- • ${Ai.properties.advert.node_name||"Unknown Node"} (${Ai.properties.advert.contact_type})
+ `),we.value.push(fi)},200)};ps()},Fo)},ma=()=>{if(!It||!re)return;const Ya=It.getBounds(),ao=Math.floor(It.getZoom());se.value.forEach(Ks=>{It&&Ks.remove()}),se.value.clear(),we.value.forEach(Ks=>{It&&Ks.remove()}),we.value.length=0,re.getClusters([Ya.getWest(),Ya.getSouth(),Ya.getEast(),Ya.getNorth()],ao).forEach(Ks=>{const[Fo,$a]=Ks.geometry.coordinates,Ca=Ks.properties;if(Ca.cluster){const ha=Sm.marker([$a,Fo],{icon:Vn(Ca.point_count||0)}).addTo(It);ha.on("click",()=>{if(It&&re){const Mi=re.getClusterExpansionZoom(Ca.cluster_id);It.setView([$a,Fo],Mi)}});const mo=re.getLeaves(Ca.cluster_id,1/0).map(Mi=>`
+ • ${Mi.properties.advert.node_name||"Unknown Node"} (${Mi.properties.advert.contact_type})
`).join("");ha.bindPopup(`
Cluster: ${Ca.point_count} nodes
@@ -89,56 +89,56 @@ function SG(d,s){for(var E=0;E
- `),le.value.set(`cluster-${Ca.cluster_id}`,ha);const Jo=Qn(Nn,si,$a,Fo),zo=Math.min(Math.floor(Jo*5),200),di={node_name:`Cluster of ${Ca.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:$a,jittered_longitude:Fo,latitude:$a,longitude:Fo};fi(di,Nn,si,"#AAE8E8",zo)}else{const ha=Ca.advert,oo=Ti[ha.contact_type]||Ti.Unknown,mo=Hn(oo),Jo=$a,zo=Fo,di=Qn(Nn,si,Jo,zo),Ai=Mm.marker([Jo,zo],{icon:mo}).addTo(It).bindPopup(`
+ `),se.value.set(`cluster-${Ca.cluster_id}`,ha);const Jo=Xn(On,ei,$a,Fo),Oo=Math.min(Math.floor(Jo*5),200),gi={node_name:`Cluster of ${Ca.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:$a,jittered_longitude:Fo,latitude:$a,longitude:Fo};di(gi,On,ei,"#AAE8E8",Oo)}else{const ha=Ca.advert,oo=Ai[ha.contact_type]||Ai.Unknown,mo=Fn(oo),Jo=$a,Oo=Fo,gi=Xn(On,ei,Jo,Oo),Mi=Sm.marker([Jo,Oo],{icon:mo}).addTo(It).bindPopup(`
${ha.node_name||"Unknown Node"}
Type: ${ha.contact_type}
- Distance: ${di.toFixed(2)} km
- Signal: ${fn(ha.rssi)} / ${Dt(ha.snr)}
- Route: ${un(ha.route_type)}
- Last Seen: ${Vr(ha.last_seen)}
+ Distance: ${gi.toFixed(2)} km
+ Signal: ${hn(ha.rssi)} / ${Dt(ha.snr)}
+ Route: ${on(ha.route_type)}
+ Last Seen: ${Dr(ha.last_seen)}
${ha.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);jt.value.set(ha.pubkey,Ai),le.value.set(`node-${ha.pubkey}`,Ai);const hi=Math.min(Math.floor(di*5),200),go={...ha,jittered_latitude:Jo,jittered_longitude:zo};fi(go,Nn,si,oo,hi)}})},ml=(Ya,ao)=>{let Wa=0;Xn(R.adverts).forEach(Fo=>{const $a=Fo.properties.advert;if($a.latitude!==null&&$a.longitude!==null){const Ca=Ti[$a.contact_type]||Ti.Unknown,ha=Hn(Ca),oo=$a.jittered_latitude||$a.latitude,mo=$a.jittered_longitude||$a.longitude,Jo=Mm.marker([oo,mo],{icon:ha}).addTo(It).bindPopup(`
+ `);jt.value.set(ha.pubkey,Mi),se.value.set(`node-${ha.pubkey}`,Mi);const fi=Math.min(Math.floor(gi*5),200),go={...ha,jittered_latitude:Jo,jittered_longitude:Oo};di(go,On,ei,oo,fi)}})},ml=(Ya,ao)=>{let Wa=0;Qn(B.adverts).forEach(Fo=>{const $a=Fo.properties.advert;if($a.latitude!==null&&$a.longitude!==null){const Ca=Ai[$a.contact_type]||Ai.Unknown,ha=Fn(Ca),oo=$a.jittered_latitude||$a.latitude,mo=$a.jittered_longitude||$a.longitude,Jo=Sm.marker([oo,mo],{icon:ha}).addTo(It).bindPopup(`
${$a.node_name||"Unknown Node"}
Type: ${$a.contact_type}
- Distance: ${Qn(Ya,ao,oo,mo).toFixed(2)} km
- Signal: ${fn($a.rssi)} / ${Dt($a.snr)}
- Route: ${un($a.route_type)}
- Last Seen: ${Vr($a.last_seen)}
+ Distance: ${Xn(Ya,ao,oo,mo).toFixed(2)} km
+ Signal: ${hn($a.rssi)} / ${Dt($a.snr)}
+ Route: ${on($a.route_type)}
+ Last Seen: ${Dr($a.last_seen)}
${$a.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);jt.value.set($a.pubkey,Jo);const zo=Jo.getElement();zo&&(zo.style.opacity="0",zo.style.transition="opacity 0.5s ease-out"),fi($a,Ya,ao,Ca,Wa),setTimeout(()=>{zo&&(zo.style.opacity="1")},Wa+1e3),Wa+=100}})};if(Je.value&&R.adverts.length>0)try{const Ya=Xn(R.adverts);Ni(Ya);const ao=Math.min(14,It.getZoom());It.setZoom(ao),setTimeout(()=>{try{ma()}catch(Wa){console.warn("Error updating clusters:",Wa),ml(Nn,si)}},100),It.on("moveend",()=>{try{ma()}catch(Wa){console.warn("Error updating clusters on move:",Wa)}}),It.on("zoomend",()=>{try{ma()}catch(Wa){console.warn("Error updating clusters on zoom:",Wa)}})}catch(Ya){console.warn("Error initializing clustering:",Ya),ml(Nn,si)}else ml(Nn,si);setTimeout(()=>{It&&It.invalidateSize()},1e3)}catch(Hn){console.error("Error initializing map:",Hn)}};return s({highlightNode:Nn=>{const si=jt.value.get(Nn);if(si){const Hn=si.getElement();if(Hn){const Vn=Hn.querySelector("div");Vn&&Vn.classList.add("marker-highlight")}}},unhighlightNode:Nn=>{const si=jt.value.get(Nn);if(si){const Hn=si.getElement();if(Hn){const Vn=Hn.querySelector("div");Vn&&Vn.classList.remove("marker-highlight")}}},initializeOpenStreetMap:zi}),Em(()=>R.adverts,()=>{It&&wr.value&&setTimeout(()=>{zi()},100)},{immediate:!1}),op(()=>{wr.value&&R.adverts.length>0&&setTimeout(()=>{zi()},300)}),Oy(()=>{Dn()}),(Nn,si)=>(ii(),gi("div",Sst,[wr.value?(ii(),gi("div",{key:1,ref_key:"mapContainer",ref:_t,class:"leaflet-map-container h-96 w-full bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden",style:{"min-height":"384px",position:"relative"}},null,512)):(ii(),gi("div",Est,si[0]||(si[0]=[Tf('
No valid coordinates available
Configure base station location to view map
',1)]))),wr.value&&Nn.adverts.length>0?(ii(),gi("button",{key:2,onClick:dt,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[si[1]||(si[1]=oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),oe("span",Cst,mi(Nn.showLegend?"Hide":"Show"),1)])):Oo("",!0),wr.value&&Nn.adverts.length>0&&Nn.showLegend?(ii(),gi("div",Lst,[si[2]||(si[2]=Tf('
',2)),oe("div",Pst,mi(Nn.adverts.length)+" node"+mi(Nn.adverts.length!==1?"s":"")+" visible ",1)])):Oo("",!0),wr.value?(ii(),gi("div",Ist," © OpenStreetMap contributors © CARTO ")):Oo("",!0)]))}}),Ost=Bf(zst,[["__scopeId","data-v-9c7dd490"]]),Dst={class:"relative","data-menu-container":""},oP=Ec({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(d,{emit:s}){const E=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Tr=>{if(E.activeMenu&&E.activeMenu!==Tr)try{E.activeMenu.closeMenu()}catch(wr){console.warn("Error closing previous menu:",wr)}E.activeMenu=Tr}};window.__neighborMenuManager=E;const R=d,K=s,dt=ja(!1),_t=ja(),It=ja({top:0,left:0}),jt=()=>{dt.value=!1,document.removeEventListener("click",Le,!0),document.removeEventListener("keydown",Je),E.activeMenu===te&&(E.activeMenu=null)},te={closeMenu:jt},le=()=>{jt(),K("delete",R.neighbor)},Le=Tr=>{Tr.target.closest("[data-menu-container]")||jt()},Je=Tr=>{Tr.key==="Escape"&&jt()},fr=async()=>{if(!dt.value&&_t.value){E.setActiveMenu(te);const Tr=_t.value.getBoundingClientRect(),wr=window.innerWidth,Vr=144,fn=wr<1024,Dt=Tr.left+Vr>wr-16;let un=Tr.left;fn&&Dt&&(un=Tr.right-Vr),un=Math.max(8,un),It.value={top:Tr.bottom+4,left:un},dt.value=!0,await S0(),document.addEventListener("click",Le,!0),document.addEventListener("keydown",Je)}else jt()};return Oy(()=>{jt()}),(Tr,wr)=>(ii(),gi("div",Dst,[oe("button",{ref_key:"buttonRef",ref:_t,onClick:fr,class:ko(["p-1 rounded hover:bg-white/10 transition-colors text-white/60 hover:text-white/80",{"bg-white/10 text-white/80":dt.value}]),"data-menu-container":""},wr[0]||(wr[0]=[oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(ii(),Y0(QA,{to:"body"},[dt.value?(ii(),gi("div",{key:0,class:"fixed w-36 bg-dark-card/90 backdrop-blur-lg border border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:G0({top:It.value.top+"px",left:It.value.left+"px"}),"data-menu-container":""},[oe("div",{class:"py-2"},[oe("button",{onClick:le,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},wr[1]||(wr[1]=[oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),oe("span",{class:"font-medium"},"Delete",-1)]))])],4)):Oo("",!0)]))]))}}),Fst={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Bst={class:"flex items-center justify-between mb-4"},Rst={class:"flex items-center gap-3"},Nst={class:"text-white text-lg font-semibold"},jst={class:"bg-white/10 text-white text-xs px-2 py-1 rounded-full"},Ust={key:0,class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 p-1"},Vst={class:"hidden lg:block overflow-x-auto"},Hst={class:"w-full"},Wst={class:"bg-dark-bg/50"},qst={class:"bg-dark-bg/30"},$st=["onMouseenter","onMouseleave"],Zst=["onClick","title"],Gst={key:0,class:"ml-1 text-xs"},Yst={key:0,class:"flex items-center gap-3"},Kst={class:"text-white/70"},Xst={class:"flex gap-1"},Jst=["onClick"],Qst=["onClick"],tlt={key:1,class:"text-dark-text"},elt={class:"flex items-center gap-2"},rlt={class:"flex items-end gap-0.5"},nlt={class:"flex items-center gap-2"},ilt=["title"],alt=["title"],olt={class:"lg:hidden space-y-3"},slt=["onClick"],llt={class:"flex items-center justify-between mb-3"},ult={class:"flex items-center gap-3"},clt={class:"text-white font-medium text-base"},hlt={class:"grid grid-cols-1 gap-3"},flt={class:"grid grid-cols-2 gap-4"},dlt=["onClick","title"],plt={key:0,class:"ml-1 text-xs"},mlt={class:"flex items-center gap-2 justify-end"},glt={class:"flex items-end gap-0.5"},vlt={class:"grid grid-cols-2 gap-4"},ylt={class:"flex items-center gap-2"},xlt=["title"],_lt={class:"text-white text-sm block text-right"},blt={key:0,class:"border-t border-white/10 pt-3"},wlt={class:"flex items-center justify-between"},klt={class:"text-white/70 text-sm font-mono"},Tlt={class:"flex gap-2"},Alt=["onClick"],Mlt=["onClick"],Slt={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},Elt={class:"text-center"},Clt={class:"text-white text-sm font-medium"},Llt={class:"text-center"},Plt={class:"text-white text-sm font-medium"},Ilt={class:"text-center"},zlt=["title"],Olt=Ec({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(d,{emit:s}){const E=ja(null),R=d,K=s,dt=qr=>new Date(qr*1e3).toLocaleString(),_t=qr=>`${qr.slice(0,4)}...${qr.slice(-4)}`,It=qr=>{switch(qr){case 2:return{text:"Direct",bgColor:"bg-green-500/20",borderColor:"border-green-400/30",textColor:"text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-600/20",borderColor:"border-green-500/30",textColor:"text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-500/20",borderColor:"border-yellow-400/30",textColor:"text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-500/20",borderColor:"border-orange-400/30",textColor:"text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},jt=qr=>qr?`${qr} dBm`:"N/A",te=qr=>qr?`${qr} dB`:"N/A",le=(qr,Si,Nn,si)=>{const Vn=(Nn-qr)*Math.PI/180,sa=(si-Si)*Math.PI/180,Ti=Math.sin(Vn/2)*Math.sin(Vn/2)+Math.cos(qr*Math.PI/180)*Math.cos(Nn*Math.PI/180)*Math.sin(sa/2)*Math.sin(sa/2);return 6371*(2*Math.atan2(Math.sqrt(Ti),Math.sqrt(1-Ti)))},Le=qr=>R.baseLatitude===null||R.baseLongitude===null||qr.latitude===null||qr.longitude===null?"N/A":`${le(R.baseLatitude,R.baseLongitude,qr.latitude,qr.longitude).toFixed(1)} km`,Je=async qr=>{try{return await navigator.clipboard.writeText(qr),!0}catch{const Si=document.createElement("textarea");return Si.value=qr,document.body.appendChild(Si),Si.select(),document.execCommand("copy"),document.body.removeChild(Si),!0}},fr=qr=>{const Si=Date.now(),Nn=qr*1e3,si=Si-Nn,Hn=Math.floor(si/1e3),Vn=Math.floor(Hn/60),sa=Math.floor(Vn/60),Ti=Math.floor(sa/24);return Hn<60?`${Hn}s ago`:Vn<60?`${Vn}m ago`:sa<24?`${sa}h ago`:`${Ti}d ago`},Tr=qr=>{const Si=Date.now(),Nn=qr*1e3,si=Si-Nn,Hn=Math.floor(si/(1e3*60*60));return Hn<1?{color:"text-green-400"}:Hn<26?{color:"text-yellow-400"}:{color:"text-red-400"}},wr=async(qr,Si)=>{const Nn=`${qr.toFixed(6)}, ${Si.toFixed(6)}`;await Je(Nn)},Vr=(qr,Si)=>{const Nn=`https://www.google.com/maps?q=${qr},${Si}`;window.open(Nn,"_blank")},fn=async qr=>{await Je(qr),E.value=qr,setTimeout(()=>{E.value=null},2e3)},Dt=qr=>qr?qr>=-50?{bars:5,color:"text-green-400"}:qr>=-60?{bars:4,color:"text-green-300"}:qr>=-70?{bars:3,color:"text-yellow-400"}:qr>=-80?{bars:2,color:"text-orange-400"}:qr>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}:{bars:0,color:"text-gray-400"},un=()=>R.isCompactView?"py-2 px-2":"py-4 px-3",Qn=()=>{K("toggle-view")},Dn=qr=>{K("highlight-node",qr)},Xn=qr=>{K("unhighlight-node",qr)},Ni=qr=>{K("menu-ping",qr)},zi=qr=>{K("menu-delete",qr)};return(qr,Si)=>(ii(),gi("div",Fst,[oe("div",Bst,[oe("div",Rst,[oe("div",{class:"w-3 h-3 rounded-full border border-white/20",style:G0({backgroundColor:qr.color})},null,4),oe("h3",Nst,mi(qr.contactType),1),oe("span",jst,mi(qr.adverts.length),1)]),qr.isFirstTable&&qr.showViewToggle?(ii(),gi("div",Ust,[oe("button",{onClick:Qn,class:ko(["p-2 rounded-md transition-colors",qr.isCompactView?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},Si[0]||(Si[0]=[oe("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),oe("button",{onClick:Qn,class:ko(["p-2 rounded-md transition-colors",qr.isCompactView?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},Si[1]||(Si[1]=[oe("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)])):Oo("",!0)]),oe("div",Vst,[oe("table",Hst,[oe("thead",null,[oe("tr",Wst,[oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},null,2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Node Name",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Public Key",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Location",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Distance",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Route Type",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"RSSI",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"SNR",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Last Seen",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"First Seen",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${un().split(" ")[1]} border-b border-white/5`)},"Advert Count",2)])]),oe("tbody",qst,[(ii(!0),gi(cu,null,Yc(qr.adverts,Nn=>(ii(),gi("tr",{key:Nn.id,class:"hover:bg-white/5 transition-colors",onMouseenter:si=>Dn(Nn.pubkey),onMouseleave:si=>Xn(Nn.pubkey)},[oe("td",{class:ko(un())},[Al(oP,{neighbor:Nn,onPing:Ni,onDelete:zi},null,8,["neighbor"])],2),oe("td",{class:ko(`${un()} text-white text-sm`)},mi(Nn.node_name||"Unknown"),3),oe("td",{class:ko(`${un()} text-white text-sm font-mono`)},[oe("button",{onClick:si=>fn(Nn.pubkey),class:ko(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",E.value===Nn.pubkey?"text-green-400 decoration-green-400/60":""]),title:E.value===Nn.pubkey?"Copied!":"Click to copy full public key"},[Zu(mi(_t(Nn.pubkey))+" ",1),E.value===Nn.pubkey?(ii(),gi("span",Gst,"✓")):Oo("",!0)],10,Zst)],2),oe("td",{class:ko(`${un()} text-white text-sm`)},[Nn.latitude!==null&&Nn.longitude!==null?(ii(),gi("div",Yst,[oe("span",Kst,mi(Nn.latitude.toFixed(4))+", "+mi(Nn.longitude.toFixed(4)),1),oe("div",Xst,[oe("button",{onClick:si=>wr(Nn.latitude,Nn.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},Si[2]||(Si[2]=[oe("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),oe("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Jst),oe("button",{onClick:si=>Vr(Nn.latitude,Nn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},Si[3]||(Si[3]=[oe("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),oe("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Qst)])])):(ii(),gi("span",tlt,"Unknown"))],2),oe("td",{class:ko(`${un()} text-white text-sm`)},mi(Le(Nn)),3),oe("td",{class:ko(`${un()} text-white text-sm`)},[oe("span",{class:ko(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",It(Nn.route_type).bgColor,It(Nn.route_type).borderColor,It(Nn.route_type).textColor])},mi(It(Nn.route_type).text),3)],2),oe("td",{class:ko(`${un()} text-white text-sm`)},[oe("div",elt,[oe("div",rlt,[(ii(),gi(cu,null,Yc(5,si=>oe("div",{key:si,class:ko(["w-1 transition-colors",si<=Dt(Nn.rssi).bars?Dt(Nn.rssi).color:"text-gray-600"]),style:G0({height:`${4+si*2}px`})},Si[4]||(Si[4]=[oe("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),oe("span",{class:ko(Dt(Nn.rssi).color)},mi(jt(Nn.rssi)),3)])],2),oe("td",{class:ko(`${un()} text-white text-sm`)},mi(te(Nn.snr)),3),oe("td",{class:ko(`${un()} text-white text-sm`)},[oe("div",nlt,[oe("div",{class:ko(["w-2 h-2 rounded-full",Tr(Nn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Nn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Nn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),oe("span",{class:ko([Tr(Nn.last_seen).color,"cursor-help"]),title:dt(Nn.last_seen)},mi(fr(Nn.last_seen)),11,ilt)])],2),oe("td",{class:ko(`${un()} text-white text-sm`)},[oe("span",{title:dt(Nn.first_seen),class:"cursor-help"},mi(fr(Nn.first_seen)),9,alt)],2),oe("td",{class:ko(`${un()} text-white text-sm text-center`)},mi(Nn.advert_count),3)],40,$st))),128))])])]),oe("div",olt,[(ii(!0),gi(cu,null,Yc(qr.adverts,Nn=>(ii(),gi("div",{key:Nn.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:si=>Dn(Nn.pubkey)},[oe("div",llt,[oe("div",ult,[oe("h4",clt,mi(Nn.node_name||"Unknown Node"),1),oe("span",{class:ko(["inline-block px-2 py-1 rounded-full text-xs border",It(Nn.route_type).bgColor,It(Nn.route_type).borderColor,It(Nn.route_type).textColor])},mi(It(Nn.route_type).text),3)]),Al(oP,{neighbor:Nn,onPing:Ni,onDelete:zi},null,8,["neighbor"])]),oe("div",hlt,[oe("div",flt,[oe("div",null,[Si[5]||(Si[5]=oe("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),oe("button",{onClick:si=>fn(Nn.pubkey),class:ko(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",E.value===Nn.pubkey?"text-green-400 decoration-green-400/60":""]),title:E.value===Nn.pubkey?"Copied!":"Click to copy full public key"},[Zu(mi(_t(Nn.pubkey))+" ",1),E.value===Nn.pubkey?(ii(),gi("span",plt,"✓")):Oo("",!0)],10,dlt)]),oe("div",null,[Si[7]||(Si[7]=oe("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),oe("div",mlt,[oe("div",glt,[(ii(),gi(cu,null,Yc(5,si=>oe("div",{key:si,class:ko(["w-1.5 transition-colors",si<=Dt(Nn.rssi).bars?Dt(Nn.rssi).color:"text-gray-600"]),style:G0({height:`${6+si*2}px`})},Si[6]||(Si[6]=[oe("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),oe("span",{class:ko(`${Dt(Nn.rssi).color} text-sm font-medium`)},mi(jt(Nn.rssi)),3)])])]),oe("div",vlt,[oe("div",null,[Si[8]||(Si[8]=oe("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),oe("div",ylt,[oe("div",{class:ko(["w-2 h-2 rounded-full",Tr(Nn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Nn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Nn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),oe("span",{class:ko(`${Tr(Nn.last_seen).color} text-sm`),title:dt(Nn.last_seen)},mi(fr(Nn.last_seen)),11,xlt)])]),oe("div",null,[Si[9]||(Si[9]=oe("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),oe("span",_lt,mi(Le(Nn)),1)])]),Nn.latitude!==null&&Nn.longitude!==null?(ii(),gi("div",blt,[Si[12]||(Si[12]=oe("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),oe("div",wlt,[oe("span",klt,mi(Nn.latitude.toFixed(4))+", "+mi(Nn.longitude.toFixed(4)),1),oe("div",Tlt,[oe("button",{onClick:si=>wr(Nn.latitude,Nn.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},Si[10]||(Si[10]=[oe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),oe("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Alt),oe("button",{onClick:si=>Vr(Nn.latitude,Nn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},Si[11]||(Si[11]=[oe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),oe("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Mlt)])])])):Oo("",!0),oe("div",Slt,[oe("div",Elt,[Si[13]||(Si[13]=oe("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),oe("span",Clt,mi(te(Nn.snr)),1)]),oe("div",Llt,[Si[14]||(Si[14]=oe("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),oe("span",Plt,mi(Nn.advert_count),1)]),oe("div",Ilt,[Si[15]||(Si[15]=oe("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),oe("span",{class:"text-white text-sm",title:dt(Nn.first_seen)},mi(fr(Nn.first_seen)),9,zlt)])])])],8,slt))),128))])]))}}),Dlt={class:"space-y-6"},Flt={key:0,class:"flex items-center justify-center py-12"},Blt={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Rlt={class:"flex items-center gap-3"},Nlt={class:"text-accent-red/80 text-sm"},jlt={key:0,class:"text-center py-12"},Ult=Ec({name:"NeighborsView",__name:"Neighbors",setup(d){const s=Dm(),E={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},R={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},K=ja({}),dt=ja(!0),_t=ja(null),It=ja(!1),jt=ja(typeof window<"u"?window.innerWidth>=1024:!0),te=ja(!1),le=ja(null),Le=qo(()=>{if(!le.value)return null;const qr=le.value;return{id:qr.id,pubkey:qr.pubkey,node_name:qr.node_name,contact_type:qr.contact_type,latitude:qr.latitude,longitude:qr.longitude,rssi:qr.rssi,snr:qr.snr,route_type:qr.route_type,last_seen:qr.last_seen,first_seen:qr.first_seen,advert_count:qr.advert_count,timestamp:qr.timestamp,is_repeater:qr.is_repeater,is_new_neighbor:qr.is_new_neighbor}}),Je=qo(()=>s.stats?.config?.repeater?.latitude),fr=qo(()=>s.stats?.config?.repeater?.longitude),Tr=qo(()=>Object.entries(E).filter(([qr])=>K.value[qr]?.length>0).sort(([qr],[Si])=>parseInt(qr)-parseInt(Si))),wr=qo(()=>Object.values(K.value).flat().filter(qr=>{const Si=qr.latitude,Nn=qr.longitude;return Si!=null&&Si!==0&&Nn!==null&&Nn!==void 0&&Nn!==0&&typeof Si=="number"&&typeof Nn=="number"&&!isNaN(Si)&&!isNaN(Nn)})),Vr=async qr=>{try{const Si=await oh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(qr)}&hours=168`);return Si.success&&Array.isArray(Si.data)?Si.data:[]}catch(Si){return console.error(`Error fetching adverts for contact type ${qr}:`,Si),[]}},fn=async()=>{dt.value=!0,_t.value=null;try{K.value={};for(const[qr,Si]of Object.entries(E)){const Nn=await Vr(Si);Nn.length>0&&(K.value[qr]=Nn)}}catch(qr){console.error("Error loading adverts:",qr),_t.value=qr instanceof Error?qr.message:"Failed to load neighbor data"}finally{dt.value=!1}},Dt=ja(),un=qr=>{Dt.value?.highlightNode(qr)},Qn=qr=>{Dt.value?.unhighlightNode(qr)},Dn=async qr=>{const Si=qr;try{const Nn=await oh.post("/ping_neighbor",{pubkey:Si.pubkey});Nn.success?console.log("Ping sent successfully"):console.error("Failed to ping neighbor:",Nn.error)}catch(Nn){console.error("Error pinging neighbor:",Nn)}},Xn=qr=>{le.value=qr,te.value=!0},Ni=()=>{te.value=!1,le.value=null},zi=async qr=>{try{await oh.deleteAdvert(qr),await fn(),Ni()}catch(Si){console.error("Error deleting neighbor:",Si)}};return op(async()=>{await fn()}),(qr,Si)=>(ii(),gi("div",Dlt,[dt.value?(ii(),gi("div",Flt,Si[2]||(Si[2]=[oe("div",{class:"text-center"},[oe("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),oe("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):_t.value?(ii(),gi("div",Blt,[oe("div",Rlt,[Si[4]||(Si[4]=oe("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),oe("div",null,[Si[3]||(Si[3]=oe("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),oe("p",Nlt,mi(_t.value),1)])])])):(ii(),gi(cu,{key:2},[Al(Ost,{ref_key:"networkMapRef",ref:Dt,adverts:wr.value,"base-latitude":Je.value,"base-longitude":fr.value,"show-legend":jt.value,"onUpdate:showLegend":Si[0]||(Si[0]=Nn=>jt.value=Nn)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),(ii(!0),gi(cu,null,Yc(Tr.value,([Nn,si])=>(ii(),gi("div",{key:Nn,class:"space-y-6"},[Al(Olt,{"contact-type":si,"contact-type-key":Nn,adverts:K.value[Nn],color:R[parseInt(Nn)],"base-latitude":Je.value,"base-longitude":fr.value,"is-compact-view":It.value,"is-first-table":Nn===Tr.value[0]?.[0],"show-view-toggle":Tr.value.length>0,onHighlightNode:un,onUnhighlightNode:Qn,onMenuPing:Dn,onMenuDelete:Xn,onToggleView:Si[1]||(Si[1]=Hn=>It.value=!It.value)},null,8,["contact-type","contact-type-key","adverts","color","base-latitude","base-longitude","is-compact-view","is-first-table","show-view-toggle"])]))),128)),Tr.value.length===0?(ii(),gi("div",jlt,[Si[5]||(Si[5]=Tf('
No Neighbors Found
No mesh neighbors have been discovered in your area yet.
',3)),oe("button",{onClick:fn,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):Oo("",!0)],64)),Al(xst,{show:te.value,neighbor:Le.value,onClose:Ni,onDelete:zi},null,8,["show","neighbor"])]))}});/*!
+ `);jt.value.set($a.pubkey,Jo);const Oo=Jo.getElement();Oo&&(Oo.style.opacity="0",Oo.style.transition="opacity 0.5s ease-out"),di($a,Ya,ao,Ca,Wa),setTimeout(()=>{Oo&&(Oo.style.opacity="1")},Wa+1e3),Wa+=100}})};if(tr.value&&B.adverts.length>0)try{const Ya=Qn(B.adverts);Ri(Ya);const ao=Math.min(14,It.getZoom());It.setZoom(ao),setTimeout(()=>{try{ma()}catch(Wa){console.warn("Error updating clusters:",Wa),ml(On,ei)}},100),It.on("moveend",()=>{try{ma()}catch(Wa){console.warn("Error updating clusters on move:",Wa)}}),It.on("zoomend",()=>{try{ma()}catch(Wa){console.warn("Error updating clusters on zoom:",Wa)}})}catch(Ya){console.warn("Error initializing clustering:",Ya),ml(On,ei)}else ml(On,ei);setTimeout(()=>{It&&It.invalidateSize()},1e3)}catch(Fn){console.error("Error initializing map:",Fn)}};return s({highlightNode:On=>{const ei=jt.value.get(On);if(ei){const Fn=ei.getElement();if(Fn){const Vn=Fn.querySelector("div");Vn&&Vn.classList.add("marker-highlight")}}},unhighlightNode:On=>{const ei=jt.value.get(On);if(ei){const Fn=ei.getElement();if(Fn){const Vn=Fn.querySelector("div");Vn&&Vn.classList.remove("marker-highlight")}}},initializeOpenStreetMap:$i}),Cm(()=>B.adverts,()=>{It&&xr.value&&setTimeout(()=>{$i()},100)},{immediate:!1}),op(()=>{xr.value&&B.adverts.length>0&&setTimeout(()=>{$i()},300)}),Oy(()=>{Hn()}),(On,ei)=>(ii(),mi("div",Pst,[xr.value?(ii(),mi("div",{key:1,ref_key:"mapContainer",ref:_t,class:"leaflet-map-container h-96 w-full bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden",style:{"min-height":"384px",position:"relative"}},null,512)):(ii(),mi("div",Ist,ei[0]||(ei[0]=[Tf('
No valid coordinates available
Configure base station location to view map
',1)]))),xr.value&&On.adverts.length>0?(ii(),mi("button",{key:2,onClick:dt,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[ei[1]||(ei[1]=oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),oe("span",zst,pi(On.showLegend?"Hide":"Show"),1)])):Po("",!0),xr.value&&On.adverts.length>0&&On.showLegend?(ii(),mi("div",Ost,[ei[2]||(ei[2]=Tf('
',2)),oe("div",Dst,pi(On.adverts.length)+" node"+pi(On.adverts.length!==1?"s":"")+" visible ",1)])):Po("",!0),xr.value?(ii(),mi("div",Fst," © OpenStreetMap contributors © CARTO ")):Po("",!0)]))}}),Bst=Rf(Rst,[["__scopeId","data-v-9c7dd490"]]),Nst={class:"relative","data-menu-container":""},oP=Ec({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(d,{emit:s}){const E=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Mr=>{if(E.activeMenu&&E.activeMenu!==Mr)try{E.activeMenu.closeMenu()}catch(xr){console.warn("Error closing previous menu:",xr)}E.activeMenu=Mr}};window.__neighborMenuManager=E;const B=d,K=s,dt=ja(!1),_t=ja(),It=ja({top:0,left:0}),jt=()=>{dt.value=!1,document.removeEventListener("click",we,!0),document.removeEventListener("keydown",tr),E.activeMenu===re&&(E.activeMenu=null)},re={closeMenu:jt},se=()=>{jt(),K("delete",B.neighbor)},we=Mr=>{Mr.target.closest("[data-menu-container]")||jt()},tr=Mr=>{Mr.key==="Escape"&&jt()},fr=async()=>{if(!dt.value&&_t.value){E.setActiveMenu(re);const Mr=_t.value.getBoundingClientRect(),xr=window.innerWidth,Dr=144,hn=xr<1024,Dt=Mr.left+Dr>xr-16;let on=Mr.left;hn&&Dt&&(on=Mr.right-Dr),on=Math.max(8,on),It.value={top:Mr.bottom+4,left:on},dt.value=!0,await S0(),document.addEventListener("click",we,!0),document.addEventListener("keydown",tr)}else jt()};return Oy(()=>{jt()}),(Mr,xr)=>(ii(),mi("div",Nst,[oe("button",{ref_key:"buttonRef",ref:_t,onClick:fr,class:ko(["p-1 rounded hover:bg-white/10 transition-colors text-white/60 hover:text-white/80",{"bg-white/10 text-white/80":dt.value}]),"data-menu-container":""},xr[0]||(xr[0]=[oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(ii(),Y0(QA,{to:"body"},[dt.value?(ii(),mi("div",{key:0,class:"fixed w-36 bg-dark-card/90 backdrop-blur-lg border border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:G0({top:It.value.top+"px",left:It.value.left+"px"}),"data-menu-container":""},[oe("div",{class:"py-2"},[oe("button",{onClick:se,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},xr[1]||(xr[1]=[oe("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),oe("span",{class:"font-medium"},"Delete",-1)]))])],4)):Po("",!0)]))]))}}),jst={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Ust={class:"flex items-center justify-between mb-4"},Vst={class:"flex items-center gap-3"},Hst={class:"text-white text-lg font-semibold"},Wst={class:"bg-white/10 text-white text-xs px-2 py-1 rounded-full"},qst={key:0,class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 p-1"},$st={class:"hidden lg:block overflow-x-auto"},Zst={class:"w-full"},Gst={class:"bg-dark-bg/50"},Yst={class:"bg-dark-bg/30"},Kst=["onMouseenter","onMouseleave"],Xst=["onClick","title"],Jst={key:0,class:"ml-1 text-xs"},Qst={key:0,class:"flex items-center gap-3"},tlt={class:"text-white/70"},elt={class:"flex gap-1"},rlt=["onClick"],nlt=["onClick"],ilt={key:1,class:"text-dark-text"},alt={class:"flex items-center gap-2"},olt={class:"flex items-end gap-0.5"},slt={class:"flex items-center gap-2"},llt=["title"],ult=["title"],clt={class:"lg:hidden space-y-3"},hlt=["onClick"],flt={class:"flex items-center justify-between mb-3"},dlt={class:"flex items-center gap-3"},plt={class:"text-white font-medium text-base"},mlt={class:"grid grid-cols-1 gap-3"},glt={class:"grid grid-cols-2 gap-4"},vlt=["onClick","title"],ylt={key:0,class:"ml-1 text-xs"},xlt={class:"flex items-center gap-2 justify-end"},_lt={class:"flex items-end gap-0.5"},blt={class:"grid grid-cols-2 gap-4"},wlt={class:"flex items-center gap-2"},klt=["title"],Tlt={class:"text-white text-sm block text-right"},Alt={key:0,class:"border-t border-white/10 pt-3"},Mlt={class:"flex items-center justify-between"},Slt={class:"text-white/70 text-sm font-mono"},Elt={class:"flex gap-2"},Clt=["onClick"],Llt=["onClick"],Plt={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},Ilt={class:"text-center"},zlt={class:"text-white text-sm font-medium"},Olt={class:"text-center"},Dlt={class:"text-white text-sm font-medium"},Flt={class:"text-center"},Rlt=["title"],Blt=Ec({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(d,{emit:s}){const E=ja(null),B=d,K=s,dt=qr=>new Date(qr*1e3).toLocaleString(),_t=qr=>`${qr.slice(0,4)}...${qr.slice(-4)}`,It=qr=>{switch(qr){case 2:return{text:"Direct",bgColor:"bg-green-500/20",borderColor:"border-green-400/30",textColor:"text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-600/20",borderColor:"border-green-500/30",textColor:"text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-500/20",borderColor:"border-yellow-400/30",textColor:"text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-500/20",borderColor:"border-orange-400/30",textColor:"text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},jt=qr=>qr?`${qr} dBm`:"N/A",re=qr=>qr?`${qr} dB`:"N/A",se=(qr,ci,On,ei)=>{const Vn=(On-qr)*Math.PI/180,sa=(ei-ci)*Math.PI/180,Ai=Math.sin(Vn/2)*Math.sin(Vn/2)+Math.cos(qr*Math.PI/180)*Math.cos(On*Math.PI/180)*Math.sin(sa/2)*Math.sin(sa/2);return 6371*(2*Math.atan2(Math.sqrt(Ai),Math.sqrt(1-Ai)))},we=qr=>B.baseLatitude===null||B.baseLongitude===null||qr.latitude===null||qr.longitude===null?"N/A":`${se(B.baseLatitude,B.baseLongitude,qr.latitude,qr.longitude).toFixed(1)} km`,tr=async qr=>{try{return await navigator.clipboard.writeText(qr),!0}catch{const ci=document.createElement("textarea");return ci.value=qr,document.body.appendChild(ci),ci.select(),document.execCommand("copy"),document.body.removeChild(ci),!0}},fr=qr=>{const ci=Date.now(),On=qr*1e3,ei=ci-On,Fn=Math.floor(ei/1e3),Vn=Math.floor(Fn/60),sa=Math.floor(Vn/60),Ai=Math.floor(sa/24);return Fn<60?`${Fn}s ago`:Vn<60?`${Vn}m ago`:sa<24?`${sa}h ago`:`${Ai}d ago`},Mr=qr=>{const ci=Date.now(),On=qr*1e3,ei=ci-On,Fn=Math.floor(ei/(1e3*60*60));return Fn<1?{color:"text-green-400"}:Fn<26?{color:"text-yellow-400"}:{color:"text-red-400"}},xr=async(qr,ci)=>{const On=`${qr.toFixed(6)}, ${ci.toFixed(6)}`;await tr(On)},Dr=(qr,ci)=>{const On=`https://www.google.com/maps?q=${qr},${ci}`;window.open(On,"_blank")},hn=async qr=>{await tr(qr),E.value=qr,setTimeout(()=>{E.value=null},2e3)},Dt=qr=>qr?qr>=-50?{bars:5,color:"text-green-400"}:qr>=-60?{bars:4,color:"text-green-300"}:qr>=-70?{bars:3,color:"text-yellow-400"}:qr>=-80?{bars:2,color:"text-orange-400"}:qr>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}:{bars:0,color:"text-gray-400"},on=()=>B.isCompactView?"py-2 px-2":"py-4 px-3",Xn=()=>{K("toggle-view")},Hn=qr=>{K("highlight-node",qr)},Qn=qr=>{K("unhighlight-node",qr)},Ri=qr=>{K("menu-ping",qr)},$i=qr=>{K("menu-delete",qr)};return(qr,ci)=>(ii(),mi("div",jst,[oe("div",Ust,[oe("div",Vst,[oe("div",{class:"w-3 h-3 rounded-full border border-white/20",style:G0({backgroundColor:qr.color})},null,4),oe("h3",Hst,pi(qr.contactType),1),oe("span",Wst,pi(qr.adverts.length),1)]),qr.isFirstTable&&qr.showViewToggle?(ii(),mi("div",qst,[oe("button",{onClick:Xn,class:ko(["p-2 rounded-md transition-colors",qr.isCompactView?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},ci[0]||(ci[0]=[oe("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),oe("button",{onClick:Xn,class:ko(["p-2 rounded-md transition-colors",qr.isCompactView?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},ci[1]||(ci[1]=[oe("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),oe("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)])):Po("",!0)]),oe("div",$st,[oe("table",Zst,[oe("thead",null,[oe("tr",Gst,[oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},null,2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Node Name",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Public Key",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Location",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Distance",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Route Type",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"RSSI",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"SNR",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Last Seen",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"First Seen",2),oe("th",{class:ko(`text-left text-dark-text text-xs font-medium py-3 ${on().split(" ")[1]} border-b border-white/5`)},"Advert Count",2)])]),oe("tbody",Yst,[(ii(!0),mi(cu,null,Yc(qr.adverts,On=>(ii(),mi("tr",{key:On.id,class:"hover:bg-white/5 transition-colors",onMouseenter:ei=>Hn(On.pubkey),onMouseleave:ei=>Qn(On.pubkey)},[oe("td",{class:ko(on())},[Al(oP,{neighbor:On,onPing:Ri,onDelete:$i},null,8,["neighbor"])],2),oe("td",{class:ko(`${on()} text-white text-sm`)},pi(On.node_name||"Unknown"),3),oe("td",{class:ko(`${on()} text-white text-sm font-mono`)},[oe("button",{onClick:ei=>hn(On.pubkey),class:ko(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",E.value===On.pubkey?"text-green-400 decoration-green-400/60":""]),title:E.value===On.pubkey?"Copied!":"Click to copy full public key"},[Ru(pi(_t(On.pubkey))+" ",1),E.value===On.pubkey?(ii(),mi("span",Jst,"✓")):Po("",!0)],10,Xst)],2),oe("td",{class:ko(`${on()} text-white text-sm`)},[On.latitude!==null&&On.longitude!==null?(ii(),mi("div",Qst,[oe("span",tlt,pi(On.latitude.toFixed(4))+", "+pi(On.longitude.toFixed(4)),1),oe("div",elt,[oe("button",{onClick:ei=>xr(On.latitude,On.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},ci[2]||(ci[2]=[oe("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),oe("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,rlt),oe("button",{onClick:ei=>Dr(On.latitude,On.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},ci[3]||(ci[3]=[oe("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),oe("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,nlt)])])):(ii(),mi("span",ilt,"Unknown"))],2),oe("td",{class:ko(`${on()} text-white text-sm`)},pi(we(On)),3),oe("td",{class:ko(`${on()} text-white text-sm`)},[oe("span",{class:ko(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",It(On.route_type).bgColor,It(On.route_type).borderColor,It(On.route_type).textColor])},pi(It(On.route_type).text),3)],2),oe("td",{class:ko(`${on()} text-white text-sm`)},[oe("div",alt,[oe("div",olt,[(ii(),mi(cu,null,Yc(5,ei=>oe("div",{key:ei,class:ko(["w-1 transition-colors",ei<=Dt(On.rssi).bars?Dt(On.rssi).color:"text-gray-600"]),style:G0({height:`${4+ei*2}px`})},ci[4]||(ci[4]=[oe("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),oe("span",{class:ko(Dt(On.rssi).color)},pi(jt(On.rssi)),3)])],2),oe("td",{class:ko(`${on()} text-white text-sm`)},pi(re(On.snr)),3),oe("td",{class:ko(`${on()} text-white text-sm`)},[oe("div",slt,[oe("div",{class:ko(["w-2 h-2 rounded-full",Mr(On.last_seen).color==="text-green-400"?"bg-green-400":"",Mr(On.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Mr(On.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),oe("span",{class:ko([Mr(On.last_seen).color,"cursor-help"]),title:dt(On.last_seen)},pi(fr(On.last_seen)),11,llt)])],2),oe("td",{class:ko(`${on()} text-white text-sm`)},[oe("span",{title:dt(On.first_seen),class:"cursor-help"},pi(fr(On.first_seen)),9,ult)],2),oe("td",{class:ko(`${on()} text-white text-sm text-center`)},pi(On.advert_count),3)],40,Kst))),128))])])]),oe("div",clt,[(ii(!0),mi(cu,null,Yc(qr.adverts,On=>(ii(),mi("div",{key:On.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:ei=>Hn(On.pubkey)},[oe("div",flt,[oe("div",dlt,[oe("h4",plt,pi(On.node_name||"Unknown Node"),1),oe("span",{class:ko(["inline-block px-2 py-1 rounded-full text-xs border",It(On.route_type).bgColor,It(On.route_type).borderColor,It(On.route_type).textColor])},pi(It(On.route_type).text),3)]),Al(oP,{neighbor:On,onPing:Ri,onDelete:$i},null,8,["neighbor"])]),oe("div",mlt,[oe("div",glt,[oe("div",null,[ci[5]||(ci[5]=oe("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),oe("button",{onClick:ei=>hn(On.pubkey),class:ko(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",E.value===On.pubkey?"text-green-400 decoration-green-400/60":""]),title:E.value===On.pubkey?"Copied!":"Click to copy full public key"},[Ru(pi(_t(On.pubkey))+" ",1),E.value===On.pubkey?(ii(),mi("span",ylt,"✓")):Po("",!0)],10,vlt)]),oe("div",null,[ci[7]||(ci[7]=oe("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),oe("div",xlt,[oe("div",_lt,[(ii(),mi(cu,null,Yc(5,ei=>oe("div",{key:ei,class:ko(["w-1.5 transition-colors",ei<=Dt(On.rssi).bars?Dt(On.rssi).color:"text-gray-600"]),style:G0({height:`${6+ei*2}px`})},ci[6]||(ci[6]=[oe("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),oe("span",{class:ko(`${Dt(On.rssi).color} text-sm font-medium`)},pi(jt(On.rssi)),3)])])]),oe("div",blt,[oe("div",null,[ci[8]||(ci[8]=oe("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),oe("div",wlt,[oe("div",{class:ko(["w-2 h-2 rounded-full",Mr(On.last_seen).color==="text-green-400"?"bg-green-400":"",Mr(On.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Mr(On.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),oe("span",{class:ko(`${Mr(On.last_seen).color} text-sm`),title:dt(On.last_seen)},pi(fr(On.last_seen)),11,klt)])]),oe("div",null,[ci[9]||(ci[9]=oe("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),oe("span",Tlt,pi(we(On)),1)])]),On.latitude!==null&&On.longitude!==null?(ii(),mi("div",Alt,[ci[12]||(ci[12]=oe("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),oe("div",Mlt,[oe("span",Slt,pi(On.latitude.toFixed(4))+", "+pi(On.longitude.toFixed(4)),1),oe("div",Elt,[oe("button",{onClick:ei=>xr(On.latitude,On.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},ci[10]||(ci[10]=[oe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),oe("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Clt),oe("button",{onClick:ei=>Dr(On.latitude,On.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},ci[11]||(ci[11]=[oe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[oe("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),oe("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Llt)])])])):Po("",!0),oe("div",Plt,[oe("div",Ilt,[ci[13]||(ci[13]=oe("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),oe("span",zlt,pi(re(On.snr)),1)]),oe("div",Olt,[ci[14]||(ci[14]=oe("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),oe("span",Dlt,pi(On.advert_count),1)]),oe("div",Flt,[ci[15]||(ci[15]=oe("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),oe("span",{class:"text-white text-sm",title:dt(On.first_seen)},pi(fr(On.first_seen)),9,Rlt)])])])],8,hlt))),128))])]))}}),Nlt={class:"space-y-6"},jlt={key:0,class:"flex items-center justify-center py-12"},Ult={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Vlt={class:"flex items-center gap-3"},Hlt={class:"text-accent-red/80 text-sm"},Wlt={key:0,class:"text-center py-12"},qlt=Ec({name:"NeighborsView",__name:"Neighbors",setup(d){const s=dm(),E={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},B={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},K=ja({}),dt=ja(!0),_t=ja(null),It=ja(!1),jt=ja(typeof window<"u"?window.innerWidth>=1024:!0),re=ja(!1),se=ja(null),we=Ho(()=>{if(!se.value)return null;const qr=se.value;return{id:qr.id,pubkey:qr.pubkey,node_name:qr.node_name,contact_type:qr.contact_type,latitude:qr.latitude,longitude:qr.longitude,rssi:qr.rssi,snr:qr.snr,route_type:qr.route_type,last_seen:qr.last_seen,first_seen:qr.first_seen,advert_count:qr.advert_count,timestamp:qr.timestamp,is_repeater:qr.is_repeater,is_new_neighbor:qr.is_new_neighbor}}),tr=Ho(()=>s.stats?.config?.repeater?.latitude),fr=Ho(()=>s.stats?.config?.repeater?.longitude),Mr=Ho(()=>Object.entries(E).filter(([qr])=>K.value[qr]?.length>0).sort(([qr],[ci])=>parseInt(qr)-parseInt(ci))),xr=Ho(()=>Object.values(K.value).flat().filter(qr=>{const ci=qr.latitude,On=qr.longitude;return ci!=null&&ci!==0&&On!==null&&On!==void 0&&On!==0&&typeof ci=="number"&&typeof On=="number"&&!isNaN(ci)&&!isNaN(On)})),Dr=async qr=>{try{const ci=await oh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(qr)}&hours=168`);return ci.success&&Array.isArray(ci.data)?ci.data:[]}catch(ci){return console.error(`Error fetching adverts for contact type ${qr}:`,ci),[]}},hn=async()=>{dt.value=!0,_t.value=null;try{K.value={};for(const[qr,ci]of Object.entries(E)){const On=await Dr(ci);On.length>0&&(K.value[qr]=On)}}catch(qr){console.error("Error loading adverts:",qr),_t.value=qr instanceof Error?qr.message:"Failed to load neighbor data"}finally{dt.value=!1}},Dt=ja(),on=qr=>{Dt.value?.highlightNode(qr)},Xn=qr=>{Dt.value?.unhighlightNode(qr)},Hn=async qr=>{const ci=qr;try{const On=await oh.post("/ping_neighbor",{pubkey:ci.pubkey});On.success?console.log("Ping sent successfully"):console.error("Failed to ping neighbor:",On.error)}catch(On){console.error("Error pinging neighbor:",On)}},Qn=qr=>{se.value=qr,re.value=!0},Ri=()=>{re.value=!1,se.value=null},$i=async qr=>{try{await oh.deleteAdvert(qr),await hn(),Ri()}catch(ci){console.error("Error deleting neighbor:",ci)}};return op(async()=>{await hn()}),(qr,ci)=>(ii(),mi("div",Nlt,[dt.value?(ii(),mi("div",jlt,ci[2]||(ci[2]=[oe("div",{class:"text-center"},[oe("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),oe("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):_t.value?(ii(),mi("div",Ult,[oe("div",Vlt,[ci[4]||(ci[4]=oe("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[oe("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),oe("div",null,[ci[3]||(ci[3]=oe("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),oe("p",Hlt,pi(_t.value),1)])])])):(ii(),mi(cu,{key:2},[Al(Bst,{ref_key:"networkMapRef",ref:Dt,adverts:xr.value,"base-latitude":tr.value,"base-longitude":fr.value,"show-legend":jt.value,"onUpdate:showLegend":ci[0]||(ci[0]=On=>jt.value=On)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),(ii(!0),mi(cu,null,Yc(Mr.value,([On,ei])=>(ii(),mi("div",{key:On,class:"space-y-6"},[Al(Blt,{"contact-type":ei,"contact-type-key":On,adverts:K.value[On],color:B[parseInt(On)],"base-latitude":tr.value,"base-longitude":fr.value,"is-compact-view":It.value,"is-first-table":On===Mr.value[0]?.[0],"show-view-toggle":Mr.value.length>0,onHighlightNode:on,onUnhighlightNode:Xn,onMenuPing:Hn,onMenuDelete:Qn,onToggleView:ci[1]||(ci[1]=Fn=>It.value=!It.value)},null,8,["contact-type","contact-type-key","adverts","color","base-latitude","base-longitude","is-compact-view","is-first-table","show-view-toggle"])]))),128)),Mr.value.length===0?(ii(),mi("div",Wlt,[ci[5]||(ci[5]=Tf('
No Neighbors Found
No mesh neighbors have been discovered in your area yet.
',3)),oe("button",{onClick:hn,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):Po("",!0)],64)),Al(kst,{show:re.value,neighbor:we.value,onClose:Ri,onDelete:$i},null,8,["show","neighbor"])]))}});/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
- */function lw(d){return d+.5|0}const f1=(d,s,E)=>Math.max(Math.min(d,E),s);function y2(d){return f1(lw(d*2.55),0,255)}function y1(d){return f1(lw(d*255),0,255)}function tv(d){return f1(lw(d/2.55)/100,0,1)}function sP(d){return f1(lw(d*100),0,100)}const sm={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},CA=[..."0123456789ABCDEF"],Vlt=d=>CA[d&15],Hlt=d=>CA[(d&240)>>4]+CA[d&15],D5=d=>(d&240)>>4===(d&15),Wlt=d=>D5(d.r)&&D5(d.g)&&D5(d.b)&&D5(d.a);function qlt(d){var s=d.length,E;return d[0]==="#"&&(s===4||s===5?E={r:255&sm[d[1]]*17,g:255&sm[d[2]]*17,b:255&sm[d[3]]*17,a:s===5?sm[d[4]]*17:255}:(s===7||s===9)&&(E={r:sm[d[1]]<<4|sm[d[2]],g:sm[d[3]]<<4|sm[d[4]],b:sm[d[5]]<<4|sm[d[6]],a:s===9?sm[d[7]]<<4|sm[d[8]]:255})),E}const $lt=(d,s)=>d<255?s(d):"";function Zlt(d){var s=Wlt(d)?Vlt:Hlt;return d?"#"+s(d.r)+s(d.g)+s(d.b)+$lt(d.a,s):void 0}const Glt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function aD(d,s,E){const R=s*Math.min(E,1-E),K=(dt,_t=(dt+d/30)%12)=>E-R*Math.max(Math.min(_t-3,9-_t,1),-1);return[K(0),K(8),K(4)]}function Ylt(d,s,E){const R=(K,dt=(K+d/60)%6)=>E-E*s*Math.max(Math.min(dt,4-dt,1),0);return[R(5),R(3),R(1)]}function Klt(d,s,E){const R=aD(d,1,.5);let K;for(s+E>1&&(K=1/(s+E),s*=K,E*=K),K=0;K<3;K++)R[K]*=1-s-E,R[K]+=s;return R}function Xlt(d,s,E,R,K){return d===K?(s-E)/R+(s
.5?le/(2-dt-_t):le/(dt+_t),jt=Xlt(E,R,K,le,dt),jt=jt*60+.5),[jt|0,te||0,It]}function vM(d,s,E,R){return(Array.isArray(s)?d(s[0],s[1],s[2]):d(s,E,R)).map(y1)}function yM(d,s,E){return vM(aD,d,s,E)}function Jlt(d,s,E){return vM(Klt,d,s,E)}function Qlt(d,s,E){return vM(Ylt,d,s,E)}function oD(d){return(d%360+360)%360}function tut(d){const s=Glt.exec(d);let E=255,R;if(!s)return;s[5]!==R&&(E=s[6]?y2(+s[5]):y1(+s[5]));const K=oD(+s[2]),dt=+s[3]/100,_t=+s[4]/100;return s[1]==="hwb"?R=Jlt(K,dt,_t):s[1]==="hsv"?R=Qlt(K,dt,_t):R=yM(K,dt,_t),{r:R[0],g:R[1],b:R[2],a:E}}function eut(d,s){var E=gM(d);E[0]=oD(E[0]+s),E=yM(E),d.r=E[0],d.g=E[1],d.b=E[2]}function rut(d){if(!d)return;const s=gM(d),E=s[0],R=sP(s[1]),K=sP(s[2]);return d.a<255?`hsla(${E}, ${R}%, ${K}%, ${tv(d.a)})`:`hsl(${E}, ${R}%, ${K}%)`}const lP={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},uP={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function nut(){const d={},s=Object.keys(uP),E=Object.keys(lP);let R,K,dt,_t,It;for(R=0;R>16&255,dt>>8&255,dt&255]}return d}let F5;function iut(d){F5||(F5=nut(),F5.transparent=[0,0,0,0]);const s=F5[d.toLowerCase()];return s&&{r:s[0],g:s[1],b:s[2],a:s.length===4?s[3]:255}}const aut=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function out(d){const s=aut.exec(d);let E=255,R,K,dt;if(s){if(s[7]!==R){const _t=+s[7];E=s[8]?y2(_t):f1(_t*255,0,255)}return R=+s[1],K=+s[3],dt=+s[5],R=255&(s[2]?y2(R):f1(R,0,255)),K=255&(s[4]?y2(K):f1(K,0,255)),dt=255&(s[6]?y2(dt):f1(dt,0,255)),{r:R,g:K,b:dt,a:E}}}function sut(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${tv(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const U8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,n_=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function lut(d,s,E){const R=n_(tv(d.r)),K=n_(tv(d.g)),dt=n_(tv(d.b));return{r:y1(U8(R+E*(n_(tv(s.r))-R))),g:y1(U8(K+E*(n_(tv(s.g))-K))),b:y1(U8(dt+E*(n_(tv(s.b))-dt))),a:d.a+E*(s.a-d.a)}}function B5(d,s,E){if(d){let R=gM(d);R[s]=Math.max(0,Math.min(R[s]+R[s]*E,s===0?360:1)),R=yM(R),d.r=R[0],d.g=R[1],d.b=R[2]}}function sD(d,s){return d&&Object.assign(s||{},d)}function cP(d){var s={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(s={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(s.a=y1(d[3]))):(s=sD(d,{r:0,g:0,b:0,a:1}),s.a=y1(s.a)),s}function uut(d){return d.charAt(0)==="r"?out(d):tut(d)}class q2{constructor(s){if(s instanceof q2)return s;const E=typeof s;let R;E==="object"?R=cP(s):E==="string"&&(R=qlt(s)||iut(s)||uut(s)),this._rgb=R,this._valid=!!R}get valid(){return this._valid}get rgb(){var s=sD(this._rgb);return s&&(s.a=tv(s.a)),s}set rgb(s){this._rgb=cP(s)}rgbString(){return this._valid?sut(this._rgb):void 0}hexString(){return this._valid?Zlt(this._rgb):void 0}hslString(){return this._valid?rut(this._rgb):void 0}mix(s,E){if(s){const R=this.rgb,K=s.rgb;let dt;const _t=E===dt?.5:E,It=2*_t-1,jt=R.a-K.a,te=((It*jt===-1?It:(It+jt)/(1+It*jt))+1)/2;dt=1-te,R.r=255&te*R.r+dt*K.r+.5,R.g=255&te*R.g+dt*K.g+.5,R.b=255&te*R.b+dt*K.b+.5,R.a=_t*R.a+(1-_t)*K.a,this.rgb=R}return this}interpolate(s,E){return s&&(this._rgb=lut(this._rgb,s._rgb,E)),this}clone(){return new q2(this.rgb)}alpha(s){return this._rgb.a=y1(s),this}clearer(s){const E=this._rgb;return E.a*=1-s,this}greyscale(){const s=this._rgb,E=lw(s.r*.3+s.g*.59+s.b*.11);return s.r=s.g=s.b=E,this}opaquer(s){const E=this._rgb;return E.a*=1+s,this}negate(){const s=this._rgb;return s.r=255-s.r,s.g=255-s.g,s.b=255-s.b,this}lighten(s){return B5(this._rgb,2,s),this}darken(s){return B5(this._rgb,2,-s),this}saturate(s){return B5(this._rgb,1,s),this}desaturate(s){return B5(this._rgb,1,-s),this}rotate(s){return eut(this._rgb,s),this}}/*!
+ */function lw(d){return d+.5|0}const f1=(d,s,E)=>Math.max(Math.min(d,E),s);function y2(d){return f1(lw(d*2.55),0,255)}function y1(d){return f1(lw(d*255),0,255)}function tv(d){return f1(lw(d/2.55)/100,0,1)}function sP(d){return f1(lw(d*100),0,100)}const sm={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},CA=[..."0123456789ABCDEF"],$lt=d=>CA[d&15],Zlt=d=>CA[(d&240)>>4]+CA[d&15],D5=d=>(d&240)>>4===(d&15),Glt=d=>D5(d.r)&&D5(d.g)&&D5(d.b)&&D5(d.a);function Ylt(d){var s=d.length,E;return d[0]==="#"&&(s===4||s===5?E={r:255&sm[d[1]]*17,g:255&sm[d[2]]*17,b:255&sm[d[3]]*17,a:s===5?sm[d[4]]*17:255}:(s===7||s===9)&&(E={r:sm[d[1]]<<4|sm[d[2]],g:sm[d[3]]<<4|sm[d[4]],b:sm[d[5]]<<4|sm[d[6]],a:s===9?sm[d[7]]<<4|sm[d[8]]:255})),E}const Klt=(d,s)=>d<255?s(d):"";function Xlt(d){var s=Glt(d)?$lt:Zlt;return d?"#"+s(d.r)+s(d.g)+s(d.b)+Klt(d.a,s):void 0}const Jlt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function aD(d,s,E){const B=s*Math.min(E,1-E),K=(dt,_t=(dt+d/30)%12)=>E-B*Math.max(Math.min(_t-3,9-_t,1),-1);return[K(0),K(8),K(4)]}function Qlt(d,s,E){const B=(K,dt=(K+d/60)%6)=>E-E*s*Math.max(Math.min(dt,4-dt,1),0);return[B(5),B(3),B(1)]}function tut(d,s,E){const B=aD(d,1,.5);let K;for(s+E>1&&(K=1/(s+E),s*=K,E*=K),K=0;K<3;K++)B[K]*=1-s-E,B[K]+=s;return B}function eut(d,s,E,B,K){return d===K?(s-E)/B+(s.5?se/(2-dt-_t):se/(dt+_t),jt=eut(E,B,K,se,dt),jt=jt*60+.5),[jt|0,re||0,It]}function vM(d,s,E,B){return(Array.isArray(s)?d(s[0],s[1],s[2]):d(s,E,B)).map(y1)}function yM(d,s,E){return vM(aD,d,s,E)}function rut(d,s,E){return vM(tut,d,s,E)}function nut(d,s,E){return vM(Qlt,d,s,E)}function oD(d){return(d%360+360)%360}function iut(d){const s=Jlt.exec(d);let E=255,B;if(!s)return;s[5]!==B&&(E=s[6]?y2(+s[5]):y1(+s[5]));const K=oD(+s[2]),dt=+s[3]/100,_t=+s[4]/100;return s[1]==="hwb"?B=rut(K,dt,_t):s[1]==="hsv"?B=nut(K,dt,_t):B=yM(K,dt,_t),{r:B[0],g:B[1],b:B[2],a:E}}function aut(d,s){var E=gM(d);E[0]=oD(E[0]+s),E=yM(E),d.r=E[0],d.g=E[1],d.b=E[2]}function out(d){if(!d)return;const s=gM(d),E=s[0],B=sP(s[1]),K=sP(s[2]);return d.a<255?`hsla(${E}, ${B}%, ${K}%, ${tv(d.a)})`:`hsl(${E}, ${B}%, ${K}%)`}const lP={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},uP={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function sut(){const d={},s=Object.keys(uP),E=Object.keys(lP);let B,K,dt,_t,It;for(B=0;B>16&255,dt>>8&255,dt&255]}return d}let F5;function lut(d){F5||(F5=sut(),F5.transparent=[0,0,0,0]);const s=F5[d.toLowerCase()];return s&&{r:s[0],g:s[1],b:s[2],a:s.length===4?s[3]:255}}const uut=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function cut(d){const s=uut.exec(d);let E=255,B,K,dt;if(s){if(s[7]!==B){const _t=+s[7];E=s[8]?y2(_t):f1(_t*255,0,255)}return B=+s[1],K=+s[3],dt=+s[5],B=255&(s[2]?y2(B):f1(B,0,255)),K=255&(s[4]?y2(K):f1(K,0,255)),dt=255&(s[6]?y2(dt):f1(dt,0,255)),{r:B,g:K,b:dt,a:E}}}function hut(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${tv(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const U8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,n_=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function fut(d,s,E){const B=n_(tv(d.r)),K=n_(tv(d.g)),dt=n_(tv(d.b));return{r:y1(U8(B+E*(n_(tv(s.r))-B))),g:y1(U8(K+E*(n_(tv(s.g))-K))),b:y1(U8(dt+E*(n_(tv(s.b))-dt))),a:d.a+E*(s.a-d.a)}}function R5(d,s,E){if(d){let B=gM(d);B[s]=Math.max(0,Math.min(B[s]+B[s]*E,s===0?360:1)),B=yM(B),d.r=B[0],d.g=B[1],d.b=B[2]}}function sD(d,s){return d&&Object.assign(s||{},d)}function cP(d){var s={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(s={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(s.a=y1(d[3]))):(s=sD(d,{r:0,g:0,b:0,a:1}),s.a=y1(s.a)),s}function dut(d){return d.charAt(0)==="r"?cut(d):iut(d)}class q2{constructor(s){if(s instanceof q2)return s;const E=typeof s;let B;E==="object"?B=cP(s):E==="string"&&(B=Ylt(s)||lut(s)||dut(s)),this._rgb=B,this._valid=!!B}get valid(){return this._valid}get rgb(){var s=sD(this._rgb);return s&&(s.a=tv(s.a)),s}set rgb(s){this._rgb=cP(s)}rgbString(){return this._valid?hut(this._rgb):void 0}hexString(){return this._valid?Xlt(this._rgb):void 0}hslString(){return this._valid?out(this._rgb):void 0}mix(s,E){if(s){const B=this.rgb,K=s.rgb;let dt;const _t=E===dt?.5:E,It=2*_t-1,jt=B.a-K.a,re=((It*jt===-1?It:(It+jt)/(1+It*jt))+1)/2;dt=1-re,B.r=255&re*B.r+dt*K.r+.5,B.g=255&re*B.g+dt*K.g+.5,B.b=255&re*B.b+dt*K.b+.5,B.a=_t*B.a+(1-_t)*K.a,this.rgb=B}return this}interpolate(s,E){return s&&(this._rgb=fut(this._rgb,s._rgb,E)),this}clone(){return new q2(this.rgb)}alpha(s){return this._rgb.a=y1(s),this}clearer(s){const E=this._rgb;return E.a*=1-s,this}greyscale(){const s=this._rgb,E=lw(s.r*.3+s.g*.59+s.b*.11);return s.r=s.g=s.b=E,this}opaquer(s){const E=this._rgb;return E.a*=1+s,this}negate(){const s=this._rgb;return s.r=255-s.r,s.g=255-s.g,s.b=255-s.b,this}lighten(s){return R5(this._rgb,2,s),this}darken(s){return R5(this._rgb,2,-s),this}saturate(s){return R5(this._rgb,1,s),this}desaturate(s){return R5(this._rgb,1,-s),this}rotate(s){return aut(this._rgb,s),this}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
- */function Kg(){}const cut=(()=>{let d=0;return()=>d++})();function Nh(d){return d==null}function Yd(d){if(Array.isArray&&Array.isArray(d))return!0;const s=Object.prototype.toString.call(d);return s.slice(0,7)==="[object"&&s.slice(-6)==="Array]"}function Sc(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function t0(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function og(d,s){return t0(d)?d:s}function cc(d,s){return typeof d>"u"?s:d}const hut=(d,s)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/s,lD=(d,s)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*s:+d;function Ff(d,s,E){if(d&&typeof d.call=="function")return d.apply(E,s)}function Jh(d,s,E,R){let K,dt,_t;if(Yd(d))for(dt=d.length,K=0;Kd,x:d=>d.x,y:d=>d.y};function put(d){const s=d.split("."),E=[];let R="";for(const K of s)R+=K,R.endsWith("\\")?R=R.slice(0,-1)+".":(E.push(R),R="");return E}function mut(d){const s=put(d);return E=>{for(const R of s){if(R==="")break;E=E&&E[R]}return E}}function Py(d,s){return(hP[s]||(hP[s]=mut(s)))(d)}function xM(d){return d.charAt(0).toUpperCase()+d.slice(1)}const Z2=d=>typeof d<"u",b1=d=>typeof d=="function",fP=(d,s)=>{if(d.size!==s.size)return!1;for(const E of d)if(!s.has(E))return!1;return!0};function gut(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const Qh=Math.PI,sd=2*Qh,vut=sd+Qh,b4=Number.POSITIVE_INFINITY,yut=Qh/180,ip=Qh/2,fy=Qh/4,dP=Qh*2/3,cD=Math.log10,gg=Math.sign;function P2(d,s,E){return Math.abs(d-s)K-dt).pop(),s}function _ut(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function G2(d){return!_ut(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function but(d,s){const E=Math.round(d);return E-s<=d&&E+s>=d}function wut(d,s,E){let R,K,dt;for(R=0,K=d.length;Rjt&&te=Math.min(s,E)-R&&d<=Math.max(s,E)+R}function _M(d,s,E){E=E||(_t=>d[_t]1;)dt=K+R>>1,E(dt)?K=dt:R=dt;return{lo:K,hi:R}}const ky=(d,s,E,R)=>_M(d,E,R?K=>{const dt=d[K][s];return dtd[K][s]_M(d,E,R=>d[R][s]>=E);function Sut(d,s,E){let R=0,K=d.length;for(;RR&&d[K-1]>E;)K--;return R>0||K{const R="_onData"+xM(E),K=d[E];Object.defineProperty(d,E,{configurable:!0,enumerable:!1,value(...dt){const _t=K.apply(this,dt);return d._chartjs.listeners.forEach(It=>{typeof It[R]=="function"&&It[R](...dt)}),_t}})})}function gP(d,s){const E=d._chartjs;if(!E)return;const R=E.listeners,K=R.indexOf(s);K!==-1&&R.splice(K,1),!(R.length>0)&&(fD.forEach(dt=>{delete d[dt]}),delete d._chartjs)}function dD(d){const s=new Set(d);return s.size===d.length?d:Array.from(s)}const pD=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function mD(d,s){let E=[],R=!1;return function(...K){E=K,R||(R=!0,pD.call(window,()=>{R=!1,d.apply(s,E)}))}}function Cut(d,s){let E;return function(...R){return s?(clearTimeout(E),E=setTimeout(d,s,R)):d.apply(this,R),s}}const bM=d=>d==="start"?"left":d==="end"?"right":"center",qp=(d,s,E)=>d==="start"?s:d==="end"?E:(s+E)/2,Lut=(d,s,E,R)=>d===(R?"left":"right")?E:d==="center"?(s+E)/2:s;function Put(d,s,E){const R=s.length;let K=0,dt=R;if(d._sorted){const{iScale:_t,vScale:It,_parsed:jt}=d,te=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,le=_t.axis,{min:Le,max:Je,minDefined:fr,maxDefined:Tr}=_t.getUserBounds();if(fr){if(K=Math.min(ky(jt,le,Le).lo,E?R:ky(s,le,_t.getPixelForValue(Le)).lo),te){const wr=jt.slice(0,K+1).reverse().findIndex(Vr=>!Nh(Vr[It.axis]));K-=Math.max(0,wr)}K=Jp(K,0,R-1)}if(Tr){let wr=Math.max(ky(jt,_t.axis,Je,!0).hi+1,E?0:ky(s,le,_t.getPixelForValue(Je),!0).hi+1);if(te){const Vr=jt.slice(wr-1).findIndex(fn=>!Nh(fn[It.axis]));wr+=Math.max(0,Vr)}dt=Jp(wr,K,R)-K}else dt=R-K}return{start:K,count:dt}}function Iut(d){const{xScale:s,yScale:E,_scaleRanges:R}=d,K={xmin:s.min,xmax:s.max,ymin:E.min,ymax:E.max};if(!R)return d._scaleRanges=K,!0;const dt=R.xmin!==s.min||R.xmax!==s.max||R.ymin!==E.min||R.ymax!==E.max;return Object.assign(R,K),dt}const R5=d=>d===0||d===1,vP=(d,s,E)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-s)*sd/E)),yP=(d,s,E)=>Math.pow(2,-10*d)*Math.sin((d-s)*sd/E)+1,I2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*ip)+1,easeOutSine:d=>Math.sin(d*ip),easeInOutSine:d=>-.5*(Math.cos(Qh*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>R5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>R5(d)?d:vP(d,.075,.3),easeOutElastic:d=>R5(d)?d:yP(d,.075,.3),easeInOutElastic(d){return R5(d)?d:d<.5?.5*vP(d*2,.1125,.45):.5+.5*yP(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let s=1.70158;return(d/=.5)<1?.5*(d*d*(((s*=1.525)+1)*d-s)):.5*((d-=2)*d*(((s*=1.525)+1)*d+s)+2)},easeInBounce:d=>1-I2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?I2.easeInBounce(d*2)*.5:I2.easeOutBounce(d*2-1)*.5+.5};function wM(d){if(d&&typeof d=="object"){const s=d.toString();return s==="[object CanvasPattern]"||s==="[object CanvasGradient]"}return!1}function xP(d){return wM(d)?d:new q2(d)}function V8(d){return wM(d)?d:new q2(d).saturate(.5).darken(.1).hexString()}const zut=["x","y","borderWidth","radius","tension"],Out=["color","borderColor","backgroundColor"];function Dut(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:s=>s!=="onProgress"&&s!=="onComplete"&&s!=="fn"}),d.set("animations",{colors:{type:"color",properties:Out},numbers:{type:"number",properties:zut}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:s=>s|0}}}})}function Fut(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _P=new Map;function But(d,s){s=s||{};const E=d+JSON.stringify(s);let R=_P.get(E);return R||(R=new Intl.NumberFormat(d,s),_P.set(E,R)),R}function kM(d,s,E){return But(s,E).format(d)}const Rut={values(d){return Yd(d)?d:""+d},numeric(d,s,E){if(d===0)return"0";const R=this.chart.options.locale;let K,dt=d;if(E.length>1){const te=Math.max(Math.abs(E[0].value),Math.abs(E[E.length-1].value));(te<1e-4||te>1e15)&&(K="scientific"),dt=Nut(d,E)}const _t=cD(Math.abs(dt)),It=isNaN(_t)?1:Math.max(Math.min(-1*Math.floor(_t),20),0),jt={notation:K,minimumFractionDigits:It,maximumFractionDigits:It};return Object.assign(jt,this.options.ticks.format),kM(d,R,jt)}};function Nut(d,s){let E=s.length>3?s[2].value-s[1].value:s[1].value-s[0].value;return Math.abs(E)>=1&&d!==Math.floor(d)&&(E=d-Math.floor(d)),E}var gD={formatters:Rut};function jut(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(s,E)=>E.lineWidth,tickColor:(s,E)=>E.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:gD.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:s=>!s.startsWith("before")&&!s.startsWith("after")&&s!=="callback"&&s!=="parser",_indexable:s=>s!=="borderDash"&&s!=="tickBorderDash"&&s!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:s=>s!=="backdropPadding"&&s!=="callback",_indexable:s=>s!=="backdropPadding"})}const Iy=Object.create(null),PA=Object.create(null);function z2(d,s){if(!s)return d;const E=s.split(".");for(let R=0,K=E.length;RR.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(R,K)=>V8(K.backgroundColor),this.hoverBorderColor=(R,K)=>V8(K.borderColor),this.hoverColor=(R,K)=>V8(K.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(s),this.apply(E)}set(s,E){return H8(this,s,E)}get(s){return z2(this,s)}describe(s,E){return H8(PA,s,E)}override(s,E){return H8(Iy,s,E)}route(s,E,R,K){const dt=z2(this,s),_t=z2(this,R),It="_"+E;Object.defineProperties(dt,{[It]:{value:dt[E],writable:!0},[E]:{enumerable:!0,get(){const jt=this[It],te=_t[K];return Sc(jt)?Object.assign({},te,jt):cc(jt,te)},set(jt){this[It]=jt}}})}apply(s){s.forEach(E=>E(this))}}var Bd=new Uut({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Dut,Fut,jut]);function Vut(d){return!d||Nh(d.size)||Nh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function bP(d,s,E,R,K){let dt=s[K];return dt||(dt=s[K]=d.measureText(K).width,E.push(K)),dt>R&&(R=dt),R}function dy(d,s,E){const R=d.currentDevicePixelRatio,K=E!==0?Math.max(E/2,.5):0;return Math.round((s-K)*R)/R+K}function wP(d,s){!s&&!d||(s=s||d.getContext("2d"),s.save(),s.resetTransform(),s.clearRect(0,0,d.width,d.height),s.restore())}function IA(d,s,E,R){vD(d,s,E,R,null)}function vD(d,s,E,R,K){let dt,_t,It,jt,te,le,Le,Je;const fr=s.pointStyle,Tr=s.rotation,wr=s.radius;let Vr=(Tr||0)*yut;if(fr&&typeof fr=="object"&&(dt=fr.toString(),dt==="[object HTMLImageElement]"||dt==="[object HTMLCanvasElement]")){d.save(),d.translate(E,R),d.rotate(Vr),d.drawImage(fr,-fr.width/2,-fr.height/2,fr.width,fr.height),d.restore();return}if(!(isNaN(wr)||wr<=0)){switch(d.beginPath(),fr){default:K?d.ellipse(E,R,K/2,wr,0,0,sd):d.arc(E,R,wr,0,sd),d.closePath();break;case"triangle":le=K?K/2:wr,d.moveTo(E+Math.sin(Vr)*le,R-Math.cos(Vr)*wr),Vr+=dP,d.lineTo(E+Math.sin(Vr)*le,R-Math.cos(Vr)*wr),Vr+=dP,d.lineTo(E+Math.sin(Vr)*le,R-Math.cos(Vr)*wr),d.closePath();break;case"rectRounded":te=wr*.516,jt=wr-te,_t=Math.cos(Vr+fy)*jt,Le=Math.cos(Vr+fy)*(K?K/2-te:jt),It=Math.sin(Vr+fy)*jt,Je=Math.sin(Vr+fy)*(K?K/2-te:jt),d.arc(E-Le,R-It,te,Vr-Qh,Vr-ip),d.arc(E+Je,R-_t,te,Vr-ip,Vr),d.arc(E+Le,R+It,te,Vr,Vr+ip),d.arc(E-Je,R+_t,te,Vr+ip,Vr+Qh),d.closePath();break;case"rect":if(!Tr){jt=Math.SQRT1_2*wr,le=K?K/2:jt,d.rect(E-le,R-jt,2*le,2*jt);break}Vr+=fy;case"rectRot":Le=Math.cos(Vr)*(K?K/2:wr),_t=Math.cos(Vr)*wr,It=Math.sin(Vr)*wr,Je=Math.sin(Vr)*(K?K/2:wr),d.moveTo(E-Le,R-It),d.lineTo(E+Je,R-_t),d.lineTo(E+Le,R+It),d.lineTo(E-Je,R+_t),d.closePath();break;case"crossRot":Vr+=fy;case"cross":Le=Math.cos(Vr)*(K?K/2:wr),_t=Math.cos(Vr)*wr,It=Math.sin(Vr)*wr,Je=Math.sin(Vr)*(K?K/2:wr),d.moveTo(E-Le,R-It),d.lineTo(E+Le,R+It),d.moveTo(E+Je,R-_t),d.lineTo(E-Je,R+_t);break;case"star":Le=Math.cos(Vr)*(K?K/2:wr),_t=Math.cos(Vr)*wr,It=Math.sin(Vr)*wr,Je=Math.sin(Vr)*(K?K/2:wr),d.moveTo(E-Le,R-It),d.lineTo(E+Le,R+It),d.moveTo(E+Je,R-_t),d.lineTo(E-Je,R+_t),Vr+=fy,Le=Math.cos(Vr)*(K?K/2:wr),_t=Math.cos(Vr)*wr,It=Math.sin(Vr)*wr,Je=Math.sin(Vr)*(K?K/2:wr),d.moveTo(E-Le,R-It),d.lineTo(E+Le,R+It),d.moveTo(E+Je,R-_t),d.lineTo(E-Je,R+_t);break;case"line":_t=K?K/2:Math.cos(Vr)*wr,It=Math.sin(Vr)*wr,d.moveTo(E-_t,R-It),d.lineTo(E+_t,R+It);break;case"dash":d.moveTo(E,R),d.lineTo(E+Math.cos(Vr)*(K?K/2:wr),R+Math.sin(Vr)*wr);break;case!1:d.closePath();break}d.fill(),s.borderWidth>0&&d.stroke()}}function K2(d,s,E){return E=E||.5,!s||d&&d.x>s.left-E&&d.xs.top-E&&d.y0&&dt.strokeColor!=="";let jt,te;for(d.save(),d.font=K.string,qut(d,dt),jt=0;jt<_t.length;++jt)te=_t[jt],dt.backdrop&&Zut(d,dt.backdrop),It&&(dt.strokeColor&&(d.strokeStyle=dt.strokeColor),Nh(dt.strokeWidth)||(d.lineWidth=dt.strokeWidth),d.strokeText(te,E,R,dt.maxWidth)),d.fillText(te,E,R,dt.maxWidth),$ut(d,E,R,te,dt),R+=Number(K.lineHeight);d.restore()}function w4(d,s){const{x:E,y:R,w:K,h:dt,radius:_t}=s;d.arc(E+_t.topLeft,R+_t.topLeft,_t.topLeft,1.5*Qh,Qh,!0),d.lineTo(E,R+dt-_t.bottomLeft),d.arc(E+_t.bottomLeft,R+dt-_t.bottomLeft,_t.bottomLeft,Qh,ip,!0),d.lineTo(E+K-_t.bottomRight,R+dt),d.arc(E+K-_t.bottomRight,R+dt-_t.bottomRight,_t.bottomRight,ip,0,!0),d.lineTo(E+K,R+_t.topRight),d.arc(E+K-_t.topRight,R+_t.topRight,_t.topRight,0,-ip,!0),d.lineTo(E+_t.topLeft,R)}const Gut=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Yut=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Kut(d,s){const E=(""+d).match(Gut);if(!E||E[1]==="normal")return s*1.2;switch(d=+E[2],E[3]){case"px":return d;case"%":d/=100;break}return s*d}const Xut=d=>+d||0;function TM(d,s){const E={},R=Sc(s),K=R?Object.keys(s):s,dt=Sc(d)?R?_t=>cc(d[_t],d[s[_t]]):_t=>d[_t]:()=>d;for(const _t of K)E[_t]=Xut(dt(_t));return E}function yD(d){return TM(d,{top:"y",right:"x",bottom:"y",left:"x"})}function f_(d){return TM(d,["topLeft","topRight","bottomLeft","bottomRight"])}function fm(d){const s=yD(d);return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Qp(d,s){d=d||{},s=s||Bd.font;let E=cc(d.size,s.size);typeof E=="string"&&(E=parseInt(E,10));let R=cc(d.style,s.style);R&&!(""+R).match(Yut)&&(console.warn('Invalid font style specified: "'+R+'"'),R=void 0);const K={family:cc(d.family,s.family),lineHeight:Kut(cc(d.lineHeight,s.lineHeight),E),size:E,style:R,weight:cc(d.weight,s.weight),string:""};return K.string=Vut(K),K}function N5(d,s,E,R){let K,dt,_t;for(K=0,dt=d.length;KE&&It===0?0:It+jt;return{min:_t(R,-Math.abs(dt)),max:_t(K,dt)}}function Dy(d,s){return Object.assign(Object.create(d),s)}function AM(d,s=[""],E,R,K=()=>d[0]){const dt=E||d;typeof R>"u"&&(R=wD("_fallback",d));const _t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:dt,_fallback:R,_getTarget:K,override:It=>AM([It,...d],s,dt,R)};return new Proxy(_t,{deleteProperty(It,jt){return delete It[jt],delete It._keys,delete d[0][jt],!0},get(It,jt){return _D(It,jt,()=>oct(jt,s,d,It))},getOwnPropertyDescriptor(It,jt){return Reflect.getOwnPropertyDescriptor(It._scopes[0],jt)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(It,jt){return TP(It).includes(jt)},ownKeys(It){return TP(It)},set(It,jt,te){const le=It._storage||(It._storage=K());return It[jt]=le[jt]=te,delete It._keys,!0}})}function __(d,s,E,R){const K={_cacheable:!1,_proxy:d,_context:s,_subProxy:E,_stack:new Set,_descriptors:xD(d,R),setContext:dt=>__(d,dt,E,R),override:dt=>__(d.override(dt),s,E,R)};return new Proxy(K,{deleteProperty(dt,_t){return delete dt[_t],delete d[_t],!0},get(dt,_t,It){return _D(dt,_t,()=>tct(dt,_t,It))},getOwnPropertyDescriptor(dt,_t){return dt._descriptors.allKeys?Reflect.has(d,_t)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,_t)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(dt,_t){return Reflect.has(d,_t)},ownKeys(){return Reflect.ownKeys(d)},set(dt,_t,It){return d[_t]=It,delete dt[_t],!0}})}function xD(d,s={scriptable:!0,indexable:!0}){const{_scriptable:E=s.scriptable,_indexable:R=s.indexable,_allKeys:K=s.allKeys}=d;return{allKeys:K,scriptable:E,indexable:R,isScriptable:b1(E)?E:()=>E,isIndexable:b1(R)?R:()=>R}}const Qut=(d,s)=>d?d+xM(s):s,MM=(d,s)=>Sc(s)&&d!=="adapters"&&(Object.getPrototypeOf(s)===null||s.constructor===Object);function _D(d,s,E){if(Object.prototype.hasOwnProperty.call(d,s)||s==="constructor")return d[s];const R=E();return d[s]=R,R}function tct(d,s,E){const{_proxy:R,_context:K,_subProxy:dt,_descriptors:_t}=d;let It=R[s];return b1(It)&&_t.isScriptable(s)&&(It=ect(s,It,d,E)),Yd(It)&&It.length&&(It=rct(s,It,d,_t.isIndexable)),MM(s,It)&&(It=__(It,K,dt&&dt[s],_t)),It}function ect(d,s,E,R){const{_proxy:K,_context:dt,_subProxy:_t,_stack:It}=E;if(It.has(d))throw new Error("Recursion detected: "+Array.from(It).join("->")+"->"+d);It.add(d);let jt=s(dt,_t||R);return It.delete(d),MM(d,jt)&&(jt=SM(K._scopes,K,d,jt)),jt}function rct(d,s,E,R){const{_proxy:K,_context:dt,_subProxy:_t,_descriptors:It}=E;if(typeof dt.index<"u"&&R(d))return s[dt.index%s.length];if(Sc(s[0])){const jt=s,te=K._scopes.filter(le=>le!==jt);s=[];for(const le of jt){const Le=SM(te,K,d,le);s.push(__(Le,dt,_t&&_t[d],It))}}return s}function bD(d,s,E){return b1(d)?d(s,E):d}const nct=(d,s)=>d===!0?s:typeof d=="string"?Py(s,d):void 0;function ict(d,s,E,R,K){for(const dt of s){const _t=nct(E,dt);if(_t){d.add(_t);const It=bD(_t._fallback,E,K);if(typeof It<"u"&&It!==E&&It!==R)return It}else if(_t===!1&&typeof R<"u"&&E!==R)return null}return!1}function SM(d,s,E,R){const K=s._rootScopes,dt=bD(s._fallback,E,R),_t=[...d,...K],It=new Set;It.add(R);let jt=kP(It,_t,E,dt||E,R);return jt===null||typeof dt<"u"&&dt!==E&&(jt=kP(It,_t,dt,jt,R),jt===null)?!1:AM(Array.from(It),[""],K,dt,()=>act(s,E,R))}function kP(d,s,E,R,K){for(;E;)E=ict(d,s,E,R,K);return E}function act(d,s,E){const R=d._getTarget();s in R||(R[s]={});const K=R[s];return Yd(K)&&Sc(E)?E:K||{}}function oct(d,s,E,R){let K;for(const dt of s)if(K=wD(Qut(dt,d),E),typeof K<"u")return MM(d,K)?SM(E,R,d,K):K}function wD(d,s){for(const E of s){if(!E)continue;const R=E[d];if(typeof R<"u")return R}}function TP(d){let s=d._keys;return s||(s=d._keys=sct(d._scopes)),s}function sct(d){const s=new Set;for(const E of d)for(const R of Object.keys(E).filter(K=>!K.startsWith("_")))s.add(R);return Array.from(s)}const lct=Number.EPSILON||1e-14,b_=(d,s)=>sd==="x"?"y":"x";function uct(d,s,E,R){const K=d.skip?s:d,dt=s,_t=E.skip?s:E,It=LA(dt,K),jt=LA(_t,dt);let te=It/(It+jt),le=jt/(It+jt);te=isNaN(te)?0:te,le=isNaN(le)?0:le;const Le=R*te,Je=R*le;return{previous:{x:dt.x-Le*(_t.x-K.x),y:dt.y-Le*(_t.y-K.y)},next:{x:dt.x+Je*(_t.x-K.x),y:dt.y+Je*(_t.y-K.y)}}}function cct(d,s,E){const R=d.length;let K,dt,_t,It,jt,te=b_(d,0);for(let le=0;le!te.skip)),s.cubicInterpolationMode==="monotone")fct(d,K);else{let te=R?d[d.length-1]:d[0];for(dt=0,_t=d.length;dt<_t;++dt)It=d[dt],jt=uct(te,It,d[Math.min(dt+1,_t-(R?0:1))%_t],s.tension),It.cp1x=jt.previous.x,It.cp1y=jt.previous.y,It.cp2x=jt.next.x,It.cp2y=jt.next.y,te=It}s.capBezierPoints&&dct(d,E)}function EM(){return typeof window<"u"&&typeof document<"u"}function CM(d){let s=d.parentNode;return s&&s.toString()==="[object ShadowRoot]"&&(s=s.host),s}function k4(d,s,E){let R;return typeof d=="string"?(R=parseInt(d,10),d.indexOf("%")!==-1&&(R=R/100*s.parentNode[E])):R=d,R}const J4=d=>d.ownerDocument.defaultView.getComputedStyle(d,null);function mct(d,s){return J4(d).getPropertyValue(s)}const gct=["top","right","bottom","left"];function Sy(d,s,E){const R={};E=E?"-"+E:"";for(let K=0;K<4;K++){const dt=gct[K];R[dt]=parseFloat(d[s+"-"+dt+E])||0}return R.width=R.left+R.right,R.height=R.top+R.bottom,R}const vct=(d,s,E)=>(d>0||s>0)&&(!E||!E.shadowRoot);function yct(d,s){const E=d.touches,R=E&&E.length?E[0]:d,{offsetX:K,offsetY:dt}=R;let _t=!1,It,jt;if(vct(K,dt,d.target))It=K,jt=dt;else{const te=s.getBoundingClientRect();It=R.clientX-te.left,jt=R.clientY-te.top,_t=!0}return{x:It,y:jt,box:_t}}function gy(d,s){if("native"in d)return d;const{canvas:E,currentDevicePixelRatio:R}=s,K=J4(E),dt=K.boxSizing==="border-box",_t=Sy(K,"padding"),It=Sy(K,"border","width"),{x:jt,y:te,box:le}=yct(d,E),Le=_t.left+(le&&It.left),Je=_t.top+(le&&It.top);let{width:fr,height:Tr}=s;return dt&&(fr-=_t.width+It.width,Tr-=_t.height+It.height),{x:Math.round((jt-Le)/fr*E.width/R),y:Math.round((te-Je)/Tr*E.height/R)}}function xct(d,s,E){let R,K;if(s===void 0||E===void 0){const dt=d&&CM(d);if(!dt)s=d.clientWidth,E=d.clientHeight;else{const _t=dt.getBoundingClientRect(),It=J4(dt),jt=Sy(It,"border","width"),te=Sy(It,"padding");s=_t.width-te.width-jt.width,E=_t.height-te.height-jt.height,R=k4(It.maxWidth,dt,"clientWidth"),K=k4(It.maxHeight,dt,"clientHeight")}}return{width:s,height:E,maxWidth:R||b4,maxHeight:K||b4}}const d1=d=>Math.round(d*10)/10;function _ct(d,s,E,R){const K=J4(d),dt=Sy(K,"margin"),_t=k4(K.maxWidth,d,"clientWidth")||b4,It=k4(K.maxHeight,d,"clientHeight")||b4,jt=xct(d,s,E);let{width:te,height:le}=jt;if(K.boxSizing==="content-box"){const Je=Sy(K,"border","width"),fr=Sy(K,"padding");te-=fr.width+Je.width,le-=fr.height+Je.height}return te=Math.max(0,te-dt.width),le=Math.max(0,R?te/R:le-dt.height),te=d1(Math.min(te,_t,jt.maxWidth)),le=d1(Math.min(le,It,jt.maxHeight)),te&&!le&&(le=d1(te/2)),(s!==void 0||E!==void 0)&&R&&jt.height&&le>jt.height&&(le=jt.height,te=d1(Math.floor(le*R))),{width:te,height:le}}function AP(d,s,E){const R=s||1,K=d1(d.height*R),dt=d1(d.width*R);d.height=d1(d.height),d.width=d1(d.width);const _t=d.canvas;return _t.style&&(E||!_t.style.height&&!_t.style.width)&&(_t.style.height=`${d.height}px`,_t.style.width=`${d.width}px`),d.currentDevicePixelRatio!==R||_t.height!==K||_t.width!==dt?(d.currentDevicePixelRatio=R,_t.height=K,_t.width=dt,d.ctx.setTransform(R,0,0,R,0,0),!0):!1}const bct=function(){let d=!1;try{const s={get passive(){return d=!0,!1}};EM()&&(window.addEventListener("test",null,s),window.removeEventListener("test",null,s))}catch{}return d}();function MP(d,s){const E=mct(d,s),R=E&&E.match(/^(\d+)(\.\d+)?px$/);return R?+R[1]:void 0}function vy(d,s,E,R){return{x:d.x+E*(s.x-d.x),y:d.y+E*(s.y-d.y)}}function wct(d,s,E,R){return{x:d.x+E*(s.x-d.x),y:R==="middle"?E<.5?d.y:s.y:R==="after"?E<1?d.y:s.y:E>0?s.y:d.y}}function kct(d,s,E,R){const K={x:d.cp2x,y:d.cp2y},dt={x:s.cp1x,y:s.cp1y},_t=vy(d,K,E),It=vy(K,dt,E),jt=vy(dt,s,E),te=vy(_t,It,E),le=vy(It,jt,E);return vy(te,le,E)}const Tct=function(d,s){return{x(E){return d+d+s-E},setWidth(E){s=E},textAlign(E){return E==="center"?E:E==="right"?"left":"right"},xPlus(E,R){return E-R},leftForLtr(E,R){return E-R}}},Act=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,s){return d+s},leftForLtr(d,s){return d}}};function d_(d,s,E){return d?Tct(s,E):Act()}function TD(d,s){let E,R;(s==="ltr"||s==="rtl")&&(E=d.canvas.style,R=[E.getPropertyValue("direction"),E.getPropertyPriority("direction")],E.setProperty("direction",s,"important"),d.prevTextDirection=R)}function AD(d,s){s!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",s[0],s[1]))}function MD(d){return d==="angle"?{between:Y2,compare:Tut,normalize:$0}:{between:av,compare:(s,E)=>s-E,normalize:s=>s}}function SP({start:d,end:s,count:E,loop:R,style:K}){return{start:d%E,end:s%E,loop:R&&(s-d+1)%E===0,style:K}}function Mct(d,s,E){const{property:R,start:K,end:dt}=E,{between:_t,normalize:It}=MD(R),jt=s.length;let{start:te,end:le,loop:Le}=d,Je,fr;if(Le){for(te+=jt,le+=jt,Je=0,fr=jt;Jejt(K,un,fn)&&It(K,un)!==0,Dn=()=>It(dt,fn)===0||jt(dt,un,fn),Xn=()=>wr||Qn(),Ni=()=>!wr||Dn();for(let zi=le,qr=le;zi<=Le;++zi)Dt=s[zi%_t],!Dt.skip&&(fn=te(Dt[R]),fn!==un&&(wr=jt(fn,K,dt),Vr===null&&Xn()&&(Vr=It(fn,K)===0?zi:qr),Vr!==null&&Ni()&&(Tr.push(SP({start:Vr,end:zi,loop:Je,count:_t,style:fr})),Vr=null),qr=zi,un=fn));return Vr!==null&&Tr.push(SP({start:Vr,end:Le,loop:Je,count:_t,style:fr})),Tr}function ED(d,s){const E=[],R=d.segments;for(let K=0;KK&&d[dt%s].skip;)dt--;return dt%=s,{start:K,end:dt}}function Ect(d,s,E,R){const K=d.length,dt=[];let _t=s,It=d[s],jt;for(jt=s+1;jt<=E;++jt){const te=d[jt%K];te.skip||te.stop?It.skip||(R=!1,dt.push({start:s%K,end:(jt-1)%K,loop:R}),s=_t=te.stop?jt:null):(_t=jt,It.skip&&(s=jt)),It=te}return _t!==null&&dt.push({start:s%K,end:_t%K,loop:R}),dt}function Cct(d,s){const E=d.points,R=d.options.spanGaps,K=E.length;if(!K)return[];const dt=!!d._loop,{start:_t,end:It}=Sct(E,K,dt,R);if(R===!0)return EP(d,[{start:_t,end:It,loop:dt}],E,s);const jt=It<_t?It+K:It,te=!!d._fullLoop&&_t===0&&It===K-1;return EP(d,Ect(E,_t,jt,te),E,s)}function EP(d,s,E,R){return!R||!R.setContext||!E?s:Lct(d,s,E,R)}function Lct(d,s,E,R){const K=d._chart.getContext(),dt=CP(d.options),{_datasetIndex:_t,options:{spanGaps:It}}=d,jt=E.length,te=[];let le=dt,Le=s[0].start,Je=Le;function fr(Tr,wr,Vr,fn){const Dt=It?-1:1;if(Tr!==wr){for(Tr+=jt;E[Tr%jt].skip;)Tr-=Dt;for(;E[wr%jt].skip;)wr+=Dt;Tr%jt!==wr%jt&&(te.push({start:Tr%jt,end:wr%jt,loop:Vr,style:fn}),le=fn,Le=wr%jt)}}for(const Tr of s){Le=It?Le:Tr.start;let wr=E[Le%jt],Vr;for(Je=Le+1;Je<=Tr.end;Je++){const fn=E[Je%jt];Vr=CP(R.setContext(Dy(K,{type:"segment",p0:wr,p1:fn,p0DataIndex:(Je-1)%jt,p1DataIndex:Je%jt,datasetIndex:_t}))),Pct(Vr,le)&&fr(Le,Je-1,Tr.loop,le),wr=fn,le=Vr}Le{let d=0;return()=>d++})();function Nh(d){return d==null}function Yd(d){if(Array.isArray&&Array.isArray(d))return!0;const s=Object.prototype.toString.call(d);return s.slice(0,7)==="[object"&&s.slice(-6)==="Array]"}function Sc(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function t0(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function og(d,s){return t0(d)?d:s}function cc(d,s){return typeof d>"u"?s:d}const mut=(d,s)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/s,lD=(d,s)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*s:+d;function Ff(d,s,E){if(d&&typeof d.call=="function")return d.apply(E,s)}function Jh(d,s,E,B){let K,dt,_t;if(Yd(d))for(dt=d.length,K=0;Kd,x:d=>d.x,y:d=>d.y};function yut(d){const s=d.split("."),E=[];let B="";for(const K of s)B+=K,B.endsWith("\\")?B=B.slice(0,-1)+".":(E.push(B),B="");return E}function xut(d){const s=yut(d);return E=>{for(const B of s){if(B==="")break;E=E&&E[B]}return E}}function Py(d,s){return(hP[s]||(hP[s]=xut(s)))(d)}function xM(d){return d.charAt(0).toUpperCase()+d.slice(1)}const Z2=d=>typeof d<"u",b1=d=>typeof d=="function",fP=(d,s)=>{if(d.size!==s.size)return!1;for(const E of d)if(!s.has(E))return!1;return!0};function _ut(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const Qh=Math.PI,sd=2*Qh,but=sd+Qh,b4=Number.POSITIVE_INFINITY,wut=Qh/180,ip=Qh/2,fy=Qh/4,dP=Qh*2/3,cD=Math.log10,gg=Math.sign;function P2(d,s,E){return Math.abs(d-s)K-dt).pop(),s}function Tut(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function G2(d){return!Tut(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function Aut(d,s){const E=Math.round(d);return E-s<=d&&E+s>=d}function Mut(d,s,E){let B,K,dt;for(B=0,K=d.length;Bjt&&re=Math.min(s,E)-B&&d<=Math.max(s,E)+B}function _M(d,s,E){E=E||(_t=>d[_t]1;)dt=K+B>>1,E(dt)?K=dt:B=dt;return{lo:K,hi:B}}const ky=(d,s,E,B)=>_M(d,E,B?K=>{const dt=d[K][s];return dtd[K][s]_M(d,E,B=>d[B][s]>=E);function Put(d,s,E){let B=0,K=d.length;for(;BB&&d[K-1]>E;)K--;return B>0||K{const B="_onData"+xM(E),K=d[E];Object.defineProperty(d,E,{configurable:!0,enumerable:!1,value(...dt){const _t=K.apply(this,dt);return d._chartjs.listeners.forEach(It=>{typeof It[B]=="function"&&It[B](...dt)}),_t}})})}function gP(d,s){const E=d._chartjs;if(!E)return;const B=E.listeners,K=B.indexOf(s);K!==-1&&B.splice(K,1),!(B.length>0)&&(fD.forEach(dt=>{delete d[dt]}),delete d._chartjs)}function dD(d){const s=new Set(d);return s.size===d.length?d:Array.from(s)}const pD=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function mD(d,s){let E=[],B=!1;return function(...K){E=K,B||(B=!0,pD.call(window,()=>{B=!1,d.apply(s,E)}))}}function zut(d,s){let E;return function(...B){return s?(clearTimeout(E),E=setTimeout(d,s,B)):d.apply(this,B),s}}const bM=d=>d==="start"?"left":d==="end"?"right":"center",qp=(d,s,E)=>d==="start"?s:d==="end"?E:(s+E)/2,Out=(d,s,E,B)=>d===(B?"left":"right")?E:d==="center"?(s+E)/2:s;function Dut(d,s,E){const B=s.length;let K=0,dt=B;if(d._sorted){const{iScale:_t,vScale:It,_parsed:jt}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,se=_t.axis,{min:we,max:tr,minDefined:fr,maxDefined:Mr}=_t.getUserBounds();if(fr){if(K=Math.min(ky(jt,se,we).lo,E?B:ky(s,se,_t.getPixelForValue(we)).lo),re){const xr=jt.slice(0,K+1).reverse().findIndex(Dr=>!Nh(Dr[It.axis]));K-=Math.max(0,xr)}K=Jp(K,0,B-1)}if(Mr){let xr=Math.max(ky(jt,_t.axis,tr,!0).hi+1,E?0:ky(s,se,_t.getPixelForValue(tr),!0).hi+1);if(re){const Dr=jt.slice(xr-1).findIndex(hn=>!Nh(hn[It.axis]));xr+=Math.max(0,Dr)}dt=Jp(xr,K,B)-K}else dt=B-K}return{start:K,count:dt}}function Fut(d){const{xScale:s,yScale:E,_scaleRanges:B}=d,K={xmin:s.min,xmax:s.max,ymin:E.min,ymax:E.max};if(!B)return d._scaleRanges=K,!0;const dt=B.xmin!==s.min||B.xmax!==s.max||B.ymin!==E.min||B.ymax!==E.max;return Object.assign(B,K),dt}const B5=d=>d===0||d===1,vP=(d,s,E)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-s)*sd/E)),yP=(d,s,E)=>Math.pow(2,-10*d)*Math.sin((d-s)*sd/E)+1,I2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*ip)+1,easeOutSine:d=>Math.sin(d*ip),easeInOutSine:d=>-.5*(Math.cos(Qh*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>B5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>B5(d)?d:vP(d,.075,.3),easeOutElastic:d=>B5(d)?d:yP(d,.075,.3),easeInOutElastic(d){return B5(d)?d:d<.5?.5*vP(d*2,.1125,.45):.5+.5*yP(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let s=1.70158;return(d/=.5)<1?.5*(d*d*(((s*=1.525)+1)*d-s)):.5*((d-=2)*d*(((s*=1.525)+1)*d+s)+2)},easeInBounce:d=>1-I2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?I2.easeInBounce(d*2)*.5:I2.easeOutBounce(d*2-1)*.5+.5};function wM(d){if(d&&typeof d=="object"){const s=d.toString();return s==="[object CanvasPattern]"||s==="[object CanvasGradient]"}return!1}function xP(d){return wM(d)?d:new q2(d)}function V8(d){return wM(d)?d:new q2(d).saturate(.5).darken(.1).hexString()}const Rut=["x","y","borderWidth","radius","tension"],But=["color","borderColor","backgroundColor"];function Nut(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:s=>s!=="onProgress"&&s!=="onComplete"&&s!=="fn"}),d.set("animations",{colors:{type:"color",properties:But},numbers:{type:"number",properties:Rut}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:s=>s|0}}}})}function jut(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _P=new Map;function Uut(d,s){s=s||{};const E=d+JSON.stringify(s);let B=_P.get(E);return B||(B=new Intl.NumberFormat(d,s),_P.set(E,B)),B}function kM(d,s,E){return Uut(s,E).format(d)}const Vut={values(d){return Yd(d)?d:""+d},numeric(d,s,E){if(d===0)return"0";const B=this.chart.options.locale;let K,dt=d;if(E.length>1){const re=Math.max(Math.abs(E[0].value),Math.abs(E[E.length-1].value));(re<1e-4||re>1e15)&&(K="scientific"),dt=Hut(d,E)}const _t=cD(Math.abs(dt)),It=isNaN(_t)?1:Math.max(Math.min(-1*Math.floor(_t),20),0),jt={notation:K,minimumFractionDigits:It,maximumFractionDigits:It};return Object.assign(jt,this.options.ticks.format),kM(d,B,jt)}};function Hut(d,s){let E=s.length>3?s[2].value-s[1].value:s[1].value-s[0].value;return Math.abs(E)>=1&&d!==Math.floor(d)&&(E=d-Math.floor(d)),E}var gD={formatters:Vut};function Wut(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(s,E)=>E.lineWidth,tickColor:(s,E)=>E.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:gD.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:s=>!s.startsWith("before")&&!s.startsWith("after")&&s!=="callback"&&s!=="parser",_indexable:s=>s!=="borderDash"&&s!=="tickBorderDash"&&s!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:s=>s!=="backdropPadding"&&s!=="callback",_indexable:s=>s!=="backdropPadding"})}const Iy=Object.create(null),PA=Object.create(null);function z2(d,s){if(!s)return d;const E=s.split(".");for(let B=0,K=E.length;BB.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(B,K)=>V8(K.backgroundColor),this.hoverBorderColor=(B,K)=>V8(K.borderColor),this.hoverColor=(B,K)=>V8(K.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(s),this.apply(E)}set(s,E){return H8(this,s,E)}get(s){return z2(this,s)}describe(s,E){return H8(PA,s,E)}override(s,E){return H8(Iy,s,E)}route(s,E,B,K){const dt=z2(this,s),_t=z2(this,B),It="_"+E;Object.defineProperties(dt,{[It]:{value:dt[E],writable:!0},[E]:{enumerable:!0,get(){const jt=this[It],re=_t[K];return Sc(jt)?Object.assign({},re,jt):cc(jt,re)},set(jt){this[It]=jt}}})}apply(s){s.forEach(E=>E(this))}}var Rd=new qut({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Nut,jut,Wut]);function $ut(d){return!d||Nh(d.size)||Nh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function bP(d,s,E,B,K){let dt=s[K];return dt||(dt=s[K]=d.measureText(K).width,E.push(K)),dt>B&&(B=dt),B}function dy(d,s,E){const B=d.currentDevicePixelRatio,K=E!==0?Math.max(E/2,.5):0;return Math.round((s-K)*B)/B+K}function wP(d,s){!s&&!d||(s=s||d.getContext("2d"),s.save(),s.resetTransform(),s.clearRect(0,0,d.width,d.height),s.restore())}function IA(d,s,E,B){vD(d,s,E,B,null)}function vD(d,s,E,B,K){let dt,_t,It,jt,re,se,we,tr;const fr=s.pointStyle,Mr=s.rotation,xr=s.radius;let Dr=(Mr||0)*wut;if(fr&&typeof fr=="object"&&(dt=fr.toString(),dt==="[object HTMLImageElement]"||dt==="[object HTMLCanvasElement]")){d.save(),d.translate(E,B),d.rotate(Dr),d.drawImage(fr,-fr.width/2,-fr.height/2,fr.width,fr.height),d.restore();return}if(!(isNaN(xr)||xr<=0)){switch(d.beginPath(),fr){default:K?d.ellipse(E,B,K/2,xr,0,0,sd):d.arc(E,B,xr,0,sd),d.closePath();break;case"triangle":se=K?K/2:xr,d.moveTo(E+Math.sin(Dr)*se,B-Math.cos(Dr)*xr),Dr+=dP,d.lineTo(E+Math.sin(Dr)*se,B-Math.cos(Dr)*xr),Dr+=dP,d.lineTo(E+Math.sin(Dr)*se,B-Math.cos(Dr)*xr),d.closePath();break;case"rectRounded":re=xr*.516,jt=xr-re,_t=Math.cos(Dr+fy)*jt,we=Math.cos(Dr+fy)*(K?K/2-re:jt),It=Math.sin(Dr+fy)*jt,tr=Math.sin(Dr+fy)*(K?K/2-re:jt),d.arc(E-we,B-It,re,Dr-Qh,Dr-ip),d.arc(E+tr,B-_t,re,Dr-ip,Dr),d.arc(E+we,B+It,re,Dr,Dr+ip),d.arc(E-tr,B+_t,re,Dr+ip,Dr+Qh),d.closePath();break;case"rect":if(!Mr){jt=Math.SQRT1_2*xr,se=K?K/2:jt,d.rect(E-se,B-jt,2*se,2*jt);break}Dr+=fy;case"rectRot":we=Math.cos(Dr)*(K?K/2:xr),_t=Math.cos(Dr)*xr,It=Math.sin(Dr)*xr,tr=Math.sin(Dr)*(K?K/2:xr),d.moveTo(E-we,B-It),d.lineTo(E+tr,B-_t),d.lineTo(E+we,B+It),d.lineTo(E-tr,B+_t),d.closePath();break;case"crossRot":Dr+=fy;case"cross":we=Math.cos(Dr)*(K?K/2:xr),_t=Math.cos(Dr)*xr,It=Math.sin(Dr)*xr,tr=Math.sin(Dr)*(K?K/2:xr),d.moveTo(E-we,B-It),d.lineTo(E+we,B+It),d.moveTo(E+tr,B-_t),d.lineTo(E-tr,B+_t);break;case"star":we=Math.cos(Dr)*(K?K/2:xr),_t=Math.cos(Dr)*xr,It=Math.sin(Dr)*xr,tr=Math.sin(Dr)*(K?K/2:xr),d.moveTo(E-we,B-It),d.lineTo(E+we,B+It),d.moveTo(E+tr,B-_t),d.lineTo(E-tr,B+_t),Dr+=fy,we=Math.cos(Dr)*(K?K/2:xr),_t=Math.cos(Dr)*xr,It=Math.sin(Dr)*xr,tr=Math.sin(Dr)*(K?K/2:xr),d.moveTo(E-we,B-It),d.lineTo(E+we,B+It),d.moveTo(E+tr,B-_t),d.lineTo(E-tr,B+_t);break;case"line":_t=K?K/2:Math.cos(Dr)*xr,It=Math.sin(Dr)*xr,d.moveTo(E-_t,B-It),d.lineTo(E+_t,B+It);break;case"dash":d.moveTo(E,B),d.lineTo(E+Math.cos(Dr)*(K?K/2:xr),B+Math.sin(Dr)*xr);break;case!1:d.closePath();break}d.fill(),s.borderWidth>0&&d.stroke()}}function K2(d,s,E){return E=E||.5,!s||d&&d.x>s.left-E&&d.xs.top-E&&d.y0&&dt.strokeColor!=="";let jt,re;for(d.save(),d.font=K.string,Yut(d,dt),jt=0;jt<_t.length;++jt)re=_t[jt],dt.backdrop&&Xut(d,dt.backdrop),It&&(dt.strokeColor&&(d.strokeStyle=dt.strokeColor),Nh(dt.strokeWidth)||(d.lineWidth=dt.strokeWidth),d.strokeText(re,E,B,dt.maxWidth)),d.fillText(re,E,B,dt.maxWidth),Kut(d,E,B,re,dt),B+=Number(K.lineHeight);d.restore()}function w4(d,s){const{x:E,y:B,w:K,h:dt,radius:_t}=s;d.arc(E+_t.topLeft,B+_t.topLeft,_t.topLeft,1.5*Qh,Qh,!0),d.lineTo(E,B+dt-_t.bottomLeft),d.arc(E+_t.bottomLeft,B+dt-_t.bottomLeft,_t.bottomLeft,Qh,ip,!0),d.lineTo(E+K-_t.bottomRight,B+dt),d.arc(E+K-_t.bottomRight,B+dt-_t.bottomRight,_t.bottomRight,ip,0,!0),d.lineTo(E+K,B+_t.topRight),d.arc(E+K-_t.topRight,B+_t.topRight,_t.topRight,0,-ip,!0),d.lineTo(E+_t.topLeft,B)}const Jut=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qut=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tct(d,s){const E=(""+d).match(Jut);if(!E||E[1]==="normal")return s*1.2;switch(d=+E[2],E[3]){case"px":return d;case"%":d/=100;break}return s*d}const ect=d=>+d||0;function TM(d,s){const E={},B=Sc(s),K=B?Object.keys(s):s,dt=Sc(d)?B?_t=>cc(d[_t],d[s[_t]]):_t=>d[_t]:()=>d;for(const _t of K)E[_t]=ect(dt(_t));return E}function yD(d){return TM(d,{top:"y",right:"x",bottom:"y",left:"x"})}function f_(d){return TM(d,["topLeft","topRight","bottomLeft","bottomRight"])}function fm(d){const s=yD(d);return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Qp(d,s){d=d||{},s=s||Rd.font;let E=cc(d.size,s.size);typeof E=="string"&&(E=parseInt(E,10));let B=cc(d.style,s.style);B&&!(""+B).match(Qut)&&(console.warn('Invalid font style specified: "'+B+'"'),B=void 0);const K={family:cc(d.family,s.family),lineHeight:tct(cc(d.lineHeight,s.lineHeight),E),size:E,style:B,weight:cc(d.weight,s.weight),string:""};return K.string=$ut(K),K}function N5(d,s,E,B){let K,dt,_t;for(K=0,dt=d.length;KE&&It===0?0:It+jt;return{min:_t(B,-Math.abs(dt)),max:_t(K,dt)}}function Dy(d,s){return Object.assign(Object.create(d),s)}function AM(d,s=[""],E,B,K=()=>d[0]){const dt=E||d;typeof B>"u"&&(B=wD("_fallback",d));const _t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:dt,_fallback:B,_getTarget:K,override:It=>AM([It,...d],s,dt,B)};return new Proxy(_t,{deleteProperty(It,jt){return delete It[jt],delete It._keys,delete d[0][jt],!0},get(It,jt){return _D(It,jt,()=>cct(jt,s,d,It))},getOwnPropertyDescriptor(It,jt){return Reflect.getOwnPropertyDescriptor(It._scopes[0],jt)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(It,jt){return TP(It).includes(jt)},ownKeys(It){return TP(It)},set(It,jt,re){const se=It._storage||(It._storage=K());return It[jt]=se[jt]=re,delete It._keys,!0}})}function __(d,s,E,B){const K={_cacheable:!1,_proxy:d,_context:s,_subProxy:E,_stack:new Set,_descriptors:xD(d,B),setContext:dt=>__(d,dt,E,B),override:dt=>__(d.override(dt),s,E,B)};return new Proxy(K,{deleteProperty(dt,_t){return delete dt[_t],delete d[_t],!0},get(dt,_t,It){return _D(dt,_t,()=>ict(dt,_t,It))},getOwnPropertyDescriptor(dt,_t){return dt._descriptors.allKeys?Reflect.has(d,_t)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,_t)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(dt,_t){return Reflect.has(d,_t)},ownKeys(){return Reflect.ownKeys(d)},set(dt,_t,It){return d[_t]=It,delete dt[_t],!0}})}function xD(d,s={scriptable:!0,indexable:!0}){const{_scriptable:E=s.scriptable,_indexable:B=s.indexable,_allKeys:K=s.allKeys}=d;return{allKeys:K,scriptable:E,indexable:B,isScriptable:b1(E)?E:()=>E,isIndexable:b1(B)?B:()=>B}}const nct=(d,s)=>d?d+xM(s):s,MM=(d,s)=>Sc(s)&&d!=="adapters"&&(Object.getPrototypeOf(s)===null||s.constructor===Object);function _D(d,s,E){if(Object.prototype.hasOwnProperty.call(d,s)||s==="constructor")return d[s];const B=E();return d[s]=B,B}function ict(d,s,E){const{_proxy:B,_context:K,_subProxy:dt,_descriptors:_t}=d;let It=B[s];return b1(It)&&_t.isScriptable(s)&&(It=act(s,It,d,E)),Yd(It)&&It.length&&(It=oct(s,It,d,_t.isIndexable)),MM(s,It)&&(It=__(It,K,dt&&dt[s],_t)),It}function act(d,s,E,B){const{_proxy:K,_context:dt,_subProxy:_t,_stack:It}=E;if(It.has(d))throw new Error("Recursion detected: "+Array.from(It).join("->")+"->"+d);It.add(d);let jt=s(dt,_t||B);return It.delete(d),MM(d,jt)&&(jt=SM(K._scopes,K,d,jt)),jt}function oct(d,s,E,B){const{_proxy:K,_context:dt,_subProxy:_t,_descriptors:It}=E;if(typeof dt.index<"u"&&B(d))return s[dt.index%s.length];if(Sc(s[0])){const jt=s,re=K._scopes.filter(se=>se!==jt);s=[];for(const se of jt){const we=SM(re,K,d,se);s.push(__(we,dt,_t&&_t[d],It))}}return s}function bD(d,s,E){return b1(d)?d(s,E):d}const sct=(d,s)=>d===!0?s:typeof d=="string"?Py(s,d):void 0;function lct(d,s,E,B,K){for(const dt of s){const _t=sct(E,dt);if(_t){d.add(_t);const It=bD(_t._fallback,E,K);if(typeof It<"u"&&It!==E&&It!==B)return It}else if(_t===!1&&typeof B<"u"&&E!==B)return null}return!1}function SM(d,s,E,B){const K=s._rootScopes,dt=bD(s._fallback,E,B),_t=[...d,...K],It=new Set;It.add(B);let jt=kP(It,_t,E,dt||E,B);return jt===null||typeof dt<"u"&&dt!==E&&(jt=kP(It,_t,dt,jt,B),jt===null)?!1:AM(Array.from(It),[""],K,dt,()=>uct(s,E,B))}function kP(d,s,E,B,K){for(;E;)E=lct(d,s,E,B,K);return E}function uct(d,s,E){const B=d._getTarget();s in B||(B[s]={});const K=B[s];return Yd(K)&&Sc(E)?E:K||{}}function cct(d,s,E,B){let K;for(const dt of s)if(K=wD(nct(dt,d),E),typeof K<"u")return MM(d,K)?SM(E,B,d,K):K}function wD(d,s){for(const E of s){if(!E)continue;const B=E[d];if(typeof B<"u")return B}}function TP(d){let s=d._keys;return s||(s=d._keys=hct(d._scopes)),s}function hct(d){const s=new Set;for(const E of d)for(const B of Object.keys(E).filter(K=>!K.startsWith("_")))s.add(B);return Array.from(s)}const fct=Number.EPSILON||1e-14,b_=(d,s)=>sd==="x"?"y":"x";function dct(d,s,E,B){const K=d.skip?s:d,dt=s,_t=E.skip?s:E,It=LA(dt,K),jt=LA(_t,dt);let re=It/(It+jt),se=jt/(It+jt);re=isNaN(re)?0:re,se=isNaN(se)?0:se;const we=B*re,tr=B*se;return{previous:{x:dt.x-we*(_t.x-K.x),y:dt.y-we*(_t.y-K.y)},next:{x:dt.x+tr*(_t.x-K.x),y:dt.y+tr*(_t.y-K.y)}}}function pct(d,s,E){const B=d.length;let K,dt,_t,It,jt,re=b_(d,0);for(let se=0;se