@idmwx/idmui-gl4 3.2.8 → 3.2.9

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.
@@ -200,7 +200,7 @@
200
200
  <path d="M10 2.5V17.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
201
201
  <path d="M5 7.5L10 2.5L15 7.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
202
202
  </svg>`;s.src="data:image/svg+xml;base64,"+window.btoa(m);const d=[s];let p=0;d.forEach(g=>{g.onload=()=>{p++,this.map.hasImage("currentDirIcon")||this.map.addImage("currentDirIcon",s),p===1&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"currentDirIcon","icon-size":["interpolate",["linear"],["get","spd"],.5,.3,1,.5,1.5,.7,2,.8,3.5,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(a+r),console.log("[current] add elapsed: ",i,", total: ",r+=i)}}},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)}}};function vs(t,e,a,r,i,l){return null}const _s=Y(zs,[["render",vs]]),dy="",Ss={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Vo},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},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,ue.vertexSchema,ue.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)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,Ce.vertexSchema,Ce.fragmentSchema,Ce.quadVertSchema,Ce.screenFragmentSchema,Ce.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()})},handleClearParticle(){var t,e,a,r,i,l,n;(t=this.viewport)==null||t.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},Ms={key:0};function Ns(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Ms,[o.createElementVNode("div",{class:"legend-bars-gl4 current",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.4",-1),o.createElementVNode("span",null,"0.8",-1),o.createElementVNode("span",null,"1.6",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3.2",-1)]),4)])):o.createCommentVNode("",!0)}const Ps=Y(Ss,[["render",Ns]]),hy="",Vs={name:"IdmSigWave",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[sig-wave] 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(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Ts={key:0};function Es(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Ts,[o.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Rs=Y(Vs,[["render",Es],["__scopeId","data-v-b562523c"]]),Ds={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:E.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","symbol-spacing":100,"text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},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 Bs(t,e,a,r,i,l){return null}const Is=Y(Ds,[["render",Bs]]),py="",Gs={name:"IdmSwell",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[sig-wave] 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(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Fs={key:0};function js(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Fs,[o.createElementVNode("div",{class:"legend-bars-gl4 swell",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Ws=Y(Gs,[["render",js],["__scopeId","data-v-7ee2face"]]),Zs={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array},theme:{type:String}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:E.featureCollection([])}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(this.map.addSource(this.source,{type:"geojson",data:n}),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(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":this.theme==="light"?1:.3}},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":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"text-halo-width":1}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-allow-overlap":!0,"text-field":["format",["get","type"],{"font-scale":1.03},`
203
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Xs(t,e,a,r,i,l){return null}const Hs=Y(Zs,[["render",Xs]]),gy="",Os={name:"IdmIceEdge",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] 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(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Ys={key:0};function Us(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Ys,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"70",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"90",-1),o.createElementVNode("span",null,null,-1)]),4)])):o.createCommentVNode("",!0)}const Js=Y(Os,[["render",Us]]),uy="",Ks={name:"IdmCover",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] 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(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Qs={key:0};function qs(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Qs,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"%",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1),o.createElementVNode("span",null,"80",-1),o.createElementVNode("span",null,"100",-1)]),4)])):o.createCommentVNode("",!0)}const $s=Y(Ks,[["render",qs],["__scopeId","data-v-3d1a7675"]]),fy="",ec={name:"IdmThickness",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] 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(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},tc={key:0};function oc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",tc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.6",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1)]),4)])):o.createCommentVNode("",!0)}const ac=Y(ec,[["render",oc]]),yy="",ic={name:"IdmPrecip3h",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},rc={key:0};function lc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",rc,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"mm",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"7",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1)]),4)])):o.createCommentVNode("",!0)}const nc=Y(ic,[["render",lc]]),by="",sc={name:"IdmVisibility",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},cc={key:0};function mc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",cc,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"nm",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const dc=Y(sc,[["render",mc]]),wy="",hc={name:"IdmWaterTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},pc={key:0};function gc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",pc,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const uc=Y(hc,[["render",gc]]),xy="",fc={name:"IdmTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},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,ue.vertexSchema,ue.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)}}},yc={key:0};function bc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",yc,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"-20",-1),o.createElementVNode("span",null,"-10",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const wc=Y(fc,[["render",bc]]),ky="",xc={name:"IdmGlLayer",components:{IdmWindBarb:xs,IdmWindParticle:Cs,IdmCurrentDirection:_s,IdmCurrentParticle:Ps,IdmWave:Rs,IdmSigWaveHeight:Is,IdmSwell:Ws,IdmPrmsl:Hs,IdmIceEdge:Js,IdmIceCover:$s,IdmIceThickness:ac,IdmPrecip3h:nc,IdmVisibility:dc,IdmWaterTemp:uc,IdmTemp:wc},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...Xe.LayerHelper.WEATHER_LAYERS],tagLayers:[...Xe.LayerHelper.WEATHER_LAYERS.filter(t=>!t.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}},computeDateZ(){return function(t){var e;if(t){const a=v(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?v(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;t.push("icon-a-"+n)}return t}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new Vo(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(t,e){t&&e&&v(t).utc().format("yyyy-MM-DD HH")!==v(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="wave-group"?(this.waveToggleValue=this.waveToggleValue||"sig-wave",this.checkList=[...a,"wave-group",this.waveToggleValue]):t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,c;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(c=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||c.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>this.checkList.includes(c.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},waveToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"wave-group",this.waveToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},fetchCache(){var a,r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(e))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(e))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"])),this.checkList.find(i=>this.rendersKeys.includes(i))&&(this.renderKey=this.checkList.find(i=>this.rendersKeys.includes(i))),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(c=>c===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(r==="sig-wave"||r==="swell"||r==="wave-group")this.checkList=[...l,"wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(s=>!this.rendersKeys.includes(s)),c=this.checkList.filter(s=>this.rendersKeys.includes(s));this.checkList=[...n,...c],console.log(2222,this.checkList)}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(n=>!["wave-group","sig-wave","swell"].includes(n)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const t=await le.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,c,s,m,d,p;const e=new Date().valueOf();let a=0;if(this.map){const g=((r=this.map)==null?void 0:r.getZoom())+1,y=(i=this.map)==null?void 0:i.getBounds(),u=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=Xe.LayerHelper.WEATHER_LAYERS.find(f=>{var w;return((w=f.peer)==null?void 0:w.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const f=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],w=await le.get(`${f}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${g}&bbox=${u}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=w==null?void 0:w.data)==null?void 0:n.code)===0){const b=(c=w==null?void 0:w.data)==null?void 0:c.data,A=[];for(const C in b)A.push(le.get(b[C],{headers:{Authorization:this.defaultMeteoToken,key:C},responseType:/\.(jpg|png)$/.test(b[C])?"blob":"json"}).catch(k=>{console.log(`[${C}] fetch layer error: ${k}`)}));const x=await Promise.all(A);this.weatherLayers={},x.map(C=>{var z,P,T,V;const k=((z=C==null?void 0:C.data)==null?void 0:z.data)||(C==null?void 0:C.data);let _=(T=(P=C==null?void 0:C.config)==null?void 0:P.headers)==null?void 0:T.key;_&&k&&(this.weatherLayers[_]={raw:k,type:((V=C==null?void 0:C.config)==null?void 0:V.responseType)==="blob"?"image":"json",etime:w.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(s=this.weatherLayers["swell-direction"])==null?void 0:s.raw,A=(m=this.weatherLayers["swell-height"])==null?void 0:m.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:A},etime:w.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(d=this.weatherLayers["current-direction"])==null?void 0:d.raw,A=(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:b,speed:{raw:A},etime:w.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,f,w,b,A;(A=(b=(w=(f=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:f.idmBottomBar)==null?void 0:w.$refs)==null?void 0:b.capture)==null||A.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1;for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,c,s,m,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:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(s=this.viewport)==null?void 0:s.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((m=this.viewport)==null?void 0:m.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)},handleDrawWeather4Json(){var i,l,n,c,s,m,d;const t=new Date().valueOf();let e=0;const a=(i=this.map)==null?void 0:i.getBounds(),r=(l=this.map)==null?void 0:l.getZoom();if(a&&r){const p=N.LngLatHelper.convertToStdLng(a._sw.lng),g=N.LngLatHelper.convertToStdLng(a._ne.lng),y=Math.floor(a._sw.lat),u=Math.ceil(a._ne.lat);for(const h in this.weatherLayers){let f=!1;if(this.weatherLayers[h].active&&this.weatherLayers[h].type==="json"){let w=[];if(h==="swell"){f=!0;const b=((n=this.weatherLayers[h])==null?void 0:n.direction)||{};for(const x in b)if(x>y&&x<u&&(!(r<=this.zoom)||x%(r<2?10:r<4?5:3)===0)){const C=b[x].lng;p>g?C.forEach((k,_)=>{var z,P,T,V,j,W;if(r<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if((k>=p&&k<=180||k>=-180&&k<=g)&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}}):C.forEach((k,_)=>{var z,P,T,V,j,W;if(p<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if(k>=p&&k<=g&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}})}new Date().valueOf()-(t+e);const A=this.weatherLayers[h].height;if(A){if(!A.data){const x=[];for(const C in(c=A.raw)==null?void 0:c.LineString){const k=A.raw.LineString[C];for(const _ of k)x.push(E.lineString(_,{val:Number(C)}));A.data=E.featureCollection(x)}}if(A.data){const x=this.handleBboxClip(A.data,a);w=w.concat(x)}new Date().valueOf()-(t+e)}}else if(h==="current"){f=!0;const b=((s=this.weatherLayers[h])==null?void 0:s.direction)||{};for(const x in b)if(x>y&&x<u&&(!(r<=this.zoom)||x%(r<2?10:r<4?5:3)===0)){const C=b[x].lng;p>g?C.forEach((k,_)=>{var z,P,T,V,j,W;if(r<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if((k>=p&&k<=180||k>=-180&&k<=g)&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}}):C.forEach((k,_)=>{var z,P,T,V,j,W;if(p<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if(k>=p&&k<=g&&(!(r<=this.zoom)||k%(r<this.zoom/2?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}})}new Date().valueOf()-(t+e);const A=this.weatherLayers[h].speed;if(A){if(!A.data){const C=[];for(const k in(m=A.raw)==null?void 0:m.Polygon){const _=A.raw.Polygon[k];for(const z of _)C.push(E.polygon(z,{val:Number(k)}))}A.data=E.featureCollection(C)}const x=r<this.zoom?A.data.features.filter(C=>C.properties.val>.5):A.data.features;w=w.concat(x),new Date().valueOf()-(t+e)}}else if(h==="wind"){f=!0;const b=this.weatherLayers.wind.raw;for(const A in b)if(A>y&&A<u&&(!(r<=this.zoom)||A%(r<2?10:r<4?5:3)===0)){const x=b[A].lng;p>g?x.forEach((C,k)=>{var _,z,P,T;if(r<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const V=E.point([C,A],{dir:((_=b[A].val)==null?void 0:_[k])||((z=b[A].dir)==null?void 0:z[k]),spd:b[A].spd[k]});w.push(V)}}else if((C>=p&&C<=180||C>=-180&&C<=g)&&(!(r<=this.zoom)||C%(r<2?10:r<4?5:3)===0)){const V=E.point([C,A],{dir:((P=b[A].val)==null?void 0:P[k])||((T=b[A].dir)==null?void 0:T[k]),spd:b[A].spd[k]});w.push(V)}}):x.forEach((C,k)=>{var _,z,P,T;if(r<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const V=E.point([C,A],{dir:((_=b[A].val)==null?void 0:_[k])||((z=b[A].dir)==null?void 0:z[k]),spd:b[A].spd[k]});w.push(V)}}else if(C>=p&&C<=g&&(!(r<=this.zoom)||C%(r<2?10:r<4?5:3)===0)){const V=E.point([C,A],{dir:((P=b[A].val)==null?void 0:P[k])||((T=b[A].dir)==null?void 0:T[k]),spd:b[A].spd[k]});w.push(V)}})}new Date().valueOf()-(t+e)}else if(h==="sig-wave-height"){if(this.weatherLayers[h].data)w=this.weatherLayers[h].data;else{f=!0;const b=this.weatherLayers[h].raw;if(b){const A=[];for(const x in b.Polygon){const C=b.Polygon[x];for(const k of C)A.push(E.polygon(k,{val:Number(x)}))}for(const x in b.MultiPolygon){const C=b.MultiPolygon[x];for(const k of C)A.push(E.multiPolygon(k,{val:Number(x)}))}for(const x in b.Point){const C=b.Point[x];for(let k=0;k<((d=C.lng)==null?void 0:d.length);k++)A.push(E.point([C.lng[k],x],{val:Number(C.val[k])}))}w=w.concat(A)}}new Date().valueOf()-(t+e)}else if(h==="prmsl"){if(this.weatherLayers[h].data)w=this.weatherLayers[h].data;else{f=!0;const b=this.weatherLayers[h].raw;if(b){const A=[];for(const x in b.LineString){const C=b.LineString[x];for(const k of C)A.push(E.lineString(k,{val:Number(x)}))}for(const x in b.Point)b.Point[x].lng.forEach((C,k)=>{C=N.LngLatHelper.convertToStdLng(C),A.push(E.point([C,x],{val:b.Point[x].val[k],type:b.Point[x].type[k]}))});w=w.concat(A)}}new Date().valueOf()-(t+e)}w.length&&(this.weatherLayers[h].data=E.featureCollection(w)),f&&(this.weatherLayers[h].version=Math.random()+1)}}}},handleMove4Weather(){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);this.handleDrawWeather4Json()},handleBboxClip(t,e){const a=[],r=N.LngLatHelper.convertToStdLng(e._sw.lng),i=N.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,e._sw.lat,i,e._ne.lat],c=E.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,e._sw.lat,i,e._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},kc={class:"idm-gl4-meteo-layers"},Ac={key:0,class:"legend-tip-btn-gl4"},Lc={class:"d-flex flex-row justify-center align-center"},Cc={class:"text-caption"},zc={class:"d-flex flex-row justify-center align-center"},vc={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},_c={class:"text-caption px-2"},Sc={class:"d-flex flex-row justify-start align-center"},Mc={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Nc={class:"text-caption"},Pc={class:"d-flex justify-start align-center ga-3"},Vc={class:"text-h5 font-weight-medium"},Tc={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Ec={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},Rc={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},Dc={class:"text-body-1 py-2"},Bc={class:"text-body-1 font-weight-medium"},Ic={class:"text-body-2 text-label"},Gc={class:"text-body-2 text-label"},Fc={class:"text-body-2 text-label mb-3"},jc={class:"text-body-1 font-weight-medium"},Wc={class:"text-body-2 text-label"},Zc={class:"text-body-2 text-label"},Xc={class:"text-body-2 text-label mb-3"},Hc={class:"text-body-1 py-2"},Oc={class:"text-body-1 font-weight-medium"},Yc={class:"text-body-2 text-label"},Uc={class:"text-body-2 text-label"},Jc={class:"text-body-2 text-label mb-3"},Kc={class:"text-body-1 font-weight-medium"},Qc={class:"text-body-2 text-label"},qc={class:"text-body-2 text-label"},$c={class:"text-body-2 text-label mb-3"},em={class:"text-body-1 py-2"},tm={class:"text-body-1 font-weight-medium"},om={class:"text-body-2 text-label"},am={class:"text-body-2 text-label"},im={class:"text-body-2 text-label mb-3"};function rm(t,e,a,r,i,l){var G,F,U,B,D,X,S,Q,re,he,ge,$,se,pe,xe;const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCol"),m=o.resolveComponent("VRow"),d=o.resolveComponent("VCardText"),p=o.resolveComponent("VDivider"),g=o.resolveComponent("VCard"),y=o.resolveComponent("VSwitch"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardTitle"),f=o.resolveComponent("VCardItem"),w=o.resolveComponent("VCheckbox"),b=o.resolveComponent("VRadio"),A=o.resolveComponent("IdmWindBarb"),x=o.resolveComponent("IdmSigWaveHeight"),C=o.resolveComponent("IdmCurrentDirection"),k=o.resolveComponent("IdmPrmsl"),_=o.resolveComponent("IdmWindParticle"),z=o.resolveComponent("IdmCurrentParticle"),P=o.resolveComponent("IdmWave"),T=o.resolveComponent("IdmSwell"),V=o.resolveComponent("IdmIceEdge"),j=o.resolveComponent("IdmIceCover"),W=o.resolveComponent("IdmIceThickness"),O=o.resolveComponent("IdmPrecip3h"),ie=o.resolveComponent("IdmVisibility"),oe=o.resolveComponent("IdmWaterTemp"),M=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",kc,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:Z})=>[o.createVNode(n,o.mergeProps(Z,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[9]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Ac,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"394px":"490px"})},[o.createVNode(c,{text:t.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:Z})=>[o.createVNode(n,o.mergeProps(Z,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ee=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[10]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(g,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"110px"}},{default:o.withCtx(()=>[e[11]||(e[11]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wind Level",-1)),o.createVNode(m,{class:"ma-0 ml-n1 text-body-2"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:Z,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Lc,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ee]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",Cc,o.toDisplayString(Number(Z)<10?`00${Z}kts`:Number(Z)<100?`0${Z}kts`:`${Z}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),o.createVNode(p,{vertical:""}),o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createVNode(m,{class:"ma-0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:ee,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",zc,[ee===0?(o.openBlock(),o.createElementBlock("div",vc)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:Z.color})},null,4)),o.createElementVNode("div",_c,o.toDisplayString(Z.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]}),o.createVNode(p,{vertical:""}),o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"90px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Current",-1)),o.createVNode(m,{class:"ma-0 ml-n4"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:ee,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Sc,[o.createElementVNode("div",Mc,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*Z.size+"px"})},null,4)]),o.createElementVNode("div",Nc,o.toDisplayString(Z.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[13]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",Pc,[o.createElementVNode("div",Vc,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=Z=>i.autoActive=Z),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[14]||(e[14]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[14]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Tc,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(u,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=Z=>i.currentModel=Z),rounded:"",height:"28",density:"compact",mandatory:"",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[15]||(e[15]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[15]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[16]||(e[16]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[16]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(d,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(Z=>Z.overlays),Z=>(o.openBlock(),o.createBlock(w,{key:Z.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ee=>i.checkList=ee),value:Z.key,label:t.$t(`weather.${Z.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(d,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(Z=>!Z.overlays),Z=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:Z.key},[o.createVNode(b,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ee=>i.renderKey=ee),label:t.$t(`weather.${Z.locale}`),value:Z.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ee=>i.renderKey=i.renderKey===Z.key?"":Z.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&Z.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Ec,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ee=>i.showWindParticle=ee),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&Z.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",Rc,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ee=>i.showCurrentParticle=ee),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="wave-group"&&Z.key==="wave-group"?(o.openBlock(),o.createBlock(u,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":e[7]||(e[7]=ee=>i.waveToggleValue=ee),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"sig-wave",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="sig-wave"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="swell"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"swell"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&Z.key==="ice-forecast"?(o.openBlock(),o.createBlock(u,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[8]||(e[8]=ee=>i.iceToggleValue=ee),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(d,{class:""},{default:o.withCtx(()=>{var Z,ee,Pe,ze,be,ke,J,we,ae,me,_e,Te,Ve,I,de,Ae,Se,Me,H,ve,q,je,We,Ze,Le,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,Ct,zt,vt,_t,St,Mt,Nt,Pt,Vt,Tt,Et,Rt,Dt,Bt,It,Gt,Ft,jt,Wt,Zt,Xt,Ht,Ot,Yt,Ut,Jt,Kt,Qt,qt,$t,eo,to,oo,ao,io,ro,lo,no,so,co,mo,ho,po,go,uo,fo,yo,bo,wo,xo,ko,Ao,Lo,Co,zo,vo,_o,So,Mo;return[o.createElementVNode("div",Dc,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",Bc,o.toDisplayString((Pe=(ee=(Z=i.models)==null?void 0:Z.weather)==null?void 0:ee.NOAA)==null?void 0:Pe.source)+" "+o.toDisplayString((ke=(be=(ze=i.models)==null?void 0:ze.weather)==null?void 0:be.NOAA)==null?void 0:ke.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((me=(ae=(we=(J=i.models)==null?void 0:J.weather)==null?void 0:we.NOAA)==null?void 0:ae.meta)==null?void 0:me.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Ic,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Gc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((I=(Ve=(Te=(_e=i.models)==null?void 0:_e.weather)==null?void 0:Te.NOAA)==null?void 0:Ve.meta)==null?void 0:I.availabilityTime)),1),o.createElementVNode("div",Fc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Me=(Se=(Ae=(de=i.models)==null?void 0:de.weather)==null?void 0:Ae.NOAA)==null?void 0:Se.meta)==null?void 0:Me.initialisationTime)),1),o.createElementVNode("div",jc,o.toDisplayString((q=(ve=(H=i.models)==null?void 0:H.weather)==null?void 0:ve.ECMWF)==null?void 0:q.source)+" "+o.toDisplayString((Ze=(We=(je=i.models)==null?void 0:je.weather)==null?void 0:We.ECMWF)==null?void 0:Ze.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((rt=(it=(at=(Le=i.models)==null?void 0:Le.weather)==null?void 0:at.ECMWF)==null?void 0:it.meta)==null?void 0:rt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Wc,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Zc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ct=(st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.meta)==null?void 0:ct.availabilityTime)),1),o.createElementVNode("div",Xc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((pt=(ht=(dt=(mt=i.models)==null?void 0:mt.weather)==null?void 0:dt.ECMWF)==null?void 0:ht.meta)==null?void 0:pt.initialisationTime)),1),o.createVNode(p),o.createElementVNode("div",Hc,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",Oc,o.toDisplayString((yt=(ft=(ut=(gt=i.models)==null?void 0:gt.marine)==null?void 0:ut.wave)==null?void 0:ft.NOAA)==null?void 0:yt.source)+" "+o.toDisplayString((kt=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.NOAA)==null?void 0:kt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((vt=(zt=(Ct=(Lt=(At=i.models)==null?void 0:At.marine)==null?void 0:Lt.wave)==null?void 0:Ct.NOAA)==null?void 0:zt.meta)==null?void 0:vt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Yc,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Uc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Pt=(Nt=(Mt=(St=(_t=i.models)==null?void 0:_t.marine)==null?void 0:St.wave)==null?void 0:Mt.NOAA)==null?void 0:Nt.meta)==null?void 0:Pt.availabilityTime)),1),o.createElementVNode("div",Jc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Dt=(Rt=(Et=(Tt=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Tt.wave)==null?void 0:Et.NOAA)==null?void 0:Rt.meta)==null?void 0:Dt.initialisationTime)),1),o.createElementVNode("div",Kc,o.toDisplayString((Ft=(Gt=(It=(Bt=i.models)==null?void 0:Bt.marine)==null?void 0:It.wave)==null?void 0:Gt.ECMWF)==null?void 0:Ft.source)+" "+o.toDisplayString((Xt=(Zt=(Wt=(jt=i.models)==null?void 0:jt.marine)==null?void 0:Wt.wave)==null?void 0:Zt.ECMWF)==null?void 0:Xt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Jt=(Ut=(Yt=(Ot=(Ht=i.models)==null?void 0:Ht.marine)==null?void 0:Ot.wave)==null?void 0:Yt.ECMWF)==null?void 0:Ut.meta)==null?void 0:Jt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Qc,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",qc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((eo=($t=(qt=(Qt=(Kt=i.models)==null?void 0:Kt.marine)==null?void 0:Qt.wave)==null?void 0:qt.ECMWF)==null?void 0:$t.meta)==null?void 0:eo.availabilityTime)),1),o.createElementVNode("div",$c,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((ro=(io=(ao=(oo=(to=i.models)==null?void 0:to.marine)==null?void 0:oo.wave)==null?void 0:ao.ECMWF)==null?void 0:io.meta)==null?void 0:ro.initialisationTime)),1),o.createVNode(p),o.createElementVNode("div",em,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",tm,o.toDisplayString((co=(so=(no=(lo=i.models)==null?void 0:lo.marine)==null?void 0:no.current)==null?void 0:so.ECMWF)==null?void 0:co.source)+" "+o.toDisplayString((go=(po=(ho=(mo=i.models)==null?void 0:mo.marine)==null?void 0:ho.current)==null?void 0:po.ECMWF)==null?void 0:go.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((wo=(bo=(yo=(fo=(uo=i.models)==null?void 0:uo.marine)==null?void 0:fo.current)==null?void 0:yo.ECMWF)==null?void 0:bo.meta)==null?void 0:wo.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",om,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",am,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Co=(Lo=(Ao=(ko=(xo=i.models)==null?void 0:xo.marine)==null?void 0:ko.current)==null?void 0:Ao.ECMWF)==null?void 0:Lo.meta)==null?void 0:Co.availabilityTime)),1),o.createElementVNode("div",im,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Mo=(So=(_o=(vo=(zo=i.models)==null?void 0:zo.marine)==null?void 0:vo.current)==null?void 0:_o.ECMWF)==null?void 0:So.meta)==null?void 0:Mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(G=i.weatherLayers)==null?void 0:G.wind,"menu-toggle":a.menuToggle},t.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(F=i.weatherLayers)==null?void 0:F["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},t.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(U=i.weatherLayers)==null?void 0:U.current,"menu-toggle":a.menuToggle},t.$attrs),null,16,["map","map-feather","current","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-3",prmsl:(B=i.weatherLayers)==null?void 0:B.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:5,viewport:i.viewport,factor:(D=i.weatherLayers)==null?void 0:D["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:6,viewport:i.viewport,factor:(X=i.weatherLayers)==null?void 0:X["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(P,o.mergeProps({key:7,viewport:i.viewport,factor:(S=i.weatherLayers)==null?void 0:S["sig-wave"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(Q=i.weatherLayers)==null?void 0:Q.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers,simple:a.simple},t.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(V,o.mergeProps({key:9,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(j,o.mergeProps({key:10,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(W,o.mergeProps({key:11,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(O,o.mergeProps({key:12,viewport:i.viewport,factor:($=i.weatherLayers)==null?void 0:$.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(ie,o.mergeProps({key:13,viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(oe,o.mergeProps({key:14,viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:15,viewport:i.viewport,factor:(xe=i.weatherLayers)==null?void 0:xe.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const lm=Y(xc,[["render",rm]]),Ke=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],Qe=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let sa=class{static standardWeatherModels(){return Ke.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return Qe.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),ir.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=Ke.find(d=>{var p,g,y;return((p=d.models)==null?void 0:p.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c}),m=Qe.find(d=>{var p,g,y;return((p=d.models)==null?void 0:p.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c});s=s||Ke.find(d=>{var p,g;return((p=d.alias)==null?void 0:p.toLowerCase())===((g=m==null?void 0:m.alias)==null?void 0:g.toLowerCase())}),m=m||Qe.find(d=>{var p,g;return((p=d.alias)==null?void 0:p.toLowerCase())===((g=s==null?void 0:s.alias)==null?void 0:g.toLowerCase())}),s=s||Ke[0],m=m||Qe[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=m.models)!=null&&r.includes(c)?c:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=Ke.filter(l=>l.alias===e),r=Qe.filter(l=>l.alias===e),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(e,a){var r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G,F,U,B,D,X,S,Q,re,he,ge,$,se,pe,xe,Z,ee,Pe,ze,be,ke;const J=typeof a=="string"?v(a):a,we=e==null?void 0:e.weather,ae=e==null?void 0:e.marine,me=v((i=(r=we==null?void 0:we[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),_e=me.clone().add((c=(n=(l=we==null?void 0:we[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),Te=me.clone().add((d=(m=(s=we==null?void 0:we[0])==null?void 0:s.hourly)==null?void 0:m.time)==null?void 0:d.at(-1),"h"),Ve=[];if(J.isBetween(_e,Te,"millisecond","[]")){const I=J.utc().diff(_e,"h",!1);let de,Ae;if(we){let Se=0,Me=0,H=0;for(const ve of we){const q=ve==null?void 0:ve.hourly;for(let Le=I-(I-1)%3;Le<=I;Le++)Se+=(p=q==null?void 0:q.precipitation)==null?void 0:p.at(Le);for(let Le=I-(I-1)%6;Le<=I;Le++)Me+=(g=q==null?void 0:q.precipitation)==null?void 0:g.at(Le);for(let Le=I-(I-1)%12;Le<=I;Le++)H+=(y=q==null?void 0:q.precipitation)==null?void 0:y.at(Le);de={temp:(u=q==null?void 0:q.temperature_2m)==null?void 0:u.at(I),apparentTemp:(h=q==null?void 0:q.apparent_temperature)==null?void 0:h.at(I),rh:(f=q==null?void 0:q.relative_humidity_2m)==null?void 0:f.at(I),dp:(w=q==null?void 0:q.dew_point_2m)==null?void 0:w.at(I),precip:{probability:(b=q==null?void 0:q.precipitation_probability)==null?void 0:b.at(I),sum:(A=q==null?void 0:q.precipitation)==null?void 0:A.at(I),sum1Hours:(x=q==null?void 0:q.precipitation)==null?void 0:x.at(I),sum3Hours:Math.round(Se*100)/100,sum6Hours:Math.round(Me*100)/100,sum12Hours:Math.round(H*100)/100},pmsl:(C=q==null?void 0:q.pressure_msl)==null?void 0:C.at(I),psurf:(k=q==null?void 0:q.surface_pressure)==null?void 0:k.at(I),code:(_=q==null?void 0:q.weather_code)==null?void 0:_.at(I),visibility:this.m2nm((z=q==null?void 0:q.visibility)==null?void 0:z.at(I)),wind:{speed:(P=q==null?void 0:q.wind_speed_10m)==null?void 0:P.at(I),kts:(T=q==null?void 0:q.wind_speed_10m)==null?void 0:T.at(I),degree:(V=q==null?void 0:q.wind_direction_10m)==null?void 0:V.at(I),bearing:((j=q==null?void 0:q.wind_direction_10m)==null?void 0:j.at(I))!==null?(((W=q==null?void 0:q.wind_direction_10m)==null?void 0:W.at(I))+180)%360:null,gusts:(O=q==null?void 0:q.wind_gusts_10m)==null?void 0:O.at(I)},isDay:(ie=q==null?void 0:q.is_day)==null?void 0:ie.at(I)};const{name:je,url:We,bg:Ze}=this.parseWeatherCode(de.code,de.isDay);de.name=je,de.url=We,de.bg=Ze,de.wind.scale=this.beaufort(this.kts2ms(de.wind.kts)),de.wind.direction=this.degree2Direction(de.wind.degree),Ve.push({utc:_e.add(I,"h").format(),model:ve.model,weather:{...de}})}}if(ae){let Se=0;for(const Me of ae){const H=Me==null?void 0:Me.hourly;Ae={wave:{sig:{height:(oe=H==null?void 0:H.wave_height)==null?void 0:oe.at(I),degree:(M=H==null?void 0:H.wave_direction)==null?void 0:M.at(I),bearing:((G=H==null?void 0:H.wave_direction)==null?void 0:G.at(I))!==null?(((F=H==null?void 0:H.wave_direction)==null?void 0:F.at(I))+180)%360:null,period:(U=H==null?void 0:H.wave_period)==null?void 0:U.at(I)},swell:{height:(B=H==null?void 0:H.swell_wave_height)==null?void 0:B.at(I),degree:(D=H==null?void 0:H.swell_wave_direction)==null?void 0:D.at(I),bearing:((X=H==null?void 0:H.swell_wave_direction)==null?void 0:X.at(I))!==null?(((S=H==null?void 0:H.swell_wave_direction)==null?void 0:S.at(I))+180)%360:null,period:(Q=H==null?void 0:H.swell_wave_period)==null?void 0:Q.at(I),peakPeriod:(re=H==null?void 0:H.swell_wave_peak_period)==null?void 0:re.at(I)},wd:{height:(he=H==null?void 0:H.wind_wave_height)==null?void 0:he.at(I),degree:(ge=H==null?void 0:H.wind_wave_direction)==null?void 0:ge.at(I),bearing:(($=H==null?void 0:H.wind_wave_direction)==null?void 0:$.at(I))!==null?(((se=H==null?void 0:H.wind_wave_direction)==null?void 0:se.at(I))+180)%360:null,period:(pe=H==null?void 0:H.wind_wave_period)==null?void 0:pe.at(I),peakPeriod:(xe=H==null?void 0:H.wind_wave_peak_period)==null?void 0:xe.at(I)}},current:{speed:(Z=H==null?void 0:H.ocean_current_velocity)==null?void 0:Z.at(I),kts:(ee=H==null?void 0:H.ocean_current_velocity)==null?void 0:ee.at(I),degree:(Pe=H==null?void 0:H.ocean_current_direction)==null?void 0:Pe.at(I),bearing:((ze=H==null?void 0:H.ocean_current_direction)==null?void 0:ze.at(I))??null},sst:(be=H==null?void 0:H.sea_surface_temperature)==null?void 0:be.at(I),height:(ke=H==null?void 0:H.sea_level_height_msl)==null?void 0:ke.at(I)},Ae.wave=this.parseWave(Ae.wave,de==null?void 0:de.wind),Ae.current.direction=this.degree2Direction(Ae.current.degree),Object.assign(Ve[Se],Ae),Se++}}}return Ve}static toLegacy(e){var a,r,i,l,n,c,s,m,d,p;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=e==null?void 0:e.weather)==null?void 0:s.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(p=e==null?void 0:e.weather)==null?void 0:p.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model}}static pickDaily(e,a){var r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G,F,U,B,D,X,S,Q,re,he,ge,$,se;const pe=typeof a=="string"?v(a):a,xe=e==null?void 0:e.weather,Z=e==null?void 0:e.marine,ee=v((l=(i=(r=xe==null?void 0:xe[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Pe=v((s=(c=(n=xe==null?void 0:xe[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),ze=[];if(pe.isBetween(ee,Pe,"millisecond","[]")){let be,ke;const J=pe.diff(ee,"d",!1);if(xe)for(const we of xe){const ae=we.daily;be={code:(m=ae.weather_code)==null?void 0:m.at(J),temp:{max:(d=ae.temperature_2m_max)==null?void 0:d.at(J),min:(p=ae.temperature_2m_min)==null?void 0:p.at(J),mean:(g=ae.temperature_2m_mean)==null?void 0:g.at(J)},apparentTemp:{max:(y=ae.apparent_temperature_max)==null?void 0:y.at(J),min:(u=ae.apparent_temperature_min)==null?void 0:u.at(J)},precip:{sum:(h=ae.precipitation_sum)==null?void 0:h.at(J),rainSum:(f=ae.rain_sum)==null?void 0:f.at(J),snowfallSum:(w=ae.snowfall_sum)==null?void 0:w.at(J),showersSum:(b=ae.showers_sum)==null?void 0:b.at(J),hours:(A=ae.precipitation_hours)==null?void 0:A.at(J),probability:(x=ae.precipitation_probability_max)==null?void 0:x.at(J)},rh:{max:(C=ae.relative_humidity_2m_max)==null?void 0:C.at(J),min:(k=ae.relative_humidity_2m_min)==null?void 0:k.at(J),mean:(_=ae.relative_humidity_2m_mean)==null?void 0:_.at(J)},wind:{speed:(z=ae.wind_speed_10m_max)==null?void 0:z.at(J),kts:(P=ae.wind_speed_10m_max)==null?void 0:P.at(J),degree:(T=ae.wind_direction_10m_dominant)==null?void 0:T.at(J),gusts:(V=ae.wind_gusts_10m_max)==null?void 0:V.at(J),bearing:((j=ae.wind_direction_10m_dominant)==null?void 0:j.at(J))!==null?(((W=ae.wind_direction_10m_dominant)==null?void 0:W.at(J))+180)%360:null}};const{name:me,url:_e,bg:Te}=this.parseWeatherCode(be.code,!0);be.name=me,be.url=_e,be.bg=Te,be.wind.scale=this.beaufort(this.kts2ms(be.wind.kts)),be.wind.direction=this.degree2Direction(be.wind.degree),ze.push({utc:ee.add(J,"d").utc().format(),model:we.model,weather:{...be}})}if(Z){let we=0;for(const ae of Z){const me=ae.daily;ke={wave:{sig:{height:(O=me.wave_height_max)==null?void 0:O.at(J),degree:(ie=me.wave_direction_dominant)==null?void 0:ie.at(J),period:(oe=me.wave_period_max)==null?void 0:oe.at(J),bearing:((M=me.wave_direction_dominant)==null?void 0:M.at(J))!==null?(((G=me.wave_direction_dominant)==null?void 0:G.at(J))+180)%360:null},swell:{height:(F=me.swell_wave_height_max)==null?void 0:F.at(J),degree:(U=me.swell_wave_direction_dominant)==null?void 0:U.at(J),period:(B=me.swell_wave_period_max)==null?void 0:B.at(J),peakPeriod:(D=me.swell_wave_peak_period_max)==null?void 0:D.at(J),bearing:((X=me.swell_wave_direction_dominant)==null?void 0:X.at(J))!==null?((S=me.swell_wave_direction_dominant)==null?void 0:S.at(J))%360:null},wd:{height:(Q=me.wind_wave_height_max)==null?void 0:Q.at(J),degree:(re=me.wind_wave_direction_dominant)==null?void 0:re.at(J),period:(he=me.wind_wave_period_max)==null?void 0:he.at(J),peakPeriod:(ge=me.wind_wave_peak_period_max)==null?void 0:ge.at(J),bearing:(($=me.wind_wave_direction_dominant)==null?void 0:$.at(J))!==null?(((se=me.wind_wave_direction_dominant)==null?void 0:se.at(J))+180)%360:null}}},ke.wave=this.parseWave(ke.wave,be==null?void 0:be.wind),Object.assign(ze[we],ke),we++}}}return ze}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height===0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=Math.round(r*100)/100}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r;e.swell.height=Math.round(i*100)/100}if(e.wd.height===0||e.wd.height>e.sig.height)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(r*100)/100}return e.swell.height>e.sig.height&&(e.swell.height=Math.round(e.sig.height*.76*100)/100),e.sig.period||(e.sig.period=Math.round(5*Math.sqrt(e.sig.height))),e.swell.period||(e.swell.period=Math.round(5*Math.sqrt(e.swell.height))),e.wd.period||(e.wd.period=Math.round(5*Math.sqrt(e.wd.height))),e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const Ay="",nm={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalProbability","tropicalNotification"],setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,helper:Xe.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:E.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(t,e)=>{if(t){const a=v(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=v(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),c=`(UTC ${l>=0?"+":""}${l})`;return n+" "+c}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=sa.kts2ms(t);return sa.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":N.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},map:{handler(){this.map?(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=Xe.LayerHelper.WEATHER_LAYERS.find(c=>c.key==="tropicals"))==null?void 0:i.weight;if(r>0){const c=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],s=await le.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const m=(n=s==null?void 0:s.data)==null?void 0:n.data;await le.get(m.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var y,u,h;const p=N.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((h=(u=d==null?void 0:d.config)==null?void 0:u.headers)==null?void 0:h.key)&&p&&(this.tropicals={data:p,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((p=r.properties.wind)==null?void 0:p.kts)<79||((g=r.properties)==null?void 0:g.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((u=r.properties)==null?void 0:u.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((f=r.properties)==null?void 0:f.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((w=r.geometry)==null?void 0:w.type)==="Point"&&((b=r.properties)!=null&&b.important)&&(r.properties.format=(x=(A=v(r.properties.date))==null?void 0:A.utcOffset(this.timeZone))==null?void 0:x.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((C=r.geometry)==null?void 0:C.type)==="Point"&&(r.properties.Name=((_=(k=r.properties.name)==null?void 0:k.trim())==null?void 0:_.replace(/^./,z=>z.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,c,s,m,d,p;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(s=(c=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:c.idmBottomBar)==null||s.handleToggle("tropical",!0):(p=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||p.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,c,s,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let p=0,g=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),g=new Date().valueOf()-(d+p),console.log("[tropicals] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.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":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),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",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),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":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),g=new Date().valueOf()-(d+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((c=this.map)==null||c.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),g=new Date().valueOf()-(d+p),console.log("[tropical] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(m=this.tropicals)==null?void 0:m.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":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),g=new Date().valueOf()-(d+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g));const y=N.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var t,e,a,r;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(i=>i==null?void 0:i.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)),(e=this.map)==null||e.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),this.handleCloseInfoMarker()},handleDateChange(){var t,e,a,r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G;if((t=this.interpolateMarkers)==null||t.forEach(F=>F==null?void 0:F.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const F=v(this.realTime).utc().set({minute:0,second:0,millisecond:0}),U=this.interpolateData.filter(S=>S.properties.date===(F==null?void 0:F.format())&&!S.properties.disabled),B=this.handleComputePolygons(U),D=E.featureCollection([...U]);B.forEach(S=>{D.features.push(S)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(D):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:D}),(l=this.map)==null||l.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,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const X=[];for(const S of U)if(!S.properties.disabled){if(!X.some($=>{var se;return $.properties.name===((se=S.properties)==null?void 0:se.name)})){const $=((c=(n=this.tropicals.data.features.find(se=>{var pe;return se.properties.name===((pe=S.properties)==null?void 0:pe.name)}))==null?void 0:n.properties)==null?void 0:c.nameCn)||((s=S.properties)==null?void 0:s.Name)||"-";S.properties.nameCn=$,S.properties.Name=((d=(m=S.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,se=>se.toUpperCase()))||S.properties.nameCn,X.push(S)}let Q=this.Theme.current.value.colors["tropicals-ty"];((g=(p=S.properties)==null?void 0:p.wind)==null?void 0:g.kts)<32||!((u=(y=S.properties)==null?void 0:y.wind)!=null&&u.kts)?Q=this.Theme.current.value.colors["tropicals-td"]:((f=(h=S.properties)==null?void 0:h.wind)==null?void 0:f.kts)>=32&&((b=(w=S.properties)==null?void 0:w.wind)==null?void 0:b.kts)<47?Q=this.Theme.current.value.colors["tropicals-ts"]:((x=(A=S.properties)==null?void 0:A.wind)==null?void 0:x.kts)>=47&&((k=(C=S.properties)==null?void 0:C.wind)==null?void 0:k.kts)<63?Q=this.Theme.current.value.colors["tropicals-sts"]:((z=(_=S.properties)==null?void 0:_.wind)==null?void 0:z.kts)>=63&&((T=(P=S.properties)==null?void 0:P.wind)==null?void 0:T.kts)<79?Q=this.Theme.current.value.colors["tropicals-ty"]:((j=(V=S.properties)==null?void 0:V.wind)==null?void 0:j.kts)>=79&&((O=(W=S.properties)==null?void 0:W.wind)==null?void 0:O.kts)<94?Q=this.Theme.current.value.colors["tropicals-sty"]:((oe=(ie=S.properties)==null?void 0:ie.wind)==null?void 0:oe.kts)>=94?Q=this.Theme.current.value.colors["tropicals-super-ty"]:Q=this.Theme.current.value.colors["tropicals-ty"];const re=`<svg t="1719918955501"
203
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Xs(t,e,a,r,i,l){return null}const Hs=Y(Zs,[["render",Xs]]),gy="",Os={name:"IdmIceEdge",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] 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(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Ys={key:0};function Us(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Ys,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"70",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"90",-1),o.createElementVNode("span",null,null,-1)]),4)])):o.createCommentVNode("",!0)}const Js=Y(Os,[["render",Us]]),uy="",Ks={name:"IdmCover",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] 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(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},Qs={key:0};function qs(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Qs,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"%",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1),o.createElementVNode("span",null,"80",-1),o.createElementVNode("span",null,"100",-1)]),4)])):o.createCommentVNode("",!0)}const $s=Y(Ks,[["render",qs],["__scopeId","data-v-3d1a7675"]]),fy="",ec={name:"IdmThickness",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] 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(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,ue.vertexSchema,ue.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)}}},tc={key:0};function oc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",tc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.6",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1)]),4)])):o.createCommentVNode("",!0)}const ac=Y(ec,[["render",oc]]),yy="",ic={name:"IdmPrecip3h",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},rc={key:0};function lc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",rc,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"mm",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"7",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1)]),4)])):o.createCommentVNode("",!0)}const nc=Y(ic,[["render",lc]]),by="",sc={name:"IdmVisibility",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},cc={key:0};function mc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",cc,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"nm",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const dc=Y(sc,[["render",mc]]),wy="",hc={name:"IdmWaterTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){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,ue.vertexSchema,ue.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)}}},pc={key:0};function gc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",pc,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const uc=Y(hc,[["render",gc]]),xy="",fc={name:"IdmTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Ne,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},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,ue.vertexSchema,ue.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)}}},yc={key:0};function bc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",yc,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"-20",-1),o.createElementVNode("span",null,"-10",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const wc=Y(fc,[["render",bc]]),ky="",xc={name:"IdmGlLayer",components:{IdmWindBarb:xs,IdmWindParticle:Cs,IdmCurrentDirection:_s,IdmCurrentParticle:Ps,IdmWave:Rs,IdmSigWaveHeight:Is,IdmSwell:Ws,IdmPrmsl:Hs,IdmIceEdge:Js,IdmIceCover:$s,IdmIceThickness:ac,IdmPrecip3h:nc,IdmVisibility:dc,IdmWaterTemp:uc,IdmTemp:wc},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...Xe.LayerHelper.WEATHER_LAYERS],tagLayers:[...Xe.LayerHelper.WEATHER_LAYERS.filter(t=>!t.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}},computeDateZ(){return function(t){var e;if(t){const a=v(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?v(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;t.push("icon-a-"+n)}return t}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new Vo(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(t,e){t&&e&&v(t).utc().format("yyyy-MM-DD HH")!==v(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="wave-group"?(this.waveToggleValue=this.waveToggleValue||"sig-wave",this.checkList=[...a,"wave-group",this.waveToggleValue]):t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,c;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(c=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||c.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>this.checkList.includes(c.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},waveToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"wave-group",this.waveToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},fetchCache(){var a,r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(e))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(e))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"])),this.checkList.find(i=>this.rendersKeys.includes(i))&&(this.renderKey=this.checkList.find(i=>this.rendersKeys.includes(i))),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return this.handleMove4Weather(),!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(c=>c===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(r==="sig-wave"||r==="swell"||r==="wave-group")this.checkList=[...l,"wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(s=>!this.rendersKeys.includes(s)),c=this.checkList.filter(s=>this.rendersKeys.includes(s));this.checkList=[...n,...c],console.log(2222,this.checkList)}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(n=>!["wave-group","sig-wave","swell"].includes(n)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const t=await le.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,c,s,m,d,p;const e=new Date().valueOf();let a=0;if(this.map){const g=((r=this.map)==null?void 0:r.getZoom())+1,y=(i=this.map)==null?void 0:i.getBounds(),u=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=Xe.LayerHelper.WEATHER_LAYERS.find(f=>{var w;return((w=f.peer)==null?void 0:w.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const f=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],w=await le.get(`${f}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${g}&bbox=${u}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=w==null?void 0:w.data)==null?void 0:n.code)===0){const b=(c=w==null?void 0:w.data)==null?void 0:c.data,A=[];for(const C in b)A.push(le.get(b[C],{headers:{Authorization:this.defaultMeteoToken,key:C},responseType:/\.(jpg|png)$/.test(b[C])?"blob":"json"}).catch(k=>{console.log(`[${C}] fetch layer error: ${k}`)}));const x=await Promise.all(A);this.weatherLayers={},x.map(C=>{var z,P,T,V;const k=((z=C==null?void 0:C.data)==null?void 0:z.data)||(C==null?void 0:C.data);let _=(T=(P=C==null?void 0:C.config)==null?void 0:P.headers)==null?void 0:T.key;_&&k&&(this.weatherLayers[_]={raw:k,type:((V=C==null?void 0:C.config)==null?void 0:V.responseType)==="blob"?"image":"json",etime:w.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(s=this.weatherLayers["swell-direction"])==null?void 0:s.raw,A=(m=this.weatherLayers["swell-height"])==null?void 0:m.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:A},etime:w.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(d=this.weatherLayers["current-direction"])==null?void 0:d.raw,A=(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:b,speed:{raw:A},etime:w.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,f,w,b,A;(A=(b=(w=(f=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:f.idmBottomBar)==null?void 0:w.$refs)==null?void 0:b.capture)==null||A.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1,console.log(333,t);for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,c,s,m,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:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(s=this.viewport)==null?void 0:s.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((m=this.viewport)==null?void 0:m.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)},handleDrawWeather4Json(){var i,l,n,c,s,m,d;const t=new Date().valueOf();let e=0;const a=(i=this.map)==null?void 0:i.getBounds(),r=(l=this.map)==null?void 0:l.getZoom();if(a&&r){const p=N.LngLatHelper.convertToStdLng(a._sw.lng),g=N.LngLatHelper.convertToStdLng(a._ne.lng),y=Math.floor(a._sw.lat),u=Math.ceil(a._ne.lat);for(const h in this.weatherLayers){let f=!1;if(this.weatherLayers[h].active&&this.weatherLayers[h].type==="json"){let w=[];if(h==="swell"){f=!0;const b=((n=this.weatherLayers[h])==null?void 0:n.direction)||{};for(const x in b)if(x>y&&x<u&&(!(r<=this.zoom)||x%(r<2?10:r<4?5:3)===0)){const C=b[x].lng;p>g?C.forEach((k,_)=>{var z,P,T,V,j,W;if(r<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if((k>=p&&k<=180||k>=-180&&k<=g)&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}}):C.forEach((k,_)=>{var z,P,T,V,j,W;if(p<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if(k>=p&&k<=g&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}})}new Date().valueOf()-(t+e);const A=this.weatherLayers[h].height;if(A){if(!A.data){const x=[];for(const C in(c=A.raw)==null?void 0:c.LineString){const k=A.raw.LineString[C];for(const _ of k)x.push(E.lineString(_,{val:Number(C)}));A.data=E.featureCollection(x)}}if(A.data){const x=this.handleBboxClip(A.data,a);w=w.concat(x)}new Date().valueOf()-(t+e)}}else if(h==="current"){f=!0;const b=((s=this.weatherLayers[h])==null?void 0:s.direction)||{};for(const x in b)if(x>y&&x<u&&(!(r<=this.zoom)||x%(r<2?10:r<4?5:3)===0)){const C=b[x].lng;p>g?C.forEach((k,_)=>{var z,P,T,V,j,W;if(r<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if((k>=p&&k<=180||k>=-180&&k<=g)&&(!(r<=this.zoom)||k%(r<2?10:r<4?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}}):C.forEach((k,_)=>{var z,P,T,V,j,W;if(p<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const O=E.point([k,x],{val:((z=b[x].val)==null?void 0:z[_])||((P=b[x].dir)==null?void 0:P[_]),spd:(T=b[x].spd)==null?void 0:T[_]});w.push(O)}}else if(k>=p&&k<=g&&(!(r<=this.zoom)||k%(r<this.zoom/2?5:3)===0)){const O=E.point([k,x],{val:((V=b[x].val)==null?void 0:V[_])||((j=b[x].dir)==null?void 0:j[_]),spd:(W=b[x].spd)==null?void 0:W[_]});w.push(O)}})}new Date().valueOf()-(t+e);const A=this.weatherLayers[h].speed;if(A){if(!A.data){const C=[];for(const k in(m=A.raw)==null?void 0:m.Polygon){const _=A.raw.Polygon[k];for(const z of _)C.push(E.polygon(z,{val:Number(k)}))}A.data=E.featureCollection(C)}const x=r<this.zoom?A.data.features.filter(C=>C.properties.val>.5):A.data.features;w=w.concat(x),new Date().valueOf()-(t+e)}}else if(h==="wind"){f=!0;const b=this.weatherLayers.wind.raw;for(const A in b)if(A>y&&A<u&&(!(r<=this.zoom)||A%(r<2?10:r<4?5:3)===0)){const x=b[A].lng;p>g?x.forEach((C,k)=>{var _,z,P,T;if(r<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const V=E.point([C,A],{dir:((_=b[A].val)==null?void 0:_[k])||((z=b[A].dir)==null?void 0:z[k]),spd:b[A].spd[k]});w.push(V)}}else if((C>=p&&C<=180||C>=-180&&C<=g)&&(!(r<=this.zoom)||C%(r<2?10:r<4?5:3)===0)){const V=E.point([C,A],{dir:((P=b[A].val)==null?void 0:P[k])||((T=b[A].dir)==null?void 0:T[k]),spd:b[A].spd[k]});w.push(V)}}):x.forEach((C,k)=>{var _,z,P,T;if(r<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const V=E.point([C,A],{dir:((_=b[A].val)==null?void 0:_[k])||((z=b[A].dir)==null?void 0:z[k]),spd:b[A].spd[k]});w.push(V)}}else if(C>=p&&C<=g&&(!(r<=this.zoom)||C%(r<2?10:r<4?5:3)===0)){const V=E.point([C,A],{dir:((P=b[A].val)==null?void 0:P[k])||((T=b[A].dir)==null?void 0:T[k]),spd:b[A].spd[k]});w.push(V)}})}new Date().valueOf()-(t+e)}else if(h==="sig-wave-height"){if(this.weatherLayers[h].data)w=this.weatherLayers[h].data;else{f=!0;const b=this.weatherLayers[h].raw;if(b){const A=[];for(const x in b.Polygon){const C=b.Polygon[x];for(const k of C)A.push(E.polygon(k,{val:Number(x)}))}for(const x in b.MultiPolygon){const C=b.MultiPolygon[x];for(const k of C)A.push(E.multiPolygon(k,{val:Number(x)}))}for(const x in b.Point){const C=b.Point[x];for(let k=0;k<((d=C.lng)==null?void 0:d.length);k++)A.push(E.point([C.lng[k],x],{val:Number(C.val[k])}))}w=w.concat(A)}}new Date().valueOf()-(t+e)}else if(h==="prmsl"){if(this.weatherLayers[h].data)w=this.weatherLayers[h].data;else{f=!0;const b=this.weatherLayers[h].raw;if(b){const A=[];for(const x in b.LineString){const C=b.LineString[x];for(const k of C)A.push(E.lineString(k,{val:Number(x)}))}for(const x in b.Point)b.Point[x].lng.forEach((C,k)=>{C=N.LngLatHelper.convertToStdLng(C),A.push(E.point([C,x],{val:b.Point[x].val[k],type:b.Point[x].type[k]}))});w=w.concat(A)}}new Date().valueOf()-(t+e)}w.length&&(this.weatherLayers[h].data=E.featureCollection(w)),f&&(this.weatherLayers[h].version=Math.random()+1)}}}},handleMove4Weather(){console.log(444,"[handleMove4Weather]");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);this.handleDrawWeather4Json()},handleBboxClip(t,e){const a=[],r=N.LngLatHelper.convertToStdLng(e._sw.lng),i=N.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,e._sw.lat,i,e._ne.lat],c=E.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,e._sw.lat,i,e._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},kc={class:"idm-gl4-meteo-layers"},Ac={key:0,class:"legend-tip-btn-gl4"},Lc={class:"d-flex flex-row justify-center align-center"},Cc={class:"text-caption"},zc={class:"d-flex flex-row justify-center align-center"},vc={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},_c={class:"text-caption px-2"},Sc={class:"d-flex flex-row justify-start align-center"},Mc={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Nc={class:"text-caption"},Pc={class:"d-flex justify-start align-center ga-3"},Vc={class:"text-h5 font-weight-medium"},Tc={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Ec={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},Rc={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},Dc={class:"text-body-1 py-2"},Bc={class:"text-body-1 font-weight-medium"},Ic={class:"text-body-2 text-label"},Gc={class:"text-body-2 text-label"},Fc={class:"text-body-2 text-label mb-3"},jc={class:"text-body-1 font-weight-medium"},Wc={class:"text-body-2 text-label"},Zc={class:"text-body-2 text-label"},Xc={class:"text-body-2 text-label mb-3"},Hc={class:"text-body-1 py-2"},Oc={class:"text-body-1 font-weight-medium"},Yc={class:"text-body-2 text-label"},Uc={class:"text-body-2 text-label"},Jc={class:"text-body-2 text-label mb-3"},Kc={class:"text-body-1 font-weight-medium"},Qc={class:"text-body-2 text-label"},qc={class:"text-body-2 text-label"},$c={class:"text-body-2 text-label mb-3"},em={class:"text-body-1 py-2"},tm={class:"text-body-1 font-weight-medium"},om={class:"text-body-2 text-label"},am={class:"text-body-2 text-label"},im={class:"text-body-2 text-label mb-3"};function rm(t,e,a,r,i,l){var G,F,U,B,D,X,S,Q,re,he,ge,$,se,pe,xe;const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCol"),m=o.resolveComponent("VRow"),d=o.resolveComponent("VCardText"),p=o.resolveComponent("VDivider"),g=o.resolveComponent("VCard"),y=o.resolveComponent("VSwitch"),u=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardTitle"),f=o.resolveComponent("VCardItem"),w=o.resolveComponent("VCheckbox"),b=o.resolveComponent("VRadio"),A=o.resolveComponent("IdmWindBarb"),x=o.resolveComponent("IdmSigWaveHeight"),C=o.resolveComponent("IdmCurrentDirection"),k=o.resolveComponent("IdmPrmsl"),_=o.resolveComponent("IdmWindParticle"),z=o.resolveComponent("IdmCurrentParticle"),P=o.resolveComponent("IdmWave"),T=o.resolveComponent("IdmSwell"),V=o.resolveComponent("IdmIceEdge"),j=o.resolveComponent("IdmIceCover"),W=o.resolveComponent("IdmIceThickness"),O=o.resolveComponent("IdmPrecip3h"),ie=o.resolveComponent("IdmVisibility"),oe=o.resolveComponent("IdmWaterTemp"),M=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",kc,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(c,{text:t.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:Z})=>[o.createVNode(n,o.mergeProps(Z,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[9]||(e[9]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[9]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Ac,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"394px":"490px"})},[o.createVNode(c,{text:t.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:Z})=>[o.createVNode(n,o.mergeProps(Z,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ee=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[10]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(g,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"110px"}},{default:o.withCtx(()=>[e[11]||(e[11]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wind Level",-1)),o.createVNode(m,{class:"ma-0 ml-n1 text-body-2"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:Z,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Lc,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ee]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",Cc,o.toDisplayString(Number(Z)<10?`00${Z}kts`:Number(Z)<100?`0${Z}kts`:`${Z}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),o.createVNode(p,{vertical:""}),o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createVNode(m,{class:"ma-0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:ee,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",zc,[ee===0?(o.openBlock(),o.createElementBlock("div",vc)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:Z.color})},null,4)),o.createElementVNode("div",_c,o.toDisplayString(Z.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]}),o.createVNode(p,{vertical:""}),o.createVNode(d,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"90px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Current",-1)),o.createVNode(m,{class:"ma-0 ml-n4"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(Z,ee)=>(o.openBlock(),o.createBlock(s,{key:ee,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Sc,[o.createElementVNode("div",Mc,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*Z.size+"px"})},null,4)]),o.createElementVNode("div",Nc,o.toDisplayString(Z.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[13]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",Pc,[o.createElementVNode("div",Vc,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=Z=>i.autoActive=Z),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[14]||(e[14]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[14]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Tc,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(u,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=Z=>i.currentModel=Z),rounded:"",height:"28",density:"compact",mandatory:"",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[15]||(e[15]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[15]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[16]||(e[16]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[16]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(d,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(Z=>Z.overlays),Z=>(o.openBlock(),o.createBlock(w,{key:Z.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ee=>i.checkList=ee),value:Z.key,label:t.$t(`weather.${Z.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(d,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(Z=>!Z.overlays),Z=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:Z.key},[o.createVNode(b,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ee=>i.renderKey=ee),label:t.$t(`weather.${Z.locale}`),value:Z.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ee=>i.renderKey=i.renderKey===Z.key?"":Z.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&Z.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Ec,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ee=>i.showWindParticle=ee),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&Z.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",Rc,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ee=>i.showCurrentParticle=ee),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="wave-group"&&Z.key==="wave-group"?(o.openBlock(),o.createBlock(u,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":e[7]||(e[7]=ee=>i.waveToggleValue=ee),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"sig-wave",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="sig-wave"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="swell"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"swell"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&Z.key==="ice-forecast"?(o.openBlock(),o.createBlock(u,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[8]||(e[8]=ee=>i.iceToggleValue=ee),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(g,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(f,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(d,{class:""},{default:o.withCtx(()=>{var Z,ee,Pe,ze,be,ke,J,we,ae,me,_e,Te,Ve,I,de,Ae,Se,Me,H,ve,q,je,We,Ze,Le,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,Ct,zt,vt,_t,St,Mt,Nt,Pt,Vt,Tt,Et,Rt,Dt,Bt,It,Gt,Ft,jt,Wt,Zt,Xt,Ht,Ot,Yt,Ut,Jt,Kt,Qt,qt,$t,eo,to,oo,ao,io,ro,lo,no,so,co,mo,ho,po,go,uo,fo,yo,bo,wo,xo,ko,Ao,Lo,Co,zo,vo,_o,So,Mo;return[o.createElementVNode("div",Dc,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",Bc,o.toDisplayString((Pe=(ee=(Z=i.models)==null?void 0:Z.weather)==null?void 0:ee.NOAA)==null?void 0:Pe.source)+" "+o.toDisplayString((ke=(be=(ze=i.models)==null?void 0:ze.weather)==null?void 0:be.NOAA)==null?void 0:ke.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((me=(ae=(we=(J=i.models)==null?void 0:J.weather)==null?void 0:we.NOAA)==null?void 0:ae.meta)==null?void 0:me.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Ic,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Gc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((I=(Ve=(Te=(_e=i.models)==null?void 0:_e.weather)==null?void 0:Te.NOAA)==null?void 0:Ve.meta)==null?void 0:I.availabilityTime)),1),o.createElementVNode("div",Fc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Me=(Se=(Ae=(de=i.models)==null?void 0:de.weather)==null?void 0:Ae.NOAA)==null?void 0:Se.meta)==null?void 0:Me.initialisationTime)),1),o.createElementVNode("div",jc,o.toDisplayString((q=(ve=(H=i.models)==null?void 0:H.weather)==null?void 0:ve.ECMWF)==null?void 0:q.source)+" "+o.toDisplayString((Ze=(We=(je=i.models)==null?void 0:je.weather)==null?void 0:We.ECMWF)==null?void 0:Ze.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((rt=(it=(at=(Le=i.models)==null?void 0:Le.weather)==null?void 0:at.ECMWF)==null?void 0:it.meta)==null?void 0:rt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Wc,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Zc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ct=(st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.meta)==null?void 0:ct.availabilityTime)),1),o.createElementVNode("div",Xc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((pt=(ht=(dt=(mt=i.models)==null?void 0:mt.weather)==null?void 0:dt.ECMWF)==null?void 0:ht.meta)==null?void 0:pt.initialisationTime)),1),o.createVNode(p),o.createElementVNode("div",Hc,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",Oc,o.toDisplayString((yt=(ft=(ut=(gt=i.models)==null?void 0:gt.marine)==null?void 0:ut.wave)==null?void 0:ft.NOAA)==null?void 0:yt.source)+" "+o.toDisplayString((kt=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.NOAA)==null?void 0:kt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((vt=(zt=(Ct=(Lt=(At=i.models)==null?void 0:At.marine)==null?void 0:Lt.wave)==null?void 0:Ct.NOAA)==null?void 0:zt.meta)==null?void 0:vt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Yc,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Uc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Pt=(Nt=(Mt=(St=(_t=i.models)==null?void 0:_t.marine)==null?void 0:St.wave)==null?void 0:Mt.NOAA)==null?void 0:Nt.meta)==null?void 0:Pt.availabilityTime)),1),o.createElementVNode("div",Jc,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Dt=(Rt=(Et=(Tt=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Tt.wave)==null?void 0:Et.NOAA)==null?void 0:Rt.meta)==null?void 0:Dt.initialisationTime)),1),o.createElementVNode("div",Kc,o.toDisplayString((Ft=(Gt=(It=(Bt=i.models)==null?void 0:Bt.marine)==null?void 0:It.wave)==null?void 0:Gt.ECMWF)==null?void 0:Ft.source)+" "+o.toDisplayString((Xt=(Zt=(Wt=(jt=i.models)==null?void 0:jt.marine)==null?void 0:Wt.wave)==null?void 0:Zt.ECMWF)==null?void 0:Xt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Jt=(Ut=(Yt=(Ot=(Ht=i.models)==null?void 0:Ht.marine)==null?void 0:Ot.wave)==null?void 0:Yt.ECMWF)==null?void 0:Ut.meta)==null?void 0:Jt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Qc,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",qc,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((eo=($t=(qt=(Qt=(Kt=i.models)==null?void 0:Kt.marine)==null?void 0:Qt.wave)==null?void 0:qt.ECMWF)==null?void 0:$t.meta)==null?void 0:eo.availabilityTime)),1),o.createElementVNode("div",$c,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((ro=(io=(ao=(oo=(to=i.models)==null?void 0:to.marine)==null?void 0:oo.wave)==null?void 0:ao.ECMWF)==null?void 0:io.meta)==null?void 0:ro.initialisationTime)),1),o.createVNode(p),o.createElementVNode("div",em,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",tm,o.toDisplayString((co=(so=(no=(lo=i.models)==null?void 0:lo.marine)==null?void 0:no.current)==null?void 0:so.ECMWF)==null?void 0:co.source)+" "+o.toDisplayString((go=(po=(ho=(mo=i.models)==null?void 0:mo.marine)==null?void 0:ho.current)==null?void 0:po.ECMWF)==null?void 0:go.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((wo=(bo=(yo=(fo=(uo=i.models)==null?void 0:uo.marine)==null?void 0:fo.current)==null?void 0:yo.ECMWF)==null?void 0:bo.meta)==null?void 0:wo.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",om,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",am,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Co=(Lo=(Ao=(ko=(xo=i.models)==null?void 0:xo.marine)==null?void 0:ko.current)==null?void 0:Ao.ECMWF)==null?void 0:Lo.meta)==null?void 0:Co.availabilityTime)),1),o.createElementVNode("div",im,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Mo=(So=(_o=(vo=(zo=i.models)==null?void 0:zo.marine)==null?void 0:vo.current)==null?void 0:_o.ECMWF)==null?void 0:So.meta)==null?void 0:Mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(G=i.weatherLayers)==null?void 0:G.wind,"menu-toggle":a.menuToggle},t.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(F=i.weatherLayers)==null?void 0:F["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},t.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(U=i.weatherLayers)==null?void 0:U.current,"menu-toggle":a.menuToggle},t.$attrs),null,16,["map","map-feather","current","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-3",prmsl:(B=i.weatherLayers)==null?void 0:B.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:5,viewport:i.viewport,factor:(D=i.weatherLayers)==null?void 0:D["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:6,viewport:i.viewport,factor:(X=i.weatherLayers)==null?void 0:X["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(P,o.mergeProps({key:7,viewport:i.viewport,factor:(S=i.weatherLayers)==null?void 0:S["sig-wave"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(Q=i.weatherLayers)==null?void 0:Q.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers,simple:a.simple},t.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(V,o.mergeProps({key:9,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(j,o.mergeProps({key:10,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(W,o.mergeProps({key:11,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(O,o.mergeProps({key:12,viewport:i.viewport,factor:($=i.weatherLayers)==null?void 0:$.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(ie,o.mergeProps({key:13,viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(oe,o.mergeProps({key:14,viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:15,viewport:i.viewport,factor:(xe=i.weatherLayers)==null?void 0:xe.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const lm=Y(xc,[["render",rm]]),Ke=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],Qe=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let sa=class{static standardWeatherModels(){return Ke.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return Qe.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),ir.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=Ke.find(d=>{var p,g,y;return((p=d.models)==null?void 0:p.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c}),m=Qe.find(d=>{var p,g,y;return((p=d.models)==null?void 0:p.includes(c))||((g=d.alias)==null?void 0:g.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c});s=s||Ke.find(d=>{var p,g;return((p=d.alias)==null?void 0:p.toLowerCase())===((g=m==null?void 0:m.alias)==null?void 0:g.toLowerCase())}),m=m||Qe.find(d=>{var p,g;return((p=d.alias)==null?void 0:p.toLowerCase())===((g=s==null?void 0:s.alias)==null?void 0:g.toLowerCase())}),s=s||Ke[0],m=m||Qe[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=m.models)!=null&&r.includes(c)?c:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=Ke.filter(l=>l.alias===e),r=Qe.filter(l=>l.alias===e),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(e,a){var r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G,F,U,B,D,X,S,Q,re,he,ge,$,se,pe,xe,Z,ee,Pe,ze,be,ke;const J=typeof a=="string"?v(a):a,we=e==null?void 0:e.weather,ae=e==null?void 0:e.marine,me=v((i=(r=we==null?void 0:we[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),_e=me.clone().add((c=(n=(l=we==null?void 0:we[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),Te=me.clone().add((d=(m=(s=we==null?void 0:we[0])==null?void 0:s.hourly)==null?void 0:m.time)==null?void 0:d.at(-1),"h"),Ve=[];if(J.isBetween(_e,Te,"millisecond","[]")){const I=J.utc().diff(_e,"h",!1);let de,Ae;if(we){let Se=0,Me=0,H=0;for(const ve of we){const q=ve==null?void 0:ve.hourly;for(let Le=I-(I-1)%3;Le<=I;Le++)Se+=(p=q==null?void 0:q.precipitation)==null?void 0:p.at(Le);for(let Le=I-(I-1)%6;Le<=I;Le++)Me+=(g=q==null?void 0:q.precipitation)==null?void 0:g.at(Le);for(let Le=I-(I-1)%12;Le<=I;Le++)H+=(y=q==null?void 0:q.precipitation)==null?void 0:y.at(Le);de={temp:(u=q==null?void 0:q.temperature_2m)==null?void 0:u.at(I),apparentTemp:(h=q==null?void 0:q.apparent_temperature)==null?void 0:h.at(I),rh:(f=q==null?void 0:q.relative_humidity_2m)==null?void 0:f.at(I),dp:(w=q==null?void 0:q.dew_point_2m)==null?void 0:w.at(I),precip:{probability:(b=q==null?void 0:q.precipitation_probability)==null?void 0:b.at(I),sum:(A=q==null?void 0:q.precipitation)==null?void 0:A.at(I),sum1Hours:(x=q==null?void 0:q.precipitation)==null?void 0:x.at(I),sum3Hours:Math.round(Se*100)/100,sum6Hours:Math.round(Me*100)/100,sum12Hours:Math.round(H*100)/100},pmsl:(C=q==null?void 0:q.pressure_msl)==null?void 0:C.at(I),psurf:(k=q==null?void 0:q.surface_pressure)==null?void 0:k.at(I),code:(_=q==null?void 0:q.weather_code)==null?void 0:_.at(I),visibility:this.m2nm((z=q==null?void 0:q.visibility)==null?void 0:z.at(I)),wind:{speed:(P=q==null?void 0:q.wind_speed_10m)==null?void 0:P.at(I),kts:(T=q==null?void 0:q.wind_speed_10m)==null?void 0:T.at(I),degree:(V=q==null?void 0:q.wind_direction_10m)==null?void 0:V.at(I),bearing:((j=q==null?void 0:q.wind_direction_10m)==null?void 0:j.at(I))!==null?(((W=q==null?void 0:q.wind_direction_10m)==null?void 0:W.at(I))+180)%360:null,gusts:(O=q==null?void 0:q.wind_gusts_10m)==null?void 0:O.at(I)},isDay:(ie=q==null?void 0:q.is_day)==null?void 0:ie.at(I)};const{name:je,url:We,bg:Ze}=this.parseWeatherCode(de.code,de.isDay);de.name=je,de.url=We,de.bg=Ze,de.wind.scale=this.beaufort(this.kts2ms(de.wind.kts)),de.wind.direction=this.degree2Direction(de.wind.degree),Ve.push({utc:_e.add(I,"h").format(),model:ve.model,weather:{...de}})}}if(ae){let Se=0;for(const Me of ae){const H=Me==null?void 0:Me.hourly;Ae={wave:{sig:{height:(oe=H==null?void 0:H.wave_height)==null?void 0:oe.at(I),degree:(M=H==null?void 0:H.wave_direction)==null?void 0:M.at(I),bearing:((G=H==null?void 0:H.wave_direction)==null?void 0:G.at(I))!==null?(((F=H==null?void 0:H.wave_direction)==null?void 0:F.at(I))+180)%360:null,period:(U=H==null?void 0:H.wave_period)==null?void 0:U.at(I)},swell:{height:(B=H==null?void 0:H.swell_wave_height)==null?void 0:B.at(I),degree:(D=H==null?void 0:H.swell_wave_direction)==null?void 0:D.at(I),bearing:((X=H==null?void 0:H.swell_wave_direction)==null?void 0:X.at(I))!==null?(((S=H==null?void 0:H.swell_wave_direction)==null?void 0:S.at(I))+180)%360:null,period:(Q=H==null?void 0:H.swell_wave_period)==null?void 0:Q.at(I),peakPeriod:(re=H==null?void 0:H.swell_wave_peak_period)==null?void 0:re.at(I)},wd:{height:(he=H==null?void 0:H.wind_wave_height)==null?void 0:he.at(I),degree:(ge=H==null?void 0:H.wind_wave_direction)==null?void 0:ge.at(I),bearing:(($=H==null?void 0:H.wind_wave_direction)==null?void 0:$.at(I))!==null?(((se=H==null?void 0:H.wind_wave_direction)==null?void 0:se.at(I))+180)%360:null,period:(pe=H==null?void 0:H.wind_wave_period)==null?void 0:pe.at(I),peakPeriod:(xe=H==null?void 0:H.wind_wave_peak_period)==null?void 0:xe.at(I)}},current:{speed:(Z=H==null?void 0:H.ocean_current_velocity)==null?void 0:Z.at(I),kts:(ee=H==null?void 0:H.ocean_current_velocity)==null?void 0:ee.at(I),degree:(Pe=H==null?void 0:H.ocean_current_direction)==null?void 0:Pe.at(I),bearing:((ze=H==null?void 0:H.ocean_current_direction)==null?void 0:ze.at(I))??null},sst:(be=H==null?void 0:H.sea_surface_temperature)==null?void 0:be.at(I),height:(ke=H==null?void 0:H.sea_level_height_msl)==null?void 0:ke.at(I)},Ae.wave=this.parseWave(Ae.wave,de==null?void 0:de.wind),Ae.current.direction=this.degree2Direction(Ae.current.degree),Object.assign(Ve[Se],Ae),Se++}}}return Ve}static toLegacy(e){var a,r,i,l,n,c,s,m,d,p;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=e==null?void 0:e.weather)==null?void 0:s.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(p=e==null?void 0:e.weather)==null?void 0:p.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model}}static pickDaily(e,a){var r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G,F,U,B,D,X,S,Q,re,he,ge,$,se;const pe=typeof a=="string"?v(a):a,xe=e==null?void 0:e.weather,Z=e==null?void 0:e.marine,ee=v((l=(i=(r=xe==null?void 0:xe[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Pe=v((s=(c=(n=xe==null?void 0:xe[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),ze=[];if(pe.isBetween(ee,Pe,"millisecond","[]")){let be,ke;const J=pe.diff(ee,"d",!1);if(xe)for(const we of xe){const ae=we.daily;be={code:(m=ae.weather_code)==null?void 0:m.at(J),temp:{max:(d=ae.temperature_2m_max)==null?void 0:d.at(J),min:(p=ae.temperature_2m_min)==null?void 0:p.at(J),mean:(g=ae.temperature_2m_mean)==null?void 0:g.at(J)},apparentTemp:{max:(y=ae.apparent_temperature_max)==null?void 0:y.at(J),min:(u=ae.apparent_temperature_min)==null?void 0:u.at(J)},precip:{sum:(h=ae.precipitation_sum)==null?void 0:h.at(J),rainSum:(f=ae.rain_sum)==null?void 0:f.at(J),snowfallSum:(w=ae.snowfall_sum)==null?void 0:w.at(J),showersSum:(b=ae.showers_sum)==null?void 0:b.at(J),hours:(A=ae.precipitation_hours)==null?void 0:A.at(J),probability:(x=ae.precipitation_probability_max)==null?void 0:x.at(J)},rh:{max:(C=ae.relative_humidity_2m_max)==null?void 0:C.at(J),min:(k=ae.relative_humidity_2m_min)==null?void 0:k.at(J),mean:(_=ae.relative_humidity_2m_mean)==null?void 0:_.at(J)},wind:{speed:(z=ae.wind_speed_10m_max)==null?void 0:z.at(J),kts:(P=ae.wind_speed_10m_max)==null?void 0:P.at(J),degree:(T=ae.wind_direction_10m_dominant)==null?void 0:T.at(J),gusts:(V=ae.wind_gusts_10m_max)==null?void 0:V.at(J),bearing:((j=ae.wind_direction_10m_dominant)==null?void 0:j.at(J))!==null?(((W=ae.wind_direction_10m_dominant)==null?void 0:W.at(J))+180)%360:null}};const{name:me,url:_e,bg:Te}=this.parseWeatherCode(be.code,!0);be.name=me,be.url=_e,be.bg=Te,be.wind.scale=this.beaufort(this.kts2ms(be.wind.kts)),be.wind.direction=this.degree2Direction(be.wind.degree),ze.push({utc:ee.add(J,"d").utc().format(),model:we.model,weather:{...be}})}if(Z){let we=0;for(const ae of Z){const me=ae.daily;ke={wave:{sig:{height:(O=me.wave_height_max)==null?void 0:O.at(J),degree:(ie=me.wave_direction_dominant)==null?void 0:ie.at(J),period:(oe=me.wave_period_max)==null?void 0:oe.at(J),bearing:((M=me.wave_direction_dominant)==null?void 0:M.at(J))!==null?(((G=me.wave_direction_dominant)==null?void 0:G.at(J))+180)%360:null},swell:{height:(F=me.swell_wave_height_max)==null?void 0:F.at(J),degree:(U=me.swell_wave_direction_dominant)==null?void 0:U.at(J),period:(B=me.swell_wave_period_max)==null?void 0:B.at(J),peakPeriod:(D=me.swell_wave_peak_period_max)==null?void 0:D.at(J),bearing:((X=me.swell_wave_direction_dominant)==null?void 0:X.at(J))!==null?((S=me.swell_wave_direction_dominant)==null?void 0:S.at(J))%360:null},wd:{height:(Q=me.wind_wave_height_max)==null?void 0:Q.at(J),degree:(re=me.wind_wave_direction_dominant)==null?void 0:re.at(J),period:(he=me.wind_wave_period_max)==null?void 0:he.at(J),peakPeriod:(ge=me.wind_wave_peak_period_max)==null?void 0:ge.at(J),bearing:(($=me.wind_wave_direction_dominant)==null?void 0:$.at(J))!==null?(((se=me.wind_wave_direction_dominant)==null?void 0:se.at(J))+180)%360:null}}},ke.wave=this.parseWave(ke.wave,be==null?void 0:be.wind),Object.assign(ze[we],ke),we++}}}return ze}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height===0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=Math.round(r*100)/100}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r;e.swell.height=Math.round(i*100)/100}if(e.wd.height===0||e.wd.height>e.sig.height)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(r*100)/100}return e.swell.height>e.sig.height&&(e.swell.height=Math.round(e.sig.height*.76*100)/100),e.sig.period||(e.sig.period=Math.round(5*Math.sqrt(e.sig.height))),e.swell.period||(e.swell.period=Math.round(5*Math.sqrt(e.swell.height))),e.wd.period||(e.wd.period=Math.round(5*Math.sqrt(e.wd.height))),e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const Ay="",nm={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalProbability","tropicalNotification"],setup(){return{Theme:fe.useTheme()}},data(){return{right:10,toggle:!1,helper:Xe.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:E.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(t,e)=>{if(t){const a=v(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=v(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),c=`(UTC ${l>=0?"+":""}${l})`;return n+" "+c}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=sa.kts2ms(t);return sa.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":N.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},map:{handler(){this.map?(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=Xe.LayerHelper.WEATHER_LAYERS.find(c=>c.key==="tropicals"))==null?void 0:i.weight;if(r>0){const c=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],s=await le.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const m=(n=s==null?void 0:s.data)==null?void 0:n.data;await le.get(m.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var y,u,h;const p=N.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((h=(u=d==null?void 0:d.config)==null?void 0:u.headers)==null?void 0:h.key)&&p&&(this.tropicals={data:p,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((p=r.properties.wind)==null?void 0:p.kts)<79||((g=r.properties)==null?void 0:g.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((u=r.properties)==null?void 0:u.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((f=r.properties)==null?void 0:f.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((w=r.geometry)==null?void 0:w.type)==="Point"&&((b=r.properties)!=null&&b.important)&&(r.properties.format=(x=(A=v(r.properties.date))==null?void 0:A.utcOffset(this.timeZone))==null?void 0:x.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((C=r.geometry)==null?void 0:C.type)==="Point"&&(r.properties.Name=((_=(k=r.properties.name)==null?void 0:k.trim())==null?void 0:_.replace(/^./,z=>z.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,c,s,m,d,p;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(s=(c=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:c.idmBottomBar)==null||s.handleToggle("tropical",!0):(p=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||p.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,c,s,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let p=0,g=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),g=new Date().valueOf()-(d+p),console.log("[tropicals] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.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":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),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",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),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":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),g=new Date().valueOf()-(d+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((c=this.map)==null||c.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),g=new Date().valueOf()-(d+p),console.log("[tropical] update elapsed: ",g,", total: ",p+=g)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(m=this.tropicals)==null?void 0:m.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":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),g=new Date().valueOf()-(d+p),console.log("[tropical] add elapsed: ",g,", total: ",p+=g));const y=N.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var t,e,a,r;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(i=>i==null?void 0:i.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)),(e=this.map)==null||e.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),this.handleCloseInfoMarker()},handleDateChange(){var t,e,a,r,i,l,n,c,s,m,d,p,g,y,u,h,f,w,b,A,x,C,k,_,z,P,T,V,j,W,O,ie,oe,M,G;if((t=this.interpolateMarkers)==null||t.forEach(F=>F==null?void 0:F.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const F=v(this.realTime).utc().set({minute:0,second:0,millisecond:0}),U=this.interpolateData.filter(S=>S.properties.date===(F==null?void 0:F.format())&&!S.properties.disabled),B=this.handleComputePolygons(U),D=E.featureCollection([...U]);B.forEach(S=>{D.features.push(S)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(D):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:D}),(l=this.map)==null||l.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,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const X=[];for(const S of U)if(!S.properties.disabled){if(!X.some($=>{var se;return $.properties.name===((se=S.properties)==null?void 0:se.name)})){const $=((c=(n=this.tropicals.data.features.find(se=>{var pe;return se.properties.name===((pe=S.properties)==null?void 0:pe.name)}))==null?void 0:n.properties)==null?void 0:c.nameCn)||((s=S.properties)==null?void 0:s.Name)||"-";S.properties.nameCn=$,S.properties.Name=((d=(m=S.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,se=>se.toUpperCase()))||S.properties.nameCn,X.push(S)}let Q=this.Theme.current.value.colors["tropicals-ty"];((g=(p=S.properties)==null?void 0:p.wind)==null?void 0:g.kts)<32||!((u=(y=S.properties)==null?void 0:y.wind)!=null&&u.kts)?Q=this.Theme.current.value.colors["tropicals-td"]:((f=(h=S.properties)==null?void 0:h.wind)==null?void 0:f.kts)>=32&&((b=(w=S.properties)==null?void 0:w.wind)==null?void 0:b.kts)<47?Q=this.Theme.current.value.colors["tropicals-ts"]:((x=(A=S.properties)==null?void 0:A.wind)==null?void 0:x.kts)>=47&&((k=(C=S.properties)==null?void 0:C.wind)==null?void 0:k.kts)<63?Q=this.Theme.current.value.colors["tropicals-sts"]:((z=(_=S.properties)==null?void 0:_.wind)==null?void 0:z.kts)>=63&&((T=(P=S.properties)==null?void 0:P.wind)==null?void 0:T.kts)<79?Q=this.Theme.current.value.colors["tropicals-ty"]:((j=(V=S.properties)==null?void 0:V.wind)==null?void 0:j.kts)>=79&&((O=(W=S.properties)==null?void 0:W.wind)==null?void 0:O.kts)<94?Q=this.Theme.current.value.colors["tropicals-sty"]:((oe=(ie=S.properties)==null?void 0:ie.wind)==null?void 0:oe.kts)>=94?Q=this.Theme.current.value.colors["tropicals-super-ty"]:Q=this.Theme.current.value.colors["tropicals-ty"];const re=`<svg t="1719918955501"
204
204
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
205
205
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
206
206
  <path