@idmwx/idmui-gl3 4.0.5 → 4.0.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.
@@ -1,4 +1,4 @@
1
- (function(k,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@idmwx/idmwx-base"),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","@idmwx/idmwx-base","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],z):(k=typeof globalThis<"u"?globalThis:k||self,z(k["idm-gl"]={},k["@idmwx/idmwx-base"],k.Vue,k["@turf/turf"],k["@mapbox/sphericalmercator"],k.moment,k["mapbox-gl"],k["@idm-plugin/geo"],k.axios))})(this,function(k,z,i,$e,Ae,O,G,E,Z){"use strict";var So=Object.defineProperty;var ko=(k,z,i)=>z in k?So(k,z,{enumerable:!0,configurable:!0,writable:!0,value:i}):k[z]=i;var P=(k,z,i)=>(ko(k,typeof z!="symbol"?z+"":z,i),i);function Me(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const x=Me($e),Eo="",zo="",C=(t,e)=>{const a=t.__vccOpts||t;for(const[r,o]of e)a[r]=o;return a},We={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},toggleMenu:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","toggleVersion","menu","showLayers"],data(){return{showLayers:!1,source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...z.LayerHelper.WEATHER_LAYERS],other:[...z.LayerHelper.OTHER_LAYERS]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.6",k:"glCacheVersion"},right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(t,e){let a="layer";return e.some(r=>r.key===t.key)&&(a="layer active"),(!t.enabled||this.rampColorLayers.includes(t.key)&&this.mapProjection==="globe")&&(a="layer disabled"),a}}},watch:{showLayers:{handler(){this.$nextTick(()=>{var t,e;this.$emit("menu",this.showLayers?!1:this.toggleMenu),this.$emit("toggleVersion",Math.random()),this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}},toggleMenu:{handler(){this.$nextTick(()=>{var t,e;this.showLayers=this.toggleMenu?!1:this.showLayers,this.$emit("toggleVersion",Math.random()),this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}}},mounted(){const t=localStorage.getItem(this.version.k);this.version.v!==t&&(localStorage.removeItem(this.weatherLayersCache),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.weatherLayersCache);let a=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=a,this.autoActive&&(this.activeWeatherLayers=[...a]),e=localStorage.getItem(this.otherLayersCache),a=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=a,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(t){if(this.rampColorLayers.includes(t.key)&&this.mapProjection==="globe")return!1;this.weatherLayers.some(e=>e.key===t.key)?(this.weatherLayers=this.weatherLayers.filter(e=>e.key!==t.key),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==t.key)):this.weatherLayers.length<12&&t.enabled&&(["png","jpg"].includes(t.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json"),this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(t),this.activeWeatherLayers.push(t)),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)},handleActiveWeatherLayerPick(t){if(this.rampColorLayers.includes(t.key)&&this.mapProjection==="globe")return!1;if(this.activeWeatherLayers.some(e=>e.key===t.key))this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.key!==t.key);else if(t.enabled){this.activeWeatherLayers.push(t);for(const e of this.weatherLayers)t.weight>e.weight&&t.weight&e.weight&&this.activeWeatherLayers.push(e)}this.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source)},handleOtherLayerPick(t){this.otherLayers.some(e=>e.key===t.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==t.key):t.enabled&&this.otherLayers.push(t),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.showLayers=!this.showLayers},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("toggleVersion",Math.random())},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)},handleSourceToggle(t){this.source=t,this.handleConfirm()}}},Oe={class:"idm-gl3-layer"},je={class:"bar-item layer-bars"},Fe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],He={class:"bar-item tool-bars"},Ue=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ge=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ze=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Je=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Xe=["onClick"],qe=i.createElementVNode("div",{class:"checkbox"},null,-1),Ye=[i.createElementVNode("i",{class:"iconfont"},"",-1)],Qe={class:"weather-layers"},Ke={class:"layers-title",style:{display:"flex","align-items":"center","justify-content":"space-between"}},et={style:{"font-size":"12px"}},tt={class:"layers-body"},at=["onClick"],it=i.createElementVNode("div",{class:"checkbox"},null,-1),ot={class:"other-layers"},rt=i.createElementVNode("div",{class:"layers-title"},"Other Layers",-1),st={class:"layers-body"},nt=["onClick"],lt=i.createElementVNode("div",{class:"checkbox"},null,-1),ct={class:"source-layers"},ht=i.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1),dt={class:"layers-body model-box"};function pt(t,e,a,r,o,s){const l=i.resolveComponent("ElScrollbar");return i.openBlock(),i.createElementBlock("div",Oe,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:a.top+10+"px",right:o.right+"px"})},[i.createElementVNode("div",je,[i.createElementVNode("div",{class:i.normalizeClass(o.showLayers?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},Fe,2)])],4),i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:a.top+160+"px",right:o.right+"px"})},[i.createElementVNode("div",He,[i.createElementVNode("div",{class:i.normalizeClass(o.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...n)=>s.handleMeasureToggle&&s.handleMeasureToggle(...n))},Ue,2),i.createElementVNode("div",{class:i.normalizeClass(o.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...n)=>s.handlePointToggle&&s.handlePointToggle(...n))},Ge,2),i.createElementVNode("div",{class:i.normalizeClass(o.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...n)=>s.handleCoordToggle&&s.handleCoordToggle(...n))},Ze,2),i.createElementVNode("div",{class:i.normalizeClass(o.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...n)=>s.handle3DToggle&&s.handle3DToggle(...n))},Je,2)])],4),i.createElementVNode("div",{class:"active-layers",style:i.normalizeStyle({right:o.right+"px",bottom:"100px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.weatherLayers,n=>(i.openBlock(),i.createElementBlock("div",{key:n.key,class:i.normalizeClass(s.computeLayerClass(n,o.activeWeatherLayers)),onClick:c=>s.handleActiveWeatherLayerPick(n)},[qe,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,Xe))),128))],4),i.createElementVNode("div",{class:"available-layers flex-center",style:i.normalizeStyle({top:a.top+"px",right:o.showLayers?"0px":"-240px"})},[i.createElementVNode("div",{class:"side-bar",style:i.normalizeStyle({right:o.showLayers?"0px":"-240px"}),onClick:e[5]||(e[5]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},Ye,4),i.createElementVNode("div",{class:i.normalizeClass(["list-box",o.showLayers?"available-layers-show":""])},[i.createVNode(l,{style:{flex:"1"}},{default:i.withCtx(()=>[i.createElementVNode("div",Qe,[i.createElementVNode("div",Ke,[i.createElementVNode("div",null,[i.createTextVNode(" Weather Layers "),i.createElementVNode("span",et,"("+i.toDisplayString(o.weatherLayers.length)+"/12)",1)])]),i.createElementVNode("div",tt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather,n=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:n.key},[n.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(s.computeLayerClass(n,o.weatherLayers)),onClick:c=>s.handleWeatherLayerPick(n)},[it,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,at))],64))),128))])]),i.createElementVNode("div",ot,[rt,i.createElementVNode("div",st,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.other,n=>(i.openBlock(),i.createElementBlock("div",{key:n.key,class:i.normalizeClass(s.computeLayerClass(n,o.otherLayers)),onClick:c=>s.handleOtherLayerPick(n)},[lt,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,nt))),128))])]),i.createElementVNode("div",ct,[ht,i.createElementVNode("div",dt,[i.createElementVNode("span",{class:i.normalizeClass(o.source==="GFS"?"text active":"text"),onClick:e[6]||(e[6]=n=>s.handleSourceToggle("GFS"))},"GFS",2),i.createElementVNode("span",{class:i.normalizeClass(o.source==="CMEMS"?"text active":"text"),onClick:e[7]||(e[7]=n=>s.handleSourceToggle("CMEMS"))},"ECMWF",2)])])]),_:1})],2)],4)])}const mt=C(We,[["render",pt]]),Ro="",yt={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},weatherLayers:{type:Object}},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:x.featureCollection([]),showFeather:!1,right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var t;(t=this.wind)!=null&&t.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showFeather=!this.showParticle},immediate:!0},showFeather:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},"current.version":{handler(){var t,e,a;this.bottom=(t=this.current)!=null&&t.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((a=document.getElementsByClassName("active-layers")[0])==null?void 0:a.clientHeight)||0)+105},immediate:!0},weatherLayers:{handler(){var t,e,a;this.bottom=(t=this.current)!=null&&t.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((a=document.getElementsByClassName("active-layers")[0])==null?void 0:a.clientHeight)||0)+105},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var t,e,a,r;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const o=new Date().valueOf();let s=0,l=0,n=this.empty;if((t=this.wind)!=null&&t.active&&(n=(e=this.wind)==null?void 0:e.data),(a=this.map)!=null&&a.getSource(this.source))(r=this.map)==null||r.getSource(this.source).setData(n),l=new Date().valueOf()-(o+s),console.log("[wind] update elapsed: ",l,", total: ",s+=l);else{this.map.addSource(this.source,{type:"geojson",data:n});for(let c=0;c<(this.barbs??[]).length-1;c++){const h=(this.barbs??[])[c]||0,d=(this.barbs??[])[c+1]||0,p=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:p,type:"symbol",filter:["all",[">=","spd",h],["<","spd",d]],source:this.source,layout:{"symbol-placement":"point","icon-image":p,"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,l=new Date().valueOf()-(o+s),console.log("[wind] add elapsed: ",l,", total: ",s+=l)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const t of this.barbs??[]){const e=t<10?`00${t}kts`:t<100?`0${t}kts`:`${t}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const t of this.barbs??[]){const e=t<10?`00${t}kts`:t<100?`0${t}kts`:`${t}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},ft={key:0},ut={key:0,class:"iconfont active"},gt={key:1,class:"iconfont"},bt={key:0,class:"iconfont active"},_t={key:1,class:"iconfont"};function Lt(t,e,a,r,o,s){var l;return(l=a.wind)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",ft,[i.createElementVNode("div",{class:"flex-center tool-bars",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:o.bottom+"px"}])},[a.mapProjection==="mercator"?(i.openBlock(),i.createElementBlock("div",{key:0,class:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[a.showParticle?(i.openBlock(),i.createElementBlock("i",ut,"")):(i.openBlock(),i.createElementBlock("i",gt,"")),i.createElementVNode("span",{class:i.normalizeClass(a.showParticle?"active":"")},"Wind Particles",2)])):i.createCommentVNode("",!0),a.showParticle?(i.openBlock(),i.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>o.showFeather=!o.showFeather)},[o.showFeather?(i.openBlock(),i.createElementBlock("i",bt,"")):(i.openBlock(),i.createElementBlock("i",_t,"")),i.createElementVNode("span",{class:i.normalizeClass(o.showFeather?"active":"")},"Wind Feather",2)])):i.createCommentVNode("",!0)],4)])):i.createCommentVNode("",!0)}const wt=C(yt,[["render",Lt],["__scopeId","data-v-b6fb74d9"]]);class we{constructor(e){P(this,"map");P(this,"mercator");P(this,"rampColorLayer");P(this,"rampColorSource");P(this,"particleLayer");P(this,"particleSource");P(this,"rampColorCanvas");P(this,"particleCanvas");P(this,"ratio");this.map=e,this.mercator=new Ae,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){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(),a=this.map.getZoom()+1,r=[e._ne.lng,e._ne.lat],o=[e._sw.lng,e._sw.lat],[s,l]=this.convertNLng(r[0]),[n,c]=this.convertNLng(o[0]),[h,d]=this.mercator.px([s,r[1]],a),[p,u]=this.mercator.px([n,o[1]],a),m=Math.round(this.mercator.size*Math.pow(2,a)*(l+c));return[p,u,h+m,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[o,s,l,n]=e.map(d=>~~(d/(r*256))),c=[];for(let d=n;d<=s;d++)for(let p=o;p<=l;p++)c.push([p,d]);return c.map(d=>{const p=2**a*256;return[d[0]*p,d[1]*p,p]})}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 a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class J{createShader(e,a,r){const o=e.createShader(a);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,a,r,o,s,l,n){const c=e.createTexture();return e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,l,n,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,a,r){if(e){const o=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,o),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),o}return null}createProgram(e,a,r){const o=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,a),l=this.createShader(e,e.FRAGMENT_SHADER,r);if(o&&s&&l&&(e.attachShader(o,s),e.attachShader(o,l),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,a,r){const o=this.createProgram(e,a,r);if(o){const s={program:o},l=e.getProgramParameter(o,e.ACTIVE_ATTRIBUTES);for(let c=0;c<l;c++){const h=e.getActiveAttrib(o,c);s[h.name]=e.getAttribLocation(o,h.name)}const n=e.getProgramParameter(o,e.ACTIVE_UNIFORMS);for(let c=0;c<n;c++){const h=e.getActiveUniform(o,c);s[h.name]=e.getUniformLocation(o,h.name)}return s}}setup(e,a,r=!1,o,s){const l=document.createElement("canvas");l.width=256,l.height=1;const n=l.getContext("2d");if(n&&e){const c=n==null?void 0:n.createLinearGradient(0,0,256,0);return a.forEach(([h,d])=>{c.addColorStop(h,d)}),n.fillStyle=c,n.fillRect(0,0,256,1),{canvas:l,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(n.getImageData(0,0,256,1).data):l,o,s)}}}setupParticle(e,a=1e3){const r=Math.ceil(Math.sqrt(a)),o=r*r,s=new Uint8Array(o*4);for(let d=0;d<s.length;d++)s[d]=Math.floor(Math.random()*256);const l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),c=new Float32Array(o);for(let d=0;d<o;d++)c[d]=d;const h=this.createDataBuffer(e,"array",c);return{resolution:r,total:o,texture0:l,texture1:n,indexBuffer:h}}bind(e,a,r){const o=this.createProgram(e,a,r);if(o){const s=this.createDataBuffer(e,"array",void 0),l=e.getAttribLocation(o,"a_position");e.enableVertexAttribArray(l),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0);const n=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",n);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,a,r,o,s,l){const n=this.createProgramWrapper(e,a,r),c=this.createProgramWrapper(e,o,s),h=this.createProgramWrapper(e,o,l),d=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),p=e.createFramebuffer();return{particle:n,screen:c,update:h,quadBuffer:d,frameBuffer:p}}draw(e,a,r,o,s,l,n){var c,h;if(a&&r){e.resize(),a==null||a.viewport(0,0,(c=a==null?void 0:a.canvas)==null?void 0:c.width,(h=a==null?void 0:a.canvas)==null?void 0:h.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{const d=a.getUniformLocation(r,"u_resolution"),p=a.getUniformLocation(r,"u_image"),u=a.getUniformLocation(r,"u_color");if(a.useProgram(r),a.uniform2f(d,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o),a.uniform1i(p,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,s),a.uniform1i(u,1),n!=null&&n.uvRange&&(n!=null&&n.sRange)){const y=a.getUniformLocation(r,"u_range_u_v"),_=a.getUniformLocation(r,"u_range_s");a.uniform2f(y,n.uvRange[0],n.uvRange[1]),a.uniform2f(_,n.sRange[0],n.sRange[1])}const m=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(m,b);for(const y of f){const _=(y[0]-m[0])*e.ratio,g=(y[1]-m[3])*e.ratio,w=y[2]*e.ratio,[v,L,N,T]=[_,w+_,g,w+g],V=new Float32Array([v,N,L,N,v,T,v,T,L,N,L,T]);a.bindBuffer(a.ARRAY_BUFFER,l),a.bufferData(a.ARRAY_BUFFER,V,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,o,s){var l,n;a&&(a==null||a.viewport(0,0,(l=a==null?void 0:a.canvas)==null?void 0:l.width,(n=a==null?void 0:a.canvas)==null?void 0:n.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,o.texture0),this.renderScreen(e,a,o,s),this.updateParticles(e,a,o,s))}renderScreen(e,a,r,o){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(e,a,r,o),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const s=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=s}renderScreenTexture(e,a,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,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,o){if(a){a.useProgram(r.particle.program),a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution*e.ratio),a.uniform1f(r.particle.u_point,e.ratio);const s=e.getBoundRange();a.uniform4f(r.particle.u_viewport,s[0],s[1],s[2],s[3]),a.uniform2f(r.particle.u_factor_min,o.uvRange[0],o.uvRange[0]),a.uniform2f(r.particle.u_factor_max,o.uvRange[1],o.uvRange[1]),a.drawArrays(a.POINTS,0,r.total)}}updateParticles(e,a,r,o){var l,n;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const c=e.getBoundRange();a.uniform4f(r.update.u_viewport,c[0],c[1],c[2],c[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(l=r==null?void 0:r.image)==null?void 0:l.width,(n=r==null?void 0:r.image)==null?void 0:n.height),a.uniform2f(r.update.u_factor_min,o.uvRange[0],o.uvRange[0]),a.uniform2f(r.update.u_factor_max,o.uvRange[1],o.uvRange[1]),a.uniform1f(r.update.u_speed_factor,o.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,o.dropRate),a.uniform1f(r.update.u_drop_rate_bump,o.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const s=r.texture0;r.texture0=r.texture1,r.texture1=s}resize(e,a){e.resize();const r=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),o=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height);return{screenTexture:o,backgroundTexture:s}}async loadImg(e){return new Promise(a=>{const r=new Blob([e],{type:e.type}),o=URL.createObjectURL(r),s=new Image;s.crossOrigin="anonymous",s.src=o,s.onload=()=>a(s)})}}class I{}P(I,"vertexSchema",`
1
+ (function(k,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@idmwx/idmwx-base"),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","@idmwx/idmwx-base","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],z):(k=typeof globalThis<"u"?globalThis:k||self,z(k["idm-gl"]={},k["@idmwx/idmwx-base"],k.Vue,k["@turf/turf"],k["@mapbox/sphericalmercator"],k.moment,k["mapbox-gl"],k["@idm-plugin/geo"],k.axios))})(this,function(k,z,i,$e,Ae,A,Z,E,G){"use strict";var So=Object.defineProperty;var ko=(k,z,i)=>z in k?So(k,z,{enumerable:!0,configurable:!0,writable:!0,value:i}):k[z]=i;var P=(k,z,i)=>(ko(k,typeof z!="symbol"?z+"":z,i),i);function Me(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 x=Me($e),Eo="",zo="",C=(a,e)=>{const t=a.__vccOpts||a;for(const[r,o]of e)t[r]=o;return t},We={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},toggleMenu:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","toggleVersion","menu","showLayers"],data(){return{showLayers:!1,source:"",weatherLayers:[],activeWeatherLayers:[],autoActive:!0,otherLayers:[],layers:{weather:[...z.LayerHelper.WEATHER_LAYERS],other:[...z.LayerHelper.OTHER_LAYERS]},weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.6",k:"glCacheVersion"},right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){let t="layer";return e.some(r=>r.key===a.key)&&(t="layer active"),(!a.enabled||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t="layer disabled"),t}}},watch:{showLayers:{handler(){this.$nextTick(()=>{var a,e;this.$emit("menu",this.showLayers?!1:this.toggleMenu),this.$emit("toggleVersion",Math.random()),this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}},toggleMenu:{handler(){this.$nextTick(()=>{var a,e;this.showLayers=this.toggleMenu?!1:this.showLayers,this.$emit("toggleVersion",Math.random()),this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10})}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.weatherLayersCache);let 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)},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.$emit("weather",this.weatherLayers,this.activeWeatherLayers,this.source)},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.showLayers=!this.showLayers},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("toggleVersion",Math.random())},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)},handleSourceToggle(a){this.source=a,this.handleConfirm()}}},Oe={class:"idm-gl3-layer"},je={class:"bar-item layer-bars"},Fe=[i.createElementVNode("span",{class:"iconfont"},"",-1)],He={class:"bar-item tool-bars"},Ue=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ze=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Ge=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Je=[i.createElementVNode("span",{class:"iconfont"},"",-1)],Xe=["onClick"],qe=i.createElementVNode("div",{class:"checkbox"},null,-1),Ye=[i.createElementVNode("i",{class:"iconfont"},"",-1)],Qe={class:"weather-layers"},Ke={class:"layers-title",style:{display:"flex","align-items":"center","justify-content":"space-between"}},et={style:{"font-size":"12px"}},tt={class:"layers-body"},at=["onClick"],it=i.createElementVNode("div",{class:"checkbox"},null,-1),ot={class:"other-layers"},rt=i.createElementVNode("div",{class:"layers-title"},"Other Layers",-1),st={class:"layers-body"},nt=["onClick"],lt=i.createElementVNode("div",{class:"checkbox"},null,-1),ct={class:"source-layers"},ht=i.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1),dt={class:"layers-body model-box"};function pt(a,e,t,r,o,s){const l=i.resolveComponent("ElScrollbar");return i.openBlock(),i.createElementBlock("div",Oe,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+10+"px",right:o.right+"px"})},[i.createElementVNode("div",je,[i.createElementVNode("div",{class:i.normalizeClass(o.showLayers?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},Fe,2)])],4),i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({top:t.top+160+"px",right:o.right+"px"})},[i.createElementVNode("div",He,[i.createElementVNode("div",{class:i.normalizeClass(o.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...n)=>s.handleMeasureToggle&&s.handleMeasureToggle(...n))},Ue,2),i.createElementVNode("div",{class:i.normalizeClass(o.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...n)=>s.handlePointToggle&&s.handlePointToggle(...n))},Ze,2),i.createElementVNode("div",{class:i.normalizeClass(o.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...n)=>s.handleCoordToggle&&s.handleCoordToggle(...n))},Ge,2),i.createElementVNode("div",{class:i.normalizeClass(o.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...n)=>s.handle3DToggle&&s.handle3DToggle(...n))},Je,2)])],4),i.createElementVNode("div",{class:"active-layers",style:i.normalizeStyle({right:o.right+"px",bottom:"100px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.weatherLayers,n=>(i.openBlock(),i.createElementBlock("div",{key:n.key,class:i.normalizeClass(s.computeLayerClass(n,o.activeWeatherLayers)),onClick:c=>s.handleActiveWeatherLayerPick(n)},[qe,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,Xe))),128))],4),i.createElementVNode("div",{class:"available-layers flex-center",style:i.normalizeStyle({top:t.top+"px",right:o.showLayers?"0px":"-240px"})},[i.createElementVNode("div",{class:"side-bar",style:i.normalizeStyle({right:o.showLayers?"0px":"-240px"}),onClick:e[5]||(e[5]=(...n)=>s.handleMenuToggle&&s.handleMenuToggle(...n))},Ye,4),i.createElementVNode("div",{class:i.normalizeClass(["list-box",o.showLayers?"available-layers-show":""])},[i.createVNode(l,{style:{flex:"1"}},{default:i.withCtx(()=>[i.createElementVNode("div",Qe,[i.createElementVNode("div",Ke,[i.createElementVNode("div",null,[i.createTextVNode(" Weather Layers "),i.createElementVNode("span",et,"("+i.toDisplayString(o.weatherLayers.length)+"/12)",1)])]),i.createElementVNode("div",tt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.weather,n=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:n.key},[n.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(s.computeLayerClass(n,o.weatherLayers)),onClick:c=>s.handleWeatherLayerPick(n)},[it,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,at))],64))),128))])]),i.createElementVNode("div",ot,[rt,i.createElementVNode("div",st,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.layers.other,n=>(i.openBlock(),i.createElementBlock("div",{key:n.key,class:i.normalizeClass(s.computeLayerClass(n,o.otherLayers)),onClick:c=>s.handleOtherLayerPick(n)},[lt,i.createElementVNode("span",null,i.toDisplayString(n.name),1)],10,nt))),128))])]),i.createElementVNode("div",ct,[ht,i.createElementVNode("div",dt,[i.createElementVNode("span",{class:i.normalizeClass(o.source==="GFS"?"text active":"text"),onClick:e[6]||(e[6]=n=>s.handleSourceToggle("GFS"))},"GFS",2),i.createElementVNode("span",{class:i.normalizeClass(o.source==="CMEMS"?"text active":"text"),onClick:e[7]||(e[7]=n=>s.handleSourceToggle("CMEMS"))},"ECMWF",2)])])]),_:1})],2)],4)])}const mt=C(We,[["render",pt]]),Ro="",yt={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},weatherLayers:{type:Object}},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:x.featureCollection([]),showFeather:!1,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(){this.showFeather=!this.showParticle},immediate:!0},showFeather:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},"current.version":{handler(){var a,e,t;this.bottom=(a=this.current)!=null&&a.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+105},immediate:!0},weatherLayers:{handler(){var a,e,t;this.bottom=(a=this.current)!=null&&a.active?(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+135:(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+105},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,l=0,n=this.empty;if((a=this.wind)!=null&&a.active&&(n=(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(n),l=new Date().valueOf()-(o+s),console.log("[wind] update elapsed: ",l,", total: ",s+=l);else{this.map.addSource(this.source,{type:"geojson",data:n});for(let c=0;c<(this.barbs??[]).length-1;c++){const h=(this.barbs??[])[c]||0,d=(this.barbs??[])[c+1]||0,p=h<10?`00${h}kts`:h<100?`0${h}kts`:`${h}kts`;this.map.addLayer({id:p,type:"symbol",filter:["all",[">=","spd",h],["<","spd",d]],source:this.source,layout:{"symbol-placement":"point","icon-image":p,"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,l=new Date().valueOf()-(o+s),console.log("[wind] add elapsed: ",l,", total: ",s+=l)}}},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}}},ft={key:0},ut={key:0,class:"iconfont active"},gt={key:1,class:"iconfont"},bt={key:0,class:"iconfont active"},_t={key:1,class:"iconfont"};function Lt(a,e,t,r,o,s){var l;return(l=t.wind)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",ft,[i.createElementVNode("div",{class:"flex-center 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:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[t.showParticle?(i.openBlock(),i.createElementBlock("i",ut,"")):(i.openBlock(),i.createElementBlock("i",gt,"")),i.createElementVNode("span",{class:i.normalizeClass(t.showParticle?"active":"")},"Wind Particles",2)])):i.createCommentVNode("",!0),t.showParticle?(i.openBlock(),i.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>o.showFeather=!o.showFeather)},[o.showFeather?(i.openBlock(),i.createElementBlock("i",bt,"")):(i.openBlock(),i.createElementBlock("i",_t,"")),i.createElementVNode("span",{class:i.normalizeClass(o.showFeather?"active":"")},"Wind Feather",2)])):i.createCommentVNode("",!0)],4)])):i.createCommentVNode("",!0)}const wt=C(yt,[["render",Lt],["__scopeId","data-v-b6fb74d9"]]);class we{constructor(e){P(this,"map");P(this,"mercator");P(this,"rampColorLayer");P(this,"rampColorSource");P(this,"particleLayer");P(this,"particleSource");P(this,"rampColorCanvas");P(this,"particleCanvas");P(this,"ratio");this.map=e,this.mercator=new Ae,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,l]=this.convertNLng(r[0]),[n,c]=this.convertNLng(o[0]),[h,d]=this.mercator.px([s,r[1]],t),[p,u]=this.mercator.px([n,o[1]],t),m=Math.round(this.mercator.size*Math.pow(2,t)*(l+c));return[p,u,h+m,d]}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,l,n]=e.map(d=>~~(d/(r*256))),c=[];for(let d=n;d<=s;d++)for(let p=o;p<=l;p++)c.push([p,d]);return c.map(d=>{const p=2**t*256;return[d[0]*p,d[1]*p,p]})}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 J{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,l,n){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,l,n,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),l=this.createShader(e,e.FRAGMENT_SHADER,r);if(o&&s&&l&&(e.attachShader(o,s),e.attachShader(o,l),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},l=e.getProgramParameter(o,e.ACTIVE_ATTRIBUTES);for(let c=0;c<l;c++){const h=e.getActiveAttrib(o,c);s[h.name]=e.getAttribLocation(o,h.name)}const n=e.getProgramParameter(o,e.ACTIVE_UNIFORMS);for(let c=0;c<n;c++){const h=e.getActiveUniform(o,c);s[h.name]=e.getUniformLocation(o,h.name)}return s}}setup(e,t,r=!1,o,s){const l=document.createElement("canvas");l.width=256,l.height=1;const n=l.getContext("2d");if(n&&e){const c=n==null?void 0:n.createLinearGradient(0,0,256,0);return t.forEach(([h,d])=>{c.addColorStop(h,d)}),n.fillStyle=c,n.fillRect(0,0,256,1),{canvas:l,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(n.getImageData(0,0,256,1).data):l,o,s)}}}setupParticle(e,t=1e3){const r=Math.ceil(Math.sqrt(t)),o=r*r,s=new Uint8Array(o*4);for(let d=0;d<s.length;d++)s[d]=Math.floor(Math.random()*256);const l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,r,r),c=new Float32Array(o);for(let d=0;d<o;d++)c[d]=d;const h=this.createDataBuffer(e,"array",c);return{resolution:r,total:o,texture0:l,texture1:n,indexBuffer:h}}bind(e,t,r){const o=this.createProgram(e,t,r);if(o){const s=this.createDataBuffer(e,"array",void 0),l=e.getAttribLocation(o,"a_position");e.enableVertexAttribArray(l),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0);const n=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",n);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,l){const n=this.createProgramWrapper(e,t,r),c=this.createProgramWrapper(e,o,s),h=this.createProgramWrapper(e,o,l),d=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),p=e.createFramebuffer();return{particle:n,screen:c,update:h,quadBuffer:d,frameBuffer:p}}draw(e,t,r,o,s,l,n){var c,h;if(t&&r){e.resize(),t==null||t.viewport(0,0,(c=t==null?void 0:t.canvas)==null?void 0:c.width,(h=t==null?void 0:t.canvas)==null?void 0:h.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);try{const d=t.getUniformLocation(r,"u_resolution"),p=t.getUniformLocation(r,"u_image"),u=t.getUniformLocation(r,"u_color");if(t.useProgram(r),t.uniform2f(d,t.canvas.width*e.ratio,t.canvas.height*e.ratio),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.uniform1i(p,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s),t.uniform1i(u,1),n!=null&&n.uvRange&&(n!=null&&n.sRange)){const y=t.getUniformLocation(r,"u_range_u_v"),_=t.getUniformLocation(r,"u_range_s");t.uniform2f(y,n.uvRange[0],n.uvRange[1]),t.uniform2f(_,n.sRange[0],n.sRange[1])}const m=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(m,b);for(const y of f){const _=(y[0]-m[0])*e.ratio,g=(y[1]-m[3])*e.ratio,w=y[2]*e.ratio,[v,L,N,T]=[_,w+_,g,w+g],D=new Float32Array([v,N,L,N,v,T,v,T,L,N,L,T]);t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,D,t.STATIC_DRAW),t.drawArrays(t.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,t,r,o,s){var l,n;t&&(t==null||t.viewport(0,0,(l=t==null?void 0:t.canvas)==null?void 0:l.width,(n=t==null?void 0:t.canvas)==null?void 0:n.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 l,n;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,(l=r==null?void 0:r.image)==null?void 0:l.width,(n=r==null?void 0:r.image)==null?void 0:n.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 I{}P(I,"vertexSchema",`
2
2
  //canvas 坐标系上的坐标 (x, y)
3
3
  attribute vec2 a_position; //像素坐标
4
4
  attribute vec2 a_texCoord; //纹理坐标
@@ -40,7 +40,7 @@
40
40
  vec4 rgba = texture2D(u_image, v_texCoord);
41
41
  vec4 color = texture2D(u_color, vec2(rgba.r, 0));
42
42
  gl_FragColor = color;
43
- }`);class D{}P(D,"vertexSchema",`
43
+ }`);class V{}P(V,"vertexSchema",`
44
44
  precision mediump float;
45
45
 
46
46
  attribute float a_index; // 索引
@@ -64,7 +64,7 @@
64
64
  gl_PointSize = 1.0;
65
65
  // gl_PointSize = u_point;
66
66
  gl_Position = vec4(2.0 * v_particle_pos.x - 1.0, 1.0 - 2.0 * v_particle_pos.y, 0, 1);
67
- }`),P(D,"fragmentSchema",`
67
+ }`),P(V,"fragmentSchema",`
68
68
  precision mediump float;
69
69
 
70
70
  uniform sampler2D u_factor;
@@ -86,7 +86,7 @@
86
86
 
87
87
  float f = 1.0 - uv.b;
88
88
  gl_FragColor = texture2D(u_color_ramp, ramp_pos) * f;
89
- }`),P(D,"quadVertSchema",`
89
+ }`),P(V,"quadVertSchema",`
90
90
  precision mediump float;
91
91
 
92
92
  attribute vec2 a_pos;
@@ -96,7 +96,7 @@
96
96
  void main() {
97
97
  v_tex_pos = a_pos;
98
98
  gl_Position = vec4(1.0 - 2.0 * a_pos, 0, 1);
99
- }`),P(D,"screenFragmentSchema",`
99
+ }`),P(V,"screenFragmentSchema",`
100
100
  precision mediump float;
101
101
 
102
102
  uniform sampler2D u_screen;
@@ -108,7 +108,7 @@
108
108
  vec4 color = texture2D(u_screen, 1.0 - v_tex_pos);
109
109
  // a hack to guarantee opacity fade out even with a value close to 1.0
110
110
  gl_FragColor = vec4(floor(255.0 * color * u_opacity) / 255.0);
111
- }`),P(D,"updateFragmentSchema",`
111
+ }`),P(V,"updateFragmentSchema",`
112
112
  precision mediump float;
113
113
 
114
114
  uniform sampler2D u_particles;
@@ -186,8 +186,8 @@
186
186
  gl_FragColor = vec4(
187
187
  fract(pos * 255.0),
188
188
  floor(pos * 255.0) / 255.0);
189
- }`);class Ee{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){P(this,"token");P(this,"mapboxCustomer");P(this,"i4");P(this,"hi");P(this,"td");P(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const Bo="",xt={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:we},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 J,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[wind-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var t,e,a,r,o,s,l,n;(t=this.viewport)==null||t.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(r=(a=this.viewport)==null?void 0:a.map)==null||r.off("resize",this.handleResize),(s=(o=this.viewport)==null?void 0:o.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,D.vertexSchema,D.fragmentSchema,D.quadVertSchema,D.screenFragmentSchema,D.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,t),this.wrapper.image=t}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},X=t=>(i.pushScopeId("data-v-41a686d0"),t=t(),i.popScopeId(),t),vt={key:0},Ct=[X(()=>i.createElementVNode("span",null,"kts",-1)),X(()=>i.createElementVNode("span",null,"0",-1)),X(()=>i.createElementVNode("span",null,"5",-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)),X(()=>i.createElementVNode("span",null,"60",-1))];function St(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",vt,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},Ct,4)])):i.createCommentVNode("",!0)}const kt=C(xt,[["render",St],["__scopeId","data-v-41a686d0"]]),Uo="",Et={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number},weatherLayers:{type:Object}},emits:["particle"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:!1,right:10,bottom:95}},watch:{"current.version":{handler(){var t;(t=this.current)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showJson=!this.showParticle},immediate:!0},showJson:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},weatherLayers:{handler(){var t;this.bottom=(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+105},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"current",weight:96})},handleRender(){var t,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const a=new Date().valueOf();let r=0,o=0,s=this.empty;this.current.active&&(s=this.current.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(a+r),console.log("[current] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),o=new Date().valueOf()-(a+r),console.log("[current] add elapsed: ",o,", total: ",r+=o)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showJson?"visible":"none")},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},zt={key:0},Pt={key:0,class:"iconfont active"},Nt={key:1,class:"iconfont"},Tt={key:0,class:"iconfont active"},It={key:1,class:"iconfont"};function Vt(t,e,a,r,o,s){var l;return(l=a.current)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",zt,[i.createElementVNode("div",{class:"flex-center tool-bars",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:o.bottom+"px"}])},[a.mapProjection==="mercator"?(i.openBlock(),i.createElementBlock("div",{key:0,class:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[a.showParticle?(i.openBlock(),i.createElementBlock("i",Pt,"")):(i.openBlock(),i.createElementBlock("i",Nt,"")),i.createElementVNode("span",{class:i.normalizeClass(a.showParticle?"active":"")},"Current Particles",2)])):i.createCommentVNode("",!0),a.showParticle?(i.openBlock(),i.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>o.showJson=!o.showJson)},[o.showJson?(i.openBlock(),i.createElementBlock("i",Tt,"")):(i.openBlock(),i.createElementBlock("i",It,"")),i.createElementVNode("span",{class:i.normalizeClass(o.showJson?"active":"")},"Current",2)])):i.createCommentVNode("",!0)],4)])):i.createCommentVNode("",!0)}const Dt=C(Et,[["render",Vt],["__scopeId","data-v-ae630f43"]]),Go="",Rt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:we},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 J,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleClear(){var t,e,a,r,o,s,l,n;(t=this.viewport)==null||t.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(r=(a=this.viewport)==null?void 0:a.map)==null||r.off("resize",this.handleResize),(s=(o=this.viewport)==null?void 0:o.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.uvFragmentSchema);this.program=e,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,D.vertexSchema,D.fragmentSchema,D.quadVertSchema,D.screenFragmentSchema,D.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,12e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,t),this.wrapper.image=t}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},ae=t=>(i.pushScopeId("data-v-9115889b"),t=t(),i.popScopeId(),t),Bt={key:0},$t=[ae(()=>i.createElementVNode("span",null,"kts",-1)),ae(()=>i.createElementVNode("span",null,"0",-1)),ae(()=>i.createElementVNode("span",null,"0.4",-1)),ae(()=>i.createElementVNode("span",null,"0.8",-1)),ae(()=>i.createElementVNode("span",null,"1.6",-1)),ae(()=>i.createElementVNode("span",null,"2",-1)),ae(()=>i.createElementVNode("span",null,"3.2",-1))];function At(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Bt,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},$t,4)])):i.createCommentVNode("",!0)}const Mt=C(Rt,[["render",At],["__scopeId","data-v-9115889b"]]),Wt={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var t;(t=this.sigWave)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var t,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const a=new Date().valueOf();let r=0,o=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(a+r),console.log("[sig.wave] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(111,248,201,0.6)",3,"#6ff8c9",4,"#36cd9a",5,"#6bff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),o=new Date().valueOf()-(a+r),console.log("[sig.wave] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ot(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const jt=C(Wt,[["render",Ot]]),Ft={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:x.featureCollection([])}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var t,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const a=new Date().valueOf();let r=0,o=0,s=this.empty;this.swell.active&&(s=this.swell.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(a+r),console.log("[swell] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}M","text-size":12},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":4}}),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),o=new Date().valueOf()-(a+r),console.log("[swell] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ht(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ut=C(Ft,[["render",Ht]]),Gt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:x.featureCollection([])}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var t,e,a;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const r=new Date().valueOf();let o=0,s=0,l=this.empty;this.prmsl.active&&(l=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),s=new Date().valueOf()-(r+o),console.log("[prmsl] update elapsed: ",s,", total: ",o+=s)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},1e3),s=new Date().valueOf()-(r+o),console.log("[prmsl] add elapsed: ",s,", total: ",o+=s))}},handleMove(){var t,e;(e=(t=this.map)==null?void 0:t.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var t,e;this.activeWeatherLayers.length===0&&((e=(t=this.map)==null?void 0:t.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Zt(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Jt=C(Gt,[["render",Zt]]),Xt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:x.featureCollection([])}},watch:{"iceberg.version":{handler(){var t;(t=this.iceberg)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var t,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const a=new Date().valueOf();let r=0,o=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(a+r),console.log("[iceberg] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),o=new Date().valueOf()-(a+r),console.log("[iceberg] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function qt(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Yt=C(Xt,[["render",qt]]),er="",Qt={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String}},emits:["tropical","tropicalProbability"],data(){return{helper:z.CompanyHelper,source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:x.featureCollection([]),circleSource:"circle-source",circleSourceData:x.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(t){if(t){const e=O(t).utc();return`${e.format("MMM-DD,HHmm[Z]")} (${e==null?void 0:e.fromNow()})`}return"-"}}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){var r,o;const t=((o=(r=this.tropicals)==null?void 0:r.data)==null?void 0:o.features)||[],e=O().utc().hour(),a=[];t.forEach(s=>{var l,n,c;(l=s.properties)!=null&&l.name&&!a.includes((n=s.properties)==null?void 0:n.name)&&a.push((c=s.properties)==null?void 0:c.name)}),a.forEach(s=>{var h;let l=0,n;const c=t.filter(d=>{var p,u;return((u=(p=d.properties)==null?void 0:p.category)==null?void 0:u.split("-")[0])===s});(h=c.filter(d=>{var p,u;return((p=d.geometry)==null?void 0:p.type)==="LineString"&&((u=d.properties)==null?void 0:u.type)==="forecast"})[0])==null||h.properties.model,c.forEach((d,p)=>{var u,m,b,f,y,_;((u=d.geometry)==null?void 0:u.type)==="Point"&&((m=d.properties)==null?void 0:m.type)==="history"&&(l=p,n=n===void 0?p:n),((b=d.geometry)==null?void 0:b.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&n===void 0&&(n=p),((y=d.geometry)==null?void 0:y.type)==="LineString"&&((_=d.properties)==null||_.type)}),c.map((d,p)=>{var u,m,b,f,y,_,g,w;if(((u=d.geometry)==null?void 0:u.type)==="LineString"&&((m=d.properties)==null||m.type),((b=d.geometry)==null?void 0:b.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&(d.properties.name=s),((y=d.geometry)==null?void 0:y.type)==="Point"&&((_=d.properties)==null?void 0:_.type)==="history"){const v=((w=(g=d.properties)==null?void 0:g.format)==null?void 0:w.slice(7,12))===O().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm")+"Z";d.properties.showHistoryLabel=v||p===l,d.properties.showNameLabel=p===l,d.properties.name=s}return d})}),this.handleInit()}}},methods:{handleInit(){var t,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(t=this.map)==null||t.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var t,e,a,r,o,s,l,n,c,h;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const p=new Date().valueOf();let u=0,m=0;(t=this.map)!=null&&t.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(p+u),console.log("[tropicals] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(o=this.tropicals)==null?void 0:o.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":4,"line-opacity":.5}}),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),m=new Date().valueOf()-(p+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((n=this.map)==null||n.getSource(this.clusterSource).setData((l=this.tropicals)!=null&&l.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(p+u),console.log("[tropical] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":8,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),m=new Date().valueOf()-(p+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m))}this.handleDrawCircle();const d=E.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(d)),this.handleDateChange()}},handleClear(){var t;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(t=this.interpolateMarkers)==null||t.forEach(e=>e==null?void 0:e.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource))},handleDateChange(){var t,e,a,r,o,s,l,n,c,h,d,p,u,m,b,f,y,_,g,w,v,L,N,T,V,R,B,A,ie,oe,re,se,ne,le,ce,Q;if((t=this.interpolateMarkers)==null||t.forEach(M=>M==null?void 0:M.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const M=O(this.date).utc().set({minute:0,second:0,millisecond:0}),j=this.interpolateData.filter(S=>S.properties.date===M.format()&&!S.properties.disabled),he=this.handleComputePolygons(j),F=x.featureCollection([...j]);he.forEach(S=>{F.features.push(S)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(F):((o=this.map)==null||o.addSource(this.interpolateSource,{type:"geojson",data:F}),(s=this.map)==null||s.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const S of j)if(!S.properties.disabled){let $="#f44336";((n=(l=S.properties)==null?void 0:l.wind)==null?void 0:n.spd)<17.2||!((h=(c=S.properties)==null?void 0:c.wind)!=null&&h.spd)?$="#03f869":((p=(d=S.properties)==null?void 0:d.wind)==null?void 0:p.spd)>=17.2&&((m=(u=S.properties)==null?void 0:u.wind)==null?void 0:m.spd)<24.5?$="#f2f202":((f=(b=S.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((_=(y=S.properties)==null?void 0:y.wind)==null?void 0:_.spd)<32.7?$="#ff9100":((w=(g=S.properties)==null?void 0:g.wind)==null?void 0:w.spd)>=32.7&&((L=(v=S.properties)==null?void 0:v.wind)==null?void 0:L.spd)<41.5?$="#f44336":((T=(N=S.properties)==null?void 0:N.wind)==null?void 0:T.spd)>=41.5&&((R=(V=S.properties)==null?void 0:V.wind)==null?void 0:R.spd)<51?$="#f903d0":((A=(B=S.properties)==null?void 0:B.wind)==null?void 0:A.spd)>=51?$="#8702f9":$="#f44336";const de=`<svg t="1719918955501"
189
+ }`);class Ee{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){P(this,"token");P(this,"mapboxCustomer");P(this,"i4");P(this,"hi");P(this,"td");P(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const Bo="",xt={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:we},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 J,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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("[wind-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,r,o,s,l,n;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(r=(t=this.viewport)==null?void 0:t.map)==null||r.off("resize",this.handleResize),(s=(o=this.viewport)==null?void 0:o.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,I.vertexSchema,I.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,V.vertexSchema,V.fragmentSchema,V.quadVertSchema,V.screenFragmentSchema,V.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},X=a=>(i.pushScopeId("data-v-41a686d0"),a=a(),i.popScopeId(),a),vt={key:0},Ct=[X(()=>i.createElementVNode("span",null,"kts",-1)),X(()=>i.createElementVNode("span",null,"0",-1)),X(()=>i.createElementVNode("span",null,"5",-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)),X(()=>i.createElementVNode("span",null,"60",-1))];function St(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",vt,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ct,4)])):i.createCommentVNode("",!0)}const kt=C(xt,[["render",St],["__scopeId","data-v-41a686d0"]]),Uo="",Et={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number},weatherLayers:{type:Object}},emits:["particle"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:!1,right:10,bottom:95}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){this.showJson=!this.showParticle},immediate:!0},showJson:{handler(){this.handleToggle()},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0},weatherLayers:{handler(){var a;this.bottom=(((a=document.getElementsByClassName("active-layers")[0])==null?void 0:a.clientHeight)||0)+105},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"current",weight:96})},handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let r=0,o=0,s=this.empty;this.current.active&&(s=this.current.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(t+r),console.log("[current] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),o=new Date().valueOf()-(t+r),console.log("[current] add elapsed: ",o,", total: ",r+=o)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showJson?"visible":"none")},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},zt={key:0},Pt={key:0,class:"iconfont active"},Nt={key:1,class:"iconfont"},Tt={key:0,class:"iconfont active"},It={key:1,class:"iconfont"};function Dt(a,e,t,r,o,s){var l;return(l=t.current)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",zt,[i.createElementVNode("div",{class:"flex-center 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:"flex-start",onClick:e[0]||(e[0]=(...n)=>s.handleParticle&&s.handleParticle(...n))},[t.showParticle?(i.openBlock(),i.createElementBlock("i",Pt,"")):(i.openBlock(),i.createElementBlock("i",Nt,"")),i.createElementVNode("span",{class:i.normalizeClass(t.showParticle?"active":"")},"Current Particles",2)])):i.createCommentVNode("",!0),t.showParticle?(i.openBlock(),i.createElementBlock("div",{key:1,class:"flex-start",style:{"margin-left":"16px"},onClick:e[1]||(e[1]=n=>o.showJson=!o.showJson)},[o.showJson?(i.openBlock(),i.createElementBlock("i",Tt,"")):(i.openBlock(),i.createElementBlock("i",It,"")),i.createElementVNode("span",{class:i.normalizeClass(o.showJson?"active":"")},"Current",2)])):i.createCommentVNode("",!0)],4)])):i.createCommentVNode("",!0)}const Vt=C(Et,[["render",Dt],["__scopeId","data-v-ae630f43"]]),Zo="",Rt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:we},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 J,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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("[current-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,r,o,s,l,n;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(r=(t=this.viewport)==null?void 0:t.map)==null||r.off("resize",this.handleResize),(s=(o=this.viewport)==null?void 0:o.map)==null||s.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,I.vertexSchema,I.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,V.vertexSchema,V.fragmentSchema,V.quadVertSchema,V.screenFragmentSchema,V.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,12e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},ae=a=>(i.pushScopeId("data-v-9115889b"),a=a(),i.popScopeId(),a),Bt={key:0},$t=[ae(()=>i.createElementVNode("span",null,"kts",-1)),ae(()=>i.createElementVNode("span",null,"0",-1)),ae(()=>i.createElementVNode("span",null,"0.4",-1)),ae(()=>i.createElementVNode("span",null,"0.8",-1)),ae(()=>i.createElementVNode("span",null,"1.6",-1)),ae(()=>i.createElementVNode("span",null,"2",-1)),ae(()=>i.createElementVNode("span",null,"3.2",-1))];function At(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Bt,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},$t,4)])):i.createCommentVNode("",!0)}const Mt=C(Rt,[["render",At],["__scopeId","data-v-9115889b"]]),Wt={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var a;(a=this.sigWave)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const t=new Date().valueOf();let r=0,o=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(t+r),console.log("[sig.wave] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(111,248,201,0.6)",3,"#6ff8c9",4,"#36cd9a",5,"#6bff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),o=new Date().valueOf()-(t+r),console.log("[sig.wave] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ot(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const jt=C(Wt,[["render",Ot]]),Ft={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:x.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let r=0,o=0,s=this.empty;this.swell.active&&(s=this.swell.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(t+r),console.log("[swell] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}M","text-size":12},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":4}}),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),o=new Date().valueOf()-(t+r),console.log("[swell] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ht(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ut=C(Ft,[["render",Ht]]),Zt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:x.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const r=new Date().valueOf();let o=0,s=0,l=this.empty;this.prmsl.active&&(l=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),s=new Date().valueOf()-(r+o),console.log("[prmsl] update elapsed: ",s,", total: ",o+=s)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(t=this.map)==null||t.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},1e3),s=new Date().valueOf()-(r+o),console.log("[prmsl] add elapsed: ",s,", total: ",o+=s))}},handleMove(){var a,e;(e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var a,e;this.activeWeatherLayers.length===0&&((e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Gt(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Jt=C(Zt,[["render",Gt]]),Xt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:x.featureCollection([])}},watch:{"iceberg.version":{handler(){var a;(a=this.iceberg)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const t=new Date().valueOf();let r=0,o=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),o=new Date().valueOf()-(t+r),console.log("[iceberg] update elapsed: ",o,", total: ",r+=o)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),o=new Date().valueOf()-(t+r),console.log("[iceberg] add elapsed: ",o,", total: ",r+=o))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function qt(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Yt=C(Xt,[["render",qt]]),er="",Qt={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:z.CompanyHelper,source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:x.featureCollection([]),circleSource:"circle-source",circleSourceData:x.featureCollection([]),circleLayer:"tropical-circle-layer"}},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} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var r,o;const a=((o=(r=this.tropicals)==null?void 0:r.data)==null?void 0:o.features)||[],e=A().utc().hour(),t=[];a.forEach(s=>{var l,n,c;(l=s.properties)!=null&&l.name&&!t.includes((n=s.properties)==null?void 0:n.name)&&t.push((c=s.properties)==null?void 0:c.name)}),t.forEach(s=>{var h;let l=0,n;const c=a.filter(d=>{var p,u;return((u=(p=d.properties)==null?void 0:p.category)==null?void 0:u.split("-")[0])===s});(h=c.filter(d=>{var p,u;return((p=d.geometry)==null?void 0:p.type)==="LineString"&&((u=d.properties)==null?void 0:u.type)==="forecast"})[0])==null||h.properties.model,c.forEach((d,p)=>{var u,m,b,f,y,_;((u=d.geometry)==null?void 0:u.type)==="Point"&&((m=d.properties)==null?void 0:m.type)==="history"&&(l=p,n=n===void 0?p:n),((b=d.geometry)==null?void 0:b.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&n===void 0&&(n=p),((y=d.geometry)==null?void 0:y.type)==="LineString"&&((_=d.properties)==null||_.type)}),c.map((d,p)=>{var u,m,b,f,y,_,g;if(((u=d.geometry)==null?void 0:u.type)==="LineString"&&((m=d.properties)==null||m.type),((b=d.geometry)==null?void 0:b.type)==="Point"&&((f=d.properties)==null?void 0:f.type)==="forecast"&&(d.properties.name=s,d.properties.format=A(d.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((y=d.geometry)==null?void 0:y.type)==="Point"&&((_=d.properties)==null?void 0:_.type)==="history"){d.properties.format=A(d.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const w=A((g=d.properties)==null?void 0:g.date).utc().format("HHmm")===A().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");d.properties.showHistoryLabel=w||p===l,d.properties.showNameLabel=p===l,d.properties.name=s}return d})}),this.handleInit()},handleInit(){var a,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,e,t,r,o,s,l,n,c,h;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const p=new Date().valueOf();let u=0,m=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(p+u),console.log("[tropicals] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(o=this.tropicals)==null?void 0:o.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":4,"line-opacity":.5}}),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),m=new Date().valueOf()-(p+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((n=this.map)==null||n.getSource(this.clusterSource).setData((l=this.tropicals)!=null&&l.active?this.tropicals.data:this.empty),m=new Date().valueOf()-(p+u),console.log("[tropical] update elapsed: ",m,", total: ",u+=m)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":8,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),m=new Date().valueOf()-(p+u),console.log("[tropical] add elapsed: ",m,", total: ",u+=m))}this.handleDrawCircle();const d=E.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(d)),this.handleDateChange()}},handleClear(){var a;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(a=this.interpolateMarkers)==null||a.forEach(e=>e==null?void 0:e.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource))},handleDateChange(){var a,e,t,r,o,s,l,n,c,h,d,p,u,m,b,f,y,_,g,w,v,L,N,T,D,R,B,M,ie,oe,re,se,ne,le,ce,Q;if((a=this.interpolateMarkers)==null||a.forEach(W=>W==null?void 0:W.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const W=A(this.date).utc().set({minute:0,second:0,millisecond:0}),j=this.interpolateData.filter(S=>S.properties.date===W.format()&&!S.properties.disabled),he=this.handleComputePolygons(j),F=x.featureCollection([...j]);he.forEach(S=>{F.features.push(S)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(F):((o=this.map)==null||o.addSource(this.interpolateSource,{type:"geojson",data:F}),(s=this.map)==null||s.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const S of j)if(!S.properties.disabled){let $="#f44336";((n=(l=S.properties)==null?void 0:l.wind)==null?void 0:n.spd)<17.2||!((h=(c=S.properties)==null?void 0:c.wind)!=null&&h.spd)?$="#03f869":((p=(d=S.properties)==null?void 0:d.wind)==null?void 0:p.spd)>=17.2&&((m=(u=S.properties)==null?void 0:u.wind)==null?void 0:m.spd)<24.5?$="#f2f202":((f=(b=S.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((_=(y=S.properties)==null?void 0:y.wind)==null?void 0:_.spd)<32.7?$="#ff9100":((w=(g=S.properties)==null?void 0:g.wind)==null?void 0:w.spd)>=32.7&&((L=(v=S.properties)==null?void 0:v.wind)==null?void 0:L.spd)<41.5?$="#f44336":((T=(N=S.properties)==null?void 0:N.wind)==null?void 0:T.spd)>=41.5&&((R=(D=S.properties)==null?void 0:D.wind)==null?void 0:R.spd)<51?$="#f903d0":((M=(B=S.properties)==null?void 0:B.wind)==null?void 0:M.spd)>=51?$="#8702f9":$="#f44336";const de=`<svg t="1719918955501"
191
191
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
192
192
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
193
193
  <path
@@ -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"}">${de}</div>`;const pe=new G.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(pe),(ie=S.properties)!=null&&ie.showCircle){const K={radius:100,coordinates:S.geometry.coordinates},ee={radius:200,coordinates:S.geometry.coordinates},te={radius:500,coordinates:S.geometry.coordinates};(oe=this.circleSourceData)==null||oe.features.push(x.circle(K.coordinates,K.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(re=this.circleSourceData)==null||re.features.push(x.circle(ee.coordinates,ee.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(se=this.circleSourceData)==null||se.features.push(x.circle(te.coordinates,te.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(le=(ne=this.map)==null?void 0:ne.getSource(this.circleSource))==null||le.setData(this.circleSourceData)}}else(ce=this.map)!=null&&ce.getSource(this.interpolateSource)&&((Q=this.map)==null||Q.getSource(this.interpolateSource).setData(this.empty))},handleClick(t){var s,l,n,c,h,d,p,u;const e=t.features[0],a=(l=(s=this.tropicals)==null?void 0:s.data)==null?void 0:l.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="forecast"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});a.sort((m,b)=>{var f,y,_,g;return((f=m.properties)==null?void 0:f.model)==="cma"?-1:((y=m.properties)==null?void 0:y.model)==="jma"?((_=b.properties)==null?void 0:_.model)==="cma"?1:-1:m.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="history"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(h=e==null?void 0:e.properties)==null?void 0:h.name,forecasts:a.map(m=>m.properties),history:(d=r[0])==null?void 0:d.properties,showCircle:(u=(p=a[0])==null?void 0:p.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const o=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([t.lngLat.lng,t.lngLat.lat]):this.activeTropicalsMarker=new G.Marker(o).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(t){var r,o,s,l,n,c;t.disabled=!t.disabled;const e=`${t.name}-${t.model}`,a=(o=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:o.features;a.forEach(h=>{h.properties.category===e&&(h.properties.disabled=t.disabled)}),this.interpolateData.forEach(h=>{h.properties.category===e&&(h.properties.disabled=t.disabled)}),(l=(s=this.map)==null?void 0:s.getSource(this.source))==null||l.setData(x.featureCollection(a)),(c=(n=this.map)==null?void 0:n.getSource(this.clusterSource))==null||c.setData(x.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(t){this.$emit("tropicalProbability",t)},handleToggleCircles(t){var e,a;t.showCircle=!t.showCircle,(a=(e=this.tropicals.data)==null?void 0:e.features)==null||a.forEach(r=>{r.properties.name===t.name&&(r.properties.showCircle=t.showCircle)}),this.handleRender()},handleDrawCircle(){var t,e;(t=this.map)!=null&&t.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(t){const e=[];for(const a of t){const r=a.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(a.geometry.coordinates,o,{...a.properties,level:7});e.push(s);const l={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},n=this.handleComputeArc(a.geometry.coordinates,l,{...a.properties,level:10});e.push(n)}return e},handleComputeArc(t,e,a){var s;const r=[];for(const l in e){const n=e[l]??0;let c;switch(l){case"ne":c=x.lineArc(t,n*1.852,0,90,{steps:n>0?64:1});break;case"se":c=x.lineArc(t,n*1.852,90,180,{steps:n>0?64:1});break;case"sw":c=x.lineArc(t,n*1.852,180,270,{steps:n>0?64:1});break;case"nw":c=x.lineArc(t,n*1.852,270,360,{steps:n>0?64:1});break}r.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const o=x.lineString(r);return x.lineToPolygon(o,{properties:a})}}},ve=t=>(i.pushScopeId("data-v-b5b42393"),t=t(),i.popScopeId(),t),Kt={id:"active-tropical",class:"active-tropical"},ea={class:"header-box"},ta={class:"main"},aa={key:0},ia={class:"sub"},oa={id:"meteoBox",class:"main-box"},ra={class:"content"},sa={class:"row"},na={class:"col col-left",style:{"justify-content":"flex-start"}},la=ve(()=>i.createElementVNode("label",null,"Wind speed : ",-1)),ca={class:"col col-right",style:{"justify-content":"flex-start"}},ha=ve(()=>i.createElementVNode("label",null,"Pressure : ",-1)),da={class:"row"},pa={class:"col col-24",style:{"justify-content":"flex-start"}},ma=ve(()=>i.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),ya={class:"forecast-models"},fa=["onClick"],ua=i.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-b5b42393></div><div class="row" style="padding:2px 10px;" data-v-b5b42393><div class="legend" data-v-b5b42393><div class="icon td" data-v-b5b42393></div><div class="label" data-v-b5b42393>TD</div></div><div class="legend" data-v-b5b42393><div class="icon ts" data-v-b5b42393></div><div class="label" data-v-b5b42393>TS</div></div><div class="legend" data-v-b5b42393><div class="icon sts" data-v-b5b42393></div><div class="label" data-v-b5b42393>STS</div></div><div class="legend" data-v-b5b42393><div class="icon ty" data-v-b5b42393></div><div class="label" data-v-b5b42393>TY</div></div><div class="legend" data-v-b5b42393><div class="icon sty" data-v-b5b42393></div><div class="label" data-v-b5b42393>STY</div></div><div class="legend" data-v-b5b42393><div class="icon supper-ty" data-v-b5b42393></div><div class="label" data-v-b5b42393>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-b5b42393><div class="legend" data-v-b5b42393><div class="icon history" data-v-b5b42393></div><div class="label" data-v-b5b42393>History</div></div><div class="legend" data-v-b5b42393><div class="icon r7" data-v-b5b42393></div><div class="label" data-v-b5b42393>35kts Radii</div></div><div class="legend" data-v-b5b42393><div class="icon r10" data-v-b5b42393></div><div class="label" data-v-b5b42393>50kts Radii</div></div></div>',3),ga={class:"more"};function ba(t,e,a,r,o,s){var l,n,c,h,d,p,u,m,b,f,y,_,g,w,v;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Kt,[i.createElementVNode("div",ea,[i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=L=>o.showTropicals=!1)},""),i.createElementVNode("div",ta,[(n=(l=o.activeTropicals)==null?void 0:l.history)!=null&&n.level?(i.openBlock(),i.createElementBlock("span",aa,i.toDisplayString((h=(c=o.activeTropicals)==null?void 0:c.history)==null?void 0:h.level)+" , ",1)):i.createCommentVNode("",!0),i.createTextVNode(i.toDisplayString((d=o.activeTropicals)==null?void 0:d.name),1)]),i.createElementVNode("div",ia," Last update: "+i.toDisplayString(s.computeTime(((u=(p=o.activeTropicals)==null?void 0:p.history)==null?void 0:u.updated)||((f=(b=(m=o.activeTropicals)==null?void 0:m.forecasts)==null?void 0:b.filter(L=>!L.disabled)[0])==null?void 0:f.date))),1)]),i.createElementVNode("div",oa,[i.createElementVNode("div",ra,[i.createElementVNode("div",sa,[i.createElementVNode("div",na,[la,i.createElementVNode("span",null,i.toDisplayString(((_=(y=o.activeTropicals)==null?void 0:y.history)==null?void 0:_.kts)||"-")+"[kts]",1)]),i.createElementVNode("div",ca,[ha,i.createElementVNode("span",null,i.toDisplayString(((w=(g=o.activeTropicals)==null?void 0:g.history)==null?void 0:w.pressure)||"-")+"[hPa]",1)])]),i.createElementVNode("div",da,[i.createElementVNode("div",pa,[ma,i.createElementVNode("div",ya,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList((v=o.activeTropicals)==null?void 0:v.forecasts,(L,N)=>{var T,V,R,B;return i.openBlock(),i.createElementBlock("div",{key:N,class:i.normalizeClass(["model",L.disabled?"":"active",N>0&&N<((V=(T=o.activeTropicals)==null?void 0:T.forecasts)==null?void 0:V.length)-1&&((B=(R=o.activeTropicals)==null?void 0:R.forecasts)==null?void 0:B.length)>2?"center-child":""]),onClick:A=>s.handleForecastToggle(L)},[i.createElementVNode("span",{class:i.normalizeClass(L.model)},i.toDisplayString(L.model),3)],10,fa)}),128))])])]),ua]),i.createElementVNode("div",ga,[i.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=L=>s.handleStrikeProbability(o.activeTropicals))},"Strike Probability >>")])])],512)),[[i.vShow,o.showTropicals&&!t.$attrs.hideTropicalsLegend]])}const Ce=C(Qt,[["render",ba],["__scopeId","data-v-b5b42393"]]),tr="",_a={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 J,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},q=t=>(i.pushScopeId("data-v-dec867b8"),t=t(),i.popScopeId(),t),La={key:0},wa=[q(()=>i.createElementVNode("span",null,"mm",-1)),q(()=>i.createElementVNode("span",null,"1.5",-1)),q(()=>i.createElementVNode("span",null,"2",-1)),q(()=>i.createElementVNode("span",null,"3",-1)),q(()=>i.createElementVNode("span",null,"7",-1)),q(()=>i.createElementVNode("span",null,"10",-1)),q(()=>i.createElementVNode("span",null,"20",-1)),q(()=>i.createElementVNode("span",null,"30",-1))];function xa(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",La,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},wa,4)])):i.createCommentVNode("",!0)}const va=C(_a,[["render",xa],["__scopeId","data-v-dec867b8"]]),hr="",Ca={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 J,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},me=t=>(i.pushScopeId("data-v-952dee5c"),t=t(),i.popScopeId(),t),Sa={key:0},ka=[me(()=>i.createElementVNode("span",null,"nm",-1)),me(()=>i.createElementVNode("span",null,"0",-1)),me(()=>i.createElementVNode("span",null,"0.5",-1)),me(()=>i.createElementVNode("span",null,"1.5",-1)),me(()=>i.createElementVNode("span",null,"3",-1)),me(()=>i.createElementVNode("span",null,"9",-1))];function Ea(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Sa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:t.right+"px",bottom:a.bottom}])},ka,4)])):i.createCommentVNode("",!0)}const za=C(Ca,[["render",Ea],["__scopeId","data-v-952dee5c"]]),gr="",Pa={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 J,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ye=t=>(i.pushScopeId("data-v-67e5094b"),t=t(),i.popScopeId(),t),Na={key:0},Ta=[ye(()=>i.createElementVNode("span",null,"°C",-1)),ye(()=>i.createElementVNode("span",null,"0",-1)),ye(()=>i.createElementVNode("span",null,"10",-1)),ye(()=>i.createElementVNode("span",null,"20",-1)),ye(()=>i.createElementVNode("span",null,"30",-1)),ye(()=>i.createElementVNode("span",null,"40",-1))];function Ia(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Na,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},Ta,4)])):i.createCommentVNode("",!0)}const Va=C(Pa,[["render",Ia],["__scopeId","data-v-67e5094b"]]),Cr="",Da={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 J,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Y=t=>(i.pushScopeId("data-v-389ea886"),t=t(),i.popScopeId(),t),Ra={key:0},Ba=[Y(()=>i.createElementVNode("span",null,"°C",-1)),Y(()=>i.createElementVNode("span",null,"-20",-1)),Y(()=>i.createElementVNode("span",null,"-10",-1)),Y(()=>i.createElementVNode("span",null,"0",-1)),Y(()=>i.createElementVNode("span",null,"10",-1)),Y(()=>i.createElementVNode("span",null,"20",-1)),Y(()=>i.createElementVNode("span",null,"30",-1)),Y(()=>i.createElementVNode("span",null,"40",-1))];function $a(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Ra,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},Ba,4)])):i.createCommentVNode("",!0)}const Aa=C(Da,[["render",$a],["__scopeId","data-v-389ea886"]]),Vr="",Ma={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 J,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,I.vertexSchema,I.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},fe=t=>(i.pushScopeId("data-v-db805141"),t=t(),i.popScopeId(),t),Wa={key:0},Oa=[fe(()=>i.createElementVNode("span",null,"m",-1)),fe(()=>i.createElementVNode("span",null,"0",-1)),fe(()=>i.createElementVNode("span",null,"0.5",-1)),fe(()=>i.createElementVNode("span",null,"1",-1)),fe(()=>i.createElementVNode("span",null,"1.5",-1)),fe(()=>i.createElementVNode("span",null,"2",-1))];function ja(t,e,a,r,o,s){var l;return(l=a.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Wa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:a.bottom}])},Oa,4)])):i.createCommentVNode("",!0)}const Fa=C(Ma,[["render",ja],["__scopeId","data-v-db805141"]]),Wr="",Ha={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:z.CompanyHelper}},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(t){return t?`${O(t).utc().format("MMM-DD,HHmm[Z]")}`:"-"}},computeLat(){return function(t,e=4){return E.LngLatHelper.lat2pretty(t,e).pretty}},computeLng(){return function(t,e=4){return E.LngLatHelper.lng2pretty(t,e).pretty}},roundPrecision(){return function(t,e=4){return isNaN(t)?"-":E.LngLatHelper.roundPrecision(t,e)}}},methods:{handleBind(){var t,e;this.show?(t=this.map)==null||t.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(t){t.originalEvent.stopPropagation();const e=t.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",t.lngLat)},handleRender(){var t;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(t=this.meteoMarker)==null||t.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new G.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},W=t=>(i.pushScopeId("data-v-ef7fa87d"),t=t(),i.popScopeId(),t),Ua={id:"point-meteo",class:"point-meteo"},Ga={class:"meteo-box"},Za={class:"header-box"},Ja={class:"main"},Xa={class:"sub"},qa={class:"main-box"},Ya={class:"flex-space"},Qa=W(()=>i.createElementVNode("label",null,"Wind",-1)),Ka={class:"flex-space"},ei=W(()=>i.createElementVNode("label",null,"Wind.Wave",-1)),ti={class:"flex-space"},ai=W(()=>i.createElementVNode("label",null,"Swell",-1)),ii={class:"flex-space"},oi=W(()=>i.createElementVNode("label",null,"Sig.Wave",-1)),ri={class:"flex-space"},si=W(()=>i.createElementVNode("label",null,"Current",-1)),ni={class:"flex-space"},li=W(()=>i.createElementVNode("label",null,"Precip",-1)),ci={class:"flex-space"},hi=W(()=>i.createElementVNode("label",null,"Visibility",-1)),di={class:"flex-space"},pi=W(()=>i.createElementVNode("label",null,"Temp",-1)),mi={class:"flex-space"},yi=W(()=>i.createElementVNode("label",null,"Water Temp",-1)),fi={key:0,class:"flex-space",style:{"justify-content":"flex-end"}},ui=[W(()=>i.createElementVNode("span",{class:"more"},"More >>",-1))];function gi(t,e,a,r,o,s){var l,n,c,h,d,p,u,m,b,f,y,_,g,w,v,L,N,T,V,R,B,A,ie,oe,re,se,ne,le,ce,Q,M,j,he,F,S,$,de,H,pe,K,ee,te,ue,ge,be,_e,Le;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Ua,[i.createElementVNode("div",Ga,[i.createElementVNode("div",Za,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=ke=>o.showMeteo=!1)},""),i.createElementVNode("div",Ja,i.toDisplayString(s.computeLat((l=a.meteo)==null?void 0:l.lat))+","+i.toDisplayString(s.computeLng((n=a.meteo)==null?void 0:n.lng)),1),i.createElementVNode("div",Xa,i.toDisplayString(s.computeTime((c=a.meteo)==null?void 0:c.utc)),1)]),i.createElementVNode("div",qa,[i.createElementVNode("div",Ya,[Qa,i.createElementVNode("span",null,i.toDisplayString(((d=(h=a.meteo)==null?void 0:h.wind)==null?void 0:d.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((u=(p=a.meteo)==null?void 0:p.wind)==null?void 0:u.kts,1))+"[kts]/"+i.toDisplayString((b=(m=a.meteo)==null?void 0:m.wind)==null?void 0:b.scale)+"[BF]/"+i.toDisplayString(s.roundPrecision((y=(f=a.meteo)==null?void 0:f.gusts)==null?void 0:y.kts,1))+"[kts]",1)]),i.createElementVNode("div",Ka,[ei,i.createElementVNode("span",null,i.toDisplayString(((w=(g=(_=a.meteo)==null?void 0:_.wave)==null?void 0:g.wd)==null?void 0:w.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((N=(L=(v=a.meteo)==null?void 0:v.wave)==null?void 0:L.wd)==null?void 0:N.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((R=(V=(T=a.meteo)==null?void 0:T.wave)==null?void 0:V.wd)==null?void 0:R.period,1))+"[s]",1)]),i.createElementVNode("div",ti,[ai,i.createElementVNode("span",null,i.toDisplayString(((ie=(A=(B=a.meteo)==null?void 0:B.wave)==null?void 0:A.swell)==null?void 0:ie.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((se=(re=(oe=a.meteo)==null?void 0:oe.wave)==null?void 0:re.swell)==null?void 0:se.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((ce=(le=(ne=a.meteo)==null?void 0:ne.wave)==null?void 0:le.swell)==null?void 0:ce.period,1))+"[s]",1)]),i.createElementVNode("div",ii,[oi,i.createElementVNode("span",null,i.toDisplayString(((j=(M=(Q=a.meteo)==null?void 0:Q.wave)==null?void 0:M.sig)==null?void 0:j.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((S=(F=(he=a.meteo)==null?void 0:he.wave)==null?void 0:F.sig)==null?void 0:S.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((H=(de=($=a.meteo)==null?void 0:$.wave)==null?void 0:de.sig)==null?void 0:H.period,1))+"[s]",1)]),i.createElementVNode("div",ri,[si,i.createElementVNode("span",null,i.toDisplayString(((K=(pe=a.meteo)==null?void 0:pe.current)==null?void 0:K.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((te=(ee=a.meteo)==null?void 0:ee.current)==null?void 0:te.kts,2))+"[kts]",1)]),i.createElementVNode("div",ni,[li,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((ge=(ue=a.meteo)==null?void 0:ue.precip)==null?void 0:ge.inter6h,2))+"[mm]",1)]),i.createElementVNode("div",ci,[hi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision(((be=a.meteo)==null?void 0:be.visibility)/1852,0))+"[nm]",1)]),i.createElementVNode("div",di,[pi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((_e=a.meteo)==null?void 0:_e.temp,0))+"[°C]",1)]),i.createElementVNode("div",mi,[yi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((Le=a.meteo)==null?void 0:Le.waterTemp,2))+"[°C]",1)])]),t.$attrs.permission&o.helper.LEVEL.Prime?(i.openBlock(),i.createElementBlock("div",fi,ui)):i.createCommentVNode("",!0)])],512)),[[i.vShow,o.showMeteo]])}const bi=C(Ha,[["render",gi],["__scopeId","data-v-ef7fa87d"]]),_i={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 Li(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const wi=C(_i,[["render",Li]]),xi={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 vi(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ci=C(xi,[["render",vi]]),Si={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 t;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(t=this.map)==null||t.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 ki(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ei=C(Si,[["render",ki]]),jr="",zi={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 t,e;this.zone?(this.handleRender(),(t=this.map)==null||t.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(t){var r;const e=t.features[0],a=(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];a&&(this.showZone=!0,this.form={...a.properties})},handleRender(){var t;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(t=this.map)==null||t.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":.1,"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":.1,"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":.1},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)}}},Pi={id:"zone-info"},Ni=["innerHTML"];function Ti(t,e,a,r,o,s){var l;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pi,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=n=>o.showZone=!1)},""),i.createElementVNode("div",{class:"rich-context",innerHTML:(l=o.form)==null?void 0:l.name},null,8,Ni)],512)),[[i.vShow,o.showZone]])}const Ii=C(zi,[["render",Ti],["__scopeId","data-v-c0864afc"]]),Fr="",Vi={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(t){return E.LngLatHelper.lat2pretty(t,4).pretty}},computeLng(){return function(t){return E.LngLatHelper.lng2pretty(t,4).pretty}}},watch:{port:{handler(){var t,e;this.port?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(t){var r;const e=t.features[0],a=(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(a){this.showPort=!0,this.form={...a.properties},this.form.lng=a.geometry.coordinates[0],this.form.lat=a.geometry.coordinates[1];const o=document.getElementById("port-info");this.marker?this.marker.setLngLat([t.lngLat.lng,t.lngLat.lat]):this.marker=new G.Marker(o).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var t;this.map?this.port&&(this.map.getSource(this.source)?(t=this.map)==null||t.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)}}},xe=t=>(i.pushScopeId("data-v-4ab013cc"),t=t(),i.popScopeId(),t),Di={id:"port-info"},Ri={class:"port-box"},Bi={class:"flex-start"},$i=xe(()=>i.createElementVNode("label",null,"Name : ",-1)),Ai={class:"flex-start"},Mi=xe(()=>i.createElementVNode("label",null,"Position : ",-1)),Wi={class:"flex-start"},Oi=xe(()=>i.createElementVNode("label",null,"LoCode : ",-1)),ji={class:"flex-start",style:{"align-items":"flex-start"}},Fi=xe(()=>i.createElementVNode("label",null,"Region : ",-1));function Hi(t,e,a,r,o,s){return i.withDirectives((i.openBlock(),i.createElementBlock("div",Di,[i.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=l=>o.showPort=!1)},""),i.createElementVNode("div",Ri,[i.createElementVNode("div",Bi,[$i,i.createElementVNode("span",{onClick:e[1]||(e[1]=(...l)=>s.handleEmit&&s.handleEmit(...l))},i.toDisplayString(o.form.name),1)]),i.createElementVNode("div",Ai,[Mi,i.createElementVNode("span",null,i.toDisplayString(s.computeLat(o.form.lat))+", "+i.toDisplayString(s.computeLng(o.form.lng)),1)]),i.createElementVNode("div",Wi,[Oi,i.createElementVNode("span",null,i.toDisplayString(o.form.loCode||"-"),1)]),i.createElementVNode("div",ji,[Fi,i.createElementVNode("span",null,i.toDisplayString(o.form.city||"-")+", "+i.toDisplayString(o.form.country||"-"),1)])])],512)),[[i.vShow,o.showPort]])}const Ui=C(Vi,[["render",Hi],["__scopeId","data-v-4ab013cc"]]),Gi={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 Zi(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ji=C(Gi,[["render",Zi]]),Xi={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 qi(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Yi=C(Xi,[["render",qi]]),Qi={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 Ki(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const eo=C(Qi,[["render",Ki]]),to={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(t=>{t.geometry.type==="Polygon"&&t.geometry.coordinates.forEach(e=>E.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 ao(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const io=C(to,[["render",ao]]),oo={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 ro(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const so=C(oo,[["render",ro]]),Hr="",no={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 t;this.map&&((t=this.map)==null||t.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var t,e,a;this.right=(((t=document.getElementsByClassName("legend-bars")[0])==null?void 0:t.clientWidth)||-10)+(((e=document.getElementsByClassName("available-layers-show")[0])==null?void 0:e.clientWidth)||0)+(((a=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:a.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var t,e;this.show?((t=this.map)==null||t.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(t){const e=t.lngLat,a=E.LngLatHelper.lng2pretty(e.lng,2),r=E.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:a,lat:r}},handleComputeLatLngs(){var r;const t=(r=this.map)==null?void 0:r.getZoom();console.log(t);let e=30;t>4?e=10:t>3&&(e=15);const a=[];for(let o=-60;o<90;o+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,o],[180,o]]}});for(let o=-180;o<180;o+=e)a.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)a.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 a},handleZoomEnd(){var e;const t=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(x.featureCollection(t))},handleRender(){if(this.map){const t=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"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 t,e,a,r,o,s;(t=this.map)!=null&&t.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(o=this.map)!=null&&o.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}},lo=(t=>(i.pushScopeId("data-v-7367f59b"),t=t(),i.popScopeId(),t))(()=>i.createElementVNode("span",null,", ",-1));function co(t,e,a,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:a.bottom})},[i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lat.pretty),1),lo,i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lng.pretty),1)],4)):i.createCommentVNode("",!0)}const Se=C(no,[["render",co],["__scopeId","data-v-7367f59b"]]),ho={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 t,e,a,r,o,s,l,n,c,h;if(this.show)(t=this.map)==null||t.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(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),(l=this.map)==null||l.off("mousemove",this.handleMove),(n=this.map)==null||n.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(h=this.map)==null||h.off("contextmenu",this.handleContextmenu);for(const d of this.geojson)this.handleClear(d,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(t){if(t.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const a=this.geojson.at(-1).features.filter(r=>r.geometry.type==="Point");a.length&&(a.at(-1).properties.mode=this.navigation)}},handleDrag(t){var a,r,o,s,l,n,c,h,d,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var _;return((_=y._element)==null?void 0:_.id)===e})[0].setLngLat([(s=(o=t.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(n=(l=t.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);let b;u.features.forEach((y,_)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=_;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(h=(c=t.target)==null?void 0:c._lngLat)==null?void 0:h.lng,lat:(p=(d=t.target)==null?void 0:d._lngLat)==null?void 0:p.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(t){var a,r,o,s,l,n,c,h,d,p;const e=(r=(a=t.target)==null?void 0:a._element)==null?void 0:r.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(o=t.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(n=(l=t.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(h=(c=t.target)==null?void 0:c._lngLat)==null?void 0:h.lng,(p=(d=t.target)==null?void 0:d._lngLat)==null?void 0:p.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(t){var a,r,o,s;t.preventDefault(),(a=this.contextmenu)==null||a.remove();const e=(s=(o=(r=t.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 n=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(n.length>2&&n.filter(h=>h.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const h=document.createElement("div");h.className="point-contextmenu-marker",h.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new G.Marker(h).setOffset([24,0]).setLngLat([t.lngLat.lng,t.lngLat.lat]).addTo(this.map)}}},handleClick(t){var a,r,o,s,l;(a=this.contextmenu)==null||a.remove();const e=t.originalEvent.target.className;if(e==="marker-close"){const n=(o=(r=t.originalEvent)==null?void 0:r.srcElement)==null?void 0:o.id,c=this.geojson.filter(h=>h.id===n)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(h=>h.id!==n)}else if(e==="del-point"){const n=(l=(s=t.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:l.split("-"),c=this.geojson.filter(h=>h.id===n[0])[0];c.features=c.features.filter(h=>h.geometry.type==="Point"&&h.properties.id!==n[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let n=this.geojson.at(-1);n||(n=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(n)),n.features=n.features.filter(h=>h.geometry.type==="Point");const c=x.feature({type:"Point",coordinates:[t.lngLat.lng,t.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});n.features.push(c),this.handlePointUpdate(n)}},handlePointUpdate(t){const e=t.features;if(e.length>1){let a=0;const r=[];for(let o=1;o<e.length;o++){const s=e[o-1],l=e[o],n=s.properties,c={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},h={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d=E.LaneHelper.calculateDistance(c,h,n.mode==="RL",2),p=E.LaneHelper.calculateBearing(c,h,n.mode==="RL",2);a=E.LngLatHelper.roundPrecision(a+d,2);let u;n.mode==="RL"?u=E.LngLatHelper.convertToMonotonicLng([c,h]):u=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(c,h,200));const m=x.lineString(u.map(b=>[b.lng,b.lat]));m.properties.dist=d,m.properties.bearing=p,m.properties.total=a,r.push(m)}e.push(...r),t.total=a}return this.handleRender(t),t},handleTmpPointUpdate(t,e,a,r){const o=x.featureCollection([]);let s,l;if(e){const c=e.properties,h={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},d={lng:a.lng,lat:a.lat};s=E.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=E.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,d]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,d,200));const u=x.lineString(p.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=l,o.features.push(u)}if(r){const c=a.properties,h=a,d={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};s=E.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=E.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,d]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,d,200));const u=x.lineString(p.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=l,o.features.push(u)}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 n;if(r?n='<div class="marker-label">Drag and drop</div>':n=`<div class="marker-label">Tol distance: <b>${E.LngLatHelper.roundPrecision((t.total??0)+s,2)}</b>nm, bearing: <b>${l}</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=n,this.tipMarker.setLngLat([a.lng,a.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=n,this.tipMarker=new G.Marker(c).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(t){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const a=e.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(e,a.at(-1),{lng:t.lngLat.lng,lat:t.lngLat.lat})},handleDblClick(t){t.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(t){var e;if((e=t==null?void 0:t.features)!=null&&e.length){const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,o=`${t.id}-${this.labelLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(t):this.map.addSource(a,{type:"geojson",data:t}),this.handleClear(t,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:o,type:"symbol",source:a,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=t.features.filter(l=>l.geometry.type==="Point");for(const l of s){const n=document.createElement("div");n.id=`${t.id}-${l.properties.id}`,n.className=`${t.closed?"point-marker closed":"point-marker"}`,n.innerHTML='<div class="marker-circle"></div>';const c=new G.Marker({element:n,draggable:!0,contextmenu:!0}).setLngLat(l.geometry.coordinates).addTo(this.map);c.on("drag",this.handleDrag),c.on("dragend",this.handleDragEnd),this.pointMarkers[t.id]?this.pointMarkers[t.id].push(c):this.pointMarkers[t.id]=[c]}if(t.closed){const l=s.at(-1),c=t.features.filter(d=>d.geometry.type==="LineString").at(-1),h=document.createElement("div");h.className="point-summary-marker",h.innerHTML=`<div id="${t.id}" class="marker-close">×</div><div class="marker-label">Tol: ${c.properties.total}nm</div>`,this.closeMarkers[t.id]=new G.Marker(h).setOffset([60,0]).setLngLat(l.geometry.coordinates).addTo(this.map)}}},handleClear(t,e=!0){var s,l,n,c,h,d,p,u,m;const a=`${t.id}-${this.source}`,r=`${t.id}-${this.layer}`,o=`${t.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(r)&&this.map.removeLayer(r),(l=this.map)!=null&&l.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(h=this.closeMarkers[t.id])==null||h.remove(),this.closeMarkers[t.id]=void 0,(d=this.pointMarkers[t.id])==null||d.forEach(b=>{b==null||b.remove()}),this.pointMarkers[t.id]=[],(p=this.tipMarker)==null||p.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(a))&&this.map.removeSource(a),e&&((m=this.map)!=null&&m.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function po(t,e,a,r,o,s){return i.openBlock(),i.createElementBlock("div")}const mo=C(ho,[["render",po]]),Gr="",yo={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:z.CompanyHelper,vendor:this.$attrs.permission&z.CompanyHelper.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var t,e;this.right=(((t=document.getElementsByClassName("available-layers-show")[0])==null?void 0:t.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{}},ze=t=>(i.pushScopeId("data-v-ab627b83"),t=t(),i.popScopeId(),t),fo={key:0},uo={class:"bar-item"},go=[ze(()=>i.createElementVNode("span",{class:"iconfont"},"HI",-1))],bo=[ze(()=>i.createElementVNode("span",{class:"iconfont"},"I4",-1))];function _o(t,e,a,r,o,s){return a.enabled&&a.permission&o.helper.LEVEL.Supper?(i.openBlock(),i.createElementBlock("div",fo,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({position:"absolute",right:o.right+"px",bottom:a.bottom})},[i.createElementVNode("div",uo,[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>o.vendor="hi")},go,2),i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>o.vendor="i4")},bo,2)])],4)])):i.createCommentVNode("",!0)}const Lo=C(yo,[["render",_o],["__scopeId","data-v-ab627b83"]]),Xr="",wo={name:"IdmGLV2",components:{IdmGlLayer:mt,IdmWindBarb:wt,IdmWindParticle:kt,IdmCurrents:Dt,IdmCurrentParticle:Mt,IdmSigWave:jt,IdmSwell:Ut,IdmPrmsl:Jt,IdmIceberg:Yt,IdmTropicals:Ce,IdmPrecip3h:va,IdmVisibility:za,IdmWaterTemp:Va,IdmTemp:Aa,IdmArctic:Fa,IdmWarZone:wi,IdmGmdssArea:Ci,IdmEcaZone:Ei,IdmAlertZone:Ii,IdmPort:Ui,IdmLoadLine:Ji,IdmTimezone:Yi,IdmVRA:eo,IdmSpecialArea:io,IdmTerminator:so,IdmLatLng:Se,IdmMeasure:mo,IdmPoint:bi,IdmENC:Lo},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""}},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,toggleVersion:0,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new Ee}},watch:{ts:{handler(t,e){t&&e&&O(t).utc().format("yyyy-MM-DD HH")!==O(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 we(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(t,e){var a,r,o,s,l,n,c,h;t?((r=(a=this.map)==null?void 0:a.getLayer(t))==null||r.setLayoutProperty("visibility","visible"),(s=(o=this.map)==null?void 0:o.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((n=(l=this.map)==null?void 0:l.getLayer("i4"))==null||n.setLayoutProperty("visibility","none"),(h=(c=this.map)==null?void 0:c.getLayer("hi"))==null||h.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var t,e,a,r,o,s,l,n,c,h,d,p,u,m,b,f,y,_;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(t=this.map)==null?void 0:t.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(r=(a=this.map)==null?void 0:a.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)&&((l=this.map)!=null&&l.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((c=this.map)==null||c.moveLayer((n=this.viewport)==null?void 0:n.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(d=this.map)!=null&&d.getLayer((h=this.viewport)==null?void 0:h.particleLayer)&&((p=this.map)!=null&&p.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((m=this.map)==null||m.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(_=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||_.setLayoutProperty("visibility","none"))},immediate:!0}},methods:{async fetchWeatherLayers(t={tropicals:!1}){var o,s,l,n,c,h,d,p;const e=new Date().valueOf();let a=0,r=0;if(this.map){const u=((o=this.map)==null?void 0:o.getZoom())+1,m=(s=this.map)==null?void 0:s.getBounds(),b=`${m._sw.lng},${m._sw.lat},${m._ne.lng},${m._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const f=z.LayerHelper.WEATHER_LAYERS.find(y=>{var _;return((_=y.peer)==null?void 0:_.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(t.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const _=await Z.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(r=new Date().valueOf()-(e+a),console.log("weather links elapsed: ",r,", total: ",a+=r),((l=_==null?void 0:_.data)==null?void 0:l.code)===0){const g=(n=_==null?void 0:_.data)==null?void 0:n.data,w=[];for(const L in g)L==="ice-edge"&&(g[L]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),L!=="tropicals"&&w.push(Z.get(g[L],{headers:{Authorization:this.token||this.defaultMeteoToken,key:L},responseType:/\.(jpg|png)$/.test(g[L])?"blob":"json"}).catch(N=>{console.log(`[${L}] fetch layer error: ${N}`)}));const v=await Promise.all(w);this.weatherLayers={},v.map(L=>{var V,R,B,A;const N=((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data),T=(B=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:B.key;T&&N&&(this.weatherLayers[T]={raw:N,type:((A=L==null?void 0:L.config)==null?void 0:A.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&Z.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(L=>{var V,R,B;const N=E.TropicalHelper.convert2Geojson(((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data)),T=(B=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:B.key;this.weatherLayers[T]={data:N,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(r=new Date().valueOf()-(e+a),console.log("weather layers elapsed: ",r,", total: ",a+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,w=(h=this.weatherLayers["swell-height"])==null?void 0:h.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:w},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(d=this.weatherLayers["current-direction"])==null?void 0:d.raw,w=(p=this.weatherLayers["current-speed"])==null?void 0:p.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:g,speed:{raw:w},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.toggleVersion=Math.random()},async fetchOtherLayers(t={all:!1,dayNight:!1,enc:!1}){var e,a,r,o;if(this.map){let s=this.otherWeight;if(s){let l=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,l=!0),s){if(t.all){const n=await Z.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=n==null?void 0:n.data)==null?void 0:e.code)===0){const c=(a=n==null?void 0:n.data)==null?void 0:a.data,h=[];for(const p in c)h.push(Z.get(c[p],{headers:{Authorization:this.token||this.defaultMeteoToken,key:p}}));const d=await Promise.all(h);this.otherLayers={enc:l},d.map(p=>{var b,f,y;const u=((b=p==null?void 0:p.data)==null?void 0:b.data)||(p==null?void 0:p.data),m=(y=(f=p==null?void 0:p.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}else if(t.dayNight&&s&1024){const n=await Z.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((r=n==null?void 0:n.data)==null?void 0:r.code)===0){const c=(o=n==null?void 0:n.data)==null?void 0:o.data,h=[];for(const p in c)h.push(Z.get(c[p],{headers:{Authorization:this.token||this.defaultMeteoToken,key:p}}));(await Promise.all(h)).map(p=>{var b,f,y;const u=((b=p==null?void 0:p.data)==null?void 0:b.data)||(p==null?void 0:p.data),m=(y=(f=p==null?void 0:p.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}}else this.otherLayers={enc:l}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var t;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(t=this.particleFactor)!=null&&t.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 t,e,a,r,o,s,l,n,c,h,d,p;this.viewport.map.getSource((t=this.viewport)==null?void 0:t.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(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((l=this.viewport)==null?void 0:l.particleSource)||this.viewport.map.addSource((n=this.viewport)==null?void 0:n.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(p=this.viewport)==null?void 0:p.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var h,d,p,u;const t=new Date().valueOf();let e=0,a=0;const r=(h=this.map)==null?void 0:h.getBounds(),o=this.map.getZoom(),s=z.convertToStandardLng(r._sw.lng),l=z.convertToStandardLng(r._ne.lng),n=Math.floor(r._sw.lat),c=Math.ceil(r._ne.lat);for(const m in this.weatherLayers)if(this.weatherLayers[m].active&&this.weatherLayers[m].type==="json"){this.weatherLayers[m].active=!1,this.weatherLayers[m].version=Math.random()+1;let b=[];if(["swell","current"].includes(m)){const f=((d=this.weatherLayers[m])==null?void 0:d.direction)||{};for(const y in f)if(y>n&&y<c&&(!(o<=this.zoom)||y%(o<this.zoom/2?5:3)===0)){const _=f[y].lng;s>l?_.forEach((g,w)=>{var v;if((g>=s&&g<=180||g>=-180&&g<=l)&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[w],spd:(v=f[y].spd)==null?void 0:v[w]});b.push(L)}}):_.forEach((g,w)=>{var v;if(g>=s&&g<=l&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[w],spd:(v=f[y].spd)==null?void 0:v[w]});b.push(L)}})}if(a=new Date().valueOf()-(t+e),console.log("direction elapsed: ",a,", total: ",e+=a),m==="swell"){const y=this.weatherLayers[m].height;if(y){if(!y.data){const _=[];for(const g in(p=y.raw)==null?void 0:p.LineString){const w=y.raw.LineString[g];for(const v of w)_.push(x.lineString(v,{val:Number(g)}));y.data=x.featureCollection(_)}}if(y.data){const _=this.handleBboxClip(y.data,r);b=b.concat(_)}a=new Date().valueOf()-(t+e),console.log("height elapsed: ",a,", total: ",e+=a)}}if(m==="current"){const y=this.weatherLayers[m].speed;if(y){if(!y.data){const g=[];for(const w in(u=y.raw)==null?void 0:u.Polygon){const v=y.raw.Polygon[w];for(const L of v)g.push(x.polygon(L,{val:Number(w)}))}y.data=x.featureCollection(g)}const _=o<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(_),a=new Date().valueOf()-(t+e),console.log("speed elapsed: ",a,", total: ",e+=a)}}}else if(m==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>n&&y<c&&(!(o<=this.zoom)||y%(o<this.zoom/2?5:3)===0)){const _=f[y].lng;s>l?_.forEach((g,w)=>{if((g>=s&&g<=180||g>=-180&&g<=l)&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const v=x.point([g,y],{val:f[y].val[w],spd:f[y].spd[w]});b.push(v)}}):_.forEach((g,w)=>{if(g>=s&&g<=l&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const v=x.point([g,y],{val:f[y].val[w],spd:f[y].spd[w]});b.push(v)}})}a=new Date().valueOf()-(t+e),console.log("wind barb elapsed: ",a,", total: ",e+=a)}else if(m==="sig-wave-height"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.Polygon){const g=f.Polygon[_];for(const w of g)y.push(x.polygon(w,{val:Number(_)}))}for(const _ in f.Point){const g=f.Point[_];for(const w of g)y.push(...x.points(w,{val:Number(_)}).features)}b=b.concat(y)}}a=new Date().valueOf()-(t+e),console.log("sigWave elapsed: ",a,", total: ",e+=a)}else if(m==="prmsl"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.LineString){const g=f.LineString[_];for(const w of g)y.push(x.lineString(w,{val:Number(_)}))}for(const _ in f.Point)f.Point[_].lng.forEach((g,w)=>{g=z.convertToStandardLng(g),y.push(x.point([g,_],{val:f.Point[_].val[w],type:f.Point[_].type[w]}))});b=b.concat(y)}}a=new Date().valueOf()-(t+e),console.log("prmsl elapsed: ",a,", total: ",e+=a)}else if(m==="arctic"||m==="iceberg"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.LineString){const g=f.LineString[_];for(const w of g)y.push(x.lineString(w,{val:Number(_)}))}b=b.concat(y)}}a=new Date().valueOf()-(t+e)}console.log(m," elapsed: ",a,", total: ",e+=a),b.length&&(this.weatherLayers[m].data=x.featureCollection(b)),this.weatherLayers[m].active=!0,this.weatherLayers[m].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const t in this.weatherLayers)this.weatherLayers[t].active&&this.weatherLayers[t].type==="image"&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1)},handleBboxClip(t,e){const a=[],r=z.convertToStandardLng(e._sw.lng),o=z.convertToStandardLng(e._ne.lng);return t.features.forEach(s=>{if(s.geometry.type!=="Point")if(r>o){let l=[r,e._sw.lat,180,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&a.push(n),l=[-180,e._sw.lat,o,e._ne.lat],n=x.bboxClip(s,l),n.geometry.coordinates.length&&a.push(n)}else{const l=[r,e._sw.lat,o,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&a.push(n)}else a.push(s)}),a},handleWeatherLayerToggle(){var t;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 a=e.key;a.indexOf("swell")>-1?a="swell":a.indexOf("current")>-1&&(a="current"),this.weatherLayers[a]&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1,((t=this.particleFactor)==null?void 0:t.key)===a&&this.weatherLayers[`${a}-particle`]&&(this.weatherLayers[`${a}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var t,e,a,r,o,s,l,n,c,h,d,p,u;(t=this.map)!=null&&t.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(a=this.otherLayers)!=null&&a["war-zones"]||(r=this.otherLayers)!=null&&r["gmdss-areas"]||(o=this.otherLayers)!=null&&o["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(l=this.otherLayers)!=null&&l["time-zones"]||(n=this.otherLayers)!=null&&n.pirates||(c=this.otherLayers)!=null&&c.ports||(h=this.otherLayers)!=null&&h.enc||(d=this.otherLayers)!=null&&d["voluntary-reporting-area"]||(p=this.otherLayers)!=null&&p["eca-zones"]||(u=this.otherLayers)!=null&&u["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(t={tropicals:!1}){this.fetchWeatherLayers(t),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(t,e,a){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(t,e,a)},500);else{this.activeWeatherLayers=e;const r=this.activeWeatherLayers.some(l=>["wind","current"].includes(l.key)),o=this.activeWeatherLayers.some(l=>["png","jpg"].includes(l.type));r&&!o?(this.particleFactor=this.activeWeatherLayers.find(l=>["wind","current"].includes(l.key)),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const s=e==null?void 0:e.reduce((l,n)=>l+(l&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==s||this.source!==a?(this.source=a,this.weatherWeight=s,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(t){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(t)},500);else{const e=t==null?void 0:t.reduce((a,r)=>a+(r==null?void 0:r.weight),0);t.find(a=>a.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(t){const e=this.ts?O(this.ts):O(),a={lat:t.lat,lng:t.lng,ts:e.utc().format(),wt:!0,src:this.source},r=await Z.get(`${this.gateway}/api/arc/meteo/query`,{params:a,headers:{Authorization:this.token||this.defaultMeteoToken}});(r==null?void 0:r.status)===200&&(this.meteo={...r==null?void 0:r.data,...t})},handle3dToggle(t){var e,a,r,o,s,l,n,c,h,d,p,u,m,b,f,y,_,g,w,v;t?(this.map.setProjection("globe"),this.mapProjection="globe",(a=this.map)!=null&&a.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)),(n=this.map)!=null&&n.getLayer((l=this.viewport)==null?void 0:l.particleLayer)&&((c=this.map)!=null&&c.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((d=this.map)==null||d.moveLayer((h=this.viewport)==null?void 0:h.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(),(u=this.map)!=null&&u.getLayer((p=this.viewport)==null?void 0:p.rampColorLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(_=this.map)!=null&&_.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((v=this.map)==null||v.moveLayer((w=this.viewport)==null?void 0:w.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(t){this.particleFactor=t,this.fetchWeatherLayers({tropicals:!1})}}},xo={key:0,className:"map-gl-home"};function vo(t,e,a,r,o,s){var Q,M,j,he,F,S,$,de,H,pe,K,ee,te,ue,ge,be,_e,Le,ke,Ne,Te,Ie,Ve,De,Re,Be;const l=i.resolveComponent("IdmGlLayer"),n=i.resolveComponent("IdmENC"),c=i.resolveComponent("IdmSigWave"),h=i.resolveComponent("IdmSwell"),d=i.resolveComponent("IdmPrmsl"),p=i.resolveComponent("IdmIceberg"),u=i.resolveComponent("IdmTropicals"),m=i.resolveComponent("IdmCurrents"),b=i.resolveComponent("IdmCurrentParticle"),f=i.resolveComponent("IdmWindBarb"),y=i.resolveComponent("IdmWindParticle"),_=i.resolveComponent("IdmPrecip3h"),g=i.resolveComponent("IdmVisibility"),w=i.resolveComponent("IdmWaterTemp"),v=i.resolveComponent("IdmTemp"),L=i.resolveComponent("IdmArctic"),N=i.resolveComponent("IdmWarZone"),T=i.resolveComponent("IdmGmdssArea"),V=i.resolveComponent("IdmEcaZone"),R=i.resolveComponent("IdmAlertZone"),B=i.resolveComponent("IdmPort"),A=i.resolveComponent("IdmLoadLine"),ie=i.resolveComponent("IdmTimezone"),oe=i.resolveComponent("IdmVRA"),re=i.resolveComponent("IdmSpecialArea"),se=i.resolveComponent("IdmTerminator"),ne=i.resolveComponent("IdmLatLng"),le=i.resolveComponent("IdmMeasure"),ce=i.resolveComponent("IdmPoint");return a.map?(i.openBlock(),i.createElementBlock("div",xo,[i.createVNode(l,i.mergeProps({ref:"layer",map:a.map,"toggle-version":o.toggleVersion,"map-projection":o.mapProjection},t.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=U=>o.showCoord=U),onMeasure:e[1]||(e[1]=U=>o.showMeasure=U),onPoint:e[2]||(e[2]=U=>o.showPoint=U),on3d:s.handle3dToggle,onToggleVersion:e[3]||(e[3]=U=>o.toggleVersion=U)}),null,16,["map","toggle-version","map-projection","onWeather","onOther","on3d"]),i.createVNode(n,i.mergeProps({map:a.map,token:a.token,enabled:(Q=o.otherLayers)==null?void 0:Q.enc,"toggle-version":o.toggleVersion},t.$attrs,{onEnc:e[4]||(e[4]=U=>o.enc=U)}),null,16,["map","token","enabled","toggle-version"]),i.createVNode(c,i.mergeProps({map:a.map,"sig-wave":(M=o.weatherLayers)==null?void 0:M["sig-wave-height"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","sig-wave","before-layer"]),i.createVNode(h,i.mergeProps({map:a.map,swell:(j=o.weatherLayers)==null?void 0:j.swell,"before-layer":a.beforeLayer},t.$attrs),null,16,["map","swell","before-layer"]),i.createVNode(d,i.mergeProps({map:a.map,prmsl:(he=o.weatherLayers)==null?void 0:he.prmsl,"before-layer":a.beforeLayer,"active-weather-layers":o.activeWeatherLayers},t.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),i.createVNode(p,i.mergeProps({map:a.map,iceberg:(F=o.weatherLayers)==null?void 0:F.iceberg,"before-layer":a.beforeLayer},t.$attrs),null,16,["map","iceberg","before-layer"]),i.createVNode(u,i.mergeProps({map:a.map,date:a.ts,tropicals:(S=o.weatherLayers)==null?void 0:S.tropicals,"before-layer":a.beforeLayer},t.$attrs),null,16,["map","date","tropicals","before-layer"]),i.createVNode(m,i.mergeProps({map:a.map,"map-projection":o.mapProjection,current:($=o.weatherLayers)==null?void 0:$.current,"before-layer":a.beforeLayer,"show-particle":o.showCurrentParticle,"margin-bottom":o.activeWindLayer?o.showRampColor?"84px":"56px":o.showRampColor?"56px":"30px","toggle-version":o.toggleVersion,"weather-layers":o.weatherLayers},t.$attrs,{onParticle:s.handleParticle}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle"]),i.createVNode(b,i.mergeProps({viewport:o.viewport,factor:(de=o.weatherLayers)==null?void 0:de["current-particle"],"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(f,i.mergeProps({ref:"windBarb",map:a.map,"map-projection":o.mapProjection,wind:(H=o.weatherLayers)==null?void 0:H.wind,current:(pe=o.weatherLayers)==null?void 0:pe.current,"before-layer":a.beforeLayer,"margin-bottom":o.showRampColor?"56px":"30px","show-particle":o.showWindParticle},t.$attrs,{"toggle-version":o.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(y,i.mergeProps({viewport:o.viewport,factor:(K=o.weatherLayers)==null?void 0:K["wind-particle"],"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(_,i.mergeProps({viewport:o.viewport,factor:(ee=o.weatherLayers)==null?void 0:ee.precip3h,"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(g,i.mergeProps({viewport:o.viewport,factor:(te=o.weatherLayers)==null?void 0:te.visibility,"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(w,i.mergeProps({viewport:o.viewport,factor:(ue=o.weatherLayers)==null?void 0:ue["water-temp"],"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(v,i.mergeProps({viewport:o.viewport,factor:(ge=o.weatherLayers)==null?void 0:ge.temp,"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(L,i.mergeProps({viewport:o.viewport,factor:(be=o.weatherLayers)==null?void 0:be.arctic,"before-layer":a.beforeLayer,"toggle-version":o.toggleVersion},t.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(N,i.mergeProps({map:a.map,zone:(_e=o.otherLayers)==null?void 0:_e["war-zones"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(T,i.mergeProps({map:a.map,area:(Le=o.otherLayers)==null?void 0:Le["gmdss-areas"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","area","before-layer"]),i.createVNode(V,i.mergeProps({map:a.map,zone:(ke=o.otherLayers)==null?void 0:ke["eca-zones"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(R,i.mergeProps({map:a.map,zone:(Ne=o.otherLayers)==null?void 0:Ne["alert-zones"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(B,i.mergeProps({map:a.map,port:(Te=o.otherLayers)==null?void 0:Te.ports,"before-layer":a.beforeLayer},t.$attrs),null,16,["map","port","before-layer"]),i.createVNode(A,i.mergeProps({map:a.map,line:(Ie=o.otherLayers)==null?void 0:Ie["load-lines"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","line","before-layer"]),i.createVNode(ie,i.mergeProps({map:a.map,zone:(Ve=o.otherLayers)==null?void 0:Ve["time-zones"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(oe,i.mergeProps({map:a.map,area:(De=o.otherLayers)==null?void 0:De["voluntary-reporting-area"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","area","before-layer"]),i.createVNode(re,i.mergeProps({map:a.map,area:(Re=o.otherLayers)==null?void 0:Re["special-area"],"before-layer":a.beforeLayer},t.$attrs),null,16,["map","area","before-layer"]),i.createVNode(se,i.mergeProps({map:a.map,area:(Be=o.otherLayers)==null?void 0:Be["day-night"]},t.$attrs),null,16,["map","area"]),i.createVNode(ne,i.mergeProps({map:a.map,show:o.showCoord,"toggle-version":o.toggleVersion},t.$attrs),null,16,["map","show","toggle-version"]),i.createVNode(le,i.mergeProps({map:a.map,show:o.showMeasure},t.$attrs),null,16,["map","show"]),i.createVNode(ce,i.mergeProps({map:a.map,show:o.showPoint,meteo:o.meteo},t.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):i.createCommentVNode("",!0)}const Pe=C(wo,[["render",vo]]),Co={install(t){t.component("MapboxGL",Pe),t.component("TropicalGL",Ce),t.component("LatLngGL",Se)}};k.LatLngGL=Se,k.MapboxGL=Pe,k.MapboxGLPlugin=Co,k.MapboxHelper=Ee,k.ParticleSchema=D,k.TropicalGL=Ce,k.Viewport=we,k.WebGL=J,k.WebGLSchema=I,Object.defineProperty(k,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"}">${de}</div>`;const pe=new Z.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(pe),(ie=S.properties)!=null&&ie.showCircle){const K={radius:100,coordinates:S.geometry.coordinates},ee={radius:200,coordinates:S.geometry.coordinates},te={radius:500,coordinates:S.geometry.coordinates};(oe=this.circleSourceData)==null||oe.features.push(x.circle(K.coordinates,K.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(re=this.circleSourceData)==null||re.features.push(x.circle(ee.coordinates,ee.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(se=this.circleSourceData)==null||se.features.push(x.circle(te.coordinates,te.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(le=(ne=this.map)==null?void 0:ne.getSource(this.circleSource))==null||le.setData(this.circleSourceData)}}else(ce=this.map)!=null&&ce.getSource(this.interpolateSource)&&((Q=this.map)==null||Q.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,l,n,c,h,d,p,u;const e=a.features[0],t=(l=(s=this.tropicals)==null?void 0:s.data)==null?void 0:l.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="forecast"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});t.sort((m,b)=>{var f,y,_,g;return((f=m.properties)==null?void 0:f.model)==="cma"?-1:((y=m.properties)==null?void 0:y.model)==="jma"?((_=b.properties)==null?void 0:_.model)==="cma"?1:-1:m.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(m=>{var b;return m.geometry.type==="LineString"&&m.properties.type==="history"&&m.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(h=e==null?void 0:e.properties)==null?void 0:h.name,forecasts:t.map(m=>m.properties),history:(d=r[0])==null?void 0:d.properties,showCircle:(u=(p=t[0])==null?void 0:p.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const o=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new Z.Marker(o).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var r,o,s,l,n,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(h=>{h.properties.category===e&&(h.properties.disabled=a.disabled)}),this.interpolateData.forEach(h=>{h.properties.category===e&&(h.properties.disabled=a.disabled)}),(l=(s=this.map)==null?void 0:s.getSource(this.source))==null||l.setData(x.featureCollection(t)),(c=(n=this.map)==null?void 0:n.getSource(this.clusterSource))==null||c.setData(x.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 l={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},n=this.handleComputeArc(t.geometry.coordinates,l,{...t.properties,level:10});e.push(n)}return e},handleComputeArc(a,e,t){var s;const r=[];for(const l in e){const n=e[l]??0;let c;switch(l){case"ne":c=x.lineArc(a,n*1.852,0,90,{steps:n>0?64:1});break;case"se":c=x.lineArc(a,n*1.852,90,180,{steps:n>0?64:1});break;case"sw":c=x.lineArc(a,n*1.852,180,270,{steps:n>0?64:1});break;case"nw":c=x.lineArc(a,n*1.852,270,360,{steps:n>0?64:1});break}r.push(...(s=c==null?void 0:c.geometry)==null?void 0:s.coordinates)}const o=x.lineString(r);return x.lineToPolygon(o,{properties:t})}}},ve=a=>(i.pushScopeId("data-v-08ecb5a5"),a=a(),i.popScopeId(),a),Kt={id:"active-tropical",class:"active-tropical"},ea={class:"header-box"},ta={class:"main"},aa={key:0},ia={class:"sub"},oa={id:"meteoBox",class:"main-box"},ra={class:"content"},sa={class:"row"},na={class:"col col-left",style:{"justify-content":"flex-start"}},la=ve(()=>i.createElementVNode("label",null,"Wind speed : ",-1)),ca={class:"col col-right",style:{"justify-content":"flex-start"}},ha=ve(()=>i.createElementVNode("label",null,"Pressure : ",-1)),da={class:"row"},pa={class:"col col-24",style:{"justify-content":"flex-start"}},ma=ve(()=>i.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),ya={class:"forecast-models"},fa=["onClick"],ua=i.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-08ecb5a5></div><div class="row" style="padding:2px 10px;" data-v-08ecb5a5><div class="legend" data-v-08ecb5a5><div class="icon td" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>TD</div></div><div class="legend" data-v-08ecb5a5><div class="icon ts" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>TS</div></div><div class="legend" data-v-08ecb5a5><div class="icon sts" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>STS</div></div><div class="legend" data-v-08ecb5a5><div class="icon ty" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>TY</div></div><div class="legend" data-v-08ecb5a5><div class="icon sty" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>STY</div></div><div class="legend" data-v-08ecb5a5><div class="icon supper-ty" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-08ecb5a5><div class="legend" data-v-08ecb5a5><div class="icon history" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>History</div></div><div class="legend" data-v-08ecb5a5><div class="icon r7" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>35kts Radii</div></div><div class="legend" data-v-08ecb5a5><div class="icon r10" data-v-08ecb5a5></div><div class="label" data-v-08ecb5a5>50kts Radii</div></div></div>',3),ga={class:"more"};function ba(a,e,t,r,o,s){var l,n,c,h,d,p,u,m,b,f,y,_,g,w,v;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Kt,[i.createElementVNode("div",ea,[i.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=L=>o.showTropicals=!1)},""),i.createElementVNode("div",ta,[(n=(l=o.activeTropicals)==null?void 0:l.history)!=null&&n.level?(i.openBlock(),i.createElementBlock("span",aa,i.toDisplayString((h=(c=o.activeTropicals)==null?void 0:c.history)==null?void 0:h.level)+" , ",1)):i.createCommentVNode("",!0),i.createTextVNode(i.toDisplayString((d=o.activeTropicals)==null?void 0:d.name),1)]),i.createElementVNode("div",ia," Last update: "+i.toDisplayString(s.computeTime(((u=(p=o.activeTropicals)==null?void 0:p.history)==null?void 0:u.updated)||((f=(b=(m=o.activeTropicals)==null?void 0:m.forecasts)==null?void 0:b.filter(L=>!L.disabled)[0])==null?void 0:f.date))),1)]),i.createElementVNode("div",oa,[i.createElementVNode("div",ra,[i.createElementVNode("div",sa,[i.createElementVNode("div",na,[la,i.createElementVNode("span",null,i.toDisplayString(((_=(y=o.activeTropicals)==null?void 0:y.history)==null?void 0:_.kts)||"-")+"[kts]",1)]),i.createElementVNode("div",ca,[ha,i.createElementVNode("span",null,i.toDisplayString(((w=(g=o.activeTropicals)==null?void 0:g.history)==null?void 0:w.pressure)||"-")+"[hPa]",1)])]),i.createElementVNode("div",da,[i.createElementVNode("div",pa,[ma,i.createElementVNode("div",ya,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList((v=o.activeTropicals)==null?void 0:v.forecasts,(L,N)=>{var T,D,R,B;return i.openBlock(),i.createElementBlock("div",{key:N,class:i.normalizeClass(["model",L.disabled?"":"active",N>0&&N<((D=(T=o.activeTropicals)==null?void 0:T.forecasts)==null?void 0:D.length)-1&&((B=(R=o.activeTropicals)==null?void 0:R.forecasts)==null?void 0:B.length)>2?"center-child":""]),onClick:M=>s.handleForecastToggle(L)},[i.createElementVNode("span",{class:i.normalizeClass(L.model)},i.toDisplayString(L.model),3)],10,fa)}),128))])])]),ua]),i.createElementVNode("div",ga,[i.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=L=>s.handleStrikeProbability(o.activeTropicals))},"Strike Probability >>")])])],512)),[[i.vShow,o.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const Ce=C(Qt,[["render",ba],["__scopeId","data-v-08ecb5a5"]]),tr="",_a={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 J,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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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,I.vertexSchema,I.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)}}},q=a=>(i.pushScopeId("data-v-dec867b8"),a=a(),i.popScopeId(),a),La={key:0},wa=[q(()=>i.createElementVNode("span",null,"mm",-1)),q(()=>i.createElementVNode("span",null,"1.5",-1)),q(()=>i.createElementVNode("span",null,"2",-1)),q(()=>i.createElementVNode("span",null,"3",-1)),q(()=>i.createElementVNode("span",null,"7",-1)),q(()=>i.createElementVNode("span",null,"10",-1)),q(()=>i.createElementVNode("span",null,"20",-1)),q(()=>i.createElementVNode("span",null,"30",-1))];function xa(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",La,[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 va=C(_a,[["render",xa],["__scopeId","data-v-dec867b8"]]),hr="",Ca={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 J,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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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,I.vertexSchema,I.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)}}},me=a=>(i.pushScopeId("data-v-952dee5c"),a=a(),i.popScopeId(),a),Sa={key:0},ka=[me(()=>i.createElementVNode("span",null,"nm",-1)),me(()=>i.createElementVNode("span",null,"0",-1)),me(()=>i.createElementVNode("span",null,"0.5",-1)),me(()=>i.createElementVNode("span",null,"1.5",-1)),me(()=>i.createElementVNode("span",null,"3",-1)),me(()=>i.createElementVNode("span",null,"9",-1))];function Ea(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Sa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},ka,4)])):i.createCommentVNode("",!0)}const za=C(Ca,[["render",Ea],["__scopeId","data-v-952dee5c"]]),gr="",Pa={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 J,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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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,I.vertexSchema,I.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-67e5094b"),a=a(),i.popScopeId(),a),Na={key:0},Ta=[ye(()=>i.createElementVNode("span",null,"°C",-1)),ye(()=>i.createElementVNode("span",null,"0",-1)),ye(()=>i.createElementVNode("span",null,"10",-1)),ye(()=>i.createElementVNode("span",null,"20",-1)),ye(()=>i.createElementVNode("span",null,"30",-1)),ye(()=>i.createElementVNode("span",null,"40",-1))];function Ia(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Na,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ta,4)])):i.createCommentVNode("",!0)}const Da=C(Pa,[["render",Ia],["__scopeId","data-v-67e5094b"]]),Cr="",Va={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 J,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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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,I.vertexSchema,I.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)}}},Y=a=>(i.pushScopeId("data-v-389ea886"),a=a(),i.popScopeId(),a),Ra={key:0},Ba=[Y(()=>i.createElementVNode("span",null,"°C",-1)),Y(()=>i.createElementVNode("span",null,"-20",-1)),Y(()=>i.createElementVNode("span",null,"-10",-1)),Y(()=>i.createElementVNode("span",null,"0",-1)),Y(()=>i.createElementVNode("span",null,"10",-1)),Y(()=>i.createElementVNode("span",null,"20",-1)),Y(()=>i.createElementVNode("span",null,"30",-1)),Y(()=>i.createElementVNode("span",null,"40",-1))];function $a(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Ra,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Ba,4)])):i.createCommentVNode("",!0)}const Aa=C(Va,[["render",$a],["__scopeId","data-v-389ea886"]]),Dr="",Ma={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 J,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,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.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,I.vertexSchema,I.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-db805141"),a=a(),i.popScopeId(),a),Wa={key:0},Oa=[fe(()=>i.createElementVNode("span",null,"m",-1)),fe(()=>i.createElementVNode("span",null,"0",-1)),fe(()=>i.createElementVNode("span",null,"0.5",-1)),fe(()=>i.createElementVNode("span",null,"1",-1)),fe(()=>i.createElementVNode("span",null,"1.5",-1)),fe(()=>i.createElementVNode("span",null,"2",-1))];function ja(a,e,t,r,o,s){var l;return(l=t.factor)!=null&&l.active?(i.openBlock(),i.createElementBlock("div",Wa,[i.createElementVNode("div",{class:"legend-bars flex-center",style:i.normalizeStyle([{position:"absolute"},{right:o.right+"px",bottom:t.bottom}])},Oa,4)])):i.createCommentVNode("",!0)}const Fa=C(Ma,[["render",ja],["__scopeId","data-v-db805141"]]),Wr="",Ha={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:z.CompanyHelper}},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[Z]")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return E.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return E.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":E.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 Z.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},O=a=>(i.pushScopeId("data-v-de0e51d2"),a=a(),i.popScopeId(),a),Ua={id:"point-meteo",class:"point-meteo"},Za={class:"meteo-box"},Ga={class:"header-box"},Ja={class:"main"},Xa={class:"sub"},qa={class:"main-box"},Ya={class:"flex-space"},Qa=O(()=>i.createElementVNode("label",null,"Wind",-1)),Ka={class:"flex-space"},ei=O(()=>i.createElementVNode("label",null,"Wind.Wave",-1)),ti={class:"flex-space"},ai=O(()=>i.createElementVNode("label",null,"Swell",-1)),ii={class:"flex-space"},oi=O(()=>i.createElementVNode("label",null,"Sig.Wave",-1)),ri={class:"flex-space"},si=O(()=>i.createElementVNode("label",null,"Current",-1)),ni={class:"flex-space"},li=O(()=>i.createElementVNode("label",null,"Precip",-1)),ci={class:"flex-space"},hi=O(()=>i.createElementVNode("label",null,"Visibility",-1)),di={class:"flex-space"},pi=O(()=>i.createElementVNode("label",null,"Temp",-1)),mi={class:"flex-space"},yi=O(()=>i.createElementVNode("label",null,"Water Temp",-1)),fi={key:0,class:"flex-space",style:{"justify-content":"flex-end"}},ui=[O(()=>i.createElementVNode("span",{class:"more"},"More >>",-1))];function gi(a,e,t,r,o,s){var l,n,c,h,d,p,u,m,b,f,y,_,g,w,v,L,N,T,D,R,B,M,ie,oe,re,se,ne,le,ce,Q,W,j,he,F,S,$,de,H,pe,K,ee,te,ue,ge,be,_e,Le;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Ua,[i.createElementVNode("div",Za,[i.createElementVNode("div",Ga,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=ke=>o.showMeteo=!1)},""),i.createElementVNode("div",Ja,i.toDisplayString(s.computeLat((l=t.meteo)==null?void 0:l.lat))+","+i.toDisplayString(s.computeLng((n=t.meteo)==null?void 0:n.lng)),1),i.createElementVNode("div",Xa,i.toDisplayString(s.computeTime((c=t.meteo)==null?void 0:c.utc)),1)]),i.createElementVNode("div",qa,[i.createElementVNode("div",Ya,[Qa,i.createElementVNode("span",null,i.toDisplayString(((d=(h=t.meteo)==null?void 0:h.wind)==null?void 0:d.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((u=(p=t.meteo)==null?void 0:p.wind)==null?void 0:u.kts,1))+"[kts]/"+i.toDisplayString((b=(m=t.meteo)==null?void 0:m.wind)==null?void 0:b.scale)+"[BF]/"+i.toDisplayString(s.roundPrecision((y=(f=t.meteo)==null?void 0:f.gusts)==null?void 0:y.kts,1))+"[kts]",1)]),i.createElementVNode("div",Ka,[ei,i.createElementVNode("span",null,i.toDisplayString(((w=(g=(_=t.meteo)==null?void 0:_.wave)==null?void 0:g.wd)==null?void 0:w.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((N=(L=(v=t.meteo)==null?void 0:v.wave)==null?void 0:L.wd)==null?void 0:N.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((R=(D=(T=t.meteo)==null?void 0:T.wave)==null?void 0:D.wd)==null?void 0:R.period,1))+"[s]",1)]),i.createElementVNode("div",ti,[ai,i.createElementVNode("span",null,i.toDisplayString(((ie=(M=(B=t.meteo)==null?void 0:B.wave)==null?void 0:M.swell)==null?void 0:ie.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((se=(re=(oe=t.meteo)==null?void 0:oe.wave)==null?void 0:re.swell)==null?void 0:se.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((ce=(le=(ne=t.meteo)==null?void 0:ne.wave)==null?void 0:le.swell)==null?void 0:ce.period,1))+"[s]",1)]),i.createElementVNode("div",ii,[oi,i.createElementVNode("span",null,i.toDisplayString(((j=(W=(Q=t.meteo)==null?void 0:Q.wave)==null?void 0:W.sig)==null?void 0:j.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((S=(F=(he=t.meteo)==null?void 0:he.wave)==null?void 0:F.sig)==null?void 0:S.height,1))+"[m]/"+i.toDisplayString(s.roundPrecision((H=(de=($=t.meteo)==null?void 0:$.wave)==null?void 0:de.sig)==null?void 0:H.period,1))+"[s]",1)]),i.createElementVNode("div",ri,[si,i.createElementVNode("span",null,i.toDisplayString(((K=(pe=t.meteo)==null?void 0:pe.current)==null?void 0:K.direction)||"-")+"/"+i.toDisplayString(s.roundPrecision((te=(ee=t.meteo)==null?void 0:ee.current)==null?void 0:te.kts,2))+"[kts]",1)]),i.createElementVNode("div",ni,[li,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((ge=(ue=t.meteo)==null?void 0:ue.precip)==null?void 0:ge.inter6h,2))+"[mm]",1)]),i.createElementVNode("div",ci,[hi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision(((be=t.meteo)==null?void 0:be.visibility)/1852,0))+"[nm]",1)]),i.createElementVNode("div",di,[pi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((_e=t.meteo)==null?void 0:_e.temp,0))+"[°C]",1)]),i.createElementVNode("div",mi,[yi,i.createElementVNode("span",null,i.toDisplayString(s.roundPrecision((Le=t.meteo)==null?void 0:Le.waterTemp,2))+"[°C]",1)])]),a.$attrs.permission&o.helper.LEVEL.Prime?(i.openBlock(),i.createElementBlock("div",fi,ui)):i.createCommentVNode("",!0)])],512)),[[i.vShow,o.showMeteo]])}const bi=C(Ha,[["render",gi],["__scopeId","data-v-de0e51d2"]]),_i={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 Li(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const wi=C(_i,[["render",Li]]),xi={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 vi(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ci=C(xi,[["render",vi]]),Si={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 ki(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ei=C(Si,[["render",ki]]),jr="",zi={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];t&&(this.showZone=!0,this.form={...t.properties})},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":.1,"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":.1,"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":.1},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)}}},Pi={id:"zone-info"},Ni=["innerHTML"];function Ti(a,e,t,r,o,s){var l;return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pi,[i.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=n=>o.showZone=!1)},""),i.createElementVNode("div",{class:"rich-context",innerHTML:(l=o.form)==null?void 0:l.name},null,8,Ni)],512)),[[i.vShow,o.showZone]])}const Ii=C(zi,[["render",Ti],["__scopeId","data-v-c0864afc"]]),Fr="",Di={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 E.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return E.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 Z.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)}}},xe=a=>(i.pushScopeId("data-v-4ab013cc"),a=a(),i.popScopeId(),a),Vi={id:"port-info"},Ri={class:"port-box"},Bi={class:"flex-start"},$i=xe(()=>i.createElementVNode("label",null,"Name : ",-1)),Ai={class:"flex-start"},Mi=xe(()=>i.createElementVNode("label",null,"Position : ",-1)),Wi={class:"flex-start"},Oi=xe(()=>i.createElementVNode("label",null,"LoCode : ",-1)),ji={class:"flex-start",style:{"align-items":"flex-start"}},Fi=xe(()=>i.createElementVNode("label",null,"Region : ",-1));function Hi(a,e,t,r,o,s){return i.withDirectives((i.openBlock(),i.createElementBlock("div",Vi,[i.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=l=>o.showPort=!1)},""),i.createElementVNode("div",Ri,[i.createElementVNode("div",Bi,[$i,i.createElementVNode("span",{onClick:e[1]||(e[1]=(...l)=>s.handleEmit&&s.handleEmit(...l))},i.toDisplayString(o.form.name),1)]),i.createElementVNode("div",Ai,[Mi,i.createElementVNode("span",null,i.toDisplayString(s.computeLat(o.form.lat))+", "+i.toDisplayString(s.computeLng(o.form.lng)),1)]),i.createElementVNode("div",Wi,[Oi,i.createElementVNode("span",null,i.toDisplayString(o.form.loCode||"-"),1)]),i.createElementVNode("div",ji,[Fi,i.createElementVNode("span",null,i.toDisplayString(o.form.city||"-")+", "+i.toDisplayString(o.form.country||"-"),1)])])],512)),[[i.vShow,o.showPort]])}const Ui=C(Di,[["render",Hi],["__scopeId","data-v-4ab013cc"]]),Zi={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 Gi(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Ji=C(Zi,[["render",Gi]]),Xi={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 qi(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const Yi=C(Xi,[["render",qi]]),Qi={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 Ki(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const eo=C(Qi,[["render",Ki]]),to={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=>E.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 ao(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const io=C(to,[["render",ao]]),oo={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 ro(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const so=C(oo,[["render",ro]]),Hr="",no={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,t;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("available-layers-show")[0])==null?void 0:e.clientWidth)||0)+(((t=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:t.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=E.LngLatHelper.lng2pretty(e.lng,2),r=E.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(x.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))}}},lo=(a=>(i.pushScopeId("data-v-7367f59b"),a=a(),i.popScopeId(),a))(()=>i.createElementVNode("span",null,", ",-1));function co(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),lo,i.createElementVNode("span",null,i.toDisplayString(o.lngLat.lng.pretty),1)],4)):i.createCommentVNode("",!0)}const Se=C(no,[["render",co],["__scopeId","data-v-7367f59b"]]),ho={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,l,n,c,h;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),(l=this.map)==null||l.off("mousemove",this.handleMove),(n=this.map)==null||n.off("dblclick",this.handleDblClick),(c=this.map)==null||c.off("click",this.handleClick),(h=this.map)==null||h.off("contextmenu",this.handleContextmenu);for(const d of this.geojson)this.handleClear(d,!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,l,n,c,h,d,p;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 u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var _;return((_=y._element)==null?void 0:_.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(n=(l=a.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);let b;u.features.forEach((y,_)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=_;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(h=(c=a.target)==null?void 0:c._lngLat)==null?void 0:h.lng,lat:(p=(d=a.target)==null?void 0:d._lngLat)==null?void 0:p.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(a){var t,r,o,s,l,n,c,h,d,p;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 u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(o=a.target)==null?void 0:o._lngLat)==null?void 0:s.lng,(n=(l=a.target)==null?void 0:l._lngLat)==null?void 0:n.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(h=(c=a.target)==null?void 0:c._lngLat)==null?void 0:h.lng,(p=(d=a.target)==null?void 0:d._lngLat)==null?void 0:p.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},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 n=this.geojson.filter(c=>c.id===e.split("-")[0])[0].features.filter(c=>c.geometry.type==="Point");if(n.length>2&&n.filter(h=>h.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const h=document.createElement("div");h.className="point-contextmenu-marker",h.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new Z.Marker(h).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,r,o,s,l;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const n=(o=(r=a.originalEvent)==null?void 0:r.srcElement)==null?void 0:o.id,c=this.geojson.filter(h=>h.id===n)[0];c&&this.handleClear(c,!0),this.geojson=this.geojson.filter(h=>h.id!==n)}else if(e==="del-point"){const n=(l=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:l.split("-"),c=this.geojson.filter(h=>h.id===n[0])[0];c.features=c.features.filter(h=>h.geometry.type==="Point"&&h.properties.id!==n[1]),this.handlePointUpdate(c)}else if(e!=="marker-label"){let n=this.geojson.at(-1);n||(n=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(n)),n.features=n.features.filter(h=>h.geometry.type==="Point");const c=x.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});n.features.push(c),this.handlePointUpdate(n)}},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],l=e[o],n=s.properties,c={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},h={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d=E.LaneHelper.calculateDistance(c,h,n.mode==="RL",2),p=E.LaneHelper.calculateBearing(c,h,n.mode==="RL",2);t=E.LngLatHelper.roundPrecision(t+d,2);let u;n.mode==="RL"?u=E.LngLatHelper.convertToMonotonicLng([c,h]):u=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(c,h,200));const m=x.lineString(u.map(b=>[b.lng,b.lat]));m.properties.dist=d,m.properties.bearing=p,m.properties.total=t,r.push(m)}e.push(...r),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,r){const o=x.featureCollection([]);let s,l;if(e){const c=e.properties,h={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},d={lng:t.lng,lat:t.lat};s=E.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=E.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,d]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,d,200));const u=x.lineString(p.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=l,o.features.push(u)}if(r){const c=t.properties,h=t,d={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};s=E.LaneHelper.calculateDistance(h,d,c.mode==="RL",2),l=E.LaneHelper.calculateBearing(h,d,c.mode==="RL",2);let p;c.mode==="RL"?p=E.LngLatHelper.convertToMonotonicLng([h,d]):p=E.LngLatHelper.convertToMonotonicLng(E.LaneHelper.interpolateCoordinates(h,d,200));const u=x.lineString(p.map(m=>[m.lng,m.lat]));u.properties.dist=s,u.properties.bearing=l,o.features.push(u)}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 n;if(r?n='<div class="marker-label">Drag and drop</div>':n=`<div class="marker-label">Tol distance: <b>${E.LngLatHelper.roundPrecision((a.total??0)+s,2)}</b>nm, bearing: <b>${l}</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=n,this.tipMarker.setLngLat([t.lng,t.lat]);else{const c=document.createElement("div");c.className="tip-marker",c.innerHTML=n,this.tipMarker=new Z.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=x.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=x.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(l=>l.geometry.type==="Point");for(const l of s){const n=document.createElement("div");n.id=`${a.id}-${l.properties.id}`,n.className=`${a.closed?"point-marker closed":"point-marker"}`,n.innerHTML='<div class="marker-circle"></div>';const c=new Z.Marker({element:n,draggable:!0,contextmenu:!0}).setLngLat(l.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 l=s.at(-1),c=a.features.filter(d=>d.geometry.type==="LineString").at(-1),h=document.createElement("div");h.className="point-summary-marker",h.innerHTML=`<div id="${a.id}" class="marker-close">×</div><div class="marker-label">Tol: ${c.properties.total}nm</div>`,this.closeMarkers[a.id]=new Z.Marker(h).setOffset([60,0]).setLngLat(l.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,l,n,c,h,d,p,u,m;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),(l=this.map)!=null&&l.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(c=this.map)!=null&&c.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(h=this.closeMarkers[a.id])==null||h.remove(),this.closeMarkers[a.id]=void 0,(d=this.pointMarkers[a.id])==null||d.forEach(b=>{b==null||b.remove()}),this.pointMarkers[a.id]=[],(p=this.tipMarker)==null||p.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(t))&&this.map.removeSource(t),e&&((m=this.map)!=null&&m.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function po(a,e,t,r,o,s){return i.openBlock(),i.createElementBlock("div")}const mo=C(ho,[["render",po]]),Zr="",yo={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:z.CompanyHelper,vendor:this.$attrs.permission&z.CompanyHelper.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("available-layers-show")[0])==null?void 0:a.clientWidth)||0)+(((e=document.getElementsByClassName("fleet-list-container")[0])==null?void 0:e.clientWidth)||0)+10},immediate:!0}},methods:{}},ze=a=>(i.pushScopeId("data-v-ab627b83"),a=a(),i.popScopeId(),a),fo={key:0},uo={class:"bar-item"},go=[ze(()=>i.createElementVNode("span",{class:"iconfont"},"HI",-1))],bo=[ze(()=>i.createElementVNode("span",{class:"iconfont"},"I4",-1))];function _o(a,e,t,r,o,s){return t.enabled&&t.permission&o.helper.LEVEL.Supper?(i.openBlock(),i.createElementBlock("div",fo,[i.createElementVNode("div",{class:"menu-bar-box",style:i.normalizeStyle({position:"absolute",right:o.right+"px",bottom:t.bottom})},[i.createElementVNode("div",uo,[i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>o.vendor="hi")},go,2),i.createElementVNode("div",{class:i.normalizeClass(o.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>o.vendor="i4")},bo,2)])],4)])):i.createCommentVNode("",!0)}const Lo=C(yo,[["render",_o],["__scopeId","data-v-ab627b83"]]),Xr="",wo={name:"IdmGLV2",components:{IdmGlLayer:mt,IdmWindBarb:wt,IdmWindParticle:kt,IdmCurrents:Vt,IdmCurrentParticle:Mt,IdmSigWave:jt,IdmSwell:Ut,IdmPrmsl:Jt,IdmIceberg:Yt,IdmTropicals:Ce,IdmPrecip3h:va,IdmVisibility:za,IdmWaterTemp:Da,IdmTemp:Aa,IdmArctic:Fa,IdmWarZone:wi,IdmGmdssArea:Ci,IdmEcaZone:Ei,IdmAlertZone:Ii,IdmPort:Ui,IdmLoadLine:Ji,IdmTimezone:Yi,IdmVRA:eo,IdmSpecialArea:io,IdmTerminator:so,IdmLatLng:Se,IdmMeasure:mo,IdmPoint:bi,IdmENC:Lo},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""}},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,toggleVersion:0,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new Ee}},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 we(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,r,o,s,l,n,c,h;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")):((n=(l=this.map)==null?void 0:l.getLayer("i4"))==null||n.setLayoutProperty("visibility","none"),(h=(c=this.map)==null?void 0:c.getLayer("hi"))==null||h.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,r,o,s,l,n,c,h,d,p,u,m,b,f,y,_;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)&&((l=this.map)!=null&&l.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((c=this.map)==null||c.moveLayer((n=this.viewport)==null?void 0:n.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(d=this.map)!=null&&d.getLayer((h=this.viewport)==null?void 0:h.particleLayer)&&((p=this.map)!=null&&p.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((m=this.map)==null||m.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(_=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||_.setLayoutProperty("visibility","none"))},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var o,s,l,n,c,h,d,p;const e=new Date().valueOf();let t=0,r=0;if(this.map){const u=((o=this.map)==null?void 0:o.getZoom())+1,m=(s=this.map)==null?void 0:s.getBounds(),b=`${m._sw.lng},${m._sw.lat},${m._ne.lng},${m._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const f=z.LayerHelper.WEATHER_LAYERS.find(y=>{var _;return((_=y.peer)==null?void 0:_.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(a.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const _=await G.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&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),((l=_==null?void 0:_.data)==null?void 0:l.code)===0){const g=(n=_==null?void 0:_.data)==null?void 0:n.data,w=[];for(const L in g)L==="ice-edge"&&(g[L]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),L!=="tropicals"&&w.push(G.get(g[L],{headers:{Authorization:this.token||this.defaultMeteoToken,key:L},responseType:/\.(jpg|png)$/.test(g[L])?"blob":"json"}).catch(N=>{console.log(`[${L}] fetch layer error: ${N}`)}));const v=await Promise.all(w);this.weatherLayers={},v.map(L=>{var D,R,B,M;const N=((D=L==null?void 0:L.data)==null?void 0:D.data)||(L==null?void 0:L.data),T=(B=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:B.key;T&&N&&(this.weatherLayers[T]={raw:N,type:((M=L==null?void 0:L.config)==null?void 0:M.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&G.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(L=>{var D,R,B;const N=E.TropicalHelper.convert2Geojson(((D=L==null?void 0:L.data)==null?void 0:D.data)||(L==null?void 0:L.data)),T=(B=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:B.key;this.weatherLayers[T]={data:N,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 g=(c=this.weatherLayers["swell-direction"])==null?void 0:c.raw,w=(h=this.weatherLayers["swell-height"])==null?void 0:h.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:w},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(d=this.weatherLayers["current-direction"])==null?void 0:d.raw,w=(p=this.weatherLayers["current-speed"])==null?void 0:p.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:g,speed:{raw:w},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.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 l=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,l=!0),s){if(a.all){const n=await G.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=n==null?void 0:n.data)==null?void 0:e.code)===0){const c=(t=n==null?void 0:n.data)==null?void 0:t.data,h=[];for(const p in c)h.push(G.get(c[p],{headers:{Authorization:this.token||this.defaultMeteoToken,key:p}}));const d=await Promise.all(h);this.otherLayers={enc:l},d.map(p=>{var b,f,y;const u=((b=p==null?void 0:p.data)==null?void 0:b.data)||(p==null?void 0:p.data),m=(y=(f=p==null?void 0:p.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}else if(a.dayNight&&s&1024){const n=await G.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((r=n==null?void 0:n.data)==null?void 0:r.code)===0){const c=(o=n==null?void 0:n.data)==null?void 0:o.data,h=[];for(const p in c)h.push(G.get(c[p],{headers:{Authorization:this.token||this.defaultMeteoToken,key:p}}));(await Promise.all(h)).map(p=>{var b,f,y;const u=((b=p==null?void 0:p.data)==null?void 0:b.data)||(p==null?void 0:p.data),m=(y=(f=p==null?void 0:p.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[m]=u})}}}else this.otherLayers={enc:l}}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,l,n,c,h,d,p;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((l=this.viewport)==null?void 0:l.particleSource)||this.viewport.map.addSource((n=this.viewport)==null?void 0:n.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(p=this.viewport)==null?void 0:p.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var h,d,p,u;const a=new Date().valueOf();let e=0,t=0;const r=(h=this.map)==null?void 0:h.getBounds(),o=this.map.getZoom(),s=z.convertToStandardLng(r._sw.lng),l=z.convertToStandardLng(r._ne.lng),n=Math.floor(r._sw.lat),c=Math.ceil(r._ne.lat);for(const m in this.weatherLayers)if(this.weatherLayers[m].active&&this.weatherLayers[m].type==="json"){this.weatherLayers[m].active=!1,this.weatherLayers[m].version=Math.random()+1;let b=[];if(["swell","current"].includes(m)){const f=((d=this.weatherLayers[m])==null?void 0:d.direction)||{};for(const y in f)if(y>n&&y<c&&(!(o<=this.zoom)||y%(o<this.zoom/2?5:3)===0)){const _=f[y].lng;s>l?_.forEach((g,w)=>{var v;if((g>=s&&g<=180||g>=-180&&g<=l)&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[w],spd:(v=f[y].spd)==null?void 0:v[w]});b.push(L)}}):_.forEach((g,w)=>{var v;if(g>=s&&g<=l&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[w],spd:(v=f[y].spd)==null?void 0:v[w]});b.push(L)}})}if(t=new Date().valueOf()-(a+e),console.log("direction elapsed: ",t,", total: ",e+=t),m==="swell"){const y=this.weatherLayers[m].height;if(y){if(!y.data){const _=[];for(const g in(p=y.raw)==null?void 0:p.LineString){const w=y.raw.LineString[g];for(const v of w)_.push(x.lineString(v,{val:Number(g)}));y.data=x.featureCollection(_)}}if(y.data){const _=this.handleBboxClip(y.data,r);b=b.concat(_)}t=new Date().valueOf()-(a+e),console.log("height elapsed: ",t,", total: ",e+=t)}}if(m==="current"){const y=this.weatherLayers[m].speed;if(y){if(!y.data){const g=[];for(const w in(u=y.raw)==null?void 0:u.Polygon){const v=y.raw.Polygon[w];for(const L of v)g.push(x.polygon(L,{val:Number(w)}))}y.data=x.featureCollection(g)}const _=o<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(_),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(m==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>n&&y<c&&(!(o<=this.zoom)||y%(o<this.zoom/2?5:3)===0)){const _=f[y].lng;s>l?_.forEach((g,w)=>{if((g>=s&&g<=180||g>=-180&&g<=l)&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const v=x.point([g,y],{val:f[y].val[w],spd:f[y].spd[w]});b.push(v)}}):_.forEach((g,w)=>{if(g>=s&&g<=l&&(!(o<=this.zoom)||g%(o<this.zoom/2?5:3)===0)){const v=x.point([g,y],{val:f[y].val[w],spd:f[y].spd[w]});b.push(v)}})}t=new Date().valueOf()-(a+e),console.log("wind barb elapsed: ",t,", total: ",e+=t)}else if(m==="sig-wave-height"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.Polygon){const g=f.Polygon[_];for(const w of g)y.push(x.polygon(w,{val:Number(_)}))}for(const _ in f.Point){const g=f.Point[_];for(const w of g)y.push(...x.points(w,{val:Number(_)}).features)}b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("sigWave elapsed: ",t,", total: ",e+=t)}else if(m==="prmsl"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.LineString){const g=f.LineString[_];for(const w of g)y.push(x.lineString(w,{val:Number(_)}))}for(const _ in f.Point)f.Point[_].lng.forEach((g,w)=>{g=z.convertToStandardLng(g),y.push(x.point([g,_],{val:f.Point[_].val[w],type:f.Point[_].type[w]}))});b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(m==="arctic"||m==="iceberg"){if(this.weatherLayers[m].data)b=this.weatherLayers[m].data;else{const f=this.weatherLayers[m].raw;if(f){const y=[];for(const _ in f.LineString){const g=f.LineString[_];for(const w of g)y.push(x.lineString(w,{val:Number(_)}))}b=b.concat(y)}}t=new Date().valueOf()-(a+e)}console.log(m," elapsed: ",t,", total: ",e+=t),b.length&&(this.weatherLayers[m].data=x.featureCollection(b)),this.weatherLayers[m].active=!0,this.weatherLayers[m].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=z.convertToStandardLng(e._sw.lng),o=z.convertToStandardLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(r>o){let l=[r,e._sw.lat,180,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&t.push(n),l=[-180,e._sw.lat,o,e._ne.lat],n=x.bboxClip(s,l),n.geometry.coordinates.length&&t.push(n)}else{const l=[r,e._sw.lat,o,e._ne.lat],n=x.bboxClip(s,l);n.geometry.coordinates.length&&t.push(n)}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,l,n,c,h,d,p,u;(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"]||(l=this.otherLayers)!=null&&l["time-zones"]||(n=this.otherLayers)!=null&&n.pirates||(c=this.otherLayers)!=null&&c.ports||(h=this.otherLayers)!=null&&h.enc||(d=this.otherLayers)!=null&&d["voluntary-reporting-area"]||(p=this.otherLayers)!=null&&p["eca-zones"]||(u=this.otherLayers)!=null&&u["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(l=>["wind","current"].includes(l.key)),o=this.activeWeatherLayers.some(l=>["png","jpg"].includes(l.type));r&&!o?(this.particleFactor=this.activeWeatherLayers.find(l=>["wind","current"].includes(l.key)),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const s=e==null?void 0:e.reduce((l,n)=>l+(l&(n==null?void 0:n.weight)?0:n==null?void 0:n.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 G.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,l,n,c,h,d,p,u,m,b,f,y,_,g,w,v;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)),(n=this.map)!=null&&n.getLayer((l=this.viewport)==null?void 0:l.particleLayer)&&((c=this.map)!=null&&c.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((d=this.map)==null||d.moveLayer((h=this.viewport)==null?void 0:h.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(),(u=this.map)!=null&&u.getLayer((p=this.viewport)==null?void 0:p.rampColorLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(_=this.map)!=null&&_.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((v=this.map)==null||v.moveLayer((w=this.viewport)==null?void 0:w.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.fetchWeatherLayers({tropicals:!1})}}},xo={key:0,className:"map-gl-home"};function vo(a,e,t,r,o,s){var Q,W,j,he,F,S,$,de,H,pe,K,ee,te,ue,ge,be,_e,Le,ke,Ne,Te,Ie,De,Ve,Re,Be;const l=i.resolveComponent("IdmGlLayer"),n=i.resolveComponent("IdmENC"),c=i.resolveComponent("IdmSigWave"),h=i.resolveComponent("IdmSwell"),d=i.resolveComponent("IdmPrmsl"),p=i.resolveComponent("IdmIceberg"),u=i.resolveComponent("IdmTropicals"),m=i.resolveComponent("IdmCurrents"),b=i.resolveComponent("IdmCurrentParticle"),f=i.resolveComponent("IdmWindBarb"),y=i.resolveComponent("IdmWindParticle"),_=i.resolveComponent("IdmPrecip3h"),g=i.resolveComponent("IdmVisibility"),w=i.resolveComponent("IdmWaterTemp"),v=i.resolveComponent("IdmTemp"),L=i.resolveComponent("IdmArctic"),N=i.resolveComponent("IdmWarZone"),T=i.resolveComponent("IdmGmdssArea"),D=i.resolveComponent("IdmEcaZone"),R=i.resolveComponent("IdmAlertZone"),B=i.resolveComponent("IdmPort"),M=i.resolveComponent("IdmLoadLine"),ie=i.resolveComponent("IdmTimezone"),oe=i.resolveComponent("IdmVRA"),re=i.resolveComponent("IdmSpecialArea"),se=i.resolveComponent("IdmTerminator"),ne=i.resolveComponent("IdmLatLng"),le=i.resolveComponent("IdmMeasure"),ce=i.resolveComponent("IdmPoint");return t.map?(i.openBlock(),i.createElementBlock("div",xo,[i.createVNode(l,i.mergeProps({ref:"layer",map:t.map,"toggle-version":o.toggleVersion,"map-projection":o.mapProjection},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=U=>o.showCoord=U),onMeasure:e[1]||(e[1]=U=>o.showMeasure=U),onPoint:e[2]||(e[2]=U=>o.showPoint=U),on3d:s.handle3dToggle,onToggleVersion:e[3]||(e[3]=U=>o.toggleVersion=U)}),null,16,["map","toggle-version","map-projection","onWeather","onOther","on3d"]),i.createVNode(n,i.mergeProps({map:t.map,token:t.token,enabled:(Q=o.otherLayers)==null?void 0:Q.enc,"toggle-version":o.toggleVersion},a.$attrs,{onEnc:e[4]||(e[4]=U=>o.enc=U)}),null,16,["map","token","enabled","toggle-version"]),i.createVNode(c,i.mergeProps({map:t.map,"sig-wave":(W=o.weatherLayers)==null?void 0:W["sig-wave-height"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","sig-wave","before-layer"]),i.createVNode(h,i.mergeProps({map:t.map,swell:(j=o.weatherLayers)==null?void 0:j.swell,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","swell","before-layer"]),i.createVNode(d,i.mergeProps({map:t.map,prmsl:(he=o.weatherLayers)==null?void 0:he.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":o.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),i.createVNode(p,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(u,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(m,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":o.toggleVersion,"weather-layers":o.weatherLayers},a.$attrs,{onParticle:s.handleParticle}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle"]),i.createVNode(b,i.mergeProps({viewport:o.viewport,factor:(de=o.weatherLayers)==null?void 0:de["current-particle"],"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(f,i.mergeProps({ref:"windBarb",map:t.map,"map-projection":o.mapProjection,wind:(H=o.weatherLayers)==null?void 0:H.wind,current:(pe=o.weatherLayers)==null?void 0:pe.current,"before-layer":t.beforeLayer,"margin-bottom":o.showRampColor?"56px":"30px","show-particle":o.showWindParticle},a.$attrs,{"toggle-version":o.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(y,i.mergeProps({viewport:o.viewport,factor:(K=o.weatherLayers)==null?void 0:K["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(_,i.mergeProps({viewport:o.viewport,factor:(ee=o.weatherLayers)==null?void 0:ee.precip3h,"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(g,i.mergeProps({viewport:o.viewport,factor:(te=o.weatherLayers)==null?void 0:te.visibility,"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(w,i.mergeProps({viewport:o.viewport,factor:(ue=o.weatherLayers)==null?void 0:ue["water-temp"],"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(v,i.mergeProps({viewport:o.viewport,factor:(ge=o.weatherLayers)==null?void 0:ge.temp,"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(L,i.mergeProps({viewport:o.viewport,factor:(be=o.weatherLayers)==null?void 0:be.arctic,"before-layer":t.beforeLayer,"toggle-version":o.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),i.createVNode(N,i.mergeProps({map:t.map,zone:(_e=o.otherLayers)==null?void 0:_e["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(T,i.mergeProps({map:t.map,area:(Le=o.otherLayers)==null?void 0:Le["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(D,i.mergeProps({map:t.map,zone:(ke=o.otherLayers)==null?void 0:ke["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(R,i.mergeProps({map:t.map,zone:(Ne=o.otherLayers)==null?void 0:Ne["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(B,i.mergeProps({map:t.map,port:(Te=o.otherLayers)==null?void 0:Te.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),i.createVNode(M,i.mergeProps({map:t.map,line:(Ie=o.otherLayers)==null?void 0:Ie["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),i.createVNode(ie,i.mergeProps({map:t.map,zone:(De=o.otherLayers)==null?void 0:De["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),i.createVNode(oe,i.mergeProps({map:t.map,area:(Ve=o.otherLayers)==null?void 0:Ve["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(re,i.mergeProps({map:t.map,area:(Re=o.otherLayers)==null?void 0:Re["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),i.createVNode(se,i.mergeProps({map:t.map,area:(Be=o.otherLayers)==null?void 0:Be["day-night"]},a.$attrs),null,16,["map","area"]),i.createVNode(ne,i.mergeProps({map:t.map,show:o.showCoord,"toggle-version":o.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),i.createVNode(le,i.mergeProps({map:t.map,show:o.showMeasure},a.$attrs),null,16,["map","show"]),i.createVNode(ce,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 Pe=C(wo,[["render",vo]]),Co={install(a){a.component("MapboxGL",Pe),a.component("TropicalGL",Ce),a.component("LatLngGL",Se)}};k.LatLngGL=Se,k.MapboxGL=Pe,k.MapboxGLPlugin=Co,k.MapboxHelper=Ee,k.ParticleSchema=V,k.TropicalGL=Ce,k.Viewport=we,k.WebGL=J,k.WebGLSchema=I,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});