@idmwx/idmui-gl4 1.7.7 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8740,27 +8740,27 @@ function ic(t, e, o, i, a, r) {
8740
8740
  s("div", Bn, m((He = (te = (G = a.models) == null ? void 0 : G.weather) == null ? void 0 : te.NOAA) == null ? void 0 : He.source) + " " + m((fe = (ue = (Me = a.models) == null ? void 0 : Me.weather) == null ? void 0 : ue.NOAA) == null ? void 0 : fe.spatialResolution) + m(t.$t("units.km")) + " " + m((re = (oe = (Ce = (U = a.models) == null ? void 0 : U.weather) == null ? void 0 : Ce.NOAA) == null ? void 0 : oe.meta) == null ? void 0 : re.days) + m(t.$t("units.days")), 1),
8741
8741
  s("div", En, m(t.$t("weather.source")) + ": NOAA", 1),
8742
8742
  s("div", jn, m(t.$t("weather.lastUpdate")) + ": " + m(r.computeDateUpdate((Ie = (ye = (j = (Oe = a.models) == null ? void 0 : Oe.weather) == null ? void 0 : j.NOAA) == null ? void 0 : ye.meta) == null ? void 0 : Ie.availabilityTime)), 1),
8743
- s("div", Nn, m(t.$t("weather.referenceTime ")) + ": " + m(r.computeDateZ((q = (E = (Ee = (Be = a.models) == null ? void 0 : Be.weather) == null ? void 0 : Ee.NOAA) == null ? void 0 : E.meta) == null ? void 0 : q.initialisationTime)), 1),
8743
+ s("div", Nn, m(t.$t("weather.referenceTime")) + ": " + m(r.computeDateZ((q = (E = (Ee = (Be = a.models) == null ? void 0 : Be.weather) == null ? void 0 : Ee.NOAA) == null ? void 0 : E.meta) == null ? void 0 : q.initialisationTime)), 1),
8744
8744
  s("div", Fn, m((Ye = (Ze = (Ve = a.models) == null ? void 0 : Ve.weather) == null ? void 0 : Ze.ECMWF) == null ? void 0 : Ye.source) + " " + m((Xe = (qe = (Te = a.models) == null ? void 0 : Te.weather) == null ? void 0 : qe.ECMWF) == null ? void 0 : Xe.spatialResolution) + m(t.$t("units.km")) + " " + m((Qe = (Je = (Ke = ($e = a.models) == null ? void 0 : $e.weather) == null ? void 0 : Ke.ECMWF) == null ? void 0 : Je.meta) == null ? void 0 : Qe.days) + m(t.$t("units.days")), 1),
8745
8745
  s("div", Hn, m(t.$t("weather.source")) + ": ECMWF", 1),
8746
8746
  s("div", Gn, m(t.$t("weather.lastUpdate")) + ": " + m(r.computeDateUpdate((at = (ot = (tt = (et = a.models) == null ? void 0 : et.weather) == null ? void 0 : tt.ECMWF) == null ? void 0 : ot.meta) == null ? void 0 : at.availabilityTime)), 1),
8747
- s("div", Un, m(t.$t("weather.referenceTime ")) + ": " + m(r.computeDateZ((lt = (st = (rt = (it = a.models) == null ? void 0 : it.weather) == null ? void 0 : rt.ECMWF) == null ? void 0 : st.meta) == null ? void 0 : lt.initialisationTime)), 1),
8747
+ s("div", Un, m(t.$t("weather.referenceTime")) + ": " + m(r.computeDateZ((lt = (st = (rt = (it = a.models) == null ? void 0 : it.weather) == null ? void 0 : rt.ECMWF) == null ? void 0 : st.meta) == null ? void 0 : lt.initialisationTime)), 1),
8748
8748
  p(b),
8749
8749
  s("div", Wn, m(t.$t("weather.wave")), 1),
8750
8750
  s("div", Vn, m((dt = (mt = (ct = (nt = a.models) == null ? void 0 : nt.marine) == null ? void 0 : ct.wave) == null ? void 0 : mt.NOAA) == null ? void 0 : dt.source) + " " + m((gt = (ut = (pt = (ht = a.models) == null ? void 0 : ht.marine) == null ? void 0 : pt.wave) == null ? void 0 : ut.NOAA) == null ? void 0 : gt.spatialResolution) + m(t.$t("units.km")) + " " + m((xt = (wt = (bt = (yt = (ft = a.models) == null ? void 0 : ft.marine) == null ? void 0 : yt.wave) == null ? void 0 : bt.NOAA) == null ? void 0 : wt.meta) == null ? void 0 : xt.days) + m(t.$t("units.days")), 1),
8751
8751
  s("div", Zn, m(t.$t("weather.source")) + ": NOAA", 1),
8752
8752
  s("div", Yn, m(t.$t("weather.lastUpdate")) + ": " + m(r.computeDateUpdate((Lt = (zt = (kt = (_t = (vt = a.models) == null ? void 0 : vt.marine) == null ? void 0 : _t.wave) == null ? void 0 : kt.NOAA) == null ? void 0 : zt.meta) == null ? void 0 : Lt.availabilityTime)), 1),
8753
- s("div", qn, m(t.$t("weather.referenceTime ")) + ": " + m(r.computeDateZ((Mt = (St = (Tt = (Ct = (Pt = a.models) == null ? void 0 : Pt.marine) == null ? void 0 : Ct.wave) == null ? void 0 : Tt.NOAA) == null ? void 0 : St.meta) == null ? void 0 : Mt.initialisationTime)), 1),
8753
+ s("div", qn, m(t.$t("weather.referenceTime")) + ": " + m(r.computeDateZ((Mt = (St = (Tt = (Ct = (Pt = a.models) == null ? void 0 : Pt.marine) == null ? void 0 : Ct.wave) == null ? void 0 : Tt.NOAA) == null ? void 0 : St.meta) == null ? void 0 : Mt.initialisationTime)), 1),
8754
8754
  s("div", Xn, m((Rt = (At = (Dt = (It = a.models) == null ? void 0 : It.marine) == null ? void 0 : Dt.wave) == null ? void 0 : At.ECMWF) == null ? void 0 : Rt.source) + " " + m((jt = (Et = (Bt = (Ot = a.models) == null ? void 0 : Ot.marine) == null ? void 0 : Bt.wave) == null ? void 0 : Et.ECMWF) == null ? void 0 : jt.spatialResolution) + m(t.$t("units.km")) + " " + m((Ut = (Gt = (Ht = (Ft = (Nt = a.models) == null ? void 0 : Nt.marine) == null ? void 0 : Ft.wave) == null ? void 0 : Ht.ECMWF) == null ? void 0 : Gt.meta) == null ? void 0 : Ut.days) + m(t.$t("units.days")), 1),
8755
8755
  s("div", $n, m(t.$t("weather.source")) + ": ECMWF", 1),
8756
8756
  s("div", Kn, m(t.$t("weather.lastUpdate")) + ": " + m(r.computeDateUpdate((qt = (Yt = (Zt = (Vt = (Wt = a.models) == null ? void 0 : Wt.marine) == null ? void 0 : Vt.wave) == null ? void 0 : Zt.ECMWF) == null ? void 0 : Yt.meta) == null ? void 0 : qt.availabilityTime)), 1),
8757
- s("div", Jn, m(t.$t("weather.referenceTime ")) + ": " + m(r.computeDateZ((eo = (Qt = (Jt = (Kt = (Xt = a.models) == null ? void 0 : Xt.marine) == null ? void 0 : Kt.wave) == null ? void 0 : Jt.ECMWF) == null ? void 0 : Qt.meta) == null ? void 0 : eo.initialisationTime)), 1),
8757
+ s("div", Jn, m(t.$t("weather.referenceTime")) + ": " + m(r.computeDateZ((eo = (Qt = (Jt = (Kt = (Xt = a.models) == null ? void 0 : Xt.marine) == null ? void 0 : Kt.wave) == null ? void 0 : Jt.ECMWF) == null ? void 0 : Qt.meta) == null ? void 0 : eo.initialisationTime)), 1),
8758
8758
  p(b),
8759
8759
  s("div", Qn, m(t.$t("weather.currents")), 1),
8760
8760
  s("div", ec, m((io = (ao = (oo = (to = a.models) == null ? void 0 : to.marine) == null ? void 0 : oo.current) == null ? void 0 : ao.ECMWF) == null ? void 0 : io.source) + " " + m((no = (lo = (so = (ro = a.models) == null ? void 0 : ro.marine) == null ? void 0 : so.current) == null ? void 0 : lo.ECMWF) == null ? void 0 : no.spatialResolution) + m(t.$t("units.km")) + " " + m((uo = (po = (ho = (mo = (co = a.models) == null ? void 0 : co.marine) == null ? void 0 : mo.current) == null ? void 0 : ho.ECMWF) == null ? void 0 : po.meta) == null ? void 0 : uo.days) + m(t.$t("units.days")), 1),
8761
8761
  s("div", tc, m(t.$t("weather.source")) + ": ECMWF", 1),
8762
8762
  s("div", oc, m(t.$t("weather.lastUpdate")) + ": " + m(r.computeDateUpdate((wo = (bo = (yo = (fo = (go = a.models) == null ? void 0 : go.marine) == null ? void 0 : fo.current) == null ? void 0 : yo.ECMWF) == null ? void 0 : bo.meta) == null ? void 0 : wo.availabilityTime)), 1),
8763
- s("div", ac, m(t.$t("weather.referenceTime ")) + ": " + m(r.computeDateZ((zo = (ko = (_o = (vo = (xo = a.models) == null ? void 0 : xo.marine) == null ? void 0 : vo.current) == null ? void 0 : _o.ECMWF) == null ? void 0 : ko.meta) == null ? void 0 : zo.initialisationTime)), 1)
8763
+ s("div", ac, m(t.$t("weather.referenceTime")) + ": " + m(r.computeDateZ((zo = (ko = (_o = (vo = (xo = a.models) == null ? void 0 : xo.marine) == null ? void 0 : vo.current) == null ? void 0 : _o.ECMWF) == null ? void 0 : ko.meta) == null ? void 0 : zo.initialisationTime)), 1)
8764
8764
  ];
8765
8765
  }),
8766
8766
  _: 1
@@ -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(h);const d=[s];let g=0;d.forEach(u=>{u.onload=()=>{g++,this.map.hasImage("currentDirIcon")||this.map.addImage("currentDirIcon",s),g===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 sn(o,t,a,r,i,l){return null}const cn=A(nn,[["render",sn]]),Pd="",mn={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:go},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new be,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 o,t;(o=this.factor)!=null&&o.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(o,t){o!==t&&t!==void 0&&(o?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{async handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[current-particle] add elapsed: ",a,", total: ",t+=a)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.uvFragmentSchema);this.program=t,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const o=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,he.vertexSchema,he.fragmentSchema,he.quadVertSchema,he.screenFragmentSchema,he.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,o,!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 o=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,o),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,o),this.wrapper.image=o}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 o,t,a,r,i,l,n;(o=this.viewport)==null||o.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(a=(t=this.viewport)==null?void 0:t.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 o;(o=this.viewport)==null||o.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},dn={key:0};function hn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",{class:"legend-bars-gl4 current",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"kts",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.4",-1),e.createElementVNode("span",null,"0.8",-1),e.createElementVNode("span",null,"1.6",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3.2",-1)]),4)])):e.createCommentVNode("",!0)}const pn=A(mn,[["render",hn]]),Sd="",gn={name:"IdmSigWave",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[sig-wave] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},un={key:0};function fn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",un,[e.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const yn=A(gn,[["render",fn],["__scopeId","data-v-fa73c319"]]),bn={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 o;(o=this.sigWaveHeight)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10})},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var o,t;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(o=this.map)!=null&&o.getSource(this.source)?((t=this.map)==null||t.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 wn(o,t,a,r,i,l){return null}const xn=A(bn,[["render",wn]]),Nd="",_n={name:"IdmSwell",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[sig-wave] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},kn={key:0};function vn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",kn,[e.createElementVNode("div",{class:"legend-bars-gl4 swell",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"6",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const zn=A(_n,[["render",vn],["__scopeId","data-v-d47b8b5c"]]),Ln={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 o;(o=this.prmsl)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var o,t,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(o=this.map)!=null&&o.getSource(this.source)?((t=this.map)==null||t.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)"]:["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-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":this.theme==="light"?1:0}},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)}}},Cn={key:0,class:"legend-tip-btn-gl4"};function Pn(o,t,a,r,i,l){var s;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip");return(s=a.prmsl)!=null&&s.active?(e.openBlock(),e.createElementBlock("div",Cn,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Map Layers",location:"left"},{activator:e.withCtx(({props:h})=>[e.createVNode(n,e.mergeProps(h,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4)])):e.createCommentVNode("",!0)}const Sn=A(Ln,[["render",Pn]]),Td="",Nn={name:"IdmIceEdge",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-edge] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Tn={key:0};function Dn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Tn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"70",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"90",-1),e.createElementVNode("span",null,null,-1)]),4)])):e.createCommentVNode("",!0)}const En=A(Nn,[["render",Dn]]),Dd="",Mn={name:"IdmCover",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-cover] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Vn={key:0};function Bn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Vn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"%",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1),e.createElementVNode("span",null,"80",-1),e.createElementVNode("span",null,"100",-1)]),4)])):e.createCommentVNode("",!0)}const In=A(Mn,[["render",Bn],["__scopeId","data-v-dcedee39"]]),Ed="",An={name:"IdmThickness",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-thickness] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Rn={key:0};function On(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.6",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1)]),4)])):e.createCommentVNode("",!0)}const jn=A(An,[["render",On]]),Md="",Fn={name:"IdmPrecip3h",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[precip3h] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Hn={key:0};function Gn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Hn,[e.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"mm",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"7",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1)]),4)])):e.createCommentVNode("",!0)}const Wn=A(Fn,[["render",Gn]]),Vd="",Un={name:"IdmVisibility",props:{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 be,etime:void 0}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[visibility] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Zn={key:0};function Yn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"nm",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const qn=A(Un,[["render",Yn]]),Bd="",Xn={name:"IdmWaterTemp",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[water-temp] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},$n={key:0};function Kn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",$n,[e.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const Jn=A(Xn,[["render",Kn]]),Id="",Qn={name:"IdmTemp",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[temp] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},es={key:0};function ts(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",es,[e.createElementVNode("div",{class:"legend-bars-gl4 temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"-20",-1),e.createElementVNode("span",null,"-10",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const os=A(Qn,[["render",ts]]),Ad="",as={name:"IdmGlLayer",components:{IdmWindBarb:tn,IdmWindParticle:ln,IdmCurrentDirection:cn,IdmCurrentParticle:pn,IdmWave:yn,IdmSigWaveHeight:xn,IdmSwell:zn,IdmPrmsl:Sn,IdmIceEdge:En,IdmIceCover:In,IdmIceThickness:jn,IdmPrecip3h:Wn,IdmVisibility:qn,IdmWaterTemp:Jn,IdmTemp:os},props:{isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},token:{type:String},defaultMeteoToken:{type:String},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["menuToggle","weatherCheckList","autoActive"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...Ee.LayerHelper.WEATHER_LAYERS],tagLayers:[...Ee.LayerHelper.WEATHER_LAYERS.filter(o=>!o.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},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:{computeDateZ(){return function(o){var t;if(o){const a=z(o);return`${(t=a==null?void 0:a.utc())==null?void 0:t.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(o){return o?z(o).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(o=>o.overlays).map(o=>o.key)},rendersKeys(){return this.allLayers.filter(o=>!o.overlays&&o.enabled).map(o=>o.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var t,a,r;const o=[];for(let i=0;i<((a=(t=this.legend)==null?void 0:t.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`;o.push("icon-a-"+n)}return o}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10})}},forecastModel:{handler(o,t){o&&o!==t&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new go(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(o,t){o&&t&&z(o).utc().format("yyyy-MM-DD HH")!==z(t).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(o,t){o&&o!==t?o==="wave-group"?this.checkList=["wave-group",this.waveToggleValue||"sig-wave"]:o==="ice-forecast"?this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"]:this.checkList=[o]:!o&&t&&(this.checkList=this.checkList.filter(a=>a!==t))}},checkList:{handler(o,t){var a,r,i,l,n,c;this.handleCheckListChange(o,t),this.$emit("weatherCheckList",o),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(o){var t,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=(t=this.$parent)==null?void 0:t.$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(o){o&&(this.checkList=["ice-forecast",this.iceToggleValue])}},waveToggleValue:{handler(o){o&&(this.checkList=["wave-group",this.waveToggleValue])}},showWindParticle:{handler(o){let t="wind-particle";this.weatherLayers[t].particle=o,this.weatherLayers[t].version=Math.random()+1}},showCurrentParticle:{handler(o){let t="current-particle";this.weatherLayers[t].particle=o,this.weatherLayers[t].version=Math.random()+1}},isLogin:{handler(o){o?this.fetchModels():this.models={}},immediate:!0}},methods:{arraysEqual(o,t){if((o==null?void 0:o.length)!==(t==null?void 0:t.length))return!1;for(let a=0;a<(o==null?void 0:o.length);a++)if((o==null?void 0:o[a])!==(t==null?void 0:t[a]))return!1;return!0},fetchCache(){var a,r;const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=t!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),t=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(t))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(t))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(t||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(o){let t=[];this.checkList.includes(o)?t=this.checkList.filter(a=>a!==o):t=[...this.checkList,o],this.handleCheckListChange(t,this.checkList)},handleCheckListChange(o,t){if(this.arraysEqual(o,t))return!1;const a=[...new Set(o)],r=a==null?void 0:a.filter(l=>!(t!=null&&t.includes(l)))[0],i=t==null?void 0:t.filter(l=>!(a!=null&&a.includes(l)))[0];r&&(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):r==="sig-wave"||r==="swell"||r==="wave-group"?(this.checkList=["wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave"):this.rendersKeys.includes(r)?this.checkList=[r]:(this.checkList=a.filter(l=>!this.rendersKeys.includes(l)),this.renderKey=void 0)),i&&(i==="ice-forecast"?(this.checkList=a.filter(l=>!["ice-cover","ice-thickness","ice-forecast"].includes(l)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(l=>!["wave-group","sig-wave","swell"].includes(l)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(l=>a.includes(l.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const o=await J.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(o==null?void 0:o.data.code)===0&&(this.models=o==null?void 0:o.data.data)},async fetchWeatherLayers(o={}){var i,l,n,c,s,h,d,g,u;const t=new Date().valueOf();let a=0,r=0;if(this.map){const y=((i=this.map)==null?void 0:i.getZoom())+1,p=(l=this.map)==null?void 0:l.getBounds(),_=`${p._sw.lng},${p._sw.lat},${p._ne.lng},${p._ne.lat}`;if(this.particleFactor&&((n=this.$refs.layer)!=null&&n.autoActive)){const v=Ee.LayerHelper.WEATHER_LAYERS.find(P=>{var L;return((L=P.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&v.weight?this.weatherWeight:this.weatherWeight+v.weight:this.weatherWeight=this.weatherWeight&v.weight?this.weatherWeight-v.weight:this.weatherWeight}if(this.weatherWeight>0){let v=this.weatherWeight;if(v>0){const P=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],L=await J.get(`${P}/api/arc/weather/layers2/links?l=${v}&v=${this.forecastModel}&z=${y}&bbox=${_}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(r=new Date().valueOf()-(t+a),console.log("weather links elapsed: ",r,", total: ",a+=r),((c=L==null?void 0:L.data)==null?void 0:c.code)===0){const x=(s=L==null?void 0:L.data)==null?void 0:s.data,w=[];for(const k in x)w.push(J.get(x[k],{headers:{Authorization:this.defaultMeteoToken,key:k},responseType:/\.(jpg|png)$/.test(x[k])?"blob":"json"}).catch(b=>{console.log(`[${k}] fetch layer error: ${b}`)}));const f=await Promise.all(w);this.weatherLayers={},f.map(k=>{var D,R,O,I;const b=((D=k==null?void 0:k.data)==null?void 0:D.data)||(k==null?void 0:k.data);let C=(O=(R=k==null?void 0:k.config)==null?void 0:R.headers)==null?void 0:O.key;C&&b&&(this.weatherLayers[C]={raw:b,type:((I=k==null?void 0:k.config)==null?void 0:I.responseType)==="blob"?"image":"json",etime:L.data.etime})})}if(r=new Date().valueOf()-(t+a),console.log("weather layers elapsed: ",r,", total: ",a+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const x=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,w=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:x,height:{raw:w},etime:L.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const x=(g=this.weatherLayers["current-direction"])==null?void 0:g.raw,w=(u=this.weatherLayers["current-speed"])==null?void 0:u.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:x,speed:{raw:w},etime:L.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json()}},handleWeatherLayerToggle(){for(const o in this.weatherLayers)this.weatherLayers[o].active=!1,this.weatherLayers[o].version=Math.random()+1;for(const o of this.activeWeatherLayers){let t=o.key;t==="current-direction"&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,t==="wind-particle"&&(this.weatherLayers[t].particle=this.showWindParticle),t==="current-particle"&&(this.weatherLayers[t].particle=this.showCurrentParticle))}},handleWeatherLayerChange(o={sourceChanged:!1}){var a;const t=(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);o!=null&&o.sourceChanged||this.weatherWeight!==t?(this.weatherWeight=t,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var o,t,a,r,i,l,n,c,s,h,d,g;this.viewport.map.getSource((o=this.viewport)==null?void 0:o.rampColorSource)||this.viewport.map.addSource((t=this.viewport)==null?void 0:t.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((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(g=this.viewport)==null?void 0:g.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,c,s,h,d,g;const o=new Date().valueOf();let t=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=N.LngLatHelper.convertToStdLng(r._sw.lng),y=N.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),_=Math.ceil(r._ne.lat);for(const v in this.weatherLayers){let P=!1;if(this.weatherLayers[v].active&&this.weatherLayers[v].type==="json"){let L=[];if(v==="swell"){P=!0;const x=((c=this.weatherLayers[v])==null?void 0:c.direction)||{};for(const f in x)if(f>p&&f<_&&(!(i<=this.zoom)||f%(i<2?10:i<4?5:3)===0)){const k=x[f].lng;u>y?k.forEach((b,C)=>{var D,R,O,I,W,H;if(i<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if((b>=u&&b<=180||b>=-180&&b<=y)&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}}):k.forEach((b,C)=>{var D,R,O,I,W,H;if(u<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if(b>=u&&b<=y&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}})}a=new Date().valueOf()-(o+t),console.log("swell direction elapsed: ",a,", total: ",t+=a);const w=this.weatherLayers[v].height;if(w){if(!w.data){const f=[];for(const k in(s=w.raw)==null?void 0:s.LineString){const b=w.raw.LineString[k];for(const C of b)f.push(E.lineString(C,{val:Number(k)}));w.data=E.featureCollection(f)}}if(w.data){const f=this.handleBboxClip(w.data,r);L=L.concat(f)}a=new Date().valueOf()-(o+t),console.log("swell height elapsed: ",a,", total: ",t+=a)}}else if(v==="current"){P=!0;const x=((h=this.weatherLayers[v])==null?void 0:h.direction)||{};for(const f in x)if(f>p&&f<_&&(!(i<=this.zoom)||f%(i<2?10:i<4?5:3)===0)){const k=x[f].lng;u>y?k.forEach((b,C)=>{var D,R,O,I,W,H;if(i<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if((b>=u&&b<=180||b>=-180&&b<=y)&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}}):k.forEach((b,C)=>{var D,R,O,I,W,H;if(u<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if(b>=u&&b<=y&&(!(i<=this.zoom)||b%(i<this.zoom/2?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}})}a=new Date().valueOf()-(o+t),console.log("current direction elapsed: ",a,", total: ",t+=a);const w=this.weatherLayers[v].speed;if(w){if(!w.data){const k=[];for(const b in(d=w.raw)==null?void 0:d.Polygon){const C=w.raw.Polygon[b];for(const D of C)k.push(E.polygon(D,{val:Number(b)}))}w.data=E.featureCollection(k)}const f=i<this.zoom?w.data.features.filter(k=>k.properties.val>.5):w.data.features;L=L.concat(f),a=new Date().valueOf()-(o+t),console.log("current speed elapsed: ",a,", total: ",t+=a)}}else if(v==="wind"){P=!0;const x=this.weatherLayers.wind.raw;for(const w in x)if(w>p&&w<_&&(!(i<=this.zoom)||w%(i<2?10:i<4?5:3)===0)){const f=x[w].lng;u>y?f.forEach((k,b)=>{var C,D,R,O;if(i<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const I=E.point([k,w],{dir:((C=x[w].val)==null?void 0:C[b])||((D=x[w].dir)==null?void 0:D[b]),spd:x[w].spd[b]});L.push(I)}}else if((k>=u&&k<=180||k>=-180&&k<=y)&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const I=E.point([k,w],{dir:((R=x[w].val)==null?void 0:R[b])||((O=x[w].dir)==null?void 0:O[b]),spd:x[w].spd[b]});L.push(I)}}):f.forEach((k,b)=>{var C,D,R,O;if(i<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const I=E.point([k,w],{dir:((C=x[w].val)==null?void 0:C[b])||((D=x[w].dir)==null?void 0:D[b]),spd:x[w].spd[b]});L.push(I)}}else if(k>=u&&k<=y&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const I=E.point([k,w],{dir:((R=x[w].val)==null?void 0:R[b])||((O=x[w].dir)==null?void 0:O[b]),spd:x[w].spd[b]});L.push(I)}})}a=new Date().valueOf()-(o+t),console.log("wind barb elapsed: ",a,", total: ",t+=a)}else if(v==="sig-wave-height"){if(this.weatherLayers[v].data)L=this.weatherLayers[v].data;else{P=!0;const x=this.weatherLayers[v].raw;if(x){const w=[];for(const f in x.Polygon){const k=x.Polygon[f];for(const b of k)w.push(E.polygon(b,{val:Number(f)}))}for(const f in x.MultiPolygon){const k=x.MultiPolygon[f];for(const b of k)w.push(E.multiPolygon(b,{val:Number(f)}))}for(const f in x.Point){const k=x.Point[f];for(let b=0;b<((g=k.lng)==null?void 0:g.length);b++)w.push(E.point([k.lng[b],f],{val:Number(k.val[b])}))}L=L.concat(w)}}a=new Date().valueOf()-(o+t),console.log("sig-wave-height elapsed: ",a,", total: ",t+=a)}else if(v==="prmsl"){if(this.weatherLayers[v].data)L=this.weatherLayers[v].data;else{P=!0;const x=this.weatherLayers[v].raw;if(x){const w=[];for(const f in x.LineString){const k=x.LineString[f];for(const b of k)w.push(E.lineString(b,{val:Number(f)}))}for(const f in x.Point)x.Point[f].lng.forEach((k,b)=>{k=N.LngLatHelper.convertToStdLng(k),w.push(E.point([k,f],{val:x.Point[f].val[b],type:x.Point[f].type[b]}))});L=L.concat(w)}}a=new Date().valueOf()-(o+t),console.log("prmsl elapsed: ",a,", total: ",t+=a)}L.length&&(this.weatherLayers[v].data=E.featureCollection(L)),P&&(this.weatherLayers[v].version=Math.random()+1)}}}},handleMove4Weather(){for(const o in this.weatherLayers)this.weatherLayers[o].active&&this.weatherLayers[o].type==="image"&&(this.weatherLayers[o].active=!0,this.weatherLayers[o].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(o,t){const a=[],r=N.LngLatHelper.convertToStdLng(t._sw.lng),i=N.LngLatHelper.convertToStdLng(t._ne.lng);return o.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,t._sw.lat,180,t._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,t._sw.lat,i,t._ne.lat],c=E.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,t._sw.lat,i,t._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},is={class:"idm-gl4-meteo-layers"},rs={key:0,class:"legend-tip-btn-gl4"},ls={class:"d-flex flex-row justify-center align-center"},ns={class:"text-caption"},ss={class:"d-flex flex-row justify-center align-center"},cs={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},ms={class:"text-caption px-2"},ds={class:"d-flex flex-row justify-start align-center"},hs={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},ps={class:"text-caption px-2"},gs={class:"header-box d-flex justify-space-between align-center pl-4 pr-4"},us={class:"d-flex justify-start align-center ga-3"},fs={class:"text-h5 font-weight-medium"},ys={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},bs={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},ws={class:"text-body-1 py-2"},xs={class:"text-body-1 font-weight-medium"},_s={class:"text-body-2 text-label"},ks={class:"text-body-2 text-label"},vs={class:"text-body-2 text-label mb-3"},zs={class:"text-body-1 font-weight-medium"},Ls={class:"text-body-2 text-label"},Cs={class:"text-body-2 text-label"},Ps={class:"text-body-2 text-label mb-3"},Ss={class:"text-body-1 py-2"},Ns={class:"text-body-1 font-weight-medium"},Ts={class:"text-body-2 text-label"},Ds={class:"text-body-2 text-label"},Es={class:"text-body-2 text-label mb-3"},Ms={class:"text-body-1 font-weight-medium"},Vs={class:"text-body-2 text-label"},Bs={class:"text-body-2 text-label"},Is={class:"text-body-2 text-label mb-3"},As={class:"text-body-1 py-2"},Rs={class:"text-body-1 font-weight-medium"},Os={class:"text-body-2 text-label"},js={class:"text-body-2 text-label"},Fs={class:"text-body-2 text-label mb-3"};function Hs(o,t,a,r,i,l){var G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke,ve,pe;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VCol"),h=e.resolveComponent("VRow"),d=e.resolveComponent("VCardText"),g=e.resolveComponent("VDivider"),u=e.resolveComponent("VCard"),y=e.resolveComponent("VSwitch"),p=e.resolveComponent("VCardTitle"),_=e.resolveComponent("VCardItem"),v=e.resolveComponent("VCheckbox"),P=e.resolveComponent("VRadio"),L=e.resolveComponent("VBtnToggle"),x=e.resolveComponent("IdmWindBarb"),w=e.resolveComponent("IdmSigWaveHeight"),f=e.resolveComponent("IdmCurrentDirection"),k=e.resolveComponent("IdmPrmsl"),b=e.resolveComponent("IdmWindParticle"),C=e.resolveComponent("IdmCurrentParticle"),D=e.resolveComponent("IdmWave"),R=e.resolveComponent("IdmSwell"),O=e.resolveComponent("IdmIceEdge"),I=e.resolveComponent("IdmIceCover"),W=e.resolveComponent("IdmIceThickness"),H=e.resolveComponent("IdmPrecip3h"),F=e.resolveComponent("IdmVisibility"),Q=e.resolveComponent("IdmWaterTemp"),K=e.resolveComponent("IdmTemp");return e.openBlock(),e.createElementBlock("div",is,[e.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:e.normalizeStyle({top:a.top+94+"px",right:i.right+"px"})},[e.createVNode(c,{text:o.$t("weather.weatherLayers"),location:"left"},{activator:e.withCtx(({props:V})=>[e.createVNode(n,e.mergeProps(V,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[8]||(t[8]=[e.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text"])],4),l.showTipMenu?(e.openBlock(),e.createElementBlock("div",rs,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Legend",location:"left"},{activator:e.withCtx(({props:V})=>[e.createVNode(n,e.mergeProps(V,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:t[0]||(t[0]=Z=>i.legendToggle=!i.legendToggle)}),{default:e.withCtx(()=>t[9]||(t[9]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[9]},1040,["class"])]),_:1})],4),i.legendToggle?(e.openBlock(),e.createBlock(u,{key:0,width:"435",elevation:"16",class:"card-info d-flex justify-center align-start",style:e.normalizeStyle({position:"absolute",top:"340px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[10]||(t[10]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Wind Level",-1)),e.createVNode(h,{class:"ma-0 ml-n1 text-body-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.barbs,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:V,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ls,[e.createElementVNode("i",{class:e.normalizeClass(["iconfont",l.barbsIconName[Z]]),style:e.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),e.createElementVNode("span",ns,e.toDisplayString(Number(V)<10?`00${V}kts`:Number(V)<100?`0${V}kts`:`${V}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[10]}),e.createVNode(g,{vertical:""}),e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[11]||(t[11]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Wave Height",-1)),e.createVNode(h,{class:"ma-0 ml-1",style:{width:"100px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.sigWaveHeight,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:Z,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ss,[Z===0?(e.openBlock(),e.createElementBlock("div",cs)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:V.color})},null,4)),e.createElementVNode("div",ms,e.toDisplayString(V.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),e.createVNode(g,{vertical:""}),e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[12]||(t[12]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Current",-1)),e.createVNode(h,{class:"ma-0 ml-n5",style:{width:"110px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.current,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:Z,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ds,[e.createElementVNode("div",hs,[e.createElementVNode("i",{class:"iconfont icon-a-direction-arrow opacity-80",style:e.normalizeStyle({fontSize:40*V.size+"px"})},null,4)]),e.createElementVNode("div",ps,e.toDisplayString(V.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]})]),_:1},8,["style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition flex-center",i.toggle?"right-bar":""]),style:e.normalizeStyle({top:a.top+"px",right:i.toggle?"0px":"-280px"})},[e.createElementVNode("div",gs,[e.createElementVNode("div",us,[e.createElementVNode("div",fs,e.toDisplayString(o.$t("weather.weather")),1),e.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":t[1]||(t[1]=V=>i.autoActive=V),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[13]||(t[13]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[13]},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["list-box scroll pl-4 pr-2 overflow-y-auto",i.autoActive?"":"cursor-not-allowed"])},[e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.overlays")),1)]),_:1})]),_:1}),e.createVNode(d,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(V=>V.overlays),V=>(e.openBlock(),e.createBlock(v,{key:V.key,modelValue:i.checkList,"onUpdate:modelValue":t[2]||(t[2]=Z=>i.checkList=Z),value:V.key,label:o.$t(`weather.${V.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}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.renders")),1)]),_:1})]),_:1}),e.createVNode(d,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(V=>!V.overlays),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[e.createVNode(P,{modelValue:i.renderKey,"onUpdate:modelValue":t[3]||(t[3]=Z=>i.renderKey=Z),label:o.$t(`weather.${V.locale}`),value:V.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:Z=>i.renderKey=i.renderKey===V.key?"":V.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&V.key==="wind-particle"?(e.openBlock(),e.createElementBlock("div",ys,[e.createElementVNode("span",null,e.toDisplayString(o.$t("weather.particleAnimatiom")),1),e.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":t[4]||(t[4]=Z=>i.showWindParticle=Z),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.renderKey==="current-particle"&&V.key==="current-particle"?(e.openBlock(),e.createElementBlock("div",bs,[e.createElementVNode("span",null,e.toDisplayString(o.$t("weather.particleAnimatiom")),1),e.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":t[5]||(t[5]=Z=>i.showCurrentParticle=Z),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.renderKey==="wave-group"&&V.key==="wave-group"?(e.openBlock(),e.createBlock(L,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":t[6]||(t[6]=Z=>i.waveToggleValue=Z),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:e.withCtx(()=>[e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&V.key==="ice-forecast"?(e.openBlock(),e.createBlock(L,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":t[7]||(t[7]=Z=>i.iceToggleValue=Z),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:e.withCtx(()=>[e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.forecastModel")),1)]),_:1})]),_:1}),e.createVNode(d,{class:""},{default:e.withCtx(()=>{var V,Z,Pe,we,le,se,B,fe,Y,X,ze,T,ce,xe,Le,Ce,S,j,Ne,Te,De,ye,Be,Ie,Ae,Re,Oe,je,Fe,He,Ge,We,Ue,Ze,Ye,qe,Xe,$e,Ke,Je,Qe,et,tt,ot,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,_t,kt,vt,zt,Lt,Ct,Pt,St,Nt,Tt,Dt,Et,Mt,Vt,Bt,It,At,Rt,Ot,jt,Ft,Ht,Gt,Wt,Ut,Zt,Yt,qt,Xt,Kt,Jt,Qt,eo,to,oo,ao,io,ro,lo,no,so,co,mo;return[e.createElementVNode("div",ws,e.toDisplayString(o.$t("weather.atmospheric")),1),e.createElementVNode("div",xs,e.toDisplayString((Pe=(Z=(V=i.models)==null?void 0:V.weather)==null?void 0:Z.NOAA)==null?void 0:Pe.source)+" "+e.toDisplayString((se=(le=(we=i.models)==null?void 0:we.weather)==null?void 0:le.NOAA)==null?void 0:se.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((X=(Y=(fe=(B=i.models)==null?void 0:B.weather)==null?void 0:fe.NOAA)==null?void 0:Y.meta)==null?void 0:X.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",_s,e.toDisplayString(o.$t("weather.source"))+": NOAA",1),e.createElementVNode("div",ks,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((xe=(ce=(T=(ze=i.models)==null?void 0:ze.weather)==null?void 0:T.NOAA)==null?void 0:ce.meta)==null?void 0:xe.availabilityTime)),1),e.createElementVNode("div",vs,e.toDisplayString(o.$t("weather.referenceTime "))+": "+e.toDisplayString(l.computeDateZ((j=(S=(Ce=(Le=i.models)==null?void 0:Le.weather)==null?void 0:Ce.NOAA)==null?void 0:S.meta)==null?void 0:j.initialisationTime)),1),e.createElementVNode("div",zs,e.toDisplayString((De=(Te=(Ne=i.models)==null?void 0:Ne.weather)==null?void 0:Te.ECMWF)==null?void 0:De.source)+" "+e.toDisplayString((Ie=(Be=(ye=i.models)==null?void 0:ye.weather)==null?void 0:Be.ECMWF)==null?void 0:Ie.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((je=(Oe=(Re=(Ae=i.models)==null?void 0:Ae.weather)==null?void 0:Re.ECMWF)==null?void 0:Oe.meta)==null?void 0:je.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Ls,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",Cs,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((We=(Ge=(He=(Fe=i.models)==null?void 0:Fe.weather)==null?void 0:He.ECMWF)==null?void 0:Ge.meta)==null?void 0:We.availabilityTime)),1),e.createElementVNode("div",Ps,e.toDisplayString(o.$t("weather.referenceTime "))+": "+e.toDisplayString(l.computeDateZ((qe=(Ye=(Ze=(Ue=i.models)==null?void 0:Ue.weather)==null?void 0:Ze.ECMWF)==null?void 0:Ye.meta)==null?void 0:qe.initialisationTime)),1),e.createVNode(g),e.createElementVNode("div",Ss,e.toDisplayString(o.$t("weather.wave")),1),e.createElementVNode("div",Ns,e.toDisplayString((Je=(Ke=($e=(Xe=i.models)==null?void 0:Xe.marine)==null?void 0:$e.wave)==null?void 0:Ke.NOAA)==null?void 0:Je.source)+" "+e.toDisplayString((ot=(tt=(et=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:et.wave)==null?void 0:tt.NOAA)==null?void 0:ot.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((nt=(lt=(rt=(it=(at=i.models)==null?void 0:at.marine)==null?void 0:it.wave)==null?void 0:rt.NOAA)==null?void 0:lt.meta)==null?void 0:nt.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Ts,e.toDisplayString(o.$t("weather.source"))+": NOAA",1),e.createElementVNode("div",Ds,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((ht=(dt=(mt=(ct=(st=i.models)==null?void 0:st.marine)==null?void 0:ct.wave)==null?void 0:mt.NOAA)==null?void 0:dt.meta)==null?void 0:ht.availabilityTime)),1),e.createElementVNode("div",Es,e.toDisplayString(o.$t("weather.referenceTime "))+": "+e.toDisplayString(l.computeDateZ((yt=(ft=(ut=(gt=(pt=i.models)==null?void 0:pt.marine)==null?void 0:gt.wave)==null?void 0:ut.NOAA)==null?void 0:ft.meta)==null?void 0:yt.initialisationTime)),1),e.createElementVNode("div",Ms,e.toDisplayString((_t=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.ECMWF)==null?void 0:_t.source)+" "+e.toDisplayString((Lt=(zt=(vt=(kt=i.models)==null?void 0:kt.marine)==null?void 0:vt.wave)==null?void 0:zt.ECMWF)==null?void 0:Lt.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((Tt=(Nt=(St=(Pt=(Ct=i.models)==null?void 0:Ct.marine)==null?void 0:Pt.wave)==null?void 0:St.ECMWF)==null?void 0:Nt.meta)==null?void 0:Tt.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Vs,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",Bs,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((Bt=(Vt=(Mt=(Et=(Dt=i.models)==null?void 0:Dt.marine)==null?void 0:Et.wave)==null?void 0:Mt.ECMWF)==null?void 0:Vt.meta)==null?void 0:Bt.availabilityTime)),1),e.createElementVNode("div",Is,e.toDisplayString(o.$t("weather.referenceTime "))+": "+e.toDisplayString(l.computeDateZ((jt=(Ot=(Rt=(At=(It=i.models)==null?void 0:It.marine)==null?void 0:At.wave)==null?void 0:Rt.ECMWF)==null?void 0:Ot.meta)==null?void 0:jt.initialisationTime)),1),e.createVNode(g),e.createElementVNode("div",As,e.toDisplayString(o.$t("weather.currents")),1),e.createElementVNode("div",Rs,e.toDisplayString((Wt=(Gt=(Ht=(Ft=i.models)==null?void 0:Ft.marine)==null?void 0:Ht.current)==null?void 0:Gt.ECMWF)==null?void 0:Wt.source)+" "+e.toDisplayString((qt=(Yt=(Zt=(Ut=i.models)==null?void 0:Ut.marine)==null?void 0:Zt.current)==null?void 0:Yt.ECMWF)==null?void 0:qt.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((eo=(Qt=(Jt=(Kt=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:Kt.current)==null?void 0:Jt.ECMWF)==null?void 0:Qt.meta)==null?void 0:eo.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Os,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",js,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((ro=(io=(ao=(oo=(to=i.models)==null?void 0:to.marine)==null?void 0:oo.current)==null?void 0:ao.ECMWF)==null?void 0:io.meta)==null?void 0:ro.availabilityTime)),1),e.createElementVNode("div",Fs,e.toDisplayString(o.$t("weather.referenceTime "))+": "+e.toDisplayString(l.computeDateZ((mo=(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.meta)==null?void 0:mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(e.openBlock(),e.createBlock(x,e.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},o.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(q=i.weatherLayers)==null?void 0:q["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(f,e.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(ae=i.weatherLayers)==null?void 0:ae.current,"menu-toggle":a.menuToggle},o.$attrs),null,16,["map","map-feather","current","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(k,e.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-2",prmsl:(ee=i.weatherLayers)==null?void 0:ee.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(b,e.mergeProps({key:5,viewport:i.viewport,factor:(ie=i.weatherLayers)==null?void 0:ie["wind-particle"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(C,e.mergeProps({key:6,viewport:i.viewport,factor:(ne=i.weatherLayers)==null?void 0:ne["current-particle"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(D,e.mergeProps({key:7,viewport:i.viewport,factor:(M=i.weatherLayers)==null?void 0:M["sig-wave"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(R,e.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(te=i.weatherLayers)==null?void 0:te.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(O,e.mergeProps({key:9,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["ice-edge"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(I,e.mergeProps({key:10,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-cover"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:11,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue["ice-thickness"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:12,viewport:i.viewport,factor:(_e=i.weatherLayers)==null?void 0:_e.precip3h,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(F,e.mergeProps({key:13,viewport:i.viewport,factor:(ke=i.weatherLayers)==null?void 0:ke.visibility,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:14,viewport:i.viewport,factor:(ve=i.weatherLayers)==null?void 0:ve["water-temp"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(K,e.mergeProps({key:15,viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe.temp,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0)])}const Gs=A(as,[["render",Hs]]),Me=[{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"}],Ve=[{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"}];class wo{static standardWeatherModels(){return Me.filter(t=>!t.disabled&&t.alias)}static standardMarineModels(){return Ve.filter(t=>!t.disabled&&t.alias)}static autoPickLayerModel(t,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",t=t==null?void 0:t.toLowerCase(),t==="gfs"?"gfs":["ec","ecmwf"].includes(t)?"ecmwf":["copernicus","cmems"].includes(t)?"copernicus":a}static autoPickPeerModel(t,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),Ra.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&t.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(t="best_match"){var a,r;t=t==null?void 0:t.toLowerCase(),t=t==="ec"?"ecmwf":t;const i=t.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=Me.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(c))||((u=d.alias)==null?void 0:u.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c}),h=Ve.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(c))||((u=d.alias)==null?void 0:u.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c});s=s||Me.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=h==null?void 0:h.alias)==null?void 0:u.toLowerCase())}),h=h||Ve.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=s==null?void 0:s.alias)==null?void 0:u.toLowerCase())}),s=s||Me[0],h=h||Ve[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=h.models)!=null&&r.includes(c)?c:h.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(t){t=t.toUpperCase();const a=Me.filter(l=>l.alias===t),r=Ve.filter(l=>l.alias===t),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(t,a){var r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W,H,F,Q,K,G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke,ve,pe,V,Z,Pe,we;const le=typeof a=="string"?z(a):a,se=t==null?void 0:t.weather,B=t==null?void 0:t.marine,fe=z((i=(r=se==null?void 0:se[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),Y=fe.clone().add((c=(n=(l=se==null?void 0:se[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),X=fe.clone().add((d=(h=(s=se==null?void 0:se[0])==null?void 0:s.hourly)==null?void 0:h.time)==null?void 0:d.at(-1),"h"),ze=[];if(le.isBetween(Y,X,"millisecond","[]")){const T=le.utc().diff(Y,"h",!1);let ce,xe;if(se){let Le=0,Ce=0;for(const S of se){const j=S==null?void 0:S.hourly;for(let ye=T-(T-1)%3;ye<=T;ye++)Le+=(g=j==null?void 0:j.precipitation)==null?void 0:g.at(ye);for(let ye=T-(T-1)%6;ye<=T;ye++)Ce+=(u=j==null?void 0:j.precipitation)==null?void 0:u.at(ye);ce={temp:(y=j==null?void 0:j.temperature_2m)==null?void 0:y.at(T),apparentTemp:(p=j==null?void 0:j.apparent_temperature)==null?void 0:p.at(T),rh:(_=j==null?void 0:j.relative_humidity_2m)==null?void 0:_.at(T),dp:(v=j==null?void 0:j.dew_point_2m)==null?void 0:v.at(T),precip:{probability:(P=j==null?void 0:j.precipitation_probability)==null?void 0:P.at(T),sum:(L=j==null?void 0:j.precipitation)==null?void 0:L.at(T),sum3Hours:Math.round(Le*100)/100,sum6Hours:Math.round(Ce*100)/100},pmsl:(x=j==null?void 0:j.pressure_msl)==null?void 0:x.at(T),psurf:(w=j==null?void 0:j.surface_pressure)==null?void 0:w.at(T),code:(f=j==null?void 0:j.weather_code)==null?void 0:f.at(T),visibility:this.m2nm((k=j==null?void 0:j.visibility)==null?void 0:k.at(T)),wind:{speed:(b=j==null?void 0:j.wind_speed_10m)==null?void 0:b.at(T),kts:(C=j==null?void 0:j.wind_speed_10m)==null?void 0:C.at(T),degree:(D=j==null?void 0:j.wind_direction_10m)==null?void 0:D.at(T),bearing:((R=j==null?void 0:j.wind_direction_10m)==null?void 0:R.at(T))!==null?(((O=j==null?void 0:j.wind_direction_10m)==null?void 0:O.at(T))+180)%360:null,gusts:(I=j==null?void 0:j.wind_gusts_10m)==null?void 0:I.at(T)},isDay:(W=j==null?void 0:j.is_day)==null?void 0:W.at(T)};const{name:Ne,url:Te,bg:De}=this.parseWeatherCode(ce.code,ce.isDay);ce.name=Ne,ce.url=Te,ce.bg=De,ce.wind.scale=this.beaufort(this.kts2ms(ce.wind.kts)),ce.wind.direction=this.degree2Direction(ce.wind.degree),ze.push({utc:Y.add(T,"h").format(),model:S.model,weather:{...ce}})}}if(B){let Le=0;for(const Ce of B){const S=Ce==null?void 0:Ce.hourly;xe={wave:{sig:{height:(H=S==null?void 0:S.wave_height)==null?void 0:H.at(T),degree:(F=S==null?void 0:S.wave_direction)==null?void 0:F.at(T),bearing:((Q=S==null?void 0:S.wave_direction)==null?void 0:Q.at(T))!==null?(((K=S==null?void 0:S.wave_direction)==null?void 0:K.at(T))+180)%360:null,period:(G=S==null?void 0:S.wave_period)==null?void 0:G.at(T)},swell:{height:(q=S==null?void 0:S.swell_wave_height)==null?void 0:q.at(T),degree:(ae=S==null?void 0:S.swell_wave_direction)==null?void 0:ae.at(T),bearing:((ee=S==null?void 0:S.swell_wave_direction)==null?void 0:ee.at(T))!==null?(((ie=S==null?void 0:S.swell_wave_direction)==null?void 0:ie.at(T))+180)%360:null,period:(ne=S==null?void 0:S.swell_wave_period)==null?void 0:ne.at(T),peakPeriod:(M=S==null?void 0:S.swell_wave_peak_period)==null?void 0:M.at(T)},wd:{height:(te=S==null?void 0:S.wind_wave_height)==null?void 0:te.at(T),degree:(de=S==null?void 0:S.wind_wave_direction)==null?void 0:de.at(T),bearing:((ge=S==null?void 0:S.wind_wave_direction)==null?void 0:ge.at(T))!==null?(((ue=S==null?void 0:S.wind_wave_direction)==null?void 0:ue.at(T))+180)%360:null,period:(_e=S==null?void 0:S.wind_wave_period)==null?void 0:_e.at(T),peakPeriod:(ke=S==null?void 0:S.wind_wave_peak_period)==null?void 0:ke.at(T)}},current:{speed:(ve=S==null?void 0:S.ocean_current_velocity)==null?void 0:ve.at(T),kts:(pe=S==null?void 0:S.ocean_current_velocity)==null?void 0:pe.at(T),degree:(V=S==null?void 0:S.ocean_current_direction)==null?void 0:V.at(T),bearing:((Z=S==null?void 0:S.ocean_current_direction)==null?void 0:Z.at(T))??null},sst:(Pe=S==null?void 0:S.sea_surface_temperature)==null?void 0:Pe.at(T),height:(we=S==null?void 0:S.sea_level_height_msl)==null?void 0:we.at(T)},xe.wave=this.parseWave(xe.wave,ce==null?void 0:ce.wind),xe.current.direction=this.degree2Direction(xe.current.degree),Object.assign(ze[Le],xe),Le++}}}return ze}static toLegacy(t){var a,r,i,l,n,c,s,h,d,g;return{wind:(a=t==null?void 0:t.weather)==null?void 0:a.wind,visibility:(r=t==null?void 0:t.weather)==null?void 0:r.visibility,temp:(i=t==null?void 0:t.weather)==null?void 0:i.temp,prmsl:(l=t==null?void 0:t.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=t==null?void 0:t.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=t==null?void 0:t.weather)==null?void 0:s.precip,code:(h=t==null?void 0:t.weather)==null?void 0:h.code,name:(d=t==null?void 0:t.weather)==null?void 0:d.name,url:(g=t==null?void 0:t.weather)==null?void 0:g.url,wave:t==null?void 0:t.wave,current:t==null?void 0:t.current,sst:t==null?void 0:t.sst,height:t==null?void 0:t.height,utc:t==null?void 0:t.utc,source:t==null?void 0:t.model}}static pickDaily(t,a){var r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W,H,F,Q,K,G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke;const ve=typeof a=="string"?z(a):a,pe=t==null?void 0:t.weather,V=t==null?void 0:t.marine,Z=z((l=(i=(r=pe==null?void 0:pe[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Pe=z((s=(c=(n=pe==null?void 0:pe[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),we=[];if(ve.isBetween(Z,Pe,"millisecond","[]")){let le,se;const B=ve.diff(Z,"d",!1);if(pe)for(const fe of pe){const Y=fe.daily;le={code:(h=Y.weather_code)==null?void 0:h.at(B),temp:{max:(d=Y.temperature_2m_max)==null?void 0:d.at(B),min:(g=Y.temperature_2m_min)==null?void 0:g.at(B),mean:(u=Y.temperature_2m_mean)==null?void 0:u.at(B)},apparentTemp:{max:(y=Y.apparent_temperature_max)==null?void 0:y.at(B),min:(p=Y.apparent_temperature_min)==null?void 0:p.at(B)},precip:{sum:(_=Y.precipitation_sum)==null?void 0:_.at(B),rainSum:(v=Y.rain_sum)==null?void 0:v.at(B),snowfallSum:(P=Y.snowfall_sum)==null?void 0:P.at(B),showersSum:(L=Y.showers_sum)==null?void 0:L.at(B),hours:(x=Y.precipitation_hours)==null?void 0:x.at(B),probability:(w=Y.precipitation_probability_max)==null?void 0:w.at(B)},rh:{max:(f=Y.relative_humidity_2m_max)==null?void 0:f.at(B),min:(k=Y.relative_humidity_2m_min)==null?void 0:k.at(B),mean:(b=Y.relative_humidity_2m_mean)==null?void 0:b.at(B)},wind:{speed:(C=Y.wind_speed_10m_max)==null?void 0:C.at(B),kts:(D=Y.wind_speed_10m_max)==null?void 0:D.at(B),degree:(R=Y.wind_direction_10m_dominant)==null?void 0:R.at(B),gusts:(O=Y.wind_gusts_10m_max)==null?void 0:O.at(B),bearing:((I=Y.wind_direction_10m_dominant)==null?void 0:I.at(B))!==null?(((W=Y.wind_direction_10m_dominant)==null?void 0:W.at(B))+180)%360:null}};const{name:X,url:ze,bg:T}=this.parseWeatherCode(le.code,!0);le.name=X,le.url=ze,le.bg=T,le.wind.scale=this.beaufort(this.kts2ms(le.wind.kts)),le.wind.direction=this.degree2Direction(le.wind.degree),we.push({utc:Z.add(B,"d").utc().format(),model:fe.model,weather:{...le}})}if(V){let fe=0;for(const Y of V){const X=Y.daily;se={wave:{sig:{height:(H=X.wave_height_max)==null?void 0:H.at(B),degree:(F=X.wave_direction_dominant)==null?void 0:F.at(B),period:(Q=X.wave_period_max)==null?void 0:Q.at(B),bearing:((K=X.wave_direction_dominant)==null?void 0:K.at(B))!==null?(((G=X.wave_direction_dominant)==null?void 0:G.at(B))+180)%360:null},swell:{height:(q=X.swell_wave_height_max)==null?void 0:q.at(B),degree:(ae=X.swell_wave_direction_dominant)==null?void 0:ae.at(B),period:(ee=X.swell_wave_period_max)==null?void 0:ee.at(B),peakPeriod:(ie=X.swell_wave_peak_period_max)==null?void 0:ie.at(B),bearing:((ne=X.swell_wave_direction_dominant)==null?void 0:ne.at(B))!==null?((M=X.swell_wave_direction_dominant)==null?void 0:M.at(B))%360:null},wd:{height:(te=X.wind_wave_height_max)==null?void 0:te.at(B),degree:(de=X.wind_wave_direction_dominant)==null?void 0:de.at(B),period:(ge=X.wind_wave_period_max)==null?void 0:ge.at(B),peakPeriod:(ue=X.wind_wave_peak_period_max)==null?void 0:ue.at(B),bearing:((_e=X.wind_wave_direction_dominant)==null?void 0:_e.at(B))!==null?(((ke=X.wind_wave_direction_dominant)==null?void 0:ke.at(B))+180)%360:null}}},se.wave=this.parseWave(se.wave,le==null?void 0:le.wind),Object.assign(we[fe],se),fe++}}}return we}static parseWave(t,a){if(t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t.sig.height===0){const r=Math.sqrt(Math.pow(t.swell.height||0,2)+Math.pow(t.wd.height||0,2));t.sig.height=Math.round(r*100)/100}if(t.swell.height===0)if(t.sig.height>t.wd.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.wd.height||0,2)));t.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;t.swell.height=Math.round(i*100)/100}if(t.wd.height===0||t.wd.height>t.sig.height)if(t.sig.height>t.swell.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(r*100)/100}return t.swell.height>t.sig.height&&(t.swell.height=Math.round(t.sig.height*.76*100)/100),t.sig.period||(t.sig.period=Math.round(5*Math.sqrt(t.sig.height))),t.swell.period||(t.swell.period=Math.round(5*Math.sqrt(t.swell.height))),t.wd.period||(t.wd.period=Math.round(5*Math.sqrt(t.wd.height))),t}static parseWeatherCode(t,a){const r=this.weatherCode(t);return(a?r.day:r.night)||{}}static weatherCode(t){const a={code:t};switch(t){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(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let a=t%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(t){const a=this.degree2Radian(t);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(t){let a=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?a=0:t<=1.5?a=1:t<=3.3?a=2:t<=5.4?a=3:t<=7.9?a=4:t<=10.7?a=5:t<=13.8?a=6:t<=17.1?a=7:t<=20.7?a=8:t<=22.4?a=9:t<=28.4?a=10:t<=32.6?a=11:t>32.6&&(a=12)),a}static douglas(t){let a="Calm";return isNaN(t)||t<=.1?a="Calm":t<=.5?a="Smooth":t<=1.25?a="Slight":t<=2.5?a="Moderate":t<=4?a="Rough":t<=6?a="VeryRough":t<=9?a="High":t<=14?a="VeryHigh":a="Precipitous",a}}const Rd="",Ws={name:"IdmTropicals",props:{permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},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","tropicalProbability","tropicalNotification"],setup(){return{Theme:re.useTheme()}},data(){return{right:10,toggle:!1,helper:Ee.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(o,t)=>{if(o){const a=z(o).utcOffset(t),r=t<0?t:"+"+t;return`${a==null?void 0:a.format("MMM-DD/HHmm")} ( UTC${r} ) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(o,t,a="MM-DD HH:mm")=>{var r,i;if(o){const l=t||0,n=(i=(r=z(o))==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(o){const t=wo.kts2ms(o);return wo.beaufort(t)}},computeMovement(){return function(o){var t,a;return(a=(t=o==null?void 0:o.forecasts)==null?void 0:t.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return o=>!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat)?"-":N.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.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)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(o,t){o!==t&&this.handleRefresh()}},realTime:{handler(o){this.map&&o&&this.toggle&&this.handleRender()}},locale:{handler(o){this.map&&this.toggle&&this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){var o,t,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(t=(o=this.$parent)==null?void 0:o.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const o=new Date().valueOf();let t=0,a=0,r=(i=Ee.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 J.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(a=new Date().valueOf()-(o+t),console.log("weather links elapsed: ",a,", total: ",t+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const h=(n=s==null?void 0:s.data)==null?void 0:n.data;await J.get(h.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(h.tropicals)?"blob":"json"}).then(d=>{var y,p,_;const g=N.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((_=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:_.key)&&g&&(this.tropicals={data:g,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`[${key}] fetch layer error: ${d}`)})}a=new Date().valueOf()-(o+t),console.log("tropicals elapsed: ",a,", total: ",t+=a)}},handleRefresh(){var t,a;(((a=(t=this.tropicals)==null?void 0:t.data)==null?void 0:a.features)||[]).forEach(r=>{var i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w;if(((i=r.geometry)==null?void 0:i.type)==="Point"){let f="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):f="TD";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):f="TS";break;case(((h=r.properties.wind)==null?void 0:h.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):f="STS";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):f="TY";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):f="STY";break;case(((_=r.properties.wind)==null?void 0:_.kts)>=94||((v=r.properties)==null?void 0:v.kts)>=94):f="Super TY";break;default:f="Super TY";break}r.properties.level=f}((P=r.geometry)==null?void 0:P.type)==="Point"&&((L=r.properties)!=null&&L.important)&&(r.properties.format=(w=(x=z(r.properties.date))==null?void 0:x.utcOffset(this.timeZone))==null?void 0:w.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`))}),this.handleInit()},handleInit(){var o,t,a,r,i,l,n,c,s,h,d,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(o=this.map)==null||o.on("click",this.clickLayers,this.handleClick),(t=this.map)==null||t.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):(g=(d=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:d.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var o,t,a,r,i,l,n,c,s,h;if(this.tropicals&&this.map){const d=new Date().valueOf();let g=0,u=0;(o=this.map)!=null&&o.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((t=this.tropicals)!=null&&t.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g),console.log("[tropicals] update elapsed: ",u,", total: ",g+=u)):(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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"line-width":3,"line-opacity":.9,"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":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(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),u=new Date().valueOf()-(d+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"#fff"}},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]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],32]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],47]],"#f2f202",["boolean",["<",["get","kts",["get","wind"]],63]],"#ff9100",["boolean",["<",["get","kts",["get","wind"]],79]],"#f44336",["boolean",["<",["get","kts",["get","wind"]],94]],"#f903d0",["boolean",[">=",["get","kts",["get","wind"]],94]],"#8702f9","#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":1}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=N.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var o,t,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),(o=this.interpolateMarkers)==null||o.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)),(t=this.map)==null||t.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 o,t,a,r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W;if((o=this.interpolateMarkers)==null||o.forEach(H=>H==null?void 0:H.remove()),(t=this.interpolateData)!=null&&t.length&&this.tropicals.active){const H=z(this.realTime).utc().set({minute:0,second:0,millisecond:0}),F=this.interpolateData.filter(G=>G.properties.date===(H==null?void 0:H.format())&&!G.properties.disabled),Q=this.handleComputePolygons(F),K=E.featureCollection([...F]);Q.forEach(G=>{K.features.push(G)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(K):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:K}),(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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];for(const G of F)if(!G.properties.disabled){let q="#f44336";((c=(n=G.properties)==null?void 0:n.wind)==null?void 0:c.kts)<32||!((h=(s=G.properties)==null?void 0:s.wind)!=null&&h.kts)?q="#03f869":((g=(d=G.properties)==null?void 0:d.wind)==null?void 0:g.kts)>=32&&((y=(u=G.properties)==null?void 0:u.wind)==null?void 0:y.kts)<47?q="#f2f202":((_=(p=G.properties)==null?void 0:p.wind)==null?void 0:_.kts)>=47&&((P=(v=G.properties)==null?void 0:v.wind)==null?void 0:P.kts)<63?q="#ff9100":((x=(L=G.properties)==null?void 0:L.wind)==null?void 0:x.kts)>=63&&((f=(w=G.properties)==null?void 0:w.wind)==null?void 0:f.kts)<79?q="#f44336":((b=(k=G.properties)==null?void 0:k.wind)==null?void 0:b.kts)>=79&&((D=(C=G.properties)==null?void 0:C.wind)==null?void 0:D.kts)<94?q="#f903d0":((O=(R=G.properties)==null?void 0:R.wind)==null?void 0:O.kts)>=94?q="#8702f9":q="#f44336";const ae=`<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)"]:["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-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":this.theme==="light"?1:0}},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)}}},Cn={key:0,class:"legend-tip-btn-gl4"};function Pn(o,t,a,r,i,l){var s;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip");return(s=a.prmsl)!=null&&s.active?(e.openBlock(),e.createElementBlock("div",Cn,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Map Layers",location:"left"},{activator:e.withCtx(({props:h})=>[e.createVNode(n,e.mergeProps(h,{"min-width":"32",width:"32",height:"32",class:"text-none pa-0",color:i.toggle?"primary":"",onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[0]||(t[0]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[0]},1040,["color","onClick"])]),_:1})],4)])):e.createCommentVNode("",!0)}const Sn=A(Ln,[["render",Pn]]),Td="",Nn={name:"IdmIceEdge",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-edge] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Tn={key:0};function Dn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Tn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"70",-1),e.createElementVNode("span",null,null,-1),e.createElementVNode("span",null,"90",-1),e.createElementVNode("span",null,null,-1)]),4)])):e.createCommentVNode("",!0)}const En=A(Nn,[["render",Dn]]),Dd="",Mn={name:"IdmCover",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-cover] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Vn={key:0};function Bn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Vn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"%",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"40",-1),e.createElementVNode("span",null,"60",-1),e.createElementVNode("span",null,"80",-1),e.createElementVNode("span",null,"100",-1)]),4)])):e.createCommentVNode("",!0)}const In=A(Mn,[["render",Bn],["__scopeId","data-v-dcedee39"]]),Ed="",An={name:"IdmThickness",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[ice-thickness] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Rn={key:0};function On(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"m",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.6",-1),e.createElementVNode("span",null,"1",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1)]),4)])):e.createCommentVNode("",!0)}const jn=A(An,[["render",On]]),Md="",Fn={name:"IdmPrecip3h",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[precip3h] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Hn={key:0};function Gn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Hn,[e.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"mm",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"2",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"7",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1)]),4)])):e.createCommentVNode("",!0)}const Wn=A(Fn,[["render",Gn]]),Vd="",Un={name:"IdmVisibility",props:{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 be,etime:void 0}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[visibility] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Zn={key:0};function Yn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"nm",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"0.5",-1),e.createElementVNode("span",null,"1.5",-1),e.createElementVNode("span",null,"3",-1),e.createElementVNode("span",null,"9",-1)]),4)])):e.createCommentVNode("",!0)}const qn=A(Un,[["render",Yn]]),Bd="",Xn={name:"IdmWaterTemp",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[water-temp] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},$n={key:0};function Kn(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",$n,[e.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const Jn=A(Xn,[["render",Kn]]),Id="",Qn={name:"IdmTemp",props:{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 be,etime:void 0,right:10}},watch:{"factor.version":{handler(){var o;(o=this.factor)!=null&&o.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(this.factor){const o=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(o+t),console.log("[temp] add elapsed: ",a,", total: ",t+=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 o=[[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,o);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,$.vertexSchema,$.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const o=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,o)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},es={key:0};function ts(o,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(e.openBlock(),e.createElementBlock("div",es,[e.createElementVNode("div",{class:"legend-bars-gl4 temp",style:e.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[e.createElementVNode("span",null,"°C",-1),e.createElementVNode("span",null,"-20",-1),e.createElementVNode("span",null,"-10",-1),e.createElementVNode("span",null,"0",-1),e.createElementVNode("span",null,"10",-1),e.createElementVNode("span",null,"20",-1),e.createElementVNode("span",null,"30",-1),e.createElementVNode("span",null,"40",-1)]),4)])):e.createCommentVNode("",!0)}const os=A(Qn,[["render",ts]]),Ad="",as={name:"IdmGlLayer",components:{IdmWindBarb:tn,IdmWindParticle:ln,IdmCurrentDirection:cn,IdmCurrentParticle:pn,IdmWave:yn,IdmSigWaveHeight:xn,IdmSwell:zn,IdmPrmsl:Sn,IdmIceEdge:En,IdmIceCover:In,IdmIceThickness:jn,IdmPrecip3h:Wn,IdmVisibility:qn,IdmWaterTemp:Jn,IdmTemp:os},props:{isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},token:{type:String},defaultMeteoToken:{type:String},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["menuToggle","weatherCheckList","autoActive"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...Ee.LayerHelper.WEATHER_LAYERS],tagLayers:[...Ee.LayerHelper.WEATHER_LAYERS.filter(o=>!o.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},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:{computeDateZ(){return function(o){var t;if(o){const a=z(o);return`${(t=a==null?void 0:a.utc())==null?void 0:t.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(o){return o?z(o).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(o=>o.overlays).map(o=>o.key)},rendersKeys(){return this.allLayers.filter(o=>!o.overlays&&o.enabled).map(o=>o.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var t,a,r;const o=[];for(let i=0;i<((a=(t=this.legend)==null?void 0:t.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`;o.push("icon-a-"+n)}return o}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10})}},forecastModel:{handler(o,t){o&&o!==t&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new go(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(o,t){o&&t&&z(o).utc().format("yyyy-MM-DD HH")!==z(t).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(o,t){o&&o!==t?o==="wave-group"?this.checkList=["wave-group",this.waveToggleValue||"sig-wave"]:o==="ice-forecast"?this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"]:this.checkList=[o]:!o&&t&&(this.checkList=this.checkList.filter(a=>a!==t))}},checkList:{handler(o,t){var a,r,i,l,n,c;this.handleCheckListChange(o,t),this.$emit("weatherCheckList",o),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(o){var t,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=(t=this.$parent)==null?void 0:t.$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(o){o&&(this.checkList=["ice-forecast",this.iceToggleValue])}},waveToggleValue:{handler(o){o&&(this.checkList=["wave-group",this.waveToggleValue])}},showWindParticle:{handler(o){let t="wind-particle";this.weatherLayers[t].particle=o,this.weatherLayers[t].version=Math.random()+1}},showCurrentParticle:{handler(o){let t="current-particle";this.weatherLayers[t].particle=o,this.weatherLayers[t].version=Math.random()+1}},isLogin:{handler(o){o?this.fetchModels():this.models={}},immediate:!0}},methods:{arraysEqual(o,t){if((o==null?void 0:o.length)!==(t==null?void 0:t.length))return!1;for(let a=0;a<(o==null?void 0:o.length);a++)if((o==null?void 0:o[a])!==(t==null?void 0:t[a]))return!1;return!0},fetchCache(){var a,r;const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=t!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),t=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(t))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(t))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(t||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(o){let t=[];this.checkList.includes(o)?t=this.checkList.filter(a=>a!==o):t=[...this.checkList,o],this.handleCheckListChange(t,this.checkList)},handleCheckListChange(o,t){if(this.arraysEqual(o,t))return!1;const a=[...new Set(o)],r=a==null?void 0:a.filter(l=>!(t!=null&&t.includes(l)))[0],i=t==null?void 0:t.filter(l=>!(a!=null&&a.includes(l)))[0];r&&(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):r==="sig-wave"||r==="swell"||r==="wave-group"?(this.checkList=["wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave"):this.rendersKeys.includes(r)?this.checkList=[r]:(this.checkList=a.filter(l=>!this.rendersKeys.includes(l)),this.renderKey=void 0)),i&&(i==="ice-forecast"?(this.checkList=a.filter(l=>!["ice-cover","ice-thickness","ice-forecast"].includes(l)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(l=>!["wave-group","sig-wave","swell"].includes(l)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(l=>a.includes(l.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const o=await J.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(o==null?void 0:o.data.code)===0&&(this.models=o==null?void 0:o.data.data)},async fetchWeatherLayers(o={}){var i,l,n,c,s,h,d,g,u;const t=new Date().valueOf();let a=0,r=0;if(this.map){const y=((i=this.map)==null?void 0:i.getZoom())+1,p=(l=this.map)==null?void 0:l.getBounds(),_=`${p._sw.lng},${p._sw.lat},${p._ne.lng},${p._ne.lat}`;if(this.particleFactor&&((n=this.$refs.layer)!=null&&n.autoActive)){const v=Ee.LayerHelper.WEATHER_LAYERS.find(P=>{var L;return((L=P.peer)==null?void 0:L.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&v.weight?this.weatherWeight:this.weatherWeight+v.weight:this.weatherWeight=this.weatherWeight&v.weight?this.weatherWeight-v.weight:this.weatherWeight}if(this.weatherWeight>0){let v=this.weatherWeight;if(v>0){const P=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],L=await J.get(`${P}/api/arc/weather/layers2/links?l=${v}&v=${this.forecastModel}&z=${y}&bbox=${_}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(r=new Date().valueOf()-(t+a),console.log("weather links elapsed: ",r,", total: ",a+=r),((c=L==null?void 0:L.data)==null?void 0:c.code)===0){const x=(s=L==null?void 0:L.data)==null?void 0:s.data,w=[];for(const k in x)w.push(J.get(x[k],{headers:{Authorization:this.defaultMeteoToken,key:k},responseType:/\.(jpg|png)$/.test(x[k])?"blob":"json"}).catch(b=>{console.log(`[${k}] fetch layer error: ${b}`)}));const f=await Promise.all(w);this.weatherLayers={},f.map(k=>{var D,R,O,I;const b=((D=k==null?void 0:k.data)==null?void 0:D.data)||(k==null?void 0:k.data);let C=(O=(R=k==null?void 0:k.config)==null?void 0:R.headers)==null?void 0:O.key;C&&b&&(this.weatherLayers[C]={raw:b,type:((I=k==null?void 0:k.config)==null?void 0:I.responseType)==="blob"?"image":"json",etime:L.data.etime})})}if(r=new Date().valueOf()-(t+a),console.log("weather layers elapsed: ",r,", total: ",a+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const x=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,w=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:x,height:{raw:w},etime:L.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const x=(g=this.weatherLayers["current-direction"])==null?void 0:g.raw,w=(u=this.weatherLayers["current-speed"])==null?void 0:u.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:x,speed:{raw:w},etime:L.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json()}},handleWeatherLayerToggle(){for(const o in this.weatherLayers)this.weatherLayers[o].active=!1,this.weatherLayers[o].version=Math.random()+1;for(const o of this.activeWeatherLayers){let t=o.key;t==="current-direction"&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,t==="wind-particle"&&(this.weatherLayers[t].particle=this.showWindParticle),t==="current-particle"&&(this.weatherLayers[t].particle=this.showCurrentParticle))}},handleWeatherLayerChange(o={sourceChanged:!1}){var a;const t=(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);o!=null&&o.sourceChanged||this.weatherWeight!==t?(this.weatherWeight=t,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var o,t,a,r,i,l,n,c,s,h,d,g;this.viewport.map.getSource((o=this.viewport)==null?void 0:o.rampColorSource)||this.viewport.map.addSource((t=this.viewport)==null?void 0:t.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((h=this.viewport)==null?void 0:h.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(g=this.viewport)==null?void 0:g.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,c,s,h,d,g;const o=new Date().valueOf();let t=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=N.LngLatHelper.convertToStdLng(r._sw.lng),y=N.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),_=Math.ceil(r._ne.lat);for(const v in this.weatherLayers){let P=!1;if(this.weatherLayers[v].active&&this.weatherLayers[v].type==="json"){let L=[];if(v==="swell"){P=!0;const x=((c=this.weatherLayers[v])==null?void 0:c.direction)||{};for(const f in x)if(f>p&&f<_&&(!(i<=this.zoom)||f%(i<2?10:i<4?5:3)===0)){const k=x[f].lng;u>y?k.forEach((b,C)=>{var D,R,O,I,W,H;if(i<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if((b>=u&&b<=180||b>=-180&&b<=y)&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}}):k.forEach((b,C)=>{var D,R,O,I,W,H;if(u<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if(b>=u&&b<=y&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}})}a=new Date().valueOf()-(o+t),console.log("swell direction elapsed: ",a,", total: ",t+=a);const w=this.weatherLayers[v].height;if(w){if(!w.data){const f=[];for(const k in(s=w.raw)==null?void 0:s.LineString){const b=w.raw.LineString[k];for(const C of b)f.push(E.lineString(C,{val:Number(k)}));w.data=E.featureCollection(f)}}if(w.data){const f=this.handleBboxClip(w.data,r);L=L.concat(f)}a=new Date().valueOf()-(o+t),console.log("swell height elapsed: ",a,", total: ",t+=a)}}else if(v==="current"){P=!0;const x=((h=this.weatherLayers[v])==null?void 0:h.direction)||{};for(const f in x)if(f>p&&f<_&&(!(i<=this.zoom)||f%(i<2?10:i<4?5:3)===0)){const k=x[f].lng;u>y?k.forEach((b,C)=>{var D,R,O,I,W,H;if(i<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if((b>=u&&b<=180||b>=-180&&b<=y)&&(!(i<=this.zoom)||b%(i<2?10:i<4?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}}):k.forEach((b,C)=>{var D,R,O,I,W,H;if(u<2){if((b>=0&&b<=360||b>=-360&&b<=0)&&b%10===0){const F=E.point([b,f],{val:((D=x[f].val)==null?void 0:D[C])||((R=x[f].dir)==null?void 0:R[C]),spd:(O=x[f].spd)==null?void 0:O[C]});L.push(F)}}else if(b>=u&&b<=y&&(!(i<=this.zoom)||b%(i<this.zoom/2?5:3)===0)){const F=E.point([b,f],{val:((I=x[f].val)==null?void 0:I[C])||((W=x[f].dir)==null?void 0:W[C]),spd:(H=x[f].spd)==null?void 0:H[C]});L.push(F)}})}a=new Date().valueOf()-(o+t),console.log("current direction elapsed: ",a,", total: ",t+=a);const w=this.weatherLayers[v].speed;if(w){if(!w.data){const k=[];for(const b in(d=w.raw)==null?void 0:d.Polygon){const C=w.raw.Polygon[b];for(const D of C)k.push(E.polygon(D,{val:Number(b)}))}w.data=E.featureCollection(k)}const f=i<this.zoom?w.data.features.filter(k=>k.properties.val>.5):w.data.features;L=L.concat(f),a=new Date().valueOf()-(o+t),console.log("current speed elapsed: ",a,", total: ",t+=a)}}else if(v==="wind"){P=!0;const x=this.weatherLayers.wind.raw;for(const w in x)if(w>p&&w<_&&(!(i<=this.zoom)||w%(i<2?10:i<4?5:3)===0)){const f=x[w].lng;u>y?f.forEach((k,b)=>{var C,D,R,O;if(i<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const I=E.point([k,w],{dir:((C=x[w].val)==null?void 0:C[b])||((D=x[w].dir)==null?void 0:D[b]),spd:x[w].spd[b]});L.push(I)}}else if((k>=u&&k<=180||k>=-180&&k<=y)&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const I=E.point([k,w],{dir:((R=x[w].val)==null?void 0:R[b])||((O=x[w].dir)==null?void 0:O[b]),spd:x[w].spd[b]});L.push(I)}}):f.forEach((k,b)=>{var C,D,R,O;if(i<2){if((k>=0&&k<=360||k>=-360&&k<=0)&&k%10===0){const I=E.point([k,w],{dir:((C=x[w].val)==null?void 0:C[b])||((D=x[w].dir)==null?void 0:D[b]),spd:x[w].spd[b]});L.push(I)}}else if(k>=u&&k<=y&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const I=E.point([k,w],{dir:((R=x[w].val)==null?void 0:R[b])||((O=x[w].dir)==null?void 0:O[b]),spd:x[w].spd[b]});L.push(I)}})}a=new Date().valueOf()-(o+t),console.log("wind barb elapsed: ",a,", total: ",t+=a)}else if(v==="sig-wave-height"){if(this.weatherLayers[v].data)L=this.weatherLayers[v].data;else{P=!0;const x=this.weatherLayers[v].raw;if(x){const w=[];for(const f in x.Polygon){const k=x.Polygon[f];for(const b of k)w.push(E.polygon(b,{val:Number(f)}))}for(const f in x.MultiPolygon){const k=x.MultiPolygon[f];for(const b of k)w.push(E.multiPolygon(b,{val:Number(f)}))}for(const f in x.Point){const k=x.Point[f];for(let b=0;b<((g=k.lng)==null?void 0:g.length);b++)w.push(E.point([k.lng[b],f],{val:Number(k.val[b])}))}L=L.concat(w)}}a=new Date().valueOf()-(o+t),console.log("sig-wave-height elapsed: ",a,", total: ",t+=a)}else if(v==="prmsl"){if(this.weatherLayers[v].data)L=this.weatherLayers[v].data;else{P=!0;const x=this.weatherLayers[v].raw;if(x){const w=[];for(const f in x.LineString){const k=x.LineString[f];for(const b of k)w.push(E.lineString(b,{val:Number(f)}))}for(const f in x.Point)x.Point[f].lng.forEach((k,b)=>{k=N.LngLatHelper.convertToStdLng(k),w.push(E.point([k,f],{val:x.Point[f].val[b],type:x.Point[f].type[b]}))});L=L.concat(w)}}a=new Date().valueOf()-(o+t),console.log("prmsl elapsed: ",a,", total: ",t+=a)}L.length&&(this.weatherLayers[v].data=E.featureCollection(L)),P&&(this.weatherLayers[v].version=Math.random()+1)}}}},handleMove4Weather(){for(const o in this.weatherLayers)this.weatherLayers[o].active&&this.weatherLayers[o].type==="image"&&(this.weatherLayers[o].active=!0,this.weatherLayers[o].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(o,t){const a=[],r=N.LngLatHelper.convertToStdLng(t._sw.lng),i=N.LngLatHelper.convertToStdLng(t._ne.lng);return o.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,t._sw.lat,180,t._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,t._sw.lat,i,t._ne.lat],c=E.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,t._sw.lat,i,t._ne.lat],c=E.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},is={class:"idm-gl4-meteo-layers"},rs={key:0,class:"legend-tip-btn-gl4"},ls={class:"d-flex flex-row justify-center align-center"},ns={class:"text-caption"},ss={class:"d-flex flex-row justify-center align-center"},cs={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},ms={class:"text-caption px-2"},ds={class:"d-flex flex-row justify-start align-center"},hs={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},ps={class:"text-caption px-2"},gs={class:"header-box d-flex justify-space-between align-center pl-4 pr-4"},us={class:"d-flex justify-start align-center ga-3"},fs={class:"text-h5 font-weight-medium"},ys={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},bs={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},ws={class:"text-body-1 py-2"},xs={class:"text-body-1 font-weight-medium"},_s={class:"text-body-2 text-label"},ks={class:"text-body-2 text-label"},vs={class:"text-body-2 text-label mb-3"},zs={class:"text-body-1 font-weight-medium"},Ls={class:"text-body-2 text-label"},Cs={class:"text-body-2 text-label"},Ps={class:"text-body-2 text-label mb-3"},Ss={class:"text-body-1 py-2"},Ns={class:"text-body-1 font-weight-medium"},Ts={class:"text-body-2 text-label"},Ds={class:"text-body-2 text-label"},Es={class:"text-body-2 text-label mb-3"},Ms={class:"text-body-1 font-weight-medium"},Vs={class:"text-body-2 text-label"},Bs={class:"text-body-2 text-label"},Is={class:"text-body-2 text-label mb-3"},As={class:"text-body-1 py-2"},Rs={class:"text-body-1 font-weight-medium"},Os={class:"text-body-2 text-label"},js={class:"text-body-2 text-label"},Fs={class:"text-body-2 text-label mb-3"};function Hs(o,t,a,r,i,l){var G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke,ve,pe;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VCol"),h=e.resolveComponent("VRow"),d=e.resolveComponent("VCardText"),g=e.resolveComponent("VDivider"),u=e.resolveComponent("VCard"),y=e.resolveComponent("VSwitch"),p=e.resolveComponent("VCardTitle"),_=e.resolveComponent("VCardItem"),v=e.resolveComponent("VCheckbox"),P=e.resolveComponent("VRadio"),L=e.resolveComponent("VBtnToggle"),x=e.resolveComponent("IdmWindBarb"),w=e.resolveComponent("IdmSigWaveHeight"),f=e.resolveComponent("IdmCurrentDirection"),k=e.resolveComponent("IdmPrmsl"),b=e.resolveComponent("IdmWindParticle"),C=e.resolveComponent("IdmCurrentParticle"),D=e.resolveComponent("IdmWave"),R=e.resolveComponent("IdmSwell"),O=e.resolveComponent("IdmIceEdge"),I=e.resolveComponent("IdmIceCover"),W=e.resolveComponent("IdmIceThickness"),H=e.resolveComponent("IdmPrecip3h"),F=e.resolveComponent("IdmVisibility"),Q=e.resolveComponent("IdmWaterTemp"),K=e.resolveComponent("IdmTemp");return e.openBlock(),e.createElementBlock("div",is,[e.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:e.normalizeStyle({top:a.top+94+"px",right:i.right+"px"})},[e.createVNode(c,{text:o.$t("weather.weatherLayers"),location:"left"},{activator:e.withCtx(({props:V})=>[e.createVNode(n,e.mergeProps(V,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:e.withCtx(()=>t[8]||(t[8]=[e.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text"])],4),l.showTipMenu?(e.openBlock(),e.createElementBlock("div",rs,[e.createElementVNode("div",{class:"menu-bar-box pa-1 rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createVNode(c,{text:"Legend",location:"left"},{activator:e.withCtx(({props:V})=>[e.createVNode(n,e.mergeProps(V,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:t[0]||(t[0]=Z=>i.legendToggle=!i.legendToggle)}),{default:e.withCtx(()=>t[9]||(t[9]=[e.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[9]},1040,["class"])]),_:1})],4),i.legendToggle?(e.openBlock(),e.createBlock(u,{key:0,width:"435",elevation:"16",class:"card-info d-flex justify-center align-start",style:e.normalizeStyle({position:"absolute",top:"340px",right:i.right+50+"px"})},{default:e.withCtx(()=>[e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[10]||(t[10]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Wind Level",-1)),e.createVNode(h,{class:"ma-0 ml-n1 text-body-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.barbs,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:V,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ls,[e.createElementVNode("i",{class:e.normalizeClass(["iconfont",l.barbsIconName[Z]]),style:e.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),e.createElementVNode("span",ns,e.toDisplayString(Number(V)<10?`00${V}kts`:Number(V)<100?`0${V}kts`:`${V}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[10]}),e.createVNode(g,{vertical:""}),e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[11]||(t[11]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Wave Height",-1)),e.createVNode(h,{class:"ma-0 ml-1",style:{width:"100px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.sigWaveHeight,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:Z,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ss,[Z===0?(e.openBlock(),e.createElementBlock("div",cs)):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({width:"24px",height:"12px",background:V.color})},null,4)),e.createElementVNode("div",ms,e.toDisplayString(V.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),e.createVNode(g,{vertical:""}),e.createVNode(d,{class:"d-flex flex-column justify-center align-start opacity-80 px-4"},{default:e.withCtx(()=>[t[12]||(t[12]=e.createElementVNode("div",{class:"text-body-1 font-weight-600 mb-2"},"Current",-1)),e.createVNode(h,{class:"ma-0 ml-n5",style:{width:"110px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.legend.current,(V,Z)=>(e.openBlock(),e.createBlock(s,{key:Z,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ds,[e.createElementVNode("div",hs,[e.createElementVNode("i",{class:"iconfont icon-a-direction-arrow opacity-80",style:e.normalizeStyle({fontSize:40*V.size+"px"})},null,4)]),e.createElementVNode("div",ps,e.toDisplayString(V.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]})]),_:1},8,["style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition flex-center",i.toggle?"right-bar":""]),style:e.normalizeStyle({top:a.top+"px",right:i.toggle?"0px":"-280px"})},[e.createElementVNode("div",gs,[e.createElementVNode("div",us,[e.createElementVNode("div",fs,e.toDisplayString(o.$t("weather.weather")),1),e.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":t[1]||(t[1]=V=>i.autoActive=V),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[13]||(t[13]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[13]},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["list-box scroll pl-4 pr-2 overflow-y-auto",i.autoActive?"":"cursor-not-allowed"])},[e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.overlays")),1)]),_:1})]),_:1}),e.createVNode(d,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(V=>V.overlays),V=>(e.openBlock(),e.createBlock(v,{key:V.key,modelValue:i.checkList,"onUpdate:modelValue":t[2]||(t[2]=Z=>i.checkList=Z),value:V.key,label:o.$t(`weather.${V.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}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.renders")),1)]),_:1})]),_:1}),e.createVNode(d,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(V=>!V.overlays),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[e.createVNode(P,{modelValue:i.renderKey,"onUpdate:modelValue":t[3]||(t[3]=Z=>i.renderKey=Z),label:o.$t(`weather.${V.locale}`),value:V.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:Z=>i.renderKey=i.renderKey===V.key?"":V.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&V.key==="wind-particle"?(e.openBlock(),e.createElementBlock("div",ys,[e.createElementVNode("span",null,e.toDisplayString(o.$t("weather.particleAnimatiom")),1),e.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":t[4]||(t[4]=Z=>i.showWindParticle=Z),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.renderKey==="current-particle"&&V.key==="current-particle"?(e.openBlock(),e.createElementBlock("div",bs,[e.createElementVNode("span",null,e.toDisplayString(o.$t("weather.particleAnimatiom")),1),e.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":t[5]||(t[5]=Z=>i.showCurrentParticle=Z),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):e.createCommentVNode("",!0),i.renderKey==="wave-group"&&V.key==="wave-group"?(e.openBlock(),e.createBlock(L,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":t[6]||(t[6]=Z=>i.waveToggleValue=Z),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:e.withCtx(()=>[e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&V.key==="ice-forecast"?(e.openBlock(),e.createBlock(L,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":t[7]||(t[7]=Z=>i.iceToggleValue=Z),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:e.withCtx(()=>[e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),e.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:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):e.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(_,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(p,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("weather.forecastModel")),1)]),_:1})]),_:1}),e.createVNode(d,{class:""},{default:e.withCtx(()=>{var V,Z,Pe,we,le,se,B,fe,Y,X,ze,T,ce,xe,Le,Ce,S,j,Ne,Te,De,ye,Be,Ie,Ae,Re,Oe,je,Fe,He,Ge,We,Ue,Ze,Ye,qe,Xe,$e,Ke,Je,Qe,et,tt,ot,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,_t,kt,vt,zt,Lt,Ct,Pt,St,Nt,Tt,Dt,Et,Mt,Vt,Bt,It,At,Rt,Ot,jt,Ft,Ht,Gt,Wt,Ut,Zt,Yt,qt,Xt,Kt,Jt,Qt,eo,to,oo,ao,io,ro,lo,no,so,co,mo;return[e.createElementVNode("div",ws,e.toDisplayString(o.$t("weather.atmospheric")),1),e.createElementVNode("div",xs,e.toDisplayString((Pe=(Z=(V=i.models)==null?void 0:V.weather)==null?void 0:Z.NOAA)==null?void 0:Pe.source)+" "+e.toDisplayString((se=(le=(we=i.models)==null?void 0:we.weather)==null?void 0:le.NOAA)==null?void 0:se.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((X=(Y=(fe=(B=i.models)==null?void 0:B.weather)==null?void 0:fe.NOAA)==null?void 0:Y.meta)==null?void 0:X.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",_s,e.toDisplayString(o.$t("weather.source"))+": NOAA",1),e.createElementVNode("div",ks,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((xe=(ce=(T=(ze=i.models)==null?void 0:ze.weather)==null?void 0:T.NOAA)==null?void 0:ce.meta)==null?void 0:xe.availabilityTime)),1),e.createElementVNode("div",vs,e.toDisplayString(o.$t("weather.referenceTime"))+": "+e.toDisplayString(l.computeDateZ((j=(S=(Ce=(Le=i.models)==null?void 0:Le.weather)==null?void 0:Ce.NOAA)==null?void 0:S.meta)==null?void 0:j.initialisationTime)),1),e.createElementVNode("div",zs,e.toDisplayString((De=(Te=(Ne=i.models)==null?void 0:Ne.weather)==null?void 0:Te.ECMWF)==null?void 0:De.source)+" "+e.toDisplayString((Ie=(Be=(ye=i.models)==null?void 0:ye.weather)==null?void 0:Be.ECMWF)==null?void 0:Ie.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((je=(Oe=(Re=(Ae=i.models)==null?void 0:Ae.weather)==null?void 0:Re.ECMWF)==null?void 0:Oe.meta)==null?void 0:je.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Ls,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",Cs,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((We=(Ge=(He=(Fe=i.models)==null?void 0:Fe.weather)==null?void 0:He.ECMWF)==null?void 0:Ge.meta)==null?void 0:We.availabilityTime)),1),e.createElementVNode("div",Ps,e.toDisplayString(o.$t("weather.referenceTime"))+": "+e.toDisplayString(l.computeDateZ((qe=(Ye=(Ze=(Ue=i.models)==null?void 0:Ue.weather)==null?void 0:Ze.ECMWF)==null?void 0:Ye.meta)==null?void 0:qe.initialisationTime)),1),e.createVNode(g),e.createElementVNode("div",Ss,e.toDisplayString(o.$t("weather.wave")),1),e.createElementVNode("div",Ns,e.toDisplayString((Je=(Ke=($e=(Xe=i.models)==null?void 0:Xe.marine)==null?void 0:$e.wave)==null?void 0:Ke.NOAA)==null?void 0:Je.source)+" "+e.toDisplayString((ot=(tt=(et=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:et.wave)==null?void 0:tt.NOAA)==null?void 0:ot.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((nt=(lt=(rt=(it=(at=i.models)==null?void 0:at.marine)==null?void 0:it.wave)==null?void 0:rt.NOAA)==null?void 0:lt.meta)==null?void 0:nt.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Ts,e.toDisplayString(o.$t("weather.source"))+": NOAA",1),e.createElementVNode("div",Ds,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((ht=(dt=(mt=(ct=(st=i.models)==null?void 0:st.marine)==null?void 0:ct.wave)==null?void 0:mt.NOAA)==null?void 0:dt.meta)==null?void 0:ht.availabilityTime)),1),e.createElementVNode("div",Es,e.toDisplayString(o.$t("weather.referenceTime"))+": "+e.toDisplayString(l.computeDateZ((yt=(ft=(ut=(gt=(pt=i.models)==null?void 0:pt.marine)==null?void 0:gt.wave)==null?void 0:ut.NOAA)==null?void 0:ft.meta)==null?void 0:yt.initialisationTime)),1),e.createElementVNode("div",Ms,e.toDisplayString((_t=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.ECMWF)==null?void 0:_t.source)+" "+e.toDisplayString((Lt=(zt=(vt=(kt=i.models)==null?void 0:kt.marine)==null?void 0:vt.wave)==null?void 0:zt.ECMWF)==null?void 0:Lt.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((Tt=(Nt=(St=(Pt=(Ct=i.models)==null?void 0:Ct.marine)==null?void 0:Pt.wave)==null?void 0:St.ECMWF)==null?void 0:Nt.meta)==null?void 0:Tt.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Vs,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",Bs,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((Bt=(Vt=(Mt=(Et=(Dt=i.models)==null?void 0:Dt.marine)==null?void 0:Et.wave)==null?void 0:Mt.ECMWF)==null?void 0:Vt.meta)==null?void 0:Bt.availabilityTime)),1),e.createElementVNode("div",Is,e.toDisplayString(o.$t("weather.referenceTime"))+": "+e.toDisplayString(l.computeDateZ((jt=(Ot=(Rt=(At=(It=i.models)==null?void 0:It.marine)==null?void 0:At.wave)==null?void 0:Rt.ECMWF)==null?void 0:Ot.meta)==null?void 0:jt.initialisationTime)),1),e.createVNode(g),e.createElementVNode("div",As,e.toDisplayString(o.$t("weather.currents")),1),e.createElementVNode("div",Rs,e.toDisplayString((Wt=(Gt=(Ht=(Ft=i.models)==null?void 0:Ft.marine)==null?void 0:Ht.current)==null?void 0:Gt.ECMWF)==null?void 0:Wt.source)+" "+e.toDisplayString((qt=(Yt=(Zt=(Ut=i.models)==null?void 0:Ut.marine)==null?void 0:Zt.current)==null?void 0:Yt.ECMWF)==null?void 0:qt.spatialResolution)+e.toDisplayString(o.$t("units.km"))+" "+e.toDisplayString((eo=(Qt=(Jt=(Kt=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:Kt.current)==null?void 0:Jt.ECMWF)==null?void 0:Qt.meta)==null?void 0:eo.days)+e.toDisplayString(o.$t("units.days")),1),e.createElementVNode("div",Os,e.toDisplayString(o.$t("weather.source"))+": ECMWF",1),e.createElementVNode("div",js,e.toDisplayString(o.$t("weather.lastUpdate"))+": "+e.toDisplayString(l.computeDateUpdate((ro=(io=(ao=(oo=(to=i.models)==null?void 0:to.marine)==null?void 0:oo.current)==null?void 0:ao.ECMWF)==null?void 0:io.meta)==null?void 0:ro.availabilityTime)),1),e.createElementVNode("div",Fs,e.toDisplayString(o.$t("weather.referenceTime"))+": "+e.toDisplayString(l.computeDateZ((mo=(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.meta)==null?void 0:mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(e.openBlock(),e.createBlock(x,e.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},o.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(q=i.weatherLayers)==null?void 0:q["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(f,e.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(ae=i.weatherLayers)==null?void 0:ae.current,"menu-toggle":a.menuToggle},o.$attrs),null,16,["map","map-feather","current","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(k,e.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-2",prmsl:(ee=i.weatherLayers)==null?void 0:ee.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(b,e.mergeProps({key:5,viewport:i.viewport,factor:(ie=i.weatherLayers)==null?void 0:ie["wind-particle"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(C,e.mergeProps({key:6,viewport:i.viewport,factor:(ne=i.weatherLayers)==null?void 0:ne["current-particle"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(D,e.mergeProps({key:7,viewport:i.viewport,factor:(M=i.weatherLayers)==null?void 0:M["sig-wave"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(R,e.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(te=i.weatherLayers)==null?void 0:te.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},o.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(O,e.mergeProps({key:9,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["ice-edge"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(I,e.mergeProps({key:10,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-cover"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:11,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue["ice-thickness"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:12,viewport:i.viewport,factor:(_e=i.weatherLayers)==null?void 0:_e.precip3h,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(F,e.mergeProps({key:13,viewport:i.viewport,factor:(ke=i.weatherLayers)==null?void 0:ke.visibility,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:14,viewport:i.viewport,factor:(ve=i.weatherLayers)==null?void 0:ve["water-temp"],"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(K,e.mergeProps({key:15,viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe.temp,"menu-toggle":a.menuToggle},o.$attrs),null,16,["viewport","factor","menu-toggle"])):e.createCommentVNode("",!0)])}const Gs=A(as,[["render",Hs]]),Me=[{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"}],Ve=[{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"}];class wo{static standardWeatherModels(){return Me.filter(t=>!t.disabled&&t.alias)}static standardMarineModels(){return Ve.filter(t=>!t.disabled&&t.alias)}static autoPickLayerModel(t,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",t=t==null?void 0:t.toLowerCase(),t==="gfs"?"gfs":["ec","ecmwf"].includes(t)?"ecmwf":["copernicus","cmems"].includes(t)?"copernicus":a}static autoPickPeerModel(t,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),Ra.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&t.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(t="best_match"){var a,r;t=t==null?void 0:t.toLowerCase(),t=t==="ec"?"ecmwf":t;const i=t.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=Me.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(c))||((u=d.alias)==null?void 0:u.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c}),h=Ve.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(c))||((u=d.alias)==null?void 0:u.toLowerCase())===c||((y=d.name)==null?void 0:y.toLowerCase())===c});s=s||Me.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=h==null?void 0:h.alias)==null?void 0:u.toLowerCase())}),h=h||Ve.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=s==null?void 0:s.alias)==null?void 0:u.toLowerCase())}),s=s||Me[0],h=h||Ve[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=h.models)!=null&&r.includes(c)?c:h.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(t){t=t.toUpperCase();const a=Me.filter(l=>l.alias===t),r=Ve.filter(l=>l.alias===t),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(t,a){var r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W,H,F,Q,K,G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke,ve,pe,V,Z,Pe,we;const le=typeof a=="string"?z(a):a,se=t==null?void 0:t.weather,B=t==null?void 0:t.marine,fe=z((i=(r=se==null?void 0:se[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),Y=fe.clone().add((c=(n=(l=se==null?void 0:se[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),X=fe.clone().add((d=(h=(s=se==null?void 0:se[0])==null?void 0:s.hourly)==null?void 0:h.time)==null?void 0:d.at(-1),"h"),ze=[];if(le.isBetween(Y,X,"millisecond","[]")){const T=le.utc().diff(Y,"h",!1);let ce,xe;if(se){let Le=0,Ce=0;for(const S of se){const j=S==null?void 0:S.hourly;for(let ye=T-(T-1)%3;ye<=T;ye++)Le+=(g=j==null?void 0:j.precipitation)==null?void 0:g.at(ye);for(let ye=T-(T-1)%6;ye<=T;ye++)Ce+=(u=j==null?void 0:j.precipitation)==null?void 0:u.at(ye);ce={temp:(y=j==null?void 0:j.temperature_2m)==null?void 0:y.at(T),apparentTemp:(p=j==null?void 0:j.apparent_temperature)==null?void 0:p.at(T),rh:(_=j==null?void 0:j.relative_humidity_2m)==null?void 0:_.at(T),dp:(v=j==null?void 0:j.dew_point_2m)==null?void 0:v.at(T),precip:{probability:(P=j==null?void 0:j.precipitation_probability)==null?void 0:P.at(T),sum:(L=j==null?void 0:j.precipitation)==null?void 0:L.at(T),sum3Hours:Math.round(Le*100)/100,sum6Hours:Math.round(Ce*100)/100},pmsl:(x=j==null?void 0:j.pressure_msl)==null?void 0:x.at(T),psurf:(w=j==null?void 0:j.surface_pressure)==null?void 0:w.at(T),code:(f=j==null?void 0:j.weather_code)==null?void 0:f.at(T),visibility:this.m2nm((k=j==null?void 0:j.visibility)==null?void 0:k.at(T)),wind:{speed:(b=j==null?void 0:j.wind_speed_10m)==null?void 0:b.at(T),kts:(C=j==null?void 0:j.wind_speed_10m)==null?void 0:C.at(T),degree:(D=j==null?void 0:j.wind_direction_10m)==null?void 0:D.at(T),bearing:((R=j==null?void 0:j.wind_direction_10m)==null?void 0:R.at(T))!==null?(((O=j==null?void 0:j.wind_direction_10m)==null?void 0:O.at(T))+180)%360:null,gusts:(I=j==null?void 0:j.wind_gusts_10m)==null?void 0:I.at(T)},isDay:(W=j==null?void 0:j.is_day)==null?void 0:W.at(T)};const{name:Ne,url:Te,bg:De}=this.parseWeatherCode(ce.code,ce.isDay);ce.name=Ne,ce.url=Te,ce.bg=De,ce.wind.scale=this.beaufort(this.kts2ms(ce.wind.kts)),ce.wind.direction=this.degree2Direction(ce.wind.degree),ze.push({utc:Y.add(T,"h").format(),model:S.model,weather:{...ce}})}}if(B){let Le=0;for(const Ce of B){const S=Ce==null?void 0:Ce.hourly;xe={wave:{sig:{height:(H=S==null?void 0:S.wave_height)==null?void 0:H.at(T),degree:(F=S==null?void 0:S.wave_direction)==null?void 0:F.at(T),bearing:((Q=S==null?void 0:S.wave_direction)==null?void 0:Q.at(T))!==null?(((K=S==null?void 0:S.wave_direction)==null?void 0:K.at(T))+180)%360:null,period:(G=S==null?void 0:S.wave_period)==null?void 0:G.at(T)},swell:{height:(q=S==null?void 0:S.swell_wave_height)==null?void 0:q.at(T),degree:(ae=S==null?void 0:S.swell_wave_direction)==null?void 0:ae.at(T),bearing:((ee=S==null?void 0:S.swell_wave_direction)==null?void 0:ee.at(T))!==null?(((ie=S==null?void 0:S.swell_wave_direction)==null?void 0:ie.at(T))+180)%360:null,period:(ne=S==null?void 0:S.swell_wave_period)==null?void 0:ne.at(T),peakPeriod:(M=S==null?void 0:S.swell_wave_peak_period)==null?void 0:M.at(T)},wd:{height:(te=S==null?void 0:S.wind_wave_height)==null?void 0:te.at(T),degree:(de=S==null?void 0:S.wind_wave_direction)==null?void 0:de.at(T),bearing:((ge=S==null?void 0:S.wind_wave_direction)==null?void 0:ge.at(T))!==null?(((ue=S==null?void 0:S.wind_wave_direction)==null?void 0:ue.at(T))+180)%360:null,period:(_e=S==null?void 0:S.wind_wave_period)==null?void 0:_e.at(T),peakPeriod:(ke=S==null?void 0:S.wind_wave_peak_period)==null?void 0:ke.at(T)}},current:{speed:(ve=S==null?void 0:S.ocean_current_velocity)==null?void 0:ve.at(T),kts:(pe=S==null?void 0:S.ocean_current_velocity)==null?void 0:pe.at(T),degree:(V=S==null?void 0:S.ocean_current_direction)==null?void 0:V.at(T),bearing:((Z=S==null?void 0:S.ocean_current_direction)==null?void 0:Z.at(T))??null},sst:(Pe=S==null?void 0:S.sea_surface_temperature)==null?void 0:Pe.at(T),height:(we=S==null?void 0:S.sea_level_height_msl)==null?void 0:we.at(T)},xe.wave=this.parseWave(xe.wave,ce==null?void 0:ce.wind),xe.current.direction=this.degree2Direction(xe.current.degree),Object.assign(ze[Le],xe),Le++}}}return ze}static toLegacy(t){var a,r,i,l,n,c,s,h,d,g;return{wind:(a=t==null?void 0:t.weather)==null?void 0:a.wind,visibility:(r=t==null?void 0:t.weather)==null?void 0:r.visibility,temp:(i=t==null?void 0:t.weather)==null?void 0:i.temp,prmsl:(l=t==null?void 0:t.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=t==null?void 0:t.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=t==null?void 0:t.weather)==null?void 0:s.precip,code:(h=t==null?void 0:t.weather)==null?void 0:h.code,name:(d=t==null?void 0:t.weather)==null?void 0:d.name,url:(g=t==null?void 0:t.weather)==null?void 0:g.url,wave:t==null?void 0:t.wave,current:t==null?void 0:t.current,sst:t==null?void 0:t.sst,height:t==null?void 0:t.height,utc:t==null?void 0:t.utc,source:t==null?void 0:t.model}}static pickDaily(t,a){var r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W,H,F,Q,K,G,q,ae,ee,ie,ne,M,te,de,ge,ue,_e,ke;const ve=typeof a=="string"?z(a):a,pe=t==null?void 0:t.weather,V=t==null?void 0:t.marine,Z=z((l=(i=(r=pe==null?void 0:pe[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Pe=z((s=(c=(n=pe==null?void 0:pe[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),we=[];if(ve.isBetween(Z,Pe,"millisecond","[]")){let le,se;const B=ve.diff(Z,"d",!1);if(pe)for(const fe of pe){const Y=fe.daily;le={code:(h=Y.weather_code)==null?void 0:h.at(B),temp:{max:(d=Y.temperature_2m_max)==null?void 0:d.at(B),min:(g=Y.temperature_2m_min)==null?void 0:g.at(B),mean:(u=Y.temperature_2m_mean)==null?void 0:u.at(B)},apparentTemp:{max:(y=Y.apparent_temperature_max)==null?void 0:y.at(B),min:(p=Y.apparent_temperature_min)==null?void 0:p.at(B)},precip:{sum:(_=Y.precipitation_sum)==null?void 0:_.at(B),rainSum:(v=Y.rain_sum)==null?void 0:v.at(B),snowfallSum:(P=Y.snowfall_sum)==null?void 0:P.at(B),showersSum:(L=Y.showers_sum)==null?void 0:L.at(B),hours:(x=Y.precipitation_hours)==null?void 0:x.at(B),probability:(w=Y.precipitation_probability_max)==null?void 0:w.at(B)},rh:{max:(f=Y.relative_humidity_2m_max)==null?void 0:f.at(B),min:(k=Y.relative_humidity_2m_min)==null?void 0:k.at(B),mean:(b=Y.relative_humidity_2m_mean)==null?void 0:b.at(B)},wind:{speed:(C=Y.wind_speed_10m_max)==null?void 0:C.at(B),kts:(D=Y.wind_speed_10m_max)==null?void 0:D.at(B),degree:(R=Y.wind_direction_10m_dominant)==null?void 0:R.at(B),gusts:(O=Y.wind_gusts_10m_max)==null?void 0:O.at(B),bearing:((I=Y.wind_direction_10m_dominant)==null?void 0:I.at(B))!==null?(((W=Y.wind_direction_10m_dominant)==null?void 0:W.at(B))+180)%360:null}};const{name:X,url:ze,bg:T}=this.parseWeatherCode(le.code,!0);le.name=X,le.url=ze,le.bg=T,le.wind.scale=this.beaufort(this.kts2ms(le.wind.kts)),le.wind.direction=this.degree2Direction(le.wind.degree),we.push({utc:Z.add(B,"d").utc().format(),model:fe.model,weather:{...le}})}if(V){let fe=0;for(const Y of V){const X=Y.daily;se={wave:{sig:{height:(H=X.wave_height_max)==null?void 0:H.at(B),degree:(F=X.wave_direction_dominant)==null?void 0:F.at(B),period:(Q=X.wave_period_max)==null?void 0:Q.at(B),bearing:((K=X.wave_direction_dominant)==null?void 0:K.at(B))!==null?(((G=X.wave_direction_dominant)==null?void 0:G.at(B))+180)%360:null},swell:{height:(q=X.swell_wave_height_max)==null?void 0:q.at(B),degree:(ae=X.swell_wave_direction_dominant)==null?void 0:ae.at(B),period:(ee=X.swell_wave_period_max)==null?void 0:ee.at(B),peakPeriod:(ie=X.swell_wave_peak_period_max)==null?void 0:ie.at(B),bearing:((ne=X.swell_wave_direction_dominant)==null?void 0:ne.at(B))!==null?((M=X.swell_wave_direction_dominant)==null?void 0:M.at(B))%360:null},wd:{height:(te=X.wind_wave_height_max)==null?void 0:te.at(B),degree:(de=X.wind_wave_direction_dominant)==null?void 0:de.at(B),period:(ge=X.wind_wave_period_max)==null?void 0:ge.at(B),peakPeriod:(ue=X.wind_wave_peak_period_max)==null?void 0:ue.at(B),bearing:((_e=X.wind_wave_direction_dominant)==null?void 0:_e.at(B))!==null?(((ke=X.wind_wave_direction_dominant)==null?void 0:ke.at(B))+180)%360:null}}},se.wave=this.parseWave(se.wave,le==null?void 0:le.wind),Object.assign(we[fe],se),fe++}}}return we}static parseWave(t,a){if(t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t.sig.height===0){const r=Math.sqrt(Math.pow(t.swell.height||0,2)+Math.pow(t.wd.height||0,2));t.sig.height=Math.round(r*100)/100}if(t.swell.height===0)if(t.sig.height>t.wd.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.wd.height||0,2)));t.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;t.swell.height=Math.round(i*100)/100}if(t.wd.height===0||t.wd.height>t.sig.height)if(t.sig.height>t.swell.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(r*100)/100}return t.swell.height>t.sig.height&&(t.swell.height=Math.round(t.sig.height*.76*100)/100),t.sig.period||(t.sig.period=Math.round(5*Math.sqrt(t.sig.height))),t.swell.period||(t.swell.period=Math.round(5*Math.sqrt(t.swell.height))),t.wd.period||(t.wd.period=Math.round(5*Math.sqrt(t.wd.height))),t}static parseWeatherCode(t,a){const r=this.weatherCode(t);return(a?r.day:r.night)||{}}static weatherCode(t){const a={code:t};switch(t){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(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let a=t%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(t){const a=this.degree2Radian(t);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(t){let a=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?a=0:t<=1.5?a=1:t<=3.3?a=2:t<=5.4?a=3:t<=7.9?a=4:t<=10.7?a=5:t<=13.8?a=6:t<=17.1?a=7:t<=20.7?a=8:t<=22.4?a=9:t<=28.4?a=10:t<=32.6?a=11:t>32.6&&(a=12)),a}static douglas(t){let a="Calm";return isNaN(t)||t<=.1?a="Calm":t<=.5?a="Smooth":t<=1.25?a="Slight":t<=2.5?a="Moderate":t<=4?a="Rough":t<=6?a="VeryRough":t<=9?a="High":t<=14?a="VeryHigh":a="Precipitous",a}}const Rd="",Ws={name:"IdmTropicals",props:{permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},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","tropicalProbability","tropicalNotification"],setup(){return{Theme:re.useTheme()}},data(){return{right:10,toggle:!1,helper:Ee.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(o,t)=>{if(o){const a=z(o).utcOffset(t),r=t<0?t:"+"+t;return`${a==null?void 0:a.format("MMM-DD/HHmm")} ( UTC${r} ) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(o,t,a="MM-DD HH:mm")=>{var r,i;if(o){const l=t||0,n=(i=(r=z(o))==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(o){const t=wo.kts2ms(o);return wo.beaufort(t)}},computeMovement(){return function(o){var t,a;return(a=(t=o==null?void 0:o.forecasts)==null?void 0:t.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return o=>!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat)?"-":N.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty+" / "+N.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.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)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(o,t){o!==t&&this.handleRefresh()}},realTime:{handler(o){this.map&&o&&this.toggle&&this.handleRender()}},locale:{handler(o){this.map&&this.toggle&&this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){var o,t,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(t=(o=this.$parent)==null?void 0:o.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const o=new Date().valueOf();let t=0,a=0,r=(i=Ee.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 J.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(a=new Date().valueOf()-(o+t),console.log("weather links elapsed: ",a,", total: ",t+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const h=(n=s==null?void 0:s.data)==null?void 0:n.data;await J.get(h.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(h.tropicals)?"blob":"json"}).then(d=>{var y,p,_;const g=N.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((_=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:_.key)&&g&&(this.tropicals={data:g,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`[${key}] fetch layer error: ${d}`)})}a=new Date().valueOf()-(o+t),console.log("tropicals elapsed: ",a,", total: ",t+=a)}},handleRefresh(){var t,a;(((a=(t=this.tropicals)==null?void 0:t.data)==null?void 0:a.features)||[]).forEach(r=>{var i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w;if(((i=r.geometry)==null?void 0:i.type)==="Point"){let f="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):f="TD";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):f="TS";break;case(((h=r.properties.wind)==null?void 0:h.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):f="STS";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):f="TY";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):f="STY";break;case(((_=r.properties.wind)==null?void 0:_.kts)>=94||((v=r.properties)==null?void 0:v.kts)>=94):f="Super TY";break;default:f="Super TY";break}r.properties.level=f}((P=r.geometry)==null?void 0:P.type)==="Point"&&((L=r.properties)!=null&&L.important)&&(r.properties.format=(w=(x=z(r.properties.date))==null?void 0:x.utcOffset(this.timeZone))==null?void 0:w.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`))}),this.handleInit()},handleInit(){var o,t,a,r,i,l,n,c,s,h,d,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(o=this.map)==null||o.on("click",this.clickLayers,this.handleClick),(t=this.map)==null||t.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):(g=(d=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:d.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var o,t,a,r,i,l,n,c,s,h;if(this.tropicals&&this.map){const d=new Date().valueOf();let g=0,u=0;(o=this.map)!=null&&o.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((t=this.tropicals)!=null&&t.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g),console.log("[tropicals] update elapsed: ",u,", total: ",g+=u)):(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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"line-width":3,"line-opacity":.9,"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":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#f2a0a0"],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(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),u=new Date().valueOf()-(d+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(h=this.tropicals)==null?void 0:h.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"#fff"}},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]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],32]],"#03f869",["boolean",["<",["get","kts",["get","wind"]],47]],"#f2f202",["boolean",["<",["get","kts",["get","wind"]],63]],"#ff9100",["boolean",["<",["get","kts",["get","wind"]],79]],"#f44336",["boolean",["<",["get","kts",["get","wind"]],94]],"#f903d0",["boolean",[">=",["get","kts",["get","wind"]],94]],"#8702f9","#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":1}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=N.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var o,t,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),(o=this.interpolateMarkers)==null||o.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)),(t=this.map)==null||t.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 o,t,a,r,i,l,n,c,s,h,d,g,u,y,p,_,v,P,L,x,w,f,k,b,C,D,R,O,I,W;if((o=this.interpolateMarkers)==null||o.forEach(H=>H==null?void 0:H.remove()),(t=this.interpolateData)!=null&&t.length&&this.tropicals.active){const H=z(this.realTime).utc().set({minute:0,second:0,millisecond:0}),F=this.interpolateData.filter(G=>G.properties.date===(H==null?void 0:H.format())&&!G.properties.disabled),Q=this.handleComputePolygons(F),K=E.featureCollection([...F]);Q.forEach(G=>{K.features.push(G)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(K):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:K}),(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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];for(const G of F)if(!G.properties.disabled){let q="#f44336";((c=(n=G.properties)==null?void 0:n.wind)==null?void 0:c.kts)<32||!((h=(s=G.properties)==null?void 0:s.wind)!=null&&h.kts)?q="#03f869":((g=(d=G.properties)==null?void 0:d.wind)==null?void 0:g.kts)>=32&&((y=(u=G.properties)==null?void 0:u.wind)==null?void 0:y.kts)<47?q="#f2f202":((_=(p=G.properties)==null?void 0:p.wind)==null?void 0:_.kts)>=47&&((P=(v=G.properties)==null?void 0:v.wind)==null?void 0:P.kts)<63?q="#ff9100":((x=(L=G.properties)==null?void 0:L.wind)==null?void 0:x.kts)>=63&&((f=(w=G.properties)==null?void 0:w.wind)==null?void 0:f.kts)<79?q="#f44336":((b=(k=G.properties)==null?void 0:k.wind)==null?void 0:b.kts)>=79&&((D=(C=G.properties)==null?void 0:C.wind)==null?void 0:D.kts)<94?q="#f903d0":((O=(R=G.properties)==null?void 0:R.wind)==null?void 0:O.kts)>=94?q="#8702f9":q="#f44336";const ae=`<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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmwx/idmui-gl4",
3
3
  "private": false,
4
- "version": "1.7.7",
4
+ "version": "1.7.8",
5
5
  "description": "idm webgl4",
6
6
  "type": "module",
7
7
  "keywords": [