@idmwx/idmui-gl4 1.7.6 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,11 +2,12 @@
2
2
  <span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
3
3
  <span>${l.seriesName} : </span>
4
4
  <strong>${l.value[1]}m</strong>
5
- </div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],selected:{Speed:!0,Draught:!1},textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:30,left:30,right:20,bottom:30,containLabel:!1},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:11}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["on-surface-variant"]}},alignTicks:!0,axisLine:{show:!0}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(t)}}},Qa={class:"d-flex justify-space-between align-center"},ei={class:"d-flex justify-start text-h5 my-2"},ti={class:"d-flex justify-start align-center text-body-1 text-label ga-3"},oi={class:"btns-box w-100 d-flex justify-center align-center ga-2 mt-2 px-5",style:{height:"48px"}},ai={ref:"scrollDom",class:"w-100 px-5 pt-0 pb-4 flex-1-1-0 overflow-y-auto scroll"},ii={class:"summary-box"},ri={class:"d-flex justify-space-between align-center py-2"},li={class:"d-flex justify-center align-center text-h6 ga-2"},ni={class:"multi-color-icon","aria-hidden":"true"},si=["xlink:href"],ci={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},mi={class:"w-100 d-flex justify-start align-center"},di={class:"w-30 text-label font-weight-400"},hi={class:"flex-1-1-0"},pi={class:"w-100 d-flex justify-start align-center"},gi={class:"w-30 text-label font-weight-400"},ui={class:"flex-1-1-0"},fi={class:"w-100 d-flex justify-start align-center"},yi={class:"w-30 text-label font-weight-400"},bi={class:"flex-1-1-0"},wi={class:"table-box w-100 mt-2"},xi={class:"w-100 d-flex justify-space-between align-center py-2"},_i={class:"d-flex justify-center align-center text-h6 ga-2"},ki={class:"multi-color-icon","aria-hidden":"true"},vi=["xlink:href"],zi={class:"w-100 gray-bg-2 rounded pa-4"},Li={"fixed-header":"",density:"compact",class:"w-100 forecast-table bg-none mb-2"},Ci={class:"px-1 text-left text-label font-weight-400",width:"120"},Pi={key:0,class:""},Si={class:"px-1 text-center"},Ni=["src"],Ti={key:1},Di={class:"px-1 text-center"},Ei=["src"],Mi={key:1},Vi={class:"px-1 text-center"},Bi=["src"],Ii={key:1},Ai={class:"px-1 text-center"},Ri=["src"],Oi={key:1},ji={class:"table-box w-100 mt-2 d-flex flex-column justify-start align-center"},Fi={class:"w-100 d-flex justify-space-between align-center py-2"},Hi={class:"d-flex justify-center align-center text-h6 ga-2"},Gi={class:"multi-color-icon","aria-hidden":"true"},Wi=["xlink:href"],Ui={class:"text-body-2 ga-2"},Zi={key:0,class:"w-100 gray-bg-2 rounded pa-4 overflow-y-auto"},Yi={ref:"tideEchart",class:"w-100",style:{height:"244px"}},qi={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Xi={class:"px-1 text-center text-label font-weight-400",width:"120"},$i={class:"px-1 text-center text-label font-weight-400",width:"120"},Ki={class:"px-1 text-center text-label font-weight-400",width:"120"},Ji={class:"px-1 text-center"},Qi={class:"px-1 text-center"},er={class:"px-1 text-center"};function tr(o,t,a,r,i,l){const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VCardTitle"),s=e.resolveComponent("VDivider"),h=e.resolveComponent("VIcon"),d=e.resolveComponent("VBtnToggle"),g=e.resolveComponent("VCard");return e.openBlock(),e.createBlock(g,{class:"port-detail-container d-flex flex-column justify-start align-center"},{default:e.withCtx(()=>{var u,y;return[e.createVNode(c,{class:"w-100"},{default:e.withCtx(()=>{var p,_,v,P,L;return[e.createElementVNode("div",Qa,[e.createElementVNode("div",ei,[e.createElementVNode("div",{class:e.normalizeClass(["fi mr-2 rounded elevation-4",`fi-${(p=a.port)!=null&&p.cntLoCode?(v=(_=a.port)==null?void 0:_.cntLoCode)==null?void 0:v.toLowerCase():"xx"}`]),style:{width:"36px",height:"24px"}},null,2),e.createElementVNode("div",null,e.toDisplayString((P=a.port)==null?void 0:P.name),1)]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:e.withCtx(()=>t[2]||(t[2]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[2]},8,["onClick"])]),e.createElementVNode("div",ti,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",null,[t[3]||(t[3]=e.createElementVNode("label",null,"UN/LOCODE: ",-1)),e.createElementVNode("span",null,e.toDisplayString((L=a.port)==null?void 0:L.cntLoCode),1)])])]}),_:1}),e.createVNode(s,{class:"w-100"}),e.createElementVNode("div",oi,[a.followList.some(p=>{var _;return((_=p.port)==null?void 0:_.id)===a.portId})?(e.openBlock(),e.createBlock(n,{key:0,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32","prepend-icon":"mdi-star",onClick:l.handleCancelFollow},{prepend:e.withCtx(()=>[e.createVNode(h,{color:"warning"})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(o.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(n,{key:1,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32","prepend-icon":"mdi-star-outline",onClick:l.handleFollow},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("actions.follow")),1)]),_:1},8,["onClick"])),e.createVNode(n,{class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32",onClick:l.handleMeteoMore},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("actions.7dayForcast")),1)]),_:1},8,["onClick"])]),e.createElementVNode("div",ai,[e.createElementVNode("div",ii,[e.createElementVNode("div",ri,[e.createElementVNode("div",li,[(e.openBlock(),e.createElementBlock("svg",ni,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,si)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("detail.summary")),1)]),t[4]||(t[4]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",ci,[e.createElementVNode("div",mi,[e.createElementVNode("div",di,e.toDisplayString(o.$t("port.region")),1),e.createElementVNode("div",hi,e.toDisplayString(((u=a.port)==null?void 0:u.region)??((y=a.port)==null?void 0:y.city)??"-"),1)]),e.createElementVNode("div",pi,[e.createElementVNode("div",gi,e.toDisplayString(o.$t("port.position")),1),e.createElementVNode("div",ui,e.toDisplayString(l.computePosition(a.port)),1)]),e.createElementVNode("div",fi,[e.createElementVNode("div",yi,e.toDisplayString(o.$t("time.localTime")),1),e.createElementVNode("div",bi,e.toDisplayString(l.computeLocalTime(a.realTime,a.port))+" "+e.toDisplayString(l.computeTimeOffset(a.port)),1)])])]),e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("div",_i,[(e.openBlock(),e.createElementBlock("svg",ki,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,vi)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("weather.weather")),1)]),t[5]||(t[5]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",zi,[e.createVNode(d,{modelValue:i.currentIndex,"onUpdate:modelValue":t[0]||(t[0]=p=>i.currentIndex=p),class:"w-100 gray-bg-1 rounded d-flex justify-space-around align-center ga-0 px-1 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dateList,p=>(e.openBlock(),e.createBlock(n,{class:"text-none text-body-1 rounded bg-none flex-1-1-0",density:"compact",color:"primary",height:"26",value:p.index},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),e.createElementVNode("table",Li,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tableData,p=>(e.openBlock(),e.createElementBlock("tr",{key:p.id},[e.createElementVNode("th",Ci,[e.createTextVNode(e.toDisplayString(o.$t(`${p.key}`))+" ",1),p.unit?(e.openBlock(),e.createElementBlock("span",Pi," ( "+e.toDisplayString(p.unit)+" )",1)):e.createCommentVNode("",!0)]),e.createElementVNode("td",Si,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value0,style:{height:"30px"}},null,8,Ni)):(e.openBlock(),e.createElementBlock("span",Ti,e.toDisplayString((p==null?void 0:p.value0)??"-"),1))]),e.createElementVNode("td",Di,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value1,style:{height:"30px"}},null,8,Ei)):(e.openBlock(),e.createElementBlock("span",Mi,e.toDisplayString((p==null?void 0:p.value1)??"-"),1))]),e.createElementVNode("td",Vi,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value2,style:{height:"30px"}},null,8,Bi)):(e.openBlock(),e.createElementBlock("span",Ii,e.toDisplayString((p==null?void 0:p.value2)??"-"),1))]),e.createElementVNode("td",Ai,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value3,style:{height:"30px"}},null,8,Ri)):(e.openBlock(),e.createElementBlock("span",Oi,e.toDisplayString((p==null?void 0:p.value3)??"-"),1))])]))),128))])])])]),e.createElementVNode("div",ji,[e.createElementVNode("div",Fi,[e.createElementVNode("div",Hi,[(e.openBlock(),e.createElementBlock("svg",Gi,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Wi)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideTimes")),1)]),e.createElementVNode("div",Ui,[i.showTideDetail?(e.openBlock(),e.createBlock(n,{key:0,icon:"mdi-eye-off-outline",density:"compact",variant:"plain",size:"small",onClick:t[1]||(t[1]=p=>i.showTideDetail=!1)})):(e.openBlock(),e.createBlock(n,{key:1,icon:"mdi-eye-outline",density:"compact",variant:"plain",size:"small",onClick:l.handleTide},null,8,["onClick"]))])]),i.showTideDetail?(e.openBlock(),e.createElementBlock("div",Zi,[e.createElementVNode("div",Yi,null,512),e.createElementVNode("table",qi,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",Xi,e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("th",$i,e.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),e.createElementVNode("th",Ki,e.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tideTableData,(p,_)=>{var v;return e.openBlock(),e.createElementBlock("tr",{key:_},[e.createElementVNode("td",Ji,e.toDisplayString(o.$t(`tide.${(v=p==null?void 0:p.type)==null?void 0:v.toLowerCase()}`))+" "+e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("td",Qi,e.toDisplayString(l.computeLocalTime(p==null?void 0:p.date,a.port,"MM-DD HH:mm")),1),e.createElementVNode("td",er,e.toDisplayString((p==null?void 0:p.height)??"-")+" m",1)])}),128))])])])):e.createCommentVNode("",!0)])],512)]}),_:1})}const po=A(Ja,[["render",tr],["__scopeId","data-v-104cfb37"]]),fd="",or={name:"IdmPort",components:{PortDetail:po},props:{map:{type:Object},ports:{type:Object},beforeLayer:{type:String},forecastModel:{type:String}},setup(){return{Theme:re.useTheme()}},emits:["closeAllDetail"],data(){return{source:"port-source",layer:"port-layer",showInfo:!1,showDetail:!1,portId:void 0,port:{},hoverPort:{},marker:void 0}},watch:{ports:{handler(){var o,t,a,r,i,l;this.ports?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var o;this.ports&&(this.map.getSource(this.source)?(o=this.map)==null||o.getSource(this.source).setData(this.ports):(this.map.addSource(this.source,{type:"geojson",data:this.ports}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"icon-allow-overlap":!1,"icon-ignore-placement":!1,"icon-padding":4,"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer)))},handleClear(){this.showInfo=!1,this.showDetail=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)},handleClick(o){const t=o.features[0];this.portId=t.properties.id,t.properties.id&&(this.port=t.properties,this.port.lng=t.geometry.coordinates[0],this.port.lat=t.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(o){var r,i;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.hoverPort=t.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},ar={class:"port-box d-flex flex-column justify-center align-start ga-1"},ir={class:"d-flex justify-start align-center text-label"},rr={class:"d-flex justify-start align-center text-label"};function lr(o,t,a,r,i,l){const n=e.resolveComponent("VCardText"),c=e.resolveComponent("VCard"),s=e.resolveComponent("PortDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmPortInfo",ref:"idmPortInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",ar,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",ir,[e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.name??"-"),1)]),e.createElementVNode("div",rr,[t[1]||(t[1]=e.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,portId:i.portId,port:i.port,forecastModel:a.forecastModel,onClose:l.handleCloseDetail,onCloseAllDetail:t[0]||(t[0]=h=>o.$emit("closeAllDetail",{ports:!0}))},o.$attrs),null,16,["portId","port","forecastModel","onClose"])):e.createCommentVNode("",!0)])}const nr=A(or,[["render",lr],["__scopeId","data-v-0c0f27d3"]]),sr={name:"IdmLoadLine",props:{map:{type:Object},show:{type:Boolean},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{layer:"loadlines-fill",labelLayer:"loadlines-label"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function cr(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const mr=A(sr,[["render",cr]]),dr={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneBorderLayer:"time-zone-border-layer",zoneLabelLayer:"time-zone-label-layer",marker:null}},watch:{zone:{handler(){var o,t,a,r;this.zone?(this.handleRender(),(o=this.map)==null||o.on("mousemove",[this.zoneLayer],this.handleHover),(t=this.map)==null||t.on("mouseleave",[this.zoneLayer],this.handleLeave)):(this.handleClear(),(a=this.map)==null||a.off("mousemove",[this.zoneLayer],this.handleHover),(r=this.map)==null||r.off("mouseleave",[this.zoneLayer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var t;this.handleClear();let o={features:[],type:"FeatureCollection"};o.features=(t=this.zone.features)==null?void 0:t.map(a=>(a.properties.opacity=0,a.properties.lineOpacity=.2,a.properties.width=1,a)),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"]],paint:{"fill-opacity":["get","opacity"],"fill-color":["match",["get","offSet"],"-11.5","rgba(255, 92, 88, 1)","-11","rgba(39, 195, 70, 1)","-10.5","rgba(39, 195, 70, 1)","-10","rgba(40, 106, 255, 1)","-9.5","rgba(40, 106, 255, 1)","-9","rgba(255, 92, 88, 1)","-8.5","rgba(255, 92, 88, 1)","-8","rgba(39, 195, 70, 1)","-7.5","rgba(39, 195, 70, 1)","-7","rgba(40, 106, 255, 1)","-6.5","rgba(40, 106, 255, 1)","-6","rgba(255, 92, 88, 1)","-5.5","rgba(255, 92, 88, 1)","-5","rgba(39, 195, 70, 1)","-4.5","rgba(39, 195, 70, 1)","-4","rgba(40, 106, 255, 1)","-3.5","rgba(40, 106, 255, 1)","-3","rgba(255, 92, 88, 1)","-2.5","rgba(255, 92, 88, 1)","-2","rgba(39, 195, 70, 1)","-1.5","rgba(39, 195, 70, 1)","-1","rgba(40, 106, 255, 1)","-0.5","rgba(40, 106, 255, 1)","+0","rgba(255, 92, 88, 1)","+0.5","rgba(255, 92, 88, 1)","+1","rgba(39, 195, 70, 1)","+1.5","rgba(39, 195, 70, 1)","+2","rgba(40, 106, 255, 1)","+2.5","rgba(40, 106, 255, 1)","+3","rgba(255, 92, 88, 1)","+3.5","rgba(255, 92, 88, 1)","+4","rgba(39, 195, 70, 1)","+4.5","rgba(39, 195, 70, 1)","+5","rgba(40, 106, 255, 1)","+5.5","rgba(40, 106, 255, 1)","+6","rgba(255, 92, 88, 1)","+6.5","rgba(255, 92, 88, 1)","+7","rgba(39, 195, 70, 1)","+7.5","rgba(39, 195, 70, 1)","+8","rgba(40, 106, 255, 1)","+8.5","rgba(40, 106, 255, 1)","+9","rgba(255, 92, 88, 1)","+9.5","rgba(255, 92, 88, 1)","+10","rgba(39, 195, 70, 1)","+10.5","rgba(39, 195, 70, 1)","+11","rgba(40, 106, 255, 1)","+11.5","rgba(40, 106, 255, 1)","rgba(255, 92, 88, 1)"]}},this.beforeLayer),this.map.addLayer({id:this.zoneBorderLayer,type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-opacity":["get","lineOpacity"],"line-width":["get","width"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneBorderLayer)&&this.map.removeLayer(this.zoneBorderLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)},handleHover(o){var t,a,r;if(o.features.length){(t=this.marker)==null||t.remove();let i={features:[],type:"FeatureCollection"};i.features=(a=this.zone.features)==null?void 0:a.map(n=>{const c=JSON.parse(JSON.stringify(n));return c.properties.offSet===o.features[0].properties.offSet?(c.properties.opacity=.25,c.properties.lineOpacity=.7,c.properties.width=2):(c.properties.opacity=0,c.properties.lineOpacity=.2,c.properties.width=1),c}),(r=this.map.getSource(this.source))==null||r.setData(i);const l=document.createElement("div");l.className="v-card--variant-elevated rounded px-2 py-1 text-body-1",l.innerHTML=`<div>UTC ${o.features[0].properties.offSet}</div>`,this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-30]).addTo(this.map)}},handleLeave(){}}};function hr(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const pr=A(dr,[["render",hr]]),gr={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.area?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.3,"fill-color":"rgba(144, 96, 217, 1)"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"rgba(164, 125, 222, 1)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ur(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const fr=A(gr,[["render",ur]]),yr={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.area.features.forEach(o=>{o.geometry.type==="Polygon"&&o.geometry.coordinates.forEach(t=>N.LngLatHelper.convertToMonotonicLng2(t))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.25,"fill-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.7,"line-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.7,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function br(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const wr=A(yr,[["render",br]]),xr={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"rgba(255,255,255,0.3)","fill-color":"rgba(0, 0, 0, 0.3)"}},this.beforeLayer))},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function _r(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const kr=A(xr,[["render",_r]]),vr={name:"IdmWorld12nm",props:{map:{type:Object},show:{type:Boolean},weatherLayers:{type:Object,default:()=>({})},zoom:{type:Number,default:3},left:{type:String,default:"10px"},bottom:{type:String,default:"64px"},token:{type:String,default:""}},data(){return{layer:"world-12nm-v4-20231025"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setPaintProperty(this.layer,"line-color","rgb(210,54,83)"),this.map.setPaintProperty(this.layer,"line-width",2))},handleClear(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")}}};function zr(o,t,a,r,i,l){return null}const Lr=A(vr,[["render",zr]]),yd="",Cr={name:"IdmWorldMarine",props:{map:{type:Object},show:{type:Boolean}},data(){return{labelLayer:"ne-10m-label",lineLayer:"ne-10m-outline"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&(this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),this.map.setPaintProperty(this.lineLayer,"line-width",1)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Pr(o,t,a,r,i,l){return null}const Sr=A(Cr,[["render",Pr]]),Nr={name:"IdmChinaRoute",props:{map:{type:Object},show:{type:Boolean}},data(){return{labelLayer:"china-route-label",lineLayer:"china-route-line",fillLayer:"china-route-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Tr(o,t,a,r,i,l){return null}const Dr=A(Nr,[["render",Tr]]),bd="",wd="",Er={name:"IdmTideStations",props:{map:{type:Object},gateway:{type:String},token:{type:String},theme:{type:String},locale:{type:String},realTime:{type:String},timeZone:{type:Number},forecastModel:{type:String},station:{type:Object}},setup(){return{Theme:re.useTheme()}},emits:["close","closeAllDetail"],data(){return{tideData:{},tideTableData:[],currentIndex:0,xDate:[],echartData:{}}},computed:{dateList(){var a,r,i,l;const o=[],t=(a=this.station)!=null&&a.lng&&((r=this.station)!=null&&r.lat)?N.LngLatHelper.guessTimeZoneOffset((i=this.station)==null?void 0:i.lng,(l=this.station)==null?void 0:l.lat):0;for(let n=0;n<4;n++){let c={index:n,dateTimeList:[],label:z().utcOffset(t).add(n,"days").format("MM-DD ddd"),startTime:z().utcOffset(t).add(n,"days").set({hour:0,minute:0,second:0,millisecond:0}).format(),dateTime:z().utcOffset(t).add(n,"days").format()};for(let s=0;s<4;s++)c.dateTimeList.push(z(c.startTime).utcOffset(t).add(s*3,"hours").utc().format());o.push(c)}return o},computeLocalTime(){return function(o,t,a="yyyy-MM-DD HH:mm"){if(!o||!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat))return"-";const r=t!=null&&t.lng&&(t!=null&&t.lat)?N.LngLatHelper.guessTimeZoneOffset(t==null?void 0:t.lng,t==null?void 0:t.lat):0;return z(o).utcOffset(r).format(a)}},computeTimeOffset(){return function(o){if(!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat))return"-";const t=N.LngLatHelper.guessTimeZoneOffset(o==null?void 0:o.lng,o==null?void 0:o.lat);return"( UTC "+(t>=0?"+":"")+t+" )"}},computePosition(){return function(o){return!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}},computeRoundPrecision(){return function(o,t=4){return o==null||isNaN(o)||isNaN(t)?"-":N.LngLatHelper.roundPrecision(o,t)}}},watch:{theme:{handler(){this.$nextTick(()=>{this.initEchart()})}},currentIndex:{handler(){this.initTideTableData(this.tideData)}},station:{handler(){this.$emit("closeAllDetail",{tide:!0}),this.fetchTidesData()},immediate:!0}},methods:{async fetchTidesData(){var a,r,i,l;this.tideLoading=!0,this.tideData={};let o={lat:this.station.lat,lng:this.station.lng,date:(r=(a=this.dateList)==null?void 0:a[this.currentIndex])==null?void 0:r.dateTime,pastDays:1,forecastDays:5,extremes:!0,heights:!0},t=await J.post(`${this.gateway}/api/arc/meteo2/spot/tides/forecast`,o,{headers:{Authorization:this.token}});((i=t==null?void 0:t.data)==null?void 0:i.code)===0&&(this.tideData=((l=t==null?void 0:t.data)==null?void 0:l.data)||{},this.tideLoading=!1,this.initTideTableData(this.tideData))},initTideTableData(o){var t,a;this.tideTableData=Se.TidesAssist.pickDailyExtremes(o,(a=(t=this.dateList)==null?void 0:t[this.currentIndex])==null?void 0:a.dateTime),this.initEchartData()},initEchartData(){var o;this.xDate=[],this.echartData={height:[]},(o=this.tideTableData)==null||o.forEach(t=>{this.xDate.push(this.computeLocalTime(t.date,this.station,"MM-DD HH:mm")),this.echartData.height.push([this.computeLocalTime(t.date,this.station,"MM-DD HH:mm"),t.height??void 0,"m"])}),this.initEchart()},initEchart(){ho.dispose(this.$refs.tideEchart);const o=ho.init(this.$refs.tideEchart),t={animation:!1,tooltip:{trigger:"axis",formatter:function(a){var i;let r=`<div style="font-size: 13px;">${(i=a[0])==null?void 0:i.value[0]}</div>`;return a.forEach(l=>{l.seriesName.indexOf("Min")<=-1&&l.seriesName.indexOf("Max")<=-1&&(r+=`<div style="font-size: 13px;">
5
+ </div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],selected:{Speed:!0,Draught:!1},textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:30,left:30,right:20,bottom:30,containLabel:!1},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:11}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["on-surface-variant"]}},alignTicks:!0,axisLine:{show:!0}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(t)}}},Qa={class:"d-flex justify-space-between align-center"},ei={class:"d-flex justify-start text-h5 my-2"},ti={class:"d-flex justify-start align-center text-body-1 text-label ga-3"},oi={class:"btns-box w-100 d-flex justify-center align-center ga-2 mt-2 px-5",style:{height:"48px"}},ai={ref:"scrollDom",class:"w-100 px-5 pt-0 pb-4 flex-1-1-0 overflow-y-auto scroll"},ii={class:"summary-box"},ri={class:"d-flex justify-space-between align-center py-2"},li={class:"d-flex justify-center align-center text-h6 ga-2"},ni={class:"multi-color-icon","aria-hidden":"true"},si=["xlink:href"],ci={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},mi={class:"w-100 d-flex justify-start align-center"},di={class:"w-30 text-label font-weight-400"},hi={class:"flex-1-1-0"},pi={class:"w-100 d-flex justify-start align-center"},gi={class:"w-30 text-label font-weight-400"},ui={class:"flex-1-1-0"},fi={class:"w-100 d-flex justify-start align-center"},yi={class:"w-30 text-label font-weight-400"},bi={class:"flex-1-1-0"},wi={class:"table-box w-100 mt-2"},xi={class:"w-100 d-flex justify-space-between align-center py-2"},_i={class:"d-flex justify-center align-center text-h6 ga-2"},ki={class:"multi-color-icon","aria-hidden":"true"},vi=["xlink:href"],zi={class:"w-100 gray-bg-2 rounded pa-4"},Li={"fixed-header":"",density:"compact",class:"w-100 forecast-table bg-none mb-2"},Ci={class:"px-1 text-left text-label font-weight-400",width:"120"},Pi={key:0,class:""},Si={class:"px-1 text-center"},Ni=["src"],Ti={key:1},Di={class:"px-1 text-center"},Ei=["src"],Mi={key:1},Vi={class:"px-1 text-center"},Bi=["src"],Ii={key:1},Ai={class:"px-1 text-center"},Ri=["src"],Oi={key:1},ji={class:"table-box w-100 mt-2 d-flex flex-column justify-start align-center"},Fi={class:"w-100 d-flex justify-space-between align-center py-2"},Hi={class:"d-flex justify-center align-center text-h6 ga-2"},Gi={class:"multi-color-icon","aria-hidden":"true"},Wi=["xlink:href"],Ui={class:"text-body-2 ga-2"},Zi={key:0,class:"w-100 gray-bg-2 rounded pa-4 overflow-y-auto"},Yi={ref:"tideEchart",class:"w-100",style:{height:"244px"}},qi={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Xi={class:"px-1 text-center text-label font-weight-400",width:"120"},$i={class:"px-1 text-center text-label font-weight-400",width:"120"},Ki={class:"px-1 text-center text-label font-weight-400",width:"120"},Ji={class:"px-1 text-center"},Qi={class:"px-1 text-center"},er={class:"px-1 text-center"};function tr(o,t,a,r,i,l){const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VCardTitle"),s=e.resolveComponent("VDivider"),h=e.resolveComponent("VIcon"),d=e.resolveComponent("VBtnToggle"),g=e.resolveComponent("VCard");return e.openBlock(),e.createBlock(g,{class:"port-detail-container d-flex flex-column justify-start align-center"},{default:e.withCtx(()=>{var u,y;return[e.createVNode(c,{class:"w-100"},{default:e.withCtx(()=>{var p,_,v,P,L;return[e.createElementVNode("div",Qa,[e.createElementVNode("div",ei,[e.createElementVNode("div",{class:e.normalizeClass(["fi mr-2 rounded elevation-4",`fi-${(p=a.port)!=null&&p.cntLoCode?(v=(_=a.port)==null?void 0:_.cntLoCode)==null?void 0:v.toLowerCase():"xx"}`]),style:{width:"36px",height:"24px"}},null,2),e.createElementVNode("div",null,e.toDisplayString((P=a.port)==null?void 0:P.name),1)]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:e.withCtx(()=>t[2]||(t[2]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[2]},8,["onClick"])]),e.createElementVNode("div",ti,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",null,[t[3]||(t[3]=e.createElementVNode("label",null,"UN/LOCODE: ",-1)),e.createElementVNode("span",null,e.toDisplayString((L=a.port)==null?void 0:L.cntLoCode),1)])])]}),_:1}),e.createVNode(s,{class:"w-100"}),e.createElementVNode("div",oi,[a.followList.some(p=>{var _;return((_=p.port)==null?void 0:_.id)===a.portId})?(e.openBlock(),e.createBlock(n,{key:0,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32","prepend-icon":"mdi-star",onClick:l.handleCancelFollow},{prepend:e.withCtx(()=>[e.createVNode(h,{color:"warning"})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(o.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(n,{key:1,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32","prepend-icon":"mdi-star-outline",onClick:l.handleFollow},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("actions.follow")),1)]),_:1},8,["onClick"])),e.createVNode(n,{class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32",onClick:l.handleMeteoMore},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("actions.7dayForcast")),1)]),_:1},8,["onClick"])]),e.createElementVNode("div",ai,[e.createElementVNode("div",ii,[e.createElementVNode("div",ri,[e.createElementVNode("div",li,[(e.openBlock(),e.createElementBlock("svg",ni,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,si)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("detail.summary")),1)]),t[4]||(t[4]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",ci,[e.createElementVNode("div",mi,[e.createElementVNode("div",di,e.toDisplayString(o.$t("port.region")),1),e.createElementVNode("div",hi,e.toDisplayString(((u=a.port)==null?void 0:u.region)??((y=a.port)==null?void 0:y.city)??"-"),1)]),e.createElementVNode("div",pi,[e.createElementVNode("div",gi,e.toDisplayString(o.$t("port.position")),1),e.createElementVNode("div",ui,e.toDisplayString(l.computePosition(a.port)),1)]),e.createElementVNode("div",fi,[e.createElementVNode("div",yi,e.toDisplayString(o.$t("time.localTime")),1),e.createElementVNode("div",bi,e.toDisplayString(l.computeLocalTime(a.realTime,a.port))+" "+e.toDisplayString(l.computeTimeOffset(a.port)),1)])])]),e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("div",_i,[(e.openBlock(),e.createElementBlock("svg",ki,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,vi)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("weather.weather")),1)]),t[5]||(t[5]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",zi,[e.createVNode(d,{modelValue:i.currentIndex,"onUpdate:modelValue":t[0]||(t[0]=p=>i.currentIndex=p),class:"w-100 gray-bg-1 rounded d-flex justify-space-around align-center ga-0 px-1 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dateList,p=>(e.openBlock(),e.createBlock(n,{class:"text-none text-body-1 rounded bg-none flex-1-1-0",density:"compact",color:"primary",height:"26",value:p.index},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),e.createElementVNode("table",Li,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tableData,p=>(e.openBlock(),e.createElementBlock("tr",{key:p.id},[e.createElementVNode("th",Ci,[e.createTextVNode(e.toDisplayString(o.$t(`${p.key}`))+" ",1),p.unit?(e.openBlock(),e.createElementBlock("span",Pi," ( "+e.toDisplayString(p.unit)+" )",1)):e.createCommentVNode("",!0)]),e.createElementVNode("td",Si,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value0,style:{height:"30px"}},null,8,Ni)):(e.openBlock(),e.createElementBlock("span",Ti,e.toDisplayString((p==null?void 0:p.value0)??"-"),1))]),e.createElementVNode("td",Di,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value1,style:{height:"30px"}},null,8,Ei)):(e.openBlock(),e.createElementBlock("span",Mi,e.toDisplayString((p==null?void 0:p.value1)??"-"),1))]),e.createElementVNode("td",Vi,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value2,style:{height:"30px"}},null,8,Bi)):(e.openBlock(),e.createElementBlock("span",Ii,e.toDisplayString((p==null?void 0:p.value2)??"-"),1))]),e.createElementVNode("td",Ai,[p.img?(e.openBlock(),e.createElementBlock("img",{key:0,src:p==null?void 0:p.value3,style:{height:"30px"}},null,8,Ri)):(e.openBlock(),e.createElementBlock("span",Oi,e.toDisplayString((p==null?void 0:p.value3)??"-"),1))])]))),128))])])])]),e.createElementVNode("div",ji,[e.createElementVNode("div",Fi,[e.createElementVNode("div",Hi,[(e.openBlock(),e.createElementBlock("svg",Gi,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Wi)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideTimes")),1)]),e.createElementVNode("div",Ui,[i.showTideDetail?(e.openBlock(),e.createBlock(n,{key:0,icon:"mdi-eye-off-outline",density:"compact",variant:"plain",size:"small",onClick:t[1]||(t[1]=p=>i.showTideDetail=!1)})):(e.openBlock(),e.createBlock(n,{key:1,icon:"mdi-eye-outline",density:"compact",variant:"plain",size:"small",onClick:l.handleTide},null,8,["onClick"]))])]),i.showTideDetail?(e.openBlock(),e.createElementBlock("div",Zi,[e.createElementVNode("div",Yi,null,512),e.createElementVNode("table",qi,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",Xi,e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("th",$i,e.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),e.createElementVNode("th",Ki,e.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tideTableData,(p,_)=>{var v;return e.openBlock(),e.createElementBlock("tr",{key:_},[e.createElementVNode("td",Ji,e.toDisplayString(o.$t(`tide.${(v=p==null?void 0:p.type)==null?void 0:v.toLowerCase()}`))+" "+e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("td",Qi,e.toDisplayString(l.computeLocalTime(p==null?void 0:p.date,a.port,"MM-DD HH:mm")),1),e.createElementVNode("td",er,e.toDisplayString((p==null?void 0:p.height)??"-")+" m",1)])}),128))])])])):e.createCommentVNode("",!0)])],512)]}),_:1})}const po=A(Ja,[["render",tr],["__scopeId","data-v-104cfb37"]]),fd="",or={name:"IdmPort",components:{PortDetail:po},props:{map:{type:Object},ports:{type:Object},beforeLayer:{type:String},forecastModel:{type:String}},setup(){return{Theme:re.useTheme()}},emits:["closeAllDetail"],data(){return{source:"port-source",layer:"port-layer",showInfo:!1,showDetail:!1,portId:void 0,port:{},hoverPort:{},marker:void 0}},watch:{ports:{handler(){var o,t,a,r,i,l;this.ports?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var o;this.ports&&(this.map.getSource(this.source)?(o=this.map)==null||o.getSource(this.source).setData(this.ports):(this.map.addSource(this.source,{type:"geojson",data:this.ports}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"icon-allow-overlap":!1,"icon-ignore-placement":!1,"icon-padding":4,"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer)))},handleClear(){this.showInfo=!1,this.showDetail=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)},handleClick(o){const t=o.features[0];this.portId=t.properties.id,t.properties.id&&(this.port=t.properties,this.port.lng=t.geometry.coordinates[0],this.port.lat=t.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(o){var r,i;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.hoverPort=t.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},ar={class:"port-box d-flex flex-column justify-center align-start ga-1"},ir={class:"d-flex justify-start align-center text-label"},rr={class:"d-flex justify-start align-center text-label"};function lr(o,t,a,r,i,l){const n=e.resolveComponent("VCardText"),c=e.resolveComponent("VCard"),s=e.resolveComponent("PortDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmPortInfo",ref:"idmPortInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",ar,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",ir,[e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.name??"-"),1)]),e.createElementVNode("div",rr,[t[1]||(t[1]=e.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,portId:i.portId,port:i.port,forecastModel:a.forecastModel,onClose:l.handleCloseDetail,onCloseAllDetail:t[0]||(t[0]=h=>o.$emit("closeAllDetail",{ports:!0}))},o.$attrs),null,16,["portId","port","forecastModel","onClose"])):e.createCommentVNode("",!0)])}const nr=A(or,[["render",lr],["__scopeId","data-v-0c0f27d3"]]),sr={name:"IdmLoadLine",props:{map:{type:Object},show:{type:Boolean},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{layer:"loadlines-fill",labelLayer:"loadlines-label"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function cr(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const mr=A(sr,[["render",cr]]),dr={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneBorderLayer:"time-zone-border-layer",zoneLabelLayer:"time-zone-label-layer",marker:null}},computed:{timeZoneName(){return o=>{var a;return(a=z.tz.names().filter(r=>z.tz(z(),r).utcOffset()===o*60))==null?void 0:a[0]}}},watch:{zone:{handler(){var o,t,a,r;this.zone?(this.handleRender(),(o=this.map)==null||o.on("mousemove",[this.zoneLayer],this.handleHover),(t=this.map)==null||t.on("mouseleave",[this.zoneLayer],this.handleLeave)):(this.handleClear(),(a=this.map)==null||a.off("mousemove",[this.zoneLayer],this.handleHover),(r=this.map)==null||r.off("mouseleave",[this.zoneLayer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var t;this.handleClear();let o={features:[],type:"FeatureCollection"};o.features=(t=this.zone.features)==null?void 0:t.map(a=>(a.properties.opacity=0,a.properties.lineOpacity=.2,a.properties.width=1,a)),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"]],paint:{"fill-opacity":["get","opacity"],"fill-color":["match",["get","offSet"],"-11.5","rgba(255, 92, 88, 1)","-11","rgba(39, 195, 70, 1)","-10.5","rgba(39, 195, 70, 1)","-10","rgba(40, 106, 255, 1)","-9.5","rgba(40, 106, 255, 1)","-9","rgba(255, 92, 88, 1)","-8.5","rgba(255, 92, 88, 1)","-8","rgba(39, 195, 70, 1)","-7.5","rgba(39, 195, 70, 1)","-7","rgba(40, 106, 255, 1)","-6.5","rgba(40, 106, 255, 1)","-6","rgba(255, 92, 88, 1)","-5.5","rgba(255, 92, 88, 1)","-5","rgba(39, 195, 70, 1)","-4.5","rgba(39, 195, 70, 1)","-4","rgba(40, 106, 255, 1)","-3.5","rgba(40, 106, 255, 1)","-3","rgba(255, 92, 88, 1)","-2.5","rgba(255, 92, 88, 1)","-2","rgba(39, 195, 70, 1)","-1.5","rgba(39, 195, 70, 1)","-1","rgba(40, 106, 255, 1)","-0.5","rgba(40, 106, 255, 1)","+0","rgba(255, 92, 88, 1)","+0.5","rgba(255, 92, 88, 1)","+1","rgba(39, 195, 70, 1)","+1.5","rgba(39, 195, 70, 1)","+2","rgba(40, 106, 255, 1)","+2.5","rgba(40, 106, 255, 1)","+3","rgba(255, 92, 88, 1)","+3.5","rgba(255, 92, 88, 1)","+4","rgba(39, 195, 70, 1)","+4.5","rgba(39, 195, 70, 1)","+5","rgba(40, 106, 255, 1)","+5.5","rgba(40, 106, 255, 1)","+6","rgba(255, 92, 88, 1)","+6.5","rgba(255, 92, 88, 1)","+7","rgba(39, 195, 70, 1)","+7.5","rgba(39, 195, 70, 1)","+8","rgba(40, 106, 255, 1)","+8.5","rgba(40, 106, 255, 1)","+9","rgba(255, 92, 88, 1)","+9.5","rgba(255, 92, 88, 1)","+10","rgba(39, 195, 70, 1)","+10.5","rgba(39, 195, 70, 1)","+11","rgba(40, 106, 255, 1)","+11.5","rgba(40, 106, 255, 1)","rgba(255, 92, 88, 1)"]}},this.beforeLayer),this.map.addLayer({id:this.zoneBorderLayer,type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-opacity":["get","lineOpacity"],"line-width":["get","width"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneBorderLayer)&&this.map.removeLayer(this.zoneBorderLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)},handleHover(o){var t,a,r;if(o.features.length){(t=this.marker)==null||t.remove();let i={features:[],type:"FeatureCollection"};i.features=(a=this.zone.features)==null?void 0:a.map(n=>{const c=JSON.parse(JSON.stringify(n));return c.properties.offSet===o.features[0].properties.offSet?(c.properties.opacity=.25,c.properties.lineOpacity=.7,c.properties.width=2):(c.properties.opacity=0,c.properties.lineOpacity=.2,c.properties.width=1),c}),(r=this.map.getSource(this.source))==null||r.setData(i);const l=document.createElement("div");l.className="v-card--variant-elevated rounded px-2 py-1 text-body-1",l.innerHTML=`<div>UTC ${o.features[0].properties.offSet}:00</div>
6
+ <div>${z.tz(z().format(),this.timeZoneName(o.features[0].properties.offSet)).format("MM-DD HH:mm")}`,this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-30]).addTo(this.map)}},handleLeave(){}}};function hr(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const pr=A(dr,[["render",hr]]),gr={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.area?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.3,"fill-color":"rgba(144, 96, 217, 1)"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"rgba(164, 125, 222, 1)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ur(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const fr=A(gr,[["render",ur]]),yr={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.area.features.forEach(o=>{o.geometry.type==="Polygon"&&o.geometry.coordinates.forEach(t=>N.LngLatHelper.convertToMonotonicLng2(t))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.25,"fill-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.7,"line-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.7,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function br(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const wr=A(yr,[["render",br]]),xr={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"rgba(255,255,255,0.3)","fill-color":"rgba(0, 0, 0, 0.3)"}},this.beforeLayer))},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function _r(o,t,a,r,i,l){return e.openBlock(),e.createElementBlock("div")}const kr=A(xr,[["render",_r]]),vr={name:"IdmWorld12nm",props:{map:{type:Object},show:{type:Boolean},weatherLayers:{type:Object,default:()=>({})},zoom:{type:Number,default:3},left:{type:String,default:"10px"},bottom:{type:String,default:"64px"},token:{type:String,default:""}},data(){return{layer:"world-12nm-v4-20231025"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setPaintProperty(this.layer,"line-color","rgb(210,54,83)"),this.map.setPaintProperty(this.layer,"line-width",2))},handleClear(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")}}};function zr(o,t,a,r,i,l){return null}const Lr=A(vr,[["render",zr]]),yd="",Cr={name:"IdmWorldMarine",props:{map:{type:Object},show:{type:Boolean}},data(){return{labelLayer:"ne-10m-label",lineLayer:"ne-10m-outline"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&(this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),this.map.setPaintProperty(this.lineLayer,"line-width",1)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Pr(o,t,a,r,i,l){return null}const Sr=A(Cr,[["render",Pr]]),Nr={name:"IdmChinaRoute",props:{map:{type:Object},show:{type:Boolean}},data(){return{labelLayer:"china-route-label",lineLayer:"china-route-line",fillLayer:"china-route-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,t,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Tr(o,t,a,r,i,l){return null}const Dr=A(Nr,[["render",Tr]]),bd="",wd="",Er={name:"IdmTideStations",props:{map:{type:Object},gateway:{type:String},token:{type:String},theme:{type:String},locale:{type:String},realTime:{type:String},timeZone:{type:Number},forecastModel:{type:String},station:{type:Object}},setup(){return{Theme:re.useTheme()}},emits:["close","closeAllDetail"],data(){return{tideData:{},tideTableData:[],currentIndex:0,xDate:[],echartData:{}}},computed:{dateList(){var a,r,i,l;const o=[],t=(a=this.station)!=null&&a.lng&&((r=this.station)!=null&&r.lat)?N.LngLatHelper.guessTimeZoneOffset((i=this.station)==null?void 0:i.lng,(l=this.station)==null?void 0:l.lat):0;for(let n=0;n<4;n++){let c={index:n,dateTimeList:[],label:z().utcOffset(t).add(n,"days").format("MM-DD ddd"),startTime:z().utcOffset(t).add(n,"days").set({hour:0,minute:0,second:0,millisecond:0}).format(),dateTime:z().utcOffset(t).add(n,"days").format()};for(let s=0;s<4;s++)c.dateTimeList.push(z(c.startTime).utcOffset(t).add(s*3,"hours").utc().format());o.push(c)}return o},computeLocalTime(){return function(o,t,a="yyyy-MM-DD HH:mm"){if(!o||!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat))return"-";const r=t!=null&&t.lng&&(t!=null&&t.lat)?N.LngLatHelper.guessTimeZoneOffset(t==null?void 0:t.lng,t==null?void 0:t.lat):0;return z(o).utcOffset(r).format(a)}},computeTimeOffset(){return function(o){if(!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat))return"-";const t=N.LngLatHelper.guessTimeZoneOffset(o==null?void 0:o.lng,o==null?void 0:o.lat);return"( UTC "+(t>=0?"+":"")+t+" )"}},computePosition(){return function(o){return!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}},computeRoundPrecision(){return function(o,t=4){return o==null||isNaN(o)||isNaN(t)?"-":N.LngLatHelper.roundPrecision(o,t)}}},watch:{theme:{handler(){this.$nextTick(()=>{this.initEchart()})}},currentIndex:{handler(){this.initTideTableData(this.tideData)}},station:{handler(){this.$emit("closeAllDetail",{tide:!0}),this.fetchTidesData()},immediate:!0}},methods:{async fetchTidesData(){var a,r,i,l;this.tideLoading=!0,this.tideData={};let o={lat:this.station.lat,lng:this.station.lng,date:(r=(a=this.dateList)==null?void 0:a[this.currentIndex])==null?void 0:r.dateTime,pastDays:1,forecastDays:5,extremes:!0,heights:!0},t=await J.post(`${this.gateway}/api/arc/meteo2/spot/tides/forecast`,o,{headers:{Authorization:this.token}});((i=t==null?void 0:t.data)==null?void 0:i.code)===0&&(this.tideData=((l=t==null?void 0:t.data)==null?void 0:l.data)||{},this.tideLoading=!1,this.initTideTableData(this.tideData))},initTideTableData(o){var t,a;this.tideTableData=Se.TidesAssist.pickDailyExtremes(o,(a=(t=this.dateList)==null?void 0:t[this.currentIndex])==null?void 0:a.dateTime),this.initEchartData()},initEchartData(){var o;this.xDate=[],this.echartData={height:[]},(o=this.tideTableData)==null||o.forEach(t=>{this.xDate.push(this.computeLocalTime(t.date,this.station,"MM-DD HH:mm")),this.echartData.height.push([this.computeLocalTime(t.date,this.station,"MM-DD HH:mm"),t.height??void 0,"m"])}),this.initEchart()},initEchart(){ho.dispose(this.$refs.tideEchart);const o=ho.init(this.$refs.tideEchart),t={animation:!1,tooltip:{trigger:"axis",formatter:function(a){var i;let r=`<div style="font-size: 13px;">${(i=a[0])==null?void 0:i.value[0]}</div>`;return a.forEach(l=>{l.seriesName.indexOf("Min")<=-1&&l.seriesName.indexOf("Max")<=-1&&(r+=`<div style="font-size: 13px;">
6
7
  <span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
7
8
  <span>${l.seriesName} : </span>
8
9
  <strong>${l.value[1]}m</strong>
9
- </div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],selected:{Speed:!0,Draught:!1},textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:30,left:30,right:20,bottom:30,containLabel:!1},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:11}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["on-surface-variant"]}},alignTicks:!0,axisLine:{show:!0}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(t)},handleClose(){this.$emit("close")}}},Mr={class:"d-flex justify-space-between align-center"},Vr={class:"d-flex justify-start text-h5 my-2"},Br={class:"d-flex justify-start align-center text-body-1 text-label ga-3"},Ir={class:"w-100 px-5 pt-0 pb-0 overflow-y-auto scroll"},Ar={class:"summary-box w-100"},Rr={class:"d-flex justify-space-between align-center py-2"},Or={class:"d-flex justify-center align-center text-h6 ga-2"},jr={class:"multi-color-icon","aria-hidden":"true"},Fr=["xlink:href"],Hr={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},Gr={class:"w-100 d-flex justify-start align-center"},Wr={class:"w-30 text-label font-weight-400"},Ur={class:"flex-1-1-0"},Zr={class:"w-100 d-flex justify-start align-center"},Yr={class:"w-30 text-label font-weight-400"},qr={class:"flex-1-1-0"},Xr={class:"w-100 d-flex justify-start align-center"},$r={class:"w-30 text-label font-weight-400"},Kr={class:"flex-1-1-0"},Jr={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},Qr={class:"w-100 d-flex justify-space-between align-center py-2"},el={class:"d-flex justify-center align-center text-h6 ga-2"},tl={class:"multi-color-icon","aria-hidden":"true"},ol=["xlink:href"],al={class:"w-100 gray-bg-2 rounded pa-4 overflow-y-auto"},il={class:"w-100 py-4",style:{height:"244px"},ref:"tideEchart"},rl={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},ll={class:"px-1 text-center text-label font-weight-400",width:"120"},nl={class:"px-1 text-center text-label font-weight-400",width:"120"},sl={class:"px-1 text-center text-label font-weight-400",width:"120"},cl={class:"px-1 text-center"},ml={class:"px-1 text-center"},dl={class:"px-1 text-center"};function hl(o,t,a,r,i,l){const n=e.resolveComponent("VBtn"),c=e.resolveComponent("v-card-title"),s=e.resolveComponent("v-divider"),h=e.resolveComponent("VBtnToggle"),d=e.resolveComponent("v-card");return e.openBlock(),e.createBlock(d,{class:"tide-detail-container d-flex flex-column justify-start align-center"},{default:e.withCtx(()=>{var g,u;return[e.createVNode(c,{class:"w-100"},{default:e.withCtx(()=>{var y;return[e.createElementVNode("div",Mr,[e.createElementVNode("div",Vr,[e.createElementVNode("div",null,e.toDisplayString((y=a.station)==null?void 0:y.name),1)]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:e.withCtx(()=>t[1]||(t[1]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),e.createElementVNode("div",Br,[e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideStation")),1)])]}),_:1}),e.createVNode(s,{class:"w-100"}),e.createElementVNode("div",Ir,[e.createElementVNode("div",Ar,[e.createElementVNode("div",Rr,[e.createElementVNode("div",Or,[(e.openBlock(),e.createElementBlock("svg",jr,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Fr)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("detail.summary")),1)]),t[2]||(t[2]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",Hr,[e.createElementVNode("div",Gr,[e.createElementVNode("div",Wr,e.toDisplayString(o.$t("tide.region")),1),e.createElementVNode("div",Ur,e.toDisplayString(((g=a.station)==null?void 0:g.Country)??((u=a.station)==null?void 0:u.city)??"-"),1)]),e.createElementVNode("div",Zr,[e.createElementVNode("div",Yr,e.toDisplayString(o.$t("tide.position")),1),e.createElementVNode("div",qr,e.toDisplayString(l.computePosition(a.station)),1)]),e.createElementVNode("div",Xr,[e.createElementVNode("div",$r,e.toDisplayString(o.$t("time.localTime")),1),e.createElementVNode("div",Kr,e.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+e.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),e.createElementVNode("div",Jr,[e.createElementVNode("div",Qr,[e.createElementVNode("div",el,[(e.openBlock(),e.createElementBlock("svg",tl,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ol)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideTimes")),1)]),t[3]||(t[3]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",al,[e.createVNode(h,{modelValue:i.currentIndex,"onUpdate:modelValue":t[0]||(t[0]=y=>i.currentIndex=y),class:"w-100 gray-bg-1 rounded d-flex justify-space-around align-center ga-0 px-1 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dateList,y=>(e.openBlock(),e.createBlock(n,{class:"text-none text-body-1 rounded bg-none flex-1-1-0",density:"compact",color:"primary",height:"26",value:y.index},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),e.createElementVNode("div",il,null,512),e.createElementVNode("table",rl,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",ll,e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("th",nl,e.toDisplayString(o.$t("time.time"))+" ( LT )",1),e.createElementVNode("th",sl,e.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tideTableData,(y,p)=>{var _;return e.openBlock(),e.createElementBlock("tr",{key:p},[e.createElementVNode("td",cl,e.toDisplayString(o.$t(`tide.${(_=y==null?void 0:y.type)==null?void 0:_.toLowerCase()}`))+" "+e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("td",ml,e.toDisplayString(l.computeLocalTime(y==null?void 0:y.date,a.station,"MM-DD HH:mm")),1),e.createElementVNode("td",dl,e.toDisplayString((y==null?void 0:y.height)??"-")+" m",1)])}),128))])])])])])]}),_:1})}const pl=A(Er,[["render",hl],["__scopeId","data-v-e6ab70d5"]]),xd="",_d="",gl={name:"IdmTideStations",components:{TideDetail:pl},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var o,t,a,r,i,l;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var o;this.showInfo=!1,(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(o){const t=o.features[0];t.properties&&(this.station=t.properties,this.station.name=this.locale==="en"?t.properties.Location_EN:t.properties.Location_CN,this.station.lng=t.geometry.coordinates[0],this.station.lat=t.geometry.coordinates[1],this.showDetail=!0)},handleHover(o){var a,r;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties){this.showInfo=!0,this.hoverStation=t.properties,this.hoverStation.name=this.locale==="en"?t.properties.Location_EN:t.properties.Location_CN,this.hoverStation.lng=t.geometry.coordinates[0],this.hoverStation.lat=t.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new me.Marker(i).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverStation={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},ul={class:"station-box d-flex flex-column justify-center align-start ga-1"},fl={class:"d-flex justify-start align-center"},yl={class:"d-flex justify-start align-center"},bl={class:"text-label"};function wl(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card"),s=e.resolveComponent("TideDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmTidalInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"pr-8 text-body-1"},{default:e.withCtx(()=>{var h,d;return[e.createElementVNode("div",ul,[e.createElementVNode("div",fl,e.toDisplayString(o.$t("tide.tideStation")),1),e.createElementVNode("div",yl,[e.createElementVNode("label",bl,e.toDisplayString((h=i.hoverStation)==null?void 0:h.name)+" , "+e.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,station:i.station,onClose:l.handleCloseDetail},o.$attrs),null,16,["station","onClose"])):e.createCommentVNode("",!0)])}const xl=A(gl,[["render",wl],["__scopeId","data-v-4611be64"]]),_l={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function kl(o,t,a,r,i,l){return null}const vl=A(_l,[["render",kl]]),kd="",zl={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var o;this.map&&((o=this.map)==null||o.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(o){this.lngLat.lng=N.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty,this.lngLat.lat=N.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty,this.lngLat.str=`[${N.LngLatHelper.str2Lng(o==null?void 0:o.lng,4)}, ${N.LngLatHelper.str2Lat(o==null?void 0:o.lat,4)}]`},immediate:!0}},methods:{handleBind(){var o,t;this.show?((o=this.map)==null||o.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(t=this.map)==null||t.off("zoomend",this.handleZoomEnd))},handleMouseMove(o){this.lngLat.e=o.lngLat},handleComputeLatLngs(){var r;const o=(r=this.map)==null?void 0:r.getZoom();let t=30;o>4?t=10:o>3&&(t=15);const a=[];for(let i=-60;i<90;i+=t)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=t)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=t)for(let l=-60;l<90;l+=t)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var t;const o=this.handleComputeLatLngs();(t=this.map)==null||t.getSource(this.source).setData(E.featureCollection(o))},handleRender(){if(this.handleClear(),this.map){const o=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:o}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8,"text-color":this.lineColor}},this.beforeLayer)}},handleClear(){var o,t,a,r,i,l;(o=this.map)!=null&&o.getLayer(this.layer)&&((t=this.map)==null||t.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Ll(o,t,a,r,i,l){var n,c,s;return e.openBlock(),e.createElementBlock("div",{class:"idm-lat-lng-tip-gl4 pa-2 text-caption text-right rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createElementVNode("div",null,e.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),e.createElementVNode("div",null,e.toDisplayString((c=i.lngLat)==null?void 0:c.lng),1),e.createElementVNode("div",null,e.toDisplayString((s=i.lngLat)==null?void 0:s.str),1)],4)}const fo=A(zl,[["render",Ll]]),vd="",Cl={name:"IdmFollowPort",components:{PortDetail:po},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},setup(){return{Theme:re.useTheme()}},emits:["closeAllDetail"],data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var o,t,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,t,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var t,a;const o={features:[],type:"FeatureCollection"};(t=this.followList)==null||t.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};o.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,t,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){const t=o.features[0];this.portId=t.properties.id,t.properties.id&&(this.port=t.properties,this.port.lng=t.geometry.coordinates[0],this.port.lat=t.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(o){var r,i;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.hoverPort=t.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Pl={class:"port-box d-flex flex-column justify-center align-start ga-1"},Sl={class:"d-flex justify-start align-center text-label"},Nl={class:"d-flex justify-start align-center text-label"};function Tl(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card"),s=e.resolveComponent("PortDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",Pl,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",Sl,[e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.name??"-"),1)]),e.createElementVNode("div",Nl,[t[1]||(t[1]=e.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,portId:i.portId,port:i.port,forecastModel:a.forecastModel,followList:a.followList,onClose:l.handleCloseDetail,onCloseAllDetail:t[0]||(t[0]=h=>o.$emit("closeAllDetail",{followPort:!0}))},o.$attrs),null,16,["portId","port","forecastModel","followList","onClose"])):e.createCommentVNode("",!0)])}const Dl=A(Cl,[["render",Tl],["__scopeId","data-v-95e70a1f"]]),zd="",El={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(o){return!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:{show:{handler(){var o,t,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,t,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var t,a;const o={features:[],type:"FeatureCollection"};(t=this.followList)==null||t.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};o.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"location","icon-offset":[0,-13]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,t,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){var a,r,i,l,n,c,s,h,d;const t=o.features[0];if(t.properties){const g=t.properties;g.lng=t.geometry.coordinates[0],g.lat=t.geometry.coordinates[1];const u=z(),y=(a=z(this.realTime))==null?void 0:a.diff(u,"d",!0),p={lat:g.lat,lng:g.lng,datetime:this.realTime,forecastModel:this.forecastModel};y>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchMeteoData(p):(d=(h=(s=(c=this.$parent)==null?void 0:c.$parent)==null?void 0:s.$refs)==null?void 0:h.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(o){var a;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.position=t.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new me.Marker(r).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"}}},Ml={class:"position-box d-flex flex-column justify-center align-start ga-1"},Vl={class:"d-flex justify-start align-center text-label"},Bl={key:0,class:"d-flex justify-start align-center text-label"};function Il(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card");return e.withDirectives((e.openBlock(),e.createBlock(c,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",Ml,[t[0]||(t[0]=e.createElementVNode("div",null,"Location",-1)),e.createElementVNode("div",Vl,[e.createElementVNode("span",null,e.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(e.openBlock(),e.createElementBlock("div",Bl,[e.createElementVNode("span",null,e.toDisplayString(i.position.remark??"-"),1)])):e.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[e.vShow,i.showInfo]])}const Al=A(El,[["render",Il],["__scopeId","data-v-cd6c9f7e"]]),Ld="",Rl={name:"IdmOtherLayerr",components:{IdmWarZone:Fa,IdmGmdssArea:Wa,IdmEcaZone:Ya,IdmAlertZone:Ka,IdmPort:nr,IdmLoadLine:mr,IdmTimezone:pr,IdmVRA:fr,IdmSpecialArea:wr,IdmTerminator:kr,IdmWorld12nm:Lr,IdmWorldMarine:Sr,IdmChinaRoute:Dr,IdmTideStations:xl,IdmIceAreas:vl,IdmLatLng:fo,IdmFollowPort:Dl,IdmFollowPosition:Al},props:{map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapFeather:localStorage.getItem("mapFeathersCacheGL4")||"light",tagLayers:[...Ee.LayerHelper.OTHER_LAYERS.filter(o=>o.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.2",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4"},mapFeathers:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap"}],checkList:[]}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10})},immediate:!0},realTime:{handler(o,t){o&&t&&o!==t&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapFeather=["light","nautical"].includes(this.mapFeather)?this.mapFeather:"light":this.mapFeather=["dark","satellite"].includes(this.mapFeather)?this.mapFeather:"dark"},immediate:!0},mapFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapFeather),this.$emit("mapFeather",this.mapFeather),this.$emit("theme",["light","nautical"].includes(this.mapFeather)?"light":"dark")},immediate:!0},checkList:{handler(o,t){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=o==null?void 0:o.filter(l=>!(t!=null&&t.includes(l))),r=t==null?void 0:t.filter(l=>!(o!=null&&o.includes(l))),i=o==null?void 0:o.filter(l=>t==null?void 0:t.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(t||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),t=localStorage.getItem(this.cache.mapFeatherKey);const a=t||"light";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(o){this.$emit("map",void 0),this.mapFeather=o.value},async fetchOtherLayers(){var t,a;let o=this.layerWeight;if(o){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await J.get(`${r}/api/arc/other/layers/links?l=${o}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((t=i==null?void 0:i.data)==null?void 0:t.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const s in l)n.push(J.get(l[s],{headers:{Authorization:this.defaultMeteoToken,key:s}}));(await Promise.all(n)).map(s=>{var g,u,y;const h=((g=s==null?void 0:s.data)==null?void 0:g.data)||(s==null?void 0:s.data),d=(y=(u=s==null?void 0:s.config)==null?void 0:u.headers)==null?void 0:y.key;this.otherLayers[d]=h})}}},async fetchDayNightLayer(){var a,r;const o=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],t=await J.get(`${o}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=t==null?void 0:t.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=t==null?void 0:t.data)==null?void 0:r.data)||(t==null?void 0:t.data))},handleLayersChange(o){const t=o==null?void 0:o.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=t,this.fetchOtherLayers()}}},Ol={class:"idm-gl4-other-layer"},jl={class:"header-box d-flex justify-space-between align-center px-4"},Fl={class:"text-h5 font-weight-medium"},Hl={class:"list-box scroll pl-4 pr-2 overflow-y-auto"},Gl={class:"layers-body mt-4 d-flex justify-start align-center flex-wrap"},Wl=["onClick"],Ul={key:0,src:"https://osshz.idmwx.com/asset/dark-map.png",class:"border rounded-sm"},Zl={key:1,src:"https://osshz.idmwx.com/asset/nautical-map.png",class:"border rounded-sm"},Yl={key:2,src:"https://osshz.idmwx.com/asset/satellite-map.png",class:"border rounded-sm"},ql={key:3,src:"https://osshz.idmwx.com/asset/light-map.png",class:"border rounded-sm"},Xl={class:"text-body-2 text-center pt-1"};function $l(o,t,a,r,i,l){var F,Q,K,G,q,ae,ee,ie,ne;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VCardTitle"),h=e.resolveComponent("VCardItem"),d=e.resolveComponent("VCheckbox"),g=e.resolveComponent("VCardText"),u=e.resolveComponent("VCard"),y=e.resolveComponent("IdmLatLng"),p=e.resolveComponent("IdmTerminator"),_=e.resolveComponent("IdmTimezone"),v=e.resolveComponent("IdmPort"),P=e.resolveComponent("IdmAlertZone"),L=e.resolveComponent("IdmTideStations"),x=e.resolveComponent("IdmEcaZone"),w=e.resolveComponent("IdmWarZone"),f=e.resolveComponent("IdmGmdssArea"),k=e.resolveComponent("IdmLoadLine"),b=e.resolveComponent("IdmWorldMarine"),C=e.resolveComponent("IdmVRA"),D=e.resolveComponent("IdmSpecialArea"),R=e.resolveComponent("IdmWorld12nm"),O=e.resolveComponent("IdmChinaRoute"),I=e.resolveComponent("IdmIceAreas"),W=e.resolveComponent("IdmFollowPort"),H=e.resolveComponent("IdmFollowPosition");return e.openBlock(),e.createElementBlock("div",Ol,[e.createElementVNode("div",{class:"menu-bar-box transition px-1 rounded",style:e.normalizeStyle({top:a.top+10+"px",right:i.right+"px"})},[e.createVNode(c,{text:o.$t("layer.mapLayers"),location:"left"},{activator:e.withCtx(({props:M})=>[e.createVNode(n,e.mergeProps(M,{"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[5]||(t[5]=[e.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text"])],4),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition",i.toggle?"right-bar":""]),style:e.normalizeStyle({top:a.top+"px",right:i.toggle?"0px":"-280px"})},[e.createElementVNode("div",jl,[e.createElementVNode("div",Fl,e.toDisplayString(o.$t("layer.layers")),1),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[6]||(t[6]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),e.createElementVNode("div",Hl,[e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"pb-2"},{default:e.withCtx(()=>[e.createElementVNode("div",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.mapFeathers,M=>(e.openBlock(),e.createElementBlock("div",{key:M.value,class:"mb-2 feather-item",onClick:te=>l.handleToggleMapFeather(M)},[e.createElementVNode("div",{class:e.normalizeClass([i.mapFeather===M.value?"active":"","img-box"])},[M.value==="dark"?(e.openBlock(),e.createElementBlock("img",Ul)):M.value==="nautical"?(e.openBlock(),e.createElementBlock("img",Zl)):M.value==="satellite"?(e.openBlock(),e.createElementBlock("img",Yl)):(e.openBlock(),e.createElementBlock("img",ql))],2),e.createElementVNode("div",Xl,e.toDisplayString(o.$t(`layer.${M.locale}`)),1)],8,Wl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>["graticule","day-night","time-zones"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[0]||(t[0]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>["ports","alert-zones","tidal-stations"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[1]||(t[1]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.otherLayers")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[2]||(t[2]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.myFollows")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":t[3]||(t[3]=M=>i.checkList=M),value:"follow-ports",label:o.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),e.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":t[4]||(t[4]=M=>i.checkList=M),value:"follow-positions",label:o.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})])],6),a.map?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},o.$attrs),null,16,["map","menu-toggle","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,map:a.map,area:(F=i.otherLayers)==null?void 0:F["day-night"]},o.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(_,e.mergeProps({key:2,map:a.map,zone:(Q=i.otherLayers)==null?void 0:Q["time-zones"]},o.$attrs,{beforeLayer:"empty-layer-3"}),null,16,["map","zone"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(v,e.mergeProps({key:3,ref:"idmPorts",map:a.map,ports:(K=i.otherLayers)==null?void 0:K.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","ports","gateway","token","forecast-model","realTime"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(P,e.mergeProps({key:4,map:a.map,zone:(G=i.otherLayers)==null?void 0:G["alert-zones"]},o.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","zone","theme"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(L,e.mergeProps({key:5,ref:"idmIideStation",map:a.map,gateway:a.gateway,token:a.token,show:i.checkList.includes("tidal-stations"),theme:a.theme,realTime:a.realTime,forecastModel:a.forecastModel,"before-layer":"empty-layer-3"},o.$attrs),null,16,["map","gateway","token","show","theme","realTime","forecastModel"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(x,e.mergeProps({key:6,map:a.map,zone:(q=i.otherLayers)==null?void 0:q["eca-zones"]},o.$attrs),null,16,["map","zone"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:7,map:a.map,zone:(ae=i.otherLayers)==null?void 0:ae["war-zones"]},o.$attrs),null,16,["map","zone"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(f,e.mergeProps({key:8,map:a.map,area:(ee=i.otherLayers)==null?void 0:ee["gmdss-areas"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(k,e.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},o.$attrs),null,16,["map","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(b,e.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(C,e.mergeProps({key:11,map:a.map,area:(ie=i.otherLayers)==null?void 0:ie["voluntary-reporting-area"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(D,e.mergeProps({key:12,map:a.map,area:(ne=i.otherLayers)==null?void 0:ne["special-area"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(R,e.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(O,e.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(I,e.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},o.$attrs),null,16,["map","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:16,ref:"idmFollowPort",map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","show","gateway","token","forecast-model","realTime"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:17,ref:"idmFollowPosition",map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs),null,16,["map","show","forecast-model","realTime"])):e.createCommentVNode("",!0)])}const Kl=A(Rl,[["render",$l]]);class go{constructor(t){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=t,this.mercator=new Aa,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(t,a=0){return t>180?this.convertNLng(t-360,a+1):t<-180?this.convertNLng(t+360,a+1):[t,a]}getBoundLngLat(){var a;const t=(a=this.map)==null?void 0:a.getBounds();return t?[[t._sw.lng,t._ne.lat],[t._ne.lng,t._ne.lat],[t._ne.lng,t._sw.lat],[t._sw.lng,t._sw.lat]]:[]}getBoundPixel(){var p,_;const t=(p=this.map)==null?void 0:p.getBounds();if(!t)return[];const a=((_=this.map)==null?void 0:_.getZoom())+1,r=[t._ne.lng,t._ne.lat],i=[t._sw.lng,t._sw.lat],[l,n]=this.convertNLng(r[0]),[c,s]=this.convertNLng(i[0]),[h,d]=this.mercator.px([l,r[1]],a),[g,u]=this.mercator.px([c,i[1]],a),y=Math.round(this.mercator.size*Math.pow(2,a)*(n+s));return[g,u,h+y,d]}getBoundRange(){const t=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,t),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(t,a){const r=2**a,[i,l,n,c]=t.map(d=>~~(d/(r*256))),s=[];for(let d=c;d<=l;d++)for(let g=i;g<=n;g++)s.push([g,d]);return s.map(d=>{const g=2**a*256;return[d[0]*g,d[1]*g,g]})}resize(){let t=this.map.getSource(this.rampColorSource);t.setCoordinates(this.getBoundLngLat()),t=this.map.getSource(this.particleSource),t.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(t){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.rampColorLayer,"visibility"),r=t?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(t){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.particleLayer,"visibility"),r=t?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class be{createShader(t,a,r){const i=t.createShader(a);if(i&&(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)))throw new Error(t.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(t,a,r,i,l,n,c){const s=t.createTexture();return t.bindTexture(t.TEXTURE_2D,s),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i),l instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,c,0,t.RGBA,t.UNSIGNED_BYTE,l):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,l),t.bindTexture(t.TEXTURE_2D,null),s}createDataBuffer(t,a,r){if(t){const i=t.createBuffer();return a==="array"?(t.bindBuffer(t.ARRAY_BUFFER,i),r&&t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW)):a==="element"&&(t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i),r&&t.bufferData(t.ELEMENT_ARRAY_BUFFER,r,t.STATIC_DRAW)),i}return null}createProgram(t,a,r){const i=t.createProgram(),l=this.createShader(t,t.VERTEX_SHADER,a),n=this.createShader(t,t.FRAGMENT_SHADER,r);if(i&&l&&n&&(t.attachShader(i,l),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(t,a,r){const i=this.createProgram(t,a,r);if(i){const l={program:i},n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const h=t.getActiveAttrib(i,s);l[h.name]=t.getAttribLocation(i,h.name)}const c=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let s=0;s<c;s++){const h=t.getActiveUniform(i,s);l[h.name]=t.getUniformLocation(i,h.name)}return l}}setup(t,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const c=n.getContext("2d");if(c&&t){const s=c==null?void 0:c.createLinearGradient(0,0,256,0);return a.forEach(([h,d])=>{s.addColorStop(h,d)}),c.fillStyle=s,c.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(t,t.LINEAR,t.LINEAR,t.CLAMP_TO_EDGE,r?new Uint8Array(c.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(t,a=1e3){const r=Math.ceil(Math.sqrt(a)),i=r*r,l=new Uint8Array(i*4);for(let d=0;d<l.length;d++)l[d]=Math.floor(Math.random()*256);const n=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,l,r,r),c=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,l,r,r),s=new Float32Array(i);for(let d=0;d<i;d++)s[d]=d;const h=this.createDataBuffer(t,"array",s);return{resolution:r,total:i,texture0:n,texture1:c,indexBuffer:h}}bind(t,a,r){const i=this.createProgram(t,a,r);if(i){const l=this.createDataBuffer(t,"array",void 0),n=t.getAttribLocation(i,"a_position");t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0);const c=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(t,"array",c);const s=t.getAttribLocation(i,"a_texCoord");return t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(t,a,r,i,l,n){const c=this.createProgramWrapper(t,a,r),s=this.createProgramWrapper(t,i,l),h=this.createProgramWrapper(t,i,n),d=this.createDataBuffer(t,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),g=t.createFramebuffer();return{particle:c,screen:s,update:h,quadBuffer:d,frameBuffer:g}}draw(t,a,r,i,l,n,c){var s,h;if(a&&r){t.resize(),a==null||a.viewport(0,0,(s=a==null?void 0:a.canvas)==null?void 0:s.width,(h=a==null?void 0:a.canvas)==null?void 0:h.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*t.ratio,a.canvas.height*t.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),c!=null&&c.uvRange&&(c!=null&&c.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,c.uvRange[0],c.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,c.sRange[0],c.sRange[1])),d.scale&&a.uniform1f(d.scale,(c==null?void 0:c.scale)||1);const g=t.getBoundPixel(),u=t.map.getZoom()+1,y=t.getWorldCopy(g,u);for(const p of y){const _=(p[0]-g[0])*t.ratio,v=(p[1]-g[3])*t.ratio,P=p[2]*t.ratio,[L,x,w,f]=[_,P+_,v,P+v],k=new Float32Array([L,w,x,w,L,f,L,f,x,w,x,f]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,k,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(t,a,r,i,l){var n,c;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(c=a==null?void 0:a.canvas)==null?void 0:c.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(t,a,i,l),this.updateParticles(t,a,i,l))}renderScreen(t,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(t,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(t,a,r,i,l){t&&(t.useProgram(r.program),t.bindBuffer(t.ARRAY_BUFFER,i),t.enableVertexAttribArray(r.a_pos),t.vertexAttribPointer(r.a_pos,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(r.u_screen,2),t.uniform1f(r.u_opacity,l),t.drawArrays(t.TRIANGLES,0,6))}renderParticles(t,a,r,i){if(a){a.useProgram(r.particle.program),a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution*t.ratio),a.uniform1f(r.particle.u_point,t.ratio);const l=t.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,r.total)}}updateParticles(t,a,r,i){var n,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const s=t.getBoundRange();a.uniform4f(r.update.u_viewport,s[0],s[1],s[2],s[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*t.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const l=r.texture0;r.texture0=r.texture1,r.texture1=l}resize(t,a){t.resize();const r=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height),l=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:l}}async loadImg(t){return new Promise(a=>{const r=new Blob([t],{type:t.type}),i=URL.createObjectURL(r),l=new Image;l.crossOrigin="anonymous",l.src=i,l.onload=()=>a(l)})}}class ${}oe($,"vertexSchema",`
10
+ </div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],selected:{Speed:!0,Draught:!1},textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:30,left:30,right:20,bottom:30,containLabel:!1},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:11}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["on-surface-variant"]}},alignTicks:!0,axisLine:{show:!0}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(t)},handleClose(){this.$emit("close")}}},Mr={class:"d-flex justify-space-between align-center"},Vr={class:"d-flex justify-start text-h5 my-2"},Br={class:"d-flex justify-start align-center text-body-1 text-label ga-3"},Ir={class:"w-100 px-5 pt-0 pb-0 overflow-y-auto scroll"},Ar={class:"summary-box w-100"},Rr={class:"d-flex justify-space-between align-center py-2"},Or={class:"d-flex justify-center align-center text-h6 ga-2"},jr={class:"multi-color-icon","aria-hidden":"true"},Fr=["xlink:href"],Hr={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},Gr={class:"w-100 d-flex justify-start align-center"},Wr={class:"w-30 text-label font-weight-400"},Ur={class:"flex-1-1-0"},Zr={class:"w-100 d-flex justify-start align-center"},Yr={class:"w-30 text-label font-weight-400"},qr={class:"flex-1-1-0"},Xr={class:"w-100 d-flex justify-start align-center"},$r={class:"w-30 text-label font-weight-400"},Kr={class:"flex-1-1-0"},Jr={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},Qr={class:"w-100 d-flex justify-space-between align-center py-2"},el={class:"d-flex justify-center align-center text-h6 ga-2"},tl={class:"multi-color-icon","aria-hidden":"true"},ol=["xlink:href"],al={class:"w-100 gray-bg-2 rounded pa-4 overflow-y-auto"},il={class:"w-100 py-4",style:{height:"244px"},ref:"tideEchart"},rl={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},ll={class:"px-1 text-center text-label font-weight-400",width:"120"},nl={class:"px-1 text-center text-label font-weight-400",width:"120"},sl={class:"px-1 text-center text-label font-weight-400",width:"120"},cl={class:"px-1 text-center"},ml={class:"px-1 text-center"},dl={class:"px-1 text-center"};function hl(o,t,a,r,i,l){const n=e.resolveComponent("VBtn"),c=e.resolveComponent("v-card-title"),s=e.resolveComponent("v-divider"),h=e.resolveComponent("VBtnToggle"),d=e.resolveComponent("v-card");return e.openBlock(),e.createBlock(d,{class:"tide-detail-container d-flex flex-column justify-start align-center"},{default:e.withCtx(()=>{var g,u;return[e.createVNode(c,{class:"w-100"},{default:e.withCtx(()=>{var y;return[e.createElementVNode("div",Mr,[e.createElementVNode("div",Vr,[e.createElementVNode("div",null,e.toDisplayString((y=a.station)==null?void 0:y.name),1)]),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleClose},{default:e.withCtx(()=>t[1]||(t[1]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),e.createElementVNode("div",Br,[e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideStation")),1)])]}),_:1}),e.createVNode(s,{class:"w-100"}),e.createElementVNode("div",Ir,[e.createElementVNode("div",Ar,[e.createElementVNode("div",Rr,[e.createElementVNode("div",Or,[(e.openBlock(),e.createElementBlock("svg",jr,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Fr)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("detail.summary")),1)]),t[2]||(t[2]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",Hr,[e.createElementVNode("div",Gr,[e.createElementVNode("div",Wr,e.toDisplayString(o.$t("tide.region")),1),e.createElementVNode("div",Ur,e.toDisplayString(((g=a.station)==null?void 0:g.Country)??((u=a.station)==null?void 0:u.city)??"-"),1)]),e.createElementVNode("div",Zr,[e.createElementVNode("div",Yr,e.toDisplayString(o.$t("tide.position")),1),e.createElementVNode("div",qr,e.toDisplayString(l.computePosition(a.station)),1)]),e.createElementVNode("div",Xr,[e.createElementVNode("div",$r,e.toDisplayString(o.$t("time.localTime")),1),e.createElementVNode("div",Kr,e.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+e.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),e.createElementVNode("div",Jr,[e.createElementVNode("div",Qr,[e.createElementVNode("div",el,[(e.openBlock(),e.createElementBlock("svg",tl,[e.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ol)])),e.createElementVNode("div",null,e.toDisplayString(o.$t("tide.tideTimes")),1)]),t[3]||(t[3]=e.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),e.createElementVNode("div",al,[e.createVNode(h,{modelValue:i.currentIndex,"onUpdate:modelValue":t[0]||(t[0]=y=>i.currentIndex=y),class:"w-100 gray-bg-1 rounded d-flex justify-space-around align-center ga-0 px-1 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dateList,y=>(e.openBlock(),e.createBlock(n,{class:"text-none text-body-1 rounded bg-none flex-1-1-0",density:"compact",color:"primary",height:"26",value:y.index},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),e.createElementVNode("div",il,null,512),e.createElementVNode("table",rl,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",ll,e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("th",nl,e.toDisplayString(o.$t("time.time"))+" ( LT )",1),e.createElementVNode("th",sl,e.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tideTableData,(y,p)=>{var _;return e.openBlock(),e.createElementBlock("tr",{key:p},[e.createElementVNode("td",cl,e.toDisplayString(o.$t(`tide.${(_=y==null?void 0:y.type)==null?void 0:_.toLowerCase()}`))+" "+e.toDisplayString(o.$t("tide.tide")),1),e.createElementVNode("td",ml,e.toDisplayString(l.computeLocalTime(y==null?void 0:y.date,a.station,"MM-DD HH:mm")),1),e.createElementVNode("td",dl,e.toDisplayString((y==null?void 0:y.height)??"-")+" m",1)])}),128))])])])])])]}),_:1})}const pl=A(Er,[["render",hl],["__scopeId","data-v-e6ab70d5"]]),xd="",_d="",gl={name:"IdmTideStations",components:{TideDetail:pl},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var o,t,a,r,i,l;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var o;this.showInfo=!1,(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(o){const t=o.features[0];t.properties&&(this.station=t.properties,this.station.name=this.locale==="en"?t.properties.Location_EN:t.properties.Location_CN,this.station.lng=t.geometry.coordinates[0],this.station.lat=t.geometry.coordinates[1],this.showDetail=!0)},handleHover(o){var a,r;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties){this.showInfo=!0,this.hoverStation=t.properties,this.hoverStation.name=this.locale==="en"?t.properties.Location_EN:t.properties.Location_CN,this.hoverStation.lng=t.geometry.coordinates[0],this.hoverStation.lat=t.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new me.Marker(i).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverStation={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},ul={class:"station-box d-flex flex-column justify-center align-start ga-1"},fl={class:"d-flex justify-start align-center"},yl={class:"d-flex justify-start align-center"},bl={class:"text-label"};function wl(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card"),s=e.resolveComponent("TideDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmTidalInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"pr-8 text-body-1"},{default:e.withCtx(()=>{var h,d;return[e.createElementVNode("div",ul,[e.createElementVNode("div",fl,e.toDisplayString(o.$t("tide.tideStation")),1),e.createElementVNode("div",yl,[e.createElementVNode("label",bl,e.toDisplayString((h=i.hoverStation)==null?void 0:h.name)+" , "+e.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,station:i.station,onClose:l.handleCloseDetail},o.$attrs),null,16,["station","onClose"])):e.createCommentVNode("",!0)])}const xl=A(gl,[["render",wl],["__scopeId","data-v-4611be64"]]),_l={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var o,t;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(t=this.map)!=null&&t.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function kl(o,t,a,r,i,l){return null}const vl=A(_l,[["render",kl]]),kd="",zl={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var o;this.map&&((o=this.map)==null||o.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(o){this.lngLat.lng=N.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty,this.lngLat.lat=N.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty,this.lngLat.str=`[${N.LngLatHelper.str2Lng(o==null?void 0:o.lng,4)}, ${N.LngLatHelper.str2Lat(o==null?void 0:o.lat,4)}]`},immediate:!0}},methods:{handleBind(){var o,t;this.show?((o=this.map)==null||o.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(t=this.map)==null||t.off("zoomend",this.handleZoomEnd))},handleMouseMove(o){this.lngLat.e=o.lngLat},handleComputeLatLngs(){var r;const o=(r=this.map)==null?void 0:r.getZoom();let t=30;o>4?t=10:o>3&&(t=15);const a=[];for(let i=-60;i<90;i+=t)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=t)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=t)for(let l=-60;l<90;l+=t)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var t;const o=this.handleComputeLatLngs();(t=this.map)==null||t.getSource(this.source).setData(E.featureCollection(o))},handleRender(){if(this.handleClear(),this.map){const o=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:o}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8,"text-color":this.lineColor}},this.beforeLayer)}},handleClear(){var o,t,a,r,i,l;(o=this.map)!=null&&o.getLayer(this.layer)&&((t=this.map)==null||t.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Ll(o,t,a,r,i,l){var n,c,s;return e.openBlock(),e.createElementBlock("div",{class:"idm-lat-lng-tip-gl4 pa-2 text-caption text-right rounded",style:e.normalizeStyle({right:i.right+"px"})},[e.createElementVNode("div",null,e.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),e.createElementVNode("div",null,e.toDisplayString((c=i.lngLat)==null?void 0:c.lng),1),e.createElementVNode("div",null,e.toDisplayString((s=i.lngLat)==null?void 0:s.str),1)],4)}const fo=A(zl,[["render",Ll]]),vd="",Cl={name:"IdmFollowPort",components:{PortDetail:po},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},setup(){return{Theme:re.useTheme()}},emits:["closeAllDetail"],data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var o,t,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,t,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var t,a;const o={features:[],type:"FeatureCollection"};(t=this.followList)==null||t.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};o.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,t,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){const t=o.features[0];this.portId=t.properties.id,t.properties.id&&(this.port=t.properties,this.port.lng=t.geometry.coordinates[0],this.port.lat=t.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(o){var r,i;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.hoverPort=t.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new me.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Pl={class:"port-box d-flex flex-column justify-center align-start ga-1"},Sl={class:"d-flex justify-start align-center text-label"},Nl={class:"d-flex justify-start align-center text-label"};function Tl(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card"),s=e.resolveComponent("PortDetail");return e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createVNode(c,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",Pl,[e.createElementVNode("div",null,e.toDisplayString(o.$t("port.port")),1),e.createElementVNode("div",Sl,[e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.name??"-"),1)]),e.createElementVNode("div",Nl,[t[1]||(t[1]=e.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),e.createElementVNode("span",null,e.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[e.vShow,i.showInfo]]),i.showDetail?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,portId:i.portId,port:i.port,forecastModel:a.forecastModel,followList:a.followList,onClose:l.handleCloseDetail,onCloseAllDetail:t[0]||(t[0]=h=>o.$emit("closeAllDetail",{followPort:!0}))},o.$attrs),null,16,["portId","port","forecastModel","followList","onClose"])):e.createCommentVNode("",!0)])}const Dl=A(Cl,[["render",Tl],["__scopeId","data-v-95e70a1f"]]),zd="",El={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:re.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(o){return!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:{show:{handler(){var o,t,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,t,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var t,a;const o={features:[],type:"FeatureCollection"};(t=this.followList)==null||t.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};o.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"location","icon-offset":[0,-13]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,t,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(t=this.map)==null||t.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){var a,r,i,l,n,c,s,h,d;const t=o.features[0];if(t.properties){const g=t.properties;g.lng=t.geometry.coordinates[0],g.lat=t.geometry.coordinates[1];const u=z(),y=(a=z(this.realTime))==null?void 0:a.diff(u,"d",!0),p={lat:g.lat,lng:g.lng,datetime:this.realTime,forecastModel:this.forecastModel};y>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchMeteoData(p):(d=(h=(s=(c=this.$parent)==null?void 0:c.$parent)==null?void 0:s.$refs)==null?void 0:h.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(o){var a;this.map.getCanvas().style.cursor="pointer";const t=o.features[0];if(t.properties.id){this.showInfo=!0,this.position=t.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new me.Marker(r).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"}}},Ml={class:"position-box d-flex flex-column justify-center align-start ga-1"},Vl={class:"d-flex justify-start align-center text-label"},Bl={key:0,class:"d-flex justify-start align-center text-label"};function Il(o,t,a,r,i,l){const n=e.resolveComponent("v-card-text"),c=e.resolveComponent("v-card");return e.withDirectives((e.openBlock(),e.createBlock(c,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:e.withCtx(()=>[e.createVNode(n,{class:"text-body-1 pr-8"},{default:e.withCtx(()=>[e.createElementVNode("div",Ml,[t[0]||(t[0]=e.createElementVNode("div",null,"Location",-1)),e.createElementVNode("div",Vl,[e.createElementVNode("span",null,e.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(e.openBlock(),e.createElementBlock("div",Bl,[e.createElementVNode("span",null,e.toDisplayString(i.position.remark??"-"),1)])):e.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[e.vShow,i.showInfo]])}const Al=A(El,[["render",Il],["__scopeId","data-v-cd6c9f7e"]]),Ld="",Rl={name:"IdmOtherLayerr",components:{IdmWarZone:Fa,IdmGmdssArea:Wa,IdmEcaZone:Ya,IdmAlertZone:Ka,IdmPort:nr,IdmLoadLine:mr,IdmTimezone:pr,IdmVRA:fr,IdmSpecialArea:wr,IdmTerminator:kr,IdmWorld12nm:Lr,IdmWorldMarine:Sr,IdmChinaRoute:Dr,IdmTideStations:xl,IdmIceAreas:vl,IdmLatLng:fo,IdmFollowPort:Dl,IdmFollowPosition:Al},props:{map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:60},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapFeather:localStorage.getItem("mapFeathersCacheGL4")||"light",tagLayers:[...Ee.LayerHelper.OTHER_LAYERS.filter(o=>o.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.2",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4"},mapFeathers:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap"}],checkList:[]}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10})},immediate:!0},realTime:{handler(o,t){o&&t&&o!==t&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapFeather=["light","nautical"].includes(this.mapFeather)?this.mapFeather:"light":this.mapFeather=["dark","satellite"].includes(this.mapFeather)?this.mapFeather:"dark"},immediate:!0},mapFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapFeather),this.$emit("mapFeather",this.mapFeather),this.$emit("theme",["light","nautical"].includes(this.mapFeather)?"light":"dark")},immediate:!0},checkList:{handler(o,t){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=o==null?void 0:o.filter(l=>!(t!=null&&t.includes(l))),r=t==null?void 0:t.filter(l=>!(o!=null&&o.includes(l))),i=o==null?void 0:o.filter(l=>t==null?void 0:t.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(t||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),t=localStorage.getItem(this.cache.mapFeatherKey);const a=t||"light";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(o){this.$emit("map",void 0),this.mapFeather=o.value},async fetchOtherLayers(){var t,a;let o=this.layerWeight;if(o){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await J.get(`${r}/api/arc/other/layers/links?l=${o}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((t=i==null?void 0:i.data)==null?void 0:t.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const s in l)n.push(J.get(l[s],{headers:{Authorization:this.defaultMeteoToken,key:s}}));(await Promise.all(n)).map(s=>{var g,u,y;const h=((g=s==null?void 0:s.data)==null?void 0:g.data)||(s==null?void 0:s.data),d=(y=(u=s==null?void 0:s.config)==null?void 0:u.headers)==null?void 0:y.key;this.otherLayers[d]=h})}}},async fetchDayNightLayer(){var a,r;const o=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],t=await J.get(`${o}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=t==null?void 0:t.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=t==null?void 0:t.data)==null?void 0:r.data)||(t==null?void 0:t.data))},handleLayersChange(o){const t=o==null?void 0:o.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=t,this.fetchOtherLayers()}}},Ol={class:"idm-gl4-other-layer"},jl={class:"header-box d-flex justify-space-between align-center px-4"},Fl={class:"text-h5 font-weight-medium"},Hl={class:"list-box scroll pl-4 pr-2 overflow-y-auto"},Gl={class:"layers-body mt-4 d-flex justify-start align-center flex-wrap"},Wl=["onClick"],Ul={key:0,src:"https://osshz.idmwx.com/asset/dark-map.png",class:"border rounded-sm"},Zl={key:1,src:"https://osshz.idmwx.com/asset/nautical-map.png",class:"border rounded-sm"},Yl={key:2,src:"https://osshz.idmwx.com/asset/satellite-map.png",class:"border rounded-sm"},ql={key:3,src:"https://osshz.idmwx.com/asset/light-map.png",class:"border rounded-sm"},Xl={class:"text-body-2 text-center pt-1"};function $l(o,t,a,r,i,l){var F,Q,K,G,q,ae,ee,ie,ne;const n=e.resolveComponent("VBtn"),c=e.resolveComponent("VTooltip"),s=e.resolveComponent("VCardTitle"),h=e.resolveComponent("VCardItem"),d=e.resolveComponent("VCheckbox"),g=e.resolveComponent("VCardText"),u=e.resolveComponent("VCard"),y=e.resolveComponent("IdmLatLng"),p=e.resolveComponent("IdmTerminator"),_=e.resolveComponent("IdmTimezone"),v=e.resolveComponent("IdmPort"),P=e.resolveComponent("IdmAlertZone"),L=e.resolveComponent("IdmTideStations"),x=e.resolveComponent("IdmEcaZone"),w=e.resolveComponent("IdmWarZone"),f=e.resolveComponent("IdmGmdssArea"),k=e.resolveComponent("IdmLoadLine"),b=e.resolveComponent("IdmWorldMarine"),C=e.resolveComponent("IdmVRA"),D=e.resolveComponent("IdmSpecialArea"),R=e.resolveComponent("IdmWorld12nm"),O=e.resolveComponent("IdmChinaRoute"),I=e.resolveComponent("IdmIceAreas"),W=e.resolveComponent("IdmFollowPort"),H=e.resolveComponent("IdmFollowPosition");return e.openBlock(),e.createElementBlock("div",Ol,[e.createElementVNode("div",{class:"menu-bar-box transition px-1 rounded",style:e.normalizeStyle({top:a.top+10+"px",right:i.right+"px"})},[e.createVNode(c,{text:o.$t("layer.mapLayers"),location:"left"},{activator:e.withCtx(({props:M})=>[e.createVNode(n,e.mergeProps(M,{"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[5]||(t[5]=[e.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text"])],4),e.createElementVNode("div",{class:e.normalizeClass(["available-layers transition",i.toggle?"right-bar":""]),style:e.normalizeStyle({top:a.top+"px",right:i.toggle?"0px":"-280px"})},[e.createElementVNode("div",jl,[e.createElementVNode("div",Fl,e.toDisplayString(o.$t("layer.layers")),1),e.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:e.withCtx(()=>t[6]||(t[6]=[e.createElementVNode("i",{class:"iconfont icon-close text-label text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),e.createElementVNode("div",Hl,[e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"pb-2"},{default:e.withCtx(()=>[e.createElementVNode("div",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.mapFeathers,M=>(e.openBlock(),e.createElementBlock("div",{key:M.value,class:"mb-2 feather-item",onClick:te=>l.handleToggleMapFeather(M)},[e.createElementVNode("div",{class:e.normalizeClass([i.mapFeather===M.value?"active":"","img-box"])},[M.value==="dark"?(e.openBlock(),e.createElementBlock("img",Ul)):M.value==="nautical"?(e.openBlock(),e.createElementBlock("img",Zl)):M.value==="satellite"?(e.openBlock(),e.createElementBlock("img",Yl)):(e.openBlock(),e.createElementBlock("img",ql))],2),e.createElementVNode("div",Xl,e.toDisplayString(o.$t(`layer.${M.locale}`)),1)],8,Wl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>["graticule","day-night","time-zones"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[0]||(t[0]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>["ports","alert-zones","tidal-stations"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[1]||(t[1]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.otherLayers")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tagLayers.filter(M=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(M.key)),M=>(e.openBlock(),e.createBlock(d,{key:M.key,modelValue:i.checkList,"onUpdate:modelValue":t[2]||(t[2]=te=>i.checkList=te),value:M.key,label:o.$t(`layer.${M.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),e.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:e.withCtx(()=>[e.createVNode(h,{class:"border-b-thin"},{default:e.withCtx(()=>[e.createVNode(s,{class:"text-subtitle-1 font-weight-medium",style:{"font-size":"16px !important"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.$t("layer.myFollows")),1)]),_:1})]),_:1}),e.createVNode(g,{class:"py-2"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":t[3]||(t[3]=M=>i.checkList=M),value:"follow-ports",label:o.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),e.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":t[4]||(t[4]=M=>i.checkList=M),value:"follow-positions",label:o.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})])],6),a.map?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},o.$attrs),null,16,["map","menu-toggle","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,map:a.map,area:(F=i.otherLayers)==null?void 0:F["day-night"]},o.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(_,e.mergeProps({key:2,map:a.map,zone:(Q=i.otherLayers)==null?void 0:Q["time-zones"],realTime:a.realTime},o.$attrs,{beforeLayer:"empty-layer-3"}),null,16,["map","zone","realTime"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(v,e.mergeProps({key:3,ref:"idmPorts",map:a.map,ports:(K=i.otherLayers)==null?void 0:K.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","ports","gateway","token","forecast-model","realTime"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(P,e.mergeProps({key:4,map:a.map,zone:(G=i.otherLayers)==null?void 0:G["alert-zones"]},o.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","zone","theme"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(L,e.mergeProps({key:5,ref:"idmIideStation",map:a.map,gateway:a.gateway,token:a.token,show:i.checkList.includes("tidal-stations"),theme:a.theme,realTime:a.realTime,forecastModel:a.forecastModel,"before-layer":"empty-layer-3"},o.$attrs),null,16,["map","gateway","token","show","theme","realTime","forecastModel"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(x,e.mergeProps({key:6,map:a.map,zone:(q=i.otherLayers)==null?void 0:q["eca-zones"]},o.$attrs),null,16,["map","zone"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(w,e.mergeProps({key:7,map:a.map,zone:(ae=i.otherLayers)==null?void 0:ae["war-zones"]},o.$attrs),null,16,["map","zone"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(f,e.mergeProps({key:8,map:a.map,area:(ee=i.otherLayers)==null?void 0:ee["gmdss-areas"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(k,e.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},o.$attrs),null,16,["map","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(b,e.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(C,e.mergeProps({key:11,map:a.map,area:(ie=i.otherLayers)==null?void 0:ie["voluntary-reporting-area"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(D,e.mergeProps({key:12,map:a.map,area:(ne=i.otherLayers)==null?void 0:ne["special-area"]},o.$attrs),null,16,["map","area"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(R,e.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(O,e.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},o.$attrs),null,16,["map","token","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(I,e.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},o.$attrs),null,16,["map","show"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(W,e.mergeProps({key:16,ref:"idmFollowPort",map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","show","gateway","token","forecast-model","realTime"])):e.createCommentVNode("",!0),a.map?(e.openBlock(),e.createBlock(H,e.mergeProps({key:17,ref:"idmFollowPosition",map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,realTime:a.realTime},o.$attrs),null,16,["map","show","forecast-model","realTime"])):e.createCommentVNode("",!0)])}const Kl=A(Rl,[["render",$l]]);class go{constructor(t){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=t,this.mercator=new Aa,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(t,a=0){return t>180?this.convertNLng(t-360,a+1):t<-180?this.convertNLng(t+360,a+1):[t,a]}getBoundLngLat(){var a;const t=(a=this.map)==null?void 0:a.getBounds();return t?[[t._sw.lng,t._ne.lat],[t._ne.lng,t._ne.lat],[t._ne.lng,t._sw.lat],[t._sw.lng,t._sw.lat]]:[]}getBoundPixel(){var p,_;const t=(p=this.map)==null?void 0:p.getBounds();if(!t)return[];const a=((_=this.map)==null?void 0:_.getZoom())+1,r=[t._ne.lng,t._ne.lat],i=[t._sw.lng,t._sw.lat],[l,n]=this.convertNLng(r[0]),[c,s]=this.convertNLng(i[0]),[h,d]=this.mercator.px([l,r[1]],a),[g,u]=this.mercator.px([c,i[1]],a),y=Math.round(this.mercator.size*Math.pow(2,a)*(n+s));return[g,u,h+y,d]}getBoundRange(){const t=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,t),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(t,a){const r=2**a,[i,l,n,c]=t.map(d=>~~(d/(r*256))),s=[];for(let d=c;d<=l;d++)for(let g=i;g<=n;g++)s.push([g,d]);return s.map(d=>{const g=2**a*256;return[d[0]*g,d[1]*g,g]})}resize(){let t=this.map.getSource(this.rampColorSource);t.setCoordinates(this.getBoundLngLat()),t=this.map.getSource(this.particleSource),t.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(t){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.rampColorLayer,"visibility"),r=t?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(t){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.particleLayer,"visibility"),r=t?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class be{createShader(t,a,r){const i=t.createShader(a);if(i&&(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)))throw new Error(t.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(t,a,r,i,l,n,c){const s=t.createTexture();return t.bindTexture(t.TEXTURE_2D,s),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i),l instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,c,0,t.RGBA,t.UNSIGNED_BYTE,l):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,l),t.bindTexture(t.TEXTURE_2D,null),s}createDataBuffer(t,a,r){if(t){const i=t.createBuffer();return a==="array"?(t.bindBuffer(t.ARRAY_BUFFER,i),r&&t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW)):a==="element"&&(t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i),r&&t.bufferData(t.ELEMENT_ARRAY_BUFFER,r,t.STATIC_DRAW)),i}return null}createProgram(t,a,r){const i=t.createProgram(),l=this.createShader(t,t.VERTEX_SHADER,a),n=this.createShader(t,t.FRAGMENT_SHADER,r);if(i&&l&&n&&(t.attachShader(i,l),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(t,a,r){const i=this.createProgram(t,a,r);if(i){const l={program:i},n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const h=t.getActiveAttrib(i,s);l[h.name]=t.getAttribLocation(i,h.name)}const c=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let s=0;s<c;s++){const h=t.getActiveUniform(i,s);l[h.name]=t.getUniformLocation(i,h.name)}return l}}setup(t,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const c=n.getContext("2d");if(c&&t){const s=c==null?void 0:c.createLinearGradient(0,0,256,0);return a.forEach(([h,d])=>{s.addColorStop(h,d)}),c.fillStyle=s,c.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(t,t.LINEAR,t.LINEAR,t.CLAMP_TO_EDGE,r?new Uint8Array(c.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(t,a=1e3){const r=Math.ceil(Math.sqrt(a)),i=r*r,l=new Uint8Array(i*4);for(let d=0;d<l.length;d++)l[d]=Math.floor(Math.random()*256);const n=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,l,r,r),c=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,l,r,r),s=new Float32Array(i);for(let d=0;d<i;d++)s[d]=d;const h=this.createDataBuffer(t,"array",s);return{resolution:r,total:i,texture0:n,texture1:c,indexBuffer:h}}bind(t,a,r){const i=this.createProgram(t,a,r);if(i){const l=this.createDataBuffer(t,"array",void 0),n=t.getAttribLocation(i,"a_position");t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0);const c=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(t,"array",c);const s=t.getAttribLocation(i,"a_texCoord");return t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(t,a,r,i,l,n){const c=this.createProgramWrapper(t,a,r),s=this.createProgramWrapper(t,i,l),h=this.createProgramWrapper(t,i,n),d=this.createDataBuffer(t,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),g=t.createFramebuffer();return{particle:c,screen:s,update:h,quadBuffer:d,frameBuffer:g}}draw(t,a,r,i,l,n,c){var s,h;if(a&&r){t.resize(),a==null||a.viewport(0,0,(s=a==null?void 0:a.canvas)==null?void 0:s.width,(h=a==null?void 0:a.canvas)==null?void 0:h.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*t.ratio,a.canvas.height*t.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),c!=null&&c.uvRange&&(c!=null&&c.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,c.uvRange[0],c.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,c.sRange[0],c.sRange[1])),d.scale&&a.uniform1f(d.scale,(c==null?void 0:c.scale)||1);const g=t.getBoundPixel(),u=t.map.getZoom()+1,y=t.getWorldCopy(g,u);for(const p of y){const _=(p[0]-g[0])*t.ratio,v=(p[1]-g[3])*t.ratio,P=p[2]*t.ratio,[L,x,w,f]=[_,P+_,v,P+v],k=new Float32Array([L,w,x,w,L,f,L,f,x,w,x,f]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,k,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(t,a,r,i,l){var n,c;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(c=a==null?void 0:a.canvas)==null?void 0:c.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(t,a,i,l),this.updateParticles(t,a,i,l))}renderScreen(t,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(t,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(t,a,r,i,l){t&&(t.useProgram(r.program),t.bindBuffer(t.ARRAY_BUFFER,i),t.enableVertexAttribArray(r.a_pos),t.vertexAttribPointer(r.a_pos,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(r.u_screen,2),t.uniform1f(r.u_opacity,l),t.drawArrays(t.TRIANGLES,0,6))}renderParticles(t,a,r,i){if(a){a.useProgram(r.particle.program),a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution*t.ratio),a.uniform1f(r.particle.u_point,t.ratio);const l=t.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,r.total)}}updateParticles(t,a,r,i){var n,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const s=t.getBoundRange();a.uniform4f(r.update.u_viewport,s[0],s[1],s[2],s[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*t.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const l=r.texture0;r.texture0=r.texture1,r.texture1=l}resize(t,a){t.resize();const r=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height),l=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:l}}async loadImg(t){return new Promise(a=>{const r=new Blob([t],{type:t.type}),i=URL.createObjectURL(r),l=new Image;l.crossOrigin="anonymous",l.src=i,l.onload=()=>a(l)})}}class ${}oe($,"vertexSchema",`
10
11
  //canvas 坐标系上的坐标 (x, y)
11
12
  attribute vec2 a_position; //像素坐标
12
13
  attribute vec2 a_texCoord; //纹理坐标
@@ -24,6 +24,9 @@ declare namespace _sfc_main {
24
24
  zoneLabelLayer: string;
25
25
  marker: null;
26
26
  };
27
+ namespace computed {
28
+ function timeZoneName(): (timeZone: any) => any;
29
+ }
27
30
  namespace watch {
28
31
  export namespace zone_1 {
29
32
  function handler(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idmwx/idmui-gl4",
3
3
  "private": false,
4
- "version": "1.7.6",
4
+ "version": "1.7.7",
5
5
  "description": "idm webgl4",
6
6
  "type": "module",
7
7
  "keywords": [