diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index 06b87302..0374d5bb 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.153 +0.9.154 diff --git a/frontend/dist/assets/CollisionExplorerModal-B0_yuX1j.js b/frontend/dist/assets/CollisionExplorerModal-B0_yuX1j.js new file mode 100644 index 00000000..9a4ac588 --- /dev/null +++ b/frontend/dist/assets/CollisionExplorerModal-B0_yuX1j.js @@ -0,0 +1 @@ +import{r as e,b as t,j as o,a8 as s,X as n,a6 as r,ap as a,aq as l,ar as i,as as c,ab as d,a0 as u}from"./vendor-react-C0qkT9dV.js";import{L as m}from"./leaflet-D_ckmI2R.js";import{c as h}from"./recharts-DRDKmvXb.js";import{c as x,y as p,e as f}from"./index-DrUSC4Ks.js";const y={DEFAULT:"#4338CA",AMBER:"#F59E0B",NEIGHBOR:"#39D98A",MUTED:"#6B7280",HIGHLIGHT:"#FBBF24"};function b(){if("undefined"==typeof document)return y;const e=document.documentElement,t=getComputedStyle(e);return{DEFAULT:t.getPropertyValue("--map-hub-color").trim()||y.DEFAULT,AMBER:t.getPropertyValue("--pkt-txt-msg").trim()||y.AMBER,NEIGHBOR:t.getPropertyValue("--accent-success").trim()||y.NEIGHBOR,MUTED:t.getPropertyValue("--text-muted").trim()||y.MUTED,HIGHLIGHT:t.getPropertyValue("--accent-secondary").trim()||y.HIGHLIGHT}}function v({hash:t,highlighted:s}){const[n,r]=e.useState(!1),a=e.useCallback(e=>{e.preventDefault(),e.stopPropagation(),function(e){if("undefined"!=typeof window&&(window.isSecureContext||"https:"===window.location.protocol||"localhost"===window.location.hostname)&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText)return navigator.clipboard.writeText(e).catch(()=>{}),!0;try{const t=window.scrollX,o=window.scrollY,s=document.createElement("textarea");s.value=e,s.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;pointer-events:none",s.setAttribute("readonly",""),document.body.appendChild(s),s.focus({preventScroll:!0}),s.select(),s.setSelectionRange(0,e.length);const n=document.execCommand("copy");return document.body.removeChild(s),window.scrollTo(t,o),n}catch{return!1}}(t),r(!0),setTimeout(()=>r(!1),2e3)},[t]),l=t.length>12?`${t.slice(0,12)}…`:t;return o.jsxs("button",{type:"button",onClick:a,className:h("inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-mono rounded transition-all","border border-border-subtle hover:border-border-strong cursor-pointer select-none",s?"bg-accent-secondary/20 border-accent-secondary/50":"bg-bg-subtle/80 hover:bg-bg-elevated"),title:`Click to copy: ${t}`,children:[o.jsx("span",{className:h("transition-colors",n?"text-accent-success":"text-text-secondary"),children:l}),n?o.jsx(d,{className:"w-2.5 h-2.5 text-accent-success"}):o.jsx(u,{className:"w-2.5 h-2.5 opacity-40"})]})}function g({node:e,className:t}){const s=b(),n=e.contactType.toLowerCase(),r="room server"===n||"room_server"===n||"room"===n||"server"===n,d="companion"===n||"client"===n||"cli"===n;return r&&e.isRepeater?o.jsxs("div",{className:h("relative",t),children:[o.jsx(a,{className:"w-full h-full",style:{color:s.AMBER}}),o.jsx(l,{className:"w-1/2 h-1/2 absolute -bottom-0.5 -right-0.5",style:{color:s.DEFAULT}})]}):r?o.jsx(a,{className:t,style:{color:s.AMBER}}):d?o.jsx(i,{className:h(t,"text-text-secondary")}):e.isRepeater?e.isNeighbor?o.jsx(c,{className:t,style:{color:s.NEIGHBOR}}):o.jsx(l,{className:t,style:{color:s.DEFAULT}}):o.jsx(i,{className:h(t,"text-text-secondary")})}function w({node:e,isHovered:t,onMouseEnter:s,onMouseLeave:n,onTouchStart:r}){return o.jsxs("div",{className:h("flex items-center gap-3 px-3 py-2.5 transition-colors rounded-lg",t?"bg-accent-secondary/10":"hover:bg-white/[0.03]"),onMouseEnter:s,onMouseLeave:n,onTouchStart:r,children:[o.jsx("div",{className:"flex-shrink-0 w-5 h-5",children:o.jsx(g,{node:e,className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:e.name}),e.isNeighbor&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-accent-success/20 text-accent-success",children:"NBR"}),e.isRepeater&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/10 text-text-secondary font-medium",children:"RPT"})]}),o.jsx("div",{className:"mt-1",children:o.jsx(v,{hash:e.hash,highlighted:t})})]})]})}function N({nodes:t,hoveredHash:s,onNodeHover:n,onNodeLeave:a}){const l=e.useRef(null),i=e.useRef(null),c=e.useRef(new Map),d=e.useMemo(()=>t.filter(e=>e.latitude&&e.longitude&&0!==e.latitude&&0!==e.longitude),[t]);return e.useEffect(()=>{if(!i.current||l.current)return;const e=m.map(i.current,{zoomControl:!0,attributionControl:!0});return m.tileLayer("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",{attribution:'© OSM © CARTO'}).addTo(e),l.current=e,()=>{e.remove(),l.current=null}},[]),e.useEffect(()=>{const e=l.current;if(!e)return;if(c.current.forEach(e=>e.remove()),c.current.clear(),0===d.length)return;const t=m.latLngBounds([]);for(const o of d){if(!o.latitude||!o.longitude)continue;const s=m.latLng(o.latitude,o.longitude);t.extend(s);const r=b(),l=o.isNeighbor?r.NEIGHBOR:r.DEFAULT,i=m.circleMarker(s,{radius:8,fillColor:l,fillOpacity:.8,color:"#fff",weight:2,opacity:.9});i.bindTooltip(o.name,{permanent:!1,direction:"top",offset:[0,-8],className:"collision-tooltip"}),i.on("mouseover",()=>n(o.hash)),i.on("mouseout",()=>a()),i.addTo(e),c.current.set(o.hash,i)}t.isValid()&&e.fitBounds(t,{padding:[40,40],maxZoom:12})},[d,n,a]),e.useEffect(()=>{c.current.forEach((e,t)=>{const o=d.find(e=>e.hash===t);if(!o)return;const n=b(),r=t===s,a=o.isNeighbor?n.NEIGHBOR:n.DEFAULT;e.setStyle({radius:r?12:8,fillColor:r?n.HIGHLIGHT:a,weight:r?3:2}),r?(e.openTooltip(),e.bringToFront()):e.closeTooltip()})},[s,d]),0===d.length?o.jsx("div",{className:"h-full flex items-center justify-center bg-bg-subtle/30 rounded-lg",children:o.jsxs("div",{className:"text-center text-text-secondary p-4",children:[o.jsx(r,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),o.jsx("p",{className:"text-sm",children:"No location data available"}),o.jsx("p",{className:"text-xs opacity-70",children:"Nodes need GPS coordinates to appear on the map"})]})}):o.jsx("div",{ref:i,className:"h-full w-full rounded-lg overflow-hidden"})}const j=e.memo(function({isOpen:r,prefix:a,candidateHashes:l,onClose:i}){const c=x(),d=p(),u=f(),[m,y]=e.useState(null),b=e.useMemo(()=>new Set(u.map(e=>e.hash)),[u]),v=null==c?void 0:c.neighbors,g=e.useMemo(()=>v?l.map(e=>{var t,o;const s=v[e];return{hash:e,name:(null==s?void 0:s.node_name)||(null==s?void 0:s.name)||`Unknown (${e.slice(0,8)}…)`,contactType:(null==s?void 0:s.contact_type)||"",isRepeater:(null==s?void 0:s.is_repeater)||"repeater"===(null==(t=null==s?void 0:s.contact_type)?void 0:t.toLowerCase())||"rep"===(null==(o=null==s?void 0:s.contact_type)?void 0:o.toLowerCase())||!1,isNeighbor:b.has(e),isHub:d.has(e),latitude:null==s?void 0:s.latitude,longitude:null==s?void 0:s.longitude,lastSeen:null==s?void 0:s.last_seen}}).sort((e,t)=>e.isNeighbor!==t.isNeighbor?e.isNeighbor?-1:1:e.name.localeCompare(t.name)):[],[l,v,b,d]),j=e.useCallback(e=>y(e),[]),E=e.useCallback(()=>y(null),[]);return e.useEffect(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&i()};window.addEventListener("keydown",e);const t=window.scrollY,o={overflow:document.body.style.overflow,position:document.body.style.position,width:document.body.style.width,top:document.body.style.top};return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${t}px`,()=>{window.removeEventListener("keydown",e),document.body.style.overflow=o.overflow,document.body.style.position=o.position,document.body.style.width=o.width,document.body.style.top=o.top,window.scrollTo(0,t)}},[r,i]),r?t.createPortal(o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[10010] flex items-end sm:items-center justify-center",onClick:i,role:"dialog","aria-modal":"true","aria-labelledby":"collision-modal-title",children:o.jsxs("div",{className:h("glass-card-elevated w-full flex flex-col","max-h-[85vh] rounded-t-2xl rounded-b-none","sm:max-w-2xl sm:mx-4 sm:rounded-xl sm:max-h-[80vh]","pb-safe"),onClick:e=>e.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-subtle flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-signal-fair/10",children:o.jsx(s,{className:"w-5 h-5 text-signal-fair"})}),o.jsxs("div",{children:[o.jsxs("h3",{id:"collision-modal-title",className:"text-base font-semibold text-text-primary",children:["Prefix Collision: ",o.jsx("span",{className:"font-mono text-accent-primary",children:a})]}),o.jsxs("p",{className:"text-xs text-text-secondary",children:[g.length," nodes share this prefix"]})]})]}),o.jsx("button",{onClick:i,className:"p-2 rounded-lg text-text-secondary hover:text-text-primary hover:bg-bg-subtle transition-colors",children:o.jsx(n,{className:"w-5 h-5"})})]}),o.jsxs("div",{className:"flex-1 min-h-0 flex flex-col sm:flex-row overflow-hidden",children:[o.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto sm:max-w-[280px] sm:border-r sm:border-border-subtle",children:o.jsx("div",{className:"p-2",children:g.map(e=>o.jsx(w,{node:e,isHovered:m===e.hash,onMouseEnter:()=>j(e.hash),onMouseLeave:E,onTouchStart:()=>j(e.hash)},e.hash))})}),o.jsx("div",{className:"h-48 sm:h-auto sm:flex-1 p-2 flex-shrink-0",children:o.jsx(N,{nodes:g,hoveredHash:m,onNodeHover:j,onNodeLeave:E})})]})]})}),document.body):null});export{j as C}; diff --git a/frontend/dist/assets/CollisionExplorerModal-DdrurDtW.js b/frontend/dist/assets/CollisionExplorerModal-DdrurDtW.js deleted file mode 100644 index d9e60482..00000000 --- a/frontend/dist/assets/CollisionExplorerModal-DdrurDtW.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,b as t,j as o,a8 as s,X as n,a6 as r,ap as a,aq as l,ar as i,as as c,ab as d,a0 as u}from"./vendor-react-C0qkT9dV.js";import{L as m}from"./leaflet-D_ckmI2R.js";import{c as h}from"./recharts-DRDKmvXb.js";import{d as x,z as p,f}from"./index-wYLFmyyS.js";const y={DEFAULT:"#4338CA",AMBER:"#F59E0B",NEIGHBOR:"#39D98A",MUTED:"#6B7280",HIGHLIGHT:"#FBBF24"};function b(){if("undefined"==typeof document)return y;const e=document.documentElement,t=getComputedStyle(e);return{DEFAULT:t.getPropertyValue("--map-hub-color").trim()||y.DEFAULT,AMBER:t.getPropertyValue("--pkt-txt-msg").trim()||y.AMBER,NEIGHBOR:t.getPropertyValue("--accent-success").trim()||y.NEIGHBOR,MUTED:t.getPropertyValue("--text-muted").trim()||y.MUTED,HIGHLIGHT:t.getPropertyValue("--accent-secondary").trim()||y.HIGHLIGHT}}function v({hash:t,highlighted:s}){const[n,r]=e.useState(!1),a=e.useCallback(e=>{e.preventDefault(),e.stopPropagation(),function(e){if("undefined"!=typeof window&&(window.isSecureContext||"https:"===window.location.protocol||"localhost"===window.location.hostname)&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText)return navigator.clipboard.writeText(e).catch(()=>{}),!0;try{const t=window.scrollX,o=window.scrollY,s=document.createElement("textarea");s.value=e,s.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;pointer-events:none",s.setAttribute("readonly",""),document.body.appendChild(s),s.focus({preventScroll:!0}),s.select(),s.setSelectionRange(0,e.length);const n=document.execCommand("copy");return document.body.removeChild(s),window.scrollTo(t,o),n}catch{return!1}}(t),r(!0),setTimeout(()=>r(!1),2e3)},[t]),l=t.length>12?`${t.slice(0,12)}…`:t;return o.jsxs("button",{type:"button",onClick:a,className:h("inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-mono rounded transition-all","border border-border-subtle hover:border-border-strong cursor-pointer select-none",s?"bg-accent-secondary/20 border-accent-secondary/50":"bg-bg-subtle/80 hover:bg-bg-elevated"),title:`Click to copy: ${t}`,children:[o.jsx("span",{className:h("transition-colors",n?"text-accent-success":"text-text-secondary"),children:l}),n?o.jsx(d,{className:"w-2.5 h-2.5 text-accent-success"}):o.jsx(u,{className:"w-2.5 h-2.5 opacity-40"})]})}function g({node:e,className:t}){const s=b(),n=e.contactType.toLowerCase(),r="room server"===n||"room_server"===n||"room"===n||"server"===n,d="companion"===n||"client"===n||"cli"===n;return r&&e.isRepeater?o.jsxs("div",{className:h("relative",t),children:[o.jsx(a,{className:"w-full h-full",style:{color:s.AMBER}}),o.jsx(l,{className:"w-1/2 h-1/2 absolute -bottom-0.5 -right-0.5",style:{color:s.DEFAULT}})]}):r?o.jsx(a,{className:t,style:{color:s.AMBER}}):d?o.jsx(i,{className:h(t,"text-text-secondary")}):e.isRepeater?e.isNeighbor?o.jsx(c,{className:t,style:{color:s.NEIGHBOR}}):o.jsx(l,{className:t,style:{color:s.DEFAULT}}):o.jsx(i,{className:h(t,"text-text-secondary")})}function w({node:e,isHovered:t,onMouseEnter:s,onMouseLeave:n,onTouchStart:r}){return o.jsxs("div",{className:h("flex items-center gap-3 px-3 py-2.5 transition-colors rounded-lg",t?"bg-accent-secondary/10":"hover:bg-white/[0.03]"),onMouseEnter:s,onMouseLeave:n,onTouchStart:r,children:[o.jsx("div",{className:"flex-shrink-0 w-5 h-5",children:o.jsx(g,{node:e,className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:e.name}),e.isNeighbor&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-accent-success/20 text-accent-success",children:"NBR"}),e.isRepeater&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/10 text-text-secondary font-medium",children:"RPT"})]}),o.jsx("div",{className:"mt-1",children:o.jsx(v,{hash:e.hash,highlighted:t})})]})]})}function N({nodes:t,hoveredHash:s,onNodeHover:n,onNodeLeave:a}){const l=e.useRef(null),i=e.useRef(null),c=e.useRef(new Map),d=e.useMemo(()=>t.filter(e=>e.latitude&&e.longitude&&0!==e.latitude&&0!==e.longitude),[t]);return e.useEffect(()=>{if(!i.current||l.current)return;const e=m.map(i.current,{zoomControl:!0,attributionControl:!0});return m.tileLayer("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",{attribution:'© OSM © CARTO'}).addTo(e),l.current=e,()=>{e.remove(),l.current=null}},[]),e.useEffect(()=>{const e=l.current;if(!e)return;if(c.current.forEach(e=>e.remove()),c.current.clear(),0===d.length)return;const t=m.latLngBounds([]);for(const o of d){if(!o.latitude||!o.longitude)continue;const s=m.latLng(o.latitude,o.longitude);t.extend(s);const r=b(),l=o.isNeighbor?r.NEIGHBOR:r.DEFAULT,i=m.circleMarker(s,{radius:8,fillColor:l,fillOpacity:.8,color:"#fff",weight:2,opacity:.9});i.bindTooltip(o.name,{permanent:!1,direction:"top",offset:[0,-8],className:"collision-tooltip"}),i.on("mouseover",()=>n(o.hash)),i.on("mouseout",()=>a()),i.addTo(e),c.current.set(o.hash,i)}t.isValid()&&e.fitBounds(t,{padding:[40,40],maxZoom:12})},[d,n,a]),e.useEffect(()=>{c.current.forEach((e,t)=>{const o=d.find(e=>e.hash===t);if(!o)return;const n=b(),r=t===s,a=o.isNeighbor?n.NEIGHBOR:n.DEFAULT;e.setStyle({radius:r?12:8,fillColor:r?n.HIGHLIGHT:a,weight:r?3:2}),r?(e.openTooltip(),e.bringToFront()):e.closeTooltip()})},[s,d]),0===d.length?o.jsx("div",{className:"h-full flex items-center justify-center bg-bg-subtle/30 rounded-lg",children:o.jsxs("div",{className:"text-center text-text-secondary p-4",children:[o.jsx(r,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),o.jsx("p",{className:"text-sm",children:"No location data available"}),o.jsx("p",{className:"text-xs opacity-70",children:"Nodes need GPS coordinates to appear on the map"})]})}):o.jsx("div",{ref:i,className:"h-full w-full rounded-lg overflow-hidden"})}const j=e.memo(function({isOpen:r,prefix:a,candidateHashes:l,onClose:i}){const c=x(),d=p(),u=f(),[m,y]=e.useState(null),b=e.useMemo(()=>new Set(u.map(e=>e.hash)),[u]),v=null==c?void 0:c.neighbors,g=e.useMemo(()=>v?l.map(e=>{var t,o;const s=v[e];return{hash:e,name:(null==s?void 0:s.node_name)||(null==s?void 0:s.name)||`Unknown (${e.slice(0,8)}…)`,contactType:(null==s?void 0:s.contact_type)||"",isRepeater:(null==s?void 0:s.is_repeater)||"repeater"===(null==(t=null==s?void 0:s.contact_type)?void 0:t.toLowerCase())||"rep"===(null==(o=null==s?void 0:s.contact_type)?void 0:o.toLowerCase())||!1,isNeighbor:b.has(e),isHub:d.has(e),latitude:null==s?void 0:s.latitude,longitude:null==s?void 0:s.longitude,lastSeen:null==s?void 0:s.last_seen}}).sort((e,t)=>e.isNeighbor!==t.isNeighbor?e.isNeighbor?-1:1:e.name.localeCompare(t.name)):[],[l,v,b,d]),j=e.useCallback(e=>y(e),[]),E=e.useCallback(()=>y(null),[]);return e.useEffect(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&i()};window.addEventListener("keydown",e);const t=window.scrollY,o={overflow:document.body.style.overflow,position:document.body.style.position,width:document.body.style.width,top:document.body.style.top};return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${t}px`,()=>{window.removeEventListener("keydown",e),document.body.style.overflow=o.overflow,document.body.style.position=o.position,document.body.style.width=o.width,document.body.style.top=o.top,window.scrollTo(0,t)}},[r,i]),r?t.createPortal(o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[10010] flex items-end sm:items-center justify-center",onClick:i,role:"dialog","aria-modal":"true","aria-labelledby":"collision-modal-title",children:o.jsxs("div",{className:h("glass-card-elevated w-full flex flex-col","max-h-[85vh] rounded-t-2xl rounded-b-none","sm:max-w-2xl sm:mx-4 sm:rounded-xl sm:max-h-[80vh]","pb-safe"),onClick:e=>e.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-subtle flex-shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-signal-fair/10",children:o.jsx(s,{className:"w-5 h-5 text-signal-fair"})}),o.jsxs("div",{children:[o.jsxs("h3",{id:"collision-modal-title",className:"text-base font-semibold text-text-primary",children:["Prefix Collision: ",o.jsx("span",{className:"font-mono text-accent-primary",children:a})]}),o.jsxs("p",{className:"text-xs text-text-secondary",children:[g.length," nodes share this prefix"]})]})]}),o.jsx("button",{onClick:i,className:"p-2 rounded-lg text-text-secondary hover:text-text-primary hover:bg-bg-subtle transition-colors",children:o.jsx(n,{className:"w-5 h-5"})})]}),o.jsxs("div",{className:"flex-1 min-h-0 flex flex-col sm:flex-row overflow-hidden",children:[o.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto sm:max-w-[280px] sm:border-r sm:border-border-subtle",children:o.jsx("div",{className:"p-2",children:g.map(e=>o.jsx(w,{node:e,isHovered:m===e.hash,onMouseEnter:()=>j(e.hash),onMouseLeave:E,onTouchStart:()=>j(e.hash)},e.hash))})}),o.jsx("div",{className:"h-48 sm:h-auto sm:flex-1 p-2 flex-shrink-0",children:o.jsx(N,{nodes:g,hoveredHash:m,onNodeHover:j,onNodeLeave:E})})]})]})}),document.body):null});export{j as C}; diff --git a/frontend/dist/assets/Configuration-BkRSvuMT.js b/frontend/dist/assets/Configuration-BkRSvuMT.js deleted file mode 100644 index bfe1cceb..00000000 --- a/frontend/dist/assets/Configuration-BkRSvuMT.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t,f as s,i as a,X as r,au as n,ab as l,aY as c,aZ as i,k as d,p as o,a_ as u,ag as x,a$ as m,b0 as p,b1 as h,aQ as b,aw as y,b2 as g,ak as f,b3 as j,a8 as v,a3 as N,a0 as w,aa as k,b4 as C}from"./vendor-react-C0qkT9dV.js";import{c as S}from"./recharts-DRDKmvXb.js";import{a0 as _,ak as T,al as F,L as E,am as L,an as P,ao as R,ap as A,aj as M,aq as I,ar as D,as as z,at as K,au as q,av as H,aw as O,ax as Y,ay as $}from"./index-wYLFmyyS.js";import{H as V}from"./HashBadge-CAy9V6Vn.js";import{C as B}from"./ConfirmModal-B37DcPi-.js";import{P as U,b as X,a as G,c as W}from"./PageLayout-DAadOF4d.js";import{R as Q,C as Z}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const J=e.memo(function(){const{theme:e}=_(),{colorScheme:s}=e,a=T.find(e=>e.colorScheme===s)??T[0],r=a.displaySize,n=`clamp(${.8*r}rem, ${.6*r}rem + 1.5vw, ${1.4*r}rem)`;return t.jsx("div",{className:"w-32 sm:w-40 flex items-center justify-center flex-shrink-0",children:t.jsx("span",{className:"font-medium transition-all duration-300 leading-none text-center truncate",style:{fontFamily:a.displayFont,color:a.displayColor,fontSize:n,fontOpticalSizing:"auto",letterSpacing:"-0.03em"},children:a.displayName})})}),ee=e.memo(function(){const{theme:s,setThemePreset:a,setBrightness:r}=_(),{colorScheme:n,brightness:l}=s,[c,i]=e.useState(!1),[d,o]=e.useState(!1),u=e.useRef(null),x=e.useRef(null),m=(T.find(e=>e.colorScheme===n)??T[0]).id,p=e.useCallback((e,t)=>{if(!x.current)return l;const s=(x.current.y-e)/(t?200:80)*100;return Math.round(Math.max(0,Math.min(100,x.current.brightness+s)))},[l]),h=e.useCallback(e=>{a(e),i(!0)},[a]),b=e.useCallback(e=>{r(e)},[r]),y=e.useCallback(e=>{const t=T.find(t=>t.id===e);t&&F(t.backgroundImage)},[]);return t.jsx("div",{className:"grid grid-cols-4 gap-2 flex-shrink-0",children:T.map(e=>{const s=m===e.id,a=s&&(c||d);return t.jsxs("div",{ref:s?u:void 0,title:e.displayName,className:S("flex flex-col items-center gap-1 p-0.5 rounded-sm transition-all duration-300 ease-out",s?"ring-2 ring-accent-primary scale-105 cursor-ns-resize":"cursor-pointer"),onMouseEnter:()=>{s?i(!0):y(e.id)},onMouseLeave:()=>!d&&i(!1),onClick:()=>!s&&h(e.id),onTouchStart:e=>{if(!s)return;e.preventDefault();const t=e.touches[0];x.current={y:t.clientY,brightness:l},o(!0),i(!0);const a=e=>{e.preventDefault();const t=e.touches[0];b(p(t.clientY,!0))},r=()=>{document.removeEventListener("touchmove",a),document.removeEventListener("touchend",r),x.current=null,o(!1),setTimeout(()=>i(!1),1500)};document.addEventListener("touchmove",a,{passive:!1}),document.addEventListener("touchend",r)},onMouseDown:e=>{if(!s)return;e.preventDefault(),x.current={y:e.clientY,brightness:l},o(!0),i(!0);const t=e=>{b(p(e.clientY,!1))},a=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",a),x.current=null,o(!1)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",a)},children:[t.jsxs("div",{className:"glass-thumbnail w-10 h-10",children:["kde breeze"===e.id?t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#242627]",style:{opacity:a?.4:1},children:t.jsx("span",{className:"text-[#58b99d] text-xl font-bold font-mono",children:">"})}):t.jsx("div",{className:"absolute bg-cover bg-center transition-opacity duration-200",style:{inset:0,backgroundImage:`url(${e.backgroundImage})`,opacity:a?.4:1,filter:"brightness(1.3)"}}),s&&t.jsxs("div",{className:S("absolute inset-0 transition-opacity duration-200",a?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-black/70 transition-all duration-100 ease-out",style:{height:100-l+"%"}}),t.jsx("div",{className:"absolute inset-x-1 h-0.5 bg-white rounded-full shadow-lg transition-all duration-100 ease-out",style:{top:100-l+"%"}}),t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsxs("span",{className:"text-[10px] font-mono font-bold text-white drop-shadow-lg",children:[l,"%"]})})]})]}),t.jsx("div",{className:"flex flex-col gap-0.5",children:e.paletteColors.map((e,s)=>t.jsx("div",{className:"flex gap-0.5 justify-center",children:e.map((e,s)=>t.jsx("div",{className:"w-1.5 h-1.5 rounded-xs",style:{backgroundColor:e}},s))},s))})]},e.id)})})}),te=e.memo(function({layout:e="horizontal"}){return"logo-only"===e?t.jsx(J,{}):"thumbnails-only"===e?t.jsx(ee,{}):"vertical"===e?t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx(J,{}),t.jsx(ee,{})]}):t.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(J,{})}),t.jsx("div",{className:"flex-shrink-0",children:t.jsx(ee,{})})]})}),se=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}],ae=[5,6,7,8,9,10,11,12],re=[{value:5,label:"4/5"},{value:6,label:"4/6"},{value:7,label:"4/7"},{value:8,label:"4/8"}],ne="radioConfig",le="repeaterSettings",ce="operatingMode";function ie({node:e,level:s,expandedKeys:a,selectedKeyId:r,globalFloodPolicy:n,onSelect:l,onToggle:c}){const i=a.has(e.id),d=r===e.id,o=e.children&&e.children.length>0,u="allow"===n;return t.jsxs("div",{children:[t.jsxs("div",{className:S("flex items-center gap-2 h-[36px] px-3 rounded-full cursor-pointer transition-colors",d?"bg-accent-primary/15":"hover:bg-white/[0.02]",u&&"opacity-50 cursor-not-allowed"),style:{marginLeft:16*s+"px"},onClick:()=>!u&&l(e.id),children:[o?t.jsx("button",{onClick:t=>{t.stopPropagation(),c(e.id)},className:"p-1 hover:bg-white/[0.05] rounded-full transition-colors",children:t.jsx(k,{className:S("w-3.5 h-3.5 text-text-muted transition-transform",i&&"rotate-90")})}):t.jsx("span",{className:"w-5"}),t.jsx(C,{className:"w-4 h-4 text-accent-primary flex-shrink-0"}),t.jsx("span",{className:"type-data text-text-primary flex-1 truncate",children:e.name}),t.jsx("span",{className:S("type-data-xs px-2 py-0.5 rounded-full","allow"===e.floodPolicy?"bg-accent-success/15 text-accent-success":"bg-accent-danger/15 text-accent-danger"),children:"allow"===e.floodPolicy?"Allow":"Deny"})]}),o&&i&&t.jsx("div",{children:e.children.map(e=>t.jsx(ie,{node:e,level:s+1,expandedKeys:a,selectedKeyId:r,globalFloodPolicy:n,onSelect:l,onToggle:c},e.id))})]})}function de(){var k,C,_,T,F,J;const{stats:ee,setMode:de,clearModeMutation:oe,setDutyCycleConfig:ue,clearDutyCycleMutation:xe,fetchStats:me,startMutation:pe,clearMutation:he}=E(),be=null==(k=null==ee?void 0:ee.config)?void 0:k.radio,ye=null==(C=null==ee?void 0:ee.config)?void 0:C.repeater,ge=null==(_=null==ee?void 0:ee.config)?void 0:_.duty_cycle,fe=(null==ee?void 0:ee.node_name)||(null==(T=null==ee?void 0:ee.config)?void 0:T.node_name)||"Unknown Node",je=(null==ye?void 0:ye.mode)??"forward",ve=(null==ge?void 0:ge.enforcement_enabled)??!1,Ne=null==(F=null==ee?void 0:ee.config)?void 0:F.delays,[we,ke]=e.useState(!1),[Ce,Se]=e.useState(""),[_e,Te]=e.useState(62.5),[Fe,Ee]=e.useState(7),[Le,Pe]=e.useState(5),[Re,Ae]=e.useState(""),[Me,Ie]=e.useState("idle"),[De,ze]=e.useState(null),Ke=e.useRef(null),qe=e.useRef(null),[He,Oe]=e.useState(!1),[Ye,$e]=e.useState(""),[Ve,Be]=e.useState(""),[Ue,Xe]=e.useState(""),[Ge,We]=e.useState("idle"),Qe=e.useRef(null),Ze=e.useRef(null),[Je,et]=e.useState(!1),[tt,st]=e.useState(""),[at,rt]=e.useState(""),[nt,lt]=e.useState(""),[ct,it]=e.useState(""),[dt,ot]=e.useState("idle"),[ut,xt]=e.useState(null),mt=e.useRef(null),pt=e.useRef(null),[ht,bt]=e.useState("idle"),[yt,gt]=e.useState("idle"),[ft,jt]=e.useState(null),[vt,Nt]=e.useState(null),wt=e.useRef(!0),kt=e.useRef(null),Ct=e.useRef(null),St=e.useRef(null),_t=e.useRef(null),Tt=e.useRef(!1),Ft=e.useRef(!1);e.useEffect(()=>(wt.current=!0,()=>{wt.current=!1,kt.current&&clearTimeout(kt.current),Ct.current&&clearTimeout(Ct.current),St.current&&clearTimeout(St.current),_t.current&&clearTimeout(_t.current),Mt.current&&clearTimeout(Mt.current),It.current&&clearTimeout(It.current),qe.current&&clearTimeout(qe.current),Qe.current&&clearTimeout(Qe.current),pt.current&&clearTimeout(pt.current)}),[]),e.useEffect(()=>{const e=e=>{if(we||Je||He)return e.preventDefault(),e.returnValue="You have unsaved changes. Are you sure you want to leave?",e.returnValue};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[we,Je,He]);const Et=null==(J=null==ee?void 0:ee.config)?void 0:J.web,[Lt,Pt]=e.useState("idle"),[Rt,At]=e.useState(null),Mt=e.useRef(null),It=e.useRef(null),Dt=e.useRef(!1),[zt,Kt]=e.useState([]),[qt,Ht]=e.useState(!1),[Ot,Yt]=e.useState(null),[$t,Vt]=e.useState(!1),[Bt,Ut]=e.useState(""),[Xt,Gt]=e.useState(null),[Wt,Qt]=e.useState(!1),[Zt,Jt]=e.useState(null),[es,ts]=e.useState(!1),[ss,as]=e.useState(!1),[rs,ns]=e.useState(!1),[ls,cs]=e.useState([]),[is,ds]=e.useState(!1),[os,us]=e.useState(null),[xs,ms]=e.useState("deny"),[ps,hs]=e.useState(!1),[bs,ys]=e.useState(null),[gs,fs]=e.useState(new Set),[js,vs]=e.useState(!1),[Ns,ws]=e.useState(!1),[ks,Cs]=e.useState(!1),[Ss,_s]=e.useState(null),[Ts,Fs]=e.useState(null),[Es,Ls]=e.useState(""),[Ps,Rs]=e.useState("deny"),[As,Ms]=e.useState(!1),[Is,Ds]=e.useState(!0),[zs,Ks]=e.useState(!1),[qs,Hs]=e.useState(!0),[Os,Ys]=e.useState("idle"),[$s,Vs]=e.useState(!1),[Bs,Us]=e.useState(!1),Xs=e.useRef(!1);e.useEffect(()=>{const e=we&&!Xs.current;Xs.current=we,be&&e&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Pe(be.coding_rate),Ae(String(be.tx_power)))},[be,we]);const Gs=e.useMemo(()=>{if(!be||!we)return!1;const e=be.frequency/1e6,t=be.bandwidth/1e3,s=parseFloat(Ce)||0;return Math.abs(s-e)>1e-4||_e!==t||Fe!==be.spreading_factor||Le!==be.coding_rate||parseInt(Re)!==be.tx_power},[be,we,Ce,_e,Fe,Le,Re]),Ws=e.useCallback(()=>{ke(!1),ze(null),be&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Pe(be.coding_rate),Ae(String(be.tx_power)))},[be]);e.useEffect(()=>{if(!we)return;const e=e=>{"loading"!==Me&&Ke.current&&!Ke.current.contains(e.target)&&Ws()};return document.addEventListener("mouseup",e),()=>{document.removeEventListener("mouseup",e)}},[we,Ws,Me]);const Qs=e.useCallback(()=>{const e=null==Ne?void 0:Ne.tx_delay_factor;return e&&"object"==typeof e&&"parsedValue"in e?e.parsedValue??1:"number"==typeof e?e:1},[Ne]),Zs=e.useCallback(()=>{const e=null==Ne?void 0:Ne.direct_tx_delay_factor;return"number"==typeof e?e:.5},[Ne]),Js=e.useCallback(()=>{const e=null==ge?void 0:ge.max_airtime_percent;return"number"==typeof e?e:e&&"object"==typeof e&&"parsedValue"in e?e.parsedValue??6:6},[ge]),ea=e.useCallback(()=>{$e(Qs().toFixed(2)),Be(Zs().toFixed(2)),Xe(Js().toFixed(1)),Oe(!0)},[Qs,Zs,Js]),ta=e.useCallback(()=>{Oe(!1)},[]);e.useEffect(()=>{if(!He)return;const e=e=>{"loading"!==Ge&&Ze.current&&!Ze.current.contains(e.target)&&ta()};return document.addEventListener("mouseup",e),()=>document.removeEventListener("mouseup",e)},[He,ta,Ge]);const sa=e.useCallback(()=>{var e,t,s;st(fe),rt((null==(e=null==ye?void 0:ye.latitude)?void 0:e.toString())||"0"),lt((null==(t=null==ye?void 0:ye.longitude)?void 0:t.toString())||"0"),it((null==(s=null==ye?void 0:ye.send_advert_interval_hours)?void 0:s.toString())||"0"),xt(null),et(!0)},[fe,ye]),aa=e.useCallback(()=>{et(!1),xt(null)},[]);e.useEffect(()=>{if(!Je)return;const e=e=>{"loading"!==dt&&mt.current&&!mt.current.contains(e.target)&&aa()};return document.addEventListener("mouseup",e),()=>document.removeEventListener("mouseup",e)},[Je,aa,dt]);const ra=async()=>{var e;if("loading"===Lt)return;const t=(null==Et?void 0:Et.cors_enabled)??!1,s=!t,a=t;Mt.current&&clearTimeout(Mt.current),It.current&&clearTimeout(It.current),Dt.current=!1,At(s),Pt("loading"),Mt.current=setTimeout(()=>{Dt.current||wt.current&&(At(a),Pt("error"),It.current=setTimeout(()=>{wt.current&&(Pt("idle"),At(null))},2e3))},1e4);try{const t=await I({web:{cors_enabled:s}});if(Dt.current=!0,Mt.current&&clearTimeout(Mt.current),!wt.current)return;t.success||(null==(e=t.data)?void 0:e.persisted)?(await me(),Pt("success"),It.current=setTimeout(()=>{wt.current&&(Pt("idle"),At(null))},2e3)):(At(a),Pt("error"),It.current=setTimeout(()=>{wt.current&&(Pt("idle"),At(null))},2e3))}catch{if(Dt.current=!0,Mt.current&&clearTimeout(Mt.current),!wt.current)return;At(a),Pt("error"),It.current=setTimeout(()=>{wt.current&&(Pt("idle"),At(null))},2e3)}};e.useEffect(()=>{(async()=>{Hs(!0);try{const e=await D();e.success&&e.data?Ks(e.data.exists):Ks(!1);const t=null==Et?void 0:Et.web_path;Ds(!t||""===t)}catch{Ks(!1)}finally{Hs(!1)}})()},[null==Et?void 0:Et.web_path]);const na=async e=>{var t;if("loading"!==Os){Ys("loading");try{const s=await I({web:{web_path:e?null:"/opt/pymc_console/web/html"}});if(!wt.current)return;s.success||(null==(t=s.data)?void 0:t.persisted)?(Ds(e),Ys("success"),Vs(!0),setTimeout(()=>{wt.current&&Ys("idle")},2e3)):(Ys("error"),setTimeout(()=>{wt.current&&Ys("idle")},2e3))}catch{if(!wt.current)return;Ys("error"),setTimeout(()=>{wt.current&&Ys("idle")},2e3)}}},la=e.useCallback(async()=>{Ht(!0),Yt(null);try{const e=await L();Kt(e.tokens||[])}catch(e){Yt(e instanceof Error?e.message:"Failed to fetch tokens")}finally{Ht(!1)}},[]);e.useEffect(()=>{la()},[la]);const ca=async()=>{if(Bt.trim()){ts(!0),Yt(null);try{const e=await K(Bt.trim());Gt(e.token||null),Vt(!1),Qt(!0),Ut(""),await la()}catch(e){Yt(e instanceof Error?e.message:"Failed to create token")}finally{ts(!1)}}else Yt("Token name is required")},ia=e=>e?new Date(1e3*e).toLocaleString():"Never",da=e.useCallback(e=>{const t=new Map,s=[];return e.forEach(e=>{const s={id:e.id,name:e.name,floodPolicy:e.flood_policy,transport_key:e.transport_key,last_used:e.last_used,parent_id:e.parent_id,children:[]};t.set(e.id,s)}),t.forEach(e=>{e.parent_id&&t.has(e.parent_id)?t.get(e.parent_id).children.push(e):s.push(e)}),s},[]),oa=e.useCallback(async()=>{ds(!0),us(null);try{const e=await P();e.success&&e.data?cs(da(e.data)):us(e.error||"Failed to load transport keys")}catch(e){us(e instanceof Error?e.message:"Unknown error occurred")}finally{ds(!1)}},[da]);e.useEffect(()=>{oa()},[oa]);const ua=e.useCallback((e,t)=>{for(const s of e){if(s.id===t)return s;if(s.children){const e=ua(s.children,t);if(e)return e}}return null},[]),xa=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);return null==e?void 0:e.name},[bs,ls,ua]),ma=e.useCallback(e=>{fs(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),pa=async e=>{hs(!0),us(null);try{const t=await H("allow"===e);t.success?ms(e):us(t.error||"Failed to update global flood policy")}catch(t){us(t instanceof Error?t.message:"Failed to update global flood policy")}finally{hs(!1)}},ha=async()=>{if(Es.trim()){Ms(!0),us(null);try{const e=await O({name:Es.trim(),flood_policy:Ps,parent_id:bs??void 0});e.success?(await oa(),vs(!1),Ls(""),Rs("deny")):us(e.error||"Failed to add transport key")}catch(e){us(e instanceof Error?e.message:"Failed to add transport key")}finally{Ms(!1)}}else us("Key name is required")},ba=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);e&&(_s({...e}),ws(!0))},[bs,ls,ua]);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&(js&&(vs(!1),Ls(""),Rs("deny")),Ns&&(ws(!1),_s(null)),ks&&(Cs(!1),Fs(null)),$t&&(Vt(!1),Ut("")),Wt&&(Qt(!1),Gt(null)))};if(js||Ns||ks||$t||Wt)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[js,Ns,ks,$t,Wt]);const ya=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);e&&(Fs(e),Cs(!0))},[bs,ls,ua]);return t.jsxs(U,{children:[t.jsx(X,{title:"Configuration",icon:t.jsx(s,{})}),t.jsxs(Q,{template:"standard",children:[t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:mt,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-2",children:[t.jsx(a,{className:"icon-md text-accent-primary"}),"Repeater Settings"]}),t.jsx("div",{className:"flex items-center gap-1",children:ye&&(Je?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:aa,disabled:"loading"===dt,className:S("p-2 rounded-lg transition-colors","loading"===dt?"text-text-muted cursor-not-allowed":"text-text-muted hover:text-accent-danger hover:bg-accent-danger/10"),title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})}),t.jsx("button",{onClick:async()=>{if("loading"!==dt){pt.current&&clearTimeout(pt.current),pe(le),ot("loading"),xt(null);try{const e={};tt&&tt!==fe&&(e.node_name=tt);const t=parseFloat(at);isNaN(t)||t===(null==ye?void 0:ye.latitude)||(e.latitude=t);const s=parseFloat(nt);isNaN(s)||s===(null==ye?void 0:ye.longitude)||(e.longitude=s);const a=parseInt(ct);if(isNaN(a)||a===(null==ye?void 0:ye.send_advert_interval_hours)||(e.flood_advert_interval_hours=a),0===Object.keys(e).length)return xt({success:!0,message:"No changes to save"}),ot("idle"),void he(le);const r=await M(e);if(!wt.current)return void he(le);if(r.success&&r.data){const e=r.data.applied.join(", ");xt({success:!0,message:`Updated: ${e}`}),await me({force:!0}),ot("success"),pt.current=setTimeout(()=>{wt.current&&(ot("idle"),et(!1),xt(null),he(le))},1500)}else xt({success:!1,message:r.error||"Failed to save"}),ot("error"),he(le),pt.current=setTimeout(()=>{wt.current&&ot("idle")},2e3)}catch(e){if(!wt.current)return void he(le);xt({success:!1,message:String(e)}),ot("error"),he(le),pt.current=setTimeout(()=>{wt.current&&ot("idle")},2e3)}}},disabled:"loading"===dt,className:S("p-2 rounded-lg transition-colors","loading"===dt?"text-accent-primary cursor-wait":"success"===dt?"text-accent-success":"error"===dt?"text-accent-danger":"text-accent-success hover:bg-accent-success/10"),title:"Save changes",children:"loading"===dt?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===dt?t.jsx(l,{className:"w-4 h-4"}):"error"===dt?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:sa,className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit repeater settings",children:t.jsx(c,{className:"w-4 h-4"})}))})]}),ut&&t.jsx("div",{className:S("text-xs mb-3 px-2 py-1.5 rounded-md",ut.success?"text-accent-success bg-accent-success/10":"text-accent-danger bg-accent-danger/10"),children:ut.message}),ye?t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"col-span-2",children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Node Name"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"text",value:tt,onChange:e=>st(e.target.value),maxLength:50,className:"w-full bg-transparent text-text-primary focus:outline-none type-data",placeholder:"Enter node name"}):t.jsx("span",{className:"type-data text-text-primary",children:fe})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Latitude (°)":"Latitude"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:at,onChange:e=>rt(e.target.value),step:"0.000001",min:"-90",max:"90",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:0!==ye.latitude?ye.latitude.toFixed(6):"Not set"})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Longitude (°)":"Longitude"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:nt,onChange:e=>lt(e.target.value),step:"0.000001",min:"-180",max:"180",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:0!==ye.longitude?ye.longitude.toFixed(6):"Not set"})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Advert Interval (hours)":"Advert Interval"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:ct,onChange:e=>it(e.target.value),min:"0",max:"48",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:ye.send_advert_interval_hours>0?`${ye.send_advert_interval_hours}h`:"Disabled"})}),Je&&t.jsx("p",{className:"type-data-xs text-text-muted mt-1 ml-4",children:"0 = disabled, 3-48 hours"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Score-based TX"}),t.jsx("div",{className:"h-[38px] rounded-full px-4 flex items-center bg-white/[0.02]",children:t.jsx("span",{className:"type-data text-text-primary",children:ye.use_score_for_tx?"Enabled":"Disabled"})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading repeater settings..."})]})})}),t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:Ke,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-2",children:[t.jsx(i,{className:"icon-md text-accent-primary"}),"Radio Configuration"]}),t.jsx("div",{className:"flex items-center gap-1",children:be&&(we?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:Ws,disabled:"loading"===Me,className:S("p-2 rounded-lg transition-colors","loading"===Me?"text-text-muted cursor-not-allowed":"text-text-muted hover:text-accent-danger hover:bg-accent-danger/10"),title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})}),t.jsx("button",{onClick:async()=>{if("loading"!==Me){qe.current&&clearTimeout(qe.current),pe(ne),Ie("loading"),ze(null);try{const e={},t=parseFloat(Ce),s=be?be.frequency/1e6:0;Math.abs(t-s)>1e-4&&(e.frequency_mhz=t);const a=be?be.bandwidth/1e3:0;_e!==a&&(e.bandwidth_khz=_e),Fe!==(null==be?void 0:be.spreading_factor)&&(e.spreading_factor=Fe),Le!==(null==be?void 0:be.coding_rate)&&(e.coding_rate=Le);const r=parseInt(Re);if(r!==(null==be?void 0:be.tx_power)&&(e.tx_power=r),0===Object.keys(e).length)return ze({success:!0,message:"No changes to save"}),Ie("idle"),void he(ne);const n=await M(e);if(!wt.current)return void he(ne);if(n.success&&n.data){const e=n.data.applied.join(", "),t=n.data.live_update?" (applied live)":" (restart required)";ze({success:!0,message:`Updated: ${e}${t}`}),await me({force:!0}),Ie("success"),qe.current=setTimeout(()=>{wt.current&&(Ie("idle"),ke(!1),ze(null),he(ne))},1500)}else ze({success:!1,message:n.error||"Failed to save"}),Ie("error"),he(ne),qe.current=setTimeout(()=>{wt.current&&Ie("idle")},2e3)}catch(e){if(!wt.current)return void he(ne);ze({success:!1,message:String(e)}),Ie("error"),he(ne),qe.current=setTimeout(()=>{wt.current&&Ie("idle")},2e3)}}},disabled:"loading"===Me||!Gs,className:S("p-2 rounded-lg transition-colors","loading"===Me?"text-accent-primary cursor-wait":"success"===Me?"text-accent-success":"error"===Me?"text-accent-danger":Gs?"text-accent-success hover:bg-accent-success/10":"text-text-muted cursor-not-allowed"),title:Gs?"Save changes":"No changes to save",children:"loading"===Me?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===Me?t.jsx(l,{className:"w-4 h-4"}):"error"===Me?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:()=>{be&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Pe(be.coding_rate),Ae(String(be.tx_power))),ze(null),ke(!0)},className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit radio settings",children:t.jsx(c,{className:"w-4 h-4"})}))})]}),De&&t.jsx("div",{className:S("text-xs mb-3 px-2 py-1.5 rounded-md",De.success?"text-accent-success bg-accent-success/10":"text-accent-danger bg-accent-danger/10"),children:De.message}),be?t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:we?"Frequency (MHz)":"Frequency"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsx("input",{type:"number",value:Ce,onChange:e=>Se(e.target.value),step:"0.001",min:"400",max:"930",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:R(be.frequency)})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:we?"TX Power (dBm)":"TX Power"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsx("input",{type:"number",value:Re,onChange:e=>Ae(e.target.value),min:"-9",max:"22",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsxs("span",{className:"type-data text-text-primary",children:[be.tx_power," dBm"]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Bandwidth"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:_e,onChange:e=>Te(parseFloat(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:se.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsx("span",{className:"type-data text-text-primary",children:A(be.bandwidth)})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Spreading Factor"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:Fe,onChange:e=>Ee(parseInt(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:ae.map(e=>t.jsxs("option",{value:e,children:["SF",e]},e))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:["SF",be.spreading_factor]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Coding Rate"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:Le,onChange:e=>Pe(parseInt(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:re.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:["4/",be.coding_rate]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Preamble"}),t.jsx("div",{className:"h-[38px] rounded-full px-4 flex items-center bg-white/[0.02]",children:t.jsxs("span",{className:"type-data text-text-primary",children:[be.preamble_length," symbols"]})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading radio configuration..."})]})})})]}),t.jsxs(Q,{template:"standard",children:[t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:Ze,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-3",children:[t.jsx(o,{className:"icon-md text-icon-card-title"}),"Operating Mode"]}),t.jsx("div",{className:"flex items-center gap-1",children:He?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"!==Ge){Qe.current&&clearTimeout(Qe.current),pe(ce),We("loading");try{const e=await M({tx_delay_factor:parseFloat(Ye),direct_tx_delay_factor:parseFloat(Ve)});if(await ue({max_airtime_percent:parseFloat(Ue),enforcement_enabled:ve}),!wt.current)return void he(ce);e.success&&e.data?(await me({force:!0}),We("success"),Qe.current=setTimeout(()=>{wt.current&&(We("idle"),Oe(!1),he(ce))},1500)):(We("error"),he(ce),Qe.current=setTimeout(()=>{wt.current&&We("idle")},2e3))}catch{if(!wt.current)return void he(ce);We("error"),he(ce),Qe.current=setTimeout(()=>{wt.current&&We("idle")},2e3)}}},disabled:"loading"===Ge,className:S("p-2 rounded-lg transition-colors","loading"===Ge?"text-accent-primary cursor-wait":"success"===Ge?"text-accent-success":"error"===Ge?"text-accent-danger":"text-accent-success hover:bg-accent-success/10"),title:"Save",children:"loading"===Ge?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===Ge?t.jsx(l,{className:"w-4 h-4"}):"error"===Ge?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})}),t.jsx("button",{onClick:ta,className:"p-2 rounded-lg text-text-muted hover:text-accent-danger hover:bg-accent-danger/10",title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:ea,className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit settings",children:t.jsx(c,{className:"w-4 h-4"})})})]}),t.jsx("p",{className:"type-label text-text-muted mb-3",children:"Control how the repeater handles packets"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[t.jsxs("div",{className:"flex-1 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Repeat"}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==ft?ft:"forward"===je;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"===ht)return;const t=!e,s="forward"===je;kt.current&&clearTimeout(kt.current),Ct.current&&clearTimeout(Ct.current),Tt.current=!1,jt(t),bt("loading"),kt.current=setTimeout(()=>{Tt.current||wt.current&&(jt(s),bt("error"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null))},2e3))},1e4);try{if(await de(t?"forward":"monitor"),Tt.current=!0,kt.current&&clearTimeout(kt.current),!wt.current)return;bt("success"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null),oe())},2e3)}catch{if(Tt.current=!0,kt.current&&clearTimeout(kt.current),!wt.current)return;jt(s),bt("error"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null))},2e3)}},disabled:"loading"===ht,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===ht&&"opacity-70"),"aria-label":"Toggle forward mode",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),t.jsx("span",{className:S("type-data text-sm w-7",e?"text-accent-success":"text-text-muted"),children:e?"On":"Off"}),"loading"===ht&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===ht&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===ht&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Duty Cycle"}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==vt?vt:ve;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"===yt)return;const t=!e,s=ve;St.current&&clearTimeout(St.current),_t.current&&clearTimeout(_t.current),Ft.current=!1,Nt(t),gt("loading"),St.current=setTimeout(()=>{Ft.current||wt.current&&(Nt(s),gt("error"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null))},2e3))},1e4);try{if(await ue({max_airtime_percent:Js(),enforcement_enabled:t}),Ft.current=!0,St.current&&clearTimeout(St.current),!wt.current)return;gt("success"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null),xe())},2e3)}catch{if(Ft.current=!0,St.current&&clearTimeout(St.current),!wt.current)return;Nt(s),gt("error"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null))},2e3)}},disabled:"loading"===yt,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===yt&&"opacity-70"),"aria-label":"Toggle duty cycle",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),t.jsx("span",{className:S("type-data text-sm w-7",e?"text-accent-success":"text-text-muted"),children:e?"On":"Off"}),"loading"===yt&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===yt&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===yt&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Max Airtime"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:Ue,onChange:e=>Xe(e.target.value),step:"0.5",min:"0.1",max:"100",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"%"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Js().toFixed(1),"%"]})})]})]}),t.jsx("div",{className:"hidden sm:block w-px bg-border-subtle"}),t.jsxs("div",{className:"flex-1 pt-4 sm:pt-0 border-t sm:border-t-0 border-border-subtle",children:[t.jsx("label",{className:"type-label text-text-muted block mb-3",children:"TX Delays"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Flood"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:Ye,onChange:e=>$e(e.target.value),step:"0.1",min:"0",max:"5",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"x"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Qs().toFixed(2),"x"]})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Direct"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:Ve,onChange:e=>Be(e.target.value),step:"0.1",min:"0",max:"5",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"s"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Zs().toFixed(2),"s"]})})]})]})]})]})]})})}),t.jsx(Z,{span:12,md:6,children:t.jsxs(G,{children:[t.jsx(W,{icon:t.jsx(s,{}),title:"App Settings",largeTitle:!0}),t.jsx("p",{className:"type-body-sm text-text-muted mb-4",children:"Appearance and web server options."}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-body text-text-primary font-medium block",children:"Enable CORS"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Allow cross-origin API access"})]}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==Rt?Rt:(null==Et?void 0:Et.cors_enabled)??!1;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:ra,disabled:"loading"===Lt,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===Lt&&"opacity-70"),title:e?"Disable CORS":"Enable CORS",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),"loading"===Lt&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===Lt&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===Lt&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-body text-text-primary font-medium block mb-2",children:"Theme"}),t.jsx(te,{})]})]})]})})]}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(u,{className:"icon-md text-accent-primary"}),"Regions / Transport Keys"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Manage regional key hierarchy for flood control"})]}),t.jsxs("div",{className:"flex gap-2 flex-wrap",children:[t.jsxs("button",{onClick:()=>vs(!0),disabled:"allow"===xs,className:S("flex items-center gap-1.5 h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium","allow"===xs?"bg-white/[0.02] text-text-muted cursor-not-allowed":"bg-accent-success/10 hover:bg-accent-success/20 text-accent-success"),children:[t.jsx(x,{className:"w-3.5 h-3.5"}),"Add"]}),t.jsx("button",{onClick:ba,disabled:!bs||"allow"===xs,className:S("h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium",bs&&"allow"!==xs?"bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary":"bg-white/[0.02] text-text-muted cursor-not-allowed"),children:"Edit"}),t.jsx("button",{onClick:ya,disabled:!bs||"allow"===xs,className:S("h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium",bs&&"allow"!==xs?"bg-accent-danger/10 hover:bg-accent-danger/20 text-accent-danger":"bg-white/[0.02] text-text-muted cursor-not-allowed"),children:"Delete"})]})]}),t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 mb-4",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:S("w-10 h-10 rounded-full flex items-center justify-center","allow"===xs?"bg-accent-success/20":"bg-accent-danger/20"),children:"allow"===xs?t.jsx(m,{className:"w-5 h-5 text-accent-success"}):t.jsx(p,{className:"w-5 h-5 text-accent-danger"})}),t.jsxs("div",{children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:"Global Flood Policy"}),t.jsx("p",{className:"type-body-sm text-text-muted",children:"Master control for repeater flooding"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex bg-white/[0.02] rounded-full p-1",children:[t.jsx("button",{onClick:()=>pa("deny"),disabled:ps,className:S("px-4 py-1.5 rounded-full transition-colors type-body-sm font-medium","deny"===xs?"bg-accent-danger/20 text-accent-danger":"text-text-muted hover:text-text-secondary",ps&&"opacity-50"),children:"Deny"}),t.jsx("button",{onClick:()=>pa("allow"),disabled:ps,className:S("px-4 py-1.5 rounded-full transition-colors type-body-sm font-medium","allow"===xs?"bg-accent-success/20 text-accent-success":"text-text-muted hover:text-text-secondary",ps&&"opacity-50"),children:"Allow"})]}),ps&&t.jsx(n,{className:"w-4 h-4 animate-spin text-text-muted"})]})]})}),os&&t.jsx("div",{className:"type-body-sm mb-3 px-3 py-2 rounded-full text-accent-danger bg-accent-danger/10",children:os}),t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 min-h-[120px]",children:is?t.jsxs("div",{className:"flex items-center justify-center py-6",children:[t.jsx(n,{className:"w-5 h-5 animate-spin text-accent-primary mr-2"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Loading transport keys..."})]}):0===ls.length?t.jsxs("div",{className:"text-center py-6",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-white/[0.02] mx-auto mb-3 flex items-center justify-center",children:t.jsx(u,{className:"w-6 h-6 text-text-muted/50"})}),t.jsx("p",{className:"type-body text-text-muted",children:"No transport keys found"}),t.jsx("p",{className:"type-body-sm text-text-muted/70 mt-1",children:"Add your first transport key to get started"})]}):t.jsx("div",{className:"space-y-1",children:ls.map(e=>t.jsx(ie,{node:e,level:0,expandedKeys:gs,selectedKeyId:bs,globalFloodPolicy:xs,onSelect:ys,onToggle:ma},e.id))})})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(h,{className:"icon-md text-accent-primary"}),"API Tokens"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Manage API tokens for machine-to-machine authentication"})]}),t.jsxs("button",{onClick:()=>Vt(!0),className:"flex items-center justify-center gap-2 h-[32px] px-4 bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary rounded-full transition-colors type-body-sm font-medium",children:[t.jsx(x,{className:"w-4 h-4"}),"Create Token"]})]}),t.jsx("div",{className:"bg-accent-tertiary/5 rounded-2xl p-4 mb-4",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-accent-tertiary/20 flex items-center justify-center flex-shrink-0",children:t.jsx(b,{className:"w-4 h-4 text-accent-tertiary"})}),t.jsxs("div",{className:"type-body-sm text-text-muted",children:[t.jsxs("p",{children:[t.jsx("span",{className:"text-text-secondary",children:"API tokens"})," are used for machine-to-machine authentication. Include the token in the ",t.jsx("code",{className:"type-code bg-accent-tertiary/20 px-1.5 py-0.5 rounded-full text-accent-tertiary",children:"X-API-Key"})," header when making API requests."]}),t.jsx("p",{className:"mt-1 text-text-muted/70",children:"Tokens are only shown once at creation. Store them securely."})]})]})}),Ot&&t.jsx("div",{className:"type-body-sm mb-3 px-3 py-2 rounded-full text-accent-danger bg-accent-danger/10",children:Ot}),qt&&0===zt.length?t.jsxs("div",{className:"flex items-center justify-center py-6",children:[t.jsx(n,{className:"w-5 h-5 animate-spin text-accent-primary mr-2"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Loading tokens..."})]}):zt.length>0?t.jsx("div",{className:"space-y-2",children:zt.map(e=>t.jsx("div",{className:"bg-white/[0.02] hover:bg-white/[0.04] rounded-2xl p-4 transition-colors",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-accent-primary/10 flex items-center justify-center flex-shrink-0",children:t.jsx(h,{className:"w-5 h-5 text-accent-primary"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h3",{className:"type-body text-text-primary font-medium truncate",children:e.name}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-0.5",children:[t.jsxs("span",{className:"type-data-sm text-text-muted truncate",children:["Created: ",ia(e.created_at)]}),t.jsxs("span",{className:"type-data-sm text-text-muted truncate",children:["Last used: ",ia(e.last_used)]})]})]})]}),t.jsxs("button",{onClick:()=>Jt({id:e.id,name:e.name}),disabled:ss,className:"h-[32px] px-4 bg-accent-danger/10 hover:bg-accent-danger/20 text-accent-danger rounded-full transition-colors disabled:opacity-50 type-body-sm font-medium flex items-center justify-center gap-1.5",children:[t.jsx(y,{className:"w-3.5 h-3.5"}),"Revoke"]})]})},e.id))}):t.jsxs("div",{className:"bg-white/[0.02] rounded-2xl p-6 text-center",children:[t.jsx("div",{className:"w-14 h-14 rounded-full bg-white/[0.02] mx-auto mb-4 flex items-center justify-center",children:t.jsx(h,{className:"w-7 h-7 text-text-muted/50"})}),t.jsx("h3",{className:"type-body text-text-primary font-medium mb-1",children:"No API Tokens"}),t.jsx("p",{className:"type-body-sm text-text-muted mb-4",children:"Create a token to enable API access"}),t.jsx("button",{onClick:()=>Vt(!0),className:"h-[32px] px-4 bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary rounded-full transition-colors type-body-sm font-medium",children:"Create Your First Token"})]})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(g,{className:"icon-md text-accent-primary"}),"Web Frontend"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Choose which web interface to use"})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:S("flex items-start gap-3 p-4 bg-white/[0.02] rounded-2xl border-2 cursor-pointer transition-all",Is?"border-accent-primary bg-accent-primary/5":"border-transparent hover:border-accent-primary/30","loading"===Os&&"opacity-50 pointer-events-none"),children:[t.jsx("input",{type:"radio",name:"frontend",checked:Is,onChange:()=>na(!0),disabled:"loading"===Os,className:"mt-1 h-4 w-4 text-accent-primary focus:ring-accent-primary focus:ring-offset-bg-elevated"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"type-body text-text-primary font-medium",children:"Default Frontend"}),t.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"type-data-xs bg-accent-tertiary/15 text-accent-tertiary px-2.5 py-0.5 rounded-full font-medium hover:bg-accent-tertiary/25 transition-colors",children:"@RightUp"})]}),t.jsx("div",{className:"type-body-sm text-text-muted mt-1",children:"Built-in pyMC Repeater web interface"}),t.jsx("div",{className:"type-data-xs text-text-muted/60 mt-1 font-mono",children:"/opt/pymc_repeater/repeater/web/html"})]})]}),t.jsxs("label",{className:S("flex items-start gap-3 p-4 bg-white/[0.02] rounded-2xl border-2 cursor-pointer transition-all",Is?"border-transparent hover:border-accent-primary/30":"border-accent-primary bg-accent-primary/5","loading"===Os&&"opacity-50 pointer-events-none"),children:[t.jsx("input",{type:"radio",name:"frontend",checked:!Is,onChange:()=>na(!1),disabled:"loading"===Os,className:"mt-1 h-4 w-4 text-accent-primary focus:ring-accent-primary focus:ring-offset-bg-elevated"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"type-body text-text-primary font-medium",children:"PyMC Console"}),t.jsx("span",{className:"type-data-xs bg-accent-secondary/15 text-accent-secondary px-2.5 py-0.5 rounded-full font-medium",children:"@Treehouse ⚡"})]}),t.jsx("div",{className:"type-body-sm text-text-muted mt-1",children:"Alternative web interface for pyMC Repeater"}),t.jsx("div",{className:"type-data-xs text-text-muted/60 mt-1 font-mono",children:"/opt/pymc_console/web/html"})]})]})]}),!qs&&t.jsx("div",{className:S("bg-white/[0.02] rounded-2xl p-4",zs?"border border-accent-success/20":"border border-accent-tertiary/20"),children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:S("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",zs?"bg-accent-success/20":"bg-accent-tertiary/20"),children:zs?t.jsx(f,{className:"w-4 h-4 text-accent-success"}):t.jsx(b,{className:"w-4 h-4 text-accent-tertiary"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:zs?"PyMC Console has been detected":"PyMC Console Not Installed"}),zs?t.jsxs("p",{className:"type-body-sm text-text-muted mt-1",children:["PyMC Console is installed at ",t.jsx("code",{className:"type-code bg-accent-success/10 px-1.5 py-0.5 rounded-full text-accent-success",children:"/opt/pymc_console/web/html"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"type-body-sm text-text-muted mt-1 mb-3",children:["PyMC Console must be installed at ",t.jsx("code",{className:"type-code bg-accent-tertiary/10 px-1.5 py-0.5 rounded-full text-accent-tertiary",children:"/opt/pymc_console/web/html"})," before selecting this option."]}),t.jsxs("a",{href:"https://github.com/dmduran12/pymc_console-dist",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 h-[32px] px-4 bg-accent-tertiary/10 hover:bg-accent-tertiary/20 text-accent-tertiary rounded-full type-body-sm font-medium transition-colors",children:[t.jsx(j,{className:"w-4 h-4"}),"PyMC Console Install Instructions"]})]})]})]})}),$s&&t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 border border-accent-secondary/30",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-accent-secondary/20 flex items-center justify-center flex-shrink-0",children:t.jsx(v,{className:"w-4 h-4 text-accent-secondary"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:"Service restart required"}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Web frontend changes will take effect after restarting the pymc-repeater service."})]})]}),t.jsx("button",{onClick:async()=>{if(!Bs){Us(!0);try{await z(),Vs(!1),setTimeout(()=>{window.location.reload()},2e3)}catch{Vs(!1),setTimeout(()=>{window.location.reload()},3e3)}}},disabled:Bs,className:"h-[32px] px-4 bg-accent-secondary/10 hover:bg-accent-secondary/20 text-accent-secondary rounded-full transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap type-body-sm font-medium",children:Bs?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Restarting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(N,{className:"w-4 h-4"}),"Restart Now"]})})]})})]})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsx(W,{icon:t.jsx(o,{}),title:"Node Information",largeTitle:!0}),ee?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Node Name"}),t.jsx("p",{className:"type-body text-text-primary mt-1",children:fe})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",ee.version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Core Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",ee.core_version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Local Hash"}),t.jsx("div",{className:"mt-1",children:ee.local_hash?t.jsx(V,{hash:ee.local_hash,size:"sm"}):t.jsx("span",{className:"type-data-sm text-text-muted",children:"N/A"})})]})]}),ee.public_key&&t.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Public Key"}),t.jsx("div",{className:"mt-1",children:t.jsx(V,{hash:ee.public_key,prefixLength:12,suffixLength:8})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading node information..."})]})}),$t&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Vt(!1),role:"dialog","aria-modal":"true","aria-labelledby":"create-token-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"create-token-modal-title",className:"type-subheading text-text-primary mb-4",children:"Create API Token"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Token Name"}),t.jsx("input",{type:"text",value:Bt,onChange:e=>Ut(e.target.value),placeholder:"e.g., Production Server, CI/CD Pipeline",className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",onKeyDown:e=>"Enter"===e.key&&ca(),autoFocus:!0}),t.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Give your token a descriptive name to identify its purpose"})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{Vt(!1),Ut(""),Yt(null)},disabled:es,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:ca,disabled:es||!Bt.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:es?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):"Create Token"})]})]})]})}),Wt&&Xt&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Qt(!1),role:"dialog","aria-modal":"true","aria-labelledby":"show-token-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-lg w-full shadow-2xl",children:[t.jsx("h3",{id:"show-token-modal-title",className:"type-subheading text-text-primary mb-4",children:"Token Created Successfully"}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-accent-secondary/10 border border-accent-secondary/30 rounded-lg p-3",children:t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{className:"w-4 h-4 text-accent-secondary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-text-secondary",children:[t.jsx("strong",{children:"Save this token now!"})," For security reasons, it will not be shown again."]})]})}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Your API Token"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{value:Xt,readOnly:!0,className:"flex-1 px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary font-mono text-sm"}),t.jsxs("button",{onClick:()=>{Xt&&(navigator.clipboard.writeText(Xt),ns(!0),setTimeout(()=>ns(!1),2e3))},className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard",children:[rs?t.jsx(l,{className:"w-4 h-4 text-accent-success"}):t.jsx(w,{className:"w-4 h-4"}),rs?"Copied!":"Copy"]})]})]}),t.jsxs("div",{className:"bg-accent-tertiary/10 border border-accent-tertiary/30 rounded-lg p-3",children:[t.jsx("p",{className:"text-sm text-text-secondary mb-2",children:t.jsx("strong",{children:"Usage Example:"})}),t.jsxs("code",{className:"block bg-accent-tertiary/20 px-3 py-2 rounded text-xs text-accent-tertiary font-mono overflow-x-auto",children:['curl -H "X-API-Key: ',Xt.slice(0,12),'..." ',window.location.origin,"/api/stats"]})]}),t.jsx("div",{className:"flex justify-end mt-6",children:t.jsx("button",{onClick:()=>{Qt(!1),Gt(null)},className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors",children:"Done"})})]})]})}),t.jsx(B,{isOpen:!!Zt,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${null==Zt?void 0:Zt.name}'? This action cannot be undone.`,confirmLabel:ss?"Revoking...":"Revoke",cancelLabel:"Cancel",variant:"danger",onConfirm:async()=>{if(Zt){as(!0),Yt(null);try{await q(Zt.id),await la(),Jt(null)}catch(e){Yt(e instanceof Error?e.message:"Failed to revoke token")}finally{as(!1)}}},onCancel:()=>Jt(null)}),js&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&vs(!1),role:"dialog","aria-modal":"true","aria-labelledby":"add-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"add-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Add Transport Key"}),t.jsxs("div",{className:"space-y-4",children:[bs&&t.jsxs("div",{className:"bg-accent-tertiary/10 border border-accent-tertiary/30 rounded-lg p-3 text-sm text-text-secondary",children:["Adding as child of: ",t.jsx("strong",{className:"text-text-primary",children:xa()})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Key Name"}),t.jsx("input",{type:"text",value:Es,onChange:e=>Ls(e.target.value),placeholder:"e.g., Region Name, Group Key",className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",onKeyDown:e=>"Enter"===e.key&&ha(),autoFocus:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Flood Policy"}),t.jsxs("div",{className:"flex bg-bg-subtle rounded-lg border border-border-subtle p-1",children:[t.jsx("button",{onClick:()=>Rs("deny"),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","deny"===Ps?"bg-accent-danger/20 text-accent-danger border border-accent-danger/50":"text-text-muted hover:text-text-secondary"),children:"DENY"}),t.jsx("button",{onClick:()=>Rs("allow"),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","allow"===Ps?"bg-accent-success/20 text-accent-success border border-accent-success/50":"text-text-muted hover:text-text-secondary"),children:"ALLOW"})]})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{vs(!1),Ls(""),Rs("deny")},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:ha,disabled:As||!Es.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Adding..."]}):"Add Key"})]})]})]})}),Ns&&Ss&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&ws(!1),role:"dialog","aria-modal":"true","aria-labelledby":"edit-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"edit-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Edit Transport Key"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Key Name"}),t.jsx("input",{type:"text",value:Ss.name,onChange:e=>_s({...Ss,name:e.target.value}),className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",autoFocus:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Flood Policy"}),t.jsxs("div",{className:"flex bg-bg-subtle rounded-lg border border-border-subtle p-1",children:[t.jsx("button",{onClick:()=>_s({...Ss,floodPolicy:"deny"}),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","deny"===Ss.floodPolicy?"bg-accent-danger/20 text-accent-danger border border-accent-danger/50":"text-text-muted hover:text-text-secondary"),children:"DENY"}),t.jsx("button",{onClick:()=>_s({...Ss,floodPolicy:"allow"}),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","allow"===Ss.floodPolicy?"bg-accent-success/20 text-accent-success border border-accent-success/50":"text-text-muted hover:text-text-secondary"),children:"ALLOW"})]})]}),Ss.transport_key&&t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Transport Key"}),t.jsx("code",{className:"block bg-bg-subtle px-3 py-2 rounded-lg text-xs text-text-muted font-mono overflow-x-auto",children:Ss.transport_key})]}),t.jsxs("div",{className:"flex justify-between gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{ws(!1),Fs(Ss),Cs(!0),_s(null)},disabled:As,className:"px-4 py-2 bg-accent-danger/20 hover:bg-accent-danger/30 text-accent-danger rounded-lg border border-accent-danger/50 transition-colors disabled:opacity-50",children:"Delete"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx("button",{onClick:()=>{ws(!1),_s(null)},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:async()=>{if(Ss){Ms(!0),us(null);try{const e=await Y(Ss.id,{name:Ss.name,flood_policy:Ss.floodPolicy});e.success?(await oa(),ws(!1),_s(null)):us(e.error||"Failed to update transport key")}catch(e){us(e instanceof Error?e.message:"Failed to update transport key")}finally{Ms(!1)}}},disabled:As||!Ss.name.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):"Save"})]})]})]})]})}),ks&&Ts&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Cs(!1),role:"dialog","aria-modal":"true","aria-labelledby":"delete-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"delete-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Delete Transport Key"}),t.jsxs("p",{className:"text-text-secondary mb-4",children:["Are you sure you want to delete ",t.jsxs("strong",{className:"text-text-primary",children:["'",Ts.name,"'"]}),"?"]}),Ts.children&&Ts.children.length>0&&t.jsx("div",{className:"bg-accent-secondary/10 border border-accent-secondary/30 rounded-lg p-3 mb-4",children:t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{className:"w-4 h-4 text-accent-secondary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-text-secondary",children:["This key has ",Ts.children.length," child key(s). Deleting will also remove all children."]})]})}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx("button",{onClick:()=>{Cs(!1),Fs(null)},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:async()=>{if(Ts){Ms(!0),us(null);try{const e=await $(Ts.id);e.success?(await oa(),Cs(!1),Fs(null),ys(null)):us(e.error||"Failed to delete transport key")}catch(e){us(e instanceof Error?e.message:"Failed to delete transport key")}finally{Ms(!1)}}},disabled:As,className:"px-4 py-2 bg-accent-danger/20 hover:bg-accent-danger/30 text-accent-danger rounded-lg border border-accent-danger/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Deleting..."]}):"Delete"})]})]})})]})}export{de as default}; diff --git a/frontend/dist/assets/Configuration-Dh8yao9Z.js b/frontend/dist/assets/Configuration-Dh8yao9Z.js new file mode 100644 index 00000000..6229b7e0 --- /dev/null +++ b/frontend/dist/assets/Configuration-Dh8yao9Z.js @@ -0,0 +1 @@ +import{r as e,j as t,f as s,i as a,X as r,au as n,ab as l,aY as c,aZ as i,k as d,p as o,a_ as u,ag as x,a$ as m,b0 as p,b1 as h,aQ as b,aw as y,b2 as g,ak as f,b3 as j,a8 as v,a3 as N,a0 as w,aa as k,b4 as C}from"./vendor-react-C0qkT9dV.js";import{c as S}from"./recharts-DRDKmvXb.js";import{$ as _,aj as T,ak as F,K as E,al as P,am as L,an as R,ao as A,ai as M,ap as I,aq as D,ar as z,as as K,at as q,au as H,av as O,aw as $,ax as Y}from"./index-DrUSC4Ks.js";import{H as V}from"./HashBadge-CAy9V6Vn.js";import{C as B}from"./ConfirmModal-B37DcPi-.js";import{P as U,b as X,a as G,c as W}from"./PageLayout-DAadOF4d.js";import{R as Q,C as Z}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const J=e.memo(function(){const{theme:e}=_(),{colorScheme:s}=e,a=T.find(e=>e.colorScheme===s)??T[0],r=a.displaySize,n=`clamp(${.8*r}rem, ${.6*r}rem + 1.5vw, ${1.4*r}rem)`;return t.jsx("div",{className:"w-32 sm:w-40 flex items-center justify-center flex-shrink-0",children:t.jsx("span",{className:"font-medium transition-all duration-300 leading-none text-center truncate",style:{fontFamily:a.displayFont,color:a.displayColor,fontSize:n,fontOpticalSizing:"auto",letterSpacing:"-0.03em"},children:a.displayName})})}),ee=e.memo(function(){const{theme:s,setThemePreset:a,setBrightness:r}=_(),{colorScheme:n,brightness:l}=s,[c,i]=e.useState(!1),[d,o]=e.useState(!1),u=e.useRef(null),x=e.useRef(null),m=(T.find(e=>e.colorScheme===n)??T[0]).id,p=e.useCallback((e,t)=>{if(!x.current)return l;const s=(x.current.y-e)/(t?200:80)*100;return Math.round(Math.max(0,Math.min(100,x.current.brightness+s)))},[l]),h=e.useCallback(e=>{a(e),i(!0)},[a]),b=e.useCallback(e=>{r(e)},[r]),y=e.useCallback(e=>{const t=T.find(t=>t.id===e);t&&F(t.backgroundImage)},[]);return t.jsx("div",{className:"grid grid-cols-4 gap-2 flex-shrink-0",children:T.map(e=>{const s=m===e.id,a=s&&(c||d);return t.jsxs("div",{ref:s?u:void 0,title:e.displayName,className:S("flex flex-col items-center gap-1 p-0.5 rounded-sm transition-all duration-300 ease-out",s?"ring-2 ring-accent-primary scale-105 cursor-ns-resize":"cursor-pointer"),onMouseEnter:()=>{s?i(!0):y(e.id)},onMouseLeave:()=>!d&&i(!1),onClick:()=>!s&&h(e.id),onTouchStart:e=>{if(!s)return;e.preventDefault();const t=e.touches[0];x.current={y:t.clientY,brightness:l},o(!0),i(!0);const a=e=>{e.preventDefault();const t=e.touches[0];b(p(t.clientY,!0))},r=()=>{document.removeEventListener("touchmove",a),document.removeEventListener("touchend",r),x.current=null,o(!1),setTimeout(()=>i(!1),1500)};document.addEventListener("touchmove",a,{passive:!1}),document.addEventListener("touchend",r)},onMouseDown:e=>{if(!s)return;e.preventDefault(),x.current={y:e.clientY,brightness:l},o(!0),i(!0);const t=e=>{b(p(e.clientY,!1))},a=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",a),x.current=null,o(!1)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",a)},children:[t.jsxs("div",{className:"glass-thumbnail w-10 h-10",children:["kde breeze"===e.id?t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#242627]",style:{opacity:a?.4:1},children:t.jsx("span",{className:"text-[#58b99d] text-xl font-bold font-mono",children:">"})}):t.jsx("div",{className:"absolute bg-cover bg-center transition-opacity duration-200",style:{inset:0,backgroundImage:`url(${e.backgroundImage})`,opacity:a?.4:1,filter:"brightness(1.3)"}}),s&&t.jsxs("div",{className:S("absolute inset-0 transition-opacity duration-200",a?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-black/70 transition-all duration-100 ease-out",style:{height:100-l+"%"}}),t.jsx("div",{className:"absolute inset-x-1 h-0.5 bg-white rounded-full shadow-lg transition-all duration-100 ease-out",style:{top:100-l+"%"}}),t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsxs("span",{className:"text-[10px] font-mono font-bold text-white drop-shadow-lg",children:[l,"%"]})})]})]}),t.jsx("div",{className:"flex flex-col gap-0.5",children:e.paletteColors.map((e,s)=>t.jsx("div",{className:"flex gap-0.5 justify-center",children:e.map((e,s)=>t.jsx("div",{className:"w-1.5 h-1.5 rounded-xs",style:{backgroundColor:e}},s))},s))})]},e.id)})})}),te=e.memo(function({layout:e="horizontal"}){return"logo-only"===e?t.jsx(J,{}):"thumbnails-only"===e?t.jsx(ee,{}):"vertical"===e?t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx(J,{}),t.jsx(ee,{})]}):t.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(J,{})}),t.jsx("div",{className:"flex-shrink-0",children:t.jsx(ee,{})})]})}),se=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}],ae=[5,6,7,8,9,10,11,12],re=[{value:5,label:"4/5"},{value:6,label:"4/6"},{value:7,label:"4/7"},{value:8,label:"4/8"}],ne="radioConfig",le="repeaterSettings",ce="operatingMode";function ie({node:e,level:s,expandedKeys:a,selectedKeyId:r,globalFloodPolicy:n,onSelect:l,onToggle:c}){const i=a.has(e.id),d=r===e.id,o=e.children&&e.children.length>0,u="allow"===n;return t.jsxs("div",{children:[t.jsxs("div",{className:S("flex items-center gap-2 h-[36px] px-3 rounded-full cursor-pointer transition-colors",d?"bg-accent-primary/15":"hover:bg-white/[0.02]",u&&"opacity-50 cursor-not-allowed"),style:{marginLeft:16*s+"px"},onClick:()=>!u&&l(e.id),children:[o?t.jsx("button",{onClick:t=>{t.stopPropagation(),c(e.id)},className:"p-1 hover:bg-white/[0.05] rounded-full transition-colors",children:t.jsx(k,{className:S("w-3.5 h-3.5 text-text-muted transition-transform",i&&"rotate-90")})}):t.jsx("span",{className:"w-5"}),t.jsx(C,{className:"w-4 h-4 text-accent-primary flex-shrink-0"}),t.jsx("span",{className:"type-data text-text-primary flex-1 truncate",children:e.name}),t.jsx("span",{className:S("type-data-xs px-2 py-0.5 rounded-full","allow"===e.floodPolicy?"bg-accent-success/15 text-accent-success":"bg-accent-danger/15 text-accent-danger"),children:"allow"===e.floodPolicy?"Allow":"Deny"})]}),o&&i&&t.jsx("div",{children:e.children.map(e=>t.jsx(ie,{node:e,level:s+1,expandedKeys:a,selectedKeyId:r,globalFloodPolicy:n,onSelect:l,onToggle:c},e.id))})]})}function de(){var k,C,_,T,F,J;const{stats:ee,setMode:de,clearModeMutation:oe,setDutyCycleConfig:ue,clearDutyCycleMutation:xe,fetchStats:me,startMutation:pe,clearMutation:he}=E(),be=null==(k=null==ee?void 0:ee.config)?void 0:k.radio,ye=null==(C=null==ee?void 0:ee.config)?void 0:C.repeater,ge=null==(_=null==ee?void 0:ee.config)?void 0:_.duty_cycle,fe=(null==ee?void 0:ee.node_name)||(null==(T=null==ee?void 0:ee.config)?void 0:T.node_name)||"Unknown Node",je=(null==ye?void 0:ye.mode)??"forward",ve=(null==ge?void 0:ge.enforcement_enabled)??!1,Ne=null==(F=null==ee?void 0:ee.config)?void 0:F.delays,[we,ke]=e.useState(!1),[Ce,Se]=e.useState(""),[_e,Te]=e.useState(62.5),[Fe,Ee]=e.useState(7),[Pe,Le]=e.useState(5),[Re,Ae]=e.useState(""),[Me,Ie]=e.useState("idle"),[De,ze]=e.useState(null),Ke=e.useRef(null),qe=e.useRef(null),[He,Oe]=e.useState(!1),[$e,Ye]=e.useState(""),[Ve,Be]=e.useState(""),[Ue,Xe]=e.useState(""),[Ge,We]=e.useState("idle"),Qe=e.useRef(null),Ze=e.useRef(null),[Je,et]=e.useState(!1),[tt,st]=e.useState(""),[at,rt]=e.useState(""),[nt,lt]=e.useState(""),[ct,it]=e.useState(""),[dt,ot]=e.useState("idle"),[ut,xt]=e.useState(null),mt=e.useRef(null),pt=e.useRef(null),[ht,bt]=e.useState("idle"),[yt,gt]=e.useState("idle"),[ft,jt]=e.useState(null),[vt,Nt]=e.useState(null),wt=e.useRef(!0),kt=e.useRef(null),Ct=e.useRef(null),St=e.useRef(null),_t=e.useRef(null),Tt=e.useRef(!1),Ft=e.useRef(!1);e.useEffect(()=>(wt.current=!0,()=>{wt.current=!1,kt.current&&clearTimeout(kt.current),Ct.current&&clearTimeout(Ct.current),St.current&&clearTimeout(St.current),_t.current&&clearTimeout(_t.current),Mt.current&&clearTimeout(Mt.current),It.current&&clearTimeout(It.current),qe.current&&clearTimeout(qe.current),Qe.current&&clearTimeout(Qe.current),pt.current&&clearTimeout(pt.current)}),[]),e.useEffect(()=>{const e=e=>{if(we||Je||He)return e.preventDefault(),e.returnValue="You have unsaved changes. Are you sure you want to leave?",e.returnValue};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[we,Je,He]);const Et=null==(J=null==ee?void 0:ee.config)?void 0:J.web,[Pt,Lt]=e.useState("idle"),[Rt,At]=e.useState(null),Mt=e.useRef(null),It=e.useRef(null),Dt=e.useRef(!1),[zt,Kt]=e.useState([]),[qt,Ht]=e.useState(!1),[Ot,$t]=e.useState(null),[Yt,Vt]=e.useState(!1),[Bt,Ut]=e.useState(""),[Xt,Gt]=e.useState(null),[Wt,Qt]=e.useState(!1),[Zt,Jt]=e.useState(null),[es,ts]=e.useState(!1),[ss,as]=e.useState(!1),[rs,ns]=e.useState(!1),[ls,cs]=e.useState([]),[is,ds]=e.useState(!1),[os,us]=e.useState(null),[xs,ms]=e.useState("deny"),[ps,hs]=e.useState(!1),[bs,ys]=e.useState(null),[gs,fs]=e.useState(new Set),[js,vs]=e.useState(!1),[Ns,ws]=e.useState(!1),[ks,Cs]=e.useState(!1),[Ss,_s]=e.useState(null),[Ts,Fs]=e.useState(null),[Es,Ps]=e.useState(""),[Ls,Rs]=e.useState("deny"),[As,Ms]=e.useState(!1),[Is,Ds]=e.useState(!0),[zs,Ks]=e.useState(!1),[qs,Hs]=e.useState(!0),[Os,$s]=e.useState("idle"),[Ys,Vs]=e.useState(!1),[Bs,Us]=e.useState(!1),Xs=e.useRef(!1);e.useEffect(()=>{const e=we&&!Xs.current;Xs.current=we,be&&e&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Le(be.coding_rate),Ae(String(be.tx_power)))},[be,we]);const Gs=e.useMemo(()=>{if(!be||!we)return!1;const e=be.frequency/1e6,t=be.bandwidth/1e3,s=parseFloat(Ce)||0;return Math.abs(s-e)>1e-4||_e!==t||Fe!==be.spreading_factor||Pe!==be.coding_rate||parseInt(Re)!==be.tx_power},[be,we,Ce,_e,Fe,Pe,Re]),Ws=e.useCallback(()=>{ke(!1),ze(null),be&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Le(be.coding_rate),Ae(String(be.tx_power)))},[be]);e.useEffect(()=>{if(!we)return;const e=e=>{"loading"!==Me&&Ke.current&&!Ke.current.contains(e.target)&&Ws()};return document.addEventListener("mouseup",e),()=>{document.removeEventListener("mouseup",e)}},[we,Ws,Me]);const Qs=e.useCallback(()=>{const e=null==Ne?void 0:Ne.tx_delay_factor;return e&&"object"==typeof e&&"parsedValue"in e?e.parsedValue??1:"number"==typeof e?e:1},[Ne]),Zs=e.useCallback(()=>{const e=null==Ne?void 0:Ne.direct_tx_delay_factor;return"number"==typeof e?e:.5},[Ne]),Js=e.useCallback(()=>{const e=null==ge?void 0:ge.max_airtime_percent;return"number"==typeof e?e:e&&"object"==typeof e&&"parsedValue"in e?e.parsedValue??6:6},[ge]),ea=e.useCallback(()=>{Ye(Qs().toFixed(2)),Be(Zs().toFixed(2)),Xe(Js().toFixed(1)),Oe(!0)},[Qs,Zs,Js]),ta=e.useCallback(()=>{Oe(!1)},[]);e.useEffect(()=>{if(!He)return;const e=e=>{"loading"!==Ge&&Ze.current&&!Ze.current.contains(e.target)&&ta()};return document.addEventListener("mouseup",e),()=>document.removeEventListener("mouseup",e)},[He,ta,Ge]);const sa=e.useCallback(()=>{var e,t,s;st(fe),rt((null==(e=null==ye?void 0:ye.latitude)?void 0:e.toString())||"0"),lt((null==(t=null==ye?void 0:ye.longitude)?void 0:t.toString())||"0"),it((null==(s=null==ye?void 0:ye.send_advert_interval_hours)?void 0:s.toString())||"0"),xt(null),et(!0)},[fe,ye]),aa=e.useCallback(()=>{et(!1),xt(null)},[]);e.useEffect(()=>{if(!Je)return;const e=e=>{"loading"!==dt&&mt.current&&!mt.current.contains(e.target)&&aa()};return document.addEventListener("mouseup",e),()=>document.removeEventListener("mouseup",e)},[Je,aa,dt]);const ra=async()=>{var e;if("loading"===Pt)return;const t=(null==Et?void 0:Et.cors_enabled)??!1,s=!t,a=t;Mt.current&&clearTimeout(Mt.current),It.current&&clearTimeout(It.current),Dt.current=!1,At(s),Lt("loading"),Mt.current=setTimeout(()=>{Dt.current||wt.current&&(At(a),Lt("error"),It.current=setTimeout(()=>{wt.current&&(Lt("idle"),At(null))},2e3))},1e4);try{const t=await I({web:{cors_enabled:s}});if(Dt.current=!0,Mt.current&&clearTimeout(Mt.current),!wt.current)return;t.success||(null==(e=t.data)?void 0:e.persisted)?(await me(),Lt("success"),It.current=setTimeout(()=>{wt.current&&(Lt("idle"),At(null))},2e3)):(At(a),Lt("error"),It.current=setTimeout(()=>{wt.current&&(Lt("idle"),At(null))},2e3))}catch{if(Dt.current=!0,Mt.current&&clearTimeout(Mt.current),!wt.current)return;At(a),Lt("error"),It.current=setTimeout(()=>{wt.current&&(Lt("idle"),At(null))},2e3)}};e.useEffect(()=>{(async()=>{Hs(!0);try{const e=await D();e.success&&e.data?Ks(e.data.exists):Ks(!1);const t=null==Et?void 0:Et.web_path;Ds(!t||""===t)}catch{Ks(!1)}finally{Hs(!1)}})()},[null==Et?void 0:Et.web_path]);const na=async e=>{var t;if("loading"!==Os){$s("loading");try{const s=await I({web:{web_path:e?null:"/opt/pymc_console/web/html"}});if(!wt.current)return;s.success||(null==(t=s.data)?void 0:t.persisted)?(Ds(e),$s("success"),Vs(!0),setTimeout(()=>{wt.current&&$s("idle")},2e3)):($s("error"),setTimeout(()=>{wt.current&&$s("idle")},2e3))}catch{if(!wt.current)return;$s("error"),setTimeout(()=>{wt.current&&$s("idle")},2e3)}}},la=e.useCallback(async()=>{Ht(!0),$t(null);try{const e=await P();Kt(e.tokens||[])}catch(e){$t(e instanceof Error?e.message:"Failed to fetch tokens")}finally{Ht(!1)}},[]);e.useEffect(()=>{la()},[la]);const ca=async()=>{if(Bt.trim()){ts(!0),$t(null);try{const e=await K(Bt.trim());Gt(e.token||null),Vt(!1),Qt(!0),Ut(""),await la()}catch(e){$t(e instanceof Error?e.message:"Failed to create token")}finally{ts(!1)}}else $t("Token name is required")},ia=e=>e?new Date(1e3*e).toLocaleString():"Never",da=e.useCallback(e=>{const t=new Map,s=[];return e.forEach(e=>{const s={id:e.id,name:e.name,floodPolicy:e.flood_policy,transport_key:e.transport_key,last_used:e.last_used,parent_id:e.parent_id,children:[]};t.set(e.id,s)}),t.forEach(e=>{e.parent_id&&t.has(e.parent_id)?t.get(e.parent_id).children.push(e):s.push(e)}),s},[]),oa=e.useCallback(async()=>{ds(!0),us(null);try{const e=await L();e.success&&e.data?cs(da(e.data)):us(e.error||"Failed to load transport keys")}catch(e){us(e instanceof Error?e.message:"Unknown error occurred")}finally{ds(!1)}},[da]);e.useEffect(()=>{oa()},[oa]);const ua=e.useCallback((e,t)=>{for(const s of e){if(s.id===t)return s;if(s.children){const e=ua(s.children,t);if(e)return e}}return null},[]),xa=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);return null==e?void 0:e.name},[bs,ls,ua]),ma=e.useCallback(e=>{fs(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),pa=async e=>{hs(!0),us(null);try{const t=await H("allow"===e);t.success?ms(e):us(t.error||"Failed to update global flood policy")}catch(t){us(t instanceof Error?t.message:"Failed to update global flood policy")}finally{hs(!1)}},ha=async()=>{if(Es.trim()){Ms(!0),us(null);try{const e=await O({name:Es.trim(),flood_policy:Ls,parent_id:bs??void 0});e.success?(await oa(),vs(!1),Ps(""),Rs("deny")):us(e.error||"Failed to add transport key")}catch(e){us(e instanceof Error?e.message:"Failed to add transport key")}finally{Ms(!1)}}else us("Key name is required")},ba=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);e&&(_s({...e}),ws(!0))},[bs,ls,ua]);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&(js&&(vs(!1),Ps(""),Rs("deny")),Ns&&(ws(!1),_s(null)),ks&&(Cs(!1),Fs(null)),Yt&&(Vt(!1),Ut("")),Wt&&(Qt(!1),Gt(null)))};if(js||Ns||ks||Yt||Wt)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[js,Ns,ks,Yt,Wt]);const ya=e.useCallback(()=>{if(!bs)return;const e=ua(ls,bs);e&&(Fs(e),Cs(!0))},[bs,ls,ua]);return t.jsxs(U,{children:[t.jsx(X,{title:"Configuration",icon:t.jsx(s,{})}),t.jsxs(Q,{template:"standard",children:[t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:mt,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-2",children:[t.jsx(a,{className:"icon-md text-accent-primary"}),"Repeater Settings"]}),t.jsx("div",{className:"flex items-center gap-1",children:ye&&(Je?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:aa,disabled:"loading"===dt,className:S("p-2 rounded-lg transition-colors","loading"===dt?"text-text-muted cursor-not-allowed":"text-text-muted hover:text-accent-danger hover:bg-accent-danger/10"),title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})}),t.jsx("button",{onClick:async()=>{if("loading"!==dt){pt.current&&clearTimeout(pt.current),pe(le),ot("loading"),xt(null);try{const e={};tt&&tt!==fe&&(e.node_name=tt);const t=parseFloat(at);isNaN(t)||t===(null==ye?void 0:ye.latitude)||(e.latitude=t);const s=parseFloat(nt);isNaN(s)||s===(null==ye?void 0:ye.longitude)||(e.longitude=s);const a=parseInt(ct);if(isNaN(a)||a===(null==ye?void 0:ye.send_advert_interval_hours)||(e.flood_advert_interval_hours=a),0===Object.keys(e).length)return xt({success:!0,message:"No changes to save"}),ot("idle"),void he(le);const r=await M(e);if(!wt.current)return void he(le);if(r.success&&r.data){const e=r.data.applied.join(", ");xt({success:!0,message:`Updated: ${e}`}),await me({force:!0}),ot("success"),pt.current=setTimeout(()=>{wt.current&&(ot("idle"),et(!1),xt(null),he(le))},1500)}else xt({success:!1,message:r.error||"Failed to save"}),ot("error"),he(le),pt.current=setTimeout(()=>{wt.current&&ot("idle")},2e3)}catch(e){if(!wt.current)return void he(le);xt({success:!1,message:String(e)}),ot("error"),he(le),pt.current=setTimeout(()=>{wt.current&&ot("idle")},2e3)}}},disabled:"loading"===dt,className:S("p-2 rounded-lg transition-colors","loading"===dt?"text-accent-primary cursor-wait":"success"===dt?"text-accent-success":"error"===dt?"text-accent-danger":"text-accent-success hover:bg-accent-success/10"),title:"Save changes",children:"loading"===dt?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===dt?t.jsx(l,{className:"w-4 h-4"}):"error"===dt?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:sa,className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit repeater settings",children:t.jsx(c,{className:"w-4 h-4"})}))})]}),ut&&t.jsx("div",{className:S("text-xs mb-3 px-2 py-1.5 rounded-md",ut.success?"text-accent-success bg-accent-success/10":"text-accent-danger bg-accent-danger/10"),children:ut.message}),ye?t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"col-span-2",children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Node Name"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"text",value:tt,onChange:e=>st(e.target.value),maxLength:50,className:"w-full bg-transparent text-text-primary focus:outline-none type-data",placeholder:"Enter node name"}):t.jsx("span",{className:"type-data text-text-primary",children:fe})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Latitude (°)":"Latitude"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:at,onChange:e=>rt(e.target.value),step:"0.000001",min:"-90",max:"90",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:0!==ye.latitude?ye.latitude.toFixed(6):"Not set"})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Longitude (°)":"Longitude"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:nt,onChange:e=>lt(e.target.value),step:"0.000001",min:"-180",max:"180",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:0!==ye.longitude?ye.longitude.toFixed(6):"Not set"})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:Je?"Advert Interval (hours)":"Advert Interval"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",Je?"bg-white/5":"bg-white/[0.02]"),children:Je?t.jsx("input",{type:"number",value:ct,onChange:e=>it(e.target.value),min:"0",max:"48",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:ye.send_advert_interval_hours>0?`${ye.send_advert_interval_hours}h`:"Disabled"})}),Je&&t.jsx("p",{className:"type-data-xs text-text-muted mt-1 ml-4",children:"0 = disabled, 3-48 hours"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Score-based TX"}),t.jsx("div",{className:"h-[38px] rounded-full px-4 flex items-center bg-white/[0.02]",children:t.jsx("span",{className:"type-data text-text-primary",children:ye.use_score_for_tx?"Enabled":"Disabled"})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading repeater settings..."})]})})}),t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:Ke,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-2",children:[t.jsx(i,{className:"icon-md text-accent-primary"}),"Radio Configuration"]}),t.jsx("div",{className:"flex items-center gap-1",children:be&&(we?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:Ws,disabled:"loading"===Me,className:S("p-2 rounded-lg transition-colors","loading"===Me?"text-text-muted cursor-not-allowed":"text-text-muted hover:text-accent-danger hover:bg-accent-danger/10"),title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})}),t.jsx("button",{onClick:async()=>{if("loading"!==Me){qe.current&&clearTimeout(qe.current),pe(ne),Ie("loading"),ze(null);try{const e={},t=parseFloat(Ce),s=be?be.frequency/1e6:0;Math.abs(t-s)>1e-4&&(e.frequency_mhz=t);const a=be?be.bandwidth/1e3:0;_e!==a&&(e.bandwidth_khz=_e),Fe!==(null==be?void 0:be.spreading_factor)&&(e.spreading_factor=Fe),Pe!==(null==be?void 0:be.coding_rate)&&(e.coding_rate=Pe);const r=parseInt(Re);if(r!==(null==be?void 0:be.tx_power)&&(e.tx_power=r),0===Object.keys(e).length)return ze({success:!0,message:"No changes to save"}),Ie("idle"),void he(ne);const n=await M(e);if(!wt.current)return void he(ne);if(n.success&&n.data){const e=n.data.applied.join(", "),t=n.data.live_update?" (applied live)":" (restart required)";ze({success:!0,message:`Updated: ${e}${t}`}),await me({force:!0}),Ie("success"),qe.current=setTimeout(()=>{wt.current&&(Ie("idle"),ke(!1),ze(null),he(ne))},1500)}else ze({success:!1,message:n.error||"Failed to save"}),Ie("error"),he(ne),qe.current=setTimeout(()=>{wt.current&&Ie("idle")},2e3)}catch(e){if(!wt.current)return void he(ne);ze({success:!1,message:String(e)}),Ie("error"),he(ne),qe.current=setTimeout(()=>{wt.current&&Ie("idle")},2e3)}}},disabled:"loading"===Me||!Gs,className:S("p-2 rounded-lg transition-colors","loading"===Me?"text-accent-primary cursor-wait":"success"===Me?"text-accent-success":"error"===Me?"text-accent-danger":Gs?"text-accent-success hover:bg-accent-success/10":"text-text-muted cursor-not-allowed"),title:Gs?"Save changes":"No changes to save",children:"loading"===Me?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===Me?t.jsx(l,{className:"w-4 h-4"}):"error"===Me?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:()=>{be&&(Se((be.frequency/1e6).toFixed(3)),Te(be.bandwidth/1e3),Ee(be.spreading_factor),Le(be.coding_rate),Ae(String(be.tx_power))),ze(null),ke(!0)},className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit radio settings",children:t.jsx(c,{className:"w-4 h-4"})}))})]}),De&&t.jsx("div",{className:S("text-xs mb-3 px-2 py-1.5 rounded-md",De.success?"text-accent-success bg-accent-success/10":"text-accent-danger bg-accent-danger/10"),children:De.message}),be?t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:we?"Frequency (MHz)":"Frequency"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsx("input",{type:"number",value:Ce,onChange:e=>Se(e.target.value),step:"0.001",min:"400",max:"930",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsx("span",{className:"type-data text-text-primary",children:R(be.frequency)})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:we?"TX Power (dBm)":"TX Power"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsx("input",{type:"number",value:Re,onChange:e=>Ae(e.target.value),min:"-9",max:"22",className:"w-full bg-transparent text-text-primary focus:outline-none type-data"}):t.jsxs("span",{className:"type-data text-text-primary",children:[be.tx_power," dBm"]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Bandwidth"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:_e,onChange:e=>Te(parseFloat(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:se.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsx("span",{className:"type-data text-text-primary",children:A(be.bandwidth)})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Spreading Factor"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:Fe,onChange:e=>Ee(parseInt(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:ae.map(e=>t.jsxs("option",{value:e,children:["SF",e]},e))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:["SF",be.spreading_factor]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Coding Rate"}),t.jsx("div",{className:S("h-[38px] rounded-full px-4 flex items-center transition-colors relative",we?"bg-white/5":"bg-white/[0.02]"),children:we?t.jsxs(t.Fragment,{children:[t.jsx("select",{value:Pe,onChange:e=>Le(parseInt(e.target.value)),className:"w-full bg-transparent text-text-primary focus:outline-none appearance-none cursor-pointer type-data pr-6",children:re.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx(d,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:["4/",be.coding_rate]})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-1",children:"Preamble"}),t.jsx("div",{className:"h-[38px] rounded-full px-4 flex items-center bg-white/[0.02]",children:t.jsxs("span",{className:"type-data text-text-primary",children:[be.preamble_length," symbols"]})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading radio configuration..."})]})})})]}),t.jsxs(Q,{template:"standard",children:[t.jsx(Z,{span:12,md:6,children:t.jsx(G,{children:t.jsxs("div",{ref:Ze,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("h2",{className:"type-subheading text-text-primary flex items-center gap-3",children:[t.jsx(o,{className:"icon-md text-icon-card-title"}),"Operating Mode"]}),t.jsx("div",{className:"flex items-center gap-1",children:He?t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"!==Ge){Qe.current&&clearTimeout(Qe.current),pe(ce),We("loading");try{const e=await M({tx_delay_factor:parseFloat($e),direct_tx_delay_factor:parseFloat(Ve)});if(await ue({max_airtime_percent:parseFloat(Ue),enforcement_enabled:ve}),!wt.current)return void he(ce);e.success&&e.data?(await me({force:!0}),We("success"),Qe.current=setTimeout(()=>{wt.current&&(We("idle"),Oe(!1),he(ce))},1500)):(We("error"),he(ce),Qe.current=setTimeout(()=>{wt.current&&We("idle")},2e3))}catch{if(!wt.current)return void he(ce);We("error"),he(ce),Qe.current=setTimeout(()=>{wt.current&&We("idle")},2e3)}}},disabled:"loading"===Ge,className:S("p-2 rounded-lg transition-colors","loading"===Ge?"text-accent-primary cursor-wait":"success"===Ge?"text-accent-success":"error"===Ge?"text-accent-danger":"text-accent-success hover:bg-accent-success/10"),title:"Save",children:"loading"===Ge?t.jsx(n,{className:"w-4 h-4 animate-spin"}):"success"===Ge?t.jsx(l,{className:"w-4 h-4"}):"error"===Ge?t.jsx(r,{className:"w-4 h-4"}):t.jsx(l,{className:"w-4 h-4"})}),t.jsx("button",{onClick:ta,className:"p-2 rounded-lg text-text-muted hover:text-accent-danger hover:bg-accent-danger/10",title:"Cancel",children:t.jsx(r,{className:"w-4 h-4"})})]}):t.jsx("button",{onClick:ea,className:"p-2 rounded-lg transition-colors text-text-muted hover:text-text-primary hover:bg-bg-subtle",title:"Edit settings",children:t.jsx(c,{className:"w-4 h-4"})})})]}),t.jsx("p",{className:"type-label text-text-muted mb-3",children:"Control how the repeater handles packets"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[t.jsxs("div",{className:"flex-1 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Repeat"}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==ft?ft:"forward"===je;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"===ht)return;const t=!e,s="forward"===je;kt.current&&clearTimeout(kt.current),Ct.current&&clearTimeout(Ct.current),Tt.current=!1,jt(t),bt("loading"),kt.current=setTimeout(()=>{Tt.current||wt.current&&(jt(s),bt("error"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null))},2e3))},1e4);try{if(await de(t?"forward":"monitor"),Tt.current=!0,kt.current&&clearTimeout(kt.current),!wt.current)return;bt("success"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null),oe())},2e3)}catch{if(Tt.current=!0,kt.current&&clearTimeout(kt.current),!wt.current)return;jt(s),bt("error"),Ct.current=setTimeout(()=>{wt.current&&(bt("idle"),jt(null))},2e3)}},disabled:"loading"===ht,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===ht&&"opacity-70"),"aria-label":"Toggle forward mode",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),t.jsx("span",{className:S("type-data text-sm w-7",e?"text-accent-success":"text-text-muted"),children:e?"On":"Off"}),"loading"===ht&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===ht&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===ht&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Duty Cycle"}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==vt?vt:ve;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:async()=>{if("loading"===yt)return;const t=!e,s=ve;St.current&&clearTimeout(St.current),_t.current&&clearTimeout(_t.current),Ft.current=!1,Nt(t),gt("loading"),St.current=setTimeout(()=>{Ft.current||wt.current&&(Nt(s),gt("error"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null))},2e3))},1e4);try{if(await ue({max_airtime_percent:Js(),enforcement_enabled:t}),Ft.current=!0,St.current&&clearTimeout(St.current),!wt.current)return;gt("success"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null),xe())},2e3)}catch{if(Ft.current=!0,St.current&&clearTimeout(St.current),!wt.current)return;Nt(s),gt("error"),_t.current=setTimeout(()=>{wt.current&&(gt("idle"),Nt(null))},2e3)}},disabled:"loading"===yt,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===yt&&"opacity-70"),"aria-label":"Toggle duty cycle",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),t.jsx("span",{className:S("type-data text-sm w-7",e?"text-accent-success":"text-text-muted"),children:e?"On":"Off"}),"loading"===yt&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===yt&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===yt&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"type-label text-text-muted",children:"Max Airtime"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:Ue,onChange:e=>Xe(e.target.value),step:"0.5",min:"0.1",max:"100",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"%"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Js().toFixed(1),"%"]})})]})]}),t.jsx("div",{className:"hidden sm:block w-px bg-border-subtle"}),t.jsxs("div",{className:"flex-1 pt-4 sm:pt-0 border-t sm:border-t-0 border-border-subtle",children:[t.jsx("label",{className:"type-label text-text-muted block mb-3",children:"TX Delays"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Flood"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:$e,onChange:e=>Ye(e.target.value),step:"0.1",min:"0",max:"5",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"x"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Qs().toFixed(2),"x"]})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Direct"}),t.jsx("div",{className:S("h-[32px] rounded-full px-3 flex items-center justify-end transition-colors min-w-[80px]",He?"bg-white/5":"bg-white/[0.02]"),children:He?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"number",value:Ve,onChange:e=>Be(e.target.value),step:"0.1",min:"0",max:"5",className:"w-12 bg-transparent text-text-primary text-right focus:outline-none type-data"}),t.jsx("span",{className:"text-text-muted type-data",children:"s"})]}):t.jsxs("span",{className:"type-data text-text-primary",children:[Zs().toFixed(2),"s"]})})]})]})]})]})]})})}),t.jsx(Z,{span:12,md:6,children:t.jsxs(G,{children:[t.jsx(W,{icon:t.jsx(s,{}),title:"App Settings",largeTitle:!0}),t.jsx("p",{className:"type-body-sm text-text-muted mb-4",children:"Appearance and web server options."}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-body text-text-primary font-medium block",children:"Enable CORS"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Allow cross-origin API access"})]}),t.jsx("div",{className:"flex items-center gap-2",children:(()=>{const e=null!==Rt?Rt:(null==Et?void 0:Et.cors_enabled)??!1;return t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:ra,disabled:"loading"===Pt,className:S("relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",e?"bg-toggle-on border-toggle-on":"bg-toggle-off border-border-subtle","loading"===Pt&&"opacity-70"),title:e?"Disable CORS":"Enable CORS",children:t.jsx("span",{className:S("inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",e?"translate-x-5":"translate-x-0.5")})}),"loading"===Pt&&t.jsx(n,{className:"w-4 h-4 text-text-muted animate-spin"}),"success"===Pt&&t.jsx(l,{className:"w-4 h-4 text-accent-success"}),"error"===Pt&&t.jsx(r,{className:"w-4 h-4 text-accent-danger"})]})})()})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-body text-text-primary font-medium block mb-2",children:"Theme"}),t.jsx(te,{})]})]})]})})]}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(u,{className:"icon-md text-accent-primary"}),"Regions / Transport Keys"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Manage regional key hierarchy for flood control"})]}),t.jsxs("div",{className:"flex gap-2 flex-wrap",children:[t.jsxs("button",{onClick:()=>vs(!0),disabled:"allow"===xs,className:S("flex items-center gap-1.5 h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium","allow"===xs?"bg-white/[0.02] text-text-muted cursor-not-allowed":"bg-accent-success/10 hover:bg-accent-success/20 text-accent-success"),children:[t.jsx(x,{className:"w-3.5 h-3.5"}),"Add"]}),t.jsx("button",{onClick:ba,disabled:!bs||"allow"===xs,className:S("h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium",bs&&"allow"!==xs?"bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary":"bg-white/[0.02] text-text-muted cursor-not-allowed"),children:"Edit"}),t.jsx("button",{onClick:ya,disabled:!bs||"allow"===xs,className:S("h-[32px] px-3 rounded-full transition-colors type-body-sm font-medium",bs&&"allow"!==xs?"bg-accent-danger/10 hover:bg-accent-danger/20 text-accent-danger":"bg-white/[0.02] text-text-muted cursor-not-allowed"),children:"Delete"})]})]}),t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 mb-4",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:S("w-10 h-10 rounded-full flex items-center justify-center","allow"===xs?"bg-accent-success/20":"bg-accent-danger/20"),children:"allow"===xs?t.jsx(m,{className:"w-5 h-5 text-accent-success"}):t.jsx(p,{className:"w-5 h-5 text-accent-danger"})}),t.jsxs("div",{children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:"Global Flood Policy"}),t.jsx("p",{className:"type-body-sm text-text-muted",children:"Master control for repeater flooding"})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex bg-white/[0.02] rounded-full p-1",children:[t.jsx("button",{onClick:()=>pa("deny"),disabled:ps,className:S("px-4 py-1.5 rounded-full transition-colors type-body-sm font-medium","deny"===xs?"bg-accent-danger/20 text-accent-danger":"text-text-muted hover:text-text-secondary",ps&&"opacity-50"),children:"Deny"}),t.jsx("button",{onClick:()=>pa("allow"),disabled:ps,className:S("px-4 py-1.5 rounded-full transition-colors type-body-sm font-medium","allow"===xs?"bg-accent-success/20 text-accent-success":"text-text-muted hover:text-text-secondary",ps&&"opacity-50"),children:"Allow"})]}),ps&&t.jsx(n,{className:"w-4 h-4 animate-spin text-text-muted"})]})]})}),os&&t.jsx("div",{className:"type-body-sm mb-3 px-3 py-2 rounded-full text-accent-danger bg-accent-danger/10",children:os}),t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 min-h-[120px]",children:is?t.jsxs("div",{className:"flex items-center justify-center py-6",children:[t.jsx(n,{className:"w-5 h-5 animate-spin text-accent-primary mr-2"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Loading transport keys..."})]}):0===ls.length?t.jsxs("div",{className:"text-center py-6",children:[t.jsx("div",{className:"w-12 h-12 rounded-full bg-white/[0.02] mx-auto mb-3 flex items-center justify-center",children:t.jsx(u,{className:"w-6 h-6 text-text-muted/50"})}),t.jsx("p",{className:"type-body text-text-muted",children:"No transport keys found"}),t.jsx("p",{className:"type-body-sm text-text-muted/70 mt-1",children:"Add your first transport key to get started"})]}):t.jsx("div",{className:"space-y-1",children:ls.map(e=>t.jsx(ie,{node:e,level:0,expandedKeys:gs,selectedKeyId:bs,globalFloodPolicy:xs,onSelect:ys,onToggle:ma},e.id))})})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(h,{className:"icon-md text-accent-primary"}),"API Tokens"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Manage API tokens for machine-to-machine authentication"})]}),t.jsxs("button",{onClick:()=>Vt(!0),className:"flex items-center justify-center gap-2 h-[32px] px-4 bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary rounded-full transition-colors type-body-sm font-medium",children:[t.jsx(x,{className:"w-4 h-4"}),"Create Token"]})]}),t.jsx("div",{className:"bg-accent-tertiary/5 rounded-2xl p-4 mb-4",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-accent-tertiary/20 flex items-center justify-center flex-shrink-0",children:t.jsx(b,{className:"w-4 h-4 text-accent-tertiary"})}),t.jsxs("div",{className:"type-body-sm text-text-muted",children:[t.jsxs("p",{children:[t.jsx("span",{className:"text-text-secondary",children:"API tokens"})," are used for machine-to-machine authentication. Include the token in the ",t.jsx("code",{className:"type-code bg-accent-tertiary/20 px-1.5 py-0.5 rounded-full text-accent-tertiary",children:"X-API-Key"})," header when making API requests."]}),t.jsx("p",{className:"mt-1 text-text-muted/70",children:"Tokens are only shown once at creation. Store them securely."})]})]})}),Ot&&t.jsx("div",{className:"type-body-sm mb-3 px-3 py-2 rounded-full text-accent-danger bg-accent-danger/10",children:Ot}),qt&&0===zt.length?t.jsxs("div",{className:"flex items-center justify-center py-6",children:[t.jsx(n,{className:"w-5 h-5 animate-spin text-accent-primary mr-2"}),t.jsx("span",{className:"type-body-sm text-text-muted",children:"Loading tokens..."})]}):zt.length>0?t.jsx("div",{className:"space-y-2",children:zt.map(e=>t.jsx("div",{className:"bg-white/[0.02] hover:bg-white/[0.04] rounded-2xl p-4 transition-colors",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-accent-primary/10 flex items-center justify-center flex-shrink-0",children:t.jsx(h,{className:"w-5 h-5 text-accent-primary"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h3",{className:"type-body text-text-primary font-medium truncate",children:e.name}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-0.5",children:[t.jsxs("span",{className:"type-data-sm text-text-muted truncate",children:["Created: ",ia(e.created_at)]}),t.jsxs("span",{className:"type-data-sm text-text-muted truncate",children:["Last used: ",ia(e.last_used)]})]})]})]}),t.jsxs("button",{onClick:()=>Jt({id:e.id,name:e.name}),disabled:ss,className:"h-[32px] px-4 bg-accent-danger/10 hover:bg-accent-danger/20 text-accent-danger rounded-full transition-colors disabled:opacity-50 type-body-sm font-medium flex items-center justify-center gap-1.5",children:[t.jsx(y,{className:"w-3.5 h-3.5"}),"Revoke"]})]})},e.id))}):t.jsxs("div",{className:"bg-white/[0.02] rounded-2xl p-6 text-center",children:[t.jsx("div",{className:"w-14 h-14 rounded-full bg-white/[0.02] mx-auto mb-4 flex items-center justify-center",children:t.jsx(h,{className:"w-7 h-7 text-text-muted/50"})}),t.jsx("h3",{className:"type-body text-text-primary font-medium mb-1",children:"No API Tokens"}),t.jsx("p",{className:"type-body-sm text-text-muted mb-4",children:"Create a token to enable API access"}),t.jsx("button",{onClick:()=>Vt(!0),className:"h-[32px] px-4 bg-accent-primary/10 hover:bg-accent-primary/20 text-accent-primary rounded-full transition-colors type-body-sm font-medium",children:"Create Your First Token"})]})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:t.jsxs("div",{children:[t.jsxs("h2",{className:"type-heading text-text-primary flex items-center gap-2",children:[t.jsx(g,{className:"icon-md text-accent-primary"}),"Web Frontend"]}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Choose which web interface to use"})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:S("flex items-start gap-3 p-4 bg-white/[0.02] rounded-2xl border-2 cursor-pointer transition-all",Is?"border-accent-primary bg-accent-primary/5":"border-transparent hover:border-accent-primary/30","loading"===Os&&"opacity-50 pointer-events-none"),children:[t.jsx("input",{type:"radio",name:"frontend",checked:Is,onChange:()=>na(!0),disabled:"loading"===Os,className:"mt-1 h-4 w-4 text-accent-primary focus:ring-accent-primary focus:ring-offset-bg-elevated"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"type-body text-text-primary font-medium",children:"Default Frontend"}),t.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"type-data-xs bg-accent-tertiary/15 text-accent-tertiary px-2.5 py-0.5 rounded-full font-medium hover:bg-accent-tertiary/25 transition-colors",children:"@RightUp"})]}),t.jsx("div",{className:"type-body-sm text-text-muted mt-1",children:"Built-in pyMC Repeater web interface"}),t.jsx("div",{className:"type-data-xs text-text-muted/60 mt-1 font-mono",children:"/opt/pymc_repeater/repeater/web/html"})]})]}),t.jsxs("label",{className:S("flex items-start gap-3 p-4 bg-white/[0.02] rounded-2xl border-2 cursor-pointer transition-all",Is?"border-transparent hover:border-accent-primary/30":"border-accent-primary bg-accent-primary/5","loading"===Os&&"opacity-50 pointer-events-none"),children:[t.jsx("input",{type:"radio",name:"frontend",checked:!Is,onChange:()=>na(!1),disabled:"loading"===Os,className:"mt-1 h-4 w-4 text-accent-primary focus:ring-accent-primary focus:ring-offset-bg-elevated"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"type-body text-text-primary font-medium",children:"PyMC Console"}),t.jsx("span",{className:"type-data-xs bg-accent-secondary/15 text-accent-secondary px-2.5 py-0.5 rounded-full font-medium",children:"@Treehouse ⚡"})]}),t.jsx("div",{className:"type-body-sm text-text-muted mt-1",children:"Alternative web interface for pyMC Repeater"}),t.jsx("div",{className:"type-data-xs text-text-muted/60 mt-1 font-mono",children:"/opt/pymc_console/web/html"})]})]})]}),!qs&&t.jsx("div",{className:S("bg-white/[0.02] rounded-2xl p-4",zs?"border border-accent-success/20":"border border-accent-tertiary/20"),children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:S("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",zs?"bg-accent-success/20":"bg-accent-tertiary/20"),children:zs?t.jsx(f,{className:"w-4 h-4 text-accent-success"}):t.jsx(b,{className:"w-4 h-4 text-accent-tertiary"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:zs?"PyMC Console has been detected":"PyMC Console Not Installed"}),zs?t.jsxs("p",{className:"type-body-sm text-text-muted mt-1",children:["PyMC Console is installed at ",t.jsx("code",{className:"type-code bg-accent-success/10 px-1.5 py-0.5 rounded-full text-accent-success",children:"/opt/pymc_console/web/html"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"type-body-sm text-text-muted mt-1 mb-3",children:["PyMC Console must be installed at ",t.jsx("code",{className:"type-code bg-accent-tertiary/10 px-1.5 py-0.5 rounded-full text-accent-tertiary",children:"/opt/pymc_console/web/html"})," before selecting this option."]}),t.jsxs("a",{href:"https://github.com/dmduran12/pymc_console-dist",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 h-[32px] px-4 bg-accent-tertiary/10 hover:bg-accent-tertiary/20 text-accent-tertiary rounded-full type-body-sm font-medium transition-colors",children:[t.jsx(j,{className:"w-4 h-4"}),"PyMC Console Install Instructions"]})]})]})]})}),Ys&&t.jsx("div",{className:"bg-white/[0.02] rounded-2xl p-4 border border-accent-secondary/30",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-accent-secondary/20 flex items-center justify-center flex-shrink-0",children:t.jsx(v,{className:"w-4 h-4 text-accent-secondary"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"type-body text-text-primary font-medium",children:"Service restart required"}),t.jsx("p",{className:"type-body-sm text-text-muted mt-1",children:"Web frontend changes will take effect after restarting the pymc-repeater service."})]})]}),t.jsx("button",{onClick:async()=>{if(!Bs){Us(!0);try{await z(),Vs(!1),setTimeout(()=>{window.location.reload()},2e3)}catch{Vs(!1),setTimeout(()=>{window.location.reload()},3e3)}}},disabled:Bs,className:"h-[32px] px-4 bg-accent-secondary/10 hover:bg-accent-secondary/20 text-accent-secondary rounded-full transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap type-body-sm font-medium",children:Bs?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Restarting..."]}):t.jsxs(t.Fragment,{children:[t.jsx(N,{className:"w-4 h-4"}),"Restart Now"]})})]})})]})]})}),t.jsx(Q,{template:"auto",children:t.jsxs(G,{children:[t.jsx(W,{icon:t.jsx(o,{}),title:"Node Information",largeTitle:!0}),ee?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Node Name"}),t.jsx("p",{className:"type-body text-text-primary mt-1",children:fe})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",ee.version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Core Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",ee.core_version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-muted",children:"Local Hash"}),t.jsx("div",{className:"mt-1",children:ee.local_hash?t.jsx(V,{hash:ee.local_hash,size:"sm"}):t.jsx("span",{className:"type-data-sm text-text-muted",children:"N/A"})})]})]}),ee.public_key&&t.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle",children:[t.jsx("span",{className:"type-label text-text-muted",children:"Public Key"}),t.jsx("div",{className:"mt-1",children:t.jsx(V,{hash:ee.public_key,prefixLength:12,suffixLength:8})})]})]}):t.jsx("p",{className:"text-text-muted",children:"Loading node information..."})]})}),Yt&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Vt(!1),role:"dialog","aria-modal":"true","aria-labelledby":"create-token-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"create-token-modal-title",className:"type-subheading text-text-primary mb-4",children:"Create API Token"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Token Name"}),t.jsx("input",{type:"text",value:Bt,onChange:e=>Ut(e.target.value),placeholder:"e.g., Production Server, CI/CD Pipeline",className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",onKeyDown:e=>"Enter"===e.key&&ca(),autoFocus:!0}),t.jsx("p",{className:"text-xs text-text-muted mt-1",children:"Give your token a descriptive name to identify its purpose"})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{Vt(!1),Ut(""),$t(null)},disabled:es,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:ca,disabled:es||!Bt.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:es?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):"Create Token"})]})]})]})}),Wt&&Xt&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Qt(!1),role:"dialog","aria-modal":"true","aria-labelledby":"show-token-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-lg w-full shadow-2xl",children:[t.jsx("h3",{id:"show-token-modal-title",className:"type-subheading text-text-primary mb-4",children:"Token Created Successfully"}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-accent-secondary/10 border border-accent-secondary/30 rounded-lg p-3",children:t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{className:"w-4 h-4 text-accent-secondary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-text-secondary",children:[t.jsx("strong",{children:"Save this token now!"})," For security reasons, it will not be shown again."]})]})}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Your API Token"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{value:Xt,readOnly:!0,className:"flex-1 px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary font-mono text-sm"}),t.jsxs("button",{onClick:()=>{Xt&&(navigator.clipboard.writeText(Xt),ns(!0),setTimeout(()=>ns(!1),2e3))},className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard",children:[rs?t.jsx(l,{className:"w-4 h-4 text-accent-success"}):t.jsx(w,{className:"w-4 h-4"}),rs?"Copied!":"Copy"]})]})]}),t.jsxs("div",{className:"bg-accent-tertiary/10 border border-accent-tertiary/30 rounded-lg p-3",children:[t.jsx("p",{className:"text-sm text-text-secondary mb-2",children:t.jsx("strong",{children:"Usage Example:"})}),t.jsxs("code",{className:"block bg-accent-tertiary/20 px-3 py-2 rounded text-xs text-accent-tertiary font-mono overflow-x-auto",children:['curl -H "X-API-Key: ',Xt.slice(0,12),'..." ',window.location.origin,"/api/stats"]})]}),t.jsx("div",{className:"flex justify-end mt-6",children:t.jsx("button",{onClick:()=>{Qt(!1),Gt(null)},className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors",children:"Done"})})]})]})}),t.jsx(B,{isOpen:!!Zt,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${null==Zt?void 0:Zt.name}'? This action cannot be undone.`,confirmLabel:ss?"Revoking...":"Revoke",cancelLabel:"Cancel",variant:"danger",onConfirm:async()=>{if(Zt){as(!0),$t(null);try{await q(Zt.id),await la(),Jt(null)}catch(e){$t(e instanceof Error?e.message:"Failed to revoke token")}finally{as(!1)}}},onCancel:()=>Jt(null)}),js&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&vs(!1),role:"dialog","aria-modal":"true","aria-labelledby":"add-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"add-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Add Transport Key"}),t.jsxs("div",{className:"space-y-4",children:[bs&&t.jsxs("div",{className:"bg-accent-tertiary/10 border border-accent-tertiary/30 rounded-lg p-3 text-sm text-text-secondary",children:["Adding as child of: ",t.jsx("strong",{className:"text-text-primary",children:xa()})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Key Name"}),t.jsx("input",{type:"text",value:Es,onChange:e=>Ps(e.target.value),placeholder:"e.g., Region Name, Group Key",className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",onKeyDown:e=>"Enter"===e.key&&ha(),autoFocus:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Flood Policy"}),t.jsxs("div",{className:"flex bg-bg-subtle rounded-lg border border-border-subtle p-1",children:[t.jsx("button",{onClick:()=>Rs("deny"),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","deny"===Ls?"bg-accent-danger/20 text-accent-danger border border-accent-danger/50":"text-text-muted hover:text-text-secondary"),children:"DENY"}),t.jsx("button",{onClick:()=>Rs("allow"),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","allow"===Ls?"bg-accent-success/20 text-accent-success border border-accent-success/50":"text-text-muted hover:text-text-secondary"),children:"ALLOW"})]})]}),t.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{vs(!1),Ps(""),Rs("deny")},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:ha,disabled:As||!Es.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Adding..."]}):"Add Key"})]})]})]})}),Ns&&Ss&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&ws(!1),role:"dialog","aria-modal":"true","aria-labelledby":"edit-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"edit-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Edit Transport Key"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Key Name"}),t.jsx("input",{type:"text",value:Ss.name,onChange:e=>_s({...Ss,name:e.target.value}),className:"w-full px-4 py-2 bg-bg-subtle border border-border-subtle rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors",autoFocus:!0})]}),t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Flood Policy"}),t.jsxs("div",{className:"flex bg-bg-subtle rounded-lg border border-border-subtle p-1",children:[t.jsx("button",{onClick:()=>_s({...Ss,floodPolicy:"deny"}),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","deny"===Ss.floodPolicy?"bg-accent-danger/20 text-accent-danger border border-accent-danger/50":"text-text-muted hover:text-text-secondary"),children:"DENY"}),t.jsx("button",{onClick:()=>_s({...Ss,floodPolicy:"allow"}),className:S("flex-1 px-3 py-2 text-sm font-medium rounded transition-colors","allow"===Ss.floodPolicy?"bg-accent-success/20 text-accent-success border border-accent-success/50":"text-text-muted hover:text-text-secondary"),children:"ALLOW"})]})]}),Ss.transport_key&&t.jsxs("div",{children:[t.jsx("label",{className:"type-label text-text-muted block mb-2",children:"Transport Key"}),t.jsx("code",{className:"block bg-bg-subtle px-3 py-2 rounded-lg text-xs text-text-muted font-mono overflow-x-auto",children:Ss.transport_key})]}),t.jsxs("div",{className:"flex justify-between gap-3 mt-6",children:[t.jsx("button",{onClick:()=>{ws(!1),Fs(Ss),Cs(!0),_s(null)},disabled:As,className:"px-4 py-2 bg-accent-danger/20 hover:bg-accent-danger/30 text-accent-danger rounded-lg border border-accent-danger/50 transition-colors disabled:opacity-50",children:"Delete"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx("button",{onClick:()=>{ws(!1),_s(null)},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:async()=>{if(Ss){Ms(!0),us(null);try{const e=await $(Ss.id,{name:Ss.name,flood_policy:Ss.floodPolicy});e.success?(await oa(),ws(!1),_s(null)):us(e.error||"Failed to update transport key")}catch(e){us(e instanceof Error?e.message:"Failed to update transport key")}finally{Ms(!1)}}},disabled:As||!Ss.name.trim(),className:"px-4 py-2 bg-accent-primary/20 hover:bg-accent-primary/30 text-text-primary rounded-lg border border-accent-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):"Save"})]})]})]})]})}),ks&&Ts&&t.jsx("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:e=>e.target===e.currentTarget&&Cs(!1),role:"dialog","aria-modal":"true","aria-labelledby":"delete-key-modal-title",children:t.jsxs("div",{className:"bg-bg-elevated border border-border-subtle rounded-xl p-6 max-w-md w-full shadow-2xl",children:[t.jsx("h3",{id:"delete-key-modal-title",className:"type-subheading text-text-primary mb-4",children:"Delete Transport Key"}),t.jsxs("p",{className:"text-text-secondary mb-4",children:["Are you sure you want to delete ",t.jsxs("strong",{className:"text-text-primary",children:["'",Ts.name,"'"]}),"?"]}),Ts.children&&Ts.children.length>0&&t.jsx("div",{className:"bg-accent-secondary/10 border border-accent-secondary/30 rounded-lg p-3 mb-4",children:t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{className:"w-4 h-4 text-accent-secondary flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm text-text-secondary",children:["This key has ",Ts.children.length," child key(s). Deleting will also remove all children."]})]})}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsx("button",{onClick:()=>{Cs(!1),Fs(null)},disabled:As,className:"px-4 py-2 bg-bg-subtle hover:bg-bg-elevated text-text-secondary rounded-lg border border-border-subtle transition-colors disabled:opacity-50",children:"Cancel"}),t.jsx("button",{onClick:async()=>{if(Ts){Ms(!0),us(null);try{const e=await Y(Ts.id);e.success?(await oa(),Cs(!1),Fs(null),ys(null)):us(e.error||"Failed to delete transport key")}catch(e){us(e instanceof Error?e.message:"Failed to delete transport key")}finally{Ms(!1)}}},disabled:As,className:"px-4 py-2 bg-accent-danger/20 hover:bg-accent-danger/30 text-accent-danger rounded-lg border border-accent-danger/50 transition-colors disabled:opacity-50 flex items-center gap-2",children:As?t.jsxs(t.Fragment,{children:[t.jsx(n,{className:"w-4 h-4 animate-spin"}),"Deleting..."]}):"Delete"})]})]})})]})}export{de as default}; diff --git a/frontend/dist/assets/Contacts-B1sA0BbK.js b/frontend/dist/assets/Contacts-B1sA0BbK.js deleted file mode 100644 index d21a3b0c..00000000 --- a/frontend/dist/assets/Contacts-B1sA0BbK.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-B1DglaF3.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/link-scoring-lk0Wk34S.js","assets/index-wYLFmyyS.js","assets/ConfirmModal-B37DcPi-.js","assets/useThemeColors-DL9Pr7sC.js","assets/PageLayout-DAadOF4d.js","assets/HashBadge-CAy9V6Vn.js","assets/SignalIndicator-C1cW0knK.js","assets/CollisionExplorerModal-DdrurDtW.js","assets/maplibre-gl-B1CfjdFi.css","assets/index-CzV5DN7L.css","assets/leaflet-CIGW-MKW.css"])))=>i.map(i=>d[i]); -import{j as e,r as s,ac as t,a8 as a,z as n,h as l,ad as c,k as i,ae as r,Z as o,af as d,T as x,A as m,a2 as h,ag as p,ah as u,ab as g,a7 as j,a1 as b,a6 as N,ai as v,o as f,aj as y,ak as w,_ as k,al as C,p as S,am as M,X as L,an as H,ao as P,ap as F,aq as E,ar as R,as as T,at as $,au as _,av as A,aw as O}from"./vendor-react-C0qkT9dV.js";import{E as D,G as z,B as G,H as W,I,J as K,q as U,K as B,e as V,L as q,h as J,M as Q,N as Z,O as X,f as Y,o as ee,Q as se,S as te}from"./index-wYLFmyyS.js";import{P as ae,b as ne}from"./PageLayout-DAadOF4d.js";import{_ as le}from"./deckgl-DTsmDcfs.js";import{c as ce,L as ie,T as re,a as oe}from"./recharts-DRDKmvXb.js";import{H as de}from"./HashBadge-CAy9V6Vn.js";import{a as xe}from"./SignalIndicator-C1cW0knK.js";import{C as me}from"./CollisionExplorerModal-DdrurDtW.js";import{C as he}from"./ConfirmModal-B37DcPi-.js";class pe extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){var s;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 glass-card flex items-center justify-center",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-white/50 p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-white/30",children:(null==(s=this.state.error)?void 0:s.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-white/20 mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ue=s.lazy(()=>le(()=>import("./ContactsMapMapLibre-B1DglaF3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function ge({neighbors:t,localNode:a,localHash:n,onRemoveNode:l,selectedNodeHash:c,onNodeSelected:i,highlightedEdgeKey:r,highlightedGhost:o}){return e.jsx(pe,{children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"map-container-16-9 glass-card flex items-center justify-center",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-white/50 flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-accent-primary border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})}),children:e.jsx(ue,{neighbors:t,localNode:a,localHash:n,onRemoveNode:l,selectedNodeHash:c,onNodeSelected:i,highlightedEdgeKey:r,highlightedGhost:o})})})}function je(e){return e>=.7?"text-accent-success":e>=.5?"text-accent-secondary":e>=.3?"text-signal-poor":"text-accent-danger"}function be(e){return`${Math.round(100*e)}%`}function Ne(e,s){return s.has(e.toUpperCase())}const ve=s.memo(function({path:s,isHighlighted:t,onHighlight:c,ghostPrefixes:i}){const r=function(s){return s>.2?{icon:e.jsx(x,{className:"w-3 h-3"}),color:"text-accent-success"}:s<-.2?{icon:e.jsx(n,{className:"w-3 h-3"}),color:"text-accent-danger"}:{icon:e.jsx(m,{className:"w-3 h-3"}),color:"text-text-muted"}}(s.observationTrend),h=s.weakestLinkKey&&s.weakestLinkConfidence<.5,p=s.hops.some(e=>Ne(e,i));return e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md transition-colors cursor-pointer "+(t?"bg-accent-primary/20 border border-accent-primary/40":"hover:bg-white/5"),onClick:()=>c(t?null:s.weakestLinkKey),children:[e.jsx("div",{className:"flex-shrink-0 w-12 text-center py-1 rounded-md "+(u=s.healthScore,u>=.7?"bg-accent-success/10":u>=.5?"bg-accent-secondary/10":u>=.3?"bg-signal-poor/10":"bg-accent-danger/10"),children:e.jsx("span",{className:`text-xs font-semibold tabular-nums ${je(s.healthScore)}`,children:be(s.healthScore)})}),e.jsx("div",{className:"flex-1 flex items-center gap-0.5 overflow-x-auto min-w-0",children:s.hops.map((t,a)=>{var n;const c=Ne(t,i),r=h&&(null==(n=s.weakestLinkKey)?void 0:n.includes(t));return e.jsxs("span",{className:"flex items-center",children:[e.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-0.5 "+(c?"bg-accent-tertiary/20 text-accent-tertiary border border-accent-tertiary/30":r?"bg-accent-danger/20 text-accent-danger":"bg-white/10 text-text-secondary"),children:[c&&e.jsx(l,{className:"w-2.5 h-2.5"}),t]}),anew Set(p.map(e=>e.prefix.toUpperCase())),[p]),b=s.useMemo(()=>m.slice(0,o),[m,o]),N=s.useMemo(()=>0===m.length?null:{avgHealth:m.reduce((e,s)=>e+s.healthScore,0)/m.length,declining:m.filter(e=>e.observationTrend<-.2).length,weakLinks:m.filter(e=>e.weakestLinkConfidence<.5).length,pathsWithGhosts:m.filter(e=>e.hops.some(e=>j.has(e.toUpperCase()))).length},[m,j]),v=e=>{null==d||d(e)};return 0===m.length?null:e.jsxs("div",{className:"chart-container",children:[e.jsxs("button",{onClick:()=>g(!u),className:"w-full chart-header hover:bg-white/5 transition-colors rounded-t-lg cursor-pointer",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(t,{className:"chart-title-icon"}),"Path Health",e.jsxs("span",{className:"ml-2 text-[10px] font-normal text-text-muted",children:["(",m.length," paths)"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[N&&e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[e.jsxs("span",{className:`tabular-nums ${je(N.avgHealth)}`,children:["Avg: ",be(N.avgHealth)]}),N.weakLinks>0&&e.jsxs("span",{className:"text-accent-danger flex items-center gap-1",children:[e.jsx(a,{className:"w-3 h-3"}),N.weakLinks," weak"]}),N.declining>0&&e.jsxs("span",{className:"text-signal-poor flex items-center gap-1",children:[e.jsx(n,{className:"w-3 h-3"}),N.declining," declining"]}),N.pathsWithGhosts>0&&e.jsxs("span",{className:"text-accent-tertiary flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3"}),N.pathsWithGhosts," ghost"]})]}),u?e.jsx(c,{className:"w-4 h-4 text-text-muted"}):e.jsx(i,{className:"w-4 h-4 text-text-muted"})]})]}),u&&e.jsxs("div",{className:"p-3 pt-0 space-y-1",children:[h.totalPaths>0&&e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted pb-2 border-b border-white/5",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(r,{className:"w-3 h-3 text-accent-primary"}),e.jsx("span",{className:"text-text-secondary",children:h.totalPaths.toLocaleString()})," Viterbi decoded"]}),h.observationOverrideCount>0&&e.jsxs("span",{className:"text-accent-success",children:[Math.round(h.observationOverrideCount/h.totalPaths*100),"% observation override"]}),p.length>0&&e.jsxs("span",{className:"text-accent-tertiary flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3"}),p.length," ghost",1!==p.length?"s":""]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-text-muted pb-2 border-b border-white/5",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-success"})," Healthy (≥70%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-secondary"})," Fair (50-70%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-signal-poor"})," Weak (30-50%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-danger"})," Critical (<30%)"]}),p.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3 text-accent-tertiary"})," Ghost"]})]}),e.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:b.map(s=>e.jsx(ve,{path:s,isHighlighted:x===s.weakestLinkKey,onHighlight:v,ghostPrefixes:j},s.pathKey))}),m.length>o&&e.jsxs("div",{className:"text-center text-[10px] text-text-muted pt-2",children:["Showing top ",o," of ",m.length," paths"]})]})]})});function ye(e){switch(e){case"rf_intersection":return"RF Circle Intersection";case"weighted_centroid":return"Weighted Centroid";case"single_anchor":return"Single Anchor (less reliable)";default:return e}}const we={confirmed:{label:"Confirmed",icon:e.jsx(u,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-success/40",bgClass:"bg-accent-success/10",textClass:"text-accent-success",badgeClass:"bg-accent-success/20 text-accent-success"},likely:{label:"Likely",icon:e.jsx(g,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-tertiary/30",bgClass:"bg-accent-tertiary/5",textClass:"text-accent-tertiary",badgeClass:"bg-accent-tertiary/20 text-accent-tertiary"},possible:{label:"Possible",icon:e.jsx(j,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-secondary/20",bgClass:"bg-accent-secondary/5",textClass:"text-accent-secondary",badgeClass:"bg-accent-secondary/20 text-accent-secondary"},noise:{label:"Noise",icon:e.jsx(a,{className:"w-3.5 h-3.5"}),borderClass:"border-border-muted",bgClass:"bg-bg-card/30",textClass:"text-text-muted",badgeClass:"bg-bg-elevated text-text-muted"}};function ke({ghost:t,neighbors:n,isExpanded:o,onToggle:x,compact:m}){var h,p;const u=(null==(h=t.classification)?void 0:h.tier)??"noise",g=we[u],j="clusterId"in(w=t)&&"temporal"in w;var w;const k=s.useMemo(()=>Array.from(t.commonNeighbors).map(e=>{var s;return{hash:e,name:null==(s=n[e])?void 0:s.name}}),[t.commonNeighbors,n]),C=t.estimatedLocation?t.estimatedLocation.uncertaintyM>=1e3?`±${(t.estimatedLocation.uncertaintyM/1e3).toFixed(1)}km`:`±${Math.round(t.estimatedLocation.uncertaintyM)}m`:null,S=j&&t.temporal?(M=t.temporal.consistency)>=.7?{label:"Steady",color:"text-accent-success"}:M>=.4?{label:"Regular",color:"text-accent-tertiary"}:M>=.2?{label:"Sporadic",color:"text-accent-secondary"}:{label:"Bursty",color:"text-signal-poor"}:null;var M;const L=j&&t.collisionCandidates&&t.collisionCandidates.length>0,H=L?t.collisionCandidates[0]:null;return m?e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded bg-bg-elevated/50 text-sm",children:[e.jsx("span",{className:"font-mono font-medium text-text-secondary",children:t.prefix.toUpperCase()}),e.jsx("span",{className:"text-text-muted",children:t.observationCount})]}):e.jsxs("div",{className:ce("rounded-lg border transition-all duration-150",g.borderClass,g.bgClass),children:[e.jsxs("button",{onClick:x,className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/5 rounded-lg",children:[e.jsx(l,{className:ce("w-5 h-5 flex-shrink-0",g.textClass)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-sm font-semibold text-text-primary",children:t.prefix.toUpperCase()}),e.jsx("span",{className:ce("px-1.5 py-0.5 rounded text-sm font-medium",g.badgeClass),children:g.label})]}),e.jsx("div",{className:ce("text-sm mt-0.5",g.textClass),children:(null==(p=t.classification)?void 0:p.reason)??"Unknown"}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-text-muted mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(r,{className:"w-3 h-3"}),t.observationCount]}),e.jsxs("span",{children:[(100*t.confidence).toFixed(0),"%"]}),t.commonNeighbors.size>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(b,{className:"w-3 h-3"}),t.commonNeighbors.size]}),t.estimatedLocation&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(N,{className:"w-3 h-3"}),C]}),S&&e.jsxs("span",{className:ce("flex items-center gap-1",S.color),children:[e.jsx(d,{className:"w-3 h-3"}),S.label]}),L&&e.jsxs("span",{className:"flex items-center gap-1 text-signal-poor",children:[e.jsx(v,{className:"w-3 h-3"}),"Collision?"]})]})]}),o?e.jsx(c,{className:"w-4 h-4 text-text-muted"}):e.jsx(i,{className:"w-4 h-4 text-text-muted"})]}),o&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-border-muted/50 mt-1 pt-3",children:[L&&H&&e.jsx("div",{className:"p-2 rounded bg-signal-poor/10 border border-signal-poor/30",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(v,{className:"w-4 h-4 text-signal-poor flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-signal-poor font-medium",children:"Possible collision with known node"}),e.jsx("div",{className:"text-text-secondary mt-0.5",children:H.knownNodeName?e.jsxs("span",{children:["May match ",e.jsx("span",{className:"font-medium",children:H.knownNodeName})," ","(",(100*H.collisionProbability).toFixed(0),"% probability)"]}):e.jsxs("span",{children:["May match ",e.jsx(de,{hash:H.knownNodeHash,size:"sm",className:"inline"})," ","(",(100*H.collisionProbability).toFixed(0),"% probability)"]})}),H.evidence&&e.jsxs("div",{className:"text-text-muted mt-1 text-[10px]",children:[H.evidence.sharedEdgeCount>0&&e.jsxs("span",{className:"mr-2",children:[H.evidence.sharedEdgeCount," shared edges"]}),void 0!==H.evidence.distanceKm&&e.jsxs("span",{className:"mr-2",children:[H.evidence.distanceKm.toFixed(1),"km apart"]}),H.evidence.withinUncertainty&&e.jsx("span",{className:"text-accent-secondary",children:"Within uncertainty radius"})]})]})]})}),t.estimatedLocation?e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-accent-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary font-medium",children:[t.estimatedLocation.lat.toFixed(5),", ",t.estimatedLocation.lon.toFixed(5)]}),e.jsxs("div",{className:"text-text-muted",children:["Uncertainty: ",C]}),j&&t.location&&e.jsxs("div",{className:"mt-1 text-text-muted",children:[e.jsxs("div",{children:["Method: ",ye(t.location.method)]}),t.location.anchors&&t.location.anchors.length>0&&e.jsxs("div",{children:[t.location.anchors.length," anchor",1!==t.location.anchors.length?"s":""," used"," · ",(100*t.location.locationConfidence).toFixed(0),"% confidence"]})]})]})]}):e.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[e.jsx(a,{className:"w-4 h-4 text-signal-poor"}),"Location unknown (neighbors lack coordinates)"]}),j&&t.temporal&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(d,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary font-medium",children:["Temporal Pattern: ",e.jsx("span",{className:null==S?void 0:S.color,children:null==S?void 0:S.label})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1 text-text-muted",children:[e.jsxs("span",{children:["Distinct hours: ",t.temporal.distinctHours]}),e.jsxs("span",{children:["Distinct days: ",t.temporal.distinctDays]}),e.jsxs("span",{children:["Burstiness: ",(100*t.temporal.burstiness).toFixed(0),"%"]}),e.jsxs("span",{children:["Consistency: ",(100*t.temporal.consistency).toFixed(0),"%"]}),e.jsxs("span",{children:["Last 24h: ",t.temporal.last24HourCount," obs"]}),e.jsxs("span",{children:["Active hours: ",t.temporal.activeHoursLast24,"/24"]})]})]})]}),!j&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(f,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary",children:["First seen: ",W(t.firstSeen)," ago"]}),e.jsxs("div",{className:"text-text-muted",children:["Last seen: ",W(t.lastSeen)," ago"]})]})]}),j&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary",children:["Active period: ",W(t.firstSeen)," – ",W(t.lastSeen)," ago"]}),t.temporal&&e.jsxs("div",{className:"text-text-muted",children:["Obs/hour avg: ",t.temporal.observationsPerHour.toFixed(1)]})]})]}),k.length>0&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(b,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-muted mb-1",children:["Adjacent to ",k.length," known node",1!==k.length?"s":"",":"]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[k.slice(0,5).map(({hash:s})=>e.jsx(de,{hash:s,size:"sm"},s)),k.length>5&&e.jsxs("span",{className:"text-text-muted",children:["+",k.length-5," more"]})]})]})]}),j&&t.validationStages&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30",children:[e.jsx("div",{className:"text-[10px] text-text-muted mb-1.5 uppercase tracking-wide",children:"Validation Stages"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(Ce,{label:"Candidates",passed:t.validationStages.candidateExhaustion}),e.jsx(Ce,{label:"Temporal",passed:t.validationStages.temporalConsistency}),e.jsx(Ce,{label:"Topology",passed:t.validationStages.topologicalFit}),e.jsx(Ce,{label:"Location",passed:t.validationStages.locationPlausible})]})]}),t.classification&&!j&&e.jsx("div",{className:"pt-2 border-t border-border-muted/30",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.classification.criteria.hasVeryHighObservations&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-success/20 text-accent-success",children:"200+ obs"}),t.classification.criteria.hasHighObservations&&!t.classification.criteria.hasVeryHighObservations&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-tertiary/20 text-accent-tertiary",children:"50+ obs"}),t.classification.criteria.hasHighConfidence&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-success/20 text-accent-success",children:"70%+ conf"}),t.classification.criteria.hasCommonNeighbors&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-primary/20 text-accent-primary",children:"2+ neighbors"}),t.classification.criteria.hasGoodLocation&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-primary/20 text-accent-primary",children:"good loc"}),t.classification.criteria.isRecent&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-text-muted/20 text-text-muted",children:"recent"})]})}),j&&t.upgradeRequirements&&t.upgradeRequirements.length>0&&"confirmed"!==u&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30",children:[e.jsx("div",{className:"text-[10px] text-text-muted mb-1 uppercase tracking-wide",children:"To upgrade tier:"}),e.jsx("ul",{className:"text-xs text-text-secondary space-y-0.5",children:t.upgradeRequirements.slice(0,3).map((s,t)=>e.jsxs("li",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-accent-tertiary",children:"•"})," ",s]},t))})]})]})]})}function Ce({label:s,passed:t}){return e.jsxs("span",{className:ce("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium",t?"bg-accent-success/20 text-accent-success":"bg-bg-elevated text-text-muted"),children:[t?e.jsx(w,{className:"w-2.5 h-2.5"}):e.jsx(k,{className:"w-2.5 h-2.5"}),s]})}function Se({neighbors:t,className:n,onGhostSelect:r}){const o=G(),d=z(),[x,b]=s.useState(new Set),[N,v]=s.useState("actionable"),[f,y]=s.useState(!1),[w,k]=s.useState(!0),[C,S]=s.useState(Date.now);s.useEffect(()=>{S(Date.now())},[o]);const M=s.useMemo(()=>o.filter(e=>!function(e,s){return s-1e3*e.lastSeen>6048e5}(e,C)),[o,C]),L=s.useMemo(()=>{const e=Array.from(x);return e.length>0?e[0]:null},[x]),H=s.useMemo(()=>L?M.find(e=>e.prefix===L)??null:null,[L,M]);s.useEffect(()=>{r&&r(H&&!w?{prefix:H.prefix,commonNeighbors:Array.from(H.commonNeighbors),estimatedLocation:H.estimatedLocation}:null)},[H,w,r]),s.useEffect(()=>{w&&b(new Set)},[w]);const{confirmed:P,likely:F,possible:E,noise:R,actionableCount:T}=s.useMemo(()=>{var e;const s=[],t=[],a=[],n=[];for(const c of M)switch((null==(e=c.classification)?void 0:e.tier)??"noise"){case"confirmed":s.push(c);break;case"likely":t.push(c);break;case"possible":a.push(c);break;case"noise":n.push(c)}const l=(e,s)=>s.observationCount-e.observationCount;return s.sort(l),t.sort(l),a.sort(l),n.sort(l),{confirmed:s,likely:t,possible:a,noise:n,actionableCount:s.length+t.length}},[M]);if(0===M.length)return null;const $=e=>{b(s=>s.has(e)?new Set:new Set([e]))},_="all"===N,A=P.length+F.length+(_?E.length:0)+(f?R.length:0);return e.jsxs("div",{className:n,children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(l,{className:"chart-title-icon"}),"Ghost Buster",T>0&&e.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent-success/20 text-accent-success",children:[T," actionable"]}),w&&M.length>0&&e.jsxs("span",{className:"text-xs text-text-muted ml-2",children:["(",M.length," total)"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!w&&e.jsxs("button",{onClick:()=>v(e=>"actionable"===e?"all":"actionable"),className:ce("flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors","all"===N?"bg-accent-primary/20 text-accent-primary":"bg-bg-elevated text-text-muted hover:text-text-secondary"),children:[e.jsx(h,{className:"w-3 h-3"}),"actionable"===N?"Actionable":"All"]}),e.jsx("button",{onClick:()=>k(e=>!e),className:"flex items-center gap-1 px-2 py-1 rounded text-xs bg-bg-elevated text-text-muted hover:text-text-secondary transition-colors",title:w?"Expand panel":"Minimize panel",children:w?e.jsx(p,{className:"w-3 h-3"}):e.jsx(m,{className:"w-3 h-3"})})]})]}),w?e.jsxs("div",{className:"px-5 py-3 flex items-center gap-3 text-xs cursor-pointer hover:bg-white/5 transition-colors",onClick:()=>k(!1),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[P.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent-success",children:[e.jsx(u,{className:"w-3 h-3"}),P.length," confirmed"]}),F.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent-tertiary",children:[e.jsx(g,{className:"w-3 h-3"}),F.length," likely"]}),E.length>0&&e.jsxs("span",{className:"text-accent-secondary",children:[E.length," possible"]}),R.length>0&&e.jsxs("span",{className:"text-text-muted",children:[R.length," noise"]})]}),e.jsx("span",{className:"text-text-muted ml-auto",children:"Click to expand"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-5 py-2 flex items-center gap-3 text-xs border-b border-border-muted/30",children:[e.jsxs("span",{className:"text-text-muted",children:[d.pathsWithGhosts.toLocaleString()," / ",d.totalPaths.toLocaleString()," paths"]}),e.jsx("span",{className:"text-text-muted",children:"•"}),e.jsxs("div",{className:"flex items-center gap-2",children:[P.length>0&&e.jsxs("span",{className:"text-accent-success",children:[P.length," confirmed"]}),F.length>0&&e.jsxs("span",{className:"text-accent-tertiary",children:[F.length," likely"]}),E.length>0&&e.jsxs("span",{className:"text-accent-secondary",children:[E.length," possible"]}),R.length>0&&e.jsxs("span",{className:"text-text-muted",children:[R.length," noise"]})]})]}),e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[P.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-success",children:[e.jsx(u,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Confirmed Repeaters (",P.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:P.map(s=>e.jsx(ke,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix))})]}),F.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-tertiary",children:[e.jsx(g,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Likely Repeaters (",F.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:F.map(s=>e.jsx(ke,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix))})]}),_&&E.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-secondary",children:[e.jsx(j,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Possible (",E.length,")"]})]}),e.jsxs("div",{className:"space-y-2",children:[E.slice(0,10).map(s=>e.jsx(ke,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix)),E.length>10&&e.jsxs("div",{className:"text-xs text-text-muted text-center py-1",children:["+",E.length-10," more possible nodes"]})]})]}),R.length>0&&"all"===N&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{onClick:()=>y(!f),className:"flex items-center gap-2 text-xs text-text-muted hover:text-text-secondary transition-colors",children:[f?e.jsx(c,{className:"w-3.5 h-3.5"}):e.jsx(i,{className:"w-3.5 h-3.5"}),e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsxs("span",{children:["Noise (",R.length,")"]})]}),f&&e.jsx("div",{className:"flex flex-wrap gap-1",children:R.map(s=>e.jsx(ke,{ghost:s,neighbors:t,isExpanded:!1,onToggle:()=>{},compact:!0},s.prefix))})]}),"actionable"===N&&0===T&&e.jsxs("div",{className:"text-center py-6 text-sm text-text-muted",children:[e.jsx(l,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No confirmed or likely repeaters yet."}),e.jsxs("p",{className:"text-xs mt-1",children:[E.length+R.length," prefixes need more evidence."]}),e.jsxs("button",{onClick:()=>v("all"),className:"mt-3 text-accent-primary hover:underline",children:["View all ",M.length," discovered nodes"]})]}),d.observationOverrideCount>0&&A>0&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30 text-xs text-text-muted",children:[e.jsx("span",{className:"text-accent-primary",children:d.observationOverrideCount})," observation overrides • Avg confidence: ",e.jsxs("span",{className:"text-accent-secondary",children:[(100*d.avgPathConfidence).toFixed(0),"%"]})]})]})]})]})}const Me="var(--sparkline-critical)",Le="var(--sparkline-poor)",He="var(--sparkline-fair)",Pe="var(--sparkline-good)",Fe="var(--sparkline-excellent)";function Ee({active:s,payload:t}){if(!s||!t||!t.length)return null;const a=t[0].payload,n=new Date(a.timestamp),l=`${(n.getMonth()+1).toString().padStart(2,"0")}/${n.getDate().toString().padStart(2,"0")}`;return e.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded px-1.5 py-0.5 text-[10px] shadow-xl",children:[e.jsx("span",{className:"text-text-muted",children:l}),e.jsx("span",{className:"ml-1.5 font-semibold tabular-nums",children:a.count})]})}const Re=s.memo(function({nodeHash:s,width:t=60,height:a=20,color:n,showArea:l=!0,showTooltip:c=!1,className:i=""}){const r=I(s),o=K(),d=!U().backgroundLoadComplete||o,x=n??(r.length>0?function(e){if(0===e.length)return Me;const s=e.slice(-4),t=s.reduce((e,s)=>e+s.count,0),a=t/s.length,n=e.reduce((e,s)=>e+s.count,0)/e.length;if(0===t)return Me;if(n>0){const e=a/n;return e>=1.2?Fe:e>=.8?Pe:e>=.4?He:e>=.1?Le:Me}return t>=10?Fe:t>=5?Pe:t>=2?He:t>=1?Le:Me}(r):"var(--text-muted)"),m="number"==typeof t?t:60,h=a;return d&&r.length<2?e.jsx("div",{className:`flex items-center justify-center ${i}`,style:{width:m,height:h},children:e.jsx("div",{className:"rounded animate-pulse bg-white/[0.06]",style:{width:m-8,height:h-6}})}):r.length<2?e.jsx("div",{className:`flex items-center justify-center ${i}`,style:{width:m,height:h,color:Me},children:e.jsx("svg",{width:m,height:h,viewBox:`0 0 ${m} ${h}`,preserveAspectRatio:"none",children:e.jsx("line",{x1:4,y1:h/2,x2:m-4,y2:h/2,stroke:"currentColor",strokeWidth:1.5,strokeDasharray:"3,2"})})}):e.jsx("div",{className:i,style:{width:m,height:h},children:e.jsxs(ie,{data:r,width:m,height:h,margin:{top:1,right:1,bottom:1,left:1},children:[c&&e.jsx(re,{content:e.jsx(Ee,{}),cursor:{stroke:"rgba(255,255,255,0.2)",strokeWidth:1}}),e.jsx(oe,{type:"monotone",dataKey:"count",stroke:x,strokeWidth:1.5,dot:!1,isAnimationActive:!1})]})})}),Te=s.memo(function({hash:t,className:a="",size:n="sm"}){const l=B(),c=z(),[i,o]=s.useState(!1),d=s.useMemo(()=>V(t),[t]),x=s.useMemo(()=>d?l.find(e=>e.prefix===d)??null:null,[d,l]),m=c.totalPaths>0&&c.avgPathConfidence>=.7,h=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),o(!0)},[]),p=s.useCallback(()=>{o(!1)},[]);if(!x)return null;const u="sm"===n?"w-3.5 h-3.5":"w-4 h-4",j=m?"text-accent-tertiary hover:text-accent-tertiary hover:bg-accent-tertiary/10 focus:ring-accent-tertiary/50":"text-signal-fair hover:text-accent-secondary hover:bg-signal-fair/10 focus:ring-signal-fair/50",b=m?`Prefix conflict resolved by Viterbi HMM (${(100*c.avgPathConfidence).toFixed(0)}% confidence)`:`Prefix conflict: ${x.candidateCount} nodes share prefix "${d}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:h,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${j} ${a}`,title:b,"aria-label":`View prefix conflict for ${d}${m?" (Viterbi resolved)":""}`,children:m?e.jsxs("span",{className:"relative",children:[e.jsx(r,{className:u}),e.jsx(g,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-accent-success"})]}):e.jsx(C,{className:u})}),e.jsx(me,{isOpen:i,prefix:x.prefix,candidateHashes:x.candidateHashes,onClose:p})]})});function $e(e,s,t,a){const n=(t-e)*Math.PI/180,l=(a-s)*Math.PI/180,c=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371e3}const _e=Object.freeze(Object.defineProperty({__proto__:null,default:function(){const{stats:t}=q(),a=J(),n=Q(),l=Z(),c=X(),r=Y(),o=G(),x=ee(),[m,h]=s.useState(null),[p,u]=s.useState("lastHeard"),[j,v]=s.useState("desc"),[y,w]=s.useState(""),[k,C]=s.useState(!1),[D,z]=s.useState(null),[W,I]=s.useState(null),[K,U]=s.useState(null),[B,V]=s.useState(null),[le,ce]=s.useState(new Map),[ie,re]=s.useState(new Map),[oe,me]=s.useState(25),[pe,ue]=s.useState(25),je=s.useRef(null),[be,Ne]=s.useState(!1),ve=s.useMemo(()=>(null==t?void 0:t.neighbors)??{},[null==t?void 0:t.neighbors]),ye=s.useMemo(()=>Object.fromEntries(Object.entries(ve).filter(([e])=>!a.has(e))),[ve,a]),we=s.useMemo(()=>{var e;return(null==(e=null==t?void 0:t.config)?void 0:e.repeater)?{latitude:t.config.repeater.latitude,longitude:t.config.repeater.longitude,name:t.config.node_name||"Local Node"}:void 0},[t]),ke=null==t?void 0:t.local_hash,Ce=s.useMemo(()=>{const e=new Map;if(!(null==we?void 0:we.latitude)||!(null==we?void 0:we.longitude))return e;for(const[s,t]of Object.entries(ye))t.latitude&&t.longitude&&0!==t.latitude&&0!==t.longitude?e.set(s,$e(we.latitude,we.longitude,t.latitude,t.longitude)):e.set(s,null);return e},[ye,we]),{neighborHashSet:Me,neighborSignalMap:Le}=s.useMemo(()=>{const e=new Set,s=new Map;for(const t of r)e.add(t.hash),s.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:e,neighborSignalMap:s}},[r]),He=s.useMemo(()=>{const e=y.toLowerCase().trim(),s="neighbor"===e||"neighbors"===e,t=k||s;return Object.fromEntries(Object.entries(ye).filter(([a,n])=>{if(t&&!Me.has(a))return!1;if(s)return!0;if(!e)return!0;const l=(n.node_name||n.name||"").toLowerCase(),c=a.slice(2,4).toLowerCase();return l.includes(e)||c.includes(e)||a.toLowerCase().includes(e)}))},[ye,y,k,Me]),Pe=s.useMemo(()=>Object.entries(He).sort(([e,s],[t,a])=>{let n=0;switch(p){case"lastHeard":n=(s.last_seen||0)-(a.last_seen||0);break;case"distance":{const s=Ce.get(e)??null,a=Ce.get(t)??null;n=null===s&&null===a?0:null===s?1:null===a?-1:s-a;break}case"centrality":n=(c.get(e)||0)-(c.get(t)||0)}return"desc"===j?-n:n}),[He,p,j,Ce,c]),Fe=Pe.filter(([,e])=>e.latitude&&e.longitude&&0!==e.latitude&&0!==e.longitude).length,Ee=s.useMemo(()=>new Set(l),[l]),_e=s.useMemo(()=>0===oe?Pe:Pe.slice(0,pe),[Pe,pe,oe]);s.useEffect(()=>{ue(oe||Pe.length)},[p,j,y,k,oe,Pe.length]),s.useEffect(()=>{if(0===oe)return;const e=new IntersectionObserver(e=>{e[0].isIntersecting&&peMath.min(e+oe,Pe.length))},{threshold:.1,rootMargin:"100px"});return je.current&&e.observe(je.current),()=>e.disconnect()},[oe,pe,Pe.length]);const Ae=s.useCallback(e=>{me(e),ue(e||Pe.length),Ne(!1)},[Pe.length]),Oe=s.useCallback(e=>{p===e?v(e=>"desc"===e?"asc":"desc"):(u(e),v("desc"))},[p]),De=s.useCallback(e=>{const s=ye[e];(null==s?void 0:s.latitude)&&(null==s?void 0:s.longitude)&&0!==s.latitude&&0!==s.longitude&&z(e)},[ye]),ze=s.useCallback(()=>{z(null)},[]),Ge=s.useCallback(async(e,s)=>{if(s.stopPropagation(),!B){V(e),ce(s=>{const t=new Map(s);return t.delete(e),t}),re(s=>{const t=new Map(s);return t.delete(e),t});try{const s=e.startsWith("0x")?e.slice(0,4):`0x${e.slice(0,2)}`,t=await se(s,30);t.success&&t.data?(ce(s=>new Map(s).set(e,t.data)),setTimeout(()=>{ce(s=>{const t=new Map(s);return t.delete(e),t})},1e4)):(re(s=>new Map(s).set(e,t.error||"Ping failed")),setTimeout(()=>{re(s=>{const t=new Map(s);return t.delete(e),t})},5e3))}catch(t){const s=t instanceof Error?t.message:"Ping failed";re(t=>new Map(t).set(e,s)),setTimeout(()=>{re(s=>{const t=new Map(s);return t.delete(e),t})},5e3)}finally{V(null)}}},[B]);return e.jsxs(ae,{children:[e.jsx(ne,{title:"Contacts",icon:e.jsx(b,{}),controls:e.jsxs("div",{className:"flex items-baseline gap-3 sm:gap-4",children:[e.jsxs("span",{className:"roster-title tabular-nums",children:[Pe.length," node",1!==Pe.length?"s":""]}),Fe>0&&e.jsxs("span",{className:"roster-title flex items-baseline gap-1.5 tabular-nums",children:[e.jsx(N,{className:"w-3.5 h-3.5 relative top-[2px]"}),Fe," with location"]})]})}),x?e.jsx(ge,{neighbors:ye,localNode:we,localHash:ke,onRemoveNode:n,selectedNodeHash:D,onNodeSelected:ze,highlightedEdgeKey:W,highlightedGhost:K}):e.jsx("div",{className:"glass-card aspect-video flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 border-2 border-accent-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{className:"text-sm text-text-muted",children:"Loading map..."})]})}),e.jsx(fe,{maxPaths:10,highlightedEdge:W,onHighlightEdge:I}),o.length>0&&(x?e.jsx("div",{className:"chart-container",children:e.jsx(Se,{neighbors:ye,onGhostSelect:U})}):e.jsxs("div",{className:"glass-card",children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"w-6 h-6 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"px-5 py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-20 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-4 rounded bg-bg-elevated animate-pulse"})]})})]})),e.jsx("div",{className:"chart-container",children:x?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(b,{className:"chart-title-icon"}),"Discovered Contacts"]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[Me.size>0&&e.jsxs("button",{onClick:()=>C(!k),className:"flex items-center gap-1 px-1.5 sm:px-2.5 py-1.5 text-sm rounded-lg transition-colors "+(k?"bg-accent-success/20 text-accent-success border border-accent-success/30":"text-text-muted hover:text-text-secondary hover:bg-white/5 border border-transparent"),title:k?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(S,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Neighbors"}),e.jsx("span",{className:"sm:hidden tabular-nums",children:Me.size})]}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-muted"}),e.jsx("input",{type:"text",name:"contact-search",id:"contact-search",autoComplete:"off",value:y,onChange:e=>w(e.target.value),placeholder:"Search...",className:"w-20 sm:w-28 lg:w-32 pl-6 sm:pl-7 pr-6 py-1.5 text-sm bg-white/5 border border-white/10 rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-primary/50"}),y&&e.jsx("button",{onClick:()=>{w(""),"neighbor"!==y.toLowerCase().trim()&&"neighbors"!==y.toLowerCase().trim()||C(!1)},className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary p-0.5",children:e.jsx(L,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1",children:[e.jsxs("button",{onClick:()=>Oe("lastHeard"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("lastHeard"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by last heard",children:[e.jsx(f,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Recent"}),"lastHeard"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]}),e.jsxs("button",{onClick:()=>Oe("distance"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("distance"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by distance",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Distance"}),"distance"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]}),e.jsxs("button",{onClick:()=>Oe("centrality"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("centrality"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by network centrality",children:[e.jsx(d,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Centrality"}),"centrality"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>Ne(!be),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-text-muted hover:text-text-secondary hover:bg-white/5 rounded-lg transition-colors",title:"Items per page",children:[e.jsx("span",{className:"tabular-nums",children:0===oe?"All":oe}),e.jsx(i,{className:"w-3 h-3 transition-transform "+(be?"rotate-180":"")})]}),be&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg-surface border border-border-subtle rounded-lg shadow-lg py-1 min-w-[80px]",children:[25,50,100,0].map(s=>e.jsx("button",{onClick:()=>Ae(s),className:"w-full px-3 py-1.5 text-sm text-left hover:bg-white/5 transition-colors "+(oe===s?"text-accent-primary":"text-text-secondary"),children:0===s?"All":s},s))})]})]})]}),Pe.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-border-subtle/50 px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-activity text-center",children:"Activity"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-border-subtle/30",children:_e.map(([s,t])=>{var a;const n=t.latitude&&t.longitude&&0!==t.latitude&&0!==t.longitude,l=t.node_name||t.name||"Unknown",i=Ee.has(s),r=Me.has(s),o=Ce.get(s),x=c.get(s)||0,m=r?Le.get(s):void 0,p=r&&m,u=null==(a=t.contact_type)?void 0:a.toLowerCase(),j="room server"===u||"room_server"===u||"room"===u||"server"===u,b="companion"===u||"client"===u||"cli"===u,N=t.is_repeater||"repeater"===u||"rep"===u,v=r?"direct":"flood",f=r?"Direct RF contact (zero-hop neighbor)":"Flood routing (multi-hop via mesh)";return e.jsxs("div",{className:`contacts-grid-row ${i?"bg-amber-500/5 border-l-2 border-l-amber-400":""} ${n?"cursor-pointer hover:bg-white/[0.02]":""}`,onClick:()=>De(s),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[p&&null!==(null==m?void 0:m.avgSnr)?e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0 self-center "+(w=m.avgSnr,void 0===w?"bg-[var(--signal-unknown)]":w>=5?"bg-[var(--signal-excellent)]":w>=0?"bg-[var(--signal-good)]":w>=-5?"bg-[var(--signal-fair)]":w>=-10?"bg-[var(--signal-poor)]":"bg-[var(--signal-critical)]")}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"roster-icon flex-shrink-0",title:f,children:j&&N?e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(F,{className:"w-5 h-5 absolute inset-0 text-accent-secondary"}),e.jsx(E,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-accent-primary"})]}):j?e.jsx(F,{className:"w-5 h-5 text-accent-secondary"}):b?e.jsx(R,{className:"w-5 h-5 text-text-muted"}):N?"direct"===v?e.jsx(T,{className:"w-5 h-5 text-accent-success"}):e.jsx(E,{className:"w-5 h-5 text-accent-tertiary"}):e.jsx(R,{className:"w-5 h-5 text-text-muted"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:l,children:l}),r&&e.jsx("span",{className:"type-badge px-1.5 py-0.5 rounded flex-shrink-0",style:{backgroundColor:"rgba(113, 152, 114, 0.2)",color:"var(--accent-success)"},children:"NBR"}),i&&e.jsxs("span",{className:"type-badge px-1.5 py-0.5 rounded flex items-center gap-1 flex-shrink-0",style:{backgroundColor:"rgba(223, 188, 114, 0.2)",color:"var(--accent-secondary)"},children:[e.jsx($,{className:"w-3 h-3"}),"HUB"]}),N&&e.jsx("span",{className:"pill-tag flex-shrink-0",children:"RPT"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(de,{hash:s,size:"xs",prefixLength:8,suffixLength:6}),e.jsx(Te,{hash:s})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[p&&null!==(null==m?void 0:m.avgRssi)&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(xe,{rssi:m.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs tabular-nums text-text-muted",children:Math.round(m.avgRssi)})]}),p&&null!==(null==m?void 0:m.avgSnr)&&e.jsxs("span",{className:"type-data-xs tabular-nums text-text-muted",children:[m.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-text-muted",children:null!=o&&e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs tabular-nums",children:(y=o,y<1e3?`${Math.round(y)}m`:`${(y/1e3).toFixed(1)}km`)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:x>0&&e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"w-3 h-3 text-accent-secondary"}),e.jsxs("span",{className:"type-data-xs tabular-nums text-text-muted",children:[(100*x).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-activity flex items-center justify-center",children:e.jsx(Re,{nodeHash:s,width:48,height:16})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs tabular-nums text-text-primary whitespace-nowrap",children:t.last_seen?te(t.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[r&&e.jsx(e.Fragment,{children:le.has(s)?e.jsxs("div",{className:"flex items-center gap-1 text-accent-success",title:`RTT: ${le.get(s).rtt_ms.toFixed(0)}ms`,children:[e.jsx(g,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs tabular-nums hidden sm:inline",children:[le.get(s).snr_db.toFixed(1),"dB"]})]}):ie.has(s)?e.jsx("span",{className:"text-red-400 text-[10px]",title:ie.get(s),children:"✗"}):e.jsx("button",{onClick:e=>Ge(s,e),disabled:null!==B,className:"p-1 sm:p-1.5 rounded-lg text-text-muted/50 hover:text-accent-primary hover:bg-accent-primary/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:B===s?e.jsx(_,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(A,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:e=>{e.stopPropagation(),h({hash:s,name:l})},className:"p-1 sm:p-1.5 rounded-lg text-text-muted/50 hover:text-red-400 hover:bg-red-500/10 transition-colors",title:"Remove contact",children:e.jsx(O,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]},s);var y,w})}),oe>0&&pe0&&peue(e=>Math.min(e+oe,Pe.length)),className:"text-accent-primary hover:text-accent-primary/80 transition-colors",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(b,{className:"roster-empty-icon"}),e.jsx("div",{className:"type-label text-text-secondary",children:"No Contacts Discovered"}),e.jsx("div",{className:"type-data-xs text-text-muted mt-1",children:"Contacts will appear here as they advertise on the mesh network."})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-32 h-4 rounded bg-bg-elevated animate-pulse"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-16 h-6 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-24 h-6 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-6 rounded bg-bg-elevated animate-pulse"})]})]}),e.jsx("div",{className:"px-3 py-3 space-y-3",children:[...Array(5)].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-bg-elevated animate-pulse"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-4 w-32 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"h-3 w-24 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"w-12 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-4 rounded bg-bg-elevated animate-pulse"})]},t))})]})}),e.jsx(he,{isOpen:!!m,title:"Remove Contact",message:`Are you sure you would like to remove ${(null==m?void 0:m.name)||"this contact"}?`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{m&&n(m.hash),h(null)},onCancel:()=>h(null)})]})}},Symbol.toStringTag,{value:"Module"}));export{_e as C,Re as N,Te as P}; diff --git a/frontend/dist/assets/Contacts-DVK_9PWN.js b/frontend/dist/assets/Contacts-DVK_9PWN.js new file mode 100644 index 00000000..2edef837 --- /dev/null +++ b/frontend/dist/assets/Contacts-DVK_9PWN.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-rvuELpep.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/link-scoring-y9pf-GTv.js","assets/index-DrUSC4Ks.js","assets/ConfirmModal-B37DcPi-.js","assets/useThemeColors-DL9Pr7sC.js","assets/PageLayout-DAadOF4d.js","assets/HashBadge-CAy9V6Vn.js","assets/SignalIndicator-C1cW0knK.js","assets/CollisionExplorerModal-B0_yuX1j.js","assets/maplibre-gl-B1CfjdFi.css","assets/index-CO4RTX0p.css","assets/leaflet-CIGW-MKW.css"])))=>i.map(i=>d[i]); +import{j as e,r as s,ac as t,a8 as a,z as n,h as l,ad as c,k as i,ae as r,Z as o,af as d,T as x,A as m,a2 as h,ag as p,ah as u,ab as g,a7 as j,a1 as b,a6 as N,ai as v,o as f,aj as y,ak as w,_ as C,al as k,p as S,am as M,X as L,an as H,ao as P,ap as F,aq as E,ar as R,as as T,at as $,au as _,av as A,aw as O}from"./vendor-react-C0qkT9dV.js";import{C as D,E as z,A as G,G as W,H as I,I as K,p as U,J as B,d as V,K as q,f as J,L as Q,M as Z,N as X,e as Y,n as ee,O as se,Q as te}from"./index-DrUSC4Ks.js";import{P as ae,b as ne}from"./PageLayout-DAadOF4d.js";import{_ as le}from"./deckgl-DTsmDcfs.js";import{c as ce,L as ie,T as re,a as oe}from"./recharts-DRDKmvXb.js";import{H as de}from"./HashBadge-CAy9V6Vn.js";import{a as xe}from"./SignalIndicator-C1cW0knK.js";import{C as me}from"./CollisionExplorerModal-B0_yuX1j.js";import{C as he}from"./ConfirmModal-B37DcPi-.js";class pe extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){var s;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 glass-card flex items-center justify-center",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-white/50 p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-white/30",children:(null==(s=this.state.error)?void 0:s.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-white/20 mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ue=s.lazy(()=>le(()=>import("./ContactsMapMapLibre-rvuELpep.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function ge({neighbors:t,localNode:a,localHash:n,onRemoveNode:l,selectedNodeHash:c,onNodeSelected:i,highlightedEdgeKey:r,highlightedGhost:o}){return e.jsx(pe,{children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"map-container-16-9 glass-card flex items-center justify-center",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-white/50 flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-accent-primary border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})}),children:e.jsx(ue,{neighbors:t,localNode:a,localHash:n,onRemoveNode:l,selectedNodeHash:c,onNodeSelected:i,highlightedEdgeKey:r,highlightedGhost:o})})})}function je(e){return e>=.7?"text-accent-success":e>=.5?"text-accent-secondary":e>=.3?"text-signal-poor":"text-accent-danger"}function be(e){return`${Math.round(100*e)}%`}function Ne(e,s){return s.has(e.toUpperCase())}const ve=s.memo(function({path:s,isHighlighted:t,onHighlight:c,ghostPrefixes:i}){const r=function(s){return s>.2?{icon:e.jsx(x,{className:"w-3 h-3"}),color:"text-accent-success"}:s<-.2?{icon:e.jsx(n,{className:"w-3 h-3"}),color:"text-accent-danger"}:{icon:e.jsx(m,{className:"w-3 h-3"}),color:"text-text-muted"}}(s.observationTrend),h=s.weakestLinkKey&&s.weakestLinkConfidence<.5,p=s.hops.some(e=>Ne(e,i));return e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md transition-colors cursor-pointer "+(t?"bg-accent-primary/20 border border-accent-primary/40":"hover:bg-white/5"),onClick:()=>c(t?null:s.weakestLinkKey),children:[e.jsx("div",{className:"flex-shrink-0 w-12 text-center py-1 rounded-md "+(u=s.healthScore,u>=.7?"bg-accent-success/10":u>=.5?"bg-accent-secondary/10":u>=.3?"bg-signal-poor/10":"bg-accent-danger/10"),children:e.jsx("span",{className:`text-xs font-semibold tabular-nums ${je(s.healthScore)}`,children:be(s.healthScore)})}),e.jsx("div",{className:"flex-1 flex items-center gap-0.5 overflow-x-auto min-w-0",children:s.hops.map((t,a)=>{var n;const c=Ne(t,i),r=h&&(null==(n=s.weakestLinkKey)?void 0:n.includes(t));return e.jsxs("span",{className:"flex items-center",children:[e.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-0.5 "+(c?"bg-accent-tertiary/20 text-accent-tertiary border border-accent-tertiary/30":r?"bg-accent-danger/20 text-accent-danger":"bg-white/10 text-text-secondary"),children:[c&&e.jsx(l,{className:"w-2.5 h-2.5"}),t]}),anew Set(p.map(e=>e.prefix.toUpperCase())),[p]),b=s.useMemo(()=>m.slice(0,o),[m,o]),N=s.useMemo(()=>0===m.length?null:{avgHealth:m.reduce((e,s)=>e+s.healthScore,0)/m.length,declining:m.filter(e=>e.observationTrend<-.2).length,weakLinks:m.filter(e=>e.weakestLinkConfidence<.5).length,pathsWithGhosts:m.filter(e=>e.hops.some(e=>j.has(e.toUpperCase()))).length},[m,j]),v=e=>{null==d||d(e)};return 0===m.length?null:e.jsxs("div",{className:"chart-container",children:[e.jsxs("button",{onClick:()=>g(!u),className:"w-full chart-header hover:bg-white/5 transition-colors rounded-t-lg cursor-pointer",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(t,{className:"chart-title-icon"}),"Path Health",e.jsxs("span",{className:"ml-2 text-[10px] font-normal text-text-muted",children:["(",m.length," paths)"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[N&&e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[e.jsxs("span",{className:`tabular-nums ${je(N.avgHealth)}`,children:["Avg: ",be(N.avgHealth)]}),N.weakLinks>0&&e.jsxs("span",{className:"text-accent-danger flex items-center gap-1",children:[e.jsx(a,{className:"w-3 h-3"}),N.weakLinks," weak"]}),N.declining>0&&e.jsxs("span",{className:"text-signal-poor flex items-center gap-1",children:[e.jsx(n,{className:"w-3 h-3"}),N.declining," declining"]}),N.pathsWithGhosts>0&&e.jsxs("span",{className:"text-accent-tertiary flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3"}),N.pathsWithGhosts," ghost"]})]}),u?e.jsx(c,{className:"w-4 h-4 text-text-muted"}):e.jsx(i,{className:"w-4 h-4 text-text-muted"})]})]}),u&&e.jsxs("div",{className:"p-3 pt-0 space-y-1",children:[h.totalPaths>0&&e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted pb-2 border-b border-white/5",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(r,{className:"w-3 h-3 text-accent-primary"}),e.jsx("span",{className:"text-text-secondary",children:h.totalPaths.toLocaleString()})," Viterbi decoded"]}),h.observationOverrideCount>0&&e.jsxs("span",{className:"text-accent-success",children:[Math.round(h.observationOverrideCount/h.totalPaths*100),"% observation override"]}),p.length>0&&e.jsxs("span",{className:"text-accent-tertiary flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3"}),p.length," ghost",1!==p.length?"s":""]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-text-muted pb-2 border-b border-white/5",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-success"})," Healthy (≥70%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-secondary"})," Fair (50-70%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-signal-poor"})," Weak (30-50%)"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-accent-danger"})," Critical (<30%)"]}),p.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(l,{className:"w-3 h-3 text-accent-tertiary"})," Ghost"]})]}),e.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:b.map(s=>e.jsx(ve,{path:s,isHighlighted:x===s.weakestLinkKey,onHighlight:v,ghostPrefixes:j},s.pathKey))}),m.length>o&&e.jsxs("div",{className:"text-center text-[10px] text-text-muted pt-2",children:["Showing top ",o," of ",m.length," paths"]})]})]})});function ye(e){switch(e){case"rf_intersection":return"RF Circle Intersection";case"weighted_centroid":return"Weighted Centroid";case"single_anchor":return"Single Anchor (less reliable)";default:return e}}const we={confirmed:{label:"Confirmed",icon:e.jsx(u,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-success/40",bgClass:"bg-accent-success/10",textClass:"text-accent-success",badgeClass:"bg-accent-success/20 text-accent-success"},likely:{label:"Likely",icon:e.jsx(g,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-tertiary/30",bgClass:"bg-accent-tertiary/5",textClass:"text-accent-tertiary",badgeClass:"bg-accent-tertiary/20 text-accent-tertiary"},possible:{label:"Possible",icon:e.jsx(j,{className:"w-3.5 h-3.5"}),borderClass:"border-accent-secondary/20",bgClass:"bg-accent-secondary/5",textClass:"text-accent-secondary",badgeClass:"bg-accent-secondary/20 text-accent-secondary"},noise:{label:"Noise",icon:e.jsx(a,{className:"w-3.5 h-3.5"}),borderClass:"border-border-muted",bgClass:"bg-bg-card/30",textClass:"text-text-muted",badgeClass:"bg-bg-elevated text-text-muted"}};function Ce({ghost:t,neighbors:n,isExpanded:o,onToggle:x,compact:m}){var h,p;const u=(null==(h=t.classification)?void 0:h.tier)??"noise",g=we[u],j="clusterId"in(w=t)&&"temporal"in w;var w;const C=s.useMemo(()=>Array.from(t.commonNeighbors).map(e=>{var s;return{hash:e,name:null==(s=n[e])?void 0:s.name}}),[t.commonNeighbors,n]),k=t.estimatedLocation?t.estimatedLocation.uncertaintyM>=1e3?`±${(t.estimatedLocation.uncertaintyM/1e3).toFixed(1)}km`:`±${Math.round(t.estimatedLocation.uncertaintyM)}m`:null,S=j&&t.temporal?(M=t.temporal.consistency)>=.7?{label:"Steady",color:"text-accent-success"}:M>=.4?{label:"Regular",color:"text-accent-tertiary"}:M>=.2?{label:"Sporadic",color:"text-accent-secondary"}:{label:"Bursty",color:"text-signal-poor"}:null;var M;const L=j&&t.collisionCandidates&&t.collisionCandidates.length>0,H=L?t.collisionCandidates[0]:null;return m?e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded bg-bg-elevated/50 text-sm",children:[e.jsx("span",{className:"font-mono font-medium text-text-secondary",children:t.prefix.toUpperCase()}),e.jsx("span",{className:"text-text-muted",children:t.observationCount})]}):e.jsxs("div",{className:ce("rounded-lg border transition-all duration-150",g.borderClass,g.bgClass),children:[e.jsxs("button",{onClick:x,className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/5 rounded-lg",children:[e.jsx(l,{className:ce("w-5 h-5 flex-shrink-0",g.textClass)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-sm font-semibold text-text-primary",children:t.prefix.toUpperCase()}),e.jsx("span",{className:ce("px-1.5 py-0.5 rounded text-sm font-medium",g.badgeClass),children:g.label})]}),e.jsx("div",{className:ce("text-sm mt-0.5",g.textClass),children:(null==(p=t.classification)?void 0:p.reason)??"Unknown"}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-text-muted mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(r,{className:"w-3 h-3"}),t.observationCount]}),e.jsxs("span",{children:[(100*t.confidence).toFixed(0),"%"]}),t.commonNeighbors.size>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(b,{className:"w-3 h-3"}),t.commonNeighbors.size]}),t.estimatedLocation&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(N,{className:"w-3 h-3"}),k]}),S&&e.jsxs("span",{className:ce("flex items-center gap-1",S.color),children:[e.jsx(d,{className:"w-3 h-3"}),S.label]}),L&&e.jsxs("span",{className:"flex items-center gap-1 text-signal-poor",children:[e.jsx(v,{className:"w-3 h-3"}),"Collision?"]})]})]}),o?e.jsx(c,{className:"w-4 h-4 text-text-muted"}):e.jsx(i,{className:"w-4 h-4 text-text-muted"})]}),o&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-border-muted/50 mt-1 pt-3",children:[L&&H&&e.jsx("div",{className:"p-2 rounded bg-signal-poor/10 border border-signal-poor/30",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(v,{className:"w-4 h-4 text-signal-poor flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-signal-poor font-medium",children:"Possible collision with known node"}),e.jsx("div",{className:"text-text-secondary mt-0.5",children:H.knownNodeName?e.jsxs("span",{children:["May match ",e.jsx("span",{className:"font-medium",children:H.knownNodeName})," ","(",(100*H.collisionProbability).toFixed(0),"% probability)"]}):e.jsxs("span",{children:["May match ",e.jsx(de,{hash:H.knownNodeHash,size:"sm",className:"inline"})," ","(",(100*H.collisionProbability).toFixed(0),"% probability)"]})}),H.evidence&&e.jsxs("div",{className:"text-text-muted mt-1 text-[10px]",children:[H.evidence.sharedEdgeCount>0&&e.jsxs("span",{className:"mr-2",children:[H.evidence.sharedEdgeCount," shared edges"]}),void 0!==H.evidence.distanceKm&&e.jsxs("span",{className:"mr-2",children:[H.evidence.distanceKm.toFixed(1),"km apart"]}),H.evidence.withinUncertainty&&e.jsx("span",{className:"text-accent-secondary",children:"Within uncertainty radius"})]})]})]})}),t.estimatedLocation?e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-accent-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary font-medium",children:[t.estimatedLocation.lat.toFixed(5),", ",t.estimatedLocation.lon.toFixed(5)]}),e.jsxs("div",{className:"text-text-muted",children:["Uncertainty: ",k]}),j&&t.location&&e.jsxs("div",{className:"mt-1 text-text-muted",children:[e.jsxs("div",{children:["Method: ",ye(t.location.method)]}),t.location.anchors&&t.location.anchors.length>0&&e.jsxs("div",{children:[t.location.anchors.length," anchor",1!==t.location.anchors.length?"s":""," used"," · ",(100*t.location.locationConfidence).toFixed(0),"% confidence"]})]})]})]}):e.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[e.jsx(a,{className:"w-4 h-4 text-signal-poor"}),"Location unknown (neighbors lack coordinates)"]}),j&&t.temporal&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(d,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary font-medium",children:["Temporal Pattern: ",e.jsx("span",{className:null==S?void 0:S.color,children:null==S?void 0:S.label})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1 text-text-muted",children:[e.jsxs("span",{children:["Distinct hours: ",t.temporal.distinctHours]}),e.jsxs("span",{children:["Distinct days: ",t.temporal.distinctDays]}),e.jsxs("span",{children:["Burstiness: ",(100*t.temporal.burstiness).toFixed(0),"%"]}),e.jsxs("span",{children:["Consistency: ",(100*t.temporal.consistency).toFixed(0),"%"]}),e.jsxs("span",{children:["Last 24h: ",t.temporal.last24HourCount," obs"]}),e.jsxs("span",{children:["Active hours: ",t.temporal.activeHoursLast24,"/24"]})]})]})]}),!j&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(f,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary",children:["First seen: ",W(t.firstSeen)," ago"]}),e.jsxs("div",{className:"text-text-muted",children:["Last seen: ",W(t.lastSeen)," ago"]})]})]}),j&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-primary",children:["Active period: ",W(t.firstSeen)," – ",W(t.lastSeen)," ago"]}),t.temporal&&e.jsxs("div",{className:"text-text-muted",children:["Obs/hour avg: ",t.temporal.observationsPerHour.toFixed(1)]})]})]}),C.length>0&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(b,{className:"w-4 h-4 text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{className:"text-text-muted mb-1",children:["Adjacent to ",C.length," known node",1!==C.length?"s":"",":"]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[C.slice(0,5).map(({hash:s})=>e.jsx(de,{hash:s,size:"sm"},s)),C.length>5&&e.jsxs("span",{className:"text-text-muted",children:["+",C.length-5," more"]})]})]})]}),j&&t.validationStages&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30",children:[e.jsx("div",{className:"text-[10px] text-text-muted mb-1.5 uppercase tracking-wide",children:"Validation Stages"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(ke,{label:"Candidates",passed:t.validationStages.candidateExhaustion}),e.jsx(ke,{label:"Temporal",passed:t.validationStages.temporalConsistency}),e.jsx(ke,{label:"Topology",passed:t.validationStages.topologicalFit}),e.jsx(ke,{label:"Location",passed:t.validationStages.locationPlausible})]})]}),t.classification&&!j&&e.jsx("div",{className:"pt-2 border-t border-border-muted/30",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.classification.criteria.hasVeryHighObservations&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-success/20 text-accent-success",children:"200+ obs"}),t.classification.criteria.hasHighObservations&&!t.classification.criteria.hasVeryHighObservations&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-tertiary/20 text-accent-tertiary",children:"50+ obs"}),t.classification.criteria.hasHighConfidence&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-success/20 text-accent-success",children:"70%+ conf"}),t.classification.criteria.hasCommonNeighbors&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-primary/20 text-accent-primary",children:"2+ neighbors"}),t.classification.criteria.hasGoodLocation&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-accent-primary/20 text-accent-primary",children:"good loc"}),t.classification.criteria.isRecent&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-text-muted/20 text-text-muted",children:"recent"})]})}),j&&t.upgradeRequirements&&t.upgradeRequirements.length>0&&"confirmed"!==u&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30",children:[e.jsx("div",{className:"text-[10px] text-text-muted mb-1 uppercase tracking-wide",children:"To upgrade tier:"}),e.jsx("ul",{className:"text-xs text-text-secondary space-y-0.5",children:t.upgradeRequirements.slice(0,3).map((s,t)=>e.jsxs("li",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-accent-tertiary",children:"•"})," ",s]},t))})]})]})]})}function ke({label:s,passed:t}){return e.jsxs("span",{className:ce("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium",t?"bg-accent-success/20 text-accent-success":"bg-bg-elevated text-text-muted"),children:[t?e.jsx(w,{className:"w-2.5 h-2.5"}):e.jsx(C,{className:"w-2.5 h-2.5"}),s]})}function Se({neighbors:t,className:n,onGhostSelect:r}){const o=G(),d=z(),[x,b]=s.useState(new Set),[N,v]=s.useState("actionable"),[f,y]=s.useState(!1),[w,C]=s.useState(!0),[k,S]=s.useState(Date.now);s.useEffect(()=>{S(Date.now())},[o]);const M=s.useMemo(()=>o.filter(e=>!function(e,s){return s-1e3*e.lastSeen>6048e5}(e,k)),[o,k]),L=s.useMemo(()=>{const e=Array.from(x);return e.length>0?e[0]:null},[x]),H=s.useMemo(()=>L?M.find(e=>e.prefix===L)??null:null,[L,M]);s.useEffect(()=>{r&&r(H&&!w?{prefix:H.prefix,commonNeighbors:Array.from(H.commonNeighbors),estimatedLocation:H.estimatedLocation}:null)},[H,w,r]),s.useEffect(()=>{w&&b(new Set)},[w]);const{confirmed:P,likely:F,possible:E,noise:R,actionableCount:T}=s.useMemo(()=>{var e;const s=[],t=[],a=[],n=[];for(const c of M)switch((null==(e=c.classification)?void 0:e.tier)??"noise"){case"confirmed":s.push(c);break;case"likely":t.push(c);break;case"possible":a.push(c);break;case"noise":n.push(c)}const l=(e,s)=>s.observationCount-e.observationCount;return s.sort(l),t.sort(l),a.sort(l),n.sort(l),{confirmed:s,likely:t,possible:a,noise:n,actionableCount:s.length+t.length}},[M]);if(0===M.length)return null;const $=e=>{b(s=>s.has(e)?new Set:new Set([e]))},_="all"===N,A=P.length+F.length+(_?E.length:0)+(f?R.length:0);return e.jsxs("div",{className:n,children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(l,{className:"chart-title-icon"}),"Ghost Buster",T>0&&e.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent-success/20 text-accent-success",children:[T," actionable"]}),w&&M.length>0&&e.jsxs("span",{className:"text-xs text-text-muted ml-2",children:["(",M.length," total)"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!w&&e.jsxs("button",{onClick:()=>v(e=>"actionable"===e?"all":"actionable"),className:ce("flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors","all"===N?"bg-accent-primary/20 text-accent-primary":"bg-bg-elevated text-text-muted hover:text-text-secondary"),children:[e.jsx(h,{className:"w-3 h-3"}),"actionable"===N?"Actionable":"All"]}),e.jsx("button",{onClick:()=>C(e=>!e),className:"flex items-center gap-1 px-2 py-1 rounded text-xs bg-bg-elevated text-text-muted hover:text-text-secondary transition-colors",title:w?"Expand panel":"Minimize panel",children:w?e.jsx(p,{className:"w-3 h-3"}):e.jsx(m,{className:"w-3 h-3"})})]})]}),w?e.jsxs("div",{className:"px-5 py-3 flex items-center gap-3 text-xs cursor-pointer hover:bg-white/5 transition-colors",onClick:()=>C(!1),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[P.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent-success",children:[e.jsx(u,{className:"w-3 h-3"}),P.length," confirmed"]}),F.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent-tertiary",children:[e.jsx(g,{className:"w-3 h-3"}),F.length," likely"]}),E.length>0&&e.jsxs("span",{className:"text-accent-secondary",children:[E.length," possible"]}),R.length>0&&e.jsxs("span",{className:"text-text-muted",children:[R.length," noise"]})]}),e.jsx("span",{className:"text-text-muted ml-auto",children:"Click to expand"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-5 py-2 flex items-center gap-3 text-xs border-b border-border-muted/30",children:[e.jsxs("span",{className:"text-text-muted",children:[d.pathsWithGhosts.toLocaleString()," / ",d.totalPaths.toLocaleString()," paths"]}),e.jsx("span",{className:"text-text-muted",children:"•"}),e.jsxs("div",{className:"flex items-center gap-2",children:[P.length>0&&e.jsxs("span",{className:"text-accent-success",children:[P.length," confirmed"]}),F.length>0&&e.jsxs("span",{className:"text-accent-tertiary",children:[F.length," likely"]}),E.length>0&&e.jsxs("span",{className:"text-accent-secondary",children:[E.length," possible"]}),R.length>0&&e.jsxs("span",{className:"text-text-muted",children:[R.length," noise"]})]})]}),e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[P.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-success",children:[e.jsx(u,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Confirmed Repeaters (",P.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:P.map(s=>e.jsx(Ce,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix))})]}),F.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-tertiary",children:[e.jsx(g,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Likely Repeaters (",F.length,")"]})]}),e.jsx("div",{className:"space-y-2",children:F.map(s=>e.jsx(Ce,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix))})]}),_&&E.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-accent-secondary",children:[e.jsx(j,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"font-medium",children:["Possible (",E.length,")"]})]}),e.jsxs("div",{className:"space-y-2",children:[E.slice(0,10).map(s=>e.jsx(Ce,{ghost:s,neighbors:t,isExpanded:x.has(s.prefix),onToggle:()=>$(s.prefix)},s.prefix)),E.length>10&&e.jsxs("div",{className:"text-xs text-text-muted text-center py-1",children:["+",E.length-10," more possible nodes"]})]})]}),R.length>0&&"all"===N&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{onClick:()=>y(!f),className:"flex items-center gap-2 text-xs text-text-muted hover:text-text-secondary transition-colors",children:[f?e.jsx(c,{className:"w-3.5 h-3.5"}):e.jsx(i,{className:"w-3.5 h-3.5"}),e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsxs("span",{children:["Noise (",R.length,")"]})]}),f&&e.jsx("div",{className:"flex flex-wrap gap-1",children:R.map(s=>e.jsx(Ce,{ghost:s,neighbors:t,isExpanded:!1,onToggle:()=>{},compact:!0},s.prefix))})]}),"actionable"===N&&0===T&&e.jsxs("div",{className:"text-center py-6 text-sm text-text-muted",children:[e.jsx(l,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No confirmed or likely repeaters yet."}),e.jsxs("p",{className:"text-xs mt-1",children:[E.length+R.length," prefixes need more evidence."]}),e.jsxs("button",{onClick:()=>v("all"),className:"mt-3 text-accent-primary hover:underline",children:["View all ",M.length," discovered nodes"]})]}),d.observationOverrideCount>0&&A>0&&e.jsxs("div",{className:"pt-2 border-t border-border-muted/30 text-xs text-text-muted",children:[e.jsx("span",{className:"text-accent-primary",children:d.observationOverrideCount})," observation overrides • Avg confidence: ",e.jsxs("span",{className:"text-accent-secondary",children:[(100*d.avgPathConfidence).toFixed(0),"%"]})]})]})]})]})}const Me="var(--sparkline-critical)",Le="var(--sparkline-poor)",He="var(--sparkline-fair)",Pe="var(--sparkline-good)",Fe="var(--sparkline-excellent)";function Ee({active:s,payload:t}){if(!s||!t||!t.length)return null;const a=t[0].payload,n=new Date(a.timestamp),l=`${(n.getMonth()+1).toString().padStart(2,"0")}/${n.getDate().toString().padStart(2,"0")}`;return e.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded px-1.5 py-0.5 text-[10px] shadow-xl",children:[e.jsx("span",{className:"text-text-muted",children:l}),e.jsx("span",{className:"ml-1.5 font-semibold tabular-nums",children:a.count})]})}const Re=s.memo(function({nodeHash:s,width:t=60,height:a=20,color:n,showArea:l=!0,showTooltip:c=!1,className:i=""}){const r=I(s),o=K(),d=!U().backgroundLoadComplete||o,x=n??(r.length>0?function(e){if(0===e.length)return Me;const s=e.slice(-4),t=s.reduce((e,s)=>e+s.count,0),a=t/s.length,n=e.reduce((e,s)=>e+s.count,0)/e.length;if(0===t)return Me;if(n>0){const e=a/n;return e>=1.2?Fe:e>=.8?Pe:e>=.4?He:e>=.1?Le:Me}return t>=10?Fe:t>=5?Pe:t>=2?He:t>=1?Le:Me}(r):"var(--text-muted)"),m="number"==typeof t?t:60,h=a;return d&&r.length<2?e.jsx("div",{className:`flex items-center justify-center ${i}`,style:{width:m,height:h},children:e.jsx("div",{className:"rounded animate-pulse bg-white/[0.06]",style:{width:m-8,height:h-6}})}):r.length<2?e.jsx("div",{className:`flex items-center justify-center ${i}`,style:{width:m,height:h,color:Me},children:e.jsx("svg",{width:m,height:h,viewBox:`0 0 ${m} ${h}`,preserveAspectRatio:"none",children:e.jsx("line",{x1:4,y1:h/2,x2:m-4,y2:h/2,stroke:"currentColor",strokeWidth:1.5,strokeDasharray:"3,2"})})}):e.jsx("div",{className:i,style:{width:m,height:h},children:e.jsxs(ie,{data:r,width:m,height:h,margin:{top:1,right:1,bottom:1,left:1},children:[c&&e.jsx(re,{content:e.jsx(Ee,{}),cursor:{stroke:"rgba(255,255,255,0.2)",strokeWidth:1}}),e.jsx(oe,{type:"monotone",dataKey:"count",stroke:x,strokeWidth:1.5,dot:!1,isAnimationActive:!1})]})})}),Te=s.memo(function({hash:t,className:a="",size:n="sm"}){const l=B(),c=z(),[i,o]=s.useState(!1),d=s.useMemo(()=>V(t),[t]),x=s.useMemo(()=>d?l.find(e=>e.prefix===d)??null:null,[d,l]),m=c.totalPaths>0&&c.avgPathConfidence>=.7,h=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),o(!0)},[]),p=s.useCallback(()=>{o(!1)},[]);if(!x)return null;const u="sm"===n?"w-3.5 h-3.5":"w-4 h-4",j=m?"text-accent-tertiary hover:text-accent-tertiary hover:bg-accent-tertiary/10 focus:ring-accent-tertiary/50":"text-signal-fair hover:text-accent-secondary hover:bg-signal-fair/10 focus:ring-signal-fair/50",b=m?`Prefix conflict resolved by Viterbi HMM (${(100*c.avgPathConfidence).toFixed(0)}% confidence)`:`Prefix conflict: ${x.candidateCount} nodes share prefix "${d}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:h,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${j} ${a}`,title:b,"aria-label":`View prefix conflict for ${d}${m?" (Viterbi resolved)":""}`,children:m?e.jsxs("span",{className:"relative",children:[e.jsx(r,{className:u}),e.jsx(g,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-accent-success"})]}):e.jsx(k,{className:u})}),e.jsx(me,{isOpen:i,prefix:x.prefix,candidateHashes:x.candidateHashes,onClose:p})]})});function $e(e,s,t,a){const n=(t-e)*Math.PI/180,l=(a-s)*Math.PI/180,c=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371e3}const _e=Object.freeze(Object.defineProperty({__proto__:null,default:function(){const{stats:t}=q(),a=J(),n=Q(),l=Z(),c=X(),r=Y(),o=G(),x=ee(),[m,h]=s.useState(null),[p,u]=s.useState("lastHeard"),[j,v]=s.useState("desc"),[y,w]=s.useState(""),[C,k]=s.useState(!1),[D,z]=s.useState(null),[W,I]=s.useState(null),[K,U]=s.useState(null),[B,V]=s.useState(null),[le,ce]=s.useState(new Map),[ie,re]=s.useState(new Map),[oe,me]=s.useState(25),[pe,ue]=s.useState(25),je=s.useRef(null),[be,Ne]=s.useState(!1),ve=s.useMemo(()=>(null==t?void 0:t.neighbors)??{},[null==t?void 0:t.neighbors]),ye=s.useMemo(()=>Object.fromEntries(Object.entries(ve).filter(([e])=>!a.has(e))),[ve,a]),we=s.useMemo(()=>{var e;return(null==(e=null==t?void 0:t.config)?void 0:e.repeater)?{latitude:t.config.repeater.latitude,longitude:t.config.repeater.longitude,name:t.config.node_name||"Local Node"}:void 0},[t]),Ce=null==t?void 0:t.local_hash,ke=s.useMemo(()=>{const e=new Map;if(!(null==we?void 0:we.latitude)||!(null==we?void 0:we.longitude))return e;for(const[s,t]of Object.entries(ye))t.latitude&&t.longitude&&0!==t.latitude&&0!==t.longitude?e.set(s,$e(we.latitude,we.longitude,t.latitude,t.longitude)):e.set(s,null);return e},[ye,we]),{neighborHashSet:Me,neighborSignalMap:Le}=s.useMemo(()=>{const e=new Set,s=new Map;for(const t of r)e.add(t.hash),s.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:e,neighborSignalMap:s}},[r]),He=s.useMemo(()=>{const e=y.toLowerCase().trim(),s="neighbor"===e||"neighbors"===e,t=C||s;return Object.fromEntries(Object.entries(ye).filter(([a,n])=>{if(t&&!Me.has(a))return!1;if(s)return!0;if(!e)return!0;const l=(n.node_name||n.name||"").toLowerCase(),c=a.slice(2,4).toLowerCase();return l.includes(e)||c.includes(e)||a.toLowerCase().includes(e)}))},[ye,y,C,Me]),Pe=s.useMemo(()=>Object.entries(He).sort(([e,s],[t,a])=>{let n=0;switch(p){case"lastHeard":n=(s.last_seen||0)-(a.last_seen||0);break;case"distance":{const s=ke.get(e)??null,a=ke.get(t)??null;n=null===s&&null===a?0:null===s?1:null===a?-1:s-a;break}case"centrality":n=(c.get(e)||0)-(c.get(t)||0)}return"desc"===j?-n:n}),[He,p,j,ke,c]),Fe=Pe.filter(([,e])=>e.latitude&&e.longitude&&0!==e.latitude&&0!==e.longitude).length,Ee=s.useMemo(()=>new Set(l),[l]),_e=s.useMemo(()=>0===oe?Pe:Pe.slice(0,pe),[Pe,pe,oe]);s.useEffect(()=>{ue(oe||Pe.length)},[p,j,y,C,oe,Pe.length]),s.useEffect(()=>{if(0===oe)return;const e=new IntersectionObserver(e=>{e[0].isIntersecting&&peMath.min(e+oe,Pe.length))},{threshold:.1,rootMargin:"100px"});return je.current&&e.observe(je.current),()=>e.disconnect()},[oe,pe,Pe.length]);const Ae=s.useCallback(e=>{me(e),ue(e||Pe.length),Ne(!1)},[Pe.length]),Oe=s.useCallback(e=>{p===e?v(e=>"desc"===e?"asc":"desc"):(u(e),v("desc"))},[p]),De=s.useCallback(e=>{const s=ye[e];(null==s?void 0:s.latitude)&&(null==s?void 0:s.longitude)&&0!==s.latitude&&0!==s.longitude&&z(e)},[ye]),ze=s.useCallback(()=>{z(null)},[]),Ge=s.useCallback(async(e,s)=>{if(s.stopPropagation(),!B){V(e),ce(s=>{const t=new Map(s);return t.delete(e),t}),re(s=>{const t=new Map(s);return t.delete(e),t});try{const s=e.startsWith("0x")?e.slice(0,4):`0x${e.slice(0,2)}`,t=await se(s,30);t.success&&t.data?(ce(s=>new Map(s).set(e,t.data)),setTimeout(()=>{ce(s=>{const t=new Map(s);return t.delete(e),t})},1e4)):(re(s=>new Map(s).set(e,t.error||"Ping failed")),setTimeout(()=>{re(s=>{const t=new Map(s);return t.delete(e),t})},5e3))}catch(t){const s=t instanceof Error?t.message:"Ping failed";re(t=>new Map(t).set(e,s)),setTimeout(()=>{re(s=>{const t=new Map(s);return t.delete(e),t})},5e3)}finally{V(null)}}},[B]);return e.jsxs(ae,{children:[e.jsx(ne,{title:"Contacts",icon:e.jsx(b,{}),controls:e.jsxs("div",{className:"flex items-baseline gap-3 sm:gap-4",children:[e.jsxs("span",{className:"roster-title tabular-nums",children:[Pe.length," node",1!==Pe.length?"s":""]}),Fe>0&&e.jsxs("span",{className:"roster-title flex items-baseline gap-1.5 tabular-nums",children:[e.jsx(N,{className:"w-3.5 h-3.5 relative top-[2px]"}),Fe," with location"]})]})}),x?e.jsx(ge,{neighbors:ye,localNode:we,localHash:Ce,onRemoveNode:n,selectedNodeHash:D,onNodeSelected:ze,highlightedEdgeKey:W,highlightedGhost:K}):e.jsx("div",{className:"glass-card aspect-video flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 border-2 border-accent-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{className:"text-sm text-text-muted",children:"Loading map..."})]})}),e.jsx(fe,{maxPaths:10,highlightedEdge:W,onHighlightEdge:I}),o.length>0&&(x?e.jsx("div",{className:"chart-container",children:e.jsx(Se,{neighbors:ye,onGhostSelect:U})}):e.jsxs("div",{className:"glass-card",children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"w-6 h-6 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"px-5 py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-20 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-4 rounded bg-bg-elevated animate-pulse"})]})})]})),e.jsx("div",{className:"chart-container",children:x?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"chart-title",children:[e.jsx(b,{className:"chart-title-icon"}),"Discovered Contacts"]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[Me.size>0&&e.jsxs("button",{onClick:()=>k(!C),className:"flex items-center gap-1 px-1.5 sm:px-2.5 py-1.5 text-sm rounded-lg transition-colors "+(C?"bg-accent-success/20 text-accent-success border border-accent-success/30":"text-text-muted hover:text-text-secondary hover:bg-white/5 border border-transparent"),title:C?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(S,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Neighbors"}),e.jsx("span",{className:"sm:hidden tabular-nums",children:Me.size})]}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-muted"}),e.jsx("input",{type:"text",name:"contact-search",id:"contact-search",autoComplete:"off",value:y,onChange:e=>w(e.target.value),placeholder:"Search...",className:"w-20 sm:w-28 lg:w-32 pl-6 sm:pl-7 pr-6 py-1.5 text-sm bg-white/5 border border-white/10 rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-primary/50"}),y&&e.jsx("button",{onClick:()=>{w(""),"neighbor"!==y.toLowerCase().trim()&&"neighbors"!==y.toLowerCase().trim()||k(!1)},className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary p-0.5",children:e.jsx(L,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1",children:[e.jsxs("button",{onClick:()=>Oe("lastHeard"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("lastHeard"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by last heard",children:[e.jsx(f,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Recent"}),"lastHeard"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]}),e.jsxs("button",{onClick:()=>Oe("distance"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("distance"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by distance",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Distance"}),"distance"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]}),e.jsxs("button",{onClick:()=>Oe("centrality"),className:"flex items-center gap-1 p-1.5 sm:px-2 sm:py-1.5 text-sm rounded-lg transition-colors "+("centrality"===p?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary hover:bg-white/5"),title:"Sort by network centrality",children:[e.jsx(d,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Centrality"}),"centrality"===p&&e.jsx(H,{className:"w-3 h-3 "+("asc"===j?"rotate-180":"")})]})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>Ne(!be),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-text-muted hover:text-text-secondary hover:bg-white/5 rounded-lg transition-colors",title:"Items per page",children:[e.jsx("span",{className:"tabular-nums",children:0===oe?"All":oe}),e.jsx(i,{className:"w-3 h-3 transition-transform "+(be?"rotate-180":"")})]}),be&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg-surface border border-border-subtle rounded-lg shadow-lg py-1 min-w-[80px]",children:[25,50,100,0].map(s=>e.jsx("button",{onClick:()=>Ae(s),className:"w-full px-3 py-1.5 text-sm text-left hover:bg-white/5 transition-colors "+(oe===s?"text-accent-primary":"text-text-secondary"),children:0===s?"All":s},s))})]})]})]}),Pe.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-border-subtle/50 px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-activity text-center",children:"Activity"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-border-subtle/30",children:_e.map(([s,t])=>{var a;const n=t.latitude&&t.longitude&&0!==t.latitude&&0!==t.longitude,l=t.node_name||t.name||"Unknown",i=Ee.has(s),r=Me.has(s),o=ke.get(s),x=c.get(s)||0,m=r?Le.get(s):void 0,p=r&&m,u=null==(a=t.contact_type)?void 0:a.toLowerCase(),j="room server"===u||"room_server"===u||"room"===u||"server"===u,b="companion"===u||"client"===u||"cli"===u,N=t.is_repeater||"repeater"===u||"rep"===u,v=r?"direct":"flood",f=r?"Direct RF contact (zero-hop neighbor)":"Flood routing (multi-hop via mesh)";return e.jsxs("div",{className:`contacts-grid-row ${i?"bg-amber-500/5 border-l-2 border-l-amber-400":""} ${n?"cursor-pointer hover:bg-white/[0.02]":""}`,onClick:()=>De(s),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[p&&null!==(null==m?void 0:m.avgSnr)?e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0 self-center "+(w=m.avgSnr,void 0===w?"bg-[var(--signal-unknown)]":w>=5?"bg-[var(--signal-excellent)]":w>=0?"bg-[var(--signal-good)]":w>=-5?"bg-[var(--signal-fair)]":w>=-10?"bg-[var(--signal-poor)]":"bg-[var(--signal-critical)]")}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"roster-icon flex-shrink-0",title:f,children:j&&N?e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(F,{className:"w-5 h-5 absolute inset-0 text-accent-secondary"}),e.jsx(E,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-accent-primary"})]}):j?e.jsx(F,{className:"w-5 h-5 text-accent-secondary"}):b?e.jsx(R,{className:"w-5 h-5 text-text-muted"}):N?"direct"===v?e.jsx(T,{className:"w-5 h-5 text-accent-success"}):e.jsx(E,{className:"w-5 h-5 text-accent-tertiary"}):e.jsx(R,{className:"w-5 h-5 text-text-muted"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:l,children:l}),r&&e.jsx("span",{className:"type-badge px-1.5 py-0.5 rounded flex-shrink-0",style:{backgroundColor:"rgba(113, 152, 114, 0.2)",color:"var(--accent-success)"},children:"NBR"}),i&&e.jsxs("span",{className:"type-badge px-1.5 py-0.5 rounded flex items-center gap-1 flex-shrink-0",style:{backgroundColor:"rgba(223, 188, 114, 0.2)",color:"var(--accent-secondary)"},children:[e.jsx($,{className:"w-3 h-3"}),"HUB"]}),N&&e.jsx("span",{className:"pill-tag flex-shrink-0",children:"RPT"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(de,{hash:s,size:"xs",prefixLength:8,suffixLength:6}),e.jsx(Te,{hash:s})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[p&&null!==(null==m?void 0:m.avgRssi)&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(xe,{rssi:m.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs tabular-nums text-text-muted",children:Math.round(m.avgRssi)})]}),p&&null!==(null==m?void 0:m.avgSnr)&&e.jsxs("span",{className:"type-data-xs tabular-nums text-text-muted",children:[m.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-text-muted",children:null!=o&&e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs tabular-nums",children:(y=o,y<1e3?`${Math.round(y)}m`:`${(y/1e3).toFixed(1)}km`)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:x>0&&e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"w-3 h-3 text-accent-secondary"}),e.jsxs("span",{className:"type-data-xs tabular-nums text-text-muted",children:[(100*x).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-activity flex items-center justify-center",children:e.jsx(Re,{nodeHash:s,width:48,height:16})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs tabular-nums text-text-primary whitespace-nowrap",children:t.last_seen?te(t.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[r&&e.jsx(e.Fragment,{children:le.has(s)?e.jsxs("div",{className:"flex items-center gap-1 text-accent-success",title:`RTT: ${le.get(s).rtt_ms.toFixed(0)}ms`,children:[e.jsx(g,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs tabular-nums hidden sm:inline",children:[le.get(s).snr_db.toFixed(1),"dB"]})]}):ie.has(s)?e.jsx("span",{className:"text-red-400 text-[10px]",title:ie.get(s),children:"✗"}):e.jsx("button",{onClick:e=>Ge(s,e),disabled:null!==B,className:"p-1 sm:p-1.5 rounded-lg text-text-muted/50 hover:text-accent-primary hover:bg-accent-primary/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:B===s?e.jsx(_,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(A,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:e=>{e.stopPropagation(),h({hash:s,name:l})},className:"p-1 sm:p-1.5 rounded-lg text-text-muted/50 hover:text-red-400 hover:bg-red-500/10 transition-colors",title:"Remove contact",children:e.jsx(O,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]},s);var y,w})}),oe>0&&pe0&&peue(e=>Math.min(e+oe,Pe.length)),className:"text-accent-primary hover:text-accent-primary/80 transition-colors",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(b,{className:"roster-empty-icon"}),e.jsx("div",{className:"type-label text-text-secondary",children:"No Contacts Discovered"}),e.jsx("div",{className:"type-data-xs text-text-muted mt-1",children:"Contacts will appear here as they advertise on the mesh network."})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chart-header",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-32 h-4 rounded bg-bg-elevated animate-pulse"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-16 h-6 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-24 h-6 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-6 rounded bg-bg-elevated animate-pulse"})]})]}),e.jsx("div",{className:"px-3 py-3 space-y-3",children:[...Array(5)].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-bg-elevated animate-pulse"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-4 w-32 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"h-3 w-24 rounded bg-bg-elevated animate-pulse"})]}),e.jsx("div",{className:"w-12 h-4 rounded bg-bg-elevated animate-pulse"}),e.jsx("div",{className:"w-16 h-4 rounded bg-bg-elevated animate-pulse"})]},t))})]})}),e.jsx(he,{isOpen:!!m,title:"Remove Contact",message:`Are you sure you would like to remove ${(null==m?void 0:m.name)||"this contact"}?`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{m&&n(m.hash),h(null)},onCancel:()=>h(null)})]})}},Symbol.toStringTag,{value:"Module"}));export{_e as C,Re as N,Te as P}; diff --git a/frontend/dist/assets/ContactsMapMapLibre-B1DglaF3.js b/frontend/dist/assets/ContactsMapMapLibre-rvuELpep.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-B1DglaF3.js rename to frontend/dist/assets/ContactsMapMapLibre-rvuELpep.js index 94dded92..d0810bff 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-B1DglaF3.js +++ b/frontend/dist/assets/ContactsMapMapLibre-rvuELpep.js @@ -1 +1 @@ -import{r as A,b as e,j as t,ab as r,ac as n,ba as o,bb as i,h as a,au as s,ap as l,W as c,a3 as u,ae as d,k as f,aQ as g,bc as h,bd as m,be as b,bf as p,ag as x,A as v,aM as w,Z as y,bg as k,bh as C,bi as B,c as M,bj as D,X as E,bk as N,a9 as Q,bl as j,aw as P,b3 as F,bm as S,a0 as L,o as I,ao as R,a6 as T,bn as _,av as H,b6 as z,b7 as G,b9 as O,b5 as U,bo as Y}from"./vendor-react-C0qkT9dV.js";import"./maplibre-gl-Bk5DsYkB.js";import{L as W,c as Z}from"./link-scoring-lk0Wk34S.js";import{B as V,G as K,T as J,m as X,az as q,aA as $,e as AA,aB as eA,Q as tA,S as rA,aC as nA,aD as oA,f as iA,q as aA,aE as sA,aF as lA}from"./index-wYLFmyyS.js";import{C as cA}from"./ConfirmModal-B37DcPi-.js";import{c as uA}from"./recharts-DRDKmvXb.js";import{g as dA,f as fA,h as gA,i as hA}from"./useThemeColors-DL9Pr7sC.js";import{p as mA,a as bA}from"./vendor-core-WoOfkQwm.js";import{P as pA,N as xA}from"./Contacts-B1sA0BbK.js";import"./deckgl-DTsmDcfs.js";import"./PageLayout-DAadOF4d.js";import"./HashBadge-CAy9V6Vn.js";import"./SignalIndicator-C1cW0knK.js";import"./CollisionExplorerModal-DdrurDtW.js";import"./leaflet-D_ckmI2R.js";function vA(A,e){const t=Math.max(5,Math.min(A,300)),r=Math.log(5),n=Math.log(300);return 1+(Math.log(t)-r)/(n-r)*5}function wA({label:A,icon:e,status:n,detail:o}){return t.jsxs("div",{className:uA("flex items-center gap-3 py-3 px-4 rounded-xl transition-all duration-300","active"===n&&"bg-accent-primary/10","complete"===n&&"bg-accent-success/10","pending"===n&&"opacity-40"),children:[t.jsx("div",{className:uA("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-all duration-300","active"===n&&"bg-accent-primary/20","complete"===n&&"bg-accent-success/20","pending"===n&&"bg-white/5"),children:"complete"===n?t.jsx(r,{className:"w-4 h-4 text-accent-success"}):"active"===n?t.jsx(s,{className:"w-4 h-4 animate-spin text-accent-primary"}):t.jsx("span",{className:"text-text-muted",children:e})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:uA("text-sm font-medium transition-colors","active"===n&&"text-accent-primary","complete"===n&&"text-accent-success","pending"===n&&"text-text-muted"),children:A}),o&&"pending"!==n&&t.jsx("div",{className:"text-xs text-text-muted mt-0.5 truncate",children:o})]})]})}const yA=A.memo(function({isOpen:s,currentStep:l,packetCount:c,onClose:u}){if(A.useEffect(()=>{if(!s)return;const A=A=>{"Escape"===A.key&&u&&u()};window.addEventListener("keydown",A);const e=document.body.style.overflow,t=document.body.style.position,r=document.body.style.width,n=document.body.style.top,o=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${o}px`,()=>{window.removeEventListener("keydown",A),document.body.style.overflow=e,document.body.style.position=t,document.body.style.width=r,document.body.style.top=n,window.scrollTo(0,o)}},[s,u]),!s)return null;const d="complete"===l,f=A=>{const e=["fetching","analyzing","building","discovering","complete"],t=e.indexOf(l),r=e.indexOf(A);return r0?`${c.toLocaleString()} packets`:"Loading database..."}),t.jsx(wA,{label:"Analyzing Database",icon:t.jsx(i,{className:"w-4 h-4"}),status:f("analyzing"),detail:"Processing packet paths"}),t.jsx(wA,{label:"Building Topology",icon:t.jsx(n,{className:"w-4 h-4"}),status:f("building"),detail:"Computing mesh edges"}),t.jsx(wA,{label:"Discovering Nodes",icon:t.jsx(a,{className:"w-4 h-4"}),status:f("discovering"),detail:"Viterbi HMM ghost detection"})]}),t.jsx("p",{className:"text-xs text-text-muted text-center mt-5",children:"This may take a few seconds..."})]})})]}),document.body)}),kA={nodeFill:"#F5F5F0",nodeStroke:"#4A5568",localColor:"#FBBF24",hubColor:"#8B7BAD",mobileColor:"#F97316",roomServerColor:"#E17899",neighborColor:"#FBBF24",edges:{rest:"#4B4B4B",restBright:"#616161",restDim:"#3F3F3F",hoverDirect:"#6FBCBD",hoverLoop:"#8B7BAD",hoverStandard:"#8A8A8A",hoverNeighbor:"#FBBF24",neighborRest:"#6B7280",neighborHover:"#FBBF24",highlight:"#FFD700"},edgeOpacity:.82};function CA(){if("undefined"==typeof window)return kA;const A=dA(),e=fA();return{nodeFill:A.nodeFill,nodeStroke:A.nodeStroke,localColor:A.localColor,hubColor:A.hubColor,mobileColor:A.mobileColor,roomServerColor:A.roomColor,neighborColor:A.neighborColor,edges:{rest:e.rest,restBright:e.restBright,restDim:e.restDim,hoverDirect:e.hoverDirect,hoverLoop:e.hoverLoop,hoverStandard:e.hoverStandard,hoverNeighbor:e.hoverNeighbor,neighborRest:kA.edges.neighborRest,neighborHover:kA.edges.neighborHover,highlight:e.highlight},edgeOpacity:kA.edgeOpacity}}const BA=2e3;function MA({text:A}){return t.jsx(J,{content:A,delay:200,children:t.jsx(g,{className:"w-3.5 h-3.5 text-text-muted cursor-help"})})}function DA({title:A,tooltip:e,isOpen:r,onToggle:n,hasBorder:o=!1}){return t.jsxs("button",{onClick:n,className:"w-full flex items-center justify-between text-text-secondary font-medium py-1 hover:text-text-primary transition-colors "+(o?"mt-2 pt-2 border-t border-white/10":""),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[A,t.jsx(MA,{text:e})]}),t.jsx(f,{className:"w-3 h-3 text-text-muted transition-transform duration-200 "+(r?"":"-rotate-90")})]})}function EA({showTopology:e,validatedPolylineCount:r,filteredNeighborCount:n,hasLocalNode:o,meshTopology:i,zeroHopNeighbors:s,neighborsWithLocation:f}){const g=gA(),h=V(),m=K(),b=h.filter(A=>A.isLikelyReal).length,p=function(A){let e=0;for(const t of A.txDelayRecommendations.values())"backbone"===t.networkRole&&e++;return e}(i),[x,v]=A.useState(!0),[w,y]=A.useState(!0),[k,C]=A.useState(!0);return t.jsxs("div",{className:"map-control-glass text-xs",style:{padding:"0.625rem"},children:[t.jsx(DA,{title:"Nodes",tooltip:"Node type shown by shape. Yellow = direct RF neighbor.",isOpen:x,onToggle:()=>v(!x)}),x&&t.jsxs("div",{className:"flex flex-col gap-1 mt-1.5",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.nodeFill}}),t.jsx("span",{className:"text-text-muted",children:"Node"}),t.jsx(MA,{text:"Standard mesh node. Can be a repeater, client, or companion device."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.hubColor}}),t.jsx("span",{className:"text-text-muted",children:"Hub"}),t.jsx(MA,{text:"Network hub (≥10% of last-hop traffic). Hubs are central to mesh traffic flow."})]}),(B=f,B.some(([,A])=>{var e;const t=null==(e=A.contact_type)?void 0:e.toLowerCase();return"room server"===t||"room_server"===t||"room"===t||"server"===t})&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(l,{className:"w-3 h-3 flex-shrink-0",style:{color:g.roomColor},strokeWidth:2.5}),t.jsx("span",{className:"text-text-muted",children:"Room"}),t.jsx(MA,{text:"Room Server identity. Hosts a chat room that clients can sync messages with."})]})),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(c,{className:"w-3 h-3 flex-shrink-0",style:{color:g.localColor},strokeWidth:2.5}),t.jsx("span",{className:"text-text-muted",children:"Local"}),t.jsx(MA,{text:"Your repeater. This is the node running pyMC_Repeater that you're connected to."})]}),s.size>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded flex-shrink-0",style:{width:"12px",height:"8px",backgroundColor:g.neighborColor}}),t.jsx("span",{className:"text-text-muted",children:"Neighbor"}),t.jsx(MA,{text:"Zero-hop direct RF contact. Color indicates we receive their ADVERTs directly."})]}),i.gatewayNodes.length>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.hubColor,opacity:.7}}),t.jsx("span",{className:"text-text-muted",children:"Gateway"}),t.jsx(MA,{text:"Significant traffic forwarder (7-10% of last-hop traffic). Gateways relay substantial traffic to the local node."})]}),p>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:"rgb(168, 85, 247)",opacity:.8}}),t.jsx("span",{className:"text-text-muted",children:"Backbone"}),t.jsx(MA,{text:"Critical relay with 4+ neighbors and high betweenness centrality. Backbone nodes carry the majority of mesh traffic."})]}),i.mobileNodes.length>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",background:"transparent",border:`4px solid ${g.mobileColor}`,boxSizing:"border-box"}}),t.jsx("span",{className:"text-text-muted",children:"Mobile"}),t.jsx(MA,{text:"Volatile node that frequently appears/disappears from paths. Likely a portable or vehicle-mounted device."})]}),b>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(a,{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--accent-tertiary)"},strokeWidth:2.5}),t.jsxs("span",{className:"text-text-muted",children:["Ghost (",b,")"]}),t.jsx(MA,{text:"Unknown repeater discovered via Viterbi HMM path analysis. These nodes appear in paths but aren't in our neighbor table."})]})]}),s.size>0&&t.jsxs(t.Fragment,{children:[t.jsx(DA,{title:"Link Quality",tooltip:"Neighbor edge colors based on bidirectional link balance. 2-Way = balanced. Listener = they hear us. Loud = they route to us.",isOpen:w,onToggle:()=>y(!w),hasBorder:!0}),w&&t.jsxs("div",{className:"flex flex-col gap-1 mt-1.5",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.YELLOW}}),t.jsx("span",{className:"text-text-muted",children:"2-Way"}),t.jsx(MA,{text:"33-67% balanced. Ideal bidirectional link - this neighbor both hears us and routes traffic to us equally well."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.GREEN}}),t.jsx("span",{className:"text-text-muted",children:"Listener"}),t.jsx(MA,{text:">67% listener score. This neighbor hears our transmissions well (good RX from us)."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.RED}}),t.jsx("span",{className:"text-text-muted",children:"Loud"}),t.jsx(MA,{text:"<33% listener score. This neighbor routes more traffic TO us than they hear from us."})]})]})]}),e&&r>0&&t.jsxs(t.Fragment,{children:[t.jsx(DA,{title:"Topology",tooltip:"Links with 5+ validations. Thickness = relative strength.",isOpen:k,onToggle:()=>C(!k),hasBorder:!0}),k&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-0.5 text-text-muted mt-1",children:[t.jsxs("div",{className:"flex justify-between tabular-nums",children:[t.jsx("span",{children:"Nodes"}),t.jsx("span",{className:"text-text-secondary",children:n+(o?1:0)})]}),i.hubNodes.length>0&&t.jsxs("div",{className:"flex justify-between tabular-nums",children:[t.jsx("span",{children:"Hubs"}),t.jsx("span",{style:{color:kA.hubColor},children:i.hubNodes.length})]})]}),i.loops.length>0&&t.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-white/10",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(u,{className:"w-3 h-3 flex-shrink-0",style:{color:kA.edges.hoverLoop}}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{style:{color:kA.edges.hoverLoop},className:"font-medium",children:[i.loops.length," ",1===i.loops.length?"Loop":"Loops"]}),t.jsx("span",{className:"text-text-muted text-[10px] leading-tight",children:"Redundant paths"})]})]})}),m.totalPaths>0&&t.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-white/10",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(d,{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--accent-primary)"}}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{style:{color:"var(--accent-primary)"},className:"font-medium",children:[m.totalPaths.toLocaleString()," Viterbi"]}),t.jsx("span",{className:"text-text-muted text-[10px] leading-tight",children:"HMM decoded paths"})]})]})})]})]})]});var B}function NA({options:A,value:e,onChange:r,size:n="sm",className:o=""}){const i={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-1"};return t.jsx("div",{className:`inline-flex rounded-md bg-black/40 p-0.5 ${o}`,role:"radiogroup",children:A.map(A=>{const o=e===A.value;return t.jsx("button",{onClick:()=>r(A.value),className:`\n ${i[n]}\n rounded transition-all font-medium\n ${o?"bg-white/15 text-text-primary shadow-sm":"text-text-muted hover:text-text-secondary hover:bg-white/5"}\n `,role:"radio","aria-checked":o,title:A.title,children:A.icon?t.jsxs("span",{className:"flex items-center gap-1",children:[A.icon,t.jsx("span",{className:"hidden sm:inline",children:A.label})]}):A.label},A.value)})})}function QA({mapRef:A,showNeighborLines:e,onToggleNeighborLines:r,hasNeighborPolylines:n,nodeFilter:o,onNodeFilterChange:i,hasHubNodes:a,hasZeroHopNeighbors:s,showCoverage:l,onToggleCoverage:c,show3DTerrain:u,onToggle3DTerrain:d,isFullscreen:f,onToggleFullscreen:g}){const y=[{value:"all",label:"All",title:"Show all nodes"},...a?[{value:"hubs",label:"Hubs",title:"Show only hub nodes and their connections"}]:[],...s?[{value:"direct",label:"Direct",title:"Show only zero-hop (direct RF) neighbors"}]:[]];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-3 right-3 z-[600] map-controls-container sm:top-4 sm:right-4",children:t.jsxs("div",{className:"map-controls-row",children:[n&&t.jsx("button",{onClick:r,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",style:e?{backgroundColor:"#1a1408"}:void 0,title:e?"Hide neighbor lines":"Show neighbor lines","aria-label":e?"Hide neighbor lines":"Show neighbor lines","aria-pressed":e,children:t.jsx(h,{className:"map-control-icon "+(e?"text-amber-400":"text-text-secondary")})}),y.length>1&&t.jsx(NA,{options:y,value:o,onChange:i,size:"sm"}),t.jsx("button",{onClick:d,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",style:u?{backgroundColor:"#0a1a1a"}:void 0,title:u?"Disable 3D terrain":"Enable 3D terrain","aria-label":u?"Disable 3D terrain":"Enable 3D terrain","aria-pressed":u,children:t.jsx(m,{className:"map-control-icon "+(u?"text-teal-400":"text-text-secondary")})}),t.jsx("button",{onClick:g,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",title:f?"Exit fullscreen":"Fullscreen","aria-label":f?"Exit fullscreen":"Enter fullscreen","aria-pressed":f,children:f?t.jsx(b,{className:"map-control-icon text-text-secondary"}):t.jsx(p,{className:"map-control-icon text-text-secondary"})})]})}),t.jsx("div",{className:"absolute top-[3.5rem] right-3 z-[600] map-controls-container sm:top-[4rem] sm:right-4 lg:top-[4.5rem]",children:t.jsxs("div",{className:"flex flex-col items-stretch map-nav-module",children:[t.jsx("button",{onClick:()=>{var e,t;null==(t=null==(e=A.current)?void 0:e.getMap())||t.zoomIn()},className:"map-control-btn hover:bg-white/5 flex items-center justify-center",title:"Zoom in","aria-label":"Zoom in",children:t.jsx(x,{className:"map-control-icon text-text-secondary"})}),t.jsx("button",{onClick:()=>{var e,t;null==(t=null==(e=A.current)?void 0:e.getMap())||t.zoomOut()},className:"map-control-btn hover:bg-white/5 border-t border-white/6 flex items-center justify-center",title:"Zoom out","aria-label":"Zoom out",children:t.jsx(v,{className:"map-control-icon text-text-secondary"})}),t.jsx("button",{onClick:()=>{var e;const t=null==(e=A.current)?void 0:e.getMap();t&&t.easeTo({bearing:0,pitch:0,duration:300})},className:"map-control-btn hover:bg-white/5 border-t border-white/6 flex items-center justify-center",title:"Reset bearing to north","aria-label":"Reset bearing to north",children:t.jsx(w,{className:"map-control-icon text-text-secondary"})})]})})]})}const jA="#4ADE80",PA="DeepAnalysis";function FA(){return"abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())]}function SA({isActive:e,hasAnalyzed:r,isLoading:o,onClick:i}){const[a,l]=A.useState(!1),[c,u]=A.useState(PA),d=A.useRef(!1),f=A.useRef(null),[g]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)}),h=a&&!e&&!o&&g;A.useEffect(()=>{if(a&&!e&&!o&&!d.current){d.current=!0;const A=performance.now(),e=t=>{const r=t-A,n=Math.min(r/700,1),o=Math.floor(12*n);let i="";for(let A=0;A<12;A++)i+=A{f.current&&cancelAnimationFrame(f.current)}},[a,e,o]);const m=o?"Analyzing...":c;return t.jsxs("button",{onClick:i,onMouseEnter:()=>g&&l(!0),onMouseLeave:()=>g&&l(!1),onPointerEnter:()=>g&&l(!0),onPointerLeave:()=>g&&l(!1),disabled:o,className:`map-control-btn flex items-center gap-2 w-full text-left transition-colors ${e?"map-control-glass-active":"map-control-glass"} ${o?"cursor-wait":""}`,style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#0a1a0a":"#050505"},title:o?"Analyzing packet history...":r?e?"Hide topology edges":"Show topology edges":"Load full packet history and build topology",children:[o?t.jsx(s,{className:"w-3.5 h-3.5 flex-shrink-0 text-green-400 animate-spin"}):t.jsx(n,{className:"w-3.5 h-3.5 flex-shrink-0 transition-colors "+(e?"text-green-400":"text-text-secondary"),style:h?{color:jA}:void 0}),t.jsx("span",{className:e?"text-green-400":"text-text-secondary",style:{fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"0.6875rem",fontWeight:e||h?700:500,letterSpacing:"-0.01em",lineHeight:1,...h?{color:jA}:{}},children:m})]})}const LA="#00FFFF";function IA({isActive:e,onClick:r}){const[n,o]=A.useState(!1),[i,a]=A.useState(0),s=A.useRef(!1),l=A.useRef(null),[c,u]=A.useState(0),d=A.useRef(!1),[f]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)}),g=n&&!e&&f;A.useEffect(()=>{g&&!d.current&&(d.current=!0,u(1),setTimeout(()=>u(2),100),setTimeout(()=>u(3),200)),n||(d.current=!1,u(0))},[g,n]),A.useEffect(()=>{if(n&&!e&&!s.current){s.current=!0;const A=performance.now(),e=t=>{const r=t-A,n=Math.min(r/400,1);a(n),n<1&&(l.current=requestAnimationFrame(e))};l.current=requestAnimationFrame(e)}return n||(l.current&&(cancelAnimationFrame(l.current),l.current=null),s.current=!1,a(0)),()=>{l.current&&cancelAnimationFrame(l.current)}},[n,e]);const h=A=>{if(e)return;if(!g)return;const t=11*i;return A>=t-2&&Af&&o(!0),onMouseLeave:()=>f&&o(!1),onPointerEnter:()=>f&&o(!0),onPointerLeave:()=>f&&o(!1),className:"map-control-btn flex items-center gap-2 w-full text-left transition-colors "+(e?"map-control-glass-active":"map-control-glass"),style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#0a2a2a":"#050505"},title:e?"Disable live packet tracing (reduces CPU usage)":"Enable live packet tracing",children:[t.jsx(y,{className:"w-3.5 h-3.5 flex-shrink-0 "+(e?"text-cyan-400":"text-text-secondary"),fill:1===c?"#FFFFFF":3===c?LA:"none",stroke:1===c||2===c?"#FFFFFF":g?LA:"currentColor",style:{transition:"fill 0.05s, stroke 0.05s"}}),t.jsx("span",{className:e?"text-cyan-400":"text-text-secondary",style:{fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"0.6875rem",fontWeight:e||g?700:500,letterSpacing:"-0.01em",lineHeight:1},children:"LiveTrace".split("").map((A,e)=>t.jsx("span",{style:{color:h(e)||void 0},children:A},e))})]})}const RA="#fe8019";function TA({isActive:e,onClick:r,brightness:n=.7,onBrightnessChange:o}){const[i,a]=A.useState(!1),[s,l]=A.useState(!1),[c]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)});A.useEffect(()=>{if(!i||e)return;const A=requestAnimationFrame(()=>l(!0)),t=setTimeout(()=>l(!1),80);return()=>{cancelAnimationFrame(A),clearTimeout(t)}},[i,e]);const u=Math.max(.01,Math.min(1,n)),d=u<.999,f=u>.011,g=i&&!e&&c;return t.jsxs("button",{onClick:r,onMouseEnter:()=>c&&a(!0),onMouseLeave:()=>c&&a(!1),onPointerEnter:()=>c&&a(!0),onPointerLeave:()=>c&&a(!1),className:"map-control-btn flex items-center gap-2 w-full text-left transition-colors "+(e?"map-control-glass-active":"map-control-glass"),style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#1a1408":"#050505"},title:e?"Configure wardriving coverage":"Show wardriving coverage",children:[t.jsx(k,{className:"w-3.5 h-3.5 flex-shrink-0 transition-colors "+(e?"text-amber-400":"text-text-secondary"),style:g?{color:RA}:void 0}),t.jsx("span",{className:e?"text-amber-400":"text-text-secondary",style:{fontFamily:e||g?"'Jacquard 12', serif":"ui-monospace, SFMono-Regular, monospace",fontSize:e||g?"0.75rem":"0.6875rem",fontWeight:500,letterSpacing:"-0.01em",lineHeight:1,transition:"none",transform:e?"scale(1.45)":g?`scale(${s?1.595:1.45})`:void 0,transformOrigin:"left center",...g?{color:RA}:{}},children:"Wardrive"}),e&&o&&t.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[t.jsx("button",{onClick:A=>{A.stopPropagation();const e=Math.max(.01,u-.2);null==o||o(e)},disabled:!f,className:"p-0.5 rounded transition-colors "+(f?"hover:bg-[#252525] text-amber-400":"text-amber-400/30 cursor-not-allowed"),title:`Decrease opacity (${Math.round(100*u)}%)`,children:t.jsx(C,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:A=>{A.stopPropagation();const e=Math.min(1,u+.2);null==o||o(e)},disabled:!d,className:"p-0.5 rounded transition-colors "+(d?"hover:bg-[#252525] text-amber-400":"text-amber-400/30 cursor-not-allowed"),title:`Increase opacity (${Math.round(100*u)}%)`,children:t.jsx(B,{className:"w-3.5 h-3.5"})})]})]})}function _A(A){let e=!0,t=-90,r=90,n=-180,o=180;for(const i of A.toLowerCase()){const A="0123456789bcdefghjkmnpqrstuvwxyz".indexOf(i);if(-1!==A)for(let i=4;i>=0;i--){const a=A>>i&1;if(e){const A=(n+o)/2;a?n=A:o=A}else{const A=(t+r)/2;a?t=A:r=A}e=!e}}return{lat:(t+r)/2,lon:(n+o)/2}}function HA(A){return Math.exp(-A*Math.LN2/7)}const zA="pymc-wardriving-url",GA="pymc-wardriving-enabled",OA="pymc-wardriving-brightness";function UA(A){"undefined"!=typeof localStorage&&(A?localStorage.setItem(zA,A):localStorage.removeItem(zA))}function YA(A){"undefined"!=typeof localStorage&&localStorage.setItem(GA,String(A))}function WA(){if("undefined"==typeof localStorage)return.7;const A=localStorage.getItem(OA);if(A){const e=parseFloat(A);if(!isNaN(e)&&e>=.01&&e<=1)return e}return.7}function ZA(A,e=null){if(null!==A){const t=(Math.max(-12,Math.min(12,A))+12)/24;return null!==e?.8*t+(Math.max(-120,Math.min(-50,e))+120)/70*.2:t}return null!==e?(Math.max(-120,Math.min(-50,e))+120)/70:.5}const VA=M((A,e)=>({status:"idle",isVisible:"undefined"!=typeof localStorage&&"true"===localStorage.getItem(GA),coveragePoints:[],repeaters:[],error:null,stats:{coverageCount:0,repeaterCount:0,lastUpdated:null},url:"undefined"==typeof localStorage?"":localStorage.getItem(zA)||"",brightness:WA(),isModalOpen:!1,openModal:()=>A({isModalOpen:!0}),closeModal:()=>A({isModalOpen:!1}),setUrl:e=>A({url:e}),setBrightness:e=>{const t=Math.max(.01,Math.min(1,e));!function(A){if("undefined"==typeof localStorage)return;const e=Math.max(.01,Math.min(1,A));localStorage.setItem(OA,String(e))}(t),A({brightness:t})},toggleVisibility:()=>{const t=!e().isVisible;YA(t),A({isVisible:t})},setVisible:e=>{YA(e),A({isVisible:e})},loadCoverage:async e=>{if(!e.trim())return A({error:"Please enter a URL",status:"error"}),!1;try{new URL(e.trim())}catch{return A({error:"Invalid URL format",status:"error"}),!1}A({error:null,status:"connecting"});try{A({status:"loading"});const t=await async function(A){const e=`${A.replace(/\/+$/,"").replace(/\/get-nodes$/,"").replace(/\/get-samples$/,"")}/get-samples`,t=await async function(A,e={},t=8e3){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return await fetch(A,{...e,signal:r.signal})}catch(o){if(o instanceof Error&&"AbortError"===o.name)throw new Error(`Connection timed out after ${t/1e3}s`);throw o}finally{clearTimeout(n)}}(e,{headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Failed to fetch precise samples: ${t.status}`);return t.json()}(e.trim());if(!t||"object"!=typeof t)throw new Error("Invalid response from server");if(!Array.isArray(t.keys))throw new Error("No sample data found in response");A({status:"processing"});const r=function(A){var e;const t=[];for(const r of A.keys){if(!r.observed)continue;const{lat:A,lon:n}=_A(r.hash),o=parseInt(r.time,10),i=isNaN(o)?30:(Date.now()-o)/864e5,a=HA(i),s=ZA(r.snr,r.rssi)*(.3+.7*a);t.push({lat:A,lon:n,successRate:r.observed?1:0,weight:s,totalSamples:1,ageDays:i,geohash:r.hash,repeaters:(null==(e=r.path)?void 0:e.map(A=>A.toLowerCase()))||[]})}return t}(t);if(0===r.length)throw new Error("No valid coverage points found");return A({coveragePoints:r,repeaters:[],stats:{coverageCount:r.length,repeaterCount:0,lastUpdated:new Date},status:"success",isVisible:!0,url:e.trim()}),UA(e.trim()),YA(!0),!0}catch(t){const e=t instanceof Error?t.message:"Failed to load coverage data";let r=e;return e.includes("timed out")?r="Connection timed out. Server may be unreachable or slow.":e.includes("Failed to fetch")||e.includes("NetworkError")?r="Could not connect to server. Check the URL and try again.":e.includes("CORS")?r="Server does not allow cross-origin requests.":e.includes("404")?r="Coverage endpoint not found. Check the URL.":(e.includes("ERR_NAME_NOT_RESOLVED")||e.includes("DNS"))&&(r="Server not found. Check the URL for typos."),A({error:r,status:"error"}),!1}},clearCoverage:()=>{A({coveragePoints:[],repeaters:[],stats:{coverageCount:0,repeaterCount:0,lastUpdated:null},status:"idle",error:null,isVisible:!1,url:""}),UA(""),YA(!1)}}));function KA({status:A}){if("connecting"!==A&&"loading"!==A&&"processing"!==A)return null;const e={idle:"",connecting:"Connecting to server...",loading:"Fetching coverage data...",processing:"Processing coverage points...",success:"",error:""}[A];return e?t.jsxs("div",{className:"flex items-center gap-3 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl",children:[t.jsx("div",{className:"relative",children:t.jsx(s,{className:"w-5 h-5 text-amber-400 animate-spin"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-amber-400 font-medium",children:e}),t.jsx("div",{className:"mt-2 h-1 bg-amber-500/20 rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-amber-400 rounded-full transition-all duration-300",style:{width:"connecting"===A?"30%":"loading"===A?"60%":"90%"}})})]})]}):null}function JA(){const{isModalOpen:e,closeModal:n,status:i,isVisible:a,stats:l,error:c,url:u,brightness:f,loadCoverage:g,clearCoverage:h,toggleVisibility:m,setUrl:b,setBrightness:p}=VA(),x="connecting"===i||"loading"===i||"processing"===i,[v,w]=A.useState(u),y=A.useCallback(async()=>{await g(v)},[v,g]),k=A.useCallback(()=>{w(""),h()},[h]),C=A.useCallback(A=>{"Enter"!==A.key||A.shiftKey||x||(A.preventDefault(),y())},[y,x]),M=A.useCallback(A=>{const e=A.target.value;w(e),b(e)},[b]);if(!e)return null;const S=l.coverageCount>0,L=v.trim().length>0&&!x;return t.jsxs("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-md",onClick:x?void 0:n}),t.jsxs("div",{className:"relative glass-card-elevated w-full max-w-md mx-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-subtle",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 rounded-lg bg-amber-500/20",children:t.jsx(D,{className:"w-5 h-5 text-amber-400"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Wardriving Coverage"}),t.jsx("p",{className:"text-xs text-text-muted",children:"Overlay RF coverage heatmap"})]})]}),t.jsx("button",{onClick:n,disabled:x,className:"p-2 rounded-lg hover:bg-[#252525] transition-colors disabled:opacity-50",children:t.jsx(E,{className:"w-5 h-5 text-text-secondary"})})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-2",children:"Coverage Server URL"}),t.jsx("input",{type:"url",value:v,onChange:M,onKeyDown:C,placeholder:"https://coverage.wcmesh.com",className:"w-full px-4 py-3 bg-black/30 border border-border rounded-xl text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-amber-500/50 focus:border-amber-500/50 transition-all disabled:opacity-50",disabled:x}),t.jsx("p",{className:"mt-1.5 text-xs text-text-muted",children:"Enter the base URL of a wardriving coverage server (e.g., coverage.wcmesh.com)"})]}),t.jsx(KA,{status:i}),"error"===i&&c&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-xl",children:[t.jsx(N,{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Connection Failed"}),t.jsx("p",{className:"text-xs text-red-400/80 mt-0.5",children:c})]})]}),"success"===i&&S&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-xl",children:[t.jsx(r,{className:"w-5 h-5 text-green-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-green-400 font-medium",children:"Data Loaded Successfully"}),t.jsxs("p",{className:"text-xs text-green-400/80 mt-0.5",children:[l.coverageCount.toLocaleString()," coverage points • ",l.repeaterCount.toLocaleString()," repeaters"]})]})]}),S&&!x&&"success"!==i&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-amber-500/10 border border-amber-500/30 rounded-xl",children:[t.jsx(Q,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-amber-400 font-medium",children:"Coverage Data Loaded"}),t.jsxs("p",{className:"text-xs text-amber-400/80 mt-0.5",children:[l.coverageCount.toLocaleString()," points •",l.lastUpdated&&` Last updated ${l.lastUpdated.toLocaleTimeString()}`]})]})]}),S&&!x&&t.jsx("div",{className:"p-3 bg-black/20 border border-border-subtle rounded-xl",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(B,{className:"w-4 h-4 flex-shrink-0 "+(f>.5?"text-amber-400":"text-text-muted")}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-xs text-text-secondary",children:"Brightness"}),t.jsxs("span",{className:"text-xs text-text-muted font-mono",children:[Math.round(100*f),"%"]})]}),t.jsx("input",{type:"range",min:"1",max:"100",value:100*f,onChange:A=>p(Number(A.target.value)/100),className:"w-full h-1.5 cursor-pointer accent-amber-400"})]})]})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 border-t border-border-subtle",children:[t.jsx("div",{className:"flex items-center gap-2",children:S&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:m,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-[#202020] rounded-lg transition-colors disabled:opacity-50",title:a?"Hide heatmap":"Show heatmap",children:a?t.jsxs(t.Fragment,{children:[t.jsx(j,{className:"w-3.5 h-3.5"})," Hide"]}):t.jsxs(t.Fragment,{children:[t.jsx(d,{className:"w-3.5 h-3.5"})," Show"]})}),t.jsxs("button",{onClick:k,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-400/80 hover:text-red-400 hover:bg-red-500/10 rounded-lg transition-colors disabled:opacity-50",title:"Clear coverage data",children:[t.jsx(P,{className:"w-3.5 h-3.5"})," Clear"]})]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:n,disabled:x,className:"px-4 py-2 text-sm font-medium text-text-secondary hover:bg-[#252525] rounded-lg transition-colors disabled:opacity-50",children:S?"Done":"Cancel"}),t.jsx("button",{onClick:y,disabled:!L,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium bg-amber-500 hover:bg-amber-400 text-black rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:x?t.jsxs(t.Fragment,{children:[t.jsx(s,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):S?t.jsxs(t.Fragment,{children:[t.jsx(o,{className:"w-4 h-4"}),"Refresh"]}):t.jsxs(t.Fragment,{children:[t.jsx(F,{className:"w-4 h-4"}),"Connect"]})})]})]})]})]})}const XA={getItem:A=>{try{return localStorage.getItem(A)}catch{return null}},setItem:(A,e)=>{try{localStorage.setItem(A,e)}catch{}},removeItem:A=>{try{localStorage.removeItem(A)}catch{}}},qA=M()(mA(A=>({isEnabled:!1,toggle:()=>A(A=>({isEnabled:!A.isEnabled})),setEnabled:e=>A({isEnabled:e})}),{name:"pymc-live-trace",storage:bA(()=>XA)}));var $A=function(A){var e,t=void 0!==(A=A||{})?A:{},r={};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);var n,o="";"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),o=0!==o.indexOf("blob:")?o.substr(0,o.lastIndexOf("/")+1):"",n=function(A,e,t){var r=new XMLHttpRequest;r.open("GET",A,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var n=O(A);n?e(n.buffer):t()}},r.onerror=t,r.send(null)};var i=t.print||function(){}.bind(),a=t.printErr||function(){}.bind();for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);r=null,t.arguments&&t.arguments;var s=0,l=!1;function c(A){var e=t["_"+A];return e||tA("Assertion failed: "+("Cannot call unknown function "+A+", make sure it is exported")),e}var u,d,f,g,h,m,b,p="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function x(A,e){return A?function(A,e,t){for(var r=e+t,n=e;A[n]&&!(n>=r);)++n;if(n-e>16&&A.subarray&&p)return p.decode(A.subarray(e,n));for(var o="";e>10,56320|1023&l)}}else o+=String.fromCharCode((31&i)<<6|a)}else o+=String.fromCharCode(i)}return o}(f,A,e):""}function v(A,e){return A%e>0&&(A+=e-A%e),A}function w(A){u=A,t.HEAP8=d=new Int8Array(A),t.HEAP16=g=new Int16Array(A),t.HEAP32=h=new Int32Array(A),t.HEAPU8=f=new Uint8Array(A),t.HEAPU16=new Uint16Array(A),t.HEAPU32=new Uint32Array(A),t.HEAPF32=m=new Float32Array(A),t.HEAPF64=b=new Float64Array(A)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var y=t.TOTAL_MEMORY||33554432;function k(A){for(;A.length>0;){var e=A.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?t.dynCall_v(r):t.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}y=(u=t.buffer?t.buffer:new ArrayBuffer(y)).byteLength,w(u),h[7156]=5271536;var C=[],B=[],M=[],D=[];function E(A){C.unshift(A)}function N(A){D.unshift(A)}var Q=Math.abs,j=Math.ceil,P=Math.floor,F=Math.min,S=0,L=null;t.preloadedImages={},t.preloadedAudios={};var I,R,T=null,_="data:application/octet-stream;base64,";function H(A){return String.prototype.startsWith?A.startsWith(_):0===A.indexOf(_)}function z(){return d.length}T="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";var G="function"==typeof atob?atob:function(A){var e,t,r,n,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="",l=0;A=A.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(A.charAt(l++))<<2|(n=a.indexOf(A.charAt(l++)))>>4,t=(15&n)<<4|(o=a.indexOf(A.charAt(l++)))>>2,r=(3&o)<<6|(i=a.indexOf(A.charAt(l++))),s+=String.fromCharCode(e),64!==o&&(s+=String.fromCharCode(t)),64!==i&&(s+=String.fromCharCode(r))}while(l=0){if((0|t)>13780509){if(0|(a=0|le(15,s)))break;s=0|n[(l=s)>>2],l=0|n[l+4>>2]}else c=0|qe(0|t,0|(a=((0|t)<0)<<31>>31),3,0),l=0|B(),a=0|Ze(0|t,0|a,1,0),a=0|Ze(0|(a=0|qe(0|c,0|l,0|a,0|B())),0|B(),1,0),l=0|B(),n[s>>2]=a,n[s+4>>2]=l,s=a;if(lt(0|r,0,s<<3),0|o){lt(0|o,0,s<<2),a=0|I(A,e,t,r,o,s,l,0);break}(a=0|We(s,4))?(c=0|I(A,e,t,r,a,s,l,0),Ye(a),a=c):a=13}else a=2}while(0);return P=i,0|a}function L(A,e,t,r,o){A|=0,e|=0,t|=0,r|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(a=P,P=P+16|0,m=a+8|0,n[(h=i=a)>>2]=A,n[h+4>>2]=e,(0|t)<0)return P=a,2;if(n[(s=r)>>2]=A,n[s+4>>2]=e,(s=!!(0|o))&&(n[o>>2]=0),0|HA(A,e))return P=a,9;n[m>>2]=0;A:do{if((0|t)>=1)if(s)for(f=1,d=0,g=0,h=1,s=A;;){if(!(d|g)){if(0|(s=0|R(s,e,4,m,i)))break A;if(0|HA(s=0|n[(e=i)>>2],e=0|n[e+4>>2])){s=9;break A}}if(0|(s=0|R(s,e,0|n[26800+(g<<2)>>2],m,i)))break A;if(s=0|n[(e=i)>>2],e=0|n[e+4>>2],n[(A=r+(f<<3)|0)>>2]=s,n[A+4>>2]=e,n[o+(f<<2)>>2]=h,l=(0|(A=d+1|0))==(0|h),u=6==(0|(c=g+1|0)),0|HA(s,e)){s=9;break A}if((0|(h=h+(u&l&1)|0))>(0|t)){s=0;break}f=f+1|0,d=l?0:A,g=l?u?0:c:g}else for(f=1,d=0,g=0,h=1,s=A;;){if(!(d|g)){if(0|(s=0|R(s,e,4,m,i)))break A;if(0|HA(s=0|n[(e=i)>>2],e=0|n[e+4>>2])){s=9;break A}}if(0|(s=0|R(s,e,0|n[26800+(g<<2)>>2],m,i)))break A;if(s=0|n[(e=i)>>2],e=0|n[e+4>>2],n[(A=r+(f<<3)|0)>>2]=s,n[A+4>>2]=e,l=(0|(A=d+1|0))==(0|h),u=6==(0|(c=g+1|0)),0|HA(s,e)){s=9;break A}if((0|(h=h+(u&l&1)|0))>(0|t)){s=0;break}f=f+1|0,d=l?0:A,g=l?u?0:c:g}else s=0}while(0);return P=a,0|s}function I(A,e,t,r,o,i,a,s){t|=0,r|=0,o|=0,s|=0;var l,c,u,d=0,f=0,g=0,h=0,m=0,b=0,p=0;if(u=P,P=P+16|0,l=u+8|0,c=u,d=0|At(0|(A|=0),0|(e|=0),0|(i|=0),0|(a|=0)),g=0|B(),!(!(0|(p=0|n[(b=h=r+(d<<3)|0)>>2]))&!(0|(b=0|n[b+4>>2]))|(f=(0|p)==(0|A)&(0|b)==(0|e))))do{d=0|$e(0|(d=0|Ze(0|d,0|g,1,0)),0|B(),0|i,0|a),g=0|B(),f=(0|(b=0|n[(p=h=r+(d<<3)|0)>>2]))==(0|A)&(0|(p=0|n[p+4>>2]))==(0|e)}while(!(!(0|b)&!(0|p)|f));if(d=o+(d<<2)|0,f&&(0|n[d>>2])<=(0|s))return P=u,0;if(n[(p=h)>>2]=A,n[p+4>>2]=e,n[d>>2]=s,(0|s)>=(0|t))return P=u,0;switch(f=s+1|0,n[l>>2]=0,0|(d=0|R(A,e,2,l,c))){case 9:m=9;break;case 0:(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f))||(m=9)}A:do{if(9==(0|m)){switch(n[l>>2]=0,0|(d=0|R(A,e,3,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,1,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,5,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,4,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,6,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}return P=u,0}}while(0);return P=u,0|d}function R(A,e,t,r,o){A|=0,e|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0;if((t|=0)>>>0>6)return 1;if(d=(0|n[(r|=0)>>2])%6|0,n[r>>2]=d,(0|d)>0){s=0;do{t=0|xA(t),s=s+1|0}while((0|s)<(0|n[r>>2]))}if(d=0|tt(0|A,0|e,45),B(),(a=127&d)>>>0>121)return 5;i=0|OA(A,e),s=0|tt(0|A,0|e,52),B(),s&=15;A:do{if(s){for(;;){if(c=0|tt(0|A,0|e,0|(l=3*(15-s|0)|0)),B(),7==(0|(c&=7))){e=5;break}if(g=!(0|VA(s)),s=s+-1|0,f=0|rt(7,0,0|l),e&=~B(),A=0|rt(0|n[(g?432:16)+(28*c|0)+(t<<2)>>2],0,0|l)|A&~f,e|=l=0|B(),!(t=0|n[(g?640:224)+(28*c|0)+(t<<2)>>2])){t=0;break A}if(!s){u=8;break A}}return 0|e}u=8}while(0);8==(0|u)&&(A|=0|rt(0|(g=0|n[848+(28*a|0)+(t<<2)>>2]),0,45),e=B()|-1040385&e,t=0|n[4272+(28*a|0)+(t<<2)>>2],127&~g||(g=0|rt(0|n[848+(28*a|0)+20>>2],0,45),e=B()|-1040385&e,t=0|n[4272+(28*a|0)+20>>2],A=0|YA(g|A,e),e=0|B(),n[r>>2]=1+(0|n[r>>2]))),c=0|tt(0|A,0|e,45),B(),c&=127;A:do{if(0|z(c)){e:do{if(1==(0|OA(A,e))){if((0|a)!=(0|c)){if(0|Y(c,0|n[7696+(28*a|0)>>2])){A=0|ZA(A,e),l=1,e=0|B();break}M(27795,26864,533,26872)}switch(0|i){case 3:A=0|YA(A,e),e=0|B(),n[r>>2]=1+(0|n[r>>2]),l=0;break e;case 5:A=0|ZA(A,e),e=0|B(),n[r>>2]=5+(0|n[r>>2]),l=0;break e;case 0:return 9;default:return 1}}else l=0}while(0);if((0|t)>0){s=0;do{A=0|UA(A,e),e=0|B(),s=s+1|0}while((0|s)!=(0|t))}if((0|a)!=(0|c)){if(!(0|G(c))){if(!!(0|l)|5!=(0|OA(A,e)))break;n[r>>2]=1+(0|n[r>>2]);break}switch(127&d){case 8:case 118:break A}3!=(0|OA(A,e))&&(n[r>>2]=1+(0|n[r>>2]))}}else if((0|t)>0){s=0;do{A=0|YA(A,e),e=0|B(),s=s+1|0}while((0|s)!=(0|t))}}while(0);return n[r>>2]=((0|n[r>>2])+t|0)%6|0,n[(g=o)>>2]=A,n[g+4>>2]=e,0}function T(A,e,t,r){A|=0,e|=0,t|=0,r|=0;var o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0;if(i=P,P=P+16|0,h=i+8|0,n[(g=o=i)>>2]=A,n[g+4>>2]=e,(0|t)<0)return P=i,2;if(!t)return n[(h=r)>>2]=A,n[h+4>>2]=e,P=i,0;n[h>>2]=0;A:do{if(0|HA(A,e))A=9;else{a=0,g=A;do{if(0|(A=0|R(g,e,4,h,o)))break A;if(a=a+1|0,0|HA(g=0|n[(e=o)>>2],e=0|n[e+4>>2])){A=9;break A}}while((0|a)<(0|t));n[(f=r)>>2]=g,n[f+4>>2]=e,f=t+-1|0,d=0,A=1;do{if(a=26800+(d<<2)|0,5==(0|d))for(l=0|n[a>>2],s=0,a=A;;){if(0|(A=0|R(0|n[(A=o)>>2],0|n[A+4>>2],l,h,o)))break A;if((0|s)!=(0|f)){if(c=0|n[(u=o)>>2],u=0|n[u+4>>2],n[(A=r+(a<<3)|0)>>2]=c,n[A+4>>2]=u,0|HA(c,u)){A=9;break A}A=a+1|0}else A=a;if((0|(s=s+1|0))>=(0|t))break;a=A}else for(l=o,u=0|n[a>>2],c=0,a=A,s=0|n[l>>2],l=0|n[l+4>>2];;){if(0|(A=0|R(s,l,u,h,o)))break A;if(s=0|n[(l=o)>>2],l=0|n[l+4>>2],n[(A=r+(a<<3)|0)>>2]=s,n[A+4>>2]=l,A=a+1|0,0|HA(s,l)){A=9;break A}if((0|(c=c+1|0))>=(0|t))break;a=A}d=d+1|0}while(d>>>0<6);A=(0|g)==(0|n[(A=o)>>2])&&(0|e)==(0|n[A+4>>2])?0:9}}while(0);return P=i,0|A}function _(A,e,t,r){t|=0,r|=0;var o,i,a,s=0,l=0;for(a=P,P=P+16|0,o=a,i=a+8|0,s=(s=!(0|HA(A|=0,e|=0)))?1:2;;){if(n[i>>2]=0,!(0|R(A,e,s,i,o))&((0|n[(l=o)>>2])==(0|t)?(0|n[l+4>>2])==(0|r):0)){A=4;break}if((s=s+1|0)>>>0>=7){s=7,A=4;break}}return 4==(0|A)?(P=a,0|s):0}function H(A,e,t,r,i,a,s){e|=0,t|=0,r|=0,i|=0,a|=0,s|=0;var l,c,u,d,f,g,h,m,b,p,x=0,v=0,w=0,y=0,k=0,C=0,M=0,D=0,E=0,N=0,Q=0,j=0,F=0,S=0,L=0,I=0,R=0,T=0,_=0;if(p=P,P=P+64|0,h=p+48|0,m=p+32|0,b=p+24|0,l=p+8|0,c=p,(0|(v=0|n[(A|=0)>>2]))<=0)return P=p,0;for(u=A+4|0,d=h+8|0,f=m+8|0,g=l+8|0,x=0,F=0;;){j=(w=0|n[u>>2])+(F<<4)|0,n[h>>2]=n[j>>2],n[h+4>>2]=n[j+4>>2],n[h+8>>2]=n[j+8>>2],n[h+12>>2]=n[j+12>>2],(0|F)==(v+-1|0)?(n[m>>2]=n[w>>2],n[m+4>>2]=n[w+4>>2],n[m+8>>2]=n[w+8>>2],n[m+12>>2]=n[w+12>>2]):(j=w+(F+1<<4)|0,n[m>>2]=n[j>>2],n[m+4>>2]=n[j+4>>2],n[m+8>>2]=n[j+8>>2],n[m+12>>2]=n[j+12>>2]),v=0|tA(h,m,r,b);A:do{if(v)w=0,x=v;else if(w=0|n[(v=b)>>2],(0|(v=0|n[v+4>>2]))>0|!(0|v)&w>>>0>0){Q=0,j=0;e:for(;;){if(R=1/(+(w>>>0)+4294967296*+(0|v)),_=+o[h>>3],T=+((v=0|Ve(0|w,0|v,0|Q,0|j))>>>0)+4294967296*+(0|B()),I=+(Q>>>0)+4294967296*+(0|j),o[l>>3]=R*(_*T)+R*(+o[m>>3]*I),o[g>>3]=R*(+o[d>>3]*T)+R*(+o[f>>3]*I),0|(v=0|KA(l,r,c))){x=v;break}C=0|At(0|(E=0|n[(N=c)>>2]),0|(N=0|n[N+4>>2]),0|e,0|t),y=0|B(),w=0|n[(k=v=s+(C<<3)|0)>>2],k=0|n[k+4>>2];t:do{if(!(0|w)&!(0|k))S=v,L=16;else for(M=0,D=0;;){if((0|M)>(0|t)|(0|M)==(0|t)&D>>>0>e>>>0){x=1;break e}if((0|w)==(0|E)&(0|k)==(0|N))break t;if(C=0|$e(0|(v=0|Ze(0|C,0|y,1,0)),0|B(),0|e,0|t),y=0|B(),D=0|Ze(0|D,0|M,1,0),M=0|B(),!(0|(w=0|n[(k=v=s+(C<<3)|0)>>2]))&!(0|(k=0|n[k+4>>2]))){S=v,L=16;break}}}while(0);if(16!=(0|L)||(L=0,!(0|E)&!(0|N))||(n[(D=S)>>2]=E,n[D+4>>2]=N,D=a+(n[i>>2]<<3)|0,n[D>>2]=E,n[D+4>>2]=N,D=0|Ze(0|n[(D=i)>>2],0|n[D+4>>2],1,0),E=0|B(),n[(N=i)>>2]=D,n[N+4>>2]=E),Q=0|Ze(0|Q,0|j,1,0),j=0|B(),w=0|n[(v=b)>>2],!((0|(v=0|n[v+4>>2]))>(0|j)|(0|v)==(0|j)&w>>>0>Q>>>0)){w=1;break A}}w=0}else w=1}while(0);if(F=F+1|0,!w){L=21;break}if((0|F)>=(0|(v=0|n[A>>2]))){x=0,L=21;break}}return 21==(0|L)?(P=p,0|x):0}function z(A){return(A|=0)>>>0>121?0|(A=0):0|(A=0|n[7696+(28*A|0)+16>>2])}function G(A){return 4==(0|(A|=0))|117==(0|A)|0}function O(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)>>2]}function U(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)+4>>2]}function Y(A,e){return e|=0,(0|n[7696+(28*(A|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|n[7696+(28*A|0)+24>>2])==(0|e))}function W(A,e){return 0|n[848+(28*(A|=0)|0)+((e|=0)<<2)>>2]}function Z(A,e){return e|=0,(0|n[848+(28*(A|=0)|0)>>2])==(0|e)?0|(e=0):(0|n[848+(28*A|0)+4>>2])==(0|e)?0|(e=1):(0|n[848+(28*A|0)+8>>2])==(0|e)?0|(e=2):(0|n[848+(28*A|0)+12>>2])==(0|e)?0|(e=3):(0|n[848+(28*A|0)+16>>2])==(0|e)?0|(e=4):(0|n[848+(28*A|0)+20>>2])==(0|e)?0|(e=5):0|((0|n[848+(28*A|0)+24>>2])==(0|e)?6:7)}function V(A){var e,t,r;return e=(r=+o[16+(A|=0)>>3])-(t=+o[A+24>>3]),+(r>3]<+o[A+24>>3]|0}function J(A){return+(+o[(A|=0)>>3]-+o[A+8>>3])}function X(A,e){A|=0;var t,r,n=0;return(n=+o[(e|=0)>>3])>=+o[A+8>>3]&&n<=+o[A>>3]?(t=+o[A+16>>3],n=+o[A+24>>3],e=(r=+o[e+8>>3])>=n,A=r<=t&1,t>3]<+o[e+8>>3]||+o[A+8>>3]>+o[e>>3]?0|(s=0):(n=(l=+o[A+16>>3])<(u=+o[(t=A+24|0)>>3]),c=(a=+o[(s=e+16|0)>>3])<(i=+o[(r=e+24|0)>>3]),e=u-a>3],e)||(u=+ie(+o[t>>3],A))>+ie(+o[s>>3],e)?0|(c=0):0|(c=1))}function $(A,e){e|=0;var t,r,n,i,a,s=0,l=0,c=0,u=0;return+o[(A|=0)>>3]<+o[e>>3]||+o[A+8>>3]>+o[e+8>>3]?0|(s=0):(n=(i=+o[(s=A+16|0)>>3])<(l=+o[A+24>>3]),c=(u=+o[(t=e+16|0)>>3])<(a=+o[(r=e+24|0)>>3]),e=l-u>3],e)?0|(c=(u=+ie(+o[s>>3],A))>=+ie(+o[t>>3],e)):0|(c=0))}function AA(A,e){A|=0,e|=0;var t,r,i,a,s,l=0;i=P,P=P+176|0,n[(r=i)>>2]=4,l=+o[e>>3],o[r+8>>3]=l,a=+o[e+16>>3],o[r+16>>3]=a,o[r+24>>3]=l,l=+o[e+24>>3],o[r+32>>3]=l,s=+o[e+8>>3],o[r+40>>3]=s,o[r+48>>3]=l,o[r+56>>3]=s,o[r+64>>3]=a,t=96+(e=r+72|0)|0;do{n[e>>2]=0,e=e+4|0}while((0|e)<(0|t));st(0|A,0|r,168),P=i}function eA(A,e,t){A|=0,e|=0,t|=0;var r,a,c,u,d,f,g,h=0,m=0,b=0,p=0,v=0,y=0,k=0;f=P,P=P+288|0,d=f+264|0,p=f+96|0,m=(h=b=f)+96|0;do{n[h>>2]=0,h=h+4|0}while((0|h)<(0|m));return 0|(e=0|Ae(e,b))?(P=f,0|(y=e)):(qA(b=0|n[(m=b)>>2],m=0|n[m+4>>2],d),$A(b,m,p),u=+ae(d,p+8|0),o[d>>3]=+o[A>>3],o[(m=d+8|0)>>3]=+o[A+16>>3],o[p>>3]=+o[A+8>>3],o[(b=p+8|0)>>3]=+o[A+24>>3],a=+ae(d,p),k=+o[m>>3]-+o[b>>3],c=+l(+k),g=+o[d>>3]-+o[p>>3],r=+l(+g),!(0==k|0==g)&&(k=+ot(+c,+r),k=+x(+a*a/+it(+k/+it(+c,+r),3)/(u*(2.59807621135*u)*.8)),o[i>>3]=k,v=~~k>>>0,y=+l(k)>=1?k>0?~~+w(+s(k/4294967296),4294967295)>>>0:~~+x((k-+(~~k>>>0))/4294967296)>>>0:0,2146435072&~n[i+4>>2])?(p=!(0|v)&!(0|y),n[(e=t)>>2]=p?1:v,n[e+4>>2]=p?0:y,e=0):e=1,P=f,0|(y=e))}function tA(A,e,t,r){A|=0,e|=0,t|=0,r|=0;var a,c,u,d,f=0,g=0,h=0;d=P,P=P+288|0,c=d+264|0,u=d+96|0,a=(f=g=d)+96|0;do{n[f>>2]=0,f=f+4|0}while((0|f)<(0|a));return 0|(t=0|Ae(t,g))?(P=d,0|(r=t)):(qA(f=0|n[(t=g)>>2],t=0|n[t+4>>2],c),$A(f,t,u),h=+ae(c,u+8|0),h=+x(+ +ae(A,e)/(2*h)),o[i>>3]=h,t=~~h>>>0,f=+l(h)>=1?h>0?~~+w(+s(h/4294967296),4294967295)>>>0:~~+x((h-+(~~h>>>0))/4294967296)>>>0:0,2146435072&~n[i+4>>2]?(g=!(0|t)&!(0|f),n[r>>2]=g?1:t,n[r+4>>2]=g?0:f,P=d,0|(r=0)):(P=d,0|(r=1)))}function rA(A,e,t,r){e|=0,t|=0,r|=0,n[(A|=0)>>2]=e,n[A+4>>2]=t,n[A+8>>2]=r}function nA(A){var e,t=0,r=0,o=0,i=0,a=0;t=0|n[(A|=0)>>2],r=0|n[(e=A+4|0)>>2],(0|t)<0&&(r=r-t|0,n[e>>2]=r,n[(a=A+8|0)>>2]=(0|n[a>>2])-t,n[A>>2]=0,t=0),(0|r)<0?(t=t-r|0,n[A>>2]=t,i=(0|n[(a=A+8|0)>>2])-r|0,n[a>>2]=i,n[e>>2]=0,r=0):(a=i=A+8|0,i=0|n[i>>2]),(0|i)<0&&(t=t-i|0,n[A>>2]=t,r=r-i|0,n[e>>2]=r,n[a>>2]=0,i=0),(0|(o=(0|i)<(0|(o=(0|r)<(0|t)?r:t))?i:o))<=0||(n[A>>2]=t-o,n[e>>2]=r-o,n[a>>2]=i-o)}function oA(A,e){var t,r;e|=0,r=0|n[8+(A|=0)>>2],t=+((0|n[A+4>>2])-r|0),o[e>>3]=+((0|n[A>>2])-r|0)-.5*t,o[e+8>>3]=.8660254037844386*t}function iA(A,e,t){A|=0,e|=0,n[(t|=0)>>2]=(0|n[e>>2])+(0|n[A>>2]),n[t+4>>2]=(0|n[e+4>>2])+(0|n[A+4>>2]),n[t+8>>2]=(0|n[e+8>>2])+(0|n[A+8>>2])}function aA(A,e,t){A|=0,e|=0,n[(t|=0)>>2]=(0|n[A>>2])-(0|n[e>>2]),n[t+4>>2]=(0|n[A+4>>2])-(0|n[e+4>>2]),n[t+8>>2]=(0|n[A+8>>2])-(0|n[e+8>>2])}function sA(A,e){e|=0;var t,r=0;r=0|v(0|n[(A|=0)>>2],e),n[A>>2]=r,t=0|v(0|n[(r=A+4|0)>>2],e),n[r>>2]=t,e=0|v(0|n[(A=A+8|0)>>2],e),n[A>>2]=e}function lA(A){var e,t,r=0,o=0,i=0,a=0,s=0;s=(0|(t=0|n[(A|=0)>>2]))<0,A=(A=(o=(0|(a=((e=(0|(i=(0|n[A+4>>2])-(s?t:0)|0))<0)?0-i|0:0)+((0|n[A+8>>2])-(s?t:0))|0))<0)?0:a)-((i=(0|(o=(0|A)<(0|(o=(0|(r=(e?0:i)-(o?a:0)|0))<(0|(a=(s?0:t)-(e?i:0)-(o?a:0)|0))?r:a))?A:o))>0)?o:0)|0,r=r-(i?o:0)|0;A:do{switch(a-(i?o:0)|0){case 0:switch(0|r){case 0:return 0|(0|A?1==(0|A)?1:7:0);case 1:return 0|(0|A?1==(0|A)?3:7:2);default:break A}case 1:switch(0|r){case 0:return 0|(0|A?1==(0|A)?5:7:4);case 1:if(A)break A;return 6;default:break A}}}while(0);return 7}function cA(A){var e,t,r=0,o=0,i=0,a=0,s=0,l=0,c=0;if(l=0|n[(t=8+(A|=0)|0)>>2],(e=(0|n[A>>2])-l|0)>>>0>715827881|(l=(0|n[(c=A+4|0)>>2])-l|0)>>>0>715827881){if(a=2147483647-e|0,s=-2147483648-e|0,(i=(0|e)>0)?(0|a)<(0|e):(0|s)>(0|e))return 1;if(o=e<<1,i?(2147483647-o|0)<(0|e):(-2147483648-o|0)>(0|e))return 1;if((0|l)>0?(2147483647-l|0)<(0|l):(-2147483648-l|0)>(0|l))return 1;if(r=3*e|0,o=l<<1,(i?(0|a)<(0|o):(0|s)>(0|o))||((0|e)>-1?(-2147483648|r)>=(0|l):(-2147483648^r)<(0|l)))return 1}else o=l<<1,r=3*e|0;return i=0|Oe(.14285714285714285*+(r-l|0)),n[A>>2]=i,a=0|Oe(.14285714285714285*+(o+e|0)),n[c>>2]=a,n[t>>2]=0,r=(o=(0|a)<(0|i))?i:a,(0|(o=o?a:i))<0&&((-2147483648==(0|o)||((0|r)>0?(2147483647-r|0)<(0|o):(-2147483648-r|0)>(0|o)))&&M(27795,26892,354,26903),((0|r)>-1?(-2147483648|r)>=(0|o):(-2147483648^r)<(0|o))&&M(27795,26892,354,26903)),r=a-i|0,(0|i)<0?(o=0-i|0,n[c>>2]=r,n[t>>2]=o,n[A>>2]=0,i=0):(r=a,o=0),(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[t>>2]=o,n[c>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[c>>2]=a,n[t>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[c>>2]=r-i,n[t>>2]=o-i),0}function uA(A){var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0;if(i=0|n[(e=8+(A|=0)|0)>>2],(a=(0|n[A>>2])-i|0)>>>0>715827881|(i=(0|n[(s=A+4|0)>>2])-i|0)>>>0>715827881){if((r=(0|a)>0)?(2147483647-a|0)<(0|a):(-2147483648-a|0)>(0|a))return 1;if(t=a<<1,(o=(0|i)>0)?(2147483647-i|0)<(0|i):(-2147483648-i|0)>(0|i))return 1;if(l=i<<1,o?(2147483647-l|0)<(0|i):(-2147483648-l|0)>(0|i))return 1;if(r?(2147483647-t|0)<(0|i):(-2147483648-t|0)>(0|i))return 1;if(r=3*i|0,(0|i)>-1?(-2147483648|r)>=(0|a):(-2147483648^r)<(0|a))return 1}else r=3*i|0,t=a<<1;return o=0|Oe(.14285714285714285*+(t+i|0)),n[A>>2]=o,i=0|Oe(.14285714285714285*+(r-a|0)),n[s>>2]=i,n[e>>2]=0,t=(r=(0|i)<(0|o))?o:i,(0|(r=r?i:o))<0&&((-2147483648==(0|r)||((0|t)>0?(2147483647-t|0)<(0|r):(-2147483648-t|0)>(0|r)))&&M(27795,26892,402,26917),((0|t)>-1?(-2147483648|t)>=(0|r):(-2147483648^t)<(0|r))&&M(27795,26892,402,26917)),t=i-o|0,(0|o)<0?(r=0-o|0,n[s>>2]=t,n[e>>2]=r,n[A>>2]=0,o=0):(t=i,r=0),(0|t)<0&&(o=o-t|0,n[A>>2]=o,r=r-t|0,n[e>>2]=r,n[s>>2]=0,t=0),a=o-r|0,i=t-r|0,(0|r)<0?(n[A>>2]=a,n[s>>2]=i,n[e>>2]=0,t=i,i=a,r=0):i=o,(0|(o=(0|r)<(0|(o=(0|t)<(0|i)?t:i))?r:o))<=0||(n[A>>2]=i-o,n[s>>2]=t-o,n[e>>2]=r-o),0}function dA(A){var e,t,r=0,o=0,i=0,a=0,s=0;o=0|n[(e=8+(A|=0)|0)>>2],i=0|Oe(.14285714285714285*+((3*(r=(0|n[A>>2])-o|0)|0)-(o=(0|n[(t=A+4|0)>>2])-o|0)|0)),n[A>>2]=i,r=0|Oe(.14285714285714285*+((o<<1)+r|0)),n[t>>2]=r,n[e>>2]=0,o=r-i|0,(0|i)<0?(s=0-i|0,n[t>>2]=o,n[e>>2]=s,n[A>>2]=0,r=o,i=0,o=s):o=0,(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[e>>2]=o,n[t>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[t>>2]=a,n[e>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=r-i,n[e>>2]=o-i)}function fA(A){var e,t,r=0,o=0,i=0,a=0,s=0;o=0|n[(e=8+(A|=0)|0)>>2],i=0|Oe(.14285714285714285*+(((r=(0|n[A>>2])-o|0)<<1)+(o=(0|n[(t=A+4|0)>>2])-o|0)|0)),n[A>>2]=i,r=0|Oe(.14285714285714285*+((3*o|0)-r|0)),n[t>>2]=r,n[e>>2]=0,o=r-i|0,(0|i)<0?(s=0-i|0,n[t>>2]=o,n[e>>2]=s,n[A>>2]=0,r=o,i=0,o=s):o=0,(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[e>>2]=o,n[t>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[t>>2]=a,n[e>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=r-i,n[e>>2]=o-i)}function gA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],i=0|n[(t=A+4|0)>>2],a=0|n[(r=A+8|0)>>2],s=i+(3*o|0)|0,n[A>>2]=s,i=a+(3*i|0)|0,n[t>>2]=i,o=(3*a|0)+o|0,n[r>>2]=o,a=i-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=a,n[r>>2]=o,n[A>>2]=0,i=a,a=0):a=s,(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function hA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=(3*(o=0|n[(t=A+4|0)>>2])|0)+s|0,s=(i=0|n[(r=A+8|0)>>2])+(3*s|0)|0,n[A>>2]=s,n[t>>2]=a,o=(3*i|0)+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,s=0):i=a,(0|i)<0&&(s=s-i|0,n[A>>2]=s,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=s-o|0,a=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=a,n[r>>2]=0,s=e,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(n[A>>2]=s-i,n[t>>2]=a-i,n[r>>2]=o-i)}function mA(A,e){A|=0;var t,r,o,i=0,a=0,s=0;((e|=0)-1|0)>>>0>=6||(s=(0|n[15440+(12*e|0)>>2])+(0|n[A>>2])|0,n[A>>2]=s,o=A+4|0,a=(0|n[15440+(12*e|0)+4>>2])+(0|n[o>>2])|0,n[o>>2]=a,r=A+8|0,e=(0|n[15440+(12*e|0)+8>>2])+(0|n[r>>2])|0,n[r>>2]=e,i=a-s|0,(0|s)<0?(e=e-s|0,n[o>>2]=i,n[r>>2]=e,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,e=e-i|0,n[r>>2]=e,n[o>>2]=0,i=0),t=a-e|0,s=i-e|0,(0|e)<0?(n[A>>2]=t,n[o>>2]=s,n[r>>2]=0,a=t,e=0):s=i,(0|(i=(0|e)<(0|(i=(0|s)<(0|a)?s:a))?e:i))<=0||(n[A>>2]=a-i,n[o>>2]=s-i,n[r>>2]=e-i))}function bA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=(o=0|n[(t=A+4|0)>>2])+s|0,s=(i=0|n[(r=A+8|0)>>2])+s|0,n[A>>2]=s,n[t>>2]=a,o=i+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function pA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],a=0|n[(t=A+4|0)>>2],i=0|n[(r=A+8|0)>>2],s=a+o|0,n[A>>2]=s,a=i+a|0,n[t>>2]=a,o=i+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function xA(A){switch(0|(A|=0)){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1}return 0|A}function vA(A){switch(0|(A|=0)){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1}return 0|A}function wA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],i=0|n[(t=A+4|0)>>2],a=0|n[(r=A+8|0)>>2],s=i+(o<<1)|0,n[A>>2]=s,i=a+(i<<1)|0,n[t>>2]=i,o=(a<<1)+o|0,n[r>>2]=o,a=i-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=a,n[r>>2]=o,n[A>>2]=0,i=a,a=0):a=s,(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function yA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=((o=0|n[(t=A+4|0)>>2])<<1)+s|0,s=(i=0|n[(r=A+8|0)>>2])+(s<<1)|0,n[A>>2]=s,n[t>>2]=a,o=(i<<1)+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,s=0):i=a,(0|i)<0&&(s=s-i|0,n[A>>2]=s,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=s-o|0,a=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=a,n[r>>2]=0,s=e,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(n[A>>2]=s-i,n[t>>2]=a-i,n[r>>2]=o-i)}function kA(A,e){e|=0;var t,r,o,i=0,a=0,s=0;return o=(0|(r=(0|n[(A|=0)>>2])-(0|n[e>>2])|0))<0,t=(0|(a=(0|n[A+4>>2])-(0|n[e+4>>2])-(o?r:0)|0))<0,e=(e=(A=(0|(s=(o?0-r|0:0)+(0|n[A+8>>2])-(0|n[e+8>>2])+(t?0-a|0:0)|0))<0)?0:s)-((a=(0|(A=(0|e)<(0|(A=(0|(i=(t?0:a)-(A?s:0)|0))<(0|(s=(o?0:r)-(t?a:0)-(A?s:0)|0))?i:s))?e:A))>0)?A:0)|0,i=i-(a?A:0)|0,0|((0|(A=(0|(A=s-(a?A:0)|0))>-1?A:0-A|0))>(0|(e=(0|(i=(0|i)>-1?i:0-i|0))>(0|(e=(0|e)>-1?e:0-e|0))?i:e))?A:e)}function CA(A){var e,t,r,o;t=(o=0|n[(e=8+(A|=0)|0)>>2])-(0|n[A>>2])|0,n[A>>2]=t,A=(0|n[(r=A+4|0)>>2])-o|0,n[r>>2]=A,n[e>>2]=0-(A+t)}function BA(A){var e,t,r=0,o=0,i=0,a=0,s=0;r=0-(o=0|n[(A|=0)>>2])|0,n[A>>2]=r,n[(e=A+8|0)>>2]=0,a=(i=0|n[(t=A+4|0)>>2])+o|0,(0|o)>0?(n[t>>2]=a,n[e>>2]=o,n[A>>2]=0,r=0,i=a):o=0,(0|i)<0?(s=r-i|0,n[A>>2]=s,o=o-i|0,n[e>>2]=o,n[t>>2]=0,a=s-o|0,r=0-o|0,(0|o)<0?(n[A>>2]=a,n[t>>2]=r,n[e>>2]=0,i=r,o=0):(i=0,a=s)):a=r,(0|(r=(0|o)<(0|(r=(0|i)<(0|a)?i:a))?o:r))<=0||(n[A>>2]=a-r,n[t>>2]=i-r,n[e>>2]=o-r)}function MA(A,e){var t=0;switch(t=0|tt(0|(A|=0),0|(e|=0),56),B(),7&t){case 0:case 7:return 0}return t=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|HA(A,t))?0|(t=0):0|(t=0|IA(A,t)):0|(t=0)}function DA(A,e,t){t|=0;var r,o,i=0,a=0;return o=P,P=P+16|0,r=o,a=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(i=0|tt(0|(A|=0),0|e,56),B(),i=0|function(A,e,t){t|=0;var r,o=0,i=0;if(r=P,P=P+16|0,i=r,o=0|HA(A|=0,e|=0),(t+-1|0)>>>0>5)return P=r,-1;if(1==(0|t)&(o=!!(0|o)))return P=r,-1;do{if(!(0|Fe(A,e,i))){if(o){o=(5+(0|n[26352+(t<<2)>>2])-(0|n[i>>2])|0)%5|0;break}o=(6+(0|n[26384+(t<<2)>>2])-(0|n[i>>2])|0)%6|0;break}o=-1}while(0);return P=r,0|(i=o)}(A,a,7&i),-1==(0|i)?(n[t>>2]=0,P=o,0|(a=6)):(0|XA(A,a,r)&&M(27795,26932,282,26947),e=0|tt(0|A,0|e,52),B(),e&=15,0|HA(A,a)?NA(r,e,i,2,t):FA(r,e,i,2,t),P=o,0|(a=0))):(P=o,0|(a=6))}function EA(A,e,t,r,i){e|=0,t|=0,r|=0,i|=0;var a,s=0,u=0;if(s=+function(A){var e,t;return t=+o[(A|=0)>>3],e=+o[A+8>>3],+ +c(+(t*t+e*e))}(A|=0),s<1e-16)return e=15600+(e<<4)|0,n[i>>2]=n[e>>2],n[i+4>>2]=n[e+4>>2],n[i+8>>2]=n[e+8>>2],void(n[i+12>>2]=n[e+12>>2]);if(u=+p(+ +o[A+8>>3],+ +o[A>>3]),(0|t)>0){A=0;do{s*=.37796447300922725,A=A+1|0}while((0|A)!=(0|t))}a=.3333333333333333*s,r?(t=!(0|VA(t)),s=+b(.381966011250105*(t?a:.37796447300922725*a))):(s=+b(.381966011250105*s),0|VA(t)&&(u=+ne(u+.3334731722518321))),function(A,e,t,r){A|=0,e=+e,r|=0;var i=0,a=0,s=0,c=0;if((t=+t)<1e-16)return n[r>>2]=n[A>>2],n[r+4>>2]=n[A+4>>2],n[r+8>>2]=n[A+8>>2],void(n[r+12>>2]=n[A+12>>2]);a=e<0?e+6.283185307179586:e,a=e>=6.283185307179586?a+-6.283185307179586:a;do{if(!(a<1e-16)){if(i=+l(+(a+-3.141592653589793))<1e-16,e=+o[A>>3],i){e-=t,o[r>>3]=e,i=r;break}if(s=+d(+t),t=+f(+t),e=s*+f(+e)+ +d(+a)*(t*+d(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),o[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return o[r>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[r>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if(c=1/+d(+e),a=t*+f(+a)*c,t=+o[A>>3],e=c*((s-+f(+e)*+f(+t))/+d(+t)),s=a>1?1:a,e=e>1?1:e,(e=+o[A+8>>3]+ +p(+(s<-1?-1:s),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[r+8>>3]=e)}e=+o[A>>3]+t,o[r>>3]=e,i=r}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return o[i>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[i>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if((e=+o[A+8>>3])>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[r+8>>3]=e}(15600+(e<<4)|0,+ne(+o[15920+(24*e|0)>>3]-u),s,i)}function NA(A,e,t,r,i){A|=0,e|=0,t|=0,r|=0,i|=0;var a,s,l,c,u,d,f,g,h,m,b,p,x,v,w,y,k,C,B,D,E,N,Q=0,j=0,F=0,S=0,L=0,I=0;if(N=P,P=P+272|0,S=N+240|0,B=N,D=N+224|0,E=N+208|0,b=N+176|0,p=N+160|0,x=N+192|0,v=N+144|0,w=N+128|0,y=N+112|0,k=N+96|0,C=N+80|0,n[(Q=N+256|0)>>2]=e,n[S>>2]=n[A>>2],n[S+4>>2]=n[A+4>>2],n[S+8>>2]=n[A+8>>2],n[S+12>>2]=n[A+12>>2],QA(S,Q,B),n[i>>2]=0,(0|(S=r+t+(5==(0|r)&1)|0))<=(0|t))P=N;else{s=D+4|0,l=b+4|0,c=t+5|0,u=16880+((a=0|n[Q>>2])<<2)|0,d=16960+(a<<2)|0,f=w+8|0,g=y+8|0,h=k+8|0,m=E+4|0,F=t;A:for(;;){j=B+((0|F)%5<<4)|0,n[E>>2]=n[j>>2],n[E+4>>2]=n[j+4>>2],n[E+8>>2]=n[j+8>>2],n[E+12>>2]=n[j+12>>2];do{}while(2==(0|jA(E,a,0,1)));if((0|F)>(0|t)&!!(0|VA(e))){if(n[b>>2]=n[E>>2],n[b+4>>2]=n[E+4>>2],n[b+8>>2]=n[E+8>>2],n[b+12>>2]=n[E+12>>2],oA(s,p),r=0|n[b>>2],Q=0|n[17040+(80*r|0)+(n[D>>2]<<2)>>2],n[b>>2]=n[18640+(80*r|0)+(20*Q|0)>>2],(0|(j=0|n[18640+(80*r|0)+(20*Q|0)+16>>2]))>0){A=0;do{bA(l),A=A+1|0}while((0|A)<(0|j))}switch(j=18640+(80*r|0)+(20*Q|0)+4|0,n[x>>2]=n[j>>2],n[x+4>>2]=n[j+4>>2],n[x+8>>2]=n[j+8>>2],sA(x,3*(0|n[u>>2])|0),iA(l,x,l),nA(l),oA(l,v),L=+(0|n[d>>2]),o[w>>3]=3*L,o[f>>3]=0,I=-1.5*L,o[y>>3]=I,o[g>>3]=2.598076211353316*L,o[k>>3]=I,o[h>>3]=-2.598076211353316*L,0|n[17040+(80*(0|n[b>>2])|0)+(n[E>>2]<<2)>>2]){case 1:A=y,r=w;break;case 3:A=k,r=y;break;case 2:A=w,r=k;break;default:A=12;break A}Qe(p,v,r,A,C),EA(C,0|n[b>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])}if((0|F)<(0|c)&&(oA(m,b),EA(b,0|n[E>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])),n[D>>2]=n[E>>2],n[D+4>>2]=n[E+4>>2],n[D+8>>2]=n[E+8>>2],n[D+12>>2]=n[E+12>>2],(0|(F=F+1|0))>=(0|S)){A=3;break}}3!=(0|A)?12==(0|A)&&M(26970,27017,572,27027):P=N}}function QA(A,e,t){A|=0,e|=0,t|=0;var r,o=0,i=0,a=0,s=0,l=0;r=P,P=P+128|0,i=r,s=20240,l=60+(a=o=r+64|0)|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));s=20304,l=(a=i)+60|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));o=(l=!(0|VA(0|n[e>>2])))?o:i,wA(i=A+4|0),yA(i),0|VA(0|n[e>>2])&&(hA(i),n[e>>2]=1+(0|n[e>>2])),n[t>>2]=n[A>>2],iA(i,o,e=t+4|0),nA(e),n[t+16>>2]=n[A>>2],iA(i,o+12|0,e=t+20|0),nA(e),n[t+32>>2]=n[A>>2],iA(i,o+24|0,e=t+36|0),nA(e),n[t+48>>2]=n[A>>2],iA(i,o+36|0,e=t+52|0),nA(e),n[t+64>>2]=n[A>>2],iA(i,o+48|0,t=t+68|0),nA(t),P=r}function jA(A,e,t,r){t|=0,r|=0;var o,i,a,s,l,c,u=0,d=0,f=0,g=0,h=0;if(c=P,P=P+32|0,l=c+12|0,i=c,h=4+(A|=0)|0,g=0|n[16960+((e|=0)<<2)>>2],g=(s=!!(0|r))?3*g|0:g,u=0|n[h>>2],o=0|n[(a=A+8|0)>>2],s){if((0|(u=o+u+(r=0|n[(d=A+12|0)>>2])|0))==(0|g))return P=c,1;f=d}else u=o+u+(r=0|n[(f=A+12|0)>>2])|0;if((0|u)<=(0|g))return P=c,0;do{if((0|r)>0){if(r=0|n[A>>2],(0|o)>0){d=18640+(80*r|0)+60|0,r=A;break}r=18640+(80*r|0)+40|0,t?(rA(l,g,0,0),aA(h,l,i),pA(i),iA(i,l,h),d=r,r=A):(d=r,r=A)}else d=18640+(80*(0|n[A>>2])|0)+20|0,r=A}while(0);if(n[r>>2]=n[d>>2],(0|n[(u=d+16|0)>>2])>0){r=0;do{bA(h),r=r+1|0}while((0|r)<(0|n[u>>2]))}return A=d+4|0,n[l>>2]=n[A>>2],n[l+4>>2]=n[A+4>>2],n[l+8>>2]=n[A+8>>2],e=0|n[16880+(e<<2)>>2],sA(l,s?3*e|0:e),iA(h,l,h),nA(h),r=s&&((0|n[a>>2])+(0|n[h>>2])+(0|n[f>>2])|0)==(0|g)?1:2,P=c,0|r}function PA(A,e){A|=0,e|=0;var t=0;do{t=0|jA(A,e,0,1)}while(2==(0|t));return 0|t}function FA(A,e,t,r,i){A|=0,e|=0,t|=0,r|=0,i|=0;var a,s,l,c,u,d,f,g,h,m,b,p,x,v,w,y,k,C,B=0,D=0,E=0,N=0,Q=0;if(C=P,P=P+240|0,v=C+208|0,w=C,y=C+192|0,k=C+176|0,h=C+160|0,m=C+144|0,b=C+128|0,p=C+112|0,x=C+96|0,n[(B=C+224|0)>>2]=e,n[v>>2]=n[A>>2],n[v+4>>2]=n[A+4>>2],n[v+8>>2]=n[A+8>>2],n[v+12>>2]=n[A+12>>2],SA(v,B,w),n[i>>2]=0,(0|(g=r+t+(6==(0|r)&1)|0))<=(0|t))P=C;else{s=t+6|0,l=16960+((a=0|n[B>>2])<<2)|0,c=m+8|0,u=b+8|0,d=p+8|0,f=y+4|0,D=0,E=t,r=-1;A:for(;;){if(A=w+((B=(0|E)%6|0)<<4)|0,n[y>>2]=n[A>>2],n[y+4>>2]=n[A+4>>2],n[y+8>>2]=n[A+8>>2],n[y+12>>2]=n[A+12>>2],A=D,D=0|jA(y,a,0,1),(0|E)>(0|t)&!!(0|VA(e))&&1!=(0|A)&&(0|n[y>>2])!=(0|r)){switch(oA(w+((B+5|0)%6<<4)+4|0,k),oA(w+(B<<4)+4|0,h),N=+(0|n[l>>2]),o[m>>3]=3*N,o[c>>3]=0,Q=-1.5*N,o[b>>3]=Q,o[u>>3]=2.598076211353316*N,o[p>>3]=Q,o[d>>3]=-2.598076211353316*N,B=0|n[v>>2],0|n[17040+(80*B|0)+(((0|r)==(0|B)?n[y>>2]:r)<<2)>>2]){case 1:A=b,r=m;break;case 3:A=p,r=b;break;case 2:A=m,r=p;break;default:A=8;break A}Qe(k,h,r,A,x),0|je(k,x)||0|je(h,x)||(EA(x,0|n[v>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2]))}if((0|E)<(0|s)&&(oA(f,k),EA(k,0|n[y>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])),(0|(E=E+1|0))>=(0|g)){A=3;break}r=0|n[y>>2]}3!=(0|A)?8==(0|A)&&M(27054,27017,737,27099):P=C}}function SA(A,e,t){A|=0,e|=0,t|=0;var r,o=0,i=0,a=0,s=0,l=0;r=P,P=P+160|0,i=r,s=20368,l=72+(a=o=r+80|0)|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));s=20448,l=(a=i)+72|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));o=(l=!(0|VA(0|n[e>>2])))?o:i,wA(i=A+4|0),yA(i),0|VA(0|n[e>>2])&&(hA(i),n[e>>2]=1+(0|n[e>>2])),n[t>>2]=n[A>>2],iA(i,o,e=t+4|0),nA(e),n[t+16>>2]=n[A>>2],iA(i,o+12|0,e=t+20|0),nA(e),n[t+32>>2]=n[A>>2],iA(i,o+24|0,e=t+36|0),nA(e),n[t+48>>2]=n[A>>2],iA(i,o+36|0,e=t+52|0),nA(e),n[t+64>>2]=n[A>>2],iA(i,o+48|0,e=t+68|0),nA(e),n[t+80>>2]=n[A>>2],iA(i,o+60|0,t=t+84|0),nA(t),P=r}function LA(A,e){return e=0|tt(0|(A|=0),0|(e|=0),45),B(),127&e}function IA(A,e){A|=0;var t=0,n=0,o=0,i=0;return!0&134217728==(-16777216&(e|=0))?(n=0|tt(0|A,0|e,52),B(),n&=15,t=0|tt(0|A,0|e,45),B(),(t&=127)>>>0>121?0|(A=0):!(613566756&(i=0|rt(0|(o=0|tt(0|A,0|e,0|(i=3*(15^n)|0))),0|B(),0|i))&Ve(-1227133514,-1171,0|i,0|(o=0|B())))&!(4681&o&B())&&15==(0|n)|!(0|(i=0|tt(0|rt(0|~A,0|~e,0|(i=19+(3*n|0)|0)),0|B(),0|i)))&!(0|B())?0|r[20528+t|0]?!(0|A)&!(0|(e&=8191))?0|(i=1):(i=0|nt(0|A,0|e),B(),0|!!((63-i|0)%3|0)):0|(i=1):0|(i=0)):0|(A=0)}function RA(A,e,t,r){A|=0,t|=0,r|=0;var o=0,i=0,a=0,s=0;if(o=0|rt(0|(e|=0),0,52),i=0|B(),t=0|rt(0|t,0,45),t=0|i|B()|134225919,(0|e)<1)return i=-1,r=t,n[(e=A)>>2]=i,void(n[(A=A+4|0)>>2]=r);for(i=1,o=-1;s=0|rt(7,0,0|(a=3*(15-i|0)|0)),t&=~B(),o=o&~s|(a=0|rt(0|r,0,0|a)),t=0|t|B(),(0|i)!=(0|e);)i=i+1|0;n[(a=s=A)>>2]=o,n[(s=s+4|0)>>2]=t}function TA(A,e,t,r){t|=0,r|=0;var o=0,i=0;if(i=0|tt(0|(A|=0),0|(e|=0),52),B(),t>>>0>15)return 4;if((0|(i&=15))<(0|t))return 12;if((0|i)==(0|t))return n[r>>2]=A,n[r+4>>2]=e,0;if(o=0|rt(0|t,0,52),o|=A,A=B()|-15728641&e,(0|i)>(0|t))do{e=0|rt(7,0,3*(14-t|0)|0),t=t+1|0,o|=e,A=0|B()|A}while((0|t)<(0|i));return n[r>>2]=o,n[r+4>>2]=A,0}function _A(A,e,t,r){t|=0,r|=0;var o=0,i=0,a=0;if(i=0|tt(0|(A|=0),0|(e|=0),52),B(),!((0|t)<16&(0|(i&=15))<=(0|t)))return 4;o=t-i|0,t=0|tt(0|A,0|e,45),B();A:do{if(0|z(127&t)){e:do{if(0|i){for(t=1;!((a=0|rt(7,0,3*(15-t|0)|0))&A)&!((0|B())&e);){if(!(t>>>0>>0))break e;t=t+1|0}t=0|pe(7,0,o,((0|o)<0)<<31>>31),o=0|B();break A}}while(0);t=0|Ze(0|(t=0|qe(0|(t=0|pe(7,0,o,((0|o)<0)<<31>>31)),0|B(),5,0)),0|B(),-5,-1),t=0|Ze(0|(t=0|Xe(0|t,0|B(),6,0)),0|B(),1,0),o=0|B()}else t=0|pe(7,0,o,((0|o)<0)<<31>>31),o=0|B()}while(0);return n[(a=r)>>2]=t,n[a+4>>2]=o,0}function HA(A,e){var t=0,r=0,n=0;if(n=0|tt(0|(A|=0),0|(e|=0),45),B(),!(0|z(127&n)))return 0;n=0|tt(0|A,0|e,52),B(),n&=15;A:do{if(n)for(r=1;;){if(t=0|tt(0|A,0|e,3*(15-r|0)|0),B(),0|(t&=7))break A;if(!(r>>>0>>0)){t=0;break}r=r+1|0}else t=0}while(0);return 1&!(0|t)}function zA(A,e,t,r){return A|=0,e|=0,(0|(r|=0))<(0|(t|=0))?(r=A,C(0|(t=e)),0|r):(t=0|rt(-1,-1,3+(3*(r-t|0)|0)|0),r=0|rt(0|~t,0|~B(),3*(15-r|0)|0),t=~B()&e,r=~r&A,C(0|t),0|r)}function GA(A,e,t,r){t|=0,r|=0;var o=0;return o=0|tt(0|(A|=0),0|(e|=0),52),B(),(0|t)<16&(0|(o&=15))<=(0|t)?((0|o)<(0|t)&&(o=0|rt(-1,-1,3+(3*(t+-1-o|0)|0)|0),o=0|rt(0|~o,0|~B(),3*(15-t|0)|0),e=~B()&e,A&=~o),o=0|rt(0|t,0,52),t=-15728641&e|B(),n[r>>2]=A|o,n[r+4>>2]=t,0|(r=0)):0|(r=4)}function OA(A,e){var t=0,r=0,n=0;if(n=0|tt(0|(A|=0),0|(e|=0),52),B(),!(n&=15))return 0;for(r=1;;){if(t=0|tt(0|A,0|e,3*(15-r|0)|0),B(),0|(t&=7)){r=5;break}if(!(r>>>0>>0)){t=0,r=5;break}r=r+1|0}return 5==(0|r)?0|t:0}function UA(A,e){var t=0,r=0,n=0,o=0,i=0,a=0,s=0;if(s=0|tt(0|(A|=0),0|(e|=0),52),B(),!(s&=15))return s=A,C(0|(a=e)),0|s;for(a=1,t=0;;){r=0|rt(7,0,0|(o=3*(15-a|0)|0)),n=0|B(),i=0|tt(0|A,0|e,0|o),B(),A=(o=0|rt(0|xA(7&i),0,0|o))|A&~r,e=(i=0|B())|e&~n;A:do{if(!t)if(!(o&r|0)&!(i&n|0))t=0;else if(r=0|tt(0|A,0|e,52),B(),r&=15){t=1;e:for(;;){switch(i=0|tt(0|A,0|e,3*(15-t|0)|0),B(),7&i){case 1:break e;case 0:break;default:t=1;break A}if(!(t>>>0>>0)){t=1;break A}t=t+1|0}for(t=1;;){if(n=0|tt(0|A,0|e,0|(i=3*(15-t|0)|0)),B(),o=0|rt(7,0,0|i),e&=~B(),A=A&~o|(i=0|rt(0|xA(7&n),0,0|i)),e=0|e|B(),!(t>>>0>>0)){t=1;break}t=t+1|0}}else t=1}while(0);if(!(a>>>0>>0))break;a=a+1|0}return C(0|e),0|A}function YA(A,e){var t=0,r=0,n=0,o=0,i=0;if(r=0|tt(0|(A|=0),0|(e|=0),52),B(),!(r&=15))return r=A,C(0|(t=e)),0|r;for(t=1;i=0|tt(0|A,0|e,0|(o=3*(15-t|0)|0)),B(),n=0|rt(7,0,0|o),e&=~B(),A=(o=0|rt(0|xA(7&i),0,0|o))|A&~n,e=0|B()|e,t>>>0>>0;)t=t+1|0;return C(0|e),0|A}function WA(A,e){var t=0,r=0,n=0,o=0,i=0,a=0,s=0;if(s=0|tt(0|(A|=0),0|(e|=0),52),B(),!(s&=15))return s=A,C(0|(a=e)),0|s;for(a=1,t=0;;){r=0|rt(7,0,0|(o=3*(15-a|0)|0)),n=0|B(),i=0|tt(0|A,0|e,0|o),B(),A=(o=0|rt(0|vA(7&i),0,0|o))|A&~r,e=(i=0|B())|e&~n;A:do{if(!t)if(!(o&r|0)&!(i&n|0))t=0;else if(r=0|tt(0|A,0|e,52),B(),r&=15){t=1;e:for(;;){switch(i=0|tt(0|A,0|e,3*(15-t|0)|0),B(),7&i){case 1:break e;case 0:break;default:t=1;break A}if(!(t>>>0>>0)){t=1;break A}t=t+1|0}for(t=1;;){if(o=0|rt(7,0,0|(n=3*(15-t|0)|0)),i=e&~B(),e=0|tt(0|A,0|e,0|n),B(),A=A&~o|(e=0|rt(0|vA(7&e),0,0|n)),e=0|i|B(),!(t>>>0>>0)){t=1;break}t=t+1|0}}else t=1}while(0);if(!(a>>>0>>0))break;a=a+1|0}return C(0|e),0|A}function ZA(A,e){var t=0,r=0,n=0,o=0,i=0;if(r=0|tt(0|(A|=0),0|(e|=0),52),B(),!(r&=15))return r=A,C(0|(t=e)),0|r;for(t=1;o=0|rt(7,0,0|(i=3*(15-t|0)|0)),n=e&~B(),e=0|tt(0|A,0|e,0|i),B(),A=(e=0|rt(0|vA(7&e),0,0|i))|A&~o,e=0|B()|n,t>>>0>>0;)t=t+1|0;return C(0|e),0|A}function VA(A){return(0|(A|=0))%2|0}function KA(A,e,t){t|=0;var r,i=0;return r=P,P=P+16|0,i=r,(e|=0)>>>0>15?(P=r,0|(i=4)):2146435072&~n[4+(A|=0)>>2]&&2146435072&~n[A+8+4>>2]?(function(A,e,t){var r,i;r=P,P=P+16|0,function(A,e,t,r){e|=0,r|=0;var i,a=0,s=0,l=0,c=0;if(i=P,P=P+16|0,function(A,e,t){e|=0,t|=0;var r,i,a=0;i=P,P=P+32|0,function(A,e){e|=0;var t,r,n=0;n=+o[(A|=0)>>3],t=+d(+n),n=+f(+n),o[e+16>>3]=n,n=+o[A+8>>3],r=t*+d(+n),o[e>>3]=r,n=t*+f(+n),o[e+8>>3]=n}(A|=0,r=i),n[e>>2]=0,o[t>>3]=5,(a=+Pe(16400,r))<+o[t>>3]&&(n[e>>2]=0,o[t>>3]=a),(a=+Pe(16424,r))<+o[t>>3]&&(n[e>>2]=1,o[t>>3]=a),(a=+Pe(16448,r))<+o[t>>3]&&(n[e>>2]=2,o[t>>3]=a),(a=+Pe(16472,r))<+o[t>>3]&&(n[e>>2]=3,o[t>>3]=a),(a=+Pe(16496,r))<+o[t>>3]&&(n[e>>2]=4,o[t>>3]=a),(a=+Pe(16520,r))<+o[t>>3]&&(n[e>>2]=5,o[t>>3]=a),(a=+Pe(16544,r))<+o[t>>3]&&(n[e>>2]=6,o[t>>3]=a),(a=+Pe(16568,r))<+o[t>>3]&&(n[e>>2]=7,o[t>>3]=a),(a=+Pe(16592,r))<+o[t>>3]&&(n[e>>2]=8,o[t>>3]=a),(a=+Pe(16616,r))<+o[t>>3]&&(n[e>>2]=9,o[t>>3]=a),(a=+Pe(16640,r))<+o[t>>3]&&(n[e>>2]=10,o[t>>3]=a),(a=+Pe(16664,r))<+o[t>>3]&&(n[e>>2]=11,o[t>>3]=a),(a=+Pe(16688,r))<+o[t>>3]&&(n[e>>2]=12,o[t>>3]=a),(a=+Pe(16712,r))<+o[t>>3]&&(n[e>>2]=13,o[t>>3]=a),(a=+Pe(16736,r))<+o[t>>3]&&(n[e>>2]=14,o[t>>3]=a),(a=+Pe(16760,r))<+o[t>>3]&&(n[e>>2]=15,o[t>>3]=a),(a=+Pe(16784,r))<+o[t>>3]&&(n[e>>2]=16,o[t>>3]=a),(a=+Pe(16808,r))<+o[t>>3]&&(n[e>>2]=17,o[t>>3]=a),(a=+Pe(16832,r))<+o[t>>3]&&(n[e>>2]=18,o[t>>3]=a),(a=+Pe(16856,r))<+o[t>>3]?(n[e>>2]=19,o[t>>3]=a,P=i):P=i}(A|=0,t|=0,c=i),(s=+h(+(1-.5*+o[c>>3])))<1e-16)return n[r>>2]=0,n[r+4>>2]=0,n[r+8>>2]=0,n[r+12>>2]=0,void(P=i);if(c=0|n[t>>2],a=+ne((a=+o[15920+(24*c|0)>>3])-+ne(+function(A,e){var t,r,n,i,a;return A|=0,i=+o[(e|=0)>>3],r=+d(+i),n=+o[e+8>>3]-+o[A+8>>3],a=r*+f(+n),t=+o[A>>3],+ +p(+a,+(+f(+i)*+d(+t)-+d(+n)*(r*+f(+t))))}(15600+(c<<4)|0,A))),l=0|VA(e)?+ne(a+-.3334731722518321):a,a=2.618033988749896*+g(+s),(0|e)>0){A=0;do{a*=2.6457513110645907,A=A+1|0}while((0|A)!=(0|e))}s=+d(+l)*a,o[r>>3]=s,l=+f(+l)*a,o[r+8>>3]=l,P=i}(A|=0,e|=0,t|=0,i=r),function(A,e){A|=0;var t,r,i,a,s=0,c=0,u=0,d=0,f=0,g=0,h=0;n[(a=8+(e|=0)|0)>>2]=0,r=+o[A>>3],d=+l(+r),i=+o[A+8>>3],d+=.5*(f=1.1547005383792515*+l(+i)),d-=+(0|(s=~~d)),f-=+(0|(A=~~f));do{if(d<.5){if(d<.3333333333333333){if(n[e>>2]=s,f<.5*(d+1)){n[e+4>>2]=A;break}A=A+1|0,n[e+4>>2]=A;break}if(A=(1&!(f<(h=1-d)))+A|0,n[e+4>>2]=A,h<=f&f<2*d){s=s+1|0,n[e>>2]=s;break}n[e>>2]=s;break}if(!(d<.6666666666666666)){if(s=s+1|0,n[e>>2]=s,f<.5*d){n[e+4>>2]=A;break}A=A+1|0,n[e+4>>2]=A;break}if(f<1-d){if(n[e+4>>2]=A,2*d-1>2]=s;break}}else A=A+1|0,n[e+4>>2]=A;s=s+1|0,n[e>>2]=s}while(0);do{if(r<0){if(1&A){s=~~(+(0|s)-(2*(+((g=0|Ve(0|s,((0|s)<0)<<31>>31,0|(g=(A+1|0)/2|0),((0|g)<0)<<31>>31))>>>0)+4294967296*+(0|B()))+1)),n[e>>2]=s;break}s=~~(+(0|s)-2*(+((g=0|Ve(0|s,((0|s)<0)<<31>>31,0|(g=(0|A)/2|0),((0|g)<0)<<31>>31))>>>0)+4294967296*+(0|B()))),n[e>>2]=s;break}}while(0);g=e+4|0,i<0&&(s=s-((1|A<<1)/2|0)|0,n[e>>2]=s,A=0-A|0,n[g>>2]=A),c=A-s|0,(0|s)<0?(u=0-s|0,n[g>>2]=c,n[a>>2]=u,n[e>>2]=0,A=c,s=0):u=0,(0|A)<0&&(s=s-A|0,n[e>>2]=s,u=u-A|0,n[a>>2]=u,n[g>>2]=0,A=0),t=s-u|0,c=A-u|0,(0|u)<0&&(n[e>>2]=t,n[g>>2]=c,n[a>>2]=0,A=c,s=t,u=0),(0|(c=(0|u)<(0|(c=(0|A)<(0|s)?A:s))?u:c))<=0||(n[e>>2]=s-c,n[g>>2]=A-c,n[a>>2]=u-c)}(i,t+4|0),P=r}(A,e,i),e=0|function(A,e){A|=0;var t,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0;if(t=P,P=P+64|0,l=t+40|0,o=t+24|0,i=t+12|0,a=t,rt(0|(e|=0),0,52),r=134225919|B(),!e)return(0|n[A+4>>2])>2||(0|n[A+8>>2])>2||(0|n[A+12>>2])>2?(l=0,C(0|(s=0)),P=t,0|l):(rt(0|O(A),0,45),s=0|B()|r,l=-1,C(0|s),P=t,0|l);if(n[l>>2]=n[A>>2],n[l+4>>2]=n[A+4>>2],n[l+8>>2]=n[A+8>>2],n[l+12>>2]=n[A+12>>2],s=l+4|0,(0|e)>0)for(A=-1;n[o>>2]=n[s>>2],n[o+4>>2]=n[s+4>>2],n[o+8>>2]=n[s+8>>2],1&e?(dA(s),n[i>>2]=n[s>>2],n[i+4>>2]=n[s+4>>2],n[i+8>>2]=n[s+8>>2],gA(i)):(fA(s),n[i>>2]=n[s>>2],n[i+4>>2]=n[s+4>>2],n[i+8>>2]=n[s+8>>2],hA(i)),aA(o,i,a),nA(a),c=0|rt(7,0,0|(u=3*(15-e|0)|0)),r&=~B(),A=(u=0|rt(0|lA(a),0,0|u))|A&~c,r=0|B()|r,(0|e)>1;)e=e+-1|0;else A=-1;A:do{if((0|n[s>>2])<=2&&(0|n[l+8>>2])<=2&&(0|n[l+12>>2])<=2){if(e=0|rt(0|(o=0|O(l)),0,45),e|=A,A=B()|-1040385&r,a=0|U(l),!(0|z(o))){if((0|a)<=0)break;for(i=0;;){if(o=0|tt(0|e,0|A,52),B(),o&=15)for(r=1;l=0|tt(0|e,0|A,0|(u=3*(15-r|0)|0)),B(),c=0|rt(7,0,0|u),A&=~B(),e=e&~c|(u=0|rt(0|xA(7&l),0,0|u)),A=0|A|B(),r>>>0>>0;)r=r+1|0;if((0|(i=i+1|0))==(0|a))break A}}i=0|tt(0|e,0|A,52),B(),i&=15;e:do{if(i){r=1;t:for(;;){switch(u=0|tt(0|e,0|A,3*(15-r|0)|0),B(),7&u){case 1:break t;case 0:break;default:break e}if(!(r>>>0>>0))break e;r=r+1|0}if(0|Y(o,0|n[l>>2]))for(r=1;c=0|rt(7,0,0|(l=3*(15-r|0)|0)),u=A&~B(),A=0|tt(0|e,0|A,0|l),B(),e=e&~c|(A=0|rt(0|vA(7&A),0,0|l)),A=0|u|B(),r>>>0>>0;)r=r+1|0;else for(r=1;l=0|tt(0|e,0|A,0|(u=3*(15-r|0)|0)),B(),c=0|rt(7,0,0|u),A&=~B(),e=e&~c|(u=0|rt(0|xA(7&l),0,0|u)),A=0|A|B(),r>>>0>>0;)r=r+1|0}}while(0);if((0|a)>0){r=0;do{e=0|UA(e,A),A=0|B(),r=r+1|0}while((0|r)!=(0|a))}}else e=0,A=0}while(0);return u=e,C(0|(c=A)),P=t,0|u}(i,e),i=0|B(),n[t>>2]=e,n[t+4>>2]=i,!(0|e)&!(0|i)&&M(27795,27122,1050,27145),P=r,0|(i=0)):(P=r,0|(i=3))}function JA(A,e,t){var r,o=0,i=0,a=0;if(r=4+(t|=0)|0,i=0|tt(0|(A|=0),0|(e|=0),52),B(),i&=15,a=0|tt(0|A,0|e,45),B(),o=!(0|i),0|z(127&a)){if(o)return 1;o=1}else{if(o)return 0;o=0|n[r>>2]||0|n[t+8>>2]?1:1&!!(0|n[t+12>>2])}for(t=1;1&t?gA(r):hA(r),a=0|tt(0|A,0|e,3*(15-t|0)|0),B(),mA(r,7&a),t>>>0>>0;)t=t+1|0;return 0|o}function XA(A,e,t){t|=0;var r,o,i=0,a=0,s=0,l=0,c=0,u=0;if(o=P,P=P+16|0,r=o,u=0|tt(0|(A|=0),0|(e|=0),45),B(),(u&=127)>>>0>121)return n[t>>2]=0,n[t+4>>2]=0,n[t+8>>2]=0,n[t+12>>2]=0,P=o,5;A:do{if(0|z(u)&&(s=0|tt(0|A,0|e,52),B(),0|(s&=15))){i=1;e:for(;;){switch(c=0|tt(0|A,0|e,3*(15-i|0)|0),B(),7&c){case 5:break e;case 0:break;default:i=e;break A}if(!(i>>>0>>0)){i=e;break A}i=i+1|0}for(a=1,i=e;l=0|rt(7,0,0|(e=3*(15-a|0)|0)),c=i&~B(),i=0|tt(0|A,0|i,0|e),B(),A=A&~l|(i=0|rt(0|vA(7&i),0,0|e)),i=0|c|B(),a>>>0>>0;)a=a+1|0}else i=e}while(0);if(c=7696+(28*u|0)|0,n[t>>2]=n[c>>2],n[t+4>>2]=n[c+4>>2],n[t+8>>2]=n[c+8>>2],n[t+12>>2]=n[c+12>>2],!(0|JA(A,i,t)))return P=o,0;if(l=t+4|0,n[r>>2]=n[l>>2],n[r+4>>2]=n[l+4>>2],n[r+8>>2]=n[l+8>>2],s=0|tt(0|A,0|i,52),B(),c=15&s,1&s?(hA(l),s=c+1|0):s=c,0|z(u)){A:do{if(c)for(e=1;;){if(a=0|tt(0|A,0|i,3*(15-e|0)|0),B(),0|(a&=7)){i=a;break A}if(!(e>>>0>>0)){i=0;break}e=e+1|0}else i=0}while(0);i=4==(0|i)&1}else i=0;if(0|jA(t,s,i,0)){if(0|z(u))do{}while(0|jA(t,s,0,0));(0|s)!=(0|c)&&fA(l)}else(0|s)!=(0|c)&&(n[l>>2]=n[r>>2],n[l+4>>2]=n[r+4>>2],n[l+8>>2]=n[r+8>>2]);return P=o,0}function qA(A,e,t){t|=0;var r,o,i=0;return o=P,P=P+16|0,0|(i=0|XA(A|=0,e|=0,r=o))?(P=o,0|i):(i=0|tt(0|A,0|e,52),B(),function(A,e,t){var r,o;e|=0,t|=0,r=P,P=P+16|0,oA(4+(A|=0)|0,o=r),EA(o,0|n[A>>2],e,0,t),P=r}(r,15&i,t),P=o,0|(i=0))}function $A(A,e,t){t|=0;var r,n=0,o=0,i=0;if(r=P,P=P+16|0,0|(n=0|XA(A|=0,e|=0,i=r)))return P=r,0|n;n=0|tt(0|A,0|e,45),B(),n=!(0|z(127&n)),o=0|tt(0|A,0|e,52),B(),o&=15;A:do{if(!n){if(0|o)for(n=1;;){if(!(!((0|rt(7,0,3*(15-n|0)|0))&A)&!((0|B())&e)))break A;if(!(n>>>0>>0))break;n=n+1|0}return NA(i,o,0,5,t),P=r,0}}while(0);return FA(i,o,0,6,t),P=r,0}function Ae(A,e){e|=0;var t=0,r=0,o=0,i=0,a=0,s=0,l=0;if((A|=0)>>>0>15)return 4;if(rt(0|A,0,52),s=134225919|B(),!A){t=0,r=0;do{0|z(r)&&(rt(0|r,0,45),a=0|s|B(),n[(A=e+(t<<3)|0)>>2]=-1,n[A+4>>2]=a,t=t+1|0),r=r+1|0}while(122!=(0|r));return 0}t=0,a=0;do{if(0|z(a)){for(rt(0|a,0,45),r=1,o=-1,i=0|s|B();o&=~(l=0|rt(7,0,3*(15-r|0)|0)),i&=~B(),(0|r)!=(0|A);)r=r+1|0;n[(l=e+(t<<3)|0)>>2]=o,n[l+4>>2]=i,t=t+1|0}a=a+1|0}while(122!=(0|a));return 0}function ee(A,e,t,r){A|=0,r|=0;var o=0,i=0,a=0;o=0|tt(0|(e|=0),0|(t|=0),52),B(),!(0|e)&!(0|t)|(0|r)>15|(0|(o&=15))>(0|r)?(i=-1,e=-1,t=0,o=0):(e=0|zA(e,t,o+1|0,r),a=-15728641&B(),t=0|rt(0|r,0,52),i=o,e=(e=!(0|HA(t|=e,a=0|a|B())))?-1:r,o=a),n[(a=A)>>2]=t,n[a+4>>2]=o,n[A+8>>2]=i,n[A+12>>2]=e}function te(A,e,t,r){t|=0,r|=0;var o=0,i=0;return o=0|tt(0|(A|=0),0|(e|=0),52),B(),o&=15,n[(i=r+8|0)>>2]=o,!(0|A)&!(0|e)|(0|t)>15|(0|o)>(0|t)?(n[(t=r)>>2]=0,n[t+4>>2]=0,n[i>>2]=-1,void(n[r+12>>2]=-1)):(A=0|zA(A,e,o+1|0,t),i=-15728641&B(),o=0|rt(0|t,0,52),o|=A,i=0|i|B(),n[(A=r)>>2]=o,n[A+4>>2]=i,A=r+12|0,0|HA(o,i)?void(n[A>>2]=t):void(n[A>>2]=-1))}function re(A){var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0,c=0;if(!(!(0|(t=0|n[(r=A|=0)>>2]))&!(0|(r=0|n[r+4>>2]))||(o=0|tt(0|t,0|r,52),B(),t=0|Ze(0|(l=0|rt(1,0,3*(15^(o&=15))|0)),0|B(),0|t,0|r),r=0|B(),n[(l=A)>>2]=t,n[l+4>>2]=r,(0|o)<(0|(s=0|n[(l=A+8|0)>>2]))))){for(e=A+12|0,a=o;;){if((0|a)==(0|s)){o=5;break}if(c=(0|a)==(0|n[e>>2]),o=0|tt(0|t,0|r,0|(i=3*(15-a|0)|0)),B(),c&1==(0|(o&=7))&!0){o=7;break}if(!(7==(0|o)&!0)){o=10;break}if(t=0|Ze(0|t,0|r,0|(c=0|rt(1,0,0|i)),0|B()),r=0|B(),n[(c=A)>>2]=t,n[c+4>>2]=r,!((0|a)>(0|s))){o=10;break}a=a+-1|0}if(5==(0|o))return n[(c=A)>>2]=0,n[c+4>>2]=0,n[l>>2]=-1,void(n[e>>2]=-1);if(7==(0|o))return s=0|Ze(0|t,0|r,0|(s=0|rt(1,0,0|i)),0|B()),l=0|B(),n[(c=A)>>2]=s,n[c+4>>2]=l,void(n[e>>2]=a+-1)}}function ne(A){var e;return e=(A=+A)<0?A+6.283185307179586:A,+(A>=6.283185307179586?e+-6.283185307179586:e)}function oe(A,e){return e|=0,+l(+(+o[(A|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+l(+(+o[A+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function ie(A,e){switch(A=+A,0|(e|=0)){case 1:A=A<0?A+6.283185307179586:A;break;case 2:A=A>0?A+-6.283185307179586:A}return+A}function ae(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))*6371.007180918475}function se(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20656+(A<<3)>>3],0|(e=0))}function le(A,e){e|=0;var t=0;return(A|=0)>>>0>15?0|(e=4):(t=0|qe(0|(t=0|pe(7,0,A,((0|A)<0)<<31>>31)),0|B(),120,0),A=0|B(),n[e>>2]=2|t,n[e+4>>2]=A,0|(e=0))}function ce(A,e,t){A|=0,t|=0;var r,n,i,a,s=0,l=0,u=0,h=0,m=0,x=0;return x=+o[(e|=0)>>3],i=+o[A>>3],m=+f(.5*(x-i)),u=+o[e+8>>3],n=+o[A+8>>3],h=+f(.5*(u-n)),r=+d(+i),a=+d(+x),h=2*+p(+ +c(+(h=m*m+h*(a*r*h))),+ +c(+(1-h))),m=+o[t>>3],x=+f(.5*(m-x)),s=+o[t+8>>3],u=+f(.5*(s-u)),l=+d(+m),u=2*+p(+ +c(+(u=x*x+u*(a*l*u))),+ +c(+(1-u))),m=+f(.5*(i-m)),s=+f(.5*(n-s)),s=2*+p(+ +c(+(s=m*m+s*(r*l*s))),+ +c(+(1-s))),4*+b(+ +c(+ +g(.5*(l=.5*(h+u+s)))*+g(.5*(l-h))*+g(.5*(l-u))*+g(.5*(l-s))))}function ue(A,e,t){t|=0;var r,i,a,s=0,l=0;if(a=P,P=P+192|0,i=a,0|(l=0|qA(A|=0,e|=0,r=a+168|0)))return P=a,0|l;if(0|$A(A,e,i)&&M(27795,27190,415,27199),(0|(e=0|n[i>>2]))>0){if(s=+ce(i+8|0,i+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){A=1;do{s+=+ce(i+8+((l=A)<<4)|0,i+8+((0|(A=A+1|0))%(0|e)<<4)|0,r)}while((0|A)<(0|e))}}else s=0;return o[t>>3]=s,P=a,0}function de(A){A|=0;var e,t,r=0;return(e=0|We(1,12))||M(27280,27235,49,27293),0|(r=0|n[(t=A+4|0)>>2])?(n[(r=r+8|0)>>2]=e,n[t>>2]=e,0|e):(0|n[A>>2]&&M(27310,27235,61,27333),n[(r=A)>>2]=e,n[t>>2]=e,0|e)}function fe(A,e){var t,r;return A|=0,e|=0,(r=0|Ue(24))||M(27347,27235,78,27361),n[r>>2]=n[e>>2],n[r+4>>2]=n[e+4>>2],n[r+8>>2]=n[e+8>>2],n[r+12>>2]=n[e+12>>2],n[r+16>>2]=0,0|(t=0|n[(e=A+4|0)>>2])?(n[t+16>>2]=r,n[e>>2]=r,0|r):(0|n[A>>2]&&M(27376,27235,82,27361),n[A>>2]=r,n[e>>2]=r,0|r)}function ge(A){var e=0,t=0,r=0,o=0;if(A|=0)for(r=1;;){if(0|(e=0|n[A>>2]))do{if(0|(t=0|n[e>>2]))do{o=t,t=0|n[t+16>>2],Ye(o)}while(0|t);o=e,e=0|n[e+8>>2],Ye(o)}while(0|e);if(e=A,A=0|n[A+8>>2],r||Ye(e),!A)break;r=0}}function he(A,e,t){A|=0;var r=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0;if(!(0|X(e|=0,t|=0)))return 0;if(e=0|K(e),r=+o[t>>3],i=e&(i=+o[t+8>>3])<0?i+6.283185307179586:i,!(A=0|n[A>>2]))return 0;if(e){e=0,u=i,t=A;A:for(;;){for(;s=+o[t>>3],i=+o[t+8>>3],d=0|n[(t=t+16|0)>>2],a=+o[(d=0|d?d:A)>>3],l=+o[d+8>>3],s>a?(c=s,s=l):(c=a,a=s,s=i,i=l),(r=r==a|r==c?r+2220446049250313e-31:r)c;)if(!(t=0|n[t>>2])){t=22;break A}if(((c=(l=s<0?s+6.283185307179586:s)+(r-a)/(c-a)*((s=i<0?i+6.283185307179586:i)-l))<0?c+6.283185307179586:c)>(u=l==u|s==u?u+-2220446049250313e-31:u)&&(e^=1),!(t=0|n[t>>2])){t=22;break}}if(22==(0|t))return 0|e}else{e=0,u=i,t=A;A:for(;;){for(;s=+o[t>>3],i=+o[t+8>>3],d=0|n[(t=t+16|0)>>2],a=+o[(d=0|d?d:A)>>3],l=+o[d+8>>3],s>a?(c=s,s=l):(c=a,a=s,s=i,i=l),(r=r==a|r==c?r+2220446049250313e-31:r)c;)if(!(t=0|n[t>>2])){t=22;break A}if(s+(r-a)/(c-a)*(i-s)>(u=s==u|i==u?u+-2220446049250313e-31:u)&&(e^=1),!(t=0|n[t>>2])){t=22;break}}if(22==(0|t))return 0|e}return 0}function me(A,e,t,o,i){t|=0,o|=0,i|=0;var a,s,l,c,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(c=P,P=P+32|0,v=c+16|0,l=c,u=0|tt(0|(A|=0),0|(e|=0),52),B(),u&=15,b=0|tt(0|t,0|o,52),B(),(0|u)!=(15&b))return P=c,12;if(h=0|tt(0|A,0|e,45),B(),h&=127,m=0|tt(0|t,0|o,45),B(),h>>>0>121|(m&=127)>>>0>121)return P=c,5;if(b=(0|h)!=(0|m)){if(7==(0|(f=0|Z(h,m))))return P=c,1;7==(0|(g=0|Z(m,h)))?M(27514,27538,161,27548):(p=f,d=g)}else p=0,d=0;a=0|z(h),s=0|z(m),n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,n[v+12>>2]=0;do{if(p){if(f=(0|(m=0|n[4272+(28*h|0)+(p<<2)>>2]))>0,s)if(f){h=0,g=t,f=o;do{g=0|WA(g,f),f=0|B(),1==(0|(d=0|vA(d)))&&(d=0|vA(1)),h=h+1|0}while((0|h)!=(0|m));m=d,h=g,g=f}else m=d,h=t,g=o;else if(f){h=0,g=t,f=o;do{g=0|ZA(g,f),f=0|B(),d=0|vA(d),h=h+1|0}while((0|h)!=(0|m));m=d,h=g,g=f}else m=d,h=t,g=o;if(JA(h,g,v),b||M(27563,27538,191,27548),(f=!!(0|a))&(d=!!(0|s))&&M(27590,27538,192,27548),f){if(7==(0|(d=0|OA(A,e)))){u=5;break}if(0|r[22e3+(7*d|0)+p|0]){u=1;break}h=g=0|n[21168+(28*d|0)+(p<<2)>>2]}else if(d){if(7==(0|(d=0|OA(h,g)))){u=5;break}if(0|r[22e3+(7*d|0)+m|0]){u=1;break}h=0,g=0|n[21168+(28*m|0)+(d<<2)>>2]}else h=0,g=0;if((h|g|0)<0)u=5;else{if((0|g)>0){f=v+4|0,d=0;do{pA(f),d=d+1|0}while((0|d)!=(0|g))}if(n[l>>2]=0,n[l+4>>2]=0,n[l+8>>2]=0,mA(l,p),0|u)for(;0|VA(u)?gA(l):hA(l),(0|u)>1;)u=u+-1|0;if((0|h)>0){u=0;do{pA(l),u=u+1|0}while((0|u)!=(0|h))}iA(x=v+4|0,l,x),nA(x),x=51}}else if(JA(t,o,v),!!(0|a)&!!(0|s))if((0|m)!=(0|h)&&M(27621,27538,261,27548),7==(0|(d=0|OA(A,e)))|7==(0|(u=0|OA(t,o))))u=5;else if(0|r[22e3+(7*d|0)+u|0])u=1;else if((0|(d=0|n[21168+(28*d|0)+(u<<2)>>2]))>0){f=v+4|0,u=0;do{pA(f),u=u+1|0}while((0|u)!=(0|d));x=51}else x=51;else x=51}while(0);return 51==(0|x)&&(u=v+4|0,n[i>>2]=n[u>>2],n[i+4>>2]=n[u+4>>2],n[i+8>>2]=n[u+8>>2],u=0),P=c,0|u}function be(A,e,t,r){t|=0,r|=0;var o,i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(a=P,P=P+48|0,o=a+36|0,c=a+24|0,u=a+12|0,d=a,s=0|tt(0|(A|=0),0|(e|=0),52),B(),s&=15,g=0|tt(0|A,0|e,45),B(),(g&=127)>>>0>121)return P=a,5;if(i=0|z(g),rt(0|s,0,52),b=134225919|B(),n[(l=r)>>2]=-1,n[l+4>>2]=b,!s)return 7==(0|(s=0|lA(t)))||127==(0|(s=0|W(g,s)))?(P=a,0|(b=1)):(h=0|rt(0|s,0,45),m=0|B(),m=-1040385&n[(g=r)+4>>2]|m,n[(b=r)>>2]=n[g>>2]|h,n[b+4>>2]=m,P=a,0|(b=0));for(n[o>>2]=n[t>>2],n[o+4>>2]=n[t+4>>2],n[o+8>>2]=n[t+8>>2],t=s;;){if(l=t,t=t+-1|0,n[c>>2]=n[o>>2],n[c+4>>2]=n[o+4>>2],n[c+8>>2]=n[o+8>>2],0|VA(l)){if(0|(s=0|cA(o))){t=13;break}n[u>>2]=n[o>>2],n[u+4>>2]=n[o+4>>2],n[u+8>>2]=n[o+8>>2],gA(u)}else{if(0|(s=0|uA(o))){t=13;break}n[u>>2]=n[o>>2],n[u+4>>2]=n[o+4>>2],n[u+8>>2]=n[o+8>>2],hA(u)}if(aA(c,u,d),nA(d),x=0|n[(s=r)>>2],s=0|n[s+4>>2],p=0|rt(7,0,0|(v=3*(15-l|0)|0)),s&=~B(),v=0|rt(0|lA(d),0,0|v),s=0|B()|s,n[(b=r)>>2]=v|x&~p,n[b+4>>2]=s,(0|l)<=1){t=14;break}}A:do{if(13!=(0|t)&&14==(0|t))if((0|n[o>>2])<=1&&(0|n[o+4>>2])<=1&&(0|n[o+8>>2])<=1){d=127==(0|(s=0|W(g,t=0|lA(o))))?0:0|z(s);e:do{if(t){if(i){if(7==(0|(s=0|OA(A,e)))){s=5;break A}if((0|(l=0|n[21376+(28*s|0)+(t<<2)>>2]))>0){s=t,t=0;do{s=0|xA(s),t=t+1|0}while((0|t)!=(0|l))}else s=t;if(1==(0|s)){s=9;break A}127==(0|(t=0|W(g,s)))&&M(27648,27538,411,27678),0|z(t)?M(27693,27538,412,27678):(m=t,h=l,f=s)}else m=s,h=0,f=t;if((0|(u=0|n[4272+(28*g|0)+(f<<2)>>2]))<=-1&&M(27724,27538,419,27678),!d){if((0|h)<0){s=5;break A}if(0|h){s=0,t=0|n[(l=r)>>2],l=0|n[l+4>>2];do{t=0|YA(t,l),l=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=l,s=s+1|0}while((0|s)<(0|h))}if((0|u)<=0){s=m,t=58;break}for(s=0,t=0|n[(l=r)>>2],l=0|n[l+4>>2];;)if(t=0|YA(t,l),l=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=l,(0|(s=s+1|0))==(0|u)){s=m,t=58;break e}}if(7==(0|(c=0|Z(m,g)))&&M(27514,27538,428,27678),t=0|n[(s=r)>>2],s=0|n[s+4>>2],(0|u)>0){l=0;do{t=0|YA(t,s),s=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=s,l=l+1|0}while((0|l)!=(0|u))}if(7==(0|(s=0|OA(t,s)))&&M(27795,27538,440,27678),t=0|G(m),(0|(t=0|n[(t?21792:21584)+(28*c|0)+(s<<2)>>2]))<0&&M(27795,27538,454,27678),t){s=0,l=0|n[(c=r)>>2],c=0|n[c+4>>2];do{l=0|UA(l,c),c=0|B(),n[(v=r)>>2]=l,n[v+4>>2]=c,s=s+1|0}while((0|s)<(0|t));s=m,t=58}else s=m,t=58}else if(!!(0|i)&!!(0|d)){if(7==(0|(t=0|OA(A,e)))|7==(0|(l=0|OA(0|n[(l=r)>>2],0|n[l+4>>2])))){s=5;break A}if((0|(l=0|n[21376+(28*t|0)+(l<<2)>>2]))<0){s=5;break A}if(l){t=0,c=0|n[(u=r)>>2],u=0|n[u+4>>2];do{c=0|YA(c,u),u=0|B(),n[(v=r)>>2]=c,n[v+4>>2]=u,t=t+1|0}while((0|t)<(0|l));t=58}else t=59}else t=58}while(0);if(58==(0|t)&&d&&(t=59),59==(0|t)&&1==(0|OA(0|n[(v=r)>>2],0|n[v+4>>2]))){s=9;break}p=0|n[(v=r)>>2],v=-1040385&n[v+4>>2],x=0|rt(0|s,0,45),v=0|v|B(),n[(s=r)>>2]=p|x,n[s+4>>2]=v,s=0}else s=1}while(0);return P=a,0|s}function pe(A,e,t,r){A|=0,e|=0;var n=0,o=0,i=0;if(!(0|(t|=0))&!(0|(r|=0)))return o=1,C(0|(n=0)),0|o;o=A,n=e,A=1,e=0;do{A=0|qe(0|((i=!0&!(1&t))?1:o),0|(i?0:n),0|A,0|e),e=0|B(),t=0|et(0|t,0|r,1),r=0|B(),o=0|qe(0|o,0|n,0|o,0|n),n=0|B()}while(!(!(0|t)&!(0|r)));return C(0|e),0|A}function xe(A,e,t,r){t|=0,r|=0;var i,a=0,s=0,l=0,c=0,u=0,f=0;i=P,P=P+16|0,s=i,l=0|tt(0|(A|=0),0|(e|=0),52),B(),l&=15;do{if(l){if(!(a=0|qA(A,e,s))){u=+o[s>>3],c=1/+d(+u),f=+o[25968+(l<<3)>>3],o[t>>3]=u+f,o[t+8>>3]=u-f,u=+o[s+8>>3],c*=f,o[t+16>>3]=c+u,o[t+24>>3]=u-c;break}return P=i,0|a}if(a=0|tt(0|A,0|e,45),B(),(a&=127)>>>0>121)return P=i,5;s=22064+(a<<5)|0,n[t>>2]=n[s>>2],n[t+4>>2]=n[s+4>>2],n[t+8>>2]=n[s+8>>2],n[t+12>>2]=n[s+12>>2],n[t+16>>2]=n[s+16>>2],n[t+20>>2]=n[s+20>>2],n[t+24>>2]=n[s+24>>2],n[t+28>>2]=n[s+28>>2];break}while(0);return function(A,e){e=+e;var t,r,n,i,a,s,l,c=0,u=0;c=(i=+o[(n=16+(A|=0)|0)>>3])-(r=+o[(t=A+24|0)>>3]),c=i>3],c=.5*(c*e-c),u+=e=.5*((l=u-(s=+o[(a=A+8|0)>>3]))*e-l),o[A>>3]=u>1.5707963267948966?1.5707963267948966:u,e=s-e,o[a>>3]=e<-1.5707963267948966?-1.5707963267948966:e,e=(e=i+c)>3.141592653589793?e+-6.283185307179586:e,o[n>>3]=e<-3.141592653589793?e+6.283185307179586:e,e=(e=r-c)>3.141592653589793?e+-6.283185307179586:e,o[t>>3]=e<-3.141592653589793?e+6.283185307179586:e}(t,r?1.4:1.1),(0|n[(r=26096+(l<<3)|0)>>2])==(0|A)&&(0|n[r+4>>2])==(0|e)&&(o[t>>3]=1.5707963267948966),(0|n[(l=26224+(l<<3)|0)>>2])==(0|A)&&(0|n[l+4>>2])==(0|e)&&(o[t+8>>3]=-1.5707963267948966),1.5707963267948966!=+o[t>>3]&&-1.5707963267948966!=+o[t+8>>3]?(P=i,0|(l=0)):(o[t+16>>3]=3.141592653589793,o[t+24>>3]=-3.141592653589793,P=i,0|(l=0))}function ve(A){var e,t,o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0;if(i=P,P=P+336|0,e=i+168|0,t=i,!(0|(s=0|n[(l=A|=0)>>2]))&!(0|(l=0|n[l+4>>2])))P=i;else{if(0|r[0|(a=A+28|0)]?(s=0|we(s,l),l=0|B()):r[0|a]=1,!(0|n[n[(o=A+20|0)>>2]>>2]))return 0|(s=0|n[(a=A+24|0)>>2])&&Ye(s),n[(y=A)>>2]=0,n[y+4>>2]=0,n[A+8>>2]=0,n[o>>2]=0,n[A+12>>2]=-1,n[A+16>>2]=0,n[a>>2]=0,void(P=i);c=15&(a=0|n[(y=A+16|0)>>2]);A:do{if(!(0|s)&!(0|l))w=A+24|0;else{x=A+12|0,b=3==(0|c),m=255&a,g=3==(1|c),p=A+24|0,h=(c+-1|0)>>>0<3,d=3==(2|c),f=t+8|0;e:for(;;){if(u=0|tt(0|s,0|l,52),B(),(0|(u&=15))==(0|n[x>>2])){switch(15&m){case 0:case 2:case 3:if(0|(c=0|qA(s,l,e))){v=15;break e}if(0|Me(0|n[o>>2],0|n[p>>2],e)){v=19;break e}}if(g&&(c=0|n[4+(0|n[o>>2])>>2],n[e>>2]=n[c>>2],n[e+4>>2]=n[c+4>>2],n[e+8>>2]=n[c+8>>2],n[e+12>>2]=n[c+12>>2],0|X(26832,e))){if(0|KA(0|n[4+(0|n[o>>2])>>2],u,t)){v=25;break}if((0|n[(c=t)>>2])==(0|s)&&(0|n[c+4>>2])==(0|l)){v=29;break}}if(h){if(0|(c=0|$A(s,l,e))){v=32;break}if(0|xe(s,l,t,0)){v=36;break}if(d&&0|De(0|n[o>>2],0|n[p>>2],e,t)){v=42;break}if(g&&0|Ne(0|n[o>>2],0|n[p>>2],e,t)){v=42;break}}if(b){if(a=0|xe(s,l,e,1),c=0|n[p>>2],0|a){v=45;break}if(0|q(c,e)){if(AA(t,e),0|$(e,0|n[p>>2])){v=53;break}if(0|Me(0|n[o>>2],0|n[p>>2],f)){v=53;break}if(0|Ne(0|n[o>>2],0|n[p>>2],t,e)){v=53;break}}}}do{if((0|u)<(0|n[x>>2])){if(a=0|xe(s,l,e,1),c=0|n[p>>2],0|a){v=58;break e}if(!(0|q(c,e))){v=73;break}if(0|$(0|n[p>>2],e)&&(AA(t,e),0|De(0|n[o>>2],0|n[p>>2],t,e))){v=65;break e}if(0|(s=0|GA(s,l,u+1|0,t))){v=67;break e}s=0|n[(l=t)>>2],l=0|n[l+4>>2]}else v=73}while(0);if(73==(0|v)&&(v=0,s=0|we(s,l),l=0|B()),!(0|s)&!(0|l)){w=p;break A}}switch(0|v){case 15:0|(a=0|n[p>>2])&&Ye(a),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=c,v=20;break;case 19:n[A>>2]=s,n[A+4>>2]=l,v=20;break;case 25:M(27795,27761,470,27772);break;case 29:case 42:return n[A>>2]=s,n[A+4>>2]=l,void(P=i);case 32:return 0|(a=0|n[p>>2])&&Ye(a),n[(w=A)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=c,void(P=i);case 36:M(27795,27761,493,27772);break;case 45:0|c&&Ye(c),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=a,v=55;break;case 53:n[A>>2]=s,n[A+4>>2]=l,v=55;break;case 58:0|c&&Ye(c),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=a,v=71;break;case 65:n[A>>2]=s,n[A+4>>2]=l,v=71;break;case 67:return 0|(a=0|n[p>>2])&&Ye(a),n[(w=A)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=s,void(P=i)}if(20==(0|v))return void(P=i);if(55==(0|v))return void(P=i);if(71==(0|v))return void(P=i)}}while(0);0|(a=0|n[w>>2])&&Ye(a),n[(v=A)>>2]=0,n[v+4>>2]=0,n[A+8>>2]=0,n[o>>2]=0,n[A+12>>2]=-1,n[y>>2]=0,n[w>>2]=0,P=i}}function we(A,e){var t,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0;t=P,P=P+16|0,d=t,o=0|tt(0|(A|=0),0|(e|=0),52),B(),o&=15,r=0|tt(0|A,0|e,45),B();do{if(o){for(;r=0|rt(o+4095|0,0,52),i=B()|-15728641&e,r=r|A|(s=0|rt(7,0,0|(a=3*(15-o|0)|0))),i|=l=0|B(),c=0|tt(0|A,0|e,0|a),B(),o=o+-1|0,!((c&=7)>>>0<6);){if(!o){u=4;break}e=i,A=r}if(4==(0|u)){r=0|tt(0|r,0|i,45),B();break}return d=0|rt(((d=!(0|c)&!!(0|HA(r,i)))?2:1)+c|0,0,0|a),u=0|B()|e&~l,d|=A&~s,C(0|u),P=t,0|d}}while(0);return(r&=127)>>>0>120?(d=0,C(0|(u=0)),P=t,0|d):(RA(d,0,r+1|0,0),u=0|n[d+4>>2],d=0|n[d>>2],C(0|u),P=t,0|d)}function ye(A,e,t){A|=0;var r,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0;if(!(0|X(e|=0,t|=0)))return 0;if(e=0|K(e),i=+o[t>>3],a=e&(a=+o[t+8>>3])<0?a+6.283185307179586:a,(0|(g=0|n[A>>2]))<=0)return 0;if(r=0|n[A+4>>2],e){e=0,f=a,t=-1,A=0;A:for(;;){for(d=A;l=+o[r+(d<<4)>>3],a=+o[r+(d<<4)+8>>3],s=+o[r+((A=(t+2|0)%(0|g)|0)<<4)>>3],c=+o[r+(A<<4)+8>>3],l>s?(u=l,l=c):(u=s,s=l,l=a,a=c),(i=i==s|i==u?i+2220446049250313e-31:i)u;){if((0|(t=d+1|0))>=(0|g)){t=22;break A}A=d,d=t,t=A}if(((u=(c=l<0?l+6.283185307179586:l)+(i-s)/(u-s)*((l=a<0?a+6.283185307179586:a)-c))<0?u+6.283185307179586:u)>(f=c==f|l==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(A=d+1|0))>=(0|g)){t=22;break}t=d}if(22==(0|t))return 0|e}else{e=0,f=a,t=-1,A=0;A:for(;;){for(d=A;l=+o[r+(d<<4)>>3],a=+o[r+(d<<4)+8>>3],s=+o[r+((A=(t+2|0)%(0|g)|0)<<4)>>3],c=+o[r+(A<<4)+8>>3],l>s?(u=l,l=c):(u=s,s=l,l=a,a=c),(i=i==s|i==u?i+2220446049250313e-31:i)u;){if((0|(t=d+1|0))>=(0|g)){t=22;break A}A=d,d=t,t=A}if(l+(i-s)/(u-s)*(a-l)>(f=l==f|a==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(A=d+1|0))>=(0|g)){t=22;break}t=d}if(22==(0|t))return 0|e}return 0}function ke(A,e){e|=0;var t,r,i,a,s,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0;if(!(r=0|n[(A|=0)>>2]))return n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,void(n[e+28>>2]=0);if(o[(i=e+8|0)>>3]=17976931348623157e292,o[(a=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(s=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(t=0|n[A+4>>2],b=17976931348623157e292,p=-17976931348623157e292,x=0,A=-1,f=17976931348623157e292,g=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,v=0;c=+o[t+(v<<4)>>3],h=+o[t+(v<<4)+8>>3],d=+o[t+(((0|(A=A+2|0))==(0|r)?0:A)<<4)+8>>3],c>3]=c,f=c),h>3]=h,g=h),c>m?o[e>>3]=c:c=m,h>u&&(o[s>>3]=h,u=h),b=h>0&hp?h:p,x|=+l(+(h-d))>3.141592653589793,(0|(A=v+1|0))!=(0|r);)w=v,m=c,v=A,A=w;x&&(o[s>>3]=p,o[a>>3]=b)}}function Ce(A){return 0|((A|=0)>>>0<4?0:15)}function Be(A,e){e|=0;var t,r=0,i=0,a=0,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,M=0;if(p=0|n[(A|=0)>>2]){if(o[(x=e+8|0)>>3]=17976931348623157e292,o[(v=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(w=e+16|0)>>3]=-17976931348623157e292,(0|p)>0){for(a=0|n[A+4>>2],m=17976931348623157e292,b=-17976931348623157e292,i=0,r=-1,d=17976931348623157e292,f=17976931348623157e292,h=-17976931348623157e292,c=-17976931348623157e292,y=0;s=+o[a+(y<<4)>>3],g=+o[a+(y<<4)+8>>3],u=+o[a+(((0|(B=r+2|0))==(0|p)?0:B)<<4)+8>>3],s>3]=s,d=s),g>3]=g,f=g),s>h?o[e>>3]=s:s=h,g>c&&(o[w>>3]=g,c=g),m=g>0&gb?g:b,i|=+l(+(g-u))>3.141592653589793,(0|(r=y+1|0))!=(0|p);)B=y,h=s,y=r,r=B;i&&(o[w>>3]=b,o[v>>3]=m)}}else n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,n[e+28>>2]=0;if(!((0|(r=0|n[(B=A+8|0)>>2]))<=0)){t=A+12|0,C=0;do{if(a=0|n[t>>2],i=C,v=e+((C=C+1|0)<<5)|0,w=0|n[a+(i<<3)>>2]){if(o[(y=e+(C<<5)+8|0)>>3]=17976931348623157e292,o[(A=e+(C<<5)+24|0)>>3]=17976931348623157e292,o[v>>3]=-17976931348623157e292,o[(k=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|w)>0){for(p=0|n[a+(i<<3)+4>>2],m=17976931348623157e292,b=-17976931348623157e292,a=0,i=-1,x=0,d=17976931348623157e292,f=17976931348623157e292,g=-17976931348623157e292,c=-17976931348623157e292;s=+o[p+(x<<4)>>3],h=+o[p+(x<<4)+8>>3],u=+o[p+(((0|(i=i+2|0))==(0|w)?0:i)<<4)+8>>3],s>3]=s,d=s),h>3]=h,f=h),s>g?o[v>>3]=s:s=g,h>c&&(o[k>>3]=h,c=h),m=h>0&hb?h:b,a|=+l(+(h-u))>3.141592653589793,(0|(i=x+1|0))!=(0|w);)M=x,x=i,g=s,i=M;a&&(o[k>>3]=b,o[A>>3]=m)}}else n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,n[v+12>>2]=0,n[v+16>>2]=0,n[v+20>>2]=0,n[v+24>>2]=0,n[v+28>>2]=0,r=0|n[B>>2]}while((0|C)<(0|r))}}function Me(A,e,t){var r=0,o=0,i=0;if(!(0|ye(A|=0,e|=0,t|=0)))return 0;if((0|n[(o=A+8|0)>>2])<=0)return 1;for(r=A+12|0,A=0;;){if(i=A,A=A+1|0,0|ye((0|n[r>>2])+(i<<3)|0,e+(A<<5)|0,t)){A=0,r=6;break}if((0|A)>=(0|n[o>>2])){A=1,r=6;break}}return 6==(0|r)?0|A:0}function De(A,e,t,r){r|=0;var o,i,a=0,s=0,l=0,c=0,u=0;if(i=P,P=P+16|0,o=i,!(0|ye(A|=0,e|=0,l=8+(t|=0)|0)))return P=i,0;c=A+8|0;A:do{if((0|n[c>>2])>0){for(s=A+12|0,a=0;;){if(u=a,a=a+1|0,0|ye((0|n[s>>2])+(u<<3)|0,e+(a<<5)|0,l)){a=0;break}if((0|a)>=(0|n[c>>2]))break A}return P=i,0|a}}while(0);if(0|Ee(A,e,t,r))return P=i,0;n[o>>2]=n[t>>2],n[o+4>>2]=l,a=0|n[c>>2];A:do{if((0|a)>0)for(A=A+12|0,l=0,s=a;;){if(a=0|n[A>>2],(0|n[a+(l<<3)>>2])>0){if(0|ye(o,r,0|n[a+(l<<3)+4>>2])){a=0;break A}if(a=l+1|0,0|Ee((0|n[A>>2])+(l<<3)|0,e+(a<<5)|0,t,r)){a=0;break A}s=0|n[c>>2]}else a=l+1|0;if(!((0|a)<(0|s))){a=1;break}l=a}else a=1}while(0);return P=i,0|a}function Ee(A,e,t,r){A|=0,t|=0;var i,a,s,l,c,u,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,M=0;if(u=P,P=P+176|0,l=u+172|0,d=u+168|0,c=u,!(0|q(e|=0,r|=0)))return P=u,0;if(function(A,e,t,r){var i,a,s,l,c;e|=0,t|=0,r|=0,A=(a=+o[16+(A|=0)>>3])<(c=+o[A+24>>3]),i=(l=+o[e+16>>3])<(s=+o[e+24>>3]),e=c-l>2]=A?i|e?1:2:0,n[r>>2]=i?A?1:e?2:1:0}(e,r,l,d),st(0|c,0|t,168),(0|n[t>>2])>0){e=0;do{y=+ie(+o[(B=c+8+(e<<4)+8|0)>>3],0|n[d>>2]),o[B>>3]=y,e=e+1|0}while((0|e)<(0|n[t>>2]))}a=+o[r>>3],s=+o[r+8>>3],y=+ie(+o[r+16>>3],0|n[d>>2]),i=+ie(+o[r+24>>3],0|n[d>>2]);A:do{if((0|n[A>>2])>0){if(r=A+4|0,(0|(d=0|n[c>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|n[A>>2])){e=0;break A}for(t=0;;){if(e=0|n[r>>2],v=+o[e+(t<<4)>>3],w=+ie(+o[e+(t<<4)+8>>3],0|n[l>>2]),e=0|n[r>>2],B=(0|(t=t+1|0))%(0|n[A>>2])|0,f=+o[e+(B<<4)>>3],g=+ie(+o[e+(B<<4)+8>>3],0|n[l>>2]),!(v>=a)|!(f>=a)&&!(v<=s)|!(f<=s)&&!(w<=i)|!(g<=i)&&!(w>=y)|!(g>=y)){x=f-v,b=g-w,e=0;do{if(M=e,B=(0|(e=e+1|0))==(0|d)?0:e,f=+o[c+8+(M<<4)+8>>3],g=+o[c+8+(B<<4)+8>>3]-f,h=+o[c+8+(M<<4)>>3],!(0==(p=x*g-b*(m=+o[c+8+(B<<4)>>3]-h))||(k=w-f,C=v-h,m=(k*m-g*C)/p,m<0|m>1))&&(p=(x*k-b*C)/p)>=0&p<=1){e=1;break A}}while((0|e)<(0|d))}if((0|t)>=(0|n[A>>2])){e=0;break}}}else e=0}while(0);return P=u,0|e}function Ne(A,e,t,r){var o=0,i=0,a=0;if(0|Ee(A|=0,e|=0,t|=0,r|=0))return 1;if((0|n[(i=A+8|0)>>2])<=0)return 0;for(o=A+12|0,A=0;;){if(a=A,A=A+1|0,0|Ee((0|n[o>>2])+(a<<3)|0,e+(A<<5)|0,t,r)){A=1,o=6;break}if((0|A)>=(0|n[i>>2])){A=0,o=6;break}}return 6==(0|o)?0|A:0}function Qe(A,e,t,r,n){e|=0,t|=0,r|=0,n|=0;var i,a,s,l,c,u,d,f=0;l=+o[(A|=0)>>3],s=+o[e>>3]-l,a=+o[A+8>>3],i=+o[e+8>>3]-a,u=+o[t>>3],f=((f=+o[r>>3]-u)*(a-(d=+o[t+8>>3]))-(l-u)*(c=+o[r+8>>3]-d))/(s*c-i*f),o[n>>3]=l+s*f,o[n+8>>3]=a+i*f}function je(A,e){return e|=0,+l(+(+o[(A|=0)>>3]-+o[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+o[A+8>>3]-+o[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function Pe(A,e){var t,r,n;return e|=0,+((n=+o[(A|=0)>>3]-+o[e>>3])*n+(r=+o[A+8>>3]-+o[e+8>>3])*r+(t=+o[A+16>>3]-+o[e+16>>3])*t)}function Fe(A,e,t){t|=0;var r,o,i,a,s=0,l=0,c=0,u=0;if(a=P,P=P+32|0,u=a,0|(s=0|XA(A|=0,e|=0,o=a+16|0)))return P=a,0|s;r=0|LA(A,e),i=0|OA(A,e),function(A,e){A=7696+(28*(A|=0)|0)|0,n[(e|=0)>>2]=n[A>>2],n[e+4>>2]=n[A+4>>2],n[e+8>>2]=n[A+8>>2],n[e+12>>2]=n[A+12>>2]}(r,u),s=0|function(A,e){A|=0;var t=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|n[11120+(216*e|0)>>2])!=(0|A))if((0|n[11120+(216*e|0)+8>>2])!=(0|A))if((0|n[11120+(216*e|0)+16>>2])!=(0|A))if((0|n[11120+(216*e|0)+24>>2])!=(0|A))if((0|n[11120+(216*e|0)+32>>2])!=(0|A))if((0|n[11120+(216*e|0)+40>>2])!=(0|A))if((0|n[11120+(216*e|0)+48>>2])!=(0|A))if((0|n[11120+(216*e|0)+56>>2])!=(0|A))if((0|n[11120+(216*e|0)+64>>2])!=(0|A))if((0|n[11120+(216*e|0)+72>>2])!=(0|A))if((0|n[11120+(216*e|0)+80>>2])!=(0|A))if((0|n[11120+(216*e|0)+88>>2])!=(0|A))if((0|n[11120+(216*e|0)+96>>2])!=(0|A))if((0|n[11120+(216*e|0)+104>>2])!=(0|A))if((0|n[11120+(216*e|0)+112>>2])!=(0|A))if((0|n[11120+(216*e|0)+120>>2])!=(0|A))if((0|n[11120+(216*e|0)+128>>2])!=(0|A)){if((0|n[11120+(216*e|0)+136>>2])!=(0|A)){if((0|n[11120+(216*e|0)+144>>2])==(0|A)){A=0,t=2,r=0;break}if((0|n[11120+(216*e|0)+152>>2])==(0|A)){A=0,t=2,r=1;break}if((0|n[11120+(216*e|0)+160>>2])==(0|A)){A=0,t=2,r=2;break}if((0|n[11120+(216*e|0)+168>>2])==(0|A)){A=1,t=2,r=0;break}if((0|n[11120+(216*e|0)+176>>2])==(0|A)){A=1,t=2,r=1;break}if((0|n[11120+(216*e|0)+184>>2])==(0|A)){A=1,t=2,r=2;break}if((0|n[11120+(216*e|0)+192>>2])==(0|A)){A=2,t=2,r=0;break}if((0|n[11120+(216*e|0)+200>>2])==(0|A)){A=2,t=2,r=1;break}if((0|n[11120+(216*e|0)+208>>2])==(0|A)){A=2,t=2,r=2;break}return-1}A=2,t=1,r=2}else A=2,t=1,r=1;else A=2,t=1,r=0;else A=1,t=1,r=2;else A=1,t=1,r=1;else A=1,t=1,r=0;else A=0,t=1,r=2;else A=0,t=1,r=1;else A=0,t=1,r=0;else A=2,t=0,r=2;else A=2,t=0,r=1;else A=2,t=0,r=0;else A=1,t=0,r=2;else A=1,t=0,r=1;else A=1,t=0,r=0;else A=0,t=0,r=2;else A=0,t=0,r=1;else A=0,t=0,r=0}while(0);return 0|n[11120+(216*e|0)+(72*t|0)+(24*A|0)+(r<<3)+4>>2]}(r,0|n[o>>2]);do{if(0|z(r)){switch(0|r){case 4:l=0;break;case 14:l=1;break;case 24:l=2;break;case 38:l=3;break;case 49:l=4;break;case 58:l=5;break;case 63:l=6;break;case 72:l=7;break;case 83:l=8;break;case 97:l=9;break;case 107:l=10;break;case 117:l=11;break;default:M(27795,27797,75,27806)}if(c=0|n[26416+(24*l|0)+8>>2],e=0|n[26416+(24*l|0)+16>>2],(0|(A=0|n[o>>2]))!=(0|n[u>>2])&&(u=0|G(r))|(0|(A=0|n[o>>2]))==(0|e)&&(s=(s+1|0)%6|0),3==(0|i)&(0|A)==(0|e)){s=(s+5|0)%6|0;break}5==(0|i)&(0|A)==(0|c)&&(s=(s+1|0)%6|0)}}while(0);return n[t>>2]=s,P=a,0}function Se(A,e,t,r){t|=0,r|=0;var o,i,a,s,l,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(l=P,P=P+32|0,v=l+24|0,s=l+20|0,a=l+8|0,i=l+16|0,o=l,g=(g=!(0|HA(A|=0,e|=0)))?6:5,m=0|tt(0|A,0|e,52),B(),g>>>0<=t>>>0)return P=l,2;!(b=!(0|(m&=15)))&&!((p=0|rt(7,0,3*(15^m)|0))&A)&!((0|B())&e)?c=t:u=4;A:do{if(4==(0|u)){if((0|((c=!!(0|HA(A,e)))?4:5))<(0|t))return P=l,1;if(0|Fe(A,e,v))return P=l,1;if(u=(0|n[v>>2])+t|0,7==(0|(p=0|n[(c=c?26704+((0|u)%5<<2)|0:26736+((0|u)%6<<2)|0)>>2])))return P=l,1;n[s>>2]=0,c=0|R(A,e,p,s,a);do{if(!c){if(h=0|n[(f=a)>>2],u=(d=(f=0|n[f+4>>2])>>>0>>0|(0|f)==(0|e)&h>>>0>>0)?h:A,d=d?f:e,!b&&!(h&(b=0|rt(7,0,3*(15^m)|0)))&!(f&(0|B())))c=t;else{if(f=(t+-1+g|0)%(0|g)|0,c=0|HA(A,e),(0|f)<0&&M(27795,27797,248,27822),(0|((g=!!(0|c))?4:5))<(0|f)&&M(27795,27797,248,27822),0|Fe(A,e,v)&&M(27795,27797,248,27822),c=(0|n[v>>2])+f|0,7==(0|(f=0|n[(c=g?26704+((0|c)%5<<2)|0:26736+((0|c)%6<<2)|0)>>2]))&&M(27795,27797,248,27822),n[i>>2]=0,0|(c=0|R(A,e,f,i,o)))break;g=0|n[(h=o)>>2],h=0|n[h+4>>2];do{if(h>>>0>>0|(0|h)==(0|d)&g>>>0>>0){if(u=0|HA(g,h)?0|_(g,h,A,e):0|n[26800+(((0|n[i>>2])+(0|n[26768+(f<<2)>>2])|0)%6<<2)>>2],c=0|HA(g,h),(u+-1|0)>>>0>5){c=-1,u=g,d=h;break}if(1==(0|u)&(c=!!(0|c))){c=-1,u=g,d=h;break}do{if(!(0|Fe(g,h,v))){if(c){c=(5+(0|n[26352+(u<<2)>>2])-(0|n[v>>2])|0)%5|0;break}c=(6+(0|n[26384+(u<<2)>>2])-(0|n[v>>2])|0)%6|0;break}c=-1}while(0);u=g,d=h}else c=t}while(0);h=0|n[(f=a)>>2],f=0|n[f+4>>2]}if((0|u)==(0|h)&(0|d)==(0|f)){if(A=(g=!!(0|HA(h,f)))?0|_(h,f,A,e):0|n[26800+(((0|n[s>>2])+(0|n[26768+(p<<2)>>2])|0)%6<<2)>>2],c=0|HA(h,f),(A+-1|0)>>>0<=5&&!(1==(0|A)&(x=!!(0|c))))do{if(!(0|Fe(h,f,v))){if(x){c=(5+(0|n[26352+(A<<2)>>2])-(0|n[v>>2])|0)%5|0;break}c=(6+(0|n[26384+(A<<2)>>2])-(0|n[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|g&5==(0|c)?0:c}e=d,A=u;break A}}while(0);return P=l,0|c}}while(0);return x=0|rt(0|c,0,56),v=B()|-2130706433&e|536870912,n[r>>2]=x|A,n[r+4>>2]=v,P=l,0}function Le(A,e){A|=0;var t,r,o=0,i=0;return r=P,P=P+16|0,t=r,!0&536870912==(2013265920&(e|=0))&&0|IA(A,o=-2130706433&e|134217728)?(i=0|tt(0|A,0|e,56),B(),o=(i=!(0|Se(A,o,7&i,t)))&((0|n[(o=t)>>2])==(0|A)?(0|n[o+4>>2])==(0|e):0)&1,P=r,0|o):(P=r,0|(o=0))}function Ie(A,e,t){A|=0,t|=0;var r=0;(0|(e|=0))>0?(r=0|We(e,4),n[A>>2]=r,r||M(27835,27858,40,27872)):n[A>>2]=0,n[A+4>>2]=e,n[A+8>>2]=0,n[A+12>>2]=t}function Re(A){var e,t,r,i=0,a=0,s=0,c=0;e=4+(A|=0)|0,t=A+12|0,r=A+8|0;A:for(;;){for(a=0|n[e>>2],i=0;;){if((0|i)>=(0|a))break A;if(s=0|n[A>>2],c=0|n[s+(i<<2)>>2])break;i=i+1|0}i=s+(~~(+l(+ +u(10,+ +(15-(0|n[t>>2])|0))*(+o[c>>3]+ +o[c+8>>3]))%+(0|a))>>>0<<2)|0,a=0|n[i>>2];e:do{if(0|a){if(s=c+32|0,(0|a)==(0|c))n[i>>2]=n[s>>2];else{if(!(i=0|n[(a=a+32|0)>>2]))break;for(;(0|i)!=(0|c);)if(!(i=0|n[(a=i+32|0)>>2]))break e;n[a>>2]=n[s>>2]}Ye(c),n[r>>2]=(0|n[r>>2])-1}}while(0)}Ye(0|n[A>>2])}function Te(A){var e,t=0,r=0;for(e=0|n[4+(A|=0)>>2],r=0;;){if((0|r)>=(0|e)){t=0,r=4;break}if(t=0|n[(0|n[A>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|t:0}function _e(A,e){e|=0;var t=0,r=0,i=0,a=0;if(t=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,t=(0|n[A>>2])+(t<<2)|0,!(r=0|n[t>>2]))return 1;a=e+32|0;do{if((0|r)!=(0|e)){if(!(t=0|n[r+32>>2]))return 1;for(i=t;;){if((0|i)==(0|e)){i=8;break}if(!(t=0|n[i+32>>2])){t=1,i=10;break}r=i,i=t}if(8==(0|i)){n[r+32>>2]=n[a>>2];break}if(10==(0|i))return 0|t}else n[t>>2]=n[a>>2]}while(0);return Ye(e),n[(a=A+8|0)>>2]=(0|n[a>>2])-1,0}function He(A,e,t){A|=0,e|=0,t|=0;var r,i=0,a=0,s=0;(r=0|Ue(40))||M(27888,27858,98,27901),n[r>>2]=n[e>>2],n[r+4>>2]=n[e+4>>2],n[r+8>>2]=n[e+8>>2],n[r+12>>2]=n[e+12>>2],n[(a=r+16|0)>>2]=n[t>>2],n[a+4>>2]=n[t+4>>2],n[a+8>>2]=n[t+8>>2],n[a+12>>2]=n[t+12>>2],n[r+32>>2]=0,a=~~(+l(+ +u(10,+ +(15-(0|n[A+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,a=(0|n[A>>2])+(a<<2)|0,i=0|n[a>>2];do{if(i){for(;!(0|oe(i,e)&&0|oe(i+16|0,t));)if(a=0|n[i+32>>2],!(0|n[(i=0|a?a:i)+32>>2])){s=10;break}if(10==(0|s)){n[i+32>>2]=r;break}return Ye(r),0|i}n[a>>2]=r}while(0);return n[(s=A+8|0)>>2]=1+(0|n[s>>2]),0|r}function ze(A,e,t){e|=0,t|=0;var r=0,i=0;if(i=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,!(i=0|n[(0|n[A>>2])+(i<<2)>>2]))return 0;if(!t){for(A=i;;){if(0|oe(A,e)){r=10;break}if(!(A=0|n[A+32>>2])){A=0,r=10;break}}if(10==(0|r))return 0|A}for(A=i;;){if(0|oe(A,e)&&0|oe(A+16|0,t)){r=10;break}if(!(A=0|n[A+32>>2])){A=0,r=10;break}}return 10==(0|r)?0|A:0}function Ge(A,e){e|=0;var t=0;if(t=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,!(A=0|n[(0|n[A>>2])+(t<<2)>>2]))return 0;for(;;){if(0|oe(A,e)){e=5;break}if(!(A=0|n[A+32>>2])){A=0,e=5;break}}return 5==(0|e)?0|A:0}function Oe(A){return 0|+ct(+(A=+A))}function Ue(A){A|=0;var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0;e=P,P=P+16|0,g=e;do{if(A>>>0<245){if(A=(u=A>>>0<11?16:A+11&-8)>>>3,3&(r=(f=0|n[6981])>>>A))return o=0|n[(r=8+(A=27964+((t=(1&r^1)+A|0)<<1<<2)|0)|0)>>2],(0|(a=0|n[(i=o+8|0)>>2]))==(0|A)?n[6981]=f&~(1<>2]=A,n[r>>2]=a),y=t<<3,n[o+4>>2]=3|y,n[(y=o+y+4|0)>>2]=1|n[y>>2],P=e,0|i;if(u>>>0>(d=0|n[6983])>>>0){if(0|r)return t=((t=r<>>=l=t>>>12&16)>>>5&8)|l|(a=(t>>>=r)>>>2&4)|(A=(t>>>=a)>>>1&2)|(o=(t>>>=A)>>>1&1))+(t>>>o)|0)<<1<<2)|0)|0)>>2],(0|(r=0|n[(l=a+8|0)>>2]))==(0|t)?(A=f&~(1<>2]=t,n[A>>2]=r,A=f),s=(y=o<<3)-u|0,n[a+4>>2]=3|u,n[4+(i=a+u|0)>>2]=1|s,n[a+y>>2]=s,0|d&&(o=0|n[6986],r=27964+((t=d>>>3)<<1<<2)|0,A&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=o,n[t+12>>2]=o,n[o+8>>2]=t,n[o+12>>2]=r),n[6983]=s,n[6986]=i,P=e,0|l;if(a=0|n[6982]){for(r=(a&0-a)-1|0,r=c=0|n[28228+(((o=(r>>>=i=r>>>12&16)>>>5&8)|i|(s=(r>>>=o)>>>2&4)|(l=(r>>>=s)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&n[c+4>>2])-u|0;(A=0|n[r+16>>2])||(A=0|n[r+20>>2]);)r=A,l=(i=(s=(-8&n[A+4>>2])-u|0)>>>0>>0)?A:l,c=i?s:c;if((s=l+u|0)>>>0>l>>>0){i=0|n[l+24>>2],t=0|n[l+12>>2];do{if((0|t)==(0|l)){if(!(t=0|n[(A=l+20|0)>>2])&&!(t=0|n[(A=l+16|0)>>2])){r=0;break}for(;;)if(r=0|n[(o=t+20|0)>>2])t=r,A=o;else{if(!(r=0|n[(o=t+16|0)>>2]))break;t=r,A=o}n[A>>2]=0,r=t}else r=0|n[l+8>>2],n[r+12>>2]=t,n[t+8>>2]=r,r=t}while(0);do{if(0|i){if(t=0|n[l+28>>2],(0|l)==(0|n[(A=28228+(t<<2)|0)>>2])){if(n[A>>2]=r,!r){n[6982]=a&~(1<>2])==(0|l)?y:i+20)>>2]=r,!r)break;n[r+24>>2]=i,0|(t=0|n[l+16>>2])&&(n[r+16>>2]=t,n[t+24>>2]=r),0|(t=0|n[l+20>>2])&&(n[r+20>>2]=t,n[t+24>>2]=r)}}while(0);return c>>>0<16?(y=c+u|0,n[l+4>>2]=3|y,n[(y=l+y+4|0)>>2]=1|n[y>>2]):(n[l+4>>2]=3|u,n[s+4>>2]=1|c,n[s+c>>2]=c,0|d&&(o=0|n[6986],r=27964+((t=d>>>3)<<1<<2)|0,(t=1<>2]:(n[6981]=t|f,t=r,A=r+8|0),n[A>>2]=o,n[t+12>>2]=o,n[o+8>>2]=t,n[o+12>>2]=r),n[6983]=c,n[6986]=s),P=e,0|l+8}f=u}else f=u}else f=u}else if(A>>>0<=4294967231)if(u=-8&(A=A+11|0),o=0|n[6982]){i=0-u|0,c=(A>>>=8)?u>>>0>16777215?31:u>>>(7+(c=14-((l=(520192+(b=A<<(f=(A+1048320|0)>>>16&8))|0)>>>16&4)|f|(c=(245760+(b<<=l)|0)>>>16&2))+(b<>>15)|0)|0)&1|c<<1:0,r=0|n[28228+(c<<2)>>2];A:do{if(r)for(A=0,l=u<<(31==(0|c)?0:25-(c>>>1)|0),a=0;;){if((s=(-8&n[r+4>>2])-u|0)>>>0>>0){if(!s){A=r,i=0,b=65;break A}A=r,i=s}if(a=!(0|(b=0|n[r+20>>2]))|(0|b)==(0|(r=0|n[r+16+(l>>>31<<2)>>2]))?a:b,!r){r=a,b=61;break}l<<=1}else r=0,A=0,b=61}while(0);if(61==(0|b)){if(!(0|r)&!(0|A)){if(!(A=((A=2<>>=s=f>>>12&16)>>>5&8)|s|(l=(f>>>=a)>>>2&4)|(c=(f>>>=l)>>>1&2)|(r=(f>>>=c)>>>1&1))+(f>>>r)<<2)>>2]}r?b=65:(l=A,s=i)}if(65==(0|b))for(a=r;;){if(i=(r=(f=(-8&n[a+4>>2])-u|0)>>>0>>0)?f:i,A=r?a:A,(r=0|n[a+16>>2])||(r=0|n[a+20>>2]),!r){l=A,s=i;break}a=r}if(0|l&&s>>>0<((0|n[6983])-u|0)>>>0&&(d=l+u|0)>>>0>l>>>0){a=0|n[l+24>>2],t=0|n[l+12>>2];do{if((0|t)==(0|l)){if(!(t=0|n[(A=l+20|0)>>2])&&!(t=0|n[(A=l+16|0)>>2])){t=0;break}for(;;)if(r=0|n[(i=t+20|0)>>2])t=r,A=i;else{if(!(r=0|n[(i=t+16|0)>>2]))break;t=r,A=i}n[A>>2]=0}else y=0|n[l+8>>2],n[y+12>>2]=t,n[t+8>>2]=y}while(0);do{if(a){if(A=0|n[l+28>>2],(0|l)==(0|n[(r=28228+(A<<2)|0)>>2])){if(n[r>>2]=t,!t){o&=~(1<>2])==(0|l)?y:a+20)>>2]=t,!t)break;n[t+24>>2]=a,0|(A=0|n[l+16>>2])&&(n[t+16>>2]=A,n[A+24>>2]=t),(A=0|n[l+20>>2])&&(n[t+20>>2]=A,n[A+24>>2]=t)}}while(0);A:do{if(s>>>0<16)y=s+u|0,n[l+4>>2]=3|y,n[(y=l+y+4|0)>>2]=1|n[y>>2];else{if(n[l+4>>2]=3|u,n[d+4>>2]=1|s,n[d+s>>2]=s,t=s>>>3,s>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=d,n[t+12>>2]=d,n[d+8>>2]=t,n[d+12>>2]=r;break}if(t=28228+((r=(t=s>>>8)?s>>>0>16777215?31:s>>>(7+(r=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(r=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|r<<1:0)<<2)|0,n[d+28>>2]=r,n[4+(A=d+16|0)>>2]=0,n[A>>2]=0,!(o&(A=1<>2]=d,n[d+24>>2]=t,n[d+12>>2]=d,n[d+8>>2]=d;break}t=0|n[t>>2];e:do{if((-8&n[t+4>>2])!=(0|s)){for(o=s<<(31==(0|r)?0:25-(r>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|s)){t=A;break e}o<<=1,t=A}n[r>>2]=d,n[d+24>>2]=t,n[d+12>>2]=d,n[d+8>>2]=d;break A}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=d,n[w>>2]=d,n[d+8>>2]=y,n[d+12>>2]=t,n[d+24>>2]=0}}while(0);return P=e,0|l+8}f=u}else f=u;else f=-1}while(0);if((r=0|n[6983])>>>0>=f>>>0)return t=r-f|0,A=0|n[6986],t>>>0>15?(y=A+f|0,n[6986]=y,n[6983]=t,n[y+4>>2]=1|t,n[A+r>>2]=t,n[A+4>>2]=3|f):(n[6983]=0,n[6986]=0,n[A+4>>2]=3|r,n[(y=A+r+4|0)>>2]=1|n[y>>2]),P=e,0|A+8;if((s=0|n[6984])>>>0>f>>>0)return v=s-f|0,n[6984]=v,w=(y=0|n[6987])+f|0,n[6987]=w,n[w+4>>2]=1|v,n[y+4>>2]=3|f,P=e,0|y+8;if(0|n[7099]?A=0|n[7101]:(n[7101]=4096,n[7100]=4096,n[7102]=-1,n[7103]=-1,n[7104]=0,n[7092]=0,n[7099]=-16&g^1431655768,A=4096),l=f+48|0,(u=(a=A+(c=f+47|0)|0)&(i=0-A|0))>>>0<=f>>>0)return P=e,0;if(0|(A=0|n[7091])&&(g=(d=0|n[7089])+u|0)>>>0<=d>>>0|g>>>0>A>>>0)return P=e,0;A:do{if(4&n[7092])t=0,b=143;else{r=0|n[6987];e:do{if(r){for(o=28372;!((g=0|n[o>>2])>>>0<=r>>>0&&(g+(0|n[o+4>>2])|0)>>>0>r>>>0);){if(!(A=0|n[o+8>>2])){b=128;break e}o=A}if((t=a-s&i)>>>0<2147483647)if((0|(A=0|ut(0|t)))==((0|n[o>>2])+(0|n[o+4>>2])|0)){if(-1!=(0|A)){s=t,a=A,b=145;break A}}else o=A,b=136;else t=0}else b=128}while(0);do{if(128==(0|b))if(-1!=(0|(r=0|ut(0)))&&(t=r,m=(t=((m=(h=0|n[7100])-1|0)&t?(m+t&0-h)-t|0:0)+u|0)+(h=0|n[7089])|0,t>>>0>f>>>0&t>>>0<2147483647)){if(0|(g=0|n[7091])&&m>>>0<=h>>>0|m>>>0>g>>>0){t=0;break}if((0|(A=0|ut(0|t)))==(0|r)){s=t,a=r,b=145;break A}o=A,b=136}else t=0}while(0);do{if(136==(0|b)){if(r=0-t|0,!(l>>>0>t>>>0&t>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){t=0;break}s=t,a=o,b=145;break A}if((A=c-t+(A=0|n[7101])&0-A)>>>0>=2147483647){s=t,a=o,b=145;break A}if(-1==(0|ut(0|A))){ut(0|r),t=0;break}s=A+t|0,a=o,b=145;break A}}while(0);n[7092]=4|n[7092],b=143}}while(0);if(143==(0|b)&&u>>>0<2147483647&&!(-1==(0|(v=0|ut(0|u)))|1^(x=(p=(m=0|ut(0))-v|0)>>>0>(f+40|0)>>>0)|v>>>0>>0&-1!=(0|v)&-1!=(0|m)^1)&&(s=x?p:t,a=v,b=145),145==(0|b)){t=(0|n[7089])+s|0,n[7089]=t,t>>>0>(0|n[7090])>>>0&&(n[7090]=t),c=0|n[6987];A:do{if(c){for(t=28372;;){if((0|a)==((A=0|n[t>>2])+(r=0|n[t+4>>2])|0)){b=154;break}if(!(o=0|n[t+8>>2]))break;t=o}if(!(154!=(0|b)||(w=t+4|0,8&n[t+12>>2]))&&a>>>0>c>>>0&A>>>0<=c>>>0){n[w>>2]=r+s,w=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(y=(0|n[6984])+s|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[c+y+4>>2]=40,n[6988]=n[7103];break}for(a>>>0<(0|n[6985])>>>0&&(n[6985]=a),r=a+s|0,t=28372;;){if((0|n[t>>2])==(0|r)){b=162;break}if(!(A=0|n[t+8>>2]))break;t=A}if(162==(0|b)&&!(8&n[t+12>>2])){n[t>>2]=a,n[(d=t+4|0)>>2]=(0|n[d>>2])+s,u=(d=a+(7&(d=a+8|0)?0-d&7:0)|0)+f|0,l=(t=r+(7&(t=r+8|0)?0-t&7:0)|0)-d-f|0,n[d+4>>2]=3|f;e:do{if((0|c)==(0|t))y=(0|n[6984])+l|0,n[6984]=y,n[6987]=u,n[u+4>>2]=1|y;else{if((0|n[6986])==(0|t)){y=(0|n[6983])+l|0,n[6983]=y,n[6986]=u,n[u+4>>2]=1|y,n[u+y>>2]=y;break}if(1==(3&(A=0|n[t+4>>2]))){s=-8&A,o=A>>>3;t:do{if(A>>>0<256){if(A=0|n[t+8>>2],(0|(r=0|n[t+12>>2]))==(0|A)){n[6981]=n[6981]&~(1<>2]=r,n[r+8>>2]=A;break}a=0|n[t+24>>2],A=0|n[t+12>>2];do{if((0|A)==(0|t)){if(A=0|n[(o=4+(r=t+16|0)|0)>>2])r=o;else if(!(A=0|n[r>>2])){A=0;break}for(;;)if(o=0|n[(i=A+20|0)>>2])A=o,r=i;else{if(!(o=0|n[(i=A+16|0)>>2]))break;A=o,r=i}n[r>>2]=0}else y=0|n[t+8>>2],n[y+12>>2]=A,n[A+8>>2]=y}while(0);if(!a)break;o=28228+((r=0|n[t+28>>2])<<2)|0;do{if((0|n[o>>2])==(0|t)){if(n[o>>2]=A,0|A)break;n[6982]=n[6982]&~(1<>2])==(0|t)?y:a+20)>>2]=A,!A)break t}while(0);if(n[A+24>>2]=a,0|(o=0|n[(r=t+16|0)>>2])&&(n[A+16>>2]=o,n[o+24>>2]=A),!(r=0|n[r+4>>2]))break;n[A+20>>2]=r,n[r+24>>2]=A}while(0);t=t+s|0,i=s+l|0}else i=l;if(n[(t=t+4|0)>>2]=-2&n[t>>2],n[u+4>>2]=1|i,n[u+i>>2]=i,t=i>>>3,i>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=u,n[t+12>>2]=u,n[u+8>>2]=t,n[u+12>>2]=r;break}t=i>>>8;do{if(t){if(i>>>0>16777215){o=31;break}o=i>>>(7+(o=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(o=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|o<<1}else o=0}while(0);if(t=28228+(o<<2)|0,n[u+28>>2]=o,n[4+(A=u+16|0)>>2]=0,n[A>>2]=0,!((A=0|n[6982])&(r=1<>2]=u,n[u+24>>2]=t,n[u+12>>2]=u,n[u+8>>2]=u;break}t=0|n[t>>2];t:do{if((-8&n[t+4>>2])!=(0|i)){for(o=i<<(31==(0|o)?0:25-(o>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|i)){t=A;break t}o<<=1,t=A}n[r>>2]=u,n[u+24>>2]=t,n[u+12>>2]=u,n[u+8>>2]=u;break e}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=u,n[w>>2]=u,n[u+8>>2]=y,n[u+12>>2]=t,n[u+24>>2]=0}}while(0);return P=e,0|d+8}for(t=28372;!((A=0|n[t>>2])>>>0<=c>>>0&&(y=A+(0|n[t+4>>2])|0)>>>0>c>>>0);)t=0|n[t+8>>2];t=(A=(A=(i=y+-47|0)+(7&(A=i+8|0)?0-A&7:0)|0)>>>0<(i=c+16|0)>>>0?c:A)+8|0,w=a+(v=7&(v=a+8|0)?0-v&7:0)|0,v=(r=s+-40|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[a+r+4>>2]=40,n[6988]=n[7103],n[(r=A+4|0)>>2]=27,n[t>>2]=n[7093],n[t+4>>2]=n[7094],n[t+8>>2]=n[7095],n[t+12>>2]=n[7096],n[7093]=a,n[7094]=s,n[7096]=0,n[7095]=t,t=A+24|0;do{w=t,n[(t=t+4|0)>>2]=7}while((w+8|0)>>>0>>0);if((0|A)!=(0|c)){if(a=A-c|0,n[r>>2]=-2&n[r>>2],n[c+4>>2]=1|a,n[A>>2]=a,t=a>>>3,a>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=c,n[t+12>>2]=c,n[c+8>>2]=t,n[c+12>>2]=r;break}if(r=28228+((o=(t=a>>>8)?a>>>0>16777215?31:a>>>(7+(o=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(o=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|o<<1:0)<<2)|0,n[c+28>>2]=o,n[c+20>>2]=0,n[i>>2]=0,!((t=0|n[6982])&(A=1<>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break}t=0|n[r>>2];e:do{if((-8&n[t+4>>2])!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|a)){t=A;break e}o<<=1,t=A}n[r>>2]=c,n[c+24>>2]=t,n[c+12>>2]=c,n[c+8>>2]=c;break A}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=c,n[w>>2]=c,n[c+8>>2]=y,n[c+12>>2]=t,n[c+24>>2]=0}}else!(0|(y=0|n[6985]))|a>>>0>>0&&(n[6985]=a),n[7093]=a,n[7094]=s,n[7096]=0,n[6990]=n[7099],n[6989]=-1,n[6994]=27964,n[6993]=27964,n[6996]=27972,n[6995]=27972,n[6998]=27980,n[6997]=27980,n[7e3]=27988,n[6999]=27988,n[7002]=27996,n[7001]=27996,n[7004]=28004,n[7003]=28004,n[7006]=28012,n[7005]=28012,n[7008]=28020,n[7007]=28020,n[7010]=28028,n[7009]=28028,n[7012]=28036,n[7011]=28036,n[7014]=28044,n[7013]=28044,n[7016]=28052,n[7015]=28052,n[7018]=28060,n[7017]=28060,n[7020]=28068,n[7019]=28068,n[7022]=28076,n[7021]=28076,n[7024]=28084,n[7023]=28084,n[7026]=28092,n[7025]=28092,n[7028]=28100,n[7027]=28100,n[7030]=28108,n[7029]=28108,n[7032]=28116,n[7031]=28116,n[7034]=28124,n[7033]=28124,n[7036]=28132,n[7035]=28132,n[7038]=28140,n[7037]=28140,n[7040]=28148,n[7039]=28148,n[7042]=28156,n[7041]=28156,n[7044]=28164,n[7043]=28164,n[7046]=28172,n[7045]=28172,n[7048]=28180,n[7047]=28180,n[7050]=28188,n[7049]=28188,n[7052]=28196,n[7051]=28196,n[7054]=28204,n[7053]=28204,n[7056]=28212,n[7055]=28212,w=a+(v=7&(v=a+8|0)?0-v&7:0)|0,v=(y=s+-40|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[a+y+4>>2]=40,n[6988]=n[7103]}while(0);if((t=0|n[6984])>>>0>f>>>0)return v=t-f|0,n[6984]=v,w=(y=0|n[6987])+f|0,n[6987]=w,n[w+4>>2]=1|v,n[y+4>>2]=3|f,P=e,0|y+8}return n[(y=27920)>>2]=12,P=e,0}function Ye(A){var e=0,t=0,r=0,o=0,i=0,a=0,s=0,l=0;if(A|=0){t=A+-8|0,o=0|n[6985],l=t+(e=-8&(A=0|n[A+-4>>2]))|0;do{if(1&A)s=t,a=t;else{if(r=0|n[t>>2],!(3&A))return;if(i=r+e|0,(a=t+(0-r)|0)>>>0>>0)return;if((0|n[6986])==(0|a)){if(3&~(e=0|n[(A=l+4|0)>>2])){s=a,e=i;break}return n[6983]=i,n[A>>2]=-2&e,n[a+4>>2]=1|i,void(n[a+i>>2]=i)}if(t=r>>>3,r>>>0<256){if(A=0|n[a+8>>2],(0|(e=0|n[a+12>>2]))==(0|A)){n[6981]=n[6981]&~(1<>2]=e,n[e+8>>2]=A,s=a,e=i;break}o=0|n[a+24>>2],A=0|n[a+12>>2];do{if((0|A)==(0|a)){if(A=0|n[(t=4+(e=a+16|0)|0)>>2])e=t;else if(!(A=0|n[e>>2])){A=0;break}for(;;)if(t=0|n[(r=A+20|0)>>2])A=t,e=r;else{if(!(t=0|n[(r=A+16|0)>>2]))break;A=t,e=r}n[e>>2]=0}else s=0|n[a+8>>2],n[s+12>>2]=A,n[A+8>>2]=s}while(0);if(o){if(e=0|n[a+28>>2],(0|n[(t=28228+(e<<2)|0)>>2])==(0|a)){if(n[t>>2]=A,!A){n[6982]=n[6982]&~(1<>2])==(0|a)?s:o+20)>>2]=A,!A){s=a,e=i;break}n[A+24>>2]=o,0|(t=0|n[(e=a+16|0)>>2])&&(n[A+16>>2]=t,n[t+24>>2]=A),(e=0|n[e+4>>2])?(n[A+20>>2]=e,n[e+24>>2]=A,s=a,e=i):(s=a,e=i)}else s=a,e=i}}while(0);if(!(a>>>0>=l>>>0)&&1&(r=0|n[(A=l+4|0)>>2])){if(2&r)n[A>>2]=-2&r,n[s+4>>2]=1|e,n[a+e>>2]=e,o=e;else{if((0|n[6987])==(0|l)){if(l=(0|n[6984])+e|0,n[6984]=l,n[6987]=s,n[s+4>>2]=1|l,(0|s)!=(0|n[6986]))return;return n[6986]=0,void(n[6983]=0)}if((0|n[6986])==(0|l))return l=(0|n[6983])+e|0,n[6983]=l,n[6986]=a,n[s+4>>2]=1|l,void(n[a+l>>2]=l);o=(-8&r)+e|0,t=r>>>3;do{if(r>>>0<256){if(e=0|n[l+8>>2],(0|(A=0|n[l+12>>2]))==(0|e)){n[6981]=n[6981]&~(1<>2]=A,n[A+8>>2]=e;break}i=0|n[l+24>>2],A=0|n[l+12>>2];do{if((0|A)==(0|l)){if(A=0|n[(t=4+(e=l+16|0)|0)>>2])e=t;else if(!(A=0|n[e>>2])){t=0;break}for(;;)if(t=0|n[(r=A+20|0)>>2])A=t,e=r;else{if(!(t=0|n[(r=A+16|0)>>2]))break;A=t,e=r}n[e>>2]=0,t=A}else t=0|n[l+8>>2],n[t+12>>2]=A,n[A+8>>2]=t,t=A}while(0);if(0|i){if(A=0|n[l+28>>2],(0|n[(e=28228+(A<<2)|0)>>2])==(0|l)){if(n[e>>2]=t,!t){n[6982]=n[6982]&~(1<>2])==(0|l)?r:i+20)>>2]=t,!t)break;n[t+24>>2]=i,0|(e=0|n[(A=l+16|0)>>2])&&(n[t+16>>2]=e,n[e+24>>2]=t),0|(A=0|n[A+4>>2])&&(n[t+20>>2]=A,n[A+24>>2]=t)}}while(0);if(n[s+4>>2]=1|o,n[a+o>>2]=o,(0|s)==(0|n[6986]))return void(n[6983]=o)}if(A=o>>>3,o>>>0<256)return t=27964+(A<<1<<2)|0,(e=0|n[6981])&(A=1<>2]:(n[6981]=e|A,A=t,e=t+8|0),n[e>>2]=s,n[A+12>>2]=s,n[s+8>>2]=A,void(n[s+12>>2]=t);A=28228+((r=(A=o>>>8)?o>>>0>16777215?31:o>>>(7+(r=14-((i=(520192+(l=A<<(a=(A+1048320|0)>>>16&8))|0)>>>16&4)|a|(r=(245760+(l<<=i)|0)>>>16&2))+(l<>>15)|0)|0)&1|r<<1:0)<<2)|0,n[s+28>>2]=r,n[s+20>>2]=0,n[s+16>>2]=0,e=0|n[6982],t=1<>2];e:do{if((-8&n[A+4>>2])!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);e=0|n[(t=A+16+(r>>>31<<2)|0)>>2];){if((-8&n[e+4>>2])==(0|o)){A=e;break e}r<<=1,A=e}n[t>>2]=s,n[s+24>>2]=A,n[s+12>>2]=s,n[s+8>>2]=s;break A}}while(0);l=0|n[(a=A+8|0)>>2],n[l+12>>2]=s,n[a>>2]=s,n[s+8>>2]=l,n[s+12>>2]=A,n[s+24>>2]=0}else n[6982]=e|t,n[A>>2]=s,n[s+24>>2]=A,n[s+12>>2]=s,n[s+8>>2]=s}while(0);if(l=(0|n[6989])-1|0,n[6989]=l,!(0|l)){for(A=28380;A=0|n[A>>2];)A=A+8|0;n[6989]=-1}}}}function We(A,e){e|=0;var t=0;return(A|=0)?(t=0|v(e,A),(e|A)>>>0>65535&&(t=((t>>>0)/(A>>>0)|0)==(0|e)?t:-1)):t=0,(A=0|Ue(t))&&3&n[A+-4>>2]?(lt(0|A,0,0|t),0|A):0|A}function Ze(A,e,t,r){return 0|(C((e|=0)+(r|=0)+((t=(A|=0)+(t|=0)>>>0)>>>0>>0|0)>>>0|0),t)}function Ve(A,e,t,r){return 0|(C(0|(r=(e|=0)-(r|=0)-((t|=0)>>>0>(A|=0)>>>0|0)>>>0)),A-t>>>0)}function Ke(A){return 0|((A|=0)?31-(0|k(A^A-1)):32)}function Je(A,e,t,r,o){o|=0;var i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0;if(u=A|=0,a=t|=0,s=f=r|=0,!(c=l=e|=0))return i=!!(0|o),s?i?(n[o>>2]=0|A,n[o+4>>2]=0&e,o=0,0|(C(0|(f=0)),o)):(o=0,0|(C(0|(f=0)),o)):(i&&(n[o>>2]=(u>>>0)%(a>>>0),n[o+4>>2]=0),o=(u>>>0)/(a>>>0)>>>0,0|(C(0|(f=0)),o));i=!(0|s);do{if(a){if(!i){if((i=(0|k(0|s))-(0|k(0|c))|0)>>>0<=31){a=d=i+1|0,A=u>>>(d>>>0)&(e=i-31>>31)|c<<(s=31-i|0),e&=c>>>(d>>>0),i=0,s=u<>2]=0|A,n[o+4>>2]=l|0&e,o=0,0|(C(0|(f=0)),o)):(o=0,0|(C(0|(f=0)),o))}if((i=a-1|0)&a){a=s=33+(0|k(0|a))-(0|k(0|c))|0,A=(d=32-s|0)-1>>31&c>>>((g=s-32|0)>>>0)|(c<>>(s>>>0))&(e=g>>31),e&=c>>>(s>>>0),i=u<<(h=64-s|0)&(l=d>>31),s=(c<>>(g>>>0))&l|u<>31;break}return 0|o&&(n[o>>2]=i&u,n[o+4>>2]=0),1==(0|a)?(h=0|A,0|(C(0|(g=l|0&e)),h)):(g=c>>>((h=0|Ke(0|a))>>>0)|0,h=c<<32-h|u>>>(h>>>0),0|(C(0|g),h))}if(i)return 0|o&&(n[o>>2]=(c>>>0)%(a>>>0),n[o+4>>2]=0),h=(c>>>0)/(a>>>0)>>>0,0|(C(0|(g=0)),h);if(!u)return 0|o&&(n[o>>2]=0,n[o+4>>2]=(c>>>0)%(s>>>0)),h=(c>>>0)/(s>>>0)>>>0,0|(C(0|(g=0)),h);if(!((i=s-1|0)&s))return 0|o&&(n[o>>2]=0|A,n[o+4>>2]=i&c|0&e),g=0,h=c>>>((0|Ke(0|s))>>>0),0|(C(0|g),h);if((i=(0|k(0|s))-(0|k(0|c))|0)>>>0<=30){a=e=i+1|0,A=c<<(s=31-i|0)|u>>>(e>>>0),e=c>>>(e>>>0),i=0,s=u<>2]=0|A,n[o+4>>2]=l|0&e,h=0,0|(C(0|(g=0)),h)):(h=0,0|(C(0|(g=0)),h))}while(0);if(a){c=0|Ze(0|(d=0|t),0|(u=f|0&r),-1,-1),t=0|B(),l=s,s=0;do{r=l,l=i>>>31|l<<1,i=s|i<<1,Ve(0|c,0|t,0|(r=A<<1|r>>>31),0|(f=A>>>31|e<<1)),s=1&(g=(h=0|B())>>31|((0|h)<0?-1:0)<<1),A=0|Ve(0|r,0|f,g&d|0,(((0|h)<0?-1:0)>>31|((0|h)<0?-1:0)<<1)&u),e=0|B(),a=a-1|0}while(0|a);c=l,l=0}else c=s,l=0,s=0;return a=0,0|o&&(n[o>>2]=A,n[o+4>>2]=e),h=i<<1&-2|s,0|(C(0|(g=(0|i)>>>31|(c|a)<<1|l)),h)}function Xe(A,e,t,r){var n,o,i,a,s;return t|=0,o=(r|=0)>>31|((0|r)<0?-1:0)<<1,n=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,i=0|Ve((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0),(a=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|a),A=o^s,e=n^a,0|Ve((0|Je(i,0|B(),0|Ve(o^t|0,n^r|0,0|o,0|n),0|B(),0))^A,(0|B())^e,0|A,0|e)}function qe(A,e,t,r){var n,o;return e|=0,r|=0,t=0|function(A,e){var t,r,n,o=0;return A=((t=0|v(o=65535&(e|=0),n=65535&(A|=0)))>>>16)+(0|v(o,r=A>>>16))|0,e=0|v(o=e>>>16,n),0|(C((A>>>16)+(0|v(o,r))+(((65535&A)+e|0)>>>16)|0),A+e<<16|65535&t)}(n=A|=0,o=t|=0),A=0|B(),0|(C((0|v(e,o))+(0|v(r,n))+A|0&A),t)}function $e(A,e,t,r){var o,i,a,s,l,c;return t|=0,o=P,P=P+16|0,s=0|o,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Je(A=0|Ve((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0),(i=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|i),e=0|B(),0|Ve(c^t|0,l^r|0,0|c,0|l),0|B(),s),r=0|Ve(n[s>>2]^a|0,n[s+4>>2]^i|0,0|a,0|i),t=0|B(),P=o,0|(C(0|t),r)}function At(A,e,t,r){var o,i;return i=P,P=P+16|0,Je(A|=0,e|=0,t|=0,r|=0,o=0|i),P=i,0|(C(0|n[o+4>>2]),n[o>>2])}function et(A,e,t){return A|=0,e|=0,(0|(t|=0))<32?(C(e>>t|0),A>>>t|(e&(1<>t-32)}function tt(A,e,t){return A|=0,e|=0,(0|(t|=0))<32?(C(e>>>t|0),A>>>t|(e&(1<>>t-32|0)}function rt(A,e,t){return A|=0,(0|(t|=0))<32?(C((e|=0)<>>32-t),A<=0?+s(A+.5):+x(A-.5)}function st(A,e,t){A|=0,e|=0;var o,i,a=0;if((0|(t|=0))>=8192)return N(0|A,0|e,0|t),0|A;if(i=0|A,o=A+t|0,(3&A)==(3&e)){for(;3&A;){if(!t)return 0|i;r[0|A]=0|r[0|e],A=A+1|0,e=e+1|0,t=t-1|0}for(a=(t=-4&o)-64|0;(0|A)<=(0|a);)n[A>>2]=n[e>>2],n[A+4>>2]=n[e+4>>2],n[A+8>>2]=n[e+8>>2],n[A+12>>2]=n[e+12>>2],n[A+16>>2]=n[e+16>>2],n[A+20>>2]=n[e+20>>2],n[A+24>>2]=n[e+24>>2],n[A+28>>2]=n[e+28>>2],n[A+32>>2]=n[e+32>>2],n[A+36>>2]=n[e+36>>2],n[A+40>>2]=n[e+40>>2],n[A+44>>2]=n[e+44>>2],n[A+48>>2]=n[e+48>>2],n[A+52>>2]=n[e+52>>2],n[A+56>>2]=n[e+56>>2],n[A+60>>2]=n[e+60>>2],A=A+64|0,e=e+64|0;for(;(0|A)<(0|t);)n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}else for(t=o-4|0;(0|A)<(0|t);)r[0|A]=0|r[0|e],r[A+1|0]=0|r[e+1|0],r[A+2|0]=0|r[e+2|0],r[A+3|0]=0|r[e+3|0],A=A+4|0,e=e+4|0;for(;(0|A)<(0|o);)r[0|A]=0|r[0|e],A=A+1|0,e=e+1|0;return 0|i}function lt(A,e,t){e|=0;var o,i=0,a=0,s=0;if(o=(A|=0)+(t|=0)|0,e&=255,(0|t)>=67){for(;3&A;)r[0|A]=e,A=A+1|0;for(s=e|e<<8|e<<16|e<<24,a=(i=-4&o)-64|0;(0|A)<=(0|a);)n[A>>2]=s,n[A+4>>2]=s,n[A+8>>2]=s,n[A+12>>2]=s,n[A+16>>2]=s,n[A+20>>2]=s,n[A+24>>2]=s,n[A+28>>2]=s,n[A+32>>2]=s,n[A+36>>2]=s,n[A+40>>2]=s,n[A+44>>2]=s,n[A+48>>2]=s,n[A+52>>2]=s,n[A+56>>2]=s,n[A+60>>2]=s,A=A+64|0;for(;(0|A)<(0|i);)n[A>>2]=s,A=A+4|0}for(;(0|A)<(0|o);)r[0|A]=e,A=A+1|0;return o-t|0}function ct(A){return(A=+A)>=0?+s(A+.5):+x(A-.5)}function ut(A){var e,t,r;return A|=0,r=0|E(),(0|A)>0&(0|(e=(t=0|n[a>>2])+A|0))<(0|t)|(0|e)<0?(j(0|e),D(12),-1):(0|e)>(0|r)&&!(0|Q(0|e))?(D(12),-1):(n[a>>2]=e,0|t)}return{___divdi3:Xe,___muldi3:qe,___remdi3:$e,___uremdi3:At,_areNeighborCells:function(A,e,t,r,o){o|=0;var i,a,s,l=0,c=0,u=0,d=0;if(s=P,P=P+64|0,a=s,i=s+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return P=s,5;if((0|(A|=0))==(0|(t|=0))&(0|e)==(0|r))return n[o>>2]=0,P=s,0;if(c=0|tt(0|A,0|e,52),B(),c&=15,d=0|tt(0|t,0|r,52),B(),(0|c)!=(15&d))return P=s,12;if(l=c+-1|0,c>>>0>1){TA(A,e,l,a),TA(t,r,l,i),u=0|n[(d=a)>>2],d=0|n[d+4>>2];A:do{if((0|u)==(0|n[i>>2])&&(0|d)==(0|n[i+4>>2])){l=0|tt(0|A,0|e,0|(c=3*(15^c)|0)),B(),l&=7,c=0|tt(0|t,0|r,0|c),B(),c&=7;do{if(!(0|l)|!(0|c))n[o>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|c)&&0|HA(u,d)){l=5;break}if((0|n[15536+(l<<2)>>2])!=(0|c)&&(0|n[15568+(l<<2)>>2])!=(0|c))break A;n[o>>2]=1,l=0}}while(0);return P=s,0|l}}while(0)}c=(l=a)+56|0;do{n[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return F(A,e,1,a),l=(0|n[(e=a)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+8|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+16|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+24|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+32|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+40|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)?1:1&((0|n[(l=a+48|0)>>2])==(0|t)?(0|n[l+4>>2])==(0|r):0),n[o>>2]=l,P=s,0},_bitshift64Ashr:et,_bitshift64Lshr:tt,_bitshift64Shl:rt,_calloc:We,_cellAreaKm2:function(A,e,t){return 0|(A=0|ue(A|=0,e|=0,t|=0))||(o[t>>3]=6371.007180918475*+o[t>>3]*6371.007180918475),0|A},_cellAreaM2:function(A,e,t){return 0|(A=0|ue(A|=0,e|=0,t|=0))||(o[t>>3]=6371.007180918475*+o[t>>3]*6371.007180918475*1e3*1e3),0|A},_cellAreaRads2:ue,_cellToBoundary:$A,_cellToCenterChild:GA,_cellToChildPos:function(A,e,t,r){t|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0;if(o=P,P=P+16|0,p=o,x=0|tt(0|(A|=0),0|(e|=0),52),B(),t>>>0>15)return P=o,4;if((0|(x&=15))<(0|t))return P=o,12;if((0|x)!=(0|t))if(a=0|rt(0|t,0,52),a|=A,l=B()|-15728641&e,(0|x)>(0|t)){c=t;do{b=0|rt(7,0,3*(14-c|0)|0),c=c+1|0,a|=b,l=0|B()|l}while((0|c)<(0|x));b=a}else b=a;else b=A,l=e;m=0|tt(0|b,0|l,45),B();A:do{if(0|z(127&m)){if(c=0|tt(0|b,0|l,52),B(),0|(c&=15))for(a=1;;){if(!(!((m=0|rt(7,0,3*(15-a|0)|0))&b)&!((0|B())&l))){u=33;break A}if(!(a>>>0>>0))break;a=a+1|0}if(n[(m=r)>>2]=0,n[m+4>>2]=0,(0|x)>(0|t)){for(m=-15728641&e,h=x;;){if(g=h,(h=h+-1|0)>>>0>15|(0|x)<(0|h)){u=19;break}if((0|x)!=(0|h))if(a=0|rt(0|h,0,52),a|=A,c=0|B()|m,(0|x)<(0|g))f=a;else{u=h;do{f=0|rt(7,0,3*(14-u|0)|0),u=u+1|0,a|=f,c=0|B()|c}while((0|u)<(0|x));f=a}else f=A,c=e;if(d=0|tt(0|f,0|c,45),B(),0|z(127&d)){d=0|tt(0|f,0|c,52),B(),d&=15;e:do{if(d)for(u=1;;){if(a=0|tt(0|f,0|c,3*(15-u|0)|0),B(),0|(a&=7))break e;if(!(u>>>0>>0)){a=0;break}u=u+1|0}else a=0}while(0);a=1&!(0|a)}else a=0;if(c=0|tt(0|A,0|e,3*(15-g|0)|0),B(),7==(0|(c&=7))){i=5,u=42;break}if(1==(0|c)&(a=!!(0|a))){i=5,u=42;break}if(0|(f=c+((!!(0|c)&a)<<31>>31)|0)&&(u=0|pe(7,0,u=x-g|0,((0|u)<0)<<31>>31),d=0|B(),a?(a=0|Ze(0|(a=0|qe(0|u,0|d,5,0)),0|B(),-5,-1),a=0|Ze(0|(a=0|Xe(0|a,0|B(),6,0)),0|B(),1,0),c=0|B()):(a=u,c=d),g=0|Ze(0|a,0|c,0|(g=0|qe(0|u,0|d,0|(g=f+-1|0),((0|g)<0)<<31>>31)),0|B()),d=0|Ze(0|g,0|(f=0|B()),0|n[(d=r)>>2],0|n[d+4>>2]),f=0|B(),n[(g=r)>>2]=d,n[g+4>>2]=f),(0|h)<=(0|t)){u=37;break}}if(19==(0|u))M(27795,27122,1367,27158);else{if(37==(0|u)){i=0|n[(s=r)+4>>2],s=0|n[s>>2];break}if(42==(0|u))return P=o,0|i}}else i=0,s=0}else u=33}while(0);A:do{if(33==(0|u)){if(n[(m=r)>>2]=0,n[m+4>>2]=0,(0|x)>(0|t)){for(a=x;;){if(i=0|tt(0|A,0|e,3*(15-a|0)|0),B(),7==(0|(i&=7))){i=5;break}if(i=0|qe(0|(s=0|pe(7,0,s=x-a|0,((0|s)<0)<<31>>31)),0|B(),0|i,0),s=0|B(),s=0|Ze(0|n[(m=r)>>2],0|n[m+4>>2],0|i,0|s),i=0|B(),n[(m=r)>>2]=s,n[m+4>>2]=i,(0|(a=a+-1|0))<=(0|t))break A}return P=o,0|i}i=0,s=0}}while(0);return 0|_A(b,l,x,p)&&M(27795,27122,1327,27173),((0|i)>-1|-1==(0|i)&s>>>0>4294967295)&((0|(p=0|n[(x=p)+4>>2]))>(0|i)|((0|p)==(0|i)?(0|n[x>>2])>>>0>s>>>0:0))?(P=o,0|(x=0)):(M(27795,27122,1407,27158),0)},_cellToChildren:function(A,e,t,r){r|=0;var o,i,a=0,s=0;if(i=P,P=P+16|0,ee(o=i,A|=0,e|=0,t|=0),!(0|(A=0|n[(e=o)>>2]))&!(0|(e=0|n[e+4>>2])))return P=i,0;a=0,t=0;do{n[(s=r+(a<<3)|0)>>2]=A,n[s+4>>2]=e,a=0|Ze(0|a,0|t,1,0),t=0|B(),re(o),A=0|n[(s=o)>>2],e=0|n[s+4>>2]}while(!(!(0|A)&!(0|e)));return P=i,0},_cellToChildrenSize:_A,_cellToLatLng:qA,_cellToLocalIj:function(A,e,t,r,o,i){var a,s;return A|=0,i|=0,s=P,P=P+16|0,a=s,(o|=0)?A=15:(A=0|me(A,e|=0,t|=0,r|=0,a))||(function(A,e){var t;e|=0,t=0|n[8+(A|=0)>>2],n[e>>2]=(0|n[A>>2])-t,n[e+4>>2]=(0|n[A+4>>2])-t}(a,i),A=0),P=s,0|A},_cellToParent:TA,_cellToVertex:Se,_cellToVertexes:function(A,e,t){t|=0;var r,o=0,i=0;return i=!(0|HA(A|=0,e|=0)),r=!(0|(o=0|Se(A,e,0,t))),i?r?0|(o=0|Se(A,e,1,t+8|0))||0|(o=0|Se(A,e,2,t+16|0))||0|(o=0|Se(A,e,3,t+24|0))||(o=0|Se(A,e,4,t+32|0))?0|(i=o):0|Se(A,e,5,t+40|0):0|(i=o):r?0|(o=0|Se(A,e,1,t+8|0))||0|(o=0|Se(A,e,2,t+16|0))||0|(o=0|Se(A,e,3,t+24|0))||0|(o=0|Se(A,e,4,t+32|0))?0|(i=o):(n[(i=t+40|0)>>2]=0,n[i+4>>2]=0,0|(i=0)):0|(i=o)},_cellsToDirectedEdge:function(A,e,t,r,o){return o|=0,7==(0|(t=0|_(A|=0,e|=0,t|=0,r|=0)))?0|(o=11):(r=0|rt(0|t,0,56),e=-2130706433&e|B()|268435456,n[o>>2]=A|r,n[o+4>>2]=e,0|(o=0))},_cellsToLinkedMultiPolygon:function(A,e,t){t|=0;var r,i,a,s=0;if(a=P,P=P+32|0,r=a,0|(A=0|function(A,e,t){A|=0,t|=0;var r,o,i=0,a=0,s=0,l=0,c=0,u=0;if(o=P,P=P+176|0,r=o,(0|(e|=0))<1)return Ie(t,0,0),P=o,0;for(c=0|tt(0|n[(c=A)>>2],0|n[c+4>>2],52),B(),Ie(t,(0|e)>6?e:6,15&c),c=0;!(0|(i=0|$A(0|n[(i=A+(c<<3)|0)>>2],0|n[i+4>>2],r)));){if((0|(i=0|n[r>>2]))>0){l=0;do{s=r+8+(l<<4)|0,(a=0|ze(t,i=r+8+((0|(l=l+1|0))%(0|i)<<4)|0,s))?_e(t,a):He(t,s,i),i=0|n[r>>2]}while((0|l)<(0|i))}if((0|(c=c+1|0))>=(0|e)){i=0,u=13;break}}return 13==(0|u)?(P=o,0|i):(Re(t),P=o,0|(u=i))}(A|=0,e|=0,i=a+16|0)))return P=a,0|A;if(n[t>>2]=0,n[t+4>>2]=0,n[t+8>>2]=0,0|(A=0|Te(i)))do{e=0|de(t);do{fe(e,A),s=A+16|0,n[r>>2]=n[s>>2],n[r+4>>2]=n[s+4>>2],n[r+8>>2]=n[s+8>>2],n[r+12>>2]=n[s+12>>2],_e(i,A),A=0|Ge(i,r)}while(0|A);A=0|Te(i)}while(0|A);return Re(i),(A=0|function(A){var e,t,r=0,i=0,a=0,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,D=0,E=0,N=0,Q=0,j=0,P=0,F=0,S=0,L=0,I=0;if(0|n[(s=(A|=0)+8|0)>>2])return 1;if(!(a=0|n[A>>2]))return 0;r=a,i=0;do{i=i+1|0,r=0|n[r+8>>2]}while(0|r);if(i>>>0<2)return 0;(t=0|Ue(i<<2))||M(27396,27235,317,27415),(e=0|Ue(i<<5))||M(27437,27235,321,27415),n[A>>2]=0,n[(E=A+4|0)>>2]=0,n[s>>2]=0,i=0,S=0,D=0,m=0;A:for(;;){if(h=0|n[a>>2]){c=0,u=h;do{if(f=+o[u+8>>3],r=u,u=0|n[u+16>>2],d=+o[(s=(g=!(0|u))?h:u)+8>>3],+l(+(f-d))>3.141592653589793){I=14;break}c+=(d-f)*(+o[r>>3]+ +o[s>>3])}while(!g);if(14==(0|I)){I=0,c=0,r=h;do{B=+o[r+8>>3],P=0|n[(F=r+16|0)>>2],C=+o[(P=0|P?P:h)+8>>3],c+=(+o[r>>3]+ +o[P>>3])*((C<0?C+6.283185307179586:C)-(B<0?B+6.283185307179586:B)),r=0|n[(0|r?F:a)>>2]}while(0|r)}c>0?(n[t+(S<<2)>>2]=a,S=S+1|0,s=D,r=m):I=19}else I=19;if(19==(0|I)){I=0;do{if(!i){if(m){s=E,u=m+8|0,r=a,i=A;break}if(0|n[A>>2]){I=27;break A}s=E,u=A,r=a,i=A;break}if(0|n[(r=i+8|0)>>2]){I=21;break A}if(!(i=0|We(1,12))){I=23;break A}n[r>>2]=i,s=i+4|0,u=i,r=m}while(0);if(n[u>>2]=a,n[s>>2]=a,u=e+(D<<5)|0,g=0|n[a>>2]){for(o[(h=e+(D<<5)+8|0)>>3]=17976931348623157e292,o[(m=e+(D<<5)+24|0)>>3]=17976931348623157e292,o[u>>3]=-17976931348623157e292,o[(b=e+(D<<5)+16|0)>>3]=-17976931348623157e292,y=17976931348623157e292,k=-17976931348623157e292,s=0,p=g,f=17976931348623157e292,v=17976931348623157e292,w=-17976931348623157e292,d=-17976931348623157e292;c=+o[p>>3],B=+o[p+8>>3],p=0|n[p+16>>2],C=+o[((x=!(0|p))?g:p)+8>>3],c>3]=c,f=c),B>3]=B,v=B),c>w?o[u>>3]=c:c=w,B>d&&(o[b>>3]=B,d=B),y=B>0&Bk?B:k,s|=+l(+(B-C))>3.141592653589793,!x;)w=c;s&&(o[b>>3]=k,o[m>>3]=y)}else n[u>>2]=0,n[u+4>>2]=0,n[u+8>>2]=0,n[u+12>>2]=0,n[u+16>>2]=0,n[u+20>>2]=0,n[u+24>>2]=0,n[u+28>>2]=0;s=D+1|0}if(a=0|n[(F=a+8|0)>>2],n[F>>2]=0,!a){I=45;break}D=s,m=r}if(21==(0|I))M(27213,27235,35,27247);else if(23==(0|I))M(27267,27235,37,27247);else if(27==(0|I))M(27310,27235,61,27333);else if(45==(0|I)){A:do{if((0|S)>0){for(F=!(0|s),j=s<<2,P=!(0|A),Q=0,r=0;;){if(N=0|n[t+(Q<<2)>>2],F)I=73;else{if(!(D=0|Ue(j))){I=50;break}if(!(E=0|Ue(j))){I=52;break}e:do{if(P)i=0;else{for(s=0,i=0,u=A;a=e+(s<<5)|0,0|he(0|n[u>>2],a,0|n[N>>2])?(n[D+(i<<2)>>2]=u,n[E+(i<<2)>>2]=a,x=i+1|0):x=i,u=0|n[u+8>>2];)s=s+1|0,i=x;if((0|x)>0)if(a=0|n[D>>2],1==(0|x))i=a;else for(b=0,p=-1,i=a,m=a;;){for(g=0|n[m>>2],a=0,u=0;h=(0|(s=0|n[n[D+(u<<2)>>2]>>2]))==(0|g)?a:a+(1&he(s,0|n[E+(u<<2)>>2],0|n[g>>2]))|0,(0|(u=u+1|0))!=(0|x);)a=h;if(i=(s=(0|h)>(0|p))?m:i,(0|(a=b+1|0))==(0|x))break e;b=a,p=s?h:p,m=0|n[D+(a<<2)>>2]}else i=0}}while(0);if(Ye(D),Ye(E),i){if(a=0|n[(s=i+4|0)>>2])i=a+8|0;else if(0|n[i>>2]){I=70;break}n[i>>2]=N,n[s>>2]=N}else I=73}if(73==(0|I)){if(I=0,0|(r=0|n[N>>2]))do{E=r,r=0|n[r+16>>2],Ye(E)}while(0|r);Ye(N),r=1}if((0|(Q=Q+1|0))>=(0|S)){L=r;break A}}50==(0|I)?M(27452,27235,249,27471):52==(0|I)?M(27490,27235,252,27471):70==(0|I)&&M(27310,27235,61,27333)}else L=0}while(0);return Ye(t),Ye(e),0|L}return 0}(t))?(ge(t),P=a,0|(s=A)):(P=a,0|(s=0))},_childPosToCell:function(A,e,t,r,o,i){A|=0,e|=0,i|=0;var a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(a=P,P=P+16|0,s=a,(o|=0)>>>0>15)return P=a,4;if(l=0|tt(0|(t|=0),0|(r|=0),52),B(),(0|(l&=15))>(0|o))return P=a,12;if(0|_A(t,r,o,s)&&M(27795,27122,1327,27173),!(((0|e)>-1|-1==(0|e)&A>>>0>4294967295)&((0|(u=0|n[(d=s)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|n[d>>2])>>>0>A>>>0:0))))return P=a,2;d=o-l|0,o=0|rt(0|o,0,52),c=B()|-15728641&r,n[(u=i)>>2]=o|t,n[u+4>>2]=c,u=0|tt(0|t,0|r,45),B();A:do{if(0|z(127&u)){if(0|l)for(s=1;;){if(!(!((u=0|rt(7,0,3*(15-s|0)|0))&t)&!((0|B())&r)))break A;if(!(s>>>0>>0))break;s=s+1|0}if((0|d)<1)return P=a,0;for(u=15^l,r=-1,c=1,s=1;;){l=0|pe(7,0,l=d-c|0,((0|l)<0)<<31>>31),t=0|B();do{if(s){if(s=0|Xe(0|(s=0|Ze(0|(s=0|qe(0|l,0|t,5,0)),0|B(),-5,-1)),0|B(),6,0),(0|e)>(0|(o=0|B()))|(0|e)==(0|o)&A>>>0>s>>>0){e=0|Ve(0|(e=0|Ze(0|A,0|e,-1,-1)),0|B(),0|s,0|o),s=0|B(),h=0|n[(f=i)>>2],f=0|n[f+4>>2],g=0|rt(7,0,0|(m=3*(u+r|0)|0)),f&=~B(),m=0|rt(0|(o=0|Ze(0|(r=0|Xe(0|e,0|s,0|l,0|t)),0|(A=0|B()),2,0)),0|B(),0|m),f=0|B()|f,n[(o=i)>>2]=m|h&~g,n[o+4>>2]=f,A=0|Ve(0|e,0|s,0|(A=0|qe(0|r,0|A,0|l,0|t)),0|B()),s=0,e=0|B();break}g=0|n[(m=i)>>2],m=0|n[m+4>>2],h=0|rt(7,0,3*(u+r|0)|0),m&=~B(),n[(s=i)>>2]=g&~h,n[s+4>>2]=m,s=1;break}o=0|n[(g=i)>>2],g=0|n[g+4>>2],f=0|rt(7,0,0|(r=3*(u+r|0)|0)),g&=~B(),r=0|rt(0|(m=0|Xe(0|A,0|e,0|l,0|t)),0|(s=0|B()),0|r),g=0|B()|g,n[(h=i)>>2]=r|o&~f,n[h+4>>2]=g,A=0|Ve(0|A,0|e,0|(s=0|qe(0|m,0|s,0|l,0|t)),0|B()),s=0,e=0|B()}while(0);if(!((0|d)>(0|c))){e=0;break}r=~c,c=c+1|0}return P=a,0|e}}while(0);if((0|d)<1)return P=a,0;for(o=15^l,s=1;;){if(h=0|pe(7,0,h=d-s|0,((0|h)<0)<<31>>31),m=0|B(),t=0|n[(c=i)>>2],c=0|n[c+4>>2],r=0|rt(7,0,0|(l=3*(o-s|0)|0)),c&=~B(),l=0|rt(0|(f=0|Xe(0|A,0|e,0|h,0|m)),0|(g=0|B()),0|l),c=0|B()|c,n[(u=i)>>2]=l|t&~r,n[u+4>>2]=c,A=0|Ve(0|A,0|e,0|(m=0|qe(0|f,0|g,0|h,0|m)),0|B()),e=0|B(),(0|d)<=(0|s)){e=0;break}s=s+1|0}return P=a,0|e},_compactCells:function(A,e,t,r){e|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,D=0,E=0,N=0,Q=0,j=0,P=0;if(!(0|(t|=0))&!(0|(r|=0)))return 0;if(a=0|n[(i=A|=0)>>2],!0&!(15728640&(i=0|n[i+4>>2]))){if(!((0|r)>0|!(0|r)&t>>>0>0))return 0;if(n[(P=e)>>2]=a,n[P+4>>2]=i,1==(0|t)&!(0|r))return 0;i=1,a=0;do{j=0|n[4+(Q=A+(i<<3)|0)>>2],n[(P=e+(i<<3)|0)>>2]=n[Q>>2],n[P+4>>2]=j,i=0|Ze(0|i,0|a,1,0),a=0|B()}while((0|a)<(0|r)|(0|a)==(0|r)&i>>>0>>0);return 0}if(!(j=0|Ue(o=t<<3)))return 13;if(st(0|j,0|A,0|o),!(Q=0|We(t,8)))return Ye(j),13;A:for(;;){E=0|tt(0|(u=0|n[(i=j)>>2]),0|(i=0|n[i+4>>2]),52),B(),N=(E&=15)-1|0,D=!!(0|E),C=(0|r)>0|!(0|r)&t>>>0>0;e:do{if(D&C){if(v=0|rt(0|N,0,52),w=0|B(),N>>>0>15){if(!(!(0|u)&!(0|i))){P=16;break A}for(a=0,A=0;;){if(a=0|Ze(0|a,0|A,1,0),!((0|(A=0|B()))<(0|r)|(0|A)==(0|r)&a>>>0>>0))break e;if(!(!(0|(k=0|n[(s=j+(a<<3)|0)>>2]))&!(0|(s=0|n[s+4>>2])))){i=s,P=16;break A}}}for(l=u,A=i,a=0,s=0;;){if(!(!(0|l)&!(0|A))){if(!(!0&!(117440512&A))){P=21;break A}if(d=0|tt(0|l,0|A,52),B(),(0|(d&=15))<(0|N)){i=12,P=27;break A}if((0|d)!=(0|N)&&(l|=v,A=-15728641&A|w,d>>>0>=E>>>0)){c=N;do{k=0|rt(7,0,3*(14-c|0)|0),c=c+1|0,l|=k,A=0|B()|A}while(c>>>0>>0)}if(g=0|At(0|l,0|A,0|t,0|r),h=0|B(),!(!(0|(f=0|n[(d=c=Q+(g<<3)|0)>>2]))&!(0|(d=0|n[d+4>>2])))){p=0,x=0;do{if((0|p)>(0|r)|(0|p)==(0|r)&x>>>0>t>>>0){P=31;break A}if((0|f)==(0|l)&(-117440513&d)==(0|A)){m=0|tt(0|f,0|d,56),B(),b=1+(m&=7)|0,k=0|tt(0|f,0|d,45),B();t:do{if(0|z(127&k)){if(f=0|tt(0|f,0|d,52),B(),!(f&=15)){d=6;break}for(d=1;;){if(!(!((k=0|rt(7,0,3*(15-d|0)|0))&l)&!((0|B())&A))){d=7;break t}if(!(d>>>0>>0)){d=6;break}d=d+1|0}}else d=7}while(0);if((m+2|0)>>>0>d>>>0){P=41;break A}k=0|rt(0|b,0,56),A=B()|-117440513&A,n[(y=c)>>2]=0,n[y+4>>2]=0,l|=k}else g=0|$e(0|(g=0|Ze(0|g,0|h,1,0)),0|B(),0|t,0|r),h=0|B();x=0|Ze(0|x,0|p,1,0),p=0|B(),f=0|n[(d=c=Q+(g<<3)|0)>>2],d=0|n[d+4>>2]}while(!(!(0|f)&!(0|d)))}n[(k=c)>>2]=l,n[k+4>>2]=A}if(a=0|Ze(0|a,0|s,1,0),!((0|(s=0|B()))<(0|r)|(0|s)==(0|r)&a>>>0>>0))break e;l=0|n[(A=j+(a<<3)|0)>>2],A=0|n[A+4>>2]}}}while(0);if(k=0|Ze(0|t,0|r,5,0),(y=0|B())>>>0<0|!(0|y)&k>>>0<11){P=85;break}if(k=0|Xe(0|t,0|r,6,0),B(),!(k=0|We(k,8))){P=48;break}do{if(C){for(b=0,A=0,m=0,p=0;;){if(!(0|(a=0|n[(s=d=Q+(b<<3)|0)>>2]))&!(0|(s=0|n[s+4>>2])))y=m;else{f=0|tt(0|a,0|s,56),B(),l=1+(f&=7)|0,g=-117440513&s,y=0|tt(0|a,0|s,45),B();e:do{if(0|z(127&y)){if(h=0|tt(0|a,0|s,52),B(),0|(h&=15))for(c=1;;){if(!(!(a&(y=0|rt(7,0,3*(15-c|0)|0)))&!(g&(0|B()))))break e;if(!(c>>>0>>0))break;c=c+1|0}a|=s=0|rt(0|l,0,56),s=0|B()|g,n[(l=d)>>2]=a,n[l+4>>2]=s,l=f+2|0}}while(0);7==(0|l)?(n[(y=k+(A<<3)|0)>>2]=a,n[y+4>>2]=-117440513&s,A=0|Ze(0|A,0|m,1,0),y=0|B()):y=m}if(b=0|Ze(0|b,0|p,1,0),!((0|(p=0|B()))<(0|r)|(0|p)==(0|r)&b>>>0>>0))break;m=y}if(C){if(x=N>>>0>15,v=0|rt(0|N,0,52),w=0|B(),!D){for(a=0,c=0,l=0,s=0;!(0|u)&!(0|i)||(n[(N=e+(a<<3)|0)>>2]=u,n[N+4>>2]=i,a=0|Ze(0|a,0|c,1,0),c=0|B()),l=0|Ze(0|l,0|s,1,0),(0|(s=0|B()))<(0|r)|(0|s)==(0|r)&l>>>0>>0;)u=0|n[(i=j+(l<<3)|0)>>2],i=0|n[i+4>>2];i=y;break}for(a=0,c=0,s=0,l=0;;){do{if(!(!(0|u)&!(0|i))){if(h=0|tt(0|u,0|i,52),B(),x|(0|(h&=15))<(0|N)){P=80;break A}if((0|h)!=(0|N)){if(d=u|v,f=-15728641&i|w,h>>>0>=E>>>0){g=N;do{D=0|rt(7,0,3*(14-g|0)|0),g=g+1|0,d|=D,f=0|B()|f}while(g>>>0>>0)}}else d=u,f=i;m=0|At(0|d,0|f,0|t,0|r),g=0,h=0,p=0|B();do{if((0|g)>(0|r)|(0|g)==(0|r)&h>>>0>t>>>0){P=81;break A}if((-117440513&(b=0|n[4+(D=Q+(m<<3)|0)>>2]))==(0|f)&&(0|n[D>>2])==(0|d)){P=65;break}m=0|$e(0|(D=0|Ze(0|m,0|p,1,0)),0|B(),0|t,0|r),p=0|B(),h=0|Ze(0|h,0|g,1,0),g=0|B(),D=Q+(m<<3)|0}while((0|n[D>>2])!=(0|d)||(0|n[D+4>>2])!=(0|f));if(65==(0|P)&&(P=0,!0&100663296==(117440512&b)))break;n[(D=e+(a<<3)|0)>>2]=u,n[D+4>>2]=i,a=0|Ze(0|a,0|c,1,0),c=0|B()}}while(0);if(s=0|Ze(0|s,0|l,1,0),!((0|(l=0|B()))<(0|r)|(0|l)==(0|r)&s>>>0>>0))break;u=0|n[(i=j+(s<<3)|0)>>2],i=0|n[i+4>>2]}i=y}else a=0,i=y}else a=0,A=0,i=0}while(0);if(lt(0|Q,0,0|o),st(0|j,0|k,A<<3),Ye(k),!(0|A)&!(0|i)){P=89;break}e=e+(a<<3)|0,r=i,t=A}if(16==(0|P))!0&!(117440512&i)?(i=4,P=27):P=21;else if(31==(0|P))M(27795,27122,620,27132);else{if(41==(0|P))return Ye(j),Ye(Q),10;if(48==(0|P))return Ye(j),Ye(Q),13;80==(0|P)?M(27795,27122,711,27132):81==(0|P)?M(27795,27122,723,27132):85==(0|P)&&(st(0|e,0|j,t<<3),P=89)}return 21==(0|P)?(Ye(j),Ye(Q),0|(P=5)):27==(0|P)?(Ye(j),Ye(Q),0|(P=i)):89==(0|P)?(Ye(j),Ye(Q),0|(P=0)):0},_constructCell:function(A,e,t,o){t|=0,o|=0;var i=0,a=0,s=0,l=0,c=0,u=0;if((A|=0)>>>0>15)return 4;if((e|=0)>>>0>121)return 17;s=0|rt(0|A,0,52),i=0|B(),l=0|rt(0|e,0,45),i=0|i|B()|134225919;A:do{if((0|A)>=1){for(l=1,s=!!(0|r[20528+e|0]),a=-1;;){if((e=0|n[t+(l+-1<<2)>>2])>>>0>6){i=18,e=10;break}if(!(!(0|e)|1^s)){if(1==(0|e)){i=19,e=10;break}s=0}if(c=0|rt(7,0,0|(u=3*(15-l|0)|0)),i&=~B(),a=(e=0|rt(0|e,((0|e)<0)<<31>>31,0|u))|a&~c,i=0|B()|i,!((0|l)<(0|A)))break A;l=l+1|0}if(10==(0|e))return 0|i}else a=-1}while(0);return n[(u=o)>>2]=a,n[u+4>>2]=i,0},_destroyLinkedMultiPolygon:ge,_directedEdgeToBoundary:DA,_directedEdgeToCells:function(A,e,t){A|=0;var r,o,i,a=0;return r=P,P=P+16|0,a=r,!0&268435456==(2013265920&(e|=0))?(o=-2130706433&e|134217728,n[(i=t|=0)>>2]=A,n[i+4>>2]=o,n[a>>2]=0,e=0|tt(0|A,0|e,56),B(),a=0|R(A,o,7&e,a,t+8|0),P=r,0|a):(P=r,0|(a=6))},_edgeLengthKm:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return l=A,s=+o[t>>3],s*=6371.007180918475,o[t>>3]=s,P=r,0|l;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,s=0,s*=6371.007180918475,o[t>>3]=s,P=r,0|l;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+g)*+d(+i)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)!=(0|e));return o[t>>3]=s,l=0,h=s,h*=6371.007180918475,o[t>>3]=h,P=r,0|l},_edgeLengthM:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return l=A,s=+o[t>>3],s*=6371.007180918475,s*=1e3,o[t>>3]=s,P=r,0|l;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,s=0,s*=6371.007180918475,s*=1e3,o[t>>3]=s,P=r,0|l;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+g)*+d(+i)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)!=(0|e));return o[t>>3]=s,l=0,h=s,h*=6371.007180918475,h*=1e3,o[t>>3]=h,P=r,0|l},_edgeLengthRads:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return P=r,0|A;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return P=r,0;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+i)*+d(+g)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)<(0|e));return o[t>>3]=s,P=r,0},_emscripten_replace_memory:function(A){return r=new Int8Array(A),n=new Int32Array(A),o=new Float64Array(A),t=A,!0},_free:Ye,_getBaseCellNumber:LA,_getDirectedEdgeDestination:function(A,e,t){A|=0,e|=0,t|=0;var r,o,i=0;return r=P,P=P+16|0,n[(i=r)>>2]=0,!0&268435456==(2013265920&e)?(o=0|tt(0|A,0|e,56),B(),i=0|R(A,-2130706433&e|134217728,7&o,i,t),P=r,0|i):(P=r,0|(i=6))},_getDirectedEdgeOrigin:function(A,e,t){return A|=0,t|=0,!0&268435456==(2013265920&(e|=0))?(n[t>>2]=A,n[t+4>>2]=-2130706433&e|134217728,0|(t=0)):0|(t=6)},_getHexagonAreaAvgKm2:se,_getHexagonAreaAvgM2:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20784+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20912+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[21040+(A<<3)>>3],0|(e=0))},_getIcosahedronFaces:function A(e,t,r){r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0;o=P,P=P+128|0,d=o+112|0,s=o+96|0,f=o,a=0|tt(0|(e|=0),0|(t|=0),52),B(),c=15&a,n[d>>2]=c,l=0|tt(0|e,0|t,45),B(),l&=127;A:do{if(0|z(l)){if(0|c)for(i=1;;){if(!(!((u=0|rt(7,0,3*(15-i|0)|0))&e)&!((0|B())&t))){a=0;break A}if(!(i>>>0>>0))break;i=i+1|0}if(!(1&a))return u=0|rt(c+1|0,0,52),f=B()|-15728641&t,f=0|A((u|e)&~(d=0|rt(7,0,3*(14-c|0)|0)),f&~B(),r),P=o,0|f;a=1}else a=0}while(0);if(!(i=0|XA(e,t,s))){a?(QA(s,d,f),u=5):(SA(s,d,f),u=6);A:do{if(0|z(l))if(c)for(i=1;;){if(!(!((l=0|rt(7,0,3*(15-i|0)|0))&e)&!((0|B())&t))){e=2;break A}if(!(i>>>0>>0)){e=5;break}i=i+1|0}else e=5;else e=2}while(0);lt(0|r,-1,e<<2);A:do{if(a)for(s=0;;){if(PA(l=f+(s<<4)|0,0|n[d>>2]),l=0|n[l>>2],-1==(0|(c=0|n[r>>2]))|(0|c)==(0|l))i=r;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){i=1;break A}c=0|n[(i=r+(a<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(n[i>>2]=l,(s=s+1|0)>>>0>=u>>>0){i=0;break}}else for(s=0;;){if(jA(l=f+(s<<4)|0,0|n[d>>2],0,1),l=0|n[l>>2],-1==(0|(c=0|n[r>>2]))|(0|c)==(0|l))i=r;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){i=1;break A}c=0|n[(i=r+(a<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(n[i>>2]=l,(s=s+1|0)>>>0>=u>>>0){i=0;break}}}while(0)}return P=o,0|i},_getIndexDigit:function(A,e,t,r){return r|=0,((t|=0)-1|0)>>>0>14?0|(r=4):(t=0|tt(0|(A|=0),0|(e|=0),3*(15-t|0)|0),B(),n[r>>2]=7&t,0|(r=0))},_getNumCells:le,_getPentagons:Ae,_getRes0Cells:function(A){A|=0;var e=0,t=0,r=0;e=0;do{rt(0|e,0,45),r=134225919|B(),n[(t=A+(e<<3)|0)>>2]=-1,n[t+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(A,e){return e=0|tt(0|(A|=0),0|(e|=0),52),B(),15&e},_greatCircleDistanceKm:ae,_greatCircleDistanceM:function(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))},_gridDisk:F,_gridDiskDistances:S,_gridDistance:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a,s=0,l=0;return a=P,P=P+32|0,l=a,0|(i=0|me(A|=0,e|=0,A,e,s=a+12|0))?(P=a,0|(l=i)):0|(A=0|me(A,e,t,r,l))?(P=a,0|(l=A)):(s=0|kA(s,l),n[(l=o)>>2]=s,n[l+4>>2]=((0|s)<0)<<31>>31,P=a,0|(l=0))},_gridPathCells:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,D=0,E=0;if(a=P,P=P+48|0,c=a+12|0,D=a,!(s=0|me(A|=0,e|=0,A,e,i=a+24|0))&&!(s=0|me(A,e,t,r,c))){C=((0|(k=0|kA(i,c)))<0)<<31>>31,n[i>>2]=0,n[i+4>>2]=0,n[i+8>>2]=0,n[c>>2]=0,n[c+4>>2]=0,n[c+8>>2]=0,0|me(A,e,A,e,i)&&M(27795,27538,692,27747),0|me(A,e,t,r,c)&&M(27795,27538,697,27747),CA(i),CA(c),g=0|k?1/+(0|k):0,t=0|n[i>>2],x=g*+((0|n[c>>2])-t|0),r=0|n[(v=i+4|0)>>2],w=g*+((0|n[c+4>>2])-r|0),s=0|n[(y=i+8|0)>>2],g*=+((0|n[c+8>>2])-s|0),n[D>>2]=t,n[(h=D+4|0)>>2]=r,n[(m=D+8|0)>>2]=s;A:do{if((0|k)<0)s=0;else for(b=0,p=0;;){E=x*(d=+(p>>>0)+4294967296*+(0|b))+ +(0|t),u=w*d+ +(0|r),d=g*d+ +(0|s),t=~~+at(+E),c=~~+at(+u),s=~~+at(+d),E=+l(+(+(0|t)-E)),u=+l(+(+(0|c)-u)),d=+l(+(+(0|s)-d));do{if(!(E>u&E>d)){if(f=0-t|0,u>d){r=f-s|0;break}r=c,s=f-c|0;break}t=0-(c+s)|0,r=c}while(0);if(n[D>>2]=t,n[h>>2]=r,n[m>>2]=s,BA(D),0|(s=0|be(A,e,D,o+(p<<3)|0)))break A;if(!((0|b)<(0|C)|(0|b)==(0|C)&p>>>0>>0)){s=0;break A}t=0|Ze(0|p,0|b,1,0),b=r=0|B(),p=t,t=0|n[i>>2],r=0|n[v>>2],s=0|n[y>>2]}}while(0);return P=a,0|s}return P=a,0|s},_gridPathCellsSize:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a=0,s=0,l=0;return i=P,P=P+32|0,l=i,(a=0|me(A|=0,e|=0,A,e,s=i+12|0))||(a=0|me(A,e,t,r,l))?(P=i,0|(l=a)):(r=0|Ze(0|(r=0|kA(s,l)),((0|r)<0)<<31>>31,1,0),s=0|B(),n[(l=o)>>2]=r,n[l+4>>2]=s,P=i,0|(l=0))},_gridRing:function(A,e,t,r){return 0|T(A|=0,e|=0,t|=0,r|=0)?(lt(0|r,0,48*t|0),0|(r=0|function(A,e,t,r){A|=0,e|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0;if(o=P,P=P+16|0,s=o,!(t|=0))return n[r>>2]=A,n[r+4>>2]=e,P=o,0;do{if((0|t)>=0){if((0|t)>13780509){if(0|(i=0|le(15,s)))break;i=0|n[(a=s)>>2],a=0|n[a+4>>2]}else d=0|qe(0|t,0|(i=((0|t)<0)<<31>>31),3,0),a=0|B(),i=0|Ze(0|t,0|i,1,0),i=0|Ze(0|(i=0|qe(0|d,0|a,0|i,0|B())),0|B(),1,0),a=0|B(),n[(d=s)>>2]=i,n[d+4>>2]=a;if(u=0|We(i,8)){if(!(d=0|We(i,4))){Ye(u),i=13;break}if(0|(i=0|I(A,e,t,u,d,i,a,0))){Ye(u),Ye(d);break}if(e=0|n[s>>2],(0|(s=0|n[s+4>>2]))>0|!(0|s)&e>>>0>0){i=0,l=0,c=0;do{!(0|(a=0|n[(A=u+(l<<3)|0)>>2]))&!(0|(A=0|n[A+4>>2]))||(0|n[d+(l<<2)>>2])!=(0|t)||(n[(f=r+(i<<3)|0)>>2]=a,n[f+4>>2]=A,i=i+1|0),l=0|Ze(0|l,0|c,1,0),c=0|B()}while((0|c)<(0|s)|(0|c)==(0|s)&l>>>0>>0)}Ye(u),Ye(d),i=0}else i=13}else i=2}while(0);return P=o,0|i}(A,e,t,r))):0|(r=0)},_gridRingUnsafe:T,_i64Add:Ze,_i64Subtract:Ve,_isPentagon:HA,_isResClassIII:function(A,e){return e=0|tt(0|(A|=0),0|(e|=0),52),B(),1&e},_isValidCell:IA,_isValidDirectedEdge:MA,_isValidIndex:function(A,e){A|=0;var t=0,n=0,o=0,i=0;if(!0&134217728==(-16777216&(e|=0))&&(n=0|tt(0|A,0|e,52),B(),n&=15,t=0|tt(0|A,0|e,45),B(),(t&=127)>>>0<=121)&&!(613566756&(i=0|rt(0|(o=0|tt(0|A,0|e,0|(i=3*(15^n)|0))),0|B(),0|i))&Ve(-1227133514,-1171,0|i,0|(o=0|B())))&!(4681&o&B())&&15==(0|n)|!(0|(i=0|tt(0|rt(0|~A,0|~e,0|(i=19+(3*n|0)|0)),0|B(),0|i)))&!(0|B())){if(!(0|r[20528+t|0]))return 1;if(!(0|A)&!(0|(t=8191&e)))return 1;if(i=0|nt(0|A,0|t),B(),(63-i|0)%3|0)return 1}return 0|MA(A,e)?0|(i=1):0|(i=1&!!(0|Le(A,e)))},_isValidVertex:Le,_latLngToCell:KA,_llvm_ctlz_i64:nt,_llvm_maxnum_f64:ot,_llvm_minnum_f64:it,_llvm_round_f64:at,_localIjToCell:function(A,e,t,r,o){var i,a;return A|=0,e|=0,t|=0,o|=0,a=P,P=P+16|0,i=a,(r|=0)?t=15:(t=0|function(A,e){e|=0;var t,r,o,i=0,a=0,s=0;if(a=0|n[(A|=0)>>2],n[e>>2]=a,s=0|n[A+4>>2],n[(r=e+4|0)>>2]=s,n[(o=e+8|0)>>2]=0,A=(i=(0|s)<(0|a))?a:s,(0|(i=i?s:a))<0){if(-2147483648==(0|i)||((0|A)>0?(2147483647-A|0)<(0|i):(-2147483648-A|0)>(0|i)))return 1;if((0|A)>-1?(-2147483648|A)>=(0|i):(-2147483648^A)<(0|i))return 1}return A=s-a|0,(0|a)<0?(i=0-a|0,n[r>>2]=A,n[o>>2]=i,n[e>>2]=0,a=0):(A=s,i=0),(0|A)<0&&(a=a-A|0,n[e>>2]=a,i=i-A|0,n[o>>2]=i,n[r>>2]=0,A=0),t=a-i|0,s=A-i|0,(0|i)<0?(n[e>>2]=t,n[r>>2]=s,n[o>>2]=0,A=s,s=t,i=0):s=a,(0|(a=(0|i)<(0|(a=(0|A)<(0|s)?A:s))?i:a))<=0||(n[e>>2]=s-a,n[r>>2]=A-a,n[o>>2]=i-a),0}(t,i))||(t=0|be(A,e,i,o)),P=a,0|t},_malloc:Ue,_maxFaceCount:function(A,e,t){t|=0;var r=0,o=0;if(o=0|tt(0|(A|=0),0|(e|=0),45),B(),!(0|z(127&o)))return o=2,n[t>>2]=o,0;if(o=0|tt(0|A,0|e,52),B(),!(o&=15))return o=5,n[t>>2]=o,0;for(r=1;;){if(!(!((0|rt(7,0,3*(15-r|0)|0))&A)&!((0|B())&e))){r=2,A=6;break}if(!(r>>>0>>0)){r=5,A=6;break}r=r+1|0}return 6==(0|A)?(n[t>>2]=r,0):0},_maxGridDiskSize:function(A,e){e|=0;var t=0,r=0,o=0;return(0|(A|=0))<0?0|(e=2):(0|A)>13780509?0|(e=0|le(15,e)):(o=0|qe(0|A,0|(t=((0|A)<0)<<31>>31),3,0),r=0|B(),t=0|Ze(0|A,0|t,1,0),t=0|Ze(0|(t=0|qe(0|o,0|r,0|t,0|B())),0|B(),1,0),A=0|B(),n[e>>2]=t,n[e+4>>2]=A,0|(e=0))},_maxPolygonToCellsSize:function(A,e,t,r){A|=0,e|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0;if(o=P,P=P+48|0,i=o+16|0,a=o+8|0,s=o,0|(t=0|Ce(t|=0)))return P=o,0|t;if(l=0|n[(c=A)+4>>2],n[(t=a)>>2]=n[c>>2],n[t+4>>2]=l,ke(a,i),!(t=0|eA(i,e,s))){if(e=0|n[a>>2],(0|(a=0|n[A+8>>2]))>0){i=0|n[A+12>>2],t=0;do{e=(0|n[i+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|a))}i=0|n[(t=s)>>2],(0|(t=0|n[t+4>>2]))<(0|(a=((0|e)<0)<<31>>31))|(0|t)==(0|a)&i>>>0>>0?(n[(t=s)>>2]=e,n[t+4>>2]=a,t=a):e=i,l=0|Ze(0|e,0|t,12,0),c=0|B(),n[(t=s)>>2]=l,n[t+4>>2]=c,n[(t=r)>>2]=l,n[t+4>>2]=c,t=0}return P=o,0|t},_maxPolygonToCellsSizeExperimental:function(A,e,t,i){e|=0,t|=0,i|=0;var a,s,c=0,u=0,f=0,g=0,h=0,m=0,b=0,p=0;if(s=P,P=P+48|0,h=s+32|0,g=s+40|0,a=s,!(0|n[(A|=0)>>2]))return n[(m=i)>>2]=0,n[m+4>>2]=0,P=s,0;RA(h,0,0,0),c=0|n[(f=h)>>2],f=0|n[f+4>>2];do{if(e>>>0>15)n[(m=a)>>2]=0,n[m+4>>2]=0,n[a+8>>2]=4,n[a+12>>2]=-1,t=a+29|0,n[(m=a+16|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,r[m+12|0]=0,r[0|t]=0|r[0|g],r[t+1|0]=0|r[g+1|0],r[t+2|0]=0|r[g+2|0],t=4,m=9;else{if(0|(t=0|Ce(t))){n[(h=a)>>2]=0,n[h+4>>2]=0,n[a+8>>2]=t,n[a+12>>2]=-1,m=a+29|0,n[(h=a+16|0)>>2]=0,n[h+4>>2]=0,n[h+8>>2]=0,r[h+12|0]=0,r[0|m]=0|r[0|g],r[m+1|0]=0|r[g+1|0],r[m+2|0]=0|r[g+2|0],m=9;break}if(!(t=0|We(1+(0|n[A+8>>2])|0,32))){n[(m=a)>>2]=0,n[m+4>>2]=0,n[a+8>>2]=13,n[a+12>>2]=-1,t=a+29|0,n[(m=a+16|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,r[m+12|0]=0,r[0|t]=0|r[0|g],r[t+1|0]=0|r[g+1|0],r[t+2|0]=0|r[g+2|0],t=13,m=9;break}Be(A,t),n[(p=a)>>2]=c,n[p+4>>2]=f,n[(f=a+8|0)>>2]=0,n[a+12>>2]=e,n[a+20>>2]=A,n[a+24>>2]=t,r[a+28|0]=0,r[0|(c=a+29|0)]=0|r[0|g],r[c+1|0]=0|r[g+1|0],r[c+2|0]=0|r[g+2|0],n[a+16>>2]=3,b=+J(t),b*=+V(t),u=+l(+ +o[t>>3]),u=b/+d(+ +it(+u,+ +l(+ +o[t+8>>3])))*6371.007180918475*6371.007180918475,t=0|n[(c=a+12|0)>>2];A:do{if((0|t)>0)do{if(se(t+-1|0,h),!(u/+o[h>>3]>10))break A;t=(p=0|n[c>>2])-1|0,n[c>>2]=t}while((0|p)>1)}while(0);if(ve(a),n[(c=i)>>2]=0,n[c+4>>2]=0,!(!(0|(t=0|n[(c=a)>>2]))&!(0|(c=0|n[c+4>>2]))))do{_A(t,c,e,h),g=h,g=0|Ze(0|n[(A=i)>>2],0|n[A+4>>2],0|n[g>>2],0|n[g+4>>2]),A=0|B(),n[(p=i)>>2]=g,n[p+4>>2]=A,ve(a),t=0|n[(p=a)>>2],c=0|n[p+4>>2]}while(!(!(0|t)&!(0|c)));t=0|n[f>>2]}}while(0);return P=s,0|t},_memcpy:st,_memset:lt,_originToDirectedEdges:function(A,e,t){t|=0;var r,o=0;return r=!(0|HA(A|=0,e|=0)),e&=-2130706433,n[(o=t)>>2]=r?A:0,n[o+4>>2]=r?285212672|e:0,n[(o=t+8|0)>>2]=A,n[o+4>>2]=301989888|e,n[(o=t+16|0)>>2]=A,n[o+4>>2]=318767104|e,n[(o=t+24|0)>>2]=A,n[o+4>>2]=335544320|e,n[(o=t+32|0)>>2]=A,n[o+4>>2]=352321536|e,n[(t=t+40|0)>>2]=A,n[t+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(A,e,t,r){A|=0,e|=0,r|=0;var o,i,a,s,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,M=0,D=0,E=0,N=0,Q=0,j=0,F=0,S=0,R=0,T=0,_=0;if(s=P,P=P+112|0,o=s+80|0,f=s+72|0,i=s,a=s+56|0,0|(l=0|Ce(t|=0)))return P=s,0|l;if(!(_=0|Ue(32+(n[(g=A+8|0)>>2]<<5)|0)))return P=s,13;if(Be(A,_),!(l=0|Ce(t))){if(T=0|n[(R=A)+4>>2],n[(l=f)>>2]=n[R>>2],n[l+4>>2]=T,ke(f,o),l=0|eA(o,e,i))R=0,T=0;else{if(l=0|n[f>>2],(0|(c=0|n[g>>2]))>0){u=0|n[A+12>>2],t=0;do{l=(0|n[u+(t<<3)>>2])+l|0,t=t+1|0}while((0|t)!=(0|c));t=l}else t=l;c=0|n[(l=i)>>2],(0|(l=0|n[l+4>>2]))<(0|(u=((0|t)<0)<<31>>31))|(0|l)==(0|u)&c>>>0>>0?(n[(l=i)>>2]=t,n[l+4>>2]=u,l=u):t=c,R=0|Ze(0|t,0|l,12,0),T=0|B(),n[(l=i)>>2]=R,n[l+4>>2]=T,l=0}if(!l){if(!(t=0|We(R,8)))return Ye(_),P=s,13;if(!(d=0|We(R,8)))return Ye(_),Ye(t),P=s,13;n[(F=o)>>2]=0,n[F+4>>2]=0,S=0|n[(F=A)+4>>2],n[(l=f)>>2]=n[F>>2],n[l+4>>2]=S,l=0|H(f,R,T,e,o,t,d);A:do{if(l)Ye(t),Ye(d),Ye(_);else{e:do{if((0|n[g>>2])>0){for(u=A+12|0,c=0;l=0|H((0|n[u>>2])+(c<<3)|0,R,T,e,o,t,d),c=c+1|0,!(0|l);)if((0|c)>=(0|n[g>>2]))break e;Ye(t),Ye(d),Ye(_);break A}}while(0);(0|T)>0|!(0|T)&R>>>0>0&<(0|d,0,R<<3),F=0|n[(S=o)+4>>2];e:do{if((0|F)>0|!(0|F)&(0|n[S>>2])>>>0>0){N=t,Q=d,j=t,F=d,S=t,l=t,M=t,D=d,E=d,t=d;t:for(;;){for(w=0,y=0,k=0,C=0,c=0,u=0;;){f=(d=i)+56|0;do{n[d>>2]=0,d=d+4|0}while((0|d)<(0|f));if(0|L(g=0|n[(e=N+(w<<3)|0)>>2],e=0|n[e+4>>2],1,i,0)){f=(d=i)+56|0;do{n[d>>2]=0,d=d+4|0}while((0|d)<(0|f));0|(d=0|We(7,4))&&(I(g,e,1,i,d,7,0,0),Ye(d))}for(v=0;;){p=0|n[(x=i+(v<<3)|0)>>2],x=0|n[x+4>>2];r:do{if(!(0|p)&!(0|x))d=c,f=u;else{if(h=0|At(0|p,0|x,0|R,0|T),g=0|B(),!(!(0|(f=0|n[(e=d=r+(h<<3)|0)>>2]))&!(0|(e=0|n[e+4>>2])))){m=0,b=0;do{if((0|m)>(0|T)|(0|m)==(0|T)&b>>>0>R>>>0)break t;if((0|f)==(0|p)&(0|e)==(0|x)){d=c,f=u;break r}h=0|$e(0|(d=0|Ze(0|h,0|g,1,0)),0|B(),0|R,0|T),g=0|B(),b=0|Ze(0|b,0|m,1,0),m=0|B(),f=0|n[(e=d=r+(h<<3)|0)>>2],e=0|n[e+4>>2]}while(!(!(0|f)&!(0|e)))}if(!(0|p)&!(0|x)){d=c,f=u;break}qA(p,x,a),0|Me(A,_,a)&&(b=0|Ze(0|c,0|u,1,0),u=0|B(),n[(m=d)>>2]=p,n[m+4>>2]=x,n[(c=Q+(c<<3)|0)>>2]=p,n[c+4>>2]=x,c=b),d=c,f=u}}while(0);if((v=v+1|0)>>>0>=7)break;c=d,u=f}if(w=0|Ze(0|w,0|y,1,0),y=0|B(),k=0|Ze(0|k,0|C,1,0),C=0|B(),c=0|n[(u=o)>>2],!((0|C)<(0|(u=0|n[u+4>>2]))|(0|C)==(0|u)&k>>>0>>0))break;c=d,u=f}if((0|u)>0|!(0|u)&c>>>0>0){c=0,u=0;do{n[(C=N+(c<<3)|0)>>2]=0,n[C+4>>2]=0,c=0|Ze(0|c,0|u,1,0),u=0|B(),k=0|n[(C=o)+4>>2]}while((0|u)<(0|k)|((0|u)==(0|k)?c>>>0<(0|n[C>>2])>>>0:0))}if(n[(C=o)>>2]=d,n[C+4>>2]=f,!((0|f)>0|!(0|f)&d>>>0>0))break e;v=t,w=E,y=S,k=D,C=Q,t=M,E=l,D=j,M=v,l=w,S=F,F=y,j=k,Q=N,N=C}Ye(j),Ye(F),Ye(_),l=1;break A}l=d}while(0);Ye(_),Ye(t),Ye(l),l=0}}while(0);return P=s,0|l}}return Ye(_),P=s,0|l},_polygonToCellsExperimental:function(A,e,t,o,i,a){o|=0,i|=0,a|=0;var s,l,c,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0;c=P,P=P+160|0,d=c+64|0,h=c+112|0,p=c,function(A,e,t,o){A|=0,e|=0,t|=0,o|=0;var i,a,s,l=0,c=0,u=0,d=0;s=P,P=P+48|0,i=s+40|0,a=s,RA(c=s+32|0,0,0,0),u=0|n[c>>2],c=0|n[c+4>>2];do{if(t>>>0<=15){if(0|(l=0|Ce(o))){n[(o=a)>>2]=0,n[o+4>>2]=0,n[a+8>>2]=l,n[a+12>>2]=-1,u=a+29|0,n[(o=a+16|0)>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,r[o+12|0]=0,r[0|u]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}if(l=0|We(1+(0|n[e+8>>2])|0,32)){Be(e,l),n[(d=a)>>2]=u,n[d+4>>2]=c,n[a+8>>2]=0,n[a+12>>2]=t,n[a+16>>2]=o,n[a+20>>2]=e,n[a+24>>2]=l,r[a+28|0]=0,r[0|(u=a+29|0)]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}n[(o=a)>>2]=0,n[o+4>>2]=0,n[a+8>>2]=13,n[a+12>>2]=-1,u=a+29|0,n[(o=a+16|0)>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,r[o+12|0]=0,r[0|u]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}n[(u=a)>>2]=0,n[u+4>>2]=0,n[a+8>>2]=4,n[a+12>>2]=-1,d=a+29|0,n[(u=a+16|0)>>2]=0,n[u+4>>2]=0,n[u+8>>2]=0,r[u+12|0]=0,r[0|d]=0|r[0|i],r[d+1|0]=0|r[i+1|0],r[d+2|0]=0|r[i+2|0]}while(0);ve(a),n[A>>2]=n[a>>2],n[A+4>>2]=n[a+4>>2],n[A+8>>2]=n[a+8>>2],n[A+12>>2]=n[a+12>>2],n[A+16>>2]=n[a+16>>2],n[A+20>>2]=n[a+20>>2],n[A+24>>2]=n[a+24>>2],n[A+28>>2]=n[a+28>>2],P=s}(g=c+80|0,A|=0,e|=0,t|=0),ee(d,0|n[(f=g)>>2],0|n[f+4>>2],e),s=0|n[(f=d)>>2],f=0|n[f+4>>2],u=0|n[g+8>>2],n[(m=h+4|0)>>2]=n[g>>2],n[m+4>>2]=n[g+4>>2],n[m+8>>2]=n[g+8>>2],n[m+12>>2]=n[g+12>>2],n[m+16>>2]=n[g+16>>2],n[m+20>>2]=n[g+20>>2],n[m+24>>2]=n[g+24>>2],n[m+28>>2]=n[g+28>>2],n[(m=p)>>2]=s,n[m+4>>2]=f,n[(m=p+8|0)>>2]=u,e=h,t=36+(A=p+12|0)|0;do{n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}while((0|A)<(0|t));if(n[(h=p+48|0)>>2]=n[d>>2],n[h+4>>2]=n[d+4>>2],n[h+8>>2]=n[d+8>>2],n[h+12>>2]=n[d+12>>2],!(0|s)&!(0|f))return P=c,0|u;t=p+16|0,l=p+24|0,g=p+28|0,u=0,d=0,e=s,A=f;do{if(!((0|u)<(0|i)|(0|u)==(0|i)&d>>>0>>0)){b=4;break}if(f=d,d=0|Ze(0|d,0|u,1,0),u=0|B(),n[(f=a+(f<<3)|0)>>2]=e,n[f+4>>2]=A,re(h),!(0|(e=0|n[(A=h)>>2]))&!(0|(A=0|n[A+4>>2]))){if(ve(t),!(0|(A=0|n[(e=t)>>2]))&!(0|(e=0|n[e+4>>2]))){b=10;break}te(A,e,0|n[g>>2],h),e=0|n[(A=h)>>2],A=0|n[A+4>>2]}n[(f=p)>>2]=e,n[f+4>>2]=A}while(!(!(0|e)&!(0|A)));return 4==(0|b)?(0|(e=0|n[(A=p+40|0)>>2])&&Ye(e),n[(b=p+16|0)>>2]=0,n[b+4>>2]=0,n[l>>2]=0,n[p+36>>2]=0,n[g>>2]=-1,n[p+32>>2]=0,n[A>>2]=0,te(0,0,0,h),n[p>>2]=0,n[p+4>>2]=0,n[m>>2]=0,P=c,0|(p=14)):(10==(0|b)&&(n[p>>2]=0,n[p+4>>2]=0,n[m>>2]=n[l>>2]),p=0|n[m>>2],P=c,0|p)},_readInt64AsDoubleFromPointer:function(A){return+(+((0|n[(A|=0)>>2])>>>0)+4294967296*+(0|n[A+4>>2]))},_res0CellCount:function(){return 122},_round:ct,_sbrk:ut,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(A,e,t,r,o,i,a){A|=0,r|=0,o|=0,i|=0;var s,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(s=P,P=P+16|0,m=s,!((0|(t|=0))>0|!(0|t)&(e|=0)>>>0>0))return P=s,0;if((0|(a|=0))>=16)return P=s,12;g=0,h=0,f=0,l=0;A:for(;;){if(d=0|tt(0|(c=0|n[(u=A+(g<<3)|0)>>2]),0|(u=0|n[u+4>>2]),52),B(),(15&d)>(0|a)){l=12,c=11;break}if(ee(m,c,u,a),!(0|(u=0|n[(d=m)>>2]))&!(0|(d=0|n[d+4>>2])))c=f;else{c=f;do{if(!((0|l)<(0|i)|(0|l)==(0|i)&c>>>0>>0)){c=10;break A}n[(f=r+(c<<3)|0)>>2]=u,n[f+4>>2]=d,c=0|Ze(0|c,0|l,1,0),l=0|B(),re(m),u=0|n[(f=m)>>2],d=0|n[f+4>>2]}while(!(!(0|u)&!(0|d)))}if(g=0|Ze(0|g,0|h,1,0),!((0|(h=0|B()))<(0|t)|(0|h)==(0|t)&g>>>0>>0)){l=0,c=11;break}f=c}return 10==(0|c)?(P=s,0|(m=14)):11==(0|c)?(P=s,0|l):0},_uncompactCellsSize:function(A,e,t,r,o){A|=0,e|=0,t|=0,r|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0;a=P,P=P+16|0,i=a;A:do{if((0|t)>0|!(0|t)&e>>>0>0){for(d=0,l=0,s=0,f=0;;){if(!(!(0|(c=0|n[(u=A+(d<<3)|0)>>2]))&!(0|(u=0|n[u+4>>2]))||(u=!(0|_A(c,u,r,i)),l=0|Ze(0|n[(c=i)>>2],0|n[c+4>>2],0|l,0|s),s=0|B(),u))){s=12;break}if(d=0|Ze(0|d,0|f,1,0),!((0|(f=0|B()))<(0|t)|(0|f)==(0|t)&d>>>0>>0))break A}return P=a,0|s}l=0,s=0}while(0);return n[o>>2]=l,n[o+4>>2]=s,P=a,0},_vertexToLatLng:function(A,e,t){t|=0;var r,o,i,a,s=0,l=0;return a=P,P=P+192|0,o=a,i=a+168|0,s=0|tt(0|(A|=0),0|(e|=0),56),B(),s&=7,0|(r=0|XA(A,l=-2130706433&e|134217728,i))?(P=a,0|(l=r)):(e=0|tt(0|A,0|e,52),B(),e&=15,0|HA(A,l)?NA(i,e,s,1,o):FA(i,e,s,1,o),l=o+8|0,n[t>>2]=n[l>>2],n[t+4>>2]=n[l+4>>2],n[t+8>>2]=n[l+8>>2],n[t+12>>2]=n[l+12>>2],P=a,0|(l=0))},establishStackSpace:function(A,e){P=A|=0},stackAlloc:function(A){var e;return e=P,P=15+(P=P+(A|=0)|0)&-16,0|e},stackRestore:function(A){P=A|=0},stackSave:function(){return 0|P}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(A){s=A},c:function(){return s},d:function(A,e,t,r){tA("Assertion failed: "+x(A)+", at: "+[e?x(e):"unknown filename",t,r?x(r):"unknown function"])},e:function(A){return t.___errno_location&&(h[t.___errno_location()>>2]=A),A},f:z,g:function(A,e,t){f.set(f.subarray(e,e+t),A)},h:function(A){var e=z(),t=16777216,r=2130706432;if(A>r)return!1;for(var n=Math.max(e,16777216);n0))return 0;for(var n=t+r-1,o=0;o=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&A.charCodeAt(++o)),i<=127){if(t>=n)break;e[t++]=i}else if(i<=2047){if(t+1>=n)break;e[t++]=192|i>>6,e[t++]=128|63&i}else if(i<=65535){if(t+2>=n)break;e[t++]=224|i>>12,e[t++]=128|i>>6&63,e[t++]=128|63&i}else{if(t+3>=n)break;e[t++]=240|i>>18,e[t++]=128|i>>12&63,e[t++]=128|i>>6&63,e[t++]=128|63&i}}e[t]=0}(A,f,e,t)}(A,e=V(t),t)}return e},array:function(A){var e,t,r=V(A.length);return e=A,t=r,d.set(e,t),r}},o=c(A),i=[],a=0;if(r)for(var s=0;s>1]=e;break;case"i32":h[A>>2]=e;break;case"i64":R=[e>>>0,(I=e,+Q(I)>=1?I>0?(0|F(+P(I/4294967296),4294967295))>>>0:~~+j((I-+(~~I>>>0))/4294967296)>>>0:0)],h[A>>2]=R[0],h[A+4>>2]=R[1];break;case"float":m[A>>2]=e;break;case"double":b[A>>3]=e;break;default:tA("invalid type for setValue: "+t)}},t.getValue=function(A,e,t){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return d[0|A];case"i16":return g[A>>1];case"i32":case"i64":return h[A>>2];case"float":return m[A>>2];case"double":return b[A>>3];default:tA("invalid type for getValue: "+e)}return null},T){H(T)||(W=T,T=t.locateFile?t.locateFile(W,o):o+W),S++,t.monitorRunDependencies&&t.monitorRunDependencies(S);var X=function(A){A.byteLength&&(A=new Uint8Array(A)),f.set(A,8),t.memoryInitializerRequest&&delete t.memoryInitializerRequest.response,function(){if(S--,t.monitorRunDependencies&&t.monitorRunDependencies(S),0==S&&L){var A=L;L=null,A()}}()},q=function(){n(T,X,function(){throw"could not load memory initializer "+T})},$=O(T);if($)X($.buffer);else if(t.memoryInitializerRequest){var AA=function(){var A=t.memoryInitializerRequest,e=A.response;if(200!==A.status&&0!==A.status){var r=O(t.memoryInitializerRequestURL);if(!r)return void q();e=r.buffer}X(e)};t.memoryInitializerRequest.response?setTimeout(AA,0):t.memoryInitializerRequest.addEventListener("load",AA)}else q()}function eA(A){function e(){Z||(Z=!0,l||(k(B),k(M),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)N(t.postRun.shift());k(D)}()))}S>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)E(t.preRun.shift());k(C)}(),S>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}function tA(A){throw t.onAbort&&t.onAbort(A),i(A+=""),a(A),l=!0,"abort("+A+"). Build with -s ASSERTIONS=1 for more info."}if(L=function A(){Z||eA(),Z||(L=A)},t.run=eA,t.abort=tA,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return eA(),A}("object"==typeof $A?$A:{}),Ae="number",ee={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid",16:"Index argument was not valid",17:"Base cell number was outside of acceptable range",18:"Child indexing digits invalid",19:"Child indexing digits refer to a deleted subsequence"},te={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function re(A,e,t){var r=t&&"value"in t,n=new Error((A[e]||"Unknown error")+" (code: "+e+(r?", value: "+t.value:"")+")");return n.code=e,n}function ne(A){if(0!==A)throw function(A,e){return re(ee,A,2===arguments.length?{value:e}:{})}(A)}var oe={};[["sizeOfH3Index",Ae],["sizeOfLatLng",Ae],["sizeOfCellBoundary",Ae],["sizeOfGeoLoop",Ae],["sizeOfGeoPolygon",Ae],["sizeOfLinkedGeoPolygon",Ae],["sizeOfCoordIJ",Ae],["readInt64AsDoubleFromPointer",Ae],["isValidCell",Ae,[Ae,Ae]],["isValidIndex",Ae,[Ae,Ae]],["latLngToCell",Ae,[Ae,Ae,Ae,Ae]],["cellToLatLng",Ae,[Ae,Ae,Ae]],["cellToBoundary",Ae,[Ae,Ae,Ae]],["maxGridDiskSize",Ae,[Ae,Ae]],["gridDisk",Ae,[Ae,Ae,Ae,Ae]],["gridDiskDistances",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridRing",Ae,[Ae,Ae,Ae,Ae]],["gridRingUnsafe",Ae,[Ae,Ae,Ae,Ae]],["maxPolygonToCellsSize",Ae,[Ae,Ae,Ae,Ae]],["polygonToCells",Ae,[Ae,Ae,Ae,Ae]],["maxPolygonToCellsSizeExperimental",Ae,[Ae,Ae,Ae,Ae]],["polygonToCellsExperimental",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["cellsToLinkedMultiPolygon",Ae,[Ae,Ae,Ae]],["destroyLinkedMultiPolygon",null,[Ae]],["compactCells",Ae,[Ae,Ae,Ae,Ae]],["uncompactCells",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["uncompactCellsSize",Ae,[Ae,Ae,Ae,Ae,Ae]],["isPentagon",Ae,[Ae,Ae]],["isResClassIII",Ae,[Ae,Ae]],["getBaseCellNumber",Ae,[Ae,Ae]],["getResolution",Ae,[Ae,Ae]],["getIndexDigit",Ae,[Ae,Ae,Ae]],["constructCell",Ae,[Ae,Ae,Ae,Ae]],["maxFaceCount",Ae,[Ae,Ae,Ae]],["getIcosahedronFaces",Ae,[Ae,Ae,Ae]],["cellToParent",Ae,[Ae,Ae,Ae,Ae]],["cellToChildren",Ae,[Ae,Ae,Ae,Ae]],["cellToCenterChild",Ae,[Ae,Ae,Ae,Ae]],["cellToChildrenSize",Ae,[Ae,Ae,Ae,Ae]],["cellToChildPos",Ae,[Ae,Ae,Ae,Ae]],["childPosToCell",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["areNeighborCells",Ae,[Ae,Ae,Ae,Ae,Ae]],["cellsToDirectedEdge",Ae,[Ae,Ae,Ae,Ae,Ae]],["getDirectedEdgeOrigin",Ae,[Ae,Ae,Ae]],["getDirectedEdgeDestination",Ae,[Ae,Ae,Ae]],["isValidDirectedEdge",Ae,[Ae,Ae]],["directedEdgeToCells",Ae,[Ae,Ae,Ae]],["originToDirectedEdges",Ae,[Ae,Ae,Ae]],["directedEdgeToBoundary",Ae,[Ae,Ae,Ae]],["gridDistance",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridPathCells",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridPathCellsSize",Ae,[Ae,Ae,Ae,Ae,Ae]],["cellToLocalIj",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["localIjToCell",Ae,[Ae,Ae,Ae,Ae,Ae]],["getHexagonAreaAvgM2",Ae,[Ae,Ae]],["getHexagonAreaAvgKm2",Ae,[Ae,Ae]],["getHexagonEdgeLengthAvgM",Ae,[Ae,Ae]],["getHexagonEdgeLengthAvgKm",Ae,[Ae,Ae]],["greatCircleDistanceM",Ae,[Ae,Ae]],["greatCircleDistanceKm",Ae,[Ae,Ae]],["greatCircleDistanceRads",Ae,[Ae,Ae]],["cellAreaM2",Ae,[Ae,Ae,Ae]],["cellAreaKm2",Ae,[Ae,Ae,Ae]],["cellAreaRads2",Ae,[Ae,Ae,Ae]],["edgeLengthM",Ae,[Ae,Ae,Ae]],["edgeLengthKm",Ae,[Ae,Ae,Ae]],["edgeLengthRads",Ae,[Ae,Ae,Ae]],["getNumCells",Ae,[Ae,Ae]],["getRes0Cells",Ae,[Ae]],["res0CellCount",Ae],["getPentagons",Ae,[Ae,Ae]],["pentagonCount",Ae],["cellToVertex",Ae,[Ae,Ae,Ae,Ae]],["cellToVertexes",Ae,[Ae,Ae,Ae]],["vertexToLatLng",Ae,[Ae,Ae,Ae]],["isValidVertex",Ae,[Ae,Ae]]].forEach(function(A){oe[A[0]]=$A.cwrap.apply($A,A)});var ie=16,ae=oe.sizeOfH3Index(),se=oe.sizeOfLatLng(),le=oe.sizeOfCellBoundary();oe.sizeOfGeoPolygon(),oe.sizeOfGeoLoop(),oe.sizeOfLinkedGeoPolygon(),oe.sizeOfCoordIJ();var ce=/[^0-9a-fA-F]/;function ue(A){if(A>=0)return A.toString(ie);var e=de(8,(A&=2147483647).toString(ie));return(parseInt(e[0],ie)+8).toString(ie)+e.substring(1)}function de(A,e){for(var t=A-e.length,r="",n=0;n.85?.9+(i-.85)/.15*.1:.1+(i-.15)/.7*.8;var i;return we(r[Math.min(23,Math.floor(24*o))])}function ke({coveragePoints:e,visible:r,terrainEnabled:n=!1,brightness:o=.7}){const{current:i}=S(),[a,s]=A.useState(null),[l,c]=A.useState(!1),u=A.useRef({aborted:!1}),d=A.useRef(0),f=function(e){const[t,r]=A.useState(e);return A.useEffect(()=>{const A=setTimeout(()=>r(e),300);return()=>clearTimeout(A)},[e,300]),t}(e),g=A.useMemo(()=>function(){var A;const e=hA();return 24===e.length&&0!==(null==(A=e[0])?void 0:A[0])?e:ve}(),[]);A.useEffect(()=>{if(!f||!Array.isArray(f)||0===f.length)return void queueMicrotask(()=>{s(null),d.current=0});if(f.length===d.current&&a)return;d.current=f.length,u.current.aborted=!0,u.current={aborted:!1};const A=u.current;c(!0);const{cells:e,minQuality:t,maxQuality:r}=function(A){const e=new Map;for(const o of A){if("number"!=typeof o.lat||"number"!=typeof o.lon||isNaN(o.lat)||isNaN(o.lon))continue;const A=he(o.lat,o.lon,8),t=e.get(A),r=o.weight;t?(t.count++,t.qualitySum+=r):e.set(A,{count:1,qualitySum:r})}const t=[];let r=1/0,n=-1/0;for(const[o,i]of e.entries()){const A=i.qualitySum/i.count;t.push({hexId:o,count:i.count,avgQuality:A}),r=Math.min(r,A),n=Math.max(n,A)}return{cells:t,minQuality:t.length>0?r:0,maxQuality:t.length>0?n:0}}(f);if(0===e.length)return s(null),void c(!1);if(e.length<500){const n=function(A,e,t,r){const n=[];for(const o of A){const A=me(o.hexId).map(([A,e])=>[e,A]);A.push(A[0]);const i=ye(o.avgQuality,e,t,r);n.push({type:"Feature",properties:{color:i,quality:o.avgQuality,count:o.count},geometry:{type:"Polygon",coordinates:[A]}})}return{type:"FeatureCollection",features:n}}(e,t,r,g);return void(A.aborted||(s(n),c(!1)))}return async function(A,e,t,r,n){const o=[];let i=0;for(;i[e,A]);a.push(a[0]);const s=ye(n.avgQuality,e,t,r);o.push({type:"Feature",properties:{color:s,quality:n.avgQuality,count:n.count},geometry:{type:"Polygon",coordinates:[a]}})}irequestAnimationFrame(A))}return{type:"FeatureCollection",features:o}}(e,t,r,g,A).then(e=>{!A.aborted&&e&&s(e)}).finally(()=>{A.aborted||c(!1)}),()=>{A.aborted=!0}},[f,g]),A.useEffect(()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(!e)return;const t=()=>{var A,t;try{const n=e.getLayer(xe),i=e.getSource(pe);if(r&&a&&a.features.length>0){if(i?e.getSource(pe).setData(a):e.addSource(pe,{type:"geojson",data:a}),!n){const r=e.getLayer("topology-weak-edges-native"),n=null==(t=null==(A=e.getStyle())?void 0:A.layers)?void 0:t.find(A=>"symbol"===A.type),i=r?"topology-weak-edges-native":null==n?void 0:n.id;e.addLayer({id:xe,type:"fill",source:pe,paint:{"fill-color":["get","color"],"fill-opacity":o}},i)}}else n&&e.removeLayer(xe),i&&e.removeSource(pe)}catch(n){}};e.isStyleLoaded()?t():e.once("style.load",t)},[i,r,a,n]),A.useEffect(()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(e&&r)try{e.getLayer(xe)&&e.setPaintProperty(xe,"fill-opacity",o)}catch{}},[i,o,r]),A.useEffect(()=>()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(e)try{e.getLayer(xe)&&e.removeLayer(xe),e.getSource(pe)&&e.removeSource(pe)}catch{}},[i]);const h=(null==a?void 0:a.features.length)??0;return h>0&&r?t.jsx("div",{"data-testid":"wardriving-hexlayer-maplibre-active","data-point-count":(null==e?void 0:e.length)||0,"data-cell-count":h,"data-terrain-enabled":n,"data-is-processing":l,style:{display:"none"}}):null}const Ce="https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",Be="terrarium",Me="terrain-dem",De="hillshade-dem",Ee="terrain-hillshade";function Ne({enabled:e,exaggeration:t=4}){const{current:r}=S(),n=A.useRef(null);return A.useEffect(()=>{var A;const e=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);if(!e)return;let t=!0;const n=()=>{var A,r;if(t)try{if(e.getSource(De)||e.addSource(De,{type:"raster-dem",tiles:[Ce],encoding:Be,tileSize:256,maxzoom:14}),!e.getLayer(Ee)){const t=null==(r=null==(A=e.getStyle())?void 0:A.layers)?void 0:r.find(A=>"symbol"===A.type);e.addLayer({id:Ee,type:"hillshade",source:De,paint:{"hillshade-shadow-color":"rgba(10, 10, 10, 0.6)","hillshade-highlight-color":"rgba(245, 240, 230, 0.4)","hillshade-accent-color":"rgba(90, 75, 65, 0.3)","hillshade-illumination-direction":315,"hillshade-exaggeration":.35}},null==t?void 0:t.id)}}catch(n){}};return e.isStyleLoaded()?n():e.once("style.load",n),()=>{t=!1}},[r]),A.useEffect(()=>{var A;const o=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);if(!o)return;let i=!0;const a=()=>{if(i)try{o.getSource(Me)||o.addSource(Me,{type:"raster-dem",tiles:[Ce],encoding:Be,tileSize:256,maxzoom:14}),e?(o.setCenterClampedToGround(!1),o.setTerrain({source:Me,exaggeration:t}),o.setMaxPitch(70),o.getPitch()<30&&!o.isMoving()&&(null!==n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{n.current=null,i&&!o.isMoving()&&o.getPitch()<30&&o.easeTo({pitch:45,duration:1e3})},200))):(o.setTerrain(null),o.setCenterClampedToGround(!0),o.getPitch()>0&&!o.isMoving()&&o.easeTo({pitch:0,duration:800}),o.setMaxPitch(60))}catch(A){}};return o.isStyleLoaded()?a():o.once("style.load",a),()=>{i=!1,null!==n.current&&(clearTimeout(n.current),n.current=null);try{o.getStyle()&&o.isStyleLoaded()&&o.setTerrain(null)}catch{}}},[r,e,t]),A.useEffect(()=>{var A;const e=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);return()=>{var A;try{(null==(A=null==e?void 0:e.getStyle)?void 0:A.call(e))&&e.isStyleLoaded()&&(e.setTerrain(null),e.getLayer(Ee)&&e.removeLayer(Ee),e.getSource(De)&&e.removeSource(De),e.getSource(Me)&&e.removeSource(Me))}catch{}}},[r]),null}function Qe(A,e=!1,t=!1,r=!1,n=.7){const o=fA();return r?n>=.75?o.restBright:o.rest:n>=.85?o.rest:o.restDim}function je(A){return[A[1],A[0]]}function Pe(A,e,t,r=12){const[n,o]=A,[i,a]=e,s=[];for(let l=0;l<=r;l++){const A=l/r,e=o+(a-o)*A,c=n+(i-n)*A,u=4*t*A*(1-A);s.push([e,c,u])}return s}function Fe(A){return A<.5?4*A*A*A:1-Math.pow(-2*A+2,3)/2}function Se(A,e,t,r,n,o,i,a,s,l,c){const u=CA(),d=[];let f=1/0,g=-1/0;const h=[];for(const b of A){const A=.7*(b.edge.avgConfidence??(e?.7:.5))+b.edge.certainCount/Math.max(i,1)*.3+(e?.5:0);h.push({polyline:b,brightnessScore:A}),f=Math.min(f,A),g=Math.max(g,A)}if(0===h.length)return{type:"FeatureCollection",features:[]};const m=g-f||1;h.sort((A,e)=>A.brightnessScore-e.brightnessScore);for(const{polyline:b,brightnessScore:p}of h){const{from:A,to:i,edge:g}=b,h=t.get(g.key)??0;if(h<=0)continue;const x=a.has(g.key),v=s.has(g.key),w=g.avgConfidence??(e?.7:.5),y=l===g.key,k=c[g.fromHash],C=c[g.toHash],B=(null==k?void 0:k.node_name)||(null==k?void 0:k.name)||g.fromHash.slice(0,8),M=(null==C?void 0:C.node_name)||(null==C?void 0:C.name)||g.toHash.slice(0,8),D=[A[0]+(i[0]-A[0])*h,A[1]+(i[1]-A[1])*h];let E,N,Q,j;if(e){const A=o.get(g.key)??vA(g.certainCount),e=n.get(g.key)??A;E=e+(A-e)*r,y?E=Math.max(1.6*E,4.5):v&&(E*=1.3)}else E=1.5;if(N=y?u.edges.highlight:Qe(0,g.isDirectPathEdge??!1,x,v,w),Q=y?u.edges.highlight:g.isDirectPathEdge?u.edges.hoverDirect:x?u.edges.hoverLoop:u.edges.hoverStandard,e){const A=Math.min(1.5*h,1)*u.edgeOpacity;j=v?1.15*A:A}else j=(.3+.3*w)*h;y&&(j=.95);const P=(p-f)/m;d.push({type:"Feature",properties:{key:g.key,baseColor:N,hoverColor:Q,baseWidth:E,baseOpacity:j,brightnessScore:P,isLoopEdge:x,isBackbone:v,isDirectPath:g.isDirectPathEdge??!1,isHubConnection:g.isHubConnection??!1,isZeroHop:g.isZeroHop??!1,isValidated:e,certainCount:g.certainCount,confidence:w,symmetryRatio:g.symmetryRatio??1,dominantDirection:g.dominantDirection??"balanced",fromName:B,toName:M,fromHash:g.fromHash,toHash:g.toHash},geometry:{type:"LineString",coordinates:[je(A),je(D)]}})}return{type:"FeatureCollection",features:d}}function Le(A,e){const t=CA(),r=[];let n=0;for(const o of A){const A=e.get(o.hash);A&&A.blendedScore>n&&(n=A.blendedScore)}for(const o of A){const{from:A,to:i,hash:a,neighbor:s,lastHopData:l}=o,c=`neighbor-${a}`,u=(null==l?void 0:l.avgRssi)??s.rssi??null,d=(null==l?void 0:l.avgSnr)??s.snr??null,f=(null==l?void 0:l.count)??0,g=(null==l?void 0:l.confidence)??1,h=e.get(a),m=(null==h?void 0:h.listenerScore)??0,b=(null==h?void 0:h.loudScore)??0,p=(null==h?void 0:h.blendedScore)??0,x=n>0?p/n:0,v=o.rxAdvertCount??0,w=o.txProxyCount??0,y=v+w,k=y>0?(w-v)/y:0,C=Pe(A,i,150,8);r.push({type:"Feature",properties:{key:c,hash:a,name:s.node_name||s.name||a.slice(0,8),prefix:a.slice(2,4).toUpperCase(),color:t.neighborColor,width:2.5,opacity:.85,rssi:u,snr:d,packetCount:f,confidence:g,hasAvgRssi:void 0!==(null==l?void 0:l.avgRssi),hasAvgSnr:void 0!==(null==l?void 0:l.avgSnr),isNeighborEdge:!0,listenerScore:m,loudScore:b,blendedScore:p,trafficWeight:x,linkAsymmetry:k,rxAdvertCount:v,txProxyCount:w},geometry:{type:"LineString",coordinates:C}})}return{type:"FeatureCollection",features:r}}function Ie(A){return A<.5?4*A*A*A:1-Math.pow(-2*A+2,3)/2}function Re(A,e){if(A<240)return.5;if(A<480)return 1;const t=(A-480)/(e-480);return Math.max(0,.33*(1-t))}function Te(A,e,t){const r=t?AA(t):null,n=[];for(const o of A){if(r&&o.toUpperCase()===r){t&&n.push(t);continue}const A=e.get(o.toUpperCase());A&&n.push(A)}return n}const _e="edge-blink-source",He="edge-blink-layer",ze=1e3,Ge=1e3,Oe="node-markers-layer";function Ue(A){return A<0||A>=ze?0:1-A/ze}function Ye(A){if(A<0)return 0;if(A>=Ge)return 0;const e=A/Ge;return Math.pow(1-e,3)}function We(A){return[A[1],A[0]]}function Ze(A){const e=new Date(1e3*A);return`${(e.getMonth()+1).toString().padStart(2,"0")}/${e.getDate().toString().padStart(2,"0")}`}function Ve({hash:e,hashPrefix:n,name:o,isHub:i,isGateway:a,isBackbone:l,isZeroHop:c,isMobile:u,isRoomServer:d,isStale:f,lastSeenTimestamp:g,centrality:h,affinity:m,meanSnr:b,meanRssi:p,neighbor:x,onRemove:v,txDelayRec:w,onPingResult:y}){const k=gA(),[C,B]=A.useState(!1),[M,D]=A.useState(!1),[E,N]=A.useState(null),[Q,j]=A.useState(null),F=A.useCallback(async()=>{if(!M){D(!0),j(null),N(null);try{const A=e.startsWith("0x")?e.slice(0,4):`0x${e.slice(0,2)}`,t=await tA(A,30);t.success&&t.data?(N(t.data),null==y||y(t.data)):j(t.error||"Ping failed")}catch(A){j(A instanceof Error?A.message:"Ping failed")}finally{D(!1)}}},[e,M,y]),S=c?"Direct":(null==m?void 0:m.typicalHopPosition)?`${m.typicalHopPosition}-hop`:null,z=w&&!w.insufficientData,G={hub:{bg:"bg-amber-500/20",text:"text-amber-400",title:"Hub: High-connectivity node that bridges many paths"},backbone:{bg:"bg-purple-500/20",text:"text-purple-400",title:"Backbone: Critical relay with high traffic"},relay:{bg:"bg-cyan-500/20",text:"text-cyan-400",title:"Relay: Standard forwarding node"},edge:{bg:"bg-gray-500/20",text:"text-gray-400",title:"Edge: Peripheral node"}},O={high:{bg:"bg-green-500/20",text:"text-green-400",title:"1000+ packets"},medium:{bg:"bg-amber-500/20",text:"text-amber-400",title:"500-999 packets"},low:{bg:"bg-red-500/20",text:"text-red-400",title:"100-499 packets"},insufficient:{bg:"bg-gray-500/20",text:"text-gray-400",title:"Insufficient data"}};return t.jsxs("div",{className:"w-[240px] pr-2",children:[t.jsx("div",{className:"text-[14px] font-semibold text-text-primary leading-tight truncate mb-1",children:o}),t.jsxs("div",{className:"flex items-center gap-1 flex-wrap mb-1.5",children:[t.jsx("code",{className:"font-mono text-[10px] text-text-secondary bg-[#1a1a1a] px-1 py-0.5 rounded",children:n}),t.jsx("button",{onClick:async()=>{try{await navigator.clipboard.writeText(e),B(!0),setTimeout(()=>B(!1),1500)}catch(A){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{document.execCommand("copy"),B(!0),setTimeout(()=>B(!1),1500)}catch{}document.body.removeChild(t)}},className:"p-0.5 hover:bg-[#252525] rounded transition-colors",title:"Copy full hash",children:C?t.jsx(r,{className:"w-3 h-3 text-accent-success"}):t.jsx(L,{className:"w-3 h-3 text-text-secondary"})}),t.jsx(pA,{hash:e,size:"sm"}),S&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded "+(c?"bg-amber-400 text-gray-900":"bg-[#2a2a2a] text-white"),children:S}),x.is_repeater&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-cyan-500/20 text-cyan-400",children:"Rptr"}),i&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded",style:{backgroundColor:k.hubColor,color:"#fff"},title:"Hub: ≥10% of last-hop traffic",children:"Hub"}),a&&!i&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded",style:{backgroundColor:k.hubColor,color:"#fff",opacity:.8},title:"Gateway: 7-10% of last-hop traffic",children:"Gate"}),l&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-purple-500/80 text-white",title:"Backbone",children:"Bone"}),u&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-orange-500/25 text-orange-300",children:"Mobile"}),d&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-amber-500/25 text-amber-400",children:"Room"}),f&&g&&t.jsxs("span",{className:"px-1 py-0.5 text-[9px] font-medium rounded bg-gray-500/30 text-gray-300",title:"Neighbor not heard in 7+ days",children:["Idle ",Ze(g)]})]}),t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-secondary mb-1.5",children:[t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(I,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsx("span",{className:"font-mono",children:rA(x.last_seen)})]}),(null==m?void 0:m.distanceMeters)&&t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(R,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:(U=m.distanceMeters,null===U?"—":U<1e3?`${Math.round(U)}m`:`${(U/1e3).toFixed(1)}km`)})]}),x.latitude&&x.longitude&&0!==x.latitude&&0!==x.longitude&&t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(T,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsxs("span",{className:"font-mono text-text-muted",children:[x.latitude.toFixed(2),", ",x.longitude.toFixed(2)]})]})]}),t.jsx("div",{className:"mb-1.5",style:{width:224},children:t.jsx(xA,{nodeHash:e,width:224,height:26,showArea:!0,showTooltip:!0})}),t.jsxs("div",{className:"flex gap-3 text-[10px] mb-1.5",children:[t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Packets"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:(null==m?void 0:m.frequency)||0})]}),c&&void 0!==b&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"SNR"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[b.toFixed(1)," dB"]})]}),z&&w.networkRole&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Role"}),t.jsx("span",{className:`text-[9px] font-bold uppercase px-1 py-0.5 rounded ${G[w.networkRole].bg} ${G[w.networkRole].text}`,title:G[w.networkRole].title,children:w.networkRole})]})]}),t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Adverts"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:x.advert_count||0})]}),c&&void 0!==p&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"RSSI"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[Math.round(p)," dBm"]})]}),z&&w.dataConfidence&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Data"}),t.jsx("span",{className:`text-[9px] font-bold uppercase px-1 py-0.5 rounded ${O[w.dataConfidence].bg} ${O[w.dataConfidence].text}`,title:O[w.dataConfidence].title,children:w.dataConfidence})]})]})]}),z&&t.jsxs("div",{className:"flex items-center gap-2 text-[10px] mb-1.5 py-1 px-1.5 bg-amber-400/5 rounded",children:[t.jsx(_,{className:"w-3 h-3 text-amber-400 shrink-0"}),t.jsx("span",{className:"text-text-muted",children:"TxDelay"}),t.jsxs("div",{className:"flex gap-3 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-text-muted",children:"F"}),t.jsxs("span",{className:"font-mono font-semibold text-amber-400",children:["×",(w.floodFactor??w.txDelayFactor).toFixed(1)]})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-text-muted",children:"D"}),t.jsxs("span",{className:"font-mono font-semibold text-amber-400",children:["×",(w.directFactor??w.directTxDelayFactor).toFixed(1)]})]})]})]}),t.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-white/[0.08]",children:[c?t.jsxs("button",{onClick:F,disabled:M,className:"flex items-center gap-1 py-0.5 text-[10px] text-text-secondary hover:text-accent-primary hover:bg-accent-primary/10 rounded transition-colors disabled:opacity-50",title:"Ping neighbor",children:[M?t.jsx(s,{className:"w-3 h-3 animate-spin"}):t.jsx(H,{className:"w-3 h-3"}),t.jsx("span",{children:"Ping"})]}):t.jsx("div",{}),v&&t.jsx("button",{onClick:v,className:"p-1 text-text-secondary hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",title:"Remove from contacts",children:t.jsx(P,{className:"w-3.5 h-3.5"})})]}),E&&t.jsxs("div",{className:"mt-1 pt-1 border-t border-white/[0.08] text-[10px]",children:[t.jsxs("div",{className:"flex items-center gap-1 text-accent-success mb-0.5",children:[t.jsx(r,{className:"w-3 h-3"}),t.jsx("span",{className:"font-medium",children:"Ping OK"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"RTT"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.rtt_ms.toFixed(0)," ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"RSSI"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.rssi," dBm"]})]})]}),t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"SNR"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.snr_db.toFixed(1)," dB"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"Hops"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:E.path.length})]})]})]})]}),Q&&t.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-white/[0.08] text-[10px] text-red-400",children:["⚠ ",Q]})]});var U}const Ke="node-markers-native",Je="node-markers-layer",Xe="node-markers-layer-local",qe="marker-standard",$e="marker-standard-neighbor",At="marker-hub",et="marker-hub-neighbor",tt="marker-gateway",rt="marker-gateway-neighbor",nt="marker-mobile",ot="marker-mobile-neighbor",it="marker-room-server",at="marker-room-server-neighbor",st="marker-local",lt="marker-blink-black",ct="marker-blink-black-local",ut="marker-blink",dt="marker-blink-local";function ft(A){var e;const t=null==(e=A.contact_type)?void 0:e.toLowerCase();return"room server"===t||"room_server"===t||"room"===t||"server"===t}function gt(A){return A.startsWith("0x")?A.slice(2,4).toUpperCase():A.slice(0,2).toUpperCase()}function ht({neighborsWithLocation:e,localNode:r,localHash:n,zeroHopNeighbors:o,lastHopNeighborMap:i,meshTopology:a,hoveredMarker:s,onMarkerHover:l,getNodeOpacity:c,shouldShowNode:u,onRequestRemove:d,openPopupId:f,onOpenPopup:g,onClosePopup:h,blinkingNodes:m}){const{current:b}=S(),p=A.useRef(!1),[x,v]=A.useState(!1);A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e)return;const t=()=>{if(!p.current)try{!function(A){const e=dA(),t=(A,e,t=0,r=!1)=>{const n=document.createElement("canvas");n.width=32,n.height=32;const o=n.getContext("2d",r?{colorSpace:"display-p3"}:void 0),i=14-t/2;return o.beginPath(),o.arc(16,16,i,0,2*Math.PI),o.fillStyle=A,o.fill(),e&&t>0&&(o.strokeStyle=e,o.lineWidth=2*t,o.stroke()),o.shadowColor="rgba(0,0,0,0.3)",o.shadowBlur=4,o.shadowOffsetY=2,{data:o.getImageData(0,0,32,32),pixelRatio:2}},r=(A,e=!1)=>{const t=document.createElement("canvas");t.width=48,t.height=48;const r=t.getContext("2d",e?{colorSpace:"display-p3"}:void 0),n=24*.35*2;return r.strokeStyle=A,r.lineWidth=5,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(24-n,24),r.lineTo(24,24-n),r.lineTo(40.8,24),r.stroke(),r.beginPath(),r.moveTo(24-.7*n,24),r.lineTo(24-.7*n,35.76),r.lineTo(35.76,35.76),r.lineTo(35.76,24),r.stroke(),r.beginPath(),r.moveTo(20.64,35.76),r.lineTo(20.64,27.36),r.lineTo(27.36,27.36),r.lineTo(27.36,35.76),r.stroke(),{data:r.getImageData(0,0,48,48),pixelRatio:2}},n=(A,e)=>{const t=document.createElement("canvas");t.width=48,t.height=48;const r=t.getContext("2d"),n=24*.35*2;return r.strokeStyle=A,r.lineWidth=5,r.lineCap="round",r.lineJoin="round",e&&(r.fillStyle=e),r.beginPath(),r.roundRect(24-n,24-.6*n,1.6*n,1.2*n,6),e&&r.fill(),r.stroke(),r.beginPath(),r.moveTo(18.96,34.08),r.lineTo(24-.6*n,40.8),r.lineTo(24,34.08),r.stroke(),{data:r.getImageData(0,0,48,48),pixelRatio:2}},o="#00FF00",i={[qe]:t(e.nodeFill,e.nodeStroke,1.5),[$e]:t(e.neighborColor),[At]:t(e.hubColor),[et]:t(e.neighborColor),[tt]:t(e.hubColor+"B3"),[rt]:t(e.neighborColor),[nt]:t("transparent",e.mobileColor,2),[ot]:t(e.neighborColor),[it]:n(e.roomColor),[at]:n(e.neighborColor,"#1a1a1c"),[st]:r(e.localColor),[lt]:t("#000000"),[ct]:r("#000000"),[ut]:t(o,void 0,0,!0),[dt]:r(o,!0)};for(const[a,s]of Object.entries(i))A.hasImage(a)&&A.removeImage(a),A.addImage(a,s.data,{pixelRatio:s.pixelRatio})}(e),p.current=!0,v(!0)}catch(A){}};e.isStyleLoaded()?t():e.once("style.load",t);const r=()=>{p.current=!1,t()},n=new MutationObserver(A=>{for(const e of A)if("data-theme"===e.attributeName){setTimeout(r,100);break}});return n.observe(document.documentElement,{attributes:!0}),()=>{n.disconnect()}},[b]);const w=A.useMemo(()=>{var A;const t=[],r=[...e].sort(([A,e],[t,r])=>{const n=(A,e)=>{var t;return ft(e)?5e3:o.has(A)?3e3:a.hubNodes.includes(A)?2e3:(null==(t=a.gatewayNodes)?void 0:t.includes(A))?1e3:0};return n(A,e)-n(t,r)});for(const[e,n]of r){if(!n.latitude||!n.longitude)continue;const r=u(e),s=c(e,r);if(s<=.01)continue;const l=o.has(e),d=a.hubNodes.includes(e),f=(null==(A=a.gatewayNodes)?void 0:A.includes(e))??!1,g=a.mobileNodes.includes(e),h=ft(n),m=a.centrality.get(e)||0,b=i.get(e),p="stale"===(null==b?void 0:b.status),x=p?Math.min(s,.5):s;let v="standard";h?v="roomServer":d?v="hub":f?v="gateway":g&&(v="mobile");const w=a.fullAffinity.get(e),y=a.txDelayRecommendations.get(e);t.push({type:"Feature",geometry:{type:"Point",coordinates:[n.longitude,n.latitude]},properties:{hash:e,name:n.node_name||n.name||"Unknown",hashPrefix:gt(e),iconType:v,isNeighbor:l,isHub:d,isGateway:f,isMobile:g,isRoomServer:h,isStale:p,isZeroHop:l,opacity:x,blinkIntensity:0,lastSeenTimestamp:null==b?void 0:b.lastSeen,centrality:m,neighborJson:JSON.stringify(n),affinityJson:w?JSON.stringify(w):void 0,txDelayRecJson:y?JSON.stringify(y):void 0,meanSnr:(null==b?void 0:b.avgSnr)??void 0,meanRssi:(null==b?void 0:b.avgRssi)??void 0}})}return{type:"FeatureCollection",features:t}},[e,o,i,a,c,u]),y=A.useMemo(()=>(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)?{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{hash:"local",name:r.name,hashPrefix:n?gt(n):"",iconType:"local",isNeighbor:!1,isHub:!1,isGateway:!1,isMobile:!1,isRoomServer:!1,isStale:!1,isZeroHop:!1,opacity:1,blinkIntensity:0,centrality:0}}]}:{type:"FeatureCollection",features:[]},[r,n]),k=A.useCallback(A=>{var e;if(!A.features||0===A.features.length)return;const t=null==(e=A.features[0].properties)?void 0:e.hash;t&&g&&g(t)},[g]),C=A.useCallback(A=>{var e,t;if(!A.features||0===A.features.length)return;const r=null==(e=null==b?void 0:b.getMap)?void 0:e.call(b);r&&(r.getCanvas().style.cursor="pointer");const n=null==(t=A.features[0].properties)?void 0:t.hash;n&&l(n)},[b,l]),B=A.useCallback(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);e&&(e.getCanvas().style.cursor=""),l(null)},[b,l]);A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e||!x)return;const t=[Je,Xe];for(const r of t)e.on("click",r,k),e.on("mouseenter",r,C),e.on("mouseleave",r,B);return()=>{for(const A of t)e.off("click",A,k),e.off("mouseenter",A,C),e.off("mouseleave",A,B)}},[b,x,k,C,B]);const M=A.useRef(w),D=A.useRef(y);A.useEffect(()=>{M.current=w,D.current=y},[w,y]),A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e||!x||!m||0===m.size)return;const t=e.getSource(Ke),r=e.getSource(`${Ke}-local`);if(t||r){if(t){const A=M.current;let e=!1;const r=A.features.map(A=>{const t=m.get(A.properties.hash)??0;return t!==A.properties.blinkIntensity?(e=!0,{...A,properties:{...A.properties,blinkIntensity:t}}):A});e&&t.setData({type:"FeatureCollection",features:r})}if(r&&n){const A=m.get(n)??0,e=D.current;e.features.length>0&&e.features[0].properties.blinkIntensity!==A&&r.setData({type:"FeatureCollection",features:[{...e.features[0],properties:{...e.features[0].properties,blinkIntensity:A}}]})}}},[b,x,m,n]);const E=A.useMemo(()=>{if(!f)return null;if("local"===f&&r)return{longitude:r.longitude,latitude:r.latitude,isLocal:!0,name:r.name,hash:n};const A=w.features.find(A=>A.properties.hash===f);if(!A)return null;const e=A.properties,t=e.txDelayRecJson?JSON.parse(e.txDelayRecJson):void 0;return{longitude:A.geometry.coordinates[0],latitude:A.geometry.coordinates[1],isLocal:!1,hash:e.hash,hashPrefix:e.hashPrefix,name:e.name,isHub:e.isHub,isGateway:e.isGateway,isBackbone:"backbone"===(null==t?void 0:t.networkRole),isZeroHop:e.isZeroHop,isMobile:e.isMobile,isRoomServer:e.isRoomServer,isStale:e.isStale,lastSeenTimestamp:e.lastSeenTimestamp,centrality:e.centrality,neighbor:e.neighborJson?JSON.parse(e.neighborJson):void 0,affinity:e.affinityJson?JSON.parse(e.affinityJson):void 0,txDelayRec:t,meanSnr:e.meanSnr,meanRssi:e.meanRssi}},[f,r,n,w]);if(!x)return null;const N=dA(),Q=["case",[">",["get","blinkIntensity"],.66],ut,[">",["get","blinkIntensity"],.33],lt,["==",["get","iconType"],"roomServer"],["case",["get","isNeighbor"],at,it],["==",["get","iconType"],"hub"],["case",["get","isNeighbor"],et,At],["==",["get","iconType"],"gateway"],["case",["get","isNeighbor"],rt,tt],["==",["get","iconType"],"mobile"],["case",["get","isNeighbor"],ot,nt],["case",["get","isNeighbor"],$e,qe]],j=["interpolate",["linear"],["zoom"],6,.25,10,1];return t.jsxs(t.Fragment,{children:[t.jsx(z,{id:Ke,type:"geojson",data:w,children:t.jsx(G,{id:Je,type:"symbol",layout:{"icon-image":Q,"icon-size":j,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"symbol-sort-key":["get","opacity"]},paint:{"icon-opacity":["get","opacity"]}})}),t.jsx(z,{id:`${Ke}-local`,type:"geojson",data:y,children:t.jsx(G,{id:Xe,type:"symbol",layout:{"icon-image":["case",[">",["get","blinkIntensity"],.66],dt,[">",["get","blinkIntensity"],.33],ct,st],"icon-size":j,"icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{"icon-opacity":1}})}),E&&h&&t.jsx(O,{longitude:E.longitude,latitude:E.latitude,offset:{center:[0,0],top:[0,12],"top-left":[6,12],"top-right":[-6,12],bottom:[0,-12],"bottom-left":[6,-12],"bottom-right":[-6,-12],left:[12,0],right:[-12,0]},maxWidth:"280px",closeOnClick:!0,onClose:h,className:"maplibre-popup",children:E.isLocal?t.jsxs("div",{className:"text-sm",children:[t.jsx("strong",{className:"text-base",children:E.name}),E.hash&&t.jsx("span",{className:"ml-2 font-mono text-xs text-text-muted bg-surface-elevated px-1.5 py-0.5 rounded",children:gt(E.hash)}),t.jsx("br",{}),t.jsx("span",{style:{color:N.localColor},className:"font-medium",children:"This Node (Local)"}),t.jsx("br",{}),r&&t.jsxs("span",{className:"text-xs text-text-muted",children:[r.latitude.toFixed(5),", ",r.longitude.toFixed(5)]})]}):E.neighbor&&E.hash?t.jsx(Ve,{hash:E.hash,hashPrefix:E.hashPrefix,name:E.name,isHub:E.isHub,isGateway:E.isGateway,isBackbone:E.isBackbone,isZeroHop:E.isZeroHop,isMobile:E.isMobile,isRoomServer:E.isRoomServer,isStale:E.isStale,lastSeenTimestamp:E.lastSeenTimestamp,centrality:E.centrality,affinity:E.affinity,meanSnr:E.meanSnr,meanRssi:E.meanRssi,neighbor:E.neighbor,txDelayRec:E.txDelayRec,onRemove:d?()=>d(E.hash,E.name):void 0}):null})]})}const mt=[Je,Xe];A.createContext(null);const bt="topology-validated-edges-native",pt="topology-weak-edges-native",xt="neighbor-edges-native",vt="topology-weak-edges-native",wt="topology-validated-edges-native",yt="neighbor-edges-native",kt={type:"FeatureCollection",features:[]},Ct={"line-cap":"round","line-join":"round"},Bt={"line-color":"transparent","line-width":16,"line-opacity":0};function Mt({showTopology:e,isExiting:r,hoveredEdgeKey:n,highlightedLoopEdges:o,onEdgeHover:i,onLoopHover:a,loops:s=[],neighborNames:l={},opacityBias:c=.5,widthMultiplier:u=1,trafficFilter:d=0,showNeighborLines:f=!0,disableHover:g=!1}){const{current:h}=S(),m=e||r,b=!0,p=f?"visible":"none",x=g||r,v=A.useRef(null),w=A.useRef(x),y=A.useRef(new Map),k=A.useRef(l),C=A.useRef(a);A.useLayoutEffect(()=>{w.current=x,k.current=l,C.current=a});const B=A.useMemo(()=>function(A){const e=new Map;for(const t of A)for(const A of t.edgeKeys){const r=e.get(A)??[];r.push(t),e.set(A,r)}return e}(s),[s]);A.useLayoutEffect(()=>{y.current=B},[B]);const M=A.useCallback(A=>{var e,t;if(w.current)return;if(!A.features||0===A.features.length)return;const r=A.features[0].properties;if(!(null==r?void 0:r.key))return;const n=r.key;if(n!==v.current){v.current=n;const o=!0===r.isNeighborEdge||"true"===r.isNeighborEdge,a=!0===r.isLoopEdge||"true"===r.isLoopEdge;if(o){const t={key:n,fromName:"Local",toName:r.name,certainCount:Number(r.packetCount)||0,confidence:1,isBackbone:!1,isLoopEdge:!1,isDirectPath:!0,isZeroHop:!0,symmetryRatio:1,dominantDirection:"balanced",isHubConnection:!1};i(n,[A.lngLat.lng,A.lngLat.lat],t),null==(e=C.current)||e.call(C,null)}else if(a&&C.current){const e=y.current.get(n)??[];if(e.length>0){const t=new Set;for(const A of e)for(const e of A.edgeKeys)t.add(e);const r={loops:e,highlightedEdgeKeys:t,hoveredEdgeKey:n,nodeNames:e[0].nodes.map(A=>k.current[A]||A.substring(0,4))};C.current(r,[A.lngLat.lng,A.lngLat.lat]),i(n)}else{const e={key:n,fromName:r.fromName,toName:r.toName,certainCount:Number(r.certainCount),confidence:Number(r.confidence),isBackbone:!0===r.isBackbone||"true"===r.isBackbone,isLoopEdge:!0,isDirectPath:!0===r.isDirectPath||"true"===r.isDirectPath,isZeroHop:!0===r.isZeroHop||"true"===r.isZeroHop,symmetryRatio:Number(r.symmetryRatio),dominantDirection:r.dominantDirection,isHubConnection:!0===r.isHubConnection||"true"===r.isHubConnection};i(n,[A.lngLat.lng,A.lngLat.lat],e)}}else{const e={key:n,fromName:r.fromName,toName:r.toName,certainCount:Number(r.certainCount),confidence:Number(r.confidence),isBackbone:!0===r.isBackbone||"true"===r.isBackbone,isLoopEdge:a,isDirectPath:!0===r.isDirectPath||"true"===r.isDirectPath,isZeroHop:!0===r.isZeroHop||"true"===r.isZeroHop,symmetryRatio:Number(r.symmetryRatio),dominantDirection:r.dominantDirection,isHubConnection:!0===r.isHubConnection||"true"===r.isHubConnection};i(n,[A.lngLat.lng,A.lngLat.lat],e),null==(t=C.current)||t.call(C,null)}}},[i]),D=A.useCallback(()=>{var A;null!==v.current&&(v.current=null,i(null),null==(A=C.current)||A.call(C,null))},[i]);A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e||!m)return;const t="topology-validated-edges-hitarea-native",r=()=>{try{return e.getStyle()&&e.getLayer(t)}catch{return!1}},n=()=>!!r()&&(e.on("mousemove",t,M),e.on("mouseleave",t,D),!0);if(!n()){const A=()=>{n()&&e.off("styledata",A)};return e.on("styledata",A),()=>{try{e.off("styledata",A),r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}}return()=>{try{r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}},[h,m,M,D]),A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e||!f)return;const t="neighbor-edges-hitarea-native",r=()=>{try{return e.getStyle()&&e.getLayer(t)}catch{return!1}},n=()=>!!r()&&(e.on("mousemove",t,M),e.on("mouseleave",t,D),!0);if(!n()){const A=()=>{n()&&e.off("styledata",A)};return e.on("styledata",A),()=>{try{e.off("styledata",A),r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}}return()=>{try{r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}},[h,b,f,M,D]),A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e)return;let t=null;const r=(A,t)=>{try{if(e.getLayer(A)&&e.getLayer(t))return e.moveLayer(A,t),!0}catch{}return!1},n=()=>{try{if(!e.getLayer("node-markers-layer"))return;r(yt,"node-markers-layer"),r("neighbor-edges-hitarea-native",yt),(r(wt,"neighbor-edges-hitarea-native")||r(wt,"node-markers-layer"))&&r("topology-validated-edges-hitarea-native",wt),r(vt,"topology-validated-edges-hitarea-native")}catch{}},o=()=>{t&&clearTimeout(t),t=setTimeout(n,50)},i=setTimeout(n,100);e.on("styledata",o);const a=A=>{(A.sourceId===bt||A.sourceId===pt||A.sourceId===xt)&&o()};return e.on("sourcedata",a),()=>{clearTimeout(i),t&&clearTimeout(t);try{e.off("styledata",o),e.off("sourcedata",a)}catch{}}},[h,m,b,f]);const E=x?null:n,N=function(A,e,t,r,n){const o=CA(),i=null!==A,a=n&&n.size>0,s=a?Array.from(n):[],l=e<=0?["get","baseColor"]:["case",[">=",["get","brightnessScore"],1-.5*e],"#FFFFFF",["get","baseColor"]],c=e<=0?1:["max",.1,["+",1,["*",e,3,["-",["get","brightnessScore"],.5]]]],u=a?["in",["get","key"],["literal",s]]:!!i&&["==",["get","key"],A],d=i||a,f=o.edges.hoverLoop??"#A78BFA";return{"line-color":d?["case",u,a?f:["get","hoverColor"],l]:l,"line-width":d?["case",u,["max",["*",["get","baseWidth"],t,1.3],3.5],["*",["get","baseWidth"],t]]:["*",["get","baseWidth"],t],"line-opacity":["case",["<",["get","brightnessScore"],r],0,d?["case",u,["min",["*",["get","baseOpacity"],1.25],1],["*",["get","baseOpacity"],c,.35]]:["*",["get","baseOpacity"],c]]}}(E,c,u,d,x?null:o),Q=function(A){const e=null!==A,{YELLOW:t,GREEN:r,RED:n,GRAY:o}=W,i=["to-number",["get","listenerScore"],0],a=["to-number",["get","loudScore"],0],s=["/",i,["max",["+",i,a],1]],l=["*",["+",.2,["*",["to-number",["get","trafficWeight"],0],.8]],8];return{"line-color":["case",["all",["==",i,0],["==",a,0]],o,[">=",s,.97],r,["<=",s,.03],n,["interpolate",["linear"],s,.03,n,.5,t,.97,r]],"line-width":["interpolate",["linear"],["zoom"],6,e?["case",["==",["get","key"],A],["max",["*",l,.25],1.25],["*",l,.25]]:["*",l,.25],10,e?["case",["==",["get","key"],A],["max",l,5],l]:l],"line-opacity":e?["case",["==",["get","key"],A],1,.35]:.9}}(E);return t.jsxs(t.Fragment,{children:[m&&t.jsx(z,{id:pt,type:"geojson",data:kt,children:t.jsx(G,{id:vt,type:"line",paint:N,layout:Ct})}),m&&t.jsxs(z,{id:bt,type:"geojson",data:kt,children:[t.jsx(G,{id:"topology-validated-edges-hitarea-native",type:"line",paint:Bt,layout:Ct}),t.jsx(G,{id:wt,type:"line",paint:N,layout:Ct})]}),t.jsxs(z,{id:xt,type:"geojson",data:kt,children:[t.jsx(G,{id:"neighbor-edges-hitarea-native",type:"line",paint:Bt,layout:{...Ct,visibility:p}}),t.jsx(G,{id:yt,type:"line",paint:Q,layout:{...Ct,visibility:p}})]})]})}const Dt=["topology-validated-edges-hitarea-native","topology-validated-edges-native","topology-weak-edges-native","neighbor-edges-hitarea-native","neighbor-edges-native"];function Et({targetHash:e,nodeCoordinates:t,onComplete:r}){const{current:n}=S(),o=A.useRef(null);return A.useEffect(()=>{if(!n||!e||e===o.current)return;const A=t.get(e);if(!A)return;const i=n.getMap();i.isMoving()&&i.stop(),o.current=e;const[a,s]=A;n.flyTo({center:[s,a],zoom:10,duration:2500,essential:!0}),setTimeout(()=>{null==r||r()},2600)},[e,t,n,r]),null}function Nt({highlightedEdgeKey:e,validatedPolylines:t,weakPolylines:r,onEnsureTopology:n}){const{current:o}=S(),i=A.useRef(null);return A.useEffect(()=>{if(!o||!e)return;if(e===i.current)return;i.current=e,n();const A=t.find(A=>A.edge.key===e)||r.find(A=>A.edge.key===e);if(!A)return;if(o.getMap().isMoving())return;const a=(A.from[0]+A.to[0])/2,s=(A.from[1]+A.to[1])/2,l=o.getZoom(),c=Math.max(l,11);o.easeTo({center:[s,a],zoom:c,duration:500})},[e,t,r,o,n]),null}function Qt(A,e,t,r){const n=(t-A)*Math.PI/180,o=(r-e)*Math.PI/180,i=Math.sin(n/2)*Math.sin(n/2)+Math.cos(A*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371e3}function jt(A,e,t,r=64){const n=[],o=t/6371e3*(180/Math.PI),i=o/Math.cos(e*Math.PI/180);for(let a=0;a<=r;a++){const t=a/r*2*Math.PI,s=A+i*Math.cos(t),l=e+o*Math.sin(t);n.push([s,l])}return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}}function Pt({ghost:e,neighborCoordinates:r,onHighlightedNeighborsChange:n}){const{current:o}=S(),i=A.useRef(null),a=A.useRef(null),s=A.useMemo(()=>e?new Set(e.commonNeighbors):new Set,[e]);A.useEffect(()=>{null==n||n(s)},[s,n]);const l=A.useMemo(()=>{if(!(null==e?void 0:e.commonNeighbors)||e.commonNeighbors.length<2)return 8e3;let A=0;const t=[];for(const n of e.commonNeighbors){const A=r.get(n);A&&t.push(A)}e.estimatedLocation&&t.push([e.estimatedLocation.lat,e.estimatedLocation.lon]);for(let e=0;eA&&(A=n)}return Math.max(A,2e3)},[e,r]),c=A.useMemo(()=>{if(!(null==e?void 0:e.estimatedLocation))return{type:"FeatureCollection",features:[]};const{lat:A,lon:t,uncertaintyM:r}=e.estimatedLocation,n=.5*l,o=r>0?r:2e3;return{type:"FeatureCollection",features:[jt(t,A,Math.max(500,Math.min(o,n)))]}},[e,l]);if(A.useEffect(()=>{if(!o)return;const A=o.getMap();if(e&&e.prefix!==a.current){if(a.current=e.prefix,!i.current&&A.getZoom()>3){const e=A.getCenter();i.current={center:[e.lng,e.lat],zoom:A.getZoom(),pitch:A.getPitch(),bearing:A.getBearing()}}const t=[];for(const A of e.commonNeighbors){const e=r.get(A);e&&t.push([e[1],e[0]])}if(e.estimatedLocation&&t.push([e.estimatedLocation.lon,e.estimatedLocation.lat]),t.length>0){const r=()=>{var n;if(A.isMoving())setTimeout(r,100);else if(1===t.length)o.flyTo({center:t[0],zoom:13,duration:1500});else{let A=1/0,r=-1/0,i=1/0,a=-1/0;for(const[e,n]of t)A=Math.min(A,e),r=Math.max(r,e),i=Math.min(i,n),a=Math.max(a,n);if(null==(n=e.estimatedLocation)?void 0:n.uncertaintyM){const t=e.estimatedLocation.uncertaintyM/111e3;A-=t,r+=t,i-=t,a+=t}o.fitBounds([[A,i],[r,a]],{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,duration:1500})}};setTimeout(r,50)}}if(!e&&null!==a.current&&(a.current=null,i.current)){const e=i.current,t=()=>{A.isMoving()?setTimeout(t,100):(o.flyTo({center:e.center,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,duration:1e3}),i.current=null)};setTimeout(t,50)}},[e,o,r]),!(null==e?void 0:e.estimatedLocation))return null;return t.jsx(z,{id:"ghost-uncertainty-circle",type:"geojson",data:c,children:t.jsx(G,{id:"ghost-uncertainty-fill",type:"fill",paint:{"fill-color":"rgba(167, 139, 250, 0.15)","fill-opacity":.8}})})}!function(A){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);e&&(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16))}(kA.edges.neighborHover);const Ft={longitude:0,latitude:0,zoom:2};function St(A,e,t,r){const n=(t-A)*Math.PI/180,o=(r-e)*Math.PI/180,i=Math.sin(n/2)*Math.sin(n/2)+Math.cos(A*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371}function Lt({data:A}){const e=A.subtitle&&"loop"===A.type,r=A.subtitle&&"loop"!==A.type;return t.jsxs("div",{className:"w-[540px]",children:[t.jsxs("div",{className:"flex items-center justify-between h-5",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[A.title.icon&&t.jsx("span",{className:`${A.title.color} text-base leading-none flex-shrink-0`,children:A.title.icon}),t.jsx("span",{className:`${A.title.color} font-semibold text-[13px] truncate`,children:A.title.text}),r&&t.jsx("span",{className:`${A.subtitle.color} text-[11px] flex-shrink-0`,children:A.subtitle.text})]}),A.badges.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:A.badges.map((A,e)=>t.jsx("span",{className:`${A.color} text-[11px] font-medium`,children:A.text},e))})]}),e&&t.jsx("div",{className:"h-4 mt-0.5 overflow-hidden",children:t.jsx("span",{className:"font-mono text-[10px] text-text-muted truncate block",children:A.subtitle.text})}),t.jsx("div",{className:`flex items-center gap-4 h-4 ${e?"mt-1":"mt-1.5"} text-[11px]`,children:A.stats.map((A,e)=>t.jsxs("span",{className:"whitespace-nowrap",children:[t.jsx("span",{className:`font-mono tabular-nums font-semibold ${A.color??"text-text-primary"}`,children:A.value}),t.jsx("span",{className:"text-text-muted ml-1",children:A.label}),A.unit&&t.jsx("span",{className:"text-text-muted/50 ml-0.5",children:A.unit})]},e))})]})}function It({neighbors:e,localNode:r,localHash:n,onRemoveNode:o,selectedNodeHash:i,onNodeSelected:a,highlightedEdgeKey:s,highlightedGhost:l}){const c=A.useRef(null),u=nA(),d=oA(),f=iA(),g=aA(),h=sA(),[m,b]=A.useState(!1),p=lA(A=>A.preloadFromNodes),x=lA(A=>A.isLoading),v=lA(A=>A.terrainGrid),w=n??h,y=A.useMemo(()=>{const A=[];for(const[,t]of Object.entries(e))t.latitude&&t.longitude&&A.push([t.latitude,t.longitude]);return A},[e]),k=A.useMemo(()=>function(A,e){let t=[...A];if((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&t.push([e.latitude,e.longitude]),0===t.length)return null;if(1===t.length){const[A,e]=t[0];return{longitude:e,latitude:A,zoom:14}}t=function(A,e){if(A.length<=2)return A;let t,r;if((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude))t=e.latitude,r=e.longitude;else{let e=0,n=0;for(const[t,r]of A)e+=t,n+=r;t=e/A.length,r=n/A.length}const n=A.map(([A,e])=>({pos:[A,e],dist:St(t,r,A,e)}));n.sort((A,e)=>A.dist-e.dist);const o=n[Math.floor(n.length/2)].dist,i=Math.max(3*o,50),a=n.filter(A=>A.dist<=i).map(A=>A.pos);return a.length<.5*A.length?A:a}(t,e);let r=1/0,n=-1/0,o=1/0,i=-1/0;for(const[f,g]of t)r=Math.min(r,g),n=Math.max(n,g),o=Math.min(o,f),i=Math.max(i,f);const a=(r+n)/2,s=(o+i)/2,l=i-o,c=n-r,u=Math.max(l,c);let d=16;return u>0&&(d=Math.floor(Math.log2(360/u*1.2)),d=Math.max(1,Math.min(14,d))),d=Math.min(d+1,12),{longitude:a,latitude:s,zoom:d}}(y,r),[y,r]),[C,B]=A.useState(()=>k??Ft),M=A.useRef(!1);A.useEffect(()=>{!M.current&&k&&(B(k),M.current=!0,setTimeout(()=>b(!0),50))},[k]);const[D,E]=A.useState(!1),[N,Q]=A.useState(!1),[j,P]=A.useState(!0),[F,S]=A.useState(!1),[L,I]=A.useState(!1),[R,T]=A.useState("all"),[_,H]=A.useState(null),[z,G]=A.useState(null),[O]=A.useState(0),[W]=A.useState(.5),[V]=A.useState(0),[K,J]=A.useState(null),[tA,rA]=A.useState(""),[uA,dA]=A.useState(!1),[fA,gA]=A.useState("fetching"),[hA,mA]=A.useState(!1),[bA,pA]=A.useState(0),[xA,wA]=A.useState(!1),[kA,CA]=A.useState(null),MA=A.useCallback(A=>CA(A),[]),DA=A.useCallback(()=>CA(null),[]),[,NA]=A.useState(new Set),jA=VA(A=>A.coveragePoints),PA=VA(A=>A.isVisible),FA=VA(A=>A.brightness),LA=VA(A=>A.openModal),RA=qA(A=>A.isEnabled),_A=qA(A=>A.toggle),HA=A.useRef(!1);A.useEffect(()=>{jA.length>0&&PA&&!HA.current&&(P(!1),HA.current=!0)},[jA.length,PA]);const zA=A.useRef(null);A.useEffect(()=>{if(i&&i!==zA.current){zA.current=i;const A=setTimeout(()=>{CA(i)},1250);return()=>clearTimeout(A)}},[i]);const[GA,OA]=A.useState(null),[UA,YA]=A.useState(null),WA=A.useCallback((A,e,t)=>{G(A),A&&e&&t?OA({longitude:e[0],latitude:e[1],type:"topology",properties:{key:t.key,fromName:t.fromName,toName:t.toName,certainCount:t.certainCount,confidence:t.confidence,isBackbone:t.isBackbone,isLoopEdge:t.isLoopEdge,isDirectPath:t.isDirectPath,isHubConnection:t.isHubConnection,color:"",width:0,opacity:0,symmetryRatio:t.symmetryRatio,dominantDirection:t.dominantDirection}}):A||OA(null)},[]),ZA=A.useCallback((A,e)=>{YA(A),A&&OA(null)},[]),KA=A.useMemo(()=>{const A={};for(const[t,r]of Object.entries(e))A[t]=r.node_name||r.name||t.substring(0,4);return w&&(A[w]="You"),A},[e,w]),XA=A.useMemo(()=>Object.entries(e).filter(([,A])=>A.latitude&&A.longitude),[e]),$A=A.useMemo(()=>{const A=new Map;w&&(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)&&A.set(w,[r.latitude,r.longitude]);for(const[e,t]of XA)t.latitude&&t.longitude&&A.set(e,[t.latitude,t.longitude]);return A},[w,r,XA]),Ae=A.useMemo(()=>{const A=new Map;for(const e of f)"expired"!==e.status&&A.set(e.hash,{hash:e.hash,prefix:e.prefix,count:e.count,avgRssi:e.avgRssi,avgSnr:e.avgSnr,lastSeen:e.lastSeen,confidence:1,status:e.status});return A},[f]),ee=A.useMemo(()=>{var A,t;const r=new Set;for(const n of Ae.keys())(null==(A=e[n])?void 0:A.latitude)&&(null==(t=e[n])?void 0:t.longitude)&&r.add(n);return r},[Ae,e]),te=A.useMemo(()=>{if(0===ee.size||!w)return new Map;const A=q.getPackets();if(0===A.length)return new Map;const e=AA(w);return Z(A,ee,e).scores},[ee,w,g.packetCount]),re=A.useCallback(A=>!!(w&&(A.fromHash===w&&ee.has(A.toHash)||A.toHash===w&&ee.has(A.fromHash))),[w,ee]),ne=A.useMemo(()=>{var A,t;if(0===f.length||!w)return[];if(g.backgroundLoadComplete)return[];const r=[];for(const n of f){if("expired"===n.status)continue;if(!(null==(A=e[n.hash])?void 0:A.latitude)||!(null==(t=e[n.hash])?void 0:t.longitude))continue;const o=[w,n.hash].sort(),i=`${o[0]}~${o[1]}`;r.push({fromHash:w,toHash:n.hash,key:i,packetCount:n.count,avgConfidence:1,strength:.8,avgRecency:1,hopDistanceFromLocal:0,isHubConnection:!1,isCertain:!0,certainCount:n.count,isLoopEdge:!1,forwardCount:n.count,reverseCount:0,symmetryRatio:0,dominantDirection:"forward",floodCount:n.count,directCount:0,isDirectPathEdge:!1,isZeroHop:!0,avgRssi:n.avgRssi,avgSnr:n.avgSnr})}return r},[f,w,g.backgroundLoadComplete,e]),oe=A.useMemo(()=>{const A=[];if(ne.length>0&&!g.backgroundLoadComplete){for(const e of ne){const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A}for(const e of u.validatedEdges){if(re(e))continue;const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A},[u.validatedEdges,$A,re,ne,g.backgroundLoadComplete]),ie=A.useMemo(()=>{const A=[];for(const e of u.weakEdges){if(re(e))continue;const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A},[u.weakEdges,$A,re]),ae=A.useMemo(()=>{if(!(null==r?void 0:r.latitude)||!(null==r?void 0:r.longitude))return[];const A=[],t=[r.latitude,r.longitude],n=new Map;for(const e of u.lastHopNeighbors)n.set(e.hash,e.count);const o=new Map;for(const e of f)o.set(e.hash,e.count);for(const r of ee){const i=e[r];if(!(null==i?void 0:i.latitude)||!(null==i?void 0:i.longitude))continue;const a=o.get(r),s=n.get(r);A.push({from:t,to:[i.latitude,i.longitude],hash:r,neighbor:i,lastHopData:Ae.get(r)??null,rxAdvertCount:a,txProxyCount:s})}return A},[r,ee,e,Ae,u.lastHopNeighbors,f]),se=A.useMemo(()=>new Set(u.loopEdgeKeys),[u.loopEdgeKeys]),le=A.useMemo(()=>new Set(u.backboneEdges),[u.backboneEdges]),ce=A.useMemo(()=>{let A=0;if(ne.length>0&&!g.backgroundLoadComplete){for(const e of ne)e.certainCount>A&&(A=e.certainCount);return A||1}for(const e of u.validatedEdges)e.certainCount>A&&(A=e.certainCount);return A||1},[u.validatedEdges,ne,g.backgroundLoadComplete]),ue=A.useRef(null);A.useLayoutEffect(()=>{var A,e;ue.current=(null==(e=null==(A=c.current)?void 0:A.getMap)?void 0:e.call(A))??null});const de=X(),fe=A.useMemo(()=>q.getPackets(),[de]);!function({map:e,nodeCoordinates:t,packets:r,localHash:n,neighbors:o,meshTopology:i,enabled:a=!0}){const s=A.useRef(null),l=e&&"current"in e?e.current:e;A.useEffect(()=>{s.current=l},[l]);const c=A.useRef(!1),u=A.useRef(null),d=A.useRef([]),f=A.useRef(0),g=A.useRef(!1),[h,m]=A.useState(!1),b=A.useRef(null),p=A.useRef([]),x=A.useRef(new Map),v=A.useRef(t);A.useEffect(()=>{v.current=t},[t]),A.useEffect(()=>{x.current=function(A,e){const t=new Map;for(const r of Object.keys(A)){const A=AA(r);t.has(A)||t.set(A,r)}if(e){const A=AA(e);t.set(A,e)}return t}(o,n)},[o,n]),A.useEffect(()=>{if(!a){b.current&&(clearTimeout(b.current),b.current=null),p.current=[],null!==u.current&&(cancelAnimationFrame(u.current),u.current=null),d.current=[];const A=s.current;if(A&&c.current){const e=A.getSource(_e);e&&e.setData({type:"FeatureCollection",features:[]})}g.current=!1,f.current=0}},[a]),A.useEffect(()=>{const A=l;if(!A)return;let e=null,t=!1;const r=()=>{if(!t&&!c.current)try{A.getLayer(He)&&A.removeLayer(He),A.getSource(_e)&&A.removeSource(_e),A.addSource(_e,{type:"geojson",data:{type:"FeatureCollection",features:[]}});const t=A.getLayer(Oe)?Oe:void 0;A.addLayer({id:He,type:"line",source:_e,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["any",["==",["get","isSpeculative"],!0],["==",["get","isSpeculative"],"true"]],"#8B7BAD","#00FFFF"],"line-width":["case",["any",["==",["get","isSpeculative"],!0],["==",["get","isSpeculative"],"true"]],1.875,2.5],"line-opacity":["*",["get","opacityMult"],["interpolate",["linear"],["get","intensity"],0,0,.1,.8,.5,1,1,1]]}},t),c.current=!0,m(!0),e&&(clearInterval(e),e=null)}catch{}};return A.isStyleLoaded()&&r(),A.once("style.load",()=>{r()}),c.current||(e=setInterval(()=>{c.current?e&&clearInterval(e):r()},100),setTimeout(()=>{e&&(clearInterval(e),e=null)},5e3)),()=>{t=!0,e&&clearInterval(e),null!==u.current&&(cancelAnimationFrame(u.current),u.current=null);const A=s.current;if(A&&c.current){try{A.getLayer(He)&&A.removeLayer(He),A.getSource(_e)&&A.removeSource(_e)}catch{}c.current=!1,m(!1)}}},[l]);const w=A.useRef(()=>{});A.useEffect(()=>{w.current=()=>{const A=s.current;if(!A)return;const e=A.getSource(_e);if(!e)return;const t=performance.now(),r=d.current,n=[],o=[];for(const i of r){const A=t-i.startTime-i.delay;if(A<(i.isSpeculative?Ge:ze)){o.push(i);const e=i.isSpeculative?Ye(A):Ue(A);e>0&&n.push({type:"Feature",properties:{intensity:e,opacityMult:i.isSpeculative?.5:1,isSpeculative:i.isSpeculative??!1},geometry:{type:"LineString",coordinates:[i.fromCoord,i.toCoord]}})}}e.setData({type:"FeatureCollection",features:n}),d.current=o,o.length>0?u.current=requestAnimationFrame(()=>w.current()):u.current=null}},[]);const y=A.useCallback(()=>{const A=s.current;A&&function(A){if(!A.getLayer(He))return;const e=A.getLayer(Oe)?Oe:void 0;try{A.moveLayer(He,e)}catch{}}(A),null===u.current&&(u.current=requestAnimationFrame(()=>w.current()))},[]),k=A.useCallback(()=>{if(!s.current||!c.current)return;const A=p.current;if(p.current=[],b.current=null,0===A.length)return;const e=x.current,t=v.current;if(0===e.size)return;const r=performance.now();let o=0,a=!1;const l=new Set;for(const s of A){const A=$(s,n);if(!A||A.original.length<2)continue;const c=A.original;let u=0,f=null;for(let n=0;n0){A.sort((A,e)=>e.confidence-A.confidence);const e=Math.max(1,Math.ceil(.25*A.length)),n=A.slice(0,e),i=o+150*u;for(const{edgeKey:A,otherHash:o}of n){const e=t.get(f),n=t.get(o);d.current.push({edgeKey:A,fromCoord:We(e),toCoord:We(n),startTime:r,delay:i,isSpeculative:!0}),l.add(A),a=!0}}}u>0&&(o+=150*u*.5)}a&&y()},[n,i,y]);A.useEffect(()=>{const A=s.current;if(!a)return;if(!A)return;if(!h)return;if(0===r.length)return;const e=Date.now(),t=f.current;if(!g.current){g.current=!0;const A=(e-3e4)/1e3,t=r.filter(e=>(e.timestamp??0)>=A),n=Math.max(...r.map(A=>A.timestamp??0));if(f.current=n,t.length>0){t.sort((A,e)=>(A.timestamp??0)-(e.timestamp??0));const A=t.slice(-20);p.current.push(...A),k()}return}const n=r.filter(A=>(A.timestamp??0)>t);0!==n.length&&(f.current=Math.max(...n.map(A=>A.timestamp??0)),p.current.push(...n),b.current&&clearTimeout(b.current),b.current=setTimeout(k,175))},[a,r,k,h]),A.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[])}({map:ue,nodeCoordinates:$A,packets:fe,localHash:w,neighbors:e,meshTopology:u,enabled:RA});const{isExiting:ge,isAnimating:he,resetAnimationState:me}=function({map:e,showTopology:t,validatedPolylines:r,weakPolylines:n,maxCertainCount:o,loopEdgeKeys:i,backboneEdgeKeys:a,highlightedEdgeKey:s,neighbors:l,validatedSourceId:c,weakSourceId:u,neighborPolylines:d=[],showNeighborLines:f=!0,neighborSourceId:g,neighborLinkScores:h=new Map}){const m=A.useRef(null);A.useEffect(()=>{const A=e&&"current"in e?e.current:e;m.current=A});const b=A.useRef(new Map),p=A.useRef(1),x=A.useRef(new Map),v=A.useRef(new Map),w=A.useRef(!1),y=A.useRef(null),k=A.useRef(t),C=A.useRef(new Set),B=A.useRef(""),M=A.useRef(new Map),D=A.useRef(""),E=A.useRef(""),N=A.useRef(""),Q=A.useRef(r),j=A.useRef(n),P=A.useRef(o),F=A.useRef(i),S=A.useRef(a),L=A.useRef(s),I=A.useRef(l),R=A.useRef(d),T=A.useRef(f),_=A.useRef(h);A.useEffect(()=>{Q.current=r,j.current=n,P.current=o,F.current=i,S.current=a,L.current=s,I.current=l,R.current=d,T.current=f,_.current=h},[r,n,o,i,a,s,l,d,f,h]);const H=A.useCallback((A=!1)=>{var e,t,r,n,o,i,a,s,l,d;const f=m.current;if(!f)return;const h=f.getSource(c),w=f.getSource(u),y=f.getSource(g);if(h){const o=Se(Q.current,!0,b.current,p.current,x.current,v.current,P.current,F.current,S.current,L.current,I.current),i=`${o.features.length}:${(null==(t=null==(e=o.features[0])?void 0:e.properties)?void 0:t.key)??""}:${(null==(n=null==(r=o.features[o.features.length-1])?void 0:r.properties)?void 0:n.key)??""}:${Array.from(b.current.values()).reduce((A,e)=>A+e,0).toFixed(2)}`;(A||i!==D.current)&&(h.setData(o),D.current=i)}if(w){const e=Se(j.current,!1,b.current,p.current,x.current,v.current,P.current,F.current,S.current,L.current,I.current),t=`${e.features.length}:${(null==(i=null==(o=e.features[0])?void 0:o.properties)?void 0:i.key)??""}:${(null==(s=null==(a=e.features[e.features.length-1])?void 0:a.properties)?void 0:s.key)??""}`;(A||t!==E.current)&&(w.setData(e),E.current=t)}if(y&&R.current.length>0){const e=Le(R.current,_.current),t=`${e.features.length}:${(null==(d=null==(l=e.features[0])?void 0:l.properties)?void 0:d.hash)??""}`;(A||t!==N.current)&&(y.setData(e),N.current=t)}},[c,u,g]),z=A.useCallback(()=>{y.current&&(cancelAnimationFrame(y.current),y.current=null),b.current=new Map,p.current=1,x.current=new Map,v.current=new Map,w.current=!1,C.current=new Set,B.current="",M.current=new Map},[]);return A.useEffect(()=>{const A=k.current,e=t;if(k.current=t,m.current){if(y.current&&(cancelAnimationFrame(y.current),y.current=null),A&&!e&&!w.current){w.current=!0;const A=new Map(b.current);let e=null;const t=r=>{e||(e=r);const n=r-e,o=Math.min(n/500,1),i=(a=o,1-Math.pow(1-a,3));var a;for(const[e,t]of A)b.current.set(e,t*(1-i));H(!0),o<1?y.current=requestAnimationFrame(t):(w.current=!1,b.current=new Map,C.current=new Set,B.current="",x.current=new Map,v.current=new Map,y.current=null,H(!0))};y.current=requestAnimationFrame(t)}!A&&e&&(b.current=new Map,C.current=new Set,B.current="")}},[t,H]),A.useEffect(()=>{const A=m.current;if(!t||w.current||!A)return;const e=[...r,...n],o=e.map(A=>`${A.edge.key}:${A.edge.certainCount}`).sort().join(","),i=0===C.current.size,a=""!==B.current&&B.current!==o;if(!i&&!a)return void H();const s=[],l=[];for(const{edge:t}of e)C.current.has(t.key)?l.push(t.key):s.push(t.key);a&&l.length>0&&(x.current=new Map(M.current),p.current=0),v.current=new Map;for(const{edge:t}of r){const A=vA(t.certainCount);v.current.set(t.key,A)}for(const t of s)b.current.set(t,0);for(const t of l)b.current.has(t)||b.current.set(t,1);if(s.length>0||a&&l.length>0){y.current&&(cancelAnimationFrame(y.current),y.current=null);let A=null;const e=Math.min(100,BA/Math.max(s.length,1)/2),t=r=>{A||(A=r);const n=r-A;for(let A=0;A0){const A=Math.min(n/BA,1);p.current=Fe(A)}H(!0);const o=BA+(s.length-1)*e;y.current=n{const A=m.current;if(!A||!g)return;const e=()=>{const e=A.getSource(g);if(!e)return!1;if(d.length>0){const A=Le(d,h);e.setData(A)}else e.setData({type:"FeatureCollection",features:[]});return!0};if(e())return;const t=r=>{r.sourceId===g&&e()&&A.off("sourcedata",t)};A.on("sourcedata",t);const r=()=>{e()&&(A.off("styledata",r),A.off("sourcedata",t))};return A.on("styledata",r),()=>{A.off("sourcedata",t),A.off("styledata",r)}},[g,d,h]),A.useEffect(()=>()=>{y.current&&(cancelAnimationFrame(y.current),y.current=null)},[]),{isExiting:w.current,isAnimating:null!==y.current,resetAnimationState:z,weightAnimProgress:p.current,animStartWeights:x.current,animTargetWeights:v.current}}({map:ue,showTopology:N,validatedPolylines:oe,weakPolylines:ie,maxCertainCount:ce,loopEdgeKeys:se,backboneEdgeKeys:le,highlightedEdgeKey:s,neighbors:e,validatedSourceId:bt,weakSourceId:pt,neighborPolylines:ae,showNeighborLines:j,neighborSourceId:xt,neighborLinkScores:te}),be=A.useMemo(()=>{const A=new Set;for(const e of u.hubNodes){A.add(e);for(const t of u.validatedEdges)t.fromHash===e&&A.add(t.toHash),t.toHash===e&&A.add(t.fromHash)}return A},[u.hubNodes,u.validatedEdges]),pe=A.useMemo(()=>{const A=new Set;if(!n)return A;for(const e of u.validatedEdges)e.fromHash===n&&A.add(e.toHash),e.toHash===n&&A.add(e.fromHash);return A},[n,u.validatedEdges]),{getNodeOpacity:xe}=function({soloDirect:e,soloHubs:t,neighborHashes:r,hubConnectedNodes:n,directNodeSet:o,localConnectedNodes:i,showTopology:a}){const[s,l]=A.useState(new Map),c=A.useRef(e),u=A.useRef(t),d=A.useRef(new Map),f=A.useRef(null),g=A.useRef(n),h=A.useRef(o),m=A.useRef(i),b=A.useRef(a);return A.useEffect(()=>{g.current=n,h.current=o,m.current=i,b.current=a},[n,o,i,a]),A.useEffect(()=>{const A=c.current,n=u.current,o=e,i=t;if(c.current=e,u.current=t,A===o&&n===i)return;f.current&&(cancelAnimationFrame(f.current),f.current=null);const a=g.current,s=h.current,p=m.current,x=b.current;for(const e of r)d.current.has(e)||d.current.set(e,Math.random());const v=(A,e,t)=>{const r=a.has(A),n=s.has(A),o=x&&p.has(A);return!e&&!t||(e&&t?r||n||o:t?r:!e||n||o)},w=[];for(const e of r){const t=v(e,A,n),r=v(e,o,i);t!==r&&w.push({hash:e,startOpacity:t?1:0,targetOpacity:r?1:0})}if(0===w.length)return;l(A=>{const e=new Map(A);for(const{hash:t,startOpacity:r}of w)e.set(t,r);return e});const y=w;let k=null;const C=A=>{k||(k=A);const e=A-k;let t=!0;l(()=>{const A=new Map;for(const{hash:r,startOpacity:n,targetOpacity:o}of y){const i=250*(d.current.get(r)??0),a=Math.max(0,e-i),s=Math.min(a/500,1),l=n+(o-n)*Ie(s);A.set(r,l),s<1&&(t=!1)}return A}),e<750&&!t?f.current=requestAnimationFrame(C):(f.current=null,l(new Map))};return f.current=requestAnimationFrame(C),()=>{f.current&&(cancelAnimationFrame(f.current),f.current=null)}},[e,t,r]),{nodeOpacities:s,getNodeOpacity:(A,e)=>s.has(A)?s.get(A):e?1:0}}({soloDirect:"direct"===R,soloHubs:"hubs"===R,neighborHashes:XA.map(([A])=>A),hubConnectedNodes:be,directNodeSet:ee,localConnectedNodes:pe,showTopology:N}),{blinkingNodes:ve,blinkColor:we}=function({neighbors:e,localHash:t,enabled:r=!0}){const[n,o]=A.useState(new Map),i=X(),a=A.useRef(q.getPackets());A.useEffect(()=>{a.current=q.getPackets()},[i]);const s=A.useRef(0),l=A.useRef(null),c=A.useRef(new Map),u=A.useRef(new Map);A.useEffect(()=>{u.current=function(A){const e=new Map;for(const t of Object.keys(A)){const A=AA(t);e.has(A)||e.set(A,t)}return e}(e)},[e]);const d=A.useRef(null);return A.useEffect(()=>{d.current=()=>{const A=performance.now(),e=c.current;if(0===e.size)return l.current=null,void o(new Map);const t=new Map,r=[];for(const[n,{startTime:o,staggerDelay:i}]of e){const e=A-o-i;if(e<0);else if(e>=750)r.push(n);else{const A=Re(e,750);A>0&&t.set(n,A)}}for(const n of r)e.delete(n);o(t),e.size>0&&d.current?l.current=requestAnimationFrame(d.current):l.current=null}},[]),A.useEffect(()=>{if(!r)return;const A=a.current;if(0===A.length)return;const e=s.current,n=A.filter(A=>(A.timestamp??0)>e);if(0===e){const e=A.reduce((A,e)=>Math.max(A,e.timestamp??0),0);return void(s.current=e)}if(0===n.length)return;const o=n.reduce((A,e)=>Math.max(A,e.timestamp??0),0);s.current=o;const i=performance.now();let f=0;for(const r of n){const A=$(r,t);if(!A||0===A.original.length)continue;const e=Te(A.original,u.current,t);if(0===e.length)continue;const n=375;for(let t=0;t()=>{null!==l.current&&(cancelAnimationFrame(l.current),l.current=null)},[]),{blinkingNodes:n,blinkColor:"#00FF00"}}({neighbors:e,localHash:n,enabled:RA}),ye=A.useCallback(A=>{if("all"===R)return!0;if("direct"===R)return ee.has(A);if("hubs"===R){if(u.hubNodes.includes(A))return!0;for(const e of u.validatedEdges){if(e.fromHash===A&&u.hubNodes.includes(e.toHash))return!0;if(e.toHash===A&&u.hubNodes.includes(e.fromHash))return!0}return!1}return!0},[R,ee,u.hubNodes,u.validatedEdges]),Ce=A.useCallback(async()=>{mA(!0),dA(!0),gA("fetching"),pA(0),await d(),pA(g.packetCount),gA("analyzing"),await new Promise(A=>setTimeout(A,200)),gA("building");const A=Date.now(),e=Date.now()-A;e<1700&&await new Promise(A=>setTimeout(A,1700-e)),gA("complete"),await new Promise(A=>setTimeout(A,1e3)),dA(!1),mA(!1),me(),wA(!0),setTimeout(()=>{Q(!0)},150)},[d,me,g.packetCount]),Be=A.useCallback(()=>{xA?Q(A=>!A):Ce()},[xA,Ce]),Me=A.useCallback(A=>{B(A.viewState)},[]),De=A.useCallback(()=>{E(A=>{var e,t,r,n,o,i,a;const s=!A,l=null==(r=null==(t=null==(e=c.current)?void 0:e.getContainer())?void 0:t.closest(".map-container-fullscreen, .map-container-16-9"))?void 0:r.parentElement;return s?l&&document.fullscreenEnabled?null==(n=l.requestFullscreen)||n.call(l).catch(()=>{}):l&&document.webkitFullscreenEnabled&&(null==(o=l.webkitRequestFullscreen)||o.call(l)):document.fullscreenElement?null==(i=document.exitFullscreen)||i.call(document).catch(()=>{}):document.webkitFullscreenElement&&(null==(a=document.webkitExitFullscreen)||a.call(document)),s})},[]),Ee=A.useCallback(A=>{T(A)},[]),Qe=A.useCallback(()=>{P(A=>!A)},[]),je=A.useCallback(()=>{S(A=>!A)},[]),Pe=A.useCallback(()=>{I(A=>{const e=!A;if(c.current){const A=c.current.getMap();A&&A.stop()}if(e&&c.current){const A=c.current.getMap();A&&A.easeTo({pitch:45,duration:1500,easing:A=>1-Math.pow(1-A,3)})}if(!e&&c.current){const A=c.current.getMap();A&&A.easeTo({pitch:0,bearing:0,duration:800,easing:A=>1-Math.pow(1-A,2)})}return e})},[]),Ze=A.useCallback(()=>{N||Q(!0)},[N]),Ve=A.useCallback((A,e)=>{J(A),rA(e)},[]),Ke=A.useCallback(()=>{K&&o&&o(K),J(null),rA("")},[K,o]),Je=A.useMemo(()=>[...Dt,...mt],[]),Xe=A.useRef(!1);A.useEffect(()=>{Xe.current="ontouchstart"in window||navigator.maxTouchPoints>0},[]);const qe=A.useCallback(A=>{!Xe.current||!GA||A.features&&0!==A.features.length||(OA(null),G(null))},[GA]),$e=A.useCallback(A=>{var e,t;if(!A.features||0===A.features.length)return;if(A.features.some(A=>{var e,t;return null==(t=null==(e=A.layer)?void 0:e.id)?void 0:t.startsWith("node-markers-")}))return void(z&&(G(null),OA(null)));const r=A.features.find(A=>{var e;const t=null==(e=A.layer)?void 0:e.id;return(null==t?void 0:t.startsWith("topology-"))||(null==t?void 0:t.startsWith("neighbor-"))});if(!r)return;const n=null==(e=r.layer)?void 0:e.id,o=r.properties;if(!(null==o?void 0:o.key))return;const i=null==n?void 0:n.startsWith("topology-"),a=null==n?void 0:n.startsWith("neighbor-");if(i||a){const e=o.key.replace(/-loop[12]$/,"");G(e),A.lngLat&&OA({longitude:A.lngLat.lng,latitude:A.lngLat.lat,type:i?"topology":"neighbor",properties:o})}try{(null==(t=c.current)?void 0:t.getCanvas())&&(c.current.getCanvas().style.cursor="pointer")}catch{}},[z]),At=A.useCallback(()=>{var A;G(null),OA(null);try{(null==(A=c.current)?void 0:A.getCanvas())&&(c.current.getCanvas().style.cursor="")}catch{}},[]),et=D?"map-container-fullscreen":"map-container-16-9",tt=y.length>0||(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude),rt=!m||!tt,nt=tt;return t.jsxs("div",{className:`relative ${et}`,role:"application","aria-label":"Mesh network contacts map","aria-describedby":"map-instructions",children:[t.jsx("span",{id:"map-instructions",className:"sr-only",children:"Interactive map showing mesh network contacts. Use mouse or touch to pan and zoom. Press Tab to navigate map controls. Press Escape to exit fullscreen mode."}),rt&&t.jsx("div",{className:"absolute inset-0 z-50 glass-card flex items-center justify-center","aria-hidden":"true",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-accent-primary border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm text-text-muted",children:"Loading map..."})]})}),nt&&t.jsx("div",{className:`relative w-full h-full ${D?"":"rounded-[1.125rem] overflow-hidden"} ${rt?"opacity-0":"opacity-100 transition-opacity duration-300"}`,children:t.jsxs(U,{ref:c,...C,onMove:Me,mapStyle:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",style:{width:"100%",height:"100%"},attributionControl:!1,interactiveLayerIds:Je,onMouseMove:$e,onMouseLeave:At,onClick:qe,onLoad:A=>{const e=A.target;try{const A=e.getStyle();if(null==A?void 0:A.layers){const t=["road","highway","tunnel","bridge","motorway","trunk","primary","secondary","tertiary","street","path","track"],r=A=>t.some(e=>A.toLowerCase().includes(e));for(const n of A.layers)"fill"===n.type&&n.id.toLowerCase().includes("water")&&e.setPaintProperty(n.id,"fill-color","rgba(22, 26, 32, 1)"),"line"===n.type&&r(n.id)&&e.setPaintProperty(n.id,"line-color","rgba(25, 26, 29, 1)"),"symbol"===n.type&&(e.setPaintProperty(n.id,"text-color","rgba(108, 110, 120, 0.85)"),e.setPaintProperty(n.id,"text-halo-color","rgba(8, 9, 11, 0.9)"),e.setPaintProperty(n.id,"text-halo-width",1),e.setLayoutProperty(n.id,"text-font",["Inter","Open Sans Regular","Arial Unicode MS Regular"]))}}catch(t){}},onError:A=>{},onIdle:()=>{if(!v&&!x&&c.current){const A=c.current.getMap();if(A){const t=Object.values(e).filter(A=>A.latitude&&A.longitude).map(A=>({latitude:A.latitude,longitude:A.longitude}));(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)&&t.push({latitude:r.latitude,longitude:r.longitude}),t.length>0&&p(t,A)}}},children:[t.jsx(Y,{position:"bottom-right"}),t.jsx(Ne,{enabled:L,exaggeration:4}),t.jsx(ke,{coveragePoints:jA,visible:jA.length>0&&PA,terrainEnabled:L,brightness:FA}),t.jsx(Mt,{showTopology:N,isExiting:ge,hoveredEdgeKey:z,highlightedLoopEdges:null==UA?void 0:UA.highlightedEdgeKeys,onEdgeHover:WA,onLoopHover:ZA,loops:u.loops,neighborNames:KA,opacityBias:O,widthMultiplier:W,trafficFilter:V,showNeighborLines:j,disableHover:he||hA}),i&&t.jsx(Et,{targetHash:i,nodeCoordinates:$A,onComplete:a}),s&&t.jsx(Nt,{highlightedEdgeKey:s,validatedPolylines:oe,weakPolylines:ie,onEnsureTopology:Ze}),t.jsx(Pt,{ghost:l??null,neighborCoordinates:$A,onHighlightedNeighborsChange:NA}),t.jsx(ht,{neighborsWithLocation:XA,localNode:r,localHash:n,zeroHopNeighbors:ee,lastHopNeighborMap:Ae,meshTopology:u,hoveredMarker:_,onMarkerHover:H,getNodeOpacity:xe,shouldShowNode:ye,onRequestRemove:o?Ve:void 0,openPopupId:kA,onOpenPopup:MA,onClosePopup:DA,blinkingNodes:ve,blinkColor:we})]})}),(()=>{const A=function(A,e,t){if(e){const A=e.loops[0],t=e.loops.length,r=[{label:"edges in loop",value:A.size},{label:"strength",value:`${Math.round(100*A.strength)}%`,unit:"(weakest link)"}],n=[];return A.includesLocal&&n.push({text:"★ Includes your node",color:"text-amber-400"}),t>1&&n.push({text:`Part of ${t} overlapping loops`,color:"text-violet-400/70"}),{type:"loop",title:{icon:"⟳",text:"Redundant Path"+(t>1?"s":""),color:"text-violet-400"},subtitle:{text:`${e.nodeNames.join(" → ")} → ${e.nodeNames[0]}`,color:"text-text-secondary",mono:!0},stats:r,badges:n}}if("neighbor"===(null==A?void 0:A.type)){const e=A.properties,t=[];void 0!==e.rssi&&null!==e.rssi&&t.push({label:"RSSI",value:`${Math.round(e.rssi)} dBm`,unit:e.hasAvgRssi?"avg":void 0}),void 0!==e.snr&&null!==e.snr&&t.push({label:"SNR",value:`${Number(e.snr).toFixed(1)} dB`,unit:e.hasAvgSnr?"avg":void 0});const r=e.listenerScore??0,n=e.loudScore??0,o=r>0||n>0;return o&&(t.push({label:"listener",value:r,color:"text-accent-success"}),t.push({label:"loud",value:n,color:"text-accent-danger"})),void 0===e.packetCount||o||t.push({label:"packets",value:Number(e.packetCount).toLocaleString()}),{type:"neighbor",title:{icon:"●",text:e.prefix?`${e.name} (${e.prefix})`:e.name,color:"text-amber-400"},subtitle:{text:"Direct RF Neighbor",color:"text-amber-400/70"},stats:t,badges:[]}}if("topology"===(null==A?void 0:A.type)){const e=A.properties,r=t>0?Number(e.certainCount)/t:0,n=[{label:"validations",value:e.certainCount},{label:"of max traffic",value:`${Math.round(100*r)}%`},{label:"confidence",value:`${Math.round(100*Number(e.confidence))}%`}];if(void 0!==e.symmetryRatio&&e.symmetryRatio<1){const A="forward"===e.dominantDirection?"→":"reverse"===e.dominantDirection?"←":"↔";n.push({label:"symmetric",value:`${A} ${Math.round(100*e.symmetryRatio)}%`,color:"text-text-muted"})}const o=[];return e.isBackbone&&o.push({text:"Backbone",color:"text-gray-300"}),e.isLoopEdge&&o.push({text:"Redundant",color:"text-violet-400"}),e.isDirectPath&&o.push({text:"Direct Path",color:"text-teal-400"}),{type:"topology",title:{icon:"",text:`${e.fromName} ↔ ${e.toName}`,color:"text-text-primary"},stats:n,badges:o}}return null}(GA?{type:GA.type,properties:GA.properties}:null,UA,ce);return A&&t.jsx("div",{className:"map-edge-tooltip",children:t.jsx("div",{className:"map-control-glass map-edge-tooltip-inner",children:t.jsx(Lt,{data:A})})})})(),t.jsx(QA,{mapRef:c,showNeighborLines:j,onToggleNeighborLines:Qe,hasNeighborPolylines:ae.length>0,nodeFilter:R,onNodeFilterChange:Ee,hasHubNodes:u.hubNodes.length>0,hasZeroHopNeighbors:ee.size>0,showCoverage:F,onToggleCoverage:je,show3DTerrain:L,onToggle3DTerrain:Pe,isFullscreen:D,onToggleFullscreen:De}),t.jsxs("div",{className:"map-legend-stack",children:[t.jsx(SA,{isActive:N,hasAnalyzed:xA,isLoading:hA,onClick:Be}),t.jsx(IA,{isActive:RA,onClick:_A}),t.jsx(TA,{isActive:jA.length>0&&PA,onClick:LA}),t.jsx(EA,{showTopology:N,validatedPolylineCount:oe.length,filteredNeighborCount:XA.length,hasLocalNode:!(!(null==r?void 0:r.latitude)||!(null==r?void 0:r.longitude)),meshTopology:u,zeroHopNeighbors:ee,neighborsWithLocation:XA})]}),!D&&t.jsx("div",{className:"glass-card-frame absolute inset-0 pointer-events-none rounded-[1.125rem]",style:{zIndex:9999},"aria-hidden":"true"}),t.jsx(cA,{isOpen:null!==K,onCancel:()=>J(null),onConfirm:Ke,title:"Remove Node?",message:`Remove "${tA}" from the contacts list? This will hide the node until it sends a new packet.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger"}),t.jsx(yA,{isOpen:uA,currentStep:fA,packetCount:bA}),t.jsx(JA,{})]})}export{It as default}; +import{r as A,b as e,j as t,ab as r,ac as n,ba as o,bb as i,h as a,au as s,ap as l,W as c,a3 as u,ae as d,k as f,aQ as g,bc as h,bd as m,be as b,bf as p,ag as x,A as v,aM as w,Z as y,bg as k,bh as C,bi as B,c as M,bj as D,X as E,bk as N,a9 as Q,bl as j,aw as P,b3 as F,bm as S,a0 as L,o as I,ao as R,a6 as T,bn as _,av as H,b6 as z,b7 as G,b9 as O,b5 as U,bo as Y}from"./vendor-react-C0qkT9dV.js";import"./maplibre-gl-Bk5DsYkB.js";import{L as W,c as Z}from"./link-scoring-y9pf-GTv.js";import{A as V,E as K,T as J,k as X,ay as q,az as $,d as AA,aA as eA,O as tA,Q as rA,aB as nA,aC as oA,e as iA,p as aA,aD as sA,aE as lA}from"./index-DrUSC4Ks.js";import{C as cA}from"./ConfirmModal-B37DcPi-.js";import{c as uA}from"./recharts-DRDKmvXb.js";import{g as dA,f as fA,h as gA,i as hA}from"./useThemeColors-DL9Pr7sC.js";import{p as mA,a as bA}from"./vendor-core-WoOfkQwm.js";import{P as pA,N as xA}from"./Contacts-DVK_9PWN.js";import"./deckgl-DTsmDcfs.js";import"./PageLayout-DAadOF4d.js";import"./HashBadge-CAy9V6Vn.js";import"./SignalIndicator-C1cW0knK.js";import"./CollisionExplorerModal-B0_yuX1j.js";import"./leaflet-D_ckmI2R.js";function vA(A,e){const t=Math.max(5,Math.min(A,300)),r=Math.log(5),n=Math.log(300);return 1+(Math.log(t)-r)/(n-r)*5}function wA({label:A,icon:e,status:n,detail:o}){return t.jsxs("div",{className:uA("flex items-center gap-3 py-3 px-4 rounded-xl transition-all duration-300","active"===n&&"bg-accent-primary/10","complete"===n&&"bg-accent-success/10","pending"===n&&"opacity-40"),children:[t.jsx("div",{className:uA("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-all duration-300","active"===n&&"bg-accent-primary/20","complete"===n&&"bg-accent-success/20","pending"===n&&"bg-white/5"),children:"complete"===n?t.jsx(r,{className:"w-4 h-4 text-accent-success"}):"active"===n?t.jsx(s,{className:"w-4 h-4 animate-spin text-accent-primary"}):t.jsx("span",{className:"text-text-muted",children:e})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:uA("text-sm font-medium transition-colors","active"===n&&"text-accent-primary","complete"===n&&"text-accent-success","pending"===n&&"text-text-muted"),children:A}),o&&"pending"!==n&&t.jsx("div",{className:"text-xs text-text-muted mt-0.5 truncate",children:o})]})]})}const yA=A.memo(function({isOpen:s,currentStep:l,packetCount:c,onClose:u}){if(A.useEffect(()=>{if(!s)return;const A=A=>{"Escape"===A.key&&u&&u()};window.addEventListener("keydown",A);const e=document.body.style.overflow,t=document.body.style.position,r=document.body.style.width,n=document.body.style.top,o=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${o}px`,()=>{window.removeEventListener("keydown",A),document.body.style.overflow=e,document.body.style.position=t,document.body.style.width=r,document.body.style.top=n,window.scrollTo(0,o)}},[s,u]),!s)return null;const d="complete"===l,f=A=>{const e=["fetching","analyzing","building","discovering","complete"],t=e.indexOf(l),r=e.indexOf(A);return r0?`${c.toLocaleString()} packets`:"Loading database..."}),t.jsx(wA,{label:"Analyzing Database",icon:t.jsx(i,{className:"w-4 h-4"}),status:f("analyzing"),detail:"Processing packet paths"}),t.jsx(wA,{label:"Building Topology",icon:t.jsx(n,{className:"w-4 h-4"}),status:f("building"),detail:"Computing mesh edges"}),t.jsx(wA,{label:"Discovering Nodes",icon:t.jsx(a,{className:"w-4 h-4"}),status:f("discovering"),detail:"Viterbi HMM ghost detection"})]}),t.jsx("p",{className:"text-xs text-text-muted text-center mt-5",children:"This may take a few seconds..."})]})})]}),document.body)}),kA={nodeFill:"#F5F5F0",nodeStroke:"#4A5568",localColor:"#FBBF24",hubColor:"#8B7BAD",mobileColor:"#F97316",roomServerColor:"#E17899",neighborColor:"#FBBF24",edges:{rest:"#4B4B4B",restBright:"#616161",restDim:"#3F3F3F",hoverDirect:"#6FBCBD",hoverLoop:"#8B7BAD",hoverStandard:"#8A8A8A",hoverNeighbor:"#FBBF24",neighborRest:"#6B7280",neighborHover:"#FBBF24",highlight:"#FFD700"},edgeOpacity:.82};function CA(){if("undefined"==typeof window)return kA;const A=dA(),e=fA();return{nodeFill:A.nodeFill,nodeStroke:A.nodeStroke,localColor:A.localColor,hubColor:A.hubColor,mobileColor:A.mobileColor,roomServerColor:A.roomColor,neighborColor:A.neighborColor,edges:{rest:e.rest,restBright:e.restBright,restDim:e.restDim,hoverDirect:e.hoverDirect,hoverLoop:e.hoverLoop,hoverStandard:e.hoverStandard,hoverNeighbor:e.hoverNeighbor,neighborRest:kA.edges.neighborRest,neighborHover:kA.edges.neighborHover,highlight:e.highlight},edgeOpacity:kA.edgeOpacity}}const BA=2e3;function MA({text:A}){return t.jsx(J,{content:A,delay:200,children:t.jsx(g,{className:"w-3.5 h-3.5 text-text-muted cursor-help"})})}function DA({title:A,tooltip:e,isOpen:r,onToggle:n,hasBorder:o=!1}){return t.jsxs("button",{onClick:n,className:"w-full flex items-center justify-between text-text-secondary font-medium py-1 hover:text-text-primary transition-colors "+(o?"mt-2 pt-2 border-t border-white/10":""),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[A,t.jsx(MA,{text:e})]}),t.jsx(f,{className:"w-3 h-3 text-text-muted transition-transform duration-200 "+(r?"":"-rotate-90")})]})}function EA({showTopology:e,validatedPolylineCount:r,filteredNeighborCount:n,hasLocalNode:o,meshTopology:i,zeroHopNeighbors:s,neighborsWithLocation:f}){const g=gA(),h=V(),m=K(),b=h.filter(A=>A.isLikelyReal).length,p=function(A){let e=0;for(const t of A.txDelayRecommendations.values())"backbone"===t.networkRole&&e++;return e}(i),[x,v]=A.useState(!0),[w,y]=A.useState(!0),[k,C]=A.useState(!0);return t.jsxs("div",{className:"map-control-glass text-xs",style:{padding:"0.625rem"},children:[t.jsx(DA,{title:"Nodes",tooltip:"Node type shown by shape. Yellow = direct RF neighbor.",isOpen:x,onToggle:()=>v(!x)}),x&&t.jsxs("div",{className:"flex flex-col gap-1 mt-1.5",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.nodeFill}}),t.jsx("span",{className:"text-text-muted",children:"Node"}),t.jsx(MA,{text:"Standard mesh node. Can be a repeater, client, or companion device."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.hubColor}}),t.jsx("span",{className:"text-text-muted",children:"Hub"}),t.jsx(MA,{text:"Network hub (≥10% of last-hop traffic). Hubs are central to mesh traffic flow."})]}),(B=f,B.some(([,A])=>{var e;const t=null==(e=A.contact_type)?void 0:e.toLowerCase();return"room server"===t||"room_server"===t||"room"===t||"server"===t})&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(l,{className:"w-3 h-3 flex-shrink-0",style:{color:g.roomColor},strokeWidth:2.5}),t.jsx("span",{className:"text-text-muted",children:"Room"}),t.jsx(MA,{text:"Room Server identity. Hosts a chat room that clients can sync messages with."})]})),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(c,{className:"w-3 h-3 flex-shrink-0",style:{color:g.localColor},strokeWidth:2.5}),t.jsx("span",{className:"text-text-muted",children:"Local"}),t.jsx(MA,{text:"Your repeater. This is the node running pyMC_Repeater that you're connected to."})]}),s.size>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded flex-shrink-0",style:{width:"12px",height:"8px",backgroundColor:g.neighborColor}}),t.jsx("span",{className:"text-text-muted",children:"Neighbor"}),t.jsx(MA,{text:"Zero-hop direct RF contact. Color indicates we receive their ADVERTs directly."})]}),i.gatewayNodes.length>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:g.hubColor,opacity:.7}}),t.jsx("span",{className:"text-text-muted",children:"Gateway"}),t.jsx(MA,{text:"Significant traffic forwarder (7-10% of last-hop traffic). Gateways relay substantial traffic to the local node."})]}),p>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",backgroundColor:"rgb(168, 85, 247)",opacity:.8}}),t.jsx("span",{className:"text-text-muted",children:"Backbone"}),t.jsx(MA,{text:"Critical relay with 4+ neighbors and high betweenness centrality. Backbone nodes carry the majority of mesh traffic."})]}),i.mobileNodes.length>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"rounded-full flex-shrink-0",style:{width:"14px",height:"14px",background:"transparent",border:`4px solid ${g.mobileColor}`,boxSizing:"border-box"}}),t.jsx("span",{className:"text-text-muted",children:"Mobile"}),t.jsx(MA,{text:"Volatile node that frequently appears/disappears from paths. Likely a portable or vehicle-mounted device."})]}),b>0&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(a,{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--accent-tertiary)"},strokeWidth:2.5}),t.jsxs("span",{className:"text-text-muted",children:["Ghost (",b,")"]}),t.jsx(MA,{text:"Unknown repeater discovered via Viterbi HMM path analysis. These nodes appear in paths but aren't in our neighbor table."})]})]}),s.size>0&&t.jsxs(t.Fragment,{children:[t.jsx(DA,{title:"Link Quality",tooltip:"Neighbor edge colors based on bidirectional link balance. 2-Way = balanced. Listener = they hear us. Loud = they route to us.",isOpen:w,onToggle:()=>y(!w),hasBorder:!0}),w&&t.jsxs("div",{className:"flex flex-col gap-1 mt-1.5",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.YELLOW}}),t.jsx("span",{className:"text-text-muted",children:"2-Way"}),t.jsx(MA,{text:"33-67% balanced. Ideal bidirectional link - this neighbor both hears us and routes traffic to us equally well."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.GREEN}}),t.jsx("span",{className:"text-text-muted",children:"Listener"}),t.jsx(MA,{text:">67% listener score. This neighbor hears our transmissions well (good RX from us)."})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"flex-shrink-0 rounded-sm",style:{width:"16px",height:"3px",backgroundColor:W.RED}}),t.jsx("span",{className:"text-text-muted",children:"Loud"}),t.jsx(MA,{text:"<33% listener score. This neighbor routes more traffic TO us than they hear from us."})]})]})]}),e&&r>0&&t.jsxs(t.Fragment,{children:[t.jsx(DA,{title:"Topology",tooltip:"Links with 5+ validations. Thickness = relative strength.",isOpen:k,onToggle:()=>C(!k),hasBorder:!0}),k&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-0.5 text-text-muted mt-1",children:[t.jsxs("div",{className:"flex justify-between tabular-nums",children:[t.jsx("span",{children:"Nodes"}),t.jsx("span",{className:"text-text-secondary",children:n+(o?1:0)})]}),i.hubNodes.length>0&&t.jsxs("div",{className:"flex justify-between tabular-nums",children:[t.jsx("span",{children:"Hubs"}),t.jsx("span",{style:{color:kA.hubColor},children:i.hubNodes.length})]})]}),i.loops.length>0&&t.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-white/10",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(u,{className:"w-3 h-3 flex-shrink-0",style:{color:kA.edges.hoverLoop}}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{style:{color:kA.edges.hoverLoop},className:"font-medium",children:[i.loops.length," ",1===i.loops.length?"Loop":"Loops"]}),t.jsx("span",{className:"text-text-muted text-[10px] leading-tight",children:"Redundant paths"})]})]})}),m.totalPaths>0&&t.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-white/10",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(d,{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--accent-primary)"}}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{style:{color:"var(--accent-primary)"},className:"font-medium",children:[m.totalPaths.toLocaleString()," Viterbi"]}),t.jsx("span",{className:"text-text-muted text-[10px] leading-tight",children:"HMM decoded paths"})]})]})})]})]})]});var B}function NA({options:A,value:e,onChange:r,size:n="sm",className:o=""}){const i={sm:"text-[10px] px-1.5 py-0.5",md:"text-xs px-2 py-1"};return t.jsx("div",{className:`inline-flex rounded-md bg-black/40 p-0.5 ${o}`,role:"radiogroup",children:A.map(A=>{const o=e===A.value;return t.jsx("button",{onClick:()=>r(A.value),className:`\n ${i[n]}\n rounded transition-all font-medium\n ${o?"bg-white/15 text-text-primary shadow-sm":"text-text-muted hover:text-text-secondary hover:bg-white/5"}\n `,role:"radio","aria-checked":o,title:A.title,children:A.icon?t.jsxs("span",{className:"flex items-center gap-1",children:[A.icon,t.jsx("span",{className:"hidden sm:inline",children:A.label})]}):A.label},A.value)})})}function QA({mapRef:A,showNeighborLines:e,onToggleNeighborLines:r,hasNeighborPolylines:n,nodeFilter:o,onNodeFilterChange:i,hasHubNodes:a,hasZeroHopNeighbors:s,showCoverage:l,onToggleCoverage:c,show3DTerrain:u,onToggle3DTerrain:d,isFullscreen:f,onToggleFullscreen:g}){const y=[{value:"all",label:"All",title:"Show all nodes"},...a?[{value:"hubs",label:"Hubs",title:"Show only hub nodes and their connections"}]:[],...s?[{value:"direct",label:"Direct",title:"Show only zero-hop (direct RF) neighbors"}]:[]];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-3 right-3 z-[600] map-controls-container sm:top-4 sm:right-4",children:t.jsxs("div",{className:"map-controls-row",children:[n&&t.jsx("button",{onClick:r,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",style:e?{backgroundColor:"#1a1408"}:void 0,title:e?"Hide neighbor lines":"Show neighbor lines","aria-label":e?"Hide neighbor lines":"Show neighbor lines","aria-pressed":e,children:t.jsx(h,{className:"map-control-icon "+(e?"text-amber-400":"text-text-secondary")})}),y.length>1&&t.jsx(NA,{options:y,value:o,onChange:i,size:"sm"}),t.jsx("button",{onClick:d,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",style:u?{backgroundColor:"#0a1a1a"}:void 0,title:u?"Disable 3D terrain":"Enable 3D terrain","aria-label":u?"Disable 3D terrain":"Enable 3D terrain","aria-pressed":u,children:t.jsx(m,{className:"map-control-icon "+(u?"text-teal-400":"text-text-secondary")})}),t.jsx("button",{onClick:g,className:"map-control-btn rounded-lg transition-colors hover:bg-white/5",title:f?"Exit fullscreen":"Fullscreen","aria-label":f?"Exit fullscreen":"Enter fullscreen","aria-pressed":f,children:f?t.jsx(b,{className:"map-control-icon text-text-secondary"}):t.jsx(p,{className:"map-control-icon text-text-secondary"})})]})}),t.jsx("div",{className:"absolute top-[3.5rem] right-3 z-[600] map-controls-container sm:top-[4rem] sm:right-4 lg:top-[4.5rem]",children:t.jsxs("div",{className:"flex flex-col items-stretch map-nav-module",children:[t.jsx("button",{onClick:()=>{var e,t;null==(t=null==(e=A.current)?void 0:e.getMap())||t.zoomIn()},className:"map-control-btn hover:bg-white/5 flex items-center justify-center",title:"Zoom in","aria-label":"Zoom in",children:t.jsx(x,{className:"map-control-icon text-text-secondary"})}),t.jsx("button",{onClick:()=>{var e,t;null==(t=null==(e=A.current)?void 0:e.getMap())||t.zoomOut()},className:"map-control-btn hover:bg-white/5 border-t border-white/6 flex items-center justify-center",title:"Zoom out","aria-label":"Zoom out",children:t.jsx(v,{className:"map-control-icon text-text-secondary"})}),t.jsx("button",{onClick:()=>{var e;const t=null==(e=A.current)?void 0:e.getMap();t&&t.easeTo({bearing:0,pitch:0,duration:300})},className:"map-control-btn hover:bg-white/5 border-t border-white/6 flex items-center justify-center",title:"Reset bearing to north","aria-label":"Reset bearing to north",children:t.jsx(w,{className:"map-control-icon text-text-secondary"})})]})})]})}const jA="#4ADE80",PA="DeepAnalysis";function FA(){return"abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(36*Math.random())]}function SA({isActive:e,hasAnalyzed:r,isLoading:o,onClick:i}){const[a,l]=A.useState(!1),[c,u]=A.useState(PA),d=A.useRef(!1),f=A.useRef(null),[g]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)}),h=a&&!e&&!o&&g;A.useEffect(()=>{if(a&&!e&&!o&&!d.current){d.current=!0;const A=performance.now(),e=t=>{const r=t-A,n=Math.min(r/700,1),o=Math.floor(12*n);let i="";for(let A=0;A<12;A++)i+=A{f.current&&cancelAnimationFrame(f.current)}},[a,e,o]);const m=o?"Analyzing...":c;return t.jsxs("button",{onClick:i,onMouseEnter:()=>g&&l(!0),onMouseLeave:()=>g&&l(!1),onPointerEnter:()=>g&&l(!0),onPointerLeave:()=>g&&l(!1),disabled:o,className:`map-control-btn flex items-center gap-2 w-full text-left transition-colors ${e?"map-control-glass-active":"map-control-glass"} ${o?"cursor-wait":""}`,style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#0a1a0a":"#050505"},title:o?"Analyzing packet history...":r?e?"Hide topology edges":"Show topology edges":"Load full packet history and build topology",children:[o?t.jsx(s,{className:"w-3.5 h-3.5 flex-shrink-0 text-green-400 animate-spin"}):t.jsx(n,{className:"w-3.5 h-3.5 flex-shrink-0 transition-colors "+(e?"text-green-400":"text-text-secondary"),style:h?{color:jA}:void 0}),t.jsx("span",{className:e?"text-green-400":"text-text-secondary",style:{fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"0.6875rem",fontWeight:e||h?700:500,letterSpacing:"-0.01em",lineHeight:1,...h?{color:jA}:{}},children:m})]})}const LA="#00FFFF";function IA({isActive:e,onClick:r}){const[n,o]=A.useState(!1),[i,a]=A.useState(0),s=A.useRef(!1),l=A.useRef(null),[c,u]=A.useState(0),d=A.useRef(!1),[f]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)}),g=n&&!e&&f;A.useEffect(()=>{g&&!d.current&&(d.current=!0,u(1),setTimeout(()=>u(2),100),setTimeout(()=>u(3),200)),n||(d.current=!1,u(0))},[g,n]),A.useEffect(()=>{if(n&&!e&&!s.current){s.current=!0;const A=performance.now(),e=t=>{const r=t-A,n=Math.min(r/400,1);a(n),n<1&&(l.current=requestAnimationFrame(e))};l.current=requestAnimationFrame(e)}return n||(l.current&&(cancelAnimationFrame(l.current),l.current=null),s.current=!1,a(0)),()=>{l.current&&cancelAnimationFrame(l.current)}},[n,e]);const h=A=>{if(e)return;if(!g)return;const t=11*i;return A>=t-2&&Af&&o(!0),onMouseLeave:()=>f&&o(!1),onPointerEnter:()=>f&&o(!0),onPointerLeave:()=>f&&o(!1),className:"map-control-btn flex items-center gap-2 w-full text-left transition-colors "+(e?"map-control-glass-active":"map-control-glass"),style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#0a2a2a":"#050505"},title:e?"Disable live packet tracing (reduces CPU usage)":"Enable live packet tracing",children:[t.jsx(y,{className:"w-3.5 h-3.5 flex-shrink-0 "+(e?"text-cyan-400":"text-text-secondary"),fill:1===c?"#FFFFFF":3===c?LA:"none",stroke:1===c||2===c?"#FFFFFF":g?LA:"currentColor",style:{transition:"fill 0.05s, stroke 0.05s"}}),t.jsx("span",{className:e?"text-cyan-400":"text-text-secondary",style:{fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"0.6875rem",fontWeight:e||g?700:500,letterSpacing:"-0.01em",lineHeight:1},children:"LiveTrace".split("").map((A,e)=>t.jsx("span",{style:{color:h(e)||void 0},children:A},e))})]})}const RA="#fe8019";function TA({isActive:e,onClick:r,brightness:n=.7,onBrightnessChange:o}){const[i,a]=A.useState(!1),[s,l]=A.useState(!1),[c]=A.useState(()=>{var A;return"undefined"!=typeof window&&((null==(A=window.matchMedia)?void 0:A.call(window,"(hover: hover)").matches)??!1)});A.useEffect(()=>{if(!i||e)return;const A=requestAnimationFrame(()=>l(!0)),t=setTimeout(()=>l(!1),80);return()=>{cancelAnimationFrame(A),clearTimeout(t)}},[i,e]);const u=Math.max(.01,Math.min(1,n)),d=u<.999,f=u>.011,g=i&&!e&&c;return t.jsxs("button",{onClick:r,onMouseEnter:()=>c&&a(!0),onMouseLeave:()=>c&&a(!1),onPointerEnter:()=>c&&a(!0),onPointerLeave:()=>c&&a(!1),className:"map-control-btn flex items-center gap-2 w-full text-left transition-colors "+(e?"map-control-glass-active":"map-control-glass"),style:{padding:"0.5rem 0.625rem",backgroundColor:e?"#1a1408":"#050505"},title:e?"Configure wardriving coverage":"Show wardriving coverage",children:[t.jsx(k,{className:"w-3.5 h-3.5 flex-shrink-0 transition-colors "+(e?"text-amber-400":"text-text-secondary"),style:g?{color:RA}:void 0}),t.jsx("span",{className:e?"text-amber-400":"text-text-secondary",style:{fontFamily:e||g?"'Jacquard 12', serif":"ui-monospace, SFMono-Regular, monospace",fontSize:e||g?"0.75rem":"0.6875rem",fontWeight:500,letterSpacing:"-0.01em",lineHeight:1,transition:"none",transform:e?"scale(1.45)":g?`scale(${s?1.595:1.45})`:void 0,transformOrigin:"left center",...g?{color:RA}:{}},children:"Wardrive"}),e&&o&&t.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[t.jsx("button",{onClick:A=>{A.stopPropagation();const e=Math.max(.01,u-.2);null==o||o(e)},disabled:!f,className:"p-0.5 rounded transition-colors "+(f?"hover:bg-[#252525] text-amber-400":"text-amber-400/30 cursor-not-allowed"),title:`Decrease opacity (${Math.round(100*u)}%)`,children:t.jsx(C,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:A=>{A.stopPropagation();const e=Math.min(1,u+.2);null==o||o(e)},disabled:!d,className:"p-0.5 rounded transition-colors "+(d?"hover:bg-[#252525] text-amber-400":"text-amber-400/30 cursor-not-allowed"),title:`Increase opacity (${Math.round(100*u)}%)`,children:t.jsx(B,{className:"w-3.5 h-3.5"})})]})]})}function _A(A){let e=!0,t=-90,r=90,n=-180,o=180;for(const i of A.toLowerCase()){const A="0123456789bcdefghjkmnpqrstuvwxyz".indexOf(i);if(-1!==A)for(let i=4;i>=0;i--){const a=A>>i&1;if(e){const A=(n+o)/2;a?n=A:o=A}else{const A=(t+r)/2;a?t=A:r=A}e=!e}}return{lat:(t+r)/2,lon:(n+o)/2}}function HA(A){return Math.exp(-A*Math.LN2/7)}const zA="pymc-wardriving-url",GA="pymc-wardriving-enabled",OA="pymc-wardriving-brightness";function UA(A){"undefined"!=typeof localStorage&&(A?localStorage.setItem(zA,A):localStorage.removeItem(zA))}function YA(A){"undefined"!=typeof localStorage&&localStorage.setItem(GA,String(A))}function WA(){if("undefined"==typeof localStorage)return.7;const A=localStorage.getItem(OA);if(A){const e=parseFloat(A);if(!isNaN(e)&&e>=.01&&e<=1)return e}return.7}function ZA(A,e=null){if(null!==A){const t=(Math.max(-12,Math.min(12,A))+12)/24;return null!==e?.8*t+(Math.max(-120,Math.min(-50,e))+120)/70*.2:t}return null!==e?(Math.max(-120,Math.min(-50,e))+120)/70:.5}const VA=M((A,e)=>({status:"idle",isVisible:"undefined"!=typeof localStorage&&"true"===localStorage.getItem(GA),coveragePoints:[],repeaters:[],error:null,stats:{coverageCount:0,repeaterCount:0,lastUpdated:null},url:"undefined"==typeof localStorage?"":localStorage.getItem(zA)||"",brightness:WA(),isModalOpen:!1,openModal:()=>A({isModalOpen:!0}),closeModal:()=>A({isModalOpen:!1}),setUrl:e=>A({url:e}),setBrightness:e=>{const t=Math.max(.01,Math.min(1,e));!function(A){if("undefined"==typeof localStorage)return;const e=Math.max(.01,Math.min(1,A));localStorage.setItem(OA,String(e))}(t),A({brightness:t})},toggleVisibility:()=>{const t=!e().isVisible;YA(t),A({isVisible:t})},setVisible:e=>{YA(e),A({isVisible:e})},loadCoverage:async e=>{if(!e.trim())return A({error:"Please enter a URL",status:"error"}),!1;try{new URL(e.trim())}catch{return A({error:"Invalid URL format",status:"error"}),!1}A({error:null,status:"connecting"});try{A({status:"loading"});const t=await async function(A){const e=`${A.replace(/\/+$/,"").replace(/\/get-nodes$/,"").replace(/\/get-samples$/,"")}/get-samples`,t=await async function(A,e={},t=8e3){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return await fetch(A,{...e,signal:r.signal})}catch(o){if(o instanceof Error&&"AbortError"===o.name)throw new Error(`Connection timed out after ${t/1e3}s`);throw o}finally{clearTimeout(n)}}(e,{headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Failed to fetch precise samples: ${t.status}`);return t.json()}(e.trim());if(!t||"object"!=typeof t)throw new Error("Invalid response from server");if(!Array.isArray(t.keys))throw new Error("No sample data found in response");A({status:"processing"});const r=function(A){var e;const t=[];for(const r of A.keys){if(!r.observed)continue;const{lat:A,lon:n}=_A(r.hash),o=parseInt(r.time,10),i=isNaN(o)?30:(Date.now()-o)/864e5,a=HA(i),s=ZA(r.snr,r.rssi)*(.3+.7*a);t.push({lat:A,lon:n,successRate:r.observed?1:0,weight:s,totalSamples:1,ageDays:i,geohash:r.hash,repeaters:(null==(e=r.path)?void 0:e.map(A=>A.toLowerCase()))||[]})}return t}(t);if(0===r.length)throw new Error("No valid coverage points found");return A({coveragePoints:r,repeaters:[],stats:{coverageCount:r.length,repeaterCount:0,lastUpdated:new Date},status:"success",isVisible:!0,url:e.trim()}),UA(e.trim()),YA(!0),!0}catch(t){const e=t instanceof Error?t.message:"Failed to load coverage data";let r=e;return e.includes("timed out")?r="Connection timed out. Server may be unreachable or slow.":e.includes("Failed to fetch")||e.includes("NetworkError")?r="Could not connect to server. Check the URL and try again.":e.includes("CORS")?r="Server does not allow cross-origin requests.":e.includes("404")?r="Coverage endpoint not found. Check the URL.":(e.includes("ERR_NAME_NOT_RESOLVED")||e.includes("DNS"))&&(r="Server not found. Check the URL for typos."),A({error:r,status:"error"}),!1}},clearCoverage:()=>{A({coveragePoints:[],repeaters:[],stats:{coverageCount:0,repeaterCount:0,lastUpdated:null},status:"idle",error:null,isVisible:!1,url:""}),UA(""),YA(!1)}}));function KA({status:A}){if("connecting"!==A&&"loading"!==A&&"processing"!==A)return null;const e={idle:"",connecting:"Connecting to server...",loading:"Fetching coverage data...",processing:"Processing coverage points...",success:"",error:""}[A];return e?t.jsxs("div",{className:"flex items-center gap-3 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl",children:[t.jsx("div",{className:"relative",children:t.jsx(s,{className:"w-5 h-5 text-amber-400 animate-spin"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-amber-400 font-medium",children:e}),t.jsx("div",{className:"mt-2 h-1 bg-amber-500/20 rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-amber-400 rounded-full transition-all duration-300",style:{width:"connecting"===A?"30%":"loading"===A?"60%":"90%"}})})]})]}):null}function JA(){const{isModalOpen:e,closeModal:n,status:i,isVisible:a,stats:l,error:c,url:u,brightness:f,loadCoverage:g,clearCoverage:h,toggleVisibility:m,setUrl:b,setBrightness:p}=VA(),x="connecting"===i||"loading"===i||"processing"===i,[v,w]=A.useState(u),y=A.useCallback(async()=>{await g(v)},[v,g]),k=A.useCallback(()=>{w(""),h()},[h]),C=A.useCallback(A=>{"Enter"!==A.key||A.shiftKey||x||(A.preventDefault(),y())},[y,x]),M=A.useCallback(A=>{const e=A.target.value;w(e),b(e)},[b]);if(!e)return null;const S=l.coverageCount>0,L=v.trim().length>0&&!x;return t.jsxs("div",{className:"fixed inset-0 z-[10010] flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-md",onClick:x?void 0:n}),t.jsxs("div",{className:"relative glass-card-elevated w-full max-w-md mx-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-subtle",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"p-2 rounded-lg bg-amber-500/20",children:t.jsx(D,{className:"w-5 h-5 text-amber-400"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Wardriving Coverage"}),t.jsx("p",{className:"text-xs text-text-muted",children:"Overlay RF coverage heatmap"})]})]}),t.jsx("button",{onClick:n,disabled:x,className:"p-2 rounded-lg hover:bg-[#252525] transition-colors disabled:opacity-50",children:t.jsx(E,{className:"w-5 h-5 text-text-secondary"})})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-2",children:"Coverage Server URL"}),t.jsx("input",{type:"url",value:v,onChange:M,onKeyDown:C,placeholder:"https://coverage.wcmesh.com",className:"w-full px-4 py-3 bg-black/30 border border-border rounded-xl text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-amber-500/50 focus:border-amber-500/50 transition-all disabled:opacity-50",disabled:x}),t.jsx("p",{className:"mt-1.5 text-xs text-text-muted",children:"Enter the base URL of a wardriving coverage server (e.g., coverage.wcmesh.com)"})]}),t.jsx(KA,{status:i}),"error"===i&&c&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-xl",children:[t.jsx(N,{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Connection Failed"}),t.jsx("p",{className:"text-xs text-red-400/80 mt-0.5",children:c})]})]}),"success"===i&&S&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-xl",children:[t.jsx(r,{className:"w-5 h-5 text-green-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-green-400 font-medium",children:"Data Loaded Successfully"}),t.jsxs("p",{className:"text-xs text-green-400/80 mt-0.5",children:[l.coverageCount.toLocaleString()," coverage points • ",l.repeaterCount.toLocaleString()," repeaters"]})]})]}),S&&!x&&"success"!==i&&t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-amber-500/10 border border-amber-500/30 rounded-xl",children:[t.jsx(Q,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm text-amber-400 font-medium",children:"Coverage Data Loaded"}),t.jsxs("p",{className:"text-xs text-amber-400/80 mt-0.5",children:[l.coverageCount.toLocaleString()," points •",l.lastUpdated&&` Last updated ${l.lastUpdated.toLocaleTimeString()}`]})]})]}),S&&!x&&t.jsx("div",{className:"p-3 bg-black/20 border border-border-subtle rounded-xl",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(B,{className:"w-4 h-4 flex-shrink-0 "+(f>.5?"text-amber-400":"text-text-muted")}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-xs text-text-secondary",children:"Brightness"}),t.jsxs("span",{className:"text-xs text-text-muted font-mono",children:[Math.round(100*f),"%"]})]}),t.jsx("input",{type:"range",min:"1",max:"100",value:100*f,onChange:A=>p(Number(A.target.value)/100),className:"w-full h-1.5 cursor-pointer accent-amber-400"})]})]})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 border-t border-border-subtle",children:[t.jsx("div",{className:"flex items-center gap-2",children:S&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:m,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-[#202020] rounded-lg transition-colors disabled:opacity-50",title:a?"Hide heatmap":"Show heatmap",children:a?t.jsxs(t.Fragment,{children:[t.jsx(j,{className:"w-3.5 h-3.5"})," Hide"]}):t.jsxs(t.Fragment,{children:[t.jsx(d,{className:"w-3.5 h-3.5"})," Show"]})}),t.jsxs("button",{onClick:k,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-400/80 hover:text-red-400 hover:bg-red-500/10 rounded-lg transition-colors disabled:opacity-50",title:"Clear coverage data",children:[t.jsx(P,{className:"w-3.5 h-3.5"})," Clear"]})]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:n,disabled:x,className:"px-4 py-2 text-sm font-medium text-text-secondary hover:bg-[#252525] rounded-lg transition-colors disabled:opacity-50",children:S?"Done":"Cancel"}),t.jsx("button",{onClick:y,disabled:!L,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium bg-amber-500 hover:bg-amber-400 text-black rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:x?t.jsxs(t.Fragment,{children:[t.jsx(s,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):S?t.jsxs(t.Fragment,{children:[t.jsx(o,{className:"w-4 h-4"}),"Refresh"]}):t.jsxs(t.Fragment,{children:[t.jsx(F,{className:"w-4 h-4"}),"Connect"]})})]})]})]})]})}const XA={getItem:A=>{try{return localStorage.getItem(A)}catch{return null}},setItem:(A,e)=>{try{localStorage.setItem(A,e)}catch{}},removeItem:A=>{try{localStorage.removeItem(A)}catch{}}},qA=M()(mA(A=>({isEnabled:!1,toggle:()=>A(A=>({isEnabled:!A.isEnabled})),setEnabled:e=>A({isEnabled:e})}),{name:"pymc-live-trace",storage:bA(()=>XA)}));var $A=function(A){var e,t=void 0!==(A=A||{})?A:{},r={};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);var n,o="";"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),o=0!==o.indexOf("blob:")?o.substr(0,o.lastIndexOf("/")+1):"",n=function(A,e,t){var r=new XMLHttpRequest;r.open("GET",A,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var n=O(A);n?e(n.buffer):t()}},r.onerror=t,r.send(null)};var i=t.print||function(){}.bind(),a=t.printErr||function(){}.bind();for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);r=null,t.arguments&&t.arguments;var s=0,l=!1;function c(A){var e=t["_"+A];return e||tA("Assertion failed: "+("Cannot call unknown function "+A+", make sure it is exported")),e}var u,d,f,g,h,m,b,p="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function x(A,e){return A?function(A,e,t){for(var r=e+t,n=e;A[n]&&!(n>=r);)++n;if(n-e>16&&A.subarray&&p)return p.decode(A.subarray(e,n));for(var o="";e>10,56320|1023&l)}}else o+=String.fromCharCode((31&i)<<6|a)}else o+=String.fromCharCode(i)}return o}(f,A,e):""}function v(A,e){return A%e>0&&(A+=e-A%e),A}function w(A){u=A,t.HEAP8=d=new Int8Array(A),t.HEAP16=g=new Int16Array(A),t.HEAP32=h=new Int32Array(A),t.HEAPU8=f=new Uint8Array(A),t.HEAPU16=new Uint16Array(A),t.HEAPU32=new Uint32Array(A),t.HEAPF32=m=new Float32Array(A),t.HEAPF64=b=new Float64Array(A)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var y=t.TOTAL_MEMORY||33554432;function k(A){for(;A.length>0;){var e=A.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?t.dynCall_v(r):t.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}y=(u=t.buffer?t.buffer:new ArrayBuffer(y)).byteLength,w(u),h[7156]=5271536;var C=[],B=[],M=[],D=[];function E(A){C.unshift(A)}function N(A){D.unshift(A)}var Q=Math.abs,j=Math.ceil,P=Math.floor,F=Math.min,S=0,L=null;t.preloadedImages={},t.preloadedAudios={};var I,R,T=null,_="data:application/octet-stream;base64,";function H(A){return String.prototype.startsWith?A.startsWith(_):0===A.indexOf(_)}function z(){return d.length}T="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMAdmVydGV4Um90YXRpb25zAGNlbGxUb1ZlcnRleABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";var G="function"==typeof atob?atob:function(A){var e,t,r,n,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="",l=0;A=A.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(A.charAt(l++))<<2|(n=a.indexOf(A.charAt(l++)))>>4,t=(15&n)<<4|(o=a.indexOf(A.charAt(l++)))>>2,r=(3&o)<<6|(i=a.indexOf(A.charAt(l++))),s+=String.fromCharCode(e),64!==o&&(s+=String.fromCharCode(t)),64!==i&&(s+=String.fromCharCode(r))}while(l=0){if((0|t)>13780509){if(0|(a=0|le(15,s)))break;s=0|n[(l=s)>>2],l=0|n[l+4>>2]}else c=0|qe(0|t,0|(a=((0|t)<0)<<31>>31),3,0),l=0|B(),a=0|Ze(0|t,0|a,1,0),a=0|Ze(0|(a=0|qe(0|c,0|l,0|a,0|B())),0|B(),1,0),l=0|B(),n[s>>2]=a,n[s+4>>2]=l,s=a;if(lt(0|r,0,s<<3),0|o){lt(0|o,0,s<<2),a=0|I(A,e,t,r,o,s,l,0);break}(a=0|We(s,4))?(c=0|I(A,e,t,r,a,s,l,0),Ye(a),a=c):a=13}else a=2}while(0);return P=i,0|a}function L(A,e,t,r,o){A|=0,e|=0,t|=0,r|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(a=P,P=P+16|0,m=a+8|0,n[(h=i=a)>>2]=A,n[h+4>>2]=e,(0|t)<0)return P=a,2;if(n[(s=r)>>2]=A,n[s+4>>2]=e,(s=!!(0|o))&&(n[o>>2]=0),0|HA(A,e))return P=a,9;n[m>>2]=0;A:do{if((0|t)>=1)if(s)for(f=1,d=0,g=0,h=1,s=A;;){if(!(d|g)){if(0|(s=0|R(s,e,4,m,i)))break A;if(0|HA(s=0|n[(e=i)>>2],e=0|n[e+4>>2])){s=9;break A}}if(0|(s=0|R(s,e,0|n[26800+(g<<2)>>2],m,i)))break A;if(s=0|n[(e=i)>>2],e=0|n[e+4>>2],n[(A=r+(f<<3)|0)>>2]=s,n[A+4>>2]=e,n[o+(f<<2)>>2]=h,l=(0|(A=d+1|0))==(0|h),u=6==(0|(c=g+1|0)),0|HA(s,e)){s=9;break A}if((0|(h=h+(u&l&1)|0))>(0|t)){s=0;break}f=f+1|0,d=l?0:A,g=l?u?0:c:g}else for(f=1,d=0,g=0,h=1,s=A;;){if(!(d|g)){if(0|(s=0|R(s,e,4,m,i)))break A;if(0|HA(s=0|n[(e=i)>>2],e=0|n[e+4>>2])){s=9;break A}}if(0|(s=0|R(s,e,0|n[26800+(g<<2)>>2],m,i)))break A;if(s=0|n[(e=i)>>2],e=0|n[e+4>>2],n[(A=r+(f<<3)|0)>>2]=s,n[A+4>>2]=e,l=(0|(A=d+1|0))==(0|h),u=6==(0|(c=g+1|0)),0|HA(s,e)){s=9;break A}if((0|(h=h+(u&l&1)|0))>(0|t)){s=0;break}f=f+1|0,d=l?0:A,g=l?u?0:c:g}else s=0}while(0);return P=a,0|s}function I(A,e,t,r,o,i,a,s){t|=0,r|=0,o|=0,s|=0;var l,c,u,d=0,f=0,g=0,h=0,m=0,b=0,p=0;if(u=P,P=P+16|0,l=u+8|0,c=u,d=0|At(0|(A|=0),0|(e|=0),0|(i|=0),0|(a|=0)),g=0|B(),!(!(0|(p=0|n[(b=h=r+(d<<3)|0)>>2]))&!(0|(b=0|n[b+4>>2]))|(f=(0|p)==(0|A)&(0|b)==(0|e))))do{d=0|$e(0|(d=0|Ze(0|d,0|g,1,0)),0|B(),0|i,0|a),g=0|B(),f=(0|(b=0|n[(p=h=r+(d<<3)|0)>>2]))==(0|A)&(0|(p=0|n[p+4>>2]))==(0|e)}while(!(!(0|b)&!(0|p)|f));if(d=o+(d<<2)|0,f&&(0|n[d>>2])<=(0|s))return P=u,0;if(n[(p=h)>>2]=A,n[p+4>>2]=e,n[d>>2]=s,(0|s)>=(0|t))return P=u,0;switch(f=s+1|0,n[l>>2]=0,0|(d=0|R(A,e,2,l,c))){case 9:m=9;break;case 0:(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f))||(m=9)}A:do{if(9==(0|m)){switch(n[l>>2]=0,0|(d=0|R(A,e,3,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,1,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,5,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,4,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}switch(n[l>>2]=0,0|(d=0|R(A,e,6,l,c))){case 9:break;case 0:if(0|(d=0|I(0|n[(d=c)>>2],0|n[d+4>>2],t,r,o,i,a,f)))break A;break;default:break A}return P=u,0}}while(0);return P=u,0|d}function R(A,e,t,r,o){A|=0,e|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0;if((t|=0)>>>0>6)return 1;if(d=(0|n[(r|=0)>>2])%6|0,n[r>>2]=d,(0|d)>0){s=0;do{t=0|xA(t),s=s+1|0}while((0|s)<(0|n[r>>2]))}if(d=0|tt(0|A,0|e,45),B(),(a=127&d)>>>0>121)return 5;i=0|OA(A,e),s=0|tt(0|A,0|e,52),B(),s&=15;A:do{if(s){for(;;){if(c=0|tt(0|A,0|e,0|(l=3*(15-s|0)|0)),B(),7==(0|(c&=7))){e=5;break}if(g=!(0|VA(s)),s=s+-1|0,f=0|rt(7,0,0|l),e&=~B(),A=0|rt(0|n[(g?432:16)+(28*c|0)+(t<<2)>>2],0,0|l)|A&~f,e|=l=0|B(),!(t=0|n[(g?640:224)+(28*c|0)+(t<<2)>>2])){t=0;break A}if(!s){u=8;break A}}return 0|e}u=8}while(0);8==(0|u)&&(A|=0|rt(0|(g=0|n[848+(28*a|0)+(t<<2)>>2]),0,45),e=B()|-1040385&e,t=0|n[4272+(28*a|0)+(t<<2)>>2],127&~g||(g=0|rt(0|n[848+(28*a|0)+20>>2],0,45),e=B()|-1040385&e,t=0|n[4272+(28*a|0)+20>>2],A=0|YA(g|A,e),e=0|B(),n[r>>2]=1+(0|n[r>>2]))),c=0|tt(0|A,0|e,45),B(),c&=127;A:do{if(0|z(c)){e:do{if(1==(0|OA(A,e))){if((0|a)!=(0|c)){if(0|Y(c,0|n[7696+(28*a|0)>>2])){A=0|ZA(A,e),l=1,e=0|B();break}M(27795,26864,533,26872)}switch(0|i){case 3:A=0|YA(A,e),e=0|B(),n[r>>2]=1+(0|n[r>>2]),l=0;break e;case 5:A=0|ZA(A,e),e=0|B(),n[r>>2]=5+(0|n[r>>2]),l=0;break e;case 0:return 9;default:return 1}}else l=0}while(0);if((0|t)>0){s=0;do{A=0|UA(A,e),e=0|B(),s=s+1|0}while((0|s)!=(0|t))}if((0|a)!=(0|c)){if(!(0|G(c))){if(!!(0|l)|5!=(0|OA(A,e)))break;n[r>>2]=1+(0|n[r>>2]);break}switch(127&d){case 8:case 118:break A}3!=(0|OA(A,e))&&(n[r>>2]=1+(0|n[r>>2]))}}else if((0|t)>0){s=0;do{A=0|YA(A,e),e=0|B(),s=s+1|0}while((0|s)!=(0|t))}}while(0);return n[r>>2]=((0|n[r>>2])+t|0)%6|0,n[(g=o)>>2]=A,n[g+4>>2]=e,0}function T(A,e,t,r){A|=0,e|=0,t|=0,r|=0;var o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0;if(i=P,P=P+16|0,h=i+8|0,n[(g=o=i)>>2]=A,n[g+4>>2]=e,(0|t)<0)return P=i,2;if(!t)return n[(h=r)>>2]=A,n[h+4>>2]=e,P=i,0;n[h>>2]=0;A:do{if(0|HA(A,e))A=9;else{a=0,g=A;do{if(0|(A=0|R(g,e,4,h,o)))break A;if(a=a+1|0,0|HA(g=0|n[(e=o)>>2],e=0|n[e+4>>2])){A=9;break A}}while((0|a)<(0|t));n[(f=r)>>2]=g,n[f+4>>2]=e,f=t+-1|0,d=0,A=1;do{if(a=26800+(d<<2)|0,5==(0|d))for(l=0|n[a>>2],s=0,a=A;;){if(0|(A=0|R(0|n[(A=o)>>2],0|n[A+4>>2],l,h,o)))break A;if((0|s)!=(0|f)){if(c=0|n[(u=o)>>2],u=0|n[u+4>>2],n[(A=r+(a<<3)|0)>>2]=c,n[A+4>>2]=u,0|HA(c,u)){A=9;break A}A=a+1|0}else A=a;if((0|(s=s+1|0))>=(0|t))break;a=A}else for(l=o,u=0|n[a>>2],c=0,a=A,s=0|n[l>>2],l=0|n[l+4>>2];;){if(0|(A=0|R(s,l,u,h,o)))break A;if(s=0|n[(l=o)>>2],l=0|n[l+4>>2],n[(A=r+(a<<3)|0)>>2]=s,n[A+4>>2]=l,A=a+1|0,0|HA(s,l)){A=9;break A}if((0|(c=c+1|0))>=(0|t))break;a=A}d=d+1|0}while(d>>>0<6);A=(0|g)==(0|n[(A=o)>>2])&&(0|e)==(0|n[A+4>>2])?0:9}}while(0);return P=i,0|A}function _(A,e,t,r){t|=0,r|=0;var o,i,a,s=0,l=0;for(a=P,P=P+16|0,o=a,i=a+8|0,s=(s=!(0|HA(A|=0,e|=0)))?1:2;;){if(n[i>>2]=0,!(0|R(A,e,s,i,o))&((0|n[(l=o)>>2])==(0|t)?(0|n[l+4>>2])==(0|r):0)){A=4;break}if((s=s+1|0)>>>0>=7){s=7,A=4;break}}return 4==(0|A)?(P=a,0|s):0}function H(A,e,t,r,i,a,s){e|=0,t|=0,r|=0,i|=0,a|=0,s|=0;var l,c,u,d,f,g,h,m,b,p,x=0,v=0,w=0,y=0,k=0,C=0,M=0,D=0,E=0,N=0,Q=0,j=0,F=0,S=0,L=0,I=0,R=0,T=0,_=0;if(p=P,P=P+64|0,h=p+48|0,m=p+32|0,b=p+24|0,l=p+8|0,c=p,(0|(v=0|n[(A|=0)>>2]))<=0)return P=p,0;for(u=A+4|0,d=h+8|0,f=m+8|0,g=l+8|0,x=0,F=0;;){j=(w=0|n[u>>2])+(F<<4)|0,n[h>>2]=n[j>>2],n[h+4>>2]=n[j+4>>2],n[h+8>>2]=n[j+8>>2],n[h+12>>2]=n[j+12>>2],(0|F)==(v+-1|0)?(n[m>>2]=n[w>>2],n[m+4>>2]=n[w+4>>2],n[m+8>>2]=n[w+8>>2],n[m+12>>2]=n[w+12>>2]):(j=w+(F+1<<4)|0,n[m>>2]=n[j>>2],n[m+4>>2]=n[j+4>>2],n[m+8>>2]=n[j+8>>2],n[m+12>>2]=n[j+12>>2]),v=0|tA(h,m,r,b);A:do{if(v)w=0,x=v;else if(w=0|n[(v=b)>>2],(0|(v=0|n[v+4>>2]))>0|!(0|v)&w>>>0>0){Q=0,j=0;e:for(;;){if(R=1/(+(w>>>0)+4294967296*+(0|v)),_=+o[h>>3],T=+((v=0|Ve(0|w,0|v,0|Q,0|j))>>>0)+4294967296*+(0|B()),I=+(Q>>>0)+4294967296*+(0|j),o[l>>3]=R*(_*T)+R*(+o[m>>3]*I),o[g>>3]=R*(+o[d>>3]*T)+R*(+o[f>>3]*I),0|(v=0|KA(l,r,c))){x=v;break}C=0|At(0|(E=0|n[(N=c)>>2]),0|(N=0|n[N+4>>2]),0|e,0|t),y=0|B(),w=0|n[(k=v=s+(C<<3)|0)>>2],k=0|n[k+4>>2];t:do{if(!(0|w)&!(0|k))S=v,L=16;else for(M=0,D=0;;){if((0|M)>(0|t)|(0|M)==(0|t)&D>>>0>e>>>0){x=1;break e}if((0|w)==(0|E)&(0|k)==(0|N))break t;if(C=0|$e(0|(v=0|Ze(0|C,0|y,1,0)),0|B(),0|e,0|t),y=0|B(),D=0|Ze(0|D,0|M,1,0),M=0|B(),!(0|(w=0|n[(k=v=s+(C<<3)|0)>>2]))&!(0|(k=0|n[k+4>>2]))){S=v,L=16;break}}}while(0);if(16!=(0|L)||(L=0,!(0|E)&!(0|N))||(n[(D=S)>>2]=E,n[D+4>>2]=N,D=a+(n[i>>2]<<3)|0,n[D>>2]=E,n[D+4>>2]=N,D=0|Ze(0|n[(D=i)>>2],0|n[D+4>>2],1,0),E=0|B(),n[(N=i)>>2]=D,n[N+4>>2]=E),Q=0|Ze(0|Q,0|j,1,0),j=0|B(),w=0|n[(v=b)>>2],!((0|(v=0|n[v+4>>2]))>(0|j)|(0|v)==(0|j)&w>>>0>Q>>>0)){w=1;break A}}w=0}else w=1}while(0);if(F=F+1|0,!w){L=21;break}if((0|F)>=(0|(v=0|n[A>>2]))){x=0,L=21;break}}return 21==(0|L)?(P=p,0|x):0}function z(A){return(A|=0)>>>0>121?0|(A=0):0|(A=0|n[7696+(28*A|0)+16>>2])}function G(A){return 4==(0|(A|=0))|117==(0|A)|0}function O(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)>>2]}function U(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)+4>>2]}function Y(A,e){return e|=0,(0|n[7696+(28*(A|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|n[7696+(28*A|0)+24>>2])==(0|e))}function W(A,e){return 0|n[848+(28*(A|=0)|0)+((e|=0)<<2)>>2]}function Z(A,e){return e|=0,(0|n[848+(28*(A|=0)|0)>>2])==(0|e)?0|(e=0):(0|n[848+(28*A|0)+4>>2])==(0|e)?0|(e=1):(0|n[848+(28*A|0)+8>>2])==(0|e)?0|(e=2):(0|n[848+(28*A|0)+12>>2])==(0|e)?0|(e=3):(0|n[848+(28*A|0)+16>>2])==(0|e)?0|(e=4):(0|n[848+(28*A|0)+20>>2])==(0|e)?0|(e=5):0|((0|n[848+(28*A|0)+24>>2])==(0|e)?6:7)}function V(A){var e,t,r;return e=(r=+o[16+(A|=0)>>3])-(t=+o[A+24>>3]),+(r>3]<+o[A+24>>3]|0}function J(A){return+(+o[(A|=0)>>3]-+o[A+8>>3])}function X(A,e){A|=0;var t,r,n=0;return(n=+o[(e|=0)>>3])>=+o[A+8>>3]&&n<=+o[A>>3]?(t=+o[A+16>>3],n=+o[A+24>>3],e=(r=+o[e+8>>3])>=n,A=r<=t&1,t>3]<+o[e+8>>3]||+o[A+8>>3]>+o[e>>3]?0|(s=0):(n=(l=+o[A+16>>3])<(u=+o[(t=A+24|0)>>3]),c=(a=+o[(s=e+16|0)>>3])<(i=+o[(r=e+24|0)>>3]),e=u-a>3],e)||(u=+ie(+o[t>>3],A))>+ie(+o[s>>3],e)?0|(c=0):0|(c=1))}function $(A,e){e|=0;var t,r,n,i,a,s=0,l=0,c=0,u=0;return+o[(A|=0)>>3]<+o[e>>3]||+o[A+8>>3]>+o[e+8>>3]?0|(s=0):(n=(i=+o[(s=A+16|0)>>3])<(l=+o[A+24>>3]),c=(u=+o[(t=e+16|0)>>3])<(a=+o[(r=e+24|0)>>3]),e=l-u>3],e)?0|(c=(u=+ie(+o[s>>3],A))>=+ie(+o[t>>3],e)):0|(c=0))}function AA(A,e){A|=0,e|=0;var t,r,i,a,s,l=0;i=P,P=P+176|0,n[(r=i)>>2]=4,l=+o[e>>3],o[r+8>>3]=l,a=+o[e+16>>3],o[r+16>>3]=a,o[r+24>>3]=l,l=+o[e+24>>3],o[r+32>>3]=l,s=+o[e+8>>3],o[r+40>>3]=s,o[r+48>>3]=l,o[r+56>>3]=s,o[r+64>>3]=a,t=96+(e=r+72|0)|0;do{n[e>>2]=0,e=e+4|0}while((0|e)<(0|t));st(0|A,0|r,168),P=i}function eA(A,e,t){A|=0,e|=0,t|=0;var r,a,c,u,d,f,g,h=0,m=0,b=0,p=0,v=0,y=0,k=0;f=P,P=P+288|0,d=f+264|0,p=f+96|0,m=(h=b=f)+96|0;do{n[h>>2]=0,h=h+4|0}while((0|h)<(0|m));return 0|(e=0|Ae(e,b))?(P=f,0|(y=e)):(qA(b=0|n[(m=b)>>2],m=0|n[m+4>>2],d),$A(b,m,p),u=+ae(d,p+8|0),o[d>>3]=+o[A>>3],o[(m=d+8|0)>>3]=+o[A+16>>3],o[p>>3]=+o[A+8>>3],o[(b=p+8|0)>>3]=+o[A+24>>3],a=+ae(d,p),k=+o[m>>3]-+o[b>>3],c=+l(+k),g=+o[d>>3]-+o[p>>3],r=+l(+g),!(0==k|0==g)&&(k=+ot(+c,+r),k=+x(+a*a/+it(+k/+it(+c,+r),3)/(u*(2.59807621135*u)*.8)),o[i>>3]=k,v=~~k>>>0,y=+l(k)>=1?k>0?~~+w(+s(k/4294967296),4294967295)>>>0:~~+x((k-+(~~k>>>0))/4294967296)>>>0:0,2146435072&~n[i+4>>2])?(p=!(0|v)&!(0|y),n[(e=t)>>2]=p?1:v,n[e+4>>2]=p?0:y,e=0):e=1,P=f,0|(y=e))}function tA(A,e,t,r){A|=0,e|=0,t|=0,r|=0;var a,c,u,d,f=0,g=0,h=0;d=P,P=P+288|0,c=d+264|0,u=d+96|0,a=(f=g=d)+96|0;do{n[f>>2]=0,f=f+4|0}while((0|f)<(0|a));return 0|(t=0|Ae(t,g))?(P=d,0|(r=t)):(qA(f=0|n[(t=g)>>2],t=0|n[t+4>>2],c),$A(f,t,u),h=+ae(c,u+8|0),h=+x(+ +ae(A,e)/(2*h)),o[i>>3]=h,t=~~h>>>0,f=+l(h)>=1?h>0?~~+w(+s(h/4294967296),4294967295)>>>0:~~+x((h-+(~~h>>>0))/4294967296)>>>0:0,2146435072&~n[i+4>>2]?(g=!(0|t)&!(0|f),n[r>>2]=g?1:t,n[r+4>>2]=g?0:f,P=d,0|(r=0)):(P=d,0|(r=1)))}function rA(A,e,t,r){e|=0,t|=0,r|=0,n[(A|=0)>>2]=e,n[A+4>>2]=t,n[A+8>>2]=r}function nA(A){var e,t=0,r=0,o=0,i=0,a=0;t=0|n[(A|=0)>>2],r=0|n[(e=A+4|0)>>2],(0|t)<0&&(r=r-t|0,n[e>>2]=r,n[(a=A+8|0)>>2]=(0|n[a>>2])-t,n[A>>2]=0,t=0),(0|r)<0?(t=t-r|0,n[A>>2]=t,i=(0|n[(a=A+8|0)>>2])-r|0,n[a>>2]=i,n[e>>2]=0,r=0):(a=i=A+8|0,i=0|n[i>>2]),(0|i)<0&&(t=t-i|0,n[A>>2]=t,r=r-i|0,n[e>>2]=r,n[a>>2]=0,i=0),(0|(o=(0|i)<(0|(o=(0|r)<(0|t)?r:t))?i:o))<=0||(n[A>>2]=t-o,n[e>>2]=r-o,n[a>>2]=i-o)}function oA(A,e){var t,r;e|=0,r=0|n[8+(A|=0)>>2],t=+((0|n[A+4>>2])-r|0),o[e>>3]=+((0|n[A>>2])-r|0)-.5*t,o[e+8>>3]=.8660254037844386*t}function iA(A,e,t){A|=0,e|=0,n[(t|=0)>>2]=(0|n[e>>2])+(0|n[A>>2]),n[t+4>>2]=(0|n[e+4>>2])+(0|n[A+4>>2]),n[t+8>>2]=(0|n[e+8>>2])+(0|n[A+8>>2])}function aA(A,e,t){A|=0,e|=0,n[(t|=0)>>2]=(0|n[A>>2])-(0|n[e>>2]),n[t+4>>2]=(0|n[A+4>>2])-(0|n[e+4>>2]),n[t+8>>2]=(0|n[A+8>>2])-(0|n[e+8>>2])}function sA(A,e){e|=0;var t,r=0;r=0|v(0|n[(A|=0)>>2],e),n[A>>2]=r,t=0|v(0|n[(r=A+4|0)>>2],e),n[r>>2]=t,e=0|v(0|n[(A=A+8|0)>>2],e),n[A>>2]=e}function lA(A){var e,t,r=0,o=0,i=0,a=0,s=0;s=(0|(t=0|n[(A|=0)>>2]))<0,A=(A=(o=(0|(a=((e=(0|(i=(0|n[A+4>>2])-(s?t:0)|0))<0)?0-i|0:0)+((0|n[A+8>>2])-(s?t:0))|0))<0)?0:a)-((i=(0|(o=(0|A)<(0|(o=(0|(r=(e?0:i)-(o?a:0)|0))<(0|(a=(s?0:t)-(e?i:0)-(o?a:0)|0))?r:a))?A:o))>0)?o:0)|0,r=r-(i?o:0)|0;A:do{switch(a-(i?o:0)|0){case 0:switch(0|r){case 0:return 0|(0|A?1==(0|A)?1:7:0);case 1:return 0|(0|A?1==(0|A)?3:7:2);default:break A}case 1:switch(0|r){case 0:return 0|(0|A?1==(0|A)?5:7:4);case 1:if(A)break A;return 6;default:break A}}}while(0);return 7}function cA(A){var e,t,r=0,o=0,i=0,a=0,s=0,l=0,c=0;if(l=0|n[(t=8+(A|=0)|0)>>2],(e=(0|n[A>>2])-l|0)>>>0>715827881|(l=(0|n[(c=A+4|0)>>2])-l|0)>>>0>715827881){if(a=2147483647-e|0,s=-2147483648-e|0,(i=(0|e)>0)?(0|a)<(0|e):(0|s)>(0|e))return 1;if(o=e<<1,i?(2147483647-o|0)<(0|e):(-2147483648-o|0)>(0|e))return 1;if((0|l)>0?(2147483647-l|0)<(0|l):(-2147483648-l|0)>(0|l))return 1;if(r=3*e|0,o=l<<1,(i?(0|a)<(0|o):(0|s)>(0|o))||((0|e)>-1?(-2147483648|r)>=(0|l):(-2147483648^r)<(0|l)))return 1}else o=l<<1,r=3*e|0;return i=0|Oe(.14285714285714285*+(r-l|0)),n[A>>2]=i,a=0|Oe(.14285714285714285*+(o+e|0)),n[c>>2]=a,n[t>>2]=0,r=(o=(0|a)<(0|i))?i:a,(0|(o=o?a:i))<0&&((-2147483648==(0|o)||((0|r)>0?(2147483647-r|0)<(0|o):(-2147483648-r|0)>(0|o)))&&M(27795,26892,354,26903),((0|r)>-1?(-2147483648|r)>=(0|o):(-2147483648^r)<(0|o))&&M(27795,26892,354,26903)),r=a-i|0,(0|i)<0?(o=0-i|0,n[c>>2]=r,n[t>>2]=o,n[A>>2]=0,i=0):(r=a,o=0),(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[t>>2]=o,n[c>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[c>>2]=a,n[t>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[c>>2]=r-i,n[t>>2]=o-i),0}function uA(A){var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0;if(i=0|n[(e=8+(A|=0)|0)>>2],(a=(0|n[A>>2])-i|0)>>>0>715827881|(i=(0|n[(s=A+4|0)>>2])-i|0)>>>0>715827881){if((r=(0|a)>0)?(2147483647-a|0)<(0|a):(-2147483648-a|0)>(0|a))return 1;if(t=a<<1,(o=(0|i)>0)?(2147483647-i|0)<(0|i):(-2147483648-i|0)>(0|i))return 1;if(l=i<<1,o?(2147483647-l|0)<(0|i):(-2147483648-l|0)>(0|i))return 1;if(r?(2147483647-t|0)<(0|i):(-2147483648-t|0)>(0|i))return 1;if(r=3*i|0,(0|i)>-1?(-2147483648|r)>=(0|a):(-2147483648^r)<(0|a))return 1}else r=3*i|0,t=a<<1;return o=0|Oe(.14285714285714285*+(t+i|0)),n[A>>2]=o,i=0|Oe(.14285714285714285*+(r-a|0)),n[s>>2]=i,n[e>>2]=0,t=(r=(0|i)<(0|o))?o:i,(0|(r=r?i:o))<0&&((-2147483648==(0|r)||((0|t)>0?(2147483647-t|0)<(0|r):(-2147483648-t|0)>(0|r)))&&M(27795,26892,402,26917),((0|t)>-1?(-2147483648|t)>=(0|r):(-2147483648^t)<(0|r))&&M(27795,26892,402,26917)),t=i-o|0,(0|o)<0?(r=0-o|0,n[s>>2]=t,n[e>>2]=r,n[A>>2]=0,o=0):(t=i,r=0),(0|t)<0&&(o=o-t|0,n[A>>2]=o,r=r-t|0,n[e>>2]=r,n[s>>2]=0,t=0),a=o-r|0,i=t-r|0,(0|r)<0?(n[A>>2]=a,n[s>>2]=i,n[e>>2]=0,t=i,i=a,r=0):i=o,(0|(o=(0|r)<(0|(o=(0|t)<(0|i)?t:i))?r:o))<=0||(n[A>>2]=i-o,n[s>>2]=t-o,n[e>>2]=r-o),0}function dA(A){var e,t,r=0,o=0,i=0,a=0,s=0;o=0|n[(e=8+(A|=0)|0)>>2],i=0|Oe(.14285714285714285*+((3*(r=(0|n[A>>2])-o|0)|0)-(o=(0|n[(t=A+4|0)>>2])-o|0)|0)),n[A>>2]=i,r=0|Oe(.14285714285714285*+((o<<1)+r|0)),n[t>>2]=r,n[e>>2]=0,o=r-i|0,(0|i)<0?(s=0-i|0,n[t>>2]=o,n[e>>2]=s,n[A>>2]=0,r=o,i=0,o=s):o=0,(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[e>>2]=o,n[t>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[t>>2]=a,n[e>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=r-i,n[e>>2]=o-i)}function fA(A){var e,t,r=0,o=0,i=0,a=0,s=0;o=0|n[(e=8+(A|=0)|0)>>2],i=0|Oe(.14285714285714285*+(((r=(0|n[A>>2])-o|0)<<1)+(o=(0|n[(t=A+4|0)>>2])-o|0)|0)),n[A>>2]=i,r=0|Oe(.14285714285714285*+((3*o|0)-r|0)),n[t>>2]=r,n[e>>2]=0,o=r-i|0,(0|i)<0?(s=0-i|0,n[t>>2]=o,n[e>>2]=s,n[A>>2]=0,r=o,i=0,o=s):o=0,(0|r)<0&&(i=i-r|0,n[A>>2]=i,o=o-r|0,n[e>>2]=o,n[t>>2]=0,r=0),s=i-o|0,a=r-o|0,(0|o)<0?(n[A>>2]=s,n[t>>2]=a,n[e>>2]=0,r=a,a=s,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|r)<(0|a)?r:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=r-i,n[e>>2]=o-i)}function gA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],i=0|n[(t=A+4|0)>>2],a=0|n[(r=A+8|0)>>2],s=i+(3*o|0)|0,n[A>>2]=s,i=a+(3*i|0)|0,n[t>>2]=i,o=(3*a|0)+o|0,n[r>>2]=o,a=i-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=a,n[r>>2]=o,n[A>>2]=0,i=a,a=0):a=s,(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function hA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=(3*(o=0|n[(t=A+4|0)>>2])|0)+s|0,s=(i=0|n[(r=A+8|0)>>2])+(3*s|0)|0,n[A>>2]=s,n[t>>2]=a,o=(3*i|0)+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,s=0):i=a,(0|i)<0&&(s=s-i|0,n[A>>2]=s,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=s-o|0,a=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=a,n[r>>2]=0,s=e,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(n[A>>2]=s-i,n[t>>2]=a-i,n[r>>2]=o-i)}function mA(A,e){A|=0;var t,r,o,i=0,a=0,s=0;((e|=0)-1|0)>>>0>=6||(s=(0|n[15440+(12*e|0)>>2])+(0|n[A>>2])|0,n[A>>2]=s,o=A+4|0,a=(0|n[15440+(12*e|0)+4>>2])+(0|n[o>>2])|0,n[o>>2]=a,r=A+8|0,e=(0|n[15440+(12*e|0)+8>>2])+(0|n[r>>2])|0,n[r>>2]=e,i=a-s|0,(0|s)<0?(e=e-s|0,n[o>>2]=i,n[r>>2]=e,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,e=e-i|0,n[r>>2]=e,n[o>>2]=0,i=0),t=a-e|0,s=i-e|0,(0|e)<0?(n[A>>2]=t,n[o>>2]=s,n[r>>2]=0,a=t,e=0):s=i,(0|(i=(0|e)<(0|(i=(0|s)<(0|a)?s:a))?e:i))<=0||(n[A>>2]=a-i,n[o>>2]=s-i,n[r>>2]=e-i))}function bA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=(o=0|n[(t=A+4|0)>>2])+s|0,s=(i=0|n[(r=A+8|0)>>2])+s|0,n[A>>2]=s,n[t>>2]=a,o=i+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function pA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],a=0|n[(t=A+4|0)>>2],i=0|n[(r=A+8|0)>>2],s=a+o|0,n[A>>2]=s,a=i+a|0,n[t>>2]=a,o=i+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,a=0):(i=a,a=s),(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function xA(A){switch(0|(A|=0)){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1}return 0|A}function vA(A){switch(0|(A|=0)){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1}return 0|A}function wA(A){var e,t,r,o=0,i=0,a=0,s=0;o=0|n[(A|=0)>>2],i=0|n[(t=A+4|0)>>2],a=0|n[(r=A+8|0)>>2],s=i+(o<<1)|0,n[A>>2]=s,i=a+(i<<1)|0,n[t>>2]=i,o=(a<<1)+o|0,n[r>>2]=o,a=i-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=a,n[r>>2]=o,n[A>>2]=0,i=a,a=0):a=s,(0|i)<0&&(a=a-i|0,n[A>>2]=a,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=a-o|0,s=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=s,n[r>>2]=0,a=e,o=0):s=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(n[A>>2]=a-i,n[t>>2]=s-i,n[r>>2]=o-i)}function yA(A){var e,t,r,o=0,i=0,a=0,s=0;s=0|n[(A|=0)>>2],a=((o=0|n[(t=A+4|0)>>2])<<1)+s|0,s=(i=0|n[(r=A+8|0)>>2])+(s<<1)|0,n[A>>2]=s,n[t>>2]=a,o=(i<<1)+o|0,n[r>>2]=o,i=a-s|0,(0|s)<0?(o=o-s|0,n[t>>2]=i,n[r>>2]=o,n[A>>2]=0,s=0):i=a,(0|i)<0&&(s=s-i|0,n[A>>2]=s,o=o-i|0,n[r>>2]=o,n[t>>2]=0,i=0),e=s-o|0,a=i-o|0,(0|o)<0?(n[A>>2]=e,n[t>>2]=a,n[r>>2]=0,s=e,o=0):a=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(n[A>>2]=s-i,n[t>>2]=a-i,n[r>>2]=o-i)}function kA(A,e){e|=0;var t,r,o,i=0,a=0,s=0;return o=(0|(r=(0|n[(A|=0)>>2])-(0|n[e>>2])|0))<0,t=(0|(a=(0|n[A+4>>2])-(0|n[e+4>>2])-(o?r:0)|0))<0,e=(e=(A=(0|(s=(o?0-r|0:0)+(0|n[A+8>>2])-(0|n[e+8>>2])+(t?0-a|0:0)|0))<0)?0:s)-((a=(0|(A=(0|e)<(0|(A=(0|(i=(t?0:a)-(A?s:0)|0))<(0|(s=(o?0:r)-(t?a:0)-(A?s:0)|0))?i:s))?e:A))>0)?A:0)|0,i=i-(a?A:0)|0,0|((0|(A=(0|(A=s-(a?A:0)|0))>-1?A:0-A|0))>(0|(e=(0|(i=(0|i)>-1?i:0-i|0))>(0|(e=(0|e)>-1?e:0-e|0))?i:e))?A:e)}function CA(A){var e,t,r,o;t=(o=0|n[(e=8+(A|=0)|0)>>2])-(0|n[A>>2])|0,n[A>>2]=t,A=(0|n[(r=A+4|0)>>2])-o|0,n[r>>2]=A,n[e>>2]=0-(A+t)}function BA(A){var e,t,r=0,o=0,i=0,a=0,s=0;r=0-(o=0|n[(A|=0)>>2])|0,n[A>>2]=r,n[(e=A+8|0)>>2]=0,a=(i=0|n[(t=A+4|0)>>2])+o|0,(0|o)>0?(n[t>>2]=a,n[e>>2]=o,n[A>>2]=0,r=0,i=a):o=0,(0|i)<0?(s=r-i|0,n[A>>2]=s,o=o-i|0,n[e>>2]=o,n[t>>2]=0,a=s-o|0,r=0-o|0,(0|o)<0?(n[A>>2]=a,n[t>>2]=r,n[e>>2]=0,i=r,o=0):(i=0,a=s)):a=r,(0|(r=(0|o)<(0|(r=(0|i)<(0|a)?i:a))?o:r))<=0||(n[A>>2]=a-r,n[t>>2]=i-r,n[e>>2]=o-r)}function MA(A,e){var t=0;switch(t=0|tt(0|(A|=0),0|(e|=0),56),B(),7&t){case 0:case 7:return 0}return t=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|HA(A,t))?0|(t=0):0|(t=0|IA(A,t)):0|(t=0)}function DA(A,e,t){t|=0;var r,o,i=0,a=0;return o=P,P=P+16|0,r=o,a=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(i=0|tt(0|(A|=0),0|e,56),B(),i=0|function(A,e,t){t|=0;var r,o=0,i=0;if(r=P,P=P+16|0,i=r,o=0|HA(A|=0,e|=0),(t+-1|0)>>>0>5)return P=r,-1;if(1==(0|t)&(o=!!(0|o)))return P=r,-1;do{if(!(0|Fe(A,e,i))){if(o){o=(5+(0|n[26352+(t<<2)>>2])-(0|n[i>>2])|0)%5|0;break}o=(6+(0|n[26384+(t<<2)>>2])-(0|n[i>>2])|0)%6|0;break}o=-1}while(0);return P=r,0|(i=o)}(A,a,7&i),-1==(0|i)?(n[t>>2]=0,P=o,0|(a=6)):(0|XA(A,a,r)&&M(27795,26932,282,26947),e=0|tt(0|A,0|e,52),B(),e&=15,0|HA(A,a)?NA(r,e,i,2,t):FA(r,e,i,2,t),P=o,0|(a=0))):(P=o,0|(a=6))}function EA(A,e,t,r,i){e|=0,t|=0,r|=0,i|=0;var a,s=0,u=0;if(s=+function(A){var e,t;return t=+o[(A|=0)>>3],e=+o[A+8>>3],+ +c(+(t*t+e*e))}(A|=0),s<1e-16)return e=15600+(e<<4)|0,n[i>>2]=n[e>>2],n[i+4>>2]=n[e+4>>2],n[i+8>>2]=n[e+8>>2],void(n[i+12>>2]=n[e+12>>2]);if(u=+p(+ +o[A+8>>3],+ +o[A>>3]),(0|t)>0){A=0;do{s*=.37796447300922725,A=A+1|0}while((0|A)!=(0|t))}a=.3333333333333333*s,r?(t=!(0|VA(t)),s=+b(.381966011250105*(t?a:.37796447300922725*a))):(s=+b(.381966011250105*s),0|VA(t)&&(u=+ne(u+.3334731722518321))),function(A,e,t,r){A|=0,e=+e,r|=0;var i=0,a=0,s=0,c=0;if((t=+t)<1e-16)return n[r>>2]=n[A>>2],n[r+4>>2]=n[A+4>>2],n[r+8>>2]=n[A+8>>2],void(n[r+12>>2]=n[A+12>>2]);a=e<0?e+6.283185307179586:e,a=e>=6.283185307179586?a+-6.283185307179586:a;do{if(!(a<1e-16)){if(i=+l(+(a+-3.141592653589793))<1e-16,e=+o[A>>3],i){e-=t,o[r>>3]=e,i=r;break}if(s=+d(+t),t=+f(+t),e=s*+f(+e)+ +d(+a)*(t*+d(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),o[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return o[r>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[r>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if(c=1/+d(+e),a=t*+f(+a)*c,t=+o[A>>3],e=c*((s-+f(+e)*+f(+t))/+d(+t)),s=a>1?1:a,e=e>1?1:e,(e=+o[A+8>>3]+ +p(+(s<-1?-1:s),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[r+8>>3]=e)}e=+o[A>>3]+t,o[r>>3]=e,i=r}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return o[i>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[i>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if((e=+o[A+8>>3])>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[r+8>>3]=e}(15600+(e<<4)|0,+ne(+o[15920+(24*e|0)>>3]-u),s,i)}function NA(A,e,t,r,i){A|=0,e|=0,t|=0,r|=0,i|=0;var a,s,l,c,u,d,f,g,h,m,b,p,x,v,w,y,k,C,B,D,E,N,Q=0,j=0,F=0,S=0,L=0,I=0;if(N=P,P=P+272|0,S=N+240|0,B=N,D=N+224|0,E=N+208|0,b=N+176|0,p=N+160|0,x=N+192|0,v=N+144|0,w=N+128|0,y=N+112|0,k=N+96|0,C=N+80|0,n[(Q=N+256|0)>>2]=e,n[S>>2]=n[A>>2],n[S+4>>2]=n[A+4>>2],n[S+8>>2]=n[A+8>>2],n[S+12>>2]=n[A+12>>2],QA(S,Q,B),n[i>>2]=0,(0|(S=r+t+(5==(0|r)&1)|0))<=(0|t))P=N;else{s=D+4|0,l=b+4|0,c=t+5|0,u=16880+((a=0|n[Q>>2])<<2)|0,d=16960+(a<<2)|0,f=w+8|0,g=y+8|0,h=k+8|0,m=E+4|0,F=t;A:for(;;){j=B+((0|F)%5<<4)|0,n[E>>2]=n[j>>2],n[E+4>>2]=n[j+4>>2],n[E+8>>2]=n[j+8>>2],n[E+12>>2]=n[j+12>>2];do{}while(2==(0|jA(E,a,0,1)));if((0|F)>(0|t)&!!(0|VA(e))){if(n[b>>2]=n[E>>2],n[b+4>>2]=n[E+4>>2],n[b+8>>2]=n[E+8>>2],n[b+12>>2]=n[E+12>>2],oA(s,p),r=0|n[b>>2],Q=0|n[17040+(80*r|0)+(n[D>>2]<<2)>>2],n[b>>2]=n[18640+(80*r|0)+(20*Q|0)>>2],(0|(j=0|n[18640+(80*r|0)+(20*Q|0)+16>>2]))>0){A=0;do{bA(l),A=A+1|0}while((0|A)<(0|j))}switch(j=18640+(80*r|0)+(20*Q|0)+4|0,n[x>>2]=n[j>>2],n[x+4>>2]=n[j+4>>2],n[x+8>>2]=n[j+8>>2],sA(x,3*(0|n[u>>2])|0),iA(l,x,l),nA(l),oA(l,v),L=+(0|n[d>>2]),o[w>>3]=3*L,o[f>>3]=0,I=-1.5*L,o[y>>3]=I,o[g>>3]=2.598076211353316*L,o[k>>3]=I,o[h>>3]=-2.598076211353316*L,0|n[17040+(80*(0|n[b>>2])|0)+(n[E>>2]<<2)>>2]){case 1:A=y,r=w;break;case 3:A=k,r=y;break;case 2:A=w,r=k;break;default:A=12;break A}Qe(p,v,r,A,C),EA(C,0|n[b>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])}if((0|F)<(0|c)&&(oA(m,b),EA(b,0|n[E>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])),n[D>>2]=n[E>>2],n[D+4>>2]=n[E+4>>2],n[D+8>>2]=n[E+8>>2],n[D+12>>2]=n[E+12>>2],(0|(F=F+1|0))>=(0|S)){A=3;break}}3!=(0|A)?12==(0|A)&&M(26970,27017,572,27027):P=N}}function QA(A,e,t){A|=0,e|=0,t|=0;var r,o=0,i=0,a=0,s=0,l=0;r=P,P=P+128|0,i=r,s=20240,l=60+(a=o=r+64|0)|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));s=20304,l=(a=i)+60|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));o=(l=!(0|VA(0|n[e>>2])))?o:i,wA(i=A+4|0),yA(i),0|VA(0|n[e>>2])&&(hA(i),n[e>>2]=1+(0|n[e>>2])),n[t>>2]=n[A>>2],iA(i,o,e=t+4|0),nA(e),n[t+16>>2]=n[A>>2],iA(i,o+12|0,e=t+20|0),nA(e),n[t+32>>2]=n[A>>2],iA(i,o+24|0,e=t+36|0),nA(e),n[t+48>>2]=n[A>>2],iA(i,o+36|0,e=t+52|0),nA(e),n[t+64>>2]=n[A>>2],iA(i,o+48|0,t=t+68|0),nA(t),P=r}function jA(A,e,t,r){t|=0,r|=0;var o,i,a,s,l,c,u=0,d=0,f=0,g=0,h=0;if(c=P,P=P+32|0,l=c+12|0,i=c,h=4+(A|=0)|0,g=0|n[16960+((e|=0)<<2)>>2],g=(s=!!(0|r))?3*g|0:g,u=0|n[h>>2],o=0|n[(a=A+8|0)>>2],s){if((0|(u=o+u+(r=0|n[(d=A+12|0)>>2])|0))==(0|g))return P=c,1;f=d}else u=o+u+(r=0|n[(f=A+12|0)>>2])|0;if((0|u)<=(0|g))return P=c,0;do{if((0|r)>0){if(r=0|n[A>>2],(0|o)>0){d=18640+(80*r|0)+60|0,r=A;break}r=18640+(80*r|0)+40|0,t?(rA(l,g,0,0),aA(h,l,i),pA(i),iA(i,l,h),d=r,r=A):(d=r,r=A)}else d=18640+(80*(0|n[A>>2])|0)+20|0,r=A}while(0);if(n[r>>2]=n[d>>2],(0|n[(u=d+16|0)>>2])>0){r=0;do{bA(h),r=r+1|0}while((0|r)<(0|n[u>>2]))}return A=d+4|0,n[l>>2]=n[A>>2],n[l+4>>2]=n[A+4>>2],n[l+8>>2]=n[A+8>>2],e=0|n[16880+(e<<2)>>2],sA(l,s?3*e|0:e),iA(h,l,h),nA(h),r=s&&((0|n[a>>2])+(0|n[h>>2])+(0|n[f>>2])|0)==(0|g)?1:2,P=c,0|r}function PA(A,e){A|=0,e|=0;var t=0;do{t=0|jA(A,e,0,1)}while(2==(0|t));return 0|t}function FA(A,e,t,r,i){A|=0,e|=0,t|=0,r|=0,i|=0;var a,s,l,c,u,d,f,g,h,m,b,p,x,v,w,y,k,C,B=0,D=0,E=0,N=0,Q=0;if(C=P,P=P+240|0,v=C+208|0,w=C,y=C+192|0,k=C+176|0,h=C+160|0,m=C+144|0,b=C+128|0,p=C+112|0,x=C+96|0,n[(B=C+224|0)>>2]=e,n[v>>2]=n[A>>2],n[v+4>>2]=n[A+4>>2],n[v+8>>2]=n[A+8>>2],n[v+12>>2]=n[A+12>>2],SA(v,B,w),n[i>>2]=0,(0|(g=r+t+(6==(0|r)&1)|0))<=(0|t))P=C;else{s=t+6|0,l=16960+((a=0|n[B>>2])<<2)|0,c=m+8|0,u=b+8|0,d=p+8|0,f=y+4|0,D=0,E=t,r=-1;A:for(;;){if(A=w+((B=(0|E)%6|0)<<4)|0,n[y>>2]=n[A>>2],n[y+4>>2]=n[A+4>>2],n[y+8>>2]=n[A+8>>2],n[y+12>>2]=n[A+12>>2],A=D,D=0|jA(y,a,0,1),(0|E)>(0|t)&!!(0|VA(e))&&1!=(0|A)&&(0|n[y>>2])!=(0|r)){switch(oA(w+((B+5|0)%6<<4)+4|0,k),oA(w+(B<<4)+4|0,h),N=+(0|n[l>>2]),o[m>>3]=3*N,o[c>>3]=0,Q=-1.5*N,o[b>>3]=Q,o[u>>3]=2.598076211353316*N,o[p>>3]=Q,o[d>>3]=-2.598076211353316*N,B=0|n[v>>2],0|n[17040+(80*B|0)+(((0|r)==(0|B)?n[y>>2]:r)<<2)>>2]){case 1:A=b,r=m;break;case 3:A=p,r=b;break;case 2:A=m,r=p;break;default:A=8;break A}Qe(k,h,r,A,x),0|je(k,x)||0|je(h,x)||(EA(x,0|n[v>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2]))}if((0|E)<(0|s)&&(oA(f,k),EA(k,0|n[y>>2],a,1,i+8+(n[i>>2]<<4)|0),n[i>>2]=1+(0|n[i>>2])),(0|(E=E+1|0))>=(0|g)){A=3;break}r=0|n[y>>2]}3!=(0|A)?8==(0|A)&&M(27054,27017,737,27099):P=C}}function SA(A,e,t){A|=0,e|=0,t|=0;var r,o=0,i=0,a=0,s=0,l=0;r=P,P=P+160|0,i=r,s=20368,l=72+(a=o=r+80|0)|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));s=20448,l=(a=i)+72|0;do{n[a>>2]=n[s>>2],a=a+4|0,s=s+4|0}while((0|a)<(0|l));o=(l=!(0|VA(0|n[e>>2])))?o:i,wA(i=A+4|0),yA(i),0|VA(0|n[e>>2])&&(hA(i),n[e>>2]=1+(0|n[e>>2])),n[t>>2]=n[A>>2],iA(i,o,e=t+4|0),nA(e),n[t+16>>2]=n[A>>2],iA(i,o+12|0,e=t+20|0),nA(e),n[t+32>>2]=n[A>>2],iA(i,o+24|0,e=t+36|0),nA(e),n[t+48>>2]=n[A>>2],iA(i,o+36|0,e=t+52|0),nA(e),n[t+64>>2]=n[A>>2],iA(i,o+48|0,e=t+68|0),nA(e),n[t+80>>2]=n[A>>2],iA(i,o+60|0,t=t+84|0),nA(t),P=r}function LA(A,e){return e=0|tt(0|(A|=0),0|(e|=0),45),B(),127&e}function IA(A,e){A|=0;var t=0,n=0,o=0,i=0;return!0&134217728==(-16777216&(e|=0))?(n=0|tt(0|A,0|e,52),B(),n&=15,t=0|tt(0|A,0|e,45),B(),(t&=127)>>>0>121?0|(A=0):!(613566756&(i=0|rt(0|(o=0|tt(0|A,0|e,0|(i=3*(15^n)|0))),0|B(),0|i))&Ve(-1227133514,-1171,0|i,0|(o=0|B())))&!(4681&o&B())&&15==(0|n)|!(0|(i=0|tt(0|rt(0|~A,0|~e,0|(i=19+(3*n|0)|0)),0|B(),0|i)))&!(0|B())?0|r[20528+t|0]?!(0|A)&!(0|(e&=8191))?0|(i=1):(i=0|nt(0|A,0|e),B(),0|!!((63-i|0)%3|0)):0|(i=1):0|(i=0)):0|(A=0)}function RA(A,e,t,r){A|=0,t|=0,r|=0;var o=0,i=0,a=0,s=0;if(o=0|rt(0|(e|=0),0,52),i=0|B(),t=0|rt(0|t,0,45),t=0|i|B()|134225919,(0|e)<1)return i=-1,r=t,n[(e=A)>>2]=i,void(n[(A=A+4|0)>>2]=r);for(i=1,o=-1;s=0|rt(7,0,0|(a=3*(15-i|0)|0)),t&=~B(),o=o&~s|(a=0|rt(0|r,0,0|a)),t=0|t|B(),(0|i)!=(0|e);)i=i+1|0;n[(a=s=A)>>2]=o,n[(s=s+4|0)>>2]=t}function TA(A,e,t,r){t|=0,r|=0;var o=0,i=0;if(i=0|tt(0|(A|=0),0|(e|=0),52),B(),t>>>0>15)return 4;if((0|(i&=15))<(0|t))return 12;if((0|i)==(0|t))return n[r>>2]=A,n[r+4>>2]=e,0;if(o=0|rt(0|t,0,52),o|=A,A=B()|-15728641&e,(0|i)>(0|t))do{e=0|rt(7,0,3*(14-t|0)|0),t=t+1|0,o|=e,A=0|B()|A}while((0|t)<(0|i));return n[r>>2]=o,n[r+4>>2]=A,0}function _A(A,e,t,r){t|=0,r|=0;var o=0,i=0,a=0;if(i=0|tt(0|(A|=0),0|(e|=0),52),B(),!((0|t)<16&(0|(i&=15))<=(0|t)))return 4;o=t-i|0,t=0|tt(0|A,0|e,45),B();A:do{if(0|z(127&t)){e:do{if(0|i){for(t=1;!((a=0|rt(7,0,3*(15-t|0)|0))&A)&!((0|B())&e);){if(!(t>>>0>>0))break e;t=t+1|0}t=0|pe(7,0,o,((0|o)<0)<<31>>31),o=0|B();break A}}while(0);t=0|Ze(0|(t=0|qe(0|(t=0|pe(7,0,o,((0|o)<0)<<31>>31)),0|B(),5,0)),0|B(),-5,-1),t=0|Ze(0|(t=0|Xe(0|t,0|B(),6,0)),0|B(),1,0),o=0|B()}else t=0|pe(7,0,o,((0|o)<0)<<31>>31),o=0|B()}while(0);return n[(a=r)>>2]=t,n[a+4>>2]=o,0}function HA(A,e){var t=0,r=0,n=0;if(n=0|tt(0|(A|=0),0|(e|=0),45),B(),!(0|z(127&n)))return 0;n=0|tt(0|A,0|e,52),B(),n&=15;A:do{if(n)for(r=1;;){if(t=0|tt(0|A,0|e,3*(15-r|0)|0),B(),0|(t&=7))break A;if(!(r>>>0>>0)){t=0;break}r=r+1|0}else t=0}while(0);return 1&!(0|t)}function zA(A,e,t,r){return A|=0,e|=0,(0|(r|=0))<(0|(t|=0))?(r=A,C(0|(t=e)),0|r):(t=0|rt(-1,-1,3+(3*(r-t|0)|0)|0),r=0|rt(0|~t,0|~B(),3*(15-r|0)|0),t=~B()&e,r=~r&A,C(0|t),0|r)}function GA(A,e,t,r){t|=0,r|=0;var o=0;return o=0|tt(0|(A|=0),0|(e|=0),52),B(),(0|t)<16&(0|(o&=15))<=(0|t)?((0|o)<(0|t)&&(o=0|rt(-1,-1,3+(3*(t+-1-o|0)|0)|0),o=0|rt(0|~o,0|~B(),3*(15-t|0)|0),e=~B()&e,A&=~o),o=0|rt(0|t,0,52),t=-15728641&e|B(),n[r>>2]=A|o,n[r+4>>2]=t,0|(r=0)):0|(r=4)}function OA(A,e){var t=0,r=0,n=0;if(n=0|tt(0|(A|=0),0|(e|=0),52),B(),!(n&=15))return 0;for(r=1;;){if(t=0|tt(0|A,0|e,3*(15-r|0)|0),B(),0|(t&=7)){r=5;break}if(!(r>>>0>>0)){t=0,r=5;break}r=r+1|0}return 5==(0|r)?0|t:0}function UA(A,e){var t=0,r=0,n=0,o=0,i=0,a=0,s=0;if(s=0|tt(0|(A|=0),0|(e|=0),52),B(),!(s&=15))return s=A,C(0|(a=e)),0|s;for(a=1,t=0;;){r=0|rt(7,0,0|(o=3*(15-a|0)|0)),n=0|B(),i=0|tt(0|A,0|e,0|o),B(),A=(o=0|rt(0|xA(7&i),0,0|o))|A&~r,e=(i=0|B())|e&~n;A:do{if(!t)if(!(o&r|0)&!(i&n|0))t=0;else if(r=0|tt(0|A,0|e,52),B(),r&=15){t=1;e:for(;;){switch(i=0|tt(0|A,0|e,3*(15-t|0)|0),B(),7&i){case 1:break e;case 0:break;default:t=1;break A}if(!(t>>>0>>0)){t=1;break A}t=t+1|0}for(t=1;;){if(n=0|tt(0|A,0|e,0|(i=3*(15-t|0)|0)),B(),o=0|rt(7,0,0|i),e&=~B(),A=A&~o|(i=0|rt(0|xA(7&n),0,0|i)),e=0|e|B(),!(t>>>0>>0)){t=1;break}t=t+1|0}}else t=1}while(0);if(!(a>>>0>>0))break;a=a+1|0}return C(0|e),0|A}function YA(A,e){var t=0,r=0,n=0,o=0,i=0;if(r=0|tt(0|(A|=0),0|(e|=0),52),B(),!(r&=15))return r=A,C(0|(t=e)),0|r;for(t=1;i=0|tt(0|A,0|e,0|(o=3*(15-t|0)|0)),B(),n=0|rt(7,0,0|o),e&=~B(),A=(o=0|rt(0|xA(7&i),0,0|o))|A&~n,e=0|B()|e,t>>>0>>0;)t=t+1|0;return C(0|e),0|A}function WA(A,e){var t=0,r=0,n=0,o=0,i=0,a=0,s=0;if(s=0|tt(0|(A|=0),0|(e|=0),52),B(),!(s&=15))return s=A,C(0|(a=e)),0|s;for(a=1,t=0;;){r=0|rt(7,0,0|(o=3*(15-a|0)|0)),n=0|B(),i=0|tt(0|A,0|e,0|o),B(),A=(o=0|rt(0|vA(7&i),0,0|o))|A&~r,e=(i=0|B())|e&~n;A:do{if(!t)if(!(o&r|0)&!(i&n|0))t=0;else if(r=0|tt(0|A,0|e,52),B(),r&=15){t=1;e:for(;;){switch(i=0|tt(0|A,0|e,3*(15-t|0)|0),B(),7&i){case 1:break e;case 0:break;default:t=1;break A}if(!(t>>>0>>0)){t=1;break A}t=t+1|0}for(t=1;;){if(o=0|rt(7,0,0|(n=3*(15-t|0)|0)),i=e&~B(),e=0|tt(0|A,0|e,0|n),B(),A=A&~o|(e=0|rt(0|vA(7&e),0,0|n)),e=0|i|B(),!(t>>>0>>0)){t=1;break}t=t+1|0}}else t=1}while(0);if(!(a>>>0>>0))break;a=a+1|0}return C(0|e),0|A}function ZA(A,e){var t=0,r=0,n=0,o=0,i=0;if(r=0|tt(0|(A|=0),0|(e|=0),52),B(),!(r&=15))return r=A,C(0|(t=e)),0|r;for(t=1;o=0|rt(7,0,0|(i=3*(15-t|0)|0)),n=e&~B(),e=0|tt(0|A,0|e,0|i),B(),A=(e=0|rt(0|vA(7&e),0,0|i))|A&~o,e=0|B()|n,t>>>0>>0;)t=t+1|0;return C(0|e),0|A}function VA(A){return(0|(A|=0))%2|0}function KA(A,e,t){t|=0;var r,i=0;return r=P,P=P+16|0,i=r,(e|=0)>>>0>15?(P=r,0|(i=4)):2146435072&~n[4+(A|=0)>>2]&&2146435072&~n[A+8+4>>2]?(function(A,e,t){var r,i;r=P,P=P+16|0,function(A,e,t,r){e|=0,r|=0;var i,a=0,s=0,l=0,c=0;if(i=P,P=P+16|0,function(A,e,t){e|=0,t|=0;var r,i,a=0;i=P,P=P+32|0,function(A,e){e|=0;var t,r,n=0;n=+o[(A|=0)>>3],t=+d(+n),n=+f(+n),o[e+16>>3]=n,n=+o[A+8>>3],r=t*+d(+n),o[e>>3]=r,n=t*+f(+n),o[e+8>>3]=n}(A|=0,r=i),n[e>>2]=0,o[t>>3]=5,(a=+Pe(16400,r))<+o[t>>3]&&(n[e>>2]=0,o[t>>3]=a),(a=+Pe(16424,r))<+o[t>>3]&&(n[e>>2]=1,o[t>>3]=a),(a=+Pe(16448,r))<+o[t>>3]&&(n[e>>2]=2,o[t>>3]=a),(a=+Pe(16472,r))<+o[t>>3]&&(n[e>>2]=3,o[t>>3]=a),(a=+Pe(16496,r))<+o[t>>3]&&(n[e>>2]=4,o[t>>3]=a),(a=+Pe(16520,r))<+o[t>>3]&&(n[e>>2]=5,o[t>>3]=a),(a=+Pe(16544,r))<+o[t>>3]&&(n[e>>2]=6,o[t>>3]=a),(a=+Pe(16568,r))<+o[t>>3]&&(n[e>>2]=7,o[t>>3]=a),(a=+Pe(16592,r))<+o[t>>3]&&(n[e>>2]=8,o[t>>3]=a),(a=+Pe(16616,r))<+o[t>>3]&&(n[e>>2]=9,o[t>>3]=a),(a=+Pe(16640,r))<+o[t>>3]&&(n[e>>2]=10,o[t>>3]=a),(a=+Pe(16664,r))<+o[t>>3]&&(n[e>>2]=11,o[t>>3]=a),(a=+Pe(16688,r))<+o[t>>3]&&(n[e>>2]=12,o[t>>3]=a),(a=+Pe(16712,r))<+o[t>>3]&&(n[e>>2]=13,o[t>>3]=a),(a=+Pe(16736,r))<+o[t>>3]&&(n[e>>2]=14,o[t>>3]=a),(a=+Pe(16760,r))<+o[t>>3]&&(n[e>>2]=15,o[t>>3]=a),(a=+Pe(16784,r))<+o[t>>3]&&(n[e>>2]=16,o[t>>3]=a),(a=+Pe(16808,r))<+o[t>>3]&&(n[e>>2]=17,o[t>>3]=a),(a=+Pe(16832,r))<+o[t>>3]&&(n[e>>2]=18,o[t>>3]=a),(a=+Pe(16856,r))<+o[t>>3]?(n[e>>2]=19,o[t>>3]=a,P=i):P=i}(A|=0,t|=0,c=i),(s=+h(+(1-.5*+o[c>>3])))<1e-16)return n[r>>2]=0,n[r+4>>2]=0,n[r+8>>2]=0,n[r+12>>2]=0,void(P=i);if(c=0|n[t>>2],a=+ne((a=+o[15920+(24*c|0)>>3])-+ne(+function(A,e){var t,r,n,i,a;return A|=0,i=+o[(e|=0)>>3],r=+d(+i),n=+o[e+8>>3]-+o[A+8>>3],a=r*+f(+n),t=+o[A>>3],+ +p(+a,+(+f(+i)*+d(+t)-+d(+n)*(r*+f(+t))))}(15600+(c<<4)|0,A))),l=0|VA(e)?+ne(a+-.3334731722518321):a,a=2.618033988749896*+g(+s),(0|e)>0){A=0;do{a*=2.6457513110645907,A=A+1|0}while((0|A)!=(0|e))}s=+d(+l)*a,o[r>>3]=s,l=+f(+l)*a,o[r+8>>3]=l,P=i}(A|=0,e|=0,t|=0,i=r),function(A,e){A|=0;var t,r,i,a,s=0,c=0,u=0,d=0,f=0,g=0,h=0;n[(a=8+(e|=0)|0)>>2]=0,r=+o[A>>3],d=+l(+r),i=+o[A+8>>3],d+=.5*(f=1.1547005383792515*+l(+i)),d-=+(0|(s=~~d)),f-=+(0|(A=~~f));do{if(d<.5){if(d<.3333333333333333){if(n[e>>2]=s,f<.5*(d+1)){n[e+4>>2]=A;break}A=A+1|0,n[e+4>>2]=A;break}if(A=(1&!(f<(h=1-d)))+A|0,n[e+4>>2]=A,h<=f&f<2*d){s=s+1|0,n[e>>2]=s;break}n[e>>2]=s;break}if(!(d<.6666666666666666)){if(s=s+1|0,n[e>>2]=s,f<.5*d){n[e+4>>2]=A;break}A=A+1|0,n[e+4>>2]=A;break}if(f<1-d){if(n[e+4>>2]=A,2*d-1>2]=s;break}}else A=A+1|0,n[e+4>>2]=A;s=s+1|0,n[e>>2]=s}while(0);do{if(r<0){if(1&A){s=~~(+(0|s)-(2*(+((g=0|Ve(0|s,((0|s)<0)<<31>>31,0|(g=(A+1|0)/2|0),((0|g)<0)<<31>>31))>>>0)+4294967296*+(0|B()))+1)),n[e>>2]=s;break}s=~~(+(0|s)-2*(+((g=0|Ve(0|s,((0|s)<0)<<31>>31,0|(g=(0|A)/2|0),((0|g)<0)<<31>>31))>>>0)+4294967296*+(0|B()))),n[e>>2]=s;break}}while(0);g=e+4|0,i<0&&(s=s-((1|A<<1)/2|0)|0,n[e>>2]=s,A=0-A|0,n[g>>2]=A),c=A-s|0,(0|s)<0?(u=0-s|0,n[g>>2]=c,n[a>>2]=u,n[e>>2]=0,A=c,s=0):u=0,(0|A)<0&&(s=s-A|0,n[e>>2]=s,u=u-A|0,n[a>>2]=u,n[g>>2]=0,A=0),t=s-u|0,c=A-u|0,(0|u)<0&&(n[e>>2]=t,n[g>>2]=c,n[a>>2]=0,A=c,s=t,u=0),(0|(c=(0|u)<(0|(c=(0|A)<(0|s)?A:s))?u:c))<=0||(n[e>>2]=s-c,n[g>>2]=A-c,n[a>>2]=u-c)}(i,t+4|0),P=r}(A,e,i),e=0|function(A,e){A|=0;var t,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0;if(t=P,P=P+64|0,l=t+40|0,o=t+24|0,i=t+12|0,a=t,rt(0|(e|=0),0,52),r=134225919|B(),!e)return(0|n[A+4>>2])>2||(0|n[A+8>>2])>2||(0|n[A+12>>2])>2?(l=0,C(0|(s=0)),P=t,0|l):(rt(0|O(A),0,45),s=0|B()|r,l=-1,C(0|s),P=t,0|l);if(n[l>>2]=n[A>>2],n[l+4>>2]=n[A+4>>2],n[l+8>>2]=n[A+8>>2],n[l+12>>2]=n[A+12>>2],s=l+4|0,(0|e)>0)for(A=-1;n[o>>2]=n[s>>2],n[o+4>>2]=n[s+4>>2],n[o+8>>2]=n[s+8>>2],1&e?(dA(s),n[i>>2]=n[s>>2],n[i+4>>2]=n[s+4>>2],n[i+8>>2]=n[s+8>>2],gA(i)):(fA(s),n[i>>2]=n[s>>2],n[i+4>>2]=n[s+4>>2],n[i+8>>2]=n[s+8>>2],hA(i)),aA(o,i,a),nA(a),c=0|rt(7,0,0|(u=3*(15-e|0)|0)),r&=~B(),A=(u=0|rt(0|lA(a),0,0|u))|A&~c,r=0|B()|r,(0|e)>1;)e=e+-1|0;else A=-1;A:do{if((0|n[s>>2])<=2&&(0|n[l+8>>2])<=2&&(0|n[l+12>>2])<=2){if(e=0|rt(0|(o=0|O(l)),0,45),e|=A,A=B()|-1040385&r,a=0|U(l),!(0|z(o))){if((0|a)<=0)break;for(i=0;;){if(o=0|tt(0|e,0|A,52),B(),o&=15)for(r=1;l=0|tt(0|e,0|A,0|(u=3*(15-r|0)|0)),B(),c=0|rt(7,0,0|u),A&=~B(),e=e&~c|(u=0|rt(0|xA(7&l),0,0|u)),A=0|A|B(),r>>>0>>0;)r=r+1|0;if((0|(i=i+1|0))==(0|a))break A}}i=0|tt(0|e,0|A,52),B(),i&=15;e:do{if(i){r=1;t:for(;;){switch(u=0|tt(0|e,0|A,3*(15-r|0)|0),B(),7&u){case 1:break t;case 0:break;default:break e}if(!(r>>>0>>0))break e;r=r+1|0}if(0|Y(o,0|n[l>>2]))for(r=1;c=0|rt(7,0,0|(l=3*(15-r|0)|0)),u=A&~B(),A=0|tt(0|e,0|A,0|l),B(),e=e&~c|(A=0|rt(0|vA(7&A),0,0|l)),A=0|u|B(),r>>>0>>0;)r=r+1|0;else for(r=1;l=0|tt(0|e,0|A,0|(u=3*(15-r|0)|0)),B(),c=0|rt(7,0,0|u),A&=~B(),e=e&~c|(u=0|rt(0|xA(7&l),0,0|u)),A=0|A|B(),r>>>0>>0;)r=r+1|0}}while(0);if((0|a)>0){r=0;do{e=0|UA(e,A),A=0|B(),r=r+1|0}while((0|r)!=(0|a))}}else e=0,A=0}while(0);return u=e,C(0|(c=A)),P=t,0|u}(i,e),i=0|B(),n[t>>2]=e,n[t+4>>2]=i,!(0|e)&!(0|i)&&M(27795,27122,1050,27145),P=r,0|(i=0)):(P=r,0|(i=3))}function JA(A,e,t){var r,o=0,i=0,a=0;if(r=4+(t|=0)|0,i=0|tt(0|(A|=0),0|(e|=0),52),B(),i&=15,a=0|tt(0|A,0|e,45),B(),o=!(0|i),0|z(127&a)){if(o)return 1;o=1}else{if(o)return 0;o=0|n[r>>2]||0|n[t+8>>2]?1:1&!!(0|n[t+12>>2])}for(t=1;1&t?gA(r):hA(r),a=0|tt(0|A,0|e,3*(15-t|0)|0),B(),mA(r,7&a),t>>>0>>0;)t=t+1|0;return 0|o}function XA(A,e,t){t|=0;var r,o,i=0,a=0,s=0,l=0,c=0,u=0;if(o=P,P=P+16|0,r=o,u=0|tt(0|(A|=0),0|(e|=0),45),B(),(u&=127)>>>0>121)return n[t>>2]=0,n[t+4>>2]=0,n[t+8>>2]=0,n[t+12>>2]=0,P=o,5;A:do{if(0|z(u)&&(s=0|tt(0|A,0|e,52),B(),0|(s&=15))){i=1;e:for(;;){switch(c=0|tt(0|A,0|e,3*(15-i|0)|0),B(),7&c){case 5:break e;case 0:break;default:i=e;break A}if(!(i>>>0>>0)){i=e;break A}i=i+1|0}for(a=1,i=e;l=0|rt(7,0,0|(e=3*(15-a|0)|0)),c=i&~B(),i=0|tt(0|A,0|i,0|e),B(),A=A&~l|(i=0|rt(0|vA(7&i),0,0|e)),i=0|c|B(),a>>>0>>0;)a=a+1|0}else i=e}while(0);if(c=7696+(28*u|0)|0,n[t>>2]=n[c>>2],n[t+4>>2]=n[c+4>>2],n[t+8>>2]=n[c+8>>2],n[t+12>>2]=n[c+12>>2],!(0|JA(A,i,t)))return P=o,0;if(l=t+4|0,n[r>>2]=n[l>>2],n[r+4>>2]=n[l+4>>2],n[r+8>>2]=n[l+8>>2],s=0|tt(0|A,0|i,52),B(),c=15&s,1&s?(hA(l),s=c+1|0):s=c,0|z(u)){A:do{if(c)for(e=1;;){if(a=0|tt(0|A,0|i,3*(15-e|0)|0),B(),0|(a&=7)){i=a;break A}if(!(e>>>0>>0)){i=0;break}e=e+1|0}else i=0}while(0);i=4==(0|i)&1}else i=0;if(0|jA(t,s,i,0)){if(0|z(u))do{}while(0|jA(t,s,0,0));(0|s)!=(0|c)&&fA(l)}else(0|s)!=(0|c)&&(n[l>>2]=n[r>>2],n[l+4>>2]=n[r+4>>2],n[l+8>>2]=n[r+8>>2]);return P=o,0}function qA(A,e,t){t|=0;var r,o,i=0;return o=P,P=P+16|0,0|(i=0|XA(A|=0,e|=0,r=o))?(P=o,0|i):(i=0|tt(0|A,0|e,52),B(),function(A,e,t){var r,o;e|=0,t|=0,r=P,P=P+16|0,oA(4+(A|=0)|0,o=r),EA(o,0|n[A>>2],e,0,t),P=r}(r,15&i,t),P=o,0|(i=0))}function $A(A,e,t){t|=0;var r,n=0,o=0,i=0;if(r=P,P=P+16|0,0|(n=0|XA(A|=0,e|=0,i=r)))return P=r,0|n;n=0|tt(0|A,0|e,45),B(),n=!(0|z(127&n)),o=0|tt(0|A,0|e,52),B(),o&=15;A:do{if(!n){if(0|o)for(n=1;;){if(!(!((0|rt(7,0,3*(15-n|0)|0))&A)&!((0|B())&e)))break A;if(!(n>>>0>>0))break;n=n+1|0}return NA(i,o,0,5,t),P=r,0}}while(0);return FA(i,o,0,6,t),P=r,0}function Ae(A,e){e|=0;var t=0,r=0,o=0,i=0,a=0,s=0,l=0;if((A|=0)>>>0>15)return 4;if(rt(0|A,0,52),s=134225919|B(),!A){t=0,r=0;do{0|z(r)&&(rt(0|r,0,45),a=0|s|B(),n[(A=e+(t<<3)|0)>>2]=-1,n[A+4>>2]=a,t=t+1|0),r=r+1|0}while(122!=(0|r));return 0}t=0,a=0;do{if(0|z(a)){for(rt(0|a,0,45),r=1,o=-1,i=0|s|B();o&=~(l=0|rt(7,0,3*(15-r|0)|0)),i&=~B(),(0|r)!=(0|A);)r=r+1|0;n[(l=e+(t<<3)|0)>>2]=o,n[l+4>>2]=i,t=t+1|0}a=a+1|0}while(122!=(0|a));return 0}function ee(A,e,t,r){A|=0,r|=0;var o=0,i=0,a=0;o=0|tt(0|(e|=0),0|(t|=0),52),B(),!(0|e)&!(0|t)|(0|r)>15|(0|(o&=15))>(0|r)?(i=-1,e=-1,t=0,o=0):(e=0|zA(e,t,o+1|0,r),a=-15728641&B(),t=0|rt(0|r,0,52),i=o,e=(e=!(0|HA(t|=e,a=0|a|B())))?-1:r,o=a),n[(a=A)>>2]=t,n[a+4>>2]=o,n[A+8>>2]=i,n[A+12>>2]=e}function te(A,e,t,r){t|=0,r|=0;var o=0,i=0;return o=0|tt(0|(A|=0),0|(e|=0),52),B(),o&=15,n[(i=r+8|0)>>2]=o,!(0|A)&!(0|e)|(0|t)>15|(0|o)>(0|t)?(n[(t=r)>>2]=0,n[t+4>>2]=0,n[i>>2]=-1,void(n[r+12>>2]=-1)):(A=0|zA(A,e,o+1|0,t),i=-15728641&B(),o=0|rt(0|t,0,52),o|=A,i=0|i|B(),n[(A=r)>>2]=o,n[A+4>>2]=i,A=r+12|0,0|HA(o,i)?void(n[A>>2]=t):void(n[A>>2]=-1))}function re(A){var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0,c=0;if(!(!(0|(t=0|n[(r=A|=0)>>2]))&!(0|(r=0|n[r+4>>2]))||(o=0|tt(0|t,0|r,52),B(),t=0|Ze(0|(l=0|rt(1,0,3*(15^(o&=15))|0)),0|B(),0|t,0|r),r=0|B(),n[(l=A)>>2]=t,n[l+4>>2]=r,(0|o)<(0|(s=0|n[(l=A+8|0)>>2]))))){for(e=A+12|0,a=o;;){if((0|a)==(0|s)){o=5;break}if(c=(0|a)==(0|n[e>>2]),o=0|tt(0|t,0|r,0|(i=3*(15-a|0)|0)),B(),c&1==(0|(o&=7))&!0){o=7;break}if(!(7==(0|o)&!0)){o=10;break}if(t=0|Ze(0|t,0|r,0|(c=0|rt(1,0,0|i)),0|B()),r=0|B(),n[(c=A)>>2]=t,n[c+4>>2]=r,!((0|a)>(0|s))){o=10;break}a=a+-1|0}if(5==(0|o))return n[(c=A)>>2]=0,n[c+4>>2]=0,n[l>>2]=-1,void(n[e>>2]=-1);if(7==(0|o))return s=0|Ze(0|t,0|r,0|(s=0|rt(1,0,0|i)),0|B()),l=0|B(),n[(c=A)>>2]=s,n[c+4>>2]=l,void(n[e>>2]=a+-1)}}function ne(A){var e;return e=(A=+A)<0?A+6.283185307179586:A,+(A>=6.283185307179586?e+-6.283185307179586:e)}function oe(A,e){return e|=0,+l(+(+o[(A|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+l(+(+o[A+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function ie(A,e){switch(A=+A,0|(e|=0)){case 1:A=A<0?A+6.283185307179586:A;break;case 2:A=A>0?A+-6.283185307179586:A}return+A}function ae(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))*6371.007180918475}function se(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20656+(A<<3)>>3],0|(e=0))}function le(A,e){e|=0;var t=0;return(A|=0)>>>0>15?0|(e=4):(t=0|qe(0|(t=0|pe(7,0,A,((0|A)<0)<<31>>31)),0|B(),120,0),A=0|B(),n[e>>2]=2|t,n[e+4>>2]=A,0|(e=0))}function ce(A,e,t){A|=0,t|=0;var r,n,i,a,s=0,l=0,u=0,h=0,m=0,x=0;return x=+o[(e|=0)>>3],i=+o[A>>3],m=+f(.5*(x-i)),u=+o[e+8>>3],n=+o[A+8>>3],h=+f(.5*(u-n)),r=+d(+i),a=+d(+x),h=2*+p(+ +c(+(h=m*m+h*(a*r*h))),+ +c(+(1-h))),m=+o[t>>3],x=+f(.5*(m-x)),s=+o[t+8>>3],u=+f(.5*(s-u)),l=+d(+m),u=2*+p(+ +c(+(u=x*x+u*(a*l*u))),+ +c(+(1-u))),m=+f(.5*(i-m)),s=+f(.5*(n-s)),s=2*+p(+ +c(+(s=m*m+s*(r*l*s))),+ +c(+(1-s))),4*+b(+ +c(+ +g(.5*(l=.5*(h+u+s)))*+g(.5*(l-h))*+g(.5*(l-u))*+g(.5*(l-s))))}function ue(A,e,t){t|=0;var r,i,a,s=0,l=0;if(a=P,P=P+192|0,i=a,0|(l=0|qA(A|=0,e|=0,r=a+168|0)))return P=a,0|l;if(0|$A(A,e,i)&&M(27795,27190,415,27199),(0|(e=0|n[i>>2]))>0){if(s=+ce(i+8|0,i+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){A=1;do{s+=+ce(i+8+((l=A)<<4)|0,i+8+((0|(A=A+1|0))%(0|e)<<4)|0,r)}while((0|A)<(0|e))}}else s=0;return o[t>>3]=s,P=a,0}function de(A){A|=0;var e,t,r=0;return(e=0|We(1,12))||M(27280,27235,49,27293),0|(r=0|n[(t=A+4|0)>>2])?(n[(r=r+8|0)>>2]=e,n[t>>2]=e,0|e):(0|n[A>>2]&&M(27310,27235,61,27333),n[(r=A)>>2]=e,n[t>>2]=e,0|e)}function fe(A,e){var t,r;return A|=0,e|=0,(r=0|Ue(24))||M(27347,27235,78,27361),n[r>>2]=n[e>>2],n[r+4>>2]=n[e+4>>2],n[r+8>>2]=n[e+8>>2],n[r+12>>2]=n[e+12>>2],n[r+16>>2]=0,0|(t=0|n[(e=A+4|0)>>2])?(n[t+16>>2]=r,n[e>>2]=r,0|r):(0|n[A>>2]&&M(27376,27235,82,27361),n[A>>2]=r,n[e>>2]=r,0|r)}function ge(A){var e=0,t=0,r=0,o=0;if(A|=0)for(r=1;;){if(0|(e=0|n[A>>2]))do{if(0|(t=0|n[e>>2]))do{o=t,t=0|n[t+16>>2],Ye(o)}while(0|t);o=e,e=0|n[e+8>>2],Ye(o)}while(0|e);if(e=A,A=0|n[A+8>>2],r||Ye(e),!A)break;r=0}}function he(A,e,t){A|=0;var r=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0;if(!(0|X(e|=0,t|=0)))return 0;if(e=0|K(e),r=+o[t>>3],i=e&(i=+o[t+8>>3])<0?i+6.283185307179586:i,!(A=0|n[A>>2]))return 0;if(e){e=0,u=i,t=A;A:for(;;){for(;s=+o[t>>3],i=+o[t+8>>3],d=0|n[(t=t+16|0)>>2],a=+o[(d=0|d?d:A)>>3],l=+o[d+8>>3],s>a?(c=s,s=l):(c=a,a=s,s=i,i=l),(r=r==a|r==c?r+2220446049250313e-31:r)c;)if(!(t=0|n[t>>2])){t=22;break A}if(((c=(l=s<0?s+6.283185307179586:s)+(r-a)/(c-a)*((s=i<0?i+6.283185307179586:i)-l))<0?c+6.283185307179586:c)>(u=l==u|s==u?u+-2220446049250313e-31:u)&&(e^=1),!(t=0|n[t>>2])){t=22;break}}if(22==(0|t))return 0|e}else{e=0,u=i,t=A;A:for(;;){for(;s=+o[t>>3],i=+o[t+8>>3],d=0|n[(t=t+16|0)>>2],a=+o[(d=0|d?d:A)>>3],l=+o[d+8>>3],s>a?(c=s,s=l):(c=a,a=s,s=i,i=l),(r=r==a|r==c?r+2220446049250313e-31:r)c;)if(!(t=0|n[t>>2])){t=22;break A}if(s+(r-a)/(c-a)*(i-s)>(u=s==u|i==u?u+-2220446049250313e-31:u)&&(e^=1),!(t=0|n[t>>2])){t=22;break}}if(22==(0|t))return 0|e}return 0}function me(A,e,t,o,i){t|=0,o|=0,i|=0;var a,s,l,c,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(c=P,P=P+32|0,v=c+16|0,l=c,u=0|tt(0|(A|=0),0|(e|=0),52),B(),u&=15,b=0|tt(0|t,0|o,52),B(),(0|u)!=(15&b))return P=c,12;if(h=0|tt(0|A,0|e,45),B(),h&=127,m=0|tt(0|t,0|o,45),B(),h>>>0>121|(m&=127)>>>0>121)return P=c,5;if(b=(0|h)!=(0|m)){if(7==(0|(f=0|Z(h,m))))return P=c,1;7==(0|(g=0|Z(m,h)))?M(27514,27538,161,27548):(p=f,d=g)}else p=0,d=0;a=0|z(h),s=0|z(m),n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,n[v+12>>2]=0;do{if(p){if(f=(0|(m=0|n[4272+(28*h|0)+(p<<2)>>2]))>0,s)if(f){h=0,g=t,f=o;do{g=0|WA(g,f),f=0|B(),1==(0|(d=0|vA(d)))&&(d=0|vA(1)),h=h+1|0}while((0|h)!=(0|m));m=d,h=g,g=f}else m=d,h=t,g=o;else if(f){h=0,g=t,f=o;do{g=0|ZA(g,f),f=0|B(),d=0|vA(d),h=h+1|0}while((0|h)!=(0|m));m=d,h=g,g=f}else m=d,h=t,g=o;if(JA(h,g,v),b||M(27563,27538,191,27548),(f=!!(0|a))&(d=!!(0|s))&&M(27590,27538,192,27548),f){if(7==(0|(d=0|OA(A,e)))){u=5;break}if(0|r[22e3+(7*d|0)+p|0]){u=1;break}h=g=0|n[21168+(28*d|0)+(p<<2)>>2]}else if(d){if(7==(0|(d=0|OA(h,g)))){u=5;break}if(0|r[22e3+(7*d|0)+m|0]){u=1;break}h=0,g=0|n[21168+(28*m|0)+(d<<2)>>2]}else h=0,g=0;if((h|g|0)<0)u=5;else{if((0|g)>0){f=v+4|0,d=0;do{pA(f),d=d+1|0}while((0|d)!=(0|g))}if(n[l>>2]=0,n[l+4>>2]=0,n[l+8>>2]=0,mA(l,p),0|u)for(;0|VA(u)?gA(l):hA(l),(0|u)>1;)u=u+-1|0;if((0|h)>0){u=0;do{pA(l),u=u+1|0}while((0|u)!=(0|h))}iA(x=v+4|0,l,x),nA(x),x=51}}else if(JA(t,o,v),!!(0|a)&!!(0|s))if((0|m)!=(0|h)&&M(27621,27538,261,27548),7==(0|(d=0|OA(A,e)))|7==(0|(u=0|OA(t,o))))u=5;else if(0|r[22e3+(7*d|0)+u|0])u=1;else if((0|(d=0|n[21168+(28*d|0)+(u<<2)>>2]))>0){f=v+4|0,u=0;do{pA(f),u=u+1|0}while((0|u)!=(0|d));x=51}else x=51;else x=51}while(0);return 51==(0|x)&&(u=v+4|0,n[i>>2]=n[u>>2],n[i+4>>2]=n[u+4>>2],n[i+8>>2]=n[u+8>>2],u=0),P=c,0|u}function be(A,e,t,r){t|=0,r|=0;var o,i,a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(a=P,P=P+48|0,o=a+36|0,c=a+24|0,u=a+12|0,d=a,s=0|tt(0|(A|=0),0|(e|=0),52),B(),s&=15,g=0|tt(0|A,0|e,45),B(),(g&=127)>>>0>121)return P=a,5;if(i=0|z(g),rt(0|s,0,52),b=134225919|B(),n[(l=r)>>2]=-1,n[l+4>>2]=b,!s)return 7==(0|(s=0|lA(t)))||127==(0|(s=0|W(g,s)))?(P=a,0|(b=1)):(h=0|rt(0|s,0,45),m=0|B(),m=-1040385&n[(g=r)+4>>2]|m,n[(b=r)>>2]=n[g>>2]|h,n[b+4>>2]=m,P=a,0|(b=0));for(n[o>>2]=n[t>>2],n[o+4>>2]=n[t+4>>2],n[o+8>>2]=n[t+8>>2],t=s;;){if(l=t,t=t+-1|0,n[c>>2]=n[o>>2],n[c+4>>2]=n[o+4>>2],n[c+8>>2]=n[o+8>>2],0|VA(l)){if(0|(s=0|cA(o))){t=13;break}n[u>>2]=n[o>>2],n[u+4>>2]=n[o+4>>2],n[u+8>>2]=n[o+8>>2],gA(u)}else{if(0|(s=0|uA(o))){t=13;break}n[u>>2]=n[o>>2],n[u+4>>2]=n[o+4>>2],n[u+8>>2]=n[o+8>>2],hA(u)}if(aA(c,u,d),nA(d),x=0|n[(s=r)>>2],s=0|n[s+4>>2],p=0|rt(7,0,0|(v=3*(15-l|0)|0)),s&=~B(),v=0|rt(0|lA(d),0,0|v),s=0|B()|s,n[(b=r)>>2]=v|x&~p,n[b+4>>2]=s,(0|l)<=1){t=14;break}}A:do{if(13!=(0|t)&&14==(0|t))if((0|n[o>>2])<=1&&(0|n[o+4>>2])<=1&&(0|n[o+8>>2])<=1){d=127==(0|(s=0|W(g,t=0|lA(o))))?0:0|z(s);e:do{if(t){if(i){if(7==(0|(s=0|OA(A,e)))){s=5;break A}if((0|(l=0|n[21376+(28*s|0)+(t<<2)>>2]))>0){s=t,t=0;do{s=0|xA(s),t=t+1|0}while((0|t)!=(0|l))}else s=t;if(1==(0|s)){s=9;break A}127==(0|(t=0|W(g,s)))&&M(27648,27538,411,27678),0|z(t)?M(27693,27538,412,27678):(m=t,h=l,f=s)}else m=s,h=0,f=t;if((0|(u=0|n[4272+(28*g|0)+(f<<2)>>2]))<=-1&&M(27724,27538,419,27678),!d){if((0|h)<0){s=5;break A}if(0|h){s=0,t=0|n[(l=r)>>2],l=0|n[l+4>>2];do{t=0|YA(t,l),l=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=l,s=s+1|0}while((0|s)<(0|h))}if((0|u)<=0){s=m,t=58;break}for(s=0,t=0|n[(l=r)>>2],l=0|n[l+4>>2];;)if(t=0|YA(t,l),l=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=l,(0|(s=s+1|0))==(0|u)){s=m,t=58;break e}}if(7==(0|(c=0|Z(m,g)))&&M(27514,27538,428,27678),t=0|n[(s=r)>>2],s=0|n[s+4>>2],(0|u)>0){l=0;do{t=0|YA(t,s),s=0|B(),n[(v=r)>>2]=t,n[v+4>>2]=s,l=l+1|0}while((0|l)!=(0|u))}if(7==(0|(s=0|OA(t,s)))&&M(27795,27538,440,27678),t=0|G(m),(0|(t=0|n[(t?21792:21584)+(28*c|0)+(s<<2)>>2]))<0&&M(27795,27538,454,27678),t){s=0,l=0|n[(c=r)>>2],c=0|n[c+4>>2];do{l=0|UA(l,c),c=0|B(),n[(v=r)>>2]=l,n[v+4>>2]=c,s=s+1|0}while((0|s)<(0|t));s=m,t=58}else s=m,t=58}else if(!!(0|i)&!!(0|d)){if(7==(0|(t=0|OA(A,e)))|7==(0|(l=0|OA(0|n[(l=r)>>2],0|n[l+4>>2])))){s=5;break A}if((0|(l=0|n[21376+(28*t|0)+(l<<2)>>2]))<0){s=5;break A}if(l){t=0,c=0|n[(u=r)>>2],u=0|n[u+4>>2];do{c=0|YA(c,u),u=0|B(),n[(v=r)>>2]=c,n[v+4>>2]=u,t=t+1|0}while((0|t)<(0|l));t=58}else t=59}else t=58}while(0);if(58==(0|t)&&d&&(t=59),59==(0|t)&&1==(0|OA(0|n[(v=r)>>2],0|n[v+4>>2]))){s=9;break}p=0|n[(v=r)>>2],v=-1040385&n[v+4>>2],x=0|rt(0|s,0,45),v=0|v|B(),n[(s=r)>>2]=p|x,n[s+4>>2]=v,s=0}else s=1}while(0);return P=a,0|s}function pe(A,e,t,r){A|=0,e|=0;var n=0,o=0,i=0;if(!(0|(t|=0))&!(0|(r|=0)))return o=1,C(0|(n=0)),0|o;o=A,n=e,A=1,e=0;do{A=0|qe(0|((i=!0&!(1&t))?1:o),0|(i?0:n),0|A,0|e),e=0|B(),t=0|et(0|t,0|r,1),r=0|B(),o=0|qe(0|o,0|n,0|o,0|n),n=0|B()}while(!(!(0|t)&!(0|r)));return C(0|e),0|A}function xe(A,e,t,r){t|=0,r|=0;var i,a=0,s=0,l=0,c=0,u=0,f=0;i=P,P=P+16|0,s=i,l=0|tt(0|(A|=0),0|(e|=0),52),B(),l&=15;do{if(l){if(!(a=0|qA(A,e,s))){u=+o[s>>3],c=1/+d(+u),f=+o[25968+(l<<3)>>3],o[t>>3]=u+f,o[t+8>>3]=u-f,u=+o[s+8>>3],c*=f,o[t+16>>3]=c+u,o[t+24>>3]=u-c;break}return P=i,0|a}if(a=0|tt(0|A,0|e,45),B(),(a&=127)>>>0>121)return P=i,5;s=22064+(a<<5)|0,n[t>>2]=n[s>>2],n[t+4>>2]=n[s+4>>2],n[t+8>>2]=n[s+8>>2],n[t+12>>2]=n[s+12>>2],n[t+16>>2]=n[s+16>>2],n[t+20>>2]=n[s+20>>2],n[t+24>>2]=n[s+24>>2],n[t+28>>2]=n[s+28>>2];break}while(0);return function(A,e){e=+e;var t,r,n,i,a,s,l,c=0,u=0;c=(i=+o[(n=16+(A|=0)|0)>>3])-(r=+o[(t=A+24|0)>>3]),c=i>3],c=.5*(c*e-c),u+=e=.5*((l=u-(s=+o[(a=A+8|0)>>3]))*e-l),o[A>>3]=u>1.5707963267948966?1.5707963267948966:u,e=s-e,o[a>>3]=e<-1.5707963267948966?-1.5707963267948966:e,e=(e=i+c)>3.141592653589793?e+-6.283185307179586:e,o[n>>3]=e<-3.141592653589793?e+6.283185307179586:e,e=(e=r-c)>3.141592653589793?e+-6.283185307179586:e,o[t>>3]=e<-3.141592653589793?e+6.283185307179586:e}(t,r?1.4:1.1),(0|n[(r=26096+(l<<3)|0)>>2])==(0|A)&&(0|n[r+4>>2])==(0|e)&&(o[t>>3]=1.5707963267948966),(0|n[(l=26224+(l<<3)|0)>>2])==(0|A)&&(0|n[l+4>>2])==(0|e)&&(o[t+8>>3]=-1.5707963267948966),1.5707963267948966!=+o[t>>3]&&-1.5707963267948966!=+o[t+8>>3]?(P=i,0|(l=0)):(o[t+16>>3]=3.141592653589793,o[t+24>>3]=-3.141592653589793,P=i,0|(l=0))}function ve(A){var e,t,o,i,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0;if(i=P,P=P+336|0,e=i+168|0,t=i,!(0|(s=0|n[(l=A|=0)>>2]))&!(0|(l=0|n[l+4>>2])))P=i;else{if(0|r[0|(a=A+28|0)]?(s=0|we(s,l),l=0|B()):r[0|a]=1,!(0|n[n[(o=A+20|0)>>2]>>2]))return 0|(s=0|n[(a=A+24|0)>>2])&&Ye(s),n[(y=A)>>2]=0,n[y+4>>2]=0,n[A+8>>2]=0,n[o>>2]=0,n[A+12>>2]=-1,n[A+16>>2]=0,n[a>>2]=0,void(P=i);c=15&(a=0|n[(y=A+16|0)>>2]);A:do{if(!(0|s)&!(0|l))w=A+24|0;else{x=A+12|0,b=3==(0|c),m=255&a,g=3==(1|c),p=A+24|0,h=(c+-1|0)>>>0<3,d=3==(2|c),f=t+8|0;e:for(;;){if(u=0|tt(0|s,0|l,52),B(),(0|(u&=15))==(0|n[x>>2])){switch(15&m){case 0:case 2:case 3:if(0|(c=0|qA(s,l,e))){v=15;break e}if(0|Me(0|n[o>>2],0|n[p>>2],e)){v=19;break e}}if(g&&(c=0|n[4+(0|n[o>>2])>>2],n[e>>2]=n[c>>2],n[e+4>>2]=n[c+4>>2],n[e+8>>2]=n[c+8>>2],n[e+12>>2]=n[c+12>>2],0|X(26832,e))){if(0|KA(0|n[4+(0|n[o>>2])>>2],u,t)){v=25;break}if((0|n[(c=t)>>2])==(0|s)&&(0|n[c+4>>2])==(0|l)){v=29;break}}if(h){if(0|(c=0|$A(s,l,e))){v=32;break}if(0|xe(s,l,t,0)){v=36;break}if(d&&0|De(0|n[o>>2],0|n[p>>2],e,t)){v=42;break}if(g&&0|Ne(0|n[o>>2],0|n[p>>2],e,t)){v=42;break}}if(b){if(a=0|xe(s,l,e,1),c=0|n[p>>2],0|a){v=45;break}if(0|q(c,e)){if(AA(t,e),0|$(e,0|n[p>>2])){v=53;break}if(0|Me(0|n[o>>2],0|n[p>>2],f)){v=53;break}if(0|Ne(0|n[o>>2],0|n[p>>2],t,e)){v=53;break}}}}do{if((0|u)<(0|n[x>>2])){if(a=0|xe(s,l,e,1),c=0|n[p>>2],0|a){v=58;break e}if(!(0|q(c,e))){v=73;break}if(0|$(0|n[p>>2],e)&&(AA(t,e),0|De(0|n[o>>2],0|n[p>>2],t,e))){v=65;break e}if(0|(s=0|GA(s,l,u+1|0,t))){v=67;break e}s=0|n[(l=t)>>2],l=0|n[l+4>>2]}else v=73}while(0);if(73==(0|v)&&(v=0,s=0|we(s,l),l=0|B()),!(0|s)&!(0|l)){w=p;break A}}switch(0|v){case 15:0|(a=0|n[p>>2])&&Ye(a),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=c,v=20;break;case 19:n[A>>2]=s,n[A+4>>2]=l,v=20;break;case 25:M(27795,27761,470,27772);break;case 29:case 42:return n[A>>2]=s,n[A+4>>2]=l,void(P=i);case 32:return 0|(a=0|n[p>>2])&&Ye(a),n[(w=A)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=c,void(P=i);case 36:M(27795,27761,493,27772);break;case 45:0|c&&Ye(c),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=a,v=55;break;case 53:n[A>>2]=s,n[A+4>>2]=l,v=55;break;case 58:0|c&&Ye(c),n[(v=A)>>2]=0,n[v+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=a,v=71;break;case 65:n[A>>2]=s,n[A+4>>2]=l,v=71;break;case 67:return 0|(a=0|n[p>>2])&&Ye(a),n[(w=A)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[x>>2]=-1,n[y>>2]=0,n[p>>2]=0,n[A+8>>2]=s,void(P=i)}if(20==(0|v))return void(P=i);if(55==(0|v))return void(P=i);if(71==(0|v))return void(P=i)}}while(0);0|(a=0|n[w>>2])&&Ye(a),n[(v=A)>>2]=0,n[v+4>>2]=0,n[A+8>>2]=0,n[o>>2]=0,n[A+12>>2]=-1,n[y>>2]=0,n[w>>2]=0,P=i}}function we(A,e){var t,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0;t=P,P=P+16|0,d=t,o=0|tt(0|(A|=0),0|(e|=0),52),B(),o&=15,r=0|tt(0|A,0|e,45),B();do{if(o){for(;r=0|rt(o+4095|0,0,52),i=B()|-15728641&e,r=r|A|(s=0|rt(7,0,0|(a=3*(15-o|0)|0))),i|=l=0|B(),c=0|tt(0|A,0|e,0|a),B(),o=o+-1|0,!((c&=7)>>>0<6);){if(!o){u=4;break}e=i,A=r}if(4==(0|u)){r=0|tt(0|r,0|i,45),B();break}return d=0|rt(((d=!(0|c)&!!(0|HA(r,i)))?2:1)+c|0,0,0|a),u=0|B()|e&~l,d|=A&~s,C(0|u),P=t,0|d}}while(0);return(r&=127)>>>0>120?(d=0,C(0|(u=0)),P=t,0|d):(RA(d,0,r+1|0,0),u=0|n[d+4>>2],d=0|n[d>>2],C(0|u),P=t,0|d)}function ye(A,e,t){A|=0;var r,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0;if(!(0|X(e|=0,t|=0)))return 0;if(e=0|K(e),i=+o[t>>3],a=e&(a=+o[t+8>>3])<0?a+6.283185307179586:a,(0|(g=0|n[A>>2]))<=0)return 0;if(r=0|n[A+4>>2],e){e=0,f=a,t=-1,A=0;A:for(;;){for(d=A;l=+o[r+(d<<4)>>3],a=+o[r+(d<<4)+8>>3],s=+o[r+((A=(t+2|0)%(0|g)|0)<<4)>>3],c=+o[r+(A<<4)+8>>3],l>s?(u=l,l=c):(u=s,s=l,l=a,a=c),(i=i==s|i==u?i+2220446049250313e-31:i)u;){if((0|(t=d+1|0))>=(0|g)){t=22;break A}A=d,d=t,t=A}if(((u=(c=l<0?l+6.283185307179586:l)+(i-s)/(u-s)*((l=a<0?a+6.283185307179586:a)-c))<0?u+6.283185307179586:u)>(f=c==f|l==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(A=d+1|0))>=(0|g)){t=22;break}t=d}if(22==(0|t))return 0|e}else{e=0,f=a,t=-1,A=0;A:for(;;){for(d=A;l=+o[r+(d<<4)>>3],a=+o[r+(d<<4)+8>>3],s=+o[r+((A=(t+2|0)%(0|g)|0)<<4)>>3],c=+o[r+(A<<4)+8>>3],l>s?(u=l,l=c):(u=s,s=l,l=a,a=c),(i=i==s|i==u?i+2220446049250313e-31:i)u;){if((0|(t=d+1|0))>=(0|g)){t=22;break A}A=d,d=t,t=A}if(l+(i-s)/(u-s)*(a-l)>(f=l==f|a==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(A=d+1|0))>=(0|g)){t=22;break}t=d}if(22==(0|t))return 0|e}return 0}function ke(A,e){e|=0;var t,r,i,a,s,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0;if(!(r=0|n[(A|=0)>>2]))return n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,void(n[e+28>>2]=0);if(o[(i=e+8|0)>>3]=17976931348623157e292,o[(a=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(s=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(t=0|n[A+4>>2],b=17976931348623157e292,p=-17976931348623157e292,x=0,A=-1,f=17976931348623157e292,g=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,v=0;c=+o[t+(v<<4)>>3],h=+o[t+(v<<4)+8>>3],d=+o[t+(((0|(A=A+2|0))==(0|r)?0:A)<<4)+8>>3],c>3]=c,f=c),h>3]=h,g=h),c>m?o[e>>3]=c:c=m,h>u&&(o[s>>3]=h,u=h),b=h>0&hp?h:p,x|=+l(+(h-d))>3.141592653589793,(0|(A=v+1|0))!=(0|r);)w=v,m=c,v=A,A=w;x&&(o[s>>3]=p,o[a>>3]=b)}}function Ce(A){return 0|((A|=0)>>>0<4?0:15)}function Be(A,e){e|=0;var t,r=0,i=0,a=0,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,M=0;if(p=0|n[(A|=0)>>2]){if(o[(x=e+8|0)>>3]=17976931348623157e292,o[(v=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(w=e+16|0)>>3]=-17976931348623157e292,(0|p)>0){for(a=0|n[A+4>>2],m=17976931348623157e292,b=-17976931348623157e292,i=0,r=-1,d=17976931348623157e292,f=17976931348623157e292,h=-17976931348623157e292,c=-17976931348623157e292,y=0;s=+o[a+(y<<4)>>3],g=+o[a+(y<<4)+8>>3],u=+o[a+(((0|(B=r+2|0))==(0|p)?0:B)<<4)+8>>3],s>3]=s,d=s),g>3]=g,f=g),s>h?o[e>>3]=s:s=h,g>c&&(o[w>>3]=g,c=g),m=g>0&gb?g:b,i|=+l(+(g-u))>3.141592653589793,(0|(r=y+1|0))!=(0|p);)B=y,h=s,y=r,r=B;i&&(o[w>>3]=b,o[v>>3]=m)}}else n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,n[e+28>>2]=0;if(!((0|(r=0|n[(B=A+8|0)>>2]))<=0)){t=A+12|0,C=0;do{if(a=0|n[t>>2],i=C,v=e+((C=C+1|0)<<5)|0,w=0|n[a+(i<<3)>>2]){if(o[(y=e+(C<<5)+8|0)>>3]=17976931348623157e292,o[(A=e+(C<<5)+24|0)>>3]=17976931348623157e292,o[v>>3]=-17976931348623157e292,o[(k=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|w)>0){for(p=0|n[a+(i<<3)+4>>2],m=17976931348623157e292,b=-17976931348623157e292,a=0,i=-1,x=0,d=17976931348623157e292,f=17976931348623157e292,g=-17976931348623157e292,c=-17976931348623157e292;s=+o[p+(x<<4)>>3],h=+o[p+(x<<4)+8>>3],u=+o[p+(((0|(i=i+2|0))==(0|w)?0:i)<<4)+8>>3],s>3]=s,d=s),h>3]=h,f=h),s>g?o[v>>3]=s:s=g,h>c&&(o[k>>3]=h,c=h),m=h>0&hb?h:b,a|=+l(+(h-u))>3.141592653589793,(0|(i=x+1|0))!=(0|w);)M=x,x=i,g=s,i=M;a&&(o[k>>3]=b,o[A>>3]=m)}}else n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,n[v+12>>2]=0,n[v+16>>2]=0,n[v+20>>2]=0,n[v+24>>2]=0,n[v+28>>2]=0,r=0|n[B>>2]}while((0|C)<(0|r))}}function Me(A,e,t){var r=0,o=0,i=0;if(!(0|ye(A|=0,e|=0,t|=0)))return 0;if((0|n[(o=A+8|0)>>2])<=0)return 1;for(r=A+12|0,A=0;;){if(i=A,A=A+1|0,0|ye((0|n[r>>2])+(i<<3)|0,e+(A<<5)|0,t)){A=0,r=6;break}if((0|A)>=(0|n[o>>2])){A=1,r=6;break}}return 6==(0|r)?0|A:0}function De(A,e,t,r){r|=0;var o,i,a=0,s=0,l=0,c=0,u=0;if(i=P,P=P+16|0,o=i,!(0|ye(A|=0,e|=0,l=8+(t|=0)|0)))return P=i,0;c=A+8|0;A:do{if((0|n[c>>2])>0){for(s=A+12|0,a=0;;){if(u=a,a=a+1|0,0|ye((0|n[s>>2])+(u<<3)|0,e+(a<<5)|0,l)){a=0;break}if((0|a)>=(0|n[c>>2]))break A}return P=i,0|a}}while(0);if(0|Ee(A,e,t,r))return P=i,0;n[o>>2]=n[t>>2],n[o+4>>2]=l,a=0|n[c>>2];A:do{if((0|a)>0)for(A=A+12|0,l=0,s=a;;){if(a=0|n[A>>2],(0|n[a+(l<<3)>>2])>0){if(0|ye(o,r,0|n[a+(l<<3)+4>>2])){a=0;break A}if(a=l+1|0,0|Ee((0|n[A>>2])+(l<<3)|0,e+(a<<5)|0,t,r)){a=0;break A}s=0|n[c>>2]}else a=l+1|0;if(!((0|a)<(0|s))){a=1;break}l=a}else a=1}while(0);return P=i,0|a}function Ee(A,e,t,r){A|=0,t|=0;var i,a,s,l,c,u,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,M=0;if(u=P,P=P+176|0,l=u+172|0,d=u+168|0,c=u,!(0|q(e|=0,r|=0)))return P=u,0;if(function(A,e,t,r){var i,a,s,l,c;e|=0,t|=0,r|=0,A=(a=+o[16+(A|=0)>>3])<(c=+o[A+24>>3]),i=(l=+o[e+16>>3])<(s=+o[e+24>>3]),e=c-l>2]=A?i|e?1:2:0,n[r>>2]=i?A?1:e?2:1:0}(e,r,l,d),st(0|c,0|t,168),(0|n[t>>2])>0){e=0;do{y=+ie(+o[(B=c+8+(e<<4)+8|0)>>3],0|n[d>>2]),o[B>>3]=y,e=e+1|0}while((0|e)<(0|n[t>>2]))}a=+o[r>>3],s=+o[r+8>>3],y=+ie(+o[r+16>>3],0|n[d>>2]),i=+ie(+o[r+24>>3],0|n[d>>2]);A:do{if((0|n[A>>2])>0){if(r=A+4|0,(0|(d=0|n[c>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|n[A>>2])){e=0;break A}for(t=0;;){if(e=0|n[r>>2],v=+o[e+(t<<4)>>3],w=+ie(+o[e+(t<<4)+8>>3],0|n[l>>2]),e=0|n[r>>2],B=(0|(t=t+1|0))%(0|n[A>>2])|0,f=+o[e+(B<<4)>>3],g=+ie(+o[e+(B<<4)+8>>3],0|n[l>>2]),!(v>=a)|!(f>=a)&&!(v<=s)|!(f<=s)&&!(w<=i)|!(g<=i)&&!(w>=y)|!(g>=y)){x=f-v,b=g-w,e=0;do{if(M=e,B=(0|(e=e+1|0))==(0|d)?0:e,f=+o[c+8+(M<<4)+8>>3],g=+o[c+8+(B<<4)+8>>3]-f,h=+o[c+8+(M<<4)>>3],!(0==(p=x*g-b*(m=+o[c+8+(B<<4)>>3]-h))||(k=w-f,C=v-h,m=(k*m-g*C)/p,m<0|m>1))&&(p=(x*k-b*C)/p)>=0&p<=1){e=1;break A}}while((0|e)<(0|d))}if((0|t)>=(0|n[A>>2])){e=0;break}}}else e=0}while(0);return P=u,0|e}function Ne(A,e,t,r){var o=0,i=0,a=0;if(0|Ee(A|=0,e|=0,t|=0,r|=0))return 1;if((0|n[(i=A+8|0)>>2])<=0)return 0;for(o=A+12|0,A=0;;){if(a=A,A=A+1|0,0|Ee((0|n[o>>2])+(a<<3)|0,e+(A<<5)|0,t,r)){A=1,o=6;break}if((0|A)>=(0|n[i>>2])){A=0,o=6;break}}return 6==(0|o)?0|A:0}function Qe(A,e,t,r,n){e|=0,t|=0,r|=0,n|=0;var i,a,s,l,c,u,d,f=0;l=+o[(A|=0)>>3],s=+o[e>>3]-l,a=+o[A+8>>3],i=+o[e+8>>3]-a,u=+o[t>>3],f=((f=+o[r>>3]-u)*(a-(d=+o[t+8>>3]))-(l-u)*(c=+o[r+8>>3]-d))/(s*c-i*f),o[n>>3]=l+s*f,o[n+8>>3]=a+i*f}function je(A,e){return e|=0,+l(+(+o[(A|=0)>>3]-+o[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+o[A+8>>3]-+o[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function Pe(A,e){var t,r,n;return e|=0,+((n=+o[(A|=0)>>3]-+o[e>>3])*n+(r=+o[A+8>>3]-+o[e+8>>3])*r+(t=+o[A+16>>3]-+o[e+16>>3])*t)}function Fe(A,e,t){t|=0;var r,o,i,a,s=0,l=0,c=0,u=0;if(a=P,P=P+32|0,u=a,0|(s=0|XA(A|=0,e|=0,o=a+16|0)))return P=a,0|s;r=0|LA(A,e),i=0|OA(A,e),function(A,e){A=7696+(28*(A|=0)|0)|0,n[(e|=0)>>2]=n[A>>2],n[e+4>>2]=n[A+4>>2],n[e+8>>2]=n[A+8>>2],n[e+12>>2]=n[A+12>>2]}(r,u),s=0|function(A,e){A|=0;var t=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|n[11120+(216*e|0)>>2])!=(0|A))if((0|n[11120+(216*e|0)+8>>2])!=(0|A))if((0|n[11120+(216*e|0)+16>>2])!=(0|A))if((0|n[11120+(216*e|0)+24>>2])!=(0|A))if((0|n[11120+(216*e|0)+32>>2])!=(0|A))if((0|n[11120+(216*e|0)+40>>2])!=(0|A))if((0|n[11120+(216*e|0)+48>>2])!=(0|A))if((0|n[11120+(216*e|0)+56>>2])!=(0|A))if((0|n[11120+(216*e|0)+64>>2])!=(0|A))if((0|n[11120+(216*e|0)+72>>2])!=(0|A))if((0|n[11120+(216*e|0)+80>>2])!=(0|A))if((0|n[11120+(216*e|0)+88>>2])!=(0|A))if((0|n[11120+(216*e|0)+96>>2])!=(0|A))if((0|n[11120+(216*e|0)+104>>2])!=(0|A))if((0|n[11120+(216*e|0)+112>>2])!=(0|A))if((0|n[11120+(216*e|0)+120>>2])!=(0|A))if((0|n[11120+(216*e|0)+128>>2])!=(0|A)){if((0|n[11120+(216*e|0)+136>>2])!=(0|A)){if((0|n[11120+(216*e|0)+144>>2])==(0|A)){A=0,t=2,r=0;break}if((0|n[11120+(216*e|0)+152>>2])==(0|A)){A=0,t=2,r=1;break}if((0|n[11120+(216*e|0)+160>>2])==(0|A)){A=0,t=2,r=2;break}if((0|n[11120+(216*e|0)+168>>2])==(0|A)){A=1,t=2,r=0;break}if((0|n[11120+(216*e|0)+176>>2])==(0|A)){A=1,t=2,r=1;break}if((0|n[11120+(216*e|0)+184>>2])==(0|A)){A=1,t=2,r=2;break}if((0|n[11120+(216*e|0)+192>>2])==(0|A)){A=2,t=2,r=0;break}if((0|n[11120+(216*e|0)+200>>2])==(0|A)){A=2,t=2,r=1;break}if((0|n[11120+(216*e|0)+208>>2])==(0|A)){A=2,t=2,r=2;break}return-1}A=2,t=1,r=2}else A=2,t=1,r=1;else A=2,t=1,r=0;else A=1,t=1,r=2;else A=1,t=1,r=1;else A=1,t=1,r=0;else A=0,t=1,r=2;else A=0,t=1,r=1;else A=0,t=1,r=0;else A=2,t=0,r=2;else A=2,t=0,r=1;else A=2,t=0,r=0;else A=1,t=0,r=2;else A=1,t=0,r=1;else A=1,t=0,r=0;else A=0,t=0,r=2;else A=0,t=0,r=1;else A=0,t=0,r=0}while(0);return 0|n[11120+(216*e|0)+(72*t|0)+(24*A|0)+(r<<3)+4>>2]}(r,0|n[o>>2]);do{if(0|z(r)){switch(0|r){case 4:l=0;break;case 14:l=1;break;case 24:l=2;break;case 38:l=3;break;case 49:l=4;break;case 58:l=5;break;case 63:l=6;break;case 72:l=7;break;case 83:l=8;break;case 97:l=9;break;case 107:l=10;break;case 117:l=11;break;default:M(27795,27797,75,27806)}if(c=0|n[26416+(24*l|0)+8>>2],e=0|n[26416+(24*l|0)+16>>2],(0|(A=0|n[o>>2]))!=(0|n[u>>2])&&(u=0|G(r))|(0|(A=0|n[o>>2]))==(0|e)&&(s=(s+1|0)%6|0),3==(0|i)&(0|A)==(0|e)){s=(s+5|0)%6|0;break}5==(0|i)&(0|A)==(0|c)&&(s=(s+1|0)%6|0)}}while(0);return n[t>>2]=s,P=a,0}function Se(A,e,t,r){t|=0,r|=0;var o,i,a,s,l,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0;if(l=P,P=P+32|0,v=l+24|0,s=l+20|0,a=l+8|0,i=l+16|0,o=l,g=(g=!(0|HA(A|=0,e|=0)))?6:5,m=0|tt(0|A,0|e,52),B(),g>>>0<=t>>>0)return P=l,2;!(b=!(0|(m&=15)))&&!((p=0|rt(7,0,3*(15^m)|0))&A)&!((0|B())&e)?c=t:u=4;A:do{if(4==(0|u)){if((0|((c=!!(0|HA(A,e)))?4:5))<(0|t))return P=l,1;if(0|Fe(A,e,v))return P=l,1;if(u=(0|n[v>>2])+t|0,7==(0|(p=0|n[(c=c?26704+((0|u)%5<<2)|0:26736+((0|u)%6<<2)|0)>>2])))return P=l,1;n[s>>2]=0,c=0|R(A,e,p,s,a);do{if(!c){if(h=0|n[(f=a)>>2],u=(d=(f=0|n[f+4>>2])>>>0>>0|(0|f)==(0|e)&h>>>0>>0)?h:A,d=d?f:e,!b&&!(h&(b=0|rt(7,0,3*(15^m)|0)))&!(f&(0|B())))c=t;else{if(f=(t+-1+g|0)%(0|g)|0,c=0|HA(A,e),(0|f)<0&&M(27795,27797,248,27822),(0|((g=!!(0|c))?4:5))<(0|f)&&M(27795,27797,248,27822),0|Fe(A,e,v)&&M(27795,27797,248,27822),c=(0|n[v>>2])+f|0,7==(0|(f=0|n[(c=g?26704+((0|c)%5<<2)|0:26736+((0|c)%6<<2)|0)>>2]))&&M(27795,27797,248,27822),n[i>>2]=0,0|(c=0|R(A,e,f,i,o)))break;g=0|n[(h=o)>>2],h=0|n[h+4>>2];do{if(h>>>0>>0|(0|h)==(0|d)&g>>>0>>0){if(u=0|HA(g,h)?0|_(g,h,A,e):0|n[26800+(((0|n[i>>2])+(0|n[26768+(f<<2)>>2])|0)%6<<2)>>2],c=0|HA(g,h),(u+-1|0)>>>0>5){c=-1,u=g,d=h;break}if(1==(0|u)&(c=!!(0|c))){c=-1,u=g,d=h;break}do{if(!(0|Fe(g,h,v))){if(c){c=(5+(0|n[26352+(u<<2)>>2])-(0|n[v>>2])|0)%5|0;break}c=(6+(0|n[26384+(u<<2)>>2])-(0|n[v>>2])|0)%6|0;break}c=-1}while(0);u=g,d=h}else c=t}while(0);h=0|n[(f=a)>>2],f=0|n[f+4>>2]}if((0|u)==(0|h)&(0|d)==(0|f)){if(A=(g=!!(0|HA(h,f)))?0|_(h,f,A,e):0|n[26800+(((0|n[s>>2])+(0|n[26768+(p<<2)>>2])|0)%6<<2)>>2],c=0|HA(h,f),(A+-1|0)>>>0<=5&&!(1==(0|A)&(x=!!(0|c))))do{if(!(0|Fe(h,f,v))){if(x){c=(5+(0|n[26352+(A<<2)>>2])-(0|n[v>>2])|0)%5|0;break}c=(6+(0|n[26384+(A<<2)>>2])-(0|n[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|g&5==(0|c)?0:c}e=d,A=u;break A}}while(0);return P=l,0|c}}while(0);return x=0|rt(0|c,0,56),v=B()|-2130706433&e|536870912,n[r>>2]=x|A,n[r+4>>2]=v,P=l,0}function Le(A,e){A|=0;var t,r,o=0,i=0;return r=P,P=P+16|0,t=r,!0&536870912==(2013265920&(e|=0))&&0|IA(A,o=-2130706433&e|134217728)?(i=0|tt(0|A,0|e,56),B(),o=(i=!(0|Se(A,o,7&i,t)))&((0|n[(o=t)>>2])==(0|A)?(0|n[o+4>>2])==(0|e):0)&1,P=r,0|o):(P=r,0|(o=0))}function Ie(A,e,t){A|=0,t|=0;var r=0;(0|(e|=0))>0?(r=0|We(e,4),n[A>>2]=r,r||M(27835,27858,40,27872)):n[A>>2]=0,n[A+4>>2]=e,n[A+8>>2]=0,n[A+12>>2]=t}function Re(A){var e,t,r,i=0,a=0,s=0,c=0;e=4+(A|=0)|0,t=A+12|0,r=A+8|0;A:for(;;){for(a=0|n[e>>2],i=0;;){if((0|i)>=(0|a))break A;if(s=0|n[A>>2],c=0|n[s+(i<<2)>>2])break;i=i+1|0}i=s+(~~(+l(+ +u(10,+ +(15-(0|n[t>>2])|0))*(+o[c>>3]+ +o[c+8>>3]))%+(0|a))>>>0<<2)|0,a=0|n[i>>2];e:do{if(0|a){if(s=c+32|0,(0|a)==(0|c))n[i>>2]=n[s>>2];else{if(!(i=0|n[(a=a+32|0)>>2]))break;for(;(0|i)!=(0|c);)if(!(i=0|n[(a=i+32|0)>>2]))break e;n[a>>2]=n[s>>2]}Ye(c),n[r>>2]=(0|n[r>>2])-1}}while(0)}Ye(0|n[A>>2])}function Te(A){var e,t=0,r=0;for(e=0|n[4+(A|=0)>>2],r=0;;){if((0|r)>=(0|e)){t=0,r=4;break}if(t=0|n[(0|n[A>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|t:0}function _e(A,e){e|=0;var t=0,r=0,i=0,a=0;if(t=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,t=(0|n[A>>2])+(t<<2)|0,!(r=0|n[t>>2]))return 1;a=e+32|0;do{if((0|r)!=(0|e)){if(!(t=0|n[r+32>>2]))return 1;for(i=t;;){if((0|i)==(0|e)){i=8;break}if(!(t=0|n[i+32>>2])){t=1,i=10;break}r=i,i=t}if(8==(0|i)){n[r+32>>2]=n[a>>2];break}if(10==(0|i))return 0|t}else n[t>>2]=n[a>>2]}while(0);return Ye(e),n[(a=A+8|0)>>2]=(0|n[a>>2])-1,0}function He(A,e,t){A|=0,e|=0,t|=0;var r,i=0,a=0,s=0;(r=0|Ue(40))||M(27888,27858,98,27901),n[r>>2]=n[e>>2],n[r+4>>2]=n[e+4>>2],n[r+8>>2]=n[e+8>>2],n[r+12>>2]=n[e+12>>2],n[(a=r+16|0)>>2]=n[t>>2],n[a+4>>2]=n[t+4>>2],n[a+8>>2]=n[t+8>>2],n[a+12>>2]=n[t+12>>2],n[r+32>>2]=0,a=~~(+l(+ +u(10,+ +(15-(0|n[A+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,a=(0|n[A>>2])+(a<<2)|0,i=0|n[a>>2];do{if(i){for(;!(0|oe(i,e)&&0|oe(i+16|0,t));)if(a=0|n[i+32>>2],!(0|n[(i=0|a?a:i)+32>>2])){s=10;break}if(10==(0|s)){n[i+32>>2]=r;break}return Ye(r),0|i}n[a>>2]=r}while(0);return n[(s=A+8|0)>>2]=1+(0|n[s>>2]),0|r}function ze(A,e,t){e|=0,t|=0;var r=0,i=0;if(i=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,!(i=0|n[(0|n[A>>2])+(i<<2)>>2]))return 0;if(!t){for(A=i;;){if(0|oe(A,e)){r=10;break}if(!(A=0|n[A+32>>2])){A=0,r=10;break}}if(10==(0|r))return 0|A}for(A=i;;){if(0|oe(A,e)&&0|oe(A+16|0,t)){r=10;break}if(!(A=0|n[A+32>>2])){A=0,r=10;break}}return 10==(0|r)?0|A:0}function Ge(A,e){e|=0;var t=0;if(t=~~(+l(+ +u(10,+ +(15-(0|n[12+(A|=0)>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|n[A+4>>2]))>>>0,!(A=0|n[(0|n[A>>2])+(t<<2)>>2]))return 0;for(;;){if(0|oe(A,e)){e=5;break}if(!(A=0|n[A+32>>2])){A=0,e=5;break}}return 5==(0|e)?0|A:0}function Oe(A){return 0|+ct(+(A=+A))}function Ue(A){A|=0;var e,t=0,r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0;e=P,P=P+16|0,g=e;do{if(A>>>0<245){if(A=(u=A>>>0<11?16:A+11&-8)>>>3,3&(r=(f=0|n[6981])>>>A))return o=0|n[(r=8+(A=27964+((t=(1&r^1)+A|0)<<1<<2)|0)|0)>>2],(0|(a=0|n[(i=o+8|0)>>2]))==(0|A)?n[6981]=f&~(1<>2]=A,n[r>>2]=a),y=t<<3,n[o+4>>2]=3|y,n[(y=o+y+4|0)>>2]=1|n[y>>2],P=e,0|i;if(u>>>0>(d=0|n[6983])>>>0){if(0|r)return t=((t=r<>>=l=t>>>12&16)>>>5&8)|l|(a=(t>>>=r)>>>2&4)|(A=(t>>>=a)>>>1&2)|(o=(t>>>=A)>>>1&1))+(t>>>o)|0)<<1<<2)|0)|0)>>2],(0|(r=0|n[(l=a+8|0)>>2]))==(0|t)?(A=f&~(1<>2]=t,n[A>>2]=r,A=f),s=(y=o<<3)-u|0,n[a+4>>2]=3|u,n[4+(i=a+u|0)>>2]=1|s,n[a+y>>2]=s,0|d&&(o=0|n[6986],r=27964+((t=d>>>3)<<1<<2)|0,A&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=o,n[t+12>>2]=o,n[o+8>>2]=t,n[o+12>>2]=r),n[6983]=s,n[6986]=i,P=e,0|l;if(a=0|n[6982]){for(r=(a&0-a)-1|0,r=c=0|n[28228+(((o=(r>>>=i=r>>>12&16)>>>5&8)|i|(s=(r>>>=o)>>>2&4)|(l=(r>>>=s)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&n[c+4>>2])-u|0;(A=0|n[r+16>>2])||(A=0|n[r+20>>2]);)r=A,l=(i=(s=(-8&n[A+4>>2])-u|0)>>>0>>0)?A:l,c=i?s:c;if((s=l+u|0)>>>0>l>>>0){i=0|n[l+24>>2],t=0|n[l+12>>2];do{if((0|t)==(0|l)){if(!(t=0|n[(A=l+20|0)>>2])&&!(t=0|n[(A=l+16|0)>>2])){r=0;break}for(;;)if(r=0|n[(o=t+20|0)>>2])t=r,A=o;else{if(!(r=0|n[(o=t+16|0)>>2]))break;t=r,A=o}n[A>>2]=0,r=t}else r=0|n[l+8>>2],n[r+12>>2]=t,n[t+8>>2]=r,r=t}while(0);do{if(0|i){if(t=0|n[l+28>>2],(0|l)==(0|n[(A=28228+(t<<2)|0)>>2])){if(n[A>>2]=r,!r){n[6982]=a&~(1<>2])==(0|l)?y:i+20)>>2]=r,!r)break;n[r+24>>2]=i,0|(t=0|n[l+16>>2])&&(n[r+16>>2]=t,n[t+24>>2]=r),0|(t=0|n[l+20>>2])&&(n[r+20>>2]=t,n[t+24>>2]=r)}}while(0);return c>>>0<16?(y=c+u|0,n[l+4>>2]=3|y,n[(y=l+y+4|0)>>2]=1|n[y>>2]):(n[l+4>>2]=3|u,n[s+4>>2]=1|c,n[s+c>>2]=c,0|d&&(o=0|n[6986],r=27964+((t=d>>>3)<<1<<2)|0,(t=1<>2]:(n[6981]=t|f,t=r,A=r+8|0),n[A>>2]=o,n[t+12>>2]=o,n[o+8>>2]=t,n[o+12>>2]=r),n[6983]=c,n[6986]=s),P=e,0|l+8}f=u}else f=u}else f=u}else if(A>>>0<=4294967231)if(u=-8&(A=A+11|0),o=0|n[6982]){i=0-u|0,c=(A>>>=8)?u>>>0>16777215?31:u>>>(7+(c=14-((l=(520192+(b=A<<(f=(A+1048320|0)>>>16&8))|0)>>>16&4)|f|(c=(245760+(b<<=l)|0)>>>16&2))+(b<>>15)|0)|0)&1|c<<1:0,r=0|n[28228+(c<<2)>>2];A:do{if(r)for(A=0,l=u<<(31==(0|c)?0:25-(c>>>1)|0),a=0;;){if((s=(-8&n[r+4>>2])-u|0)>>>0>>0){if(!s){A=r,i=0,b=65;break A}A=r,i=s}if(a=!(0|(b=0|n[r+20>>2]))|(0|b)==(0|(r=0|n[r+16+(l>>>31<<2)>>2]))?a:b,!r){r=a,b=61;break}l<<=1}else r=0,A=0,b=61}while(0);if(61==(0|b)){if(!(0|r)&!(0|A)){if(!(A=((A=2<>>=s=f>>>12&16)>>>5&8)|s|(l=(f>>>=a)>>>2&4)|(c=(f>>>=l)>>>1&2)|(r=(f>>>=c)>>>1&1))+(f>>>r)<<2)>>2]}r?b=65:(l=A,s=i)}if(65==(0|b))for(a=r;;){if(i=(r=(f=(-8&n[a+4>>2])-u|0)>>>0>>0)?f:i,A=r?a:A,(r=0|n[a+16>>2])||(r=0|n[a+20>>2]),!r){l=A,s=i;break}a=r}if(0|l&&s>>>0<((0|n[6983])-u|0)>>>0&&(d=l+u|0)>>>0>l>>>0){a=0|n[l+24>>2],t=0|n[l+12>>2];do{if((0|t)==(0|l)){if(!(t=0|n[(A=l+20|0)>>2])&&!(t=0|n[(A=l+16|0)>>2])){t=0;break}for(;;)if(r=0|n[(i=t+20|0)>>2])t=r,A=i;else{if(!(r=0|n[(i=t+16|0)>>2]))break;t=r,A=i}n[A>>2]=0}else y=0|n[l+8>>2],n[y+12>>2]=t,n[t+8>>2]=y}while(0);do{if(a){if(A=0|n[l+28>>2],(0|l)==(0|n[(r=28228+(A<<2)|0)>>2])){if(n[r>>2]=t,!t){o&=~(1<>2])==(0|l)?y:a+20)>>2]=t,!t)break;n[t+24>>2]=a,0|(A=0|n[l+16>>2])&&(n[t+16>>2]=A,n[A+24>>2]=t),(A=0|n[l+20>>2])&&(n[t+20>>2]=A,n[A+24>>2]=t)}}while(0);A:do{if(s>>>0<16)y=s+u|0,n[l+4>>2]=3|y,n[(y=l+y+4|0)>>2]=1|n[y>>2];else{if(n[l+4>>2]=3|u,n[d+4>>2]=1|s,n[d+s>>2]=s,t=s>>>3,s>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=d,n[t+12>>2]=d,n[d+8>>2]=t,n[d+12>>2]=r;break}if(t=28228+((r=(t=s>>>8)?s>>>0>16777215?31:s>>>(7+(r=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(r=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|r<<1:0)<<2)|0,n[d+28>>2]=r,n[4+(A=d+16|0)>>2]=0,n[A>>2]=0,!(o&(A=1<>2]=d,n[d+24>>2]=t,n[d+12>>2]=d,n[d+8>>2]=d;break}t=0|n[t>>2];e:do{if((-8&n[t+4>>2])!=(0|s)){for(o=s<<(31==(0|r)?0:25-(r>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|s)){t=A;break e}o<<=1,t=A}n[r>>2]=d,n[d+24>>2]=t,n[d+12>>2]=d,n[d+8>>2]=d;break A}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=d,n[w>>2]=d,n[d+8>>2]=y,n[d+12>>2]=t,n[d+24>>2]=0}}while(0);return P=e,0|l+8}f=u}else f=u;else f=-1}while(0);if((r=0|n[6983])>>>0>=f>>>0)return t=r-f|0,A=0|n[6986],t>>>0>15?(y=A+f|0,n[6986]=y,n[6983]=t,n[y+4>>2]=1|t,n[A+r>>2]=t,n[A+4>>2]=3|f):(n[6983]=0,n[6986]=0,n[A+4>>2]=3|r,n[(y=A+r+4|0)>>2]=1|n[y>>2]),P=e,0|A+8;if((s=0|n[6984])>>>0>f>>>0)return v=s-f|0,n[6984]=v,w=(y=0|n[6987])+f|0,n[6987]=w,n[w+4>>2]=1|v,n[y+4>>2]=3|f,P=e,0|y+8;if(0|n[7099]?A=0|n[7101]:(n[7101]=4096,n[7100]=4096,n[7102]=-1,n[7103]=-1,n[7104]=0,n[7092]=0,n[7099]=-16&g^1431655768,A=4096),l=f+48|0,(u=(a=A+(c=f+47|0)|0)&(i=0-A|0))>>>0<=f>>>0)return P=e,0;if(0|(A=0|n[7091])&&(g=(d=0|n[7089])+u|0)>>>0<=d>>>0|g>>>0>A>>>0)return P=e,0;A:do{if(4&n[7092])t=0,b=143;else{r=0|n[6987];e:do{if(r){for(o=28372;!((g=0|n[o>>2])>>>0<=r>>>0&&(g+(0|n[o+4>>2])|0)>>>0>r>>>0);){if(!(A=0|n[o+8>>2])){b=128;break e}o=A}if((t=a-s&i)>>>0<2147483647)if((0|(A=0|ut(0|t)))==((0|n[o>>2])+(0|n[o+4>>2])|0)){if(-1!=(0|A)){s=t,a=A,b=145;break A}}else o=A,b=136;else t=0}else b=128}while(0);do{if(128==(0|b))if(-1!=(0|(r=0|ut(0)))&&(t=r,m=(t=((m=(h=0|n[7100])-1|0)&t?(m+t&0-h)-t|0:0)+u|0)+(h=0|n[7089])|0,t>>>0>f>>>0&t>>>0<2147483647)){if(0|(g=0|n[7091])&&m>>>0<=h>>>0|m>>>0>g>>>0){t=0;break}if((0|(A=0|ut(0|t)))==(0|r)){s=t,a=r,b=145;break A}o=A,b=136}else t=0}while(0);do{if(136==(0|b)){if(r=0-t|0,!(l>>>0>t>>>0&t>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){t=0;break}s=t,a=o,b=145;break A}if((A=c-t+(A=0|n[7101])&0-A)>>>0>=2147483647){s=t,a=o,b=145;break A}if(-1==(0|ut(0|A))){ut(0|r),t=0;break}s=A+t|0,a=o,b=145;break A}}while(0);n[7092]=4|n[7092],b=143}}while(0);if(143==(0|b)&&u>>>0<2147483647&&!(-1==(0|(v=0|ut(0|u)))|1^(x=(p=(m=0|ut(0))-v|0)>>>0>(f+40|0)>>>0)|v>>>0>>0&-1!=(0|v)&-1!=(0|m)^1)&&(s=x?p:t,a=v,b=145),145==(0|b)){t=(0|n[7089])+s|0,n[7089]=t,t>>>0>(0|n[7090])>>>0&&(n[7090]=t),c=0|n[6987];A:do{if(c){for(t=28372;;){if((0|a)==((A=0|n[t>>2])+(r=0|n[t+4>>2])|0)){b=154;break}if(!(o=0|n[t+8>>2]))break;t=o}if(!(154!=(0|b)||(w=t+4|0,8&n[t+12>>2]))&&a>>>0>c>>>0&A>>>0<=c>>>0){n[w>>2]=r+s,w=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(y=(0|n[6984])+s|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[c+y+4>>2]=40,n[6988]=n[7103];break}for(a>>>0<(0|n[6985])>>>0&&(n[6985]=a),r=a+s|0,t=28372;;){if((0|n[t>>2])==(0|r)){b=162;break}if(!(A=0|n[t+8>>2]))break;t=A}if(162==(0|b)&&!(8&n[t+12>>2])){n[t>>2]=a,n[(d=t+4|0)>>2]=(0|n[d>>2])+s,u=(d=a+(7&(d=a+8|0)?0-d&7:0)|0)+f|0,l=(t=r+(7&(t=r+8|0)?0-t&7:0)|0)-d-f|0,n[d+4>>2]=3|f;e:do{if((0|c)==(0|t))y=(0|n[6984])+l|0,n[6984]=y,n[6987]=u,n[u+4>>2]=1|y;else{if((0|n[6986])==(0|t)){y=(0|n[6983])+l|0,n[6983]=y,n[6986]=u,n[u+4>>2]=1|y,n[u+y>>2]=y;break}if(1==(3&(A=0|n[t+4>>2]))){s=-8&A,o=A>>>3;t:do{if(A>>>0<256){if(A=0|n[t+8>>2],(0|(r=0|n[t+12>>2]))==(0|A)){n[6981]=n[6981]&~(1<>2]=r,n[r+8>>2]=A;break}a=0|n[t+24>>2],A=0|n[t+12>>2];do{if((0|A)==(0|t)){if(A=0|n[(o=4+(r=t+16|0)|0)>>2])r=o;else if(!(A=0|n[r>>2])){A=0;break}for(;;)if(o=0|n[(i=A+20|0)>>2])A=o,r=i;else{if(!(o=0|n[(i=A+16|0)>>2]))break;A=o,r=i}n[r>>2]=0}else y=0|n[t+8>>2],n[y+12>>2]=A,n[A+8>>2]=y}while(0);if(!a)break;o=28228+((r=0|n[t+28>>2])<<2)|0;do{if((0|n[o>>2])==(0|t)){if(n[o>>2]=A,0|A)break;n[6982]=n[6982]&~(1<>2])==(0|t)?y:a+20)>>2]=A,!A)break t}while(0);if(n[A+24>>2]=a,0|(o=0|n[(r=t+16|0)>>2])&&(n[A+16>>2]=o,n[o+24>>2]=A),!(r=0|n[r+4>>2]))break;n[A+20>>2]=r,n[r+24>>2]=A}while(0);t=t+s|0,i=s+l|0}else i=l;if(n[(t=t+4|0)>>2]=-2&n[t>>2],n[u+4>>2]=1|i,n[u+i>>2]=i,t=i>>>3,i>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=u,n[t+12>>2]=u,n[u+8>>2]=t,n[u+12>>2]=r;break}t=i>>>8;do{if(t){if(i>>>0>16777215){o=31;break}o=i>>>(7+(o=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(o=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|o<<1}else o=0}while(0);if(t=28228+(o<<2)|0,n[u+28>>2]=o,n[4+(A=u+16|0)>>2]=0,n[A>>2]=0,!((A=0|n[6982])&(r=1<>2]=u,n[u+24>>2]=t,n[u+12>>2]=u,n[u+8>>2]=u;break}t=0|n[t>>2];t:do{if((-8&n[t+4>>2])!=(0|i)){for(o=i<<(31==(0|o)?0:25-(o>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|i)){t=A;break t}o<<=1,t=A}n[r>>2]=u,n[u+24>>2]=t,n[u+12>>2]=u,n[u+8>>2]=u;break e}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=u,n[w>>2]=u,n[u+8>>2]=y,n[u+12>>2]=t,n[u+24>>2]=0}}while(0);return P=e,0|d+8}for(t=28372;!((A=0|n[t>>2])>>>0<=c>>>0&&(y=A+(0|n[t+4>>2])|0)>>>0>c>>>0);)t=0|n[t+8>>2];t=(A=(A=(i=y+-47|0)+(7&(A=i+8|0)?0-A&7:0)|0)>>>0<(i=c+16|0)>>>0?c:A)+8|0,w=a+(v=7&(v=a+8|0)?0-v&7:0)|0,v=(r=s+-40|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[a+r+4>>2]=40,n[6988]=n[7103],n[(r=A+4|0)>>2]=27,n[t>>2]=n[7093],n[t+4>>2]=n[7094],n[t+8>>2]=n[7095],n[t+12>>2]=n[7096],n[7093]=a,n[7094]=s,n[7096]=0,n[7095]=t,t=A+24|0;do{w=t,n[(t=t+4|0)>>2]=7}while((w+8|0)>>>0>>0);if((0|A)!=(0|c)){if(a=A-c|0,n[r>>2]=-2&n[r>>2],n[c+4>>2]=1|a,n[A>>2]=a,t=a>>>3,a>>>0<256){r=27964+(t<<1<<2)|0,(A=0|n[6981])&(t=1<>2]:(n[6981]=A|t,t=r,A=r+8|0),n[A>>2]=c,n[t+12>>2]=c,n[c+8>>2]=t,n[c+12>>2]=r;break}if(r=28228+((o=(t=a>>>8)?a>>>0>16777215?31:a>>>(7+(o=14-((v=(520192+(y=t<<(w=(t+1048320|0)>>>16&8))|0)>>>16&4)|w|(o=(245760+(y<<=v)|0)>>>16&2))+(y<>>15)|0)|0)&1|o<<1:0)<<2)|0,n[c+28>>2]=o,n[c+20>>2]=0,n[i>>2]=0,!((t=0|n[6982])&(A=1<>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break}t=0|n[r>>2];e:do{if((-8&n[t+4>>2])!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);A=0|n[(r=t+16+(o>>>31<<2)|0)>>2];){if((-8&n[A+4>>2])==(0|a)){t=A;break e}o<<=1,t=A}n[r>>2]=c,n[c+24>>2]=t,n[c+12>>2]=c,n[c+8>>2]=c;break A}}while(0);y=0|n[(w=t+8|0)>>2],n[y+12>>2]=c,n[w>>2]=c,n[c+8>>2]=y,n[c+12>>2]=t,n[c+24>>2]=0}}else!(0|(y=0|n[6985]))|a>>>0>>0&&(n[6985]=a),n[7093]=a,n[7094]=s,n[7096]=0,n[6990]=n[7099],n[6989]=-1,n[6994]=27964,n[6993]=27964,n[6996]=27972,n[6995]=27972,n[6998]=27980,n[6997]=27980,n[7e3]=27988,n[6999]=27988,n[7002]=27996,n[7001]=27996,n[7004]=28004,n[7003]=28004,n[7006]=28012,n[7005]=28012,n[7008]=28020,n[7007]=28020,n[7010]=28028,n[7009]=28028,n[7012]=28036,n[7011]=28036,n[7014]=28044,n[7013]=28044,n[7016]=28052,n[7015]=28052,n[7018]=28060,n[7017]=28060,n[7020]=28068,n[7019]=28068,n[7022]=28076,n[7021]=28076,n[7024]=28084,n[7023]=28084,n[7026]=28092,n[7025]=28092,n[7028]=28100,n[7027]=28100,n[7030]=28108,n[7029]=28108,n[7032]=28116,n[7031]=28116,n[7034]=28124,n[7033]=28124,n[7036]=28132,n[7035]=28132,n[7038]=28140,n[7037]=28140,n[7040]=28148,n[7039]=28148,n[7042]=28156,n[7041]=28156,n[7044]=28164,n[7043]=28164,n[7046]=28172,n[7045]=28172,n[7048]=28180,n[7047]=28180,n[7050]=28188,n[7049]=28188,n[7052]=28196,n[7051]=28196,n[7054]=28204,n[7053]=28204,n[7056]=28212,n[7055]=28212,w=a+(v=7&(v=a+8|0)?0-v&7:0)|0,v=(y=s+-40|0)-v|0,n[6987]=w,n[6984]=v,n[w+4>>2]=1|v,n[a+y+4>>2]=40,n[6988]=n[7103]}while(0);if((t=0|n[6984])>>>0>f>>>0)return v=t-f|0,n[6984]=v,w=(y=0|n[6987])+f|0,n[6987]=w,n[w+4>>2]=1|v,n[y+4>>2]=3|f,P=e,0|y+8}return n[(y=27920)>>2]=12,P=e,0}function Ye(A){var e=0,t=0,r=0,o=0,i=0,a=0,s=0,l=0;if(A|=0){t=A+-8|0,o=0|n[6985],l=t+(e=-8&(A=0|n[A+-4>>2]))|0;do{if(1&A)s=t,a=t;else{if(r=0|n[t>>2],!(3&A))return;if(i=r+e|0,(a=t+(0-r)|0)>>>0>>0)return;if((0|n[6986])==(0|a)){if(3&~(e=0|n[(A=l+4|0)>>2])){s=a,e=i;break}return n[6983]=i,n[A>>2]=-2&e,n[a+4>>2]=1|i,void(n[a+i>>2]=i)}if(t=r>>>3,r>>>0<256){if(A=0|n[a+8>>2],(0|(e=0|n[a+12>>2]))==(0|A)){n[6981]=n[6981]&~(1<>2]=e,n[e+8>>2]=A,s=a,e=i;break}o=0|n[a+24>>2],A=0|n[a+12>>2];do{if((0|A)==(0|a)){if(A=0|n[(t=4+(e=a+16|0)|0)>>2])e=t;else if(!(A=0|n[e>>2])){A=0;break}for(;;)if(t=0|n[(r=A+20|0)>>2])A=t,e=r;else{if(!(t=0|n[(r=A+16|0)>>2]))break;A=t,e=r}n[e>>2]=0}else s=0|n[a+8>>2],n[s+12>>2]=A,n[A+8>>2]=s}while(0);if(o){if(e=0|n[a+28>>2],(0|n[(t=28228+(e<<2)|0)>>2])==(0|a)){if(n[t>>2]=A,!A){n[6982]=n[6982]&~(1<>2])==(0|a)?s:o+20)>>2]=A,!A){s=a,e=i;break}n[A+24>>2]=o,0|(t=0|n[(e=a+16|0)>>2])&&(n[A+16>>2]=t,n[t+24>>2]=A),(e=0|n[e+4>>2])?(n[A+20>>2]=e,n[e+24>>2]=A,s=a,e=i):(s=a,e=i)}else s=a,e=i}}while(0);if(!(a>>>0>=l>>>0)&&1&(r=0|n[(A=l+4|0)>>2])){if(2&r)n[A>>2]=-2&r,n[s+4>>2]=1|e,n[a+e>>2]=e,o=e;else{if((0|n[6987])==(0|l)){if(l=(0|n[6984])+e|0,n[6984]=l,n[6987]=s,n[s+4>>2]=1|l,(0|s)!=(0|n[6986]))return;return n[6986]=0,void(n[6983]=0)}if((0|n[6986])==(0|l))return l=(0|n[6983])+e|0,n[6983]=l,n[6986]=a,n[s+4>>2]=1|l,void(n[a+l>>2]=l);o=(-8&r)+e|0,t=r>>>3;do{if(r>>>0<256){if(e=0|n[l+8>>2],(0|(A=0|n[l+12>>2]))==(0|e)){n[6981]=n[6981]&~(1<>2]=A,n[A+8>>2]=e;break}i=0|n[l+24>>2],A=0|n[l+12>>2];do{if((0|A)==(0|l)){if(A=0|n[(t=4+(e=l+16|0)|0)>>2])e=t;else if(!(A=0|n[e>>2])){t=0;break}for(;;)if(t=0|n[(r=A+20|0)>>2])A=t,e=r;else{if(!(t=0|n[(r=A+16|0)>>2]))break;A=t,e=r}n[e>>2]=0,t=A}else t=0|n[l+8>>2],n[t+12>>2]=A,n[A+8>>2]=t,t=A}while(0);if(0|i){if(A=0|n[l+28>>2],(0|n[(e=28228+(A<<2)|0)>>2])==(0|l)){if(n[e>>2]=t,!t){n[6982]=n[6982]&~(1<>2])==(0|l)?r:i+20)>>2]=t,!t)break;n[t+24>>2]=i,0|(e=0|n[(A=l+16|0)>>2])&&(n[t+16>>2]=e,n[e+24>>2]=t),0|(A=0|n[A+4>>2])&&(n[t+20>>2]=A,n[A+24>>2]=t)}}while(0);if(n[s+4>>2]=1|o,n[a+o>>2]=o,(0|s)==(0|n[6986]))return void(n[6983]=o)}if(A=o>>>3,o>>>0<256)return t=27964+(A<<1<<2)|0,(e=0|n[6981])&(A=1<>2]:(n[6981]=e|A,A=t,e=t+8|0),n[e>>2]=s,n[A+12>>2]=s,n[s+8>>2]=A,void(n[s+12>>2]=t);A=28228+((r=(A=o>>>8)?o>>>0>16777215?31:o>>>(7+(r=14-((i=(520192+(l=A<<(a=(A+1048320|0)>>>16&8))|0)>>>16&4)|a|(r=(245760+(l<<=i)|0)>>>16&2))+(l<>>15)|0)|0)&1|r<<1:0)<<2)|0,n[s+28>>2]=r,n[s+20>>2]=0,n[s+16>>2]=0,e=0|n[6982],t=1<>2];e:do{if((-8&n[A+4>>2])!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);e=0|n[(t=A+16+(r>>>31<<2)|0)>>2];){if((-8&n[e+4>>2])==(0|o)){A=e;break e}r<<=1,A=e}n[t>>2]=s,n[s+24>>2]=A,n[s+12>>2]=s,n[s+8>>2]=s;break A}}while(0);l=0|n[(a=A+8|0)>>2],n[l+12>>2]=s,n[a>>2]=s,n[s+8>>2]=l,n[s+12>>2]=A,n[s+24>>2]=0}else n[6982]=e|t,n[A>>2]=s,n[s+24>>2]=A,n[s+12>>2]=s,n[s+8>>2]=s}while(0);if(l=(0|n[6989])-1|0,n[6989]=l,!(0|l)){for(A=28380;A=0|n[A>>2];)A=A+8|0;n[6989]=-1}}}}function We(A,e){e|=0;var t=0;return(A|=0)?(t=0|v(e,A),(e|A)>>>0>65535&&(t=((t>>>0)/(A>>>0)|0)==(0|e)?t:-1)):t=0,(A=0|Ue(t))&&3&n[A+-4>>2]?(lt(0|A,0,0|t),0|A):0|A}function Ze(A,e,t,r){return 0|(C((e|=0)+(r|=0)+((t=(A|=0)+(t|=0)>>>0)>>>0>>0|0)>>>0|0),t)}function Ve(A,e,t,r){return 0|(C(0|(r=(e|=0)-(r|=0)-((t|=0)>>>0>(A|=0)>>>0|0)>>>0)),A-t>>>0)}function Ke(A){return 0|((A|=0)?31-(0|k(A^A-1)):32)}function Je(A,e,t,r,o){o|=0;var i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0;if(u=A|=0,a=t|=0,s=f=r|=0,!(c=l=e|=0))return i=!!(0|o),s?i?(n[o>>2]=0|A,n[o+4>>2]=0&e,o=0,0|(C(0|(f=0)),o)):(o=0,0|(C(0|(f=0)),o)):(i&&(n[o>>2]=(u>>>0)%(a>>>0),n[o+4>>2]=0),o=(u>>>0)/(a>>>0)>>>0,0|(C(0|(f=0)),o));i=!(0|s);do{if(a){if(!i){if((i=(0|k(0|s))-(0|k(0|c))|0)>>>0<=31){a=d=i+1|0,A=u>>>(d>>>0)&(e=i-31>>31)|c<<(s=31-i|0),e&=c>>>(d>>>0),i=0,s=u<>2]=0|A,n[o+4>>2]=l|0&e,o=0,0|(C(0|(f=0)),o)):(o=0,0|(C(0|(f=0)),o))}if((i=a-1|0)&a){a=s=33+(0|k(0|a))-(0|k(0|c))|0,A=(d=32-s|0)-1>>31&c>>>((g=s-32|0)>>>0)|(c<>>(s>>>0))&(e=g>>31),e&=c>>>(s>>>0),i=u<<(h=64-s|0)&(l=d>>31),s=(c<>>(g>>>0))&l|u<>31;break}return 0|o&&(n[o>>2]=i&u,n[o+4>>2]=0),1==(0|a)?(h=0|A,0|(C(0|(g=l|0&e)),h)):(g=c>>>((h=0|Ke(0|a))>>>0)|0,h=c<<32-h|u>>>(h>>>0),0|(C(0|g),h))}if(i)return 0|o&&(n[o>>2]=(c>>>0)%(a>>>0),n[o+4>>2]=0),h=(c>>>0)/(a>>>0)>>>0,0|(C(0|(g=0)),h);if(!u)return 0|o&&(n[o>>2]=0,n[o+4>>2]=(c>>>0)%(s>>>0)),h=(c>>>0)/(s>>>0)>>>0,0|(C(0|(g=0)),h);if(!((i=s-1|0)&s))return 0|o&&(n[o>>2]=0|A,n[o+4>>2]=i&c|0&e),g=0,h=c>>>((0|Ke(0|s))>>>0),0|(C(0|g),h);if((i=(0|k(0|s))-(0|k(0|c))|0)>>>0<=30){a=e=i+1|0,A=c<<(s=31-i|0)|u>>>(e>>>0),e=c>>>(e>>>0),i=0,s=u<>2]=0|A,n[o+4>>2]=l|0&e,h=0,0|(C(0|(g=0)),h)):(h=0,0|(C(0|(g=0)),h))}while(0);if(a){c=0|Ze(0|(d=0|t),0|(u=f|0&r),-1,-1),t=0|B(),l=s,s=0;do{r=l,l=i>>>31|l<<1,i=s|i<<1,Ve(0|c,0|t,0|(r=A<<1|r>>>31),0|(f=A>>>31|e<<1)),s=1&(g=(h=0|B())>>31|((0|h)<0?-1:0)<<1),A=0|Ve(0|r,0|f,g&d|0,(((0|h)<0?-1:0)>>31|((0|h)<0?-1:0)<<1)&u),e=0|B(),a=a-1|0}while(0|a);c=l,l=0}else c=s,l=0,s=0;return a=0,0|o&&(n[o>>2]=A,n[o+4>>2]=e),h=i<<1&-2|s,0|(C(0|(g=(0|i)>>>31|(c|a)<<1|l)),h)}function Xe(A,e,t,r){var n,o,i,a,s;return t|=0,o=(r|=0)>>31|((0|r)<0?-1:0)<<1,n=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,i=0|Ve((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0),(a=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|a),A=o^s,e=n^a,0|Ve((0|Je(i,0|B(),0|Ve(o^t|0,n^r|0,0|o,0|n),0|B(),0))^A,(0|B())^e,0|A,0|e)}function qe(A,e,t,r){var n,o;return e|=0,r|=0,t=0|function(A,e){var t,r,n,o=0;return A=((t=0|v(o=65535&(e|=0),n=65535&(A|=0)))>>>16)+(0|v(o,r=A>>>16))|0,e=0|v(o=e>>>16,n),0|(C((A>>>16)+(0|v(o,r))+(((65535&A)+e|0)>>>16)|0),A+e<<16|65535&t)}(n=A|=0,o=t|=0),A=0|B(),0|(C((0|v(e,o))+(0|v(r,n))+A|0&A),t)}function $e(A,e,t,r){var o,i,a,s,l,c;return t|=0,o=P,P=P+16|0,s=0|o,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Je(A=0|Ve((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0),(i=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|i),e=0|B(),0|Ve(c^t|0,l^r|0,0|c,0|l),0|B(),s),r=0|Ve(n[s>>2]^a|0,n[s+4>>2]^i|0,0|a,0|i),t=0|B(),P=o,0|(C(0|t),r)}function At(A,e,t,r){var o,i;return i=P,P=P+16|0,Je(A|=0,e|=0,t|=0,r|=0,o=0|i),P=i,0|(C(0|n[o+4>>2]),n[o>>2])}function et(A,e,t){return A|=0,e|=0,(0|(t|=0))<32?(C(e>>t|0),A>>>t|(e&(1<>t-32)}function tt(A,e,t){return A|=0,e|=0,(0|(t|=0))<32?(C(e>>>t|0),A>>>t|(e&(1<>>t-32|0)}function rt(A,e,t){return A|=0,(0|(t|=0))<32?(C((e|=0)<>>32-t),A<=0?+s(A+.5):+x(A-.5)}function st(A,e,t){A|=0,e|=0;var o,i,a=0;if((0|(t|=0))>=8192)return N(0|A,0|e,0|t),0|A;if(i=0|A,o=A+t|0,(3&A)==(3&e)){for(;3&A;){if(!t)return 0|i;r[0|A]=0|r[0|e],A=A+1|0,e=e+1|0,t=t-1|0}for(a=(t=-4&o)-64|0;(0|A)<=(0|a);)n[A>>2]=n[e>>2],n[A+4>>2]=n[e+4>>2],n[A+8>>2]=n[e+8>>2],n[A+12>>2]=n[e+12>>2],n[A+16>>2]=n[e+16>>2],n[A+20>>2]=n[e+20>>2],n[A+24>>2]=n[e+24>>2],n[A+28>>2]=n[e+28>>2],n[A+32>>2]=n[e+32>>2],n[A+36>>2]=n[e+36>>2],n[A+40>>2]=n[e+40>>2],n[A+44>>2]=n[e+44>>2],n[A+48>>2]=n[e+48>>2],n[A+52>>2]=n[e+52>>2],n[A+56>>2]=n[e+56>>2],n[A+60>>2]=n[e+60>>2],A=A+64|0,e=e+64|0;for(;(0|A)<(0|t);)n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}else for(t=o-4|0;(0|A)<(0|t);)r[0|A]=0|r[0|e],r[A+1|0]=0|r[e+1|0],r[A+2|0]=0|r[e+2|0],r[A+3|0]=0|r[e+3|0],A=A+4|0,e=e+4|0;for(;(0|A)<(0|o);)r[0|A]=0|r[0|e],A=A+1|0,e=e+1|0;return 0|i}function lt(A,e,t){e|=0;var o,i=0,a=0,s=0;if(o=(A|=0)+(t|=0)|0,e&=255,(0|t)>=67){for(;3&A;)r[0|A]=e,A=A+1|0;for(s=e|e<<8|e<<16|e<<24,a=(i=-4&o)-64|0;(0|A)<=(0|a);)n[A>>2]=s,n[A+4>>2]=s,n[A+8>>2]=s,n[A+12>>2]=s,n[A+16>>2]=s,n[A+20>>2]=s,n[A+24>>2]=s,n[A+28>>2]=s,n[A+32>>2]=s,n[A+36>>2]=s,n[A+40>>2]=s,n[A+44>>2]=s,n[A+48>>2]=s,n[A+52>>2]=s,n[A+56>>2]=s,n[A+60>>2]=s,A=A+64|0;for(;(0|A)<(0|i);)n[A>>2]=s,A=A+4|0}for(;(0|A)<(0|o);)r[0|A]=e,A=A+1|0;return o-t|0}function ct(A){return(A=+A)>=0?+s(A+.5):+x(A-.5)}function ut(A){var e,t,r;return A|=0,r=0|E(),(0|A)>0&(0|(e=(t=0|n[a>>2])+A|0))<(0|t)|(0|e)<0?(j(0|e),D(12),-1):(0|e)>(0|r)&&!(0|Q(0|e))?(D(12),-1):(n[a>>2]=e,0|t)}return{___divdi3:Xe,___muldi3:qe,___remdi3:$e,___uremdi3:At,_areNeighborCells:function(A,e,t,r,o){o|=0;var i,a,s,l=0,c=0,u=0,d=0;if(s=P,P=P+64|0,a=s,i=s+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return P=s,5;if((0|(A|=0))==(0|(t|=0))&(0|e)==(0|r))return n[o>>2]=0,P=s,0;if(c=0|tt(0|A,0|e,52),B(),c&=15,d=0|tt(0|t,0|r,52),B(),(0|c)!=(15&d))return P=s,12;if(l=c+-1|0,c>>>0>1){TA(A,e,l,a),TA(t,r,l,i),u=0|n[(d=a)>>2],d=0|n[d+4>>2];A:do{if((0|u)==(0|n[i>>2])&&(0|d)==(0|n[i+4>>2])){l=0|tt(0|A,0|e,0|(c=3*(15^c)|0)),B(),l&=7,c=0|tt(0|t,0|r,0|c),B(),c&=7;do{if(!(0|l)|!(0|c))n[o>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|c)&&0|HA(u,d)){l=5;break}if((0|n[15536+(l<<2)>>2])!=(0|c)&&(0|n[15568+(l<<2)>>2])!=(0|c))break A;n[o>>2]=1,l=0}}while(0);return P=s,0|l}}while(0)}c=(l=a)+56|0;do{n[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return F(A,e,1,a),l=(0|n[(e=a)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+8|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+16|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+24|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+32|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)||(0|n[(e=a+40|0)>>2])==(0|t)&&(0|n[e+4>>2])==(0|r)?1:1&((0|n[(l=a+48|0)>>2])==(0|t)?(0|n[l+4>>2])==(0|r):0),n[o>>2]=l,P=s,0},_bitshift64Ashr:et,_bitshift64Lshr:tt,_bitshift64Shl:rt,_calloc:We,_cellAreaKm2:function(A,e,t){return 0|(A=0|ue(A|=0,e|=0,t|=0))||(o[t>>3]=6371.007180918475*+o[t>>3]*6371.007180918475),0|A},_cellAreaM2:function(A,e,t){return 0|(A=0|ue(A|=0,e|=0,t|=0))||(o[t>>3]=6371.007180918475*+o[t>>3]*6371.007180918475*1e3*1e3),0|A},_cellAreaRads2:ue,_cellToBoundary:$A,_cellToCenterChild:GA,_cellToChildPos:function(A,e,t,r){t|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0;if(o=P,P=P+16|0,p=o,x=0|tt(0|(A|=0),0|(e|=0),52),B(),t>>>0>15)return P=o,4;if((0|(x&=15))<(0|t))return P=o,12;if((0|x)!=(0|t))if(a=0|rt(0|t,0,52),a|=A,l=B()|-15728641&e,(0|x)>(0|t)){c=t;do{b=0|rt(7,0,3*(14-c|0)|0),c=c+1|0,a|=b,l=0|B()|l}while((0|c)<(0|x));b=a}else b=a;else b=A,l=e;m=0|tt(0|b,0|l,45),B();A:do{if(0|z(127&m)){if(c=0|tt(0|b,0|l,52),B(),0|(c&=15))for(a=1;;){if(!(!((m=0|rt(7,0,3*(15-a|0)|0))&b)&!((0|B())&l))){u=33;break A}if(!(a>>>0>>0))break;a=a+1|0}if(n[(m=r)>>2]=0,n[m+4>>2]=0,(0|x)>(0|t)){for(m=-15728641&e,h=x;;){if(g=h,(h=h+-1|0)>>>0>15|(0|x)<(0|h)){u=19;break}if((0|x)!=(0|h))if(a=0|rt(0|h,0,52),a|=A,c=0|B()|m,(0|x)<(0|g))f=a;else{u=h;do{f=0|rt(7,0,3*(14-u|0)|0),u=u+1|0,a|=f,c=0|B()|c}while((0|u)<(0|x));f=a}else f=A,c=e;if(d=0|tt(0|f,0|c,45),B(),0|z(127&d)){d=0|tt(0|f,0|c,52),B(),d&=15;e:do{if(d)for(u=1;;){if(a=0|tt(0|f,0|c,3*(15-u|0)|0),B(),0|(a&=7))break e;if(!(u>>>0>>0)){a=0;break}u=u+1|0}else a=0}while(0);a=1&!(0|a)}else a=0;if(c=0|tt(0|A,0|e,3*(15-g|0)|0),B(),7==(0|(c&=7))){i=5,u=42;break}if(1==(0|c)&(a=!!(0|a))){i=5,u=42;break}if(0|(f=c+((!!(0|c)&a)<<31>>31)|0)&&(u=0|pe(7,0,u=x-g|0,((0|u)<0)<<31>>31),d=0|B(),a?(a=0|Ze(0|(a=0|qe(0|u,0|d,5,0)),0|B(),-5,-1),a=0|Ze(0|(a=0|Xe(0|a,0|B(),6,0)),0|B(),1,0),c=0|B()):(a=u,c=d),g=0|Ze(0|a,0|c,0|(g=0|qe(0|u,0|d,0|(g=f+-1|0),((0|g)<0)<<31>>31)),0|B()),d=0|Ze(0|g,0|(f=0|B()),0|n[(d=r)>>2],0|n[d+4>>2]),f=0|B(),n[(g=r)>>2]=d,n[g+4>>2]=f),(0|h)<=(0|t)){u=37;break}}if(19==(0|u))M(27795,27122,1367,27158);else{if(37==(0|u)){i=0|n[(s=r)+4>>2],s=0|n[s>>2];break}if(42==(0|u))return P=o,0|i}}else i=0,s=0}else u=33}while(0);A:do{if(33==(0|u)){if(n[(m=r)>>2]=0,n[m+4>>2]=0,(0|x)>(0|t)){for(a=x;;){if(i=0|tt(0|A,0|e,3*(15-a|0)|0),B(),7==(0|(i&=7))){i=5;break}if(i=0|qe(0|(s=0|pe(7,0,s=x-a|0,((0|s)<0)<<31>>31)),0|B(),0|i,0),s=0|B(),s=0|Ze(0|n[(m=r)>>2],0|n[m+4>>2],0|i,0|s),i=0|B(),n[(m=r)>>2]=s,n[m+4>>2]=i,(0|(a=a+-1|0))<=(0|t))break A}return P=o,0|i}i=0,s=0}}while(0);return 0|_A(b,l,x,p)&&M(27795,27122,1327,27173),((0|i)>-1|-1==(0|i)&s>>>0>4294967295)&((0|(p=0|n[(x=p)+4>>2]))>(0|i)|((0|p)==(0|i)?(0|n[x>>2])>>>0>s>>>0:0))?(P=o,0|(x=0)):(M(27795,27122,1407,27158),0)},_cellToChildren:function(A,e,t,r){r|=0;var o,i,a=0,s=0;if(i=P,P=P+16|0,ee(o=i,A|=0,e|=0,t|=0),!(0|(A=0|n[(e=o)>>2]))&!(0|(e=0|n[e+4>>2])))return P=i,0;a=0,t=0;do{n[(s=r+(a<<3)|0)>>2]=A,n[s+4>>2]=e,a=0|Ze(0|a,0|t,1,0),t=0|B(),re(o),A=0|n[(s=o)>>2],e=0|n[s+4>>2]}while(!(!(0|A)&!(0|e)));return P=i,0},_cellToChildrenSize:_A,_cellToLatLng:qA,_cellToLocalIj:function(A,e,t,r,o,i){var a,s;return A|=0,i|=0,s=P,P=P+16|0,a=s,(o|=0)?A=15:(A=0|me(A,e|=0,t|=0,r|=0,a))||(function(A,e){var t;e|=0,t=0|n[8+(A|=0)>>2],n[e>>2]=(0|n[A>>2])-t,n[e+4>>2]=(0|n[A+4>>2])-t}(a,i),A=0),P=s,0|A},_cellToParent:TA,_cellToVertex:Se,_cellToVertexes:function(A,e,t){t|=0;var r,o=0,i=0;return i=!(0|HA(A|=0,e|=0)),r=!(0|(o=0|Se(A,e,0,t))),i?r?0|(o=0|Se(A,e,1,t+8|0))||0|(o=0|Se(A,e,2,t+16|0))||0|(o=0|Se(A,e,3,t+24|0))||(o=0|Se(A,e,4,t+32|0))?0|(i=o):0|Se(A,e,5,t+40|0):0|(i=o):r?0|(o=0|Se(A,e,1,t+8|0))||0|(o=0|Se(A,e,2,t+16|0))||0|(o=0|Se(A,e,3,t+24|0))||0|(o=0|Se(A,e,4,t+32|0))?0|(i=o):(n[(i=t+40|0)>>2]=0,n[i+4>>2]=0,0|(i=0)):0|(i=o)},_cellsToDirectedEdge:function(A,e,t,r,o){return o|=0,7==(0|(t=0|_(A|=0,e|=0,t|=0,r|=0)))?0|(o=11):(r=0|rt(0|t,0,56),e=-2130706433&e|B()|268435456,n[o>>2]=A|r,n[o+4>>2]=e,0|(o=0))},_cellsToLinkedMultiPolygon:function(A,e,t){t|=0;var r,i,a,s=0;if(a=P,P=P+32|0,r=a,0|(A=0|function(A,e,t){A|=0,t|=0;var r,o,i=0,a=0,s=0,l=0,c=0,u=0;if(o=P,P=P+176|0,r=o,(0|(e|=0))<1)return Ie(t,0,0),P=o,0;for(c=0|tt(0|n[(c=A)>>2],0|n[c+4>>2],52),B(),Ie(t,(0|e)>6?e:6,15&c),c=0;!(0|(i=0|$A(0|n[(i=A+(c<<3)|0)>>2],0|n[i+4>>2],r)));){if((0|(i=0|n[r>>2]))>0){l=0;do{s=r+8+(l<<4)|0,(a=0|ze(t,i=r+8+((0|(l=l+1|0))%(0|i)<<4)|0,s))?_e(t,a):He(t,s,i),i=0|n[r>>2]}while((0|l)<(0|i))}if((0|(c=c+1|0))>=(0|e)){i=0,u=13;break}}return 13==(0|u)?(P=o,0|i):(Re(t),P=o,0|(u=i))}(A|=0,e|=0,i=a+16|0)))return P=a,0|A;if(n[t>>2]=0,n[t+4>>2]=0,n[t+8>>2]=0,0|(A=0|Te(i)))do{e=0|de(t);do{fe(e,A),s=A+16|0,n[r>>2]=n[s>>2],n[r+4>>2]=n[s+4>>2],n[r+8>>2]=n[s+8>>2],n[r+12>>2]=n[s+12>>2],_e(i,A),A=0|Ge(i,r)}while(0|A);A=0|Te(i)}while(0|A);return Re(i),(A=0|function(A){var e,t,r=0,i=0,a=0,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,B=0,D=0,E=0,N=0,Q=0,j=0,P=0,F=0,S=0,L=0,I=0;if(0|n[(s=(A|=0)+8|0)>>2])return 1;if(!(a=0|n[A>>2]))return 0;r=a,i=0;do{i=i+1|0,r=0|n[r+8>>2]}while(0|r);if(i>>>0<2)return 0;(t=0|Ue(i<<2))||M(27396,27235,317,27415),(e=0|Ue(i<<5))||M(27437,27235,321,27415),n[A>>2]=0,n[(E=A+4|0)>>2]=0,n[s>>2]=0,i=0,S=0,D=0,m=0;A:for(;;){if(h=0|n[a>>2]){c=0,u=h;do{if(f=+o[u+8>>3],r=u,u=0|n[u+16>>2],d=+o[(s=(g=!(0|u))?h:u)+8>>3],+l(+(f-d))>3.141592653589793){I=14;break}c+=(d-f)*(+o[r>>3]+ +o[s>>3])}while(!g);if(14==(0|I)){I=0,c=0,r=h;do{B=+o[r+8>>3],P=0|n[(F=r+16|0)>>2],C=+o[(P=0|P?P:h)+8>>3],c+=(+o[r>>3]+ +o[P>>3])*((C<0?C+6.283185307179586:C)-(B<0?B+6.283185307179586:B)),r=0|n[(0|r?F:a)>>2]}while(0|r)}c>0?(n[t+(S<<2)>>2]=a,S=S+1|0,s=D,r=m):I=19}else I=19;if(19==(0|I)){I=0;do{if(!i){if(m){s=E,u=m+8|0,r=a,i=A;break}if(0|n[A>>2]){I=27;break A}s=E,u=A,r=a,i=A;break}if(0|n[(r=i+8|0)>>2]){I=21;break A}if(!(i=0|We(1,12))){I=23;break A}n[r>>2]=i,s=i+4|0,u=i,r=m}while(0);if(n[u>>2]=a,n[s>>2]=a,u=e+(D<<5)|0,g=0|n[a>>2]){for(o[(h=e+(D<<5)+8|0)>>3]=17976931348623157e292,o[(m=e+(D<<5)+24|0)>>3]=17976931348623157e292,o[u>>3]=-17976931348623157e292,o[(b=e+(D<<5)+16|0)>>3]=-17976931348623157e292,y=17976931348623157e292,k=-17976931348623157e292,s=0,p=g,f=17976931348623157e292,v=17976931348623157e292,w=-17976931348623157e292,d=-17976931348623157e292;c=+o[p>>3],B=+o[p+8>>3],p=0|n[p+16>>2],C=+o[((x=!(0|p))?g:p)+8>>3],c>3]=c,f=c),B>3]=B,v=B),c>w?o[u>>3]=c:c=w,B>d&&(o[b>>3]=B,d=B),y=B>0&Bk?B:k,s|=+l(+(B-C))>3.141592653589793,!x;)w=c;s&&(o[b>>3]=k,o[m>>3]=y)}else n[u>>2]=0,n[u+4>>2]=0,n[u+8>>2]=0,n[u+12>>2]=0,n[u+16>>2]=0,n[u+20>>2]=0,n[u+24>>2]=0,n[u+28>>2]=0;s=D+1|0}if(a=0|n[(F=a+8|0)>>2],n[F>>2]=0,!a){I=45;break}D=s,m=r}if(21==(0|I))M(27213,27235,35,27247);else if(23==(0|I))M(27267,27235,37,27247);else if(27==(0|I))M(27310,27235,61,27333);else if(45==(0|I)){A:do{if((0|S)>0){for(F=!(0|s),j=s<<2,P=!(0|A),Q=0,r=0;;){if(N=0|n[t+(Q<<2)>>2],F)I=73;else{if(!(D=0|Ue(j))){I=50;break}if(!(E=0|Ue(j))){I=52;break}e:do{if(P)i=0;else{for(s=0,i=0,u=A;a=e+(s<<5)|0,0|he(0|n[u>>2],a,0|n[N>>2])?(n[D+(i<<2)>>2]=u,n[E+(i<<2)>>2]=a,x=i+1|0):x=i,u=0|n[u+8>>2];)s=s+1|0,i=x;if((0|x)>0)if(a=0|n[D>>2],1==(0|x))i=a;else for(b=0,p=-1,i=a,m=a;;){for(g=0|n[m>>2],a=0,u=0;h=(0|(s=0|n[n[D+(u<<2)>>2]>>2]))==(0|g)?a:a+(1&he(s,0|n[E+(u<<2)>>2],0|n[g>>2]))|0,(0|(u=u+1|0))!=(0|x);)a=h;if(i=(s=(0|h)>(0|p))?m:i,(0|(a=b+1|0))==(0|x))break e;b=a,p=s?h:p,m=0|n[D+(a<<2)>>2]}else i=0}}while(0);if(Ye(D),Ye(E),i){if(a=0|n[(s=i+4|0)>>2])i=a+8|0;else if(0|n[i>>2]){I=70;break}n[i>>2]=N,n[s>>2]=N}else I=73}if(73==(0|I)){if(I=0,0|(r=0|n[N>>2]))do{E=r,r=0|n[r+16>>2],Ye(E)}while(0|r);Ye(N),r=1}if((0|(Q=Q+1|0))>=(0|S)){L=r;break A}}50==(0|I)?M(27452,27235,249,27471):52==(0|I)?M(27490,27235,252,27471):70==(0|I)&&M(27310,27235,61,27333)}else L=0}while(0);return Ye(t),Ye(e),0|L}return 0}(t))?(ge(t),P=a,0|(s=A)):(P=a,0|(s=0))},_childPosToCell:function(A,e,t,r,o,i){A|=0,e|=0,i|=0;var a,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(a=P,P=P+16|0,s=a,(o|=0)>>>0>15)return P=a,4;if(l=0|tt(0|(t|=0),0|(r|=0),52),B(),(0|(l&=15))>(0|o))return P=a,12;if(0|_A(t,r,o,s)&&M(27795,27122,1327,27173),!(((0|e)>-1|-1==(0|e)&A>>>0>4294967295)&((0|(u=0|n[(d=s)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|n[d>>2])>>>0>A>>>0:0))))return P=a,2;d=o-l|0,o=0|rt(0|o,0,52),c=B()|-15728641&r,n[(u=i)>>2]=o|t,n[u+4>>2]=c,u=0|tt(0|t,0|r,45),B();A:do{if(0|z(127&u)){if(0|l)for(s=1;;){if(!(!((u=0|rt(7,0,3*(15-s|0)|0))&t)&!((0|B())&r)))break A;if(!(s>>>0>>0))break;s=s+1|0}if((0|d)<1)return P=a,0;for(u=15^l,r=-1,c=1,s=1;;){l=0|pe(7,0,l=d-c|0,((0|l)<0)<<31>>31),t=0|B();do{if(s){if(s=0|Xe(0|(s=0|Ze(0|(s=0|qe(0|l,0|t,5,0)),0|B(),-5,-1)),0|B(),6,0),(0|e)>(0|(o=0|B()))|(0|e)==(0|o)&A>>>0>s>>>0){e=0|Ve(0|(e=0|Ze(0|A,0|e,-1,-1)),0|B(),0|s,0|o),s=0|B(),h=0|n[(f=i)>>2],f=0|n[f+4>>2],g=0|rt(7,0,0|(m=3*(u+r|0)|0)),f&=~B(),m=0|rt(0|(o=0|Ze(0|(r=0|Xe(0|e,0|s,0|l,0|t)),0|(A=0|B()),2,0)),0|B(),0|m),f=0|B()|f,n[(o=i)>>2]=m|h&~g,n[o+4>>2]=f,A=0|Ve(0|e,0|s,0|(A=0|qe(0|r,0|A,0|l,0|t)),0|B()),s=0,e=0|B();break}g=0|n[(m=i)>>2],m=0|n[m+4>>2],h=0|rt(7,0,3*(u+r|0)|0),m&=~B(),n[(s=i)>>2]=g&~h,n[s+4>>2]=m,s=1;break}o=0|n[(g=i)>>2],g=0|n[g+4>>2],f=0|rt(7,0,0|(r=3*(u+r|0)|0)),g&=~B(),r=0|rt(0|(m=0|Xe(0|A,0|e,0|l,0|t)),0|(s=0|B()),0|r),g=0|B()|g,n[(h=i)>>2]=r|o&~f,n[h+4>>2]=g,A=0|Ve(0|A,0|e,0|(s=0|qe(0|m,0|s,0|l,0|t)),0|B()),s=0,e=0|B()}while(0);if(!((0|d)>(0|c))){e=0;break}r=~c,c=c+1|0}return P=a,0|e}}while(0);if((0|d)<1)return P=a,0;for(o=15^l,s=1;;){if(h=0|pe(7,0,h=d-s|0,((0|h)<0)<<31>>31),m=0|B(),t=0|n[(c=i)>>2],c=0|n[c+4>>2],r=0|rt(7,0,0|(l=3*(o-s|0)|0)),c&=~B(),l=0|rt(0|(f=0|Xe(0|A,0|e,0|h,0|m)),0|(g=0|B()),0|l),c=0|B()|c,n[(u=i)>>2]=l|t&~r,n[u+4>>2]=c,A=0|Ve(0|A,0|e,0|(m=0|qe(0|f,0|g,0|h,0|m)),0|B()),e=0|B(),(0|d)<=(0|s)){e=0;break}s=s+1|0}return P=a,0|e},_compactCells:function(A,e,t,r){e|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,D=0,E=0,N=0,Q=0,j=0,P=0;if(!(0|(t|=0))&!(0|(r|=0)))return 0;if(a=0|n[(i=A|=0)>>2],!0&!(15728640&(i=0|n[i+4>>2]))){if(!((0|r)>0|!(0|r)&t>>>0>0))return 0;if(n[(P=e)>>2]=a,n[P+4>>2]=i,1==(0|t)&!(0|r))return 0;i=1,a=0;do{j=0|n[4+(Q=A+(i<<3)|0)>>2],n[(P=e+(i<<3)|0)>>2]=n[Q>>2],n[P+4>>2]=j,i=0|Ze(0|i,0|a,1,0),a=0|B()}while((0|a)<(0|r)|(0|a)==(0|r)&i>>>0>>0);return 0}if(!(j=0|Ue(o=t<<3)))return 13;if(st(0|j,0|A,0|o),!(Q=0|We(t,8)))return Ye(j),13;A:for(;;){E=0|tt(0|(u=0|n[(i=j)>>2]),0|(i=0|n[i+4>>2]),52),B(),N=(E&=15)-1|0,D=!!(0|E),C=(0|r)>0|!(0|r)&t>>>0>0;e:do{if(D&C){if(v=0|rt(0|N,0,52),w=0|B(),N>>>0>15){if(!(!(0|u)&!(0|i))){P=16;break A}for(a=0,A=0;;){if(a=0|Ze(0|a,0|A,1,0),!((0|(A=0|B()))<(0|r)|(0|A)==(0|r)&a>>>0>>0))break e;if(!(!(0|(k=0|n[(s=j+(a<<3)|0)>>2]))&!(0|(s=0|n[s+4>>2])))){i=s,P=16;break A}}}for(l=u,A=i,a=0,s=0;;){if(!(!(0|l)&!(0|A))){if(!(!0&!(117440512&A))){P=21;break A}if(d=0|tt(0|l,0|A,52),B(),(0|(d&=15))<(0|N)){i=12,P=27;break A}if((0|d)!=(0|N)&&(l|=v,A=-15728641&A|w,d>>>0>=E>>>0)){c=N;do{k=0|rt(7,0,3*(14-c|0)|0),c=c+1|0,l|=k,A=0|B()|A}while(c>>>0>>0)}if(g=0|At(0|l,0|A,0|t,0|r),h=0|B(),!(!(0|(f=0|n[(d=c=Q+(g<<3)|0)>>2]))&!(0|(d=0|n[d+4>>2])))){p=0,x=0;do{if((0|p)>(0|r)|(0|p)==(0|r)&x>>>0>t>>>0){P=31;break A}if((0|f)==(0|l)&(-117440513&d)==(0|A)){m=0|tt(0|f,0|d,56),B(),b=1+(m&=7)|0,k=0|tt(0|f,0|d,45),B();t:do{if(0|z(127&k)){if(f=0|tt(0|f,0|d,52),B(),!(f&=15)){d=6;break}for(d=1;;){if(!(!((k=0|rt(7,0,3*(15-d|0)|0))&l)&!((0|B())&A))){d=7;break t}if(!(d>>>0>>0)){d=6;break}d=d+1|0}}else d=7}while(0);if((m+2|0)>>>0>d>>>0){P=41;break A}k=0|rt(0|b,0,56),A=B()|-117440513&A,n[(y=c)>>2]=0,n[y+4>>2]=0,l|=k}else g=0|$e(0|(g=0|Ze(0|g,0|h,1,0)),0|B(),0|t,0|r),h=0|B();x=0|Ze(0|x,0|p,1,0),p=0|B(),f=0|n[(d=c=Q+(g<<3)|0)>>2],d=0|n[d+4>>2]}while(!(!(0|f)&!(0|d)))}n[(k=c)>>2]=l,n[k+4>>2]=A}if(a=0|Ze(0|a,0|s,1,0),!((0|(s=0|B()))<(0|r)|(0|s)==(0|r)&a>>>0>>0))break e;l=0|n[(A=j+(a<<3)|0)>>2],A=0|n[A+4>>2]}}}while(0);if(k=0|Ze(0|t,0|r,5,0),(y=0|B())>>>0<0|!(0|y)&k>>>0<11){P=85;break}if(k=0|Xe(0|t,0|r,6,0),B(),!(k=0|We(k,8))){P=48;break}do{if(C){for(b=0,A=0,m=0,p=0;;){if(!(0|(a=0|n[(s=d=Q+(b<<3)|0)>>2]))&!(0|(s=0|n[s+4>>2])))y=m;else{f=0|tt(0|a,0|s,56),B(),l=1+(f&=7)|0,g=-117440513&s,y=0|tt(0|a,0|s,45),B();e:do{if(0|z(127&y)){if(h=0|tt(0|a,0|s,52),B(),0|(h&=15))for(c=1;;){if(!(!(a&(y=0|rt(7,0,3*(15-c|0)|0)))&!(g&(0|B()))))break e;if(!(c>>>0>>0))break;c=c+1|0}a|=s=0|rt(0|l,0,56),s=0|B()|g,n[(l=d)>>2]=a,n[l+4>>2]=s,l=f+2|0}}while(0);7==(0|l)?(n[(y=k+(A<<3)|0)>>2]=a,n[y+4>>2]=-117440513&s,A=0|Ze(0|A,0|m,1,0),y=0|B()):y=m}if(b=0|Ze(0|b,0|p,1,0),!((0|(p=0|B()))<(0|r)|(0|p)==(0|r)&b>>>0>>0))break;m=y}if(C){if(x=N>>>0>15,v=0|rt(0|N,0,52),w=0|B(),!D){for(a=0,c=0,l=0,s=0;!(0|u)&!(0|i)||(n[(N=e+(a<<3)|0)>>2]=u,n[N+4>>2]=i,a=0|Ze(0|a,0|c,1,0),c=0|B()),l=0|Ze(0|l,0|s,1,0),(0|(s=0|B()))<(0|r)|(0|s)==(0|r)&l>>>0>>0;)u=0|n[(i=j+(l<<3)|0)>>2],i=0|n[i+4>>2];i=y;break}for(a=0,c=0,s=0,l=0;;){do{if(!(!(0|u)&!(0|i))){if(h=0|tt(0|u,0|i,52),B(),x|(0|(h&=15))<(0|N)){P=80;break A}if((0|h)!=(0|N)){if(d=u|v,f=-15728641&i|w,h>>>0>=E>>>0){g=N;do{D=0|rt(7,0,3*(14-g|0)|0),g=g+1|0,d|=D,f=0|B()|f}while(g>>>0>>0)}}else d=u,f=i;m=0|At(0|d,0|f,0|t,0|r),g=0,h=0,p=0|B();do{if((0|g)>(0|r)|(0|g)==(0|r)&h>>>0>t>>>0){P=81;break A}if((-117440513&(b=0|n[4+(D=Q+(m<<3)|0)>>2]))==(0|f)&&(0|n[D>>2])==(0|d)){P=65;break}m=0|$e(0|(D=0|Ze(0|m,0|p,1,0)),0|B(),0|t,0|r),p=0|B(),h=0|Ze(0|h,0|g,1,0),g=0|B(),D=Q+(m<<3)|0}while((0|n[D>>2])!=(0|d)||(0|n[D+4>>2])!=(0|f));if(65==(0|P)&&(P=0,!0&100663296==(117440512&b)))break;n[(D=e+(a<<3)|0)>>2]=u,n[D+4>>2]=i,a=0|Ze(0|a,0|c,1,0),c=0|B()}}while(0);if(s=0|Ze(0|s,0|l,1,0),!((0|(l=0|B()))<(0|r)|(0|l)==(0|r)&s>>>0>>0))break;u=0|n[(i=j+(s<<3)|0)>>2],i=0|n[i+4>>2]}i=y}else a=0,i=y}else a=0,A=0,i=0}while(0);if(lt(0|Q,0,0|o),st(0|j,0|k,A<<3),Ye(k),!(0|A)&!(0|i)){P=89;break}e=e+(a<<3)|0,r=i,t=A}if(16==(0|P))!0&!(117440512&i)?(i=4,P=27):P=21;else if(31==(0|P))M(27795,27122,620,27132);else{if(41==(0|P))return Ye(j),Ye(Q),10;if(48==(0|P))return Ye(j),Ye(Q),13;80==(0|P)?M(27795,27122,711,27132):81==(0|P)?M(27795,27122,723,27132):85==(0|P)&&(st(0|e,0|j,t<<3),P=89)}return 21==(0|P)?(Ye(j),Ye(Q),0|(P=5)):27==(0|P)?(Ye(j),Ye(Q),0|(P=i)):89==(0|P)?(Ye(j),Ye(Q),0|(P=0)):0},_constructCell:function(A,e,t,o){t|=0,o|=0;var i=0,a=0,s=0,l=0,c=0,u=0;if((A|=0)>>>0>15)return 4;if((e|=0)>>>0>121)return 17;s=0|rt(0|A,0,52),i=0|B(),l=0|rt(0|e,0,45),i=0|i|B()|134225919;A:do{if((0|A)>=1){for(l=1,s=!!(0|r[20528+e|0]),a=-1;;){if((e=0|n[t+(l+-1<<2)>>2])>>>0>6){i=18,e=10;break}if(!(!(0|e)|1^s)){if(1==(0|e)){i=19,e=10;break}s=0}if(c=0|rt(7,0,0|(u=3*(15-l|0)|0)),i&=~B(),a=(e=0|rt(0|e,((0|e)<0)<<31>>31,0|u))|a&~c,i=0|B()|i,!((0|l)<(0|A)))break A;l=l+1|0}if(10==(0|e))return 0|i}else a=-1}while(0);return n[(u=o)>>2]=a,n[u+4>>2]=i,0},_destroyLinkedMultiPolygon:ge,_directedEdgeToBoundary:DA,_directedEdgeToCells:function(A,e,t){A|=0;var r,o,i,a=0;return r=P,P=P+16|0,a=r,!0&268435456==(2013265920&(e|=0))?(o=-2130706433&e|134217728,n[(i=t|=0)>>2]=A,n[i+4>>2]=o,n[a>>2]=0,e=0|tt(0|A,0|e,56),B(),a=0|R(A,o,7&e,a,t+8|0),P=r,0|a):(P=r,0|(a=6))},_edgeLengthKm:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return l=A,s=+o[t>>3],s*=6371.007180918475,o[t>>3]=s,P=r,0|l;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,s=0,s*=6371.007180918475,o[t>>3]=s,P=r,0|l;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+g)*+d(+i)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)!=(0|e));return o[t>>3]=s,l=0,h=s,h*=6371.007180918475,o[t>>3]=h,P=r,0|l},_edgeLengthM:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return l=A,s=+o[t>>3],s*=6371.007180918475,s*=1e3,o[t>>3]=s,P=r,0|l;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,s=0,s*=6371.007180918475,s*=1e3,o[t>>3]=s,P=r,0|l;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+g)*+d(+i)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)!=(0|e));return o[t>>3]=s,l=0,h=s,h*=6371.007180918475,h*=1e3,o[t>>3]=h,P=r,0|l},_edgeLengthRads:function(A,e,t){t|=0;var r,i=0,a=0,s=0,l=0,u=0,g=0,h=0;if(r=P,P=P+176|0,0|(A=0|DA(A|=0,e|=0,l=r)))return P=r,0|A;if(o[t>>3]=0,(0|(A=0|n[l>>2]))<=1)return P=r,0;e=A+-1|0,A=0,i=+o[l+8>>3],a=+o[l+16>>3],s=0;do{g=i,i=+o[l+8+((A=A+1|0)<<4)>>3],h=+f(.5*(i-g)),u=a,a=+o[l+8+(A<<4)+8>>3],u=h*h+(u=+f(.5*(a-u)))*(+d(+i)*+d(+g)*u),s+=2*+p(+ +c(+u),+ +c(+(1-u)))}while((0|A)<(0|e));return o[t>>3]=s,P=r,0},_emscripten_replace_memory:function(A){return r=new Int8Array(A),n=new Int32Array(A),o=new Float64Array(A),t=A,!0},_free:Ye,_getBaseCellNumber:LA,_getDirectedEdgeDestination:function(A,e,t){A|=0,e|=0,t|=0;var r,o,i=0;return r=P,P=P+16|0,n[(i=r)>>2]=0,!0&268435456==(2013265920&e)?(o=0|tt(0|A,0|e,56),B(),i=0|R(A,-2130706433&e|134217728,7&o,i,t),P=r,0|i):(P=r,0|(i=6))},_getDirectedEdgeOrigin:function(A,e,t){return A|=0,t|=0,!0&268435456==(2013265920&(e|=0))?(n[t>>2]=A,n[t+4>>2]=-2130706433&e|134217728,0|(t=0)):0|(t=6)},_getHexagonAreaAvgKm2:se,_getHexagonAreaAvgM2:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20784+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[20912+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(o[e>>3]=+o[21040+(A<<3)>>3],0|(e=0))},_getIcosahedronFaces:function A(e,t,r){r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0;o=P,P=P+128|0,d=o+112|0,s=o+96|0,f=o,a=0|tt(0|(e|=0),0|(t|=0),52),B(),c=15&a,n[d>>2]=c,l=0|tt(0|e,0|t,45),B(),l&=127;A:do{if(0|z(l)){if(0|c)for(i=1;;){if(!(!((u=0|rt(7,0,3*(15-i|0)|0))&e)&!((0|B())&t))){a=0;break A}if(!(i>>>0>>0))break;i=i+1|0}if(!(1&a))return u=0|rt(c+1|0,0,52),f=B()|-15728641&t,f=0|A((u|e)&~(d=0|rt(7,0,3*(14-c|0)|0)),f&~B(),r),P=o,0|f;a=1}else a=0}while(0);if(!(i=0|XA(e,t,s))){a?(QA(s,d,f),u=5):(SA(s,d,f),u=6);A:do{if(0|z(l))if(c)for(i=1;;){if(!(!((l=0|rt(7,0,3*(15-i|0)|0))&e)&!((0|B())&t))){e=2;break A}if(!(i>>>0>>0)){e=5;break}i=i+1|0}else e=5;else e=2}while(0);lt(0|r,-1,e<<2);A:do{if(a)for(s=0;;){if(PA(l=f+(s<<4)|0,0|n[d>>2]),l=0|n[l>>2],-1==(0|(c=0|n[r>>2]))|(0|c)==(0|l))i=r;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){i=1;break A}c=0|n[(i=r+(a<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(n[i>>2]=l,(s=s+1|0)>>>0>=u>>>0){i=0;break}}else for(s=0;;){if(jA(l=f+(s<<4)|0,0|n[d>>2],0,1),l=0|n[l>>2],-1==(0|(c=0|n[r>>2]))|(0|c)==(0|l))i=r;else{a=0;do{if((a=a+1|0)>>>0>=e>>>0){i=1;break A}c=0|n[(i=r+(a<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(n[i>>2]=l,(s=s+1|0)>>>0>=u>>>0){i=0;break}}}while(0)}return P=o,0|i},_getIndexDigit:function(A,e,t,r){return r|=0,((t|=0)-1|0)>>>0>14?0|(r=4):(t=0|tt(0|(A|=0),0|(e|=0),3*(15-t|0)|0),B(),n[r>>2]=7&t,0|(r=0))},_getNumCells:le,_getPentagons:Ae,_getRes0Cells:function(A){A|=0;var e=0,t=0,r=0;e=0;do{rt(0|e,0,45),r=134225919|B(),n[(t=A+(e<<3)|0)>>2]=-1,n[t+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(A,e){return e=0|tt(0|(A|=0),0|(e|=0),52),B(),15&e},_greatCircleDistanceKm:ae,_greatCircleDistanceM:function(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(A,e){A|=0;var t,r,n,i=0;return r=+o[(e|=0)>>3],t=+o[A>>3],i=(n=+f(.5*(r-t)))*n+(i=+f(.5*(+o[e+8>>3]-+o[A+8>>3])))*(+d(+r)*+d(+t)*i),2*+p(+ +c(+i),+ +c(+(1-i)))},_gridDisk:F,_gridDiskDistances:S,_gridDistance:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a,s=0,l=0;return a=P,P=P+32|0,l=a,0|(i=0|me(A|=0,e|=0,A,e,s=a+12|0))?(P=a,0|(l=i)):0|(A=0|me(A,e,t,r,l))?(P=a,0|(l=A)):(s=0|kA(s,l),n[(l=o)>>2]=s,n[l+4>>2]=((0|s)<0)<<31>>31,P=a,0|(l=0))},_gridPathCells:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a,s=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,D=0,E=0;if(a=P,P=P+48|0,c=a+12|0,D=a,!(s=0|me(A|=0,e|=0,A,e,i=a+24|0))&&!(s=0|me(A,e,t,r,c))){C=((0|(k=0|kA(i,c)))<0)<<31>>31,n[i>>2]=0,n[i+4>>2]=0,n[i+8>>2]=0,n[c>>2]=0,n[c+4>>2]=0,n[c+8>>2]=0,0|me(A,e,A,e,i)&&M(27795,27538,692,27747),0|me(A,e,t,r,c)&&M(27795,27538,697,27747),CA(i),CA(c),g=0|k?1/+(0|k):0,t=0|n[i>>2],x=g*+((0|n[c>>2])-t|0),r=0|n[(v=i+4|0)>>2],w=g*+((0|n[c+4>>2])-r|0),s=0|n[(y=i+8|0)>>2],g*=+((0|n[c+8>>2])-s|0),n[D>>2]=t,n[(h=D+4|0)>>2]=r,n[(m=D+8|0)>>2]=s;A:do{if((0|k)<0)s=0;else for(b=0,p=0;;){E=x*(d=+(p>>>0)+4294967296*+(0|b))+ +(0|t),u=w*d+ +(0|r),d=g*d+ +(0|s),t=~~+at(+E),c=~~+at(+u),s=~~+at(+d),E=+l(+(+(0|t)-E)),u=+l(+(+(0|c)-u)),d=+l(+(+(0|s)-d));do{if(!(E>u&E>d)){if(f=0-t|0,u>d){r=f-s|0;break}r=c,s=f-c|0;break}t=0-(c+s)|0,r=c}while(0);if(n[D>>2]=t,n[h>>2]=r,n[m>>2]=s,BA(D),0|(s=0|be(A,e,D,o+(p<<3)|0)))break A;if(!((0|b)<(0|C)|(0|b)==(0|C)&p>>>0>>0)){s=0;break A}t=0|Ze(0|p,0|b,1,0),b=r=0|B(),p=t,t=0|n[i>>2],r=0|n[v>>2],s=0|n[y>>2]}}while(0);return P=a,0|s}return P=a,0|s},_gridPathCellsSize:function(A,e,t,r,o){t|=0,r|=0,o|=0;var i,a=0,s=0,l=0;return i=P,P=P+32|0,l=i,(a=0|me(A|=0,e|=0,A,e,s=i+12|0))||(a=0|me(A,e,t,r,l))?(P=i,0|(l=a)):(r=0|Ze(0|(r=0|kA(s,l)),((0|r)<0)<<31>>31,1,0),s=0|B(),n[(l=o)>>2]=r,n[l+4>>2]=s,P=i,0|(l=0))},_gridRing:function(A,e,t,r){return 0|T(A|=0,e|=0,t|=0,r|=0)?(lt(0|r,0,48*t|0),0|(r=0|function(A,e,t,r){A|=0,e|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0,u=0,d=0,f=0;if(o=P,P=P+16|0,s=o,!(t|=0))return n[r>>2]=A,n[r+4>>2]=e,P=o,0;do{if((0|t)>=0){if((0|t)>13780509){if(0|(i=0|le(15,s)))break;i=0|n[(a=s)>>2],a=0|n[a+4>>2]}else d=0|qe(0|t,0|(i=((0|t)<0)<<31>>31),3,0),a=0|B(),i=0|Ze(0|t,0|i,1,0),i=0|Ze(0|(i=0|qe(0|d,0|a,0|i,0|B())),0|B(),1,0),a=0|B(),n[(d=s)>>2]=i,n[d+4>>2]=a;if(u=0|We(i,8)){if(!(d=0|We(i,4))){Ye(u),i=13;break}if(0|(i=0|I(A,e,t,u,d,i,a,0))){Ye(u),Ye(d);break}if(e=0|n[s>>2],(0|(s=0|n[s+4>>2]))>0|!(0|s)&e>>>0>0){i=0,l=0,c=0;do{!(0|(a=0|n[(A=u+(l<<3)|0)>>2]))&!(0|(A=0|n[A+4>>2]))||(0|n[d+(l<<2)>>2])!=(0|t)||(n[(f=r+(i<<3)|0)>>2]=a,n[f+4>>2]=A,i=i+1|0),l=0|Ze(0|l,0|c,1,0),c=0|B()}while((0|c)<(0|s)|(0|c)==(0|s)&l>>>0>>0)}Ye(u),Ye(d),i=0}else i=13}else i=2}while(0);return P=o,0|i}(A,e,t,r))):0|(r=0)},_gridRingUnsafe:T,_i64Add:Ze,_i64Subtract:Ve,_isPentagon:HA,_isResClassIII:function(A,e){return e=0|tt(0|(A|=0),0|(e|=0),52),B(),1&e},_isValidCell:IA,_isValidDirectedEdge:MA,_isValidIndex:function(A,e){A|=0;var t=0,n=0,o=0,i=0;if(!0&134217728==(-16777216&(e|=0))&&(n=0|tt(0|A,0|e,52),B(),n&=15,t=0|tt(0|A,0|e,45),B(),(t&=127)>>>0<=121)&&!(613566756&(i=0|rt(0|(o=0|tt(0|A,0|e,0|(i=3*(15^n)|0))),0|B(),0|i))&Ve(-1227133514,-1171,0|i,0|(o=0|B())))&!(4681&o&B())&&15==(0|n)|!(0|(i=0|tt(0|rt(0|~A,0|~e,0|(i=19+(3*n|0)|0)),0|B(),0|i)))&!(0|B())){if(!(0|r[20528+t|0]))return 1;if(!(0|A)&!(0|(t=8191&e)))return 1;if(i=0|nt(0|A,0|t),B(),(63-i|0)%3|0)return 1}return 0|MA(A,e)?0|(i=1):0|(i=1&!!(0|Le(A,e)))},_isValidVertex:Le,_latLngToCell:KA,_llvm_ctlz_i64:nt,_llvm_maxnum_f64:ot,_llvm_minnum_f64:it,_llvm_round_f64:at,_localIjToCell:function(A,e,t,r,o){var i,a;return A|=0,e|=0,t|=0,o|=0,a=P,P=P+16|0,i=a,(r|=0)?t=15:(t=0|function(A,e){e|=0;var t,r,o,i=0,a=0,s=0;if(a=0|n[(A|=0)>>2],n[e>>2]=a,s=0|n[A+4>>2],n[(r=e+4|0)>>2]=s,n[(o=e+8|0)>>2]=0,A=(i=(0|s)<(0|a))?a:s,(0|(i=i?s:a))<0){if(-2147483648==(0|i)||((0|A)>0?(2147483647-A|0)<(0|i):(-2147483648-A|0)>(0|i)))return 1;if((0|A)>-1?(-2147483648|A)>=(0|i):(-2147483648^A)<(0|i))return 1}return A=s-a|0,(0|a)<0?(i=0-a|0,n[r>>2]=A,n[o>>2]=i,n[e>>2]=0,a=0):(A=s,i=0),(0|A)<0&&(a=a-A|0,n[e>>2]=a,i=i-A|0,n[o>>2]=i,n[r>>2]=0,A=0),t=a-i|0,s=A-i|0,(0|i)<0?(n[e>>2]=t,n[r>>2]=s,n[o>>2]=0,A=s,s=t,i=0):s=a,(0|(a=(0|i)<(0|(a=(0|A)<(0|s)?A:s))?i:a))<=0||(n[e>>2]=s-a,n[r>>2]=A-a,n[o>>2]=i-a),0}(t,i))||(t=0|be(A,e,i,o)),P=a,0|t},_malloc:Ue,_maxFaceCount:function(A,e,t){t|=0;var r=0,o=0;if(o=0|tt(0|(A|=0),0|(e|=0),45),B(),!(0|z(127&o)))return o=2,n[t>>2]=o,0;if(o=0|tt(0|A,0|e,52),B(),!(o&=15))return o=5,n[t>>2]=o,0;for(r=1;;){if(!(!((0|rt(7,0,3*(15-r|0)|0))&A)&!((0|B())&e))){r=2,A=6;break}if(!(r>>>0>>0)){r=5,A=6;break}r=r+1|0}return 6==(0|A)?(n[t>>2]=r,0):0},_maxGridDiskSize:function(A,e){e|=0;var t=0,r=0,o=0;return(0|(A|=0))<0?0|(e=2):(0|A)>13780509?0|(e=0|le(15,e)):(o=0|qe(0|A,0|(t=((0|A)<0)<<31>>31),3,0),r=0|B(),t=0|Ze(0|A,0|t,1,0),t=0|Ze(0|(t=0|qe(0|o,0|r,0|t,0|B())),0|B(),1,0),A=0|B(),n[e>>2]=t,n[e+4>>2]=A,0|(e=0))},_maxPolygonToCellsSize:function(A,e,t,r){A|=0,e|=0,r|=0;var o,i=0,a=0,s=0,l=0,c=0;if(o=P,P=P+48|0,i=o+16|0,a=o+8|0,s=o,0|(t=0|Ce(t|=0)))return P=o,0|t;if(l=0|n[(c=A)+4>>2],n[(t=a)>>2]=n[c>>2],n[t+4>>2]=l,ke(a,i),!(t=0|eA(i,e,s))){if(e=0|n[a>>2],(0|(a=0|n[A+8>>2]))>0){i=0|n[A+12>>2],t=0;do{e=(0|n[i+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|a))}i=0|n[(t=s)>>2],(0|(t=0|n[t+4>>2]))<(0|(a=((0|e)<0)<<31>>31))|(0|t)==(0|a)&i>>>0>>0?(n[(t=s)>>2]=e,n[t+4>>2]=a,t=a):e=i,l=0|Ze(0|e,0|t,12,0),c=0|B(),n[(t=s)>>2]=l,n[t+4>>2]=c,n[(t=r)>>2]=l,n[t+4>>2]=c,t=0}return P=o,0|t},_maxPolygonToCellsSizeExperimental:function(A,e,t,i){e|=0,t|=0,i|=0;var a,s,c=0,u=0,f=0,g=0,h=0,m=0,b=0,p=0;if(s=P,P=P+48|0,h=s+32|0,g=s+40|0,a=s,!(0|n[(A|=0)>>2]))return n[(m=i)>>2]=0,n[m+4>>2]=0,P=s,0;RA(h,0,0,0),c=0|n[(f=h)>>2],f=0|n[f+4>>2];do{if(e>>>0>15)n[(m=a)>>2]=0,n[m+4>>2]=0,n[a+8>>2]=4,n[a+12>>2]=-1,t=a+29|0,n[(m=a+16|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,r[m+12|0]=0,r[0|t]=0|r[0|g],r[t+1|0]=0|r[g+1|0],r[t+2|0]=0|r[g+2|0],t=4,m=9;else{if(0|(t=0|Ce(t))){n[(h=a)>>2]=0,n[h+4>>2]=0,n[a+8>>2]=t,n[a+12>>2]=-1,m=a+29|0,n[(h=a+16|0)>>2]=0,n[h+4>>2]=0,n[h+8>>2]=0,r[h+12|0]=0,r[0|m]=0|r[0|g],r[m+1|0]=0|r[g+1|0],r[m+2|0]=0|r[g+2|0],m=9;break}if(!(t=0|We(1+(0|n[A+8>>2])|0,32))){n[(m=a)>>2]=0,n[m+4>>2]=0,n[a+8>>2]=13,n[a+12>>2]=-1,t=a+29|0,n[(m=a+16|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,r[m+12|0]=0,r[0|t]=0|r[0|g],r[t+1|0]=0|r[g+1|0],r[t+2|0]=0|r[g+2|0],t=13,m=9;break}Be(A,t),n[(p=a)>>2]=c,n[p+4>>2]=f,n[(f=a+8|0)>>2]=0,n[a+12>>2]=e,n[a+20>>2]=A,n[a+24>>2]=t,r[a+28|0]=0,r[0|(c=a+29|0)]=0|r[0|g],r[c+1|0]=0|r[g+1|0],r[c+2|0]=0|r[g+2|0],n[a+16>>2]=3,b=+J(t),b*=+V(t),u=+l(+ +o[t>>3]),u=b/+d(+ +it(+u,+ +l(+ +o[t+8>>3])))*6371.007180918475*6371.007180918475,t=0|n[(c=a+12|0)>>2];A:do{if((0|t)>0)do{if(se(t+-1|0,h),!(u/+o[h>>3]>10))break A;t=(p=0|n[c>>2])-1|0,n[c>>2]=t}while((0|p)>1)}while(0);if(ve(a),n[(c=i)>>2]=0,n[c+4>>2]=0,!(!(0|(t=0|n[(c=a)>>2]))&!(0|(c=0|n[c+4>>2]))))do{_A(t,c,e,h),g=h,g=0|Ze(0|n[(A=i)>>2],0|n[A+4>>2],0|n[g>>2],0|n[g+4>>2]),A=0|B(),n[(p=i)>>2]=g,n[p+4>>2]=A,ve(a),t=0|n[(p=a)>>2],c=0|n[p+4>>2]}while(!(!(0|t)&!(0|c)));t=0|n[f>>2]}}while(0);return P=s,0|t},_memcpy:st,_memset:lt,_originToDirectedEdges:function(A,e,t){t|=0;var r,o=0;return r=!(0|HA(A|=0,e|=0)),e&=-2130706433,n[(o=t)>>2]=r?A:0,n[o+4>>2]=r?285212672|e:0,n[(o=t+8|0)>>2]=A,n[o+4>>2]=301989888|e,n[(o=t+16|0)>>2]=A,n[o+4>>2]=318767104|e,n[(o=t+24|0)>>2]=A,n[o+4>>2]=335544320|e,n[(o=t+32|0)>>2]=A,n[o+4>>2]=352321536|e,n[(t=t+40|0)>>2]=A,n[t+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(A,e,t,r){A|=0,e|=0,r|=0;var o,i,a,s,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0,x=0,v=0,w=0,y=0,k=0,C=0,M=0,D=0,E=0,N=0,Q=0,j=0,F=0,S=0,R=0,T=0,_=0;if(s=P,P=P+112|0,o=s+80|0,f=s+72|0,i=s,a=s+56|0,0|(l=0|Ce(t|=0)))return P=s,0|l;if(!(_=0|Ue(32+(n[(g=A+8|0)>>2]<<5)|0)))return P=s,13;if(Be(A,_),!(l=0|Ce(t))){if(T=0|n[(R=A)+4>>2],n[(l=f)>>2]=n[R>>2],n[l+4>>2]=T,ke(f,o),l=0|eA(o,e,i))R=0,T=0;else{if(l=0|n[f>>2],(0|(c=0|n[g>>2]))>0){u=0|n[A+12>>2],t=0;do{l=(0|n[u+(t<<3)>>2])+l|0,t=t+1|0}while((0|t)!=(0|c));t=l}else t=l;c=0|n[(l=i)>>2],(0|(l=0|n[l+4>>2]))<(0|(u=((0|t)<0)<<31>>31))|(0|l)==(0|u)&c>>>0>>0?(n[(l=i)>>2]=t,n[l+4>>2]=u,l=u):t=c,R=0|Ze(0|t,0|l,12,0),T=0|B(),n[(l=i)>>2]=R,n[l+4>>2]=T,l=0}if(!l){if(!(t=0|We(R,8)))return Ye(_),P=s,13;if(!(d=0|We(R,8)))return Ye(_),Ye(t),P=s,13;n[(F=o)>>2]=0,n[F+4>>2]=0,S=0|n[(F=A)+4>>2],n[(l=f)>>2]=n[F>>2],n[l+4>>2]=S,l=0|H(f,R,T,e,o,t,d);A:do{if(l)Ye(t),Ye(d),Ye(_);else{e:do{if((0|n[g>>2])>0){for(u=A+12|0,c=0;l=0|H((0|n[u>>2])+(c<<3)|0,R,T,e,o,t,d),c=c+1|0,!(0|l);)if((0|c)>=(0|n[g>>2]))break e;Ye(t),Ye(d),Ye(_);break A}}while(0);(0|T)>0|!(0|T)&R>>>0>0&<(0|d,0,R<<3),F=0|n[(S=o)+4>>2];e:do{if((0|F)>0|!(0|F)&(0|n[S>>2])>>>0>0){N=t,Q=d,j=t,F=d,S=t,l=t,M=t,D=d,E=d,t=d;t:for(;;){for(w=0,y=0,k=0,C=0,c=0,u=0;;){f=(d=i)+56|0;do{n[d>>2]=0,d=d+4|0}while((0|d)<(0|f));if(0|L(g=0|n[(e=N+(w<<3)|0)>>2],e=0|n[e+4>>2],1,i,0)){f=(d=i)+56|0;do{n[d>>2]=0,d=d+4|0}while((0|d)<(0|f));0|(d=0|We(7,4))&&(I(g,e,1,i,d,7,0,0),Ye(d))}for(v=0;;){p=0|n[(x=i+(v<<3)|0)>>2],x=0|n[x+4>>2];r:do{if(!(0|p)&!(0|x))d=c,f=u;else{if(h=0|At(0|p,0|x,0|R,0|T),g=0|B(),!(!(0|(f=0|n[(e=d=r+(h<<3)|0)>>2]))&!(0|(e=0|n[e+4>>2])))){m=0,b=0;do{if((0|m)>(0|T)|(0|m)==(0|T)&b>>>0>R>>>0)break t;if((0|f)==(0|p)&(0|e)==(0|x)){d=c,f=u;break r}h=0|$e(0|(d=0|Ze(0|h,0|g,1,0)),0|B(),0|R,0|T),g=0|B(),b=0|Ze(0|b,0|m,1,0),m=0|B(),f=0|n[(e=d=r+(h<<3)|0)>>2],e=0|n[e+4>>2]}while(!(!(0|f)&!(0|e)))}if(!(0|p)&!(0|x)){d=c,f=u;break}qA(p,x,a),0|Me(A,_,a)&&(b=0|Ze(0|c,0|u,1,0),u=0|B(),n[(m=d)>>2]=p,n[m+4>>2]=x,n[(c=Q+(c<<3)|0)>>2]=p,n[c+4>>2]=x,c=b),d=c,f=u}}while(0);if((v=v+1|0)>>>0>=7)break;c=d,u=f}if(w=0|Ze(0|w,0|y,1,0),y=0|B(),k=0|Ze(0|k,0|C,1,0),C=0|B(),c=0|n[(u=o)>>2],!((0|C)<(0|(u=0|n[u+4>>2]))|(0|C)==(0|u)&k>>>0>>0))break;c=d,u=f}if((0|u)>0|!(0|u)&c>>>0>0){c=0,u=0;do{n[(C=N+(c<<3)|0)>>2]=0,n[C+4>>2]=0,c=0|Ze(0|c,0|u,1,0),u=0|B(),k=0|n[(C=o)+4>>2]}while((0|u)<(0|k)|((0|u)==(0|k)?c>>>0<(0|n[C>>2])>>>0:0))}if(n[(C=o)>>2]=d,n[C+4>>2]=f,!((0|f)>0|!(0|f)&d>>>0>0))break e;v=t,w=E,y=S,k=D,C=Q,t=M,E=l,D=j,M=v,l=w,S=F,F=y,j=k,Q=N,N=C}Ye(j),Ye(F),Ye(_),l=1;break A}l=d}while(0);Ye(_),Ye(t),Ye(l),l=0}}while(0);return P=s,0|l}}return Ye(_),P=s,0|l},_polygonToCellsExperimental:function(A,e,t,o,i,a){o|=0,i|=0,a|=0;var s,l,c,u=0,d=0,f=0,g=0,h=0,m=0,b=0,p=0;c=P,P=P+160|0,d=c+64|0,h=c+112|0,p=c,function(A,e,t,o){A|=0,e|=0,t|=0,o|=0;var i,a,s,l=0,c=0,u=0,d=0;s=P,P=P+48|0,i=s+40|0,a=s,RA(c=s+32|0,0,0,0),u=0|n[c>>2],c=0|n[c+4>>2];do{if(t>>>0<=15){if(0|(l=0|Ce(o))){n[(o=a)>>2]=0,n[o+4>>2]=0,n[a+8>>2]=l,n[a+12>>2]=-1,u=a+29|0,n[(o=a+16|0)>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,r[o+12|0]=0,r[0|u]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}if(l=0|We(1+(0|n[e+8>>2])|0,32)){Be(e,l),n[(d=a)>>2]=u,n[d+4>>2]=c,n[a+8>>2]=0,n[a+12>>2]=t,n[a+16>>2]=o,n[a+20>>2]=e,n[a+24>>2]=l,r[a+28|0]=0,r[0|(u=a+29|0)]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}n[(o=a)>>2]=0,n[o+4>>2]=0,n[a+8>>2]=13,n[a+12>>2]=-1,u=a+29|0,n[(o=a+16|0)>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,r[o+12|0]=0,r[0|u]=0|r[0|i],r[u+1|0]=0|r[i+1|0],r[u+2|0]=0|r[i+2|0];break}n[(u=a)>>2]=0,n[u+4>>2]=0,n[a+8>>2]=4,n[a+12>>2]=-1,d=a+29|0,n[(u=a+16|0)>>2]=0,n[u+4>>2]=0,n[u+8>>2]=0,r[u+12|0]=0,r[0|d]=0|r[0|i],r[d+1|0]=0|r[i+1|0],r[d+2|0]=0|r[i+2|0]}while(0);ve(a),n[A>>2]=n[a>>2],n[A+4>>2]=n[a+4>>2],n[A+8>>2]=n[a+8>>2],n[A+12>>2]=n[a+12>>2],n[A+16>>2]=n[a+16>>2],n[A+20>>2]=n[a+20>>2],n[A+24>>2]=n[a+24>>2],n[A+28>>2]=n[a+28>>2],P=s}(g=c+80|0,A|=0,e|=0,t|=0),ee(d,0|n[(f=g)>>2],0|n[f+4>>2],e),s=0|n[(f=d)>>2],f=0|n[f+4>>2],u=0|n[g+8>>2],n[(m=h+4|0)>>2]=n[g>>2],n[m+4>>2]=n[g+4>>2],n[m+8>>2]=n[g+8>>2],n[m+12>>2]=n[g+12>>2],n[m+16>>2]=n[g+16>>2],n[m+20>>2]=n[g+20>>2],n[m+24>>2]=n[g+24>>2],n[m+28>>2]=n[g+28>>2],n[(m=p)>>2]=s,n[m+4>>2]=f,n[(m=p+8|0)>>2]=u,e=h,t=36+(A=p+12|0)|0;do{n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}while((0|A)<(0|t));if(n[(h=p+48|0)>>2]=n[d>>2],n[h+4>>2]=n[d+4>>2],n[h+8>>2]=n[d+8>>2],n[h+12>>2]=n[d+12>>2],!(0|s)&!(0|f))return P=c,0|u;t=p+16|0,l=p+24|0,g=p+28|0,u=0,d=0,e=s,A=f;do{if(!((0|u)<(0|i)|(0|u)==(0|i)&d>>>0>>0)){b=4;break}if(f=d,d=0|Ze(0|d,0|u,1,0),u=0|B(),n[(f=a+(f<<3)|0)>>2]=e,n[f+4>>2]=A,re(h),!(0|(e=0|n[(A=h)>>2]))&!(0|(A=0|n[A+4>>2]))){if(ve(t),!(0|(A=0|n[(e=t)>>2]))&!(0|(e=0|n[e+4>>2]))){b=10;break}te(A,e,0|n[g>>2],h),e=0|n[(A=h)>>2],A=0|n[A+4>>2]}n[(f=p)>>2]=e,n[f+4>>2]=A}while(!(!(0|e)&!(0|A)));return 4==(0|b)?(0|(e=0|n[(A=p+40|0)>>2])&&Ye(e),n[(b=p+16|0)>>2]=0,n[b+4>>2]=0,n[l>>2]=0,n[p+36>>2]=0,n[g>>2]=-1,n[p+32>>2]=0,n[A>>2]=0,te(0,0,0,h),n[p>>2]=0,n[p+4>>2]=0,n[m>>2]=0,P=c,0|(p=14)):(10==(0|b)&&(n[p>>2]=0,n[p+4>>2]=0,n[m>>2]=n[l>>2]),p=0|n[m>>2],P=c,0|p)},_readInt64AsDoubleFromPointer:function(A){return+(+((0|n[(A|=0)>>2])>>>0)+4294967296*+(0|n[A+4>>2]))},_res0CellCount:function(){return 122},_round:ct,_sbrk:ut,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(A,e,t,r,o,i,a){A|=0,r|=0,o|=0,i|=0;var s,l=0,c=0,u=0,d=0,f=0,g=0,h=0,m=0;if(s=P,P=P+16|0,m=s,!((0|(t|=0))>0|!(0|t)&(e|=0)>>>0>0))return P=s,0;if((0|(a|=0))>=16)return P=s,12;g=0,h=0,f=0,l=0;A:for(;;){if(d=0|tt(0|(c=0|n[(u=A+(g<<3)|0)>>2]),0|(u=0|n[u+4>>2]),52),B(),(15&d)>(0|a)){l=12,c=11;break}if(ee(m,c,u,a),!(0|(u=0|n[(d=m)>>2]))&!(0|(d=0|n[d+4>>2])))c=f;else{c=f;do{if(!((0|l)<(0|i)|(0|l)==(0|i)&c>>>0>>0)){c=10;break A}n[(f=r+(c<<3)|0)>>2]=u,n[f+4>>2]=d,c=0|Ze(0|c,0|l,1,0),l=0|B(),re(m),u=0|n[(f=m)>>2],d=0|n[f+4>>2]}while(!(!(0|u)&!(0|d)))}if(g=0|Ze(0|g,0|h,1,0),!((0|(h=0|B()))<(0|t)|(0|h)==(0|t)&g>>>0>>0)){l=0,c=11;break}f=c}return 10==(0|c)?(P=s,0|(m=14)):11==(0|c)?(P=s,0|l):0},_uncompactCellsSize:function(A,e,t,r,o){A|=0,e|=0,t|=0,r|=0,o|=0;var i,a,s=0,l=0,c=0,u=0,d=0,f=0;a=P,P=P+16|0,i=a;A:do{if((0|t)>0|!(0|t)&e>>>0>0){for(d=0,l=0,s=0,f=0;;){if(!(!(0|(c=0|n[(u=A+(d<<3)|0)>>2]))&!(0|(u=0|n[u+4>>2]))||(u=!(0|_A(c,u,r,i)),l=0|Ze(0|n[(c=i)>>2],0|n[c+4>>2],0|l,0|s),s=0|B(),u))){s=12;break}if(d=0|Ze(0|d,0|f,1,0),!((0|(f=0|B()))<(0|t)|(0|f)==(0|t)&d>>>0>>0))break A}return P=a,0|s}l=0,s=0}while(0);return n[o>>2]=l,n[o+4>>2]=s,P=a,0},_vertexToLatLng:function(A,e,t){t|=0;var r,o,i,a,s=0,l=0;return a=P,P=P+192|0,o=a,i=a+168|0,s=0|tt(0|(A|=0),0|(e|=0),56),B(),s&=7,0|(r=0|XA(A,l=-2130706433&e|134217728,i))?(P=a,0|(l=r)):(e=0|tt(0|A,0|e,52),B(),e&=15,0|HA(A,l)?NA(i,e,s,1,o):FA(i,e,s,1,o),l=o+8|0,n[t>>2]=n[l>>2],n[t+4>>2]=n[l+4>>2],n[t+8>>2]=n[l+8>>2],n[t+12>>2]=n[l+12>>2],P=a,0|(l=0))},establishStackSpace:function(A,e){P=A|=0},stackAlloc:function(A){var e;return e=P,P=15+(P=P+(A|=0)|0)&-16,0|e},stackRestore:function(A){P=A|=0},stackSave:function(){return 0|P}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(A){s=A},c:function(){return s},d:function(A,e,t,r){tA("Assertion failed: "+x(A)+", at: "+[e?x(e):"unknown filename",t,r?x(r):"unknown function"])},e:function(A){return t.___errno_location&&(h[t.___errno_location()>>2]=A),A},f:z,g:function(A,e,t){f.set(f.subarray(e,e+t),A)},h:function(A){var e=z(),t=16777216,r=2130706432;if(A>r)return!1;for(var n=Math.max(e,16777216);n0))return 0;for(var n=t+r-1,o=0;o=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&A.charCodeAt(++o)),i<=127){if(t>=n)break;e[t++]=i}else if(i<=2047){if(t+1>=n)break;e[t++]=192|i>>6,e[t++]=128|63&i}else if(i<=65535){if(t+2>=n)break;e[t++]=224|i>>12,e[t++]=128|i>>6&63,e[t++]=128|63&i}else{if(t+3>=n)break;e[t++]=240|i>>18,e[t++]=128|i>>12&63,e[t++]=128|i>>6&63,e[t++]=128|63&i}}e[t]=0}(A,f,e,t)}(A,e=V(t),t)}return e},array:function(A){var e,t,r=V(A.length);return e=A,t=r,d.set(e,t),r}},o=c(A),i=[],a=0;if(r)for(var s=0;s>1]=e;break;case"i32":h[A>>2]=e;break;case"i64":R=[e>>>0,(I=e,+Q(I)>=1?I>0?(0|F(+P(I/4294967296),4294967295))>>>0:~~+j((I-+(~~I>>>0))/4294967296)>>>0:0)],h[A>>2]=R[0],h[A+4>>2]=R[1];break;case"float":m[A>>2]=e;break;case"double":b[A>>3]=e;break;default:tA("invalid type for setValue: "+t)}},t.getValue=function(A,e,t){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return d[0|A];case"i16":return g[A>>1];case"i32":case"i64":return h[A>>2];case"float":return m[A>>2];case"double":return b[A>>3];default:tA("invalid type for getValue: "+e)}return null},T){H(T)||(W=T,T=t.locateFile?t.locateFile(W,o):o+W),S++,t.monitorRunDependencies&&t.monitorRunDependencies(S);var X=function(A){A.byteLength&&(A=new Uint8Array(A)),f.set(A,8),t.memoryInitializerRequest&&delete t.memoryInitializerRequest.response,function(){if(S--,t.monitorRunDependencies&&t.monitorRunDependencies(S),0==S&&L){var A=L;L=null,A()}}()},q=function(){n(T,X,function(){throw"could not load memory initializer "+T})},$=O(T);if($)X($.buffer);else if(t.memoryInitializerRequest){var AA=function(){var A=t.memoryInitializerRequest,e=A.response;if(200!==A.status&&0!==A.status){var r=O(t.memoryInitializerRequestURL);if(!r)return void q();e=r.buffer}X(e)};t.memoryInitializerRequest.response?setTimeout(AA,0):t.memoryInitializerRequest.addEventListener("load",AA)}else q()}function eA(A){function e(){Z||(Z=!0,l||(k(B),k(M),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)N(t.postRun.shift());k(D)}()))}S>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)E(t.preRun.shift());k(C)}(),S>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}function tA(A){throw t.onAbort&&t.onAbort(A),i(A+=""),a(A),l=!0,"abort("+A+"). Build with -s ASSERTIONS=1 for more info."}if(L=function A(){Z||eA(),Z||(L=A)},t.run=eA,t.abort=tA,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return eA(),A}("object"==typeof $A?$A:{}),Ae="number",ee={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid",16:"Index argument was not valid",17:"Base cell number was outside of acceptable range",18:"Child indexing digits invalid",19:"Child indexing digits refer to a deleted subsequence"},te={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function re(A,e,t){var r=t&&"value"in t,n=new Error((A[e]||"Unknown error")+" (code: "+e+(r?", value: "+t.value:"")+")");return n.code=e,n}function ne(A){if(0!==A)throw function(A,e){return re(ee,A,2===arguments.length?{value:e}:{})}(A)}var oe={};[["sizeOfH3Index",Ae],["sizeOfLatLng",Ae],["sizeOfCellBoundary",Ae],["sizeOfGeoLoop",Ae],["sizeOfGeoPolygon",Ae],["sizeOfLinkedGeoPolygon",Ae],["sizeOfCoordIJ",Ae],["readInt64AsDoubleFromPointer",Ae],["isValidCell",Ae,[Ae,Ae]],["isValidIndex",Ae,[Ae,Ae]],["latLngToCell",Ae,[Ae,Ae,Ae,Ae]],["cellToLatLng",Ae,[Ae,Ae,Ae]],["cellToBoundary",Ae,[Ae,Ae,Ae]],["maxGridDiskSize",Ae,[Ae,Ae]],["gridDisk",Ae,[Ae,Ae,Ae,Ae]],["gridDiskDistances",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridRing",Ae,[Ae,Ae,Ae,Ae]],["gridRingUnsafe",Ae,[Ae,Ae,Ae,Ae]],["maxPolygonToCellsSize",Ae,[Ae,Ae,Ae,Ae]],["polygonToCells",Ae,[Ae,Ae,Ae,Ae]],["maxPolygonToCellsSizeExperimental",Ae,[Ae,Ae,Ae,Ae]],["polygonToCellsExperimental",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["cellsToLinkedMultiPolygon",Ae,[Ae,Ae,Ae]],["destroyLinkedMultiPolygon",null,[Ae]],["compactCells",Ae,[Ae,Ae,Ae,Ae]],["uncompactCells",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["uncompactCellsSize",Ae,[Ae,Ae,Ae,Ae,Ae]],["isPentagon",Ae,[Ae,Ae]],["isResClassIII",Ae,[Ae,Ae]],["getBaseCellNumber",Ae,[Ae,Ae]],["getResolution",Ae,[Ae,Ae]],["getIndexDigit",Ae,[Ae,Ae,Ae]],["constructCell",Ae,[Ae,Ae,Ae,Ae]],["maxFaceCount",Ae,[Ae,Ae,Ae]],["getIcosahedronFaces",Ae,[Ae,Ae,Ae]],["cellToParent",Ae,[Ae,Ae,Ae,Ae]],["cellToChildren",Ae,[Ae,Ae,Ae,Ae]],["cellToCenterChild",Ae,[Ae,Ae,Ae,Ae]],["cellToChildrenSize",Ae,[Ae,Ae,Ae,Ae]],["cellToChildPos",Ae,[Ae,Ae,Ae,Ae]],["childPosToCell",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["areNeighborCells",Ae,[Ae,Ae,Ae,Ae,Ae]],["cellsToDirectedEdge",Ae,[Ae,Ae,Ae,Ae,Ae]],["getDirectedEdgeOrigin",Ae,[Ae,Ae,Ae]],["getDirectedEdgeDestination",Ae,[Ae,Ae,Ae]],["isValidDirectedEdge",Ae,[Ae,Ae]],["directedEdgeToCells",Ae,[Ae,Ae,Ae]],["originToDirectedEdges",Ae,[Ae,Ae,Ae]],["directedEdgeToBoundary",Ae,[Ae,Ae,Ae]],["gridDistance",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridPathCells",Ae,[Ae,Ae,Ae,Ae,Ae]],["gridPathCellsSize",Ae,[Ae,Ae,Ae,Ae,Ae]],["cellToLocalIj",Ae,[Ae,Ae,Ae,Ae,Ae,Ae]],["localIjToCell",Ae,[Ae,Ae,Ae,Ae,Ae]],["getHexagonAreaAvgM2",Ae,[Ae,Ae]],["getHexagonAreaAvgKm2",Ae,[Ae,Ae]],["getHexagonEdgeLengthAvgM",Ae,[Ae,Ae]],["getHexagonEdgeLengthAvgKm",Ae,[Ae,Ae]],["greatCircleDistanceM",Ae,[Ae,Ae]],["greatCircleDistanceKm",Ae,[Ae,Ae]],["greatCircleDistanceRads",Ae,[Ae,Ae]],["cellAreaM2",Ae,[Ae,Ae,Ae]],["cellAreaKm2",Ae,[Ae,Ae,Ae]],["cellAreaRads2",Ae,[Ae,Ae,Ae]],["edgeLengthM",Ae,[Ae,Ae,Ae]],["edgeLengthKm",Ae,[Ae,Ae,Ae]],["edgeLengthRads",Ae,[Ae,Ae,Ae]],["getNumCells",Ae,[Ae,Ae]],["getRes0Cells",Ae,[Ae]],["res0CellCount",Ae],["getPentagons",Ae,[Ae,Ae]],["pentagonCount",Ae],["cellToVertex",Ae,[Ae,Ae,Ae,Ae]],["cellToVertexes",Ae,[Ae,Ae,Ae]],["vertexToLatLng",Ae,[Ae,Ae,Ae]],["isValidVertex",Ae,[Ae,Ae]]].forEach(function(A){oe[A[0]]=$A.cwrap.apply($A,A)});var ie=16,ae=oe.sizeOfH3Index(),se=oe.sizeOfLatLng(),le=oe.sizeOfCellBoundary();oe.sizeOfGeoPolygon(),oe.sizeOfGeoLoop(),oe.sizeOfLinkedGeoPolygon(),oe.sizeOfCoordIJ();var ce=/[^0-9a-fA-F]/;function ue(A){if(A>=0)return A.toString(ie);var e=de(8,(A&=2147483647).toString(ie));return(parseInt(e[0],ie)+8).toString(ie)+e.substring(1)}function de(A,e){for(var t=A-e.length,r="",n=0;n.85?.9+(i-.85)/.15*.1:.1+(i-.15)/.7*.8;var i;return we(r[Math.min(23,Math.floor(24*o))])}function ke({coveragePoints:e,visible:r,terrainEnabled:n=!1,brightness:o=.7}){const{current:i}=S(),[a,s]=A.useState(null),[l,c]=A.useState(!1),u=A.useRef({aborted:!1}),d=A.useRef(0),f=function(e){const[t,r]=A.useState(e);return A.useEffect(()=>{const A=setTimeout(()=>r(e),300);return()=>clearTimeout(A)},[e,300]),t}(e),g=A.useMemo(()=>function(){var A;const e=hA();return 24===e.length&&0!==(null==(A=e[0])?void 0:A[0])?e:ve}(),[]);A.useEffect(()=>{if(!f||!Array.isArray(f)||0===f.length)return void queueMicrotask(()=>{s(null),d.current=0});if(f.length===d.current&&a)return;d.current=f.length,u.current.aborted=!0,u.current={aborted:!1};const A=u.current;c(!0);const{cells:e,minQuality:t,maxQuality:r}=function(A){const e=new Map;for(const o of A){if("number"!=typeof o.lat||"number"!=typeof o.lon||isNaN(o.lat)||isNaN(o.lon))continue;const A=he(o.lat,o.lon,8),t=e.get(A),r=o.weight;t?(t.count++,t.qualitySum+=r):e.set(A,{count:1,qualitySum:r})}const t=[];let r=1/0,n=-1/0;for(const[o,i]of e.entries()){const A=i.qualitySum/i.count;t.push({hexId:o,count:i.count,avgQuality:A}),r=Math.min(r,A),n=Math.max(n,A)}return{cells:t,minQuality:t.length>0?r:0,maxQuality:t.length>0?n:0}}(f);if(0===e.length)return s(null),void c(!1);if(e.length<500){const n=function(A,e,t,r){const n=[];for(const o of A){const A=me(o.hexId).map(([A,e])=>[e,A]);A.push(A[0]);const i=ye(o.avgQuality,e,t,r);n.push({type:"Feature",properties:{color:i,quality:o.avgQuality,count:o.count},geometry:{type:"Polygon",coordinates:[A]}})}return{type:"FeatureCollection",features:n}}(e,t,r,g);return void(A.aborted||(s(n),c(!1)))}return async function(A,e,t,r,n){const o=[];let i=0;for(;i[e,A]);a.push(a[0]);const s=ye(n.avgQuality,e,t,r);o.push({type:"Feature",properties:{color:s,quality:n.avgQuality,count:n.count},geometry:{type:"Polygon",coordinates:[a]}})}irequestAnimationFrame(A))}return{type:"FeatureCollection",features:o}}(e,t,r,g,A).then(e=>{!A.aborted&&e&&s(e)}).finally(()=>{A.aborted||c(!1)}),()=>{A.aborted=!0}},[f,g]),A.useEffect(()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(!e)return;const t=()=>{var A,t;try{const n=e.getLayer(xe),i=e.getSource(pe);if(r&&a&&a.features.length>0){if(i?e.getSource(pe).setData(a):e.addSource(pe,{type:"geojson",data:a}),!n){const r=e.getLayer("topology-weak-edges-native"),n=null==(t=null==(A=e.getStyle())?void 0:A.layers)?void 0:t.find(A=>"symbol"===A.type),i=r?"topology-weak-edges-native":null==n?void 0:n.id;e.addLayer({id:xe,type:"fill",source:pe,paint:{"fill-color":["get","color"],"fill-opacity":o}},i)}}else n&&e.removeLayer(xe),i&&e.removeSource(pe)}catch(n){}};e.isStyleLoaded()?t():e.once("style.load",t)},[i,r,a,n]),A.useEffect(()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(e&&r)try{e.getLayer(xe)&&e.setPaintProperty(xe,"fill-opacity",o)}catch{}},[i,o,r]),A.useEffect(()=>()=>{var A;const e=null==(A=null==i?void 0:i.getMap)?void 0:A.call(i);if(e)try{e.getLayer(xe)&&e.removeLayer(xe),e.getSource(pe)&&e.removeSource(pe)}catch{}},[i]);const h=(null==a?void 0:a.features.length)??0;return h>0&&r?t.jsx("div",{"data-testid":"wardriving-hexlayer-maplibre-active","data-point-count":(null==e?void 0:e.length)||0,"data-cell-count":h,"data-terrain-enabled":n,"data-is-processing":l,style:{display:"none"}}):null}const Ce="https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",Be="terrarium",Me="terrain-dem",De="hillshade-dem",Ee="terrain-hillshade";function Ne({enabled:e,exaggeration:t=4}){const{current:r}=S(),n=A.useRef(null);return A.useEffect(()=>{var A;const e=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);if(!e)return;let t=!0;const n=()=>{var A,r;if(t)try{if(e.getSource(De)||e.addSource(De,{type:"raster-dem",tiles:[Ce],encoding:Be,tileSize:256,maxzoom:14}),!e.getLayer(Ee)){const t=null==(r=null==(A=e.getStyle())?void 0:A.layers)?void 0:r.find(A=>"symbol"===A.type);e.addLayer({id:Ee,type:"hillshade",source:De,paint:{"hillshade-shadow-color":"rgba(10, 10, 10, 0.6)","hillshade-highlight-color":"rgba(245, 240, 230, 0.4)","hillshade-accent-color":"rgba(90, 75, 65, 0.3)","hillshade-illumination-direction":315,"hillshade-exaggeration":.35}},null==t?void 0:t.id)}}catch(n){}};return e.isStyleLoaded()?n():e.once("style.load",n),()=>{t=!1}},[r]),A.useEffect(()=>{var A;const o=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);if(!o)return;let i=!0;const a=()=>{if(i)try{o.getSource(Me)||o.addSource(Me,{type:"raster-dem",tiles:[Ce],encoding:Be,tileSize:256,maxzoom:14}),e?(o.setCenterClampedToGround(!1),o.setTerrain({source:Me,exaggeration:t}),o.setMaxPitch(70),o.getPitch()<30&&!o.isMoving()&&(null!==n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{n.current=null,i&&!o.isMoving()&&o.getPitch()<30&&o.easeTo({pitch:45,duration:1e3})},200))):(o.setTerrain(null),o.setCenterClampedToGround(!0),o.getPitch()>0&&!o.isMoving()&&o.easeTo({pitch:0,duration:800}),o.setMaxPitch(60))}catch(A){}};return o.isStyleLoaded()?a():o.once("style.load",a),()=>{i=!1,null!==n.current&&(clearTimeout(n.current),n.current=null);try{o.getStyle()&&o.isStyleLoaded()&&o.setTerrain(null)}catch{}}},[r,e,t]),A.useEffect(()=>{var A;const e=null==(A=null==r?void 0:r.getMap)?void 0:A.call(r);return()=>{var A;try{(null==(A=null==e?void 0:e.getStyle)?void 0:A.call(e))&&e.isStyleLoaded()&&(e.setTerrain(null),e.getLayer(Ee)&&e.removeLayer(Ee),e.getSource(De)&&e.removeSource(De),e.getSource(Me)&&e.removeSource(Me))}catch{}}},[r]),null}function Qe(A,e=!1,t=!1,r=!1,n=.7){const o=fA();return r?n>=.75?o.restBright:o.rest:n>=.85?o.rest:o.restDim}function je(A){return[A[1],A[0]]}function Pe(A,e,t,r=12){const[n,o]=A,[i,a]=e,s=[];for(let l=0;l<=r;l++){const A=l/r,e=o+(a-o)*A,c=n+(i-n)*A,u=4*t*A*(1-A);s.push([e,c,u])}return s}function Fe(A){return A<.5?4*A*A*A:1-Math.pow(-2*A+2,3)/2}function Se(A,e,t,r,n,o,i,a,s,l,c){const u=CA(),d=[];let f=1/0,g=-1/0;const h=[];for(const b of A){const A=.7*(b.edge.avgConfidence??(e?.7:.5))+b.edge.certainCount/Math.max(i,1)*.3+(e?.5:0);h.push({polyline:b,brightnessScore:A}),f=Math.min(f,A),g=Math.max(g,A)}if(0===h.length)return{type:"FeatureCollection",features:[]};const m=g-f||1;h.sort((A,e)=>A.brightnessScore-e.brightnessScore);for(const{polyline:b,brightnessScore:p}of h){const{from:A,to:i,edge:g}=b,h=t.get(g.key)??0;if(h<=0)continue;const x=a.has(g.key),v=s.has(g.key),w=g.avgConfidence??(e?.7:.5),y=l===g.key,k=c[g.fromHash],C=c[g.toHash],B=(null==k?void 0:k.node_name)||(null==k?void 0:k.name)||g.fromHash.slice(0,8),M=(null==C?void 0:C.node_name)||(null==C?void 0:C.name)||g.toHash.slice(0,8),D=[A[0]+(i[0]-A[0])*h,A[1]+(i[1]-A[1])*h];let E,N,Q,j;if(e){const A=o.get(g.key)??vA(g.certainCount),e=n.get(g.key)??A;E=e+(A-e)*r,y?E=Math.max(1.6*E,4.5):v&&(E*=1.3)}else E=1.5;if(N=y?u.edges.highlight:Qe(0,g.isDirectPathEdge??!1,x,v,w),Q=y?u.edges.highlight:g.isDirectPathEdge?u.edges.hoverDirect:x?u.edges.hoverLoop:u.edges.hoverStandard,e){const A=Math.min(1.5*h,1)*u.edgeOpacity;j=v?1.15*A:A}else j=(.3+.3*w)*h;y&&(j=.95);const P=(p-f)/m;d.push({type:"Feature",properties:{key:g.key,baseColor:N,hoverColor:Q,baseWidth:E,baseOpacity:j,brightnessScore:P,isLoopEdge:x,isBackbone:v,isDirectPath:g.isDirectPathEdge??!1,isHubConnection:g.isHubConnection??!1,isZeroHop:g.isZeroHop??!1,isValidated:e,certainCount:g.certainCount,confidence:w,symmetryRatio:g.symmetryRatio??1,dominantDirection:g.dominantDirection??"balanced",fromName:B,toName:M,fromHash:g.fromHash,toHash:g.toHash},geometry:{type:"LineString",coordinates:[je(A),je(D)]}})}return{type:"FeatureCollection",features:d}}function Le(A,e){const t=CA(),r=[];let n=0;for(const o of A){const A=e.get(o.hash);A&&A.blendedScore>n&&(n=A.blendedScore)}for(const o of A){const{from:A,to:i,hash:a,neighbor:s,lastHopData:l}=o,c=`neighbor-${a}`,u=(null==l?void 0:l.avgRssi)??s.rssi??null,d=(null==l?void 0:l.avgSnr)??s.snr??null,f=(null==l?void 0:l.count)??0,g=(null==l?void 0:l.confidence)??1,h=e.get(a),m=(null==h?void 0:h.listenerScore)??0,b=(null==h?void 0:h.loudScore)??0,p=(null==h?void 0:h.blendedScore)??0,x=n>0?p/n:0,v=o.rxAdvertCount??0,w=o.txProxyCount??0,y=v+w,k=y>0?(w-v)/y:0,C=Pe(A,i,150,8);r.push({type:"Feature",properties:{key:c,hash:a,name:s.node_name||s.name||a.slice(0,8),prefix:a.slice(2,4).toUpperCase(),color:t.neighborColor,width:2.5,opacity:.85,rssi:u,snr:d,packetCount:f,confidence:g,hasAvgRssi:void 0!==(null==l?void 0:l.avgRssi),hasAvgSnr:void 0!==(null==l?void 0:l.avgSnr),isNeighborEdge:!0,listenerScore:m,loudScore:b,blendedScore:p,trafficWeight:x,linkAsymmetry:k,rxAdvertCount:v,txProxyCount:w},geometry:{type:"LineString",coordinates:C}})}return{type:"FeatureCollection",features:r}}function Ie(A){return A<.5?4*A*A*A:1-Math.pow(-2*A+2,3)/2}function Re(A,e){if(A<240)return.5;if(A<480)return 1;const t=(A-480)/(e-480);return Math.max(0,.33*(1-t))}function Te(A,e,t){const r=t?AA(t):null,n=[];for(const o of A){if(r&&o.toUpperCase()===r){t&&n.push(t);continue}const A=e.get(o.toUpperCase());A&&n.push(A)}return n}const _e="edge-blink-source",He="edge-blink-layer",ze=1e3,Ge=1e3,Oe="node-markers-layer";function Ue(A){return A<0||A>=ze?0:1-A/ze}function Ye(A){if(A<0)return 0;if(A>=Ge)return 0;const e=A/Ge;return Math.pow(1-e,3)}function We(A){return[A[1],A[0]]}function Ze(A){const e=new Date(1e3*A);return`${(e.getMonth()+1).toString().padStart(2,"0")}/${e.getDate().toString().padStart(2,"0")}`}function Ve({hash:e,hashPrefix:n,name:o,isHub:i,isGateway:a,isBackbone:l,isZeroHop:c,isMobile:u,isRoomServer:d,isStale:f,lastSeenTimestamp:g,centrality:h,affinity:m,meanSnr:b,meanRssi:p,neighbor:x,onRemove:v,txDelayRec:w,onPingResult:y}){const k=gA(),[C,B]=A.useState(!1),[M,D]=A.useState(!1),[E,N]=A.useState(null),[Q,j]=A.useState(null),F=A.useCallback(async()=>{if(!M){D(!0),j(null),N(null);try{const A=e.startsWith("0x")?e.slice(0,4):`0x${e.slice(0,2)}`,t=await tA(A,30);t.success&&t.data?(N(t.data),null==y||y(t.data)):j(t.error||"Ping failed")}catch(A){j(A instanceof Error?A.message:"Ping failed")}finally{D(!1)}}},[e,M,y]),S=c?"Direct":(null==m?void 0:m.typicalHopPosition)?`${m.typicalHopPosition}-hop`:null,z=w&&!w.insufficientData,G={hub:{bg:"bg-amber-500/20",text:"text-amber-400",title:"Hub: High-connectivity node that bridges many paths"},backbone:{bg:"bg-purple-500/20",text:"text-purple-400",title:"Backbone: Critical relay with high traffic"},relay:{bg:"bg-cyan-500/20",text:"text-cyan-400",title:"Relay: Standard forwarding node"},edge:{bg:"bg-gray-500/20",text:"text-gray-400",title:"Edge: Peripheral node"}},O={high:{bg:"bg-green-500/20",text:"text-green-400",title:"1000+ packets"},medium:{bg:"bg-amber-500/20",text:"text-amber-400",title:"500-999 packets"},low:{bg:"bg-red-500/20",text:"text-red-400",title:"100-499 packets"},insufficient:{bg:"bg-gray-500/20",text:"text-gray-400",title:"Insufficient data"}};return t.jsxs("div",{className:"w-[240px] pr-2",children:[t.jsx("div",{className:"text-[14px] font-semibold text-text-primary leading-tight truncate mb-1",children:o}),t.jsxs("div",{className:"flex items-center gap-1 flex-wrap mb-1.5",children:[t.jsx("code",{className:"font-mono text-[10px] text-text-secondary bg-[#1a1a1a] px-1 py-0.5 rounded",children:n}),t.jsx("button",{onClick:async()=>{try{await navigator.clipboard.writeText(e),B(!0),setTimeout(()=>B(!1),1500)}catch(A){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{document.execCommand("copy"),B(!0),setTimeout(()=>B(!1),1500)}catch{}document.body.removeChild(t)}},className:"p-0.5 hover:bg-[#252525] rounded transition-colors",title:"Copy full hash",children:C?t.jsx(r,{className:"w-3 h-3 text-accent-success"}):t.jsx(L,{className:"w-3 h-3 text-text-secondary"})}),t.jsx(pA,{hash:e,size:"sm"}),S&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded "+(c?"bg-amber-400 text-gray-900":"bg-[#2a2a2a] text-white"),children:S}),x.is_repeater&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-cyan-500/20 text-cyan-400",children:"Rptr"}),i&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded",style:{backgroundColor:k.hubColor,color:"#fff"},title:"Hub: ≥10% of last-hop traffic",children:"Hub"}),a&&!i&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded",style:{backgroundColor:k.hubColor,color:"#fff",opacity:.8},title:"Gateway: 7-10% of last-hop traffic",children:"Gate"}),l&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-purple-500/80 text-white",title:"Backbone",children:"Bone"}),u&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-orange-500/25 text-orange-300",children:"Mobile"}),d&&t.jsx("span",{className:"px-1 py-0.5 text-[9px] font-bold uppercase rounded bg-amber-500/25 text-amber-400",children:"Room"}),f&&g&&t.jsxs("span",{className:"px-1 py-0.5 text-[9px] font-medium rounded bg-gray-500/30 text-gray-300",title:"Neighbor not heard in 7+ days",children:["Idle ",Ze(g)]})]}),t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-secondary mb-1.5",children:[t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(I,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsx("span",{className:"font-mono",children:rA(x.last_seen)})]}),(null==m?void 0:m.distanceMeters)&&t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(R,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:(U=m.distanceMeters,null===U?"—":U<1e3?`${Math.round(U)}m`:`${(U/1e3).toFixed(1)}km`)})]}),x.latitude&&x.longitude&&0!==x.latitude&&0!==x.longitude&&t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(T,{className:"w-3 h-3 text-text-muted shrink-0"}),t.jsxs("span",{className:"font-mono text-text-muted",children:[x.latitude.toFixed(2),", ",x.longitude.toFixed(2)]})]})]}),t.jsx("div",{className:"mb-1.5",style:{width:224},children:t.jsx(xA,{nodeHash:e,width:224,height:26,showArea:!0,showTooltip:!0})}),t.jsxs("div",{className:"flex gap-3 text-[10px] mb-1.5",children:[t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Packets"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:(null==m?void 0:m.frequency)||0})]}),c&&void 0!==b&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"SNR"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[b.toFixed(1)," dB"]})]}),z&&w.networkRole&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Role"}),t.jsx("span",{className:`text-[9px] font-bold uppercase px-1 py-0.5 rounded ${G[w.networkRole].bg} ${G[w.networkRole].text}`,title:G[w.networkRole].title,children:w.networkRole})]})]}),t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Adverts"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:x.advert_count||0})]}),c&&void 0!==p&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"RSSI"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[Math.round(p)," dBm"]})]}),z&&w.dataConfidence&&t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("span",{className:"text-text-muted",children:"Data"}),t.jsx("span",{className:`text-[9px] font-bold uppercase px-1 py-0.5 rounded ${O[w.dataConfidence].bg} ${O[w.dataConfidence].text}`,title:O[w.dataConfidence].title,children:w.dataConfidence})]})]})]}),z&&t.jsxs("div",{className:"flex items-center gap-2 text-[10px] mb-1.5 py-1 px-1.5 bg-amber-400/5 rounded",children:[t.jsx(_,{className:"w-3 h-3 text-amber-400 shrink-0"}),t.jsx("span",{className:"text-text-muted",children:"TxDelay"}),t.jsxs("div",{className:"flex gap-3 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-text-muted",children:"F"}),t.jsxs("span",{className:"font-mono font-semibold text-amber-400",children:["×",(w.floodFactor??w.txDelayFactor).toFixed(1)]})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-text-muted",children:"D"}),t.jsxs("span",{className:"font-mono font-semibold text-amber-400",children:["×",(w.directFactor??w.directTxDelayFactor).toFixed(1)]})]})]})]}),t.jsxs("div",{className:"flex items-center justify-between pt-1 border-t border-white/[0.08]",children:[c?t.jsxs("button",{onClick:F,disabled:M,className:"flex items-center gap-1 py-0.5 text-[10px] text-text-secondary hover:text-accent-primary hover:bg-accent-primary/10 rounded transition-colors disabled:opacity-50",title:"Ping neighbor",children:[M?t.jsx(s,{className:"w-3 h-3 animate-spin"}):t.jsx(H,{className:"w-3 h-3"}),t.jsx("span",{children:"Ping"})]}):t.jsx("div",{}),v&&t.jsx("button",{onClick:v,className:"p-1 text-text-secondary hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",title:"Remove from contacts",children:t.jsx(P,{className:"w-3.5 h-3.5"})})]}),E&&t.jsxs("div",{className:"mt-1 pt-1 border-t border-white/[0.08] text-[10px]",children:[t.jsxs("div",{className:"flex items-center gap-1 text-accent-success mb-0.5",children:[t.jsx(r,{className:"w-3 h-3"}),t.jsx("span",{className:"font-medium",children:"Ping OK"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"RTT"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.rtt_ms.toFixed(0)," ms"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"RSSI"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.rssi," dBm"]})]})]}),t.jsxs("div",{className:"flex-1 space-y-0.5",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"SNR"}),t.jsxs("span",{className:"font-mono font-semibold text-text-primary",children:[E.snr_db.toFixed(1)," dB"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-text-muted",children:"Hops"}),t.jsx("span",{className:"font-mono font-semibold text-text-primary",children:E.path.length})]})]})]})]}),Q&&t.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-white/[0.08] text-[10px] text-red-400",children:["⚠ ",Q]})]});var U}const Ke="node-markers-native",Je="node-markers-layer",Xe="node-markers-layer-local",qe="marker-standard",$e="marker-standard-neighbor",At="marker-hub",et="marker-hub-neighbor",tt="marker-gateway",rt="marker-gateway-neighbor",nt="marker-mobile",ot="marker-mobile-neighbor",it="marker-room-server",at="marker-room-server-neighbor",st="marker-local",lt="marker-blink-black",ct="marker-blink-black-local",ut="marker-blink",dt="marker-blink-local";function ft(A){var e;const t=null==(e=A.contact_type)?void 0:e.toLowerCase();return"room server"===t||"room_server"===t||"room"===t||"server"===t}function gt(A){return A.startsWith("0x")?A.slice(2,4).toUpperCase():A.slice(0,2).toUpperCase()}function ht({neighborsWithLocation:e,localNode:r,localHash:n,zeroHopNeighbors:o,lastHopNeighborMap:i,meshTopology:a,hoveredMarker:s,onMarkerHover:l,getNodeOpacity:c,shouldShowNode:u,onRequestRemove:d,openPopupId:f,onOpenPopup:g,onClosePopup:h,blinkingNodes:m}){const{current:b}=S(),p=A.useRef(!1),[x,v]=A.useState(!1);A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e)return;const t=()=>{if(!p.current)try{!function(A){const e=dA(),t=(A,e,t=0,r=!1)=>{const n=document.createElement("canvas");n.width=32,n.height=32;const o=n.getContext("2d",r?{colorSpace:"display-p3"}:void 0),i=14-t/2;return o.beginPath(),o.arc(16,16,i,0,2*Math.PI),o.fillStyle=A,o.fill(),e&&t>0&&(o.strokeStyle=e,o.lineWidth=2*t,o.stroke()),o.shadowColor="rgba(0,0,0,0.3)",o.shadowBlur=4,o.shadowOffsetY=2,{data:o.getImageData(0,0,32,32),pixelRatio:2}},r=(A,e=!1)=>{const t=document.createElement("canvas");t.width=48,t.height=48;const r=t.getContext("2d",e?{colorSpace:"display-p3"}:void 0),n=24*.35*2;return r.strokeStyle=A,r.lineWidth=5,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(24-n,24),r.lineTo(24,24-n),r.lineTo(40.8,24),r.stroke(),r.beginPath(),r.moveTo(24-.7*n,24),r.lineTo(24-.7*n,35.76),r.lineTo(35.76,35.76),r.lineTo(35.76,24),r.stroke(),r.beginPath(),r.moveTo(20.64,35.76),r.lineTo(20.64,27.36),r.lineTo(27.36,27.36),r.lineTo(27.36,35.76),r.stroke(),{data:r.getImageData(0,0,48,48),pixelRatio:2}},n=(A,e)=>{const t=document.createElement("canvas");t.width=48,t.height=48;const r=t.getContext("2d"),n=24*.35*2;return r.strokeStyle=A,r.lineWidth=5,r.lineCap="round",r.lineJoin="round",e&&(r.fillStyle=e),r.beginPath(),r.roundRect(24-n,24-.6*n,1.6*n,1.2*n,6),e&&r.fill(),r.stroke(),r.beginPath(),r.moveTo(18.96,34.08),r.lineTo(24-.6*n,40.8),r.lineTo(24,34.08),r.stroke(),{data:r.getImageData(0,0,48,48),pixelRatio:2}},o="#00FF00",i={[qe]:t(e.nodeFill,e.nodeStroke,1.5),[$e]:t(e.neighborColor),[At]:t(e.hubColor),[et]:t(e.neighborColor),[tt]:t(e.hubColor+"B3"),[rt]:t(e.neighborColor),[nt]:t("transparent",e.mobileColor,2),[ot]:t(e.neighborColor),[it]:n(e.roomColor),[at]:n(e.neighborColor,"#1a1a1c"),[st]:r(e.localColor),[lt]:t("#000000"),[ct]:r("#000000"),[ut]:t(o,void 0,0,!0),[dt]:r(o,!0)};for(const[a,s]of Object.entries(i))A.hasImage(a)&&A.removeImage(a),A.addImage(a,s.data,{pixelRatio:s.pixelRatio})}(e),p.current=!0,v(!0)}catch(A){}};e.isStyleLoaded()?t():e.once("style.load",t);const r=()=>{p.current=!1,t()},n=new MutationObserver(A=>{for(const e of A)if("data-theme"===e.attributeName){setTimeout(r,100);break}});return n.observe(document.documentElement,{attributes:!0}),()=>{n.disconnect()}},[b]);const w=A.useMemo(()=>{var A;const t=[],r=[...e].sort(([A,e],[t,r])=>{const n=(A,e)=>{var t;return ft(e)?5e3:o.has(A)?3e3:a.hubNodes.includes(A)?2e3:(null==(t=a.gatewayNodes)?void 0:t.includes(A))?1e3:0};return n(A,e)-n(t,r)});for(const[e,n]of r){if(!n.latitude||!n.longitude)continue;const r=u(e),s=c(e,r);if(s<=.01)continue;const l=o.has(e),d=a.hubNodes.includes(e),f=(null==(A=a.gatewayNodes)?void 0:A.includes(e))??!1,g=a.mobileNodes.includes(e),h=ft(n),m=a.centrality.get(e)||0,b=i.get(e),p="stale"===(null==b?void 0:b.status),x=p?Math.min(s,.5):s;let v="standard";h?v="roomServer":d?v="hub":f?v="gateway":g&&(v="mobile");const w=a.fullAffinity.get(e),y=a.txDelayRecommendations.get(e);t.push({type:"Feature",geometry:{type:"Point",coordinates:[n.longitude,n.latitude]},properties:{hash:e,name:n.node_name||n.name||"Unknown",hashPrefix:gt(e),iconType:v,isNeighbor:l,isHub:d,isGateway:f,isMobile:g,isRoomServer:h,isStale:p,isZeroHop:l,opacity:x,blinkIntensity:0,lastSeenTimestamp:null==b?void 0:b.lastSeen,centrality:m,neighborJson:JSON.stringify(n),affinityJson:w?JSON.stringify(w):void 0,txDelayRecJson:y?JSON.stringify(y):void 0,meanSnr:(null==b?void 0:b.avgSnr)??void 0,meanRssi:(null==b?void 0:b.avgRssi)??void 0}})}return{type:"FeatureCollection",features:t}},[e,o,i,a,c,u]),y=A.useMemo(()=>(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)?{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{hash:"local",name:r.name,hashPrefix:n?gt(n):"",iconType:"local",isNeighbor:!1,isHub:!1,isGateway:!1,isMobile:!1,isRoomServer:!1,isStale:!1,isZeroHop:!1,opacity:1,blinkIntensity:0,centrality:0}}]}:{type:"FeatureCollection",features:[]},[r,n]),k=A.useCallback(A=>{var e;if(!A.features||0===A.features.length)return;const t=null==(e=A.features[0].properties)?void 0:e.hash;t&&g&&g(t)},[g]),C=A.useCallback(A=>{var e,t;if(!A.features||0===A.features.length)return;const r=null==(e=null==b?void 0:b.getMap)?void 0:e.call(b);r&&(r.getCanvas().style.cursor="pointer");const n=null==(t=A.features[0].properties)?void 0:t.hash;n&&l(n)},[b,l]),B=A.useCallback(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);e&&(e.getCanvas().style.cursor=""),l(null)},[b,l]);A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e||!x)return;const t=[Je,Xe];for(const r of t)e.on("click",r,k),e.on("mouseenter",r,C),e.on("mouseleave",r,B);return()=>{for(const A of t)e.off("click",A,k),e.off("mouseenter",A,C),e.off("mouseleave",A,B)}},[b,x,k,C,B]);const M=A.useRef(w),D=A.useRef(y);A.useEffect(()=>{M.current=w,D.current=y},[w,y]),A.useEffect(()=>{var A;const e=null==(A=null==b?void 0:b.getMap)?void 0:A.call(b);if(!e||!x||!m||0===m.size)return;const t=e.getSource(Ke),r=e.getSource(`${Ke}-local`);if(t||r){if(t){const A=M.current;let e=!1;const r=A.features.map(A=>{const t=m.get(A.properties.hash)??0;return t!==A.properties.blinkIntensity?(e=!0,{...A,properties:{...A.properties,blinkIntensity:t}}):A});e&&t.setData({type:"FeatureCollection",features:r})}if(r&&n){const A=m.get(n)??0,e=D.current;e.features.length>0&&e.features[0].properties.blinkIntensity!==A&&r.setData({type:"FeatureCollection",features:[{...e.features[0],properties:{...e.features[0].properties,blinkIntensity:A}}]})}}},[b,x,m,n]);const E=A.useMemo(()=>{if(!f)return null;if("local"===f&&r)return{longitude:r.longitude,latitude:r.latitude,isLocal:!0,name:r.name,hash:n};const A=w.features.find(A=>A.properties.hash===f);if(!A)return null;const e=A.properties,t=e.txDelayRecJson?JSON.parse(e.txDelayRecJson):void 0;return{longitude:A.geometry.coordinates[0],latitude:A.geometry.coordinates[1],isLocal:!1,hash:e.hash,hashPrefix:e.hashPrefix,name:e.name,isHub:e.isHub,isGateway:e.isGateway,isBackbone:"backbone"===(null==t?void 0:t.networkRole),isZeroHop:e.isZeroHop,isMobile:e.isMobile,isRoomServer:e.isRoomServer,isStale:e.isStale,lastSeenTimestamp:e.lastSeenTimestamp,centrality:e.centrality,neighbor:e.neighborJson?JSON.parse(e.neighborJson):void 0,affinity:e.affinityJson?JSON.parse(e.affinityJson):void 0,txDelayRec:t,meanSnr:e.meanSnr,meanRssi:e.meanRssi}},[f,r,n,w]);if(!x)return null;const N=dA(),Q=["case",[">",["get","blinkIntensity"],.66],ut,[">",["get","blinkIntensity"],.33],lt,["==",["get","iconType"],"roomServer"],["case",["get","isNeighbor"],at,it],["==",["get","iconType"],"hub"],["case",["get","isNeighbor"],et,At],["==",["get","iconType"],"gateway"],["case",["get","isNeighbor"],rt,tt],["==",["get","iconType"],"mobile"],["case",["get","isNeighbor"],ot,nt],["case",["get","isNeighbor"],$e,qe]],j=["interpolate",["linear"],["zoom"],6,.25,10,1];return t.jsxs(t.Fragment,{children:[t.jsx(z,{id:Ke,type:"geojson",data:w,children:t.jsx(G,{id:Je,type:"symbol",layout:{"icon-image":Q,"icon-size":j,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"symbol-sort-key":["get","opacity"]},paint:{"icon-opacity":["get","opacity"]}})}),t.jsx(z,{id:`${Ke}-local`,type:"geojson",data:y,children:t.jsx(G,{id:Xe,type:"symbol",layout:{"icon-image":["case",[">",["get","blinkIntensity"],.66],dt,[">",["get","blinkIntensity"],.33],ct,st],"icon-size":j,"icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{"icon-opacity":1}})}),E&&h&&t.jsx(O,{longitude:E.longitude,latitude:E.latitude,offset:{center:[0,0],top:[0,12],"top-left":[6,12],"top-right":[-6,12],bottom:[0,-12],"bottom-left":[6,-12],"bottom-right":[-6,-12],left:[12,0],right:[-12,0]},maxWidth:"280px",closeOnClick:!0,onClose:h,className:"maplibre-popup",children:E.isLocal?t.jsxs("div",{className:"text-sm",children:[t.jsx("strong",{className:"text-base",children:E.name}),E.hash&&t.jsx("span",{className:"ml-2 font-mono text-xs text-text-muted bg-surface-elevated px-1.5 py-0.5 rounded",children:gt(E.hash)}),t.jsx("br",{}),t.jsx("span",{style:{color:N.localColor},className:"font-medium",children:"This Node (Local)"}),t.jsx("br",{}),r&&t.jsxs("span",{className:"text-xs text-text-muted",children:[r.latitude.toFixed(5),", ",r.longitude.toFixed(5)]})]}):E.neighbor&&E.hash?t.jsx(Ve,{hash:E.hash,hashPrefix:E.hashPrefix,name:E.name,isHub:E.isHub,isGateway:E.isGateway,isBackbone:E.isBackbone,isZeroHop:E.isZeroHop,isMobile:E.isMobile,isRoomServer:E.isRoomServer,isStale:E.isStale,lastSeenTimestamp:E.lastSeenTimestamp,centrality:E.centrality,affinity:E.affinity,meanSnr:E.meanSnr,meanRssi:E.meanRssi,neighbor:E.neighbor,txDelayRec:E.txDelayRec,onRemove:d?()=>d(E.hash,E.name):void 0}):null})]})}const mt=[Je,Xe];A.createContext(null);const bt="topology-validated-edges-native",pt="topology-weak-edges-native",xt="neighbor-edges-native",vt="topology-weak-edges-native",wt="topology-validated-edges-native",yt="neighbor-edges-native",kt={type:"FeatureCollection",features:[]},Ct={"line-cap":"round","line-join":"round"},Bt={"line-color":"transparent","line-width":16,"line-opacity":0};function Mt({showTopology:e,isExiting:r,hoveredEdgeKey:n,highlightedLoopEdges:o,onEdgeHover:i,onLoopHover:a,loops:s=[],neighborNames:l={},opacityBias:c=.5,widthMultiplier:u=1,trafficFilter:d=0,showNeighborLines:f=!0,disableHover:g=!1}){const{current:h}=S(),m=e||r,b=!0,p=f?"visible":"none",x=g||r,v=A.useRef(null),w=A.useRef(x),y=A.useRef(new Map),k=A.useRef(l),C=A.useRef(a);A.useLayoutEffect(()=>{w.current=x,k.current=l,C.current=a});const B=A.useMemo(()=>function(A){const e=new Map;for(const t of A)for(const A of t.edgeKeys){const r=e.get(A)??[];r.push(t),e.set(A,r)}return e}(s),[s]);A.useLayoutEffect(()=>{y.current=B},[B]);const M=A.useCallback(A=>{var e,t;if(w.current)return;if(!A.features||0===A.features.length)return;const r=A.features[0].properties;if(!(null==r?void 0:r.key))return;const n=r.key;if(n!==v.current){v.current=n;const o=!0===r.isNeighborEdge||"true"===r.isNeighborEdge,a=!0===r.isLoopEdge||"true"===r.isLoopEdge;if(o){const t={key:n,fromName:"Local",toName:r.name,certainCount:Number(r.packetCount)||0,confidence:1,isBackbone:!1,isLoopEdge:!1,isDirectPath:!0,isZeroHop:!0,symmetryRatio:1,dominantDirection:"balanced",isHubConnection:!1};i(n,[A.lngLat.lng,A.lngLat.lat],t),null==(e=C.current)||e.call(C,null)}else if(a&&C.current){const e=y.current.get(n)??[];if(e.length>0){const t=new Set;for(const A of e)for(const e of A.edgeKeys)t.add(e);const r={loops:e,highlightedEdgeKeys:t,hoveredEdgeKey:n,nodeNames:e[0].nodes.map(A=>k.current[A]||A.substring(0,4))};C.current(r,[A.lngLat.lng,A.lngLat.lat]),i(n)}else{const e={key:n,fromName:r.fromName,toName:r.toName,certainCount:Number(r.certainCount),confidence:Number(r.confidence),isBackbone:!0===r.isBackbone||"true"===r.isBackbone,isLoopEdge:!0,isDirectPath:!0===r.isDirectPath||"true"===r.isDirectPath,isZeroHop:!0===r.isZeroHop||"true"===r.isZeroHop,symmetryRatio:Number(r.symmetryRatio),dominantDirection:r.dominantDirection,isHubConnection:!0===r.isHubConnection||"true"===r.isHubConnection};i(n,[A.lngLat.lng,A.lngLat.lat],e)}}else{const e={key:n,fromName:r.fromName,toName:r.toName,certainCount:Number(r.certainCount),confidence:Number(r.confidence),isBackbone:!0===r.isBackbone||"true"===r.isBackbone,isLoopEdge:a,isDirectPath:!0===r.isDirectPath||"true"===r.isDirectPath,isZeroHop:!0===r.isZeroHop||"true"===r.isZeroHop,symmetryRatio:Number(r.symmetryRatio),dominantDirection:r.dominantDirection,isHubConnection:!0===r.isHubConnection||"true"===r.isHubConnection};i(n,[A.lngLat.lng,A.lngLat.lat],e),null==(t=C.current)||t.call(C,null)}}},[i]),D=A.useCallback(()=>{var A;null!==v.current&&(v.current=null,i(null),null==(A=C.current)||A.call(C,null))},[i]);A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e||!m)return;const t="topology-validated-edges-hitarea-native",r=()=>{try{return e.getStyle()&&e.getLayer(t)}catch{return!1}},n=()=>!!r()&&(e.on("mousemove",t,M),e.on("mouseleave",t,D),!0);if(!n()){const A=()=>{n()&&e.off("styledata",A)};return e.on("styledata",A),()=>{try{e.off("styledata",A),r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}}return()=>{try{r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}},[h,m,M,D]),A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e||!f)return;const t="neighbor-edges-hitarea-native",r=()=>{try{return e.getStyle()&&e.getLayer(t)}catch{return!1}},n=()=>!!r()&&(e.on("mousemove",t,M),e.on("mouseleave",t,D),!0);if(!n()){const A=()=>{n()&&e.off("styledata",A)};return e.on("styledata",A),()=>{try{e.off("styledata",A),r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}}return()=>{try{r()&&(e.off("mousemove",t,M),e.off("mouseleave",t,D))}catch{}}},[h,b,f,M,D]),A.useEffect(()=>{var A;const e=null==(A=null==h?void 0:h.getMap)?void 0:A.call(h);if(!e)return;let t=null;const r=(A,t)=>{try{if(e.getLayer(A)&&e.getLayer(t))return e.moveLayer(A,t),!0}catch{}return!1},n=()=>{try{if(!e.getLayer("node-markers-layer"))return;r(yt,"node-markers-layer"),r("neighbor-edges-hitarea-native",yt),(r(wt,"neighbor-edges-hitarea-native")||r(wt,"node-markers-layer"))&&r("topology-validated-edges-hitarea-native",wt),r(vt,"topology-validated-edges-hitarea-native")}catch{}},o=()=>{t&&clearTimeout(t),t=setTimeout(n,50)},i=setTimeout(n,100);e.on("styledata",o);const a=A=>{(A.sourceId===bt||A.sourceId===pt||A.sourceId===xt)&&o()};return e.on("sourcedata",a),()=>{clearTimeout(i),t&&clearTimeout(t);try{e.off("styledata",o),e.off("sourcedata",a)}catch{}}},[h,m,b,f]);const E=x?null:n,N=function(A,e,t,r,n){const o=CA(),i=null!==A,a=n&&n.size>0,s=a?Array.from(n):[],l=e<=0?["get","baseColor"]:["case",[">=",["get","brightnessScore"],1-.5*e],"#FFFFFF",["get","baseColor"]],c=e<=0?1:["max",.1,["+",1,["*",e,3,["-",["get","brightnessScore"],.5]]]],u=a?["in",["get","key"],["literal",s]]:!!i&&["==",["get","key"],A],d=i||a,f=o.edges.hoverLoop??"#A78BFA";return{"line-color":d?["case",u,a?f:["get","hoverColor"],l]:l,"line-width":d?["case",u,["max",["*",["get","baseWidth"],t,1.3],3.5],["*",["get","baseWidth"],t]]:["*",["get","baseWidth"],t],"line-opacity":["case",["<",["get","brightnessScore"],r],0,d?["case",u,["min",["*",["get","baseOpacity"],1.25],1],["*",["get","baseOpacity"],c,.35]]:["*",["get","baseOpacity"],c]]}}(E,c,u,d,x?null:o),Q=function(A){const e=null!==A,{YELLOW:t,GREEN:r,RED:n,GRAY:o}=W,i=["to-number",["get","listenerScore"],0],a=["to-number",["get","loudScore"],0],s=["/",i,["max",["+",i,a],1]],l=["*",["+",.2,["*",["to-number",["get","trafficWeight"],0],.8]],8];return{"line-color":["case",["all",["==",i,0],["==",a,0]],o,[">=",s,.97],r,["<=",s,.03],n,["interpolate",["linear"],s,.03,n,.5,t,.97,r]],"line-width":["interpolate",["linear"],["zoom"],6,e?["case",["==",["get","key"],A],["max",["*",l,.25],1.25],["*",l,.25]]:["*",l,.25],10,e?["case",["==",["get","key"],A],["max",l,5],l]:l],"line-opacity":e?["case",["==",["get","key"],A],1,.35]:.9}}(E);return t.jsxs(t.Fragment,{children:[m&&t.jsx(z,{id:pt,type:"geojson",data:kt,children:t.jsx(G,{id:vt,type:"line",paint:N,layout:Ct})}),m&&t.jsxs(z,{id:bt,type:"geojson",data:kt,children:[t.jsx(G,{id:"topology-validated-edges-hitarea-native",type:"line",paint:Bt,layout:Ct}),t.jsx(G,{id:wt,type:"line",paint:N,layout:Ct})]}),t.jsxs(z,{id:xt,type:"geojson",data:kt,children:[t.jsx(G,{id:"neighbor-edges-hitarea-native",type:"line",paint:Bt,layout:{...Ct,visibility:p}}),t.jsx(G,{id:yt,type:"line",paint:Q,layout:{...Ct,visibility:p}})]})]})}const Dt=["topology-validated-edges-hitarea-native","topology-validated-edges-native","topology-weak-edges-native","neighbor-edges-hitarea-native","neighbor-edges-native"];function Et({targetHash:e,nodeCoordinates:t,onComplete:r}){const{current:n}=S(),o=A.useRef(null);return A.useEffect(()=>{if(!n||!e||e===o.current)return;const A=t.get(e);if(!A)return;const i=n.getMap();i.isMoving()&&i.stop(),o.current=e;const[a,s]=A;n.flyTo({center:[s,a],zoom:10,duration:2500,essential:!0}),setTimeout(()=>{null==r||r()},2600)},[e,t,n,r]),null}function Nt({highlightedEdgeKey:e,validatedPolylines:t,weakPolylines:r,onEnsureTopology:n}){const{current:o}=S(),i=A.useRef(null);return A.useEffect(()=>{if(!o||!e)return;if(e===i.current)return;i.current=e,n();const A=t.find(A=>A.edge.key===e)||r.find(A=>A.edge.key===e);if(!A)return;if(o.getMap().isMoving())return;const a=(A.from[0]+A.to[0])/2,s=(A.from[1]+A.to[1])/2,l=o.getZoom(),c=Math.max(l,11);o.easeTo({center:[s,a],zoom:c,duration:500})},[e,t,r,o,n]),null}function Qt(A,e,t,r){const n=(t-A)*Math.PI/180,o=(r-e)*Math.PI/180,i=Math.sin(n/2)*Math.sin(n/2)+Math.cos(A*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371e3}function jt(A,e,t,r=64){const n=[],o=t/6371e3*(180/Math.PI),i=o/Math.cos(e*Math.PI/180);for(let a=0;a<=r;a++){const t=a/r*2*Math.PI,s=A+i*Math.cos(t),l=e+o*Math.sin(t);n.push([s,l])}return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}}function Pt({ghost:e,neighborCoordinates:r,onHighlightedNeighborsChange:n}){const{current:o}=S(),i=A.useRef(null),a=A.useRef(null),s=A.useMemo(()=>e?new Set(e.commonNeighbors):new Set,[e]);A.useEffect(()=>{null==n||n(s)},[s,n]);const l=A.useMemo(()=>{if(!(null==e?void 0:e.commonNeighbors)||e.commonNeighbors.length<2)return 8e3;let A=0;const t=[];for(const n of e.commonNeighbors){const A=r.get(n);A&&t.push(A)}e.estimatedLocation&&t.push([e.estimatedLocation.lat,e.estimatedLocation.lon]);for(let e=0;eA&&(A=n)}return Math.max(A,2e3)},[e,r]),c=A.useMemo(()=>{if(!(null==e?void 0:e.estimatedLocation))return{type:"FeatureCollection",features:[]};const{lat:A,lon:t,uncertaintyM:r}=e.estimatedLocation,n=.5*l,o=r>0?r:2e3;return{type:"FeatureCollection",features:[jt(t,A,Math.max(500,Math.min(o,n)))]}},[e,l]);if(A.useEffect(()=>{if(!o)return;const A=o.getMap();if(e&&e.prefix!==a.current){if(a.current=e.prefix,!i.current&&A.getZoom()>3){const e=A.getCenter();i.current={center:[e.lng,e.lat],zoom:A.getZoom(),pitch:A.getPitch(),bearing:A.getBearing()}}const t=[];for(const A of e.commonNeighbors){const e=r.get(A);e&&t.push([e[1],e[0]])}if(e.estimatedLocation&&t.push([e.estimatedLocation.lon,e.estimatedLocation.lat]),t.length>0){const r=()=>{var n;if(A.isMoving())setTimeout(r,100);else if(1===t.length)o.flyTo({center:t[0],zoom:13,duration:1500});else{let A=1/0,r=-1/0,i=1/0,a=-1/0;for(const[e,n]of t)A=Math.min(A,e),r=Math.max(r,e),i=Math.min(i,n),a=Math.max(a,n);if(null==(n=e.estimatedLocation)?void 0:n.uncertaintyM){const t=e.estimatedLocation.uncertaintyM/111e3;A-=t,r+=t,i-=t,a+=t}o.fitBounds([[A,i],[r,a]],{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,duration:1500})}};setTimeout(r,50)}}if(!e&&null!==a.current&&(a.current=null,i.current)){const e=i.current,t=()=>{A.isMoving()?setTimeout(t,100):(o.flyTo({center:e.center,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,duration:1e3}),i.current=null)};setTimeout(t,50)}},[e,o,r]),!(null==e?void 0:e.estimatedLocation))return null;return t.jsx(z,{id:"ghost-uncertainty-circle",type:"geojson",data:c,children:t.jsx(G,{id:"ghost-uncertainty-fill",type:"fill",paint:{"fill-color":"rgba(167, 139, 250, 0.15)","fill-opacity":.8}})})}!function(A){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);e&&(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16))}(kA.edges.neighborHover);const Ft={longitude:0,latitude:0,zoom:2};function St(A,e,t,r){const n=(t-A)*Math.PI/180,o=(r-e)*Math.PI/180,i=Math.sin(n/2)*Math.sin(n/2)+Math.cos(A*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371}function Lt({data:A}){const e=A.subtitle&&"loop"===A.type,r=A.subtitle&&"loop"!==A.type;return t.jsxs("div",{className:"w-[540px]",children:[t.jsxs("div",{className:"flex items-center justify-between h-5",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[A.title.icon&&t.jsx("span",{className:`${A.title.color} text-base leading-none flex-shrink-0`,children:A.title.icon}),t.jsx("span",{className:`${A.title.color} font-semibold text-[13px] truncate`,children:A.title.text}),r&&t.jsx("span",{className:`${A.subtitle.color} text-[11px] flex-shrink-0`,children:A.subtitle.text})]}),A.badges.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:A.badges.map((A,e)=>t.jsx("span",{className:`${A.color} text-[11px] font-medium`,children:A.text},e))})]}),e&&t.jsx("div",{className:"h-4 mt-0.5 overflow-hidden",children:t.jsx("span",{className:"font-mono text-[10px] text-text-muted truncate block",children:A.subtitle.text})}),t.jsx("div",{className:`flex items-center gap-4 h-4 ${e?"mt-1":"mt-1.5"} text-[11px]`,children:A.stats.map((A,e)=>t.jsxs("span",{className:"whitespace-nowrap",children:[t.jsx("span",{className:`font-mono tabular-nums font-semibold ${A.color??"text-text-primary"}`,children:A.value}),t.jsx("span",{className:"text-text-muted ml-1",children:A.label}),A.unit&&t.jsx("span",{className:"text-text-muted/50 ml-0.5",children:A.unit})]},e))})]})}function It({neighbors:e,localNode:r,localHash:n,onRemoveNode:o,selectedNodeHash:i,onNodeSelected:a,highlightedEdgeKey:s,highlightedGhost:l}){const c=A.useRef(null),u=nA(),d=oA(),f=iA(),g=aA(),h=sA(),[m,b]=A.useState(!1),p=lA(A=>A.preloadFromNodes),x=lA(A=>A.isLoading),v=lA(A=>A.terrainGrid),w=n??h,y=A.useMemo(()=>{const A=[];for(const[,t]of Object.entries(e))t.latitude&&t.longitude&&A.push([t.latitude,t.longitude]);return A},[e]),k=A.useMemo(()=>function(A,e){let t=[...A];if((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&t.push([e.latitude,e.longitude]),0===t.length)return null;if(1===t.length){const[A,e]=t[0];return{longitude:e,latitude:A,zoom:14}}t=function(A,e){if(A.length<=2)return A;let t,r;if((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude))t=e.latitude,r=e.longitude;else{let e=0,n=0;for(const[t,r]of A)e+=t,n+=r;t=e/A.length,r=n/A.length}const n=A.map(([A,e])=>({pos:[A,e],dist:St(t,r,A,e)}));n.sort((A,e)=>A.dist-e.dist);const o=n[Math.floor(n.length/2)].dist,i=Math.max(3*o,50),a=n.filter(A=>A.dist<=i).map(A=>A.pos);return a.length<.5*A.length?A:a}(t,e);let r=1/0,n=-1/0,o=1/0,i=-1/0;for(const[f,g]of t)r=Math.min(r,g),n=Math.max(n,g),o=Math.min(o,f),i=Math.max(i,f);const a=(r+n)/2,s=(o+i)/2,l=i-o,c=n-r,u=Math.max(l,c);let d=16;return u>0&&(d=Math.floor(Math.log2(360/u*1.2)),d=Math.max(1,Math.min(14,d))),d=Math.min(d+1,12),{longitude:a,latitude:s,zoom:d}}(y,r),[y,r]),[C,B]=A.useState(()=>k??Ft),M=A.useRef(!1);A.useEffect(()=>{!M.current&&k&&(B(k),M.current=!0,setTimeout(()=>b(!0),50))},[k]);const[D,E]=A.useState(!1),[N,Q]=A.useState(!1),[j,P]=A.useState(!0),[F,S]=A.useState(!1),[L,I]=A.useState(!1),[R,T]=A.useState("all"),[_,H]=A.useState(null),[z,G]=A.useState(null),[O]=A.useState(0),[W]=A.useState(.5),[V]=A.useState(0),[K,J]=A.useState(null),[tA,rA]=A.useState(""),[uA,dA]=A.useState(!1),[fA,gA]=A.useState("fetching"),[hA,mA]=A.useState(!1),[bA,pA]=A.useState(0),[xA,wA]=A.useState(!1),[kA,CA]=A.useState(null),MA=A.useCallback(A=>CA(A),[]),DA=A.useCallback(()=>CA(null),[]),[,NA]=A.useState(new Set),jA=VA(A=>A.coveragePoints),PA=VA(A=>A.isVisible),FA=VA(A=>A.brightness),LA=VA(A=>A.openModal),RA=qA(A=>A.isEnabled),_A=qA(A=>A.toggle),HA=A.useRef(!1);A.useEffect(()=>{jA.length>0&&PA&&!HA.current&&(P(!1),HA.current=!0)},[jA.length,PA]);const zA=A.useRef(null);A.useEffect(()=>{if(i&&i!==zA.current){zA.current=i;const A=setTimeout(()=>{CA(i)},1250);return()=>clearTimeout(A)}},[i]);const[GA,OA]=A.useState(null),[UA,YA]=A.useState(null),WA=A.useCallback((A,e,t)=>{G(A),A&&e&&t?OA({longitude:e[0],latitude:e[1],type:"topology",properties:{key:t.key,fromName:t.fromName,toName:t.toName,certainCount:t.certainCount,confidence:t.confidence,isBackbone:t.isBackbone,isLoopEdge:t.isLoopEdge,isDirectPath:t.isDirectPath,isHubConnection:t.isHubConnection,color:"",width:0,opacity:0,symmetryRatio:t.symmetryRatio,dominantDirection:t.dominantDirection}}):A||OA(null)},[]),ZA=A.useCallback((A,e)=>{YA(A),A&&OA(null)},[]),KA=A.useMemo(()=>{const A={};for(const[t,r]of Object.entries(e))A[t]=r.node_name||r.name||t.substring(0,4);return w&&(A[w]="You"),A},[e,w]),XA=A.useMemo(()=>Object.entries(e).filter(([,A])=>A.latitude&&A.longitude),[e]),$A=A.useMemo(()=>{const A=new Map;w&&(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)&&A.set(w,[r.latitude,r.longitude]);for(const[e,t]of XA)t.latitude&&t.longitude&&A.set(e,[t.latitude,t.longitude]);return A},[w,r,XA]),Ae=A.useMemo(()=>{const A=new Map;for(const e of f)"expired"!==e.status&&A.set(e.hash,{hash:e.hash,prefix:e.prefix,count:e.count,avgRssi:e.avgRssi,avgSnr:e.avgSnr,lastSeen:e.lastSeen,confidence:1,status:e.status});return A},[f]),ee=A.useMemo(()=>{var A,t;const r=new Set;for(const n of Ae.keys())(null==(A=e[n])?void 0:A.latitude)&&(null==(t=e[n])?void 0:t.longitude)&&r.add(n);return r},[Ae,e]),te=A.useMemo(()=>{if(0===ee.size||!w)return new Map;const A=q.getPackets();if(0===A.length)return new Map;const e=AA(w);return Z(A,ee,e).scores},[ee,w,g.packetCount]),re=A.useCallback(A=>!!(w&&(A.fromHash===w&&ee.has(A.toHash)||A.toHash===w&&ee.has(A.fromHash))),[w,ee]),ne=A.useMemo(()=>{var A,t;if(0===f.length||!w)return[];if(g.backgroundLoadComplete)return[];const r=[];for(const n of f){if("expired"===n.status)continue;if(!(null==(A=e[n.hash])?void 0:A.latitude)||!(null==(t=e[n.hash])?void 0:t.longitude))continue;const o=[w,n.hash].sort(),i=`${o[0]}~${o[1]}`;r.push({fromHash:w,toHash:n.hash,key:i,packetCount:n.count,avgConfidence:1,strength:.8,avgRecency:1,hopDistanceFromLocal:0,isHubConnection:!1,isCertain:!0,certainCount:n.count,isLoopEdge:!1,forwardCount:n.count,reverseCount:0,symmetryRatio:0,dominantDirection:"forward",floodCount:n.count,directCount:0,isDirectPathEdge:!1,isZeroHop:!0,avgRssi:n.avgRssi,avgSnr:n.avgSnr})}return r},[f,w,g.backgroundLoadComplete,e]),oe=A.useMemo(()=>{const A=[];if(ne.length>0&&!g.backgroundLoadComplete){for(const e of ne){const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A}for(const e of u.validatedEdges){if(re(e))continue;const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A},[u.validatedEdges,$A,re,ne,g.backgroundLoadComplete]),ie=A.useMemo(()=>{const A=[];for(const e of u.weakEdges){if(re(e))continue;const t=$A.get(e.fromHash),r=$A.get(e.toHash);t&&r&&A.push({from:t,to:r,edge:e})}return A},[u.weakEdges,$A,re]),ae=A.useMemo(()=>{if(!(null==r?void 0:r.latitude)||!(null==r?void 0:r.longitude))return[];const A=[],t=[r.latitude,r.longitude],n=new Map;for(const e of u.lastHopNeighbors)n.set(e.hash,e.count);const o=new Map;for(const e of f)o.set(e.hash,e.count);for(const r of ee){const i=e[r];if(!(null==i?void 0:i.latitude)||!(null==i?void 0:i.longitude))continue;const a=o.get(r),s=n.get(r);A.push({from:t,to:[i.latitude,i.longitude],hash:r,neighbor:i,lastHopData:Ae.get(r)??null,rxAdvertCount:a,txProxyCount:s})}return A},[r,ee,e,Ae,u.lastHopNeighbors,f]),se=A.useMemo(()=>new Set(u.loopEdgeKeys),[u.loopEdgeKeys]),le=A.useMemo(()=>new Set(u.backboneEdges),[u.backboneEdges]),ce=A.useMemo(()=>{let A=0;if(ne.length>0&&!g.backgroundLoadComplete){for(const e of ne)e.certainCount>A&&(A=e.certainCount);return A||1}for(const e of u.validatedEdges)e.certainCount>A&&(A=e.certainCount);return A||1},[u.validatedEdges,ne,g.backgroundLoadComplete]),ue=A.useRef(null);A.useLayoutEffect(()=>{var A,e;ue.current=(null==(e=null==(A=c.current)?void 0:A.getMap)?void 0:e.call(A))??null});const de=X(),fe=A.useMemo(()=>q.getPackets(),[de]);!function({map:e,nodeCoordinates:t,packets:r,localHash:n,neighbors:o,meshTopology:i,enabled:a=!0}){const s=A.useRef(null),l=e&&"current"in e?e.current:e;A.useEffect(()=>{s.current=l},[l]);const c=A.useRef(!1),u=A.useRef(null),d=A.useRef([]),f=A.useRef(0),g=A.useRef(!1),[h,m]=A.useState(!1),b=A.useRef(null),p=A.useRef([]),x=A.useRef(new Map),v=A.useRef(t);A.useEffect(()=>{v.current=t},[t]),A.useEffect(()=>{x.current=function(A,e){const t=new Map;for(const r of Object.keys(A)){const A=AA(r);t.has(A)||t.set(A,r)}if(e){const A=AA(e);t.set(A,e)}return t}(o,n)},[o,n]),A.useEffect(()=>{if(!a){b.current&&(clearTimeout(b.current),b.current=null),p.current=[],null!==u.current&&(cancelAnimationFrame(u.current),u.current=null),d.current=[];const A=s.current;if(A&&c.current){const e=A.getSource(_e);e&&e.setData({type:"FeatureCollection",features:[]})}g.current=!1,f.current=0}},[a]),A.useEffect(()=>{const A=l;if(!A)return;let e=null,t=!1;const r=()=>{if(!t&&!c.current)try{A.getLayer(He)&&A.removeLayer(He),A.getSource(_e)&&A.removeSource(_e),A.addSource(_e,{type:"geojson",data:{type:"FeatureCollection",features:[]}});const t=A.getLayer(Oe)?Oe:void 0;A.addLayer({id:He,type:"line",source:_e,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["any",["==",["get","isSpeculative"],!0],["==",["get","isSpeculative"],"true"]],"#8B7BAD","#00FFFF"],"line-width":["case",["any",["==",["get","isSpeculative"],!0],["==",["get","isSpeculative"],"true"]],1.875,2.5],"line-opacity":["*",["get","opacityMult"],["interpolate",["linear"],["get","intensity"],0,0,.1,.8,.5,1,1,1]]}},t),c.current=!0,m(!0),e&&(clearInterval(e),e=null)}catch{}};return A.isStyleLoaded()&&r(),A.once("style.load",()=>{r()}),c.current||(e=setInterval(()=>{c.current?e&&clearInterval(e):r()},100),setTimeout(()=>{e&&(clearInterval(e),e=null)},5e3)),()=>{t=!0,e&&clearInterval(e),null!==u.current&&(cancelAnimationFrame(u.current),u.current=null);const A=s.current;if(A&&c.current){try{A.getLayer(He)&&A.removeLayer(He),A.getSource(_e)&&A.removeSource(_e)}catch{}c.current=!1,m(!1)}}},[l]);const w=A.useRef(()=>{});A.useEffect(()=>{w.current=()=>{const A=s.current;if(!A)return;const e=A.getSource(_e);if(!e)return;const t=performance.now(),r=d.current,n=[],o=[];for(const i of r){const A=t-i.startTime-i.delay;if(A<(i.isSpeculative?Ge:ze)){o.push(i);const e=i.isSpeculative?Ye(A):Ue(A);e>0&&n.push({type:"Feature",properties:{intensity:e,opacityMult:i.isSpeculative?.5:1,isSpeculative:i.isSpeculative??!1},geometry:{type:"LineString",coordinates:[i.fromCoord,i.toCoord]}})}}e.setData({type:"FeatureCollection",features:n}),d.current=o,o.length>0?u.current=requestAnimationFrame(()=>w.current()):u.current=null}},[]);const y=A.useCallback(()=>{const A=s.current;A&&function(A){if(!A.getLayer(He))return;const e=A.getLayer(Oe)?Oe:void 0;try{A.moveLayer(He,e)}catch{}}(A),null===u.current&&(u.current=requestAnimationFrame(()=>w.current()))},[]),k=A.useCallback(()=>{if(!s.current||!c.current)return;const A=p.current;if(p.current=[],b.current=null,0===A.length)return;const e=x.current,t=v.current;if(0===e.size)return;const r=performance.now();let o=0,a=!1;const l=new Set;for(const s of A){const A=$(s,n);if(!A||A.original.length<2)continue;const c=A.original;let u=0,f=null;for(let n=0;n0){A.sort((A,e)=>e.confidence-A.confidence);const e=Math.max(1,Math.ceil(.25*A.length)),n=A.slice(0,e),i=o+150*u;for(const{edgeKey:A,otherHash:o}of n){const e=t.get(f),n=t.get(o);d.current.push({edgeKey:A,fromCoord:We(e),toCoord:We(n),startTime:r,delay:i,isSpeculative:!0}),l.add(A),a=!0}}}u>0&&(o+=150*u*.5)}a&&y()},[n,i,y]);A.useEffect(()=>{const A=s.current;if(!a)return;if(!A)return;if(!h)return;if(0===r.length)return;const e=Date.now(),t=f.current;if(!g.current){g.current=!0;const A=(e-3e4)/1e3,t=r.filter(e=>(e.timestamp??0)>=A),n=Math.max(...r.map(A=>A.timestamp??0));if(f.current=n,t.length>0){t.sort((A,e)=>(A.timestamp??0)-(e.timestamp??0));const A=t.slice(-20);p.current.push(...A),k()}return}const n=r.filter(A=>(A.timestamp??0)>t);0!==n.length&&(f.current=Math.max(...n.map(A=>A.timestamp??0)),p.current.push(...n),b.current&&clearTimeout(b.current),b.current=setTimeout(k,175))},[a,r,k,h]),A.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[])}({map:ue,nodeCoordinates:$A,packets:fe,localHash:w,neighbors:e,meshTopology:u,enabled:RA});const{isExiting:ge,isAnimating:he,resetAnimationState:me}=function({map:e,showTopology:t,validatedPolylines:r,weakPolylines:n,maxCertainCount:o,loopEdgeKeys:i,backboneEdgeKeys:a,highlightedEdgeKey:s,neighbors:l,validatedSourceId:c,weakSourceId:u,neighborPolylines:d=[],showNeighborLines:f=!0,neighborSourceId:g,neighborLinkScores:h=new Map}){const m=A.useRef(null);A.useEffect(()=>{const A=e&&"current"in e?e.current:e;m.current=A});const b=A.useRef(new Map),p=A.useRef(1),x=A.useRef(new Map),v=A.useRef(new Map),w=A.useRef(!1),y=A.useRef(null),k=A.useRef(t),C=A.useRef(new Set),B=A.useRef(""),M=A.useRef(new Map),D=A.useRef(""),E=A.useRef(""),N=A.useRef(""),Q=A.useRef(r),j=A.useRef(n),P=A.useRef(o),F=A.useRef(i),S=A.useRef(a),L=A.useRef(s),I=A.useRef(l),R=A.useRef(d),T=A.useRef(f),_=A.useRef(h);A.useEffect(()=>{Q.current=r,j.current=n,P.current=o,F.current=i,S.current=a,L.current=s,I.current=l,R.current=d,T.current=f,_.current=h},[r,n,o,i,a,s,l,d,f,h]);const H=A.useCallback((A=!1)=>{var e,t,r,n,o,i,a,s,l,d;const f=m.current;if(!f)return;const h=f.getSource(c),w=f.getSource(u),y=f.getSource(g);if(h){const o=Se(Q.current,!0,b.current,p.current,x.current,v.current,P.current,F.current,S.current,L.current,I.current),i=`${o.features.length}:${(null==(t=null==(e=o.features[0])?void 0:e.properties)?void 0:t.key)??""}:${(null==(n=null==(r=o.features[o.features.length-1])?void 0:r.properties)?void 0:n.key)??""}:${Array.from(b.current.values()).reduce((A,e)=>A+e,0).toFixed(2)}`;(A||i!==D.current)&&(h.setData(o),D.current=i)}if(w){const e=Se(j.current,!1,b.current,p.current,x.current,v.current,P.current,F.current,S.current,L.current,I.current),t=`${e.features.length}:${(null==(i=null==(o=e.features[0])?void 0:o.properties)?void 0:i.key)??""}:${(null==(s=null==(a=e.features[e.features.length-1])?void 0:a.properties)?void 0:s.key)??""}`;(A||t!==E.current)&&(w.setData(e),E.current=t)}if(y&&R.current.length>0){const e=Le(R.current,_.current),t=`${e.features.length}:${(null==(d=null==(l=e.features[0])?void 0:l.properties)?void 0:d.hash)??""}`;(A||t!==N.current)&&(y.setData(e),N.current=t)}},[c,u,g]),z=A.useCallback(()=>{y.current&&(cancelAnimationFrame(y.current),y.current=null),b.current=new Map,p.current=1,x.current=new Map,v.current=new Map,w.current=!1,C.current=new Set,B.current="",M.current=new Map},[]);return A.useEffect(()=>{const A=k.current,e=t;if(k.current=t,m.current){if(y.current&&(cancelAnimationFrame(y.current),y.current=null),A&&!e&&!w.current){w.current=!0;const A=new Map(b.current);let e=null;const t=r=>{e||(e=r);const n=r-e,o=Math.min(n/500,1),i=(a=o,1-Math.pow(1-a,3));var a;for(const[e,t]of A)b.current.set(e,t*(1-i));H(!0),o<1?y.current=requestAnimationFrame(t):(w.current=!1,b.current=new Map,C.current=new Set,B.current="",x.current=new Map,v.current=new Map,y.current=null,H(!0))};y.current=requestAnimationFrame(t)}!A&&e&&(b.current=new Map,C.current=new Set,B.current="")}},[t,H]),A.useEffect(()=>{const A=m.current;if(!t||w.current||!A)return;const e=[...r,...n],o=e.map(A=>`${A.edge.key}:${A.edge.certainCount}`).sort().join(","),i=0===C.current.size,a=""!==B.current&&B.current!==o;if(!i&&!a)return void H();const s=[],l=[];for(const{edge:t}of e)C.current.has(t.key)?l.push(t.key):s.push(t.key);a&&l.length>0&&(x.current=new Map(M.current),p.current=0),v.current=new Map;for(const{edge:t}of r){const A=vA(t.certainCount);v.current.set(t.key,A)}for(const t of s)b.current.set(t,0);for(const t of l)b.current.has(t)||b.current.set(t,1);if(s.length>0||a&&l.length>0){y.current&&(cancelAnimationFrame(y.current),y.current=null);let A=null;const e=Math.min(100,BA/Math.max(s.length,1)/2),t=r=>{A||(A=r);const n=r-A;for(let A=0;A0){const A=Math.min(n/BA,1);p.current=Fe(A)}H(!0);const o=BA+(s.length-1)*e;y.current=n{const A=m.current;if(!A||!g)return;const e=()=>{const e=A.getSource(g);if(!e)return!1;if(d.length>0){const A=Le(d,h);e.setData(A)}else e.setData({type:"FeatureCollection",features:[]});return!0};if(e())return;const t=r=>{r.sourceId===g&&e()&&A.off("sourcedata",t)};A.on("sourcedata",t);const r=()=>{e()&&(A.off("styledata",r),A.off("sourcedata",t))};return A.on("styledata",r),()=>{A.off("sourcedata",t),A.off("styledata",r)}},[g,d,h]),A.useEffect(()=>()=>{y.current&&(cancelAnimationFrame(y.current),y.current=null)},[]),{isExiting:w.current,isAnimating:null!==y.current,resetAnimationState:z,weightAnimProgress:p.current,animStartWeights:x.current,animTargetWeights:v.current}}({map:ue,showTopology:N,validatedPolylines:oe,weakPolylines:ie,maxCertainCount:ce,loopEdgeKeys:se,backboneEdgeKeys:le,highlightedEdgeKey:s,neighbors:e,validatedSourceId:bt,weakSourceId:pt,neighborPolylines:ae,showNeighborLines:j,neighborSourceId:xt,neighborLinkScores:te}),be=A.useMemo(()=>{const A=new Set;for(const e of u.hubNodes){A.add(e);for(const t of u.validatedEdges)t.fromHash===e&&A.add(t.toHash),t.toHash===e&&A.add(t.fromHash)}return A},[u.hubNodes,u.validatedEdges]),pe=A.useMemo(()=>{const A=new Set;if(!n)return A;for(const e of u.validatedEdges)e.fromHash===n&&A.add(e.toHash),e.toHash===n&&A.add(e.fromHash);return A},[n,u.validatedEdges]),{getNodeOpacity:xe}=function({soloDirect:e,soloHubs:t,neighborHashes:r,hubConnectedNodes:n,directNodeSet:o,localConnectedNodes:i,showTopology:a}){const[s,l]=A.useState(new Map),c=A.useRef(e),u=A.useRef(t),d=A.useRef(new Map),f=A.useRef(null),g=A.useRef(n),h=A.useRef(o),m=A.useRef(i),b=A.useRef(a);return A.useEffect(()=>{g.current=n,h.current=o,m.current=i,b.current=a},[n,o,i,a]),A.useEffect(()=>{const A=c.current,n=u.current,o=e,i=t;if(c.current=e,u.current=t,A===o&&n===i)return;f.current&&(cancelAnimationFrame(f.current),f.current=null);const a=g.current,s=h.current,p=m.current,x=b.current;for(const e of r)d.current.has(e)||d.current.set(e,Math.random());const v=(A,e,t)=>{const r=a.has(A),n=s.has(A),o=x&&p.has(A);return!e&&!t||(e&&t?r||n||o:t?r:!e||n||o)},w=[];for(const e of r){const t=v(e,A,n),r=v(e,o,i);t!==r&&w.push({hash:e,startOpacity:t?1:0,targetOpacity:r?1:0})}if(0===w.length)return;l(A=>{const e=new Map(A);for(const{hash:t,startOpacity:r}of w)e.set(t,r);return e});const y=w;let k=null;const C=A=>{k||(k=A);const e=A-k;let t=!0;l(()=>{const A=new Map;for(const{hash:r,startOpacity:n,targetOpacity:o}of y){const i=250*(d.current.get(r)??0),a=Math.max(0,e-i),s=Math.min(a/500,1),l=n+(o-n)*Ie(s);A.set(r,l),s<1&&(t=!1)}return A}),e<750&&!t?f.current=requestAnimationFrame(C):(f.current=null,l(new Map))};return f.current=requestAnimationFrame(C),()=>{f.current&&(cancelAnimationFrame(f.current),f.current=null)}},[e,t,r]),{nodeOpacities:s,getNodeOpacity:(A,e)=>s.has(A)?s.get(A):e?1:0}}({soloDirect:"direct"===R,soloHubs:"hubs"===R,neighborHashes:XA.map(([A])=>A),hubConnectedNodes:be,directNodeSet:ee,localConnectedNodes:pe,showTopology:N}),{blinkingNodes:ve,blinkColor:we}=function({neighbors:e,localHash:t,enabled:r=!0}){const[n,o]=A.useState(new Map),i=X(),a=A.useRef(q.getPackets());A.useEffect(()=>{a.current=q.getPackets()},[i]);const s=A.useRef(0),l=A.useRef(null),c=A.useRef(new Map),u=A.useRef(new Map);A.useEffect(()=>{u.current=function(A){const e=new Map;for(const t of Object.keys(A)){const A=AA(t);e.has(A)||e.set(A,t)}return e}(e)},[e]);const d=A.useRef(null);return A.useEffect(()=>{d.current=()=>{const A=performance.now(),e=c.current;if(0===e.size)return l.current=null,void o(new Map);const t=new Map,r=[];for(const[n,{startTime:o,staggerDelay:i}]of e){const e=A-o-i;if(e<0);else if(e>=750)r.push(n);else{const A=Re(e,750);A>0&&t.set(n,A)}}for(const n of r)e.delete(n);o(t),e.size>0&&d.current?l.current=requestAnimationFrame(d.current):l.current=null}},[]),A.useEffect(()=>{if(!r)return;const A=a.current;if(0===A.length)return;const e=s.current,n=A.filter(A=>(A.timestamp??0)>e);if(0===e){const e=A.reduce((A,e)=>Math.max(A,e.timestamp??0),0);return void(s.current=e)}if(0===n.length)return;const o=n.reduce((A,e)=>Math.max(A,e.timestamp??0),0);s.current=o;const i=performance.now();let f=0;for(const r of n){const A=$(r,t);if(!A||0===A.original.length)continue;const e=Te(A.original,u.current,t);if(0===e.length)continue;const n=375;for(let t=0;t()=>{null!==l.current&&(cancelAnimationFrame(l.current),l.current=null)},[]),{blinkingNodes:n,blinkColor:"#00FF00"}}({neighbors:e,localHash:n,enabled:RA}),ye=A.useCallback(A=>{if("all"===R)return!0;if("direct"===R)return ee.has(A);if("hubs"===R){if(u.hubNodes.includes(A))return!0;for(const e of u.validatedEdges){if(e.fromHash===A&&u.hubNodes.includes(e.toHash))return!0;if(e.toHash===A&&u.hubNodes.includes(e.fromHash))return!0}return!1}return!0},[R,ee,u.hubNodes,u.validatedEdges]),Ce=A.useCallback(async()=>{mA(!0),dA(!0),gA("fetching"),pA(0),await d(),pA(g.packetCount),gA("analyzing"),await new Promise(A=>setTimeout(A,200)),gA("building");const A=Date.now(),e=Date.now()-A;e<1700&&await new Promise(A=>setTimeout(A,1700-e)),gA("complete"),await new Promise(A=>setTimeout(A,1e3)),dA(!1),mA(!1),me(),wA(!0),setTimeout(()=>{Q(!0)},150)},[d,me,g.packetCount]),Be=A.useCallback(()=>{xA?Q(A=>!A):Ce()},[xA,Ce]),Me=A.useCallback(A=>{B(A.viewState)},[]),De=A.useCallback(()=>{E(A=>{var e,t,r,n,o,i,a;const s=!A,l=null==(r=null==(t=null==(e=c.current)?void 0:e.getContainer())?void 0:t.closest(".map-container-fullscreen, .map-container-16-9"))?void 0:r.parentElement;return s?l&&document.fullscreenEnabled?null==(n=l.requestFullscreen)||n.call(l).catch(()=>{}):l&&document.webkitFullscreenEnabled&&(null==(o=l.webkitRequestFullscreen)||o.call(l)):document.fullscreenElement?null==(i=document.exitFullscreen)||i.call(document).catch(()=>{}):document.webkitFullscreenElement&&(null==(a=document.webkitExitFullscreen)||a.call(document)),s})},[]),Ee=A.useCallback(A=>{T(A)},[]),Qe=A.useCallback(()=>{P(A=>!A)},[]),je=A.useCallback(()=>{S(A=>!A)},[]),Pe=A.useCallback(()=>{I(A=>{const e=!A;if(c.current){const A=c.current.getMap();A&&A.stop()}if(e&&c.current){const A=c.current.getMap();A&&A.easeTo({pitch:45,duration:1500,easing:A=>1-Math.pow(1-A,3)})}if(!e&&c.current){const A=c.current.getMap();A&&A.easeTo({pitch:0,bearing:0,duration:800,easing:A=>1-Math.pow(1-A,2)})}return e})},[]),Ze=A.useCallback(()=>{N||Q(!0)},[N]),Ve=A.useCallback((A,e)=>{J(A),rA(e)},[]),Ke=A.useCallback(()=>{K&&o&&o(K),J(null),rA("")},[K,o]),Je=A.useMemo(()=>[...Dt,...mt],[]),Xe=A.useRef(!1);A.useEffect(()=>{Xe.current="ontouchstart"in window||navigator.maxTouchPoints>0},[]);const qe=A.useCallback(A=>{!Xe.current||!GA||A.features&&0!==A.features.length||(OA(null),G(null))},[GA]),$e=A.useCallback(A=>{var e,t;if(!A.features||0===A.features.length)return;if(A.features.some(A=>{var e,t;return null==(t=null==(e=A.layer)?void 0:e.id)?void 0:t.startsWith("node-markers-")}))return void(z&&(G(null),OA(null)));const r=A.features.find(A=>{var e;const t=null==(e=A.layer)?void 0:e.id;return(null==t?void 0:t.startsWith("topology-"))||(null==t?void 0:t.startsWith("neighbor-"))});if(!r)return;const n=null==(e=r.layer)?void 0:e.id,o=r.properties;if(!(null==o?void 0:o.key))return;const i=null==n?void 0:n.startsWith("topology-"),a=null==n?void 0:n.startsWith("neighbor-");if(i||a){const e=o.key.replace(/-loop[12]$/,"");G(e),A.lngLat&&OA({longitude:A.lngLat.lng,latitude:A.lngLat.lat,type:i?"topology":"neighbor",properties:o})}try{(null==(t=c.current)?void 0:t.getCanvas())&&(c.current.getCanvas().style.cursor="pointer")}catch{}},[z]),At=A.useCallback(()=>{var A;G(null),OA(null);try{(null==(A=c.current)?void 0:A.getCanvas())&&(c.current.getCanvas().style.cursor="")}catch{}},[]),et=D?"map-container-fullscreen":"map-container-16-9",tt=y.length>0||(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude),rt=!m||!tt,nt=tt;return t.jsxs("div",{className:`relative ${et}`,role:"application","aria-label":"Mesh network contacts map","aria-describedby":"map-instructions",children:[t.jsx("span",{id:"map-instructions",className:"sr-only",children:"Interactive map showing mesh network contacts. Use mouse or touch to pan and zoom. Press Tab to navigate map controls. Press Escape to exit fullscreen mode."}),rt&&t.jsx("div",{className:"absolute inset-0 z-50 glass-card flex items-center justify-center","aria-hidden":"true",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-accent-primary border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm text-text-muted",children:"Loading map..."})]})}),nt&&t.jsx("div",{className:`relative w-full h-full ${D?"":"rounded-[1.125rem] overflow-hidden"} ${rt?"opacity-0":"opacity-100 transition-opacity duration-300"}`,children:t.jsxs(U,{ref:c,...C,onMove:Me,mapStyle:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",style:{width:"100%",height:"100%"},attributionControl:!1,interactiveLayerIds:Je,onMouseMove:$e,onMouseLeave:At,onClick:qe,onLoad:A=>{const e=A.target;try{const A=e.getStyle();if(null==A?void 0:A.layers){const t=["road","highway","tunnel","bridge","motorway","trunk","primary","secondary","tertiary","street","path","track"],r=A=>t.some(e=>A.toLowerCase().includes(e));for(const n of A.layers)"fill"===n.type&&n.id.toLowerCase().includes("water")&&e.setPaintProperty(n.id,"fill-color","rgba(22, 26, 32, 1)"),"line"===n.type&&r(n.id)&&e.setPaintProperty(n.id,"line-color","rgba(25, 26, 29, 1)"),"symbol"===n.type&&(e.setPaintProperty(n.id,"text-color","rgba(108, 110, 120, 0.85)"),e.setPaintProperty(n.id,"text-halo-color","rgba(8, 9, 11, 0.9)"),e.setPaintProperty(n.id,"text-halo-width",1),e.setLayoutProperty(n.id,"text-font",["Inter","Open Sans Regular","Arial Unicode MS Regular"]))}}catch(t){}},onError:A=>{},onIdle:()=>{if(!v&&!x&&c.current){const A=c.current.getMap();if(A){const t=Object.values(e).filter(A=>A.latitude&&A.longitude).map(A=>({latitude:A.latitude,longitude:A.longitude}));(null==r?void 0:r.latitude)&&(null==r?void 0:r.longitude)&&t.push({latitude:r.latitude,longitude:r.longitude}),t.length>0&&p(t,A)}}},children:[t.jsx(Y,{position:"bottom-right"}),t.jsx(Ne,{enabled:L,exaggeration:4}),t.jsx(ke,{coveragePoints:jA,visible:jA.length>0&&PA,terrainEnabled:L,brightness:FA}),t.jsx(Mt,{showTopology:N,isExiting:ge,hoveredEdgeKey:z,highlightedLoopEdges:null==UA?void 0:UA.highlightedEdgeKeys,onEdgeHover:WA,onLoopHover:ZA,loops:u.loops,neighborNames:KA,opacityBias:O,widthMultiplier:W,trafficFilter:V,showNeighborLines:j,disableHover:he||hA}),i&&t.jsx(Et,{targetHash:i,nodeCoordinates:$A,onComplete:a}),s&&t.jsx(Nt,{highlightedEdgeKey:s,validatedPolylines:oe,weakPolylines:ie,onEnsureTopology:Ze}),t.jsx(Pt,{ghost:l??null,neighborCoordinates:$A,onHighlightedNeighborsChange:NA}),t.jsx(ht,{neighborsWithLocation:XA,localNode:r,localHash:n,zeroHopNeighbors:ee,lastHopNeighborMap:Ae,meshTopology:u,hoveredMarker:_,onMarkerHover:H,getNodeOpacity:xe,shouldShowNode:ye,onRequestRemove:o?Ve:void 0,openPopupId:kA,onOpenPopup:MA,onClosePopup:DA,blinkingNodes:ve,blinkColor:we})]})}),(()=>{const A=function(A,e,t){if(e){const A=e.loops[0],t=e.loops.length,r=[{label:"edges in loop",value:A.size},{label:"strength",value:`${Math.round(100*A.strength)}%`,unit:"(weakest link)"}],n=[];return A.includesLocal&&n.push({text:"★ Includes your node",color:"text-amber-400"}),t>1&&n.push({text:`Part of ${t} overlapping loops`,color:"text-violet-400/70"}),{type:"loop",title:{icon:"⟳",text:"Redundant Path"+(t>1?"s":""),color:"text-violet-400"},subtitle:{text:`${e.nodeNames.join(" → ")} → ${e.nodeNames[0]}`,color:"text-text-secondary",mono:!0},stats:r,badges:n}}if("neighbor"===(null==A?void 0:A.type)){const e=A.properties,t=[];void 0!==e.rssi&&null!==e.rssi&&t.push({label:"RSSI",value:`${Math.round(e.rssi)} dBm`,unit:e.hasAvgRssi?"avg":void 0}),void 0!==e.snr&&null!==e.snr&&t.push({label:"SNR",value:`${Number(e.snr).toFixed(1)} dB`,unit:e.hasAvgSnr?"avg":void 0});const r=e.listenerScore??0,n=e.loudScore??0,o=r>0||n>0;return o&&(t.push({label:"listener",value:r,color:"text-accent-success"}),t.push({label:"loud",value:n,color:"text-accent-danger"})),void 0===e.packetCount||o||t.push({label:"packets",value:Number(e.packetCount).toLocaleString()}),{type:"neighbor",title:{icon:"●",text:e.prefix?`${e.name} (${e.prefix})`:e.name,color:"text-amber-400"},subtitle:{text:"Direct RF Neighbor",color:"text-amber-400/70"},stats:t,badges:[]}}if("topology"===(null==A?void 0:A.type)){const e=A.properties,r=t>0?Number(e.certainCount)/t:0,n=[{label:"validations",value:e.certainCount},{label:"of max traffic",value:`${Math.round(100*r)}%`},{label:"confidence",value:`${Math.round(100*Number(e.confidence))}%`}];if(void 0!==e.symmetryRatio&&e.symmetryRatio<1){const A="forward"===e.dominantDirection?"→":"reverse"===e.dominantDirection?"←":"↔";n.push({label:"symmetric",value:`${A} ${Math.round(100*e.symmetryRatio)}%`,color:"text-text-muted"})}const o=[];return e.isBackbone&&o.push({text:"Backbone",color:"text-gray-300"}),e.isLoopEdge&&o.push({text:"Redundant",color:"text-violet-400"}),e.isDirectPath&&o.push({text:"Direct Path",color:"text-teal-400"}),{type:"topology",title:{icon:"",text:`${e.fromName} ↔ ${e.toName}`,color:"text-text-primary"},stats:n,badges:o}}return null}(GA?{type:GA.type,properties:GA.properties}:null,UA,ce);return A&&t.jsx("div",{className:"map-edge-tooltip",children:t.jsx("div",{className:"map-control-glass map-edge-tooltip-inner",children:t.jsx(Lt,{data:A})})})})(),t.jsx(QA,{mapRef:c,showNeighborLines:j,onToggleNeighborLines:Qe,hasNeighborPolylines:ae.length>0,nodeFilter:R,onNodeFilterChange:Ee,hasHubNodes:u.hubNodes.length>0,hasZeroHopNeighbors:ee.size>0,showCoverage:F,onToggleCoverage:je,show3DTerrain:L,onToggle3DTerrain:Pe,isFullscreen:D,onToggleFullscreen:De}),t.jsxs("div",{className:"map-legend-stack",children:[t.jsx(SA,{isActive:N,hasAnalyzed:xA,isLoading:hA,onClick:Be}),t.jsx(IA,{isActive:RA,onClick:_A}),t.jsx(TA,{isActive:jA.length>0&&PA,onClick:LA}),t.jsx(EA,{showTopology:N,validatedPolylineCount:oe.length,filteredNeighborCount:XA.length,hasLocalNode:!(!(null==r?void 0:r.latitude)||!(null==r?void 0:r.longitude)),meshTopology:u,zeroHopNeighbors:ee,neighborsWithLocation:XA})]}),!D&&t.jsx("div",{className:"glass-card-frame absolute inset-0 pointer-events-none rounded-[1.125rem]",style:{zIndex:9999},"aria-hidden":"true"}),t.jsx(cA,{isOpen:null!==K,onCancel:()=>J(null),onConfirm:Ke,title:"Remove Node?",message:`Remove "${tA}" from the contacts list? This will hide the node until it sends a new packet.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger"}),t.jsx(yA,{isOpen:uA,currentStep:fA,packetCount:bA}),t.jsx(JA,{})]})}export{It as default}; diff --git a/frontend/dist/assets/Dashboard-BIGBrxNX.js b/frontend/dist/assets/Dashboard-BIGBrxNX.js deleted file mode 100644 index 686e89dd..00000000 --- a/frontend/dist/assets/Dashboard-BIGBrxNX.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t,y as s,T as a,z as n,A as l,p as i,D as r,g as o,E as c,x as d,H as u,I as m,J as h,K as x,O as p,Q as f,U as g,Z as v,V as j,W as b,Y as N,_ as y}from"./vendor-react-C0qkT9dV.js";import{u as k,a as w,b as M,c as _,d as L,e as S,f as C,h as F,j as D,D as R,k as B,m as T,T as A,n as $,o as P,p as H,q as I,r as E,F as W}from"./index-wYLFmyyS.js";import{u as z,a as O}from"./useThemeColors-DL9Pr7sC.js";import{C as G,S as K,a as V,P as q,b as J,c as U}from"./PageLayout-DAadOF4d.js";import{P as Q,a as X,b as Y,g as Z}from"./PacketDetailModal-DU2ZzX69.js";import{T as ee}from"./TimeRangeSelector-COrVm3Yj.js";import{H as te}from"./HashBadge-CAy9V6Vn.js";import{s as se}from"./SignalIndicator-C1cW0knK.js";import{R as ae,L as ne,Y as le,a as ie,A as re,C as oe,X as ce,T as de,b as ue}from"./recharts-DRDKmvXb.js";import{c as me}from"./link-scoring-lk0Wk34S.js";import{R as he,C as xe}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const pe={received:{barBase:"var(--metric-received)"},forwarded:{barBase:"var(--metric-forwarded)"},transmitted:{barBase:"var(--metric-transmitted)"},dropped:{barBase:"var(--metric-dropped)"},neutral:{barBase:"var(--metric-neutral)"}},fe={sm:"card-sm",md:"card-md",lg:"card-lg",hero:"card-hero",auto:""};function ge({buckets:s,colorType:a}){const n=pe[a].barBase,l=e.useMemo(()=>{if(!(null==s?void 0:s.length))return[];const e=s.length/60,t=e<=1?s:Array.from({length:60},(t,a)=>{var n,l;const i=s.slice(Math.floor(a*e),Math.floor((a+1)*e)),r=i.reduce((e,t)=>e+t.count,0),o=i.length?i.reduce((e,t)=>e+t.avg_snr,0)/i.length:0;return{bucket:a,start:(null==(n=i[0])?void 0:n.start)??0,end:(null==(l=i.at(-1))?void 0:l.end)??0,count:r,airtime_ms:i.reduce((e,t)=>e+t.airtime_ms,0),avg_snr:o,avg_rssi:0}}),a=t.map(e=>e.count).filter(e=>e>0);if(0===a.length)return t.map(()=>({height:0,bottom:0,color:"transparent",count:0,snr:0}));const l=Math.max(...a),i=Math.min(...a),r=l-i;return 0===r?t.map(e=>({height:e.count>0?40:0,bottom:e.count>0?30:0,color:e.count>0?n:"transparent",count:e.count,snr:e.avg_snr})):t.map(e=>{if(0===e.count)return{height:0,bottom:0,color:"transparent",count:0,snr:e.avg_snr};const t=(e.count-i)/r,s=25*t;return{height:Math.max(15,25+60*t),bottom:s,color:n,count:e.count,snr:e.avg_snr}})},[s,n]);return(null==s?void 0:s.length)?t.jsx("div",{className:"w-full h-full relative",children:l.map((e,s)=>{var a;return t.jsx("div",{className:"absolute rounded-full",style:{height:`${e.height}%`,bottom:`${e.bottom}%`,left:7*s+"px",width:"5px",backgroundColor:e.color,opacity:e.count>0?.8:.1},title:e.count>0?`${e.count} packets, SNR: ${null==(a=e.snr)?void 0:a.toFixed(1)}dB`:"No packets"},s)})}):t.jsx("div",{className:"w-full h-full flex items-end justify-center gap-[2px] opacity-20",children:t.jsx("span",{className:"type-data-xs text-text-secondary",children:"No data"})})}function ve({title:s,value:a,color:n="neutral",subtitle:l,buckets:i,receivedCount:r,timeRangeLabel:o,icon:c,size:d="md",isLoaded:u=!0}){const m="string"==typeof a?a:a.toLocaleString(),h=e.useMemo(()=>function(e){if(!(null==e?void 0:e.length))return null;const t=e.reduce((e,t)=>e+t.count,0),s=e[0].start,a=e[e.length-1].end,n=Math.max((a-s)/3600,1),l=Math.round(t/n);let i=0,r=0;for(let d=0;dr&&(r=e[d].count,i=d);const o=new Date(1e3*e[i].start).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),c=e.filter(e=>e.count>0&&0!==e.avg_snr);return{total:t,ratePerHour:l,peakCount:r,peakHour:o,avgSnr:c.length>0?c.reduce((e,t)=>e+t.avg_snr,0)/c.length:null}}(i),[i]),x="number"==typeof a?a:(null==h?void 0:h.total)??0,p=r&&r>0?(x/r*100).toFixed(1):null;return u?t.jsxs("div",{className:`data-card flex flex-col relative ${fe[d]}`,children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c&&t.jsx("span",{className:"icon-sm text-icon-card-title",children:c}),t.jsx("span",{className:"type-micro",children:s}),o&&t.jsx("span",{className:"pill-tag",children:o})]}),t.jsx("div",{className:"font-mono text-3xl font-semibold tabular-nums text-text-primary",style:{letterSpacing:"-0.05em"},children:m}),t.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[60px]",children:i?t.jsx(ge,{buckets:i,colorType:n}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("div",{className:"w-full h-0.5 rounded-full bg-text-muted/15"})})}),t.jsx("div",{className:"pt-2 mt-1",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Rate"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[(null==h?void 0:h.ratePerHour)??l??"—","/hr"]})]}),null!==p?t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"dropped"===n?"Drop %":"Ratio"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[p,"%"]})]}):(null==h?void 0:h.peakHour)?t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Peak"}),t.jsx("div",{className:"data-box data-box-fill data-box-left",children:h.peakHour})]}):null]})})]}):t.jsx("div",{className:`data-card flex flex-col relative ${fe[d]}`,children:t.jsx(G,{})})}const je=.2;function be(e,t=1){return Math.floor(5*t*e)}function Ne(e){const t=Math.round(e/je)*je;return Math.max(0,Math.min(5,t))}function ye({stats:e,receivedBuckets:i,droppedBuckets:r,forwardedBuckets:o,bucketDurationSeconds:c,timeRangeLabel:d,isLoaded:u=!0}){var m,h,x,p;if(!u)return t.jsx("div",{className:"data-card flex flex-col relative",children:t.jsx(G,{})});const f=function(e,t,s,a,n){var l,i;const r=e=>(null==e?void 0:e.reduce((e,t)=>e+t.count,0))??0,o=r(t),c=r(s),d=r(a),u=o||(null==e?void 0:e.rx_count)||1,m=c||(null==e?void 0:e.dropped_count)||0,h=u>0?m/(u+m)*100:0;let x=0;if((null==a?void 0:a.length)&&n)x=100*d/(a.length*n*1e3)*100;else if(e){const t=1e3*(e.uptime_seconds||1);x=(e.total_airtime_ms||e.airtime_used_ms||0)/t*100}const p=(null==e?void 0:e.neighbors)??{},f=Object.values(p).filter(e=>e.zero_hop).length;let g=1;h<3?g-=je:h>15?g+=.4:h>10&&(g+=je),x>5&&(g+=je),f>10&&(g+=je);const v=Ne(g),j=Ne(.28*v),b=be(v),N=be(j),y=be((null==(i=null==(l=null==e?void 0:e.config)?void 0:l.delays)?void 0:i.tx_delay_factor)??1);return{floodFactor:v,directFactor:j,floodSlots:b,directSlots:N,adjustment:b>y?"increase":b10?"text-accent-warning":""),children:[f.duplicateRate.toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"TX Util"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[f.txUtilization.toFixed(2),"%"]})]})]})}),t.jsxs("div",{className:"pt-2 mt-2",children:[t.jsx("div",{className:"data-box-label",children:"Current"}),t.jsx("div",{className:"flex gap-2",children:null!==g?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"data-box",children:["×",g.toFixed(2)]}),t.jsxs("div",{className:"data-box",style:{color:"var(--accent-tertiary)"},children:["×",(null==v?void 0:v.toFixed(2))??"—"]})]}):t.jsx("span",{className:"text-sm text-text-muted",children:"No config"})})]})]})}function ke(e){return(e.payload_type_name||Z(e.payload_type??e.type)).toLowerCase().includes("advert")}function we(){const s=k(),a=w(),n=M(),l=_(),d=L(),[u,m]=e.useState(null),[h,x]=e.useState(null),p=e.useRef(0),f=e.useRef(0),g=e.useMemo(()=>[...s.length<=100?s:s.slice(-100)].sort((e,t)=>(t.timestamp??0)-(e.timestamp??0)),[s]),v=e.useMemo(()=>{const e=new Map;if(!(null==d?void 0:d.neighbors))return e;d.local_hash&&e.set(S(d.local_hash),d.local_hash);for(const t of Object.keys(d.neighbors)){const s=S(t);e.has(s)||e.set(s,t)}return e},[d]),j=e.useMemo(()=>g.slice(0,15).map(e=>{if(e.src_hash&&e.src_hash.length<=4){const t=v.get(e.src_hash.toUpperCase());if(t)return{...e,src_hash_full:t}}return e}),[g,v]);e.useEffect(()=>{var e;if(!g.length)return;const t=(null==(e=g[0])?void 0:e.timestamp)??0,s=t>f.current&&f.current>0;if(f.current=t,!s)return;const a=g.find(ke);if(!a||(a.timestamp??0)<=f.current)return;const n=requestAnimationFrame(()=>m(a.packet_hash)),l=setTimeout(()=>m(null),600);return()=>{cancelAnimationFrame(n),clearTimeout(l)}},[g]),e.useEffect(()=>{if(l>0&&l!==p.current&&g.length>0){p.current=l;const e=g.find(ke);if(e){const t=requestAnimationFrame(()=>m(e.packet_hash)),s=setTimeout(()=>m(null),600);return()=>{cancelAnimationFrame(t),clearTimeout(s)}}}},[l,g]);const b=()=>t.jsxs(t.Fragment,{children:[t.jsx(i,{className:"w-6 h-6 text-text-muted mx-auto mb-2"}),t.jsx("div",{className:"text-sm text-text-primary",children:"No packets received"}),t.jsx("div",{className:"text-xs text-text-muted",children:"Packets will appear here"})]});return t.jsxs("div",{className:"chart-container h-full flex flex-col",children:[t.jsxs("div",{className:"chart-header",children:[t.jsxs("div",{className:"chart-title",children:[t.jsx(i,{className:"chart-title-icon"}),"Recent Packets"]}),t.jsxs("div",{className:"flex items-center gap-3",children:[n&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(r,{className:"w-2 h-2 fill-accent-success text-accent-success animate-pulse"}),t.jsx("span",{className:"type-data-xs text-text-muted",children:"LIVE"})]}),t.jsxs(o,{to:"/packets",className:"pill-subtle",children:["View all ",t.jsx(c,{className:"w-3 h-3"})]})]})]}),t.jsxs("div",{className:"sm:hidden flex items-center gap-1.5 px-3 py-1.5 border-b border-border-subtle/50 bg-bg-elevated/20",children:[t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-14 flex-shrink-0",children:"Dir"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-7 flex-shrink-0",children:"Time"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-9 flex-shrink-0",children:"Src"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider flex-1 min-w-0",children:"Type"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-14 flex-shrink-0",children:"Route"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-12 flex-shrink-0",children:"Signal"})]}),t.jsx("div",{className:"hidden sm:block flex-1 overflow-hidden",children:t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-bg-elevated/95 backdrop-blur-sm",children:t.jsxs("tr",{className:"border-b border-border-subtle/50",children:[t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider w-16",children:"Dir"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Time"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Source"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Route"}),t.jsx("th",{className:"text-right py-1.5 px-3 pr-4 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Signal"})]})}),t.jsx("tbody",{className:"divide-y divide-border-subtle/30",children:a&&0===g.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-8 text-text-muted",children:"Loading packets..."})}):0===j.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-8",children:b()})}):j.map((e,s)=>t.jsx(Q,{packet:e,onClick:x,isFlashing:ke(e)&&u===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))})]})})}),t.jsx("div",{className:"sm:hidden flex-1 overflow-y-auto divide-y divide-border-subtle/30",children:a&&0===g.length?t.jsx("div",{className:"p-8 text-center text-text-muted",children:"Loading packets..."}):0===j.length?t.jsx("div",{className:"p-8 text-center",children:b()}):j.map((e,s)=>t.jsx(X,{packet:e,onClick:x,isFlashing:ke(e)&&u===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))}),t.jsxs("div",{className:"px-3 py-1.5 border-t border-border-subtle/50 text-[10px] text-text-muted bg-bg-elevated/20 text-center",children:["Showing ",j.length," of ",g.length," packets"]}),h&&t.jsx(Y,{packet:h,onClose:()=>x(null)})]})}e.memo(function({active:e,payload:s,label:a,formatValue:n,labelKey:l}){var i;if(!e||!(null==s?void 0:s.length))return null;const r=l&&(null==(i=s[0])?void 0:i.payload)?s[0].payload[l]:a;return t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-4 py-3 shadow-xl",children:[r&&t.jsx("p",{className:"type-data-xs text-white/50 mb-2",children:r}),t.jsx("div",{className:"space-y-1.5",children:s.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),t.jsx("span",{className:"type-body-sm text-white/70 capitalize min-w-[60px]",children:e.name}),t.jsx("span",{className:"type-data-sm text-white tabular-nums",children:n?n(e.value,e.name):e.value.toLocaleString()})]},s))})]})});const Me=e.memo(function({active:e,payload:s,color:a,labelKey:n,unit:l=""}){var i,r;if(!e||!(null==s?void 0:s.length))return null;const o=s[0],c=null==(i=null==o?void 0:o.payload)?void 0:i[n];return t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 shadow-xl",children:[t.jsx("p",{className:"type-data-xs text-white/50 mb-1",children:c}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a}}),t.jsxs("span",{className:"type-data-sm text-white tabular-nums",children:[null==(r=null==o?void 0:o.value)?void 0:r.toLocaleString(),l]})]})]})});e.memo(function({payload:e}){return(null==e?void 0:e.length)?t.jsx("div",{className:"flex items-center justify-center gap-6 mt-4 pt-4 border-t border-white/5",children:e.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsx("span",{className:"type-body-sm text-white/60 capitalize",children:e.value})]},s))}):null});const _e={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function Le({trend:e}){return t.jsx("span",{className:`mini-widget-trend ${e}`,children:t.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:_e[e]})})})}function Se(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function Ce({message:e}){return t.jsx("div",{className:"mini-widget-error",children:t.jsx("span",{title:e,children:"No data"})})}function Fe({title:e,icon:s,value:a,unit:n,valueSize:l="md",status:i,subtitle:r,trend:o,children:c,isLoading:d=!1,error:u,className:m="",onClick:h}){const x=["mini-widget-value","lg"===l&&"mini-widget-value-lg","sm"===l&&"mini-widget-value-sm"].filter(Boolean).join(" "),p=["mini-widget",h&&"cursor-pointer",m].filter(Boolean).join(" ");return t.jsxs("div",{className:p,onClick:h,role:h?"button":void 0,children:[t.jsxs("div",{className:"mini-widget-header",children:[s,t.jsx("span",{className:"mini-widget-title",children:e}),i&&"unknown"!==i&&t.jsx("div",{className:`mini-widget-status-dot ${i}`}),o&&t.jsx(Le,{trend:o})]}),d?t.jsx(Se,{}):u?t.jsx(Ce,{message:u}):t.jsxs(t.Fragment,{children:[void 0!==a&&t.jsxs("div",{className:x,children:[a,n&&t.jsx("span",{className:"mini-widget-unit",children:n})]}),r&&t.jsx("div",{className:"mini-widget-subtitle",children:r}),c]})]})}const De={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},Re={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function Be(e,t){if(0===e.length)return null;const s=[...e].sort((e,t)=>e-t),a=t/100*(s.length-1),n=Math.floor(a),l=Math.ceil(a);return n===l?s[n]:s[n]+(s[l]-s[n])*(a-n)}function Te(e){return Be(e,50)}const Ae={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],linkQuality:null,channelHealth:null,nfTrend:Re,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},$e=e.createContext(Ae);function Pe(e){if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(Number).filter(e=>!isNaN(e))}catch{}return[]}function He(e){return null!=e&&0!==e&&!Object.is(e,-0)&&!(e>-50||e<-130)}function Ie(e,t,s=2,a=!1){if(null===t)return"stable";const n=e-t;return(0!==t?100*Math.abs(n/t):Math.abs(n))0?"up":"down":n>0?"down":"up"}function Ee({children:s}){var a;const n=L(),l=k(),i=C(),r=F(),o=D(),c=R[o],d=Math.max(1,c.minutes/60),u=null===n,m=e.useMemo(()=>function(e,t){const s=3600*t,a=Math.floor(Date.now()/1e3)-s,n=e.filter(e=>e.timestamp>=a&&void 0!==e.lbt_attempts&&e.lbt_attempts>0),l=n.length,i=n.filter(e=>(e.lbt_attempts??0)>1).length,r=l>0?i/l*100:0,o=n.filter(e=>(e.lbt_attempts??0)>1),c=o.length>0?o.reduce((e,t)=>e+(t.lbt_attempts??0),0)/o.length:0,d=n.filter(e=>(e.lbt_attempts??0)>=5).length,u=l>0?d/l*100:0,m=[];for(const b of n){const e=Pe(b.lbt_backoff_delays_ms);m.push(...e)}const h=m.reduce((e,t)=>e+t,0),x=m.length>0?h/m.length:0,p=m.length>0?Math.min(...m):0,f=m.length>0?Math.max(...m):0,g=s/24,v=[],j=[];for(let b=0;b<24;b++){const e=a+b*g,t=e+g,s=n.filter(s=>s.timestamp>=e&&s.timestamp(e.lbt_attempts??0)>1).length,i=s.length>0?l/s.length*100:0,r=[];for(const a of s){const e=Pe(a.lbt_backoff_delays_ms);r.push(...e)}const o=r.length>0?r.reduce((e,t)=>e+t,0)/r.length:0;if(v.push(o),0===s.length)j.push(0);else{const e=s.filter(e=>(e.lbt_attempts??0)>=5).length,t=r.length>0?Math.max(...r):0,a=Math.min(s.length/5,1),n=.15,l=Math.log(1+i*n)/Math.log(1+100*n)*40,c=e/s.length*100,d=Math.min(.5*c,25);let u=0;o>100&&(u=Math.min(8*Math.log10(o/100),15));let m=0;t>500&&o>0&&t>2*o&&(m=Math.min((t-500)/200,5));const h=l+d+u+m;j.push(Math.min(h*a,85))}}return{totalPacketsWithLBT:l,packetsWithRetries:i,retryRate:r,avgRetries:c,channelBusyCount:d,channelBusyRate:u,avgBackoffMs:x,minBackoffMs:p,maxBackoffMs:f,totalBackoffMs:h,sparklineBackoff:v,sparklineCollisionRisk:j,windowHours:t,packetCount:e.length}}(l,d),[l,d]),h=(null==n?void 0:n.noise_floor_dbm)??null,x=e.useMemo(()=>He(h)?h:null,[h]),p=e.useMemo(()=>{var e;const t=null==(e=null==n?void 0:n.config)?void 0:e.radio;return t?{sf:t.spreading_factor??7,bwHz:t.bandwidth??125e3}:null},[null==(a=null==n?void 0:n.config)?void 0:a.radio]),[f,g]=e.useState([]),v=e.useRef({time:0,hours:0});e.useEffect(()=>{const e=async()=>{var e;const t=Date.now(),s=Math.ceil(d);if(0===v.current.time||v.current.hours!==s||t-v.current.time>=6e4){v.current={time:t,hours:s};try{const t=await B(Math.max(s,24));t.success&&(null==(e=t.data)?void 0:e.history)&&g(t.data.history)}catch{}}};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[d]);const j=e.useMemo(()=>{if(0===f.length)return[];const e=f.reduce((e,t)=>Math.max(e,t.timestamp),0);if(0===e)return[];const t=3600*d,s=e-t,a=t/24,n=[];for(let l=0;l<24;l++){const e=s+l*a,t=e+a,i=f.filter(s=>s.timestamp>=e&&s.timestamp0){const e=i.reduce((e,t)=>e+t.noise_floor_dbm,0)/i.length;n.push(e)}else n.push(n.length>0?n[n.length-1]:-100)}return n},[f,d]),b=null==n?void 0:n.neighbors,N=e.useMemo(()=>{const e=b??{};return Object.fromEntries(Object.entries(e).filter(([e])=>!r.has(e)))},[b,r]),y=e.useMemo(()=>i.filter(e=>!r.has(e.hash)),[i,r]),w=e.useMemo(()=>function(e){if(0===e.length)return{...Re,computedAt:Math.floor(Date.now()/1e3)};const t=Math.floor(Date.now()/1e3),s=e.filter(e=>Number.isFinite(e)),a=e.length>0?[e[e.length-1]]:[],n=e.slice(-4).filter(e=>Number.isFinite(e)),l=Te(s),i=Be(s,10),r=Be(s,90),o=Te(a),c=null!==o&&null!==i?o-i:0,d=function(e){if(e.length<2)return 0;const t=e.length;let s=0,a=0,n=0,l=0;const i=e[0].timestamp;for(const o of e){const e=(o.timestamp-i)/3600,t=o.value;s+=e,a+=t,n+=e*t,l+=e*e}const r=t*l-s*s;return Math.abs(r)<1e-4?0:(t*n-s*a)/r}(n.map((e,s)=>({timestamp:t-3600*(n.length-1-s),value:e}))),u=function(e){if(e.length<2)return 0;const t=e.reduce((e,t)=>e+t,0)/e.length,s=e.map(e=>Math.pow(e-t,2)).reduce((e,t)=>e+t,0)/e.length;return Math.sqrt(s)}(n),m=s.length>=12,[h,x]=m?function(e,t,s){const a=De;return e>=a.DELTA_CRITICAL?[2,`Noise floor ${e.toFixed(1)} dB above baseline`]:t>=a.SLOPE_CRITICAL?[2,`Noise floor rising ${t.toFixed(1)} dB/hour`]:s>=a.JITTER_CRITICAL?[2,`Noise floor unstable (±${s.toFixed(1)} dB)`]:e>=a.DELTA_WARNING?[1,`Noise floor ${e.toFixed(1)} dB above baseline`]:t>=a.SLOPE_WARNING?[1,`Noise floor rising ${t.toFixed(1)} dB/hour`]:s>=a.JITTER_WARNING?[1,`Noise floor variable (±${s.toFixed(1)} dB)`]:[0,null]}(c,d,u):[0,null];return{baselineMedian:l,baselineP10:i,baselineP90:r,currentMedian:o,currentSampleCount:a.length,delta:c,slope:d,jitter:u,penalty:h,penaltyReason:x,computedAt:t,isReliable:m}}(j),[j]),M=e.useMemo(()=>function(e,t,s){if(0===e.length)return{neighbors:[],networkScore:0,neighborCount:0,bestLink:null,worstLink:null};const a=e.map(e=>{const a=function(e,t,s){const a=se(e,t,s,0);if(a)switch(a.finalGrade){case"excellent":return 100;case"good":return 80;case"fair":return 60;case"poor":return 40;case"critical":return 20}const n=void 0===e?50:e>=10?100:e>=5?80:e>=0?60:e>=-5?40:20,l=void 0===t?50:t>=-70?100:t>=-80?80:t>=-90?60:t>=-100?40:20;return Math.round(.6*n+.4*l)}(e.avgSnr??void 0,e.avgRssi??void 0,s),n=t[e.hash];return{name:(null==n?void 0:n.name)||(null==n?void 0:n.node_name)||e.prefix,hash:e.hash,rssi:e.avgRssi??-100,snr:e.avgSnr??-10,score:a,advertCount:e.count}});a.sort((e,t)=>t.score-e.score);const n=a.length>0?a.reduce((e,t)=>e+t.score,0)/a.length:0;return{neighbors:a,networkScore:Math.round(n),neighborCount:a.length,bestLink:a.length>0?{name:a[0].name,score:a[0].score}:null,worstLink:a.length>0?{name:a[a.length-1].name,score:a[a.length-1].score}:null}}(y,N,p),[y,N,p]),_=e.useMemo(()=>function(e,t,s){const a=e?Math.max(0,Math.min(100,100-5*e.retryRate)):50;let n=50;null!==t&&(n=Math.max(0,Math.min(100,(t+120)/30*100)));const l=(null==s?void 0:s.networkScore)??50,i=Math.round(.35*a+.25*n+.4*l);let r;return r=i>=85?"excellent":i>=70?"good":i>=50?"fair":i>=30?"congested":"critical",{score:i,status:r,components:{lbtHealth:Math.round(a),noiseHealth:Math.round(n),linkHealth:Math.round(l)}}}(m,x,M),[m,x,M]),[S,T]=e.useState({noiseFloor:null,networkScore:null,channelHealth:null}),A=e.useRef(0);e.useEffect(()=>{const e=()=>{const e=Date.now();e-A.current>3e4&&(A.current=e,T({noiseFloor:x,networkScore:(null==M?void 0:M.networkScore)??null,channelHealth:(null==_?void 0:_.score)??null}))};e();const t=setInterval(e,5e3);return()=>clearInterval(t)},[x,null==M?void 0:M.networkScore,null==_?void 0:_.score]);const $=e.useMemo(()=>({noiseFloor:{current:x,previous:S.noiseFloor,trend:null!==x?Ie(x,S.noiseFloor,2,!0):"stable"},networkScore:{current:(null==M?void 0:M.networkScore)??0,previous:S.networkScore,trend:Ie((null==M?void 0:M.networkScore)??0,S.networkScore,3,!1)},channelHealth:{current:(null==_?void 0:_.score)??0,previous:S.channelHealth,trend:Ie((null==_?void 0:_.score)??0,S.channelHealth,3,!1)}}),[x,null==M?void 0:M.networkScore,null==_?void 0:_.score,S]),P={lbtStats:m,noiseFloor:x,sparklineNoiseFloor:j,linkQuality:M,channelHealth:_,nfTrend:w,radioConfig:p,trends:$,stats:n,recentPackets:l,quickNeighbors:i,isLoading:u,error:null,refresh:async()=>{}};return t.jsx($e.Provider,{value:P,children:s})}function We(){const t=e.useContext($e);if(void 0===t)throw new Error("useLBTData must be used within an LBTDataProvider");return t}function ze(e,t){return 0===e?"No backoffs":`${t.toFixed(0)}% retry rate`}function Oe(){const{lbtStats:s,isLoading:a,error:n}=We(),l=d(),i=(null==s?void 0:s.avgBackoffMs)??0,r=(null==s?void 0:s.retryRate)??0,o=s?(c=i)<100?"excellent":c<250?"good":c<500?"fair":c<1e3?"congested":"critical":"unknown";var c;const m=null==s?void 0:s.sparklineBackoff,{chartData:h,yDomain:x}=e.useMemo(()=>{if(!m||m.length<2)return{chartData:[],yDomain:[0,100]};const e=m.map(e=>({value:e})),t=m.filter(e=>e>0);if(0===t.length)return{chartData:e,yDomain:[0,100]};const s=Math.min(...t),a=Math.max(...t),n=a-s,l=Math.max(.2*n,.1*a,10);return{chartData:e,yDomain:[Math.max(0,s-l),a+l]}},[m]);return t.jsx(Fe,{title:"LBT Backoff",icon:t.jsx(u,{className:"mini-widget-icon"}),value:Math.round(i),unit:"ms",status:o,subtitle:s?ze(i,r):void 0,isLoading:a,error:n,onClick:()=>l("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline",children:h.length>0?t.jsx(ae,{width:"100%",height:24,children:t.jsxs(ne,{data:h,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(le,{domain:x,hide:!0}),t.jsx(ie,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function Ge(e){return 0===e?"—":e<1?"<1":Math.round(e).toString()}function Ke(){const{lbtStats:e,isLoading:s,error:a}=We(),n=d(),l=(null==e?void 0:e.channelBusyCount)??0,i=(null==e?void 0:e.totalPacketsWithLBT)??0,r=(null==e?void 0:e.channelBusyRate)??0,o=(null==e?void 0:e.retryRate)??0,c=(null==e?void 0:e.avgBackoffMs)??0,u=(null==e?void 0:e.minBackoffMs)??0,h=(null==e?void 0:e.maxBackoffMs)??0,x=o>0?Math.max(0,(o-r)/o*100):100;return t.jsx(Fe,{title:"Ch. Busy",icon:t.jsx(m,{className:"mini-widget-icon"}),isLoading:s,error:a,onClick:()=>n("/packets"),children:t.jsx("div",{className:"flex-1 flex items-end",children:t.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-2 gap-y-2 w-full items-baseline",children:[t.jsx("span",{className:"data-box-label mb-0",title:`${l} packets exceeded max CAD attempts (5) out of ${i} total transmissions.`,children:"Failed:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`${l} packets exceeded max CAD attempts (5) out of ${i} total transmissions.`,children:[l,t.jsx("span",{className:"text-text-muted",children:"/"}),i]}),t.jsx("span",{className:"data-box-label mb-0",title:`${x.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:"Sent:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`${x.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:[x.toFixed(0),"%"]}),t.jsx("span",{className:"data-box-label mb-0",title:`Average LBT backoff delay: ${c.toFixed(0)}ms.`,children:"Mean:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`Average LBT backoff delay: ${c.toFixed(0)}ms.`,children:[Ge(c),t.jsx("span",{className:"text-text-muted text-xs",children:"ms"})]}),t.jsx("span",{className:"data-box-label mb-0",title:`Backoff range: ${u.toFixed(0)}ms min, ${h.toFixed(0)}ms max.`,children:"Range:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`Backoff range: ${u.toFixed(0)}ms min, ${h.toFixed(0)}ms max.`,children:[Ge(u),t.jsx("span",{className:"text-text-muted",children:"/"}),Ge(h)]})]})})})}function Ve(e){return null===e?"No reading":e<-115?"Very quiet":e<-105?"Quiet":e<-95?"Moderate":e<-85?"Elevated":"High interference"}function qe(){const{noiseFloor:s,sparklineNoiseFloor:a,trends:n,isLoading:l,error:i}=We(),r=null===(o=s)||o<-110?"excellent":o<-100?"good":o<-90?"fair":o<-80?"congested":"critical";var o;const c=null==n?void 0:n.noiseFloor.trend,{chartData:d,yDomain:u}=e.useMemo(()=>{if(!a||a.length<2)return{chartData:[],yDomain:[-120,-90]};const e=a.map(e=>({value:e})),t=a.filter(e=>-100!==e&&e<-50);if(0===t.length)return{chartData:e,yDomain:[-120,-90]};const s=Math.min(...t),n=Math.max(...t),l=n-s,i=Math.max(.2*l,3);return{chartData:e,yDomain:[s-i,n+i]}},[a]);return t.jsx(Fe,{title:"Noise Floor",icon:t.jsx(h,{className:"mini-widget-icon"}),value:null!==s?Math.round(s):"—",unit:null!==s?"dBm":void 0,status:r,trend:c,subtitle:Ve(s),isLoading:l,error:i,children:t.jsx("div",{className:"mini-widget-sparkline",children:d.length>0?t.jsx(ae,{width:"100%",height:24,children:t.jsxs(ne,{data:d,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(le,{domain:u,hide:!0}),t.jsx(ie,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function Je(){const s=d(),a=C(),n=k(),l=L(),i=D(),r=60*R[i].minutes,o=T(),c=e.useMemo(()=>{if(0===o)return n;const e=o-r;return n.filter(t=>t.timestamp>=e)},[n,r,o]),u=null===l,m=(null==l?void 0:l.local_hash)?S(l.local_hash):"",h=(null==l?void 0:l.neighbors)??{},{neighborHashes:v,neighborNames:j}=e.useMemo(()=>{const e=new Set,t=new Map;for(const s of a){e.add(s.hash);const a=h[s.hash],n=(null==a?void 0:a.name)||(null==a?void 0:a.node_name)||s.prefix;t.set(s.hash,n)}return{neighborHashes:e,neighborNames:t}},[a,h]),b=e.useMemo(()=>{if(0===v.size||0===c.length||!m)return{champion:null,listener:null,loudest:null};const{scores:e}=me(c,v,m),t=[];for(const[l,i]of e)0!==i.blendedScore&&t.push({...i,name:j.get(l)??S(l)});let s=null,a=null,n=null;for(const l of t)(!s||l.blendedScore>s.blendedScore)&&(s=l),(!a||l.listenerScore>a.listenerScore)&&(a=l),(!n||l.loudScore>n.loudScore)&&(n=l);return{champion:s,listener:a,loudest:n}},[c,v,m,j]),{champion:N,listener:y,loudest:w}=b,M=N||y||w?t.jsxs("div",{className:"flex flex-col gap-0.5 mt-auto",children:[N&&t.jsx(A,{content:(_=N,t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",_.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Blended Score: ",_.blendedScore,t.jsx("span",{className:"text-text-muted/60 ml-1",children:"(Listener + Loud)"})]}),t.jsxs("div",{className:"border-t border-border-subtle pt-1 mt-1 space-y-0.5",children:[t.jsxs("div",{children:["Listener: ",_.listenerScore,"/100 (",_.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",_.loudScore,"/100 (",_.loudCount," packets relayed)"]})]})]})),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(x,{className:"w-3 h-3 text-map-neighbor-color flex-shrink-0"}),t.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:N.name}),t.jsx("span",{className:"text-map-neighbor-color pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:N.blendedScore})]})}),y&&t.jsx(A,{content:(e=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",e.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Score: ",e.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-border-subtle pt-1 mt-1",children:t.jsxs("div",{children:[e.listenerCount," packets where they heard your transmissions"]})})]}))(y),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(p,{className:"w-3 h-3 text-text-muted flex-shrink-0"}),t.jsx("span",{className:"text-text-muted font-mono truncate flex-1 min-w-0",children:y.name}),t.jsx("span",{className:"text-text-muted pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:y.listenerScore})]})}),w&&t.jsx(A,{content:(e=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",e.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Score: ",e.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-border-subtle pt-1 mt-1",children:t.jsxs("div",{children:[e.loudCount," packets they relayed directly to you"]})})]}))(w),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(f,{className:"w-3 h-3 text-text-muted flex-shrink-0"}),t.jsx("span",{className:"text-text-muted font-mono truncate flex-1 min-w-0",children:w.name}),t.jsx("span",{className:"text-text-muted pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:w.loudScore})]})})]}):0===a.length?t.jsx("div",{className:"flex items-center justify-center text-sm text-text-muted mt-auto",children:"No direct neighbors"}):t.jsx("div",{className:"flex items-center justify-center text-sm text-text-muted mt-auto",children:"No routing data yet"});var _;return t.jsx(Fe,{title:"Link Leaders",icon:t.jsx(g,{className:"mini-widget-icon"}),isLoading:u,onClick:()=>s("/contacts"),children:M})}function Ue(){const{lbtStats:s,isLoading:a,error:n}=We(),l=s?function(e){const{retryRate:t,channelBusyCount:s,totalPacketsWithLBT:a,avgBackoffMs:n,maxBackoffMs:l}=e;if(0===a)return 0;const i=Math.min(a/10,1),r=Math.log(1+.15*t)/Math.log(16)*40,o=s/a*100,c=Math.min(.5*o,25);let d=0;n>100&&(d=Math.min(8*Math.log10(n/100),15));let u=0;l>500&&n>0&&l>2*n&&(u=Math.min((l-500)/200,5));const m=(r+c+d+u)*i;return Math.min(m,85)}(s):0,i=s?(r=l)<15?"excellent":r<30?"good":r<45?"fair":r<60?"congested":"critical":"unknown";var r;const o=(null==s?void 0:s.maxBackoffMs)??0,c=s?o>200?`Max backoff: ${Math.round(o)}ms`:function(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}(l):void 0,d=null==s?void 0:s.sparklineCollisionRisk,{chartData:u,yDomain:m}=e.useMemo(()=>{if(!d||d.length<2)return{chartData:[],yDomain:[0,85]};const e=d.map(e=>({value:e})),t=d.filter(e=>e>0);if(0===t.length)return{chartData:e,yDomain:[0,85]};const s=Math.min(...t),a=Math.max(...t),n=a-s,l=Math.max(.2*n,5);return{chartData:e,yDomain:[Math.max(0,s-l),Math.min(85,a+l)]}},[d]);return t.jsx(Fe,{title:"Collision Risk",icon:t.jsx(v,{className:"mini-widget-icon"}),value:l.toFixed(1),unit:"%",status:i,subtitle:c,isLoading:a,error:n,children:t.jsx("div",{className:"mini-widget-sparkline",children:u.length>0?t.jsx(ae,{width:"100%",height:24,children:t.jsxs(ne,{data:u,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(le,{domain:m,hide:!0}),t.jsx(ie,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function Qe(){const[s,a]=e.useState(!1),[n]=e.useState(0),{stats:l,lbtStats:r,isLoading:o}=We(),c=e.useMemo(()=>{if(!l)return null;const e=l.airtime_used_ms??0,t=l.max_airtime_ms??1;return{usedMs:e,maxMs:t,remainingMs:l.airtime_remaining_ms??0,utilizationPercent:l.utilization_percent??(t>0?e/t*100:0)}},[l]),d=e.useMemo(()=>r&&0!==r.totalPacketsWithLBT?(r.totalPacketsWithLBT-r.packetsWithRetries)/r.totalPacketsWithLBT*100:100,[r]),u=(null==c?void 0:c.utilizationPercent)??0,m=(h=u)<30?"excellent":h<50?"good":h<70?"fair":h<90?"congested":"critical";var h;const x=(null==c?void 0:c.remainingMs)??0,p=d<95?`${d.toFixed(0)}% clean TX`:((f=x)<1e3?`${Math.round(f)}ms`:f<6e4?`${(f/1e3).toFixed(1)}s`:`${(f/6e4).toFixed(1)}m`)+" remaining";var f;const g=c?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${m}`,style:{width:`${Math.min(u,100)}%`}})}):null;return t.jsx(Fe,{title:"Duty Cycle",icon:t.jsx(i,{className:"mini-widget-icon"}),value:u.toFixed(1),unit:"%",status:m,subtitle:p,isLoading:o,children:g})}function Xe(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(K,{className:"w-4 h-4"}),t.jsx(K,{className:"h-3 w-16"})]}),t.jsx(K,{className:"h-7 w-12 mt-2"}),t.jsx(K,{className:"h-3 w-20 mt-2"})]})}function Ye(){return t.jsx("div",{className:"widget-row",children:Array.from({length:6}).map((e,s)=>t.jsx(Xe,{},s))})}function Ze({className:e="",isLoaded:s=!0}){return t.jsxs("div",{className:`mesh-health-container relative ${e}`,children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(j,{className:"w-4 h-4 text-accent-primary"}),t.jsx("span",{className:"type-label text-text-muted",children:"MESH HEALTH"})]}),s?t.jsx(Ee,{children:t.jsxs("div",{className:"widget-row",children:[t.jsx(Oe,{}),t.jsx(Ue,{}),t.jsx(qe,{}),t.jsx(Qe,{}),t.jsx(Ke,{}),t.jsx(Je,{})]})}):t.jsx(Ye,{})]})}function et(){var s,n;const l=L(),r=$(),o=k(),c=P(),d=D(),u=H(),m=I(),h=R[d],x=5===d&&!m.threeDayLoadComplete,p=6===d&&!m.sevenDayLoadComplete,f=7===d&&!m.fourteenDayLoadComplete,g=m.isBackgroundLoading&&(x||p||f),v=z(),j=O(),w=null==(s=null==l?void 0:l.config)?void 0:s.radio,M=e.useMemo(()=>w?{sf:w.spreading_factor??10,bw:w.bandwidth??25e4,cr:w.coding_rate??5,preamble:w.preamble_length??8}:null,[w]),_=o.length,S=e.useMemo(()=>_?E(h.minutes,h.buckets,o,l):null,[_,h.minutes,h.buckets,M]),C=e.useMemo(()=>function(e,t){if(!(null==e?void 0:e.length))return[];const s=t>1440?{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}:{hour:"2-digit",minute:"2-digit",hour12:!1};return e.map(e=>({time:new Date(1e3*e.start).toLocaleString([],s),received:e.count}))}(null==S?void 0:S.received,h.minutes),[null==S?void 0:S.received,h.minutes]),F=e.useMemo(()=>function(e){if(!e.length)return[0,"auto"];const t=e.map(e=>e.received),s=Math.min(...t),a=Math.max(...t);if(s===a)return[Math.max(0,s-1),a+1];const n=.1*(a-s);return[Math.max(0,Math.floor(s-n)),Math.ceil(a+n)]}(C),[C]),B=e.useMemo(()=>{return(e=C.length)<=12?0:e<=24?2:e<=48?5:e<=72?8:Math.floor(e/7);var e},[C.length]),T=e.useMemo(()=>{const e=e=>(null==e?void 0:e.reduce((e,t)=>e+t.count,0))??0,t=e(null==S?void 0:S.received),s=e(null==S?void 0:S.forwarded),a=e(null==S?void 0:S.dropped),n=e(null==S?void 0:S.transmitted),l=((null==S?void 0:S.time_range_minutes)??h.minutes)/60;return{received:t,forwarded:s,dropped:a,transmitted:n,rxPerHour:l>0?Math.round(t/l):0,fwdPerHour:l>0?Math.round(s/l):0}},[S,h.minutes]),A=(null==l?void 0:l.node_name)??(null==(n=null==l?void 0:l.config)?void 0:n.node_name)??"Unknown Node";return r?t.jsxs(V,{className:"p-8 text-center",children:[t.jsx("p",{className:"type-subheading text-accent-red mb-2",children:"Failed to connect to backend"}),t.jsx("p",{className:"type-body text-white/50",children:r}),t.jsx("p",{className:"type-data-sm text-white/40 mt-4",children:"Make sure the backend is running on port 8000"})]}):t.jsxs(q,{children:[t.jsx(J,{title:A,icon:t.jsx(b,{}),controls:t.jsx(ee,{ranges:R,selectedIndex:d,onSelect:u,isPending:g})}),t.jsx(he,{template:"hero",children:t.jsx(V,{isLoaded:c,skeletonType:"chart",compact:!0,children:c&&t.jsxs(t.Fragment,{children:[t.jsx(U,{icon:t.jsx(a,{}),title:"RECEIVED",badge:h.label,actions:t.jsxs("div",{className:"data-box",children:[T.rxPerHour,"/hr"]})}),t.jsx("div",{className:"font-mono text-5xl font-semibold tabular-nums text-accent-primary min-h-[3rem]",style:{letterSpacing:"-0.05em"},children:T.received.toLocaleString()}),t.jsx("div",{className:"mt-4",children:C.length>0?t.jsx(ae,{width:"100%",height:180,children:t.jsxs(re,{data:C,margin:{left:0,right:8,top:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"gradient-received",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"5%",stopColor:v.received,stopOpacity:.3}),t.jsx("stop",{offset:"95%",stopColor:v.received,stopOpacity:0})]})}),t.jsx(oe,{strokeDasharray:"3 3",stroke:j.grid,vertical:!1}),t.jsx(ce,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:j.axisTick,fontSize:10,fontFamily:W},dy:8,interval:B,minTickGap:20}),t.jsx(le,{domain:F,axisLine:!1,tickLine:!1,tick:{fill:j.axisTick,fontSize:10,fontFamily:W},dx:-4,width:28}),t.jsx(de,{content:t.jsx(Me,{color:v.received,labelKey:"time",unit:" packets"}),cursor:{stroke:j.cursor,strokeWidth:1}}),t.jsx(ue,{type:"stepAfter",dataKey:"received",stroke:v.received,fill:"url(#gradient-received)",strokeWidth:1,dot:!1,activeDot:{r:4,strokeWidth:0,fill:v.received},isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available for this time range"})})]})})}),t.jsxs(he,{template:"compact",children:[t.jsx(xe,{span:12,md:6,lg:4,children:t.jsx(ve,{title:"FORWARDED",value:T.forwarded,color:"forwarded",buckets:null==S?void 0:S.forwarded,receivedCount:T.received,timeRangeLabel:h.label,icon:t.jsx(N,{className:"w-4 h-4"}),isLoaded:c})}),t.jsx(xe,{span:12,md:6,lg:4,children:t.jsx(ve,{title:"DROPPED",value:T.dropped,color:"dropped",buckets:null==S?void 0:S.dropped,receivedCount:T.received,timeRangeLabel:h.label,icon:t.jsx(y,{className:"w-4 h-4"}),isLoaded:c})}),t.jsx(xe,{span:12,md:12,lg:4,children:t.jsx(ye,{stats:l,receivedBuckets:null==S?void 0:S.received,droppedBuckets:null==S?void 0:S.dropped,forwardedBuckets:null==S?void 0:S.forwarded,bucketDurationSeconds:null==S?void 0:S.bucket_duration_seconds,timeRangeLabel:h.label,isLoaded:c})})]}),t.jsx(Ze,{isLoaded:c}),t.jsx(we,{}),l&&t.jsx(he,{template:"auto",children:t.jsxs(V,{children:[t.jsx(U,{icon:t.jsx(i,{}),title:"Node Information",largeTitle:!0}),t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Node Name"}),t.jsx("p",{className:"type-body text-text-primary mt-1",children:A})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",l.version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Core Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",l.core_version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Local Hash"}),t.jsx("div",{className:"mt-1",children:l.local_hash?t.jsx(te,{hash:l.local_hash,size:"sm"}):t.jsx("span",{className:"type-data-sm text-text-secondary",children:"N/A"})})]})]}),l.public_key&&t.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle",children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Public Key"}),t.jsx("div",{className:"mt-1",children:t.jsx(te,{hash:l.public_key,prefixLength:12,suffixLength:8})})]})]})})]})}export{et as default}; diff --git a/frontend/dist/assets/Dashboard-I4-zVbBf.js b/frontend/dist/assets/Dashboard-I4-zVbBf.js new file mode 100644 index 00000000..03c5dcce --- /dev/null +++ b/frontend/dist/assets/Dashboard-I4-zVbBf.js @@ -0,0 +1 @@ +import{r as e,j as t,y as s,T as a,z as n,A as l,p as i,D as r,g as o,E as c,x as d,H as u,I as m,J as x,K as h,O as p,Q as f,U as g,Z as v,V as j,W as b,Y as N,_ as k}from"./vendor-react-C0qkT9dV.js";import{u as y,a as w,b as M,c as _,d as L,e as S,f as C,h as D,D as F,j as B,k as R,T,m as A,n as $,o as P,p as H,q as I,F as E}from"./index-DrUSC4Ks.js";import{u as W,a as z}from"./useThemeColors-DL9Pr7sC.js";import{C as O,S as G,a as K,P as V,b as q,c as J}from"./PageLayout-DAadOF4d.js";import{P as U,a as Q,b as X}from"./PacketDetailModal-D1jT4M4x.js";import{T as Y}from"./TimeRangeSelector-COrVm3Yj.js";import{H as Z}from"./HashBadge-CAy9V6Vn.js";import{s as ee}from"./SignalIndicator-C1cW0knK.js";import{R as te,L as se,Y as ae,a as ne,A as le,C as ie,X as re,T as oe,b as ce}from"./recharts-DRDKmvXb.js";import{c as de}from"./link-scoring-y9pf-GTv.js";import{R as ue,C as me}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const xe={received:{barBase:"var(--metric-received)"},forwarded:{barBase:"var(--metric-forwarded)"},transmitted:{barBase:"var(--metric-transmitted)"},dropped:{barBase:"var(--metric-dropped)"},neutral:{barBase:"var(--metric-neutral)"}},he={sm:"card-sm",md:"card-md",lg:"card-lg",hero:"card-hero",auto:""};function pe({buckets:s,colorType:a}){const n=xe[a].barBase,l=e.useMemo(()=>{if(!(null==s?void 0:s.length))return[];const e=s.length/60,t=e<=1?s:Array.from({length:60},(t,a)=>{var n,l;const i=s.slice(Math.floor(a*e),Math.floor((a+1)*e)),r=i.reduce((e,t)=>e+t.count,0),o=i.length?i.reduce((e,t)=>e+t.avg_snr,0)/i.length:0;return{bucket:a,start:(null==(n=i[0])?void 0:n.start)??0,end:(null==(l=i.at(-1))?void 0:l.end)??0,count:r,airtime_ms:i.reduce((e,t)=>e+t.airtime_ms,0),avg_snr:o,avg_rssi:0}}),a=t.map(e=>e.count).filter(e=>e>0);if(0===a.length)return t.map(()=>({height:0,bottom:0,color:"transparent",count:0,snr:0}));const l=Math.max(...a),i=Math.min(...a),r=l-i;return 0===r?t.map(e=>({height:e.count>0?40:0,bottom:e.count>0?30:0,color:e.count>0?n:"transparent",count:e.count,snr:e.avg_snr})):t.map(e=>{if(0===e.count)return{height:0,bottom:0,color:"transparent",count:0,snr:e.avg_snr};const t=(e.count-i)/r,s=25*t;return{height:Math.max(15,25+60*t),bottom:s,color:n,count:e.count,snr:e.avg_snr}})},[s,n]);return(null==s?void 0:s.length)?t.jsx("div",{className:"w-full h-full relative",children:l.map((e,s)=>{var a;return t.jsx("div",{className:"absolute rounded-full",style:{height:`${e.height}%`,bottom:`${e.bottom}%`,left:7*s+"px",width:"5px",backgroundColor:e.color,opacity:e.count>0?.8:.1},title:e.count>0?`${e.count} packets, SNR: ${null==(a=e.snr)?void 0:a.toFixed(1)}dB`:"No packets"},s)})}):t.jsx("div",{className:"w-full h-full flex items-end justify-center gap-[2px] opacity-20",children:t.jsx("span",{className:"type-data-xs text-text-secondary",children:"No data"})})}function fe({title:s,value:a,color:n="neutral",subtitle:l,buckets:i,receivedCount:r,timeRangeLabel:o,icon:c,size:d="md",isLoaded:u=!0}){const m="string"==typeof a?a:a.toLocaleString(),x=e.useMemo(()=>function(e){if(!(null==e?void 0:e.length))return null;const t=e.reduce((e,t)=>e+t.count,0),s=e[0].start,a=e[e.length-1].end,n=Math.max((a-s)/3600,1),l=Math.round(t/n);let i=0,r=0;for(let d=0;dr&&(r=e[d].count,i=d);const o=new Date(1e3*e[i].start).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),c=e.filter(e=>e.count>0&&0!==e.avg_snr);return{total:t,ratePerHour:l,peakCount:r,peakHour:o,avgSnr:c.length>0?c.reduce((e,t)=>e+t.avg_snr,0)/c.length:null}}(i),[i]),h="number"==typeof a?a:(null==x?void 0:x.total)??0,p=r&&r>0?(h/r*100).toFixed(1):null;return u?t.jsxs("div",{className:`data-card flex flex-col relative ${he[d]}`,children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c&&t.jsx("span",{className:"icon-sm text-icon-card-title",children:c}),t.jsx("span",{className:"type-micro",children:s}),o&&t.jsx("span",{className:"pill-tag",children:o})]}),t.jsx("div",{className:"font-mono text-3xl font-semibold tabular-nums text-text-primary",style:{letterSpacing:"-0.05em"},children:m}),t.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[60px]",children:i?t.jsx(pe,{buckets:i,colorType:n}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("div",{className:"w-full h-0.5 rounded-full bg-text-muted/15"})})}),t.jsx("div",{className:"pt-2 mt-1",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Rate"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[(null==x?void 0:x.ratePerHour)??l??"—","/hr"]})]}),null!==p?t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"dropped"===n?"Drop %":"Ratio"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[p,"%"]})]}):(null==x?void 0:x.peakHour)?t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Peak"}),t.jsx("div",{className:"data-box data-box-fill data-box-left",children:x.peakHour})]}):null]})})]}):t.jsx("div",{className:`data-card flex flex-col relative ${he[d]}`,children:t.jsx(O,{})})}const ge=.2;function ve(e,t=1){return Math.floor(5*t*e)}function je(e){const t=Math.round(e/ge)*ge;return Math.max(0,Math.min(5,t))}function be({stats:e,receivedBuckets:i,droppedBuckets:r,forwardedBuckets:o,bucketDurationSeconds:c,timeRangeLabel:d,isLoaded:u=!0}){var m,x,h,p;if(!u)return t.jsx("div",{className:"data-card flex flex-col relative",children:t.jsx(O,{})});const f=function(e,t,s,a,n){var l,i;const r=e=>(null==e?void 0:e.reduce((e,t)=>e+t.count,0))??0,o=r(t),c=r(s),d=r(a),u=o||(null==e?void 0:e.rx_count)||1,m=c||(null==e?void 0:e.dropped_count)||0,x=u>0?m/(u+m)*100:0;let h=0;if((null==a?void 0:a.length)&&n)h=100*d/(a.length*n*1e3)*100;else if(e){const t=1e3*(e.uptime_seconds||1);h=(e.total_airtime_ms||e.airtime_used_ms||0)/t*100}const p=(null==e?void 0:e.neighbors)??{},f=Object.values(p).filter(e=>e.zero_hop).length;let g=1;x<3?g-=ge:x>15?g+=.4:x>10&&(g+=ge),h>5&&(g+=ge),f>10&&(g+=ge);const v=je(g),j=je(.28*v),b=ve(v),N=ve(j),k=ve((null==(i=null==(l=null==e?void 0:e.config)?void 0:l.delays)?void 0:i.tx_delay_factor)??1);return{floodFactor:v,directFactor:j,floodSlots:b,directSlots:N,adjustment:b>k?"increase":b10?"text-accent-warning":""),children:[f.duplicateRate.toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"TX Util"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[f.txUtilization.toFixed(2),"%"]})]})]})}),t.jsxs("div",{className:"pt-2 mt-2",children:[t.jsx("div",{className:"data-box-label",children:"Current"}),t.jsx("div",{className:"flex gap-2",children:null!==g?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"data-box",children:["×",g.toFixed(2)]}),t.jsxs("div",{className:"data-box",style:{color:"var(--accent-tertiary)"},children:["×",(null==v?void 0:v.toFixed(2))??"—"]})]}):t.jsx("span",{className:"text-sm text-text-muted",children:"No config"})})]})]})}function Ne(){const s=y(),a=w(),n=M(),l=_(),[d,u]=e.useState(null),[m,x]=e.useState(null),h=e.useRef(0),p=e.useMemo(()=>[...s.length<=100?s:s.slice(-100)].sort((e,t)=>(t.timestamp??0)-(e.timestamp??0)),[s]),f=e.useMemo(()=>{const e=new Map;if(!(null==l?void 0:l.neighbors))return e;l.local_hash&&e.set(L(l.local_hash),l.local_hash);for(const t of Object.keys(l.neighbors)){const s=L(t);e.has(s)||e.set(s,t)}return e},[l]),g=e.useMemo(()=>p.slice(0,15).map(e=>{if(e.src_hash&&e.src_hash.length<=4){const t=f.get(e.src_hash.toUpperCase());if(t)return{...e,src_hash_full:t}}return e}),[p,f]);e.useEffect(()=>{var e;if(!p.length)return;const t=(null==(e=p[0])?void 0:e.timestamp)??0,s=t>h.current&&h.current>0;if(h.current=t,!s)return;const a=p[0];if(a){const e=requestAnimationFrame(()=>u(a.packet_hash)),t=setTimeout(()=>u(null),600);return()=>{cancelAnimationFrame(e),clearTimeout(t)}}},[p]);const v=()=>t.jsxs(t.Fragment,{children:[t.jsx(i,{className:"w-6 h-6 text-text-muted mx-auto mb-2"}),t.jsx("div",{className:"text-sm text-text-primary",children:"No packets received"}),t.jsx("div",{className:"text-xs text-text-muted",children:"Packets will appear here"})]});return t.jsxs("div",{className:"chart-container h-full flex flex-col",children:[t.jsxs("div",{className:"chart-header",children:[t.jsxs("div",{className:"chart-title",children:[t.jsx(i,{className:"chart-title-icon"}),"Recent Packets"]}),t.jsxs("div",{className:"flex items-center gap-3",children:[n&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(r,{className:"w-2 h-2 fill-accent-success text-accent-success animate-pulse"}),t.jsx("span",{className:"type-data-xs text-text-muted",children:"LIVE"})]}),t.jsxs(o,{to:"/packets",className:"pill-subtle",children:["View all ",t.jsx(c,{className:"w-3 h-3"})]})]})]}),t.jsxs("div",{className:"sm:hidden flex items-center gap-1.5 px-3 py-1.5 border-b border-border-subtle/50 bg-bg-elevated/20",children:[t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-14 flex-shrink-0",children:"Dir"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-7 flex-shrink-0",children:"Time"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-9 flex-shrink-0",children:"Src"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider flex-1 min-w-0",children:"Type"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-14 flex-shrink-0",children:"Route"}),t.jsx("span",{className:"text-[9px] font-semibold text-text-muted uppercase tracking-wider w-12 flex-shrink-0",children:"Signal"})]}),t.jsx("div",{className:"hidden sm:block flex-1 overflow-hidden",children:t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-bg-elevated/95 backdrop-blur-sm",children:t.jsxs("tr",{className:"border-b border-border-subtle/50",children:[t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider w-16",children:"Dir"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Time"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Source"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"text-left py-1.5 px-3 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Route"}),t.jsx("th",{className:"text-right py-1.5 px-3 pr-4 text-[9px] font-semibold text-text-muted uppercase tracking-wider",children:"Signal"})]})}),t.jsx("tbody",{className:"divide-y divide-border-subtle/30",children:a&&0===p.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-8 text-text-muted",children:"Loading packets..."})}):0===g.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-8",children:v()})}):g.map((e,s)=>t.jsx(U,{packet:e,onClick:x,isFlashing:d===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))})]})})}),t.jsx("div",{className:"sm:hidden flex-1 overflow-y-auto divide-y divide-border-subtle/30",children:a&&0===p.length?t.jsx("div",{className:"p-8 text-center text-text-muted",children:"Loading packets..."}):0===g.length?t.jsx("div",{className:"p-8 text-center",children:v()}):g.map((e,s)=>t.jsx(Q,{packet:e,onClick:x,isFlashing:d===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))}),t.jsxs("div",{className:"px-3 py-1.5 border-t border-border-subtle/50 text-[10px] text-text-muted bg-bg-elevated/20 text-center",children:["Showing ",g.length," of ",p.length," packets"]}),m&&t.jsx(X,{packet:m,onClose:()=>x(null)})]})}e.memo(function({active:e,payload:s,label:a,formatValue:n,labelKey:l}){var i;if(!e||!(null==s?void 0:s.length))return null;const r=l&&(null==(i=s[0])?void 0:i.payload)?s[0].payload[l]:a;return t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-4 py-3 shadow-xl",children:[r&&t.jsx("p",{className:"type-data-xs text-white/50 mb-2",children:r}),t.jsx("div",{className:"space-y-1.5",children:s.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),t.jsx("span",{className:"type-body-sm text-white/70 capitalize min-w-[60px]",children:e.name}),t.jsx("span",{className:"type-data-sm text-white tabular-nums",children:n?n(e.value,e.name):e.value.toLocaleString()})]},s))})]})});const ke=e.memo(function({active:e,payload:s,color:a,labelKey:n,unit:l=""}){var i,r;if(!e||!(null==s?void 0:s.length))return null;const o=s[0],c=null==(i=null==o?void 0:o.payload)?void 0:i[n];return t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 shadow-xl",children:[t.jsx("p",{className:"type-data-xs text-white/50 mb-1",children:c}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a}}),t.jsxs("span",{className:"type-data-sm text-white tabular-nums",children:[null==(r=null==o?void 0:o.value)?void 0:r.toLocaleString(),l]})]})]})});e.memo(function({payload:e}){return(null==e?void 0:e.length)?t.jsx("div",{className:"flex items-center justify-center gap-6 mt-4 pt-4 border-t border-white/5",children:e.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsx("span",{className:"type-body-sm text-white/60 capitalize",children:e.value})]},s))}):null});const ye={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function we({trend:e}){return t.jsx("span",{className:`mini-widget-trend ${e}`,children:t.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:ye[e]})})})}function Me(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function _e({message:e}){return t.jsx("div",{className:"mini-widget-error",children:t.jsx("span",{title:e,children:"No data"})})}function Le({title:e,icon:s,value:a,unit:n,valueSize:l="md",status:i,subtitle:r,trend:o,children:c,isLoading:d=!1,error:u,className:m="",onClick:x}){const h=["mini-widget-value","lg"===l&&"mini-widget-value-lg","sm"===l&&"mini-widget-value-sm"].filter(Boolean).join(" "),p=["mini-widget",x&&"cursor-pointer",m].filter(Boolean).join(" ");return t.jsxs("div",{className:p,onClick:x,role:x?"button":void 0,children:[t.jsxs("div",{className:"mini-widget-header",children:[s,t.jsx("span",{className:"mini-widget-title",children:e}),i&&"unknown"!==i&&t.jsx("div",{className:`mini-widget-status-dot ${i}`}),o&&t.jsx(we,{trend:o})]}),d?t.jsx(Me,{}):u?t.jsx(_e,{message:u}):t.jsxs(t.Fragment,{children:[void 0!==a&&t.jsxs("div",{className:h,children:[a,n&&t.jsx("span",{className:"mini-widget-unit",children:n})]}),r&&t.jsx("div",{className:"mini-widget-subtitle",children:r}),c]})]})}const Se={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},Ce={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function De(e,t){if(0===e.length)return null;const s=[...e].sort((e,t)=>e-t),a=t/100*(s.length-1),n=Math.floor(a),l=Math.ceil(a);return n===l?s[n]:s[n]+(s[l]-s[n])*(a-n)}function Fe(e){return De(e,50)}const Be={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],linkQuality:null,channelHealth:null,nfTrend:Ce,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},Re=e.createContext(Be);function Te(e){if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(Number).filter(e=>!isNaN(e))}catch{}return[]}function Ae(e){return null!=e&&0!==e&&!Object.is(e,-0)&&!(e>-50||e<-130)}function $e(e,t,s=2,a=!1){if(null===t)return"stable";const n=e-t;return(0!==t?100*Math.abs(n/t):Math.abs(n))0?"up":"down":n>0?"down":"up"}function Pe({children:s}){var a;const n=_(),l=y(),i=S(),r=C(),o=D(),c=F[o],d=Math.max(1,c.minutes/60),u=null===n,m=e.useMemo(()=>function(e,t){const s=3600*t,a=Math.floor(Date.now()/1e3)-s,n=e.filter(e=>e.timestamp>=a&&void 0!==e.lbt_attempts&&e.lbt_attempts>0),l=n.length,i=n.filter(e=>(e.lbt_attempts??0)>1).length,r=l>0?i/l*100:0,o=n.filter(e=>(e.lbt_attempts??0)>1),c=o.length>0?o.reduce((e,t)=>e+(t.lbt_attempts??0),0)/o.length:0,d=n.filter(e=>(e.lbt_attempts??0)>=5).length,u=l>0?d/l*100:0,m=[];for(const b of n){const e=Te(b.lbt_backoff_delays_ms);m.push(...e)}const x=m.reduce((e,t)=>e+t,0),h=m.length>0?x/m.length:0,p=m.length>0?Math.min(...m):0,f=m.length>0?Math.max(...m):0,g=s/24,v=[],j=[];for(let b=0;b<24;b++){const e=a+b*g,t=e+g,s=n.filter(s=>s.timestamp>=e&&s.timestamp(e.lbt_attempts??0)>1).length,i=s.length>0?l/s.length*100:0,r=[];for(const a of s){const e=Te(a.lbt_backoff_delays_ms);r.push(...e)}const o=r.length>0?r.reduce((e,t)=>e+t,0)/r.length:0;if(v.push(o),0===s.length)j.push(0);else{const e=s.filter(e=>(e.lbt_attempts??0)>=5).length,t=r.length>0?Math.max(...r):0,a=Math.min(s.length/5,1),n=.15,l=Math.log(1+i*n)/Math.log(1+100*n)*40,c=e/s.length*100,d=Math.min(.5*c,25);let u=0;o>100&&(u=Math.min(8*Math.log10(o/100),15));let m=0;t>500&&o>0&&t>2*o&&(m=Math.min((t-500)/200,5));const x=l+d+u+m;j.push(Math.min(x*a,85))}}return{totalPacketsWithLBT:l,packetsWithRetries:i,retryRate:r,avgRetries:c,channelBusyCount:d,channelBusyRate:u,avgBackoffMs:h,minBackoffMs:p,maxBackoffMs:f,totalBackoffMs:x,sparklineBackoff:v,sparklineCollisionRisk:j,windowHours:t,packetCount:e.length}}(l,d),[l,d]),x=(null==n?void 0:n.noise_floor_dbm)??null,h=e.useMemo(()=>Ae(x)?x:null,[x]),p=e.useMemo(()=>{var e;const t=null==(e=null==n?void 0:n.config)?void 0:e.radio;return t?{sf:t.spreading_factor??7,bwHz:t.bandwidth??125e3}:null},[null==(a=null==n?void 0:n.config)?void 0:a.radio]),[f,g]=e.useState([]),v=e.useRef({time:0,hours:0});e.useEffect(()=>{const e=async()=>{var e;const t=Date.now(),s=Math.ceil(d);if(0===v.current.time||v.current.hours!==s||t-v.current.time>=6e4){v.current={time:t,hours:s};try{const t=await B(Math.max(s,24));t.success&&(null==(e=t.data)?void 0:e.history)&&g(t.data.history)}catch{}}};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[d]);const j=e.useMemo(()=>{if(0===f.length)return[];const e=f.reduce((e,t)=>Math.max(e,t.timestamp),0);if(0===e)return[];const t=3600*d,s=e-t,a=t/24,n=[];for(let l=0;l<24;l++){const e=s+l*a,t=e+a,i=f.filter(s=>s.timestamp>=e&&s.timestamp0){const e=i.reduce((e,t)=>e+t.noise_floor_dbm,0)/i.length;n.push(e)}else n.push(n.length>0?n[n.length-1]:-100)}return n},[f,d]),b=null==n?void 0:n.neighbors,N=e.useMemo(()=>{const e=b??{};return Object.fromEntries(Object.entries(e).filter(([e])=>!r.has(e)))},[b,r]),k=e.useMemo(()=>i.filter(e=>!r.has(e.hash)),[i,r]),w=e.useMemo(()=>function(e){if(0===e.length)return{...Ce,computedAt:Math.floor(Date.now()/1e3)};const t=Math.floor(Date.now()/1e3),s=e.filter(e=>Number.isFinite(e)),a=e.length>0?[e[e.length-1]]:[],n=e.slice(-4).filter(e=>Number.isFinite(e)),l=Fe(s),i=De(s,10),r=De(s,90),o=Fe(a),c=null!==o&&null!==i?o-i:0,d=function(e){if(e.length<2)return 0;const t=e.length;let s=0,a=0,n=0,l=0;const i=e[0].timestamp;for(const o of e){const e=(o.timestamp-i)/3600,t=o.value;s+=e,a+=t,n+=e*t,l+=e*e}const r=t*l-s*s;return Math.abs(r)<1e-4?0:(t*n-s*a)/r}(n.map((e,s)=>({timestamp:t-3600*(n.length-1-s),value:e}))),u=function(e){if(e.length<2)return 0;const t=e.reduce((e,t)=>e+t,0)/e.length,s=e.map(e=>Math.pow(e-t,2)).reduce((e,t)=>e+t,0)/e.length;return Math.sqrt(s)}(n),m=s.length>=12,[x,h]=m?function(e,t,s){const a=Se;return e>=a.DELTA_CRITICAL?[2,`Noise floor ${e.toFixed(1)} dB above baseline`]:t>=a.SLOPE_CRITICAL?[2,`Noise floor rising ${t.toFixed(1)} dB/hour`]:s>=a.JITTER_CRITICAL?[2,`Noise floor unstable (±${s.toFixed(1)} dB)`]:e>=a.DELTA_WARNING?[1,`Noise floor ${e.toFixed(1)} dB above baseline`]:t>=a.SLOPE_WARNING?[1,`Noise floor rising ${t.toFixed(1)} dB/hour`]:s>=a.JITTER_WARNING?[1,`Noise floor variable (±${s.toFixed(1)} dB)`]:[0,null]}(c,d,u):[0,null];return{baselineMedian:l,baselineP10:i,baselineP90:r,currentMedian:o,currentSampleCount:a.length,delta:c,slope:d,jitter:u,penalty:x,penaltyReason:h,computedAt:t,isReliable:m}}(j),[j]),M=e.useMemo(()=>function(e,t,s){if(0===e.length)return{neighbors:[],networkScore:0,neighborCount:0,bestLink:null,worstLink:null};const a=e.map(e=>{const a=function(e,t,s){const a=ee(e,t,s,0);if(a)switch(a.finalGrade){case"excellent":return 100;case"good":return 80;case"fair":return 60;case"poor":return 40;case"critical":return 20}const n=void 0===e?50:e>=10?100:e>=5?80:e>=0?60:e>=-5?40:20,l=void 0===t?50:t>=-70?100:t>=-80?80:t>=-90?60:t>=-100?40:20;return Math.round(.6*n+.4*l)}(e.avgSnr??void 0,e.avgRssi??void 0,s),n=t[e.hash];return{name:(null==n?void 0:n.name)||(null==n?void 0:n.node_name)||e.prefix,hash:e.hash,rssi:e.avgRssi??-100,snr:e.avgSnr??-10,score:a,advertCount:e.count}});a.sort((e,t)=>t.score-e.score);const n=a.length>0?a.reduce((e,t)=>e+t.score,0)/a.length:0;return{neighbors:a,networkScore:Math.round(n),neighborCount:a.length,bestLink:a.length>0?{name:a[0].name,score:a[0].score}:null,worstLink:a.length>0?{name:a[a.length-1].name,score:a[a.length-1].score}:null}}(k,N,p),[k,N,p]),L=e.useMemo(()=>function(e,t,s){const a=e?Math.max(0,Math.min(100,100-5*e.retryRate)):50;let n=50;null!==t&&(n=Math.max(0,Math.min(100,(t+120)/30*100)));const l=(null==s?void 0:s.networkScore)??50,i=Math.round(.35*a+.25*n+.4*l);let r;return r=i>=85?"excellent":i>=70?"good":i>=50?"fair":i>=30?"congested":"critical",{score:i,status:r,components:{lbtHealth:Math.round(a),noiseHealth:Math.round(n),linkHealth:Math.round(l)}}}(m,h,M),[m,h,M]),[R,T]=e.useState({noiseFloor:null,networkScore:null,channelHealth:null}),A=e.useRef(0);e.useEffect(()=>{const e=()=>{const e=Date.now();e-A.current>3e4&&(A.current=e,T({noiseFloor:h,networkScore:(null==M?void 0:M.networkScore)??null,channelHealth:(null==L?void 0:L.score)??null}))};e();const t=setInterval(e,5e3);return()=>clearInterval(t)},[h,null==M?void 0:M.networkScore,null==L?void 0:L.score]);const $=e.useMemo(()=>({noiseFloor:{current:h,previous:R.noiseFloor,trend:null!==h?$e(h,R.noiseFloor,2,!0):"stable"},networkScore:{current:(null==M?void 0:M.networkScore)??0,previous:R.networkScore,trend:$e((null==M?void 0:M.networkScore)??0,R.networkScore,3,!1)},channelHealth:{current:(null==L?void 0:L.score)??0,previous:R.channelHealth,trend:$e((null==L?void 0:L.score)??0,R.channelHealth,3,!1)}}),[h,null==M?void 0:M.networkScore,null==L?void 0:L.score,R]),P={lbtStats:m,noiseFloor:h,sparklineNoiseFloor:j,linkQuality:M,channelHealth:L,nfTrend:w,radioConfig:p,trends:$,stats:n,recentPackets:l,quickNeighbors:i,isLoading:u,error:null,refresh:async()=>{}};return t.jsx(Re.Provider,{value:P,children:s})}function He(){const t=e.useContext(Re);if(void 0===t)throw new Error("useLBTData must be used within an LBTDataProvider");return t}function Ie(e,t){return 0===e?"No backoffs":`${t.toFixed(0)}% retry rate`}function Ee(){const{lbtStats:s,isLoading:a,error:n}=He(),l=d(),i=(null==s?void 0:s.avgBackoffMs)??0,r=(null==s?void 0:s.retryRate)??0,o=s?(c=i)<100?"excellent":c<250?"good":c<500?"fair":c<1e3?"congested":"critical":"unknown";var c;const m=null==s?void 0:s.sparklineBackoff,{chartData:x,yDomain:h}=e.useMemo(()=>{if(!m||m.length<2)return{chartData:[],yDomain:[0,100]};const e=m.map(e=>({value:e})),t=m.filter(e=>e>0);if(0===t.length)return{chartData:e,yDomain:[0,100]};const s=Math.min(...t),a=Math.max(...t),n=a-s,l=Math.max(.2*n,.1*a,10);return{chartData:e,yDomain:[Math.max(0,s-l),a+l]}},[m]);return t.jsx(Le,{title:"LBT Backoff",icon:t.jsx(u,{className:"mini-widget-icon"}),value:Math.round(i),unit:"ms",status:o,subtitle:s?Ie(i,r):void 0,isLoading:a,error:n,onClick:()=>l("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline",children:x.length>0?t.jsx(te,{width:"100%",height:24,children:t.jsxs(se,{data:x,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(ae,{domain:h,hide:!0}),t.jsx(ne,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function We(e){return 0===e?"—":e<1?"<1":Math.round(e).toString()}function ze(){const{lbtStats:e,isLoading:s,error:a}=He(),n=d(),l=(null==e?void 0:e.channelBusyCount)??0,i=(null==e?void 0:e.totalPacketsWithLBT)??0,r=(null==e?void 0:e.channelBusyRate)??0,o=(null==e?void 0:e.retryRate)??0,c=(null==e?void 0:e.avgBackoffMs)??0,u=(null==e?void 0:e.minBackoffMs)??0,x=(null==e?void 0:e.maxBackoffMs)??0,h=o>0?Math.max(0,(o-r)/o*100):100;return t.jsx(Le,{title:"Ch. Busy",icon:t.jsx(m,{className:"mini-widget-icon"}),isLoading:s,error:a,onClick:()=>n("/packets"),children:t.jsx("div",{className:"flex-1 flex items-end",children:t.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-2 gap-y-2 w-full items-baseline",children:[t.jsx("span",{className:"data-box-label mb-0",title:`${l} packets exceeded max CAD attempts (5) out of ${i} total transmissions.`,children:"Failed:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`${l} packets exceeded max CAD attempts (5) out of ${i} total transmissions.`,children:[l,t.jsx("span",{className:"text-text-muted",children:"/"}),i]}),t.jsx("span",{className:"data-box-label mb-0",title:`${h.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:"Sent:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`${h.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:[h.toFixed(0),"%"]}),t.jsx("span",{className:"data-box-label mb-0",title:`Average LBT backoff delay: ${c.toFixed(0)}ms.`,children:"Mean:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`Average LBT backoff delay: ${c.toFixed(0)}ms.`,children:[We(c),t.jsx("span",{className:"text-text-muted text-xs",children:"ms"})]}),t.jsx("span",{className:"data-box-label mb-0",title:`Backoff range: ${u.toFixed(0)}ms min, ${x.toFixed(0)}ms max.`,children:"Range:"}),t.jsxs("div",{className:"data-box justify-self-start",title:`Backoff range: ${u.toFixed(0)}ms min, ${x.toFixed(0)}ms max.`,children:[We(u),t.jsx("span",{className:"text-text-muted",children:"/"}),We(x)]})]})})})}function Oe(e){return null===e?"No reading":e<-115?"Very quiet":e<-105?"Quiet":e<-95?"Moderate":e<-85?"Elevated":"High interference"}function Ge(){const{noiseFloor:s,sparklineNoiseFloor:a,trends:n,isLoading:l,error:i}=He(),r=null===(o=s)||o<-110?"excellent":o<-100?"good":o<-90?"fair":o<-80?"congested":"critical";var o;const c=null==n?void 0:n.noiseFloor.trend,{chartData:d,yDomain:u}=e.useMemo(()=>{if(!a||a.length<2)return{chartData:[],yDomain:[-120,-90]};const e=a.map(e=>({value:e})),t=a.filter(e=>-100!==e&&e<-50);if(0===t.length)return{chartData:e,yDomain:[-120,-90]};const s=Math.min(...t),n=Math.max(...t),l=n-s,i=Math.max(.2*l,3);return{chartData:e,yDomain:[s-i,n+i]}},[a]);return t.jsx(Le,{title:"Noise Floor",icon:t.jsx(x,{className:"mini-widget-icon"}),value:null!==s?Math.round(s):"—",unit:null!==s?"dBm":void 0,status:r,trend:c,subtitle:Oe(s),isLoading:l,error:i,children:t.jsx("div",{className:"mini-widget-sparkline",children:d.length>0?t.jsx(te,{width:"100%",height:24,children:t.jsxs(se,{data:d,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(ae,{domain:u,hide:!0}),t.jsx(ne,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function Ke(){const s=d(),a=S(),n=y(),l=_(),i=D(),r=60*F[i].minutes,o=R(),c=e.useMemo(()=>{if(0===o)return n;const e=o-r;return n.filter(t=>t.timestamp>=e)},[n,r,o]),u=null===l,m=(null==l?void 0:l.local_hash)?L(l.local_hash):"",x=(null==l?void 0:l.neighbors)??{},{neighborHashes:v,neighborNames:j}=e.useMemo(()=>{const e=new Set,t=new Map;for(const s of a){e.add(s.hash);const a=x[s.hash],n=(null==a?void 0:a.name)||(null==a?void 0:a.node_name)||s.prefix;t.set(s.hash,n)}return{neighborHashes:e,neighborNames:t}},[a,x]),b=e.useMemo(()=>{if(0===v.size||0===c.length||!m)return{champion:null,listener:null,loudest:null};const{scores:e}=de(c,v,m),t=[];for(const[l,i]of e)0!==i.blendedScore&&t.push({...i,name:j.get(l)??L(l)});let s=null,a=null,n=null;for(const l of t)(!s||l.blendedScore>s.blendedScore)&&(s=l),(!a||l.listenerScore>a.listenerScore)&&(a=l),(!n||l.loudScore>n.loudScore)&&(n=l);return{champion:s,listener:a,loudest:n}},[c,v,m,j]),{champion:N,listener:k,loudest:w}=b,M=N||k||w?t.jsxs("div",{className:"flex flex-col gap-0.5 mt-auto",children:[N&&t.jsx(T,{content:(C=N,t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",C.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Blended Score: ",C.blendedScore,t.jsx("span",{className:"text-text-muted/60 ml-1",children:"(Listener + Loud)"})]}),t.jsxs("div",{className:"border-t border-border-subtle pt-1 mt-1 space-y-0.5",children:[t.jsxs("div",{children:["Listener: ",C.listenerScore,"/100 (",C.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",C.loudScore,"/100 (",C.loudCount," packets relayed)"]})]})]})),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(h,{className:"w-3 h-3 text-map-neighbor-color flex-shrink-0"}),t.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:N.name}),t.jsx("span",{className:"text-map-neighbor-color pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:N.blendedScore})]})}),k&&t.jsx(T,{content:(e=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",e.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Score: ",e.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-border-subtle pt-1 mt-1",children:t.jsxs("div",{children:[e.listenerCount," packets where they heard your transmissions"]})})]}))(k),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(p,{className:"w-3 h-3 text-text-muted flex-shrink-0"}),t.jsx("span",{className:"text-text-muted font-mono truncate flex-1 min-w-0",children:k.name}),t.jsx("span",{className:"text-text-muted pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:k.listenerScore})]})}),w&&t.jsx(T,{content:(e=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",e.name]}),t.jsxs("div",{className:"text-text-muted mb-1",children:["Score: ",e.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-border-subtle pt-1 mt-1",children:t.jsxs("div",{children:[e.loudCount," packets they relayed directly to you"]})})]}))(w),children:t.jsxs("div",{className:"flex items-center gap-1 text-sm rounded px-1 -mx-1 hover:bg-white/5 transition-colors cursor-default",children:[t.jsx(f,{className:"w-3 h-3 text-text-muted flex-shrink-0"}),t.jsx("span",{className:"text-text-muted font-mono truncate flex-1 min-w-0",children:w.name}),t.jsx("span",{className:"text-text-muted pl-2 tabular-nums flex-shrink-0 w-9 text-right",children:w.loudScore})]})})]}):0===a.length?t.jsx("div",{className:"flex items-center justify-center text-sm text-text-muted mt-auto",children:"No direct neighbors"}):t.jsx("div",{className:"flex items-center justify-center text-sm text-text-muted mt-auto",children:"No routing data yet"});var C;return t.jsx(Le,{title:"Link Leaders",icon:t.jsx(g,{className:"mini-widget-icon"}),isLoading:u,onClick:()=>s("/contacts"),children:M})}function Ve(){const{lbtStats:s,isLoading:a,error:n}=He(),l=s?function(e){const{retryRate:t,channelBusyCount:s,totalPacketsWithLBT:a,avgBackoffMs:n,maxBackoffMs:l}=e;if(0===a)return 0;const i=Math.min(a/10,1),r=Math.log(1+.15*t)/Math.log(16)*40,o=s/a*100,c=Math.min(.5*o,25);let d=0;n>100&&(d=Math.min(8*Math.log10(n/100),15));let u=0;l>500&&n>0&&l>2*n&&(u=Math.min((l-500)/200,5));const m=(r+c+d+u)*i;return Math.min(m,85)}(s):0,i=s?(r=l)<15?"excellent":r<30?"good":r<45?"fair":r<60?"congested":"critical":"unknown";var r;const o=(null==s?void 0:s.maxBackoffMs)??0,c=s?o>200?`Max backoff: ${Math.round(o)}ms`:function(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}(l):void 0,d=null==s?void 0:s.sparklineCollisionRisk,{chartData:u,yDomain:m}=e.useMemo(()=>{if(!d||d.length<2)return{chartData:[],yDomain:[0,85]};const e=d.map(e=>({value:e})),t=d.filter(e=>e>0);if(0===t.length)return{chartData:e,yDomain:[0,85]};const s=Math.min(...t),a=Math.max(...t),n=a-s,l=Math.max(.2*n,5);return{chartData:e,yDomain:[Math.max(0,s-l),Math.min(85,a+l)]}},[d]);return t.jsx(Le,{title:"Collision Risk",icon:t.jsx(v,{className:"mini-widget-icon"}),value:l.toFixed(1),unit:"%",status:i,subtitle:c,isLoading:a,error:n,children:t.jsx("div",{className:"mini-widget-sparkline",children:u.length>0?t.jsx(te,{width:"100%",height:24,children:t.jsxs(se,{data:u,margin:{top:2,right:2,bottom:2,left:2},children:[t.jsx(ae,{domain:m,hide:!0}),t.jsx(ne,{type:"monotone",dataKey:"value",stroke:"var(--accent-primary)",strokeWidth:2,dot:!1,isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full"})})})}function qe(){const[s,a]=e.useState(!1),[n]=e.useState(0),{stats:l,lbtStats:r,isLoading:o}=He(),c=e.useMemo(()=>{if(!l)return null;const e=l.airtime_used_ms??0,t=l.max_airtime_ms??1;return{usedMs:e,maxMs:t,remainingMs:l.airtime_remaining_ms??0,utilizationPercent:l.utilization_percent??(t>0?e/t*100:0)}},[l]),d=e.useMemo(()=>r&&0!==r.totalPacketsWithLBT?(r.totalPacketsWithLBT-r.packetsWithRetries)/r.totalPacketsWithLBT*100:100,[r]),u=(null==c?void 0:c.utilizationPercent)??0,m=(x=u)<30?"excellent":x<50?"good":x<70?"fair":x<90?"congested":"critical";var x;const h=(null==c?void 0:c.remainingMs)??0,p=d<95?`${d.toFixed(0)}% clean TX`:((f=h)<1e3?`${Math.round(f)}ms`:f<6e4?`${(f/1e3).toFixed(1)}s`:`${(f/6e4).toFixed(1)}m`)+" remaining";var f;const g=c?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${m}`,style:{width:`${Math.min(u,100)}%`}})}):null;return t.jsx(Le,{title:"Duty Cycle",icon:t.jsx(i,{className:"mini-widget-icon"}),value:u.toFixed(1),unit:"%",status:m,subtitle:p,isLoading:o,children:g})}function Je(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(G,{className:"w-4 h-4"}),t.jsx(G,{className:"h-3 w-16"})]}),t.jsx(G,{className:"h-7 w-12 mt-2"}),t.jsx(G,{className:"h-3 w-20 mt-2"})]})}function Ue(){return t.jsx("div",{className:"widget-row",children:Array.from({length:6}).map((e,s)=>t.jsx(Je,{},s))})}function Qe({className:e="",isLoaded:s=!0}){return t.jsxs("div",{className:`mesh-health-container relative ${e}`,children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(j,{className:"w-4 h-4 text-accent-primary"}),t.jsx("span",{className:"type-label text-text-muted",children:"MESH HEALTH"})]}),s?t.jsx(Pe,{children:t.jsxs("div",{className:"widget-row",children:[t.jsx(Ee,{}),t.jsx(Ve,{}),t.jsx(Ge,{}),t.jsx(qe,{}),t.jsx(ze,{}),t.jsx(Ke,{})]})}):t.jsx(Ue,{})]})}function Xe(){var s,n;const l=_(),r=A(),o=y(),c=$(),d=D(),u=P(),m=H(),x=F[d],h=5===d&&!m.threeDayLoadComplete,p=6===d&&!m.sevenDayLoadComplete,f=7===d&&!m.fourteenDayLoadComplete,g=m.isBackgroundLoading&&(h||p||f),v=W(),j=z(),w=null==(s=null==l?void 0:l.config)?void 0:s.radio,M=e.useMemo(()=>w?{sf:w.spreading_factor??10,bw:w.bandwidth??25e4,cr:w.coding_rate??5,preamble:w.preamble_length??8}:null,[w]),L=o.length,S=e.useMemo(()=>L?I(x.minutes,x.buckets,o,l):null,[L,x.minutes,x.buckets,M]),C=e.useMemo(()=>function(e,t){if(!(null==e?void 0:e.length))return[];const s=t>1440?{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}:{hour:"2-digit",minute:"2-digit",hour12:!1};return e.map(e=>({time:new Date(1e3*e.start).toLocaleString([],s),received:e.count}))}(null==S?void 0:S.received,x.minutes),[null==S?void 0:S.received,x.minutes]),B=e.useMemo(()=>function(e){if(!e.length)return[0,"auto"];const t=e.map(e=>e.received),s=Math.min(...t),a=Math.max(...t);if(s===a)return[Math.max(0,s-1),a+1];const n=.1*(a-s);return[Math.max(0,Math.floor(s-n)),Math.ceil(a+n)]}(C),[C]),R=e.useMemo(()=>{return(e=C.length)<=12?0:e<=24?2:e<=48?5:e<=72?8:Math.floor(e/7);var e},[C.length]),T=e.useMemo(()=>{const e=e=>(null==e?void 0:e.reduce((e,t)=>e+t.count,0))??0,t=e(null==S?void 0:S.received),s=e(null==S?void 0:S.forwarded),a=e(null==S?void 0:S.dropped),n=e(null==S?void 0:S.transmitted),l=((null==S?void 0:S.time_range_minutes)??x.minutes)/60;return{received:t,forwarded:s,dropped:a,transmitted:n,rxPerHour:l>0?Math.round(t/l):0,fwdPerHour:l>0?Math.round(s/l):0}},[S,x.minutes]),O=(null==l?void 0:l.node_name)??(null==(n=null==l?void 0:l.config)?void 0:n.node_name)??"Unknown Node";return r?t.jsxs(K,{className:"p-8 text-center",children:[t.jsx("p",{className:"type-subheading text-accent-red mb-2",children:"Failed to connect to backend"}),t.jsx("p",{className:"type-body text-white/50",children:r}),t.jsx("p",{className:"type-data-sm text-white/40 mt-4",children:"Make sure the backend is running on port 8000"})]}):t.jsxs(V,{children:[t.jsx(q,{title:O,icon:t.jsx(b,{}),controls:t.jsx(Y,{ranges:F,selectedIndex:d,onSelect:u,isPending:g})}),t.jsx(ue,{template:"hero",children:t.jsx(K,{isLoaded:c,skeletonType:"chart",compact:!0,children:c&&t.jsxs(t.Fragment,{children:[t.jsx(J,{icon:t.jsx(a,{}),title:"RECEIVED",badge:x.label,actions:t.jsxs("div",{className:"data-box",children:[T.rxPerHour,"/hr"]})}),t.jsx("div",{className:"font-mono text-5xl font-semibold tabular-nums text-accent-primary min-h-[3rem]",style:{letterSpacing:"-0.05em"},children:T.received.toLocaleString()}),t.jsx("div",{className:"mt-4",children:C.length>0?t.jsx(te,{width:"100%",height:180,children:t.jsxs(le,{data:C,margin:{left:0,right:8,top:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"gradient-received",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"5%",stopColor:v.received,stopOpacity:.3}),t.jsx("stop",{offset:"95%",stopColor:v.received,stopOpacity:0})]})}),t.jsx(ie,{strokeDasharray:"3 3",stroke:j.grid,vertical:!1}),t.jsx(re,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:j.axisTick,fontSize:10,fontFamily:E},dy:8,interval:R,minTickGap:20}),t.jsx(ae,{domain:B,axisLine:!1,tickLine:!1,tick:{fill:j.axisTick,fontSize:10,fontFamily:E},dx:-4,width:28}),t.jsx(oe,{content:t.jsx(ke,{color:v.received,labelKey:"time",unit:" packets"}),cursor:{stroke:j.cursor,strokeWidth:1}}),t.jsx(ce,{type:"stepAfter",dataKey:"received",stroke:v.received,fill:"url(#gradient-received)",strokeWidth:1,dot:!1,activeDot:{r:4,strokeWidth:0,fill:v.received},isAnimationActive:!1})]})}):t.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available for this time range"})})]})})}),t.jsxs(ue,{template:"compact",children:[t.jsx(me,{span:12,md:6,lg:4,children:t.jsx(fe,{title:"FORWARDED",value:T.forwarded,color:"forwarded",buckets:null==S?void 0:S.forwarded,receivedCount:T.received,timeRangeLabel:x.label,icon:t.jsx(N,{className:"w-4 h-4"}),isLoaded:c})}),t.jsx(me,{span:12,md:6,lg:4,children:t.jsx(fe,{title:"DROPPED",value:T.dropped,color:"dropped",buckets:null==S?void 0:S.dropped,receivedCount:T.received,timeRangeLabel:x.label,icon:t.jsx(k,{className:"w-4 h-4"}),isLoaded:c})}),t.jsx(me,{span:12,md:12,lg:4,children:t.jsx(be,{stats:l,receivedBuckets:null==S?void 0:S.received,droppedBuckets:null==S?void 0:S.dropped,forwardedBuckets:null==S?void 0:S.forwarded,bucketDurationSeconds:null==S?void 0:S.bucket_duration_seconds,timeRangeLabel:x.label,isLoaded:c})})]}),t.jsx(Qe,{isLoaded:c}),t.jsx(Ne,{}),l&&t.jsx(ue,{template:"auto",children:t.jsxs(K,{children:[t.jsx(J,{icon:t.jsx(i,{}),title:"Node Information",largeTitle:!0}),t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Node Name"}),t.jsx("p",{className:"type-body text-text-primary mt-1",children:O})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",l.version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Core Version"}),t.jsxs("p",{className:"type-data text-text-primary mt-1",children:["v",l.core_version]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Local Hash"}),t.jsx("div",{className:"mt-1",children:l.local_hash?t.jsx(Z,{hash:l.local_hash,size:"sm"}):t.jsx("span",{className:"type-data-sm text-text-secondary",children:"N/A"})})]})]}),l.public_key&&t.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle",children:[t.jsx("span",{className:"type-label text-text-secondary",children:"Public Key"}),t.jsx("div",{className:"mt-1",children:t.jsx(Z,{hash:l.public_key,prefixLength:12,suffixLength:8})})]})]})})]})}export{Xe as default}; diff --git a/frontend/dist/assets/Login-D0VAcvfg.js b/frontend/dist/assets/Login-DW1MXg6s.js similarity index 99% rename from frontend/dist/assets/Login-D0VAcvfg.js rename to frontend/dist/assets/Login-DW1MXg6s.js index 3c865db3..2aff2202 100644 --- a/frontend/dist/assets/Login-D0VAcvfg.js +++ b/frontend/dist/assets/Login-DW1MXg6s.js @@ -1 +1 @@ -import{r as e,j as s,x as t}from"./vendor-react-C0qkT9dV.js";import{g as r,i as a,P as n,s as l,l as o}from"./index-wYLFmyyS.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./recharts-DRDKmvXb.js";const i=e.memo(function({width:e,height:t,className:r="",fill:a="currentColor"}){return s.jsxs("svg",{viewBox:"0 0 134 15",width:e,height:t,className:r,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[s.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),s.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),s.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),s.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),s.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),s.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),s.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),s.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}),c="/assets/WCM_Waves-RN-_ocPH.gif",d="#9cf15b";function m(){const m=t(),[x,p]=e.useState("admin"),[h,u]=e.useState(""),[f,C]=e.useState(()=>r()),[b,g]=e.useState(!1),[j,L]=e.useState(null);e.useEffect(()=>{a()&&m("/",{replace:!0})},[m]);const y=async e=>{e.preventDefault(),g(!0),L(null);const s=await o(x,h,f);g(!1),s.success?window.location.href="/":L(s.error||"Login failed")};return s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex flex-col bg-black",children:[s.jsx("div",{className:"fixed inset-0 -z-20 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/assets/water.webp)"},"aria-hidden":"true"}),s.jsx("div",{className:"fixed inset-0 -z-10 bg-black/40 pointer-events-none","aria-hidden":"true"}),s.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-[#9cf15b]/5 via-transparent to-[#9cf15b]/3 pointer-events-none z-0"}),s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-6 sm:px-6 sm:py-8",children:s.jsxs("div",{className:"w-full max-w-sm sm:max-w-md",children:[s.jsxs("div",{className:"text-center mb-6 sm:mb-8",children:[s.jsx("h1",{className:"sr-only",children:"pyMC Console"}),s.jsx(n,{height:28,className:"mx-auto mb-2 sm:mb-3 sm:h-8"}),s.jsxs("p",{className:"font-mono text-text-muted text-sm flex items-center justify-center gap-1.5 sm:gap-2",children:[s.jsx(i,{height:10,fill:"#6B7280",className:"sm:h-3"}),s.jsx("span",{children:"Network Management"})]})]}),s.jsxs("div",{className:"glass-card p-5 sm:p-8 rounded-xl sm:rounded-2xl border border-border-subtle bg-bg-surface/80 backdrop-blur-xl shadow-2xl",children:[s.jsxs("div",{className:"text-center mb-5 sm:mb-6",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 sm:w-16 sm:h-16 rounded-full bg-accent-primary/10 mb-3 sm:mb-4",children:s.jsx("svg",{className:"w-6 h-6 sm:w-8 sm:h-8 text-accent-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),s.jsx("h2",{className:"font-display text-lg sm:text-xl font-semibold text-text-primary",children:"Authentication Required"}),s.jsx("p",{className:"font-mono text-text-muted text-sm mt-1",children:"Sign in to access the console"})]}),s.jsxs("form",{onSubmit:y,className:"space-y-4 sm:space-y-5",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"username",className:"block font-display text-sm font-medium text-text-secondary mb-1.5 sm:mb-2",children:"Username"}),s.jsx("input",{id:"username",type:"text",value:x,onChange:e=>{p(e.target.value),j&&L(null)},className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg bg-bg-elevated border border-border-subtle \n font-mono text-sm sm:text-base text-text-primary placeholder-text-muted\n focus:outline-none focus:ring-2 focus:ring-accent-primary/50 focus:border-accent-primary\n transition-all duration-200",placeholder:"admin",autoComplete:"username",autoFocus:!0,required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"block font-display text-sm font-medium text-text-secondary mb-1.5 sm:mb-2",children:"Password"}),s.jsx("input",{id:"password",type:"password",value:h,onChange:e=>{u(e.target.value),j&&L(null)},onKeyDown:e=>{"Enter"===e.key&&x&&h&&!b&&(e.preventDefault(),y(e))},className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg bg-bg-elevated border border-border-subtle \n font-mono text-sm sm:text-base text-text-primary placeholder-text-muted\n focus:outline-none focus:ring-2 focus:ring-accent-primary/50 focus:border-accent-primary\n transition-all duration-200",placeholder:"••••••••",autoComplete:"current-password",required:!0})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("input",{id:"remember-me",type:"checkbox",checked:f,onChange:e=>{return s=e.target.checked,C(s),void l(s);var s},className:"w-4 h-4 mt-0.5 rounded border-border-subtle bg-bg-elevated text-accent-primary \n focus:ring-2 focus:ring-accent-primary/50 focus:ring-offset-0\n cursor-pointer transition-colors"}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"remember-me",className:"text-sm text-text-secondary cursor-pointer select-none",children:"Keep me signed in"}),s.jsx("p",{className:"text-sm text-text-muted mt-0.5",children:"Stay logged in after closing browser"})]})]}),j&&s.jsx("div",{className:"p-2.5 sm:p-3 rounded-lg bg-accent-danger/10 border border-accent-danger/30",children:s.jsxs("p",{className:"font-mono text-sm text-accent-danger flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),j]})}),s.jsx("button",{type:"submit",disabled:b||!x||!h,className:"w-full py-2.5 sm:py-3 px-4 rounded-lg font-display font-semibold text-sm sm:text-base text-bg-body\n bg-gradient-to-r from-[#9cf15b] to-[#8de04a]\n hover:from-[#8de04a] hover:to-[#7dd03a]\n focus:outline-none focus:ring-2 focus:ring-[#9cf15b]/50 focus:ring-offset-2 focus:ring-offset-bg-surface\n disabled:opacity-50 disabled:cursor-not-allowed\n transition-all duration-200 transform hover:scale-[1.02] active:scale-[0.98]",children:b?s.jsxs("span",{className:"flex items-center justify-center gap-2",children:[s.jsxs("svg",{className:"animate-spin h-4 w-4 sm:h-5 sm:w-5",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Authenticating..."]}):"Sign In"})]})]}),s.jsx("div",{className:"mt-5 sm:mt-8 text-center",children:s.jsxs("p",{className:"font-mono text-sm text-text-muted",children:["A ",s.jsx("span",{style:{color:d},children:"@RightUp"})," X ",s.jsx("span",{style:{color:d},children:"@Treehouse⚡"})," Collab"]})})]})}),s.jsx("footer",{className:"py-4 sm:py-6 md:py-8 px-4",children:s.jsxs("div",{className:"max-w-sm sm:max-w-md mx-auto",children:[s.jsx("p",{className:"font-mono text-[10px] sm:text-xs text-text-muted text-center mb-2 sm:mb-3 uppercase tracking-wider",children:"Powered By"}),s.jsxs("div",{className:"glass-card p-3 sm:p-4 rounded-lg sm:rounded-xl border border-border-subtle bg-bg-surface/60 backdrop-blur-xl",children:[s.jsxs("div",{className:"hidden sm:flex items-center justify-center gap-4 sm:gap-6",children:[s.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 hover:opacity-80 transition-opacity group",title:"pyMC Repeater",children:s.jsxs("span",{className:"font-display font-bold text-base sm:text-lg tracking-tight",children:[s.jsx("span",{style:{color:d},children:"py"}),s.jsx("span",{className:"text-text-primary",children:"MC"})]})}),s.jsx("span",{className:"text-border-subtle",children:"•"}),s.jsx("a",{href:"https://meshcore.co.uk",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity group",title:"MeshCore",children:s.jsx(i,{height:12,className:"text-text-primary sm:h-3.5"})}),s.jsx("span",{className:"text-border-subtle",children:"•"}),s.jsxs("a",{href:"https://wcmesh.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 sm:gap-2 hover:opacity-80 transition-opacity group",title:"West Coast Mesh",children:[s.jsx("div",{className:"w-7 h-7 sm:w-9 sm:h-9 rounded-md sm:rounded-lg overflow-hidden border border-white/10 group-hover:border-white/20 transition-all",children:s.jsx("img",{src:c,alt:"West Coast Mesh",className:"w-full h-full object-cover"})}),s.jsx("span",{className:"font-display font-bold text-base sm:text-lg tracking-tight text-text-primary",children:"WCM"})]})]}),s.jsxs("div",{className:"flex sm:hidden items-center justify-center gap-3",children:[s.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity",title:"pyMC Repeater",children:s.jsxs("span",{className:"font-display font-bold text-sm tracking-tight",children:[s.jsx("span",{style:{color:d},children:"py"}),s.jsx("span",{className:"text-text-primary",children:"MC"})]})}),s.jsx("span",{className:"text-border-subtle text-sm",children:"•"}),s.jsx("a",{href:"https://meshcore.co.uk",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity",title:"MeshCore",children:s.jsx(i,{height:10,className:"text-text-primary"})}),s.jsx("span",{className:"text-border-subtle text-sm",children:"•"}),s.jsxs("a",{href:"https://wcmesh.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:opacity-80 transition-opacity",title:"West Coast Mesh",children:[s.jsx("div",{className:"w-6 h-6 rounded overflow-hidden border border-white/10",children:s.jsx("img",{src:c,alt:"West Coast Mesh",className:"w-full h-full object-cover"})}),s.jsx("span",{className:"font-display font-bold text-sm tracking-tight text-text-primary",children:"WCM"})]})]})]})]})})]})}export{m as default}; +import{r as e,j as s,x as t}from"./vendor-react-C0qkT9dV.js";import{g as r,i as a,P as n,s as l,l as o}from"./index-DrUSC4Ks.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./recharts-DRDKmvXb.js";const i=e.memo(function({width:e,height:t,className:r="",fill:a="currentColor"}){return s.jsxs("svg",{viewBox:"0 0 134 15",width:e,height:t,className:r,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[s.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),s.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),s.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),s.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),s.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),s.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),s.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),s.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}),c="/assets/WCM_Waves-RN-_ocPH.gif",d="#9cf15b";function m(){const m=t(),[x,p]=e.useState("admin"),[h,u]=e.useState(""),[f,C]=e.useState(()=>r()),[b,g]=e.useState(!1),[j,L]=e.useState(null);e.useEffect(()=>{a()&&m("/",{replace:!0})},[m]);const y=async e=>{e.preventDefault(),g(!0),L(null);const s=await o(x,h,f);g(!1),s.success?window.location.href="/":L(s.error||"Login failed")};return s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex flex-col bg-black",children:[s.jsx("div",{className:"fixed inset-0 -z-20 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/assets/water.webp)"},"aria-hidden":"true"}),s.jsx("div",{className:"fixed inset-0 -z-10 bg-black/40 pointer-events-none","aria-hidden":"true"}),s.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-[#9cf15b]/5 via-transparent to-[#9cf15b]/3 pointer-events-none z-0"}),s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-6 sm:px-6 sm:py-8",children:s.jsxs("div",{className:"w-full max-w-sm sm:max-w-md",children:[s.jsxs("div",{className:"text-center mb-6 sm:mb-8",children:[s.jsx("h1",{className:"sr-only",children:"pyMC Console"}),s.jsx(n,{height:28,className:"mx-auto mb-2 sm:mb-3 sm:h-8"}),s.jsxs("p",{className:"font-mono text-text-muted text-sm flex items-center justify-center gap-1.5 sm:gap-2",children:[s.jsx(i,{height:10,fill:"#6B7280",className:"sm:h-3"}),s.jsx("span",{children:"Network Management"})]})]}),s.jsxs("div",{className:"glass-card p-5 sm:p-8 rounded-xl sm:rounded-2xl border border-border-subtle bg-bg-surface/80 backdrop-blur-xl shadow-2xl",children:[s.jsxs("div",{className:"text-center mb-5 sm:mb-6",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 sm:w-16 sm:h-16 rounded-full bg-accent-primary/10 mb-3 sm:mb-4",children:s.jsx("svg",{className:"w-6 h-6 sm:w-8 sm:h-8 text-accent-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),s.jsx("h2",{className:"font-display text-lg sm:text-xl font-semibold text-text-primary",children:"Authentication Required"}),s.jsx("p",{className:"font-mono text-text-muted text-sm mt-1",children:"Sign in to access the console"})]}),s.jsxs("form",{onSubmit:y,className:"space-y-4 sm:space-y-5",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"username",className:"block font-display text-sm font-medium text-text-secondary mb-1.5 sm:mb-2",children:"Username"}),s.jsx("input",{id:"username",type:"text",value:x,onChange:e=>{p(e.target.value),j&&L(null)},className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg bg-bg-elevated border border-border-subtle \n font-mono text-sm sm:text-base text-text-primary placeholder-text-muted\n focus:outline-none focus:ring-2 focus:ring-accent-primary/50 focus:border-accent-primary\n transition-all duration-200",placeholder:"admin",autoComplete:"username",autoFocus:!0,required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"password",className:"block font-display text-sm font-medium text-text-secondary mb-1.5 sm:mb-2",children:"Password"}),s.jsx("input",{id:"password",type:"password",value:h,onChange:e=>{u(e.target.value),j&&L(null)},onKeyDown:e=>{"Enter"===e.key&&x&&h&&!b&&(e.preventDefault(),y(e))},className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 rounded-lg bg-bg-elevated border border-border-subtle \n font-mono text-sm sm:text-base text-text-primary placeholder-text-muted\n focus:outline-none focus:ring-2 focus:ring-accent-primary/50 focus:border-accent-primary\n transition-all duration-200",placeholder:"••••••••",autoComplete:"current-password",required:!0})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("input",{id:"remember-me",type:"checkbox",checked:f,onChange:e=>{return s=e.target.checked,C(s),void l(s);var s},className:"w-4 h-4 mt-0.5 rounded border-border-subtle bg-bg-elevated text-accent-primary \n focus:ring-2 focus:ring-accent-primary/50 focus:ring-offset-0\n cursor-pointer transition-colors"}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"remember-me",className:"text-sm text-text-secondary cursor-pointer select-none",children:"Keep me signed in"}),s.jsx("p",{className:"text-sm text-text-muted mt-0.5",children:"Stay logged in after closing browser"})]})]}),j&&s.jsx("div",{className:"p-2.5 sm:p-3 rounded-lg bg-accent-danger/10 border border-accent-danger/30",children:s.jsxs("p",{className:"font-mono text-sm text-accent-danger flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),j]})}),s.jsx("button",{type:"submit",disabled:b||!x||!h,className:"w-full py-2.5 sm:py-3 px-4 rounded-lg font-display font-semibold text-sm sm:text-base text-bg-body\n bg-gradient-to-r from-[#9cf15b] to-[#8de04a]\n hover:from-[#8de04a] hover:to-[#7dd03a]\n focus:outline-none focus:ring-2 focus:ring-[#9cf15b]/50 focus:ring-offset-2 focus:ring-offset-bg-surface\n disabled:opacity-50 disabled:cursor-not-allowed\n transition-all duration-200 transform hover:scale-[1.02] active:scale-[0.98]",children:b?s.jsxs("span",{className:"flex items-center justify-center gap-2",children:[s.jsxs("svg",{className:"animate-spin h-4 w-4 sm:h-5 sm:w-5",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Authenticating..."]}):"Sign In"})]})]}),s.jsx("div",{className:"mt-5 sm:mt-8 text-center",children:s.jsxs("p",{className:"font-mono text-sm text-text-muted",children:["A ",s.jsx("span",{style:{color:d},children:"@RightUp"})," X ",s.jsx("span",{style:{color:d},children:"@Treehouse⚡"})," Collab"]})})]})}),s.jsx("footer",{className:"py-4 sm:py-6 md:py-8 px-4",children:s.jsxs("div",{className:"max-w-sm sm:max-w-md mx-auto",children:[s.jsx("p",{className:"font-mono text-[10px] sm:text-xs text-text-muted text-center mb-2 sm:mb-3 uppercase tracking-wider",children:"Powered By"}),s.jsxs("div",{className:"glass-card p-3 sm:p-4 rounded-lg sm:rounded-xl border border-border-subtle bg-bg-surface/60 backdrop-blur-xl",children:[s.jsxs("div",{className:"hidden sm:flex items-center justify-center gap-4 sm:gap-6",children:[s.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 hover:opacity-80 transition-opacity group",title:"pyMC Repeater",children:s.jsxs("span",{className:"font-display font-bold text-base sm:text-lg tracking-tight",children:[s.jsx("span",{style:{color:d},children:"py"}),s.jsx("span",{className:"text-text-primary",children:"MC"})]})}),s.jsx("span",{className:"text-border-subtle",children:"•"}),s.jsx("a",{href:"https://meshcore.co.uk",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity group",title:"MeshCore",children:s.jsx(i,{height:12,className:"text-text-primary sm:h-3.5"})}),s.jsx("span",{className:"text-border-subtle",children:"•"}),s.jsxs("a",{href:"https://wcmesh.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 sm:gap-2 hover:opacity-80 transition-opacity group",title:"West Coast Mesh",children:[s.jsx("div",{className:"w-7 h-7 sm:w-9 sm:h-9 rounded-md sm:rounded-lg overflow-hidden border border-white/10 group-hover:border-white/20 transition-all",children:s.jsx("img",{src:c,alt:"West Coast Mesh",className:"w-full h-full object-cover"})}),s.jsx("span",{className:"font-display font-bold text-base sm:text-lg tracking-tight text-text-primary",children:"WCM"})]})]}),s.jsxs("div",{className:"flex sm:hidden items-center justify-center gap-3",children:[s.jsx("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity",title:"pyMC Repeater",children:s.jsxs("span",{className:"font-display font-bold text-sm tracking-tight",children:[s.jsx("span",{style:{color:d},children:"py"}),s.jsx("span",{className:"text-text-primary",children:"MC"})]})}),s.jsx("span",{className:"text-border-subtle text-sm",children:"•"}),s.jsx("a",{href:"https://meshcore.co.uk",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-80 transition-opacity",title:"MeshCore",children:s.jsx(i,{height:10,className:"text-text-primary"})}),s.jsx("span",{className:"text-border-subtle text-sm",children:"•"}),s.jsxs("a",{href:"https://wcmesh.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:opacity-80 transition-opacity",title:"West Coast Mesh",children:[s.jsx("div",{className:"w-6 h-6 rounded overflow-hidden border border-white/10",children:s.jsx("img",{src:c,alt:"West Coast Mesh",className:"w-full h-full object-cover"})}),s.jsx("span",{className:"font-display font-bold text-sm tracking-tight text-text-primary",children:"WCM"})]})]})]})]})})]})}export{m as default}; diff --git a/frontend/dist/assets/Logs-Bj21D9nq.js b/frontend/dist/assets/Logs-CFPI4LFW.js similarity index 96% rename from frontend/dist/assets/Logs-Bj21D9nq.js rename to frontend/dist/assets/Logs-CFPI4LFW.js index 393cfc34..20e45eaa 100644 --- a/frontend/dist/assets/Logs-Bj21D9nq.js +++ b/frontend/dist/assets/Logs-CFPI4LFW.js @@ -1 +1 @@ -import{j as e,D as s,a3 as t,F as a,r as c,aQ as l,au as n,aX as i}from"./vendor-react-C0qkT9dV.js";import{c as r}from"./recharts-DRDKmvXb.js";import{aa as o,ab as x,b as m,ac as d,t as u,a9 as h,ad as p,ae as j}from"./index-wYLFmyyS.js";import{u as g}from"./usePolling-ul9y_if7.js";import{P as N,b as f,a as v,c as y,L as b}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const w=c.memo(function({log:s}){return e.jsx("div",{className:"p-3 rounded-2xl bg-white/[0.02] hover:bg-white/[0.04] transition-colors",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:r("type-data-sm w-14 shrink-0",j(s.level)),children:s.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-text-primary break-words whitespace-pre-wrap",children:s.message}),e.jsx("p",{className:"type-data-xs text-text-muted mt-1",children:new Date(s.timestamp).toLocaleString()})]})]})})});function F(){const s=o(),[t,a]=c.useState("INFO"),[x,m]=c.useState(!1),[d,u]=c.useState(null);c.useEffect(()=>{if(s.length>0){const e=s.some(e=>"DEBUG"===e.level);a(e?"DEBUG":"INFO")}},[s]);const h=c.useCallback(async e=>{if(e!==t&&!x){m(!0),u(null);try{const s=await p(e);s.success&&s.data?(a(e),u(s.data.message),setTimeout(()=>u(null),5e3)):(u(s.error??"Failed to change log level"),setTimeout(()=>u(null),3e3))}catch{u("Failed to change log level"),setTimeout(()=>u(null),3e3)}finally{m(!1)}}},[t,x]),j="h-[32px] px-4 rounded-full type-data flex items-center gap-2 transition-colors",g=x&&"opacity-50 cursor-not-allowed";return e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsx("span",{className:"text-xs text-text-muted animate-pulse",children:d}),e.jsxs("div",{className:"flex bg-white/[0.02] rounded-full p-1",children:[e.jsxs("button",{onClick:()=>h("INFO"),disabled:x,className:r(j,"INFO"===t?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary",g),children:[e.jsx(l,{className:"w-4 h-4"}),"Info"]}),e.jsxs("button",{onClick:()=>h("DEBUG"),disabled:x,className:r(j,"DEBUG"===t?"bg-accent-secondary/20 text-accent-secondary":"text-text-muted hover:text-text-secondary",g),children:[x?e.jsx(n,{className:"w-4 h-4 animate-spin"}):e.jsx(i,{className:"w-4 h-4"}),"Debug"]})]})]})}function k(){const c=o(),l=x(),n=m(),i=d(),p=u();return g(i,h.logs,n),e.jsxs(N,{children:[e.jsx(f,{title:"System Logs",icon:e.jsx(a,{}),controls:e.jsxs(e.Fragment,{children:[e.jsx(F,{}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(s,{className:"w-2 h-2 fill-accent-success text-accent-success animate-pulse"}),e.jsx("span",{className:"text-text-muted",children:"Live"})]}),e.jsxs("button",{onClick:()=>p(!n),className:r("h-[32px] px-4 rounded-full type-data transition-colors","flex items-center gap-2",n?"bg-accent-success/20 text-accent-success":"bg-white/[0.02] text-text-muted hover:text-text-secondary"),children:[e.jsx(t,{className:r("w-4 h-4",n&&"animate-spin")}),e.jsx("span",{className:"hidden xs:inline",children:n?"Live":"Paused"})]})]})}),e.jsxs(v,{noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(a,{className:"icon-sm"}),title:"Log Entries"}),e.jsx("div",{className:"space-y-2 max-h-[calc(100vh-300px)] sm:max-h-[calc(100vh-250px)] overflow-y-auto p-4",children:l&&0===c.length?e.jsx(b,{count:10}):0===c.length?e.jsx("div",{className:"text-center py-12 text-text-muted",children:"No logs available"}):c.map((s,t)=>e.jsx(w,{log:s},`${s.timestamp}-${t}`))})]})]})}export{k as default}; +import{j as e,D as s,a3 as t,F as a,r as c,aQ as l,au as n,aX as i}from"./vendor-react-C0qkT9dV.js";import{c as r}from"./recharts-DRDKmvXb.js";import{a9 as o,aa as x,b as m,ab as d,r as u,a8 as h,ac as p,ad as j}from"./index-DrUSC4Ks.js";import{u as g}from"./usePolling-ul9y_if7.js";import{P as N,b as f,a as v,c as y,L as b}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const w=c.memo(function({log:s}){return e.jsx("div",{className:"p-3 rounded-2xl bg-white/[0.02] hover:bg-white/[0.04] transition-colors",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:r("type-data-sm w-14 shrink-0",j(s.level)),children:s.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-text-primary break-words whitespace-pre-wrap",children:s.message}),e.jsx("p",{className:"type-data-xs text-text-muted mt-1",children:new Date(s.timestamp).toLocaleString()})]})]})})});function F(){const s=o(),[t,a]=c.useState("INFO"),[x,m]=c.useState(!1),[d,u]=c.useState(null);c.useEffect(()=>{if(s.length>0){const e=s.some(e=>"DEBUG"===e.level);a(e?"DEBUG":"INFO")}},[s]);const h=c.useCallback(async e=>{if(e!==t&&!x){m(!0),u(null);try{const s=await p(e);s.success&&s.data?(a(e),u(s.data.message),setTimeout(()=>u(null),5e3)):(u(s.error??"Failed to change log level"),setTimeout(()=>u(null),3e3))}catch{u("Failed to change log level"),setTimeout(()=>u(null),3e3)}finally{m(!1)}}},[t,x]),j="h-[32px] px-4 rounded-full type-data flex items-center gap-2 transition-colors",g=x&&"opacity-50 cursor-not-allowed";return e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsx("span",{className:"text-xs text-text-muted animate-pulse",children:d}),e.jsxs("div",{className:"flex bg-white/[0.02] rounded-full p-1",children:[e.jsxs("button",{onClick:()=>h("INFO"),disabled:x,className:r(j,"INFO"===t?"bg-accent-primary/20 text-accent-primary":"text-text-muted hover:text-text-secondary",g),children:[e.jsx(l,{className:"w-4 h-4"}),"Info"]}),e.jsxs("button",{onClick:()=>h("DEBUG"),disabled:x,className:r(j,"DEBUG"===t?"bg-accent-secondary/20 text-accent-secondary":"text-text-muted hover:text-text-secondary",g),children:[x?e.jsx(n,{className:"w-4 h-4 animate-spin"}):e.jsx(i,{className:"w-4 h-4"}),"Debug"]})]})]})}function k(){const c=o(),l=x(),n=m(),i=d(),p=u();return g(i,h.logs,n),e.jsxs(N,{children:[e.jsx(f,{title:"System Logs",icon:e.jsx(a,{}),controls:e.jsxs(e.Fragment,{children:[e.jsx(F,{}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(s,{className:"w-2 h-2 fill-accent-success text-accent-success animate-pulse"}),e.jsx("span",{className:"text-text-muted",children:"Live"})]}),e.jsxs("button",{onClick:()=>p(!n),className:r("h-[32px] px-4 rounded-full type-data transition-colors","flex items-center gap-2",n?"bg-accent-success/20 text-accent-success":"bg-white/[0.02] text-text-muted hover:text-text-secondary"),children:[e.jsx(t,{className:r("w-4 h-4",n&&"animate-spin")}),e.jsx("span",{className:"hidden xs:inline",children:n?"Live":"Paused"})]})]})}),e.jsxs(v,{noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(a,{className:"icon-sm"}),title:"Log Entries"}),e.jsx("div",{className:"space-y-2 max-h-[calc(100vh-300px)] sm:max-h-[calc(100vh-250px)] overflow-y-auto p-4",children:l&&0===c.length?e.jsx(b,{count:10}):0===c.length?e.jsx("div",{className:"text-center py-12 text-text-muted",children:"No logs available"}):c.map((s,t)=>e.jsx(w,{log:s},`${s.timestamp}-${t}`))})]})]})}export{k as default}; diff --git a/frontend/dist/assets/PacketDetailModal-D1jT4M4x.js b/frontend/dist/assets/PacketDetailModal-D1jT4M4x.js new file mode 100644 index 00000000..21e70ec7 --- /dev/null +++ b/frontend/dist/assets/PacketDetailModal-D1jT4M4x.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-vehW4pVp.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/maplibre-gl-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{r as e,$ as t,a4 as s,E as a,a5 as n,j as r,a6 as o,a7 as c,a8 as i,b as l,X as d,h as x,a9 as h,k as u,aa as m,ab as p,a0 as f}from"./vendor-react-C0qkT9dV.js";import{c as b}from"./recharts-DRDKmvXb.js";import{t as g,R as j,v as y,w as v,x as N,d as w,c as _,y as k,z as M,A as C,B as P}from"./index-DrUSC4Ks.js";import{S as T,g as S}from"./SignalIndicator-C1cW0knK.js";import{H as D}from"./HashBadge-CAy9V6Vn.js";import{_ as E}from"./deckgl-DTsmDcfs.js";function L(e){return null==e?"UNKNOWN":g[e]||`TYPE_${e}`}function F(e){return null==e?"UNKNOWN":j[e]||`ROUTE_${e}`}function A(e){return{ADVERT:"text-[var(--pkt-advert)]",FLOOD:"text-[var(--pkt-flood)]",TXT_MSG:"text-[var(--pkt-txt-msg)]",ACK:"text-[var(--pkt-ack)]",TRACE:"text-[var(--pkt-trace)]",REQ:"text-[var(--pkt-req)]",RESPONSE:"text-[var(--pkt-response)]",GRP_TXT:"text-[var(--pkt-grp-txt)]",GRP_DATA:"text-[var(--pkt-grp-data)]",PATH:"text-[var(--pkt-path)]",ANON_REQ:"text-[var(--pkt-anon)]"}[e]||"text-[var(--pkt-unknown)]"}function O(e){return{FLOOD:"bg-[var(--route-flood)]/20 text-[var(--route-flood)] border-[var(--route-flood)]/30",DIRECT:"bg-[var(--route-direct)]/20 text-[var(--route-direct)] border-[var(--route-direct)]/30",TRANSPORT:"bg-[var(--route-transport)]/20 text-[var(--route-transport)] border-[var(--route-transport)]/30",T_FLOOD:"bg-[var(--route-flood)]/20 text-[var(--route-flood)] border-[var(--route-flood)]/30",T_DIRECT:"bg-[var(--route-direct)]/20 text-[var(--route-direct)] border-[var(--route-direct)]/30"}[e]||"bg-bg-subtle text-text-muted border-border-subtle"}function R(e){return 1===e||!0===e}const z={rx:{icon:t,label:"RX",color:"text-accent-primary",bgColor:"bg-accent-primary/10"},tx:{icon:n,label:"TX",color:"text-[#F9D26F]",bgColor:"bg-[#F9D26F]/10"},forward:{icon:a,label:"FWD",color:"text-accent-success",bgColor:"bg-accent-success/10"},dropped:{icon:s,label:"DROP",color:"text-accent-danger",bgColor:"bg-accent-danger/10"},duplicate:{icon:t,label:"DUP",color:"text-text-muted",bgColor:"bg-white/5"}},U={sm:"w-3.5 h-3.5",md:"w-4 h-4"};function H(e){return"tx_local"===e.packet_origin?"tx":"tx_forward"===e.packet_origin?"forward":e.is_duplicate?"duplicate":e.transmitted?"forward":e.drop_reason?"dropped":"rx"}const V=e.memo(function({packet:e,showLabel:t=!0,size:s="sm"}){const a=H(e),n=z[a],o=n.icon;return r.jsxs("div",{className:b("inline-flex items-center gap-1 rounded-md",t&&"px-1.5 py-0.5",t&&n.bgColor),children:[r.jsx(o,{className:b(U[s],n.color)}),t&&r.jsx("span",{className:b("text-[10px] font-semibold tracking-wide",n.color),children:n.label})]})});function $(e){return"tx_local"===e.packet_origin?"Transmitted":"tx_forward"===e.packet_origin||e.transmitted?"Forwarded":e.is_duplicate?"Duplicate":"No transport keys configured"===e.drop_reason?"Monitor Only":e.drop_reason?e.drop_reason:"Received"}function I(e){return z[H(e)].color}function X(e){return{payloadType:e.payload_type_name||L(e.payload_type??e.type),routeType:e.route_type_name||F(e.route_type??e.route)}}function q({packet:e,onClick:t,isFlashing:s=!1}){const{payloadType:a,routeType:n}=X(e),o="tx_local"===e.packet_origin;return r.jsxs("tr",{onClick:()=>t(e),className:b("cursor-pointer","hover:bg-bg-subtle",R(e.is_duplicate)&&"opacity-50",s&&"flash-row",o&&"ring-1 ring-inset ring-accent-primary/60 bg-accent-primary/5"),children:[r.jsx("td",{className:"py-2.5 px-3",children:r.jsx(V,{packet:e,showLabel:!0})}),r.jsx("td",{className:"py-2.5 px-3 text-sm font-mono text-text-secondary whitespace-nowrap",children:v(e.timestamp)}),r.jsx("td",{className:"py-2.5 px-3",children:e.src_hash?r.jsx(D,{hash:e.src_hash,copyValue:e.src_hash_full,size:"xs"}):r.jsx("span",{className:"text-sm text-text-muted",children:"—"})}),r.jsx("td",{className:"py-2.5 px-3",children:r.jsx("span",{className:b("text-sm font-semibold",A(a)),children:a})}),r.jsx("td",{className:"py-2.5 px-3",children:r.jsx("span",{className:b("px-1.5 py-0.5 rounded text-[10px] border font-medium",O(n)),children:n})}),r.jsx("td",{className:"py-2.5 px-3 pr-4",children:r.jsx("div",{className:"flex justify-end",children:r.jsx(T,{rssi:e.rssi,snr:e.snr,compact:!0,showValues:!0})})})]})}const G=e.memo(function(e){return r.jsx(q,{...e})}),W=e.memo(function({packet:e,onClick:t,isFlashing:s=!1}){const{payloadType:a,routeType:n}=X(e),o="tx_local"===e.packet_origin;return r.jsx("div",{onClick:()=>t(e),className:b("packet-row px-3 py-2.5 cursor-pointer","hover:bg-bg-subtle","active:bg-bg-elevated",R(e.is_duplicate)&&"opacity-50",s&&"flash-row",o&&"ring-1 ring-inset ring-accent-primary/60 bg-accent-primary/5"),children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"w-14 flex-shrink-0",children:r.jsx(V,{packet:e,showLabel:!0,size:"sm"})}),r.jsx("span",{className:"text-[10px] font-mono text-text-muted w-7 flex-shrink-0",children:y(e.timestamp)}),r.jsx("div",{className:"w-9 flex-shrink-0",children:e.src_hash?r.jsx(D,{hash:e.src_hash,copyValue:e.src_hash_full,size:"xs"}):r.jsx("span",{className:"text-[10px] text-text-muted",children:"—"})}),r.jsx("span",{className:b("text-sm font-semibold truncate flex-1 min-w-0",A(a)),children:a}),r.jsx("div",{className:"w-14 flex-shrink-0",children:r.jsx("span",{className:b("px-1 py-0.5 rounded text-[9px] border font-medium",O(n)),children:n})}),r.jsx("div",{className:"w-12 flex-shrink-0 flex justify-end",children:r.jsx(T,{rssi:e.rssi,compact:!0,showValues:!0})})]})})});function B(e){if(e.contact_type){const t=e.contact_type.toLowerCase();if("repeater"===t||"rep"===t)return!0;if("companion"===t||"client"===t||"cli"===t)return!1;if("room server"===t||"room_server"===t||"room"===t||"server"===t)return!1}return!0===e.is_repeater||(e.is_repeater,!1)}const K=e.lazy(()=>E(()=>import("./PathMapMapLibre-vehW4pVp.js"),__vite__mapDeps([0,1,2,3])));function Q(e){return`${(100*e).toFixed(0)}%`}function Y(e,t){const s=document.documentElement,a=getComputedStyle(s),n={success:a.getPropertyValue("--accent-success").trim()||"#39D98A",secondary:a.getPropertyValue("--accent-secondary").trim()||"#F9D26F",poor:a.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:a.getPropertyValue("--accent-danger").trim()||"#FF5C7A",muted:a.getPropertyValue("--text-muted").trim()||"#767688"};let r;return r=0===t?n.muted:e>=1?n.success:e>=.5?n.secondary:e>=.25?n.poor:e>0?n.danger:n.muted,{color:r}}class J extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?r.jsxs("div",{className:"h-[200px] flex items-center justify-center text-text-muted",children:[r.jsx(i,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Z({path:t,neighbors:s,localNode:a,localHash:n,srcHash:i,dstHash:l,neighborAffinity:d,prefixLookup:x,hubNodes:h}){const[u,m]=e.useState(null),p=e.useMemo(()=>{if(!i)return null;const e=w(i),t=s[i];if((null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude)&&(0!==t.latitude||0!==t.longitude))return{prefix:e,candidates:[{hash:i,name:t.node_name||t.name||"Source",latitude:t.latitude,longitude:t.longitude,probability:1,isLocal:!1,isDirectNeighbor:!0===t.zero_hop}],confidence:1,totalMatches:1,isSource:!0};const a=(null==t?void 0:t.node_name)||(null==t?void 0:t.name)||i.slice(0,8);return{prefix:e,candidates:[{hash:i,name:a,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[i,s]),f=e.useMemo(()=>{if(!l)return null;const e=w(l);if(n&&l===n&&a){const t=0!==a.latitude||0!==a.longitude;return{prefix:e,candidates:[{hash:l,name:a.name||"Local Node",latitude:t?a.latitude:0,longitude:t?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const t=s[l];if((null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude)&&(0!==t.latitude||0!==t.longitude))return{prefix:e,candidates:[{hash:l,name:t.node_name||t.name||"Destination",latitude:t.latitude,longitude:t.longitude,probability:1,isLocal:!1,isDirectNeighbor:!0===t.zero_hop}],confidence:1,totalMatches:1,isDestination:!0};const r=(null==t?void 0:t.node_name)||(null==t?void 0:t.name)||l.slice(0,8);return{prefix:e,candidates:[{hash:l,name:r,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[l,s,a,n]),g=e.useMemo(()=>function(e,t,s,a,n,r){if(!e||0===e.length)return{hops:[],overallConfidence:0,hasValidPath:!1};const o=e.length-1,c=e.map((c,i)=>{const l=i===o,d=e.length-i,{candidates:x,totalMatches:h}=function(e,t,s,a,n=!1,r,o,c){const i=function(e){const t={};for(const[s,a]of Object.entries(e))B(a)&&(t[s]=a);return t}(t);let l;if(o){const t=function(e,t,s){const a=t.toUpperCase(),n=e.get(a);if(!n||0===n.candidates.length)return{hash:null,confidence:0};if(null==s?void 0:s.isLastHop)return{hash:n.bestMatch,confidence:n.confidence};if(1===(null==s?void 0:s.position))return{hash:n.bestMatch,confidence:n.confidence};if((null==s?void 0:s.position)&&n.bestMatchForPosition.has(s.position)){const e=n.bestMatchForPosition.get(s.position),t=Math.max(e.confidence,n.confidence);return{hash:e.hash,confidence:t}}if((null==s?void 0:s.adjacentPrefixes)&&s.adjacentPrefixes.length>0){let e=n.bestMatch,t=0;for(const a of n.candidates){let n=0;for(const e of s.adjacentPrefixes)n+=a.adjacentPrefixCounts.get(e.toUpperCase())||0;const r=a.combinedScore+n/Math.max(1,a.totalAdjacentObservations)*.3;r>t&&(t=r,e=a.hash)}return{hash:e,confidence:n.confidence}}return{hash:n.bestMatch,confidence:n.confidence}}(o,e,{position:c,isLastHop:n});l=t.confidence}const{matches:d,probability:x}=function(e,t,s,a,n=!1){const r=e.toUpperCase(),o=[],c=s&&N(r,s);c&&o.push(s);for(const u of Object.keys(t))N(r,u)&&o.push(u);if(n&&c&&s&&1===o.length)return{matches:o,probability:1,bestMatch:s};if(n&&c&&o.length>1){const e=o.filter(e=>e!==s);if(1===e.length)return{matches:o,probability:1,bestMatch:e[0]}}const i=o.length>0?1/o.length:0,l=[...o].sort();let d=null,x=-1;if(1===l.length)d=l[0];else if(l.length>1&&a){for(const e of l){const t=a.get(e),s=t?"number"==typeof t?t:t.combinedScore:0;s>x&&(x=s,d=e)}d||(d=l[0])}else l.length>0&&(d=l[0]);let h=i;if(o.length>1&&a&&x>0){let e=0;for(const t of o){const s=a.get(t);e+=s?"number"==typeof s?s:s.combinedScore:0}e>0&&(h=Math.min(.95,x/e))}return{matches:o,probability:h,bestMatch:d}}(e,i,a,r,n),h=d.length,u=[],m=e.toUpperCase(),p=s&&void 0!==s.latitude&&void 0!==s.longitude&&(0!==s.latitude||0!==s.longitude);for(const b of d){if(a&&N(m,a)&&b===a&&p&&s){u.push({hash:b,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:n?1:x,isLocal:!0});continue}const e=i[b];(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0!==e.latitude||0!==e.longitude)&&u.push({hash:b,name:e.node_name||e.name||"Unknown",latitude:e.latitude,longitude:e.longitude,probability:x,isLocal:!1,isDirectNeighbor:!0===e.zero_hop})}const f=u.length;if(1===f)u[0].probability=l??1;else if(f>1)if(void 0!==l&&l>0){u[0].probability=l;const e=1-l,t=f-1;u.slice(1).forEach(s=>{s.probability=e/t})}else{let e=0;const t=u.map(t=>{if(t.isLocal)return{candidate:t,score:1};const a=null==r?void 0:r.get(t.hash);let n=.5;var o;let c;return p&&s&&(n=(o=function(e,t,s,a){const n=(s-e)*Math.PI/180,r=(a-t)*Math.PI/180,o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2);return 2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))*6371e3}(s.latitude,s.longitude,t.latitude,t.longitude))<100?1:o<500?.9:o<1e3?.7:o<5e3?.5:o<1e4?.3:.1),a?c=.3*n+.3*a.hopConsistencyScore+.4*a.frequencyScore:(c=n,t.isDirectNeighbor&&(c=Math.max(c,.8))),e+=c,{candidate:t,score:c}});if(e>0)t.forEach(({candidate:t,score:s})=>{t.probability=Math.min(.95,s/e)});else{const e=1/f;u.forEach(t=>t.probability=e)}}return{candidates:u,totalMatches:h}}(c,t,s,a,l,n,r,d),u=x.length>0?Math.max(...x.map(e=>e.probability)):0;return{prefix:c,candidates:x,confidence:u,totalMatches:h}}),i=c.reduce((e,t)=>0===t.confidence?0:e*t.confidence,1),l=c.some(e=>e.candidates.length>0);return{hops:c,overallConfidence:i,hasValidPath:l}}(t,s,a,n,d,x),[t,s,a,n,d,x]),j=e.useMemo(()=>{const e=[];p&&e.push(p),e.push(...g.hops),f&&e.push(f);const t=e.reduce((e,t)=>0===t.confidence?0:e*t.confidence,1),s=e.some(e=>e.candidates.some(e=>0!==e.latitude||0!==e.longitude));return{hops:e,overallConfidence:t,hasValidPath:s}},[p,g,f]);return j.hasValidPath?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-text-muted",children:"Path Confidence:"}),r.jsx("span",{className:(y=j.overallConfidence,y>=1?"text-accent-success":y>=.5?"text-accent-secondary":y>=.25?"text-signal-poor":y>0?"text-accent-danger":"text-text-muted"),children:Q(j.overallConfidence)}),r.jsx("button",{className:"text-text-muted hover:text-text-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:r.jsx(c,{className:"w-3 h-3"})})]}),r.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-accent-success"}),r.jsx("span",{className:"text-text-muted",children:"Exact"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-accent-secondary"}),r.jsx("span",{className:"text-text-muted",children:"Multi"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-text-muted"}),r.jsx("span",{className:"text-text-muted",children:"Unknown"})]})]})]}),r.jsx("div",{className:"rounded-lg overflow-hidden border border-border-subtle",children:r.jsx(J,{children:r.jsx(e.Suspense,{fallback:r.jsx("div",{className:"h-[200px] bg-bg-elevated flex items-center justify-center text-text-muted text-sm",children:"Loading map..."}),children:r.jsx(K,{resolvedPath:j,localNode:a,hubNodes:h,hoveredHopIndex:u,onHoverHop:m})})})}),r.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:j.hops.map((e,t)=>{var s,a,n;const o=!0===e.isSource,c=!0===e.isDestination,i=u===t;let l;return l=o?`Source: ${(null==(s=e.candidates[0])?void 0:s.name)||"Unknown"}`:c?`Destination: ${(null==(a=e.candidates[0])?void 0:a.name)||"Unknown"}`:0===e.totalMatches?"No matching nodes found":1===e.totalMatches?`Exact match: ${(null==(n=e.candidates[0])?void 0:n.name)||"Unknown"}`:`${e.totalMatches} possible matches (${(100*e.confidence).toFixed(0)}% confidence)`,r.jsxs("div",{className:b("flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer transition-all",i?"bg-accent-primary/20 ring-1 ring-accent-primary/50":"bg-bg-elevated hover:bg-bg-subtle",o&&"border border-accent-success/30",c&&"border border-accent-primary/30"),title:l,onMouseEnter:()=>m(t),onMouseLeave:()=>m(null),children:[o&&r.jsx("span",{className:"text-accent-success text-[8px] mr-0.5",children:"SRC"}),c&&r.jsx("span",{className:"text-accent-primary text-[8px] mr-0.5",children:"DST"}),r.jsx("span",{style:Y(e.confidence,e.totalMatches),children:e.prefix}),!o&&!c&&e.totalMatches>1&&r.jsxs("span",{className:"text-text-muted",children:["×",e.totalMatches]}),!o&&!c&&0===e.totalMatches&&r.jsx("span",{className:"text-text-muted",children:"?"})]},t)})})]}):r.jsxs("div",{className:"flex items-center justify-center text-text-muted text-xs py-4",children:[r.jsx(o,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]});var y}function ee(e){if(!e)return[];if(Array.isArray(e))return e;try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function te({label:e,children:t,compact:s=!1}){return r.jsxs("div",{className:b("flex flex-col",s?"gap-0.5":"gap-1"),children:[r.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wide",children:e}),r.jsx("span",{className:b("text-text-primary","text-sm"),children:t})]})}function se({onClick:e,copied:t}){return r.jsx("button",{onClick:t=>{t.stopPropagation(),e()},className:"p-1 rounded hover:bg-bg-subtle transition-colors",children:t?r.jsx(p,{className:"w-3 h-3 text-accent-success"}):r.jsx(f,{className:"w-3 h-3 text-text-muted"})})}function ae({originalPath:e,forwardedPath:t,ghostPrefixes:s}){const n=t.length>0?t:e;if(0===n.length)return r.jsx("span",{className:"text-sm text-text-muted",children:"No path data"});const o=e=>null==s?void 0:s.has(e.toUpperCase());return r.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:n.map((e,t)=>r.jsxs("div",{className:"flex items-center gap-1",children:[o(e)?r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-accent-tertiary/20 text-accent-tertiary font-mono text-sm",children:[r.jsx(x,{className:"w-3 h-3"}),e.toUpperCase()]}):r.jsx(D,{hash:e,size:"xs"}),t{const e=e=>{"Escape"===e.key&&s()};window.addEventListener("keydown",e);const t=document.body.style.overflow,a=document.body.style.position,n=document.body.style.width,r=document.body.style.top,o=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${o}px`,()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t,document.body.style.position=a,document.body.style.width=n,document.body.style.top=r,window.scrollTo(0,o)}},[s]);const y=_(),v=k(),N=M(),w=C(),E=e.useMemo(()=>new Set(w.map(e=>e.prefix.toUpperCase())),[w]),R=t.payload_type_name||L(t.payload_type??t.type),z=t.route_type_name||F(t.route_type??t.route),U=t.payload_length??t.length??0,H=t.tx_delay_ms??0,X=ee(t.original_path),q=ee(t.forwarded_path),G=X.length>0||q.length>0,W=q.length>0?q:X,B=e.useMemo(()=>{var e;if(null==(e=null==y?void 0:y.config)?void 0:e.repeater)return{latitude:y.config.repeater.latitude,longitude:y.config.repeater.longitude,name:y.config.node_name||"Local Node"}},[y]),K=(null==y?void 0:y.neighbors)??{},Q=N.size>0?N:void 0,Y=function(e){var t;if(!e)return{text:null,isText:!1};try{if(/^[0-9a-fA-F]+$/.test(e)){const s=(null==(t=e.match(/.{1,2}/g))?void 0:t.map(e=>parseInt(e,16)))??[],a=String.fromCharCode(...s),n=a.replace(/[^\x20-\x7E]/g,"");if(n.length>.7*a.length)return{text:n,isText:!0}}if(/^[\x20-\x7E\s]+$/.test(e))return{text:e,isText:!0}}catch{}return{text:null,isText:!1}}(t.payload),J=t.payload&&t.payload.length>0,ne=t.raw_packet&&t.raw_packet.length>0,re=e.useCallback(async(e,t)=>{try{await navigator.clipboard.writeText(e),j(t),setTimeout(()=>j(null),2e3)}catch{}},[]);return l.createPortal(r.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-md z-[10010] flex items-end sm:items-center justify-center",onClick:s,role:"dialog","aria-modal":"true","aria-labelledby":"packet-modal-title",children:r.jsxs("div",{className:b("glass-card-elevated w-full max-h-[90vh] flex flex-col","sm:max-w-xl sm:mx-4 sm:rounded-xl","rounded-t-2xl rounded-b-none sm:rounded-b-xl","pb-safe"),onClick:e=>e.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-subtle flex-shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(V,{packet:t,showLabel:!0,size:"md"}),r.jsxs("div",{children:[r.jsx("h3",{id:"packet-modal-title",className:b("text-base font-semibold",A(R)),children:R}),r.jsx("p",{className:"text-sm text-text-muted",children:P(t.timestamp)})]})]}),r.jsx("button",{onClick:s,className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-bg-subtle transition-colors",children:r.jsx(d,{className:"w-5 h-5"})})]}),r.jsxs("div",{className:"overflow-y-auto flex-1 p-4 space-y-4 overscroll-contain",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(te,{label:"Packet Hash",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.packet_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.packet_hash,"hash"),copied:"hash"===g})]})}),r.jsx(te,{label:"Route",children:r.jsx("span",{className:b("px-2 py-0.5 rounded text-sm border font-medium",O(z)),children:z})})]}),r.jsx("div",{className:"glass-card-inner p-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-text-muted mb-1",children:"Signal Quality"}),r.jsx("p",{className:"text-sm font-medium text-text-primary",children:S(t.rssi)})]}),r.jsx(T,{rssi:t.rssi,snr:t.snr,showValues:!0})]})}),(t.src_hash||t.dst_hash)&&r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[t.src_hash&&r.jsx(te,{label:"Source",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.src_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.src_hash,"src"),copied:"src"===g})]})}),t.dst_hash&&r.jsx(te,{label:"Destination",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.dst_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.dst_hash,"dst"),copied:"dst"===g})]})})]}),G&&r.jsxs("div",{className:"glass-card-inner p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("p",{className:"text-sm text-text-muted",children:"Packet Path"}),W.some(e=>E.has(e.toUpperCase()))&&r.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-accent-tertiary/20 text-accent-tertiary text-[10px]",children:[r.jsx(x,{className:"w-3 h-3"}),r.jsx("span",{children:"Ghost Detected"})]})]}),r.jsx(ae,{originalPath:X,forwardedPath:q,ghostPrefixes:E})]}),G&&W.length>0&&r.jsxs("div",{className:"glass-card-inner overflow-hidden",children:[r.jsxs("button",{onClick:()=>i(!c),className:"w-full p-3 flex items-center justify-between text-left hover:bg-bg-subtle transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(h,{className:"w-4 h-4 text-accent-primary"}),r.jsx("span",{className:"text-sm text-text-secondary font-medium",children:"Path Map"})]}),c?r.jsx(u,{className:"w-4 h-4 text-text-muted"}):r.jsx(m,{className:"w-4 h-4 text-text-muted"})]}),c&&r.jsx("div",{className:"px-3 pb-3",children:r.jsx(Z,{path:W,neighbors:K,localNode:B,localHash:null==y?void 0:y.local_hash,srcHash:t.src_hash,dstHash:t.dst_hash,neighborAffinity:Q,hubNodes:[...v]})})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsx(te,{label:"Size",compact:!0,children:r.jsxs("span",{className:"font-mono",children:[U,"B"]})}),r.jsx(te,{label:"TX Delay",compact:!0,children:r.jsxs("span",{className:"font-mono",children:[H.toFixed(1),"ms"]})}),r.jsx(te,{label:"Score",compact:!0,children:r.jsx("span",{className:"font-mono",children:void 0!==t.score?t.score.toFixed(3):"—"})})]}),r.jsx(te,{label:"Status",children:r.jsx("span",{className:I(t),children:$(t)})}),J&&r.jsxs("div",{className:"glass-card-inner p-3",children:[r.jsx("p",{className:"text-sm text-text-muted mb-2",children:"Payload"}),Y.isText&&Y.text?r.jsx("div",{className:"bg-bg-base rounded p-2",children:r.jsx("p",{className:"text-sm text-text-primary font-mono break-all",children:Y.text})}):r.jsxs("p",{className:"text-sm text-text-muted font-mono break-all",children:[null==(a=t.payload)?void 0:a.slice(0,100),t.payload&&t.payload.length>100&&"..."]})]}),ne&&r.jsxs("div",{className:"glass-card-inner overflow-hidden",children:[r.jsxs("button",{onClick:()=>o(!n),className:"w-full p-3 flex items-center justify-between text-left hover:bg-bg-subtle transition-colors",children:[r.jsx("span",{className:"text-sm text-text-muted",children:"Raw Packet Hex"}),n?r.jsx(u,{className:"w-4 h-4 text-text-muted"}):r.jsx(m,{className:"w-4 h-4 text-text-muted"})]}),n&&r.jsx("div",{className:"px-3 pb-3",children:r.jsxs("div",{className:"bg-bg-base rounded p-2 relative",children:[r.jsx("pre",{className:"text-[10px] text-text-secondary font-mono break-all whitespace-pre-wrap",children:t.raw_packet}),r.jsx("button",{onClick:()=>re(t.raw_packet,"raw"),className:"absolute top-2 right-2 p-1 rounded bg-bg-elevated hover:bg-bg-subtle transition-colors",children:"raw"===g?r.jsx(p,{className:"w-3 h-3 text-accent-success"}):r.jsx(f,{className:"w-3 h-3 text-text-muted"})})]})})]})]})]})}),document.body)});export{G as P,W as a,ne as b,H as g}; diff --git a/frontend/dist/assets/PacketDetailModal-DU2ZzX69.js b/frontend/dist/assets/PacketDetailModal-DU2ZzX69.js deleted file mode 100644 index 38a8f45a..00000000 --- a/frontend/dist/assets/PacketDetailModal-DU2ZzX69.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-vehW4pVp.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/maplibre-gl-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{r as e,$ as t,a4 as s,E as a,a5 as n,j as r,a6 as o,a7 as c,a8 as i,b as l,X as d,h as x,a9 as h,k as u,aa as m,ab as p,a0 as f}from"./vendor-react-C0qkT9dV.js";import{c as b}from"./recharts-DRDKmvXb.js";import{v as g,R as j,w as y,x as v,y as N,e as w,d as _,z as k,A as M,B as C,C as P}from"./index-wYLFmyyS.js";import{S as T,g as S}from"./SignalIndicator-C1cW0knK.js";import{H as D}from"./HashBadge-CAy9V6Vn.js";import{_ as E}from"./deckgl-DTsmDcfs.js";function L(e){return null==e?"UNKNOWN":g[e]||`TYPE_${e}`}function F(e){return null==e?"UNKNOWN":j[e]||`ROUTE_${e}`}function A(e){return{ADVERT:"text-[var(--pkt-advert)]",FLOOD:"text-[var(--pkt-flood)]",TXT_MSG:"text-[var(--pkt-txt-msg)]",ACK:"text-[var(--pkt-ack)]",TRACE:"text-[var(--pkt-trace)]",REQ:"text-[var(--pkt-req)]",RESPONSE:"text-[var(--pkt-response)]",GRP_TXT:"text-[var(--pkt-grp-txt)]",GRP_DATA:"text-[var(--pkt-grp-data)]",PATH:"text-[var(--pkt-path)]",ANON_REQ:"text-[var(--pkt-anon)]"}[e]||"text-[var(--pkt-unknown)]"}function O(e){return{FLOOD:"bg-[var(--route-flood)]/20 text-[var(--route-flood)] border-[var(--route-flood)]/30",DIRECT:"bg-[var(--route-direct)]/20 text-[var(--route-direct)] border-[var(--route-direct)]/30",TRANSPORT:"bg-[var(--route-transport)]/20 text-[var(--route-transport)] border-[var(--route-transport)]/30",T_FLOOD:"bg-[var(--route-flood)]/20 text-[var(--route-flood)] border-[var(--route-flood)]/30",T_DIRECT:"bg-[var(--route-direct)]/20 text-[var(--route-direct)] border-[var(--route-direct)]/30"}[e]||"bg-bg-subtle text-text-muted border-border-subtle"}function R(e){return 1===e||!0===e}const z={rx:{icon:t,label:"RX",color:"text-accent-primary",bgColor:"bg-accent-primary/10"},tx:{icon:n,label:"TX",color:"text-[#F9D26F]",bgColor:"bg-[#F9D26F]/10"},forward:{icon:a,label:"FWD",color:"text-accent-success",bgColor:"bg-accent-success/10"},dropped:{icon:s,label:"DROP",color:"text-accent-danger",bgColor:"bg-accent-danger/10"},duplicate:{icon:t,label:"DUP",color:"text-text-muted",bgColor:"bg-white/5"}},U={sm:"w-3.5 h-3.5",md:"w-4 h-4"};function H(e){return"tx_local"===e.packet_origin?"tx":"tx_forward"===e.packet_origin?"forward":e.is_duplicate?"duplicate":e.transmitted?"forward":e.drop_reason?"dropped":"rx"}const V=e.memo(function({packet:e,showLabel:t=!0,size:s="sm"}){const a=H(e),n=z[a],o=n.icon;return r.jsxs("div",{className:b("inline-flex items-center gap-1 rounded-md",t&&"px-1.5 py-0.5",t&&n.bgColor),children:[r.jsx(o,{className:b(U[s],n.color)}),t&&r.jsx("span",{className:b("text-[10px] font-semibold tracking-wide",n.color),children:n.label})]})});function $(e){return"tx_local"===e.packet_origin?"Transmitted":"tx_forward"===e.packet_origin||e.transmitted?"Forwarded":e.is_duplicate?"Duplicate":"No transport keys configured"===e.drop_reason?"Monitor Only":e.drop_reason?e.drop_reason:"Received"}function I(e){return z[H(e)].color}function X(e){return{payloadType:e.payload_type_name||L(e.payload_type??e.type),routeType:e.route_type_name||F(e.route_type??e.route)}}function q({packet:e,onClick:t,isFlashing:s=!1}){const{payloadType:a,routeType:n}=X(e);return r.jsxs("tr",{onClick:()=>t(e),className:b("cursor-pointer","hover:bg-bg-subtle",R(e.is_duplicate)&&"opacity-50",s&&"flash-row"),children:[r.jsx("td",{className:"py-2.5 px-3",children:r.jsx(V,{packet:e,showLabel:!0})}),r.jsx("td",{className:"py-2.5 px-3 text-sm font-mono text-text-secondary whitespace-nowrap",children:v(e.timestamp)}),r.jsx("td",{className:"py-2.5 px-3",children:e.src_hash?r.jsx(D,{hash:e.src_hash,copyValue:e.src_hash_full,size:"xs"}):r.jsx("span",{className:"text-sm text-text-muted",children:"—"})}),r.jsx("td",{className:"py-2.5 px-3",children:r.jsx("span",{className:b("text-sm font-semibold",A(a)),children:a})}),r.jsx("td",{className:"py-2.5 px-3",children:r.jsx("span",{className:b("px-1.5 py-0.5 rounded text-[10px] border font-medium",O(n)),children:n})}),r.jsx("td",{className:"py-2.5 px-3 pr-4",children:r.jsx("div",{className:"flex justify-end",children:r.jsx(T,{rssi:e.rssi,snr:e.snr,compact:!0,showValues:!0})})})]})}const G=e.memo(function(e){return r.jsx(q,{...e})}),W=e.memo(function({packet:e,onClick:t,isFlashing:s=!1}){const{payloadType:a,routeType:n}=X(e);return r.jsx("div",{onClick:()=>t(e),className:b("packet-row px-3 py-2.5 cursor-pointer","hover:bg-bg-subtle","active:bg-bg-elevated",R(e.is_duplicate)&&"opacity-50",s&&"flash-row"),children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"w-14 flex-shrink-0",children:r.jsx(V,{packet:e,showLabel:!0,size:"sm"})}),r.jsx("span",{className:"text-[10px] font-mono text-text-muted w-7 flex-shrink-0",children:y(e.timestamp)}),r.jsx("div",{className:"w-9 flex-shrink-0",children:e.src_hash?r.jsx(D,{hash:e.src_hash,copyValue:e.src_hash_full,size:"xs"}):r.jsx("span",{className:"text-[10px] text-text-muted",children:"—"})}),r.jsx("span",{className:b("text-sm font-semibold truncate flex-1 min-w-0",A(a)),children:a}),r.jsx("div",{className:"w-14 flex-shrink-0",children:r.jsx("span",{className:b("px-1 py-0.5 rounded text-[9px] border font-medium",O(n)),children:n})}),r.jsx("div",{className:"w-12 flex-shrink-0 flex justify-end",children:r.jsx(T,{rssi:e.rssi,compact:!0,showValues:!0})})]})})});function B(e){if(e.contact_type){const t=e.contact_type.toLowerCase();if("repeater"===t||"rep"===t)return!0;if("companion"===t||"client"===t||"cli"===t)return!1;if("room server"===t||"room_server"===t||"room"===t||"server"===t)return!1}return!0===e.is_repeater||(e.is_repeater,!1)}const K=e.lazy(()=>E(()=>import("./PathMapMapLibre-vehW4pVp.js"),__vite__mapDeps([0,1,2,3])));function Q(e){return`${(100*e).toFixed(0)}%`}function Y(e,t){const s=document.documentElement,a=getComputedStyle(s),n={success:a.getPropertyValue("--accent-success").trim()||"#39D98A",secondary:a.getPropertyValue("--accent-secondary").trim()||"#F9D26F",poor:a.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:a.getPropertyValue("--accent-danger").trim()||"#FF5C7A",muted:a.getPropertyValue("--text-muted").trim()||"#767688"};let r;return r=0===t?n.muted:e>=1?n.success:e>=.5?n.secondary:e>=.25?n.poor:e>0?n.danger:n.muted,{color:r}}class J extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?r.jsxs("div",{className:"h-[200px] flex items-center justify-center text-text-muted",children:[r.jsx(i,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Z({path:t,neighbors:s,localNode:a,localHash:n,srcHash:i,dstHash:l,neighborAffinity:d,prefixLookup:x,hubNodes:h}){const[u,m]=e.useState(null),p=e.useMemo(()=>{if(!i)return null;const e=w(i),t=s[i];if((null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude)&&(0!==t.latitude||0!==t.longitude))return{prefix:e,candidates:[{hash:i,name:t.node_name||t.name||"Source",latitude:t.latitude,longitude:t.longitude,probability:1,isLocal:!1,isDirectNeighbor:!0===t.zero_hop}],confidence:1,totalMatches:1,isSource:!0};const a=(null==t?void 0:t.node_name)||(null==t?void 0:t.name)||i.slice(0,8);return{prefix:e,candidates:[{hash:i,name:a,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[i,s]),f=e.useMemo(()=>{if(!l)return null;const e=w(l);if(n&&l===n&&a){const t=0!==a.latitude||0!==a.longitude;return{prefix:e,candidates:[{hash:l,name:a.name||"Local Node",latitude:t?a.latitude:0,longitude:t?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const t=s[l];if((null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude)&&(0!==t.latitude||0!==t.longitude))return{prefix:e,candidates:[{hash:l,name:t.node_name||t.name||"Destination",latitude:t.latitude,longitude:t.longitude,probability:1,isLocal:!1,isDirectNeighbor:!0===t.zero_hop}],confidence:1,totalMatches:1,isDestination:!0};const r=(null==t?void 0:t.node_name)||(null==t?void 0:t.name)||l.slice(0,8);return{prefix:e,candidates:[{hash:l,name:r,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[l,s,a,n]),g=e.useMemo(()=>function(e,t,s,a,n,r){if(!e||0===e.length)return{hops:[],overallConfidence:0,hasValidPath:!1};const o=e.length-1,c=e.map((c,i)=>{const l=i===o,d=e.length-i,{candidates:x,totalMatches:h}=function(e,t,s,a,n=!1,r,o,c){const i=function(e){const t={};for(const[s,a]of Object.entries(e))B(a)&&(t[s]=a);return t}(t);let l;if(o){const t=function(e,t,s){const a=t.toUpperCase(),n=e.get(a);if(!n||0===n.candidates.length)return{hash:null,confidence:0};if(null==s?void 0:s.isLastHop)return{hash:n.bestMatch,confidence:n.confidence};if(1===(null==s?void 0:s.position))return{hash:n.bestMatch,confidence:n.confidence};if((null==s?void 0:s.position)&&n.bestMatchForPosition.has(s.position)){const e=n.bestMatchForPosition.get(s.position),t=Math.max(e.confidence,n.confidence);return{hash:e.hash,confidence:t}}if((null==s?void 0:s.adjacentPrefixes)&&s.adjacentPrefixes.length>0){let e=n.bestMatch,t=0;for(const a of n.candidates){let n=0;for(const e of s.adjacentPrefixes)n+=a.adjacentPrefixCounts.get(e.toUpperCase())||0;const r=a.combinedScore+n/Math.max(1,a.totalAdjacentObservations)*.3;r>t&&(t=r,e=a.hash)}return{hash:e,confidence:n.confidence}}return{hash:n.bestMatch,confidence:n.confidence}}(o,e,{position:c,isLastHop:n});l=t.confidence}const{matches:d,probability:x}=function(e,t,s,a,n=!1){const r=e.toUpperCase(),o=[],c=s&&N(r,s);c&&o.push(s);for(const u of Object.keys(t))N(r,u)&&o.push(u);if(n&&c&&s&&1===o.length)return{matches:o,probability:1,bestMatch:s};if(n&&c&&o.length>1){const e=o.filter(e=>e!==s);if(1===e.length)return{matches:o,probability:1,bestMatch:e[0]}}const i=o.length>0?1/o.length:0,l=[...o].sort();let d=null,x=-1;if(1===l.length)d=l[0];else if(l.length>1&&a){for(const e of l){const t=a.get(e),s=t?"number"==typeof t?t:t.combinedScore:0;s>x&&(x=s,d=e)}d||(d=l[0])}else l.length>0&&(d=l[0]);let h=i;if(o.length>1&&a&&x>0){let e=0;for(const t of o){const s=a.get(t);e+=s?"number"==typeof s?s:s.combinedScore:0}e>0&&(h=Math.min(.95,x/e))}return{matches:o,probability:h,bestMatch:d}}(e,i,a,r,n),h=d.length,u=[],m=e.toUpperCase(),p=s&&void 0!==s.latitude&&void 0!==s.longitude&&(0!==s.latitude||0!==s.longitude);for(const b of d){if(a&&N(m,a)&&b===a&&p&&s){u.push({hash:b,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:n?1:x,isLocal:!0});continue}const e=i[b];(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0!==e.latitude||0!==e.longitude)&&u.push({hash:b,name:e.node_name||e.name||"Unknown",latitude:e.latitude,longitude:e.longitude,probability:x,isLocal:!1,isDirectNeighbor:!0===e.zero_hop})}const f=u.length;if(1===f)u[0].probability=l??1;else if(f>1)if(void 0!==l&&l>0){u[0].probability=l;const e=1-l,t=f-1;u.slice(1).forEach(s=>{s.probability=e/t})}else{let e=0;const t=u.map(t=>{if(t.isLocal)return{candidate:t,score:1};const a=null==r?void 0:r.get(t.hash);let n=.5;var o;let c;return p&&s&&(n=(o=function(e,t,s,a){const n=(s-e)*Math.PI/180,r=(a-t)*Math.PI/180,o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2);return 2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))*6371e3}(s.latitude,s.longitude,t.latitude,t.longitude))<100?1:o<500?.9:o<1e3?.7:o<5e3?.5:o<1e4?.3:.1),a?c=.3*n+.3*a.hopConsistencyScore+.4*a.frequencyScore:(c=n,t.isDirectNeighbor&&(c=Math.max(c,.8))),e+=c,{candidate:t,score:c}});if(e>0)t.forEach(({candidate:t,score:s})=>{t.probability=Math.min(.95,s/e)});else{const e=1/f;u.forEach(t=>t.probability=e)}}return{candidates:u,totalMatches:h}}(c,t,s,a,l,n,r,d),u=x.length>0?Math.max(...x.map(e=>e.probability)):0;return{prefix:c,candidates:x,confidence:u,totalMatches:h}}),i=c.reduce((e,t)=>0===t.confidence?0:e*t.confidence,1),l=c.some(e=>e.candidates.length>0);return{hops:c,overallConfidence:i,hasValidPath:l}}(t,s,a,n,d,x),[t,s,a,n,d,x]),j=e.useMemo(()=>{const e=[];p&&e.push(p),e.push(...g.hops),f&&e.push(f);const t=e.reduce((e,t)=>0===t.confidence?0:e*t.confidence,1),s=e.some(e=>e.candidates.some(e=>0!==e.latitude||0!==e.longitude));return{hops:e,overallConfidence:t,hasValidPath:s}},[p,g,f]);return j.hasValidPath?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-text-muted",children:"Path Confidence:"}),r.jsx("span",{className:(y=j.overallConfidence,y>=1?"text-accent-success":y>=.5?"text-accent-secondary":y>=.25?"text-signal-poor":y>0?"text-accent-danger":"text-text-muted"),children:Q(j.overallConfidence)}),r.jsx("button",{className:"text-text-muted hover:text-text-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:r.jsx(c,{className:"w-3 h-3"})})]}),r.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-accent-success"}),r.jsx("span",{className:"text-text-muted",children:"Exact"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-accent-secondary"}),r.jsx("span",{className:"text-text-muted",children:"Multi"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"w-2 h-2 rounded-full bg-text-muted"}),r.jsx("span",{className:"text-text-muted",children:"Unknown"})]})]})]}),r.jsx("div",{className:"rounded-lg overflow-hidden border border-border-subtle",children:r.jsx(J,{children:r.jsx(e.Suspense,{fallback:r.jsx("div",{className:"h-[200px] bg-bg-elevated flex items-center justify-center text-text-muted text-sm",children:"Loading map..."}),children:r.jsx(K,{resolvedPath:j,localNode:a,hubNodes:h,hoveredHopIndex:u,onHoverHop:m})})})}),r.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:j.hops.map((e,t)=>{var s,a,n;const o=!0===e.isSource,c=!0===e.isDestination,i=u===t;let l;return l=o?`Source: ${(null==(s=e.candidates[0])?void 0:s.name)||"Unknown"}`:c?`Destination: ${(null==(a=e.candidates[0])?void 0:a.name)||"Unknown"}`:0===e.totalMatches?"No matching nodes found":1===e.totalMatches?`Exact match: ${(null==(n=e.candidates[0])?void 0:n.name)||"Unknown"}`:`${e.totalMatches} possible matches (${(100*e.confidence).toFixed(0)}% confidence)`,r.jsxs("div",{className:b("flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer transition-all",i?"bg-accent-primary/20 ring-1 ring-accent-primary/50":"bg-bg-elevated hover:bg-bg-subtle",o&&"border border-accent-success/30",c&&"border border-accent-primary/30"),title:l,onMouseEnter:()=>m(t),onMouseLeave:()=>m(null),children:[o&&r.jsx("span",{className:"text-accent-success text-[8px] mr-0.5",children:"SRC"}),c&&r.jsx("span",{className:"text-accent-primary text-[8px] mr-0.5",children:"DST"}),r.jsx("span",{style:Y(e.confidence,e.totalMatches),children:e.prefix}),!o&&!c&&e.totalMatches>1&&r.jsxs("span",{className:"text-text-muted",children:["×",e.totalMatches]}),!o&&!c&&0===e.totalMatches&&r.jsx("span",{className:"text-text-muted",children:"?"})]},t)})})]}):r.jsxs("div",{className:"flex items-center justify-center text-text-muted text-xs py-4",children:[r.jsx(o,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]});var y}function ee(e){if(!e)return[];if(Array.isArray(e))return e;try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function te({label:e,children:t,compact:s=!1}){return r.jsxs("div",{className:b("flex flex-col",s?"gap-0.5":"gap-1"),children:[r.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wide",children:e}),r.jsx("span",{className:b("text-text-primary","text-sm"),children:t})]})}function se({onClick:e,copied:t}){return r.jsx("button",{onClick:t=>{t.stopPropagation(),e()},className:"p-1 rounded hover:bg-bg-subtle transition-colors",children:t?r.jsx(p,{className:"w-3 h-3 text-accent-success"}):r.jsx(f,{className:"w-3 h-3 text-text-muted"})})}function ae({originalPath:e,forwardedPath:t,ghostPrefixes:s}){const n=t.length>0?t:e;if(0===n.length)return r.jsx("span",{className:"text-sm text-text-muted",children:"No path data"});const o=e=>null==s?void 0:s.has(e.toUpperCase());return r.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:n.map((e,t)=>r.jsxs("div",{className:"flex items-center gap-1",children:[o(e)?r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-accent-tertiary/20 text-accent-tertiary font-mono text-sm",children:[r.jsx(x,{className:"w-3 h-3"}),e.toUpperCase()]}):r.jsx(D,{hash:e,size:"xs"}),t{const e=e=>{"Escape"===e.key&&s()};window.addEventListener("keydown",e);const t=document.body.style.overflow,a=document.body.style.position,n=document.body.style.width,r=document.body.style.top,o=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top=`-${o}px`,()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t,document.body.style.position=a,document.body.style.width=n,document.body.style.top=r,window.scrollTo(0,o)}},[s]);const y=_(),v=k(),N=M(),w=C(),E=e.useMemo(()=>new Set(w.map(e=>e.prefix.toUpperCase())),[w]),R=t.payload_type_name||L(t.payload_type??t.type),z=t.route_type_name||F(t.route_type??t.route),U=t.payload_length??t.length??0,H=t.tx_delay_ms??0,X=ee(t.original_path),q=ee(t.forwarded_path),G=X.length>0||q.length>0,W=q.length>0?q:X,B=e.useMemo(()=>{var e;if(null==(e=null==y?void 0:y.config)?void 0:e.repeater)return{latitude:y.config.repeater.latitude,longitude:y.config.repeater.longitude,name:y.config.node_name||"Local Node"}},[y]),K=(null==y?void 0:y.neighbors)??{},Q=N.size>0?N:void 0,Y=function(e){var t;if(!e)return{text:null,isText:!1};try{if(/^[0-9a-fA-F]+$/.test(e)){const s=(null==(t=e.match(/.{1,2}/g))?void 0:t.map(e=>parseInt(e,16)))??[],a=String.fromCharCode(...s),n=a.replace(/[^\x20-\x7E]/g,"");if(n.length>.7*a.length)return{text:n,isText:!0}}if(/^[\x20-\x7E\s]+$/.test(e))return{text:e,isText:!0}}catch{}return{text:null,isText:!1}}(t.payload),J=t.payload&&t.payload.length>0,ne=t.raw_packet&&t.raw_packet.length>0,re=e.useCallback(async(e,t)=>{try{await navigator.clipboard.writeText(e),j(t),setTimeout(()=>j(null),2e3)}catch{}},[]);return l.createPortal(r.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-md z-[10010] flex items-end sm:items-center justify-center",onClick:s,role:"dialog","aria-modal":"true","aria-labelledby":"packet-modal-title",children:r.jsxs("div",{className:b("glass-card-elevated w-full max-h-[90vh] flex flex-col","sm:max-w-xl sm:mx-4 sm:rounded-xl","rounded-t-2xl rounded-b-none sm:rounded-b-xl","pb-safe"),onClick:e=>e.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-subtle flex-shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(V,{packet:t,showLabel:!0,size:"md"}),r.jsxs("div",{children:[r.jsx("h3",{id:"packet-modal-title",className:b("text-base font-semibold",A(R)),children:R}),r.jsx("p",{className:"text-sm text-text-muted",children:P(t.timestamp)})]})]}),r.jsx("button",{onClick:s,className:"p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-bg-subtle transition-colors",children:r.jsx(d,{className:"w-5 h-5"})})]}),r.jsxs("div",{className:"overflow-y-auto flex-1 p-4 space-y-4 overscroll-contain",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(te,{label:"Packet Hash",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.packet_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.packet_hash,"hash"),copied:"hash"===g})]})}),r.jsx(te,{label:"Route",children:r.jsx("span",{className:b("px-2 py-0.5 rounded text-sm border font-medium",O(z)),children:z})})]}),r.jsx("div",{className:"glass-card-inner p-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-text-muted mb-1",children:"Signal Quality"}),r.jsx("p",{className:"text-sm font-medium text-text-primary",children:S(t.rssi)})]}),r.jsx(T,{rssi:t.rssi,snr:t.snr,showValues:!0})]})}),(t.src_hash||t.dst_hash)&&r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[t.src_hash&&r.jsx(te,{label:"Source",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.src_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.src_hash,"src"),copied:"src"===g})]})}),t.dst_hash&&r.jsx(te,{label:"Destination",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(D,{hash:t.dst_hash,size:"sm"}),r.jsx(se,{onClick:()=>re(t.dst_hash,"dst"),copied:"dst"===g})]})})]}),G&&r.jsxs("div",{className:"glass-card-inner p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("p",{className:"text-sm text-text-muted",children:"Packet Path"}),W.some(e=>E.has(e.toUpperCase()))&&r.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-accent-tertiary/20 text-accent-tertiary text-[10px]",children:[r.jsx(x,{className:"w-3 h-3"}),r.jsx("span",{children:"Ghost Detected"})]})]}),r.jsx(ae,{originalPath:X,forwardedPath:q,ghostPrefixes:E})]}),G&&W.length>0&&r.jsxs("div",{className:"glass-card-inner overflow-hidden",children:[r.jsxs("button",{onClick:()=>i(!c),className:"w-full p-3 flex items-center justify-between text-left hover:bg-bg-subtle transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(h,{className:"w-4 h-4 text-accent-primary"}),r.jsx("span",{className:"text-sm text-text-secondary font-medium",children:"Path Map"})]}),c?r.jsx(u,{className:"w-4 h-4 text-text-muted"}):r.jsx(m,{className:"w-4 h-4 text-text-muted"})]}),c&&r.jsx("div",{className:"px-3 pb-3",children:r.jsx(Z,{path:W,neighbors:K,localNode:B,localHash:null==y?void 0:y.local_hash,srcHash:t.src_hash,dstHash:t.dst_hash,neighborAffinity:Q,hubNodes:[...v]})})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsx(te,{label:"Size",compact:!0,children:r.jsxs("span",{className:"font-mono",children:[U,"B"]})}),r.jsx(te,{label:"TX Delay",compact:!0,children:r.jsxs("span",{className:"font-mono",children:[H.toFixed(1),"ms"]})}),r.jsx(te,{label:"Score",compact:!0,children:r.jsx("span",{className:"font-mono",children:void 0!==t.score?t.score.toFixed(3):"—"})})]}),r.jsx(te,{label:"Status",children:r.jsx("span",{className:I(t),children:$(t)})}),J&&r.jsxs("div",{className:"glass-card-inner p-3",children:[r.jsx("p",{className:"text-sm text-text-muted mb-2",children:"Payload"}),Y.isText&&Y.text?r.jsx("div",{className:"bg-bg-base rounded p-2",children:r.jsx("p",{className:"text-sm text-text-primary font-mono break-all",children:Y.text})}):r.jsxs("p",{className:"text-sm text-text-muted font-mono break-all",children:[null==(a=t.payload)?void 0:a.slice(0,100),t.payload&&t.payload.length>100&&"..."]})]}),ne&&r.jsxs("div",{className:"glass-card-inner overflow-hidden",children:[r.jsxs("button",{onClick:()=>o(!n),className:"w-full p-3 flex items-center justify-between text-left hover:bg-bg-subtle transition-colors",children:[r.jsx("span",{className:"text-sm text-text-muted",children:"Raw Packet Hex"}),n?r.jsx(u,{className:"w-4 h-4 text-text-muted"}):r.jsx(m,{className:"w-4 h-4 text-text-muted"})]}),n&&r.jsx("div",{className:"px-3 pb-3",children:r.jsxs("div",{className:"bg-bg-base rounded p-2 relative",children:[r.jsx("pre",{className:"text-[10px] text-text-secondary font-mono break-all whitespace-pre-wrap",children:t.raw_packet}),r.jsx("button",{onClick:()=>re(t.raw_packet,"raw"),className:"absolute top-2 right-2 p-1 rounded bg-bg-elevated hover:bg-bg-subtle transition-colors",children:"raw"===g?r.jsx(p,{className:"w-3 h-3 text-accent-success"}):r.jsx(f,{className:"w-3 h-3 text-text-muted"})})]})})]})]})]})}),document.body)});export{G as P,W as a,ne as b,H as c,L as g}; diff --git a/frontend/dist/assets/Packets-CuPG-YBS.js b/frontend/dist/assets/Packets-CuPG-YBS.js deleted file mode 100644 index c47a7dfd..00000000 --- a/frontend/dist/assets/Packets-CuPG-YBS.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t,$ as s,E as a,_ as l,a0 as r,a1 as i,D as c,a2 as n,a3 as o,p as d,X as m}from"./vendor-react-C0qkT9dV.js";import{c as x}from"./recharts-DRDKmvXb.js";import{u as p,b as u,t as h,c as b,v as g,R as j}from"./index-wYLFmyyS.js";import{c as v,P as f,a as y,b as N,g as w}from"./PacketDetailModal-DU2ZzX69.js";import{P as k,b as S,a as R,c as _}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./SignalIndicator-C1cW0knK.js";import"./HashBadge-CAy9V6Vn.js";function C({icon:e,label:s,value:a,color:l,percentage:r}){return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:x("p-1.5 rounded-md",l),children:e}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-sm font-semibold text-text-primary",children:a.toLocaleString()}),t.jsxs("span",{className:"text-[10px] text-text-muted leading-tight",children:[s,void 0!==r&&t.jsxs("span",{className:"ml-1 opacity-70",children:["(",r,"%)"]})]})]})]})}const M=e.memo(function({packets:c}){const n=e.useMemo(()=>{let e=0,t=0,s=0;const a=new Set;let l=0,r=0;for(const o of c){switch(v(o)){case"forward":e++;break;case"dropped":t++;break;case"duplicate":s++}o.src_hash&&a.add(o.src_hash),o.rssi&&(l+=o.rssi,r++)}const i=c.length,n=r>0?Math.round(l/r):0;return{total:i,rx:i,fwd:e,dropped:t,duplicate:s,uniqueSources:a.size,avgRssi:n,rxPercent:100,fwdPercent:i>0?Math.round(e/i*100):0,droppedPercent:i>0?Math.round(t/i*100):0}},[c]);return 0===c.length?null:t.jsx("div",{className:"glass-card p-3 pr-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:flex sm:items-center sm:justify-between sm:gap-6",children:[t.jsx(C,{icon:t.jsx(s,{className:"w-3.5 h-3.5 text-accent-primary"}),label:"Received",value:n.rx,color:"bg-accent-primary/10",percentage:n.rxPercent}),t.jsx(C,{icon:t.jsx(a,{className:"w-3.5 h-3.5 text-accent-success"}),label:"Forwarded",value:n.fwd,color:"bg-accent-success/10",percentage:n.fwdPercent}),t.jsx(C,{icon:t.jsx(l,{className:"w-3.5 h-3.5 text-accent-danger"}),label:"Dropped",value:n.dropped,color:"bg-accent-danger/10",percentage:n.droppedPercent}),t.jsx(C,{icon:t.jsx(r,{className:"w-3.5 h-3.5 text-text-muted"}),label:"Duplicates",value:n.duplicate,color:"bg-white/5"}),t.jsxs("div",{className:"hidden sm:flex items-center gap-6 ml-auto",children:[t.jsx(C,{icon:t.jsx(i,{className:"w-3.5 h-3.5 text-accent-secondary"}),label:"Sources",value:n.uniqueSources,color:"bg-accent-secondary/10"}),t.jsxs("div",{className:"flex flex-col items-end pr-1",children:[t.jsxs("span",{className:"text-sm font-mono text-text-secondary",children:[n.avgRssi," dBm"]}),t.jsx("span",{className:"text-[10px] text-text-muted",children:"Avg Signal"})]})]})]})})});function P(e){return(e.payload_type_name||w(e.payload_type??e.type)).toLowerCase().includes("advert")}function L(){const s=p(),a=u(),l=h(),[r,i]=e.useState(null),[w,C]=e.useState(!1),[L,D]=e.useState({limit:100,status:"all"}),T=b(),[F,A]=e.useState(null),$=e.useRef(0),[q,E]=e.useState(Date.now);e.useEffect(()=>{L.timeRange&&L.timeRange>0&&queueMicrotask(()=>E(Date.now()))},[L.timeRange,s]);const H=e.useMemo(()=>{const e=L.limit??100;return[...s.length<=e?s:s.slice(-e)].sort((e,t)=>(t.timestamp??0)-(e.timestamp??0))},[s,L.limit]),B=0===s.length,O=e.useMemo(()=>{let e=H;if(void 0!==L.type){const t=g[L.type];e=e.filter(e=>{const s=e.type??e.payload_type,a=e.payload_type_name;return s===L.type||a===t})}if(void 0!==L.route){const t=j[L.route];e=e.filter(e=>{const s=e.route??e.route_type,a=e.route_type_name;return s===L.route||a===t})}if(L.status&&"all"!==L.status&&(e=e.filter(e=>v(e)===L.status)),void 0!==L.signalMin&&(e=e.filter(e=>e.rssi>=L.signalMin)),L.timeRange&&L.timeRange>0){const t=q/1e3-3600*L.timeRange;e=e.filter(e=>e.timestamp>=t)}return e},[H,L.type,L.route,L.status,L.signalMin,L.timeRange,q]);e.useEffect(()=>{if(T>0&&T!==$.current&&H.length>0){$.current=T;const e=H.find(P);if(e){const t=requestAnimationFrame(()=>A(e.packet_hash)),s=setTimeout(()=>A(null),600);return()=>{cancelAnimationFrame(t),clearTimeout(s)}}}},[T,H]);const z=(e,t)=>D(s=>({...s,[e]:t})),G=void 0!==L.type||void 0!==L.route||L.status&&"all"!==L.status||void 0!==L.signalMin||L.timeRange&&L.timeRange>0;return t.jsxs(k,{children:[t.jsx(S,{title:"Packet History",icon:t.jsx(d,{}),controls:t.jsxs(t.Fragment,{children:[a&&t.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[t.jsx(c,{className:"w-1.5 h-1.5 fill-accent-success text-accent-success animate-pulse"}),t.jsx("span",{className:"text-text-muted hidden xs:inline",children:"Live"})]}),t.jsxs("button",{onClick:()=>C(!w),className:x("sm:hidden px-3 py-1.5 rounded-lg text-sm font-medium transition-all","flex items-center gap-1.5 border",G?"bg-accent-primary/20 text-accent-primary border-accent-primary/30":"bg-bg-subtle text-text-muted border-border-subtle"),children:[t.jsx(n,{className:"w-4 h-4"}),G&&t.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-primary"})]}),t.jsxs("button",{onClick:()=>l(!a),className:x("px-3 py-1.5 rounded-lg text-sm font-medium transition-all duration-200","flex items-center gap-1.5 border",a?"bg-accent-success/20 text-accent-success border-accent-success/30":"bg-bg-subtle text-text-muted border-border-subtle hover:bg-bg-elevated"),children:[t.jsx(o,{className:x("w-4 h-4",a&&"animate-spin")}),t.jsx("span",{className:"hidden xs:inline",children:a?"Live":"Paused"})]})]})}),t.jsxs(R,{noPadding:!0,className:x("overflow-hidden transition-all duration-200",w?"max-h-96 opacity-100":"max-h-0 opacity-0 sm:max-h-96 sm:opacity-100"),children:[t.jsx(_,{listHeader:!0,icon:t.jsx(n,{className:"icon-sm"}),title:"Filters",actions:G?t.jsxs("button",{onClick:()=>D({limit:L.limit,status:"all"}),className:"type-data-xs text-text-muted hover:text-text-primary flex items-center gap-1",children:[t.jsx(m,{className:"w-3 h-3"})," Clear"]}):void 0}),t.jsx("div",{className:"p-3 sm:p-4",children:t.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-3",children:[t.jsxs("div",{className:"flex-1 min-w-[120px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Type"}),t.jsxs("select",{value:L.type??"",onChange:e=>z("type",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:"",children:"All Types"}),Object.entries(g).map(([e,s])=>t.jsx("option",{value:e,children:s},e))]})]}),t.jsxs("div",{className:"flex-1 min-w-[120px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Route"}),t.jsxs("select",{value:L.route??"",onChange:e=>z("route",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:"",children:"All Routes"}),Object.entries(j).map(([e,s])=>t.jsx("option",{value:e,children:s},e))]})]}),t.jsxs("div",{className:"flex-1 min-w-[120px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Status"}),t.jsxs("select",{value:L.status??"all",onChange:e=>z("status",e.target.value),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:"all",children:"All Status"}),t.jsx("option",{value:"rx",children:"Received"}),t.jsx("option",{value:"forward",children:"Forwarded"}),t.jsx("option",{value:"dropped",children:"Dropped"}),t.jsx("option",{value:"duplicate",children:"Duplicate"})]})]}),t.jsxs("div",{className:"flex-1 min-w-[100px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Time"}),t.jsxs("select",{value:L.timeRange??0,onChange:e=>z("timeRange",Number(e.target.value)||void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:0,children:"All Time"}),t.jsx("option",{value:1,children:"Last 1h"}),t.jsx("option",{value:6,children:"Last 6h"}),t.jsx("option",{value:24,children:"Last 24h"}),t.jsx("option",{value:168,children:"Last 7d"})]})]}),t.jsxs("div",{className:"flex-1 min-w-[100px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Signal"}),t.jsxs("select",{value:L.signalMin??"",onChange:e=>z("signalMin",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:"",children:"Any Signal"}),t.jsx("option",{value:-90,children:"Strong (≥-90)"}),t.jsx("option",{value:-100,children:"Good (≥-100)"}),t.jsx("option",{value:-110,children:"Fair (≥-110)"}),t.jsx("option",{value:-120,children:"Weak (≥-120)"})]})]}),t.jsxs("div",{className:"flex-1 min-w-[80px]",children:[t.jsx("label",{className:"type-micro block mb-1",children:"Limit"}),t.jsxs("select",{value:L.limit??100,onChange:e=>z("limit",Number(e.target.value)),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"}),t.jsx("option",{value:200,children:"200"}),t.jsx("option",{value:500,children:"500"})]})]})]})})]}),t.jsx(M,{packets:O}),t.jsxs(R,{noPadding:!0,children:[t.jsxs("div",{className:"sm:hidden flex items-center gap-1.5 px-3 py-2 border-b border-border-subtle bg-bg-elevated/30",children:[t.jsx("span",{className:"type-micro w-14 flex-shrink-0",children:"Dir"}),t.jsx("span",{className:"type-micro w-7 flex-shrink-0",children:"Time"}),t.jsx("span",{className:"type-micro w-9 flex-shrink-0",children:"Src"}),t.jsx("span",{className:"type-micro flex-1 min-w-0",children:"Type"}),t.jsx("span",{className:"type-micro w-14 flex-shrink-0",children:"Route"}),t.jsx("span",{className:"type-micro w-12 flex-shrink-0",children:"Signal"})]}),t.jsx("div",{className:"hidden sm:block overflow-x-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border-subtle bg-bg-elevated/30",children:[t.jsx("th",{className:"text-left py-2.5 px-3 type-micro w-16",children:"Dir"}),t.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Time"}),t.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Source"}),t.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Type"}),t.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Route"}),t.jsx("th",{className:"text-right py-2.5 px-3 pr-4 type-micro",children:"Signal"})]})}),t.jsx("tbody",{className:"divide-y divide-border-subtle/30",children:B&&0===H.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-12 text-text-muted",children:"Loading packets..."})}):0===O.length?t.jsx("tr",{children:t.jsx("td",{colSpan:6,className:"text-center py-12 text-text-muted",children:"No packets found"})}):O.map((e,s)=>t.jsx(f,{packet:e,onClick:i,isFlashing:P(e)&&F===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))})]})}),t.jsx("div",{className:"sm:hidden divide-y divide-border-subtle/30",children:B&&0===H.length?t.jsx("div",{className:"p-8 text-center text-text-muted",children:"Loading packets..."}):0===O.length?t.jsx("div",{className:"p-8 text-center text-text-muted",children:"No packets found"}):O.map((e,s)=>t.jsx(y,{packet:e,onClick:i,isFlashing:P(e)&&F===e.packet_hash},`${e.packet_hash}_${e.timestamp}_${s}`))}),t.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle type-data-xs text-text-muted bg-bg-elevated/20 sm:text-left text-center",children:["Showing ",O.length," of ",H.length," packets"]})]}),r&&t.jsx(N,{packet:r,onClose:()=>i(null)})]})}export{L as default}; diff --git a/frontend/dist/assets/Packets-KLe38miu.js b/frontend/dist/assets/Packets-KLe38miu.js new file mode 100644 index 00000000..21a5c8f7 --- /dev/null +++ b/frontend/dist/assets/Packets-KLe38miu.js @@ -0,0 +1 @@ +import{r as e,j as s,$ as t,E as a,_ as l,a0 as r,a1 as i,D as c,a2 as n,a3 as o,p as d,X as x}from"./vendor-react-C0qkT9dV.js";import{c as m}from"./recharts-DRDKmvXb.js";import{u as p,b as u,r as h,t as b,R as j}from"./index-DrUSC4Ks.js";import{g,P as v,a as f,b as y}from"./PacketDetailModal-D1jT4M4x.js";import{P as N,b as w,a as k,c as S}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./SignalIndicator-C1cW0knK.js";import"./HashBadge-CAy9V6Vn.js";function R({icon:e,label:t,value:a,color:l,percentage:r}){return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:m("p-1.5 rounded-md",l),children:e}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-text-primary",children:a.toLocaleString()}),s.jsxs("span",{className:"text-[10px] text-text-muted leading-tight",children:[t,void 0!==r&&s.jsxs("span",{className:"ml-1 opacity-70",children:["(",r,"%)"]})]})]})]})}const _=e.memo(function({packets:c}){const n=e.useMemo(()=>{let e=0,s=0,t=0;const a=new Set;let l=0,r=0;for(const o of c){switch(g(o)){case"forward":e++;break;case"dropped":s++;break;case"duplicate":t++}o.src_hash&&a.add(o.src_hash),o.rssi&&(l+=o.rssi,r++)}const i=c.length,n=r>0?Math.round(l/r):0;return{total:i,rx:i,fwd:e,dropped:s,duplicate:t,uniqueSources:a.size,avgRssi:n,rxPercent:100,fwdPercent:i>0?Math.round(e/i*100):0,droppedPercent:i>0?Math.round(s/i*100):0}},[c]);return 0===c.length?null:s.jsx("div",{className:"glass-card p-3 pr-4",children:s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:flex sm:items-center sm:justify-between sm:gap-6",children:[s.jsx(R,{icon:s.jsx(t,{className:"w-3.5 h-3.5 text-accent-primary"}),label:"Received",value:n.rx,color:"bg-accent-primary/10",percentage:n.rxPercent}),s.jsx(R,{icon:s.jsx(a,{className:"w-3.5 h-3.5 text-accent-success"}),label:"Forwarded",value:n.fwd,color:"bg-accent-success/10",percentage:n.fwdPercent}),s.jsx(R,{icon:s.jsx(l,{className:"w-3.5 h-3.5 text-accent-danger"}),label:"Dropped",value:n.dropped,color:"bg-accent-danger/10",percentage:n.droppedPercent}),s.jsx(R,{icon:s.jsx(r,{className:"w-3.5 h-3.5 text-text-muted"}),label:"Duplicates",value:n.duplicate,color:"bg-white/5"}),s.jsxs("div",{className:"hidden sm:flex items-center gap-6 ml-auto",children:[s.jsx(R,{icon:s.jsx(i,{className:"w-3.5 h-3.5 text-accent-secondary"}),label:"Sources",value:n.uniqueSources,color:"bg-accent-secondary/10"}),s.jsxs("div",{className:"flex flex-col items-end pr-1",children:[s.jsxs("span",{className:"text-sm font-mono text-text-secondary",children:[n.avgRssi," dBm"]}),s.jsx("span",{className:"text-[10px] text-text-muted",children:"Avg Signal"})]})]})]})})});function M(){const t=p(),a=u(),l=h(),[r,i]=e.useState(null),[R,M]=e.useState(!1),[P,C]=e.useState({limit:100,status:"all"}),[L,D]=e.useState(Date.now);e.useEffect(()=>{P.timeRange&&P.timeRange>0&&queueMicrotask(()=>D(Date.now()))},[P.timeRange,t]);const T=e.useMemo(()=>{const e=P.limit??100;return[...t.length<=e?t:t.slice(-e)].sort((e,s)=>(s.timestamp??0)-(e.timestamp??0))},[t,P.limit]),$=0===t.length,A=e.useMemo(()=>{let e=T;if(void 0!==P.type){const s=b[P.type];e=e.filter(e=>{const t=e.type??e.payload_type,a=e.payload_type_name;return t===P.type||a===s})}if(void 0!==P.route){const s=j[P.route];e=e.filter(e=>{const t=e.route??e.route_type,a=e.route_type_name;return t===P.route||a===s})}if(P.status&&"all"!==P.status&&(e=e.filter(e=>g(e)===P.status)),void 0!==P.signalMin&&(e=e.filter(e=>e.rssi>=P.signalMin)),P.timeRange&&P.timeRange>0){const s=L/1e3-3600*P.timeRange;e=e.filter(e=>e.timestamp>=s)}return e},[T,P.type,P.route,P.status,P.signalMin,P.timeRange,L]),F=(e,s)=>C(t=>({...t,[e]:s})),q=void 0!==P.type||void 0!==P.route||P.status&&"all"!==P.status||void 0!==P.signalMin||P.timeRange&&P.timeRange>0;return s.jsxs(N,{children:[s.jsx(w,{title:"Packet History",icon:s.jsx(d,{}),controls:s.jsxs(s.Fragment,{children:[a&&s.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[s.jsx(c,{className:"w-1.5 h-1.5 fill-accent-success text-accent-success animate-pulse"}),s.jsx("span",{className:"text-text-muted hidden xs:inline",children:"Live"})]}),s.jsxs("button",{onClick:()=>M(!R),className:m("sm:hidden px-3 py-1.5 rounded-lg text-sm font-medium transition-all","flex items-center gap-1.5 border",q?"bg-accent-primary/20 text-accent-primary border-accent-primary/30":"bg-bg-subtle text-text-muted border-border-subtle"),children:[s.jsx(n,{className:"w-4 h-4"}),q&&s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-primary"})]}),s.jsxs("button",{onClick:()=>l(!a),className:m("px-3 py-1.5 rounded-lg text-sm font-medium transition-all duration-200","flex items-center gap-1.5 border",a?"bg-accent-success/20 text-accent-success border-accent-success/30":"bg-bg-subtle text-text-muted border-border-subtle hover:bg-bg-elevated"),children:[s.jsx(o,{className:m("w-4 h-4",a&&"animate-spin")}),s.jsx("span",{className:"hidden xs:inline",children:a?"Live":"Paused"})]})]})}),s.jsxs(k,{noPadding:!0,className:m("overflow-hidden transition-all duration-200",R?"max-h-96 opacity-100":"max-h-0 opacity-0 sm:max-h-96 sm:opacity-100"),children:[s.jsx(S,{listHeader:!0,icon:s.jsx(n,{className:"icon-sm"}),title:"Filters",actions:q?s.jsxs("button",{onClick:()=>C({limit:P.limit,status:"all"}),className:"type-data-xs text-text-muted hover:text-text-primary flex items-center gap-1",children:[s.jsx(x,{className:"w-3 h-3"})," Clear"]}):void 0}),s.jsx("div",{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-[120px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Type"}),s.jsxs("select",{value:P.type??"",onChange:e=>F("type",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:"",children:"All Types"}),Object.entries(b).map(([e,t])=>s.jsx("option",{value:e,children:t},e))]})]}),s.jsxs("div",{className:"flex-1 min-w-[120px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Route"}),s.jsxs("select",{value:P.route??"",onChange:e=>F("route",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:"",children:"All Routes"}),Object.entries(j).map(([e,t])=>s.jsx("option",{value:e,children:t},e))]})]}),s.jsxs("div",{className:"flex-1 min-w-[120px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Status"}),s.jsxs("select",{value:P.status??"all",onChange:e=>F("status",e.target.value),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:"all",children:"All Status"}),s.jsx("option",{value:"rx",children:"Received"}),s.jsx("option",{value:"forward",children:"Forwarded"}),s.jsx("option",{value:"dropped",children:"Dropped"}),s.jsx("option",{value:"duplicate",children:"Duplicate"})]})]}),s.jsxs("div",{className:"flex-1 min-w-[100px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Time"}),s.jsxs("select",{value:P.timeRange??0,onChange:e=>F("timeRange",Number(e.target.value)||void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:0,children:"All Time"}),s.jsx("option",{value:1,children:"Last 1h"}),s.jsx("option",{value:6,children:"Last 6h"}),s.jsx("option",{value:24,children:"Last 24h"}),s.jsx("option",{value:168,children:"Last 7d"})]})]}),s.jsxs("div",{className:"flex-1 min-w-[100px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Signal"}),s.jsxs("select",{value:P.signalMin??"",onChange:e=>F("signalMin",e.target.value?Number(e.target.value):void 0),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:"",children:"Any Signal"}),s.jsx("option",{value:-90,children:"Strong (≥-90)"}),s.jsx("option",{value:-100,children:"Good (≥-100)"}),s.jsx("option",{value:-110,children:"Fair (≥-110)"}),s.jsx("option",{value:-120,children:"Weak (≥-120)"})]})]}),s.jsxs("div",{className:"flex-1 min-w-[80px]",children:[s.jsx("label",{className:"type-micro block mb-1",children:"Limit"}),s.jsxs("select",{value:P.limit??100,onChange:e=>F("limit",Number(e.target.value)),className:"w-full bg-bg-subtle border border-border-subtle rounded-lg px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary/50",children:[s.jsx("option",{value:50,children:"50"}),s.jsx("option",{value:100,children:"100"}),s.jsx("option",{value:200,children:"200"}),s.jsx("option",{value:500,children:"500"})]})]})]})})]}),s.jsx(_,{packets:A}),s.jsxs(k,{noPadding:!0,children:[s.jsxs("div",{className:"sm:hidden flex items-center gap-1.5 px-3 py-2 border-b border-border-subtle bg-bg-elevated/30",children:[s.jsx("span",{className:"type-micro w-14 flex-shrink-0",children:"Dir"}),s.jsx("span",{className:"type-micro w-7 flex-shrink-0",children:"Time"}),s.jsx("span",{className:"type-micro w-9 flex-shrink-0",children:"Src"}),s.jsx("span",{className:"type-micro flex-1 min-w-0",children:"Type"}),s.jsx("span",{className:"type-micro w-14 flex-shrink-0",children:"Route"}),s.jsx("span",{className:"type-micro w-12 flex-shrink-0",children:"Signal"})]}),s.jsx("div",{className:"hidden sm:block overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border-subtle bg-bg-elevated/30",children:[s.jsx("th",{className:"text-left py-2.5 px-3 type-micro w-16",children:"Dir"}),s.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Time"}),s.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Source"}),s.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Type"}),s.jsx("th",{className:"text-left py-2.5 px-3 type-micro",children:"Route"}),s.jsx("th",{className:"text-right py-2.5 px-3 pr-4 type-micro",children:"Signal"})]})}),s.jsx("tbody",{className:"divide-y divide-border-subtle/30",children:$&&0===T.length?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-text-muted",children:"Loading packets..."})}):0===A.length?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-text-muted",children:"No packets found"})}):A.map((e,t)=>s.jsx(v,{packet:e,onClick:i},`${e.packet_hash}_${e.timestamp}_${t}`))})]})}),s.jsx("div",{className:"sm:hidden divide-y divide-border-subtle/30",children:$&&0===T.length?s.jsx("div",{className:"p-8 text-center text-text-muted",children:"Loading packets..."}):0===A.length?s.jsx("div",{className:"p-8 text-center text-text-muted",children:"No packets found"}):A.map((e,t)=>s.jsx(f,{packet:e,onClick:i},`${e.packet_hash}_${e.timestamp}_${t}`))}),s.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle type-data-xs text-text-muted bg-bg-elevated/20 sm:text-left text-center",children:["Showing ",A.length," of ",T.length," packets"]})]}),r&&s.jsx(y,{packet:r,onClose:()=>i(null)})]})}export{M as default}; diff --git a/frontend/dist/assets/Statistics-GNsxMYwC.js b/frontend/dist/assets/Statistics-GNsxMYwC.js new file mode 100644 index 00000000..3297e5f4 --- /dev/null +++ b/frontend/dist/assets/Statistics-GNsxMYwC.js @@ -0,0 +1 @@ +var e,t,s=Object.defineProperty,a=(e,t,a)=>((e,t,a)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a)(e,"symbol"!=typeof t?t+"":t,a);import{j as n,r,aC as l,I as i,aD as o,aE as c,aF as d,aG as C,aH as A,aI as m,aJ as u,aK as D,aL as F,o as B,aM as E,aN as h,aO as x,aP as p,aQ as g,aR as f,a8 as b,aS as y,ak as v,h as j,ae as N,aT as w,ac as k,p as M,C as S,at as T}from"./vendor-react-C0qkT9dV.js";import{S as $,U as P,V as R,W as L,X as _,Y as z,Z as H,_ as O,F as W,t as I,$ as V,a0 as q,a1 as G,E as X,a2 as K,c as Y,f as U,e as Q,u as Z,n as J,p as ee,h as te,o as se,a3 as ae,j as ne,a4 as re}from"./index-DrUSC4Ks.js";import{u as le}from"./usePolling-ul9y_if7.js";import{a as ie,b as oe,c as ce,d as de,e as Ce,s as Ae}from"./useThemeColors-DL9Pr7sC.js";import{c as me,R as ue,d as De,L as Fe,C as Be,X as Ee,Y as he,T as xe,a as pe}from"./recharts-DRDKmvXb.js";import{T as ge}from"./TimeRangeSelector-COrVm3Yj.js";import{a as fe,c as be,P as ye,b as ve}from"./PageLayout-DAadOF4d.js";import{C as je}from"./CollisionExplorerModal-B0_yuX1j.js";import{R as Ne,C as we}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./leaflet-D_ckmI2R.js";function ke({children:e,centered:t,className:s}){return n.jsx("div",{className:me("flex-1 min-h-0",t&&"flex items-center justify-center",s),children:e})}const Me={useAbsoluteThresholds:!0,baselinePercentile:6,spikePercentile:50,baselineDbm:-107,spikeDbm:-100,mergeGapSeconds:45,minSequenceLength:16,similarityToleranceDbm:5};function Se(e,t){if(0===e.length)return 0;const s=t/100*(e.length-1),a=Math.floor(s),n=Math.ceil(s);return a===n?e[a]:e[a]+(e[n]-e[a])*(s-a)}function Te(e){if(0===e.length)return{median:0,p90:0,p95:0,p99:0,max:0,min:0};const t=[...e].sort((e,t)=>e-t);return{median:Se(t,50),p90:Se(t,90),p95:Se(t,95),p99:Se(t,99),max:t[t.length-1],min:t[0]}}function $e(e,t,s){const a=s-t;if(0===a)return"moderate";const n=(e-t)/a;return n>.66?"critical":n>.33?"severe":"moderate"}r.memo(function({options:e,data:t,className:s="",onCreate:a}){const l=r.useRef(null),i=r.useRef(null);return r.useEffect(()=>{const s=l.current;if(!s)return;const n=s.getBoundingClientRect(),r=Math.floor(n.width)||400,o=Math.floor(n.height)||200,c=new R({...e,width:r,height:o},t,s);return i.current=c,null==a||a(c),()=>{c.destroy(),i.current=null}},[e]),r.useEffect(()=>{i.current&&t&&i.current.setData(t)},[t]),r.useEffect(()=>{const e=l.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!i.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&i.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),n.jsx("div",{ref:l,className:`w-full h-full ${s}`,style:{minHeight:100}})});const Pe=new Map;function Re(e){var t;if(!e.startsWith("var("))return e;const s=Pe.get(e);if(s)return s;const a=e.match(/var\(([^,)]+)(?:,\s*([^)]+))?\)/);if(!a)return e;const n=a[1].trim(),r=(null==(t=a[2])?void 0:t.trim())||"#888888",l=getComputedStyle(document.documentElement).getPropertyValue(n).trim()||r;return Pe.set(e,l),l}function Le(e,t,s=!1){if(t.length<2)return;if(e.beginPath(),e.moveTo(t[0].x,t[0].y),2===t.length)return void e.lineTo(t[1].x,t[1].y);const a=.5;for(let n=0;n{u.current=e,D.current=t,F.current=a,B.current=s});const h=r.useRef({band:l,innerBand:i,mean:o,median:c,average:d,cursor:C});r.useLayoutEffect(()=>{h.current={band:l,innerBand:i,mean:o,median:c,average:d,cursor:C}});const x=r.useMemo(()=>[e.map(e=>e.timestamp),e.map(e=>e.max)],[e]),p=r.useMemo(()=>{const e=function(e,t,s,a){return{hooks:{draw:n=>{const r=e.current,l=t.current,i=s.current,o=a.current;if(0===r.length)return;const c=n.ctx,d=n.bbox,C=d.left,A=d.top,m=d.width,u=d.height;if(m<=0||u<=0)return;const D=n.data[0],F=D.length;if(0===F)return;const B=D[0],E=D[F-1]-B||1,h=e=>C+(e-B)/E*m,x=e=>A+u*(1-e/l),p={min:r.map(e=>({x:h(e.timestamp),y:x(e.min)})),max:r.map(e=>({x:h(e.timestamp),y:x(e.max)})),p5:r.map(e=>({x:h(e.timestamp),y:x(e.p5)})),p95:r.map(e=>({x:h(e.timestamp),y:x(e.p95)})),p25:r.map(e=>({x:h(e.timestamp),y:x(e.p25)})),p75:r.map(e=>({x:h(e.timestamp),y:x(e.p75)})),mean:r.map(e=>({x:h(e.timestamp),y:x(e.mean)})),median:r.map(e=>({x:h(e.timestamp),y:x(e.median)})),average:r.map(e=>({x:h(e.timestamp),y:x(e.average)}))},g=(e,t)=>i?i===e?Math.min(1,1.5*t):"minMax"===i||"p5p95"===i||"p25p75"===i?.3*t:t:t,f=e=>i?i===e?1:"mean"===i||"median"===i||"average"===i?.3:1:1,b={band:Re(o.band),innerBand:Re(o.innerBand),mean:Re(o.mean),median:Re(o.median),average:Re(o.average)};c.save(),c.strokeStyle=b.average,c.lineWidth=4,c.globalAlpha=f("average"),Le(c,p.average),c.stroke(),c.globalAlpha=g("minMax",.15),c.fillStyle=b.band,c.beginPath(),Le(c,p.max);const y=[...p.min].reverse();for(const e of y)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.globalAlpha=g("p5p95",.3),c.fillStyle=b.band,c.beginPath(),Le(c,p.p95);const v=[...p.p5].reverse();for(const e of v)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.globalAlpha=g("p25p75",.55),c.fillStyle=b.innerBand,c.beginPath(),Le(c,p.p75);const j=[...p.p25].reverse();for(const e of j)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.strokeStyle=b.median,c.lineWidth=1.5,c.globalAlpha=f("median"),c.setLineDash([4,4]),Le(c,p.median),c.stroke(),c.strokeStyle=b.mean,c.lineWidth=1.5,c.globalAlpha=f("mean"),c.setLineDash([]),Le(c,p.mean),c.stroke(),c.restore()}}}}(u,D,F,h);return{width:400,height:200,padding:[4,4,4,4],cursor:{show:!0,x:!0,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,t]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],hooks:{setCursor:[e=>{var t,s;const a=e.cursor.idx;null!=a&&a>=0?null==(t=B.current)||t.call(B,a):null==(s=B.current)||s.call(B,null)}]},plugins:[e]}},[t]);r.useEffect(()=>{const t=A.current;if(!t||0===e.length)return;const s=E.current,a=e.length,n=Math.abs(a-s);if(!(!m.current||n>100||s>0&&n/s>.1)&&m.current)return m.current.setData(x),void(E.current=a);m.current&&m.current.destroy();const r=t.getBoundingClientRect(),l=Math.floor(r.width)||400,i=Math.floor(r.height)||200,o=new R({...p,width:l,height:i},x,t);return m.current=o,E.current=a,()=>{o.destroy(),m.current=null}},[p,x,e.length]),r.useEffect(()=>{const e=A.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!m.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&m.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),r.useEffect(()=>{m.current&&m.current.redraw()},[a,e]);const g=r.useCallback(()=>{null==s||s(null)},[s]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:A,className:"w-full h-full rounded-2xl overflow-hidden",onMouseLeave:g})});const _e=["#65024B","#701057","#7B1B61","#88276E","#923078","#9B3881","#A4418A","#AC4993","#B5549C","#BC5CA3","#C266AB","#C970B2","#CF7AB9","#D587C1","#DA93C8","#DF9ECE","#E3AAD4","#E7B5DA","#EBC2E0","#EECCE5","#F1D5E9","#F3DDED","#F5E4F0","#F6EBF1","#F6EFF1","#F5F2F0","#F3F3ED","#EFF3E6","#EBF1DF","#E5EFD5","#DDEBCA","#D4E6BD","#C8DEAB","#BCD79B","#B0CE8C","#A3C67D","#97BC6F","#88B161","#7CA856","#72A04D","#679845","#5E903D","#538735","#4B7F2E","#427827","#397021","#306819","#245D10","#195507","#0D4C00"],ze=["#4F3043","#56304B","#603354","#6D3961","#793F6B","#834675","#8D4E7E","#965587","#A05E91","#A86698","#B06EA0","#B877A7","#BF81AF","#C78DB8","#CD98BE","#D2A3C4","#D6ADC8","#D9B5CB","#DABECC","#DAC3CC","#D9C7CA","#D8CAC8","#D6CBC6","#D4CDC2","#D1CDBE","#CCCDB9","#C6CBB1","#BCC5A4","#B2BE97","#A7B58A","#9CAB7E","#92A174","#889669","#808D62","#79855C","#737D56","#6D7552","#666C4C","#616548","#5C5D45","#575642","#54503F","#50493D","#4D453C","#4B403B","#4A3C3A","#49393A","#49343B","#4A313E","#4E3042"],He=["#9EB0FF","#93AFFA","#87ADF4","#79ABED","#6CA9E6","#60A5DF","#54A0D5","#489ACA","#3E90BC","#3787AF","#327EA3","#2D7597","#296B8B","#25607C","#225771","#1E4E65","#1B465A","#183D4F","#153342","#122C38","#11242E","#101D25","#11181C","#121214","#160E0D","#1B0B07","#210B03","#270D01","#2D0E00","#340F00","#3B1100","#421301","#4B1602","#541905","#5D1E09","#68240F","#732B16","#803620","#8A3F2A","#944834","#9E513F","#A85A4A","#B46658","#BE6F63","#C8796F","#D2837A","#DD8D86","#EA9995","#F4A3A1","#FFADAD"],Oe=["#2C1A4C","#2B2154","#2B295B","#2A3164","#29396C","#284174","#29497C","#2A5183","#305C8C","#376593","#416D9A","#4B76A0","#567FA6","#6489AD","#6F92B3","#7B9BBA","#86A3C0","#92ACC6","#A0B7CD","#ACC0D3","#B8C9DA","#C4D2E0","#D0DBE6","#DEE5EC","#E7ECED","#EDEFE9","#EDEEE1","#E9E9D4","#E4E4C8","#DEDEBD","#D8D8B1","#D2D2A5","#C9C996","#C1C18A","#B8B87E","#AEAE73","#A3A369","#97975E","#8D8D56","#83834D","#797945","#70703D","#646434","#5B5B2C","#525224","#49491D","#404016","#36360F","#2E2E08","#262600"],We=["#372F38","#36303D","#363144","#36354E","#363957","#373F60","#39456A","#3C4D75","#415780","#47608A","#4D6992","#55729A","#5D7BA2","#6886AA","#728FB1","#7C97B7","#86A0BD","#91A8C2","#9DB2C8","#A7BACC","#B1C1CE","#BAC8D0","#C2CDD0","#CAD1CD","#CED3C8","#CFD3C2","#CFD1B9","#CBCCAD","#C6C6A2","#BFBF96","#B8B78B","#AFAF7F","#A4A472","#9B9A68","#91915E","#888755","#7E7E4C","#737243","#6B693D","#626137","#5B5932","#54512E","#4C482B","#474229","#423D29","#3F3829","#3C352B","#39322E","#383032","#372F37"],Ie=["#1A3333","#1B373D","#1C3C47","#1E4255","#1F4762","#214E71","#235582","#255E92","#2969A1","#2C73AD","#2F7CB8","#3485C2","#3B8EC7","#4799C8","#50A1C9","#59AAC9","#62B2CA","#6BBACB","#76C3CB","#81CCCD","#92D5D1","#A4DED5","#B6E7DA","#CCF2DF","#DDFBE3","#034224","#08491F","#115119","#1C5914","#2B6212","#3D6915","#4E6E1B","#617224","#6F742B","#7B7631","#867836","#917B3C","#9E7E45","#AA844F","#B48D5D","#BC976C","#C3A27C","#CAB08F","#CFBBA0","#D5C6B0","#DACFC1","#DFD7D0","#E4DFE0","#E9E6ED","#EDEDFC"],Ve=["#2C194C","#2B2254","#2B295C","#2A3265","#293A6D","#284275","#284A7C","#2A5284","#2F5C8D","#366493","#3F6C99","#49749F","#527CA4","#5E85AA","#688DB0","#7395B6","#7E9DBB","#8AA6C2","#99B1C9","#A5BBD0","#B2C5D7","#C0CFDE","#CDD9E5","#DCE5EB","#E5ECED","#E6EEEA","#E0EAE1","#D4E2D4","#C8DBC8","#BCD3BC","#B0CAB0","#A4C2A3","#95B895","#89B088","#7DA87D","#71A071","#669966","#599059","#4F894E","#458244","#3B7B3A","#317430","#266A25","#1F611D","#1A5816","#174E12","#14450E","#123A0A","#103107","#0F2903"],qe=["#3F3E3A","#3E3D3F","#3E3D44","#3E3D4B","#3E3F52","#3E425A","#3F4762","#414C6C","#445578","#485D82","#4E658B","#546E94","#5C779C","#6581A5","#6E8AAC","#7792B2","#809BB8","#89A3BD","#94ACC2","#9CB3C5","#A3BAC7","#A9C0C8","#AEC5C7","#B0C9C4","#B0CABF","#ADCAB9","#A9C9B2","#A2C5A8","#9BC19F","#93BC95","#8BB68B","#82B081","#78A775","#709F6A","#689760","#608E56","#5A864C","#537B42","#4F733B","#4B6B35","#486431","#465D2E","#44562C","#43512C","#424D2D","#42492E","#414630","#404333","#404036","#3F3E3A"],Ge=["#0D0D0D","#181818","#212121","#2B2B2B","#343434","#3C3C3C","#454545","#4D4D4D","#565656","#5E5E5E","#656565","#6D6D6D","#747474","#7C7C7C","#848484","#8B8B8B","#939393","#9C9C9C","#A7A7A7","#B1B1B1","#BBBBBB","#C5C5C5","#D1D1D1","#DFDFDF","#ECECEC","#094225","#184822","#2B4F20","#3A5420","#485822","#555B24","#615E26","#6F6229","#7A652B","#86682E","#926B30","#9F7035","#AD7940","#B6834D","#BD8E5C","#C2996C","#C6A47C","#CCB18F","#D1BCA0","#D5C6B0","#DACFC1","#DFD7CF","#E4DFE0","#E8E6ED","#EDEDFC"],Xe=["#E6E5FF","#D8DCF7","#CBD2EF","#BBC6E5","#ADBCDE","#A0B3D6","#93A9CE","#86A0C6","#7794BD","#6A8BB5","#5E81AC","#5177A4","#456E9B","#38628F","#2F5984","#274F78","#20476D","#1B3F61","#173653","#142E48","#12283E","#112233","#111D2A","#121921","#15181B","#181A18","#1E1D17","#252419","#2D2B1C","#353220","#3E3A25","#46422A","#514C31","#5A5536","#645E3C","#6D6741","#777047","#837B4F","#8D8556","#988F5E","#A29A67","#ADA470","#B9B17D","#C3BC89","#CDC795","#D7D2A2","#E0DCAF","#ECE9BE","#F5F4CB","#FFFFD9"],Ke=["#FFCF67","#F9C564","#F3BB60","#EBB05D","#E5A659","#DF9D56","#D99554","#D38C51","#CC824D","#C67B4B","#C07348","#B96C46","#B36444","#AB5C41","#A4553F","#9D4F3D","#95483C","#8E423A","#843B39","#7C3639","#743139","#6D2D3A","#662A3D","#5F2941","#5A2846","#552A4C","#522C53","#4F315D","#4D3566","#4C3B6F","#4C4179","#4C4883","#4D518E","#4F5897","#51609F","#5367A7","#556FAE","#5878B6","#5B80BC","#5E88C2","#6190C8","#6498CE","#68A3D5","#6BACDB","#6FB5E1","#72BEE6","#76C7EC","#7AD3F3","#7DDDF9","#81E7FF"],Ye=["#1A2659","#212E61","#293568","#323F72","#3A477A","#424F82","#4A578A","#535F92","#5D699C","#6572A5","#6E7BAE","#7784B7","#808DC0","#8B97CA","#94A1D3","#9DAADC","#A6B3E5","#AFBCEC","#B9C6F2","#C0CDF5","#C7D4F7","#CEDAF9","#D4E1FB","#DCE9FD","#E3F0FE","#1F4E00","#2C5100","#3A5600","#445900","#4F5C02","#5A6005","#65660C","#736D18","#7E7423","#8A7B2E","#94823A","#9F8945","#AC9253","#B79A5E","#C3A36A","#CEAC75","#D9B581","#E5C090","#EDC99D","#F2D2A9","#F6DAB5","#F8E2C0","#FAECCE","#FBF4DA","#FDFDE6"],Ue=["#7E1700","#832504","#883008","#8F3C0C","#934610","#984E14","#9C5717","#A05F1B","#A5681F","#A97023","#AD7826","#B0802B","#B58930","#BA9437","#BE9D3E","#C2A647","#C7B051","#CBBA5D","#CFC66D","#D1CF7B","#D2D78A","#D2DE98","#D0E4A6","#CBE8B4","#C4EABE","#BDEAC6","#B3E9CD","#A6E6D2","#9BE2D5","#8EDDD7","#81D7D7","#74CFD6","#64C6D5","#59BDD2","#4FB5D0","#46ACCC","#3EA4C9","#379AC5","#3292C2","#2E8ABF","#2B82BB","#287AB8","#2471B4","#2269B0","#1F60AD","#1C58A9","#194FA5","#1344A0","#0C3B9C","#033198"],Qe=["#733957","#773850","#7A3849","#7E3942","#823C3D","#863F38","#8A4334","#8E4831","#94502E","#98572C","#9D5F2B","#A3672C","#A8712E","#AF7D32","#B58837","#BB933F","#C19F47","#C6AA52","#CDB761","#D1C26E","#D4CB7B","#D6D388","#D5D995","#D3DEA3","#CEE0AD","#C8E1B6","#C1E1BE","#B6DEC5","#ABDBC9","#A0D6CC","#94D0CE","#88C9CF","#7BC0CE","#70B8CD","#67AFCA","#5FA6C7","#589CC4","#5291BE","#4F88B9","#4E7EB3","#4F75AC","#516BA4","#55609A","#595891","#5D5087","#62497D","#664474","#6B3F69","#6F3B60","#723959"],Ze=["#DED9FF","#D0CFF9","#C3C6F3","#B3BBEC","#A6B1E6","#98A8E1","#8B9FDB","#7E95D4","#6E89CB","#617FC3","#5575B8","#4A6BAC","#4262A0","#395790","#334F83","#2E4776","#293F6A","#24385D","#1F304F","#1B2943","#172338","#141D2E","#111824","#0F151B","#0D1516","#0D1712","#0F1B12","#112113","#142716","#162F19","#1A361C","#1D3E20","#224825","#26512A","#2A5A2E","#2E6233","#336C38","#39773E","#3F8144","#488B4A","#529551","#5FA059","#70AB63","#7FB46B","#8EBD73","#9DC57B","#ACCD83","#BDD68C","#CCDE94","#DBE69B"],Je=["#FFCDFD","#F7BEF2","#F0B0E8","#E6A0DC","#DE93D2","#D786C8","#CF7ABF","#C76FB5","#BD63AA","#B45AA1","#AB5198","#A1498E","#964184","#883977","#7C326B","#6E2C60","#612654","#542148","#451C3B","#391931","#2F1728","#281521","#22141C","#1D1417","#1A1414","#191612","#191811","#1B1D11","#1D2212","#212913","#253014","#2B3916","#324419","#384D1B","#3F561E","#456021","#4C6924","#547427","#5A7C2A","#60852E","#678E32","#6E9737","#77A33F","#7FAE47","#88BA51","#92C65D","#9CD26B","#A9E27F","#B3EF92","#BEFDA5"],et=["#001261","#011A66","#02226B","#022B71","#023376","#023A7B","#034280","#034A85","#06548B","#0B5D91","#136697","#1E6F9D","#2B79A4","#3C85AC","#4B90B3","#5A9ABA","#6AA4C1","#7AAEC8","#8DBAD0","#9DC4D6","#ADCDDD","#BDD6E3","#CCDFE8","#DEE6E9","#E8E7E5","#EEE3DC","#EEDBD0","#EBD0C0","#E7C6B2","#E3BCA5","#DFB298","#DBA88B","#D69D7C","#D29470","#CE8B64","#CA8258","#C6794C","#C26E3F","#BE6533","#B85C28","#B2511D","#A94512","#9C3709","#912D06","#872406","#7E1D06","#741506","#6A0D07","#620607","#590008"],tt=["#4F1A3D","#4B1D43","#48214A","#432653","#3F2C5B","#3C3263","#38396C","#354174","#334B7F","#345487","#365E8F","#3B6797","#42719E","#4D7DA6","#5787AD","#6391B4","#709ABA","#7DA4BF","#8EAEC4","#9BB5C7","#A9BBC8","#B5C0C8","#C0C2C5","#CBC2BF","#D2C0B8","#D6BDAF","#D9B7A6","#D9AF99","#D8A88D","#D6A082","#D39776","#CF8D6B","#C8825D","#C27752","#BB6D47","#B3623D","#AA5633","#9F492A","#953E25","#8C3521","#822C1F","#7A251E","#721F1F","#6B1A21","#661824","#611627","#5C152B","#571631","#531736","#50193C"],st={acton:{discrete:["#260D40","#2B1345","#2F194B","#342152","#382657","#3C2C5C","#403261","#443766","#483E6C","#4C4371","#504876","#544D7B","#57527F","#5D5884","#625C88","#685F8A","#6E618C","#74628D","#7B638D","#81638E","#88648E","#8E648E","#95658F","#9D658F","#A4668F","#AB6690","#B26790","#BB6992","#C26B94","#C86F97","#CD749B","#D07AA0","#D382A7","#D688AC","#D88FB2","#D995B8","#DB9CBD","#DEA4C4","#DFABC9","#E1B1CE","#E3B7D3","#E5BED8","#E6C5DE","#E8CBE2","#E9D0E6","#EBD6EA","#ECDBEE","#EDE1F3","#EFE6F6","#F0EAFA"],categorical:["#260D40","#F0EAFA","#A76690","#DDA1C2","#585380","#7D638E","#E8CAE1","#CF789E","#403261","#4C4371","#ECDBEE","#69608B","#E3B6D2","#D78CB0","#91648F","#BE6A92","#342152","#EAD3E8","#524B79","#73628D","#463A69","#605B86","#E5C0DA","#D382A7","#C86F97","#86648E","#EEE3F4","#DA97B9","#9B658F","#B26790","#2D1749","#E0ACCA","#3A2959","#8B648E","#311C4D","#EBD7EB","#EDDFF1","#AC6790","#A1668F","#6E618C","#E6C5DE","#78628D","#433665","#DEA7C6","#81638E","#554F7C","#B86891","#3D2D5D","#4F4775","#EFE7F7","#E9CEE4","#D27DA3","#2A1244","#655D89","#C36C94","#E1B1CE","#493F6D","#5C5783","#CC739A","#DB9CBD","#D892B4","#D587AB","#96658F","#E4BBD6","#362455","#4E4573","#7F638E","#D37FA5","#E1AECC","#382657","#EBD9ED","#DFA9C8","#A4668F","#8E648E","#99658F","#675F8A","#B56891","#BB6992","#E5BED8","#E2B4D0","#D07AA0","#71618C","#E6C2DC","#AA6690","#625C88","#EDE1F3","#E8CCE3","#AF6790","#CA7199","#C16B93","#453867","#57517E","#84638E","#4B416F","#E7C7DF","#423463","#514977","#3E2F5F","#544D7B","#93658F"]},bam:{discrete:_e,categorical:_e},bamako:{discrete:["#003B47","#023C46","#053E45","#083F43","#0A4141","#0D4340","#0F443E","#12463C","#16483A","#194A38","#1C4D36","#204F34","#235132","#28542F","#2C572C","#305A2A","#355C27","#395F24","#3F6321","#44661E","#49691A","#4E6D17","#537014","#5A7410","#5F780D","#657C09","#6A7F05","#718302","#788501","#7F8700","#858800","#8C8A00","#948C01","#9B8E04","#A1920B","#A89713","#AE9C1B","#B7A225","#BEA82E","#C5AD37","#CBB341","#D2B84D","#D9BF5B","#DEC567","#E4CA73","#E9D07E","#EFD58A","#F5DB97","#FAE0A3","#FFE5AD"],categorical:["#003B47","#FFE5AD","#61790B","#B4A022","#245231","#406420","#898900","#DDC464","#0F443E","#EFD58A","#CAB23F","#194A38","#748401","#506E16","#9E9108","#315A29","#083F43","#A99815","#948C01","#6A7F05","#BFA930","#7F8700","#14473B","#1E4E35","#F7DD9C","#2A562D","#043D45","#597411","#E6CC77","#385F25","#48691B","#D4BB51","#0B4241","#8F8A00","#44661E","#1B4C37","#547113","#6F8203","#12463D","#998E03","#27542F","#4C6B18","#A4940E","#2E582B","#355C27","#B9A529","#215033","#EAD181","#FBE1A5","#C5AD37","#3C6122","#848800","#063E44","#E2C86E","#D9BF5B","#CFB648","#16493A","#798600","#023C46","#667C08","#5D770E","#0D433F","#AE9C1B","#F3D993","#094042","#A69611","#8C8A00","#053E45","#0C4240","#365E26","#6D8004","#9C8F05","#4A6A1A","#D6BD56","#B19E1F","#F9DFA0","#647B0A","#2F592A","#10453D","#818800","#C7AF3B","#46681C","#0E443F","#265330","#174A39","#335B28","#5B750F","#778501","#5F780D","#E8CF7C","#718302","#F1D78E","#978D02","#F5DB97","#204F34","#AC9A18","#29552E","#A1920B","#B7A225","#033C46"]},bamo:{discrete:ze,categorical:ze},batlow:{discrete:["#011959","#06215B","#0A285C","#0D315D","#0E375E","#103D5F","#114260","#124761","#144D62","#165162","#195662","#1C5A62","#205E61","#26635F","#2C665D","#33695A","#3A6C57","#416F53","#4A724E","#52744A","#5A7745","#627941","#6A7B3D","#747E38","#7D8134","#868330","#8F862D","#9B892B","#A58B2C","#AF8D2E","#B98F32","#C29037","#CD923F","#D69446","#DE964F","#E69858","#ED9A62","#F39E70","#F8A17B","#FAA587","#FCA993","#FDAC9E","#FDB1AB","#FDB4B6","#FDB8C0","#FDBCCB","#FCBFD6","#FCC4E3","#FBC8EF","#FACCFA"],categorical:["#011959","#FACCFA","#828231","#226061","#F29D6D","#4D734D","#114360","#C09036","#FDB4B4","#DD954D","#356A59","#FCBFD6","#175262","#677B3E","#A18A2B","#0D315D","#FCA890","#FBC6E8","#2B655E","#B18D2F","#5A7745","#FDAEA2","#CF9340","#0F3B5F","#E9995C","#FDBAC4","#416F53","#91862D","#1B5962","#08255B","#747E38","#134B61","#F9A380","#8A842F","#0E365E","#124761","#154F62","#E39754","#7B8034","#1E5D62","#99882C","#195662","#0B2B5C","#FDB7BC","#C8913B","#FCC3DF","#EE9B64","#A98C2C","#FDB1AB","#FDBCCD","#FBC9F1","#051F5A","#F6A077","#607942","#FDAB9A","#477150","#3B6D56","#B98F32","#26635F","#537549","#D69446","#6D7C3B","#30685C","#103F60","#FBA689","#BD8F34","#CB923E","#EB9A60","#FDB8C0","#FBC7EC","#F09C69","#8E852E","#FDBBC9","#7F8133","#031C5A","#114160","#FDAC9E","#5D7844","#FCA995","#185462","#787F36","#A58B2C","#0A285C","#9D892B","#33695A","#0D335E","#637A40","#165062","#124561","#205E61","#144D62","#1D5B62","#0C2E5D","#D9954A","#3E6E55","#AD8C2D","#F49F72","#868330","#B58E30","#577647"]},batlowk:{discrete:["#04050A","#0A0D15","#0F141E","#121B29","#152233","#18293D","#1C3146","#21384F","#274156","#2C485B","#314E5E","#36535F","#3B575F","#405C5E","#445F5D","#49625B","#4D6558","#526756","#586B52","#5E6E4F","#63724B","#6A7548","#717845","#797D41","#81813E","#8A853B","#938839","#9F8D38","#A99139","#B3943B","#BE973E","#C89A43","#D39D4C","#DB9F54","#E2A15D","#E8A366","#EEA570","#F3A77C","#F6A986","#F8AC91","#FAAE9A","#FCB1A4","#FDB4B0","#FDB7B9","#FDBAC3","#FDBDCD","#FDC1D8","#FCC5E4","#FBC8EF","#FACCFA"],categorical:["#04050A","#FDC0D6","#787C41","#38555F","#E5A160","#536855","#AF933A","#FAAE9A","#1A2E43","#FDB6B7","#294458","#455F5C","#63724B","#CD9B47","#91883A","#F3A77E","#111A27","#F7AB8D","#FDBBC5","#FCB2AA","#D99E52","#A18E38","#4C6459","#21384F","#3F5B5E","#152335","#0C1019","#EEA570","#5B6D50","#6C7647","#314E5E","#85823D","#BE973E","#7E7F3F","#FBB0A2","#49625B","#576A53","#0F151F","#2D495B","#DFA059","#727944","#FDBDCD","#253E54","#EAA368","#C69942","#3C585F","#998B38","#677449","#F1A678","#F9AC92","#141F2F","#1D3248","#506657","#090C13","#A99139","#5F6F4E","#35525F","#435D5D","#FDB8BD","#F5A984","#B5953B","#FDB5B2","#17273B","#D39D4C","#8C853B","#9D8C38","#415C5E","#1F354B","#33505E","#FCB1A6","#101723","#3E595F","#121C2B","#757B43","#06080F","#FCB3AE","#3A565F","#274156","#61704D","#88843C","#2B475A","#FDBED1","#6A7548","#596C51","#192B3F","#6F7845","#233B51","#C99A45","#F0A574","#DC9F55","#2F4B5D","#47615C","#F6AA88","#FDB9C1","#C29840","#4A635A","#FAAD96","#81813E","#7B7E40","#E7A264"]},batloww:{discrete:["#011959","#06215B","#0A285C","#0D315D","#0E375E","#103D5F","#114260","#124761","#144C62","#165062","#185562","#1B5962","#1F5D62","#246261","#2A665F","#30695D","#366C5A","#3D7056","#467352","#4E764E","#56794A","#5E7C46","#667F42","#70823D","#798539","#828936","#8C8C33","#989032","#A29433","#AD9738","#B79B3F","#C19E48","#CBA154","#D3A45E","#D9A669","#DFA872","#E4AA7C","#E9AC88","#EEAF91","#F2B39C","#F6B9A8","#F9C0B5","#FCCAC4","#FED3CF","#FFDBDA","#FFE3E2","#FFEAEA","#FFF2F2","#FFF8F8","#FFFEFE"],categorical:["#FFFEFE","#011959","#7E8737","#205F61","#E7AB84","#497451","#114360","#FED1CD","#BF9D46","#637E44","#9E9233","#FFEAEA","#0D315D","#326B5C","#F5B7A6","#165162","#D7A564","#0F3B5F","#1A5862","#3D7056","#FFF5F5","#FFDFDD","#FAC3BA","#134A61","#08255B","#70823D","#EEB094","#56794A","#E0A874","#8E8D33","#28655F","#AF9839","#CBA154","#EBAD8B","#1D5C62","#051F5A","#124761","#FFE5E4","#B79B3F","#A79535","#386D59","#5C7B47","#185562","#DBA76D","#F8BDAF","#FFF0F0","#246261","#F2B39C","#868A35","#4F774D","#E4AA7C","#2D685E","#77853A","#FED8D6","#103F60","#FFFAF9","#968F32","#D1A35C","#144E62","#FCCAC4","#437254","#698040","#0E365E","#0B2B5C","#C59F4C","#30695D","#1C5A62","#A29433","#407155","#FFDBDA","#0C2E5D","#F7BAAA","#E5AB80","#175362","#828936","#1F5D62","#BB9C42","#E9AC88","#FFF7F7","#3A6E58","#9A9132","#8A8B34","#4C754F","#FFEDED","#D9A669","#144C62","#266460","#FDCDC9","#FCC6BF","#FFE2E1","#FFFCFC","#7B8639","#2B675E","#155062","#5F7C45","#F9C0B5","#356C5A","#F3B5A1","#EDAF8F","#FED5D2"]},berlin:{discrete:He,categorical:He},bilbao:{discrete:["#4C0001","#54070B","#5B0E13","#64161A","#6B1D20","#712227","#77282D","#7D2E34","#84343B","#8A3A41","#8F4047","#94464B","#984C4F","#9B5253","#9D5754","#9E5C56","#A06057","#A16458","#A26959","#A36D5A","#A4715B","#A5745B","#A6785C","#A77C5D","#A8805E","#A9845F","#AA875F","#AC8C60","#AD9061","#AE9463","#AF9864","#B19D68","#B3A36E","#B6A975","#B8AD7E","#BBB287","#BDB590","#C0B99A","#C2BCA3","#C4BFAA","#C6C2B2","#C8C5B9","#CBCAC1","#CFCEC9","#D5D4D1","#DBDBDA","#E3E3E2","#EDEDED","#F6F6F6","#FFFFFF"],categorical:["#4C0001","#F8F8F8","#A9815E","#984D50","#BEB794","#AF9965","#CCCAC3","#78292F","#A26A59","#9F5D56","#64161A","#B6AA77","#C4C0AC","#A6765C","#8A3A41","#AC8C60","#DDDDDB","#A16358","#C7C5B7","#B3A16B","#A4705A","#6E2024","#EAEAE9","#92434A","#BAB185","#9C5554","#AD9262","#580B10","#813137","#C1BCA1","#AA865F","#D2D2CE","#A77C5D","#D7D7D4","#BCB48D","#B4A571","#C0B99A","#9E5955","#AB8960","#A6795C","#A36D5A","#8E3F46","#85353C","#A16758","#732529","#CAC7BD","#F1F1F0","#520509","#AC8F61","#5E1115","#C6C2B2","#E3E3E2","#691B1F","#B8AD7E","#95484D","#AE9663","#B19D68","#A5735B","#A06057","#9A5152","#A87E5D","#7D2E34","#A9835E","#C3BEA6","#CFCEC9","#A46E5A","#F4F4F4","#DADAD8","#B29F69","#EDEDED","#BBB289","#9D5754","#AF9764","#904148","#994F51","#B3A36E","#A87F5E","#A26859","#AC8D61","#BDB590","#AA875F","#A77A5D","#AB8A60","#A4715B","#611418","#BFB897","#E6E6E6","#9B5353","#D5D4D1","#974A4F","#C8C6BA","#A16558","#9F5E56","#76272C","#67191D","#8C3C43","#B9AF82","#C3BFA9","#B5A874","#4F0205"]},broc:{discrete:Oe,categorical:Oe},broco:{discrete:We,categorical:We},buda:{discrete:["#B301B3","#B30BAE","#B314AA","#B31CA6","#B323A2","#B3289F","#B32E9D","#B4339A","#B53998","#B63E96","#B84394","#B94892","#BB4C91","#BD528F","#BE568D","#C05B8C","#C15F8A","#C36389","#C46987","#C66D86","#C77184","#C97583","#CA7982","#CB7E80","#CD837F","#CE877E","#CF8B7D","#D0917B","#D1957A","#D29979","#D49E78","#D5A277","#D6A776","#D7AC75","#D8B073","#D9B572","#DAB971","#DCBF70","#DDC36F","#DEC86E","#DFCC6C","#E0D16B","#E2D76A","#E4DC69","#E6E168","#E9E667","#EDEC67","#F3F366","#F9F966","#FFFF66"],categorical:["#B301B3","#FFFF66","#CD857E","#BC4E90","#DBBD70","#C56A87","#B32F9C","#E3DB69","#D4A177","#EDEC67","#D1937B","#B73F95","#C05C8B","#DFCB6D","#C97882","#B31CA6","#D8AE74","#E7E368","#DAB572","#B311AC","#D39A79","#C36389","#C77184","#B53798","#E1D36B","#BE558E","#B94793","#CB7E80","#CF8C7C","#DDC46E","#B326A0","#F6F566","#D6A875","#DAB971","#C66E86","#E2D76A","#B32B9E","#B317A9","#B4339A","#BA4B91","#C46788","#C2608A","#B309AF","#D49E78","#B63B97","#BD528F","#DCC06F","#EAE767","#FAFA66","#D2977A","#F1F066","#D0907C","#CE897D","#C87483","#CC827F","#D5A576","#B321A3","#E5DF68","#B84394","#D9B273","#E0CF6C","#CA7B81","#DEC86E","#BF598C","#D7AB75","#E6E168","#D1957A","#CC8080","#D39C78","#E0CD6C","#CD847F","#B63D96","#C87384","#C66C86","#F8F866","#D49F78","#D9B473","#DAB772","#BF578D","#CB7D81","#CF8A7D","#B32D9D","#D08E7C","#DBBB71","#C2628A","#E2D56A","#DCBF70","#BC508F","#C46987","#C05B8C","#DFCA6D","#DDC26F","#C15E8B","#D7AD74","#F3F366","#DEC66E","#D5A377","#B31AA7","#BA4992","#CE877E"]},bukavu:{discrete:Ie,categorical:Ie},cork:{discrete:Ve,categorical:Ve},corko:{discrete:qe,categorical:qe},davos:{discrete:["#00054A","#010E51","#041459","#081C61","#0C2368","#102A6F","#133075","#17377C","#1C3F83","#204588","#244C8D","#295291","#2D5895","#335F98","#38649A","#3C699C","#416E9D","#46729D","#4C779D","#517B9C","#567F9B","#5A829A","#5F8598","#658996","#698C94","#6E8F92","#739290","#78968D","#7D998C","#829D8A","#88A089","#8DA488","#95AA87","#9BAF88","#A3B489","#ABBB8C","#B4C190","#BFCA96","#C9D29E","#D2D9A6","#DBE0AF","#E3E7B8","#EBEDC4","#F0F1CD","#F4F4D6","#F7F7DE","#FAF9E6","#FCFCF0","#FDFDF7","#FEFEFE"],categorical:["#00054A","#FDFDF4","#688B94","#2D5895","#B2C08F","#E8EBC0","#87A089","#133075","#4B769D","#5A829A","#204588","#76958E","#D0D8A4","#99AD88","#F6F6DB","#3C699C","#081C61","#031256","#1A3B7F","#537C9C","#A4B68A","#C1CC98","#7E9A8B","#FAFAE8","#356199","#0E266B","#DEE3B3","#274F90","#6F9091","#618697","#8FA588","#F0F1CD","#43709D","#1D4084","#47739D","#F3F4D4","#658996","#567F9B","#17367A","#FCFBEE","#4F799D","#C9D29E","#93A987","#39659B","#D8DEAB","#ABBB8C","#739290","#B9C693","#F8F8E1","#234A8C","#112B70","#7A978D","#9EB188","#315C97","#829D8A","#05175B","#010C50","#3F6C9D","#0B2065","#5D8499","#2A5392","#8BA388","#6B8D93","#EDEFC7","#E3E7B8","#22488A","#638897","#122E73","#00094D","#AEBD8D","#4D789D","#CDD5A1","#5F8598","#58819A","#071A5E","#0C2368","#18387D","#91A787","#37639A","#EBEDC4","#F2F2D0","#FBFBEB","#74938F","#2F5A96","#335F98","#809B8B","#BDC995","#49759D","#719191","#9BAF88","#F7F7DE","#1B3E82","#A8B88B","#849E89","#557E9B","#E6E9BC","#45719D","#1E4386","#96AB87","#89A188"]},devon:{discrete:["#2C1A4C","#2B1E51","#2B2356","#2A295B","#2A2D60","#293265","#29376A","#283B6E","#274174","#27467A","#274C7F","#275186","#28568C","#2A5C95","#2D609C","#3064A3","#3468AA","#396BB1","#3F70B9","#4774C0","#4F79C6","#597DCC","#6382D1","#6F88D7","#798CDB","#8290DF","#8C95E2","#969AE6","#9E9EE9","#A6A3EB","#ACA7ED","#B1ACEF","#B7B1F0","#BBB5F1","#BFB9F2","#C3BEF3","#C7C2F4","#CCC7F4","#D0CCF5","#D4D0F6","#D8D4F7","#DCD9F8","#E1DEF9","#E5E3FA","#E9E7FB","#EDECFB","#F2F0FC","#F7F6FD","#FBFAFE","#FFFFFF"],categorical:["#2C1A4C","#F8F8FE","#758AD9","#C6C0F3","#28568C","#29376A","#AAA5ED","#DEDCF8","#3D6EB7","#EBE9FB","#9197E4","#3063A2","#274579","#577CCB","#D2CEF6","#2A285A","#BAB3F1","#B2ADEF","#F2F0FC","#274E82","#2A2F62","#CCC7F4","#9E9EE9","#4875C1","#C0BAF2","#2B5D98","#3669AD","#2B2154","#E4E2FA","#8290DF","#D8D4F7","#6784D3","#283E71","#C9C4F4","#BDB7F1","#DBD8F8","#283A6D","#4F79C6","#A4A2EB","#EEEDFC","#CFCBF5","#E8E5FA","#5F80CF","#4272BC","#B6B0F0","#2B1D50","#AEA9EE","#275287","#2A2B5E","#989BE7","#293366","#27497D","#8A94E1","#295A92","#3266A7","#F5F4FD","#7B8DDC","#274174","#2D609C","#2B2558","#6F88D7","#E1DEF9","#3A6CB2","#D5D1F6","#C3BEF3","#2E629F","#3165A4","#8D95E3","#3468AA","#DAD6F7","#D1CDF5","#9B9CE8","#275084","#B8B2F0","#27477B","#6382D1","#4573BF","#A2A0EA","#F7F6FD","#C7C2F4","#F3F2FD","#274376","#8692E0","#2B1F52","#CAC6F4","#ACA7ED","#E3E0F9","#F0EEFC","#E6E4FA","#386AB0","#2C1C4E","#6B86D5","#28396B","#283C6F","#2A5C95","#2A2D60","#BEB9F2","#C2BCF2","#7E8FDD","#3F70B9"]},fes:{discrete:Ge,categorical:Ge},glasgow:{discrete:["#361338","#3B1434","#401530","#45172C","#491828","#4D1924","#511B21","#561C1D","#5B1E18","#602014","#662210","#6B260B","#6F2B07","#723203","#743802","#743E01","#754300","#744900","#744F01","#745402","#735905","#725F0B","#716413","#70691E","#6E6E27","#6C7231","#6B763A","#697B46","#677F4F","#658359","#648763","#628B6C","#618F78","#609381","#60978A","#619B94","#659F9D","#6CA5A8","#74A9B0","#7DADB8","#86B1BF","#8EB4C6","#99B9CE","#A1BCD5","#AABFDB","#B2C3E1","#BBC6E7","#C6CBF0","#D0CFF7","#DBD3FF"],categorical:["#361338","#DBD3FF","#6D702B","#69A3A5","#702D06","#A0BBD3","#638968","#521B20","#745101","#84B0BE","#754001","#5F9587","#BBC6E7","#612013","#45172C","#687D4A","#726210","#618F78","#4B1926","#3E1532","#629C96","#658359","#CACCF3","#76AAB2","#6B763A","#744900","#6A250C","#ADC1DD","#735905","#92B6C9","#591D1A","#743702","#70681C","#4F1A23","#754400","#6D2909","#60998E","#41162F","#744D00","#745503","#B4C3E2","#697A42","#7DADB8","#628C70","#8BB3C3","#561C1D","#D2D0F9","#99B9CE","#3A1435","#6F6C23","#743B01","#60927F","#662210","#648661","#659F9D","#678051","#725E0A","#481829","#6FA6AB","#6C7332","#5D1E17","#A6BED8","#C2C9ED","#723203","#716617","#68240E","#6F6A20","#C6CBF0","#79ABB5","#72600D","#754200","#43162D","#67A1A1","#6B7536","#5F1F15","#735B07","#571C1B","#72A8AF","#744F01","#BEC8EA","#381337","#8EB4C6","#628B6C","#677E4D","#60917B","#639E9A","#4A1827","#A3BDD6","#3C1433","#743901","#632112","#B7C5E5","#4D1924","#65845D","#618E74","#609483","#9CBAD1","#46172A","#87B1C1","#6D712F"]},grayc:{discrete:["#000000","#090909","#111111","#171717","#1C1C1C","#212121","#252525","#2A2A2A","#303030","#343434","#393939","#3D3D3D","#424242","#474747","#4B4B4B","#505050","#545454","#585858","#5D5D5D","#616161","#656565","#696969","#6D6D6D","#717171","#757575","#797979","#7D7D7D","#818181","#858585","#898989","#8E8E8E","#929292","#979797","#9C9C9C","#A1A1A1","#A6A6A6","#ABABAB","#B1B1B1","#B6B6B6","#BCBCBC","#C1C1C1","#C7C7C7","#CECECE","#D5D5D5","#DBDBDB","#E2E2E2","#E8E8E8","#F1F1F1","#F8F8F8","#FFFFFF"],categorical:["#070707","#F9F9F9","#777777","#454545","#AEAEAE","#909090","#292929","#5F5F5F","#D1D1D1","#9E9E9E","#525252","#E4E4E4","#6C6C6C","#BFBFBF","#1A1A1A","#373737","#848484","#595959","#222222","#B6B6B6","#A6A6A6","#3E3E3E","#7D7D7D","#666666","#969696","#8A8A8A","#4B4B4B","#DADADA","#C8C8C8","#313131","#717171","#131313","#EFEFEF","#C4C4C4","#A2A2A2","#424242","#878787","#252525","#2D2D2D","#4F4F4F","#3B3B3B","#808080","#1E1E1E","#BBBBBB","#AAAAAA","#EAEAEA","#696969","#7A7A7A","#DFDFDF","#636363","#565656","#B2B2B2","#0E0E0E","#9A9A9A","#5C5C5C","#747474","#F3F3F3","#333333","#6E6E6E","#D5D5D5","#8D8D8D","#939393","#494949","#CCCCCC","#171717","#BDBDBD","#575757","#C1C1C1","#404040","#828282","#E2E2E2","#151515","#1C1C1C","#0B0B0B","#9C9C9C","#858585","#2F2F2F","#B4B4B4","#888888","#242424","#272727","#3C3C3C","#B0B0B0","#353535","#545454","#5B5B5B","#393939","#D7D7D7","#A4A4A4","#A8A8A8","#959595","#767676","#646464","#989898","#444444","#474747","#111111","#F6F6F6","#ECECEC","#4D4D4D"]},hawaii:{discrete:["#8C0273","#8E0D6E","#8F1569","#901D63","#91235F","#91285A","#922D56","#933252","#94384D","#943D4A","#954246","#964742","#964C3F","#97523B","#985638","#985C34","#996131","#9A662E","#9B6C2A","#9B7226","#9C7823","#9C7E20","#9D841E","#9D8C1C","#9C921C","#9B991D","#9AA021","#97A828","#94AE30","#91B439","#8CB942","#88BE4C","#82C359","#7EC663","#79CA6E","#74CE79","#70D183","#6AD591","#66D89C","#62DCA7","#60DFB2","#5FE2BD","#61E6CA","#67E9D5","#6FEBDE","#7AEEE7","#87EFEE","#98F1F5","#A6F1F9","#B3F2FD"],categorical:["#8C0273","#B3F2FD","#9C951C","#6CD48C","#964D3E","#8ABC48","#9B6D29","#66E8D3","#922E55","#9C801F","#87EFEE","#995D34","#7BC969","#901D63","#60DEB0","#96AA2B","#943D4A","#975439","#82C359","#5FE4C2","#9AA021","#73CE7B","#65D99E","#954544","#9D8A1C","#8E126B","#91B439","#9DF1F7","#73ECE2","#91265C","#9C7724","#9A652E","#93364F","#922A59","#996131","#9D851D","#9D901C","#9A692C","#68D695","#902160","#9B9A1E","#985836","#9B7226","#933252","#77CC72","#9C7B21","#954147","#8D0A6F","#93AF32","#62DCA7","#92F0F3","#8F1867","#7DEEE8","#97513C","#6CEBDB","#61E6CA","#A8F2FA","#964941","#7FC661","#86BF50","#98A526","#70D183","#5FE1B9","#8DB840","#94394D","#9C7923","#8F1569","#985A35","#60E0B4","#9A6B2A","#91245E","#97A828","#9B7425","#6AD591","#95AD2E","#5FE2BD","#60E5C6","#953F48","#933054","#63E7CF","#84C154","#8D0671","#82EFEB","#9B9D1F","#99A323","#88BE4C","#6ED288","#6FEBDE","#9A672D","#91285A","#75CD76","#995F32","#68E9D7","#9B7028","#61DDAB","#943B4B","#933450","#8DF0F0","#8F1A65","#81C45D"]},imola:{discrete:["#1A33B3","#1C37B1","#1E3AAF","#203EAD","#2242AB","#2345AA","#2548A8","#274CA6","#2950A4","#2A53A3","#2C56A1","#2E599F","#2F5D9E","#32609B","#346499","#366797","#386A95","#3B6C92","#3E708F","#41738C","#44768A","#467987","#4A7C85","#4E8082","#518480","#56887E","#5A8C7D","#5F927B","#64967A","#689B79","#6DA078","#72A576","#78AB75","#7DB074","#82B572","#87BA71","#8CBF70","#93C66E","#98CB6D","#9ED06C","#A4D66A","#ACDB69","#B5E268","#BFE767","#C8EB67","#D3F066","#DDF466","#EAF866","#F5FB66","#FFFF66"],categorical:["#1A33B3","#FFFF66","#54867F","#305E9D","#91C36F","#3F718E","#2549A8","#BDE667","#70A377","#2B53A2","#376896","#80B373","#A3D56B","#DDF466","#203EAD","#487B86","#62947A","#2D59A0","#88BB71","#5B8D7D","#CDED66","#4E8082","#EEF966","#33639A","#284EA5","#44768A","#2344AA","#AFDE69","#3B6C92","#78AB75","#1D39B0","#99CC6D","#699C79","#3D6F90","#2C56A1","#2F5B9E","#5E917B","#4B7D84","#9ED06C","#1F3CAE","#C4EA67","#84B772","#274CA6","#D5F066","#2951A4","#74A776","#578A7E","#2446A9","#1C36B1","#A9D96A","#95C86E","#467888","#2141AC","#7CAF74","#356598","#B5E268","#66987A","#396A94","#F7FC66","#8CBF70","#E6F666","#32609B","#518380","#41738C","#6DA078","#6B9E78","#B9E468","#7AAD74","#528580","#32629B","#86B971","#3C6E91","#5C8F7C","#C8EB67","#ACDB69","#D1EF66","#E2F566","#97CA6D","#1B35B2","#1C37B0","#2345AA","#2F5D9E","#1F3DAE","#457789","#3A6B93","#598B7D","#D9F266","#346499","#386995","#A6D76A","#366797","#274DA6","#56887E","#A1D36B","#42748B","#7EB173","#72A576","#477987","#4C7F83","#F2FB66"]},lajolla:{discrete:["#191900","#1E1B02","#221C05","#271E08","#2C200B","#31220E","#362411","#3C2614","#442817","#4B2B1B","#532D1F","#5B3023","#633328","#6E362D","#783932","#813C37","#8B3F3B","#96423F","#A24543","#AD4746","#B74A48","#C04D49","#C9514B","#D1564C","#D75C4D","#DB634E","#DD694F","#E0714F","#E17750","#E37D50","#E48351","#E58951","#E79052","#E89652","#E99C52","#EAA253","#EBA853","#EDAF54","#EEB555","#F0BC57","#F1C25A","#F3CA5F","#F5D369","#F7DA74","#F9E282","#FBE890","#FCEF9F","#FDF5B0","#FEFABE","#FFFECB"],categorical:["#191900","#FFFECB","#D85F4D","#ECAC54","#653329","#F7D971","#A44544","#E58751","#362411","#E1744F","#C44E4A","#E99A52","#4B2B1B","#833D38","#F1C159","#FCEF9F","#271E08","#FEF7B6","#402716","#D0554C","#FAE587","#E79052","#EFB655","#B54947","#201C04","#E37D50","#743830","#DD694F","#EBA353","#94413E","#572F21","#F4CD61","#2E210C","#FDF3AB","#32220F","#241D06","#F5D369","#7B3B34","#1D1B02","#F0BC57","#5E3125","#F8DF7C","#512D1E","#CA514B","#E48251","#E68C51","#EA9E53","#E89552","#BC4C49","#6C362C","#EDB154","#9C4341","#E27950","#FBEA93","#3B2513","#FEFBC0","#452918","#EBA853","#F2C75C","#8B3F3B","#DB644E","#AD4746","#DF6E4F","#D55A4D","#2B200A","#783932","#E79352","#D75C4D","#FEF9BB","#EDAF54","#E0714F","#7F3C36","#613227","#F7DC77","#C7504B","#F1C45A","#30210D","#F4D065","#1E1B03","#FAE78D","#F9E282","#DA614E","#392412","#4E2C1D","#E99C52","#EFB956","#221C05","#EBA553","#FDF5B0","#984240","#E38050","#8F403D","#542E20","#ECAA54","#E68E51","#70372E","#DE6C4F","#B94A48","#291F09","#1B1A01"]},lapaz:{discrete:["#1A0C64","#1C1368","#1E196D","#202071","#212675","#222B79","#23317D","#253681","#263C85","#274189","#29478C","#2A4C8F","#2C5192","#2E5795","#305C98","#32609A","#35659C","#386A9E","#3C70A0","#3F74A1","#4379A2","#487DA3","#4D81A3","#5386A4","#588AA3","#5E8EA3","#6591A2","#6C95A1","#7398A0","#7A9A9E","#809D9D","#879F9B","#90A199","#97A397","#9EA596","#A5A795","#ADAA95","#B7AD96","#BFB199","#C8B69C","#D2BBA2","#DAC1A8","#E4C9B2","#EBCFBB","#F1D5C4","#F5DBCD","#F9E1D6","#FBE8E1","#FDEDEA","#FEF2F3"],categorical:["#1A0C64","#FEF2F3","#5B8BA3","#B3AC96","#2C5292","#3C70A0","#EACEB9","#859E9C","#24327E","#6F96A1","#33619A","#202071","#D0BAA0","#9BA496","#F9E1D6","#4A7FA3","#284289","#90A199","#FCEAE5","#1D176B","#37699D","#F3D8C8","#A7A895","#5285A4","#7A9A9E","#2F5A97","#4278A2","#263A84","#6591A2","#C1B299","#DEC3AB","#222978","#2A4B8E","#5688A4","#D7BEA6","#FDEEEC","#608EA3","#EFD3C0","#A1A696","#6A94A1","#FBE6DD","#ADAA95","#F6DDCF","#4E82A3","#2E5695","#3A6D9F","#C8B69C","#1C1268","#232D7B","#3F74A1","#467BA3","#1E1C6E","#7F9C9D","#BAAF97","#253681","#315E99","#29478C","#E4C9B2","#74989F","#273E87","#212575","#95A398","#8AA09A","#35659C","#2B4F91","#23307C","#E7CBB5","#F1D5C4","#2B4D90","#202373","#588AA3","#D3BCA3","#5487A4","#447AA2","#6792A2","#24347F","#253882","#ECD0BD","#879F9B","#305C98","#E1C6AF","#1E196D","#5D8DA3","#AAA995","#386B9E","#487DA3","#77999F","#F7DFD3","#BEB098","#1F1E70","#325F99","#4176A2","#F4DACB","#4C80A3","#2D5494","#8DA099","#6C95A1","#FAE3DA","#FDECE8","#B7AD96"]},lipari:{discrete:["#031326","#05192F","#062038","#092844","#0C2E4D","#103557","#163C5F","#1E4368","#294B70","#345075","#3E5578","#47587A","#4F5B7B","#575C7A","#5D5D79","#635E78","#695E76","#6E5F75","#765F73","#7C6071","#826070","#89606E","#90616C","#98616A","#A06268","#A86266","#B06364","#BA6462","#C36660","#CB685F","#D46B5E","#DB705F","#E27760","#E77E63","#E98567","#EA8D6B","#EA946F","#E89C75","#E7A279","#E6A87E","#E5AF84","#E5B58A","#E6BD92","#E7C49A","#EACCA3","#EDD3AD","#F0DBB7","#F5E5C4","#F9EDCF","#FDF5DA"],categorical:["#031326","#FDF5DA","#A56267","#525B7A","#E99B74","#785F72","#DA6F5E","#183E61","#E7C398","#8D616D","#365176","#092844","#655E77","#E98466","#BF6561","#F0DBB7","#E5AD82","#B26364","#EBCFA7","#5C5D79","#061D35","#25486D","#0E3353","#EA906D","#98616A","#E37861","#E5B88C","#826070","#CD685F","#6E5F75","#45587A","#F6E8C9","#E7A37A","#615E78","#E77E63","#D46B5E","#9F6268","#E99570","#93616B","#87606E","#7D6071","#F3E1C0","#575C7A","#0B2D4B","#2D4D72","#E6A87E","#E9C99F","#FAEED1","#1E4368","#EA8A69","#B86462","#6A5E76","#AB6365","#735F74","#DF735F","#E5B287","#13385A","#05182D","#E6BD92","#3E5578","#EDD5AF","#07223C","#C6665F","#4C5A7A","#E8A077","#B56363","#FBF1D6","#A26267","#E6C095","#0A2A48","#F8EBCD","#EACCA3","#AE6364","#7A5F72","#635E78","#E98768","#041629","#715F74","#ECD2AB","#A86266","#8A606E","#96616B","#545C7A","#EFD8B3","#F5E5C4","#9B6169","#F2DEBB","#765F73","#6C5F75","#294B70","#22466B","#E89D76","#E88165","#BC6461","#E6A67C","#85606F","#C36660","#1B4064","#D06A5E","#103557"]},lisbon:{discrete:Xe,categorical:Xe},managua:{discrete:Ke,categorical:Ke},navia:{discrete:["#031327","#041930","#051E3A","#052546","#062B50","#06315A","#073764","#083E6D","#0B4578","#0E4C80","#115286","#15588B","#195E8E","#1E6491","#216991","#246D91","#27718F","#2A748E","#2D788C","#307A8A","#337D89","#368087","#398385","#3C8683","#3F8981","#428C7F","#468F7D","#4A937A","#4E9678","#529A76","#579E73","#5BA271","#62A86E","#67AD6B","#6EB269","#76B768","#7FBD68","#8CC56A","#98CB6F","#A4D176","#B1D67F","#BCDB89","#C9E096","#D3E3A1","#DCE7AC","#E3EAB6","#EAEDBF","#F1F0CA","#F7F2D2","#FCF4D9"],categorical:["#031327","#FCF4D9","#408A80","#87C269","#1B608F","#59A072","#073966","#D1E39F","#2F798B","#EAEDBF","#052546","#266F90","#6BB06A","#0E4D81","#AED57D","#4C947A","#378186","#DFE8B0","#337D89","#2A748E","#14578A","#051C36","#9ACC70","#0A4374","#468F7D","#529A76","#F4F1CD","#062F56","#C1DC8D","#206891","#78B968","#62A86E","#3C8583","#569D74","#236C91","#F8F3D3","#D8E5A8","#0C487B","#04182E","#71B469","#B8D985","#07345E","#05213E","#4F9778","#5DA470","#3E8882","#062A4E","#7FBD68","#EFEFC6","#C9E096","#115286","#2C768D","#1E6491","#49917B","#66AC6C","#28718F","#A4D176","#90C76C","#438C7F","#175C8D","#083E6D","#E5EAB8","#317B8A","#357F87","#398385","#B3D781","#0D4A7E","#1C6290","#052342","#579F73","#9FCE73","#448D7E","#051A32","#FAF3D6","#428B7F","#29738F","#104F84","#5FA66F","#509877","#8CC56A","#094071","#2D788C","#083B6A","#D5E4A3","#2B758D","#226A91","#04162B","#BCDB89","#47907C","#4D9579","#E2E9B4","#7BBB68","#6EB269","#135488","#4A937A","#F1F0CA","#5BA271","#C5DE92","#F6F2D0","#CDE19B"]},naviaw:{discrete:["#041427","#051A31","#05203B","#062747","#072D52","#08345C","#0A3A66","#0C416F","#0F4979","#135080","#175686","#1B5D8A","#1F628D","#23698F","#276D8F","#2A728F","#2D758E","#30798D","#347D8B","#378089","#3A8388","#3D8686","#408984","#448C82","#489080","#4B937E","#50977C","#559C79","#5AA077","#5FA575","#65AA73","#6CAF71","#76B671","#7FBD71","#89C474","#95CB78","#A2D27F","#B1D98A","#BEDF95","#C9E5A1","#D3E9AD","#DBEDB9","#E4F1C6","#E9F4D0","#EEF6D9","#F2F8E1","#F6FAE9","#F9FCF1","#FCFDF7","#FEFEFD"],categorical:["#041427","#FBFDF6","#478F80","#9FD07D","#1F628D","#64A973","#E3F0C4","#0A3A66","#337C8B","#C7E49E","#7DBC71","#549B7A","#2A718F","#135080","#F2F8E1","#3C8586","#062747","#D7EBB2","#418A83","#B4DB8C","#2E778D","#6FB271","#EBF5D4","#0E4574","#051D37","#4D957D","#256B8F","#195A88","#388189","#F7FAEC","#5CA276","#8CC574","#073056","#31798C","#367E8A","#69AD72","#E7F3CC","#104A7A","#95CB78","#EFF6DB","#0B406D","#2C748E","#4A927F","#DDEEBB","#50987C","#165584","#589E78","#76B671","#3F8785","#05192F","#BEDF95","#448C82","#22678E","#06223F","#A9D684","#08355E","#CFE8A8","#F9FCF1","#286E8F","#85C172","#072C50","#F5F9E7","#1C5F8B","#3A8387","#60A675","#F3F9E4","#0C4271","#266D8F","#81BE72","#0A3D6A","#4B937E","#9ACD7B","#EDF5D7","#90C876","#A4D381","#378089","#1B5D8A","#489080","#145282","#DAECB6","#67AB73","#CBE6A3","#B9DD90","#3D8686","#23698F","#6CAF71","#FAFCF3","#79B971","#D3E9AD","#5AA077","#458E81","#72B471","#327B8C","#E5F1C8","#051B33","#F8FBEE","#062443","#398288","#2B728F","#06294C"]},nuuk:{discrete:["#05598C","#0E5B8B","#155C89","#1C5E87","#226085","#276184","#2C6383","#326682","#386982","#3E6C82","#446F82","#4A7283","#517584","#587A86","#5F7D88","#66818A","#6C858C","#73898E","#7B8E91","#819192","#879594","#8D9996","#939C97","#99A097","#9EA498","#A2A798","#A6AA97","#ABAD96","#AEAF95","#B1B194","#B3B492","#B6B690","#B8B88E","#BABA8C","#BDBC8A","#BFBE88","#C1C187","#C4C385","#C7C684","#CAC983","#CDCD83","#D2D184","#D7D787","#DDDD8B","#E3E290","#E8E895","#EEEE9C","#F4F4A4","#F9F9AB","#FEFEB2"],categorical:["#05598C","#FEFEB2","#A1A698","#537785","#C3C385","#B5B591","#7D8F91","#2D6483","#DDDD8B","#919B96","#BCBC8B","#3F6C82","#CDCD83","#1C5E87","#ADAE95","#68838B","#EEEE9C","#A7AA97","#879594","#C8C783","#F6F6A7","#135C89","#B9B98E","#497183","#73898E","#366882","#C0BF88","#D4D486","#99A097","#B1B293","#5E7D88","#256185","#E6E693","#829293","#788C90","#9DA398","#AAAC96","#E1E18F","#3B6A82","#638089","#B3B492","#A4A897","#446F82","#BABA8C","#D8D888","#185D88","#8C9895","#215F86","#BEBD89","#B7B78F","#CACA83","#4E7484","#C1C186","#959E97","#F2F2A1","#AFB094","#326682","#587A86","#296284","#FAFAAD","#6E868C","#C5C584","#D1D084","#0D5B8B","#E9E997","#DFDF8D","#66818A","#B0B194","#5B7B87","#2B6383","#859493","#CCCB83","#F8F8AA","#D2D285","#1F5F86","#70878D","#4B7383","#768B8F","#FCFCAF","#A9AB97","#BFBE88","#C9C983","#346782","#DBDA89","#236085","#BDBD8A","#BAB98D","#B8B88E","#2F6583","#939C97","#9FA498","#A2A798","#CFCF84","#B4B591","#C4C485","#979F97","#F0F09E","#155C89","#9BA298","#517584"]},oleron:{discrete:Ye,categorical:Ye},oslo:{discrete:["#010101","#04070B","#060C13","#0A121B","#0C1620","#0D1927","#0E1D2D","#0F2133","#10263C","#112A43","#122E4A","#133251","#153758","#173C61","#194169","#1B4670","#1E4A78","#214F80","#255589","#295A91","#2E5F99","#3364A1","#3A6AA9","#4371B2","#4B77B9","#537DBE","#5B83C3","#6489C6","#6B8EC8","#7292C9","#7896C9","#7E9ACA","#859ECA","#8BA2C9","#91A6C9","#97A9C9","#9DADC9","#A4B2CA","#AAB6CA","#B1BBCB","#B8BFCD","#BFC5CF","#C7CCD3","#CFD2D8","#D7D9DD","#DEE0E2","#E6E7E9","#EFF0F1","#F7F7F8","#FFFFFF"],categorical:["#030609","#F9F9F9","#507BBC","#163B5E","#A0AFC9","#7B98CA","#27588E","#0E2032","#CACED5","#122D48","#3767A6","#1D4875","#8DA3C9","#E2E3E5","#678BC7","#B4BDCC","#0C151F","#BFC5CF","#97A9C9","#4371B2","#10263D","#080E16","#7292C9","#215081","#2E5F99","#AAB6CA","#ECEDEE","#0D1A28","#143454","#D5D8DC","#5B83C3","#19426A","#859ECA","#13314E","#0E1D2D","#3D6CAC","#6C8FC8","#7795C9","#F3F3F4","#4976B8","#245488","#DBDDE0","#112A43","#92A6C9","#C5C9D2","#809BCA","#0F2337","#3263A0","#050A10","#B9C1CD","#1F4C7B","#183E64","#A5B3CA","#0A121B","#9CACC9","#6187C5","#0D1824","#8AA1CA","#2A5B93","#547EBF","#D1D3D9","#E6E7E9","#1B456F","#B0BACB","#153758","#7494C9","#D8DADE","#6A8DC8","#90A5C9","#99ABC9","#235285","#133251","#060C13","#406EAF","#7E9ACA","#173C61","#4C78BA","#122F4B","#1C4772","#87A0CA","#CED1D7","#C2C7D1","#0F253A","#2C5D96","#C7CCD3","#112B45","#EFF0F1","#6F90C9","#0E1E2F","#ADB8CB","#7997CA","#4673B5","#15395B","#091018","#194067","#30619C","#94A8C9","#F6F6F6","#0F2135","#A3B1CA"]},roma:{discrete:Ue,categorical:Ue},romao:{discrete:Qe,categorical:Qe},tofino:{discrete:Ze,categorical:Ze},tokyo:{discrete:["#1C0E34","#241036","#2D1339","#37163D","#3F1A40","#481E43","#4F2345","#562948","#5D304A","#62354C","#663B4D","#69404E","#6B454F","#6D4B50","#6E4F50","#6F5251","#6F5651","#705951","#715C52","#715F52","#716252","#726452","#726753","#736B53","#736E53","#747153","#757554","#757A54","#767E55","#778355","#788856","#798E57","#7B9558","#7C9B5A","#7EA25C","#81A95E","#84B062","#88B968","#8DC16E","#93CA76","#9BD27F","#A4DA8A","#AFE398","#BAEAA4","#C5EFB0","#CFF4BB","#D8F7C5","#E2F9CF","#E9FBD7","#EFFCDD"],categorical:["#1C0E34","#EFFCDD","#747053","#6C4750","#87B666","#B8E8A1","#512446","#715D52","#798B56","#7D9F5B","#37163D","#726653","#99D07D","#63374C","#6F5451","#D8F7C5","#767C54","#705951","#5B2D49","#7B9558","#441D41","#291238","#E5FAD2","#C9F1B4","#716252","#81AA5F","#683F4E","#736B53","#6E4E50","#757654","#8EC370","#A7DD8E","#778455","#747354","#84B062","#231036","#93CA76","#DFF9CC","#30143A","#A0D785","#7FA45D","#EAFBD8","#6A434F","#C1EDAB","#736D53","#562948","#6D4B50","#7A9057","#7C9A59","#4B2044","#715F52","#663B4D","#D1F4BD","#705651","#8ABD6A","#6E5151","#AFE398","#5F324B","#757954","#3E193F","#726853","#726452","#778055","#705B52","#788756","#61344C","#746E53","#ABE093","#532747","#85B364","#7EA25C","#261137","#736C53","#E8FBD5","#4E2245","#88B968","#798E57","#767E55","#726753","#757754","#715E52","#3A183E","#6E4F51","#778255","#7B9759","#DCF8C9","#EDFCDA","#411B40","#7D9C5A","#767B54","#726352","#6F5551","#726552","#82AD60","#D5F6C1","#34153C","#9CD481","#747454","#C5EFB0","#481E43"]},turku:{discrete:["#000000","#090908","#111110","#181816","#1D1D1A","#22221F","#272723","#2C2C27","#33322B","#38382F","#3D3D32","#424235","#474738","#4E4D3C","#53523E","#585841","#5D5D43","#626246","#686848","#6E6D4B","#73724D","#797750","#7F7D52","#878356","#8E8859","#968E5C","#9D9360","#A79864","#AF9C68","#B69F6C","#BEA270","#C4A474","#CCA579","#D1A67D","#D7A781","#DBA886","#E0A98B","#E6AB92","#EAAD98","#EFB09F","#F2B4A7","#F6B9AE","#F9BFB7","#FBC4BF","#FDC9C6","#FECFCC","#FED4D3","#FFDBDA","#FFE0E0","#FFE6E6"],categorical:["#070707","#FFE6E6","#948D5B","#E5AA90","#4D4C3B","#2C2C27","#C3A374","#6D6C4A","#FBC4BF","#D6A780","#F2B4A7","#1C1C19","#3D3D32","#AC9A67","#7E7C52","#FED6D4","#5D5D43","#35342D","#DDA888","#141312","#55543F","#242420","#FDCDCA","#F7BCB3","#898456","#B8A06D","#ECAE9B","#CDA57A","#FFDEDD","#646447","#454537","#9F9461","#76744E","#71704C","#30302A","#414135","#181816","#FCC8C4","#EFB1A1","#838054","#F5B8AD","#E1A98C","#C8A477","#686848","#595941","#20201D","#8E8859","#D1A67D","#B29D6A","#E9AC95","#BEA270","#FED1CF","#0E0E0D","#A59764","#DAA784","#282823","#F9C0B9","#51503D","#393930","#FFDAD9","#49493A","#606045","#FFE2E1","#9A915E","#797750","#F4B6AA","#F6BAB0","#CBA578","#FFD8D6","#FECFCC","#262622","#C0A272","#868255","#1A1A18","#FAC2BC","#8B8658","#E3AA8E","#161614","#4F4E3C","#C6A475","#2E2E28","#BBA16F","#6B6A49","#E7AB93","#CFA67C","#626246","#53523E","#5B5B42","#FED3D1","#7C7A51","#817E53","#73724D","#FFDCDB","#37372E","#F8BEB6","#0B0B0A","#575740","#DFA98A","#474738","#B59F6C"]},vanimo:{discrete:Je,categorical:Je},vik:{discrete:et,categorical:et},viko:{discrete:tt,categorical:tt}};function at(e){const t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}const nt={waves:"batlow",blksand:"tokyo",breeze:"imola",magma:"batlow",ribbon:"hawaii",stars:"batlow",folds:"imola"},rt={[H.ADVERT]:1,[H.TXT_MSG]:4,[H.GRP_TXT]:2,[H.RESPONSE]:8,[H.REQ]:13,[H.ANON_REQ]:7,[H.ACK]:11,[H.PATH]:24,[H.TRACE]:16,[H.GRP_DATA]:34,[H.MULTIPART]:52,[H.RAW_CUSTOM]:14};function lt(){let e="waves",t=!0;if("undefined"!=typeof window){e=localStorage.getItem("pymc-color-scheme")||"waves";const s=z(e);t=(null==s?void 0:s.meta.isDark)??!0}const s=nt[e]??"batlow",a=st[s],n=a.discrete.length,r=Math.floor(n/2);return{colormap:a,colormapName:s,isDark:t,baseIndex:t?r:0,halfSize:r}}let it=null;function ot(e){const{colormap:t,isDark:s}=lt();if("number"!=typeof e)return s?"#A5A5A5":"#666666";const a=rt[e];if(void 0===a)return s?"#A5A5A5":"#666666";const n=t.categorical;return n[Math.min(a,n.length-1)]}function ct(e){return at(ot(e))}const dt="undefined"!=typeof window&&(null==(t=null==(e=window.matchMedia)?void 0:e.call(window,"(color-gamut: p3)"))?void 0:t.matches);function Ct(){const e=getComputedStyle(document.documentElement);return{fontFamily:e.getPropertyValue("--font-data").trim()||'"JetBrains Mono", ui-monospace, monospace',axisColor:e.getPropertyValue("--chart-axis-tick").trim()||"rgba(255, 255, 255, 0.4)",gridColor:e.getPropertyValue("--chart-grid").trim()||"rgba(255, 255, 255, 0.06)",textMuted:e.getPropertyValue("--text-muted").trim()||"#727272",textPrimary:e.getPropertyValue("--text-primary").trim()||"#FFFFFF"}}const At=["min","max","p75","p95","p99","mean","median","average","midpoint"];function mt(e){const t=at(function(e){const{colormap:t,baseIndex:s,halfSize:a}=lt(),n=Math.max(0,Math.min(1,e)),r=Math.min(s+Math.floor(n*(a-1)),t.discrete.length-1);return t.discrete[r]}(e)),s=`color(display-p3 ${(t.r/255).toFixed(3)} ${(t.g/255).toFixed(3)} ${(t.b/255).toFixed(3)})`;return{...t,p3:s}}function ut(e,t,s,a,n,r,l,i,o,c=null,d=null,C=1,A=null,m="airtime",u=.5){if(0===t.length)return;const D=e.ctx,{left:F,top:B,width:E,height:h}=e.bbox,x=window.devicePixelRatio||1;if(E<=0||h<=0)return;const p=e.data[0],g=p.length;if(0===g)return;const f=p[0],b=p[g-1],y=s,v="share"===m,j=v?function(e){const t=[10,20,25,50,100,200,250,500,1e3],s=e/4.5;for(const a of t)if(a>=s)return a;return e>5e3?1e3*Math.ceil(s/1e3):100*Math.ceil(s/100)}(y):5,N=getComputedStyle(document.documentElement),w=N.getPropertyValue("--signal-critical").trim()||"#EF4444",k=N.getPropertyValue("--bg-body").trim()||"#171717";D.save(),D.fillStyle="#000000";const M=8*x;D.beginPath(),D.roundRect(F,B,E,h,M),D.fill(),D.restore();const S=parseInt(k.slice(1,3),16)||23,T=parseInt(k.slice(3,5),16)||23,$=parseInt(k.slice(5,7),16)||23;if(!v&&y>=20){D.save();const e=B+h*(1-20/y);D.fillStyle=`rgba(${S}, ${T}, ${$}, 0.5)`,D.fillRect(F,B,E,e-B),D.restore()}D.save(),D.lineWidth=1*x,D.setLineDash([4*x,4*x]);for(let R=j;Rs+n)return;const i=getComputedStyle(document.documentElement).getPropertyValue("--text-primary").trim()||"#FFFFFF";e.save(),e.strokeStyle=i,e.globalAlpha=.5,e.lineWidth=1*l,e.setLineDash([4*l,4*l]),e.beginPath(),e.moveTo(Math.round(t)+.5,a),e.lineTo(Math.round(t)+.5,a+r),e.stroke(),e.restore()}(D,A,F,B,E,h,x),l){!function(e,t,s,a,n,r,l=null,i=null,o=1,c=25){const{points:d,rawValues:C,count:A,packetTypes:m,timestamps:u}=t,D=1*o*(window.devicePixelRatio||1);e.globalCompositeOperation="source-over";const F=l?parseInt(l.replace("TYPE_",""),10):null;for(let B=0;B=i.start&&e0&&function(e,t,s,a,n,r,l,i,o,c,d=.5){if(0===t.length)return;const C=o-i||1,A=function(e,t=1.3,s=.15){const a=function(e){const t=e.match(/color\(display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/);if(t){const e=parseFloat(t[1]),s=parseFloat(t[2]),a=parseFloat(t[3]);return{r:Math.round(255*e),g:Math.round(255*s),b:Math.round(255*a),p3r:e,p3g:s,p3b:a}}if(e.startsWith("#")){const t=e.replace("#",""),s=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16);return{r:s,g:a,b:n,p3r:s/255,p3g:a/255,p3b:n/255}}const s=e.match(/rgba?\(([\d.]+),?\s*([\d.]+),?\s*([\d.]+)/);if(s){const e=Math.round(parseFloat(s[1])),t=Math.round(parseFloat(s[2])),a=Math.round(parseFloat(s[3]));return{r:e,g:t,b:a,p3r:e/255,p3g:t/255,p3b:a/255}}return{r:255,g:255,b:255,p3r:1,p3g:1,p3b:1}}(e),n=function(e,t,s,a=1.25,n=.15){const r=(Math.max(e,t,s)+Math.min(e,t,s))/2;return{p3r:Math.min(1,r+(e-r)*a+n),p3g:Math.min(1,r+(t-r)*a+n),p3b:Math.min(1,r+(s-r)*a+n)}}(a.p3r,a.p3g,a.p3b,t,s);return{r:Math.round(255*Math.min(1,n.p3r)),g:Math.round(255*Math.min(1,n.p3g)),b:Math.round(255*Math.min(1,n.p3b)),p3r:Math.min(1,n.p3r),p3g:Math.min(1,n.p3g),p3b:Math.min(1,n.p3b)}}(getComputedStyle(document.documentElement).getPropertyValue("--signal-critical").trim()||"#EF4444");e.save(),e.globalAlpha=d,e.fillStyle=dt?`color(display-p3 ${A.p3r} ${A.p3g} ${A.p3b})`:`rgb(${A.r}, ${A.g}, ${A.b})`;for(const m of t){if(m.endTso)continue;const t=a+(Math.max(m.startTs,i)-i)/C*r,s=a+(Math.min(m.endTs,o)-i)/C*r,d=Math.max(s-t,2*c);e.fillRect(t,n,d,l)}e.restore()}(D,i,0,F,B,E,h,f,b,x,d?Math.max(.03,.03*u):u)}const Dt=r.memo(function({data:e,maxValue:t,visibleLines:s=At,highlightedLine:a=null,onHover:l,scatterData:i=null,noiseFloorAnomalies:o=null,showNoiseFloorOverlay:c=!1,overlayOpacity:d=.5,highlightedType:C=null,hoveredTimeRange:A=null,timeRangeHours:m=24,yAxisMode:u="airtime"}){const D=r.useRef(null),F=r.useRef(null),B=r.useRef(e),E=r.useRef(t),h=r.useRef(s),x=r.useRef(a),p=r.useRef(l),g=r.useRef(i),f=r.useRef(o),b=r.useRef(c),y=r.useRef(C),v=r.useRef(A),j=r.useRef(null),N=r.useRef(null),w=r.useRef(u),k=r.useRef(d),M=m<=12?1.2:1,S=r.useRef(M),T=r.useRef(e.length);r.useLayoutEffect(()=>{B.current=e,E.current=t,h.current=s,x.current=a,p.current=l,g.current=i,f.current=o,b.current=c,y.current=C,v.current=A,S.current=M,w.current=u,k.current=d}),r.useEffect(()=>{j.current=Ct()},[]);const $=r.useMemo(()=>[e.map(e=>e.timestamp),new Array(e.length).fill(1)],[e]),P=r.useMemo(()=>({hooks:{draw:e=>{const t=j.current||Ct();ut(e,B.current,E.current,h.current,x.current,t,g.current,f.current,b.current,y.current,v.current,S.current,N.current,w.current,k.current)}}}),[]),L=r.useMemo(()=>({width:400,height:200,padding:[8,0,8,28],cursor:{show:!1,x:!1,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],plugins:[P]}),[P]);r.useEffect(()=>{const t=D.current;if(!t||0===e.length)return;const s=T.current,a=e.length,n=Math.abs(a-s);if(!(!F.current||n>100||s>0&&n/s>.1)&&F.current)return F.current.setData($),void(T.current=a);F.current&&F.current.destroy();const r=t.getBoundingClientRect(),l=Math.floor(r.width)||400,i=Math.floor(r.height)||200,o=new R({...L,width:l,height:i},$,t);return F.current=o,T.current=a,()=>{o.destroy(),F.current=null}},[L,$,e.length]),r.useEffect(()=>{const e=D.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!F.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&F.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),r.useEffect(()=>{F.current&&F.current.redraw()},[a,s,e,i,o,c,d,C,A,M]);const _=r.useCallback(t=>{var s,a;const n=D.current,r=F.current;if(!n||!r||0===e.length)return;const l=n.getBoundingClientRect(),i=t.clientX-l.left,o=window.devicePixelRatio||1,c=r.bbox,d=c.left/o,C=c.width/o;if(id+C)return N.current=null,r.redraw(),void(null==(s=p.current)||s.call(p,null));N.current=i*o;const A=(i-d)/C,m=e.length,u=Math.floor(A*m),B=Math.max(0,Math.min(m-1,u));r.redraw(),null==(a=p.current)||a.call(p,B)},[e.length]),z=r.useCallback(()=>{var e;N.current=null,F.current&&F.current.redraw(),null==(e=p.current)||e.call(p,null)},[]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:D,className:"w-full h-full rounded-lg overflow-hidden",onMouseMove:_,onMouseLeave:z})}),Ft=function(e){const t=ot(e);return null===it&&(it=_()),it?L(t):t},Bt=new class{constructor(){a(this,"buckets",new Map),a(this,"lastProcessedTimestamp",0),a(this,"processedPacketCount",0),a(this,"cacheKey",null),a(this,"bucketDuration",60),a(this,"bucketDurationMs",6e4)}getBuckets(e,t,s,a){const n={startTs:t,endTs:s,radioConfigHash:this.hashRadioConfig(a)};return this.isCacheValid(n)?this.processPackets(e,t,s,a,!1):(this.invalidate(n),this.processPackets(e,t,s,a,!0)),this.toBucketDataArray(t,s)}processPackets(e,t,s,a,n){const r=Math.ceil((s-t)/this.bucketDuration);let l=0;for(const i of e){const e=i.timestamp;if(e=s)continue;if(!n&&e<=this.lastProcessedTimestamp)continue;const o=Math.min(Math.floor((e-t)/this.bucketDuration),r-1),c=this.buckets.get(o)??{total:0,totalAirtime:0};c.total+=1;const d=$(i);c.totalAirtime+=P(d,{spreadingFactor:a.sf,bandwidthHz:a.bw,codingRate:a.cr,preambleLength:a.preamble}),this.buckets.set(o,c),e>this.lastProcessedTimestamp&&(this.lastProcessedTimestamp=e),l++}this.processedPacketCount+=l}toBucketDataArray(e,t){const s=t-e,a=Math.ceil(s/this.bucketDuration),n=s/3600,r=[];for(let l=0;l24?s.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),i=this.buckets.get(l)??{total:0,totalAirtime:0};r.push({timestamp:t,time:a,total:i.total,totalAirtime:i.totalAirtime,bucketDurationMs:this.bucketDurationMs})}return r}isCacheValid(e){return!!this.cacheKey&&this.cacheKey.startTs===e.startTs&&this.cacheKey.endTs===e.endTs&&this.cacheKey.radioConfigHash===e.radioConfigHash}invalidate(e){this.buckets.clear(),this.lastProcessedTimestamp=0,this.processedPacketCount=0,this.cacheKey=e}hashRadioConfig(e){return`${e.sf}-${e.bw}-${e.cr}-${e.preamble}`}clear(){this.buckets.clear(),this.lastProcessedTimestamp=0,this.processedPacketCount=0,this.cacheKey=null}getStats(){return{bucketCount:this.buckets.size,processedPackets:this.processedPacketCount,lastTimestamp:this.lastProcessedTimestamp,cacheKey:this.cacheKey}}};function Et(e){return I[e]??`TYPE_${e.toString(16).toUpperCase()}`}const ht={sf:10,bw:25e4,cr:5,preamble:8};function xt(e,t){if(0===e.length)return[];const s=Math.floor((t-1)/2),a=[];for(let n=0;n=s?e[n-s]:e[0];a.push(e[n]+(e[n]-t))}return function(e,t){if(0===e.length)return[];const s=2/(t+1),a=[e[0]];for(let n=1;n{if(!l)return null;const e=new Map;for(const t of l.items)e.set(t.key,t.value);return e},[l]),o=null!==i;return n.jsx("div",{className:"flex-shrink-0 pt-3 mt-2",children:n.jsx("div",{className:"grid ml-9 gap-y-0.5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(105px, 1fr))"},onMouseLeave:()=>s(null),children:e.map(e=>{const r=Ft(e.typeNum),l=(null==i?void 0:i.get(e.key))??0,c=a.get(e.key)??0,d=o?l:c,C=d>1e-4,A=t===e.key,m=t&&t!==e.key;let u="legend-item";return A?u+=" legend-item-active":m?u+=" legend-item-dimmed":o&&l>1e-4?u+=" legend-item-chart-active":o&&l<=1e-4&&(u+=" legend-item-dimmed"),n.jsxs("div",{className:u,onMouseEnter:()=>s(e.key),children:[n.jsx("div",{className:"flex-shrink-0",style:{backgroundColor:r,width:9,height:16,borderRadius:1}}),n.jsx("span",{className:"legend-label",children:e.label}),C&&n.jsxs("span",{className:"legend-value "+(o?"legend-value-live":""),children:[(100*d).toFixed(1),"%"]})]},e.key)})})})}function gt({x:e,y:t,width:s,height:a,name:r,size:l,index:i,depth:o,hoveredIndex:c,onHover:d,total:C,typeNum:A}){if(1!==o)return null;const m=null!==c&&!(c===i),u=Ft(A),D=C>0?l/C*100:0,F=s>36&&a>20,B=s>36&&a>32;return n.jsxs("g",{onMouseEnter:e=>d(i,e),onMouseLeave:()=>d(null),style:{cursor:"default"},children:[n.jsx("rect",{x:e,y:t,width:s,height:a,fill:u,opacity:m?.4:1,stroke:"rgba(0,0,0,0.2)",strokeWidth:1,rx:3,style:{transition:"opacity 150ms ease"}}),F&&n.jsxs(n.Fragment,{children:[B&&n.jsxs("text",{x:e+4,y:t+a-4-11,textAnchor:"start",dominantBaseline:"auto",fill:"rgba(0,0,0,0.6)",fontSize:8,fontFamily:W,fontWeight:500,style:{pointerEvents:"none"},children:[D.toFixed(1),"%"]}),n.jsx("text",{x:e+4,y:t+a-4,textAnchor:"start",dominantBaseline:"auto",fill:"rgba(0,0,0,0.85)",fontSize:9,fontFamily:W,fontWeight:600,style:{pointerEvents:"none"},children:r})]})]})}function ft({data:e,total:t,color:s,position:a,containerWidth:r}){if(!e||!a)return null;const l=(e.value/t*100).toFixed(1),i=r-a.x<184?Math.max(8,a.x-160-8):a.x+16;return n.jsx("div",{className:"absolute z-50 pointer-events-none",style:{left:i,top:Math.max(8,a.y-60)},children:n.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 shadow-xl min-w-[140px]",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:s}}),n.jsx("span",{className:"type-data-sm font-semibold text-text-primary",children:e.name})]}),n.jsxs("div",{className:"space-y-0.5 type-data-xs text-text-muted",children:[n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Count"}),n.jsx("span",{className:"text-text-primary tabular-nums font-medium",children:e.value.toLocaleString()})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Share"}),n.jsxs("span",{className:"text-text-primary tabular-nums font-medium",children:[l,"%"]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Total"}),n.jsx("span",{className:"text-text-primary tabular-nums font-medium",children:t.toLocaleString()})]})]})]})})}function bt({sortedTypes:e,aggregateShares:t}){var s,a,l;const[i,o]=r.useState(null),[c,d]=r.useState(null),[C,A]=r.useState(0),[m,u]=r.useState(null),D=r.useRef(null),B=r.useMemo(()=>e.reduce((e,t)=>e+t.totalCount,0),[e]),E=r.useMemo(()=>e.map((e,t)=>({name:e.label,size:e.totalCount,index:t,typeNum:e.typeNum,key:e.key})),[e]),h=r.useCallback((e,t)=>{if(o(e),t&&null!==e){const e=D.current;if(e){const s=e.getBoundingClientRect();A(s.width),d({x:t.clientX-s.left,y:t.clientY-s.top})}}else d(null)},[]),x=r.useCallback(e=>{if(u(e),e){const t=E.findIndex(t=>t.key===e);o(t>=0?t:null)}else o(null)},[E]),p=null!==i?{name:(null==(s=E[i])?void 0:s.name)??"",value:(null==(a=E[i])?void 0:a.size)??0}:null,g=null!==i?Ft(null==(l=E[i])?void 0:l.typeNum):"";return 0===e.length||0===B?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet type data available"})]}):n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"analyzer-chart-height relative flex-shrink-0",ref:D,children:[n.jsx(ue,{width:"100%",height:"100%",children:n.jsx(De,{data:E,dataKey:"size",aspectRatio:4/3,stroke:"none",isAnimationActive:!1,content:n.jsx(gt,{x:0,y:0,width:0,height:0,name:"",size:0,index:0,depth:0,hoveredIndex:i,onHover:h,total:B,typeNum:0})})}),n.jsx(ft,{data:p,total:B,color:g,position:c,containerWidth:C})]}),n.jsx(pt,{sortedTypes:e,highlightedType:m,onTypeHover:x,aggregateShares:t})]})}function yt(e){const{values:t,sum:s}=e;if(0===t.length)return{min:0,mean:0,median:0,p75:0,p95:0,p99:0,max:0};const a=[...t].sort((e,t)=>e-t),n=a.length,r=s/n,l=a[0],i=a[n-1],o=e=>{const t=Math.min(Math.ceil(e*n)-1,n-1);return a[Math.max(0,t)]};return{min:l,mean:r,median:n%2==0?(a[n/2-1]+a[n/2])/2:a[Math.floor(n/2)],p75:o(.75),p95:o(.95),p99:o(.99),max:i}}function vt({statsBuckets:e,mode:t,packets:s,startTs:a,endTs:l,radioConfig:i,sortedTypes:o,aggregateShares:c,noiseFloorAnomalies:d,showNoiseFloorOverlay:C,overlayOpacity:A=.5}){const[m,u]=r.useState(null),[D,B]=r.useState(null),E=r.useMemo(()=>(l-a)/3600,[a,l]),h=r.useCallback(e=>{B(e)},[]),x=function(e,t,s,a,n){return r.useMemo(()=>{if(0===e.length||!n)return null;const r=e.filter(e=>e.timestamp>=t&&e.timestamp<=s);if(0===r.length)return null;const l=[],i=new Map;for(const e of r){const s=e.type??e.payload_type??-1,r=$(e);let o;if(o="airtime"===a?P(r,{spreadingFactor:n.sf,bandwidthHz:n.bw,codingRate:n.cr,preambleLength:n.preamble}):1,r<=0)continue;const c=Math.floor((e.timestamp-t)/300),d={timestamp:e.timestamp,airtimeMs:o,byteSize:r,packetType:s,bucketIndex:c};l.push(d),i.has(c)||i.set(c,[]),i.get(c).push(d)}if(0===l.length)return null;const o=[],c=[],d=[],C=new Map;if("share"===a)for(const[,e]of i)for(const t of e)C.set(t,t.byteSize);else for(const[,e]of i){const t=e.reduce((e,t)=>e+t.airtimeMs,0)/3e5*100,s=Math.max(...e.map(e=>e.airtimeMs));for(const a of e){const e=a.airtimeMs/s*t;C.set(a,e)}}for(const e of l){const t=C.get(e);void 0!==t&&(o.push(t),c.push(e.timestamp),d.push(e.packetType))}const A=Math.min(...c),m=Math.max(...c),u=m-A||1,D=[...o].sort((e,t)=>e-t),F=D[0],B=D[D.length-1],E=Math.floor(.05*D.length),h=Math.floor(.5*D.length),x=Math.min(Math.ceil(.95*D.length),D.length-1),p=D[E],g=D[h],f=D[x],b=new Map;for(const e of o){const t=Math.round(100*e)/100;b.set(t,(b.get(t)??0)+1)}const y=b.size,v=[...b.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({value:e,count:t,percent:t/o.length*100}));let j;if("share"===a)j=200;else{const e=5,t=Math.ceil(B/e)*e;j=t<=10?10:t+e}const N=new Float32Array(2*o.length),w=new Float32Array(o.length),k=new Uint8Array(o.length),M=new Float32Array(o.length);for(let e=0;e=0?d[e]:255,M[e]=c[e]}return{points:N,rawValues:w,packetTypes:k,timestamps:M,count:o.length,minTime:A,maxTime:m,minValue:0,maxValue:j,rawMinValue:F,rawMaxValue:B,unit:"%",stats:{p5:p,p50:g,p95:f,uniqueValues:y,topValues:v}}},[e,t,s,a,n])}(s,a,l,"share"===t?"share":"airtime",i),{data:p}=r.useMemo(()=>function(e,t){var s;const a=e.length;if(0===a)return{data:[],windowSize:0,windowDurationMs:0};const n=(null==(s=e[0])?void 0:s.bucketDurationMs)??1e3,r=Math.min(Math.max(5,Math.round(3e5/n)),a),l=Math.floor(r/2),i=[];let o=0,c=0;for(let d=0;dp.map(e=>({timestamp:e.timestamp,min:e.min,max:e.max,p75:e.p75,p95:e.p95,p99:e.p99,mean:e.mean,median:e.median,average:e.average,midpoint:e.midpoint})),[p]),f=r.useMemo(()=>(null==x?void 0:x.maxValue)?x.maxValue:"share"===t?200:10,[x,t]),b=r.useCallback(e=>{u(e)},[]),y=r.useMemo(()=>{if(null===m||!p[m])return null;const e=p[m];let t;t=E>=168?75:E>=72?35:E>=24?15:E>=3?10:5;const s=60*t/2,a=e.timestamp;return{start:a-s,end:a+s}},[m,p,E]),v=r.useMemo(()=>{if(null===m||!p[m]||!y)return null;const e=p[m].time,{start:a,end:n}=y,r=s.filter(e=>e.timestamp>=a&&e.timestamp({key:e.key,label:e.label,value:0,color:Ft(e.typeNum)}))};const l=new Map,c=new Map;let d=0,C=0;for(const t of r){const e=`TYPE_${t.type??t.payload_type??-1}`;if(l.set(e,(l.get(e)??0)+1),d++,i){const s=$(t),a=P(s,{spreadingFactor:i.sf,bandwidthHz:i.bw,codingRate:i.cr,preambleLength:i.preamble});c.set(e,(c.get(e)??0)+a),C+=a}}const A=o.map(e=>{let s;return s="airtime"===t?C>0?(c.get(e.key)??0)/C:0:d>0?(l.get(e.key)??0)/d:0,{key:e.key,label:e.label,value:s,color:Ft(e.typeNum)}});return{timestamp:p[m].timestamp,timeLabel:e,items:A}},[m,p,y,s,o,t,i]);if(0===p.length)return n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]});const j=(null==v?void 0:v.timeLabel)??null;return n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"analyzer-chart-height relative flex-shrink-0",children:[n.jsx("div",{className:"absolute inset-0 rounded-lg overflow-hidden",children:n.jsx(Dt,{data:g,maxValue:f,onHover:b,scatterData:x,noiseFloorAnomalies:d,showNoiseFloorOverlay:C,overlayOpacity:A,highlightedType:D,hoveredTimeRange:y,timeRangeHours:E,yAxisMode:"share"===t?"share":"airtime"})}),j&&n.jsx("div",{className:"absolute top-1 right-1 px-2 py-0.5 bg-bg-elevated/90 rounded text-xs text-accent-secondary font-mono pointer-events-none",children:j})]}),n.jsx(pt,{sortedTypes:o,highlightedType:D,onTypeHover:h,aggregateShares:c,hoverData:v})]})}function jt({active:e,payload:t,label:s,mode:a}){if(!e||!t||0===t.length)return null;const r=t.filter(e=>null!==e.value&&void 0!==e.value);if(0===r.length)return null;const l=s?new Date(1e3*s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):"";return n.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm shadow-xl",children:[n.jsx("div",{className:"font-medium text-text-primary mb-1 font-mono",children:l}),r.map((e,t)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:e.color}}),n.jsxs("span",{className:"text-text-muted",children:[e.name,":"]}),n.jsx("span",{className:"text-text-primary tabular-nums font-mono",children:"share"===a?`${Number(e.value).toLocaleString()} B`:`${Number(e.value).toFixed(2)}%`})]},t))]})}function Nt(e){return e>=1e9?`${(e/1e9).toFixed(1)}G`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function wt({packets:e,mode:t,startTs:s,endTs:a,radioConfig:l,bucketCount:i}){const o=oe(),c=ce(),d=o.primary,C=o.tertiary,[A,m]=r.useState(null),{trendData:u,totals:D}=r.useMemo(()=>{if(0===e.length)return{trendData:[],totals:{rxBytes:0,txBytes:0,rxAirtime:0,txAirtime:0},actualBucketCount:0};const n=a-s,r=Math.min(Math.ceil(n/300),i),o=n/r,c=1e3*o,d=[];for(let e=0;e=a)continue;const n=Math.min(Math.floor((e-s)/o),r-1),i=$(t),c=P(i,{spreadingFactor:l.sf,bandwidthHz:l.bw,codingRate:l.cr,preambleLength:l.preamble});t.transmitted?(d[n].txBytes+=i,d[n].txAirtime+=c,A+=i,u+=c):(d[n].rxBytes+=i,d[n].rxAirtime+=c,C+=i,m+=c)}return{trendData:d.map(e=>{if("share"===t)return{timestamp:e.timestamp,rx:e.rxBytes>0?e.rxBytes:null,tx:e.txBytes>0?e.txBytes:null};{const t=c>0?e.rxAirtime/c*100:0,s=c>0?e.txAirtime/c*100:0;return{timestamp:e.timestamp,rx:t>0?t:null,tx:s>0?s:null}}}),totals:{rxBytes:C,txBytes:A,rxAirtime:m,txAirtime:u}}},[e,s,a,i,t,l,300]),E=r.useMemo(()=>{if(0===u.length)return"share"===t?100:10;let e=0;for(const t of u){const s=t.rx??0,a=t.tx??0;s>e&&(e=s),a>e&&(e=a)}const s=1.1*e;return"share"===t?s<=100?100:s<=500?100*Math.ceil(s/100):s<=1e3?200*Math.ceil(s/200):s<=5e3?500*Math.ceil(s/500):s<=1e4?1e3*Math.ceil(s/1e3):5e3*Math.ceil(s/5e3):Math.max(1,Math.ceil(s))},[u,t]),h=r.useMemo(()=>{if(null!==A&&u[A]){const e=u[A],s=e.rx??0,a=e.tx??0;return"share"===t?{rx:Nt(s),tx:Nt(a),total:Nt(s+a),isHovered:!0}:{rx:`${s.toFixed(2)}%`,tx:`${a.toFixed(2)}%`,total:`${(s+a).toFixed(2)}%`,isHovered:!0}}if("share"===t)return{rx:Nt(D.rxBytes),tx:Nt(D.txBytes),total:Nt(D.rxBytes+D.txBytes),isHovered:!1};{let e=0,t=0,s=0;for(const r of u)null===r.rx&&null===r.tx||(e+=r.rx??0,t+=r.tx??0,s++);const a=s>0?e/s:0,n=s>0?t/s:0;return{rx:`${a.toFixed(2)}%`,tx:`${n.toFixed(2)}%`,total:`${(a+n).toFixed(2)}%`,isHovered:!1}}},[A,u,D,t]),x=r.useMemo(()=>{const e=a-s,t=e/3600;return[0,.25,.5,.75,1].map(a=>{const n=new Date(1e3*(s+e*a)),r=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),l=n.toLocaleDateString([],{weekday:"short"});return{pct:a,label:t>24?`${l} ${r}`:r}})},[s,a]),p=r.useCallback(e=>{const t=null==e?void 0:e.activeTooltipIndex;m("number"==typeof t?t:null)},[]),g=r.useCallback(e=>"share"===t?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toFixed(0):`${e.toFixed(0)}%`,[t]);return 0===u.length?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]}):n.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n.jsx("div",{className:"flex items-center flex-shrink-0 text-text-secondary",style:{height:20,paddingLeft:44,paddingRight:8},children:n.jsx("div",{className:"relative w-full h-full flex items-center",children:x.map((e,t)=>n.jsxs("div",{className:"absolute flex items-center gap-1 type-data-xs",style:{left:100*e.pct+"%",transform:0===e.pct?"translateX(0)":1===e.pct?"translateX(-100%)":"translateX(-50%)"},children:[n.jsx(B,{className:"w-2.5 h-2.5 opacity-60"}),n.jsx("span",{className:"tabular-nums",children:e.label})]},t))})}),n.jsx("div",{className:"flex-1 min-h-0 relative",children:n.jsx(ue,{width:"100%",height:"100%",minWidth:1,minHeight:1,children:n.jsxs(Fe,{data:u,margin:{top:4,right:8,bottom:4,left:0},onMouseMove:p,onMouseLeave:()=>m(null),children:[n.jsx(Be,{strokeDasharray:"3 3",stroke:c.secondary,strokeOpacity:.3,vertical:!1}),n.jsx(Ee,{dataKey:"timestamp",type:"number",domain:[s,a],axisLine:!1,tickLine:!1,tick:!1,height:0}),n.jsx(he,{axisLine:!1,tickLine:!1,tick:{fill:c.secondary,fontSize:10,fontFamily:W},dx:-8,width:44,tickFormatter:g,domain:[0,E]}),n.jsx(xe,{content:n.jsx(jt,{mode:t})}),n.jsx(pe,{type:"linear",dataKey:"rx",name:"RX",stroke:d,strokeWidth:2.5,strokeOpacity:.9,dot:!1,connectNulls:!1,isAnimationActive:!1}),n.jsx(pe,{type:"linear",dataKey:"tx",name:"TX",stroke:C,strokeWidth:2.5,strokeOpacity:.9,dot:!1,connectNulls:!1,isAnimationActive:!1})]})})}),n.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between mt-2",children:[n.jsxs("div",{className:"flex items-center gap-4 text-xs font-mono pl-11",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:d}}),n.jsx("span",{className:"text-text-secondary",children:"RX"})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:C}}),n.jsx("span",{className:"text-text-secondary",children:"TX"})]}),n.jsx("span",{className:"text-text-secondary",children:"share"===t?"Bytes":"Utilization"})]}),n.jsxs("div",{className:"text-right pr-2",children:[n.jsx("span",{className:"font-mono font-bold text-xl text-text-primary",children:h.total}),n.jsx("span",{className:"text-xs text-text-secondary ml-2",children:h.isHovered?"bucket":"mean"})]})]})]})}function kt({mode:e,onChange:t}){return n.jsxs("div",{className:"toggle-group toggle-group-sm",children:[n.jsx("button",{onClick:()=>t("share"),className:"toggle-group-item "+("share"===e?"active":""),children:"Total"}),n.jsx("button",{onClick:()=>t("airtime"),className:"toggle-group-item "+("airtime"===e?"active":""),children:"Airtime"})]})}function Mt({enabled:e,onChange:t,anomalyCount:s=0,showTuning:a=!1,onTuningChange:r}){return n.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[e&&r&&n.jsx("button",{onClick:()=>r(!a),className:"toggle-group toggle-group-sm "+(a?"active":""),title:a?"Hide tuning panel":"Show tuning panel",children:n.jsx("span",{className:"toggle-group-item "+(a?"active":""),children:n.jsx(l,{className:"w-3.5 h-3.5"})})}),n.jsx("button",{onClick:()=>t(!e),className:"toggle-group toggle-group-sm "+(e?"active":""),title:e?"Hide noise floor anomalies":"Show noise floor anomalies",children:n.jsx("span",{className:"toggle-group-item "+(e?"active":""),children:n.jsx(i,{className:"w-3.5 h-3.5"})})}),s>0&&n.jsx("span",{className:"absolute -top-2 -right-2 min-w-[18px] h-[18px] px-1 rounded-full bg-accent-danger text-white text-[10px] font-bold flex items-center justify-center pointer-events-none z-10",children:s>99?"99+":s})]})}function St({smoothing:e,onChange:t}){return n.jsxs("div",{className:"toggle-group toggle-group-sm",children:[n.jsx("button",{onClick:()=>t("stats"),className:"toggle-group-item "+("stats"===e?"active":""),title:"Statistics view (scatter plot)",children:n.jsx(o,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("trend"),className:"toggle-group-item "+("trend"===e?"active":""),title:"Trend line chart",children:n.jsx(c,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("raw"),className:"toggle-group-item "+("raw"===e?"active":""),title:"No smoothing (raw values)",children:n.jsx(d,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("zlema"),className:"toggle-group-item "+("zlema"===e?"active":""),title:"6-period Zero-Lag EMA (light smoothing)",children:n.jsx(C,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("ema"),className:"toggle-group-item "+("ema"===e?"active":""),title:"12-period Zero-Lag EMA (moderate smoothing)",children:n.jsx(A,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("smooth"),className:"toggle-group-item "+("smooth"===e?"active":""),title:"24-period Zero-Lag EMA (heavy smoothing)",children:n.jsx(m,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("ultra"),className:"toggle-group-item "+("ultra"===e?"active":""),title:"96-period Zero-Lag EMA (ultra smoothing)",children:n.jsx(u,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("mosaic"),className:"toggle-group-item "+("mosaic"===e?"active":""),title:"Mosaic view (treemap chart)",children:n.jsx(D,{className:"w-3.5 h-3.5"})})]})}const Tt=r.memo(function({packets:e,startTs:t,endTs:s,bucketCount:a,radioConfig:l=ht,mode:i="share",smoothing:o="raw",noiseFloorAnomalies:c=null,showNoiseFloorOverlay:d=!1,overlayOpacity:C=.5}){const A=ie(),[m,u]=r.useState(null),[D,B]=r.useState([]),E=r.useRef(null),h=r.useRef(0);r.useEffect(()=>{const t=Math.abs(e.length-h.current);if(0===t&&D.length>0)return;E.current&&clearTimeout(E.current);const s=t>100?50:500;return E.current=setTimeout(()=>{h.current=e.length,B(e)},s),()=>{E.current&&clearTimeout(E.current)}},[e,D.length]);const x=r.useMemo(()=>function(e){const t=new Map;for(const a of e){const e=a.type??a.payload_type??-1;t.set(e,(t.get(e)??0)+1)}const s=[];for(const[a,n]of t)s.push({typeNum:a,key:`TYPE_${a}`,label:Et(a),totalCount:n});return s.sort((e,t)=>t.totalCount-e.totalCount)}(D),[D]),p=r.useMemo(()=>function(e,t,s,a,n,r){const l=s-t,i=l/a,o=1e3*i,c=[];for(let d=0;d24?s.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});c.push({timestamp:e,time:a,counts:{},shares:{},airtimes:{},total:0,totalAirtime:0,bucketDurationMs:o});for(const t of r)c[d].counts[t.key]=0,c[d].airtimes[t.key]=0}for(const d of e){const e=d.timestamp;if(e=s)continue;const r=Math.min(Math.floor((e-t)/i),a-1),l=`TYPE_${d.type??d.payload_type??-1}`;c[r].counts[l]=(c[r].counts[l]??0)+1,c[r].total++;const o=$(d),C=P(o,{spreadingFactor:n.sf,bandwidthHz:n.bw,codingRate:n.cr,preambleLength:n.preamble});c[r].airtimes[l]=(c[r].airtimes[l]??0)+C,c[r].totalAirtime+=C}for(const d of c)for(const e of r)d.total>0?d.shares[e.key]=d.counts[e.key]/d.total*100:d.shares[e.key]=0;return c}(D,t,s,a,l,x),[D,t,s,a,l,x]),g=r.useMemo(()=>Bt.getBuckets(D,t,s,l),[D,t,s,l]),f=r.useMemo(()=>x.reduce((e,t)=>e+t.totalCount,0),[x]),{sortedTypes:b,aggregateShares:y}=r.useMemo(()=>{const e=new Map;if("share"===i){if(f>0)for(const t of x)e.set(t.key,t.totalCount/f)}else{let t=0;const s=new Map;for(const e of p){t+=e.totalAirtime;for(const t of x){const a=s.get(t.key)??0;s.set(t.key,a+(e.airtimes[t.key]??0))}}if(t>0)for(const a of x)e.set(a.key,(s.get(a.key)??0)/t)}return{sortedTypes:[...x].sort((t,s)=>{const a=e.get(t.key)??0;return(e.get(s.key)??0)-a}),aggregateShares:e}},[x,f,i,p]),v=r.useMemo(()=>function(e,t,s,a="raw"){const n=function(e,t,s){if(e.length<=360)return e;const a=Math.ceil(e.length/360),n=[];for(let r=0;r0?l.counts[e.key]/l.total*100:0;n.push(l)}return n}(e,0,s),r=n.length,l=s.length,i=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;A0?(e.counts[a]??0)/e.total:0}else{let t=0;for(let a=0;a0?r/t:0}}}const o=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;Afunction(e,t){switch(t){case"zlema":return xt(e,6);case"ema":return xt(e,12);case"smooth":return xt(e,24);case"ultra":return xt(e,96);default:return e}}(e,a)),d=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;A0?c[A-1][e]:0;let s=c[A][e]-t;s<0&&(s=0),s>1&&(s=1),d[A][e]=s}for(let A=0;A0&&Math.abs(e-1)>1e-6){const t=1/e;for(let e=0;e{u(e)},[]),[N,w]=r.useState(null),k=r.useCallback(e=>{w(e)},[]),M=r.useMemo(()=>{if(null===N||!v[N])return null;const e=v[N];return{timestamp:e.timestamp,timeLabel:e.time,items:b.map(t=>({key:t.key,label:t.label,value:e[t.key]??0,color:Ft(t.typeNum)}))}},[N,v,b]),S=r.useMemo(()=>({timestamps:v.map(e=>e.timestamp),series:b.map(e=>({key:e.key,label:e.label,color:Ft(e.typeNum),values:v.map(t=>t[e.key]??0)}))}),[v,b]);return 0===D.length?0===e.length?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]}):null:"mosaic"===o?n.jsx(bt,{sortedTypes:b,aggregateShares:y}):"stats"===o?n.jsx(vt,{statsBuckets:g,mode:i,packets:D,startTs:t,endTs:s,radioConfig:l,sortedTypes:b,aggregateShares:y,noiseFloorAnomalies:c,showNoiseFloorOverlay:d,overlayOpacity:C}):"trend"===o?n.jsx(wt,{packets:D,mode:i,startTs:t,endTs:s,radioConfig:l,bucketCount:a}):n.jsxs("div",{className:"flex flex-col",children:[n.jsx("div",{className:"analyzer-chart-height relative flex-shrink-0",children:n.jsx("div",{className:"absolute inset-0 rounded-lg overflow-hidden",children:n.jsx(O,{timestamps:S.timestamps,series:S.series,highlightedKey:m,cursorColor:A.cursor,onHover:k})})}),n.jsx(pt,{sortedTypes:b,highlightedType:m,onTypeHover:j,aggregateShares:y,hoverData:M})]})}),$t={"1x":1,"2x":2,"4x":4,"8x":8,"16x":16,"36x":36},Pt=[1,5,10,25,50,100,150];function Rt(e,t,s,a){const n=Math.PI/180,r=(a-t)*n,l=e*n,i=s*n,o=Math.sin(r)*Math.cos(i),c=Math.cos(l)*Math.sin(i)-Math.sin(l)*Math.cos(i)*Math.cos(r);return(180*Math.atan2(o,c)/Math.PI+360)%360}function Lt(e,t,s,a){const n=Math.PI/180,r=(s-e)*n,l=(a-t)*n,i=Math.sin(r/2)**2+Math.cos(e*n)*Math.cos(s*n)*Math.sin(l/2)**2;return 12742*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))}const _t=[{min:10,label:"Excellent"},{min:7,label:"Very Good"},{min:4,label:"Good"},{min:1,label:"Fair+"},{min:-2,label:"Fair"},{min:-5,label:"Fair-"},{min:-8,label:"Poor"},{min:-11,label:"Bad"},{min:-1/0,label:"Critical"}];function zt(e,t){return t[Ae(e)]||"#808080"}const Ht=r.memo(function({neighbors:e,quickNeighbors:t,localLat:s,localLon:a,onStatsChange:l}){const[i,o]=r.useState(null),[c,d]=r.useState(new Set),[C,A]=r.useState({width:0,height:0}),[m,u]=r.useState("1x"),[D,F]=r.useState(1),B=r.useRef(null),h=r.useRef({}),x=r.useRef(null),p=r.useRef(null),g=r.useRef(D);g.current=D;const f=de(),b=oe(),y=Ce(),v=ce();r.useEffect(()=>{const e=p.current;if(!e)return;const t=new ResizeObserver(e=>{for(const t of e){const{width:e,height:s}=t.contentRect;e>0&&s>0&&A({width:e,height:s})}});t.observe(e);const s=e.getBoundingClientRect();return s.width>0&&s.height>0&&A({width:s.width,height:s.height}),()=>t.disconnect()},[]);const j=r.useMemo(()=>{const e=new Set;if(t)for(const s of t)e.add(s.hash);return e},[t]),N=r.useMemo(()=>{const e=new Map;if(t)for(const s of t)e.set(s.hash,{snr:s.avgSnr,rssi:s.avgRssi});return e},[t]),{processedNeighbors:w,maxDistance:k,totalNeighbors:M,zeroHopCount:S}=r.useMemo(()=>{const t=[];for(const[r,l]of Object.entries(e)){if(!l.latitude||!l.longitude||0===l.latitude||0===l.longitude)continue;if(!j.has(r))continue;const e=Rt(s,a,l.latitude,l.longitude),n=Lt(s,a,l.latitude,l.longitude),i=N.get(r);t.push({hash:r.slice(0,8),name:l.node_name||l.name||"Unknown",snr:(null==i?void 0:i.snr)??l.snr??null,rssi:(null==i?void 0:i.rssi)??l.rssi??null,bearing:e,distance:n,normalizedDistance:0,lastSeen:l.last_seen,isZeroHop:!0})}const n=1.08*(t.length>0?Math.max(...t.map(e=>e.distance)):0);return t.sort((e,t)=>(e.snr??-1/0)-(t.snr??-1/0)),{processedNeighbors:t,maxDistance:n,totalNeighbors:t.length,zeroHopCount:t.length}},[e,s,a,j,N]);r.useEffect(()=>{null==l||l({zeroHopCount:S,totalCount:M,maxDistanceKm:k})},[S,M,k]),r.useEffect(()=>{const e=$t[m],t=g.current;B.current&&cancelAnimationFrame(B.current);const s=performance.now(),a=n=>{const r=n-s,l=Math.min(r/400,1),i=(o=l)<.5?8*o*o*o*o:1-Math.pow(-2*o+2,4)/2;var o;F(t+(e-t)*i),B.current=l<1?requestAnimationFrame(a):null};return B.current=requestAnimationFrame(a),()=>{B.current&&cancelAnimationFrame(B.current)}},[m]);const T=k/D,$=r.useMemo(()=>Pt.filter(e=>e<=1.1*T),[T]);r.useEffect(()=>{const e=[];for(const s of w){const t=h.current[s.hash];void 0!==t&&t!==s.lastSeen&&e.push(s.hash),h.current[s.hash]=s.lastSeen}if(0===e.length)return;queueMicrotask(()=>{d(t=>new Set([...t,...e]))});const t=setTimeout(()=>{d(t=>{const s=new Set(t);return e.forEach(e=>s.delete(e)),s})},600);return()=>clearTimeout(t)},[w]);const P=0!==s&&0!==a,R=r.useMemo(()=>{const{width:e,height:t}=C,s=e/2,a=t/2,n=Math.max(10,e/2-12),r=Math.max(10,t/2-12),l=Math.max(10,n-16),i=Math.max(10,r-16);return{width:e,height:t,centerX:s,centerY:a,maxRadiusX:l,maxRadiusY:i,labelRadiusX:n,labelRadiusY:r,cornerRadius:.2*Math.min(l,i)}},[C]),{width:L,height:_,centerX:z,centerY:H,maxRadiusX:O,maxRadiusY:I,labelRadiusX:V,labelRadiusY:q,cornerRadius:G}=R,X=r.useCallback((e,t=1)=>{const s=O*t,a=I*t,n=Math.min(G*t,s,a),r=(e%360+360)%360,l=r*Math.PI/180,i=180*Math.atan2(a-n,s-n)/Math.PI;let o,c;if(r<=45-i||r>315+i){const e=Math.tan(l);o=Math.max(z-s+n,Math.min(z+s-n,z+a*e*(s/a))),c=H-a}else if(r>45-i&&r<=45+i)o=z+s-n+n*Math.sin(l),c=H-a+n-n*Math.cos(l);else if(r>45+i&&r<=135-i){const e=1/Math.tan(l);c=Math.max(H-a+n,Math.min(H+a-n,H-s*e*(a/s))),o=z+s}else if(r>135-i&&r<=135+i)o=z+s-n+n*Math.sin(l),c=H+a-n-n*Math.cos(l);else if(r>135+i&&r<=225-i){const e=Math.tan(l);o=Math.max(z-s+n,Math.min(z+s-n,z-a*e*(s/a))),c=H+a}else if(r>225-i&&r<=225+i)o=z-s+n+n*Math.sin(l),c=H+a-n-n*Math.cos(l);else if(r>225+i&&r<=315-i){const e=1/Math.tan(l);c=Math.max(H-a+n,Math.min(H+a-n,H-s*e*(a/s))),o=z-s}else o=z-s+n+n*Math.sin(l),c=H-a+n-n*Math.cos(l);return{x:o,y:c}},[z,H,O,I,G]),K=r.useCallback((e,t)=>{const s=X(e,1);return{x:z+(s.x-z)*t,y:H+(s.y-H)*t}},[X,z,H]),Y=r.useCallback(e=>({N:{x:z,y:H-q},S:{x:z,y:H+q},E:{x:z+V,y:H},W:{x:z-V,y:H},NE:{x:z+V,y:H-q},SE:{x:z+V,y:H+q},SW:{x:z-V,y:H+q},NW:{x:z-V,y:H-q}}[e]),[z,H,V,q]),U=r.useCallback(e=>{const t=O*e,s=I*e,a=Math.min(G*e,t,s),n=z-t,r=z+t,l=H-s,i=H+s;return[`M ${n+a} ${l}`,`L ${r-a} ${l}`,`Q ${r} ${l} ${r} ${l+a}`,`L ${r} ${i-a}`,`Q ${r} ${i} ${r-a} ${i}`,`L ${n+a} ${i}`,`Q ${n} ${i} ${n} ${i-a}`,`L ${n} ${l+a}`,`Q ${n} ${l} ${n+a} ${l}`,"Z"].join(" ")},[z,H,O,I,G]),Q=r.useCallback(e=>{o(e)},[]),Z=r.useCallback(e=>{u(e)},[]),J=r.useCallback(e=>k<=0?0:e/k*D,[k,D]),ee=e=>`${e}km`,te=r.useMemo(()=>{const e=$.map(e=>{const t=e/k*D;return{km:e,scale:t,labelY:H-I*t*.71}}).filter(e=>e.scale<=1.05&&e.scale>=.02).sort((e,t)=>t.km-e.km),t=[];for(const s of e)t.some(e=>Math.abs(e.labelY-s.labelY)<28)||t.push(s);return t},[$,k,D,H,I]),se=C.width>0&&C.height>0;return P?0===M?n.jsxs("div",{ref:x,className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[n.jsx(E,{className:"w-8 h-8 mb-2 opacity-50"}),n.jsx("p",{children:"No nodes with location data"})]}):n.jsxs("div",{ref:x,className:"relative h-full w-full flex overflow-hidden",children:[n.jsx("div",{ref:p,className:"relative flex-1 min-w-0 h-full",children:se&&n.jsxs("svg",{width:L,height:_,className:"absolute inset-0 z-0",children:[n.jsxs("defs",{children:[n.jsx("style",{children:"\n @keyframes neighbor-blink-scale {\n 0%, 100% {\n transform: scale(1);\n opacity: 0;\n }\n 50% {\n transform: scale(1.3);\n opacity: 0.8;\n }\n }\n .neighbor-blink-ring {\n transform-origin: center;\n animation: neighbor-blink-scale 600ms ease-out forwards;\n }\n "}),n.jsx("clipPath",{id:"radar-clip",children:n.jsx("path",{d:U(1)})})]}),$.map(e=>{const t=J(e);if(t>1.05||t<.02)return null;const s=te.some(t=>t.km===e),a=z+O*t*.71,r=H-I*t*.71;return n.jsxs("g",{children:[n.jsx("path",{d:U(t),fill:"none",stroke:v.primary,strokeOpacity:.15,strokeWidth:1}),s&&n.jsx("text",{x:a+4,y:r-2,textAnchor:"start",dominantBaseline:"auto",className:"fill-text-secondary",fontSize:10,fontFamily:W,children:ee(e)})]},`ring-${e}`)}),["N","E","S","W"].map(e=>{const t="N"===e||"S"===e,s=t?z:"E"===e?z+O:z-O,a=t?"N"===e?H-I:H+I:H;return n.jsx("line",{x1:z,y1:H,x2:s,y2:a,stroke:v.primary,strokeOpacity:.15,strokeWidth:1,strokeDasharray:"4 4"},e)}),["NE","SE","SW","NW"].map(e=>{const t=Y(e);return n.jsx("line",{x1:z,y1:H,x2:t.x,y2:t.y,stroke:v.primary,strokeOpacity:.08,strokeWidth:1,strokeDasharray:"4 4"},`diag-${e}`)}),["N","E","S","W"].map(e=>{const t=Y(e),s="E"===e?"end":"W"===e?"start":"middle",a="N"===e?"hanging":"S"===e?"auto":"middle";return n.jsx("text",{x:t.x,y:t.y,textAnchor:s,dominantBaseline:a,fill:b.primary,fontSize:16,fontWeight:600,fontFamily:W,"aria-hidden":"true",children:e},e)}),["NE","SE","SW","NW"].map(e=>{const t=Y(e),s="NE"===e||"SE"===e?"end":"start",a="NE"===e||"NW"===e?"hanging":"auto";return n.jsx("text",{x:t.x,y:t.y,textAnchor:s,dominantBaseline:a,fill:b.primary,fontSize:16,fontWeight:600,fontFamily:W,"aria-hidden":"true",children:e},e)}),n.jsx("circle",{cx:z,cy:H,r:5,fill:y.chart6,stroke:"rgba(255,255,255,0.3)",strokeWidth:1,role:"img","aria-label":"Local node"}),n.jsx("g",{clipPath:"url(#radar-clip)",children:w.map(e=>{const t=k>0?e.distance/k*D:0;if(t>1)return null;const{x:s,y:a}=K(e.bearing,t),r=null!==e.snr?zt(e.snr,f):"#808080",l=(null==i?void 0:i.hash)===e.hash,o=c.has(e.hash);return n.jsxs("g",{role:"img","aria-label":`${e.name}: ${e.distance.toFixed(1)}km ${e.bearing.toFixed(0)}°`,children:[o&&n.jsx("circle",{cx:s,cy:a,r:10.5,fill:"none",stroke:"rgba(255,255,255,0.9)",strokeWidth:2,className:"neighbor-blink-ring"}),l&&n.jsx("circle",{cx:s,cy:a,r:10.5,fill:r,opacity:.3}),n.jsx("circle",{cx:s,cy:a,r:l?7:5,fill:r,stroke:"rgba(0,0,0,0.5)",strokeWidth:1,style:{cursor:"pointer",transition:"r 0.15s"},onMouseEnter:()=>Q(e),onMouseLeave:()=>Q(null)})]},e.hash)})})]})}),n.jsx("div",{className:"flex flex-col h-full items-stretch gap-1 py-2 pl-2 flex-shrink-0",role:"group","aria-label":"Zoom level",children:["1x","2x","4x","8x","16x","36x"].map(e=>n.jsx("button",{onClick:()=>Z(e),"aria-pressed":m===e,className:"flex flex-1 items-center justify-center px-1.5 text-xs font-medium rounded transition-colors "+(m===e?"bg-accent-primary/20 text-accent-primary":"bg-white/5 text-text-secondary hover:bg-white/10 hover:text-text-primary"),children:e},e))}),i&&n.jsxs("div",{className:"absolute bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm pointer-events-none z-10 shadow-xl",style:{left:"50%",bottom:8,transform:"translateX(-50%)"},children:[n.jsx("div",{className:"font-medium text-text-primary",children:i.name}),n.jsx("div",{className:"text-text-secondary text-xs font-mono",children:i.hash}),null!==i.snr?n.jsx("div",{className:"flex gap-3 mt-1 text-xs",children:n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"SNR:"})," ",n.jsxs("span",{className:"tabular-nums",style:{color:zt(i.snr,f)},children:[i.snr.toFixed(1)," dB"]}),n.jsxs("span",{className:"text-text-secondary ml-1",children:["(",(ae=i.snr,(null==(ne=_t.find(e=>ae>=e.min))?void 0:ne.label)??"Critical"),")"]})]})}):n.jsx("div",{className:"text-xs text-text-secondary mt-1",children:"No SNR data"}),n.jsxs("div",{className:"flex gap-3 text-xs",children:[n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"Distance:"})," ",n.jsxs("span",{className:"tabular-nums text-text-primary",children:[i.distance.toFixed(2)," km"]})]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"Bearing:"})," ",n.jsxs("span",{className:"tabular-nums text-text-primary",children:[i.bearing.toFixed(0),"°"]})]})]})]})]}):n.jsxs("div",{ref:x,className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[n.jsx(E,{className:"w-8 h-8 mb-2 opacity-50"}),n.jsx("p",{children:"Local node coordinates not configured"}),n.jsx("p",{className:"text-xs mt-1",children:"Set latitude/longitude in config to enable"})]});var ae,ne});function Ot(e,t){if(0===e.length)return 0;const s=t/100*(e.length-1),a=Math.floor(s),n=Math.ceil(s);return a===n?e[a]:e[a]+(e[n]-e[a])*(s-a)}const Wt=r.memo(function({timestamps:e,values:t,onStatsChange:s}){var a,l;const{theme:i}=V(),[o,c]=r.useState(!0),d=r.useMemo(()=>{if(0===t.length)return null;const e=Math.min(...t),s=Math.max(...t),a=t.reduce((e,t)=>e+t,0)/t.length,n=[...t].sort((e,t)=>e-t);return{min:e,max:s,avg:a,p5:Ot(n,5),p95:Ot(n,95)}},[t]);r.useEffect(()=>{null==s||s(d)},[d]);const C=r.useCallback(()=>{c(e=>!e)},[]),{heatmapData:A,xLabels:m,yLabels:u}=r.useMemo(()=>{if(0===e.length||0===t.length||!d)return{heatmapData:null,xLabels:[],yLabels:[]};let s,a;if(o){const e=.1*(d.p95-d.p5||1);s=d.p5-e,a=d.p95+e}else{const e=.1*(d.max-d.min||1);s=d.min-e,a=d.max+e}const n=a-s,r=e[0],l=e[e.length-1]-r||1,i=new Float32Array(2*e.length);for(let o=0;o{const e=F.current;if(!e)return;const t=new ResizeObserver(e=>{for(const t of e){const{width:e,height:s}=t.contentRect;e>0&&s>0&&E({width:e,height:s})}});t.observe(e);const s=e.getBoundingClientRect();return s.width>0&&s.height>0&&E({width:s.width,height:s.height}),()=>t.disconnect()},[]),r.useEffect(()=>{const e=D.current;if(!e||!A||0===B.width)return;const t=e.getContext("2d");if(!t)return;const{width:s,height:a}=B,n=window.devicePixelRatio||1;e.width=s*n,e.height=a*n,e.style.width=`${s}px`,e.style.height=`${a}px`,t.scale(n,n),t.clearRect(0,0,s,a);const r=getComputedStyle(document.documentElement).getPropertyValue("--accent-primary").trim(),{r:l,g:i,b:o}=(e=>{const t=e.match(/color\(display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\)/);if(t)return{r:Math.round(255*parseFloat(t[1])),g:Math.round(255*parseFloat(t[2])),b:Math.round(255*parseFloat(t[3]))};const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:{r:250,g:189,b:47}})(r),{points:c,count:d}=A,C=Math.max(3,Math.min(8,s/d*4));t.globalCompositeOperation="source-over";for(let A=0;An.jsx("span",{className:"type-data-xs text-text-secondary tabular-nums text-right pr-1.5",style:{position:"absolute",top:`${e.pos}%`,transform:"translateY(-50%)",right:0},children:e.label},t))}),n.jsxs("div",{ref:F,className:"absolute overflow-hidden",style:{left:32,right:0,top:0,bottom:20},children:[n.jsx("svg",{className:"absolute inset-0 w-full h-full",preserveAspectRatio:"none","aria-hidden":"true",children:[0,25,50,75,100].map(e=>n.jsx("line",{x1:"0",y1:`${e}%`,x2:"100%",y2:`${e}%`,stroke:"rgba(255,255,255,0.06)",strokeDasharray:"3 3"},e))}),n.jsx("canvas",{ref:D,className:"absolute inset-0 w-full h-full","aria-hidden":"true"}),n.jsx("button",{type:"button",onClick:C,className:"absolute bottom-1 right-1 p-1.5 rounded bg-tooltip-bg/80 hover:bg-tooltip-bg active:bg-tooltip-bg transition-colors touch-manipulation",title:o?"Show full range (min/max)":"Show trimmed range (P5-P95)","aria-label":o?"Expand to show full data range":"Shrink to show trimmed percentile range","aria-pressed":!o,children:o?n.jsx(h,{className:"w-3.5 h-3.5 text-text-muted","aria-hidden":"true"}):n.jsx(x,{className:"w-3.5 h-3.5 text-text-muted","aria-hidden":"true"})})]}),n.jsx("div",{className:"absolute left-0 right-0 bottom-0",style:{left:32,height:20},"aria-hidden":"true",children:m.map((e,t)=>n.jsx("span",{className:"type-data-xs text-text-secondary tabular-nums absolute top-1",style:{left:`${e.pos}%`,transform:"translateX(-50%)"},children:e.label},t))})]}):n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No noise floor data available"})}),It={repeater:"var(--accent-primary)",companion:"var(--accent-tertiary)",room_server:"var(--accent-secondary)"};function Vt(e){if(e.contact_type){const t=e.contact_type.toLowerCase();if("repeater"===t||"rep"===t)return"repeater";if("room server"===t||"room_server"===t||"room"===t||"server"===t)return"room_server";if("companion"===t||"client"===t||"cli"===t)return"companion"}return e.is_repeater?"repeater":"companion"}const qt=r.memo(function({neighbors:e}){const t=r.useMemo(()=>{const t={repeater:0,companion:0,room_server:0};for(const a of Object.values(e)){const e=Vt(a);t[e]=(t[e]||0)+1}const s=Object.values(t).reduce((e,t)=>e+t,0);return{items:[{label:"Repeaters",count:t.repeater,percent:0,color:It.repeater},{label:"Companions",count:t.companion,percent:0,color:It.companion},{label:"Room Servers",count:t.room_server,percent:0,color:It.room_server}].map(e=>({...e,percent:s>0?e.count/s*100:0})).filter(e=>e.count>0).sort((e,t)=>t.count-e.count),total:s}},[e]);return 0===t.total?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted type-body-sm",children:"No neighbors discovered yet"}):n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{className:"flex-1 flex flex-col justify-evenly",children:t.items.map(e=>n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"type-data-sm text-text-secondary",children:e.label}),n.jsxs("span",{className:"type-data-sm text-text-secondary tabular-nums",children:[e.count," ",n.jsxs("span",{className:"text-text-secondary/60",children:["(",e.percent.toFixed(0),"%)"]})]})]}),n.jsx("div",{className:"h-2.5 bg-bg-elevated rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500 ease-out",style:{width:`${e.percent}%`,backgroundColor:e.color,minWidth:e.count>0?"4px":"0"}})})]},e.label))}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border-subtle",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Total Nodes"}),n.jsx("span",{className:"type-data-sm text-text-primary font-medium tabular-nums",children:t.total})]})]})});function Gt({children:e,minHeight:t="100%",rootMargin:s="200px 0px",keepMounted:a=!0,className:l=""}){const i=r.useRef(null),[o,c]=r.useState(!1),[d,C]=r.useState(!1);r.useEffect(()=>{const e=i.current;if(!e)return;const t=new IntersectionObserver(([e])=>{const t=e.isIntersecting;C(t),t&&c(!0)},{rootMargin:s,threshold:0});return t.observe(e),()=>{t.disconnect()}},[s]);const A=d||a&&o;return n.jsx("div",{ref:i,className:`h-full w-full ${l}`,style:{minHeight:t},children:A?e:n.jsx("div",{className:"h-full w-full flex items-center justify-center text-text-muted/50",children:n.jsx("div",{className:"animate-pulse text-xs",children:"Loading chart..."})})})}const Xt={excellent:"text-signal-excellent",good:"text-signal-good",fair:"text-signal-fair",poor:"text-accent-primary"},Kt={excellent:"bg-signal-excellent/10",good:"bg-signal-good/10",fair:"bg-signal-fair/10",poor:"bg-accent-primary/10"},Yt={excellent:"bg-signal-excellent",good:"bg-signal-good",fair:"bg-signal-fair",poor:"bg-accent-primary"};function Ut({value:e,status:t}){return n.jsx("div",{className:"w-full h-2 bg-surface-elevated rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${Yt[t]} transition-all duration-300`,style:{width:`${Math.min(100,Math.max(0,e))}%`}})})}function Qt(){const e=q(),t=G(),[s,a]=r.useState(null),l=r.useCallback((e,t)=>{a({prefix:e,candidateHashes:t})},[]),i=r.useCallback(()=>{a(null)},[]);if(!t)return n.jsxs(fe,{children:[n.jsx(be,{icon:n.jsx(p,{}),title:"Prefix Conflicts",largeTitle:!0}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center text-text-secondary",children:[n.jsx(g,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),n.jsx("p",{className:"type-data-xs",children:"No topology data available"}),n.jsx("p",{className:"type-data-xs opacity-70",children:"Run deep analysis to see stats"})]})})]});const o=(c=e.avgConfidence)>=.9?"excellent":c>=.7?"good":c>=.5?"fair":"poor";var c;const d=(C=e.collisionRate)<=10?"excellent":C<=25?"good":"poor";var C;const A="poor"===o||"poor"===d?"poor":"fair"===o||"fair"===d?"fair":"good"===o||"good"===d?"good":"excellent",m="excellent"===A||"good"===A?f:b;return n.jsxs(fe,{className:"flex flex-col overflow-hidden",children:[n.jsx(be,{icon:n.jsx(p,{}),title:"Prefix Conflicts",largeTitle:!0,actions:n.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full ${Kt[A]}`,children:[n.jsx(m,{className:`w-3.5 h-3.5 ${Xt[A]}`}),n.jsx("span",{className:`type-data-xs font-medium ${Xt[A]}`,children:"excellent"===A?"Excellent":"good"===A?"Good":"fair"===A?"Fair":"Needs Attention"})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[n.jsxs("div",{className:"cursor-help",title:"Average confidence score across all disambiguated prefixes. Higher = more certain node identification. Based on geographic proximity, co-occurrence patterns, and observation recency.",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Avg Confidence"}),n.jsxs("span",{className:`type-data-lg font-semibold ${Xt[o]}`,children:[(100*e.avgConfidence).toFixed(1),"%"]})]}),n.jsx(Ut,{value:100*e.avgConfidence,status:o})]}),n.jsxs("div",{className:"cursor-help",title:"Percentage of 2-character prefixes that match multiple known nodes. Lower is better. Collisions require disambiguation to determine the correct node.",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Collision Rate"}),n.jsxs("span",{className:`type-data-lg font-semibold ${Xt[d]}`,children:[e.collisionRate.toFixed(1),"%"]})]}),n.jsx(Ut,{value:e.collisionRate,status:d})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3",children:[n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Total unique 2-character prefixes observed in packet paths. Each prefix represents the first 2 hex digits of a node's full hash.",children:[n.jsx("div",{className:"type-data-lg font-semibold text-text-primary",children:e.totalPrefixes}),n.jsx("div",{className:"type-data-xs text-text-secondary",children:"Prefixes"})]}),n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Prefixes that map to exactly one known node. No disambiguation needed—these are definitive identifications.",children:[n.jsx("div",{className:"type-data-lg font-semibold text-signal-good",children:e.unambiguousPrefixes}),n.jsx("div",{className:"type-data-xs text-text-secondary",children:"Unique"})]}),n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Prefixes matching multiple known nodes. Click a prefix below to explore candidates and see how disambiguation scores them.",children:[n.jsx("div",{className:"type-data-lg font-semibold "+(e.collisionPrefixes>0?"text-accent-primary":"text-text-primary"),children:e.collisionPrefixes}),n.jsx("div",{className:"type-data-xs "+(e.collisionPrefixes>0?"text-accent-primary":"text-text-secondary"),children:"Collisions"})]})]}),e.highCollisionPrefixes.length>0&&n.jsxs("div",{className:"mb-2",children:[n.jsx("div",{className:"type-data-xs text-text-secondary mb-1.5",children:"Highest Collisions"}),n.jsx("div",{className:"flex flex-wrap gap-1",children:e.highCollisionPrefixes.map(({prefix:e,candidateCount:t,candidateHashes:s})=>n.jsxs("button",{type:"button",onClick:()=>l(e,s),className:"inline-flex items-center gap-1 px-1.5 py-0.5 min-h-[24px] rounded bg-surface-elevated text-text-secondary type-data-xs font-mono hover:bg-accent-primary/20 hover:text-accent-primary focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors cursor-pointer touch-manipulation",title:`Click to explore ${t} candidates matching this prefix`,"aria-label":`Explore prefix ${e} with ${t} colliding candidates`,children:[e,n.jsxs("span",{className:"text-accent-primary",children:["×",t]})]},e))})]}),e.lowConfidencePrefixes.length>0&&n.jsx("div",{className:"mt-auto pt-2",children:n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx(b,{className:"w-3.5 h-3.5 text-accent-primary mt-0.5 flex-shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"type-data-xs text-accent-primary font-medium",children:[n.jsx("span",{className:"text-accent-primary",children:e.lowConfidencePrefixes.length})," prefix",1!==e.lowConfidencePrefixes.length?"es":""," with low confidence"]}),n.jsxs("div",{className:"type-data-xs text-text-secondary font-mono truncate",children:[e.lowConfidencePrefixes.slice(0,5).join(", "),e.lowConfidencePrefixes.length>5&&n.jsxs("span",{className:"text-accent-primary",children:[" +",e.lowConfidencePrefixes.length-5," more"]})]})]})]})}),0===e.lowConfidencePrefixes.length&&0===e.collisionPrefixes&&n.jsx("div",{className:"mt-auto pt-2",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(f,{className:"w-3.5 h-3.5 text-signal-excellent"}),n.jsx("span",{className:"type-data-xs text-signal-excellent",children:"All prefixes uniquely identified"})]})})]}),n.jsx(je,{isOpen:!!s,prefix:(null==s?void 0:s.prefix)||"",candidateHashes:(null==s?void 0:s.candidateHashes)||[],onClose:i})]})}function Zt({icon:e,label:t,value:s,sublabel:a,highlight:r,tooltip:l}){return n.jsxs("div",{className:"flex items-center justify-between py-2 "+(l?"cursor-help":""),title:l,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"icon-xs text-icon-widget",children:e}),n.jsx("span",{className:"type-label text-text-secondary",children:t})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("span",{className:"type-data-sm "+(r?"text-accent-primary":"text-text-primary"),children:s}),a&&n.jsx("span",{className:"type-data-xs text-text-secondary ml-1",children:a})]})]})}function Jt(){const e=X(),t=K().length;if(!e||0===e.totalPaths)return null;const{totalPaths:s,pathsWithGhosts:a,observationOverrideCount:r,tracePacketsProcessed:l,pathPacketsProcessed:i,distantEdgesDiscovered:o,duplicateGroupsFound:c,duplicatePathsUnique:d,echolocationEdgesInferred:C}=e,A=s>0?((s-a)/s*100).toFixed(1):"0",m=s>0?(a/s*100).toFixed(1):"0",D=s>0?(r/s*100).toFixed(1):"0",F=l+i,B=F>0||o>0,E=c>0||C>0;return n.jsxs(fe,{children:[n.jsx(be,{title:"Path Decoder",icon:n.jsx(y,{}),largeTitle:!0,badge:t>0?`${t} hidden`:void 0}),n.jsxs(ke,{children:[n.jsx("p",{className:"type-data-xs text-text-secondary mb-3",children:"Decodes packet routes to map your mesh topology and discover hidden repeaters."}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(v,{className:"w-3.5 h-3.5"}),label:"Traceable",value:`${A}%`,sublabel:`of ${s.toLocaleString()} paths`,highlight:parseFloat(A)>=90,tooltip:"Percentage of packet journeys where every hop was identified. Higher = better visibility into how traffic flows through your mesh."}),n.jsx(Zt,{icon:n.jsx(j,{className:"w-3.5 h-3.5"}),label:"Hidden Nodes",value:a.toLocaleString(),sublabel:`paths (${m}%)`,highlight:a>0,tooltip:"Paths containing unidentified repeaters. These 'ghost' nodes forward traffic but haven't announced themselves via ADVERT — possibly distant or newly added nodes."}),n.jsx(Zt,{icon:n.jsx(N,{className:"w-3.5 h-3.5"}),label:"Learning Rate",value:`${D}%`,sublabel:"adapted",tooltip:"How often real traffic patterns improved our predictions over geography alone. Higher values mean the decoder is learning your mesh's actual behavior — which routes are preferred, which nodes are most active."})]}),B&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-subtle",children:[n.jsx("p",{className:"type-micro mb-2",children:"Beyond Line-of-Sight"}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(w,{className:"w-3.5 h-3.5"}),label:"Route Reports",value:F.toLocaleString(),sublabel:l>0?`(${l} TRACE)`:void 0,tooltip:"TRACE/PATH packets from distant nodes share their routing tables. This reveals connections we can't directly observe — mapping parts of the mesh we don't touch."}),n.jsx(Zt,{icon:n.jsx(k,{className:"w-3.5 h-3.5"}),label:"Remote Links",value:o.toLocaleString(),highlight:o>0,tooltip:"Node-to-node connections discovered from route reports. These links exist outside our RF range but help complete the topology picture."})]})]}),E&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-subtle",children:[n.jsx("p",{className:"type-micro mb-2",children:"Echo Analysis"}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(M,{className:"w-3.5 h-3.5"}),label:"Multi-Path Packets",value:c.toLocaleString(),sublabel:d>0?`(${d} routes)`:void 0,tooltip:"Packets received via multiple paths simultaneously. Like sonar, these 'echoes' reveal redundant routes — important for understanding mesh resilience."}),n.jsx(Zt,{icon:n.jsx(u,{className:"w-3.5 h-3.5"}),label:"Inferred Links",value:C.toLocaleString(),highlight:C>0,tooltip:"Connections discovered from echo patterns. When the same packet arrives via different forwarders nearly simultaneously, those forwarders likely hear each other."})]})]}),t>0&&n.jsx("div",{className:"mt-3 pt-3 border-t border-border-subtle cursor-help",title:"High-confidence hidden repeaters: appear in 10+ paths, have 2+ known neighbors, ≥30% confidence, and plausible location. View them on the Contacts map.",children:n.jsxs("p",{className:"type-label text-text-secondary",children:[n.jsx("span",{className:"text-accent-primary type-data-sm",children:t})," ","likely repeater",1!==t?"s":""," discovered from traffic patterns"]})})]})]})}function es(){var e,t,s,a,l,i,o,c,d,C,A,m,u,D,B,h,x;const p=Y(),g=U(),f=Q(),b=Z(),y=J(),v=ee(),j=te(),N=se(),[w,k]=r.useState([]),[$,P]=r.useState(null),[R,L]=r.useState(null),[_,z]=r.useState(!0),[H,O]=r.useState(null),[W,I]=r.useState("share"),[V,q]=r.useState("stats"),[G,X]=r.useState(!1),[K,ie]=r.useState(!1),[oe,ce]=r.useState(Me),[de,Ce]=r.useState(.5),Ae=r.useMemo(()=>({0:0,1:0,2:1,3:2,4:3,5:4,6:5,7:6}[j]??3),[j]),me=ae[Ae].hours,ue=60*me,De=ae[Ae],Fe=re(me),Be=v.isBackgroundLoading,Ee=r.useCallback(e=>{N({0:1,1:2,2:3,3:4,4:5,5:6,6:7}[e]??4)},[N]),he=r.useMemo(()=>{var e;if(!(null==(e=null==p?void 0:p.config)?void 0:e.radio))return null;const t=p.config.radio;return{sf:t.spreading_factor??10,bw:t.bandwidth??25e4,cr:t.coding_rate??5,preamble:t.preamble_length??8}},[null==(t=null==(e=null==p?void 0:p.config)?void 0:e.radio)?void 0:t.spreading_factor,null==(a=null==(s=null==p?void 0:p.config)?void 0:s.radio)?void 0:a.bandwidth,null==(i=null==(l=null==p?void 0:p.config)?void 0:l.radio)?void 0:i.coding_rate,null==(c=null==(o=null==p?void 0:p.config)?void 0:o.radio)?void 0:c.preamble_length]);r.useEffect(()=>{!async function(){var e;O(null);try{const t=await ne(me);t.success&&(null==(e=t.data)?void 0:e.history)&&k(t.data.history)}catch(t){O(t instanceof Error?t.message:"Failed to load chart data")}finally{z(!1)}}()},[me]);const xe=r.useMemo(()=>72===me?6e5:168===me?18e5:336===me?36e5:3e5,[me]),pe=r.useCallback(async()=>{var e;try{const t=await ne(me);t.success&&(null==(e=t.data)?void 0:e.history)&&k(t.data.history)}catch{}},[me]);le(pe,xe,!0,!0);const je=r.useMemo(()=>0===w.length?{timestamps:[],values:[]}:{timestamps:w.map(e=>e.timestamp),values:w.map(e=>e.noise_floor_dbm)},[w]),ke=r.useMemo(()=>{if(w.length<10)return{anomalies:[],debug:void 0};const e=function(e,t={}){const s={...Me,...t};if(e.length<10)return{anomalies:[],thresholds:Te([]),totalSamples:e.length,anomalySamples:0};const a=e.map(e=>e.noise_floor_dbm),n=Te(a),r=[...a].sort((e,t)=>e-t);let l,i;s.useAbsoluteThresholds?(l=s.baselineDbm,i=s.spikeDbm):(l=Se(r,s.baselinePercentile),i=Se(r,s.spikePercentile));const o=[...e].sort((e,t)=>e.timestamp-t.timestamp),c=[];let d=null,C=0;for(const A of o)if(A.noise_floor_dbm>l&&A.noise_floor_dbme+t,0)/d.values.length):(d.values.length>=s.minSequenceLength&&c.push(d),d={startTs:A.timestamp,endTs:A.timestamp,values:[A.noise_floor_dbm],timestamps:[A.timestamp],rollingAvg:A.noise_floor_dbm})}else d={startTs:A.timestamp,endTs:A.timestamp,values:[A.noise_floor_dbm],timestamps:[A.timestamp],rollingAvg:A.noise_floor_dbm};else d&&d.values.length>=s.minSequenceLength&&c.push(d),d=null;return d&&d.values.length>=s.minSequenceLength&&c.push(d),0===c.length?{anomalies:[],thresholds:n,totalSamples:e.length,anomalySamples:C,debug:{baselineCutoff:l,spikeCutoff:i,midBandSamples:C}}:{anomalies:c.map(e=>{const t=Math.max(...e.values),s=e.values.reduce((e,t)=>e+t,0)/e.values.length;return{startTs:e.startTs,endTs:e.endTs,peakValue:t,avgValue:s,severity:$e(s,l,i),sampleCount:e.values.length}}),thresholds:n,totalSamples:e.length,anomalySamples:C,debug:{baselineCutoff:l,spikeCutoff:i,midBandSamples:C}}}(w,oe);return{anomalies:e.anomalies,debug:e.debug}},[w,oe]),Pe=ke.anomalies,Re=r.useMemo(()=>{const e=(null==p?void 0:p.neighbors)??{};return Object.fromEntries(Object.entries(e).filter(([e])=>!g.has(e)))},[null==p?void 0:p.neighbors,g]),Le=r.useMemo(()=>{const e=Date.now()/1e3-3600*me;return Object.fromEntries(Object.entries(Re).filter(([,t])=>t.last_seen>=e))},[Re,me]),_e=r.useMemo(()=>{const e=60*ue/Fe,t=Math.floor(Date.now()/1e3),s=Math.floor(t/e)*e;return{start:s-60*ue,end:s}},[ue,Fe]);return n.jsxs(ye,{children:[n.jsx(ve,{title:"Statistics",icon:n.jsx(S,{}),controls:n.jsx(ge,{ranges:ae,selectedIndex:Ae,onSelect:Ee,isPending:Be})}),H&&n.jsx(fe,{className:"border border-accent-red/50 bg-accent-red/10",children:n.jsx("p",{className:"text-accent-red",children:H})}),G&&K&&n.jsxs(fe,{className:"border border-accent-purple/30 bg-glass-surface/50",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"type-label",children:"Anomaly Detection Tuning"}),n.jsxs("span",{className:"type-data-xs text-text-muted",children:["(",De.label,")"]})]}),n.jsx("button",{onClick:()=>ce(e=>({...e,useAbsoluteThresholds:!e.useAbsoluteThresholds})),className:"type-data-xs px-2 py-1 rounded transition-colors "+(oe.useAbsoluteThresholds?"bg-accent-purple/30 text-accent-purple":"bg-glass-elevated text-text-muted hover:text-text-secondary"),children:oe.useAbsoluteThresholds?"Absolute dBm":"Percentile"})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Baseline"}),n.jsxs("span",{className:"ml-2 type-data-sm text-status-warning",children:[(null==(C=null==(d=ke.debug)?void 0:d.baselineCutoff)?void 0:C.toFixed(1))??"—"," dBm"]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Spike"}),n.jsxs("span",{className:"ml-2 type-data-sm text-status-warning",children:[(null==(m=null==(A=ke.debug)?void 0:A.spikeCutoff)?void 0:m.toFixed(1))??"—"," dBm"]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Mid-band"}),n.jsx("span",{className:"ml-2 type-data-sm text-accent-purple",children:(null==(u=ke.debug)?void 0:u.midBandSamples)??0})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Anomalies"}),n.jsx("span",{className:"ml-2 type-data-sm text-status-danger",children:Pe.length})]})]}),n.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle space-y-4",children:[oe.useAbsoluteThresholds?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Baseline (",oe.baselineDbm," dBm)"]}),n.jsx("input",{type:"range",min:"-120",max:"-60",value:oe.baselineDbm,onChange:e=>ce(t=>({...t,baselineDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Spike (",oe.spikeDbm," dBm)"]}),n.jsx("input",{type:"range",min:"-100",max:"-20",value:oe.spikeDbm,onChange:e=>ce(t=>({...t,spikeDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Merge Gap (",oe.mergeGapSeconds,"s)"]}),n.jsx("input",{type:"range",min:"5",max:"120",step:"5",value:oe.mergeGapSeconds,onChange:e=>ce(t=>({...t,mergeGapSeconds:Number(e.target.value)})),className:"w-full accent-accent-purple"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Min Sequence (",oe.minSequenceLength,")"]}),n.jsx("input",{type:"range",min:"2",max:"20",value:oe.minSequenceLength,onChange:e=>ce(t=>({...t,minSequenceLength:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Similarity (±",oe.similarityToleranceDbm," dBm)"]}),n.jsx("input",{type:"range",min:"1",max:"15",value:oe.similarityToleranceDbm,onChange:e=>ce(t=>({...t,similarityToleranceDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Opacity (",Math.round(100*de),"%)"]}),n.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.05",value:de,onChange:e=>Ce(Number(e.target.value)),className:"w-full accent-accent-purple"})]})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Baseline (P",oe.baselinePercentile,")"]}),n.jsx("input",{type:"range",min:"1",max:"50",value:oe.baselinePercentile,onChange:e=>ce(t=>({...t,baselinePercentile:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Spike (P",oe.spikePercentile,")"]}),n.jsx("input",{type:"range",min:"50",max:"99",value:oe.spikePercentile,onChange:e=>ce(t=>({...t,spikePercentile:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Merge Gap (",oe.mergeGapSeconds,"s)"]}),n.jsx("input",{type:"range",min:"5",max:"120",step:"5",value:oe.mergeGapSeconds,onChange:e=>ce(t=>({...t,mergeGapSeconds:Number(e.target.value)})),className:"w-full accent-accent-purple"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Min Sequence (",oe.minSequenceLength,")"]}),n.jsx("input",{type:"range",min:"2",max:"20",value:oe.minSequenceLength,onChange:e=>ce(t=>({...t,minSequenceLength:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Similarity (±",oe.similarityToleranceDbm," dBm)"]}),n.jsx("input",{type:"range",min:"1",max:"15",value:oe.similarityToleranceDbm,onChange:e=>ce(t=>({...t,similarityToleranceDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Opacity (",Math.round(100*de),"%)"]}),n.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.05",value:de,onChange:e=>Ce(Number(e.target.value)),className:"w-full accent-accent-purple"})]})]})]}),n.jsxs("div",{className:"mt-4 p-3 bg-glass-elevated rounded-lg",children:[n.jsx("div",{className:"type-micro mb-1",children:"Config output"}),n.jsxs("div",{className:"type-data-sm text-status-success",children:[oe.useAbsoluteThresholds?`useAbsoluteThresholds: true, baselineDbm: ${oe.baselineDbm}, spikeDbm: ${oe.spikeDbm}`:`useAbsoluteThresholds: false, baselinePercentile: ${oe.baselinePercentile}, spikePercentile: ${oe.spikePercentile}`,", mergeGapSeconds: ",oe.mergeGapSeconds,", minSequenceLength: ",oe.minSequenceLength,", similarityToleranceDbm: ",oe.similarityToleranceDbm]})]})]})]}),Be&&n.jsx(Ne,{template:"auto",children:n.jsx(fe,{className:"border border-accent-primary/30 bg-accent-primary/5",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative flex h-3 w-3",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-accent-primary"})]}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("p",{className:"type-body-sm text-text-primary",children:["Loading ",De.label," data..."]}),v.loadProgress&&n.jsxs("p",{className:"type-data-xs text-text-muted mt-0.5",children:[v.loadProgress.loaded.toLocaleString()," packets (",v.loadProgress.percent,"%)"]})]})]})})}),_?n.jsx(Ne,{template:"auto",children:n.jsx(fe,{className:"text-center py-12",children:n.jsx("div",{className:"animate-pulse text-text-muted",children:"Loading statistics..."})})}):n.jsxs(n.Fragment,{children:[n.jsx(Ne,{template:"hero-auto",children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(F,{}),title:"Packet Analyzer",badge:De.label,largeTitle:!0,actions:n.jsxs("div",{className:"flex flex-wrap items-center gap-2 justify-end",children:["stats"===V&&n.jsx(Mt,{enabled:G,onChange:X,anomalyCount:Pe.length,showTuning:K,onTuningChange:ie}),n.jsx(St,{smoothing:V,onChange:q}),n.jsx(kt,{mode:W,onChange:I})]})}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Tt,{packets:b,startTs:_e.start,endTs:_e.end,bucketCount:Fe,radioConfig:he??void 0,mode:W,smoothing:V,noiseFloorAnomalies:Pe,showNoiseFloorOverlay:G,overlayOpacity:de})})]})})}),n.jsxs(Ne,{template:"panel",children:[n.jsx(we,{span:12,md:6,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(E,{}),title:"Link Quality",badge:De.label,largeTitle:!0,actions:R?n.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 type-data-xs text-text-muted",children:[n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.zeroHopCount})," nbr"]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.totalCount})," obs"]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.maxDistanceKm.toFixed(0)})," km"]})]}):null}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(Ht,{neighbors:Le,quickNeighbors:f,localLat:(null==(B=null==(D=null==p?void 0:p.config)?void 0:D.repeater)?void 0:B.latitude)??0,localLon:(null==(x=null==(h=null==p?void 0:p.config)?void 0:h.repeater)?void 0:x.longitude)??0,onStatsChange:L})})})]})})}),n.jsx(we,{span:12,md:6,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(T,{}),title:"Network Composition",badge:De.label,largeTitle:!0}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(qt,{neighbors:Le})})})]})})})]}),n.jsxs(Ne,{template:"panel",children:[n.jsx(we,{span:12,md:6,children:n.jsx(Qt,{})}),n.jsx(we,{span:12,md:6,children:n.jsx(Jt,{})})]}),n.jsx(Ne,{template:"panel",children:n.jsx(we,{span:12,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(M,{}),title:"RF Noise Floor",largeTitle:!0,actions:$?n.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 md:gap-3",children:[n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["min ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.min.toFixed(0)})]}),n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["avg ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.avg.toFixed(0)})]}),n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["max ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.max.toFixed(0)})]}),n.jsx("span",{className:"type-data-xs text-text-muted",children:"dBm"})]}):n.jsx("span",{className:"type-data-xs text-text-muted",children:"dBm"})}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(Wt,{timestamps:je.timestamps,values:je.values,onStatsChange:P})})})]})})})})]})]})}export{es as default}; diff --git a/frontend/dist/assets/Statistics-WWZtRE3M.js b/frontend/dist/assets/Statistics-WWZtRE3M.js deleted file mode 100644 index 578d10fd..00000000 --- a/frontend/dist/assets/Statistics-WWZtRE3M.js +++ /dev/null @@ -1 +0,0 @@ -var e,t,s=Object.defineProperty,a=(e,t,a)=>((e,t,a)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a)(e,"symbol"!=typeof t?t+"":t,a);import{j as n,r,aC as l,I as i,aD as o,aE as c,aF as d,aG as C,aH as A,aI as m,aJ as u,aK as D,aL as F,o as B,aM as E,aN as h,aO as x,aP as p,aQ as g,aR as f,a8 as b,aS as y,ak as v,h as j,ae as N,aT as w,ac as k,p as M,C as S,at as T}from"./vendor-react-C0qkT9dV.js";import{U as $,V as P,W as R,X as L,Y as _,Z as z,_ as H,$ as O,F as W,v as I,a0 as V,a1 as q,a2 as G,G as X,a3 as K,d as Y,h as U,f as Q,u as Z,o as J,q as ee,j as te,p as se,a4 as ae,k as ne,a5 as re}from"./index-wYLFmyyS.js";import{u as le}from"./usePolling-ul9y_if7.js";import{a as ie,b as oe,c as ce,d as de,e as Ce,s as Ae}from"./useThemeColors-DL9Pr7sC.js";import{c as me,R as ue,d as De,L as Fe,C as Be,X as Ee,Y as he,T as xe,a as pe}from"./recharts-DRDKmvXb.js";import{T as ge}from"./TimeRangeSelector-COrVm3Yj.js";import{a as fe,c as be,P as ye,b as ve}from"./PageLayout-DAadOF4d.js";import{C as je}from"./CollisionExplorerModal-DdrurDtW.js";import{R as Ne,C as we}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";import"./leaflet-D_ckmI2R.js";function ke({children:e,centered:t,className:s}){return n.jsx("div",{className:me("flex-1 min-h-0",t&&"flex items-center justify-center",s),children:e})}const Me={useAbsoluteThresholds:!0,baselinePercentile:6,spikePercentile:50,baselineDbm:-107,spikeDbm:-100,mergeGapSeconds:45,minSequenceLength:16,similarityToleranceDbm:5};function Se(e,t){if(0===e.length)return 0;const s=t/100*(e.length-1),a=Math.floor(s),n=Math.ceil(s);return a===n?e[a]:e[a]+(e[n]-e[a])*(s-a)}function Te(e){if(0===e.length)return{median:0,p90:0,p95:0,p99:0,max:0,min:0};const t=[...e].sort((e,t)=>e-t);return{median:Se(t,50),p90:Se(t,90),p95:Se(t,95),p99:Se(t,99),max:t[t.length-1],min:t[0]}}function $e(e,t,s){const a=s-t;if(0===a)return"moderate";const n=(e-t)/a;return n>.66?"critical":n>.33?"severe":"moderate"}r.memo(function({options:e,data:t,className:s="",onCreate:a}){const l=r.useRef(null),i=r.useRef(null);return r.useEffect(()=>{const s=l.current;if(!s)return;const n=s.getBoundingClientRect(),r=Math.floor(n.width)||400,o=Math.floor(n.height)||200,c=new R({...e,width:r,height:o},t,s);return i.current=c,null==a||a(c),()=>{c.destroy(),i.current=null}},[e]),r.useEffect(()=>{i.current&&t&&i.current.setData(t)},[t]),r.useEffect(()=>{const e=l.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!i.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&i.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),n.jsx("div",{ref:l,className:`w-full h-full ${s}`,style:{minHeight:100}})});const Pe=new Map;function Re(e){var t;if(!e.startsWith("var("))return e;const s=Pe.get(e);if(s)return s;const a=e.match(/var\(([^,)]+)(?:,\s*([^)]+))?\)/);if(!a)return e;const n=a[1].trim(),r=(null==(t=a[2])?void 0:t.trim())||"#888888",l=getComputedStyle(document.documentElement).getPropertyValue(n).trim()||r;return Pe.set(e,l),l}function Le(e,t,s=!1){if(t.length<2)return;if(e.beginPath(),e.moveTo(t[0].x,t[0].y),2===t.length)return void e.lineTo(t[1].x,t[1].y);const a=.5;for(let n=0;n{u.current=e,D.current=t,F.current=a,B.current=s});const h=r.useRef({band:l,innerBand:i,mean:o,median:c,average:d,cursor:C});r.useLayoutEffect(()=>{h.current={band:l,innerBand:i,mean:o,median:c,average:d,cursor:C}});const x=r.useMemo(()=>[e.map(e=>e.timestamp),e.map(e=>e.max)],[e]),p=r.useMemo(()=>{const e=function(e,t,s,a){return{hooks:{draw:n=>{const r=e.current,l=t.current,i=s.current,o=a.current;if(0===r.length)return;const c=n.ctx,d=n.bbox,C=d.left,A=d.top,m=d.width,u=d.height;if(m<=0||u<=0)return;const D=n.data[0],F=D.length;if(0===F)return;const B=D[0],E=D[F-1]-B||1,h=e=>C+(e-B)/E*m,x=e=>A+u*(1-e/l),p={min:r.map(e=>({x:h(e.timestamp),y:x(e.min)})),max:r.map(e=>({x:h(e.timestamp),y:x(e.max)})),p5:r.map(e=>({x:h(e.timestamp),y:x(e.p5)})),p95:r.map(e=>({x:h(e.timestamp),y:x(e.p95)})),p25:r.map(e=>({x:h(e.timestamp),y:x(e.p25)})),p75:r.map(e=>({x:h(e.timestamp),y:x(e.p75)})),mean:r.map(e=>({x:h(e.timestamp),y:x(e.mean)})),median:r.map(e=>({x:h(e.timestamp),y:x(e.median)})),average:r.map(e=>({x:h(e.timestamp),y:x(e.average)}))},g=(e,t)=>i?i===e?Math.min(1,1.5*t):"minMax"===i||"p5p95"===i||"p25p75"===i?.3*t:t:t,f=e=>i?i===e?1:"mean"===i||"median"===i||"average"===i?.3:1:1,b={band:Re(o.band),innerBand:Re(o.innerBand),mean:Re(o.mean),median:Re(o.median),average:Re(o.average)};c.save(),c.strokeStyle=b.average,c.lineWidth=4,c.globalAlpha=f("average"),Le(c,p.average),c.stroke(),c.globalAlpha=g("minMax",.15),c.fillStyle=b.band,c.beginPath(),Le(c,p.max);const y=[...p.min].reverse();for(const e of y)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.globalAlpha=g("p5p95",.3),c.fillStyle=b.band,c.beginPath(),Le(c,p.p95);const v=[...p.p5].reverse();for(const e of v)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.globalAlpha=g("p25p75",.55),c.fillStyle=b.innerBand,c.beginPath(),Le(c,p.p75);const j=[...p.p25].reverse();for(const e of j)c.lineTo(e.x,e.y);c.closePath(),c.fill(),c.strokeStyle=b.median,c.lineWidth=1.5,c.globalAlpha=f("median"),c.setLineDash([4,4]),Le(c,p.median),c.stroke(),c.strokeStyle=b.mean,c.lineWidth=1.5,c.globalAlpha=f("mean"),c.setLineDash([]),Le(c,p.mean),c.stroke(),c.restore()}}}}(u,D,F,h);return{width:400,height:200,padding:[4,4,4,4],cursor:{show:!0,x:!0,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,t]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],hooks:{setCursor:[e=>{var t,s;const a=e.cursor.idx;null!=a&&a>=0?null==(t=B.current)||t.call(B,a):null==(s=B.current)||s.call(B,null)}]},plugins:[e]}},[t]);r.useEffect(()=>{const t=A.current;if(!t||0===e.length)return;const s=E.current,a=e.length,n=Math.abs(a-s);if(!(!m.current||n>100||s>0&&n/s>.1)&&m.current)return m.current.setData(x),void(E.current=a);m.current&&m.current.destroy();const r=t.getBoundingClientRect(),l=Math.floor(r.width)||400,i=Math.floor(r.height)||200,o=new R({...p,width:l,height:i},x,t);return m.current=o,E.current=a,()=>{o.destroy(),m.current=null}},[p,x,e.length]),r.useEffect(()=>{const e=A.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!m.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&m.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),r.useEffect(()=>{m.current&&m.current.redraw()},[a,e]);const g=r.useCallback(()=>{null==s||s(null)},[s]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:A,className:"w-full h-full rounded-2xl overflow-hidden",onMouseLeave:g})});const _e=["#65024B","#701057","#7B1B61","#88276E","#923078","#9B3881","#A4418A","#AC4993","#B5549C","#BC5CA3","#C266AB","#C970B2","#CF7AB9","#D587C1","#DA93C8","#DF9ECE","#E3AAD4","#E7B5DA","#EBC2E0","#EECCE5","#F1D5E9","#F3DDED","#F5E4F0","#F6EBF1","#F6EFF1","#F5F2F0","#F3F3ED","#EFF3E6","#EBF1DF","#E5EFD5","#DDEBCA","#D4E6BD","#C8DEAB","#BCD79B","#B0CE8C","#A3C67D","#97BC6F","#88B161","#7CA856","#72A04D","#679845","#5E903D","#538735","#4B7F2E","#427827","#397021","#306819","#245D10","#195507","#0D4C00"],ze=["#4F3043","#56304B","#603354","#6D3961","#793F6B","#834675","#8D4E7E","#965587","#A05E91","#A86698","#B06EA0","#B877A7","#BF81AF","#C78DB8","#CD98BE","#D2A3C4","#D6ADC8","#D9B5CB","#DABECC","#DAC3CC","#D9C7CA","#D8CAC8","#D6CBC6","#D4CDC2","#D1CDBE","#CCCDB9","#C6CBB1","#BCC5A4","#B2BE97","#A7B58A","#9CAB7E","#92A174","#889669","#808D62","#79855C","#737D56","#6D7552","#666C4C","#616548","#5C5D45","#575642","#54503F","#50493D","#4D453C","#4B403B","#4A3C3A","#49393A","#49343B","#4A313E","#4E3042"],He=["#9EB0FF","#93AFFA","#87ADF4","#79ABED","#6CA9E6","#60A5DF","#54A0D5","#489ACA","#3E90BC","#3787AF","#327EA3","#2D7597","#296B8B","#25607C","#225771","#1E4E65","#1B465A","#183D4F","#153342","#122C38","#11242E","#101D25","#11181C","#121214","#160E0D","#1B0B07","#210B03","#270D01","#2D0E00","#340F00","#3B1100","#421301","#4B1602","#541905","#5D1E09","#68240F","#732B16","#803620","#8A3F2A","#944834","#9E513F","#A85A4A","#B46658","#BE6F63","#C8796F","#D2837A","#DD8D86","#EA9995","#F4A3A1","#FFADAD"],Oe=["#2C1A4C","#2B2154","#2B295B","#2A3164","#29396C","#284174","#29497C","#2A5183","#305C8C","#376593","#416D9A","#4B76A0","#567FA6","#6489AD","#6F92B3","#7B9BBA","#86A3C0","#92ACC6","#A0B7CD","#ACC0D3","#B8C9DA","#C4D2E0","#D0DBE6","#DEE5EC","#E7ECED","#EDEFE9","#EDEEE1","#E9E9D4","#E4E4C8","#DEDEBD","#D8D8B1","#D2D2A5","#C9C996","#C1C18A","#B8B87E","#AEAE73","#A3A369","#97975E","#8D8D56","#83834D","#797945","#70703D","#646434","#5B5B2C","#525224","#49491D","#404016","#36360F","#2E2E08","#262600"],We=["#372F38","#36303D","#363144","#36354E","#363957","#373F60","#39456A","#3C4D75","#415780","#47608A","#4D6992","#55729A","#5D7BA2","#6886AA","#728FB1","#7C97B7","#86A0BD","#91A8C2","#9DB2C8","#A7BACC","#B1C1CE","#BAC8D0","#C2CDD0","#CAD1CD","#CED3C8","#CFD3C2","#CFD1B9","#CBCCAD","#C6C6A2","#BFBF96","#B8B78B","#AFAF7F","#A4A472","#9B9A68","#91915E","#888755","#7E7E4C","#737243","#6B693D","#626137","#5B5932","#54512E","#4C482B","#474229","#423D29","#3F3829","#3C352B","#39322E","#383032","#372F37"],Ie=["#1A3333","#1B373D","#1C3C47","#1E4255","#1F4762","#214E71","#235582","#255E92","#2969A1","#2C73AD","#2F7CB8","#3485C2","#3B8EC7","#4799C8","#50A1C9","#59AAC9","#62B2CA","#6BBACB","#76C3CB","#81CCCD","#92D5D1","#A4DED5","#B6E7DA","#CCF2DF","#DDFBE3","#034224","#08491F","#115119","#1C5914","#2B6212","#3D6915","#4E6E1B","#617224","#6F742B","#7B7631","#867836","#917B3C","#9E7E45","#AA844F","#B48D5D","#BC976C","#C3A27C","#CAB08F","#CFBBA0","#D5C6B0","#DACFC1","#DFD7D0","#E4DFE0","#E9E6ED","#EDEDFC"],Ve=["#2C194C","#2B2254","#2B295C","#2A3265","#293A6D","#284275","#284A7C","#2A5284","#2F5C8D","#366493","#3F6C99","#49749F","#527CA4","#5E85AA","#688DB0","#7395B6","#7E9DBB","#8AA6C2","#99B1C9","#A5BBD0","#B2C5D7","#C0CFDE","#CDD9E5","#DCE5EB","#E5ECED","#E6EEEA","#E0EAE1","#D4E2D4","#C8DBC8","#BCD3BC","#B0CAB0","#A4C2A3","#95B895","#89B088","#7DA87D","#71A071","#669966","#599059","#4F894E","#458244","#3B7B3A","#317430","#266A25","#1F611D","#1A5816","#174E12","#14450E","#123A0A","#103107","#0F2903"],qe=["#3F3E3A","#3E3D3F","#3E3D44","#3E3D4B","#3E3F52","#3E425A","#3F4762","#414C6C","#445578","#485D82","#4E658B","#546E94","#5C779C","#6581A5","#6E8AAC","#7792B2","#809BB8","#89A3BD","#94ACC2","#9CB3C5","#A3BAC7","#A9C0C8","#AEC5C7","#B0C9C4","#B0CABF","#ADCAB9","#A9C9B2","#A2C5A8","#9BC19F","#93BC95","#8BB68B","#82B081","#78A775","#709F6A","#689760","#608E56","#5A864C","#537B42","#4F733B","#4B6B35","#486431","#465D2E","#44562C","#43512C","#424D2D","#42492E","#414630","#404333","#404036","#3F3E3A"],Ge=["#0D0D0D","#181818","#212121","#2B2B2B","#343434","#3C3C3C","#454545","#4D4D4D","#565656","#5E5E5E","#656565","#6D6D6D","#747474","#7C7C7C","#848484","#8B8B8B","#939393","#9C9C9C","#A7A7A7","#B1B1B1","#BBBBBB","#C5C5C5","#D1D1D1","#DFDFDF","#ECECEC","#094225","#184822","#2B4F20","#3A5420","#485822","#555B24","#615E26","#6F6229","#7A652B","#86682E","#926B30","#9F7035","#AD7940","#B6834D","#BD8E5C","#C2996C","#C6A47C","#CCB18F","#D1BCA0","#D5C6B0","#DACFC1","#DFD7CF","#E4DFE0","#E8E6ED","#EDEDFC"],Xe=["#E6E5FF","#D8DCF7","#CBD2EF","#BBC6E5","#ADBCDE","#A0B3D6","#93A9CE","#86A0C6","#7794BD","#6A8BB5","#5E81AC","#5177A4","#456E9B","#38628F","#2F5984","#274F78","#20476D","#1B3F61","#173653","#142E48","#12283E","#112233","#111D2A","#121921","#15181B","#181A18","#1E1D17","#252419","#2D2B1C","#353220","#3E3A25","#46422A","#514C31","#5A5536","#645E3C","#6D6741","#777047","#837B4F","#8D8556","#988F5E","#A29A67","#ADA470","#B9B17D","#C3BC89","#CDC795","#D7D2A2","#E0DCAF","#ECE9BE","#F5F4CB","#FFFFD9"],Ke=["#FFCF67","#F9C564","#F3BB60","#EBB05D","#E5A659","#DF9D56","#D99554","#D38C51","#CC824D","#C67B4B","#C07348","#B96C46","#B36444","#AB5C41","#A4553F","#9D4F3D","#95483C","#8E423A","#843B39","#7C3639","#743139","#6D2D3A","#662A3D","#5F2941","#5A2846","#552A4C","#522C53","#4F315D","#4D3566","#4C3B6F","#4C4179","#4C4883","#4D518E","#4F5897","#51609F","#5367A7","#556FAE","#5878B6","#5B80BC","#5E88C2","#6190C8","#6498CE","#68A3D5","#6BACDB","#6FB5E1","#72BEE6","#76C7EC","#7AD3F3","#7DDDF9","#81E7FF"],Ye=["#1A2659","#212E61","#293568","#323F72","#3A477A","#424F82","#4A578A","#535F92","#5D699C","#6572A5","#6E7BAE","#7784B7","#808DC0","#8B97CA","#94A1D3","#9DAADC","#A6B3E5","#AFBCEC","#B9C6F2","#C0CDF5","#C7D4F7","#CEDAF9","#D4E1FB","#DCE9FD","#E3F0FE","#1F4E00","#2C5100","#3A5600","#445900","#4F5C02","#5A6005","#65660C","#736D18","#7E7423","#8A7B2E","#94823A","#9F8945","#AC9253","#B79A5E","#C3A36A","#CEAC75","#D9B581","#E5C090","#EDC99D","#F2D2A9","#F6DAB5","#F8E2C0","#FAECCE","#FBF4DA","#FDFDE6"],Ue=["#7E1700","#832504","#883008","#8F3C0C","#934610","#984E14","#9C5717","#A05F1B","#A5681F","#A97023","#AD7826","#B0802B","#B58930","#BA9437","#BE9D3E","#C2A647","#C7B051","#CBBA5D","#CFC66D","#D1CF7B","#D2D78A","#D2DE98","#D0E4A6","#CBE8B4","#C4EABE","#BDEAC6","#B3E9CD","#A6E6D2","#9BE2D5","#8EDDD7","#81D7D7","#74CFD6","#64C6D5","#59BDD2","#4FB5D0","#46ACCC","#3EA4C9","#379AC5","#3292C2","#2E8ABF","#2B82BB","#287AB8","#2471B4","#2269B0","#1F60AD","#1C58A9","#194FA5","#1344A0","#0C3B9C","#033198"],Qe=["#733957","#773850","#7A3849","#7E3942","#823C3D","#863F38","#8A4334","#8E4831","#94502E","#98572C","#9D5F2B","#A3672C","#A8712E","#AF7D32","#B58837","#BB933F","#C19F47","#C6AA52","#CDB761","#D1C26E","#D4CB7B","#D6D388","#D5D995","#D3DEA3","#CEE0AD","#C8E1B6","#C1E1BE","#B6DEC5","#ABDBC9","#A0D6CC","#94D0CE","#88C9CF","#7BC0CE","#70B8CD","#67AFCA","#5FA6C7","#589CC4","#5291BE","#4F88B9","#4E7EB3","#4F75AC","#516BA4","#55609A","#595891","#5D5087","#62497D","#664474","#6B3F69","#6F3B60","#723959"],Ze=["#DED9FF","#D0CFF9","#C3C6F3","#B3BBEC","#A6B1E6","#98A8E1","#8B9FDB","#7E95D4","#6E89CB","#617FC3","#5575B8","#4A6BAC","#4262A0","#395790","#334F83","#2E4776","#293F6A","#24385D","#1F304F","#1B2943","#172338","#141D2E","#111824","#0F151B","#0D1516","#0D1712","#0F1B12","#112113","#142716","#162F19","#1A361C","#1D3E20","#224825","#26512A","#2A5A2E","#2E6233","#336C38","#39773E","#3F8144","#488B4A","#529551","#5FA059","#70AB63","#7FB46B","#8EBD73","#9DC57B","#ACCD83","#BDD68C","#CCDE94","#DBE69B"],Je=["#FFCDFD","#F7BEF2","#F0B0E8","#E6A0DC","#DE93D2","#D786C8","#CF7ABF","#C76FB5","#BD63AA","#B45AA1","#AB5198","#A1498E","#964184","#883977","#7C326B","#6E2C60","#612654","#542148","#451C3B","#391931","#2F1728","#281521","#22141C","#1D1417","#1A1414","#191612","#191811","#1B1D11","#1D2212","#212913","#253014","#2B3916","#324419","#384D1B","#3F561E","#456021","#4C6924","#547427","#5A7C2A","#60852E","#678E32","#6E9737","#77A33F","#7FAE47","#88BA51","#92C65D","#9CD26B","#A9E27F","#B3EF92","#BEFDA5"],et=["#001261","#011A66","#02226B","#022B71","#023376","#023A7B","#034280","#034A85","#06548B","#0B5D91","#136697","#1E6F9D","#2B79A4","#3C85AC","#4B90B3","#5A9ABA","#6AA4C1","#7AAEC8","#8DBAD0","#9DC4D6","#ADCDDD","#BDD6E3","#CCDFE8","#DEE6E9","#E8E7E5","#EEE3DC","#EEDBD0","#EBD0C0","#E7C6B2","#E3BCA5","#DFB298","#DBA88B","#D69D7C","#D29470","#CE8B64","#CA8258","#C6794C","#C26E3F","#BE6533","#B85C28","#B2511D","#A94512","#9C3709","#912D06","#872406","#7E1D06","#741506","#6A0D07","#620607","#590008"],tt=["#4F1A3D","#4B1D43","#48214A","#432653","#3F2C5B","#3C3263","#38396C","#354174","#334B7F","#345487","#365E8F","#3B6797","#42719E","#4D7DA6","#5787AD","#6391B4","#709ABA","#7DA4BF","#8EAEC4","#9BB5C7","#A9BBC8","#B5C0C8","#C0C2C5","#CBC2BF","#D2C0B8","#D6BDAF","#D9B7A6","#D9AF99","#D8A88D","#D6A082","#D39776","#CF8D6B","#C8825D","#C27752","#BB6D47","#B3623D","#AA5633","#9F492A","#953E25","#8C3521","#822C1F","#7A251E","#721F1F","#6B1A21","#661824","#611627","#5C152B","#571631","#531736","#50193C"],st={acton:{discrete:["#260D40","#2B1345","#2F194B","#342152","#382657","#3C2C5C","#403261","#443766","#483E6C","#4C4371","#504876","#544D7B","#57527F","#5D5884","#625C88","#685F8A","#6E618C","#74628D","#7B638D","#81638E","#88648E","#8E648E","#95658F","#9D658F","#A4668F","#AB6690","#B26790","#BB6992","#C26B94","#C86F97","#CD749B","#D07AA0","#D382A7","#D688AC","#D88FB2","#D995B8","#DB9CBD","#DEA4C4","#DFABC9","#E1B1CE","#E3B7D3","#E5BED8","#E6C5DE","#E8CBE2","#E9D0E6","#EBD6EA","#ECDBEE","#EDE1F3","#EFE6F6","#F0EAFA"],categorical:["#260D40","#F0EAFA","#A76690","#DDA1C2","#585380","#7D638E","#E8CAE1","#CF789E","#403261","#4C4371","#ECDBEE","#69608B","#E3B6D2","#D78CB0","#91648F","#BE6A92","#342152","#EAD3E8","#524B79","#73628D","#463A69","#605B86","#E5C0DA","#D382A7","#C86F97","#86648E","#EEE3F4","#DA97B9","#9B658F","#B26790","#2D1749","#E0ACCA","#3A2959","#8B648E","#311C4D","#EBD7EB","#EDDFF1","#AC6790","#A1668F","#6E618C","#E6C5DE","#78628D","#433665","#DEA7C6","#81638E","#554F7C","#B86891","#3D2D5D","#4F4775","#EFE7F7","#E9CEE4","#D27DA3","#2A1244","#655D89","#C36C94","#E1B1CE","#493F6D","#5C5783","#CC739A","#DB9CBD","#D892B4","#D587AB","#96658F","#E4BBD6","#362455","#4E4573","#7F638E","#D37FA5","#E1AECC","#382657","#EBD9ED","#DFA9C8","#A4668F","#8E648E","#99658F","#675F8A","#B56891","#BB6992","#E5BED8","#E2B4D0","#D07AA0","#71618C","#E6C2DC","#AA6690","#625C88","#EDE1F3","#E8CCE3","#AF6790","#CA7199","#C16B93","#453867","#57517E","#84638E","#4B416F","#E7C7DF","#423463","#514977","#3E2F5F","#544D7B","#93658F"]},bam:{discrete:_e,categorical:_e},bamako:{discrete:["#003B47","#023C46","#053E45","#083F43","#0A4141","#0D4340","#0F443E","#12463C","#16483A","#194A38","#1C4D36","#204F34","#235132","#28542F","#2C572C","#305A2A","#355C27","#395F24","#3F6321","#44661E","#49691A","#4E6D17","#537014","#5A7410","#5F780D","#657C09","#6A7F05","#718302","#788501","#7F8700","#858800","#8C8A00","#948C01","#9B8E04","#A1920B","#A89713","#AE9C1B","#B7A225","#BEA82E","#C5AD37","#CBB341","#D2B84D","#D9BF5B","#DEC567","#E4CA73","#E9D07E","#EFD58A","#F5DB97","#FAE0A3","#FFE5AD"],categorical:["#003B47","#FFE5AD","#61790B","#B4A022","#245231","#406420","#898900","#DDC464","#0F443E","#EFD58A","#CAB23F","#194A38","#748401","#506E16","#9E9108","#315A29","#083F43","#A99815","#948C01","#6A7F05","#BFA930","#7F8700","#14473B","#1E4E35","#F7DD9C","#2A562D","#043D45","#597411","#E6CC77","#385F25","#48691B","#D4BB51","#0B4241","#8F8A00","#44661E","#1B4C37","#547113","#6F8203","#12463D","#998E03","#27542F","#4C6B18","#A4940E","#2E582B","#355C27","#B9A529","#215033","#EAD181","#FBE1A5","#C5AD37","#3C6122","#848800","#063E44","#E2C86E","#D9BF5B","#CFB648","#16493A","#798600","#023C46","#667C08","#5D770E","#0D433F","#AE9C1B","#F3D993","#094042","#A69611","#8C8A00","#053E45","#0C4240","#365E26","#6D8004","#9C8F05","#4A6A1A","#D6BD56","#B19E1F","#F9DFA0","#647B0A","#2F592A","#10453D","#818800","#C7AF3B","#46681C","#0E443F","#265330","#174A39","#335B28","#5B750F","#778501","#5F780D","#E8CF7C","#718302","#F1D78E","#978D02","#F5DB97","#204F34","#AC9A18","#29552E","#A1920B","#B7A225","#033C46"]},bamo:{discrete:ze,categorical:ze},batlow:{discrete:["#011959","#06215B","#0A285C","#0D315D","#0E375E","#103D5F","#114260","#124761","#144D62","#165162","#195662","#1C5A62","#205E61","#26635F","#2C665D","#33695A","#3A6C57","#416F53","#4A724E","#52744A","#5A7745","#627941","#6A7B3D","#747E38","#7D8134","#868330","#8F862D","#9B892B","#A58B2C","#AF8D2E","#B98F32","#C29037","#CD923F","#D69446","#DE964F","#E69858","#ED9A62","#F39E70","#F8A17B","#FAA587","#FCA993","#FDAC9E","#FDB1AB","#FDB4B6","#FDB8C0","#FDBCCB","#FCBFD6","#FCC4E3","#FBC8EF","#FACCFA"],categorical:["#011959","#FACCFA","#828231","#226061","#F29D6D","#4D734D","#114360","#C09036","#FDB4B4","#DD954D","#356A59","#FCBFD6","#175262","#677B3E","#A18A2B","#0D315D","#FCA890","#FBC6E8","#2B655E","#B18D2F","#5A7745","#FDAEA2","#CF9340","#0F3B5F","#E9995C","#FDBAC4","#416F53","#91862D","#1B5962","#08255B","#747E38","#134B61","#F9A380","#8A842F","#0E365E","#124761","#154F62","#E39754","#7B8034","#1E5D62","#99882C","#195662","#0B2B5C","#FDB7BC","#C8913B","#FCC3DF","#EE9B64","#A98C2C","#FDB1AB","#FDBCCD","#FBC9F1","#051F5A","#F6A077","#607942","#FDAB9A","#477150","#3B6D56","#B98F32","#26635F","#537549","#D69446","#6D7C3B","#30685C","#103F60","#FBA689","#BD8F34","#CB923E","#EB9A60","#FDB8C0","#FBC7EC","#F09C69","#8E852E","#FDBBC9","#7F8133","#031C5A","#114160","#FDAC9E","#5D7844","#FCA995","#185462","#787F36","#A58B2C","#0A285C","#9D892B","#33695A","#0D335E","#637A40","#165062","#124561","#205E61","#144D62","#1D5B62","#0C2E5D","#D9954A","#3E6E55","#AD8C2D","#F49F72","#868330","#B58E30","#577647"]},batlowk:{discrete:["#04050A","#0A0D15","#0F141E","#121B29","#152233","#18293D","#1C3146","#21384F","#274156","#2C485B","#314E5E","#36535F","#3B575F","#405C5E","#445F5D","#49625B","#4D6558","#526756","#586B52","#5E6E4F","#63724B","#6A7548","#717845","#797D41","#81813E","#8A853B","#938839","#9F8D38","#A99139","#B3943B","#BE973E","#C89A43","#D39D4C","#DB9F54","#E2A15D","#E8A366","#EEA570","#F3A77C","#F6A986","#F8AC91","#FAAE9A","#FCB1A4","#FDB4B0","#FDB7B9","#FDBAC3","#FDBDCD","#FDC1D8","#FCC5E4","#FBC8EF","#FACCFA"],categorical:["#04050A","#FDC0D6","#787C41","#38555F","#E5A160","#536855","#AF933A","#FAAE9A","#1A2E43","#FDB6B7","#294458","#455F5C","#63724B","#CD9B47","#91883A","#F3A77E","#111A27","#F7AB8D","#FDBBC5","#FCB2AA","#D99E52","#A18E38","#4C6459","#21384F","#3F5B5E","#152335","#0C1019","#EEA570","#5B6D50","#6C7647","#314E5E","#85823D","#BE973E","#7E7F3F","#FBB0A2","#49625B","#576A53","#0F151F","#2D495B","#DFA059","#727944","#FDBDCD","#253E54","#EAA368","#C69942","#3C585F","#998B38","#677449","#F1A678","#F9AC92","#141F2F","#1D3248","#506657","#090C13","#A99139","#5F6F4E","#35525F","#435D5D","#FDB8BD","#F5A984","#B5953B","#FDB5B2","#17273B","#D39D4C","#8C853B","#9D8C38","#415C5E","#1F354B","#33505E","#FCB1A6","#101723","#3E595F","#121C2B","#757B43","#06080F","#FCB3AE","#3A565F","#274156","#61704D","#88843C","#2B475A","#FDBED1","#6A7548","#596C51","#192B3F","#6F7845","#233B51","#C99A45","#F0A574","#DC9F55","#2F4B5D","#47615C","#F6AA88","#FDB9C1","#C29840","#4A635A","#FAAD96","#81813E","#7B7E40","#E7A264"]},batloww:{discrete:["#011959","#06215B","#0A285C","#0D315D","#0E375E","#103D5F","#114260","#124761","#144C62","#165062","#185562","#1B5962","#1F5D62","#246261","#2A665F","#30695D","#366C5A","#3D7056","#467352","#4E764E","#56794A","#5E7C46","#667F42","#70823D","#798539","#828936","#8C8C33","#989032","#A29433","#AD9738","#B79B3F","#C19E48","#CBA154","#D3A45E","#D9A669","#DFA872","#E4AA7C","#E9AC88","#EEAF91","#F2B39C","#F6B9A8","#F9C0B5","#FCCAC4","#FED3CF","#FFDBDA","#FFE3E2","#FFEAEA","#FFF2F2","#FFF8F8","#FFFEFE"],categorical:["#FFFEFE","#011959","#7E8737","#205F61","#E7AB84","#497451","#114360","#FED1CD","#BF9D46","#637E44","#9E9233","#FFEAEA","#0D315D","#326B5C","#F5B7A6","#165162","#D7A564","#0F3B5F","#1A5862","#3D7056","#FFF5F5","#FFDFDD","#FAC3BA","#134A61","#08255B","#70823D","#EEB094","#56794A","#E0A874","#8E8D33","#28655F","#AF9839","#CBA154","#EBAD8B","#1D5C62","#051F5A","#124761","#FFE5E4","#B79B3F","#A79535","#386D59","#5C7B47","#185562","#DBA76D","#F8BDAF","#FFF0F0","#246261","#F2B39C","#868A35","#4F774D","#E4AA7C","#2D685E","#77853A","#FED8D6","#103F60","#FFFAF9","#968F32","#D1A35C","#144E62","#FCCAC4","#437254","#698040","#0E365E","#0B2B5C","#C59F4C","#30695D","#1C5A62","#A29433","#407155","#FFDBDA","#0C2E5D","#F7BAAA","#E5AB80","#175362","#828936","#1F5D62","#BB9C42","#E9AC88","#FFF7F7","#3A6E58","#9A9132","#8A8B34","#4C754F","#FFEDED","#D9A669","#144C62","#266460","#FDCDC9","#FCC6BF","#FFE2E1","#FFFCFC","#7B8639","#2B675E","#155062","#5F7C45","#F9C0B5","#356C5A","#F3B5A1","#EDAF8F","#FED5D2"]},berlin:{discrete:He,categorical:He},bilbao:{discrete:["#4C0001","#54070B","#5B0E13","#64161A","#6B1D20","#712227","#77282D","#7D2E34","#84343B","#8A3A41","#8F4047","#94464B","#984C4F","#9B5253","#9D5754","#9E5C56","#A06057","#A16458","#A26959","#A36D5A","#A4715B","#A5745B","#A6785C","#A77C5D","#A8805E","#A9845F","#AA875F","#AC8C60","#AD9061","#AE9463","#AF9864","#B19D68","#B3A36E","#B6A975","#B8AD7E","#BBB287","#BDB590","#C0B99A","#C2BCA3","#C4BFAA","#C6C2B2","#C8C5B9","#CBCAC1","#CFCEC9","#D5D4D1","#DBDBDA","#E3E3E2","#EDEDED","#F6F6F6","#FFFFFF"],categorical:["#4C0001","#F8F8F8","#A9815E","#984D50","#BEB794","#AF9965","#CCCAC3","#78292F","#A26A59","#9F5D56","#64161A","#B6AA77","#C4C0AC","#A6765C","#8A3A41","#AC8C60","#DDDDDB","#A16358","#C7C5B7","#B3A16B","#A4705A","#6E2024","#EAEAE9","#92434A","#BAB185","#9C5554","#AD9262","#580B10","#813137","#C1BCA1","#AA865F","#D2D2CE","#A77C5D","#D7D7D4","#BCB48D","#B4A571","#C0B99A","#9E5955","#AB8960","#A6795C","#A36D5A","#8E3F46","#85353C","#A16758","#732529","#CAC7BD","#F1F1F0","#520509","#AC8F61","#5E1115","#C6C2B2","#E3E3E2","#691B1F","#B8AD7E","#95484D","#AE9663","#B19D68","#A5735B","#A06057","#9A5152","#A87E5D","#7D2E34","#A9835E","#C3BEA6","#CFCEC9","#A46E5A","#F4F4F4","#DADAD8","#B29F69","#EDEDED","#BBB289","#9D5754","#AF9764","#904148","#994F51","#B3A36E","#A87F5E","#A26859","#AC8D61","#BDB590","#AA875F","#A77A5D","#AB8A60","#A4715B","#611418","#BFB897","#E6E6E6","#9B5353","#D5D4D1","#974A4F","#C8C6BA","#A16558","#9F5E56","#76272C","#67191D","#8C3C43","#B9AF82","#C3BFA9","#B5A874","#4F0205"]},broc:{discrete:Oe,categorical:Oe},broco:{discrete:We,categorical:We},buda:{discrete:["#B301B3","#B30BAE","#B314AA","#B31CA6","#B323A2","#B3289F","#B32E9D","#B4339A","#B53998","#B63E96","#B84394","#B94892","#BB4C91","#BD528F","#BE568D","#C05B8C","#C15F8A","#C36389","#C46987","#C66D86","#C77184","#C97583","#CA7982","#CB7E80","#CD837F","#CE877E","#CF8B7D","#D0917B","#D1957A","#D29979","#D49E78","#D5A277","#D6A776","#D7AC75","#D8B073","#D9B572","#DAB971","#DCBF70","#DDC36F","#DEC86E","#DFCC6C","#E0D16B","#E2D76A","#E4DC69","#E6E168","#E9E667","#EDEC67","#F3F366","#F9F966","#FFFF66"],categorical:["#B301B3","#FFFF66","#CD857E","#BC4E90","#DBBD70","#C56A87","#B32F9C","#E3DB69","#D4A177","#EDEC67","#D1937B","#B73F95","#C05C8B","#DFCB6D","#C97882","#B31CA6","#D8AE74","#E7E368","#DAB572","#B311AC","#D39A79","#C36389","#C77184","#B53798","#E1D36B","#BE558E","#B94793","#CB7E80","#CF8C7C","#DDC46E","#B326A0","#F6F566","#D6A875","#DAB971","#C66E86","#E2D76A","#B32B9E","#B317A9","#B4339A","#BA4B91","#C46788","#C2608A","#B309AF","#D49E78","#B63B97","#BD528F","#DCC06F","#EAE767","#FAFA66","#D2977A","#F1F066","#D0907C","#CE897D","#C87483","#CC827F","#D5A576","#B321A3","#E5DF68","#B84394","#D9B273","#E0CF6C","#CA7B81","#DEC86E","#BF598C","#D7AB75","#E6E168","#D1957A","#CC8080","#D39C78","#E0CD6C","#CD847F","#B63D96","#C87384","#C66C86","#F8F866","#D49F78","#D9B473","#DAB772","#BF578D","#CB7D81","#CF8A7D","#B32D9D","#D08E7C","#DBBB71","#C2628A","#E2D56A","#DCBF70","#BC508F","#C46987","#C05B8C","#DFCA6D","#DDC26F","#C15E8B","#D7AD74","#F3F366","#DEC66E","#D5A377","#B31AA7","#BA4992","#CE877E"]},bukavu:{discrete:Ie,categorical:Ie},cork:{discrete:Ve,categorical:Ve},corko:{discrete:qe,categorical:qe},davos:{discrete:["#00054A","#010E51","#041459","#081C61","#0C2368","#102A6F","#133075","#17377C","#1C3F83","#204588","#244C8D","#295291","#2D5895","#335F98","#38649A","#3C699C","#416E9D","#46729D","#4C779D","#517B9C","#567F9B","#5A829A","#5F8598","#658996","#698C94","#6E8F92","#739290","#78968D","#7D998C","#829D8A","#88A089","#8DA488","#95AA87","#9BAF88","#A3B489","#ABBB8C","#B4C190","#BFCA96","#C9D29E","#D2D9A6","#DBE0AF","#E3E7B8","#EBEDC4","#F0F1CD","#F4F4D6","#F7F7DE","#FAF9E6","#FCFCF0","#FDFDF7","#FEFEFE"],categorical:["#00054A","#FDFDF4","#688B94","#2D5895","#B2C08F","#E8EBC0","#87A089","#133075","#4B769D","#5A829A","#204588","#76958E","#D0D8A4","#99AD88","#F6F6DB","#3C699C","#081C61","#031256","#1A3B7F","#537C9C","#A4B68A","#C1CC98","#7E9A8B","#FAFAE8","#356199","#0E266B","#DEE3B3","#274F90","#6F9091","#618697","#8FA588","#F0F1CD","#43709D","#1D4084","#47739D","#F3F4D4","#658996","#567F9B","#17367A","#FCFBEE","#4F799D","#C9D29E","#93A987","#39659B","#D8DEAB","#ABBB8C","#739290","#B9C693","#F8F8E1","#234A8C","#112B70","#7A978D","#9EB188","#315C97","#829D8A","#05175B","#010C50","#3F6C9D","#0B2065","#5D8499","#2A5392","#8BA388","#6B8D93","#EDEFC7","#E3E7B8","#22488A","#638897","#122E73","#00094D","#AEBD8D","#4D789D","#CDD5A1","#5F8598","#58819A","#071A5E","#0C2368","#18387D","#91A787","#37639A","#EBEDC4","#F2F2D0","#FBFBEB","#74938F","#2F5A96","#335F98","#809B8B","#BDC995","#49759D","#719191","#9BAF88","#F7F7DE","#1B3E82","#A8B88B","#849E89","#557E9B","#E6E9BC","#45719D","#1E4386","#96AB87","#89A188"]},devon:{discrete:["#2C1A4C","#2B1E51","#2B2356","#2A295B","#2A2D60","#293265","#29376A","#283B6E","#274174","#27467A","#274C7F","#275186","#28568C","#2A5C95","#2D609C","#3064A3","#3468AA","#396BB1","#3F70B9","#4774C0","#4F79C6","#597DCC","#6382D1","#6F88D7","#798CDB","#8290DF","#8C95E2","#969AE6","#9E9EE9","#A6A3EB","#ACA7ED","#B1ACEF","#B7B1F0","#BBB5F1","#BFB9F2","#C3BEF3","#C7C2F4","#CCC7F4","#D0CCF5","#D4D0F6","#D8D4F7","#DCD9F8","#E1DEF9","#E5E3FA","#E9E7FB","#EDECFB","#F2F0FC","#F7F6FD","#FBFAFE","#FFFFFF"],categorical:["#2C1A4C","#F8F8FE","#758AD9","#C6C0F3","#28568C","#29376A","#AAA5ED","#DEDCF8","#3D6EB7","#EBE9FB","#9197E4","#3063A2","#274579","#577CCB","#D2CEF6","#2A285A","#BAB3F1","#B2ADEF","#F2F0FC","#274E82","#2A2F62","#CCC7F4","#9E9EE9","#4875C1","#C0BAF2","#2B5D98","#3669AD","#2B2154","#E4E2FA","#8290DF","#D8D4F7","#6784D3","#283E71","#C9C4F4","#BDB7F1","#DBD8F8","#283A6D","#4F79C6","#A4A2EB","#EEEDFC","#CFCBF5","#E8E5FA","#5F80CF","#4272BC","#B6B0F0","#2B1D50","#AEA9EE","#275287","#2A2B5E","#989BE7","#293366","#27497D","#8A94E1","#295A92","#3266A7","#F5F4FD","#7B8DDC","#274174","#2D609C","#2B2558","#6F88D7","#E1DEF9","#3A6CB2","#D5D1F6","#C3BEF3","#2E629F","#3165A4","#8D95E3","#3468AA","#DAD6F7","#D1CDF5","#9B9CE8","#275084","#B8B2F0","#27477B","#6382D1","#4573BF","#A2A0EA","#F7F6FD","#C7C2F4","#F3F2FD","#274376","#8692E0","#2B1F52","#CAC6F4","#ACA7ED","#E3E0F9","#F0EEFC","#E6E4FA","#386AB0","#2C1C4E","#6B86D5","#28396B","#283C6F","#2A5C95","#2A2D60","#BEB9F2","#C2BCF2","#7E8FDD","#3F70B9"]},fes:{discrete:Ge,categorical:Ge},glasgow:{discrete:["#361338","#3B1434","#401530","#45172C","#491828","#4D1924","#511B21","#561C1D","#5B1E18","#602014","#662210","#6B260B","#6F2B07","#723203","#743802","#743E01","#754300","#744900","#744F01","#745402","#735905","#725F0B","#716413","#70691E","#6E6E27","#6C7231","#6B763A","#697B46","#677F4F","#658359","#648763","#628B6C","#618F78","#609381","#60978A","#619B94","#659F9D","#6CA5A8","#74A9B0","#7DADB8","#86B1BF","#8EB4C6","#99B9CE","#A1BCD5","#AABFDB","#B2C3E1","#BBC6E7","#C6CBF0","#D0CFF7","#DBD3FF"],categorical:["#361338","#DBD3FF","#6D702B","#69A3A5","#702D06","#A0BBD3","#638968","#521B20","#745101","#84B0BE","#754001","#5F9587","#BBC6E7","#612013","#45172C","#687D4A","#726210","#618F78","#4B1926","#3E1532","#629C96","#658359","#CACCF3","#76AAB2","#6B763A","#744900","#6A250C","#ADC1DD","#735905","#92B6C9","#591D1A","#743702","#70681C","#4F1A23","#754400","#6D2909","#60998E","#41162F","#744D00","#745503","#B4C3E2","#697A42","#7DADB8","#628C70","#8BB3C3","#561C1D","#D2D0F9","#99B9CE","#3A1435","#6F6C23","#743B01","#60927F","#662210","#648661","#659F9D","#678051","#725E0A","#481829","#6FA6AB","#6C7332","#5D1E17","#A6BED8","#C2C9ED","#723203","#716617","#68240E","#6F6A20","#C6CBF0","#79ABB5","#72600D","#754200","#43162D","#67A1A1","#6B7536","#5F1F15","#735B07","#571C1B","#72A8AF","#744F01","#BEC8EA","#381337","#8EB4C6","#628B6C","#677E4D","#60917B","#639E9A","#4A1827","#A3BDD6","#3C1433","#743901","#632112","#B7C5E5","#4D1924","#65845D","#618E74","#609483","#9CBAD1","#46172A","#87B1C1","#6D712F"]},grayc:{discrete:["#000000","#090909","#111111","#171717","#1C1C1C","#212121","#252525","#2A2A2A","#303030","#343434","#393939","#3D3D3D","#424242","#474747","#4B4B4B","#505050","#545454","#585858","#5D5D5D","#616161","#656565","#696969","#6D6D6D","#717171","#757575","#797979","#7D7D7D","#818181","#858585","#898989","#8E8E8E","#929292","#979797","#9C9C9C","#A1A1A1","#A6A6A6","#ABABAB","#B1B1B1","#B6B6B6","#BCBCBC","#C1C1C1","#C7C7C7","#CECECE","#D5D5D5","#DBDBDB","#E2E2E2","#E8E8E8","#F1F1F1","#F8F8F8","#FFFFFF"],categorical:["#070707","#F9F9F9","#777777","#454545","#AEAEAE","#909090","#292929","#5F5F5F","#D1D1D1","#9E9E9E","#525252","#E4E4E4","#6C6C6C","#BFBFBF","#1A1A1A","#373737","#848484","#595959","#222222","#B6B6B6","#A6A6A6","#3E3E3E","#7D7D7D","#666666","#969696","#8A8A8A","#4B4B4B","#DADADA","#C8C8C8","#313131","#717171","#131313","#EFEFEF","#C4C4C4","#A2A2A2","#424242","#878787","#252525","#2D2D2D","#4F4F4F","#3B3B3B","#808080","#1E1E1E","#BBBBBB","#AAAAAA","#EAEAEA","#696969","#7A7A7A","#DFDFDF","#636363","#565656","#B2B2B2","#0E0E0E","#9A9A9A","#5C5C5C","#747474","#F3F3F3","#333333","#6E6E6E","#D5D5D5","#8D8D8D","#939393","#494949","#CCCCCC","#171717","#BDBDBD","#575757","#C1C1C1","#404040","#828282","#E2E2E2","#151515","#1C1C1C","#0B0B0B","#9C9C9C","#858585","#2F2F2F","#B4B4B4","#888888","#242424","#272727","#3C3C3C","#B0B0B0","#353535","#545454","#5B5B5B","#393939","#D7D7D7","#A4A4A4","#A8A8A8","#959595","#767676","#646464","#989898","#444444","#474747","#111111","#F6F6F6","#ECECEC","#4D4D4D"]},hawaii:{discrete:["#8C0273","#8E0D6E","#8F1569","#901D63","#91235F","#91285A","#922D56","#933252","#94384D","#943D4A","#954246","#964742","#964C3F","#97523B","#985638","#985C34","#996131","#9A662E","#9B6C2A","#9B7226","#9C7823","#9C7E20","#9D841E","#9D8C1C","#9C921C","#9B991D","#9AA021","#97A828","#94AE30","#91B439","#8CB942","#88BE4C","#82C359","#7EC663","#79CA6E","#74CE79","#70D183","#6AD591","#66D89C","#62DCA7","#60DFB2","#5FE2BD","#61E6CA","#67E9D5","#6FEBDE","#7AEEE7","#87EFEE","#98F1F5","#A6F1F9","#B3F2FD"],categorical:["#8C0273","#B3F2FD","#9C951C","#6CD48C","#964D3E","#8ABC48","#9B6D29","#66E8D3","#922E55","#9C801F","#87EFEE","#995D34","#7BC969","#901D63","#60DEB0","#96AA2B","#943D4A","#975439","#82C359","#5FE4C2","#9AA021","#73CE7B","#65D99E","#954544","#9D8A1C","#8E126B","#91B439","#9DF1F7","#73ECE2","#91265C","#9C7724","#9A652E","#93364F","#922A59","#996131","#9D851D","#9D901C","#9A692C","#68D695","#902160","#9B9A1E","#985836","#9B7226","#933252","#77CC72","#9C7B21","#954147","#8D0A6F","#93AF32","#62DCA7","#92F0F3","#8F1867","#7DEEE8","#97513C","#6CEBDB","#61E6CA","#A8F2FA","#964941","#7FC661","#86BF50","#98A526","#70D183","#5FE1B9","#8DB840","#94394D","#9C7923","#8F1569","#985A35","#60E0B4","#9A6B2A","#91245E","#97A828","#9B7425","#6AD591","#95AD2E","#5FE2BD","#60E5C6","#953F48","#933054","#63E7CF","#84C154","#8D0671","#82EFEB","#9B9D1F","#99A323","#88BE4C","#6ED288","#6FEBDE","#9A672D","#91285A","#75CD76","#995F32","#68E9D7","#9B7028","#61DDAB","#943B4B","#933450","#8DF0F0","#8F1A65","#81C45D"]},imola:{discrete:["#1A33B3","#1C37B1","#1E3AAF","#203EAD","#2242AB","#2345AA","#2548A8","#274CA6","#2950A4","#2A53A3","#2C56A1","#2E599F","#2F5D9E","#32609B","#346499","#366797","#386A95","#3B6C92","#3E708F","#41738C","#44768A","#467987","#4A7C85","#4E8082","#518480","#56887E","#5A8C7D","#5F927B","#64967A","#689B79","#6DA078","#72A576","#78AB75","#7DB074","#82B572","#87BA71","#8CBF70","#93C66E","#98CB6D","#9ED06C","#A4D66A","#ACDB69","#B5E268","#BFE767","#C8EB67","#D3F066","#DDF466","#EAF866","#F5FB66","#FFFF66"],categorical:["#1A33B3","#FFFF66","#54867F","#305E9D","#91C36F","#3F718E","#2549A8","#BDE667","#70A377","#2B53A2","#376896","#80B373","#A3D56B","#DDF466","#203EAD","#487B86","#62947A","#2D59A0","#88BB71","#5B8D7D","#CDED66","#4E8082","#EEF966","#33639A","#284EA5","#44768A","#2344AA","#AFDE69","#3B6C92","#78AB75","#1D39B0","#99CC6D","#699C79","#3D6F90","#2C56A1","#2F5B9E","#5E917B","#4B7D84","#9ED06C","#1F3CAE","#C4EA67","#84B772","#274CA6","#D5F066","#2951A4","#74A776","#578A7E","#2446A9","#1C36B1","#A9D96A","#95C86E","#467888","#2141AC","#7CAF74","#356598","#B5E268","#66987A","#396A94","#F7FC66","#8CBF70","#E6F666","#32609B","#518380","#41738C","#6DA078","#6B9E78","#B9E468","#7AAD74","#528580","#32629B","#86B971","#3C6E91","#5C8F7C","#C8EB67","#ACDB69","#D1EF66","#E2F566","#97CA6D","#1B35B2","#1C37B0","#2345AA","#2F5D9E","#1F3DAE","#457789","#3A6B93","#598B7D","#D9F266","#346499","#386995","#A6D76A","#366797","#274DA6","#56887E","#A1D36B","#42748B","#7EB173","#72A576","#477987","#4C7F83","#F2FB66"]},lajolla:{discrete:["#191900","#1E1B02","#221C05","#271E08","#2C200B","#31220E","#362411","#3C2614","#442817","#4B2B1B","#532D1F","#5B3023","#633328","#6E362D","#783932","#813C37","#8B3F3B","#96423F","#A24543","#AD4746","#B74A48","#C04D49","#C9514B","#D1564C","#D75C4D","#DB634E","#DD694F","#E0714F","#E17750","#E37D50","#E48351","#E58951","#E79052","#E89652","#E99C52","#EAA253","#EBA853","#EDAF54","#EEB555","#F0BC57","#F1C25A","#F3CA5F","#F5D369","#F7DA74","#F9E282","#FBE890","#FCEF9F","#FDF5B0","#FEFABE","#FFFECB"],categorical:["#191900","#FFFECB","#D85F4D","#ECAC54","#653329","#F7D971","#A44544","#E58751","#362411","#E1744F","#C44E4A","#E99A52","#4B2B1B","#833D38","#F1C159","#FCEF9F","#271E08","#FEF7B6","#402716","#D0554C","#FAE587","#E79052","#EFB655","#B54947","#201C04","#E37D50","#743830","#DD694F","#EBA353","#94413E","#572F21","#F4CD61","#2E210C","#FDF3AB","#32220F","#241D06","#F5D369","#7B3B34","#1D1B02","#F0BC57","#5E3125","#F8DF7C","#512D1E","#CA514B","#E48251","#E68C51","#EA9E53","#E89552","#BC4C49","#6C362C","#EDB154","#9C4341","#E27950","#FBEA93","#3B2513","#FEFBC0","#452918","#EBA853","#F2C75C","#8B3F3B","#DB644E","#AD4746","#DF6E4F","#D55A4D","#2B200A","#783932","#E79352","#D75C4D","#FEF9BB","#EDAF54","#E0714F","#7F3C36","#613227","#F7DC77","#C7504B","#F1C45A","#30210D","#F4D065","#1E1B03","#FAE78D","#F9E282","#DA614E","#392412","#4E2C1D","#E99C52","#EFB956","#221C05","#EBA553","#FDF5B0","#984240","#E38050","#8F403D","#542E20","#ECAA54","#E68E51","#70372E","#DE6C4F","#B94A48","#291F09","#1B1A01"]},lapaz:{discrete:["#1A0C64","#1C1368","#1E196D","#202071","#212675","#222B79","#23317D","#253681","#263C85","#274189","#29478C","#2A4C8F","#2C5192","#2E5795","#305C98","#32609A","#35659C","#386A9E","#3C70A0","#3F74A1","#4379A2","#487DA3","#4D81A3","#5386A4","#588AA3","#5E8EA3","#6591A2","#6C95A1","#7398A0","#7A9A9E","#809D9D","#879F9B","#90A199","#97A397","#9EA596","#A5A795","#ADAA95","#B7AD96","#BFB199","#C8B69C","#D2BBA2","#DAC1A8","#E4C9B2","#EBCFBB","#F1D5C4","#F5DBCD","#F9E1D6","#FBE8E1","#FDEDEA","#FEF2F3"],categorical:["#1A0C64","#FEF2F3","#5B8BA3","#B3AC96","#2C5292","#3C70A0","#EACEB9","#859E9C","#24327E","#6F96A1","#33619A","#202071","#D0BAA0","#9BA496","#F9E1D6","#4A7FA3","#284289","#90A199","#FCEAE5","#1D176B","#37699D","#F3D8C8","#A7A895","#5285A4","#7A9A9E","#2F5A97","#4278A2","#263A84","#6591A2","#C1B299","#DEC3AB","#222978","#2A4B8E","#5688A4","#D7BEA6","#FDEEEC","#608EA3","#EFD3C0","#A1A696","#6A94A1","#FBE6DD","#ADAA95","#F6DDCF","#4E82A3","#2E5695","#3A6D9F","#C8B69C","#1C1268","#232D7B","#3F74A1","#467BA3","#1E1C6E","#7F9C9D","#BAAF97","#253681","#315E99","#29478C","#E4C9B2","#74989F","#273E87","#212575","#95A398","#8AA09A","#35659C","#2B4F91","#23307C","#E7CBB5","#F1D5C4","#2B4D90","#202373","#588AA3","#D3BCA3","#5487A4","#447AA2","#6792A2","#24347F","#253882","#ECD0BD","#879F9B","#305C98","#E1C6AF","#1E196D","#5D8DA3","#AAA995","#386B9E","#487DA3","#77999F","#F7DFD3","#BEB098","#1F1E70","#325F99","#4176A2","#F4DACB","#4C80A3","#2D5494","#8DA099","#6C95A1","#FAE3DA","#FDECE8","#B7AD96"]},lipari:{discrete:["#031326","#05192F","#062038","#092844","#0C2E4D","#103557","#163C5F","#1E4368","#294B70","#345075","#3E5578","#47587A","#4F5B7B","#575C7A","#5D5D79","#635E78","#695E76","#6E5F75","#765F73","#7C6071","#826070","#89606E","#90616C","#98616A","#A06268","#A86266","#B06364","#BA6462","#C36660","#CB685F","#D46B5E","#DB705F","#E27760","#E77E63","#E98567","#EA8D6B","#EA946F","#E89C75","#E7A279","#E6A87E","#E5AF84","#E5B58A","#E6BD92","#E7C49A","#EACCA3","#EDD3AD","#F0DBB7","#F5E5C4","#F9EDCF","#FDF5DA"],categorical:["#031326","#FDF5DA","#A56267","#525B7A","#E99B74","#785F72","#DA6F5E","#183E61","#E7C398","#8D616D","#365176","#092844","#655E77","#E98466","#BF6561","#F0DBB7","#E5AD82","#B26364","#EBCFA7","#5C5D79","#061D35","#25486D","#0E3353","#EA906D","#98616A","#E37861","#E5B88C","#826070","#CD685F","#6E5F75","#45587A","#F6E8C9","#E7A37A","#615E78","#E77E63","#D46B5E","#9F6268","#E99570","#93616B","#87606E","#7D6071","#F3E1C0","#575C7A","#0B2D4B","#2D4D72","#E6A87E","#E9C99F","#FAEED1","#1E4368","#EA8A69","#B86462","#6A5E76","#AB6365","#735F74","#DF735F","#E5B287","#13385A","#05182D","#E6BD92","#3E5578","#EDD5AF","#07223C","#C6665F","#4C5A7A","#E8A077","#B56363","#FBF1D6","#A26267","#E6C095","#0A2A48","#F8EBCD","#EACCA3","#AE6364","#7A5F72","#635E78","#E98768","#041629","#715F74","#ECD2AB","#A86266","#8A606E","#96616B","#545C7A","#EFD8B3","#F5E5C4","#9B6169","#F2DEBB","#765F73","#6C5F75","#294B70","#22466B","#E89D76","#E88165","#BC6461","#E6A67C","#85606F","#C36660","#1B4064","#D06A5E","#103557"]},lisbon:{discrete:Xe,categorical:Xe},managua:{discrete:Ke,categorical:Ke},navia:{discrete:["#031327","#041930","#051E3A","#052546","#062B50","#06315A","#073764","#083E6D","#0B4578","#0E4C80","#115286","#15588B","#195E8E","#1E6491","#216991","#246D91","#27718F","#2A748E","#2D788C","#307A8A","#337D89","#368087","#398385","#3C8683","#3F8981","#428C7F","#468F7D","#4A937A","#4E9678","#529A76","#579E73","#5BA271","#62A86E","#67AD6B","#6EB269","#76B768","#7FBD68","#8CC56A","#98CB6F","#A4D176","#B1D67F","#BCDB89","#C9E096","#D3E3A1","#DCE7AC","#E3EAB6","#EAEDBF","#F1F0CA","#F7F2D2","#FCF4D9"],categorical:["#031327","#FCF4D9","#408A80","#87C269","#1B608F","#59A072","#073966","#D1E39F","#2F798B","#EAEDBF","#052546","#266F90","#6BB06A","#0E4D81","#AED57D","#4C947A","#378186","#DFE8B0","#337D89","#2A748E","#14578A","#051C36","#9ACC70","#0A4374","#468F7D","#529A76","#F4F1CD","#062F56","#C1DC8D","#206891","#78B968","#62A86E","#3C8583","#569D74","#236C91","#F8F3D3","#D8E5A8","#0C487B","#04182E","#71B469","#B8D985","#07345E","#05213E","#4F9778","#5DA470","#3E8882","#062A4E","#7FBD68","#EFEFC6","#C9E096","#115286","#2C768D","#1E6491","#49917B","#66AC6C","#28718F","#A4D176","#90C76C","#438C7F","#175C8D","#083E6D","#E5EAB8","#317B8A","#357F87","#398385","#B3D781","#0D4A7E","#1C6290","#052342","#579F73","#9FCE73","#448D7E","#051A32","#FAF3D6","#428B7F","#29738F","#104F84","#5FA66F","#509877","#8CC56A","#094071","#2D788C","#083B6A","#D5E4A3","#2B758D","#226A91","#04162B","#BCDB89","#47907C","#4D9579","#E2E9B4","#7BBB68","#6EB269","#135488","#4A937A","#F1F0CA","#5BA271","#C5DE92","#F6F2D0","#CDE19B"]},naviaw:{discrete:["#041427","#051A31","#05203B","#062747","#072D52","#08345C","#0A3A66","#0C416F","#0F4979","#135080","#175686","#1B5D8A","#1F628D","#23698F","#276D8F","#2A728F","#2D758E","#30798D","#347D8B","#378089","#3A8388","#3D8686","#408984","#448C82","#489080","#4B937E","#50977C","#559C79","#5AA077","#5FA575","#65AA73","#6CAF71","#76B671","#7FBD71","#89C474","#95CB78","#A2D27F","#B1D98A","#BEDF95","#C9E5A1","#D3E9AD","#DBEDB9","#E4F1C6","#E9F4D0","#EEF6D9","#F2F8E1","#F6FAE9","#F9FCF1","#FCFDF7","#FEFEFD"],categorical:["#041427","#FBFDF6","#478F80","#9FD07D","#1F628D","#64A973","#E3F0C4","#0A3A66","#337C8B","#C7E49E","#7DBC71","#549B7A","#2A718F","#135080","#F2F8E1","#3C8586","#062747","#D7EBB2","#418A83","#B4DB8C","#2E778D","#6FB271","#EBF5D4","#0E4574","#051D37","#4D957D","#256B8F","#195A88","#388189","#F7FAEC","#5CA276","#8CC574","#073056","#31798C","#367E8A","#69AD72","#E7F3CC","#104A7A","#95CB78","#EFF6DB","#0B406D","#2C748E","#4A927F","#DDEEBB","#50987C","#165584","#589E78","#76B671","#3F8785","#05192F","#BEDF95","#448C82","#22678E","#06223F","#A9D684","#08355E","#CFE8A8","#F9FCF1","#286E8F","#85C172","#072C50","#F5F9E7","#1C5F8B","#3A8387","#60A675","#F3F9E4","#0C4271","#266D8F","#81BE72","#0A3D6A","#4B937E","#9ACD7B","#EDF5D7","#90C876","#A4D381","#378089","#1B5D8A","#489080","#145282","#DAECB6","#67AB73","#CBE6A3","#B9DD90","#3D8686","#23698F","#6CAF71","#FAFCF3","#79B971","#D3E9AD","#5AA077","#458E81","#72B471","#327B8C","#E5F1C8","#051B33","#F8FBEE","#062443","#398288","#2B728F","#06294C"]},nuuk:{discrete:["#05598C","#0E5B8B","#155C89","#1C5E87","#226085","#276184","#2C6383","#326682","#386982","#3E6C82","#446F82","#4A7283","#517584","#587A86","#5F7D88","#66818A","#6C858C","#73898E","#7B8E91","#819192","#879594","#8D9996","#939C97","#99A097","#9EA498","#A2A798","#A6AA97","#ABAD96","#AEAF95","#B1B194","#B3B492","#B6B690","#B8B88E","#BABA8C","#BDBC8A","#BFBE88","#C1C187","#C4C385","#C7C684","#CAC983","#CDCD83","#D2D184","#D7D787","#DDDD8B","#E3E290","#E8E895","#EEEE9C","#F4F4A4","#F9F9AB","#FEFEB2"],categorical:["#05598C","#FEFEB2","#A1A698","#537785","#C3C385","#B5B591","#7D8F91","#2D6483","#DDDD8B","#919B96","#BCBC8B","#3F6C82","#CDCD83","#1C5E87","#ADAE95","#68838B","#EEEE9C","#A7AA97","#879594","#C8C783","#F6F6A7","#135C89","#B9B98E","#497183","#73898E","#366882","#C0BF88","#D4D486","#99A097","#B1B293","#5E7D88","#256185","#E6E693","#829293","#788C90","#9DA398","#AAAC96","#E1E18F","#3B6A82","#638089","#B3B492","#A4A897","#446F82","#BABA8C","#D8D888","#185D88","#8C9895","#215F86","#BEBD89","#B7B78F","#CACA83","#4E7484","#C1C186","#959E97","#F2F2A1","#AFB094","#326682","#587A86","#296284","#FAFAAD","#6E868C","#C5C584","#D1D084","#0D5B8B","#E9E997","#DFDF8D","#66818A","#B0B194","#5B7B87","#2B6383","#859493","#CCCB83","#F8F8AA","#D2D285","#1F5F86","#70878D","#4B7383","#768B8F","#FCFCAF","#A9AB97","#BFBE88","#C9C983","#346782","#DBDA89","#236085","#BDBD8A","#BAB98D","#B8B88E","#2F6583","#939C97","#9FA498","#A2A798","#CFCF84","#B4B591","#C4C485","#979F97","#F0F09E","#155C89","#9BA298","#517584"]},oleron:{discrete:Ye,categorical:Ye},oslo:{discrete:["#010101","#04070B","#060C13","#0A121B","#0C1620","#0D1927","#0E1D2D","#0F2133","#10263C","#112A43","#122E4A","#133251","#153758","#173C61","#194169","#1B4670","#1E4A78","#214F80","#255589","#295A91","#2E5F99","#3364A1","#3A6AA9","#4371B2","#4B77B9","#537DBE","#5B83C3","#6489C6","#6B8EC8","#7292C9","#7896C9","#7E9ACA","#859ECA","#8BA2C9","#91A6C9","#97A9C9","#9DADC9","#A4B2CA","#AAB6CA","#B1BBCB","#B8BFCD","#BFC5CF","#C7CCD3","#CFD2D8","#D7D9DD","#DEE0E2","#E6E7E9","#EFF0F1","#F7F7F8","#FFFFFF"],categorical:["#030609","#F9F9F9","#507BBC","#163B5E","#A0AFC9","#7B98CA","#27588E","#0E2032","#CACED5","#122D48","#3767A6","#1D4875","#8DA3C9","#E2E3E5","#678BC7","#B4BDCC","#0C151F","#BFC5CF","#97A9C9","#4371B2","#10263D","#080E16","#7292C9","#215081","#2E5F99","#AAB6CA","#ECEDEE","#0D1A28","#143454","#D5D8DC","#5B83C3","#19426A","#859ECA","#13314E","#0E1D2D","#3D6CAC","#6C8FC8","#7795C9","#F3F3F4","#4976B8","#245488","#DBDDE0","#112A43","#92A6C9","#C5C9D2","#809BCA","#0F2337","#3263A0","#050A10","#B9C1CD","#1F4C7B","#183E64","#A5B3CA","#0A121B","#9CACC9","#6187C5","#0D1824","#8AA1CA","#2A5B93","#547EBF","#D1D3D9","#E6E7E9","#1B456F","#B0BACB","#153758","#7494C9","#D8DADE","#6A8DC8","#90A5C9","#99ABC9","#235285","#133251","#060C13","#406EAF","#7E9ACA","#173C61","#4C78BA","#122F4B","#1C4772","#87A0CA","#CED1D7","#C2C7D1","#0F253A","#2C5D96","#C7CCD3","#112B45","#EFF0F1","#6F90C9","#0E1E2F","#ADB8CB","#7997CA","#4673B5","#15395B","#091018","#194067","#30619C","#94A8C9","#F6F6F6","#0F2135","#A3B1CA"]},roma:{discrete:Ue,categorical:Ue},romao:{discrete:Qe,categorical:Qe},tofino:{discrete:Ze,categorical:Ze},tokyo:{discrete:["#1C0E34","#241036","#2D1339","#37163D","#3F1A40","#481E43","#4F2345","#562948","#5D304A","#62354C","#663B4D","#69404E","#6B454F","#6D4B50","#6E4F50","#6F5251","#6F5651","#705951","#715C52","#715F52","#716252","#726452","#726753","#736B53","#736E53","#747153","#757554","#757A54","#767E55","#778355","#788856","#798E57","#7B9558","#7C9B5A","#7EA25C","#81A95E","#84B062","#88B968","#8DC16E","#93CA76","#9BD27F","#A4DA8A","#AFE398","#BAEAA4","#C5EFB0","#CFF4BB","#D8F7C5","#E2F9CF","#E9FBD7","#EFFCDD"],categorical:["#1C0E34","#EFFCDD","#747053","#6C4750","#87B666","#B8E8A1","#512446","#715D52","#798B56","#7D9F5B","#37163D","#726653","#99D07D","#63374C","#6F5451","#D8F7C5","#767C54","#705951","#5B2D49","#7B9558","#441D41","#291238","#E5FAD2","#C9F1B4","#716252","#81AA5F","#683F4E","#736B53","#6E4E50","#757654","#8EC370","#A7DD8E","#778455","#747354","#84B062","#231036","#93CA76","#DFF9CC","#30143A","#A0D785","#7FA45D","#EAFBD8","#6A434F","#C1EDAB","#736D53","#562948","#6D4B50","#7A9057","#7C9A59","#4B2044","#715F52","#663B4D","#D1F4BD","#705651","#8ABD6A","#6E5151","#AFE398","#5F324B","#757954","#3E193F","#726853","#726452","#778055","#705B52","#788756","#61344C","#746E53","#ABE093","#532747","#85B364","#7EA25C","#261137","#736C53","#E8FBD5","#4E2245","#88B968","#798E57","#767E55","#726753","#757754","#715E52","#3A183E","#6E4F51","#778255","#7B9759","#DCF8C9","#EDFCDA","#411B40","#7D9C5A","#767B54","#726352","#6F5551","#726552","#82AD60","#D5F6C1","#34153C","#9CD481","#747454","#C5EFB0","#481E43"]},turku:{discrete:["#000000","#090908","#111110","#181816","#1D1D1A","#22221F","#272723","#2C2C27","#33322B","#38382F","#3D3D32","#424235","#474738","#4E4D3C","#53523E","#585841","#5D5D43","#626246","#686848","#6E6D4B","#73724D","#797750","#7F7D52","#878356","#8E8859","#968E5C","#9D9360","#A79864","#AF9C68","#B69F6C","#BEA270","#C4A474","#CCA579","#D1A67D","#D7A781","#DBA886","#E0A98B","#E6AB92","#EAAD98","#EFB09F","#F2B4A7","#F6B9AE","#F9BFB7","#FBC4BF","#FDC9C6","#FECFCC","#FED4D3","#FFDBDA","#FFE0E0","#FFE6E6"],categorical:["#070707","#FFE6E6","#948D5B","#E5AA90","#4D4C3B","#2C2C27","#C3A374","#6D6C4A","#FBC4BF","#D6A780","#F2B4A7","#1C1C19","#3D3D32","#AC9A67","#7E7C52","#FED6D4","#5D5D43","#35342D","#DDA888","#141312","#55543F","#242420","#FDCDCA","#F7BCB3","#898456","#B8A06D","#ECAE9B","#CDA57A","#FFDEDD","#646447","#454537","#9F9461","#76744E","#71704C","#30302A","#414135","#181816","#FCC8C4","#EFB1A1","#838054","#F5B8AD","#E1A98C","#C8A477","#686848","#595941","#20201D","#8E8859","#D1A67D","#B29D6A","#E9AC95","#BEA270","#FED1CF","#0E0E0D","#A59764","#DAA784","#282823","#F9C0B9","#51503D","#393930","#FFDAD9","#49493A","#606045","#FFE2E1","#9A915E","#797750","#F4B6AA","#F6BAB0","#CBA578","#FFD8D6","#FECFCC","#262622","#C0A272","#868255","#1A1A18","#FAC2BC","#8B8658","#E3AA8E","#161614","#4F4E3C","#C6A475","#2E2E28","#BBA16F","#6B6A49","#E7AB93","#CFA67C","#626246","#53523E","#5B5B42","#FED3D1","#7C7A51","#817E53","#73724D","#FFDCDB","#37372E","#F8BEB6","#0B0B0A","#575740","#DFA98A","#474738","#B59F6C"]},vanimo:{discrete:Je,categorical:Je},vik:{discrete:et,categorical:et},viko:{discrete:tt,categorical:tt}};function at(e){const t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}const nt={waves:"batlow",blksand:"tokyo",breeze:"imola",magma:"batlow",ribbon:"hawaii",stars:"batlow",folds:"imola"},rt={[H.ADVERT]:1,[H.TXT_MSG]:4,[H.GRP_TXT]:2,[H.RESPONSE]:8,[H.REQ]:13,[H.ANON_REQ]:7,[H.ACK]:11,[H.PATH]:24,[H.TRACE]:16,[H.GRP_DATA]:34,[H.MULTIPART]:52,[H.RAW_CUSTOM]:14};function lt(){let e="waves",t=!0;if("undefined"!=typeof window){e=localStorage.getItem("pymc-color-scheme")||"waves";const s=z(e);t=(null==s?void 0:s.meta.isDark)??!0}const s=nt[e]??"batlow",a=st[s],n=a.discrete.length,r=Math.floor(n/2);return{colormap:a,colormapName:s,isDark:t,baseIndex:t?r:0,halfSize:r}}let it=null;function ot(e){const{colormap:t,isDark:s}=lt();if("number"!=typeof e)return s?"#A5A5A5":"#666666";const a=rt[e];if(void 0===a)return s?"#A5A5A5":"#666666";const n=t.categorical;return n[Math.min(a,n.length-1)]}function ct(e){return at(ot(e))}const dt="undefined"!=typeof window&&(null==(t=null==(e=window.matchMedia)?void 0:e.call(window,"(color-gamut: p3)"))?void 0:t.matches);function Ct(){const e=getComputedStyle(document.documentElement);return{fontFamily:e.getPropertyValue("--font-data").trim()||'"JetBrains Mono", ui-monospace, monospace',axisColor:e.getPropertyValue("--chart-axis-tick").trim()||"rgba(255, 255, 255, 0.4)",gridColor:e.getPropertyValue("--chart-grid").trim()||"rgba(255, 255, 255, 0.06)",textMuted:e.getPropertyValue("--text-muted").trim()||"#727272",textPrimary:e.getPropertyValue("--text-primary").trim()||"#FFFFFF"}}const At=["min","max","p75","p95","p99","mean","median","average","midpoint"];function mt(e){const t=at(function(e){const{colormap:t,baseIndex:s,halfSize:a}=lt(),n=Math.max(0,Math.min(1,e)),r=Math.min(s+Math.floor(n*(a-1)),t.discrete.length-1);return t.discrete[r]}(e)),s=`color(display-p3 ${(t.r/255).toFixed(3)} ${(t.g/255).toFixed(3)} ${(t.b/255).toFixed(3)})`;return{...t,p3:s}}function ut(e,t,s,a,n,r,l,i,o,c=null,d=null,C=1,A=null,m="airtime",u=.5){if(0===t.length)return;const D=e.ctx,{left:F,top:B,width:E,height:h}=e.bbox,x=window.devicePixelRatio||1;if(E<=0||h<=0)return;const p=e.data[0],g=p.length;if(0===g)return;const f=p[0],b=p[g-1],y=s,v="share"===m,j=v?function(e){const t=[10,20,25,50,100,200,250,500,1e3],s=e/4.5;for(const a of t)if(a>=s)return a;return e>5e3?1e3*Math.ceil(s/1e3):100*Math.ceil(s/100)}(y):5,N=getComputedStyle(document.documentElement),w=N.getPropertyValue("--signal-critical").trim()||"#EF4444",k=N.getPropertyValue("--bg-body").trim()||"#171717";D.save(),D.fillStyle="#000000";const M=8*x;D.beginPath(),D.roundRect(F,B,E,h,M),D.fill(),D.restore();const S=parseInt(k.slice(1,3),16)||23,T=parseInt(k.slice(3,5),16)||23,$=parseInt(k.slice(5,7),16)||23;if(!v&&y>=20){D.save();const e=B+h*(1-20/y);D.fillStyle=`rgba(${S}, ${T}, ${$}, 0.5)`,D.fillRect(F,B,E,e-B),D.restore()}D.save(),D.lineWidth=1*x,D.setLineDash([4*x,4*x]);for(let R=j;Rs+n)return;const i=getComputedStyle(document.documentElement).getPropertyValue("--text-primary").trim()||"#FFFFFF";e.save(),e.strokeStyle=i,e.globalAlpha=.5,e.lineWidth=1*l,e.setLineDash([4*l,4*l]),e.beginPath(),e.moveTo(Math.round(t)+.5,a),e.lineTo(Math.round(t)+.5,a+r),e.stroke(),e.restore()}(D,A,F,B,E,h,x),l){!function(e,t,s,a,n,r,l=null,i=null,o=1,c=25){const{points:d,rawValues:C,count:A,packetTypes:m,timestamps:u}=t,D=1*o*(window.devicePixelRatio||1);e.globalCompositeOperation="source-over";const F=l?parseInt(l.replace("TYPE_",""),10):null;for(let B=0;B=i.start&&e0&&function(e,t,s,a,n,r,l,i,o,c,d=.5){if(0===t.length)return;const C=o-i||1,A=function(e,t=1.3,s=.15){const a=function(e){const t=e.match(/color\(display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/);if(t){const e=parseFloat(t[1]),s=parseFloat(t[2]),a=parseFloat(t[3]);return{r:Math.round(255*e),g:Math.round(255*s),b:Math.round(255*a),p3r:e,p3g:s,p3b:a}}if(e.startsWith("#")){const t=e.replace("#",""),s=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16);return{r:s,g:a,b:n,p3r:s/255,p3g:a/255,p3b:n/255}}const s=e.match(/rgba?\(([\d.]+),?\s*([\d.]+),?\s*([\d.]+)/);if(s){const e=Math.round(parseFloat(s[1])),t=Math.round(parseFloat(s[2])),a=Math.round(parseFloat(s[3]));return{r:e,g:t,b:a,p3r:e/255,p3g:t/255,p3b:a/255}}return{r:255,g:255,b:255,p3r:1,p3g:1,p3b:1}}(e),n=function(e,t,s,a=1.25,n=.15){const r=(Math.max(e,t,s)+Math.min(e,t,s))/2;return{p3r:Math.min(1,r+(e-r)*a+n),p3g:Math.min(1,r+(t-r)*a+n),p3b:Math.min(1,r+(s-r)*a+n)}}(a.p3r,a.p3g,a.p3b,t,s);return{r:Math.round(255*Math.min(1,n.p3r)),g:Math.round(255*Math.min(1,n.p3g)),b:Math.round(255*Math.min(1,n.p3b)),p3r:Math.min(1,n.p3r),p3g:Math.min(1,n.p3g),p3b:Math.min(1,n.p3b)}}(getComputedStyle(document.documentElement).getPropertyValue("--signal-critical").trim()||"#EF4444");e.save(),e.globalAlpha=d,e.fillStyle=dt?`color(display-p3 ${A.p3r} ${A.p3g} ${A.p3b})`:`rgb(${A.r}, ${A.g}, ${A.b})`;for(const m of t){if(m.endTso)continue;const t=a+(Math.max(m.startTs,i)-i)/C*r,s=a+(Math.min(m.endTs,o)-i)/C*r,d=Math.max(s-t,2*c);e.fillRect(t,n,d,l)}e.restore()}(D,i,0,F,B,E,h,f,b,x,d?Math.max(.03,.03*u):u)}const Dt=r.memo(function({data:e,maxValue:t,visibleLines:s=At,highlightedLine:a=null,onHover:l,scatterData:i=null,noiseFloorAnomalies:o=null,showNoiseFloorOverlay:c=!1,overlayOpacity:d=.5,highlightedType:C=null,hoveredTimeRange:A=null,timeRangeHours:m=24,yAxisMode:u="airtime"}){const D=r.useRef(null),F=r.useRef(null),B=r.useRef(e),E=r.useRef(t),h=r.useRef(s),x=r.useRef(a),p=r.useRef(l),g=r.useRef(i),f=r.useRef(o),b=r.useRef(c),y=r.useRef(C),v=r.useRef(A),j=r.useRef(null),N=r.useRef(null),w=r.useRef(u),k=r.useRef(d),M=m<=12?1.2:1,S=r.useRef(M),T=r.useRef(e.length);r.useLayoutEffect(()=>{B.current=e,E.current=t,h.current=s,x.current=a,p.current=l,g.current=i,f.current=o,b.current=c,y.current=C,v.current=A,S.current=M,w.current=u,k.current=d}),r.useEffect(()=>{j.current=Ct()},[]);const $=r.useMemo(()=>[e.map(e=>e.timestamp),new Array(e.length).fill(1)],[e]),P=r.useMemo(()=>({hooks:{draw:e=>{const t=j.current||Ct();ut(e,B.current,E.current,h.current,x.current,t,g.current,f.current,b.current,y.current,v.current,S.current,N.current,w.current,k.current)}}}),[]),L=r.useMemo(()=>({width:400,height:200,padding:[8,0,8,28],cursor:{show:!1,x:!1,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],plugins:[P]}),[P]);r.useEffect(()=>{const t=D.current;if(!t||0===e.length)return;const s=T.current,a=e.length,n=Math.abs(a-s);if(!(!F.current||n>100||s>0&&n/s>.1)&&F.current)return F.current.setData($),void(T.current=a);F.current&&F.current.destroy();const r=t.getBoundingClientRect(),l=Math.floor(r.width)||400,i=Math.floor(r.height)||200,o=new R({...L,width:l,height:i},$,t);return F.current=o,T.current=a,()=>{o.destroy(),F.current=null}},[L,$,e.length]),r.useEffect(()=>{const e=D.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!F.current)return;const{width:s,height:a}=t.contentRect;s>0&&a>0&&F.current.setSize({width:Math.floor(s),height:Math.floor(a)})});return t.observe(e),()=>{t.disconnect()}},[]),r.useEffect(()=>{F.current&&F.current.redraw()},[a,s,e,i,o,c,d,C,A,M]);const _=r.useCallback(t=>{var s,a;const n=D.current,r=F.current;if(!n||!r||0===e.length)return;const l=n.getBoundingClientRect(),i=t.clientX-l.left,o=window.devicePixelRatio||1,c=r.bbox,d=c.left/o,C=c.width/o;if(id+C)return N.current=null,r.redraw(),void(null==(s=p.current)||s.call(p,null));N.current=i*o;const A=(i-d)/C,m=e.length,u=Math.floor(A*m),B=Math.max(0,Math.min(m-1,u));r.redraw(),null==(a=p.current)||a.call(p,B)},[e.length]),z=r.useCallback(()=>{var e;N.current=null,F.current&&F.current.redraw(),null==(e=p.current)||e.call(p,null)},[]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:D,className:"w-full h-full rounded-lg overflow-hidden",onMouseMove:_,onMouseLeave:z})}),Ft=function(e){const t=ot(e);return null===it&&(it=_()),it?L(t):t},Bt=new class{constructor(){a(this,"buckets",new Map),a(this,"lastProcessedTimestamp",0),a(this,"processedPacketCount",0),a(this,"cacheKey",null),a(this,"bucketDuration",60),a(this,"bucketDurationMs",6e4)}getBuckets(e,t,s,a){const n={startTs:t,endTs:s,radioConfigHash:this.hashRadioConfig(a)};return this.isCacheValid(n)?this.processPackets(e,t,s,a,!1):(this.invalidate(n),this.processPackets(e,t,s,a,!0)),this.toBucketDataArray(t,s)}processPackets(e,t,s,a,n){const r=Math.ceil((s-t)/this.bucketDuration);let l=0;for(const i of e){const e=i.timestamp;if(e=s)continue;if(!n&&e<=this.lastProcessedTimestamp)continue;const o=Math.min(Math.floor((e-t)/this.bucketDuration),r-1),c=this.buckets.get(o)??{total:0,totalAirtime:0};c.total+=1;const d=$(i);c.totalAirtime+=P(d,{spreadingFactor:a.sf,bandwidthHz:a.bw,codingRate:a.cr,preambleLength:a.preamble}),this.buckets.set(o,c),e>this.lastProcessedTimestamp&&(this.lastProcessedTimestamp=e),l++}this.processedPacketCount+=l}toBucketDataArray(e,t){const s=t-e,a=Math.ceil(s/this.bucketDuration),n=s/3600,r=[];for(let l=0;l24?s.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),i=this.buckets.get(l)??{total:0,totalAirtime:0};r.push({timestamp:t,time:a,total:i.total,totalAirtime:i.totalAirtime,bucketDurationMs:this.bucketDurationMs})}return r}isCacheValid(e){return!!this.cacheKey&&this.cacheKey.startTs===e.startTs&&this.cacheKey.endTs===e.endTs&&this.cacheKey.radioConfigHash===e.radioConfigHash}invalidate(e){this.buckets.clear(),this.lastProcessedTimestamp=0,this.processedPacketCount=0,this.cacheKey=e}hashRadioConfig(e){return`${e.sf}-${e.bw}-${e.cr}-${e.preamble}`}clear(){this.buckets.clear(),this.lastProcessedTimestamp=0,this.processedPacketCount=0,this.cacheKey=null}getStats(){return{bucketCount:this.buckets.size,processedPackets:this.processedPacketCount,lastTimestamp:this.lastProcessedTimestamp,cacheKey:this.cacheKey}}};function Et(e){return I[e]??`TYPE_${e.toString(16).toUpperCase()}`}const ht={sf:10,bw:25e4,cr:5,preamble:8};function xt(e,t){if(0===e.length)return[];const s=Math.floor((t-1)/2),a=[];for(let n=0;n=s?e[n-s]:e[0];a.push(e[n]+(e[n]-t))}return function(e,t){if(0===e.length)return[];const s=2/(t+1),a=[e[0]];for(let n=1;n{if(!l)return null;const e=new Map;for(const t of l.items)e.set(t.key,t.value);return e},[l]),o=null!==i;return n.jsx("div",{className:"flex-shrink-0 pt-3 mt-2",children:n.jsx("div",{className:"grid ml-9 gap-y-0.5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(105px, 1fr))"},onMouseLeave:()=>s(null),children:e.map(e=>{const r=Ft(e.typeNum),l=(null==i?void 0:i.get(e.key))??0,c=a.get(e.key)??0,d=o?l:c,C=d>1e-4,A=t===e.key,m=t&&t!==e.key;let u="legend-item";return A?u+=" legend-item-active":m?u+=" legend-item-dimmed":o&&l>1e-4?u+=" legend-item-chart-active":o&&l<=1e-4&&(u+=" legend-item-dimmed"),n.jsxs("div",{className:u,onMouseEnter:()=>s(e.key),children:[n.jsx("div",{className:"flex-shrink-0",style:{backgroundColor:r,width:9,height:16,borderRadius:1}}),n.jsx("span",{className:"legend-label",children:e.label}),C&&n.jsxs("span",{className:"legend-value "+(o?"legend-value-live":""),children:[(100*d).toFixed(1),"%"]})]},e.key)})})})}function gt({x:e,y:t,width:s,height:a,name:r,size:l,index:i,depth:o,hoveredIndex:c,onHover:d,total:C,typeNum:A}){if(1!==o)return null;const m=null!==c&&!(c===i),u=Ft(A),D=C>0?l/C*100:0,F=s>36&&a>20,B=s>36&&a>32;return n.jsxs("g",{onMouseEnter:e=>d(i,e),onMouseLeave:()=>d(null),style:{cursor:"default"},children:[n.jsx("rect",{x:e,y:t,width:s,height:a,fill:u,opacity:m?.4:1,stroke:"rgba(0,0,0,0.2)",strokeWidth:1,rx:3,style:{transition:"opacity 150ms ease"}}),F&&n.jsxs(n.Fragment,{children:[B&&n.jsxs("text",{x:e+4,y:t+a-4-11,textAnchor:"start",dominantBaseline:"auto",fill:"rgba(0,0,0,0.6)",fontSize:8,fontFamily:W,fontWeight:500,style:{pointerEvents:"none"},children:[D.toFixed(1),"%"]}),n.jsx("text",{x:e+4,y:t+a-4,textAnchor:"start",dominantBaseline:"auto",fill:"rgba(0,0,0,0.85)",fontSize:9,fontFamily:W,fontWeight:600,style:{pointerEvents:"none"},children:r})]})]})}function ft({data:e,total:t,color:s,position:a,containerWidth:r}){if(!e||!a)return null;const l=(e.value/t*100).toFixed(1),i=r-a.x<184?Math.max(8,a.x-160-8):a.x+16;return n.jsx("div",{className:"absolute z-50 pointer-events-none",style:{left:i,top:Math.max(8,a.y-60)},children:n.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 shadow-xl min-w-[140px]",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:s}}),n.jsx("span",{className:"type-data-sm font-semibold text-text-primary",children:e.name})]}),n.jsxs("div",{className:"space-y-0.5 type-data-xs text-text-muted",children:[n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Count"}),n.jsx("span",{className:"text-text-primary tabular-nums font-medium",children:e.value.toLocaleString()})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Share"}),n.jsxs("span",{className:"text-text-primary tabular-nums font-medium",children:[l,"%"]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{children:"Total"}),n.jsx("span",{className:"text-text-primary tabular-nums font-medium",children:t.toLocaleString()})]})]})]})})}function bt({sortedTypes:e,aggregateShares:t}){var s,a,l;const[i,o]=r.useState(null),[c,d]=r.useState(null),[C,A]=r.useState(0),[m,u]=r.useState(null),D=r.useRef(null),B=r.useMemo(()=>e.reduce((e,t)=>e+t.totalCount,0),[e]),E=r.useMemo(()=>e.map((e,t)=>({name:e.label,size:e.totalCount,index:t,typeNum:e.typeNum,key:e.key})),[e]),h=r.useCallback((e,t)=>{if(o(e),t&&null!==e){const e=D.current;if(e){const s=e.getBoundingClientRect();A(s.width),d({x:t.clientX-s.left,y:t.clientY-s.top})}}else d(null)},[]),x=r.useCallback(e=>{if(u(e),e){const t=E.findIndex(t=>t.key===e);o(t>=0?t:null)}else o(null)},[E]),p=null!==i?{name:(null==(s=E[i])?void 0:s.name)??"",value:(null==(a=E[i])?void 0:a.size)??0}:null,g=null!==i?Ft(null==(l=E[i])?void 0:l.typeNum):"";return 0===e.length||0===B?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet type data available"})]}):n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"analyzer-chart-height relative flex-shrink-0",ref:D,children:[n.jsx(ue,{width:"100%",height:"100%",children:n.jsx(De,{data:E,dataKey:"size",aspectRatio:4/3,stroke:"none",isAnimationActive:!1,content:n.jsx(gt,{x:0,y:0,width:0,height:0,name:"",size:0,index:0,depth:0,hoveredIndex:i,onHover:h,total:B,typeNum:0})})}),n.jsx(ft,{data:p,total:B,color:g,position:c,containerWidth:C})]}),n.jsx(pt,{sortedTypes:e,highlightedType:m,onTypeHover:x,aggregateShares:t})]})}function yt(e){const{values:t,sum:s}=e;if(0===t.length)return{min:0,mean:0,median:0,p75:0,p95:0,p99:0,max:0};const a=[...t].sort((e,t)=>e-t),n=a.length,r=s/n,l=a[0],i=a[n-1],o=e=>{const t=Math.min(Math.ceil(e*n)-1,n-1);return a[Math.max(0,t)]};return{min:l,mean:r,median:n%2==0?(a[n/2-1]+a[n/2])/2:a[Math.floor(n/2)],p75:o(.75),p95:o(.95),p99:o(.99),max:i}}function vt({statsBuckets:e,mode:t,packets:s,startTs:a,endTs:l,radioConfig:i,sortedTypes:o,aggregateShares:c,noiseFloorAnomalies:d,showNoiseFloorOverlay:C,overlayOpacity:A=.5}){const[m,u]=r.useState(null),[D,B]=r.useState(null),E=r.useMemo(()=>(l-a)/3600,[a,l]),h=r.useCallback(e=>{B(e)},[]),x=function(e,t,s,a,n){return r.useMemo(()=>{if(0===e.length||!n)return null;const r=e.filter(e=>e.timestamp>=t&&e.timestamp<=s);if(0===r.length)return null;const l=[],i=new Map;for(const e of r){const s=e.type??e.payload_type??-1,r=$(e);let o;if(o="airtime"===a?P(r,{spreadingFactor:n.sf,bandwidthHz:n.bw,codingRate:n.cr,preambleLength:n.preamble}):1,r<=0)continue;const c=Math.floor((e.timestamp-t)/300),d={timestamp:e.timestamp,airtimeMs:o,byteSize:r,packetType:s,bucketIndex:c};l.push(d),i.has(c)||i.set(c,[]),i.get(c).push(d)}if(0===l.length)return null;const o=[],c=[],d=[],C=new Map;if("share"===a)for(const[,e]of i)for(const t of e)C.set(t,t.byteSize);else for(const[,e]of i){const t=e.reduce((e,t)=>e+t.airtimeMs,0)/3e5*100,s=Math.max(...e.map(e=>e.airtimeMs));for(const a of e){const e=a.airtimeMs/s*t;C.set(a,e)}}for(const e of l){const t=C.get(e);void 0!==t&&(o.push(t),c.push(e.timestamp),d.push(e.packetType))}const A=Math.min(...c),m=Math.max(...c),u=m-A||1,D=[...o].sort((e,t)=>e-t),F=D[0],B=D[D.length-1],E=Math.floor(.05*D.length),h=Math.floor(.5*D.length),x=Math.min(Math.ceil(.95*D.length),D.length-1),p=D[E],g=D[h],f=D[x],b=new Map;for(const e of o){const t=Math.round(100*e)/100;b.set(t,(b.get(t)??0)+1)}const y=b.size,v=[...b.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({value:e,count:t,percent:t/o.length*100}));let j;if("share"===a)j=200;else{const e=5,t=Math.ceil(B/e)*e;j=t<=10?10:t+e}const N=new Float32Array(2*o.length),w=new Float32Array(o.length),k=new Uint8Array(o.length),M=new Float32Array(o.length);for(let e=0;e=0?d[e]:255,M[e]=c[e]}return{points:N,rawValues:w,packetTypes:k,timestamps:M,count:o.length,minTime:A,maxTime:m,minValue:0,maxValue:j,rawMinValue:F,rawMaxValue:B,unit:"%",stats:{p5:p,p50:g,p95:f,uniqueValues:y,topValues:v}}},[e,t,s,a,n])}(s,a,l,"share"===t?"share":"airtime",i),{data:p}=r.useMemo(()=>function(e,t){var s;const a=e.length;if(0===a)return{data:[],windowSize:0,windowDurationMs:0};const n=(null==(s=e[0])?void 0:s.bucketDurationMs)??1e3,r=Math.min(Math.max(5,Math.round(3e5/n)),a),l=Math.floor(r/2),i=[];let o=0,c=0;for(let d=0;dp.map(e=>({timestamp:e.timestamp,min:e.min,max:e.max,p75:e.p75,p95:e.p95,p99:e.p99,mean:e.mean,median:e.median,average:e.average,midpoint:e.midpoint})),[p]),f=r.useMemo(()=>(null==x?void 0:x.maxValue)?x.maxValue:"share"===t?200:10,[x,t]),b=r.useCallback(e=>{u(e)},[]),y=r.useMemo(()=>{if(null===m||!p[m])return null;const e=p[m];let t;t=E>=168?75:E>=72?35:E>=24?15:E>=3?10:5;const s=60*t/2,a=e.timestamp;return{start:a-s,end:a+s}},[m,p,E]),v=r.useMemo(()=>{if(null===m||!p[m]||!y)return null;const e=p[m].time,{start:a,end:n}=y,r=s.filter(e=>e.timestamp>=a&&e.timestamp({key:e.key,label:e.label,value:0,color:Ft(e.typeNum)}))};const l=new Map,c=new Map;let d=0,C=0;for(const t of r){const e=`TYPE_${t.type??t.payload_type??-1}`;if(l.set(e,(l.get(e)??0)+1),d++,i){const s=$(t),a=P(s,{spreadingFactor:i.sf,bandwidthHz:i.bw,codingRate:i.cr,preambleLength:i.preamble});c.set(e,(c.get(e)??0)+a),C+=a}}const A=o.map(e=>{let s;return s="airtime"===t?C>0?(c.get(e.key)??0)/C:0:d>0?(l.get(e.key)??0)/d:0,{key:e.key,label:e.label,value:s,color:Ft(e.typeNum)}});return{timestamp:p[m].timestamp,timeLabel:e,items:A}},[m,p,y,s,o,t,i]);if(0===p.length)return n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]});const j=(null==v?void 0:v.timeLabel)??null;return n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"analyzer-chart-height relative flex-shrink-0",children:[n.jsx("div",{className:"absolute inset-0 rounded-lg overflow-hidden",children:n.jsx(Dt,{data:g,maxValue:f,onHover:b,scatterData:x,noiseFloorAnomalies:d,showNoiseFloorOverlay:C,overlayOpacity:A,highlightedType:D,hoveredTimeRange:y,timeRangeHours:E,yAxisMode:"share"===t?"share":"airtime"})}),j&&n.jsx("div",{className:"absolute top-1 right-1 px-2 py-0.5 bg-bg-elevated/90 rounded text-xs text-accent-secondary font-mono pointer-events-none",children:j})]}),n.jsx(pt,{sortedTypes:o,highlightedType:D,onTypeHover:h,aggregateShares:c,hoverData:v})]})}function jt({active:e,payload:t,label:s,mode:a}){if(!e||!t||0===t.length)return null;const r=t.filter(e=>null!==e.value&&void 0!==e.value);if(0===r.length)return null;const l=s?new Date(1e3*s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):"";return n.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm shadow-xl",children:[n.jsx("div",{className:"font-medium text-text-primary mb-1 font-mono",children:l}),r.map((e,t)=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:e.color}}),n.jsxs("span",{className:"text-text-muted",children:[e.name,":"]}),n.jsx("span",{className:"text-text-primary tabular-nums font-mono",children:"share"===a?`${Number(e.value).toLocaleString()} B`:`${Number(e.value).toFixed(2)}%`})]},t))]})}function Nt(e){return e>=1e9?`${(e/1e9).toFixed(1)}G`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function wt({packets:e,mode:t,startTs:s,endTs:a,radioConfig:l,bucketCount:i}){const o=oe(),c=ce(),d=o.primary,C=o.tertiary,[A,m]=r.useState(null),{trendData:u,totals:D}=r.useMemo(()=>{if(0===e.length)return{trendData:[],totals:{rxBytes:0,txBytes:0,rxAirtime:0,txAirtime:0},actualBucketCount:0};const n=a-s,r=Math.min(Math.ceil(n/300),i),o=n/r,c=1e3*o,d=[];for(let e=0;e=a)continue;const n=Math.min(Math.floor((e-s)/o),r-1),i=$(t),c=P(i,{spreadingFactor:l.sf,bandwidthHz:l.bw,codingRate:l.cr,preambleLength:l.preamble});t.transmitted?(d[n].txBytes+=i,d[n].txAirtime+=c,A+=i,u+=c):(d[n].rxBytes+=i,d[n].rxAirtime+=c,C+=i,m+=c)}return{trendData:d.map(e=>{if("share"===t)return{timestamp:e.timestamp,rx:e.rxBytes>0?e.rxBytes:null,tx:e.txBytes>0?e.txBytes:null};{const t=c>0?e.rxAirtime/c*100:0,s=c>0?e.txAirtime/c*100:0;return{timestamp:e.timestamp,rx:t>0?t:null,tx:s>0?s:null}}}),totals:{rxBytes:C,txBytes:A,rxAirtime:m,txAirtime:u}}},[e,s,a,i,t,l,300]),E=r.useMemo(()=>{if(0===u.length)return"share"===t?100:10;let e=0;for(const t of u){const s=t.rx??0,a=t.tx??0;s>e&&(e=s),a>e&&(e=a)}const s=1.1*e;return"share"===t?s<=100?100:s<=500?100*Math.ceil(s/100):s<=1e3?200*Math.ceil(s/200):s<=5e3?500*Math.ceil(s/500):s<=1e4?1e3*Math.ceil(s/1e3):5e3*Math.ceil(s/5e3):Math.max(1,Math.ceil(s))},[u,t]),h=r.useMemo(()=>{if(null!==A&&u[A]){const e=u[A],s=e.rx??0,a=e.tx??0;return"share"===t?{rx:Nt(s),tx:Nt(a),total:Nt(s+a),isHovered:!0}:{rx:`${s.toFixed(2)}%`,tx:`${a.toFixed(2)}%`,total:`${(s+a).toFixed(2)}%`,isHovered:!0}}if("share"===t)return{rx:Nt(D.rxBytes),tx:Nt(D.txBytes),total:Nt(D.rxBytes+D.txBytes),isHovered:!1};{let e=0,t=0,s=0;for(const r of u)null===r.rx&&null===r.tx||(e+=r.rx??0,t+=r.tx??0,s++);const a=s>0?e/s:0,n=s>0?t/s:0;return{rx:`${a.toFixed(2)}%`,tx:`${n.toFixed(2)}%`,total:`${(a+n).toFixed(2)}%`,isHovered:!1}}},[A,u,D,t]),x=r.useMemo(()=>{const e=a-s,t=e/3600;return[0,.25,.5,.75,1].map(a=>{const n=new Date(1e3*(s+e*a)),r=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),l=n.toLocaleDateString([],{weekday:"short"});return{pct:a,label:t>24?`${l} ${r}`:r}})},[s,a]),p=r.useCallback(e=>{const t=null==e?void 0:e.activeTooltipIndex;m("number"==typeof t?t:null)},[]),g=r.useCallback(e=>"share"===t?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toFixed(0):`${e.toFixed(0)}%`,[t]);return 0===u.length?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]}):n.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n.jsx("div",{className:"flex items-center flex-shrink-0 text-text-secondary",style:{height:20,paddingLeft:44,paddingRight:8},children:n.jsx("div",{className:"relative w-full h-full flex items-center",children:x.map((e,t)=>n.jsxs("div",{className:"absolute flex items-center gap-1 type-data-xs",style:{left:100*e.pct+"%",transform:0===e.pct?"translateX(0)":1===e.pct?"translateX(-100%)":"translateX(-50%)"},children:[n.jsx(B,{className:"w-2.5 h-2.5 opacity-60"}),n.jsx("span",{className:"tabular-nums",children:e.label})]},t))})}),n.jsx("div",{className:"flex-1 min-h-0 relative",children:n.jsx(ue,{width:"100%",height:"100%",minWidth:1,minHeight:1,children:n.jsxs(Fe,{data:u,margin:{top:4,right:8,bottom:4,left:0},onMouseMove:p,onMouseLeave:()=>m(null),children:[n.jsx(Be,{strokeDasharray:"3 3",stroke:c.secondary,strokeOpacity:.3,vertical:!1}),n.jsx(Ee,{dataKey:"timestamp",type:"number",domain:[s,a],axisLine:!1,tickLine:!1,tick:!1,height:0}),n.jsx(he,{axisLine:!1,tickLine:!1,tick:{fill:c.secondary,fontSize:10,fontFamily:W},dx:-8,width:44,tickFormatter:g,domain:[0,E]}),n.jsx(xe,{content:n.jsx(jt,{mode:t})}),n.jsx(pe,{type:"linear",dataKey:"rx",name:"RX",stroke:d,strokeWidth:2.5,strokeOpacity:.9,dot:!1,connectNulls:!1,isAnimationActive:!1}),n.jsx(pe,{type:"linear",dataKey:"tx",name:"TX",stroke:C,strokeWidth:2.5,strokeOpacity:.9,dot:!1,connectNulls:!1,isAnimationActive:!1})]})})}),n.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between mt-2",children:[n.jsxs("div",{className:"flex items-center gap-4 text-xs font-mono pl-11",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:d}}),n.jsx("span",{className:"text-text-secondary",children:"RX"})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:C}}),n.jsx("span",{className:"text-text-secondary",children:"TX"})]}),n.jsx("span",{className:"text-text-secondary",children:"share"===t?"Bytes":"Utilization"})]}),n.jsxs("div",{className:"text-right pr-2",children:[n.jsx("span",{className:"font-mono font-bold text-xl text-text-primary",children:h.total}),n.jsx("span",{className:"text-xs text-text-secondary ml-2",children:h.isHovered?"bucket":"mean"})]})]})]})}function kt({mode:e,onChange:t}){return n.jsxs("div",{className:"toggle-group toggle-group-sm",children:[n.jsx("button",{onClick:()=>t("share"),className:"toggle-group-item "+("share"===e?"active":""),children:"Total"}),n.jsx("button",{onClick:()=>t("airtime"),className:"toggle-group-item "+("airtime"===e?"active":""),children:"Airtime"})]})}function Mt({enabled:e,onChange:t,anomalyCount:s=0,showTuning:a=!1,onTuningChange:r}){return n.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[e&&r&&n.jsx("button",{onClick:()=>r(!a),className:"toggle-group toggle-group-sm "+(a?"active":""),title:a?"Hide tuning panel":"Show tuning panel",children:n.jsx("span",{className:"toggle-group-item "+(a?"active":""),children:n.jsx(l,{className:"w-3.5 h-3.5"})})}),n.jsx("button",{onClick:()=>t(!e),className:"toggle-group toggle-group-sm "+(e?"active":""),title:e?"Hide noise floor anomalies":"Show noise floor anomalies",children:n.jsx("span",{className:"toggle-group-item "+(e?"active":""),children:n.jsx(i,{className:"w-3.5 h-3.5"})})}),s>0&&n.jsx("span",{className:"absolute -top-2 -right-2 min-w-[18px] h-[18px] px-1 rounded-full bg-accent-danger text-white text-[10px] font-bold flex items-center justify-center pointer-events-none z-10",children:s>99?"99+":s})]})}function St({smoothing:e,onChange:t}){return n.jsxs("div",{className:"toggle-group toggle-group-sm",children:[n.jsx("button",{onClick:()=>t("stats"),className:"toggle-group-item "+("stats"===e?"active":""),title:"Statistics view (scatter plot)",children:n.jsx(o,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("trend"),className:"toggle-group-item "+("trend"===e?"active":""),title:"Trend line chart",children:n.jsx(c,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("raw"),className:"toggle-group-item "+("raw"===e?"active":""),title:"No smoothing (raw values)",children:n.jsx(d,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("zlema"),className:"toggle-group-item "+("zlema"===e?"active":""),title:"6-period Zero-Lag EMA (light smoothing)",children:n.jsx(C,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("ema"),className:"toggle-group-item "+("ema"===e?"active":""),title:"12-period Zero-Lag EMA (moderate smoothing)",children:n.jsx(A,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("smooth"),className:"toggle-group-item "+("smooth"===e?"active":""),title:"24-period Zero-Lag EMA (heavy smoothing)",children:n.jsx(m,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("ultra"),className:"toggle-group-item "+("ultra"===e?"active":""),title:"96-period Zero-Lag EMA (ultra smoothing)",children:n.jsx(u,{className:"w-3.5 h-3.5"})}),n.jsx("button",{onClick:()=>t("mosaic"),className:"toggle-group-item "+("mosaic"===e?"active":""),title:"Mosaic view (treemap chart)",children:n.jsx(D,{className:"w-3.5 h-3.5"})})]})}const Tt=r.memo(function({packets:e,startTs:t,endTs:s,bucketCount:a,radioConfig:l=ht,mode:i="share",smoothing:o="raw",noiseFloorAnomalies:c=null,showNoiseFloorOverlay:d=!1,overlayOpacity:C=.5}){const A=ie(),[m,u]=r.useState(null),[D,B]=r.useState([]),E=r.useRef(null),h=r.useRef(0);r.useEffect(()=>{const t=Math.abs(e.length-h.current);if(0===t&&D.length>0)return;E.current&&clearTimeout(E.current);const s=t>100?50:500;return E.current=setTimeout(()=>{h.current=e.length,B(e)},s),()=>{E.current&&clearTimeout(E.current)}},[e,D.length]);const x=r.useMemo(()=>function(e){const t=new Map;for(const a of e){const e=a.type??a.payload_type??-1;t.set(e,(t.get(e)??0)+1)}const s=[];for(const[a,n]of t)s.push({typeNum:a,key:`TYPE_${a}`,label:Et(a),totalCount:n});return s.sort((e,t)=>t.totalCount-e.totalCount)}(D),[D]),p=r.useMemo(()=>function(e,t,s,a,n,r){const l=s-t,i=l/a,o=1e3*i,c=[];for(let d=0;d24?s.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});c.push({timestamp:e,time:a,counts:{},shares:{},airtimes:{},total:0,totalAirtime:0,bucketDurationMs:o});for(const t of r)c[d].counts[t.key]=0,c[d].airtimes[t.key]=0}for(const d of e){const e=d.timestamp;if(e=s)continue;const r=Math.min(Math.floor((e-t)/i),a-1),l=`TYPE_${d.type??d.payload_type??-1}`;c[r].counts[l]=(c[r].counts[l]??0)+1,c[r].total++;const o=$(d),C=P(o,{spreadingFactor:n.sf,bandwidthHz:n.bw,codingRate:n.cr,preambleLength:n.preamble});c[r].airtimes[l]=(c[r].airtimes[l]??0)+C,c[r].totalAirtime+=C}for(const d of c)for(const e of r)d.total>0?d.shares[e.key]=d.counts[e.key]/d.total*100:d.shares[e.key]=0;return c}(D,t,s,a,l,x),[D,t,s,a,l,x]),g=r.useMemo(()=>Bt.getBuckets(D,t,s,l),[D,t,s,l]),f=r.useMemo(()=>x.reduce((e,t)=>e+t.totalCount,0),[x]),{sortedTypes:b,aggregateShares:y}=r.useMemo(()=>{const e=new Map;if("share"===i){if(f>0)for(const t of x)e.set(t.key,t.totalCount/f)}else{let t=0;const s=new Map;for(const e of p){t+=e.totalAirtime;for(const t of x){const a=s.get(t.key)??0;s.set(t.key,a+(e.airtimes[t.key]??0))}}if(t>0)for(const a of x)e.set(a.key,(s.get(a.key)??0)/t)}return{sortedTypes:[...x].sort((t,s)=>{const a=e.get(t.key)??0;return(e.get(s.key)??0)-a}),aggregateShares:e}},[x,f,i,p]),v=r.useMemo(()=>function(e,t,s,a="raw"){const n=function(e,t,s){if(e.length<=360)return e;const a=Math.ceil(e.length/360),n=[];for(let r=0;r0?l.counts[e.key]/l.total*100:0;n.push(l)}return n}(e,0,s),r=n.length,l=s.length,i=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;A0?(e.counts[a]??0)/e.total:0}else{let t=0;for(let a=0;a0?r/t:0}}}const o=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;Afunction(e,t){switch(t){case"zlema":return xt(e,6);case"ema":return xt(e,12);case"smooth":return xt(e,24);case"ultra":return xt(e,96);default:return e}}(e,a)),d=Array.from({length:l},()=>new Array(r).fill(0));for(let A=0;A0?c[A-1][e]:0;let s=c[A][e]-t;s<0&&(s=0),s>1&&(s=1),d[A][e]=s}for(let A=0;A0&&Math.abs(e-1)>1e-6){const t=1/e;for(let e=0;e{u(e)},[]),[N,w]=r.useState(null),k=r.useCallback(e=>{w(e)},[]),M=r.useMemo(()=>{if(null===N||!v[N])return null;const e=v[N];return{timestamp:e.timestamp,timeLabel:e.time,items:b.map(t=>({key:t.key,label:t.label,value:e[t.key]??0,color:Ft(t.typeNum)}))}},[N,v,b]),S=r.useMemo(()=>({timestamps:v.map(e=>e.timestamp),series:b.map(e=>({key:e.key,label:e.label,color:Ft(e.typeNum),values:v.map(t=>t[e.key]??0)}))}),[v,b]);return 0===D.length?0===e.length?n.jsxs("div",{className:"h-full flex items-center justify-center text-text-muted",children:[n.jsx(F,{className:"w-6 h-6 mr-2 opacity-50"}),n.jsx("span",{children:"No packet data available"})]}):null:"mosaic"===o?n.jsx(bt,{sortedTypes:b,aggregateShares:y}):"stats"===o?n.jsx(vt,{statsBuckets:g,mode:i,packets:D,startTs:t,endTs:s,radioConfig:l,sortedTypes:b,aggregateShares:y,noiseFloorAnomalies:c,showNoiseFloorOverlay:d,overlayOpacity:C}):"trend"===o?n.jsx(wt,{packets:D,mode:i,startTs:t,endTs:s,radioConfig:l,bucketCount:a}):n.jsxs("div",{className:"flex flex-col",children:[n.jsx("div",{className:"analyzer-chart-height relative flex-shrink-0",children:n.jsx("div",{className:"absolute inset-0 rounded-lg overflow-hidden",children:n.jsx(O,{timestamps:S.timestamps,series:S.series,highlightedKey:m,cursorColor:A.cursor,onHover:k})})}),n.jsx(pt,{sortedTypes:b,highlightedType:m,onTypeHover:j,aggregateShares:y,hoverData:M})]})}),$t={"1x":1,"2x":2,"4x":4,"8x":8,"16x":16,"36x":36},Pt=[1,5,10,25,50,100,150];function Rt(e,t,s,a){const n=Math.PI/180,r=(a-t)*n,l=e*n,i=s*n,o=Math.sin(r)*Math.cos(i),c=Math.cos(l)*Math.sin(i)-Math.sin(l)*Math.cos(i)*Math.cos(r);return(180*Math.atan2(o,c)/Math.PI+360)%360}function Lt(e,t,s,a){const n=Math.PI/180,r=(s-e)*n,l=(a-t)*n,i=Math.sin(r/2)**2+Math.cos(e*n)*Math.cos(s*n)*Math.sin(l/2)**2;return 12742*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))}const _t=[{min:10,label:"Excellent"},{min:7,label:"Very Good"},{min:4,label:"Good"},{min:1,label:"Fair+"},{min:-2,label:"Fair"},{min:-5,label:"Fair-"},{min:-8,label:"Poor"},{min:-11,label:"Bad"},{min:-1/0,label:"Critical"}];function zt(e,t){return t[Ae(e)]||"#808080"}const Ht=r.memo(function({neighbors:e,quickNeighbors:t,localLat:s,localLon:a,onStatsChange:l}){const[i,o]=r.useState(null),[c,d]=r.useState(new Set),[C,A]=r.useState({width:0,height:0}),[m,u]=r.useState("1x"),[D,F]=r.useState(1),B=r.useRef(null),h=r.useRef({}),x=r.useRef(null),p=r.useRef(null),g=r.useRef(D);g.current=D;const f=de(),b=oe(),y=Ce(),v=ce();r.useEffect(()=>{const e=p.current;if(!e)return;const t=new ResizeObserver(e=>{for(const t of e){const{width:e,height:s}=t.contentRect;e>0&&s>0&&A({width:e,height:s})}});t.observe(e);const s=e.getBoundingClientRect();return s.width>0&&s.height>0&&A({width:s.width,height:s.height}),()=>t.disconnect()},[]);const j=r.useMemo(()=>{const e=new Set;if(t)for(const s of t)e.add(s.hash);return e},[t]),N=r.useMemo(()=>{const e=new Map;if(t)for(const s of t)e.set(s.hash,{snr:s.avgSnr,rssi:s.avgRssi});return e},[t]),{processedNeighbors:w,maxDistance:k,totalNeighbors:M,zeroHopCount:S}=r.useMemo(()=>{const t=[];for(const[r,l]of Object.entries(e)){if(!l.latitude||!l.longitude||0===l.latitude||0===l.longitude)continue;if(!j.has(r))continue;const e=Rt(s,a,l.latitude,l.longitude),n=Lt(s,a,l.latitude,l.longitude),i=N.get(r);t.push({hash:r.slice(0,8),name:l.node_name||l.name||"Unknown",snr:(null==i?void 0:i.snr)??l.snr??null,rssi:(null==i?void 0:i.rssi)??l.rssi??null,bearing:e,distance:n,normalizedDistance:0,lastSeen:l.last_seen,isZeroHop:!0})}const n=1.08*(t.length>0?Math.max(...t.map(e=>e.distance)):0);return t.sort((e,t)=>(e.snr??-1/0)-(t.snr??-1/0)),{processedNeighbors:t,maxDistance:n,totalNeighbors:t.length,zeroHopCount:t.length}},[e,s,a,j,N]);r.useEffect(()=>{null==l||l({zeroHopCount:S,totalCount:M,maxDistanceKm:k})},[S,M,k]),r.useEffect(()=>{const e=$t[m],t=g.current;B.current&&cancelAnimationFrame(B.current);const s=performance.now(),a=n=>{const r=n-s,l=Math.min(r/400,1),i=(o=l)<.5?8*o*o*o*o:1-Math.pow(-2*o+2,4)/2;var o;F(t+(e-t)*i),B.current=l<1?requestAnimationFrame(a):null};return B.current=requestAnimationFrame(a),()=>{B.current&&cancelAnimationFrame(B.current)}},[m]);const T=k/D,$=r.useMemo(()=>Pt.filter(e=>e<=1.1*T),[T]);r.useEffect(()=>{const e=[];for(const s of w){const t=h.current[s.hash];void 0!==t&&t!==s.lastSeen&&e.push(s.hash),h.current[s.hash]=s.lastSeen}if(0===e.length)return;queueMicrotask(()=>{d(t=>new Set([...t,...e]))});const t=setTimeout(()=>{d(t=>{const s=new Set(t);return e.forEach(e=>s.delete(e)),s})},600);return()=>clearTimeout(t)},[w]);const P=0!==s&&0!==a,R=r.useMemo(()=>{const{width:e,height:t}=C,s=e/2,a=t/2,n=Math.max(10,e/2-12),r=Math.max(10,t/2-12),l=Math.max(10,n-16),i=Math.max(10,r-16);return{width:e,height:t,centerX:s,centerY:a,maxRadiusX:l,maxRadiusY:i,labelRadiusX:n,labelRadiusY:r,cornerRadius:.2*Math.min(l,i)}},[C]),{width:L,height:_,centerX:z,centerY:H,maxRadiusX:O,maxRadiusY:I,labelRadiusX:V,labelRadiusY:q,cornerRadius:G}=R,X=r.useCallback((e,t=1)=>{const s=O*t,a=I*t,n=Math.min(G*t,s,a),r=(e%360+360)%360,l=r*Math.PI/180,i=180*Math.atan2(a-n,s-n)/Math.PI;let o,c;if(r<=45-i||r>315+i){const e=Math.tan(l);o=Math.max(z-s+n,Math.min(z+s-n,z+a*e*(s/a))),c=H-a}else if(r>45-i&&r<=45+i)o=z+s-n+n*Math.sin(l),c=H-a+n-n*Math.cos(l);else if(r>45+i&&r<=135-i){const e=1/Math.tan(l);c=Math.max(H-a+n,Math.min(H+a-n,H-s*e*(a/s))),o=z+s}else if(r>135-i&&r<=135+i)o=z+s-n+n*Math.sin(l),c=H+a-n-n*Math.cos(l);else if(r>135+i&&r<=225-i){const e=Math.tan(l);o=Math.max(z-s+n,Math.min(z+s-n,z-a*e*(s/a))),c=H+a}else if(r>225-i&&r<=225+i)o=z-s+n+n*Math.sin(l),c=H+a-n-n*Math.cos(l);else if(r>225+i&&r<=315-i){const e=1/Math.tan(l);c=Math.max(H-a+n,Math.min(H+a-n,H-s*e*(a/s))),o=z-s}else o=z-s+n+n*Math.sin(l),c=H-a+n-n*Math.cos(l);return{x:o,y:c}},[z,H,O,I,G]),K=r.useCallback((e,t)=>{const s=X(e,1);return{x:z+(s.x-z)*t,y:H+(s.y-H)*t}},[X,z,H]),Y=r.useCallback(e=>({N:{x:z,y:H-q},S:{x:z,y:H+q},E:{x:z+V,y:H},W:{x:z-V,y:H},NE:{x:z+V,y:H-q},SE:{x:z+V,y:H+q},SW:{x:z-V,y:H+q},NW:{x:z-V,y:H-q}}[e]),[z,H,V,q]),U=r.useCallback(e=>{const t=O*e,s=I*e,a=Math.min(G*e,t,s),n=z-t,r=z+t,l=H-s,i=H+s;return[`M ${n+a} ${l}`,`L ${r-a} ${l}`,`Q ${r} ${l} ${r} ${l+a}`,`L ${r} ${i-a}`,`Q ${r} ${i} ${r-a} ${i}`,`L ${n+a} ${i}`,`Q ${n} ${i} ${n} ${i-a}`,`L ${n} ${l+a}`,`Q ${n} ${l} ${n+a} ${l}`,"Z"].join(" ")},[z,H,O,I,G]),Q=r.useCallback(e=>{o(e)},[]),Z=r.useCallback(e=>{u(e)},[]),J=r.useCallback(e=>k<=0?0:e/k*D,[k,D]),ee=e=>`${e}km`,te=r.useMemo(()=>{const e=$.map(e=>{const t=e/k*D;return{km:e,scale:t,labelY:H-I*t*.71}}).filter(e=>e.scale<=1.05&&e.scale>=.02).sort((e,t)=>t.km-e.km),t=[];for(const s of e)t.some(e=>Math.abs(e.labelY-s.labelY)<28)||t.push(s);return t},[$,k,D,H,I]),se=C.width>0&&C.height>0;return P?0===M?n.jsxs("div",{ref:x,className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[n.jsx(E,{className:"w-8 h-8 mb-2 opacity-50"}),n.jsx("p",{children:"No nodes with location data"})]}):n.jsxs("div",{ref:x,className:"relative h-full w-full flex overflow-hidden",children:[n.jsx("div",{ref:p,className:"relative flex-1 min-w-0 h-full",children:se&&n.jsxs("svg",{width:L,height:_,className:"absolute inset-0 z-0",children:[n.jsxs("defs",{children:[n.jsx("style",{children:"\n @keyframes neighbor-blink-scale {\n 0%, 100% {\n transform: scale(1);\n opacity: 0;\n }\n 50% {\n transform: scale(1.3);\n opacity: 0.8;\n }\n }\n .neighbor-blink-ring {\n transform-origin: center;\n animation: neighbor-blink-scale 600ms ease-out forwards;\n }\n "}),n.jsx("clipPath",{id:"radar-clip",children:n.jsx("path",{d:U(1)})})]}),$.map(e=>{const t=J(e);if(t>1.05||t<.02)return null;const s=te.some(t=>t.km===e),a=z+O*t*.71,r=H-I*t*.71;return n.jsxs("g",{children:[n.jsx("path",{d:U(t),fill:"none",stroke:v.primary,strokeOpacity:.15,strokeWidth:1}),s&&n.jsx("text",{x:a+4,y:r-2,textAnchor:"start",dominantBaseline:"auto",className:"fill-text-secondary",fontSize:10,fontFamily:W,children:ee(e)})]},`ring-${e}`)}),["N","E","S","W"].map(e=>{const t="N"===e||"S"===e,s=t?z:"E"===e?z+O:z-O,a=t?"N"===e?H-I:H+I:H;return n.jsx("line",{x1:z,y1:H,x2:s,y2:a,stroke:v.primary,strokeOpacity:.15,strokeWidth:1,strokeDasharray:"4 4"},e)}),["NE","SE","SW","NW"].map(e=>{const t=Y(e);return n.jsx("line",{x1:z,y1:H,x2:t.x,y2:t.y,stroke:v.primary,strokeOpacity:.08,strokeWidth:1,strokeDasharray:"4 4"},`diag-${e}`)}),["N","E","S","W"].map(e=>{const t=Y(e),s="E"===e?"end":"W"===e?"start":"middle",a="N"===e?"hanging":"S"===e?"auto":"middle";return n.jsx("text",{x:t.x,y:t.y,textAnchor:s,dominantBaseline:a,fill:b.primary,fontSize:16,fontWeight:600,fontFamily:W,"aria-hidden":"true",children:e},e)}),["NE","SE","SW","NW"].map(e=>{const t=Y(e),s="NE"===e||"SE"===e?"end":"start",a="NE"===e||"NW"===e?"hanging":"auto";return n.jsx("text",{x:t.x,y:t.y,textAnchor:s,dominantBaseline:a,fill:b.primary,fontSize:16,fontWeight:600,fontFamily:W,"aria-hidden":"true",children:e},e)}),n.jsx("circle",{cx:z,cy:H,r:5,fill:y.chart6,stroke:"rgba(255,255,255,0.3)",strokeWidth:1,role:"img","aria-label":"Local node"}),n.jsx("g",{clipPath:"url(#radar-clip)",children:w.map(e=>{const t=k>0?e.distance/k*D:0;if(t>1)return null;const{x:s,y:a}=K(e.bearing,t),r=null!==e.snr?zt(e.snr,f):"#808080",l=(null==i?void 0:i.hash)===e.hash,o=c.has(e.hash);return n.jsxs("g",{role:"img","aria-label":`${e.name}: ${e.distance.toFixed(1)}km ${e.bearing.toFixed(0)}°`,children:[o&&n.jsx("circle",{cx:s,cy:a,r:10.5,fill:"none",stroke:"rgba(255,255,255,0.9)",strokeWidth:2,className:"neighbor-blink-ring"}),l&&n.jsx("circle",{cx:s,cy:a,r:10.5,fill:r,opacity:.3}),n.jsx("circle",{cx:s,cy:a,r:l?7:5,fill:r,stroke:"rgba(0,0,0,0.5)",strokeWidth:1,style:{cursor:"pointer",transition:"r 0.15s"},onMouseEnter:()=>Q(e),onMouseLeave:()=>Q(null)})]},e.hash)})})]})}),n.jsx("div",{className:"flex flex-col h-full items-stretch gap-1 py-2 pl-2 flex-shrink-0",role:"group","aria-label":"Zoom level",children:["1x","2x","4x","8x","16x","36x"].map(e=>n.jsx("button",{onClick:()=>Z(e),"aria-pressed":m===e,className:"flex flex-1 items-center justify-center px-1.5 text-xs font-medium rounded transition-colors "+(m===e?"bg-accent-primary/20 text-accent-primary":"bg-white/5 text-text-secondary hover:bg-white/10 hover:text-text-primary"),children:e},e))}),i&&n.jsxs("div",{className:"absolute bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm pointer-events-none z-10 shadow-xl",style:{left:"50%",bottom:8,transform:"translateX(-50%)"},children:[n.jsx("div",{className:"font-medium text-text-primary",children:i.name}),n.jsx("div",{className:"text-text-secondary text-xs font-mono",children:i.hash}),null!==i.snr?n.jsx("div",{className:"flex gap-3 mt-1 text-xs",children:n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"SNR:"})," ",n.jsxs("span",{className:"tabular-nums",style:{color:zt(i.snr,f)},children:[i.snr.toFixed(1)," dB"]}),n.jsxs("span",{className:"text-text-secondary ml-1",children:["(",(ae=i.snr,(null==(ne=_t.find(e=>ae>=e.min))?void 0:ne.label)??"Critical"),")"]})]})}):n.jsx("div",{className:"text-xs text-text-secondary mt-1",children:"No SNR data"}),n.jsxs("div",{className:"flex gap-3 text-xs",children:[n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"Distance:"})," ",n.jsxs("span",{className:"tabular-nums text-text-primary",children:[i.distance.toFixed(2)," km"]})]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary",children:"Bearing:"})," ",n.jsxs("span",{className:"tabular-nums text-text-primary",children:[i.bearing.toFixed(0),"°"]})]})]})]})]}):n.jsxs("div",{ref:x,className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[n.jsx(E,{className:"w-8 h-8 mb-2 opacity-50"}),n.jsx("p",{children:"Local node coordinates not configured"}),n.jsx("p",{className:"text-xs mt-1",children:"Set latitude/longitude in config to enable"})]});var ae,ne});function Ot(e,t){if(0===e.length)return 0;const s=t/100*(e.length-1),a=Math.floor(s),n=Math.ceil(s);return a===n?e[a]:e[a]+(e[n]-e[a])*(s-a)}const Wt=r.memo(function({timestamps:e,values:t,onStatsChange:s}){var a,l;const{theme:i}=V(),[o,c]=r.useState(!0),d=r.useMemo(()=>{if(0===t.length)return null;const e=Math.min(...t),s=Math.max(...t),a=t.reduce((e,t)=>e+t,0)/t.length,n=[...t].sort((e,t)=>e-t);return{min:e,max:s,avg:a,p5:Ot(n,5),p95:Ot(n,95)}},[t]);r.useEffect(()=>{null==s||s(d)},[d]);const C=r.useCallback(()=>{c(e=>!e)},[]),{heatmapData:A,xLabels:m,yLabels:u}=r.useMemo(()=>{if(0===e.length||0===t.length||!d)return{heatmapData:null,xLabels:[],yLabels:[]};let s,a;if(o){const e=.1*(d.p95-d.p5||1);s=d.p5-e,a=d.p95+e}else{const e=.1*(d.max-d.min||1);s=d.min-e,a=d.max+e}const n=a-s,r=e[0],l=e[e.length-1]-r||1,i=new Float32Array(2*e.length);for(let o=0;o{const e=F.current;if(!e)return;const t=new ResizeObserver(e=>{for(const t of e){const{width:e,height:s}=t.contentRect;e>0&&s>0&&E({width:e,height:s})}});t.observe(e);const s=e.getBoundingClientRect();return s.width>0&&s.height>0&&E({width:s.width,height:s.height}),()=>t.disconnect()},[]),r.useEffect(()=>{const e=D.current;if(!e||!A||0===B.width)return;const t=e.getContext("2d");if(!t)return;const{width:s,height:a}=B,n=window.devicePixelRatio||1;e.width=s*n,e.height=a*n,e.style.width=`${s}px`,e.style.height=`${a}px`,t.scale(n,n),t.clearRect(0,0,s,a);const r=getComputedStyle(document.documentElement).getPropertyValue("--accent-primary").trim(),{r:l,g:i,b:o}=(e=>{const t=e.match(/color\(display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\)/);if(t)return{r:Math.round(255*parseFloat(t[1])),g:Math.round(255*parseFloat(t[2])),b:Math.round(255*parseFloat(t[3]))};const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:{r:250,g:189,b:47}})(r),{points:c,count:d}=A,C=Math.max(3,Math.min(8,s/d*4));t.globalCompositeOperation="source-over";for(let A=0;An.jsx("span",{className:"type-data-xs text-text-secondary tabular-nums text-right pr-1.5",style:{position:"absolute",top:`${e.pos}%`,transform:"translateY(-50%)",right:0},children:e.label},t))}),n.jsxs("div",{ref:F,className:"absolute overflow-hidden",style:{left:32,right:0,top:0,bottom:20},children:[n.jsx("svg",{className:"absolute inset-0 w-full h-full",preserveAspectRatio:"none","aria-hidden":"true",children:[0,25,50,75,100].map(e=>n.jsx("line",{x1:"0",y1:`${e}%`,x2:"100%",y2:`${e}%`,stroke:"rgba(255,255,255,0.06)",strokeDasharray:"3 3"},e))}),n.jsx("canvas",{ref:D,className:"absolute inset-0 w-full h-full","aria-hidden":"true"}),n.jsx("button",{type:"button",onClick:C,className:"absolute bottom-1 right-1 p-1.5 rounded bg-tooltip-bg/80 hover:bg-tooltip-bg active:bg-tooltip-bg transition-colors touch-manipulation",title:o?"Show full range (min/max)":"Show trimmed range (P5-P95)","aria-label":o?"Expand to show full data range":"Shrink to show trimmed percentile range","aria-pressed":!o,children:o?n.jsx(h,{className:"w-3.5 h-3.5 text-text-muted","aria-hidden":"true"}):n.jsx(x,{className:"w-3.5 h-3.5 text-text-muted","aria-hidden":"true"})})]}),n.jsx("div",{className:"absolute left-0 right-0 bottom-0",style:{left:32,height:20},"aria-hidden":"true",children:m.map((e,t)=>n.jsx("span",{className:"type-data-xs text-text-secondary tabular-nums absolute top-1",style:{left:`${e.pos}%`,transform:"translateX(-50%)"},children:e.label},t))})]}):n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No noise floor data available"})}),It={repeater:"var(--accent-primary)",companion:"var(--accent-tertiary)",room_server:"var(--accent-secondary)"};function Vt(e){if(e.contact_type){const t=e.contact_type.toLowerCase();if("repeater"===t||"rep"===t)return"repeater";if("room server"===t||"room_server"===t||"room"===t||"server"===t)return"room_server";if("companion"===t||"client"===t||"cli"===t)return"companion"}return e.is_repeater?"repeater":"companion"}const qt=r.memo(function({neighbors:e}){const t=r.useMemo(()=>{const t={repeater:0,companion:0,room_server:0};for(const a of Object.values(e)){const e=Vt(a);t[e]=(t[e]||0)+1}const s=Object.values(t).reduce((e,t)=>e+t,0);return{items:[{label:"Repeaters",count:t.repeater,percent:0,color:It.repeater},{label:"Companions",count:t.companion,percent:0,color:It.companion},{label:"Room Servers",count:t.room_server,percent:0,color:It.room_server}].map(e=>({...e,percent:s>0?e.count/s*100:0})).filter(e=>e.count>0).sort((e,t)=>t.count-e.count),total:s}},[e]);return 0===t.total?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted type-body-sm",children:"No neighbors discovered yet"}):n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{className:"flex-1 flex flex-col justify-evenly",children:t.items.map(e=>n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"type-data-sm text-text-secondary",children:e.label}),n.jsxs("span",{className:"type-data-sm text-text-secondary tabular-nums",children:[e.count," ",n.jsxs("span",{className:"text-text-secondary/60",children:["(",e.percent.toFixed(0),"%)"]})]})]}),n.jsx("div",{className:"h-2.5 bg-bg-elevated rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500 ease-out",style:{width:`${e.percent}%`,backgroundColor:e.color,minWidth:e.count>0?"4px":"0"}})})]},e.label))}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border-subtle",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Total Nodes"}),n.jsx("span",{className:"type-data-sm text-text-primary font-medium tabular-nums",children:t.total})]})]})});function Gt({children:e,minHeight:t="100%",rootMargin:s="200px 0px",keepMounted:a=!0,className:l=""}){const i=r.useRef(null),[o,c]=r.useState(!1),[d,C]=r.useState(!1);r.useEffect(()=>{const e=i.current;if(!e)return;const t=new IntersectionObserver(([e])=>{const t=e.isIntersecting;C(t),t&&c(!0)},{rootMargin:s,threshold:0});return t.observe(e),()=>{t.disconnect()}},[s]);const A=d||a&&o;return n.jsx("div",{ref:i,className:`h-full w-full ${l}`,style:{minHeight:t},children:A?e:n.jsx("div",{className:"h-full w-full flex items-center justify-center text-text-muted/50",children:n.jsx("div",{className:"animate-pulse text-xs",children:"Loading chart..."})})})}const Xt={excellent:"text-signal-excellent",good:"text-signal-good",fair:"text-signal-fair",poor:"text-accent-primary"},Kt={excellent:"bg-signal-excellent/10",good:"bg-signal-good/10",fair:"bg-signal-fair/10",poor:"bg-accent-primary/10"},Yt={excellent:"bg-signal-excellent",good:"bg-signal-good",fair:"bg-signal-fair",poor:"bg-accent-primary"};function Ut({value:e,status:t}){return n.jsx("div",{className:"w-full h-2 bg-surface-elevated rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${Yt[t]} transition-all duration-300`,style:{width:`${Math.min(100,Math.max(0,e))}%`}})})}function Qt(){const e=q(),t=G(),[s,a]=r.useState(null),l=r.useCallback((e,t)=>{a({prefix:e,candidateHashes:t})},[]),i=r.useCallback(()=>{a(null)},[]);if(!t)return n.jsxs(fe,{children:[n.jsx(be,{icon:n.jsx(p,{}),title:"Prefix Conflicts",largeTitle:!0}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center text-text-secondary",children:[n.jsx(g,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),n.jsx("p",{className:"type-data-xs",children:"No topology data available"}),n.jsx("p",{className:"type-data-xs opacity-70",children:"Run deep analysis to see stats"})]})})]});const o=(c=e.avgConfidence)>=.9?"excellent":c>=.7?"good":c>=.5?"fair":"poor";var c;const d=(C=e.collisionRate)<=10?"excellent":C<=25?"good":"poor";var C;const A="poor"===o||"poor"===d?"poor":"fair"===o||"fair"===d?"fair":"good"===o||"good"===d?"good":"excellent",m="excellent"===A||"good"===A?f:b;return n.jsxs(fe,{className:"flex flex-col overflow-hidden",children:[n.jsx(be,{icon:n.jsx(p,{}),title:"Prefix Conflicts",largeTitle:!0,actions:n.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full ${Kt[A]}`,children:[n.jsx(m,{className:`w-3.5 h-3.5 ${Xt[A]}`}),n.jsx("span",{className:`type-data-xs font-medium ${Xt[A]}`,children:"excellent"===A?"Excellent":"good"===A?"Good":"fair"===A?"Fair":"Needs Attention"})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[n.jsxs("div",{className:"cursor-help",title:"Average confidence score across all disambiguated prefixes. Higher = more certain node identification. Based on geographic proximity, co-occurrence patterns, and observation recency.",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Avg Confidence"}),n.jsxs("span",{className:`type-data-lg font-semibold ${Xt[o]}`,children:[(100*e.avgConfidence).toFixed(1),"%"]})]}),n.jsx(Ut,{value:100*e.avgConfidence,status:o})]}),n.jsxs("div",{className:"cursor-help",title:"Percentage of 2-character prefixes that match multiple known nodes. Lower is better. Collisions require disambiguation to determine the correct node.",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[n.jsx("span",{className:"type-data-xs text-text-secondary",children:"Collision Rate"}),n.jsxs("span",{className:`type-data-lg font-semibold ${Xt[d]}`,children:[e.collisionRate.toFixed(1),"%"]})]}),n.jsx(Ut,{value:e.collisionRate,status:d})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3",children:[n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Total unique 2-character prefixes observed in packet paths. Each prefix represents the first 2 hex digits of a node's full hash.",children:[n.jsx("div",{className:"type-data-lg font-semibold text-text-primary",children:e.totalPrefixes}),n.jsx("div",{className:"type-data-xs text-text-secondary",children:"Prefixes"})]}),n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Prefixes that map to exactly one known node. No disambiguation needed—these are definitive identifications.",children:[n.jsx("div",{className:"type-data-lg font-semibold text-signal-good",children:e.unambiguousPrefixes}),n.jsx("div",{className:"type-data-xs text-text-secondary",children:"Unique"})]}),n.jsxs("div",{className:"text-center cursor-help px-2 py-1.5 rounded",style:{backgroundColor:"var(--hover-tint)"},title:"Prefixes matching multiple known nodes. Click a prefix below to explore candidates and see how disambiguation scores them.",children:[n.jsx("div",{className:"type-data-lg font-semibold "+(e.collisionPrefixes>0?"text-accent-primary":"text-text-primary"),children:e.collisionPrefixes}),n.jsx("div",{className:"type-data-xs "+(e.collisionPrefixes>0?"text-accent-primary":"text-text-secondary"),children:"Collisions"})]})]}),e.highCollisionPrefixes.length>0&&n.jsxs("div",{className:"mb-2",children:[n.jsx("div",{className:"type-data-xs text-text-secondary mb-1.5",children:"Highest Collisions"}),n.jsx("div",{className:"flex flex-wrap gap-1",children:e.highCollisionPrefixes.map(({prefix:e,candidateCount:t,candidateHashes:s})=>n.jsxs("button",{type:"button",onClick:()=>l(e,s),className:"inline-flex items-center gap-1 px-1.5 py-0.5 min-h-[24px] rounded bg-surface-elevated text-text-secondary type-data-xs font-mono hover:bg-accent-primary/20 hover:text-accent-primary focus:outline-none focus:ring-2 focus:ring-accent-primary/50 transition-colors cursor-pointer touch-manipulation",title:`Click to explore ${t} candidates matching this prefix`,"aria-label":`Explore prefix ${e} with ${t} colliding candidates`,children:[e,n.jsxs("span",{className:"text-accent-primary",children:["×",t]})]},e))})]}),e.lowConfidencePrefixes.length>0&&n.jsx("div",{className:"mt-auto pt-2",children:n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx(b,{className:"w-3.5 h-3.5 text-accent-primary mt-0.5 flex-shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"type-data-xs text-accent-primary font-medium",children:[n.jsx("span",{className:"text-accent-primary",children:e.lowConfidencePrefixes.length})," prefix",1!==e.lowConfidencePrefixes.length?"es":""," with low confidence"]}),n.jsxs("div",{className:"type-data-xs text-text-secondary font-mono truncate",children:[e.lowConfidencePrefixes.slice(0,5).join(", "),e.lowConfidencePrefixes.length>5&&n.jsxs("span",{className:"text-accent-primary",children:[" +",e.lowConfidencePrefixes.length-5," more"]})]})]})]})}),0===e.lowConfidencePrefixes.length&&0===e.collisionPrefixes&&n.jsx("div",{className:"mt-auto pt-2",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(f,{className:"w-3.5 h-3.5 text-signal-excellent"}),n.jsx("span",{className:"type-data-xs text-signal-excellent",children:"All prefixes uniquely identified"})]})})]}),n.jsx(je,{isOpen:!!s,prefix:(null==s?void 0:s.prefix)||"",candidateHashes:(null==s?void 0:s.candidateHashes)||[],onClose:i})]})}function Zt({icon:e,label:t,value:s,sublabel:a,highlight:r,tooltip:l}){return n.jsxs("div",{className:"flex items-center justify-between py-2 "+(l?"cursor-help":""),title:l,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"icon-xs text-icon-widget",children:e}),n.jsx("span",{className:"type-label text-text-secondary",children:t})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("span",{className:"type-data-sm "+(r?"text-accent-primary":"text-text-primary"),children:s}),a&&n.jsx("span",{className:"type-data-xs text-text-secondary ml-1",children:a})]})]})}function Jt(){const e=X(),t=K().length;if(!e||0===e.totalPaths)return null;const{totalPaths:s,pathsWithGhosts:a,observationOverrideCount:r,tracePacketsProcessed:l,pathPacketsProcessed:i,distantEdgesDiscovered:o,duplicateGroupsFound:c,duplicatePathsUnique:d,echolocationEdgesInferred:C}=e,A=s>0?((s-a)/s*100).toFixed(1):"0",m=s>0?(a/s*100).toFixed(1):"0",D=s>0?(r/s*100).toFixed(1):"0",F=l+i,B=F>0||o>0,E=c>0||C>0;return n.jsxs(fe,{children:[n.jsx(be,{title:"Path Decoder",icon:n.jsx(y,{}),largeTitle:!0,badge:t>0?`${t} hidden`:void 0}),n.jsxs(ke,{children:[n.jsx("p",{className:"type-data-xs text-text-secondary mb-3",children:"Decodes packet routes to map your mesh topology and discover hidden repeaters."}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(v,{className:"w-3.5 h-3.5"}),label:"Traceable",value:`${A}%`,sublabel:`of ${s.toLocaleString()} paths`,highlight:parseFloat(A)>=90,tooltip:"Percentage of packet journeys where every hop was identified. Higher = better visibility into how traffic flows through your mesh."}),n.jsx(Zt,{icon:n.jsx(j,{className:"w-3.5 h-3.5"}),label:"Hidden Nodes",value:a.toLocaleString(),sublabel:`paths (${m}%)`,highlight:a>0,tooltip:"Paths containing unidentified repeaters. These 'ghost' nodes forward traffic but haven't announced themselves via ADVERT — possibly distant or newly added nodes."}),n.jsx(Zt,{icon:n.jsx(N,{className:"w-3.5 h-3.5"}),label:"Learning Rate",value:`${D}%`,sublabel:"adapted",tooltip:"How often real traffic patterns improved our predictions over geography alone. Higher values mean the decoder is learning your mesh's actual behavior — which routes are preferred, which nodes are most active."})]}),B&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-subtle",children:[n.jsx("p",{className:"type-micro mb-2",children:"Beyond Line-of-Sight"}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(w,{className:"w-3.5 h-3.5"}),label:"Route Reports",value:F.toLocaleString(),sublabel:l>0?`(${l} TRACE)`:void 0,tooltip:"TRACE/PATH packets from distant nodes share their routing tables. This reveals connections we can't directly observe — mapping parts of the mesh we don't touch."}),n.jsx(Zt,{icon:n.jsx(k,{className:"w-3.5 h-3.5"}),label:"Remote Links",value:o.toLocaleString(),highlight:o>0,tooltip:"Node-to-node connections discovered from route reports. These links exist outside our RF range but help complete the topology picture."})]})]}),E&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-subtle",children:[n.jsx("p",{className:"type-micro mb-2",children:"Echo Analysis"}),n.jsxs("div",{className:"divide-y divide-white/5",children:[n.jsx(Zt,{icon:n.jsx(M,{className:"w-3.5 h-3.5"}),label:"Multi-Path Packets",value:c.toLocaleString(),sublabel:d>0?`(${d} routes)`:void 0,tooltip:"Packets received via multiple paths simultaneously. Like sonar, these 'echoes' reveal redundant routes — important for understanding mesh resilience."}),n.jsx(Zt,{icon:n.jsx(u,{className:"w-3.5 h-3.5"}),label:"Inferred Links",value:C.toLocaleString(),highlight:C>0,tooltip:"Connections discovered from echo patterns. When the same packet arrives via different forwarders nearly simultaneously, those forwarders likely hear each other."})]})]}),t>0&&n.jsx("div",{className:"mt-3 pt-3 border-t border-border-subtle cursor-help",title:"High-confidence hidden repeaters: appear in 10+ paths, have 2+ known neighbors, ≥30% confidence, and plausible location. View them on the Contacts map.",children:n.jsxs("p",{className:"type-label text-text-secondary",children:[n.jsx("span",{className:"text-accent-primary type-data-sm",children:t})," ","likely repeater",1!==t?"s":""," discovered from traffic patterns"]})})]})]})}function es(){var e,t,s,a,l,i,o,c,d,C,A,m,u,D,B,h,x;const p=Y(),g=U(),f=Q(),b=Z(),y=J(),v=ee(),j=te(),N=se(),[w,k]=r.useState([]),[$,P]=r.useState(null),[R,L]=r.useState(null),[_,z]=r.useState(!0),[H,O]=r.useState(null),[W,I]=r.useState("share"),[V,q]=r.useState("stats"),[G,X]=r.useState(!1),[K,ie]=r.useState(!1),[oe,ce]=r.useState(Me),[de,Ce]=r.useState(.5),Ae=r.useMemo(()=>({0:0,1:0,2:1,3:2,4:3,5:4,6:5,7:6}[j]??3),[j]),me=ae[Ae].hours,ue=60*me,De=ae[Ae],Fe=re(me),Be=v.isBackgroundLoading,Ee=r.useCallback(e=>{N({0:1,1:2,2:3,3:4,4:5,5:6,6:7}[e]??4)},[N]),he=r.useMemo(()=>{var e;if(!(null==(e=null==p?void 0:p.config)?void 0:e.radio))return null;const t=p.config.radio;return{sf:t.spreading_factor??10,bw:t.bandwidth??25e4,cr:t.coding_rate??5,preamble:t.preamble_length??8}},[null==(t=null==(e=null==p?void 0:p.config)?void 0:e.radio)?void 0:t.spreading_factor,null==(a=null==(s=null==p?void 0:p.config)?void 0:s.radio)?void 0:a.bandwidth,null==(i=null==(l=null==p?void 0:p.config)?void 0:l.radio)?void 0:i.coding_rate,null==(c=null==(o=null==p?void 0:p.config)?void 0:o.radio)?void 0:c.preamble_length]);r.useEffect(()=>{!async function(){var e;O(null);try{const t=await ne(me);t.success&&(null==(e=t.data)?void 0:e.history)&&k(t.data.history)}catch(t){O(t instanceof Error?t.message:"Failed to load chart data")}finally{z(!1)}}()},[me]);const xe=r.useMemo(()=>72===me?6e5:168===me?18e5:336===me?36e5:3e5,[me]),pe=r.useCallback(async()=>{var e;try{const t=await ne(me);t.success&&(null==(e=t.data)?void 0:e.history)&&k(t.data.history)}catch{}},[me]);le(pe,xe,!0,!0);const je=r.useMemo(()=>0===w.length?{timestamps:[],values:[]}:{timestamps:w.map(e=>e.timestamp),values:w.map(e=>e.noise_floor_dbm)},[w]),ke=r.useMemo(()=>{if(w.length<10)return{anomalies:[],debug:void 0};const e=function(e,t={}){const s={...Me,...t};if(e.length<10)return{anomalies:[],thresholds:Te([]),totalSamples:e.length,anomalySamples:0};const a=e.map(e=>e.noise_floor_dbm),n=Te(a),r=[...a].sort((e,t)=>e-t);let l,i;s.useAbsoluteThresholds?(l=s.baselineDbm,i=s.spikeDbm):(l=Se(r,s.baselinePercentile),i=Se(r,s.spikePercentile));const o=[...e].sort((e,t)=>e.timestamp-t.timestamp),c=[];let d=null,C=0;for(const A of o)if(A.noise_floor_dbm>l&&A.noise_floor_dbme+t,0)/d.values.length):(d.values.length>=s.minSequenceLength&&c.push(d),d={startTs:A.timestamp,endTs:A.timestamp,values:[A.noise_floor_dbm],timestamps:[A.timestamp],rollingAvg:A.noise_floor_dbm})}else d={startTs:A.timestamp,endTs:A.timestamp,values:[A.noise_floor_dbm],timestamps:[A.timestamp],rollingAvg:A.noise_floor_dbm};else d&&d.values.length>=s.minSequenceLength&&c.push(d),d=null;return d&&d.values.length>=s.minSequenceLength&&c.push(d),0===c.length?{anomalies:[],thresholds:n,totalSamples:e.length,anomalySamples:C,debug:{baselineCutoff:l,spikeCutoff:i,midBandSamples:C}}:{anomalies:c.map(e=>{const t=Math.max(...e.values),s=e.values.reduce((e,t)=>e+t,0)/e.values.length;return{startTs:e.startTs,endTs:e.endTs,peakValue:t,avgValue:s,severity:$e(s,l,i),sampleCount:e.values.length}}),thresholds:n,totalSamples:e.length,anomalySamples:C,debug:{baselineCutoff:l,spikeCutoff:i,midBandSamples:C}}}(w,oe);return{anomalies:e.anomalies,debug:e.debug}},[w,oe]),Pe=ke.anomalies,Re=r.useMemo(()=>{const e=(null==p?void 0:p.neighbors)??{};return Object.fromEntries(Object.entries(e).filter(([e])=>!g.has(e)))},[null==p?void 0:p.neighbors,g]),Le=r.useMemo(()=>{const e=Date.now()/1e3-3600*me;return Object.fromEntries(Object.entries(Re).filter(([,t])=>t.last_seen>=e))},[Re,me]),_e=r.useMemo(()=>{const e=60*ue/Fe,t=Math.floor(Date.now()/1e3),s=Math.floor(t/e)*e;return{start:s-60*ue,end:s}},[ue,Fe]);return n.jsxs(ye,{children:[n.jsx(ve,{title:"Statistics",icon:n.jsx(S,{}),controls:n.jsx(ge,{ranges:ae,selectedIndex:Ae,onSelect:Ee,isPending:Be})}),H&&n.jsx(fe,{className:"border border-accent-red/50 bg-accent-red/10",children:n.jsx("p",{className:"text-accent-red",children:H})}),G&&K&&n.jsxs(fe,{className:"border border-accent-purple/30 bg-glass-surface/50",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"type-label",children:"Anomaly Detection Tuning"}),n.jsxs("span",{className:"type-data-xs text-text-muted",children:["(",De.label,")"]})]}),n.jsx("button",{onClick:()=>ce(e=>({...e,useAbsoluteThresholds:!e.useAbsoluteThresholds})),className:"type-data-xs px-2 py-1 rounded transition-colors "+(oe.useAbsoluteThresholds?"bg-accent-purple/30 text-accent-purple":"bg-glass-elevated text-text-muted hover:text-text-secondary"),children:oe.useAbsoluteThresholds?"Absolute dBm":"Percentile"})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Baseline"}),n.jsxs("span",{className:"ml-2 type-data-sm text-status-warning",children:[(null==(C=null==(d=ke.debug)?void 0:d.baselineCutoff)?void 0:C.toFixed(1))??"—"," dBm"]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Spike"}),n.jsxs("span",{className:"ml-2 type-data-sm text-status-warning",children:[(null==(m=null==(A=ke.debug)?void 0:A.spikeCutoff)?void 0:m.toFixed(1))??"—"," dBm"]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Mid-band"}),n.jsx("span",{className:"ml-2 type-data-sm text-accent-purple",children:(null==(u=ke.debug)?void 0:u.midBandSamples)??0})]}),n.jsxs("div",{children:[n.jsx("span",{className:"type-micro",children:"Anomalies"}),n.jsx("span",{className:"ml-2 type-data-sm text-status-danger",children:Pe.length})]})]}),n.jsxs("div",{className:"mt-4 pt-4 border-t border-border-subtle space-y-4",children:[oe.useAbsoluteThresholds?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Baseline (",oe.baselineDbm," dBm)"]}),n.jsx("input",{type:"range",min:"-120",max:"-60",value:oe.baselineDbm,onChange:e=>ce(t=>({...t,baselineDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Spike (",oe.spikeDbm," dBm)"]}),n.jsx("input",{type:"range",min:"-100",max:"-20",value:oe.spikeDbm,onChange:e=>ce(t=>({...t,spikeDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Merge Gap (",oe.mergeGapSeconds,"s)"]}),n.jsx("input",{type:"range",min:"5",max:"120",step:"5",value:oe.mergeGapSeconds,onChange:e=>ce(t=>({...t,mergeGapSeconds:Number(e.target.value)})),className:"w-full accent-accent-purple"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Min Sequence (",oe.minSequenceLength,")"]}),n.jsx("input",{type:"range",min:"2",max:"20",value:oe.minSequenceLength,onChange:e=>ce(t=>({...t,minSequenceLength:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Similarity (±",oe.similarityToleranceDbm," dBm)"]}),n.jsx("input",{type:"range",min:"1",max:"15",value:oe.similarityToleranceDbm,onChange:e=>ce(t=>({...t,similarityToleranceDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Opacity (",Math.round(100*de),"%)"]}),n.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.05",value:de,onChange:e=>Ce(Number(e.target.value)),className:"w-full accent-accent-purple"})]})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Baseline (P",oe.baselinePercentile,")"]}),n.jsx("input",{type:"range",min:"1",max:"50",value:oe.baselinePercentile,onChange:e=>ce(t=>({...t,baselinePercentile:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Spike (P",oe.spikePercentile,")"]}),n.jsx("input",{type:"range",min:"50",max:"99",value:oe.spikePercentile,onChange:e=>ce(t=>({...t,spikePercentile:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Merge Gap (",oe.mergeGapSeconds,"s)"]}),n.jsx("input",{type:"range",min:"5",max:"120",step:"5",value:oe.mergeGapSeconds,onChange:e=>ce(t=>({...t,mergeGapSeconds:Number(e.target.value)})),className:"w-full accent-accent-purple"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Min Sequence (",oe.minSequenceLength,")"]}),n.jsx("input",{type:"range",min:"2",max:"20",value:oe.minSequenceLength,onChange:e=>ce(t=>({...t,minSequenceLength:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Similarity (±",oe.similarityToleranceDbm," dBm)"]}),n.jsx("input",{type:"range",min:"1",max:"15",value:oe.similarityToleranceDbm,onChange:e=>ce(t=>({...t,similarityToleranceDbm:Number(e.target.value)})),className:"w-full accent-accent-purple"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"type-micro block mb-1",children:["Opacity (",Math.round(100*de),"%)"]}),n.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.05",value:de,onChange:e=>Ce(Number(e.target.value)),className:"w-full accent-accent-purple"})]})]})]}),n.jsxs("div",{className:"mt-4 p-3 bg-glass-elevated rounded-lg",children:[n.jsx("div",{className:"type-micro mb-1",children:"Config output"}),n.jsxs("div",{className:"type-data-sm text-status-success",children:[oe.useAbsoluteThresholds?`useAbsoluteThresholds: true, baselineDbm: ${oe.baselineDbm}, spikeDbm: ${oe.spikeDbm}`:`useAbsoluteThresholds: false, baselinePercentile: ${oe.baselinePercentile}, spikePercentile: ${oe.spikePercentile}`,", mergeGapSeconds: ",oe.mergeGapSeconds,", minSequenceLength: ",oe.minSequenceLength,", similarityToleranceDbm: ",oe.similarityToleranceDbm]})]})]})]}),Be&&n.jsx(Ne,{template:"auto",children:n.jsx(fe,{className:"border border-accent-primary/30 bg-accent-primary/5",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative flex h-3 w-3",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-accent-primary"})]}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("p",{className:"type-body-sm text-text-primary",children:["Loading ",De.label," data..."]}),v.loadProgress&&n.jsxs("p",{className:"type-data-xs text-text-muted mt-0.5",children:[v.loadProgress.loaded.toLocaleString()," packets (",v.loadProgress.percent,"%)"]})]})]})})}),_?n.jsx(Ne,{template:"auto",children:n.jsx(fe,{className:"text-center py-12",children:n.jsx("div",{className:"animate-pulse text-text-muted",children:"Loading statistics..."})})}):n.jsxs(n.Fragment,{children:[n.jsx(Ne,{template:"hero-auto",children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(F,{}),title:"Packet Analyzer",badge:De.label,largeTitle:!0,actions:n.jsxs("div",{className:"flex flex-wrap items-center gap-2 justify-end",children:["stats"===V&&n.jsx(Mt,{enabled:G,onChange:X,anomalyCount:Pe.length,showTuning:K,onTuningChange:ie}),n.jsx(St,{smoothing:V,onChange:q}),n.jsx(kt,{mode:W,onChange:I})]})}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Tt,{packets:b,startTs:_e.start,endTs:_e.end,bucketCount:Fe,radioConfig:he??void 0,mode:W,smoothing:V,noiseFloorAnomalies:Pe,showNoiseFloorOverlay:G,overlayOpacity:de})})]})})}),n.jsxs(Ne,{template:"panel",children:[n.jsx(we,{span:12,md:6,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(E,{}),title:"Link Quality",badge:De.label,largeTitle:!0,actions:R?n.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 type-data-xs text-text-muted",children:[n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.zeroHopCount})," nbr"]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.totalCount})," obs"]}),n.jsxs("span",{children:[n.jsx("span",{className:"text-text-secondary tabular-nums font-medium",children:R.maxDistanceKm.toFixed(0)})," km"]})]}):null}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(Ht,{neighbors:Le,quickNeighbors:f,localLat:(null==(B=null==(D=null==p?void 0:p.config)?void 0:D.repeater)?void 0:B.latitude)??0,localLon:(null==(x=null==(h=null==p?void 0:p.config)?void 0:h.repeater)?void 0:x.longitude)??0,onStatsChange:L})})})]})})}),n.jsx(we,{span:12,md:6,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(T,{}),title:"Network Composition",badge:De.label,largeTitle:!0}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(qt,{neighbors:Le})})})]})})})]}),n.jsxs(Ne,{template:"panel",children:[n.jsx(we,{span:12,md:6,children:n.jsx(Qt,{})}),n.jsx(we,{span:12,md:6,children:n.jsx(Jt,{})})]}),n.jsx(Ne,{template:"panel",children:n.jsx(we,{span:12,children:n.jsx(fe,{isLoaded:y,skeletonType:"chart",children:y&&n.jsxs(n.Fragment,{children:[n.jsx(be,{icon:n.jsx(M,{}),title:"RF Noise Floor",largeTitle:!0,actions:$?n.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 md:gap-3",children:[n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["min ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.min.toFixed(0)})]}),n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["avg ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.avg.toFixed(0)})]}),n.jsxs("span",{className:"type-data-xs text-text-muted whitespace-nowrap",children:["max ",n.jsx("span",{className:"text-text-secondary tabular-nums",children:$.max.toFixed(0)})]}),n.jsx("span",{className:"type-data-xs text-text-muted",children:"dBm"})]}):n.jsx("span",{className:"type-data-xs text-text-muted",children:"dBm"})}),n.jsx("div",{className:"flex-1 min-h-0",children:n.jsx(Gt,{children:n.jsx(Wt,{timestamps:je.timestamps,values:je.values,onStatsChange:P})})})]})})})})]})]})}export{es as default}; diff --git a/frontend/dist/assets/System-CPE03-m2.js b/frontend/dist/assets/System-fGLn0Map.js similarity index 99% rename from frontend/dist/assets/System-CPE03-m2.js rename to frontend/dist/assets/System-fGLn0Map.js index 4429bc6b..4ba20cfb 100644 --- a/frontend/dist/assets/System-CPE03-m2.js +++ b/frontend/dist/assets/System-fGLn0Map.js @@ -1 +1 @@ -import{r as e,j as t,a3 as s,aU as a,af as r,aV as l,aW as n}from"./vendor-react-C0qkT9dV.js";import{c,R as o,A as i,C as d,X as m,Y as x,T as p,e as u,b as h}from"./recharts-DRDKmvXb.js";import{a6 as j,a7 as y,a8 as f,a9 as g,F as v}from"./index-wYLFmyyS.js";import{a as b,b as N}from"./useThemeColors-DL9Pr7sC.js";import{P as w,b as k,a as C,c as F}from"./PageLayout-DAadOF4d.js";import{R as _,C as M}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const S=Math.floor(12e5/g.system),G={primary:"bg-accent-primary",secondary:"bg-accent-secondary",green:"bg-accent-success",red:"bg-accent-danger",yellow:"bg-accent-secondary"},L=[{threshold:30,color:"var(--accent-tertiary)",next:"var(--accent-primary)"},{threshold:50,color:"var(--accent-primary)",next:"var(--accent-secondary)"},{threshold:65,color:"var(--accent-secondary)",next:"var(--signal-poor)"},{threshold:80,color:"var(--signal-poor)",next:"var(--accent-danger)"}];function U(e,t,s){const a=s-t,r={cold:(30-t)/a*100,normal:(50-t)/a*100,warm:(65-t)/a*100,hot:(80-t)/a*100};return`linear-gradient(to right, ${[{pos:0,color:"var(--accent-tertiary)"},{pos:r.cold,color:"var(--accent-tertiary)"},{pos:r.cold,color:"var(--accent-primary)"},{pos:r.normal,color:"var(--accent-primary)"},{pos:r.normal,color:"var(--accent-secondary)"},{pos:r.warm,color:"var(--accent-secondary)"},{pos:r.warm,color:"var(--signal-poor)"},{pos:r.hot,color:"var(--signal-poor)"},{pos:r.hot,color:"var(--accent-danger)"},{pos:100,color:"var(--accent-danger)"}].map(t=>{const s=e>0?t.pos/e*100:0;return`${t.color} ${Math.min(s,100)}%`}).join(", ")})`}const O=e.memo(function({value:e,max:s=100,color:a="primary"}){const r=Math.min(e/s*100,100),l=r>90?"bg-accent-danger":r>70?"bg-accent-secondary":G[a];return t.jsx("div",{className:"h-2.5 bg-white/[0.02] rounded-full overflow-hidden",children:t.jsx("div",{className:c("h-full rounded-full",l),style:{width:`${r}%`}})})}),T=e.memo(function({value:e,label:s,min:a=20,max:r=100}){const l=Math.min(Math.max((e-a)/(r-a)*100,0),100),n=function(e){return e<30?{text:"Cool",color:"text-accent-tertiary"}:e<50?{text:"Normal",color:"text-accent-primary"}:e<65?{text:"Warm",color:"text-accent-secondary"}:e<80?{text:"Hot",color:"text-signal-poor"}:{text:"Danger",color:"text-accent-danger"}}(e),c=r-a;return t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex justify-between items-baseline",children:[t.jsx("span",{className:"text-sm text-text-muted",children:s}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-xs text-text-muted",children:n.text}),t.jsxs("span",{className:"text-sm font-mono tabular-nums",children:[t.jsx("span",{className:n.color,children:e.toFixed(1)}),t.jsx("span",{className:"text-text-primary",children:"°"})]})]})]}),t.jsxs("div",{className:"relative h-2 bg-white/[0.02] rounded-full overflow-hidden",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-300 ease-out",style:{background:U(l,a,r),width:`${l}%`}}),t.jsx("div",{className:"absolute inset-0 flex items-center pointer-events-none",children:L.map(({threshold:e,color:s})=>{const r=(e-a)/c*100;return r<0||r>100?null:t.jsx("div",{className:"absolute w-px h-full",style:{left:`${r}%`,backgroundColor:s}},e)})})]})]})});function $({payload:e}){return e?t.jsx("div",{className:"flex items-center gap-4 justify-center text-xs font-mono",children:e.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsx("span",{className:"text-text-muted",children:e.value})]},s))}):null}function A({active:e,payload:s,label:a}){return e&&(null==s?void 0:s.length)?t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm shadow-xl",children:[t.jsx("div",{className:"font-medium text-text-primary mb-1",children:a}),s.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsxs("span",{className:"text-text-muted",children:[e.name,":"]}),t.jsxs("span",{className:"text-text-primary tabular-nums",children:[e.value.toFixed(1),"%"]})]},s))]}):null}const W=e.memo(function({data:e,cpuColor:s,memoryColor:a,chartGridColors:r}){const l=function(e){const t=[],s=Math.max(0,S-e.length),a=Date.now(),r=g.system;for(let n=0;n`${e}%`}),t.jsx(p,{content:t.jsx(A,{})}),t.jsx(u,{content:t.jsx($,{})}),t.jsx(h,{type:"stepAfter",dataKey:"cpu",name:"CPU",stroke:s,strokeWidth:2,fill:"url(#cpuGradient)",fillOpacity:.85,isAnimationActive:!1,connectNulls:!1}),t.jsx(h,{type:"stepAfter",dataKey:"memory",name:"Memory",stroke:a,strokeWidth:2,fill:"url(#memoryGradient)",fillOpacity:.85,isAnimationActive:!1,connectNulls:!1})]})})})});function P(){const[o,i]=e.useState(null),[d,m]=e.useState(!0),[x,p]=e.useState(null),[u,h]=e.useState(!1),v=j(),G=y(),L=b(),U=N(),$=U.primary,A=U.tertiary,P=e.useCallback(async()=>{try{const e=await f();e.success&&e.data?(i(e.data),p(null),G(e.data.cpu.usage_percent,e.data.memory.usage_percent,S)):p(e.error??"Failed to fetch hardware stats")}catch(e){p(e instanceof Error?e.message:"Failed to fetch hardware stats")}},[G]);return e.useEffect(()=>{let e=!0,t=null;if((async()=>{e&&(await P(),e&&m(!1))})(),"undefined"==typeof Worker){const t=setInterval(P,g.system);return()=>{e=!1,clearInterval(t)}}{const s=`setInterval(() => postMessage('tick'), ${g.system});`,a=new Blob([s],{type:"application/javascript"});t=new Worker(URL.createObjectURL(a)),t.onmessage=()=>{e&&P()}}return()=>{e=!1,null==t||t.terminate()}},[P]),t.jsxs(w,{children:[t.jsx(k,{title:"System Stats",icon:t.jsx(a,{}),controls:t.jsxs("button",{onClick:async()=>{h(!0),await P(),h(!1)},disabled:u,className:"flex items-center gap-2 px-3 py-1.5 sm:px-4 sm:py-2 bg-bg-subtle hover:bg-bg-elevated rounded-lg transition-colors text-sm text-text-muted hover:text-text-primary self-start sm:self-auto",children:[t.jsx(s,{className:c("w-4 h-4",u&&"animate-spin")}),"Refresh"]})}),x&&t.jsx(C,{className:"border border-accent-danger/50 bg-accent-danger/10",children:t.jsx("p",{className:"text-accent-danger",children:x})}),d?t.jsx(C,{className:"p-12 text-center",children:t.jsx("div",{className:"animate-pulse text-text-muted",children:"Loading system stats..."})}):o?t.jsxs(t.Fragment,{children:[t.jsx(_,{template:"hero",children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(r,{}),title:"System Resources",subtitle:"20 minute rolling window",largeTitle:!0,actions:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"type-micro",children:"CPU"}),t.jsxs("span",{className:"type-data font-semibold tabular-nums",style:{color:$},children:[o.cpu.usage_percent.toFixed(0),"%"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"type-micro",children:"MEM"}),t.jsxs("span",{className:"type-data font-semibold tabular-nums",style:{color:A},children:[o.memory.usage_percent.toFixed(0),"%"]})]})]})}),t.jsx("div",{className:"flex-1 min-h-0",children:t.jsx(W,{data:v,cpuColor:$,memoryColor:A,chartGridColors:L})}),t.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-border-subtle text-xs text-text-muted flex-shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{children:[o.cpu.count," CPU cores"]}),o.cpu.load_avg&&t.jsxs("span",{className:"tabular-nums",children:["Load: ",o.cpu.load_avg["1min"].toFixed(2)," / ",o.cpu.load_avg["5min"].toFixed(2)," / ",o.cpu.load_avg["15min"].toFixed(2)]})]}),t.jsxs("span",{className:"tabular-nums",children:[(o.memory.used/1048576).toFixed(0)," / ",(o.memory.total/1048576).toFixed(0)," MB"]})]})]})}),t.jsxs(_,{template:"compact",children:[t.jsx(M,{span:12,md:6,children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(l,{}),title:"Disk Usage",subtitle:"Storage utilization",largeTitle:!0}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-text-muted",children:"Usage"}),t.jsxs("span",{className:"text-text-primary font-medium",children:[o.disk.usage_percent.toFixed(1),"%"]})]}),t.jsx(O,{value:o.disk.usage_percent,color:"primary"}),t.jsxs("div",{className:"flex justify-between text-sm mt-2",children:[t.jsxs("span",{className:"text-text-muted",children:[(o.disk.used/1073741824).toFixed(1)," GB used"]}),t.jsxs("span",{className:"text-text-muted",children:[(o.disk.total/1073741824).toFixed(1)," GB total"]})]})]})]})}),t.jsx(M,{span:12,md:6,children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(n,{}),title:"Temperature",subtitle:"System sensors",largeTitle:!0}),o.temperatures&&Object.keys(o.temperatures).length>0?t.jsxs("div",{className:"space-y-2.5",children:[void 0!==o.temperatures.cpu_thermal&&t.jsx(T,{value:o.temperatures.cpu_thermal,label:"CPU",min:20,max:100}),Object.entries(o.temperatures).filter(([e])=>"cpu_thermal"!==e).slice(0,3).map(([e,s])=>t.jsx(T,{value:s,label:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),min:20,max:100},e))]}):t.jsxs("div",{className:"flex items-center justify-center h-20 text-text-muted text-sm",children:[t.jsx(r,{className:"w-4 h-4 mr-2"}),"No sensors available"]})]})})]})]}):null]})}export{P as default}; +import{r as e,j as t,a3 as s,aU as a,af as r,aV as l,aW as n}from"./vendor-react-C0qkT9dV.js";import{c,R as o,A as i,C as d,X as m,Y as x,T as p,e as u,b as h}from"./recharts-DRDKmvXb.js";import{a5 as j,a6 as y,a7 as f,a8 as g,F as v}from"./index-DrUSC4Ks.js";import{a as b,b as N}from"./useThemeColors-DL9Pr7sC.js";import{P as w,b as k,a as C,c as F}from"./PageLayout-DAadOF4d.js";import{R as _,C as M}from"./Grid-F2RfSVk7.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const S=Math.floor(12e5/g.system),G={primary:"bg-accent-primary",secondary:"bg-accent-secondary",green:"bg-accent-success",red:"bg-accent-danger",yellow:"bg-accent-secondary"},L=[{threshold:30,color:"var(--accent-tertiary)",next:"var(--accent-primary)"},{threshold:50,color:"var(--accent-primary)",next:"var(--accent-secondary)"},{threshold:65,color:"var(--accent-secondary)",next:"var(--signal-poor)"},{threshold:80,color:"var(--signal-poor)",next:"var(--accent-danger)"}];function U(e,t,s){const a=s-t,r={cold:(30-t)/a*100,normal:(50-t)/a*100,warm:(65-t)/a*100,hot:(80-t)/a*100};return`linear-gradient(to right, ${[{pos:0,color:"var(--accent-tertiary)"},{pos:r.cold,color:"var(--accent-tertiary)"},{pos:r.cold,color:"var(--accent-primary)"},{pos:r.normal,color:"var(--accent-primary)"},{pos:r.normal,color:"var(--accent-secondary)"},{pos:r.warm,color:"var(--accent-secondary)"},{pos:r.warm,color:"var(--signal-poor)"},{pos:r.hot,color:"var(--signal-poor)"},{pos:r.hot,color:"var(--accent-danger)"},{pos:100,color:"var(--accent-danger)"}].map(t=>{const s=e>0?t.pos/e*100:0;return`${t.color} ${Math.min(s,100)}%`}).join(", ")})`}const O=e.memo(function({value:e,max:s=100,color:a="primary"}){const r=Math.min(e/s*100,100),l=r>90?"bg-accent-danger":r>70?"bg-accent-secondary":G[a];return t.jsx("div",{className:"h-2.5 bg-white/[0.02] rounded-full overflow-hidden",children:t.jsx("div",{className:c("h-full rounded-full",l),style:{width:`${r}%`}})})}),T=e.memo(function({value:e,label:s,min:a=20,max:r=100}){const l=Math.min(Math.max((e-a)/(r-a)*100,0),100),n=function(e){return e<30?{text:"Cool",color:"text-accent-tertiary"}:e<50?{text:"Normal",color:"text-accent-primary"}:e<65?{text:"Warm",color:"text-accent-secondary"}:e<80?{text:"Hot",color:"text-signal-poor"}:{text:"Danger",color:"text-accent-danger"}}(e),c=r-a;return t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex justify-between items-baseline",children:[t.jsx("span",{className:"text-sm text-text-muted",children:s}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-xs text-text-muted",children:n.text}),t.jsxs("span",{className:"text-sm font-mono tabular-nums",children:[t.jsx("span",{className:n.color,children:e.toFixed(1)}),t.jsx("span",{className:"text-text-primary",children:"°"})]})]})]}),t.jsxs("div",{className:"relative h-2 bg-white/[0.02] rounded-full overflow-hidden",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-300 ease-out",style:{background:U(l,a,r),width:`${l}%`}}),t.jsx("div",{className:"absolute inset-0 flex items-center pointer-events-none",children:L.map(({threshold:e,color:s})=>{const r=(e-a)/c*100;return r<0||r>100?null:t.jsx("div",{className:"absolute w-px h-full",style:{left:`${r}%`,backgroundColor:s}},e)})})]})]})});function $({payload:e}){return e?t.jsx("div",{className:"flex items-center gap-4 justify-center text-xs font-mono",children:e.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsx("span",{className:"text-text-muted",children:e.value})]},s))}):null}function A({active:e,payload:s,label:a}){return e&&(null==s?void 0:s.length)?t.jsxs("div",{className:"bg-tooltip-bg border border-border-subtle rounded-lg px-3 py-2 text-sm shadow-xl",children:[t.jsx("div",{className:"font-medium text-text-primary mb-1",children:a}),s.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsxs("span",{className:"text-text-muted",children:[e.name,":"]}),t.jsxs("span",{className:"text-text-primary tabular-nums",children:[e.value.toFixed(1),"%"]})]},s))]}):null}const W=e.memo(function({data:e,cpuColor:s,memoryColor:a,chartGridColors:r}){const l=function(e){const t=[],s=Math.max(0,S-e.length),a=Date.now(),r=g.system;for(let n=0;n`${e}%`}),t.jsx(p,{content:t.jsx(A,{})}),t.jsx(u,{content:t.jsx($,{})}),t.jsx(h,{type:"stepAfter",dataKey:"cpu",name:"CPU",stroke:s,strokeWidth:2,fill:"url(#cpuGradient)",fillOpacity:.85,isAnimationActive:!1,connectNulls:!1}),t.jsx(h,{type:"stepAfter",dataKey:"memory",name:"Memory",stroke:a,strokeWidth:2,fill:"url(#memoryGradient)",fillOpacity:.85,isAnimationActive:!1,connectNulls:!1})]})})})});function P(){const[o,i]=e.useState(null),[d,m]=e.useState(!0),[x,p]=e.useState(null),[u,h]=e.useState(!1),v=j(),G=y(),L=b(),U=N(),$=U.primary,A=U.tertiary,P=e.useCallback(async()=>{try{const e=await f();e.success&&e.data?(i(e.data),p(null),G(e.data.cpu.usage_percent,e.data.memory.usage_percent,S)):p(e.error??"Failed to fetch hardware stats")}catch(e){p(e instanceof Error?e.message:"Failed to fetch hardware stats")}},[G]);return e.useEffect(()=>{let e=!0,t=null;if((async()=>{e&&(await P(),e&&m(!1))})(),"undefined"==typeof Worker){const t=setInterval(P,g.system);return()=>{e=!1,clearInterval(t)}}{const s=`setInterval(() => postMessage('tick'), ${g.system});`,a=new Blob([s],{type:"application/javascript"});t=new Worker(URL.createObjectURL(a)),t.onmessage=()=>{e&&P()}}return()=>{e=!1,null==t||t.terminate()}},[P]),t.jsxs(w,{children:[t.jsx(k,{title:"System Stats",icon:t.jsx(a,{}),controls:t.jsxs("button",{onClick:async()=>{h(!0),await P(),h(!1)},disabled:u,className:"flex items-center gap-2 px-3 py-1.5 sm:px-4 sm:py-2 bg-bg-subtle hover:bg-bg-elevated rounded-lg transition-colors text-sm text-text-muted hover:text-text-primary self-start sm:self-auto",children:[t.jsx(s,{className:c("w-4 h-4",u&&"animate-spin")}),"Refresh"]})}),x&&t.jsx(C,{className:"border border-accent-danger/50 bg-accent-danger/10",children:t.jsx("p",{className:"text-accent-danger",children:x})}),d?t.jsx(C,{className:"p-12 text-center",children:t.jsx("div",{className:"animate-pulse text-text-muted",children:"Loading system stats..."})}):o?t.jsxs(t.Fragment,{children:[t.jsx(_,{template:"hero",children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(r,{}),title:"System Resources",subtitle:"20 minute rolling window",largeTitle:!0,actions:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"type-micro",children:"CPU"}),t.jsxs("span",{className:"type-data font-semibold tabular-nums",style:{color:$},children:[o.cpu.usage_percent.toFixed(0),"%"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"type-micro",children:"MEM"}),t.jsxs("span",{className:"type-data font-semibold tabular-nums",style:{color:A},children:[o.memory.usage_percent.toFixed(0),"%"]})]})]})}),t.jsx("div",{className:"flex-1 min-h-0",children:t.jsx(W,{data:v,cpuColor:$,memoryColor:A,chartGridColors:L})}),t.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-border-subtle text-xs text-text-muted flex-shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{children:[o.cpu.count," CPU cores"]}),o.cpu.load_avg&&t.jsxs("span",{className:"tabular-nums",children:["Load: ",o.cpu.load_avg["1min"].toFixed(2)," / ",o.cpu.load_avg["5min"].toFixed(2)," / ",o.cpu.load_avg["15min"].toFixed(2)]})]}),t.jsxs("span",{className:"tabular-nums",children:[(o.memory.used/1048576).toFixed(0)," / ",(o.memory.total/1048576).toFixed(0)," MB"]})]})]})}),t.jsxs(_,{template:"compact",children:[t.jsx(M,{span:12,md:6,children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(l,{}),title:"Disk Usage",subtitle:"Storage utilization",largeTitle:!0}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-text-muted",children:"Usage"}),t.jsxs("span",{className:"text-text-primary font-medium",children:[o.disk.usage_percent.toFixed(1),"%"]})]}),t.jsx(O,{value:o.disk.usage_percent,color:"primary"}),t.jsxs("div",{className:"flex justify-between text-sm mt-2",children:[t.jsxs("span",{className:"text-text-muted",children:[(o.disk.used/1073741824).toFixed(1)," GB used"]}),t.jsxs("span",{className:"text-text-muted",children:[(o.disk.total/1073741824).toFixed(1)," GB total"]})]})]})]})}),t.jsx(M,{span:12,md:6,children:t.jsxs(C,{children:[t.jsx(F,{icon:t.jsx(n,{}),title:"Temperature",subtitle:"System sensors",largeTitle:!0}),o.temperatures&&Object.keys(o.temperatures).length>0?t.jsxs("div",{className:"space-y-2.5",children:[void 0!==o.temperatures.cpu_thermal&&t.jsx(T,{value:o.temperatures.cpu_thermal,label:"CPU",min:20,max:100}),Object.entries(o.temperatures).filter(([e])=>"cpu_thermal"!==e).slice(0,3).map(([e,s])=>t.jsx(T,{value:s,label:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),min:20,max:100},e))]}):t.jsxs("div",{className:"flex items-center justify-center h-20 text-text-muted text-sm",children:[t.jsx(r,{className:"w-4 h-4 mr-2"}),"No sensors available"]})]})})]})]}):null]})}export{P as default}; diff --git a/frontend/dist/assets/Terminal-BmUaRX2Y.js b/frontend/dist/assets/Terminal-CKEpJ-hg.js similarity index 99% rename from frontend/dist/assets/Terminal-BmUaRX2Y.js rename to frontend/dist/assets/Terminal-CKEpJ-hg.js index 4521fcd0..55954a63 100644 --- a/frontend/dist/assets/Terminal-BmUaRX2Y.js +++ b/frontend/dist/assets/Terminal-CKEpJ-hg.js @@ -1 +1 @@ -import{c as e,r as a,j as t,S as r}from"./vendor-react-C0qkT9dV.js";import{c as s}from"./recharts-DRDKmvXb.js";import{d as n,af as o,ag as i,ah as l,ai as c,aj as m,ad as d}from"./index-wYLFmyyS.js";import{P as p,b as y,a as u}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const g=e(e=>({entries:[],commandHistory:[],isInitialized:!1,addEntry:a=>{const t="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const a=16*Math.random()|0;return("x"===e?a:3&a|8).toString(16)}),r={...a,id:t,timestamp:Date.now()};return e(e=>({entries:[...e.entries,r]})),t},updateEntry:(a,t)=>{e(e=>({entries:e.entries.map(e=>e.id===a?{...e,...t}:e)}))},addCommand:a=>{e(e=>({commandHistory:[...e.commandHistory,a]}))},clearEntries:()=>{e({entries:[],commandHistory:[]})},setInitialized:a=>{e({isInitialized:a})}})),f=new Set(["start ota","erase","reboot"]),h=["gps","sensor"],v=[{cmd:"help",desc:"Show available commands"},{cmd:"clear",desc:"Clear terminal screen"},{cmd:"status",desc:"Get repeater status summary"},{cmd:"uptime",desc:"Show system uptime"},{cmd:"packets",desc:"Show packet statistics"},{cmd:"board",desc:"Show board/platform info"},...[{name:"get adc.multiplier",category:"get",params:[],description:"Get ADC multiplier for battery",serialOnly:!1,hasParam:!1},{name:"get advert.interval",category:"get",params:[],description:"Get local advert interval (minutes)",serialOnly:!1,hasParam:!1},{name:"get af",category:"get",params:[],description:"Get airtime factor",serialOnly:!1,hasParam:!1},{name:"get agc.reset.interval",category:"get",params:[],description:"Get AGC reset interval (seconds)",serialOnly:!1,hasParam:!1},{name:"get allow.read.only",category:"get",params:[],description:"Get read-only access setting",serialOnly:!1,hasParam:!1},{name:"get bridge.baud",category:"get",params:[],description:"Get bridge baud rate",serialOnly:!1,hasParam:!1},{name:"get bridge.channel",category:"get",params:[],description:"Get bridge channel (ESP-NOW)",serialOnly:!1,hasParam:!1},{name:"get bridge.delay",category:"get",params:[],description:"Get bridge delay (ms)",serialOnly:!1,hasParam:!1},{name:"get bridge.enabled",category:"get",params:[],description:"Get bridge enabled status",serialOnly:!1,hasParam:!1},{name:"get bridge.secret",category:"get",params:[],description:"Get bridge encryption secret",serialOnly:!1,hasParam:!1},{name:"get bridge.source",category:"get",params:[],description:"Get bridge packet source",serialOnly:!1,hasParam:!1},{name:"get bridge.type",category:"get",params:[],description:"Get bridge type (rs232/espnow/none)",serialOnly:!1,hasParam:!1},{name:"get direct.txdelay",category:"get",params:[],description:"Get direct TX delay factor",serialOnly:!1,hasParam:!1},{name:"get flood.advert.interval",category:"get",params:[],description:"Get flood advert interval (hours)",serialOnly:!1,hasParam:!1},{name:"get flood.max",category:"get",params:[],description:"Get max flood hops",serialOnly:!1,hasParam:!1},{name:"get freq",category:"get",params:[],description:"Get frequency (MHz)",serialOnly:!1,hasParam:!1},{name:"get guest.password",category:"get",params:[],description:"Get guest password",serialOnly:!1,hasParam:!1},{name:"get int.thresh",category:"get",params:[],description:"Get interference threshold",serialOnly:!1,hasParam:!1},{name:"get lat",category:"get",params:[],description:"Get latitude",serialOnly:!1,hasParam:!1},{name:"get lon",category:"get",params:[],description:"Get longitude",serialOnly:!1,hasParam:!1},{name:"get multi.acks",category:"get",params:[],description:"Get multi-ack setting",serialOnly:!1,hasParam:!1},{name:"get name",category:"get",params:[],description:"Get node name",serialOnly:!1,hasParam:!1},{name:"get prv.key",category:"get",params:[],description:"Get private key (hex)",serialOnly:!1,hasParam:!1},{name:"get public.key",category:"get",params:[],description:"Get public key (hex)",serialOnly:!1,hasParam:!1},{name:"get radio",category:"get",params:[],description:"Get radio params (freq,bw,sf,cr)",serialOnly:!1,hasParam:!1},{name:"get repeat",category:"get",params:[],description:"Get repeat/forward status (on/off)",serialOnly:!1,hasParam:!1},{name:"get role",category:"get",params:[],description:"Get device role",serialOnly:!1,hasParam:!1},{name:"get rxdelay",category:"get",params:[],description:"Get RX delay base",serialOnly:!1,hasParam:!1},{name:"get tx",category:"get",params:[],description:"Get TX power (dBm)",serialOnly:!1,hasParam:!1},{name:"get txdelay",category:"get",params:[],description:"Get TX delay factor",serialOnly:!1,hasParam:!1},{name:"gps",category:"gps",params:[],description:"Show GPS status",serialOnly:!1,hasParam:!1},{name:"gps advert",category:"gps",params:[],description:"Get/set GPS advert location policy",serialOnly:!1,hasParam:!0},{name:"gps off",category:"gps",params:[],description:"Disable GPS",serialOnly:!1,hasParam:!0},{name:"gps on",category:"gps",params:[],description:"Enable GPS",serialOnly:!1,hasParam:!0},{name:"gps setloc",category:"gps",params:[],description:"Set node location from GPS",serialOnly:!1,hasParam:!0},{name:"gps sync",category:"gps",params:[],description:"Sync time from GPS",serialOnly:!1,hasParam:!0},{name:"log",category:"logging",params:[],description:"Dump log file (serial only)",serialOnly:!0,hasParam:!1},{name:"log erase",category:"logging",params:[],description:"Erase log file",serialOnly:!1,hasParam:!0},{name:"log start",category:"logging",params:[],description:"Start packet logging",serialOnly:!1,hasParam:!0},{name:"log stop",category:"logging",params:[],description:"Stop packet logging",serialOnly:!1,hasParam:!0},{name:"neighbor.remove",category:"neighbor",params:[],description:"Remove neighbor by pubkey",serialOnly:!1,hasParam:!0},{name:"neighbors",category:"neighbor",params:[],description:"List neighbors",serialOnly:!1,hasParam:!1},{name:"get",category:"other",params:[],description:"Execute get command",serialOnly:!1,hasParam:!0},{name:"set",category:"other",params:[{name:"value",type:"float"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Execute set command",serialOnly:!1,hasParam:!0},{name:"tempradio",category:"radio",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Apply temporary radio params (freq bw sf cr timeout_mins)",serialOnly:!1,hasParam:!0},{name:"sensor get",category:"sensor",params:[],description:"Get sensor/custom variable value",serialOnly:!1,hasParam:!0},{name:"sensor list",category:"sensor",params:[{name:"value",type:"int"}],description:"List all sensor/custom variables",serialOnly:!1,hasParam:!0},{name:"sensor set",category:"sensor",params:[],description:"Set sensor/custom variable value",serialOnly:!1,hasParam:!0},{name:"set adc.multiplier",category:"set",params:[{name:"value",type:"float"}],description:"Set ADC multiplier",serialOnly:!1,hasParam:!0},{name:"set advert.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"string"}],description:"Set local advert interval (1-10080 min, 0=off)",serialOnly:!1,hasParam:!0},{name:"set af",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set airtime factor (0-9)",serialOnly:!1,hasParam:!0},{name:"set agc.reset.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set AGC reset interval (seconds, rounded to 4)",serialOnly:!1,hasParam:!0},{name:"set allow.read.only",category:"set",params:[{name:"value",type:"int"}],description:"Set read-only access (on/off)",serialOnly:!1,hasParam:!0},{name:"set bridge.baud",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set bridge baud (9600-115200)",serialOnly:!1,hasParam:!0},{name:"set bridge.channel",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"string"}],description:"Set bridge channel (1-14)",serialOnly:!1,hasParam:!0},{name:"set bridge.delay",category:"set",params:[{name:"value",type:"int"}],description:"Set bridge delay (0-10000 ms)",serialOnly:!1,hasParam:!0},{name:"set bridge.enabled",category:"set",params:[{name:"value",type:"int"}],description:"Enable/disable bridge",serialOnly:!1,hasParam:!0},{name:"set bridge.secret",category:"set",params:[{name:"value",type:"string"},{name:"value",type:"float"}],description:"Set bridge encryption secret",serialOnly:!1,hasParam:!0},{name:"set bridge.source",category:"set",params:[{name:"value",type:"int"}],description:"Set bridge source (rx/tx)",serialOnly:!1,hasParam:!0},{name:"set direct.txdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set direct TX delay factor",serialOnly:!1,hasParam:!0},{name:"set flood.advert.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set flood advert interval (3-48 hours, 0=off)",serialOnly:!1,hasParam:!0},{name:"set flood.max",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"float"}],description:"Set max flood hops (0-64)",serialOnly:!1,hasParam:!0},{name:"set freq",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set frequency MHz (serial only, reboot required)",serialOnly:!0,hasParam:!0},{name:"set guest.password",category:"set",params:[{name:"value",type:"string"}],description:"Set guest password",serialOnly:!1,hasParam:!0},{name:"set int.thresh",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set interference threshold",serialOnly:!1,hasParam:!0},{name:"set lat",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set latitude",serialOnly:!1,hasParam:!0},{name:"set lon",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set longitude",serialOnly:!1,hasParam:!0},{name:"set multi.acks",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set multi-ack (0/1)",serialOnly:!1,hasParam:!0},{name:"set name",category:"set",params:[{name:"value",type:"string"},{name:"value",type:"int"}],description:"Set node name",serialOnly:!1,hasParam:!0},{name:"set prv.key",category:"set",params:[{name:"value",type:"string"}],description:"Set private key (hex, restart required)",serialOnly:!1,hasParam:!0},{name:"set radio",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set radio params (freq bw sf cr)",serialOnly:!1,hasParam:!0},{name:"set repeat",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set repeat/forward (on/off)",serialOnly:!1,hasParam:!0},{name:"set rxdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set RX delay base",serialOnly:!1,hasParam:!0},{name:"set tx",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"float"}],description:"Set TX power (dBm)",serialOnly:!1,hasParam:!0},{name:"set txdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set TX delay factor",serialOnly:!1,hasParam:!0},{name:"stats-core",category:"stats",params:[],description:"Show core statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"stats-packets",category:"stats",params:[],description:"Show packet statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"stats-radio",category:"stats",params:[],description:"Show radio statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"advert",category:"system",params:[],description:"Send self advertisement",serialOnly:!1,hasParam:!1},{name:"board",category:"system",params:[],description:"Show board/manufacturer name",serialOnly:!1,hasParam:!1},{name:"clear stats",category:"system",params:[],description:"Reset statistics counters",serialOnly:!1,hasParam:!0},{name:"clock",category:"system",params:[{name:"value",type:"int"}],description:"Display current time",serialOnly:!1,hasParam:!0},{name:"clock sync",category:"system",params:[],description:"Sync clock from sender timestamp",serialOnly:!1,hasParam:!0},{name:"password",category:"system",params:[{name:"value",type:"string"}],description:"Change admin password",serialOnly:!1,hasParam:!0},{name:"reboot",category:"system",params:[],description:"Reboot the device",serialOnly:!1,hasParam:!1},{name:"start ota",category:"system",params:[{name:"value",type:"int"}],description:"Start OTA firmware update",serialOnly:!1,hasParam:!0},{name:"time",category:"system",params:[{name:"value",type:"int"}],description:"Set time to epoch seconds",serialOnly:!1,hasParam:!0},{name:"ver",category:"system",params:[],description:"Show firmware version and build date",serialOnly:!1,hasParam:!1}].filter(e=>!e.serialOnly&&!f.has(e.name)&&!h.some(a=>e.name.startsWith(a))).map(e=>({cmd:e.name,desc:e.description,params:e.hasParam?"{value}":void 0,required:e.hasParam}))],x={"set mode":["forward","monitor"],"set duty":["on","off"],"set repeat":["on","off"],"set tx":["10","14","17","20","22"],"set sf":["7","8","9","10","11","12"],"set bw":["125","250","500"],"set af":["0.5","1.0","1.5","2.0"],"set txdelay":["0.5","0.7","1.0","1.5"],"set direct.txdelay":["0.3","0.5","0.7"],"set log":["debug","info","warning"]};function b(e){switch(e){case"success":return"text-accent-success";case"error":return"text-accent-danger";case"warning":return"text-amber-400";case"info":return"text-accent-tertiary";case"value":return"text-accent-primary";case"system":return"text-text-muted";default:return"text-text-secondary"}}const w=a.memo(function({entry:e}){return"command"===e.type?t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx("span",{className:"text-text-muted font-medium select-none",children:"$"}),t.jsx("span",{className:"text-text-primary font-semibold",children:e.content})]}):"system"===e.type?t.jsx("div",{className:s("py-0.5",b(e.outputType||"system")),children:e.content}):e.content.includes("██")?t.jsx("pre",{className:s("terminal-ascii font-mono leading-none py-2 whitespace-pre",b(e.outputType||"value")),children:e.content}):t.jsx("div",{className:"ml-4 font-mono text-[13px] py-1",children:e.content.split("\n").map((a,r)=>{const s=function(e,a){if(e.startsWith("HELP_HEADER:::"))return[{text:e.slice(14),color:"text-text-primary font-bold"}];if(e.startsWith("HELP_NOTE:::"))return[{text:e.slice(12),color:"text-text-muted italic"}];const t=e.match(/^([a-z][a-z0-9.]*(?:\s+[a-z][a-z0-9.]*)?):::(.+)$/);if(t){const[,e,a]=t,r=e.split(" "),s=r[0];let n="text-accent-tertiary";"get"===s?n="text-accent-success":"set"===s&&(n="text-amber-400");const o=[{text:` ${s}`,color:`${n} font-semibold`}];r.length>1&&o.push({text:` ${r.slice(1).join(" ")}`,color:"text-accent-primary"});const i=" ".repeat(Math.max(1,22-e.length));return o.push({text:`${i}${a}`,color:"text-text-muted"}),o}if("error"===a||"warning"===a)return[{text:e,color:b(a)}];if("value"===a)return[{text:e,color:b("value")}];const r=e.match(/^([\w\s.]+):\s*(.+)$/);if(r){const[,e,a]=r;return[{text:`${e}: `,color:"text-text-muted"},{text:a,color:"text-accent-primary font-semibold"}]}return e.startsWith("OK")?[{text:e,color:b("success")}]:[{text:e,color:b(a)}]}(a,e.outputType||"default");return t.jsx("div",{className:"leading-relaxed",children:s.map((e,a)=>t.jsx("span",{className:e.color,children:e.text},a))},r)})})});function O(){const e=n(),f=g(e=>e.entries),h=g(e=>e.commandHistory),b=g(e=>e.isInitialized),{addEntry:O,updateEntry:P,addCommand:k,clearEntries:S,setInitialized:$}=g(),[_,N]=a.useState(""),[E,j]=a.useState(-1),[G,T]=a.useState(!1),[C,F]=a.useState([]),[D,W]=a.useState(0),[L,I]=a.useState(0),[R,A]=a.useState(!1),H=a.useRef(null),K=a.useRef(null),M=a.useRef(null);a.useEffect(()=>{b||(async()=>{O({type:"output",content:"██████ ██ ██ ███ ███ ██████\n██ ██ ██ ██ ████ ████ ██ \n██████ ████ ██ ████ ██ ██ \n██ ██ ██ ██ ██ ██ \n██ ██ ██ ██ ██████",outputType:"value"}),await new Promise(e=>setTimeout(e,200));const e=O({type:"system",content:"● Initializing terminal...",outputType:"system"});await new Promise(e=>setTimeout(e,400)),P(e,{content:"✓ Initializing terminal...",outputType:"success"});const a=O({type:"system",content:"● Connecting to repeater...",outputType:"system"});await new Promise(e=>setTimeout(e,600)),P(a,{content:"✓ Connected to repeater",outputType:"success"}),O({type:"system",content:"Ready. Type 'help' for commands.",outputType:"system"}),$(!0)})()},[b,O,P,$]),a.useEffect(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight)},[f]);const q=a.useCallback(()=>{var e;null==(e=H.current)||e.focus()},[]),z=a.useCallback(e=>{const a=e.trim().toLowerCase();if(!a)return T(!1),void F([]);const t=v.filter(e=>e.cmd.toLowerCase().startsWith(a));if(t.length>0)return F(t),W(0),void T(!0);if(a.includes(" ")){const e=a.lastIndexOf(" "),t=a.substring(0,e),r=a.substring(e+1),s=v.find(e=>e.cmd.toLowerCase()===t);if(s&&x[s.cmd]){const e=x[s.cmd].filter(e=>e.toLowerCase().startsWith(r)).map(e=>({cmd:`${s.cmd} ${e}`,desc:`→ ${e}`}));if(e.length>0)return F(e),W(0),void T(!0)}}T(!1),F([])},[]),X=a.useCallback(e=>{var a;const t=C[e];t&&(t.required&&t.params?(N(t.cmd+" "),z(t.cmd+" ")):(N(t.cmd),T(!1)),null==(a=H.current)||a.focus())},[C,z]),U=a.useCallback(async e=>{var a,t,r,s,n,p,y,u;const g=e.trim();if(!g)return;const f=g.toLowerCase();if(k(g),O({type:"command",content:g}),"clear"===f)return void S();if("help"===f){const e=v.map(e=>`${e.cmd}:::${e.desc}`).join("\n");return void O({type:"output",content:`HELP_HEADER:::Available commands\n${e}\nHELP_NOTE:::Some MeshCore commands not available via HTTP.`,outputType:"default"})}const h=O({type:"output",content:"processing...",outputType:"system"});try{const e=await o();let v="",x="info";const b=e=>{const a=Math.floor(e/86400),t=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return a>0?`${a}d ${t}h ${r}m`:t>0?`${t}h ${r}m`:`${r}m`};if("status"===f){v=`Mode: ${(null==(t=null==(a=e.config)?void 0:a.repeater)?void 0:t.mode)||"unknown"} | Neighbors: ${Object.keys(e.neighbors||{}).length} | Uptime: ${b(e.uptime_seconds||0)}`}else if("uptime"===f)v=b(e.uptime_seconds||0),x="value";else if("packets"===f)v=`rx: ${e.rx_count??0}\ntx: ${e.tx_count??0}\nfwd: ${e.forwarded_count??0}\ndrop: ${e.dropped_count??0}`;else if("neighbors"===f){const a=e.neighbors||{},t=Object.entries(a);if(0===t.length)v="No neighbors discovered yet.",x="warning";else{const e=t.map(([e,a])=>{const t=a.name||a.node_name||"Unknown";return` ${e.slice(0,8)} ${t}`});v=`Neighbors (${t.length}):\n${e.join("\n")}`}}else if("board"===f)v="pyMC_Repeater (Linux/RPi)",x="value";else if(f.startsWith("get ")){const a=f.slice(4).trim(),t=null==(r=e.config)?void 0:r.delays,o=null==(s=e.config)?void 0:s.radio,i=null==(n=e.config)?void 0:n.repeater,l=null==(p=e.config)?void 0:p.duty_cycle;switch(a){case"name":v=(null==(y=e.config)?void 0:y.node_name)||"Unknown";break;case"role":v="repeater";break;case"lat":v=null!=(null==i?void 0:i.latitude)?String(i.latitude):"not set";break;case"lon":v=null!=(null==i?void 0:i.longitude)?String(i.longitude):"not set";break;case"freq":v=(null==o?void 0:o.frequency)?(o.frequency/1e6).toFixed(3):"?";break;case"tx":v=String((null==o?void 0:o.tx_power)??"?");break;case"bw":v=(null==o?void 0:o.bandwidth)?String(o.bandwidth/1e3):"?";break;case"sf":v=String((null==o?void 0:o.spreading_factor)??"?");break;case"cr":v=String((null==o?void 0:o.coding_rate)??"?");break;case"radio":v=o?`freq: ${(o.frequency/1e6).toFixed(3)} MHz\nbw: ${o.bandwidth/1e3} kHz\nsf: ${o.spreading_factor}\ncr: 4/${o.coding_rate}`:"?";break;case"af":case"txdelay":v=String((null==t?void 0:t.tx_delay_factor)??"1.0");break;case"direct.txdelay":v=String((null==t?void 0:t.direct_tx_delay_factor)??"0.5");break;case"mode":v=(null==i?void 0:i.mode)||"forward";break;case"repeat":v="forward"===(null==i?void 0:i.mode)?"on":"off";break;case"flood.max":v=String((null==i?void 0:i.max_flood_hops)??"3");break;case"flood.advert.interval":v=null!=(null==i?void 0:i.send_advert_interval_hours)?`${i.send_advert_interval_hours}h`:"?";break;case"advert.interval":v=null!=(null==i?void 0:i.advert_interval_minutes)?`${i.advert_interval_minutes}m`:"120m";break;case"rxdelay":v=String((null==t?void 0:t.rx_delay_base)??"0.0");break;case"duty":case"duty.enabled":v=(null==l?void 0:l.enforcement_enabled)?"on":"off";break;case"duty.max":v=null!=(null==l?void 0:l.max_airtime_percent)?`${l.max_airtime_percent}%`:"?";break;case"public.key":v=e.public_key||"not available";break;case"prv.key":v="Private keys not available via CLI.\nUse /api/identities endpoint or config.yaml",x="warning";break;case"guest.password":case"allow.read.only":v="Security settings not exposed via stats API.\nCheck /etc/pymc_repeater/config.yaml",x="warning";break;default:v=`Unknown parameter: ${a}\nAvailable: name, role, lat, lon, freq, tx, bw, sf, cr, radio, af, txdelay, direct.txdelay, rxdelay, mode, repeat, flood.max, advert.interval, duty, public.key`,x="error"}"error"!==x&&(x="value")}else if("advert"===f){const e=await i();v=e.success?"OK - Advert sent":`Error: ${e.error||"Failed"}`,x=e.success?"success":"error"}else if(f.startsWith("set mode ")){const e=f.split(" ")[2];if("forward"!==e&&"monitor"!==e)v='Error: Mode must be "forward" or "monitor"',x="error";else{const a=await l(e);v=a.success?`OK - Mode set to ${e}`:"Error: Failed",x=a.success?"success":"error"}}else if(f.startsWith("set duty ")){const e=f.split(" ")[2],a="on"===e||"1"===e,t=await c(a);v=t.success?"OK - Duty cycle "+(a?"enabled":"disabled"):"Error: Failed",x=t.success?"success":"error"}else if(f.startsWith("set tx ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||e<2||e>22)v="Error: TX power must be 2-22 dBm (SX1262 chip max)",x="error";else{const a=await m({tx_power:e});v=a.success?`OK - TX power set to ${e}dBm`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set af ")||f.startsWith("set txdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0||e>5)v="Error: TX delay factor must be 0.0-5.0",x="error";else{const a=await m({tx_delay_factor:e});v=a.success?`OK - TX delay set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set direct.txdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0||e>5)v="Error: Direct TX delay must be 0.0-5.0",x="error";else{const a=await m({direct_tx_delay_factor:e});v=a.success?`OK - Direct TX delay set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set log ")){const e=null==(u=f.split(" ")[2])?void 0:u.toUpperCase();if(["DEBUG","INFO","WARNING","ERROR"].includes(e)){const a=await d(e);v=a.success?`OK - Log level set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}else v="Error: Level must be debug, info, warning, or error",x="error"}else if(f.startsWith("set rxdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0)v="Error: RX delay must be >= 0",x="error";else{const a=await m({rx_delay_base:e});v=a.success?`OK - RX delay base set to ${e}s`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set name ")){const e=g.substring(9).trim();if(e){const a=await m({node_name:e});v=a.success?`OK - Node name set to "${e}"`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}else v="Error: Node name cannot be empty",x="error"}else if(f.startsWith("set lat ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<-90||e>90)v="Error: Latitude must be -90 to 90",x="error";else{const a=await m({latitude:e});v=a.success?`OK - Latitude set to ${e}°`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set lon ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<-180||e>180)v="Error: Longitude must be -180 to 180",x="error";else{const a=await m({longitude:e});v=a.success?`OK - Longitude set to ${e}°`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set flood.max ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||e<0||e>64)v="Error: Max flood hops must be 0-64",x="error";else{const a=await m({max_flood_hops:e});v=a.success?`OK - Max flood hops set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set flood.advert.interval ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||0!==e&&(e<3||e>48))v="Error: Flood advert interval must be 0 (off) or 3-48 hours",x="error";else{const a=await m({flood_advert_interval_hours:e});v=a.success?0===e?"OK - Flood adverts disabled":`OK - Flood advert interval set to ${e}h`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set advert.interval ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||0!==e&&(e<1||e>10080))v="Error: Advert interval must be 0 (off) or 1-10080 minutes",x="error";else{const a=await m({advert_interval_minutes:e});v=a.success?0===e?"OK - Local adverts disabled":`OK - Local advert interval set to ${e}m`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else v=`Unknown command: ${g}\nType 'help' for available commands.`,x="error";P(h,{content:v,outputType:x})}catch(x){P(h,{content:`Error: ${x instanceof Error?x.message:"Command failed"}`,outputType:"error"})}},[O,k,P,S]),B=a.useCallback(e=>{var a,t,r,s,n,o;if(G&&C.length>0){if("ArrowDown"===e.key){e.preventDefault();const s=Math.min(D+1,C.length-1);return W(s),void(null==(r=null==(t=null==(a=M.current)?void 0:a.children[0])?void 0:t.children[s])||r.scrollIntoView({block:"nearest"}))}if("ArrowUp"===e.key){e.preventDefault();const a=Math.max(D-1,0);return W(a),void(null==(o=null==(n=null==(s=M.current)?void 0:s.children[0])?void 0:n.children[a])||o.scrollIntoView({block:"nearest"}))}if("Tab"===e.key)return e.preventDefault(),void X(D);if("Escape"===e.key)return e.preventDefault(),void T(!1)}if("Enter"===e.key){e.preventDefault();const a=_;return N(""),j(-1),T(!1),void U(a)}if("ArrowUp"!==e.key||G)if("ArrowDown"!==e.key||G);else if(e.preventDefault(),E>0){const e=E-1;j(e),N(h[h.length-1-e]||"")}else 0===E&&(j(-1),N(""));else if(e.preventDefault(),h.length>0&&E{N(e.target.value),I(e.target.selectionStart||e.target.value.length),z(e.target.value)},[z]),J=a.useCallback(e=>{const a=e.target;I(a.selectionStart||0)},[]);return t.jsxs(p,{children:[t.jsx(y,{title:"Terminal",icon:t.jsx(r,{})}),t.jsxs(u,{noPadding:!0,className:"terminal-card overflow-hidden flex flex-col isolate",onClick:q,children:[t.jsx("div",{ref:K,className:"flex-1 overflow-y-auto font-mono text-sm bg-black/40 p-3 sm:p-4 md:p-5",children:f.map(e=>t.jsx(w,{entry:e},e.id))}),t.jsxs("div",{className:"relative border-t border-white/10 bg-black/50",children:[t.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-3",children:[t.jsx("span",{className:"text-text-muted font-mono font-bold select-none",children:"$"}),t.jsxs("div",{className:"flex-1 relative font-mono text-sm",children:[t.jsx("input",{ref:H,type:"text",value:_,onChange:V,onKeyDown:B,onSelect:J,onFocus:()=>A(!0),onBlur:()=>A(!1),disabled:!b,className:"absolute inset-0 w-full bg-transparent text-transparent outline-none disabled:opacity-50 selection:bg-transparent",style:{caretColor:"transparent"},autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),t.jsx("div",{className:"relative pointer-events-none select-none","aria-hidden":!0,children:b?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-text-primary",children:_.slice(0,L)}),t.jsx("span",{className:s("inline-block w-[0.6em] h-[1.2em] align-text-bottom",R?"bg-accent-primary":"bg-text-muted/30"),style:{marginBottom:"-0.1em"},children:t.jsx("span",{className:"text-bg-primary",children:_[L]||""})}),t.jsx("span",{className:"text-text-primary",children:_.slice(L+1)})]}):t.jsx("span",{className:"text-text-muted",children:"Connecting..."})})]})]}),t.jsxs("div",{className:"px-3 sm:px-4 py-1 border-t border-white/5 bg-black/30 flex justify-between text-[10px] text-text-muted",children:[t.jsx("span",{className:"hidden sm:inline",children:"↑↓ History"}),t.jsx("span",{className:"sm:hidden",children:"Terminal"}),(null==e?void 0:e.version)&&t.jsxs("span",{children:["pyMC v",e.version]})]})]}),G&&C.length>0&&t.jsxs("div",{ref:M,className:"absolute left-2 right-2 bottom-[72px] rounded-xl shadow-2xl overflow-hidden z-50 border border-white/20 bg-black/80 backdrop-blur-xl",children:[t.jsx("div",{className:"max-h-64 overflow-y-auto",children:C.map((e,a)=>t.jsxs("div",{onClick:()=>X(a),className:s("px-4 py-2.5 cursor-pointer border-b border-white/10 last:border-b-0 transition-colors",a===D?"bg-accent-primary/25":"hover:bg-white/10"),children:[t.jsx("span",{className:s("font-mono text-sm",a===D?"text-accent-primary":"text-text-primary"),children:e.cmd}),t.jsx("span",{className:"text-xs text-text-muted ml-4",children:e.desc})]},e.cmd))}),t.jsx("div",{className:"px-3 py-1.5 border-t border-white/10 text-[10px] text-text-muted text-right bg-white/5",children:"Tab to select"})]})]})]})}export{O as default}; +import{c as e,r as a,j as t,S as r}from"./vendor-react-C0qkT9dV.js";import{c as s}from"./recharts-DRDKmvXb.js";import{c as n,ae as o,af as i,ag as l,ah as c,ai as m,ac as d}from"./index-DrUSC4Ks.js";import{P as p,b as y,a as u}from"./PageLayout-DAadOF4d.js";import"./vendor-core-WoOfkQwm.js";import"./deckgl-DTsmDcfs.js";const g=e(e=>({entries:[],commandHistory:[],isInitialized:!1,addEntry:a=>{const t="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const a=16*Math.random()|0;return("x"===e?a:3&a|8).toString(16)}),r={...a,id:t,timestamp:Date.now()};return e(e=>({entries:[...e.entries,r]})),t},updateEntry:(a,t)=>{e(e=>({entries:e.entries.map(e=>e.id===a?{...e,...t}:e)}))},addCommand:a=>{e(e=>({commandHistory:[...e.commandHistory,a]}))},clearEntries:()=>{e({entries:[],commandHistory:[]})},setInitialized:a=>{e({isInitialized:a})}})),f=new Set(["start ota","erase","reboot"]),h=["gps","sensor"],v=[{cmd:"help",desc:"Show available commands"},{cmd:"clear",desc:"Clear terminal screen"},{cmd:"status",desc:"Get repeater status summary"},{cmd:"uptime",desc:"Show system uptime"},{cmd:"packets",desc:"Show packet statistics"},{cmd:"board",desc:"Show board/platform info"},...[{name:"get adc.multiplier",category:"get",params:[],description:"Get ADC multiplier for battery",serialOnly:!1,hasParam:!1},{name:"get advert.interval",category:"get",params:[],description:"Get local advert interval (minutes)",serialOnly:!1,hasParam:!1},{name:"get af",category:"get",params:[],description:"Get airtime factor",serialOnly:!1,hasParam:!1},{name:"get agc.reset.interval",category:"get",params:[],description:"Get AGC reset interval (seconds)",serialOnly:!1,hasParam:!1},{name:"get allow.read.only",category:"get",params:[],description:"Get read-only access setting",serialOnly:!1,hasParam:!1},{name:"get bridge.baud",category:"get",params:[],description:"Get bridge baud rate",serialOnly:!1,hasParam:!1},{name:"get bridge.channel",category:"get",params:[],description:"Get bridge channel (ESP-NOW)",serialOnly:!1,hasParam:!1},{name:"get bridge.delay",category:"get",params:[],description:"Get bridge delay (ms)",serialOnly:!1,hasParam:!1},{name:"get bridge.enabled",category:"get",params:[],description:"Get bridge enabled status",serialOnly:!1,hasParam:!1},{name:"get bridge.secret",category:"get",params:[],description:"Get bridge encryption secret",serialOnly:!1,hasParam:!1},{name:"get bridge.source",category:"get",params:[],description:"Get bridge packet source",serialOnly:!1,hasParam:!1},{name:"get bridge.type",category:"get",params:[],description:"Get bridge type (rs232/espnow/none)",serialOnly:!1,hasParam:!1},{name:"get direct.txdelay",category:"get",params:[],description:"Get direct TX delay factor",serialOnly:!1,hasParam:!1},{name:"get flood.advert.interval",category:"get",params:[],description:"Get flood advert interval (hours)",serialOnly:!1,hasParam:!1},{name:"get flood.max",category:"get",params:[],description:"Get max flood hops",serialOnly:!1,hasParam:!1},{name:"get freq",category:"get",params:[],description:"Get frequency (MHz)",serialOnly:!1,hasParam:!1},{name:"get guest.password",category:"get",params:[],description:"Get guest password",serialOnly:!1,hasParam:!1},{name:"get int.thresh",category:"get",params:[],description:"Get interference threshold",serialOnly:!1,hasParam:!1},{name:"get lat",category:"get",params:[],description:"Get latitude",serialOnly:!1,hasParam:!1},{name:"get lon",category:"get",params:[],description:"Get longitude",serialOnly:!1,hasParam:!1},{name:"get multi.acks",category:"get",params:[],description:"Get multi-ack setting",serialOnly:!1,hasParam:!1},{name:"get name",category:"get",params:[],description:"Get node name",serialOnly:!1,hasParam:!1},{name:"get prv.key",category:"get",params:[],description:"Get private key (hex)",serialOnly:!1,hasParam:!1},{name:"get public.key",category:"get",params:[],description:"Get public key (hex)",serialOnly:!1,hasParam:!1},{name:"get radio",category:"get",params:[],description:"Get radio params (freq,bw,sf,cr)",serialOnly:!1,hasParam:!1},{name:"get repeat",category:"get",params:[],description:"Get repeat/forward status (on/off)",serialOnly:!1,hasParam:!1},{name:"get role",category:"get",params:[],description:"Get device role",serialOnly:!1,hasParam:!1},{name:"get rxdelay",category:"get",params:[],description:"Get RX delay base",serialOnly:!1,hasParam:!1},{name:"get tx",category:"get",params:[],description:"Get TX power (dBm)",serialOnly:!1,hasParam:!1},{name:"get txdelay",category:"get",params:[],description:"Get TX delay factor",serialOnly:!1,hasParam:!1},{name:"gps",category:"gps",params:[],description:"Show GPS status",serialOnly:!1,hasParam:!1},{name:"gps advert",category:"gps",params:[],description:"Get/set GPS advert location policy",serialOnly:!1,hasParam:!0},{name:"gps off",category:"gps",params:[],description:"Disable GPS",serialOnly:!1,hasParam:!0},{name:"gps on",category:"gps",params:[],description:"Enable GPS",serialOnly:!1,hasParam:!0},{name:"gps setloc",category:"gps",params:[],description:"Set node location from GPS",serialOnly:!1,hasParam:!0},{name:"gps sync",category:"gps",params:[],description:"Sync time from GPS",serialOnly:!1,hasParam:!0},{name:"log",category:"logging",params:[],description:"Dump log file (serial only)",serialOnly:!0,hasParam:!1},{name:"log erase",category:"logging",params:[],description:"Erase log file",serialOnly:!1,hasParam:!0},{name:"log start",category:"logging",params:[],description:"Start packet logging",serialOnly:!1,hasParam:!0},{name:"log stop",category:"logging",params:[],description:"Stop packet logging",serialOnly:!1,hasParam:!0},{name:"neighbor.remove",category:"neighbor",params:[],description:"Remove neighbor by pubkey",serialOnly:!1,hasParam:!0},{name:"neighbors",category:"neighbor",params:[],description:"List neighbors",serialOnly:!1,hasParam:!1},{name:"get",category:"other",params:[],description:"Execute get command",serialOnly:!1,hasParam:!0},{name:"set",category:"other",params:[{name:"value",type:"float"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Execute set command",serialOnly:!1,hasParam:!0},{name:"tempradio",category:"radio",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Apply temporary radio params (freq bw sf cr timeout_mins)",serialOnly:!1,hasParam:!0},{name:"sensor get",category:"sensor",params:[],description:"Get sensor/custom variable value",serialOnly:!1,hasParam:!0},{name:"sensor list",category:"sensor",params:[{name:"value",type:"int"}],description:"List all sensor/custom variables",serialOnly:!1,hasParam:!0},{name:"sensor set",category:"sensor",params:[],description:"Set sensor/custom variable value",serialOnly:!1,hasParam:!0},{name:"set adc.multiplier",category:"set",params:[{name:"value",type:"float"}],description:"Set ADC multiplier",serialOnly:!1,hasParam:!0},{name:"set advert.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"string"}],description:"Set local advert interval (1-10080 min, 0=off)",serialOnly:!1,hasParam:!0},{name:"set af",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set airtime factor (0-9)",serialOnly:!1,hasParam:!0},{name:"set agc.reset.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set AGC reset interval (seconds, rounded to 4)",serialOnly:!1,hasParam:!0},{name:"set allow.read.only",category:"set",params:[{name:"value",type:"int"}],description:"Set read-only access (on/off)",serialOnly:!1,hasParam:!0},{name:"set bridge.baud",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set bridge baud (9600-115200)",serialOnly:!1,hasParam:!0},{name:"set bridge.channel",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"string"}],description:"Set bridge channel (1-14)",serialOnly:!1,hasParam:!0},{name:"set bridge.delay",category:"set",params:[{name:"value",type:"int"}],description:"Set bridge delay (0-10000 ms)",serialOnly:!1,hasParam:!0},{name:"set bridge.enabled",category:"set",params:[{name:"value",type:"int"}],description:"Enable/disable bridge",serialOnly:!1,hasParam:!0},{name:"set bridge.secret",category:"set",params:[{name:"value",type:"string"},{name:"value",type:"float"}],description:"Set bridge encryption secret",serialOnly:!1,hasParam:!0},{name:"set bridge.source",category:"set",params:[{name:"value",type:"int"}],description:"Set bridge source (rx/tx)",serialOnly:!1,hasParam:!0},{name:"set direct.txdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set direct TX delay factor",serialOnly:!1,hasParam:!0},{name:"set flood.advert.interval",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set flood advert interval (3-48 hours, 0=off)",serialOnly:!1,hasParam:!0},{name:"set flood.max",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"float"}],description:"Set max flood hops (0-64)",serialOnly:!1,hasParam:!0},{name:"set freq",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set frequency MHz (serial only, reboot required)",serialOnly:!0,hasParam:!0},{name:"set guest.password",category:"set",params:[{name:"value",type:"string"}],description:"Set guest password",serialOnly:!1,hasParam:!0},{name:"set int.thresh",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set interference threshold",serialOnly:!1,hasParam:!0},{name:"set lat",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set latitude",serialOnly:!1,hasParam:!0},{name:"set lon",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set longitude",serialOnly:!1,hasParam:!0},{name:"set multi.acks",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set multi-ack (0/1)",serialOnly:!1,hasParam:!0},{name:"set name",category:"set",params:[{name:"value",type:"string"},{name:"value",type:"int"}],description:"Set node name",serialOnly:!1,hasParam:!0},{name:"set prv.key",category:"set",params:[{name:"value",type:"string"}],description:"Set private key (hex, restart required)",serialOnly:!1,hasParam:!0},{name:"set radio",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set radio params (freq bw sf cr)",serialOnly:!1,hasParam:!0},{name:"set repeat",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"int"}],description:"Set repeat/forward (on/off)",serialOnly:!1,hasParam:!0},{name:"set rxdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"float"}],description:"Set RX delay base",serialOnly:!1,hasParam:!0},{name:"set tx",category:"set",params:[{name:"value",type:"int"},{name:"value",type:"float"}],description:"Set TX power (dBm)",serialOnly:!1,hasParam:!0},{name:"set txdelay",category:"set",params:[{name:"value",type:"float"},{name:"value",type:"int"}],description:"Set TX delay factor",serialOnly:!1,hasParam:!0},{name:"stats-core",category:"stats",params:[],description:"Show core statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"stats-packets",category:"stats",params:[],description:"Show packet statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"stats-radio",category:"stats",params:[],description:"Show radio statistics (serial only)",serialOnly:!0,hasParam:!1},{name:"advert",category:"system",params:[],description:"Send self advertisement",serialOnly:!1,hasParam:!1},{name:"board",category:"system",params:[],description:"Show board/manufacturer name",serialOnly:!1,hasParam:!1},{name:"clear stats",category:"system",params:[],description:"Reset statistics counters",serialOnly:!1,hasParam:!0},{name:"clock",category:"system",params:[{name:"value",type:"int"}],description:"Display current time",serialOnly:!1,hasParam:!0},{name:"clock sync",category:"system",params:[],description:"Sync clock from sender timestamp",serialOnly:!1,hasParam:!0},{name:"password",category:"system",params:[{name:"value",type:"string"}],description:"Change admin password",serialOnly:!1,hasParam:!0},{name:"reboot",category:"system",params:[],description:"Reboot the device",serialOnly:!1,hasParam:!1},{name:"start ota",category:"system",params:[{name:"value",type:"int"}],description:"Start OTA firmware update",serialOnly:!1,hasParam:!0},{name:"time",category:"system",params:[{name:"value",type:"int"}],description:"Set time to epoch seconds",serialOnly:!1,hasParam:!0},{name:"ver",category:"system",params:[],description:"Show firmware version and build date",serialOnly:!1,hasParam:!1}].filter(e=>!e.serialOnly&&!f.has(e.name)&&!h.some(a=>e.name.startsWith(a))).map(e=>({cmd:e.name,desc:e.description,params:e.hasParam?"{value}":void 0,required:e.hasParam}))],x={"set mode":["forward","monitor"],"set duty":["on","off"],"set repeat":["on","off"],"set tx":["10","14","17","20","22"],"set sf":["7","8","9","10","11","12"],"set bw":["125","250","500"],"set af":["0.5","1.0","1.5","2.0"],"set txdelay":["0.5","0.7","1.0","1.5"],"set direct.txdelay":["0.3","0.5","0.7"],"set log":["debug","info","warning"]};function b(e){switch(e){case"success":return"text-accent-success";case"error":return"text-accent-danger";case"warning":return"text-amber-400";case"info":return"text-accent-tertiary";case"value":return"text-accent-primary";case"system":return"text-text-muted";default:return"text-text-secondary"}}const w=a.memo(function({entry:e}){return"command"===e.type?t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx("span",{className:"text-text-muted font-medium select-none",children:"$"}),t.jsx("span",{className:"text-text-primary font-semibold",children:e.content})]}):"system"===e.type?t.jsx("div",{className:s("py-0.5",b(e.outputType||"system")),children:e.content}):e.content.includes("██")?t.jsx("pre",{className:s("terminal-ascii font-mono leading-none py-2 whitespace-pre",b(e.outputType||"value")),children:e.content}):t.jsx("div",{className:"ml-4 font-mono text-[13px] py-1",children:e.content.split("\n").map((a,r)=>{const s=function(e,a){if(e.startsWith("HELP_HEADER:::"))return[{text:e.slice(14),color:"text-text-primary font-bold"}];if(e.startsWith("HELP_NOTE:::"))return[{text:e.slice(12),color:"text-text-muted italic"}];const t=e.match(/^([a-z][a-z0-9.]*(?:\s+[a-z][a-z0-9.]*)?):::(.+)$/);if(t){const[,e,a]=t,r=e.split(" "),s=r[0];let n="text-accent-tertiary";"get"===s?n="text-accent-success":"set"===s&&(n="text-amber-400");const o=[{text:` ${s}`,color:`${n} font-semibold`}];r.length>1&&o.push({text:` ${r.slice(1).join(" ")}`,color:"text-accent-primary"});const i=" ".repeat(Math.max(1,22-e.length));return o.push({text:`${i}${a}`,color:"text-text-muted"}),o}if("error"===a||"warning"===a)return[{text:e,color:b(a)}];if("value"===a)return[{text:e,color:b("value")}];const r=e.match(/^([\w\s.]+):\s*(.+)$/);if(r){const[,e,a]=r;return[{text:`${e}: `,color:"text-text-muted"},{text:a,color:"text-accent-primary font-semibold"}]}return e.startsWith("OK")?[{text:e,color:b("success")}]:[{text:e,color:b(a)}]}(a,e.outputType||"default");return t.jsx("div",{className:"leading-relaxed",children:s.map((e,a)=>t.jsx("span",{className:e.color,children:e.text},a))},r)})})});function O(){const e=n(),f=g(e=>e.entries),h=g(e=>e.commandHistory),b=g(e=>e.isInitialized),{addEntry:O,updateEntry:P,addCommand:k,clearEntries:S,setInitialized:$}=g(),[_,N]=a.useState(""),[E,j]=a.useState(-1),[G,T]=a.useState(!1),[C,F]=a.useState([]),[D,W]=a.useState(0),[L,I]=a.useState(0),[R,A]=a.useState(!1),H=a.useRef(null),K=a.useRef(null),M=a.useRef(null);a.useEffect(()=>{b||(async()=>{O({type:"output",content:"██████ ██ ██ ███ ███ ██████\n██ ██ ██ ██ ████ ████ ██ \n██████ ████ ██ ████ ██ ██ \n██ ██ ██ ██ ██ ██ \n██ ██ ██ ██ ██████",outputType:"value"}),await new Promise(e=>setTimeout(e,200));const e=O({type:"system",content:"● Initializing terminal...",outputType:"system"});await new Promise(e=>setTimeout(e,400)),P(e,{content:"✓ Initializing terminal...",outputType:"success"});const a=O({type:"system",content:"● Connecting to repeater...",outputType:"system"});await new Promise(e=>setTimeout(e,600)),P(a,{content:"✓ Connected to repeater",outputType:"success"}),O({type:"system",content:"Ready. Type 'help' for commands.",outputType:"system"}),$(!0)})()},[b,O,P,$]),a.useEffect(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight)},[f]);const q=a.useCallback(()=>{var e;null==(e=H.current)||e.focus()},[]),z=a.useCallback(e=>{const a=e.trim().toLowerCase();if(!a)return T(!1),void F([]);const t=v.filter(e=>e.cmd.toLowerCase().startsWith(a));if(t.length>0)return F(t),W(0),void T(!0);if(a.includes(" ")){const e=a.lastIndexOf(" "),t=a.substring(0,e),r=a.substring(e+1),s=v.find(e=>e.cmd.toLowerCase()===t);if(s&&x[s.cmd]){const e=x[s.cmd].filter(e=>e.toLowerCase().startsWith(r)).map(e=>({cmd:`${s.cmd} ${e}`,desc:`→ ${e}`}));if(e.length>0)return F(e),W(0),void T(!0)}}T(!1),F([])},[]),X=a.useCallback(e=>{var a;const t=C[e];t&&(t.required&&t.params?(N(t.cmd+" "),z(t.cmd+" ")):(N(t.cmd),T(!1)),null==(a=H.current)||a.focus())},[C,z]),U=a.useCallback(async e=>{var a,t,r,s,n,p,y,u;const g=e.trim();if(!g)return;const f=g.toLowerCase();if(k(g),O({type:"command",content:g}),"clear"===f)return void S();if("help"===f){const e=v.map(e=>`${e.cmd}:::${e.desc}`).join("\n");return void O({type:"output",content:`HELP_HEADER:::Available commands\n${e}\nHELP_NOTE:::Some MeshCore commands not available via HTTP.`,outputType:"default"})}const h=O({type:"output",content:"processing...",outputType:"system"});try{const e=await o();let v="",x="info";const b=e=>{const a=Math.floor(e/86400),t=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return a>0?`${a}d ${t}h ${r}m`:t>0?`${t}h ${r}m`:`${r}m`};if("status"===f){v=`Mode: ${(null==(t=null==(a=e.config)?void 0:a.repeater)?void 0:t.mode)||"unknown"} | Neighbors: ${Object.keys(e.neighbors||{}).length} | Uptime: ${b(e.uptime_seconds||0)}`}else if("uptime"===f)v=b(e.uptime_seconds||0),x="value";else if("packets"===f)v=`rx: ${e.rx_count??0}\ntx: ${e.tx_count??0}\nfwd: ${e.forwarded_count??0}\ndrop: ${e.dropped_count??0}`;else if("neighbors"===f){const a=e.neighbors||{},t=Object.entries(a);if(0===t.length)v="No neighbors discovered yet.",x="warning";else{const e=t.map(([e,a])=>{const t=a.name||a.node_name||"Unknown";return` ${e.slice(0,8)} ${t}`});v=`Neighbors (${t.length}):\n${e.join("\n")}`}}else if("board"===f)v="pyMC_Repeater (Linux/RPi)",x="value";else if(f.startsWith("get ")){const a=f.slice(4).trim(),t=null==(r=e.config)?void 0:r.delays,o=null==(s=e.config)?void 0:s.radio,i=null==(n=e.config)?void 0:n.repeater,l=null==(p=e.config)?void 0:p.duty_cycle;switch(a){case"name":v=(null==(y=e.config)?void 0:y.node_name)||"Unknown";break;case"role":v="repeater";break;case"lat":v=null!=(null==i?void 0:i.latitude)?String(i.latitude):"not set";break;case"lon":v=null!=(null==i?void 0:i.longitude)?String(i.longitude):"not set";break;case"freq":v=(null==o?void 0:o.frequency)?(o.frequency/1e6).toFixed(3):"?";break;case"tx":v=String((null==o?void 0:o.tx_power)??"?");break;case"bw":v=(null==o?void 0:o.bandwidth)?String(o.bandwidth/1e3):"?";break;case"sf":v=String((null==o?void 0:o.spreading_factor)??"?");break;case"cr":v=String((null==o?void 0:o.coding_rate)??"?");break;case"radio":v=o?`freq: ${(o.frequency/1e6).toFixed(3)} MHz\nbw: ${o.bandwidth/1e3} kHz\nsf: ${o.spreading_factor}\ncr: 4/${o.coding_rate}`:"?";break;case"af":case"txdelay":v=String((null==t?void 0:t.tx_delay_factor)??"1.0");break;case"direct.txdelay":v=String((null==t?void 0:t.direct_tx_delay_factor)??"0.5");break;case"mode":v=(null==i?void 0:i.mode)||"forward";break;case"repeat":v="forward"===(null==i?void 0:i.mode)?"on":"off";break;case"flood.max":v=String((null==i?void 0:i.max_flood_hops)??"3");break;case"flood.advert.interval":v=null!=(null==i?void 0:i.send_advert_interval_hours)?`${i.send_advert_interval_hours}h`:"?";break;case"advert.interval":v=null!=(null==i?void 0:i.advert_interval_minutes)?`${i.advert_interval_minutes}m`:"120m";break;case"rxdelay":v=String((null==t?void 0:t.rx_delay_base)??"0.0");break;case"duty":case"duty.enabled":v=(null==l?void 0:l.enforcement_enabled)?"on":"off";break;case"duty.max":v=null!=(null==l?void 0:l.max_airtime_percent)?`${l.max_airtime_percent}%`:"?";break;case"public.key":v=e.public_key||"not available";break;case"prv.key":v="Private keys not available via CLI.\nUse /api/identities endpoint or config.yaml",x="warning";break;case"guest.password":case"allow.read.only":v="Security settings not exposed via stats API.\nCheck /etc/pymc_repeater/config.yaml",x="warning";break;default:v=`Unknown parameter: ${a}\nAvailable: name, role, lat, lon, freq, tx, bw, sf, cr, radio, af, txdelay, direct.txdelay, rxdelay, mode, repeat, flood.max, advert.interval, duty, public.key`,x="error"}"error"!==x&&(x="value")}else if("advert"===f){const e=await i();v=e.success?"OK - Advert sent":`Error: ${e.error||"Failed"}`,x=e.success?"success":"error"}else if(f.startsWith("set mode ")){const e=f.split(" ")[2];if("forward"!==e&&"monitor"!==e)v='Error: Mode must be "forward" or "monitor"',x="error";else{const a=await l(e);v=a.success?`OK - Mode set to ${e}`:"Error: Failed",x=a.success?"success":"error"}}else if(f.startsWith("set duty ")){const e=f.split(" ")[2],a="on"===e||"1"===e,t=await c(a);v=t.success?"OK - Duty cycle "+(a?"enabled":"disabled"):"Error: Failed",x=t.success?"success":"error"}else if(f.startsWith("set tx ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||e<2||e>22)v="Error: TX power must be 2-22 dBm (SX1262 chip max)",x="error";else{const a=await m({tx_power:e});v=a.success?`OK - TX power set to ${e}dBm`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set af ")||f.startsWith("set txdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0||e>5)v="Error: TX delay factor must be 0.0-5.0",x="error";else{const a=await m({tx_delay_factor:e});v=a.success?`OK - TX delay set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set direct.txdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0||e>5)v="Error: Direct TX delay must be 0.0-5.0",x="error";else{const a=await m({direct_tx_delay_factor:e});v=a.success?`OK - Direct TX delay set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set log ")){const e=null==(u=f.split(" ")[2])?void 0:u.toUpperCase();if(["DEBUG","INFO","WARNING","ERROR"].includes(e)){const a=await d(e);v=a.success?`OK - Log level set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}else v="Error: Level must be debug, info, warning, or error",x="error"}else if(f.startsWith("set rxdelay ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<0)v="Error: RX delay must be >= 0",x="error";else{const a=await m({rx_delay_base:e});v=a.success?`OK - RX delay base set to ${e}s`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set name ")){const e=g.substring(9).trim();if(e){const a=await m({node_name:e});v=a.success?`OK - Node name set to "${e}"`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}else v="Error: Node name cannot be empty",x="error"}else if(f.startsWith("set lat ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<-90||e>90)v="Error: Latitude must be -90 to 90",x="error";else{const a=await m({latitude:e});v=a.success?`OK - Latitude set to ${e}°`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set lon ")){const e=parseFloat(f.split(" ")[2]);if(isNaN(e)||e<-180||e>180)v="Error: Longitude must be -180 to 180",x="error";else{const a=await m({longitude:e});v=a.success?`OK - Longitude set to ${e}°`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set flood.max ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||e<0||e>64)v="Error: Max flood hops must be 0-64",x="error";else{const a=await m({max_flood_hops:e});v=a.success?`OK - Max flood hops set to ${e}`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set flood.advert.interval ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||0!==e&&(e<3||e>48))v="Error: Flood advert interval must be 0 (off) or 3-48 hours",x="error";else{const a=await m({flood_advert_interval_hours:e});v=a.success?0===e?"OK - Flood adverts disabled":`OK - Flood advert interval set to ${e}h`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else if(f.startsWith("set advert.interval ")){const e=parseInt(f.split(" ")[2]);if(isNaN(e)||0!==e&&(e<1||e>10080))v="Error: Advert interval must be 0 (off) or 1-10080 minutes",x="error";else{const a=await m({advert_interval_minutes:e});v=a.success?0===e?"OK - Local adverts disabled":`OK - Local advert interval set to ${e}m`:`Error: ${a.error||"Failed"}`,x=a.success?"success":"error"}}else v=`Unknown command: ${g}\nType 'help' for available commands.`,x="error";P(h,{content:v,outputType:x})}catch(x){P(h,{content:`Error: ${x instanceof Error?x.message:"Command failed"}`,outputType:"error"})}},[O,k,P,S]),B=a.useCallback(e=>{var a,t,r,s,n,o;if(G&&C.length>0){if("ArrowDown"===e.key){e.preventDefault();const s=Math.min(D+1,C.length-1);return W(s),void(null==(r=null==(t=null==(a=M.current)?void 0:a.children[0])?void 0:t.children[s])||r.scrollIntoView({block:"nearest"}))}if("ArrowUp"===e.key){e.preventDefault();const a=Math.max(D-1,0);return W(a),void(null==(o=null==(n=null==(s=M.current)?void 0:s.children[0])?void 0:n.children[a])||o.scrollIntoView({block:"nearest"}))}if("Tab"===e.key)return e.preventDefault(),void X(D);if("Escape"===e.key)return e.preventDefault(),void T(!1)}if("Enter"===e.key){e.preventDefault();const a=_;return N(""),j(-1),T(!1),void U(a)}if("ArrowUp"!==e.key||G)if("ArrowDown"!==e.key||G);else if(e.preventDefault(),E>0){const e=E-1;j(e),N(h[h.length-1-e]||"")}else 0===E&&(j(-1),N(""));else if(e.preventDefault(),h.length>0&&E{N(e.target.value),I(e.target.selectionStart||e.target.value.length),z(e.target.value)},[z]),J=a.useCallback(e=>{const a=e.target;I(a.selectionStart||0)},[]);return t.jsxs(p,{children:[t.jsx(y,{title:"Terminal",icon:t.jsx(r,{})}),t.jsxs(u,{noPadding:!0,className:"terminal-card overflow-hidden flex flex-col isolate",onClick:q,children:[t.jsx("div",{ref:K,className:"flex-1 overflow-y-auto font-mono text-sm bg-black/40 p-3 sm:p-4 md:p-5",children:f.map(e=>t.jsx(w,{entry:e},e.id))}),t.jsxs("div",{className:"relative border-t border-white/10 bg-black/50",children:[t.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-3",children:[t.jsx("span",{className:"text-text-muted font-mono font-bold select-none",children:"$"}),t.jsxs("div",{className:"flex-1 relative font-mono text-sm",children:[t.jsx("input",{ref:H,type:"text",value:_,onChange:V,onKeyDown:B,onSelect:J,onFocus:()=>A(!0),onBlur:()=>A(!1),disabled:!b,className:"absolute inset-0 w-full bg-transparent text-transparent outline-none disabled:opacity-50 selection:bg-transparent",style:{caretColor:"transparent"},autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),t.jsx("div",{className:"relative pointer-events-none select-none","aria-hidden":!0,children:b?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-text-primary",children:_.slice(0,L)}),t.jsx("span",{className:s("inline-block w-[0.6em] h-[1.2em] align-text-bottom",R?"bg-accent-primary":"bg-text-muted/30"),style:{marginBottom:"-0.1em"},children:t.jsx("span",{className:"text-bg-primary",children:_[L]||""})}),t.jsx("span",{className:"text-text-primary",children:_.slice(L+1)})]}):t.jsx("span",{className:"text-text-muted",children:"Connecting..."})})]})]}),t.jsxs("div",{className:"px-3 sm:px-4 py-1 border-t border-white/5 bg-black/30 flex justify-between text-[10px] text-text-muted",children:[t.jsx("span",{className:"hidden sm:inline",children:"↑↓ History"}),t.jsx("span",{className:"sm:hidden",children:"Terminal"}),(null==e?void 0:e.version)&&t.jsxs("span",{children:["pyMC v",e.version]})]})]}),G&&C.length>0&&t.jsxs("div",{ref:M,className:"absolute left-2 right-2 bottom-[72px] rounded-xl shadow-2xl overflow-hidden z-50 border border-white/20 bg-black/80 backdrop-blur-xl",children:[t.jsx("div",{className:"max-h-64 overflow-y-auto",children:C.map((e,a)=>t.jsxs("div",{onClick:()=>X(a),className:s("px-4 py-2.5 cursor-pointer border-b border-white/10 last:border-b-0 transition-colors",a===D?"bg-accent-primary/25":"hover:bg-white/10"),children:[t.jsx("span",{className:s("font-mono text-sm",a===D?"text-accent-primary":"text-text-primary"),children:e.cmd}),t.jsx("span",{className:"text-xs text-text-muted ml-4",children:e.desc})]},e.cmd))}),t.jsx("div",{className:"px-3 py-1.5 border-t border-white/10 text-[10px] text-text-muted text-right bg-white/5",children:"Tab to select"})]})]})]})}export{O as default}; diff --git a/frontend/dist/assets/index-CO4RTX0p.css b/frontend/dist/assets/index-CO4RTX0p.css new file mode 100644 index 00000000..ceeccf8c --- /dev/null +++ b/frontend/dist/assets/index-CO4RTX0p.css @@ -0,0 +1 @@ +.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/inter-latin-400-normal-C38fXH4l.woff2) format("woff2"),url(/assets/inter-latin-400-normal-CyCys3Eg.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/inter-latin-500-normal-Cerq10X2.woff2) format("woff2"),url(/assets/inter-latin-500-normal-BL9OpVg8.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/inter-latin-600-normal-LgqL8muc.woff2) format("woff2"),url(/assets/inter-latin-600-normal-CiBQ2DWP.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/inter-latin-700-normal-Yt3aPRUw.woff2) format("woff2"),url(/assets/inter-latin-700-normal-BLAVimhd.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:800;src:url(/assets/jetbrains-mono-latin-800-normal-D2mQHRMK.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-800-normal-Dj9qwObk.woff) format("woff")}@font-face{font-family:Rubik Mono One;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/rubik-mono-one-latin-400-normal-U2Afr9Di.woff2) format("woff2"),url(/assets/rubik-mono-one-latin-400-normal-Cd19iSlZ.woff) format("woff")}@font-face{font-family:"Jacquard 12";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/jacquard-12-latin-400-normal-CFgZUtB9.woff2) format("woff2"),url(/assets/jacquard-12-latin-400-normal-DUTP1itc.woff) format("woff")}@font-face{font-family:Cantora One;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cantora-one-latin-400-normal-BBwF22QI.woff2) format("woff2"),url(/assets/cantora-one-latin-400-normal-DwNspYVg.woff) format("woff")}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2) format("woff2"),url(/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff) format("woff")}@font-face{font-family:"Instrument Serif";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/instrument-serif-latin-400-normal-DnYpCC2O.woff2) format("woff2"),url(/assets/instrument-serif-latin-400-normal-BVbkICAY.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/instrument-sans-latin-400-normal-DRC__1Mx.woff2) format("woff2"),url(/assets/instrument-sans-latin-400-normal-D1W7dsQl.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/instrument-sans-latin-500-normal-Dk9ku72i.woff2) format("woff2"),url(/assets/instrument-sans-latin-500-normal-Z6ESRlEs.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/instrument-sans-latin-600-normal-B7fBEWYG.woff2) format("woff2"),url(/assets/instrument-sans-latin-600-normal-B9e8oLYv.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/source-code-pro-latin-300-normal--fObHmet.woff2) format("woff2"),url(/assets/source-code-pro-latin-300-normal-BgqKZHKu.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2) format("woff2"),url(/assets/source-code-pro-latin-400-normal-Bf_aQirX.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2) format("woff2"),url(/assets/source-code-pro-latin-500-normal-FgltuOLy.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/source-code-pro-latin-600-normal-DVVSlvOB.woff2) format("woff2"),url(/assets/source-code-pro-latin-600-normal-B5rj6vMs.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/noto-sans-latin-400-normal-BTkUljjl.woff2) format("woff2"),url(/assets/noto-sans-latin-400-normal-DPpKfCgK.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/noto-sans-latin-500-normal-DCA2Z9Cj.woff2) format("woff2"),url(/assets/noto-sans-latin-500-normal-CDPngY5C.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/noto-sans-latin-600-normal-Dkgu5AE5.woff2) format("woff2"),url(/assets/noto-sans-latin-600-normal-DVJMj_t0.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/noto-sans-latin-700-normal-CrvTEWhy.woff2) format("woff2"),url(/assets/noto-sans-latin-700-normal-ZyrKABVF.woff) format("woff")}/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-teal-400:oklch(77.7% .152 181.912);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-indigo-400:oklch(67.3% .182 276.935);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--drop-shadow-lg:0 4px 4px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-display);--default-mono-font-family:var(--font-data);--font-title:var(--font-title)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-x-1{inset-inline:calc(var(--spacing)*1)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-2{top:calc(var(--spacing)*-2)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.top-\[2px\]{top:2px}.top-\[3\.5rem\]{top:3.5rem}.top-\[var\(--tip-y\,0\)\]{top:var(--tip-y,0)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing)*-.5)}.-right-2{right:calc(var(--spacing)*-2)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-1\.5{right:calc(var(--spacing)*1.5)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.-bottom-0\.5{bottom:calc(var(--spacing)*-.5)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-1{bottom:calc(var(--spacing)*1)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-\[72px\]{bottom:72px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-4{left:calc(var(--spacing)*4)}.left-\[var\(--tip-x\,0\)\]{left:var(--tip-x,0)}.isolate{isolation:isolate}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[600\]{z-index:600}.z-\[9999\]{z-index:9999}.z-\[10001\]{z-index:10001}.z-\[10002\]{z-index:10002}.z-\[10003\]{z-index:10003}.z-\[10010\]{z-index:10010}.col-auto{grid-column:auto}.col-span-2{grid-column:span 2/span 2}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:475px){.container{max-width:475px}}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-0\.5{margin-inline:calc(var(--spacing)*.5)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing)*-1)}.mr-0\.5{margin-right:calc(var(--spacing)*.5)}.mr-1\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-0\.5{margin-left:calc(var(--spacing)*.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-1\.5{margin-left:calc(var(--spacing)*1.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-7{margin-left:calc(var(--spacing)*7)}.ml-8{margin-left:calc(var(--spacing)*8)}.ml-9{margin-left:calc(var(--spacing)*9)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-1\/2{height:50%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-28{height:calc(var(--spacing)*28)}.h-32{height:calc(var(--spacing)*32)}.h-44{height:calc(var(--spacing)*44)}.h-48{height:calc(var(--spacing)*48)}.h-56{height:calc(var(--spacing)*56)}.h-64{height:calc(var(--spacing)*64)}.h-72{height:calc(var(--spacing)*72)}.h-80{height:calc(var(--spacing)*80)}.h-96{height:calc(var(--spacing)*96)}.h-\[1\.2em\]{height:1.2em}.h-\[18px\]{height:18px}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[38px\]{height:38px}.h-\[200px\]{height:200px}.h-\[500px\]{height:500px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-0{max-height:calc(var(--spacing)*0)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100vh-300px\)\]{max-height:calc(100vh - 300px)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[3rem\]{min-height:3rem}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-\[60px\]{min-height:60px}.min-h-\[100dvh\]{min-height:100dvh}.min-h-\[120px\]{min-height:120px}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-11{width:calc(var(--spacing)*11)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-36{width:calc(var(--spacing)*36)}.w-40{width:calc(var(--spacing)*40)}.w-44{width:calc(var(--spacing)*44)}.w-48{width:calc(var(--spacing)*48)}.w-64{width:calc(var(--spacing)*64)}.w-72{width:calc(var(--spacing)*72)}.w-\[0\.6em\]{width:.6em}.w-\[3px\]{width:3px}.w-\[14px\]{width:14px}.w-\[32px\]{width:32px}.w-\[52px\]{width:52px}.w-\[240px\]{width:240px}.w-\[540px\]{width:540px}.w-full{width:100%}.w-px{width:1px}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[85vw\]{max-width:85vw}.max-w-\[140px\]{max-width:140px}.max-w-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[18px\]{min-width:18px}.min-w-\[60px\]{min-width:60px}.min-w-\[80px\]{min-width:80px}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing)*5);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-full{--tw-translate-y:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[135deg\]{rotate:135deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-ns-resize{cursor:ns-resize}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.touch-manipulation{touch-action:manipulation}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)_auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-evenly{justify-content:space-evenly}.justify-start{justify-content:flex-start}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[2px\]{gap:2px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-3{column-gap:calc(var(--spacing)*3)}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.gap-y-2{row-gap:calc(var(--spacing)*2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-subtle>:not(:last-child)),:where(.divide-border-subtle\/30>:not(:last-child)){border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){:where(.divide-border-subtle\/30>:not(:last-child)){border-color:color-mix(in oklab,var(--border-subtle)30%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.self-center{align-self:center}.self-start{align-self:flex-start}.justify-self-start{justify-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[1\.125rem\]{border-radius:1.125rem}.rounded-\[1px\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:1px}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-\[var\(--route-direct\)\]\/30{border-color:var(--route-direct)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-direct\)\]\/30{border-color:color-mix(in oklab,var(--route-direct)30%,transparent)}}.border-\[var\(--route-flood\)\]\/30{border-color:var(--route-flood)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-flood\)\]\/30{border-color:color-mix(in oklab,var(--route-flood)30%,transparent)}}.border-\[var\(--route-transport\)\]\/30{border-color:var(--route-transport)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-transport\)\]\/30{border-color:color-mix(in oklab,var(--route-transport)30%,transparent)}}.border-accent-danger\/30{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-danger\/30{border-color:color-mix(in oklab,var(--accent-danger)30%,transparent)}}.border-accent-danger\/50{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-danger\/50{border-color:color-mix(in oklab,var(--accent-danger)50%,transparent)}}.border-accent-primary,.border-accent-primary\/30{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/30{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.border-accent-primary\/40{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/40{border-color:color-mix(in oklab,var(--accent-primary)40%,transparent)}}.border-accent-primary\/50{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/50{border-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.border-accent-purple\/30{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-purple\/30{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.border-accent-red\/50{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-red\/50{border-color:color-mix(in oklab,var(--accent-danger)50%,transparent)}}.border-accent-secondary\/20{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/20{border-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.border-accent-secondary\/30{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/30{border-color:color-mix(in oklab,var(--accent-secondary)30%,transparent)}}.border-accent-secondary\/50{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/50{border-color:color-mix(in oklab,var(--accent-secondary)50%,transparent)}}.border-accent-success\/20{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/20{border-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.border-accent-success\/30{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/30{border-color:color-mix(in oklab,var(--accent-success)30%,transparent)}}.border-accent-success\/40{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/40{border-color:color-mix(in oklab,var(--accent-success)40%,transparent)}}.border-accent-success\/50{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/50{border-color:color-mix(in oklab,var(--accent-success)50%,transparent)}}.border-accent-tertiary\/20{border-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.border-accent-tertiary\/20{border-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.border-accent-tertiary\/30{border-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.border-accent-tertiary\/30{border-color:color-mix(in oklab,var(--accent-tertiary)30%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-border,.border-border-subtle,.border-border-subtle\/50{border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){.border-border-subtle\/50{border-color:color-mix(in oklab,var(--border-subtle)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-signal-poor\/30{border-color:var(--signal-poor)}@supports (color:color-mix(in lab,red,red)){.border-signal-poor\/30{border-color:color-mix(in oklab,var(--signal-poor)30%,transparent)}}.border-toggle-on{border-color:var(--toggle-on)}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/6{border-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.border-white\/6{border-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-white\/\[0\.06\]{border-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.06\]{border-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.border-white\/\[0\.08\]{border-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.border-t-transparent{border-top-color:#0000}.border-l-amber-400{border-left-color:var(--color-amber-400)}.bg-\[\#1a1a1a\]{background-color:#1a1a1a}.bg-\[\#2a2a2a\]{background-color:#2a2a2a}.bg-\[\#242627\]{background-color:#242627}.bg-\[\#F9D26F\]\/10{background-color:#f9d26f1a}.bg-\[var\(--route-direct\)\]\/20{background-color:var(--route-direct)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-direct\)\]\/20{background-color:color-mix(in oklab,var(--route-direct)20%,transparent)}}.bg-\[var\(--route-flood\)\]\/20{background-color:var(--route-flood)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-flood\)\]\/20{background-color:color-mix(in oklab,var(--route-flood)20%,transparent)}}.bg-\[var\(--route-transport\)\]\/20{background-color:var(--route-transport)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-transport\)\]\/20{background-color:color-mix(in oklab,var(--route-transport)20%,transparent)}}.bg-\[var\(--signal-critical\)\]{background-color:var(--signal-critical)}.bg-\[var\(--signal-excellent\)\]{background-color:var(--signal-excellent)}.bg-\[var\(--signal-fair\)\]{background-color:var(--signal-fair)}.bg-\[var\(--signal-good\)\]{background-color:var(--signal-good)}.bg-\[var\(--signal-poor\)\]{background-color:var(--signal-poor)}.bg-\[var\(--signal-unknown\)\]{background-color:var(--signal-unknown)}.bg-accent-danger,.bg-accent-danger\/10{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/10{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.bg-accent-danger\/15{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/15{background-color:color-mix(in oklab,var(--accent-danger)15%,transparent)}}.bg-accent-danger\/20{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/20{background-color:color-mix(in oklab,var(--accent-danger)20%,transparent)}}.bg-accent-primary,.bg-accent-primary\/5{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/5{background-color:color-mix(in oklab,var(--accent-primary)5%,transparent)}}.bg-accent-primary\/10{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/10{background-color:color-mix(in oklab,var(--accent-primary)10%,transparent)}}.bg-accent-primary\/15{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/15{background-color:color-mix(in oklab,var(--accent-primary)15%,transparent)}}.bg-accent-primary\/20{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/20{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.bg-accent-primary\/25{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/25{background-color:color-mix(in oklab,var(--accent-primary)25%,transparent)}}.bg-accent-primary\/40{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/40{background-color:color-mix(in oklab,var(--accent-primary)40%,transparent)}}.bg-accent-primary\/60{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/60{background-color:color-mix(in oklab,var(--accent-primary)60%,transparent)}}.bg-accent-purple\/30{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-purple\/30{background-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.bg-accent-red\/10{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-red\/10{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.bg-accent-secondary,.bg-accent-secondary\/5{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/5{background-color:color-mix(in oklab,var(--accent-secondary)5%,transparent)}}.bg-accent-secondary\/10{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/10{background-color:color-mix(in oklab,var(--accent-secondary)10%,transparent)}}.bg-accent-secondary\/15{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/15{background-color:color-mix(in oklab,var(--accent-secondary)15%,transparent)}}.bg-accent-secondary\/20{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/20{background-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.bg-accent-success,.bg-accent-success\/10{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/10{background-color:color-mix(in oklab,var(--accent-success)10%,transparent)}}.bg-accent-success\/15{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/15{background-color:color-mix(in oklab,var(--accent-success)15%,transparent)}}.bg-accent-success\/20{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/20{background-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.bg-accent-tertiary\/5{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/5{background-color:color-mix(in oklab,var(--accent-tertiary)5%,transparent)}}.bg-accent-tertiary\/10{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/10{background-color:color-mix(in oklab,var(--accent-tertiary)10%,transparent)}}.bg-accent-tertiary\/15{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/15{background-color:color-mix(in oklab,var(--accent-tertiary)15%,transparent)}}.bg-accent-tertiary\/20{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/20{background-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-400\/5{background-color:#fcbb000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/5{background-color:color-mix(in oklab,var(--color-amber-400)5%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-amber-500\/25{background-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/25{background-color:color-mix(in oklab,var(--color-amber-500)25%,transparent)}}.bg-bg-body,.bg-bg-body\/70{background-color:var(--bg-body)}@supports (color:color-mix(in lab,red,red)){.bg-bg-body\/70{background-color:color-mix(in oklab,var(--bg-body)70%,transparent)}}.bg-bg-elevated,.bg-bg-elevated\/20{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/20{background-color:color-mix(in oklab,var(--bg-elevated)20%,transparent)}}.bg-bg-elevated\/30{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/30{background-color:color-mix(in oklab,var(--bg-elevated)30%,transparent)}}.bg-bg-elevated\/50{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/50{background-color:color-mix(in oklab,var(--bg-elevated)50%,transparent)}}.bg-bg-elevated\/90{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/90{background-color:color-mix(in oklab,var(--bg-elevated)90%,transparent)}}.bg-bg-elevated\/95{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/95{background-color:color-mix(in oklab,var(--bg-elevated)95%,transparent)}}.bg-bg-subtle,.bg-bg-subtle\/30{background-color:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-bg-subtle\/30{background-color:color-mix(in oklab,var(--bg-subtle)30%,transparent)}}.bg-bg-subtle\/80{background-color:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-bg-subtle\/80{background-color:color-mix(in oklab,var(--bg-subtle)80%,transparent)}}.bg-bg-surface,.bg-bg-surface\/60{background-color:var(--bg-surface)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface\/60{background-color:color-mix(in oklab,var(--bg-surface)60%,transparent)}}.bg-bg-surface\/80{background-color:var(--bg-surface)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface\/80{background-color:color-mix(in oklab,var(--bg-surface)80%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black)70%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border-subtle{background-color:var(--border-subtle)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-500\/30{background-color:#6a72824d}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/30{background-color:color-mix(in oklab,var(--color-gray-500)30%,transparent)}}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-orange-500\/25{background-color:#fe6e0040}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/25{background-color:color-mix(in oklab,var(--color-orange-500)25%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-purple-500\/80{background-color:#ac4bffcc}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/80{background-color:color-mix(in oklab,var(--color-purple-500)80%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-signal-excellent,.bg-signal-excellent\/10{background-color:var(--signal-excellent)}@supports (color:color-mix(in lab,red,red)){.bg-signal-excellent\/10{background-color:color-mix(in oklab,var(--signal-excellent)10%,transparent)}}.bg-signal-fair,.bg-signal-fair\/10{background-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.bg-signal-fair\/10{background-color:color-mix(in oklab,var(--signal-fair)10%,transparent)}}.bg-signal-good,.bg-signal-good\/10{background-color:var(--signal-good)}@supports (color:color-mix(in lab,red,red)){.bg-signal-good\/10{background-color:color-mix(in oklab,var(--signal-good)10%,transparent)}}.bg-signal-poor,.bg-signal-poor\/10{background-color:var(--signal-poor)}@supports (color:color-mix(in lab,red,red)){.bg-signal-poor\/10{background-color:color-mix(in oklab,var(--signal-poor)10%,transparent)}}.bg-text-muted,.bg-text-muted\/15{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/15{background-color:color-mix(in oklab,var(--text-muted)15%,transparent)}}.bg-text-muted\/20{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/20{background-color:color-mix(in oklab,var(--text-muted)20%,transparent)}}.bg-text-muted\/30{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/30{background-color:color-mix(in oklab,var(--text-muted)30%,transparent)}}.bg-toggle-off{background-color:var(--toggle-off)}.bg-toggle-on{background-color:var(--toggle-on)}.bg-tooltip-bg,.bg-tooltip-bg\/80{background-color:var(--tooltip-bg)}@supports (color:color-mix(in lab,red,red)){.bg-tooltip-bg\/80{background-color:color-mix(in oklab,var(--tooltip-bg)80%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white)4%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.bg-gradient-to-bl{--tw-gradient-position:to bottom left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#9cf15b\]{--tw-gradient-from:#9cf15b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#9cf15b\]\/5{--tw-gradient-from:oklab(87.4074% -.139284 .1444/.05);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/20{--tw-gradient-from:#0003}@supports (color:color-mix(in lab,red,red)){.from-black\/20{--tw-gradient-from:color-mix(in oklab,var(--color-black)20%,transparent)}}.from-black\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/\[0\.03\]{--tw-gradient-from:#ffffff08}@supports (color:color-mix(in lab,red,red)){.from-white\/\[0\.03\]{--tw-gradient-from:color-mix(in oklab,var(--color-white)3%,transparent)}}.from-white\/\[0\.03\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/20{--tw-gradient-via:#fff3}@supports (color:color-mix(in lab,red,red)){.via-white\/20{--tw-gradient-via:color-mix(in oklab,var(--color-white)20%,transparent)}}.via-white\/20{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#8de04a\]{--tw-gradient-to:#8de04a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#9cf15b\]\/3{--tw-gradient-to:oklab(87.4074% -.139284 .1444/.03);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-cover{background-size:cover}.bg-center{background-position:50%}.bg-no-repeat{background-repeat:no-repeat}.fill-accent-success{fill:var(--accent-success)}.fill-text-secondary{fill:var(--text-secondary)}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-12{padding:calc(var(--spacing)*12)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-px{padding-block:1px}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-14{padding-top:calc(var(--spacing)*14)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-1\.5{padding-right:calc(var(--spacing)*1.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pr-6{padding-right:calc(var(--spacing)*6)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-11{padding-left:calc(var(--spacing)*11)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.align-text-bottom{vertical-align:text-bottom}.font-mono{font-family:var(--font-data)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#58b99d\]{color:#58b99d}.text-\[\#F9D26F\]{color:#f9d26f}.text-\[var\(--log-critical\)\]{color:var(--log-critical)}.text-\[var\(--log-debug\)\]{color:var(--log-debug)}.text-\[var\(--log-error\)\]{color:var(--log-error)}.text-\[var\(--log-info\)\]{color:var(--log-info)}.text-\[var\(--log-warning\)\]{color:var(--log-warning)}.text-\[var\(--pkt-ack\)\]{color:var(--pkt-ack)}.text-\[var\(--pkt-advert\)\]{color:var(--pkt-advert)}.text-\[var\(--pkt-anon\)\]{color:var(--pkt-anon)}.text-\[var\(--pkt-flood\)\]{color:var(--pkt-flood)}.text-\[var\(--pkt-grp-data\)\]{color:var(--pkt-grp-data)}.text-\[var\(--pkt-grp-txt\)\]{color:var(--pkt-grp-txt)}.text-\[var\(--pkt-path\)\]{color:var(--pkt-path)}.text-\[var\(--pkt-req\)\]{color:var(--pkt-req)}.text-\[var\(--pkt-response\)\]{color:var(--pkt-response)}.text-\[var\(--pkt-trace\)\]{color:var(--pkt-trace)}.text-\[var\(--pkt-txt-msg\)\]{color:var(--pkt-txt-msg)}.text-\[var\(--pkt-unknown\)\]{color:var(--pkt-unknown)}.text-\[var\(--route-direct\)\]{color:var(--route-direct)}.text-\[var\(--route-flood\)\]{color:var(--route-flood)}.text-\[var\(--route-transport\)\]{color:var(--route-transport)}.text-\[var\(--signal-fair\)\]{color:var(--signal-fair)}.text-\[var\(--status-warning\)\]{color:var(--status-warning)}.text-accent-danger{color:var(--accent-danger)}.text-accent-primary,.text-accent-purple{color:var(--accent-primary)}.text-accent-red{color:var(--accent-danger)}.text-accent-secondary{color:var(--accent-secondary)}.text-accent-success{color:var(--accent-success)}.text-accent-tertiary{color:var(--accent-tertiary)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/70{color:#fcbb00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/70{color:color-mix(in oklab,var(--color-amber-400)70%,transparent)}}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400)80%,transparent)}}.text-bg-body{color:var(--bg-body)}.text-black{color:var(--color-black)}.text-border-subtle{color:var(--border-subtle)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-400\/80{color:#05df72cc}@supports (color:color-mix(in lab,red,red)){.text-green-400\/80{color:color-mix(in oklab,var(--color-green-400)80%,transparent)}}.text-icon-card-title{color:var(--icon-card-title)}.text-icon-page-title{color:var(--icon-page-title)}.text-icon-widget{color:var(--icon-widget)}.text-indigo-400{color:var(--color-indigo-400)}.text-map-neighbor-color{color:var(--map-neighbor-color)}.text-orange-300{color:var(--color-orange-300)}.text-primary{color:var(--accent-tertiary)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400)80%,transparent)}}.text-secondary{color:var(--accent-secondary)}.text-signal-critical{color:var(--signal-critical)}.text-signal-excellent{color:var(--signal-excellent)}.text-signal-fair{color:var(--signal-fair)}.text-signal-good{color:var(--signal-good)}.text-signal-poor{color:var(--signal-poor)}.text-teal-400{color:var(--color-teal-400)}.text-text-muted,.text-text-muted\/30{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/30{color:color-mix(in oklab,var(--text-muted)30%,transparent)}}.text-text-muted\/50{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/50{color:color-mix(in oklab,var(--text-muted)50%,transparent)}}.text-text-muted\/60{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/60{color:color-mix(in oklab,var(--text-muted)60%,transparent)}}.text-text-muted\/70{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/70{color:color-mix(in oklab,var(--text-muted)70%,transparent)}}.text-text-muted\/80{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/80{color:color-mix(in oklab,var(--text-muted)80%,transparent)}}.text-text-primary{color:var(--text-primary)}.text-text-secondary,.text-text-secondary\/60{color:var(--text-secondary)}@supports (color:color-mix(in lab,red,red)){.text-text-secondary\/60{color:color-mix(in oklab,var(--text-secondary)60%,transparent)}}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-violet-400\/70{color:#a685ffb3}@supports (color:color-mix(in lab,red,red)){.text-violet-400\/70{color:color-mix(in oklab,var(--color-violet-400)70%,transparent)}}.text-white{color:var(--color-white)}.text-white\/20{color:#fff3}@supports (color:color-mix(in lab,red,red)){.text-white\/20{color:color-mix(in oklab,var(--color-white)20%,transparent)}}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white)30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white)50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.placeholder-text-muted::placeholder{color:var(--text-muted)}.accent-accent-purple{accent-color:var(--accent-primary)}.accent-amber-400{accent-color:var(--color-amber-400)}.accent-primary{accent-color:var(--accent-tertiary)}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent-danger{--tw-ring-color:var(--accent-danger)}.ring-accent-primary,.ring-accent-primary\/50{--tw-ring-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.ring-accent-primary\/50{--tw-ring-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.ring-accent-primary\/60{--tw-ring-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.ring-accent-primary\/60{--tw-ring-color:color-mix(in oklab,var(--accent-primary)60%,transparent)}}.ring-accent-success{--tw-ring-color:var(--accent-success)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-transparent{--tw-ring-offset-color:transparent}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:border-white\/20:is(:where(.group):hover *){border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.group-hover\:border-white\/20:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.group-hover\/tip\:visible:is(:where(.group\/tip):hover *){visibility:visible}.group-hover\/tip\:opacity-100:is(:where(.group\/tip):hover *){opacity:1}}.selection\:bg-transparent ::selection{background-color:#0000}.selection\:bg-transparent::selection{background-color:#0000}.placeholder\:text-text-muted::placeholder{color:var(--text-muted)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:border-accent-primary\/30:hover{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:border-accent-primary\/30:hover{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.hover\:border-border-strong:hover{border-color:var(--border-strong)}.hover\:border-white\/\[0\.12\]:hover{border-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.12\]:hover{border-color:color-mix(in oklab,var(--color-white)12%,transparent)}}.hover\:bg-\[\#202020\]:hover{background-color:#202020}.hover\:bg-\[\#252525\]:hover{background-color:#252525}.hover\:bg-accent-danger\/10:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/10:hover{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.hover\:bg-accent-danger\/20:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/20:hover{background-color:color-mix(in oklab,var(--accent-danger)20%,transparent)}}.hover\:bg-accent-danger\/30:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/30:hover{background-color:color-mix(in oklab,var(--accent-danger)30%,transparent)}}.hover\:bg-accent-primary\/10:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/10:hover{background-color:color-mix(in oklab,var(--accent-primary)10%,transparent)}}.hover\:bg-accent-primary\/20:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/20:hover{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.hover\:bg-accent-primary\/30:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/30:hover{background-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.hover\:bg-accent-secondary\/20:hover{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-secondary\/20:hover{background-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.hover\:bg-accent-success\/10:hover{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-success\/10:hover{background-color:color-mix(in oklab,var(--accent-success)10%,transparent)}}.hover\:bg-accent-success\/20:hover{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-success\/20:hover{background-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.hover\:bg-accent-tertiary\/10:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/10:hover{background-color:color-mix(in oklab,var(--accent-tertiary)10%,transparent)}}.hover\:bg-accent-tertiary\/20:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/20:hover{background-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.hover\:bg-accent-tertiary\/25:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/25:hover{background-color:color-mix(in oklab,var(--accent-tertiary)25%,transparent)}}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-bg-elevated:hover{background-color:var(--bg-elevated)}.hover\:bg-bg-subtle:hover{background-color:var(--bg-subtle)}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-signal-fair\/10:hover{background-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-signal-fair\/10:hover{background-color:color-mix(in oklab,var(--signal-fair)10%,transparent)}}.hover\:bg-tooltip-bg:hover{background-color:var(--tooltip-bg)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white)4%,transparent)}}.hover\:bg-white\/\[0\.05\]:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.05\]:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/\[0\.08\]:hover{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.08\]:hover{background-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.hover\:from-\[\#8de04a\]:hover{--tw-gradient-from:#8de04a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-\[\#7dd03a\]:hover{--tw-gradient-to:#7dd03a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:text-accent-danger:hover{color:var(--accent-danger)}.hover\:text-accent-primary:hover,.hover\:text-accent-primary\/80:hover{color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:text-accent-primary\/80:hover{color:color-mix(in oklab,var(--accent-primary)80%,transparent)}}.hover\:text-accent-secondary:hover{color:var(--accent-secondary)}.hover\:text-accent-tertiary:hover{color:var(--accent-tertiary)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-text-primary:hover{color:var(--text-primary)}.hover\:text-text-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.focus\:border-accent-primary:focus,.focus\:border-accent-primary\/50:focus{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.focus\:border-accent-primary\/50:focus{border-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.focus\:border-amber-500\/50:focus{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.focus\:border-amber-500\/50:focus{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#9cf15b\]\/50:focus{--tw-ring-color:oklab(87.4074% -.139284 .1444/.5)}.focus\:ring-accent-primary:focus,.focus\:ring-accent-primary\/50:focus{--tw-ring-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-accent-primary\/50:focus{--tw-ring-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.focus\:ring-accent-tertiary\/50:focus{--tw-ring-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-accent-tertiary\/50:focus{--tw-ring-color:color-mix(in oklab,var(--accent-tertiary)50%,transparent)}}.focus\:ring-amber-500\/50:focus{--tw-ring-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.focus\:ring-amber-500\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.focus\:ring-signal-fair\/50:focus{--tw-ring-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-signal-fair\/50:focus{--tw-ring-color:color-mix(in oklab,var(--signal-fair)50%,transparent)}}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-bg-elevated:focus{--tw-ring-offset-color:var(--bg-elevated)}.focus\:ring-offset-bg-surface:focus{--tw-ring-offset-color:var(--bg-surface)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.98\]:active{scale:.98}.active\:bg-bg-elevated:active{background-color:var(--bg-elevated)}.active\:bg-tooltip-bg:active{background-color:var(--tooltip-bg)}.active\:bg-white\/10:active{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.active\:bg-white\/10:active{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.active\:brightness-90:active{--tw-brightness:brightness(90%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:475px){.xs\:inline{display:inline}}@media(min-width:40rem){.sm\:top-4{top:calc(var(--spacing)*4)}.sm\:top-\[4rem\]{top:4rem}.sm\:right-4{right:calc(var(--spacing)*4)}.sm\:mx-4{margin-inline:calc(var(--spacing)*4)}.sm\:mt-8{margin-top:calc(var(--spacing)*8)}.sm\:mb-2{margin-bottom:calc(var(--spacing)*2)}.sm\:mb-3{margin-bottom:calc(var(--spacing)*3)}.sm\:mb-4{margin-bottom:calc(var(--spacing)*4)}.sm\:mb-6{margin-bottom:calc(var(--spacing)*6)}.sm\:mb-8{margin-bottom:calc(var(--spacing)*8)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:h-3{height:calc(var(--spacing)*3)}.sm\:h-3\.5{height:calc(var(--spacing)*3.5)}.sm\:h-4{height:calc(var(--spacing)*4)}.sm\:h-5{height:calc(var(--spacing)*5)}.sm\:h-8{height:calc(var(--spacing)*8)}.sm\:h-9{height:calc(var(--spacing)*9)}.sm\:h-16{height:calc(var(--spacing)*16)}.sm\:h-auto{height:auto}.sm\:max-h-96{max-height:calc(var(--spacing)*96)}.sm\:max-h-\[80vh\]{max-height:80vh}.sm\:max-h-\[calc\(100vh-250px\)\]{max-height:calc(100vh - 250px)}.sm\:w-4{width:calc(var(--spacing)*4)}.sm\:w-5{width:calc(var(--spacing)*5)}.sm\:w-8{width:calc(var(--spacing)*8)}.sm\:w-9{width:calc(var(--spacing)*9)}.sm\:w-16{width:calc(var(--spacing)*16)}.sm\:w-28{width:calc(var(--spacing)*28)}.sm\:w-40{width:calc(var(--spacing)*40)}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-\[280px\]{max-width:280px}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-1{gap:calc(var(--spacing)*1)}.sm\:gap-2{gap:calc(var(--spacing)*2)}.sm\:gap-3{gap:calc(var(--spacing)*3)}.sm\:gap-4{gap:calc(var(--spacing)*4)}.sm\:gap-6{gap:calc(var(--spacing)*6)}:where(.sm\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.sm\:border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.sm\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.sm\:border-border-subtle{border-color:var(--border-subtle)}.sm\:p-1\.5{padding:calc(var(--spacing)*1.5)}.sm\:p-3{padding:calc(var(--spacing)*3)}.sm\:p-4{padding:calc(var(--spacing)*4)}.sm\:p-8{padding:calc(var(--spacing)*8)}.sm\:px-2{padding-inline:calc(var(--spacing)*2)}.sm\:px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.sm\:px-4{padding-inline:calc(var(--spacing)*4)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:py-1\.5{padding-block:calc(var(--spacing)*1.5)}.sm\:py-2{padding-block:calc(var(--spacing)*2)}.sm\:py-3{padding-block:calc(var(--spacing)*3)}.sm\:py-6{padding-block:calc(var(--spacing)*6)}.sm\:py-8{padding-block:calc(var(--spacing)*8)}.sm\:pt-0{padding-top:calc(var(--spacing)*0)}.sm\:pb-6{padding-bottom:calc(var(--spacing)*6)}.sm\:pl-7{padding-left:calc(var(--spacing)*7)}.sm\:text-left{text-align:left}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:opacity-100{opacity:1}}@media(min-width:48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-3{gap:calc(var(--spacing)*3)}.md\:p-5{padding:calc(var(--spacing)*5)}.md\:py-8{padding-block:calc(var(--spacing)*8)}}@media(min-width:64rem){.lg\:top-\[4\.5rem\]{top:4.5rem}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-32{width:calc(var(--spacing)*32)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}.lg\:pt-0{padding-top:calc(var(--spacing)*0)}.lg\:pb-8{padding-bottom:calc(var(--spacing)*8)}}}.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107,M12=.707107,M21=-.707107,M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--bg-body:#171717;--bg-surface:#252525;--bg-elevated:#333233;--bg-subtle:#3f3f3f;--border-subtle:#4b4b4b;--border-strong:#616161;--text-primary:#e1e1e1;--text-secondary:#bfbfbf;--text-muted:#727272;--text-invert:#171717;--accent-primary:#719cdf;--accent-secondary:#dfbc72;--accent-tertiary:#6fbcbd;--accent-danger:#e12672;--accent-success:#719872;--overlay-soft:#ffffff0a;--shadow-tint:#719cdf59;--sidebar-tint:#719cdf0f;--tooltip-bg:#252525;--hover-tint:#719cdf14;--glass-tint:#252525;--glass-light:#fff;--glass-dark:#000;--glass-reflex-light:.15;--glass-reflex-dark:.8;--glass-blur:6px;--glass-blur-elevated:8px;--glass-brightness:1;--glass-surface-tint:linear-gradient(to bottom,#ffffff06,#ffffff04);--glass-reflection-top:linear-gradient(to bottom,#ffffff05 0px,transparent 16px);--glass-reflection-bottom:linear-gradient(to top,#ffffff05 0px,transparent 20px);--glass-bg-opacity:8%;--glass-bg-opacity-elevated:12%;--signal-excellent:#0f0;--signal-good:#8ce619;--signal-fair:#ffd900;--signal-poor:#ff8c26;--signal-critical:#f33;--signal-unknown:#616161;--sparkline-excellent:#0f0;--sparkline-good:#8ce619;--sparkline-fair:#ffd900;--sparkline-poor:#ff8c26;--sparkline-critical:#f33;--status-success:#719872;--status-warning:#dfbc72;--status-danger:#e12672;--status-info:#6fbcbd;--status-muted:#616161;--pkt-advert:#dfbc72;--pkt-flood:#6fbcbd;--pkt-txt-msg:#719872;--pkt-ack:#999abd;--pkt-trace:#70bddf;--pkt-req:#0074be;--pkt-response:#98bc99;--pkt-grp-txt:#e17899;--pkt-grp-data:#be7572;--pkt-path:#70bddf;--pkt-anon:#bdbb72;--pkt-unknown:#616161;--pkt-science-req:#0090ff;--pkt-science-anon-req:#06c;--pkt-science-response:#6cf;--pkt-science-ack:#00e699;--pkt-science-advert:#fff200;--pkt-science-txt-msg:#ffb300;--pkt-science-grp-txt:#ff80c0;--pkt-science-grp-data:#f60;--pkt-science-multipart:#b3b3b3;--pkt-science-raw-custom:#e666cc;--pkt-science-path:#66b3ff;--pkt-science-trace:#33ffb3;--pkt-science-unknown:gray;--route-flood:#6fbcbd;--route-direct:#dfbc72;--route-transport:#999abd;--chart-1:#719cdf;--chart-2:#0074be;--chart-3:#6fbcbd;--chart-4:#dfbc72;--chart-5:#719872;--chart-6:#e12672;--chart-7:#e17899;--chart-8:#999abd;--chart-grid:#bfbfbf26;--chart-axis-tick:var(--text-secondary);--chart-cursor:#fff3;--metric-received:#719872;--metric-forwarded:#0074be;--metric-transmitted:#dfbc72;--metric-dropped:#e12672;--metric-neutral:#bfbfbf;--log-debug:#616161;--log-info:#6fbcbd;--log-warning:#dfbc72;--log-error:#e12672;--log-critical:#be7572;--icon-page-title:var(--accent-primary);--icon-card-title:var(--accent-primary);--icon-widget:var(--text-secondary);--icon-action:var(--text-secondary);--icon-nav:var(--text-muted);--icon-nav-active:var(--accent-primary);--toggle-on:var(--accent-success);--toggle-off:var(--bg-elevated);--data-box-bg:#ffffff08;--data-box-border:#ffffff0f;--map-node-fill:#f5f5f0;--map-node-stroke:#4a5568;--map-hub-color:#8b7bad;--map-local-color:#fbbf24;--map-neighbor-color:#fbbf24;--map-mobile-color:#f97316;--map-room-color:#e17899;--palette-bg-0:#171717;--palette-bg-1:#1f1f1f;--palette-bg-2:#252525;--palette-bg-3:#2d2d2d;--palette-bg-4:#3f3f3f;--palette-bg-5:#4b4b4b;--palette-bg-6:#616161;--palette-bg-7:#727272;--palette-fg-0:#8a8a8a;--palette-fg-1:#a3a3a3;--palette-fg-2:#bfbfbf;--palette-fg-3:#e1e1e1;--palette-fg-4:#f5f5f5;--palette-red:#be7572;--palette-red-bright:#e12672;--palette-orange:#d97742;--palette-orange-bright:#f59e0b;--palette-yellow:#bdbb72;--palette-yellow-bright:#dfbc72;--palette-green:#719872;--palette-green-bright:#98bc99;--palette-aqua:#6fbcbd;--palette-aqua-bright:#70bddf;--palette-blue:#0074be;--palette-blue-bright:#719cdf;--palette-purple:#8b7bad;--palette-purple-bright:#999abd;--map-edge-rest:#4b4b4b;--map-edge-rest-bright:#616161;--map-edge-rest-dim:#3f3f3f;--map-edge-hover-direct:#6fbcbd;--map-edge-hover-loop:#8b7bad;--map-edge-hover-standard:#8a8a8a;--map-edge-hover-neighbor:#fbbf24;--map-edge-highlight:gold;--link-strong:#719872;--link-medium:#dfbc72;--link-weak:#be7572;--hop-0:#6fbcbd;--hop-1:#719872;--hop-2:#98bc99;--hop-3:#dfbc72;--hop-distant:#727272;--hop-hub:#fbbf24;--ctrl-base:var(--palette-bg-4);--ctrl-base-hover:var(--palette-bg-5);--ctrl-base-active:var(--palette-bg-3);--ctrl-border:var(--palette-bg-5);--ctrl-border-hover:var(--palette-bg-6);--ctrl-shadow-dark:var(--palette-bg-1);--ctrl-shadow-mid:var(--palette-bg-0);--ctrl-highlight:var(--palette-bg-6);--ctrl-inset:var(--palette-bg-3);--ctrl-primary:#5a6b9f;--ctrl-primary-hover:#6a7baf;--ctrl-primary-border:#7a8bbf;--ctrl-primary-shadow:#2a3b5f;--ctrl-primary-highlight:#8a9bcf;--ctrl-primary-inset:#4a5b8f;--ctrl-success:#4a7854;--ctrl-success-hover:#5a8864;--ctrl-success-border:#6a9874;--ctrl-success-shadow:#2a4834;--ctrl-success-highlight:#7aa884;--ctrl-success-inset:#3a6844;--ctrl-warning:#9f8a4a;--ctrl-warning-hover:#af9a5a;--ctrl-warning-border:#bfaa6a;--ctrl-warning-shadow:#5f4a2a;--ctrl-warning-highlight:#cfba7a;--ctrl-warning-inset:#8f7a3a;--ctrl-panel-top:var(--palette-bg-2);--ctrl-panel-mid:var(--palette-bg-1);--ctrl-panel-bottom:var(--palette-bg-0);--ctrl-panel-border:var(--palette-bg-4);--background:var(--bg-body);--foreground:var(--text-secondary);--foreground-muted:var(--text-muted);--foreground-subtle:var(--border-subtle);--primary:var(--accent-tertiary);--secondary:var(--accent-secondary);--accent-green:var(--accent-success);--accent-red:var(--accent-danger);--accent-purple:var(--accent-primary);--accent-cyan:var(--accent-tertiary);--card-bg:var(--bg-surface);--border:var(--border-subtle);--theme-transition:.4s ease;--text-xs:.64rem;--text-sm:.8rem;--text-base:1rem;--text-md:1.125rem;--text-lg:1.25rem;--text-xl:1.563rem;--text-2xl:1.953rem;--text-3xl:2.441rem;--text-4xl:3.052rem;--text-5xl:3.815rem;--text-6xl:4.768rem;--leading-tight:1.1;--leading-snug:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--tracking-tight:-.025em;--tracking-normal:0;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--font-normal:400;--font-medium:500;--font-semibold:600;--font-bold:700;--font-extrabold:800}@supports (color:color(display-p3 1 1 1)){:root{--accent-primary:color(display-p3 .443 .612 .875);--accent-secondary:color(display-p3 .875 .737 .447);--accent-tertiary:color(display-p3 .435 .737 .741);--accent-danger:color(display-p3 .882 .15 .447);--accent-success:color(display-p3 .443 .596 .447);--signal-excellent:color(display-p3 0 1 0);--signal-good:color(display-p3 .55 .9 .15);--signal-fair:color(display-p3 1 .85 0);--signal-poor:color(display-p3 1 .55 .15);--signal-critical:color(display-p3 1 .2 .2);--sparkline-excellent:color(display-p3 .1 .9 .35);--sparkline-good:color(display-p3 .45 .85 .05);--sparkline-fair:color(display-p3 1 .8 0);--sparkline-poor:color(display-p3 1 .5 .1);--sparkline-critical:color(display-p3 1 .15 .15);--status-success:color(display-p3 .443 .596 .447);--status-warning:color(display-p3 .875 .737 .447);--status-danger:color(display-p3 .882 .15 .447);--status-info:color(display-p3 .435 .737 .741);--pkt-advert:color(display-p3 .875 .737 .447);--pkt-flood:color(display-p3 .435 .737 .741);--pkt-txt-msg:color(display-p3 .443 .596 .447);--pkt-ack:color(display-p3 .6 .604 .741);--pkt-trace:color(display-p3 .439 .741 .875);--pkt-req:color(display-p3 0 .455 .745);--pkt-response:color(display-p3 .596 .737 .6);--pkt-grp-txt:color(display-p3 .882 .471 .6);--pkt-grp-data:color(display-p3 .745 .459 .447);--pkt-path:color(display-p3 .439 .741 .875);--pkt-anon:color(display-p3 .741 .733 .447);--chart-1:color(display-p3 .443 .612 .875);--chart-2:color(display-p3 0 .455 .745);--chart-3:color(display-p3 .435 .737 .741);--chart-4:color(display-p3 .875 .737 .447);--chart-5:color(display-p3 .443 .596 .447);--chart-6:color(display-p3 .882 .15 .447);--chart-7:color(display-p3 .882 .471 .6);--chart-8:color(display-p3 .6 .604 .741);--metric-received:color(display-p3 .443 .596 .447);--metric-forwarded:color(display-p3 0 .455 .745);--metric-transmitted:color(display-p3 .875 .737 .447);--metric-dropped:color(display-p3 .882 .15 .447);--log-info:color(display-p3 .435 .737 .741);--log-warning:color(display-p3 .875 .737 .447);--log-error:color(display-p3 .882 .15 .447);--log-critical:color(display-p3 .745 .459 .447);--map-hub-color:color(display-p3 .65 .5 .85);--map-local-color:color(display-p3 1 .8 .1);--map-neighbor-color:color(display-p3 1 .8 .1);--map-mobile-color:color(display-p3 1 .5 .1);--map-room-color:color(display-p3 1 .45 .65);--link-strong:color(display-p3 .443 .596 .447);--link-medium:color(display-p3 .875 .737 .447);--link-weak:color(display-p3 .745 .459 .447);--hop-0:color(display-p3 .435 .737 .741);--hop-1:color(display-p3 .443 .596 .447);--hop-2:color(display-p3 .596 .737 .6);--hop-3:color(display-p3 .875 .737 .447);--hop-hub:color(display-p3 .984 .749 .141);--palette-red:color(display-p3 .745 .459 .447);--palette-red-bright:color(display-p3 .882 .15 .447);--palette-orange:color(display-p3 .851 .467 .259);--palette-orange-bright:color(display-p3 .961 .62 .043);--palette-yellow:color(display-p3 .741 .733 .447);--palette-yellow-bright:color(display-p3 .875 .737 .447);--palette-green:color(display-p3 .443 .596 .447);--palette-green-bright:color(display-p3 .596 .737 .6);--palette-aqua:color(display-p3 .435 .737 .741);--palette-aqua-bright:color(display-p3 .439 .741 .875);--palette-blue:color(display-p3 0 .455 .745);--palette-blue-bright:color(display-p3 .443 .612 .875);--palette-purple:color(display-p3 .545 .482 .678);--palette-purple-bright:color(display-p3 .6 .604 .741);--map-edge-hover-direct:color(display-p3 .2 .9 .92);--map-edge-hover-loop:color(display-p3 .7 .5 .92);--map-edge-hover-neighbor:color(display-p3 1 .8 0);--map-edge-highlight:color(display-p3 1 .9 0)}}a,button,[role=button],.interactive,.glass-card,.data-card,.chart-container,.pill-tag,.pill-subtle,.toggle-group-item,.roster-row,.nav-item{transition:all .15s ease-out}a:hover,button:hover,[role=button]:hover,.interactive:hover,.glass-card:hover,.data-card:hover,.chart-container:hover,.pill-tag:hover,.pill-subtle:hover,.toggle-group-item:hover,.roster-row:hover,.nav-item:hover{transition-duration:0s}a,button,[role=button],input,select,textarea{touch-action:manipulation;-webkit-tap-highlight-color:transparent}a,button{cursor:pointer}body{background:var(--bg-body);color:var(--text-secondary);font-family:var(--font-display),system-ui,-apple-system,sans-serif;font-weight:var(--font-normal);font-size:var(--text-base);line-height:var(--leading-normal);letter-spacing:var(--tracking-normal);font-feature-settings:"cv02","cv03","cv04";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-height:100vh}.type-hero{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-5xl);font-weight:var(--font-semibold);letter-spacing:var(--tracking-tight);color:var(--text-primary);line-height:1.05}.type-metric{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-4xl);font-weight:var(--font-semibold);letter-spacing:var(--tracking-tight);color:var(--text-primary);line-height:1.1}.type-title{font-family:var(--font-title),system-ui,sans-serif;font-size:var(--text-2xl);font-weight:var(--font-semibold);line-height:var(--leading-snug);color:var(--text-primary)}.type-heading,.type-subheading{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-lg);font-weight:var(--font-semibold);line-height:var(--leading-snug);color:var(--text-primary)}.type-body{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-base);font-weight:var(--font-normal);line-height:var(--leading-normal);color:var(--text-secondary)}.type-body-lg{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-md);font-weight:var(--font-normal);line-height:var(--leading-normal);color:var(--text-secondary)}.type-body-sm,.type-label{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-sm);font-weight:var(--font-medium);line-height:var(--leading-normal);color:var(--text-secondary)}.type-micro{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-normal);letter-spacing:.12em;text-transform:uppercase;color:var(--text-secondary)}.type-data{font-family:var(--font-data);font-size:var(--text-base);font-weight:var(--font-normal);line-height:var(--leading-normal);letter-spacing:var(--tracking-wide);font-feature-settings:"zero","tnum"}.type-data-lg{font-family:var(--font-data);font-size:var(--text-lg);font-weight:var(--font-medium);line-height:var(--leading-snug);letter-spacing:var(--tracking-normal);font-feature-settings:"zero","tnum"}.type-data-hero{font-family:var(--font-data);font-size:var(--text-3xl);font-weight:var(--font-medium);letter-spacing:var(--tracking-normal);font-feature-settings:"zero","tnum";line-height:1.1}.type-data-sm{font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);line-height:var(--leading-normal);letter-spacing:var(--tracking-wider);font-feature-settings:"zero","tnum"}.type-data-xs{font-family:var(--font-data);font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-normal);letter-spacing:var(--tracking-widest);font-feature-settings:"zero","tnum"}.type-code{font-family:var(--font-data);font-size:.875em;font-weight:var(--font-normal);line-height:var(--leading-relaxed);font-feature-settings:"zero","tnum"}.type-badge{font-family:var(--font-data);font-size:var(--text-xs);font-weight:var(--font-medium);letter-spacing:.08em;text-transform:uppercase;line-height:1}.type-tag{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-xs);font-weight:var(--font-medium);letter-spacing:.05em;line-height:1}.data-box{background:var(--data-box-bg);border:1px solid var(--data-box-border);font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);--data-box-color:var(--text-primary);color:var(--data-box-color);letter-spacing:-.03em;font-variant-numeric:tabular-nums;font-feature-settings:"zero","tnum";white-space:nowrap;text-overflow:ellipsis;border-radius:.375rem;justify-content:center;align-items:center;min-width:0;padding:.25rem .5rem;line-height:1.2;display:inline-flex;overflow:hidden}.data-box-compact{font-size:var(--text-xs);border-radius:.25rem;padding:.125rem .375rem}.data-box-hug{width:auto}.data-box-fill{width:100%;display:flex}.data-box-left{justify-content:flex-start}.data-box-center{justify-content:center}.data-box-right{justify-content:flex-end}.data-box-label{font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);color:var(--text-muted);margin-bottom:.25rem;line-height:1.3}.liquid-glass{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.liquid-glass{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-elevated{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass-elevated{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity-elevated),transparent)}}.liquid-glass-elevated{-webkit-backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass-elevated{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass-elevated:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-glow{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass-glow{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.liquid-glass-glow{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--accent-primary),inset 1.8px 3px 0 -2px var(--accent-primary),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass-glow{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass-glow:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-sm{border-radius:.5rem}.liquid-glass-md{border-radius:.875rem}.liquid-glass-lg{border-radius:1.125rem}.liquid-glass-xl{border-radius:1.5rem}.liquid-glass-pill{border-radius:9999px}.liquid-glass-none{border-radius:0}.glass-card{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-glow{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card-glow{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-card-glow{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--accent-primary),inset 1.8px 3px 0 -2px var(--accent-primary),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card-glow{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card-glow:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-elevated{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card-elevated{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity-elevated),transparent)}}.glass-card-elevated{-webkit-backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card-elevated{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card-elevated:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-sidebar{background-color:var(--glass-tint);border:none;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-sidebar{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-sidebar{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset -1px 0 0 0 var(--glass-light),inset 1px 0 0 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-sidebar{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset -1px 0 color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*8%),transparent),inset 1px 0 color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent)}}.glass-sidebar:before{content:"";pointer-events:none;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-inner{background-color:var(--glass-tint)}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{background-color:color-mix(in srgb,var(--glass-tint)8%,transparent)}}.glass-card-inner{border:1px solid var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{border:1px solid color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*5%),transparent)}}.glass-card-inner{box-shadow:inset 0 1px 2px var(--glass-dark);border-radius:.75rem}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{box-shadow:inset 0 1px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*5%),transparent)}}.glass-thumbnail{border:none;border-radius:.375rem;position:relative;overflow:hidden}.glass-thumbnail:after{content:"";z-index:10;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 .5px var(--glass-light),inset .9px 1.5px 0 -1px var(--glass-light),inset -1px -1px 0 -1px var(--glass-light),inset -1.5px -4px .5px -3px var(--glass-light),inset -.15px -.5px 2px 0 var(--glass-dark),inset -.75px 1.25px 0 -1px var(--glass-dark),inset 0 1.5px 2px -1px var(--glass-dark);position:absolute;top:0;right:0;bottom:0;left:0}@supports (color:color-mix(in lab,red,red)){.glass-thumbnail:after{box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*16%),transparent),inset .9px 1.5px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*140%),transparent),inset -1px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*125%),transparent),inset -1.5px -4px .5px -3px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*94%),transparent),inset -.15px -.5px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*18%),transparent),inset -.75px 1.25px 0 -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent),inset 0 1.5px 2px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent)}}.glass-thumbnail-selected:after{box-shadow:inset 0 0 0 1.5px var(--accent-primary),inset .9px 1.5px 0 -1px var(--glass-light),inset -1px -1px 0 -1px var(--glass-light),inset -1.5px -4px .5px -3px var(--glass-light),inset -.15px -.5px 2px 0 var(--glass-dark),inset -.75px 1.25px 0 -1px var(--glass-dark),inset 0 1.5px 2px -1px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-thumbnail-selected:after{box-shadow:inset 0 0 0 1.5px var(--accent-primary),inset .9px 1.5px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*140%),transparent),inset -1px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*125%),transparent),inset -1.5px -4px .5px -3px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*94%),transparent),inset -.15px -.5px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*18%),transparent),inset -.75px 1.25px 0 -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent),inset 0 1.5px 2px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent)}}.glass-card-frame{z-index:1000;box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark);border-radius:1.125rem;position:relative}@supports (color:color-mix(in lab,red,red)){.glass-card-frame{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*15%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*25%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*25%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*15%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.glass-card-frame:before{content:"";pointer-events:none;border-radius:inherit;z-index:1001;background:var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.separator-line{background:linear-gradient(to right,transparent,var(--glass-light)20%,var(--glass-light)80%,transparent);height:1px}@supports (color:color-mix(in lab,red,red)){.separator-line{background:linear-gradient(to right,transparent,color-mix(in srgb,var(--glass-light)8%,transparent)20%,color-mix(in srgb,var(--glass-light)8%,transparent)80%,transparent)}}.separator-line-vertical{background:linear-gradient(to bottom,transparent,var(--glass-light)20%,var(--glass-light)80%,transparent);width:1px}@supports (color:color-mix(in lab,red,red)){.separator-line-vertical{background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--glass-light)8%,transparent)20%,color-mix(in srgb,var(--glass-light)8%,transparent)80%,transparent)}}.rounded-pill{border-radius:9999px}.rounded-card{border-radius:1.125rem}.card-sm{min-height:7rem}.card-md{min-height:11rem}.card-lg{min-height:14rem}.card-hero{min-height:20rem}.card-auto{min-height:auto}@media(max-width:640px){.card-sm{min-height:6rem}.card-md{min-height:9rem}.card-lg{min-height:12rem}.card-hero{min-height:16rem}}.icon-sm{flex-shrink:0;width:1rem;height:1rem}.icon-md{flex-shrink:0;width:1.25rem;height:1.25rem}.icon-lg{flex-shrink:0;width:1.5rem;height:1.5rem}.icon-xl{flex-shrink:0;width:2rem;height:2rem}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--bg-surface)}::-webkit-scrollbar-thumb{background-color:var(--border-strong);border-radius:4px}::-webkit-scrollbar-thumb:hover{background-color:var(--text-muted)}.map-container-16-9{aspect-ratio:16/9;width:100%;position:relative}@supports not (aspect-ratio:16 / 9){.map-container-16-9{height:0;padding-bottom:56.25%}}.map-container-16-9{min-height:280px;max-height:80dvh}@supports not (aspect-ratio:16 / 9){.map-container-16-9>*{width:100%;height:100%;position:absolute;top:0;left:0}}@media(max-width:639px){.map-container-16-9{aspect-ratio:4/5;min-height:320px;max-height:75dvh}@supports not (aspect-ratio:4 / 5){.map-container-16-9{padding-bottom:125%}}}@media(min-width:640px)and (max-width:1023px){.map-container-16-9{aspect-ratio:3/2}@supports not (aspect-ratio:3 / 2){.map-container-16-9{padding-bottom:66.67%}}}@media(min-width:1920px){.map-container-16-9{max-height:720px}}.map-container-fullscreen{width:100vw!important;height:calc(100dvh - 3.5rem)!important;aspect-ratio:unset!important;min-height:unset!important;max-height:unset!important;z-index:999!important;border-radius:0!important;padding-bottom:0!important;position:fixed!important;top:3.5rem!important;right:0!important;bottom:0!important;left:0!important}@media(min-width:1024px){.map-container-fullscreen{height:100dvh!important;top:0!important}}.map-blue-water{position:relative}.map-blue-water .leaflet-tile-pane{filter:sepia(.15)hue-rotate(180deg)saturate(.7)brightness(.95)}.map-blue-water:after{content:"";pointer-events:none;z-index:400;mix-blend-mode:multiply;background:linear-gradient(#0d1e3226,#14284614);position:absolute;top:0;right:0;bottom:0;left:0}.map-blue-water .leaflet-marker-pane,.map-blue-water .leaflet-popup-pane,.map-blue-water .leaflet-overlay-pane{filter:none!important}.leaflet-control-attribution{color:var(--text-muted)!important;background:#141416d9!important;border-radius:4px 0 0!important;padding:2px 6px!important;font-size:10px!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.leaflet-control-zoom{-webkit-backdrop-filter:blur(12px);overflow:hidden;background:#141416d9!important;border:1px solid #8ca0c833!important;border-radius:.75rem!important;margin-top:1rem!important;margin-left:1rem!important}.leaflet-control-zoom a{color:var(--text-secondary)!important;background:0 0!important;border:none!important;border-bottom:1px solid #8ca0c826!important;width:32px!important;height:32px!important;font-size:16px!important;font-weight:500!important;line-height:32px!important}.leaflet-control-zoom a:last-child{border-bottom:none!important}.leaflet-control-zoom a:hover{color:var(--text-primary)!important;background:#ffffff1a!important}.leaflet-control-zoom a.leaflet-disabled{opacity:.5;color:var(--text-muted)!important}.map-dot-marker{background:0 0!important;border:none!important}.map-ring-marker,.map-filled-marker,.map-local-marker{cursor:pointer!important;z-index:500!important;pointer-events:auto!important;background:0 0!important;border:none!important}.leaflet-marker-pane{z-index:600!important;pointer-events:auto!important}.leaflet-marker-pane .leaflet-marker-icon{pointer-events:auto!important}.leaflet-popup-content-wrapper{-webkit-backdrop-filter:blur(12px)brightness(.7)saturate(.9)!important;backdrop-filter:blur(12px)brightness(.7)saturate(.9)!important;background-color:#20242aeb!important;border:none!important;border-radius:.75rem!important;padding:0!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff1a,0 4px 16px #00000080!important}.leaflet-popup-content{color:var(--text-primary)!important;margin:.75rem!important}.leaflet-popup-content strong{color:var(--text-primary)!important}.leaflet-popup-content hr{border-color:#8ca0c826!important;margin:.5rem 0!important}.leaflet-popup-tip-container{display:none!important}.leaflet-popup-close-button{color:var(--text-muted)!important;width:24px!important;height:24px!important;padding:6px!important;font-size:18px!important;top:4px!important;right:4px!important}.leaflet-popup-close-button:hover{color:var(--text-primary)!important;background:#ffffff1a!important;border-radius:4px!important}.leaflet-tooltip{white-space:nowrap;color:var(--text-primary)!important;background-color:#050505!important;border:none!important;border-radius:.5rem!important;padding:.375rem .5rem!important;font-size:11px!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026!important}.leaflet-tooltip:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.leaflet-tooltip:before{display:none!important}.leaflet-tooltip .text-text-muted{color:var(--text-muted)!important}.maplibregl-popup{font-family:var(--font-display),system-ui,-apple-system,sans-serif;font-size:var(--text-sm)}.maplibregl-popup-content{min-width:140px;color:var(--text-primary)!important;background-color:#050505!important;border:none!important;border-radius:.75rem!important;padding:.75rem!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.8px 3px 0 -2px #ffffff1f,inset -2px -2px 0 -2px #ffffff14,inset -3px -8px 1px -6px #ffffff0f,inset -.3px -1px 4px #00000026,inset 0 3px 4px -2px #0000001f!important}.maplibregl-popup-content:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.maplibregl-popup-close-button{border-radius:4px;transition:background .1s,color .1s;color:var(--text-muted)!important;width:24px!important;height:24px!important;padding:6px!important;font-size:18px!important;top:4px!important;right:4px!important}.maplibregl-popup-close-button:hover{color:var(--text-primary)!important;background:#ffffff1a!important}.maplibregl-popup-tip{display:none!important}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{border-top-color:var(--tooltip-bg)!important}.maplibregl-marker.local-node-marker{z-index:10!important}.maplibregl-popup{z-index:100!important}.maplibregl-ctrl-attrib{color:var(--text-muted)!important;background:#141416cc!important;padding:2px 6px!important;font-size:10px!important}.maplibregl-ctrl-attrib a{color:var(--text-secondary)!important}.maplibregl-ctrl-attrib.maplibregl-compact{background:#141416cc!important;border-radius:4px!important}.maplibregl-map,.leaflet-container{touch-action:pan-x pan-y;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.maplibregl-ctrl button:focus,.leaflet-control a:focus{outline:2px solid var(--accent-primary);outline-offset:2px}@media(prefers-contrast:high){.maplibregl-ctrl button,.leaflet-control a{border:2px solid!important}.map-legend,.map-controls{border:2px solid var(--text-primary)!important}}@media(prefers-reduced-motion:reduce){.maplibregl-map,.leaflet-container{transition:none!important}.maplibregl-map *{transition:none!important;animation:none!important}}@-moz-document url-prefix(){.maplibregl-canvas{transform:translateZ(0)}}@supports (-webkit-touch-callout:none){.maplibregl-canvas{will-change:transform;transform:translateZ(0)}}@media(forced-colors:active){.maplibregl-ctrl button,.leaflet-control a{forced-color-adjust:none;color:buttontext!important;background:canvas!important;border:1px solid buttontext!important}.maplibregl-popup-content,.leaflet-popup-content-wrapper{color:canvastext!important;background:canvas!important;border:2px solid canvastext!important}}.maplibregl-ctrl-attrib-button{background-color:#141416cc!important;border-radius:4px!important}.maplibregl-ctrl-group{background-color:#050505!important;border:none!important;border-radius:.75rem!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026!important}.maplibregl-ctrl-group:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.maplibregl-ctrl-group button{background:0 0!important;border:none!important;border-bottom:1px solid #8ca0c81f!important;width:32px!important;height:32px!important}.maplibregl-ctrl-group button:last-child{border-bottom:none!important}.maplibregl-ctrl-group button:hover{background:#ffffff14!important}.maplibregl-ctrl-group button .maplibregl-ctrl-icon{filter:invert()brightness(.75)}.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon{filter:invert()brightness()}.maplibregl-ctrl-scale{border:1px solid var(--map-local-color)!important;color:var(--map-local-color)!important;font-size:10px!important;font-family:var(--font-data)!important;background:0 0!important;border-top:none!important;border-radius:0!important;padding:2px 6px!important;line-height:1.2!important}.map-control-glass{background-color:#050505;border:none;border-radius:.75rem;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026}.map-control-glass:after{content:"";pointer-events:none;border-radius:inherit;z-index:999;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.map-control-glass-active{background-color:#050505;border:none;border-radius:.75rem;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff1f,inset 1.5px 2px 0 -1px #ffffff2e,inset -1.5px -1.5px 0 -1px #ffffff1a,inset 0 -1px 3px #00000026}.map-control-glass-active:after{content:"";pointer-events:none;border-radius:inherit;z-index:999;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.map-controls-container{background-color:#050505;border-radius:.75rem;flex-direction:column;align-items:stretch;gap:0;max-width:calc(100vw - 1.5rem);display:flex;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026}.map-controls-row{flex-wrap:wrap;justify-content:flex-end;gap:.375rem;padding:.375rem;display:flex}.map-controls-row+.map-controls-row{border-top:1px solid #ffffff0f}.map-controls-secondary{flex-wrap:wrap}.map-control-btn{touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;padding:.5rem;transition:background-color .15s}@media(hover:hover)and (pointer:fine){.map-control-btn:hover{background-color:#151515}}.map-control-btn:active{background-color:#1a1a1a}.map-control-icon{width:16px;height:16px}.map-nav-module{padding:.375rem}@media(max-width:639px){.map-controls-container{max-width:calc(100vw - 1rem)}.map-controls-row{gap:.25rem;padding:.25rem}.map-control-btn{justify-content:center;align-items:center;min-width:44px;min-height:44px;padding:.625rem;display:flex}.map-control-icon{width:18px;height:18px}.map-control-label{display:none}.map-nav-module{padding:.25rem}}@media(min-width:640px)and (max-width:1023px){.map-controls-row,.map-nav-module{padding:.375rem}}@media(min-width:1024px){.map-controls-row{gap:.5rem;padding:.5rem}.map-nav-module{padding:.5rem}}.map-legend-stack{z-index:600;flex-direction:column;gap:0;max-width:150px;max-height:calc(100% - 1.5rem);display:flex;position:absolute;bottom:.75rem;left:.75rem;overflow:hidden auto}.map-legend-stack>*{border-radius:0}.map-legend-stack>:first-child{border-radius:.75rem .75rem 0 0}.map-legend-stack>:last-child{border-radius:0 0 .75rem .75rem}.map-legend-stack>:only-child{border-radius:.75rem}.map-legend-stack>*+*{border-top:1px solid #ffffff0f}@media(min-width:640px){.map-legend-stack{max-width:160px;bottom:1rem;left:1rem}}.map-edge-tooltip{z-index:1000;pointer-events:none;max-width:calc(100vw - 2rem);position:absolute;bottom:1rem;left:calc(50% + 85px);transform:translate(-50%)}.map-edge-tooltip-inner{pointer-events:auto;padding:.625rem 1rem}@media(max-width:639px){.map-edge-tooltip{bottom:.5rem;left:.5rem;right:.5rem;transform:none}.map-edge-tooltip-inner{background-color:#050505f2;border-radius:.75rem;padding:.75rem}.map-edge-tooltip .w-\[540px\]{width:100%;max-width:100%}}.map-container-fullscreen .map-edge-tooltip{bottom:1.5rem}.font-mono{font-feature-settings:"zero";font-family:var(--font-data)!important}.font-title{font-family:var(--font-title),system-ui,sans-serif!important}.font-display{font-family:var(--font-display),system-ui,sans-serif!important}.tabular-nums{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}.layout-container{width:100%;max-width:80rem;margin-left:auto;margin-right:auto}.grid-12{grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem;display:grid}@media(min-width:768px){.grid-12{gap:1.5rem}}.col-span-6{grid-column:span 6/span 6}.col-span-4{grid-column:span 4/span 4}.col-span-3{grid-column:span 3/span 3}@media(min-width:640px){.sm\:col-span-6{grid-column:span 6/span 6}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-3{grid-column:span 3/span 3}}@media(min-width:768px){.md\:col-span-6{grid-column:span 6/span 6}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-8{grid-column:span 8/span 8}.md\:col-span-12{grid-column:span 12/span 12}}@media(min-width:1024px){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-span-9{grid-column:span 9/span 9}.lg\:col-span-10{grid-column:span 10/span 10}.lg\:col-span-12{grid-column:span 12/span 12}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-8{grid-column:span 8/span 8}}.gap-space-2{gap:.5rem}.gap-space-3{gap:.75rem}.gap-space-4{gap:1rem}.gap-space-6{gap:1.5rem}.gap-space-8{gap:2rem}.gap-y-space-4{row-gap:1rem}.gap-y-space-6{row-gap:1.5rem}.gap-y-space-8{row-gap:2rem}.gap-x-space-4{column-gap:1rem}.gap-x-space-6{column-gap:1.5rem}.gap-x-space-8{column-gap:2rem}.card-padding{padding:1rem}@media(min-width:768px){.card-padding{padding:1.5rem}}.card-padding-sm{padding:.75rem}@media(min-width:768px){.card-padding-sm{padding:1rem}}.section-gap{flex-direction:column;gap:1rem;display:flex}@media(min-width:640px){.section-gap{gap:1.5rem}}@media(min-width:1024px){.section-gap{gap:2rem}}.stats-row-hero{grid-template-columns:repeat(2,1fr);gap:1rem;display:grid}@media(min-width:768px){.stats-row-hero{grid-template-columns:repeat(3,1fr);gap:1.5rem}}@media(min-width:1280px){.stats-row-hero{grid-template-columns:repeat(5,1fr)}}.stats-row-secondary{grid-template-columns:1fr;gap:1rem;display:grid}@media(min-width:640px){.stats-row-secondary{grid-template-columns:repeat(2,1fr)}}@media(min-width:1024px){.stats-row-secondary{grid-template-columns:repeat(4,1fr);gap:1.5rem}}.content-grid{grid-template-columns:1fr;gap:1rem;display:grid}@media(min-width:768px){.content-grid{gap:1.5rem}}@media(min-width:1280px){.content-grid{grid-template-columns:2fr 1fr}}.content-main,.content-sidebar{min-width:0}.pill-filled{background:var(--accent-primary);color:var(--bg-body);border-radius:9999px;align-items:center;gap:.375rem;padding:.375rem .75rem;font-size:.75rem;font-weight:500;line-height:1;transition:opacity .15s;display:inline-flex}.pill-filled:hover{opacity:.9}.pill-subtle{background:var(--bg-subtle);color:var(--text-secondary);border:1px solid var(--border-subtle);border-radius:9999px;align-items:center;gap:.375rem;padding:.375rem .75rem;font-size:.75rem;font-weight:500;line-height:1;transition:all .15s;display:inline-flex}.pill-subtle:hover{background:var(--bg-elevated);color:var(--text-primary)}.pill-metric{text-transform:uppercase;letter-spacing:.05em;border-radius:9999px;align-items:center;gap:.25rem;padding:.25rem .5rem;font-size:.625rem;font-weight:600;line-height:1;display:inline-flex}.pill-metric-positive{background:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.pill-metric-positive{background:color-mix(in srgb,var(--accent-success)15%,transparent)}}.pill-metric-positive{color:var(--accent-success)}.pill-metric-negative{background:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.pill-metric-negative{background:color-mix(in srgb,var(--accent-danger)15%,transparent)}}.pill-metric-negative{color:var(--accent-danger)}.pill-metric-neutral{background:var(--overlay-soft);color:var(--text-secondary)}.pill-tag{background:var(--accent-primary);border-radius:9999px;align-items:center;padding:.125rem .5rem;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.pill-tag{background:color-mix(in srgb,var(--accent-primary)10%,transparent)}}.pill-tag{color:var(--accent-primary);text-transform:uppercase;letter-spacing:.08em;font-size:.625rem;font-weight:600}.toggle-group{background-color:var(--glass-tint);border-radius:9999px;padding:.25rem;display:inline-flex;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.toggle-group{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.toggle-group{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.toggle-group{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.toggle-group:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.toggle-group-item{color:var(--text-muted);border-radius:9999px;padding:.375rem .75rem;font-size:.75rem;font-weight:500;transition:all .15s}.toggle-group-item:hover{color:var(--text-secondary)}.toggle-group-item.active{background-color:var(--glass-tint)}@supports (color:color-mix(in lab,red,red)){.toggle-group-item.active{background-color:color-mix(in srgb,var(--glass-tint)36%,transparent)}}.toggle-group-item.active{color:var(--accent-primary);box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.toggle-group-item.active{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.toggle-group-sm{padding:.1875rem}.toggle-group-sm .toggle-group-item{padding:.25rem .5rem;font-size:.6875rem}.data-card{contain:layout style;isolation:isolate;background-color:var(--glass-tint);border:none;border-radius:1.125rem;padding:1.25rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.data-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.data-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.data-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.data-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.data-card-header{justify-content:space-between;align-items:center;margin-bottom:.75rem;display:flex}.data-card-title{text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);font-size:.6875rem;font-weight:600}.data-card-controls{align-items:center;gap:.5rem;display:flex}.data-card-value{color:var(--text-primary);font-variant-numeric:tabular-nums;font-size:2rem;font-weight:600;line-height:1.1}.data-card-secondary{color:var(--text-muted);margin-top:.25rem;font-size:.75rem}.chart-container{isolation:isolate;background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.chart-container{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.chart-container{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.chart-container{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.chart-container:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.chart-header{border-bottom:1px solid var(--border-subtle);justify-content:space-between;align-items:center;padding:1rem 1.25rem;display:flex}.chart-title{color:var(--text-primary);align-items:center;gap:.5rem;font-size:.875rem;font-weight:600;display:flex}.chart-title-icon{width:1.125rem;height:1.125rem;color:var(--icon-card-title)}.chart-body{padding:1rem;position:relative}.chart-axis-label{color:var(--text-muted);font-variant-numeric:tabular-nums;font-size:.6875rem}.chart-gridline{stroke:var(--chart-grid);stroke-dasharray:4 4}.chart-glow-primary{filter:drop-shadow(0 0 6px var(--accent-primary))}.chart-glow-secondary{filter:drop-shadow(0 0 6px var(--accent-secondary))}.chart-glow-tertiary{filter:drop-shadow(0 0 6px var(--accent-tertiary))}.roster-list{flex-direction:column;display:flex}.roster-row{border-radius:.75rem;align-items:center;gap:.5rem;padding:.75rem .75rem .75rem .5rem;transition:background .15s;display:flex}@media(min-width:640px){.roster-row{gap:.75rem;padding:.75rem 1rem .75rem .75rem}}.roster-row:hover{background:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.roster-row:hover{background:color-mix(in srgb,var(--bg-subtle)80%,transparent)}}.roster-row-interactive{cursor:pointer}.roster-row-interactive:active{background:var(--bg-subtle)}.roster-row.selected{background:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.roster-row.selected{background:color-mix(in srgb,var(--accent-primary)8%,transparent)}}.roster-icon{background-color:var(--glass-tint);border-radius:.625rem;flex-shrink:0;justify-content:center;align-items:center;width:2.5rem;height:2.5rem;display:flex}@supports (color:color-mix(in lab,red,red)){.roster-icon{background-color:color-mix(in srgb,var(--glass-tint)10%,transparent)}}.roster-icon{box-shadow:inset 0 0 0 1px var(--glass-light),inset .5px 1px 0 0 var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.roster-icon{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*5%),transparent),inset .5px 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*30%),transparent)}}.roster-icon-sm{border-radius:.5rem;width:2rem;height:2rem}.roster-content{flex-direction:column;flex:1;gap:.125rem;min-width:0;display:flex}.roster-title{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:.875rem;font-weight:500;overflow:hidden}.roster-subtitle{color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;font-size:.75rem;overflow:hidden}.roster-metrics{color:var(--text-muted);align-items:center;gap:1rem;display:flex}.roster-metric{color:var(--text-secondary);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:.8125rem;font-weight:600}@media(max-width:639px){.roster-row{flex-wrap:wrap;gap:.375rem;padding:.5rem .5rem .5rem .375rem}.roster-icon{border-radius:.375rem;width:1.75rem;height:1.75rem}.roster-content{flex:1 1 0;min-width:0;overflow:hidden}.roster-title{font-size:.75rem}.roster-metrics{flex-wrap:wrap;order:3;gap:.5rem;width:100%;margin-top:.25rem;padding-left:2.25rem}.roster-metric{flex-shrink:0;margin-left:auto;font-size:.6875rem}}@media(min-width:640px)and (max-width:767px){.roster-row{gap:.5rem}.roster-icon{border-radius:.5rem;width:2rem;height:2rem}.roster-metrics{gap:.75rem}}@media(min-width:768px)and (max-width:1023px){.roster-metrics{gap:.875rem}}@media(min-width:1024px){.roster-row{gap:.875rem}.roster-metrics{gap:1rem}}.contacts-grid-header,.contacts-grid-row{grid-template-columns:1fr;grid-template-areas:"node";align-items:center;gap:.75rem;display:grid}.contacts-grid-row{padding:.625rem .75rem;transition:background .15s}.contacts-grid-row:hover{background:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.contacts-grid-row:hover{background:color-mix(in srgb,var(--bg-subtle)80%,transparent)}}@media(max-width:639px){.contacts-grid-row{flex-wrap:nowrap;gap:.5rem;padding:.5rem .625rem;display:flex}.contacts-col-signal,.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity{display:none}.contacts-col-node{flex:1 1 0;min-width:0}.contacts-col-seen,.contacts-col-actions{flex-shrink:0;align-self:center}}@media(min-width:640px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(200px,1fr) 100px 60px 68px;grid-template-areas:"node signal seen actions"}.contacts-col-node{grid-area:node}.contacts-col-signal{grid-area:signal;display:flex}.contacts-col-seen{grid-area:seen}.contacts-col-actions{grid-area:actions}.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity{display:none}}@media(min-width:768px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(240px,1fr) 110px 80px 60px 68px;grid-template-areas:"node signal distance seen actions"}.contacts-col-distance{grid-area:distance;display:flex}}@media(min-width:1024px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(280px,1fr) 110px 80px 64px 64px 68px;grid-template-areas:"node signal distance centrality seen actions"}.contacts-col-centrality{grid-area:centrality;display:flex}}@media(min-width:1280px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(320px,1fr) 120px 80px 64px 64px 68px 68px;grid-template-areas:"node signal distance centrality activity seen actions"}.contacts-col-activity{grid-area:activity;display:flex}}.contacts-col-node{min-width:0}.contacts-col-signal,.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity,.contacts-col-seen,.contacts-col-actions{white-space:nowrap;flex-shrink:0;overflow:hidden}.roster-separator{background:linear-gradient(to right,transparent,var(--border-subtle)20%,var(--border-subtle)80%,transparent);height:1px;margin:0 1rem}.roster-empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:3rem 1.5rem;display:flex}.roster-empty-icon{width:3rem;height:3rem;color:var(--text-muted);opacity:.5;margin-bottom:1rem}.roster-empty-title{color:var(--text-secondary);margin-bottom:.25rem;font-size:.875rem;font-weight:500}.roster-empty-text{color:var(--text-muted);font-size:.75rem}.btn-skeuo{cursor:pointer;background:var(--ctrl-base);border:1px solid var(--ctrl-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-shadow-dark),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset);border-radius:.5rem;justify-content:center;align-items:center;gap:.5rem;padding:.75rem 1.25rem;font-size:.875rem;font-weight:600;transition:all .12s ease-out;display:inline-flex;position:relative}.btn-skeuo:hover{background:var(--ctrl-base-hover);border-color:var(--ctrl-border-hover);box-shadow:0 4px 0 var(--ctrl-shadow-dark),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset)}.btn-skeuo:active{background:var(--ctrl-base-active);box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 3px var(--ctrl-shadow-mid),inset 0 3px 6px var(--ctrl-shadow-mid),inset 0 1px 0 var(--ctrl-shadow-dark);transform:translateY(3px)}.btn-skeuo:disabled{opacity:.4;cursor:not-allowed;transform:none}.btn-skeuo-primary{background:var(--ctrl-primary);border-color:var(--ctrl-primary-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-primary-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-primary-highlight),inset 0 -2px 0 var(--ctrl-primary-inset)}.btn-skeuo-primary:hover{background:var(--ctrl-primary-hover);border-color:var(--ctrl-primary-highlight);box-shadow:0 4px 0 var(--ctrl-primary-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-primary-highlight),inset 0 -2px 0 var(--ctrl-primary-inset)}.btn-skeuo-success{background:var(--ctrl-success);border-color:var(--ctrl-success-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-success-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-success-highlight),inset 0 -2px 0 var(--ctrl-success-inset)}.btn-skeuo-success:hover{background:var(--ctrl-success-hover);border-color:var(--ctrl-success-highlight);box-shadow:0 4px 0 var(--ctrl-success-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-success-highlight),inset 0 -2px 0 var(--ctrl-success-inset)}.btn-skeuo-warning{background:var(--ctrl-warning);border-color:var(--ctrl-warning-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-warning-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-warning-highlight),inset 0 -2px 0 var(--ctrl-warning-inset)}.btn-skeuo-warning:hover{background:var(--ctrl-warning-hover);border-color:var(--ctrl-warning-highlight);box-shadow:0 4px 0 var(--ctrl-warning-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-warning-highlight),inset 0 -2px 0 var(--ctrl-warning-inset)}.btn-skeuo-neutral{background:var(--ctrl-base);border-color:var(--ctrl-border);color:var(--text-secondary);box-shadow:0 3px 0 var(--ctrl-shadow-dark),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset)}.btn-skeuo-neutral:hover{background:var(--ctrl-base-hover);color:var(--text-primary);box-shadow:0 4px #18191d,0 8px 20px #08090b,0 3px 8px #0d0e12,inset 0 1px #5e5f6b,inset 0 -2px #26272e}.control-card{background-color:var(--glass-tint);border-radius:.875rem;padding:1rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.control-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.control-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.control-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.control-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.control-card-header{justify-content:space-between;align-items:center;margin-bottom:.75rem;display:flex}.control-card-label{color:var(--text-muted);font-size:.8125rem}.control-card-value{font-size:.8125rem;font-weight:600}.control-card-value-active{color:var(--accent-success)}.control-card-value-inactive{color:var(--text-muted)}.btn-skeuo-icon{stroke-width:2.5px;width:1.125rem;height:1.125rem}.control-panel-skeuo{background:linear-gradient(180deg,var(--ctrl-panel-top)0%,var(--ctrl-panel-mid)50%,var(--ctrl-panel-bottom)100%);border:1px solid var(--ctrl-panel-border);box-shadow:inset 0 1px 0 var(--glass-light),inset 0 -1px 0 var(--glass-dark),0 4px 12px var(--glass-dark),0 1px 3px var(--glass-dark);border-radius:.75rem;flex-direction:column;gap:.5rem;padding:.75rem;display:flex}@supports (color:color-mix(in lab,red,red)){.control-panel-skeuo{box-shadow:inset 0 1px color-mix(in srgb,var(--glass-light)4%,transparent),inset 0 -1px color-mix(in srgb,var(--glass-dark)30%,transparent),0 4px 12px color-mix(in srgb,var(--glass-dark)40%,transparent),0 1px 3px color-mix(in srgb,var(--glass-dark)30%,transparent)}}.control-btn{letter-spacing:.01em;cursor:pointer;background:var(--ctrl-base);border:1px solid var(--ctrl-border);color:var(--text-primary);box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--glass-light);border-radius:.5rem;justify-content:center;align-items:center;gap:.375rem;padding:.5rem .75rem;font-size:.75rem;font-weight:600;transition:all .1s ease-out;display:flex;position:relative}@supports (color:color-mix(in lab,red,red)){.control-btn{box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 3px 8px color-mix(in srgb,var(--glass-dark)30%,transparent),inset 0 1px color-mix(in srgb,var(--glass-light)6%,transparent)}}.control-btn:hover{background:var(--ctrl-base-hover);box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.control-btn:hover{box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 4px 10px color-mix(in srgb,var(--glass-dark)35%,transparent),inset 0 1px color-mix(in srgb,var(--glass-light)8%,transparent)}}.control-btn:active{box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 2px var(--glass-dark),inset 0 2px 4px var(--glass-dark);transform:translateY(2px)}@supports (color:color-mix(in lab,red,red)){.control-btn:active{box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 2px color-mix(in srgb,var(--glass-dark)20%,transparent),inset 0 2px 4px color-mix(in srgb,var(--glass-dark)20%,transparent)}}.control-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}.control-btn-primary{background:linear-gradient(180deg,var(--ctrl-primary-hover)0%,var(--ctrl-primary)100%);border-color:var(--ctrl-primary-border);box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-primary-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-primary{box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-primary-highlight)30%,transparent)}}.control-btn-primary:hover{background:linear-gradient(180deg,var(--ctrl-primary-border)0%,var(--ctrl-primary-hover)100%);box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-primary-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-primary:hover{box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-primary-highlight)40%,transparent)}}.control-btn-success{background:linear-gradient(180deg,var(--ctrl-success-hover)0%,var(--ctrl-success)100%);border-color:var(--ctrl-success-border);box-shadow:0 2px 0 var(--ctrl-success-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-success-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-success{box-shadow:0 2px 0 var(--ctrl-success-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-success-highlight)25%,transparent)}}.control-btn-success:hover{background:linear-gradient(180deg,var(--ctrl-success-border)0%,var(--ctrl-success-hover)100%);box-shadow:0 2px 0 var(--ctrl-success-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-success-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-success:hover{box-shadow:0 2px 0 var(--ctrl-success-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-success-highlight)35%,transparent)}}.control-btn-warning{background:linear-gradient(180deg,var(--ctrl-warning-hover)0%,var(--ctrl-warning)100%);border-color:var(--ctrl-warning-border);box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-warning-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-warning{box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-warning-highlight)25%,transparent)}}.control-btn-warning:hover{background:linear-gradient(180deg,var(--ctrl-warning-border)0%,var(--ctrl-warning-hover)100%);box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-warning-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-warning:hover{box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-warning-highlight)35%,transparent)}}.control-btn-neutral{background:var(--ctrl-base-active);border-color:var(--ctrl-border);color:var(--text-secondary)}.control-btn-neutral:hover{background:var(--ctrl-base);color:var(--text-primary)}.control-toggle-group{flex-direction:column;gap:.25rem;display:flex}.control-toggle-label{color:var(--text-muted);justify-content:space-between;align-items:center;padding:0 .25rem;font-size:.6875rem;display:flex}.control-toggle-status{text-transform:uppercase;letter-spacing:.05em;font-size:.625rem;font-weight:600}@keyframes flash-white-fade{0%{opacity:.2}to{opacity:0}}.flash-overlay{border-radius:inherit;pointer-events:none;z-index:50;background-color:#fff;animation:.6s ease-out forwards flash-white-fade;position:absolute;top:0;right:0;bottom:0;left:0}@keyframes flash-row-bg{0%{background-color:#fff3}to{background-color:#0000}}.flash-row{animation:.6s ease-out forwards flash-row-bg}@keyframes flash-icon-pulse{0%{color:#fff;filter:drop-shadow(0 0 6px #fffc)}to{color:var(--text-muted);filter:none}}.flash-icon{animation:.6s ease-out forwards flash-icon-pulse}.mini-widget{contain:layout style;background-color:var(--glass-tint);border-radius:.875rem;flex-direction:column;gap:.25rem;padding:.75rem;display:flex;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.mini-widget{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.mini-widget{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.mini-widget{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.mini-widget:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.mini-widget:hover{box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.mini-widget:hover{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*100%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.mini-widget-header{align-items:center;gap:.375rem;min-height:1.25rem;display:flex}.mini-widget-icon{width:1rem;height:1rem;color:var(--icon-widget);flex-shrink:0}.mini-widget-title{font-family:Poppins,sans-serif;font-size:var(--text-xs);color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;text-overflow:ellipsis;font-weight:500;line-height:1.2;overflow:hidden}.mini-widget-value{font-family:var(--font-data);font-size:var(--text-xl);color:var(--text-primary);font-weight:600;line-height:1.1}.mini-widget-value-lg{font-size:var(--text-2xl)}.mini-widget-value-sm{font-size:var(--text-lg)}.mini-widget-unit{font-size:var(--text-xs);color:var(--text-muted);margin-left:.125rem;font-weight:400}.mini-widget-subtitle{font-family:var(--font-data);font-size:var(--text-sm);color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;line-height:1.3;overflow:hidden}.mini-widget-status-dot{border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.mini-widget-status-dot.excellent{background:var(--signal-excellent)}.mini-widget-status-dot.good{background:var(--signal-good)}.mini-widget-status-dot.fair{background:var(--signal-fair)}.mini-widget-status-dot.poor{background:var(--signal-poor)}.mini-widget-status-dot.critical{background:var(--signal-critical)}.mini-widget-status-dot.unknown{background:var(--signal-unknown)}.mini-widget-trend{font-size:var(--text-xs);align-items:center;gap:.125rem;font-weight:500;display:flex}.mini-widget-trend.up{color:var(--accent-danger)}.mini-widget-trend.down{color:var(--accent-success)}.mini-widget-trend.stable{color:var(--text-muted)}.mini-widget-sparkline{width:100%;min-width:1px;height:1.5rem;min-height:1px;margin-top:auto}.mini-widget-loading{justify-content:center;align-items:center;min-height:4rem;display:flex}.mini-widget-loading-spinner{border:2px solid var(--border-subtle);border-top-color:var(--accent-primary);border-radius:50%;width:1rem;height:1rem;animation:.8s linear infinite spin}.mini-widget-error{min-height:4rem;color:var(--text-muted);font-size:var(--text-sm);justify-content:center;align-items:center;display:flex}.mini-widget-progress{background:var(--bg-subtle);border-radius:.125rem;height:.25rem;margin-top:auto;overflow:hidden}.mini-widget-progress-bar{border-radius:.125rem;height:100%;transition:width .3s}.mini-widget-progress-bar.excellent{background:var(--signal-excellent)}.mini-widget-progress-bar.good{background:var(--signal-good)}.mini-widget-progress-bar.fair{background:var(--signal-fair)}.mini-widget-progress-bar.poor{background:var(--signal-poor)}.mini-widget-progress-bar.critical{background:var(--signal-critical)}.mini-widget-toggle{align-items:center;gap:.5rem;display:flex}.mini-widget-toggle-track{background:var(--bg-subtle);border:1px solid var(--border-subtle);cursor:pointer;border-radius:.5rem;width:2rem;height:1rem;transition:all .2s;position:relative}.mini-widget-toggle-track.active{background:var(--accent-success);border-color:var(--accent-success)}.mini-widget-toggle-thumb{background:#fff;border-radius:50%;width:.75rem;height:.75rem;transition:left .2s;position:absolute;top:50%;left:.125rem;transform:translateY(-50%)}.mini-widget-toggle-track.active .mini-widget-toggle-thumb{left:calc(100% - .875rem)}.mesh-health-container{margin-bottom:1.5rem}.mesh-health-header{align-items:center;gap:.5rem;margin-bottom:.75rem;display:flex}.widget-row{gap:.75rem;display:grid}@media(min-width:768px){.widget-row{grid-template-columns:repeat(3,1fr)}.mini-widget{height:7.5rem}}@media(max-width:767px){.widget-row{grid-template-columns:repeat(2,1fr)}.mini-widget{height:7rem;padding:.625rem}.mini-widget-value{font-size:var(--text-lg)}.mini-widget-value-lg{font-size:var(--text-xl)}}.mini-widget-value.excellent{color:var(--signal-excellent)}.mini-widget-value.good{color:var(--signal-good)}.mini-widget-value.fair{color:var(--signal-fair)}.mini-widget-value.poor{color:var(--signal-poor)}.mini-widget-value.critical{color:var(--signal-critical)}.pb-safe{padding-bottom:env(safe-area-inset-bottom,0)}.pt-safe{padding-top:env(safe-area-inset-top,0)}.pl-safe{padding-left:env(safe-area-inset-left,0)}.pr-safe{padding-right:env(safe-area-inset-right,0)}.p-safe{padding-top:env(safe-area-inset-top,0);padding-right:env(safe-area-inset-right,0);padding-bottom:env(safe-area-inset-bottom,0);padding-left:env(safe-area-inset-left,0)}@keyframes shimmer{0%{opacity:.5;transform:translate(-100%)}50%{opacity:1}to{opacity:.5;transform:translate(100%)}}@keyframes shimmer-border{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-border{z-index:1;pointer-events:none;background:linear-gradient(90deg,transparent 0%,transparent 25%,var(--accent-primary)50%,transparent 75%,transparent 100%);border-radius:inherit;opacity:.8;background-size:200% 100%;padding:2px;animation:2s ease-in-out infinite shimmer-border;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);mask-image:linear-gradient(#fff 0,#fff 0),linear-gradient(#fff 0,#fff 0);-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0;-webkit-mask-size:auto,auto;mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}.shimmer-border-light{background:linear-gradient(90deg,#0000,#0000,#fff6,#0000,#0000)}.shimmer-indicator{background:var(--bg-elevated);border-radius:2px;width:40px;height:4px;position:relative;overflow:hidden}.shimmer-indicator-inner{background:linear-gradient(90deg,transparent 0%,var(--accent-primary)50%,transparent 100%);background-size:200% 100%;animation:1.5s ease-in-out infinite shimmer-border;position:absolute;top:0;right:0;bottom:0;left:0}.bento-row{grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch;display:grid}.bento-row-hero{min-height:15rem}@media(min-width:768px){.bento-row-hero{min-height:17.5rem}}@media(min-width:1024px){.bento-row-hero{min-height:20rem}}.bento-row-hero-tall{height:20rem;min-height:20rem}@media(min-width:768px){.bento-row-hero-tall{height:23.3125rem;min-height:23.3125rem}}@media(min-width:1024px){.bento-row-hero-tall{height:26.625rem;min-height:26.625rem}}.bento-row-hero-auto{min-height:20rem}@media(min-width:768px){.bento-row-hero-auto{min-height:23.3125rem}}@media(min-width:1024px){.bento-row-hero-auto{min-height:26.625rem}}.bento-row-panel{grid-auto-rows:18.75rem}.bento-row-feature{grid-auto-rows:12.5rem}@media(min-width:768px){.bento-row-feature{grid-auto-rows:15rem}}@media(min-width:1024px){.bento-row-feature{grid-auto-rows:16.25rem}}.bento-row-standard{min-height:11.25rem}@media(min-width:768px){.bento-row-standard{min-height:12.5rem}}@media(min-width:1024px){.bento-row-standard{min-height:13.75rem}}.bento-row-compact{min-height:8.75rem}@media(min-width:768px){.bento-row-compact{min-height:10rem}}@media(min-width:1024px){.bento-row-compact{min-height:11.25rem}}.bento-row-widget{min-height:6.25rem}@media(min-width:768px){.bento-row-widget{min-height:6.875rem}}@media(min-width:1024px){.bento-row-widget{min-height:7.5rem}}.bento-row-auto{min-height:auto}.analyzer-chart-height{height:13rem}@media(min-width:768px){.analyzer-chart-height{height:17rem}}@media(min-width:1024px){.analyzer-chart-height{height:20rem}}.legend-item{cursor:pointer;border-radius:.25rem;align-items:center;gap:.25rem;padding:.25rem .375rem;font-size:.6875rem;line-height:1.2;transition:background-color .15s,opacity .15s;display:flex}.legend-item:hover{background-color:var(--hover-tint)}.legend-item-active{background-color:var(--bg-subtle);opacity:1}.legend-item-dimmed{opacity:.35}.legend-item-chart-active{background-color:var(--hover-tint);opacity:1}.legend-label{color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;max-width:5.5rem;overflow:hidden}.legend-value{font-family:var(--font-data);font-variant-numeric:tabular-nums;color:var(--text-secondary);flex-shrink:0;margin-left:auto;font-weight:600}.legend-value-live{color:var(--text-primary)}.bento-gap{gap:.75rem}@media(min-width:640px){.bento-gap{gap:1rem}}@media(min-width:768px){.bento-gap{gap:1.25rem}}@media(min-width:1024px){.bento-gap{gap:1.5rem}}.bento-gap-sm{gap:.5rem}@media(min-width:640px){.bento-gap-sm{gap:.75rem}}@media(min-width:768px){.bento-gap-sm{gap:1rem}}.bento-gap-lg{gap:1rem}@media(min-width:640px){.bento-gap-lg{gap:1.25rem}}@media(min-width:768px){.bento-gap-lg{gap:1.5rem}}@media(min-width:1024px){.bento-gap-lg{gap:2rem}}.bento-cell{flex-direction:column;min-width:0;min-height:0;display:flex}.bento-cell>*{flex:auto;min-height:0}.bento-col-1{grid-column:span 1/span 1}.bento-col-2{grid-column:span 2/span 2}.bento-col-3{grid-column:span 3/span 3}.bento-col-4{grid-column:span 4/span 4}.bento-col-5{grid-column:span 5/span 5}.bento-col-6{grid-column:span 6/span 6}.bento-col-7{grid-column:span 7/span 7}.bento-col-8{grid-column:span 8/span 8}.bento-col-9{grid-column:span 9/span 9}.bento-col-10{grid-column:span 10/span 10}.bento-col-11{grid-column:span 11/span 11}.bento-col-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-auto{grid-column:auto}.bento-col-1-5{grid-column:span 2/span 2}@media(min-width:640px){.sm\:bento-col-1{grid-column:span 1/span 1}.sm\:bento-col-2{grid-column:span 2/span 2}.sm\:bento-col-3{grid-column:span 3/span 3}.sm\:bento-col-4{grid-column:span 4/span 4}.sm\:bento-col-5{grid-column:span 5/span 5}.sm\:bento-col-6{grid-column:span 6/span 6}.sm\:bento-col-7{grid-column:span 7/span 7}.sm\:bento-col-8{grid-column:span 8/span 8}.sm\:bento-col-9{grid-column:span 9/span 9}.sm\:bento-col-10{grid-column:span 10/span 10}.sm\:bento-col-11{grid-column:span 11/span 11}.sm\:bento-col-12{grid-column:span 12/span 12}.sm\:col-span-full{grid-column:1/-1}.sm\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:768px){.md\:bento-col-1{grid-column:span 1/span 1}.md\:bento-col-2{grid-column:span 2/span 2}.md\:bento-col-3{grid-column:span 3/span 3}.md\:bento-col-4{grid-column:span 4/span 4}.md\:bento-col-5{grid-column:span 5/span 5}.md\:bento-col-6{grid-column:span 6/span 6}.md\:bento-col-7{grid-column:span 7/span 7}.md\:bento-col-8{grid-column:span 8/span 8}.md\:bento-col-9{grid-column:span 9/span 9}.md\:bento-col-10{grid-column:span 10/span 10}.md\:bento-col-11{grid-column:span 11/span 11}.md\:bento-col-12{grid-column:span 12/span 12}.md\:col-span-full{grid-column:1/-1}.md\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:1024px){.lg\:bento-col-1{grid-column:span 1/span 1}.lg\:bento-col-2{grid-column:span 2/span 2}.lg\:bento-col-3{grid-column:span 3/span 3}.lg\:bento-col-4{grid-column:span 4/span 4}.lg\:bento-col-5{grid-column:span 5/span 5}.lg\:bento-col-6{grid-column:span 6/span 6}.lg\:bento-col-7{grid-column:span 7/span 7}.lg\:bento-col-8{grid-column:span 8/span 8}.lg\:bento-col-9{grid-column:span 9/span 9}.lg\:bento-col-10{grid-column:span 10/span 10}.lg\:bento-col-11{grid-column:span 11/span 11}.lg\:bento-col-12{grid-column:span 12/span 12}.lg\:col-span-full{grid-column:1/-1}.lg\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:1280px){.xl\:bento-col-1{grid-column:span 1/span 1}.xl\:bento-col-2{grid-column:span 2/span 2}.xl\:bento-col-3{grid-column:span 3/span 3}.xl\:bento-col-4{grid-column:span 4/span 4}.xl\:bento-col-5{grid-column:span 5/span 5}.xl\:bento-col-6{grid-column:span 6/span 6}.xl\:bento-col-7{grid-column:span 7/span 7}.xl\:bento-col-8{grid-column:span 8/span 8}.xl\:bento-col-9{grid-column:span 9/span 9}.xl\:bento-col-10{grid-column:span 10/span 10}.xl\:bento-col-11{grid-column:span 11/span 11}.xl\:bento-col-12{grid-column:span 12/span 12}.xl\:col-span-full{grid-column:1/-1}.xl\:bento-col-1-5{grid-column:span 2/span 2}}.terminal-card{height:calc(100dvh - 160px);min-height:300px;max-height:calc(100vh - 120px);padding-bottom:env(safe-area-inset-bottom,0)}@media(min-width:640px){.terminal-card{height:calc(100dvh - 180px);min-height:400px}}@media(min-width:1024px){.terminal-card{height:calc(100vh - 180px);min-height:500px}}.terminal-ascii{letter-spacing:-.5px;font-size:8px}@media(min-width:375px){.terminal-ascii{letter-spacing:0;font-size:9px}}@media(min-width:414px){.terminal-ascii{font-size:10px}}@media(min-width:640px){.terminal-ascii{font-size:11px}}@media(min-width:768px){.terminal-ascii{font-size:12px}}@media(min-width:1024px){.terminal-ascii{font-size:13px}}@supports (-webkit-touch-callout:none){.terminal-card input{font-size:16px}}.terminal-card>div:first-child{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input:focus-visible{box-shadow:0 0 0 2px var(--accent-primary);outline:none}select{background-image:none}@supports (color:color(display-p3 1 1 1)){.signal-bar-active{background-color:var(--p3-color,inherit)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend/dist/assets/index-CzV5DN7L.css b/frontend/dist/assets/index-CzV5DN7L.css deleted file mode 100644 index ce945643..00000000 --- a/frontend/dist/assets/index-CzV5DN7L.css +++ /dev/null @@ -1 +0,0 @@ -.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/inter-latin-400-normal-C38fXH4l.woff2) format("woff2"),url(/assets/inter-latin-400-normal-CyCys3Eg.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/inter-latin-500-normal-Cerq10X2.woff2) format("woff2"),url(/assets/inter-latin-500-normal-BL9OpVg8.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/inter-latin-600-normal-LgqL8muc.woff2) format("woff2"),url(/assets/inter-latin-600-normal-CiBQ2DWP.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/inter-latin-700-normal-Yt3aPRUw.woff2) format("woff2"),url(/assets/inter-latin-700-normal-BLAVimhd.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:800;src:url(/assets/jetbrains-mono-latin-800-normal-D2mQHRMK.woff2) format("woff2"),url(/assets/jetbrains-mono-latin-800-normal-Dj9qwObk.woff) format("woff")}@font-face{font-family:Rubik Mono One;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/rubik-mono-one-latin-400-normal-U2Afr9Di.woff2) format("woff2"),url(/assets/rubik-mono-one-latin-400-normal-Cd19iSlZ.woff) format("woff")}@font-face{font-family:"Jacquard 12";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/jacquard-12-latin-400-normal-CFgZUtB9.woff2) format("woff2"),url(/assets/jacquard-12-latin-400-normal-DUTP1itc.woff) format("woff")}@font-face{font-family:Cantora One;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/cantora-one-latin-400-normal-BBwF22QI.woff2) format("woff2"),url(/assets/cantora-one-latin-400-normal-DwNspYVg.woff) format("woff")}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2) format("woff2"),url(/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff) format("woff")}@font-face{font-family:"Instrument Serif";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/instrument-serif-latin-400-normal-DnYpCC2O.woff2) format("woff2"),url(/assets/instrument-serif-latin-400-normal-BVbkICAY.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/instrument-sans-latin-400-normal-DRC__1Mx.woff2) format("woff2"),url(/assets/instrument-sans-latin-400-normal-D1W7dsQl.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/instrument-sans-latin-500-normal-Dk9ku72i.woff2) format("woff2"),url(/assets/instrument-sans-latin-500-normal-Z6ESRlEs.woff) format("woff")}@font-face{font-family:Instrument Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/instrument-sans-latin-600-normal-B7fBEWYG.woff2) format("woff2"),url(/assets/instrument-sans-latin-600-normal-B9e8oLYv.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:300;src:url(/assets/source-code-pro-latin-300-normal--fObHmet.woff2) format("woff2"),url(/assets/source-code-pro-latin-300-normal-BgqKZHKu.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2) format("woff2"),url(/assets/source-code-pro-latin-400-normal-Bf_aQirX.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2) format("woff2"),url(/assets/source-code-pro-latin-500-normal-FgltuOLy.woff) format("woff")}@font-face{font-family:Source Code Pro;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/source-code-pro-latin-600-normal-DVVSlvOB.woff2) format("woff2"),url(/assets/source-code-pro-latin-600-normal-B5rj6vMs.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/noto-sans-latin-400-normal-BTkUljjl.woff2) format("woff2"),url(/assets/noto-sans-latin-400-normal-DPpKfCgK.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/noto-sans-latin-500-normal-DCA2Z9Cj.woff2) format("woff2"),url(/assets/noto-sans-latin-500-normal-CDPngY5C.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/noto-sans-latin-600-normal-Dkgu5AE5.woff2) format("woff2"),url(/assets/noto-sans-latin-600-normal-DVJMj_t0.woff) format("woff")}@font-face{font-family:Noto Sans;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/noto-sans-latin-700-normal-CrvTEWhy.woff2) format("woff2"),url(/assets/noto-sans-latin-700-normal-ZyrKABVF.woff) format("woff")}/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-teal-400:oklch(77.7% .152 181.912);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-indigo-400:oklch(67.3% .182 276.935);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--drop-shadow-lg:0 4px 4px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-display);--default-mono-font-family:var(--font-data);--font-title:var(--font-title)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-x-1{inset-inline:calc(var(--spacing)*1)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-2{top:calc(var(--spacing)*-2)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-3{top:calc(var(--spacing)*3)}.top-4{top:calc(var(--spacing)*4)}.top-\[2px\]{top:2px}.top-\[3\.5rem\]{top:3.5rem}.top-\[var\(--tip-y\,0\)\]{top:var(--tip-y,0)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing)*-.5)}.-right-2{right:calc(var(--spacing)*-2)}.right-0{right:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-1\.5{right:calc(var(--spacing)*1.5)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.-bottom-0\.5{bottom:calc(var(--spacing)*-.5)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-1{bottom:calc(var(--spacing)*1)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-\[72px\]{bottom:72px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-2{left:calc(var(--spacing)*2)}.left-4{left:calc(var(--spacing)*4)}.left-\[var\(--tip-x\,0\)\]{left:var(--tip-x,0)}.isolate{isolation:isolate}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[600\]{z-index:600}.z-\[9999\]{z-index:9999}.z-\[10001\]{z-index:10001}.z-\[10002\]{z-index:10002}.z-\[10003\]{z-index:10003}.z-\[10010\]{z-index:10010}.col-auto{grid-column:auto}.col-span-2{grid-column:span 2/span 2}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:475px){.container{max-width:475px}}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-0\.5{margin-inline:calc(var(--spacing)*.5)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing)*-1)}.mr-0\.5{margin-right:calc(var(--spacing)*.5)}.mr-1\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-0\.5{margin-left:calc(var(--spacing)*.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-1\.5{margin-left:calc(var(--spacing)*1.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-7{margin-left:calc(var(--spacing)*7)}.ml-8{margin-left:calc(var(--spacing)*8)}.ml-9{margin-left:calc(var(--spacing)*9)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-1\/2{height:50%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-28{height:calc(var(--spacing)*28)}.h-32{height:calc(var(--spacing)*32)}.h-44{height:calc(var(--spacing)*44)}.h-48{height:calc(var(--spacing)*48)}.h-56{height:calc(var(--spacing)*56)}.h-64{height:calc(var(--spacing)*64)}.h-72{height:calc(var(--spacing)*72)}.h-80{height:calc(var(--spacing)*80)}.h-96{height:calc(var(--spacing)*96)}.h-\[1\.2em\]{height:1.2em}.h-\[3px\]{height:3px}.h-\[18px\]{height:18px}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[38px\]{height:38px}.h-\[200px\]{height:200px}.h-\[500px\]{height:500px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-0{max-height:calc(var(--spacing)*0)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100vh-300px\)\]{max-height:calc(100vh - 300px)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[3rem\]{min-height:3rem}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-\[60px\]{min-height:60px}.min-h-\[100dvh\]{min-height:100dvh}.min-h-\[120px\]{min-height:120px}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-11{width:calc(var(--spacing)*11)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-32{width:calc(var(--spacing)*32)}.w-36{width:calc(var(--spacing)*36)}.w-40{width:calc(var(--spacing)*40)}.w-44{width:calc(var(--spacing)*44)}.w-48{width:calc(var(--spacing)*48)}.w-64{width:calc(var(--spacing)*64)}.w-72{width:calc(var(--spacing)*72)}.w-\[0\.6em\]{width:.6em}.w-\[3px\]{width:3px}.w-\[14px\]{width:14px}.w-\[32px\]{width:32px}.w-\[52px\]{width:52px}.w-\[240px\]{width:240px}.w-\[540px\]{width:540px}.w-full{width:100%}.w-px{width:1px}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[85vw\]{max-width:85vw}.max-w-\[140px\]{max-width:140px}.max-w-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[18px\]{min-width:18px}.min-w-\[60px\]{min-width:60px}.min-w-\[80px\]{min-width:80px}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\/4{--tw-translate-x: -25% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing)*5);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-full{--tw-translate-y:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-150{--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.rotate-\[135deg\]{rotate:135deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-ns-resize{cursor:ns-resize}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.touch-manipulation{touch-action:manipulation}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)_auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-evenly{justify-content:space-evenly}.justify-start{justify-content:flex-start}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[2px\]{gap:2px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-3{column-gap:calc(var(--spacing)*3)}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.gap-y-2{row-gap:calc(var(--spacing)*2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-subtle>:not(:last-child)),:where(.divide-border-subtle\/30>:not(:last-child)){border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){:where(.divide-border-subtle\/30>:not(:last-child)){border-color:color-mix(in oklab,var(--border-subtle)30%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.self-center{align-self:center}.self-start{align-self:flex-start}.justify-self-start{justify-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[1\.125rem\]{border-radius:1.125rem}.rounded-\[1px\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:1px}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-\[var\(--route-direct\)\]\/30{border-color:var(--route-direct)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-direct\)\]\/30{border-color:color-mix(in oklab,var(--route-direct)30%,transparent)}}.border-\[var\(--route-flood\)\]\/30{border-color:var(--route-flood)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-flood\)\]\/30{border-color:color-mix(in oklab,var(--route-flood)30%,transparent)}}.border-\[var\(--route-transport\)\]\/30{border-color:var(--route-transport)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--route-transport\)\]\/30{border-color:color-mix(in oklab,var(--route-transport)30%,transparent)}}.border-accent-danger\/30{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-danger\/30{border-color:color-mix(in oklab,var(--accent-danger)30%,transparent)}}.border-accent-danger\/50{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-danger\/50{border-color:color-mix(in oklab,var(--accent-danger)50%,transparent)}}.border-accent-primary,.border-accent-primary\/30{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/30{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.border-accent-primary\/40{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/40{border-color:color-mix(in oklab,var(--accent-primary)40%,transparent)}}.border-accent-primary\/50{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-primary\/50{border-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.border-accent-purple\/30{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-accent-purple\/30{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.border-accent-red\/50{border-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.border-accent-red\/50{border-color:color-mix(in oklab,var(--accent-danger)50%,transparent)}}.border-accent-secondary\/20{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/20{border-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.border-accent-secondary\/30{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/30{border-color:color-mix(in oklab,var(--accent-secondary)30%,transparent)}}.border-accent-secondary\/50{border-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accent-secondary\/50{border-color:color-mix(in oklab,var(--accent-secondary)50%,transparent)}}.border-accent-success\/20{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/20{border-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.border-accent-success\/30{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/30{border-color:color-mix(in oklab,var(--accent-success)30%,transparent)}}.border-accent-success\/40{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/40{border-color:color-mix(in oklab,var(--accent-success)40%,transparent)}}.border-accent-success\/50{border-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.border-accent-success\/50{border-color:color-mix(in oklab,var(--accent-success)50%,transparent)}}.border-accent-tertiary\/20{border-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.border-accent-tertiary\/20{border-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.border-accent-tertiary\/30{border-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.border-accent-tertiary\/30{border-color:color-mix(in oklab,var(--accent-tertiary)30%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-border,.border-border-subtle,.border-border-subtle\/50{border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){.border-border-subtle\/50{border-color:color-mix(in oklab,var(--border-subtle)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-signal-poor\/30{border-color:var(--signal-poor)}@supports (color:color-mix(in lab,red,red)){.border-signal-poor\/30{border-color:color-mix(in oklab,var(--signal-poor)30%,transparent)}}.border-toggle-on{border-color:var(--toggle-on)}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/6{border-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.border-white\/6{border-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-white\/\[0\.06\]{border-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.06\]{border-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.border-white\/\[0\.08\]{border-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.border-t-transparent{border-top-color:#0000}.border-l-amber-400{border-left-color:var(--color-amber-400)}.bg-\[\#1a1a1a\]{background-color:#1a1a1a}.bg-\[\#2a2a2a\]{background-color:#2a2a2a}.bg-\[\#242627\]{background-color:#242627}.bg-\[\#F9D26F\]\/10{background-color:#f9d26f1a}.bg-\[var\(--route-direct\)\]\/20{background-color:var(--route-direct)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-direct\)\]\/20{background-color:color-mix(in oklab,var(--route-direct)20%,transparent)}}.bg-\[var\(--route-flood\)\]\/20{background-color:var(--route-flood)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-flood\)\]\/20{background-color:color-mix(in oklab,var(--route-flood)20%,transparent)}}.bg-\[var\(--route-transport\)\]\/20{background-color:var(--route-transport)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--route-transport\)\]\/20{background-color:color-mix(in oklab,var(--route-transport)20%,transparent)}}.bg-\[var\(--signal-critical\)\]{background-color:var(--signal-critical)}.bg-\[var\(--signal-excellent\)\]{background-color:var(--signal-excellent)}.bg-\[var\(--signal-fair\)\]{background-color:var(--signal-fair)}.bg-\[var\(--signal-good\)\]{background-color:var(--signal-good)}.bg-\[var\(--signal-poor\)\]{background-color:var(--signal-poor)}.bg-\[var\(--signal-unknown\)\]{background-color:var(--signal-unknown)}.bg-accent-danger,.bg-accent-danger\/10{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/10{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.bg-accent-danger\/15{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/15{background-color:color-mix(in oklab,var(--accent-danger)15%,transparent)}}.bg-accent-danger\/20{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-danger\/20{background-color:color-mix(in oklab,var(--accent-danger)20%,transparent)}}.bg-accent-primary,.bg-accent-primary\/5{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/5{background-color:color-mix(in oklab,var(--accent-primary)5%,transparent)}}.bg-accent-primary\/10{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/10{background-color:color-mix(in oklab,var(--accent-primary)10%,transparent)}}.bg-accent-primary\/15{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/15{background-color:color-mix(in oklab,var(--accent-primary)15%,transparent)}}.bg-accent-primary\/20{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/20{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.bg-accent-primary\/25{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/25{background-color:color-mix(in oklab,var(--accent-primary)25%,transparent)}}.bg-accent-primary\/40{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/40{background-color:color-mix(in oklab,var(--accent-primary)40%,transparent)}}.bg-accent-primary\/60{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-primary\/60{background-color:color-mix(in oklab,var(--accent-primary)60%,transparent)}}.bg-accent-purple\/30{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-purple\/30{background-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.bg-accent-red\/10{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.bg-accent-red\/10{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.bg-accent-secondary,.bg-accent-secondary\/5{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/5{background-color:color-mix(in oklab,var(--accent-secondary)5%,transparent)}}.bg-accent-secondary\/10{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/10{background-color:color-mix(in oklab,var(--accent-secondary)10%,transparent)}}.bg-accent-secondary\/15{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/15{background-color:color-mix(in oklab,var(--accent-secondary)15%,transparent)}}.bg-accent-secondary\/20{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-secondary\/20{background-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.bg-accent-success,.bg-accent-success\/10{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/10{background-color:color-mix(in oklab,var(--accent-success)10%,transparent)}}.bg-accent-success\/15{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/15{background-color:color-mix(in oklab,var(--accent-success)15%,transparent)}}.bg-accent-success\/20{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.bg-accent-success\/20{background-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.bg-accent-tertiary\/5{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/5{background-color:color-mix(in oklab,var(--accent-tertiary)5%,transparent)}}.bg-accent-tertiary\/10{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/10{background-color:color-mix(in oklab,var(--accent-tertiary)10%,transparent)}}.bg-accent-tertiary\/15{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/15{background-color:color-mix(in oklab,var(--accent-tertiary)15%,transparent)}}.bg-accent-tertiary\/20{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.bg-accent-tertiary\/20{background-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-400\/5{background-color:#fcbb000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/5{background-color:color-mix(in oklab,var(--color-amber-400)5%,transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-amber-500\/25{background-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/25{background-color:color-mix(in oklab,var(--color-amber-500)25%,transparent)}}.bg-bg-body,.bg-bg-body\/70{background-color:var(--bg-body)}@supports (color:color-mix(in lab,red,red)){.bg-bg-body\/70{background-color:color-mix(in oklab,var(--bg-body)70%,transparent)}}.bg-bg-elevated,.bg-bg-elevated\/20{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/20{background-color:color-mix(in oklab,var(--bg-elevated)20%,transparent)}}.bg-bg-elevated\/30{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/30{background-color:color-mix(in oklab,var(--bg-elevated)30%,transparent)}}.bg-bg-elevated\/50{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/50{background-color:color-mix(in oklab,var(--bg-elevated)50%,transparent)}}.bg-bg-elevated\/90{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/90{background-color:color-mix(in oklab,var(--bg-elevated)90%,transparent)}}.bg-bg-elevated\/95{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-bg-elevated\/95{background-color:color-mix(in oklab,var(--bg-elevated)95%,transparent)}}.bg-bg-subtle,.bg-bg-subtle\/30{background-color:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-bg-subtle\/30{background-color:color-mix(in oklab,var(--bg-subtle)30%,transparent)}}.bg-bg-subtle\/80{background-color:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-bg-subtle\/80{background-color:color-mix(in oklab,var(--bg-subtle)80%,transparent)}}.bg-bg-surface,.bg-bg-surface\/60{background-color:var(--bg-surface)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface\/60{background-color:color-mix(in oklab,var(--bg-surface)60%,transparent)}}.bg-bg-surface\/80{background-color:var(--bg-surface)}@supports (color:color-mix(in lab,red,red)){.bg-bg-surface\/80{background-color:color-mix(in oklab,var(--bg-surface)80%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black)70%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border-subtle{background-color:var(--border-subtle)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-500\/30{background-color:#6a72824d}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/30{background-color:color-mix(in oklab,var(--color-gray-500)30%,transparent)}}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-orange-500\/25{background-color:#fe6e0040}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/25{background-color:color-mix(in oklab,var(--color-orange-500)25%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-purple-500\/80{background-color:#ac4bffcc}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/80{background-color:color-mix(in oklab,var(--color-purple-500)80%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-signal-excellent,.bg-signal-excellent\/10{background-color:var(--signal-excellent)}@supports (color:color-mix(in lab,red,red)){.bg-signal-excellent\/10{background-color:color-mix(in oklab,var(--signal-excellent)10%,transparent)}}.bg-signal-fair,.bg-signal-fair\/10{background-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.bg-signal-fair\/10{background-color:color-mix(in oklab,var(--signal-fair)10%,transparent)}}.bg-signal-good,.bg-signal-good\/10{background-color:var(--signal-good)}@supports (color:color-mix(in lab,red,red)){.bg-signal-good\/10{background-color:color-mix(in oklab,var(--signal-good)10%,transparent)}}.bg-signal-poor,.bg-signal-poor\/10{background-color:var(--signal-poor)}@supports (color:color-mix(in lab,red,red)){.bg-signal-poor\/10{background-color:color-mix(in oklab,var(--signal-poor)10%,transparent)}}.bg-text-muted,.bg-text-muted\/15{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/15{background-color:color-mix(in oklab,var(--text-muted)15%,transparent)}}.bg-text-muted\/20{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/20{background-color:color-mix(in oklab,var(--text-muted)20%,transparent)}}.bg-text-muted\/30{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-text-muted\/30{background-color:color-mix(in oklab,var(--text-muted)30%,transparent)}}.bg-toggle-off{background-color:var(--toggle-off)}.bg-toggle-on{background-color:var(--toggle-on)}.bg-tooltip-bg,.bg-tooltip-bg\/80{background-color:var(--tooltip-bg)}@supports (color:color-mix(in lab,red,red)){.bg-tooltip-bg\/80{background-color:color-mix(in oklab,var(--tooltip-bg)80%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white)4%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.bg-gradient-to-bl{--tw-gradient-position:to bottom left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#9cf15b\]{--tw-gradient-from:#9cf15b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#9cf15b\]\/5{--tw-gradient-from:oklab(87.4074% -.139284 .1444/.05);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\/20{--tw-gradient-from:#0003}@supports (color:color-mix(in lab,red,red)){.from-black\/20{--tw-gradient-from:color-mix(in oklab,var(--color-black)20%,transparent)}}.from-black\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white\/\[0\.03\]{--tw-gradient-from:#ffffff08}@supports (color:color-mix(in lab,red,red)){.from-white\/\[0\.03\]{--tw-gradient-from:color-mix(in oklab,var(--color-white)3%,transparent)}}.from-white\/\[0\.03\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/20{--tw-gradient-via:#fff3}@supports (color:color-mix(in lab,red,red)){.via-white\/20{--tw-gradient-via:color-mix(in oklab,var(--color-white)20%,transparent)}}.via-white\/20{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#8de04a\]{--tw-gradient-to:#8de04a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#9cf15b\]\/3{--tw-gradient-to:oklab(87.4074% -.139284 .1444/.03);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-cover{background-size:cover}.bg-center{background-position:50%}.bg-no-repeat{background-repeat:no-repeat}.fill-accent-success{fill:var(--accent-success)}.fill-text-secondary{fill:var(--text-secondary)}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-12{padding:calc(var(--spacing)*12)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-px{padding-block:1px}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-14{padding-top:calc(var(--spacing)*14)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-1\.5{padding-right:calc(var(--spacing)*1.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pr-6{padding-right:calc(var(--spacing)*6)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-11{padding-left:calc(var(--spacing)*11)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.align-text-bottom{vertical-align:text-bottom}.font-mono{font-family:var(--font-data)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#58b99d\]{color:#58b99d}.text-\[\#F9D26F\]{color:#f9d26f}.text-\[var\(--log-critical\)\]{color:var(--log-critical)}.text-\[var\(--log-debug\)\]{color:var(--log-debug)}.text-\[var\(--log-error\)\]{color:var(--log-error)}.text-\[var\(--log-info\)\]{color:var(--log-info)}.text-\[var\(--log-warning\)\]{color:var(--log-warning)}.text-\[var\(--pkt-ack\)\]{color:var(--pkt-ack)}.text-\[var\(--pkt-advert\)\]{color:var(--pkt-advert)}.text-\[var\(--pkt-anon\)\]{color:var(--pkt-anon)}.text-\[var\(--pkt-flood\)\]{color:var(--pkt-flood)}.text-\[var\(--pkt-grp-data\)\]{color:var(--pkt-grp-data)}.text-\[var\(--pkt-grp-txt\)\]{color:var(--pkt-grp-txt)}.text-\[var\(--pkt-path\)\]{color:var(--pkt-path)}.text-\[var\(--pkt-req\)\]{color:var(--pkt-req)}.text-\[var\(--pkt-response\)\]{color:var(--pkt-response)}.text-\[var\(--pkt-trace\)\]{color:var(--pkt-trace)}.text-\[var\(--pkt-txt-msg\)\]{color:var(--pkt-txt-msg)}.text-\[var\(--pkt-unknown\)\]{color:var(--pkt-unknown)}.text-\[var\(--route-direct\)\]{color:var(--route-direct)}.text-\[var\(--route-flood\)\]{color:var(--route-flood)}.text-\[var\(--route-transport\)\]{color:var(--route-transport)}.text-\[var\(--signal-fair\)\]{color:var(--signal-fair)}.text-\[var\(--status-warning\)\]{color:var(--status-warning)}.text-accent-danger{color:var(--accent-danger)}.text-accent-primary,.text-accent-purple{color:var(--accent-primary)}.text-accent-red{color:var(--accent-danger)}.text-accent-secondary{color:var(--accent-secondary)}.text-accent-success{color:var(--accent-success)}.text-accent-tertiary{color:var(--accent-tertiary)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/70{color:#fcbb00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/70{color:color-mix(in oklab,var(--color-amber-400)70%,transparent)}}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400)80%,transparent)}}.text-bg-body{color:var(--bg-body)}.text-black{color:var(--color-black)}.text-border-subtle{color:var(--border-subtle)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-400\/80{color:#05df72cc}@supports (color:color-mix(in lab,red,red)){.text-green-400\/80{color:color-mix(in oklab,var(--color-green-400)80%,transparent)}}.text-icon-card-title{color:var(--icon-card-title)}.text-icon-page-title{color:var(--icon-page-title)}.text-icon-widget{color:var(--icon-widget)}.text-indigo-400{color:var(--color-indigo-400)}.text-map-neighbor-color{color:var(--map-neighbor-color)}.text-orange-300{color:var(--color-orange-300)}.text-primary{color:var(--accent-tertiary)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400)80%,transparent)}}.text-secondary{color:var(--accent-secondary)}.text-signal-critical{color:var(--signal-critical)}.text-signal-excellent{color:var(--signal-excellent)}.text-signal-fair{color:var(--signal-fair)}.text-signal-good{color:var(--signal-good)}.text-signal-poor{color:var(--signal-poor)}.text-teal-400{color:var(--color-teal-400)}.text-text-muted,.text-text-muted\/30{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/30{color:color-mix(in oklab,var(--text-muted)30%,transparent)}}.text-text-muted\/50{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/50{color:color-mix(in oklab,var(--text-muted)50%,transparent)}}.text-text-muted\/60{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/60{color:color-mix(in oklab,var(--text-muted)60%,transparent)}}.text-text-muted\/70{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/70{color:color-mix(in oklab,var(--text-muted)70%,transparent)}}.text-text-muted\/80{color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.text-text-muted\/80{color:color-mix(in oklab,var(--text-muted)80%,transparent)}}.text-text-primary{color:var(--text-primary)}.text-text-secondary,.text-text-secondary\/60{color:var(--text-secondary)}@supports (color:color-mix(in lab,red,red)){.text-text-secondary\/60{color:color-mix(in oklab,var(--text-secondary)60%,transparent)}}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-violet-400\/70{color:#a685ffb3}@supports (color:color-mix(in lab,red,red)){.text-violet-400\/70{color:color-mix(in oklab,var(--color-violet-400)70%,transparent)}}.text-white{color:var(--color-white)}.text-white\/20{color:#fff3}@supports (color:color-mix(in lab,red,red)){.text-white\/20{color:color-mix(in oklab,var(--color-white)20%,transparent)}}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white)30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white)50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.placeholder-text-muted::placeholder{color:var(--text-muted)}.accent-accent-purple{accent-color:var(--accent-primary)}.accent-amber-400{accent-color:var(--color-amber-400)}.accent-primary{accent-color:var(--accent-tertiary)}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent-primary,.ring-accent-primary\/50{--tw-ring-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.ring-accent-primary\/50{--tw-ring-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.group-hover\:border-white\/20:is(:where(.group):hover *){border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.group-hover\:border-white\/20:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.group-hover\/tip\:visible:is(:where(.group\/tip):hover *){visibility:visible}.group-hover\/tip\:opacity-100:is(:where(.group\/tip):hover *){opacity:1}}.selection\:bg-transparent ::selection{background-color:#0000}.selection\:bg-transparent::selection{background-color:#0000}.placeholder\:text-text-muted::placeholder{color:var(--text-muted)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:border-accent-primary\/30:hover{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:border-accent-primary\/30:hover{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.hover\:border-border-strong:hover{border-color:var(--border-strong)}.hover\:border-white\/\[0\.12\]:hover{border-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.12\]:hover{border-color:color-mix(in oklab,var(--color-white)12%,transparent)}}.hover\:bg-\[\#202020\]:hover{background-color:#202020}.hover\:bg-\[\#252525\]:hover{background-color:#252525}.hover\:bg-accent-danger\/10:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/10:hover{background-color:color-mix(in oklab,var(--accent-danger)10%,transparent)}}.hover\:bg-accent-danger\/20:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/20:hover{background-color:color-mix(in oklab,var(--accent-danger)20%,transparent)}}.hover\:bg-accent-danger\/30:hover{background-color:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-danger\/30:hover{background-color:color-mix(in oklab,var(--accent-danger)30%,transparent)}}.hover\:bg-accent-primary\/10:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/10:hover{background-color:color-mix(in oklab,var(--accent-primary)10%,transparent)}}.hover\:bg-accent-primary\/20:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/20:hover{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.hover\:bg-accent-primary\/30:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-primary\/30:hover{background-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.hover\:bg-accent-secondary\/20:hover{background-color:var(--accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-secondary\/20:hover{background-color:color-mix(in oklab,var(--accent-secondary)20%,transparent)}}.hover\:bg-accent-success\/10:hover{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-success\/10:hover{background-color:color-mix(in oklab,var(--accent-success)10%,transparent)}}.hover\:bg-accent-success\/20:hover{background-color:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-success\/20:hover{background-color:color-mix(in oklab,var(--accent-success)20%,transparent)}}.hover\:bg-accent-tertiary\/10:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/10:hover{background-color:color-mix(in oklab,var(--accent-tertiary)10%,transparent)}}.hover\:bg-accent-tertiary\/20:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/20:hover{background-color:color-mix(in oklab,var(--accent-tertiary)20%,transparent)}}.hover\:bg-accent-tertiary\/25:hover{background-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent-tertiary\/25:hover{background-color:color-mix(in oklab,var(--accent-tertiary)25%,transparent)}}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-bg-elevated:hover{background-color:var(--bg-elevated)}.hover\:bg-bg-subtle:hover{background-color:var(--bg-subtle)}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-signal-fair\/10:hover{background-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-signal-fair\/10:hover{background-color:color-mix(in oklab,var(--signal-fair)10%,transparent)}}.hover\:bg-tooltip-bg:hover{background-color:var(--tooltip-bg)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white)4%,transparent)}}.hover\:bg-white\/\[0\.05\]:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.05\]:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/\[0\.08\]:hover{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.08\]:hover{background-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.hover\:from-\[\#8de04a\]:hover{--tw-gradient-from:#8de04a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-\[\#7dd03a\]:hover{--tw-gradient-to:#7dd03a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:text-accent-danger:hover{color:var(--accent-danger)}.hover\:text-accent-primary:hover,.hover\:text-accent-primary\/80:hover{color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:text-accent-primary\/80:hover{color:color-mix(in oklab,var(--accent-primary)80%,transparent)}}.hover\:text-accent-secondary:hover{color:var(--accent-secondary)}.hover\:text-accent-tertiary:hover{color:var(--accent-tertiary)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-text-primary:hover{color:var(--text-primary)}.hover\:text-text-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.focus\:border-accent-primary:focus,.focus\:border-accent-primary\/50:focus{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.focus\:border-accent-primary\/50:focus{border-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.focus\:border-amber-500\/50:focus{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.focus\:border-amber-500\/50:focus{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#9cf15b\]\/50:focus{--tw-ring-color:oklab(87.4074% -.139284 .1444/.5)}.focus\:ring-accent-primary:focus,.focus\:ring-accent-primary\/50:focus{--tw-ring-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-accent-primary\/50:focus{--tw-ring-color:color-mix(in oklab,var(--accent-primary)50%,transparent)}}.focus\:ring-accent-tertiary\/50:focus{--tw-ring-color:var(--accent-tertiary)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-accent-tertiary\/50:focus{--tw-ring-color:color-mix(in oklab,var(--accent-tertiary)50%,transparent)}}.focus\:ring-amber-500\/50:focus{--tw-ring-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.focus\:ring-amber-500\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.focus\:ring-signal-fair\/50:focus{--tw-ring-color:var(--signal-fair)}@supports (color:color-mix(in lab,red,red)){.focus\:ring-signal-fair\/50:focus{--tw-ring-color:color-mix(in oklab,var(--signal-fair)50%,transparent)}}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-bg-elevated:focus{--tw-ring-offset-color:var(--bg-elevated)}.focus\:ring-offset-bg-surface:focus{--tw-ring-offset-color:var(--bg-surface)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.98\]:active{scale:.98}.active\:bg-bg-elevated:active{background-color:var(--bg-elevated)}.active\:bg-tooltip-bg:active{background-color:var(--tooltip-bg)}.active\:bg-white\/10:active{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.active\:bg-white\/10:active{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.active\:brightness-90:active{--tw-brightness:brightness(90%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:475px){.xs\:inline{display:inline}}@media(min-width:40rem){.sm\:top-4{top:calc(var(--spacing)*4)}.sm\:top-\[4rem\]{top:4rem}.sm\:right-4{right:calc(var(--spacing)*4)}.sm\:mx-4{margin-inline:calc(var(--spacing)*4)}.sm\:mt-8{margin-top:calc(var(--spacing)*8)}.sm\:mb-2{margin-bottom:calc(var(--spacing)*2)}.sm\:mb-3{margin-bottom:calc(var(--spacing)*3)}.sm\:mb-4{margin-bottom:calc(var(--spacing)*4)}.sm\:mb-6{margin-bottom:calc(var(--spacing)*6)}.sm\:mb-8{margin-bottom:calc(var(--spacing)*8)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:h-3{height:calc(var(--spacing)*3)}.sm\:h-3\.5{height:calc(var(--spacing)*3.5)}.sm\:h-4{height:calc(var(--spacing)*4)}.sm\:h-5{height:calc(var(--spacing)*5)}.sm\:h-8{height:calc(var(--spacing)*8)}.sm\:h-9{height:calc(var(--spacing)*9)}.sm\:h-16{height:calc(var(--spacing)*16)}.sm\:h-auto{height:auto}.sm\:max-h-96{max-height:calc(var(--spacing)*96)}.sm\:max-h-\[80vh\]{max-height:80vh}.sm\:max-h-\[calc\(100vh-250px\)\]{max-height:calc(100vh - 250px)}.sm\:w-4{width:calc(var(--spacing)*4)}.sm\:w-5{width:calc(var(--spacing)*5)}.sm\:w-8{width:calc(var(--spacing)*8)}.sm\:w-9{width:calc(var(--spacing)*9)}.sm\:w-16{width:calc(var(--spacing)*16)}.sm\:w-28{width:calc(var(--spacing)*28)}.sm\:w-40{width:calc(var(--spacing)*40)}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-\[280px\]{max-width:280px}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-1{gap:calc(var(--spacing)*1)}.sm\:gap-2{gap:calc(var(--spacing)*2)}.sm\:gap-3{gap:calc(var(--spacing)*3)}.sm\:gap-4{gap:calc(var(--spacing)*4)}.sm\:gap-6{gap:calc(var(--spacing)*6)}:where(.sm\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*5)*calc(1 - var(--tw-space-y-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.sm\:border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.sm\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.sm\:border-border-subtle{border-color:var(--border-subtle)}.sm\:p-1\.5{padding:calc(var(--spacing)*1.5)}.sm\:p-3{padding:calc(var(--spacing)*3)}.sm\:p-4{padding:calc(var(--spacing)*4)}.sm\:p-8{padding:calc(var(--spacing)*8)}.sm\:px-2{padding-inline:calc(var(--spacing)*2)}.sm\:px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.sm\:px-4{padding-inline:calc(var(--spacing)*4)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:py-1\.5{padding-block:calc(var(--spacing)*1.5)}.sm\:py-2{padding-block:calc(var(--spacing)*2)}.sm\:py-3{padding-block:calc(var(--spacing)*3)}.sm\:py-6{padding-block:calc(var(--spacing)*6)}.sm\:py-8{padding-block:calc(var(--spacing)*8)}.sm\:pt-0{padding-top:calc(var(--spacing)*0)}.sm\:pb-6{padding-bottom:calc(var(--spacing)*6)}.sm\:pl-7{padding-left:calc(var(--spacing)*7)}.sm\:text-left{text-align:left}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:opacity-100{opacity:1}}@media(min-width:48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-3{gap:calc(var(--spacing)*3)}.md\:p-5{padding:calc(var(--spacing)*5)}.md\:py-8{padding-block:calc(var(--spacing)*8)}}@media(min-width:64rem){.lg\:top-\[4\.5rem\]{top:4.5rem}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-32{width:calc(var(--spacing)*32)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}.lg\:pt-0{padding-top:calc(var(--spacing)*0)}.lg\:pb-8{padding-bottom:calc(var(--spacing)*8)}}}.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107,M12=.707107,M21=-.707107,M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--bg-body:#171717;--bg-surface:#252525;--bg-elevated:#333233;--bg-subtle:#3f3f3f;--border-subtle:#4b4b4b;--border-strong:#616161;--text-primary:#e1e1e1;--text-secondary:#bfbfbf;--text-muted:#727272;--text-invert:#171717;--accent-primary:#719cdf;--accent-secondary:#dfbc72;--accent-tertiary:#6fbcbd;--accent-danger:#e12672;--accent-success:#719872;--overlay-soft:#ffffff0a;--shadow-tint:#719cdf59;--sidebar-tint:#719cdf0f;--tooltip-bg:#252525;--hover-tint:#719cdf14;--glass-tint:#252525;--glass-light:#fff;--glass-dark:#000;--glass-reflex-light:.15;--glass-reflex-dark:.8;--glass-blur:6px;--glass-blur-elevated:8px;--glass-brightness:1;--glass-surface-tint:linear-gradient(to bottom,#ffffff06,#ffffff04);--glass-reflection-top:linear-gradient(to bottom,#ffffff05 0px,transparent 16px);--glass-reflection-bottom:linear-gradient(to top,#ffffff05 0px,transparent 20px);--glass-bg-opacity:8%;--glass-bg-opacity-elevated:12%;--signal-excellent:#0f0;--signal-good:#8ce619;--signal-fair:#ffd900;--signal-poor:#ff8c26;--signal-critical:#f33;--signal-unknown:#616161;--sparkline-excellent:#0f0;--sparkline-good:#8ce619;--sparkline-fair:#ffd900;--sparkline-poor:#ff8c26;--sparkline-critical:#f33;--status-success:#719872;--status-warning:#dfbc72;--status-danger:#e12672;--status-info:#6fbcbd;--status-muted:#616161;--pkt-advert:#dfbc72;--pkt-flood:#6fbcbd;--pkt-txt-msg:#719872;--pkt-ack:#999abd;--pkt-trace:#70bddf;--pkt-req:#0074be;--pkt-response:#98bc99;--pkt-grp-txt:#e17899;--pkt-grp-data:#be7572;--pkt-path:#70bddf;--pkt-anon:#bdbb72;--pkt-unknown:#616161;--pkt-science-req:#0090ff;--pkt-science-anon-req:#06c;--pkt-science-response:#6cf;--pkt-science-ack:#00e699;--pkt-science-advert:#fff200;--pkt-science-txt-msg:#ffb300;--pkt-science-grp-txt:#ff80c0;--pkt-science-grp-data:#f60;--pkt-science-multipart:#b3b3b3;--pkt-science-raw-custom:#e666cc;--pkt-science-path:#66b3ff;--pkt-science-trace:#33ffb3;--pkt-science-unknown:gray;--route-flood:#6fbcbd;--route-direct:#dfbc72;--route-transport:#999abd;--chart-1:#719cdf;--chart-2:#0074be;--chart-3:#6fbcbd;--chart-4:#dfbc72;--chart-5:#719872;--chart-6:#e12672;--chart-7:#e17899;--chart-8:#999abd;--chart-grid:#bfbfbf26;--chart-axis-tick:var(--text-secondary);--chart-cursor:#fff3;--metric-received:#719872;--metric-forwarded:#0074be;--metric-transmitted:#dfbc72;--metric-dropped:#e12672;--metric-neutral:#bfbfbf;--log-debug:#616161;--log-info:#6fbcbd;--log-warning:#dfbc72;--log-error:#e12672;--log-critical:#be7572;--icon-page-title:var(--accent-primary);--icon-card-title:var(--accent-primary);--icon-widget:var(--text-secondary);--icon-action:var(--text-secondary);--icon-nav:var(--text-muted);--icon-nav-active:var(--accent-primary);--toggle-on:var(--accent-success);--toggle-off:var(--bg-elevated);--data-box-bg:#ffffff08;--data-box-border:#ffffff0f;--map-node-fill:#f5f5f0;--map-node-stroke:#4a5568;--map-hub-color:#8b7bad;--map-local-color:#fbbf24;--map-neighbor-color:#fbbf24;--map-mobile-color:#f97316;--map-room-color:#e17899;--palette-bg-0:#171717;--palette-bg-1:#1f1f1f;--palette-bg-2:#252525;--palette-bg-3:#2d2d2d;--palette-bg-4:#3f3f3f;--palette-bg-5:#4b4b4b;--palette-bg-6:#616161;--palette-bg-7:#727272;--palette-fg-0:#8a8a8a;--palette-fg-1:#a3a3a3;--palette-fg-2:#bfbfbf;--palette-fg-3:#e1e1e1;--palette-fg-4:#f5f5f5;--palette-red:#be7572;--palette-red-bright:#e12672;--palette-orange:#d97742;--palette-orange-bright:#f59e0b;--palette-yellow:#bdbb72;--palette-yellow-bright:#dfbc72;--palette-green:#719872;--palette-green-bright:#98bc99;--palette-aqua:#6fbcbd;--palette-aqua-bright:#70bddf;--palette-blue:#0074be;--palette-blue-bright:#719cdf;--palette-purple:#8b7bad;--palette-purple-bright:#999abd;--map-edge-rest:#4b4b4b;--map-edge-rest-bright:#616161;--map-edge-rest-dim:#3f3f3f;--map-edge-hover-direct:#6fbcbd;--map-edge-hover-loop:#8b7bad;--map-edge-hover-standard:#8a8a8a;--map-edge-hover-neighbor:#fbbf24;--map-edge-highlight:gold;--link-strong:#719872;--link-medium:#dfbc72;--link-weak:#be7572;--hop-0:#6fbcbd;--hop-1:#719872;--hop-2:#98bc99;--hop-3:#dfbc72;--hop-distant:#727272;--hop-hub:#fbbf24;--ctrl-base:var(--palette-bg-4);--ctrl-base-hover:var(--palette-bg-5);--ctrl-base-active:var(--palette-bg-3);--ctrl-border:var(--palette-bg-5);--ctrl-border-hover:var(--palette-bg-6);--ctrl-shadow-dark:var(--palette-bg-1);--ctrl-shadow-mid:var(--palette-bg-0);--ctrl-highlight:var(--palette-bg-6);--ctrl-inset:var(--palette-bg-3);--ctrl-primary:#5a6b9f;--ctrl-primary-hover:#6a7baf;--ctrl-primary-border:#7a8bbf;--ctrl-primary-shadow:#2a3b5f;--ctrl-primary-highlight:#8a9bcf;--ctrl-primary-inset:#4a5b8f;--ctrl-success:#4a7854;--ctrl-success-hover:#5a8864;--ctrl-success-border:#6a9874;--ctrl-success-shadow:#2a4834;--ctrl-success-highlight:#7aa884;--ctrl-success-inset:#3a6844;--ctrl-warning:#9f8a4a;--ctrl-warning-hover:#af9a5a;--ctrl-warning-border:#bfaa6a;--ctrl-warning-shadow:#5f4a2a;--ctrl-warning-highlight:#cfba7a;--ctrl-warning-inset:#8f7a3a;--ctrl-panel-top:var(--palette-bg-2);--ctrl-panel-mid:var(--palette-bg-1);--ctrl-panel-bottom:var(--palette-bg-0);--ctrl-panel-border:var(--palette-bg-4);--background:var(--bg-body);--foreground:var(--text-secondary);--foreground-muted:var(--text-muted);--foreground-subtle:var(--border-subtle);--primary:var(--accent-tertiary);--secondary:var(--accent-secondary);--accent-green:var(--accent-success);--accent-red:var(--accent-danger);--accent-purple:var(--accent-primary);--accent-cyan:var(--accent-tertiary);--card-bg:var(--bg-surface);--border:var(--border-subtle);--theme-transition:.4s ease;--text-xs:.64rem;--text-sm:.8rem;--text-base:1rem;--text-md:1.125rem;--text-lg:1.25rem;--text-xl:1.563rem;--text-2xl:1.953rem;--text-3xl:2.441rem;--text-4xl:3.052rem;--text-5xl:3.815rem;--text-6xl:4.768rem;--leading-tight:1.1;--leading-snug:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--tracking-tight:-.025em;--tracking-normal:0;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--font-normal:400;--font-medium:500;--font-semibold:600;--font-bold:700;--font-extrabold:800}@supports (color:color(display-p3 1 1 1)){:root{--accent-primary:color(display-p3 .443 .612 .875);--accent-secondary:color(display-p3 .875 .737 .447);--accent-tertiary:color(display-p3 .435 .737 .741);--accent-danger:color(display-p3 .882 .15 .447);--accent-success:color(display-p3 .443 .596 .447);--signal-excellent:color(display-p3 0 1 0);--signal-good:color(display-p3 .55 .9 .15);--signal-fair:color(display-p3 1 .85 0);--signal-poor:color(display-p3 1 .55 .15);--signal-critical:color(display-p3 1 .2 .2);--sparkline-excellent:color(display-p3 .1 .9 .35);--sparkline-good:color(display-p3 .45 .85 .05);--sparkline-fair:color(display-p3 1 .8 0);--sparkline-poor:color(display-p3 1 .5 .1);--sparkline-critical:color(display-p3 1 .15 .15);--status-success:color(display-p3 .443 .596 .447);--status-warning:color(display-p3 .875 .737 .447);--status-danger:color(display-p3 .882 .15 .447);--status-info:color(display-p3 .435 .737 .741);--pkt-advert:color(display-p3 .875 .737 .447);--pkt-flood:color(display-p3 .435 .737 .741);--pkt-txt-msg:color(display-p3 .443 .596 .447);--pkt-ack:color(display-p3 .6 .604 .741);--pkt-trace:color(display-p3 .439 .741 .875);--pkt-req:color(display-p3 0 .455 .745);--pkt-response:color(display-p3 .596 .737 .6);--pkt-grp-txt:color(display-p3 .882 .471 .6);--pkt-grp-data:color(display-p3 .745 .459 .447);--pkt-path:color(display-p3 .439 .741 .875);--pkt-anon:color(display-p3 .741 .733 .447);--chart-1:color(display-p3 .443 .612 .875);--chart-2:color(display-p3 0 .455 .745);--chart-3:color(display-p3 .435 .737 .741);--chart-4:color(display-p3 .875 .737 .447);--chart-5:color(display-p3 .443 .596 .447);--chart-6:color(display-p3 .882 .15 .447);--chart-7:color(display-p3 .882 .471 .6);--chart-8:color(display-p3 .6 .604 .741);--metric-received:color(display-p3 .443 .596 .447);--metric-forwarded:color(display-p3 0 .455 .745);--metric-transmitted:color(display-p3 .875 .737 .447);--metric-dropped:color(display-p3 .882 .15 .447);--log-info:color(display-p3 .435 .737 .741);--log-warning:color(display-p3 .875 .737 .447);--log-error:color(display-p3 .882 .15 .447);--log-critical:color(display-p3 .745 .459 .447);--map-hub-color:color(display-p3 .65 .5 .85);--map-local-color:color(display-p3 1 .8 .1);--map-neighbor-color:color(display-p3 1 .8 .1);--map-mobile-color:color(display-p3 1 .5 .1);--map-room-color:color(display-p3 1 .45 .65);--link-strong:color(display-p3 .443 .596 .447);--link-medium:color(display-p3 .875 .737 .447);--link-weak:color(display-p3 .745 .459 .447);--hop-0:color(display-p3 .435 .737 .741);--hop-1:color(display-p3 .443 .596 .447);--hop-2:color(display-p3 .596 .737 .6);--hop-3:color(display-p3 .875 .737 .447);--hop-hub:color(display-p3 .984 .749 .141);--palette-red:color(display-p3 .745 .459 .447);--palette-red-bright:color(display-p3 .882 .15 .447);--palette-orange:color(display-p3 .851 .467 .259);--palette-orange-bright:color(display-p3 .961 .62 .043);--palette-yellow:color(display-p3 .741 .733 .447);--palette-yellow-bright:color(display-p3 .875 .737 .447);--palette-green:color(display-p3 .443 .596 .447);--palette-green-bright:color(display-p3 .596 .737 .6);--palette-aqua:color(display-p3 .435 .737 .741);--palette-aqua-bright:color(display-p3 .439 .741 .875);--palette-blue:color(display-p3 0 .455 .745);--palette-blue-bright:color(display-p3 .443 .612 .875);--palette-purple:color(display-p3 .545 .482 .678);--palette-purple-bright:color(display-p3 .6 .604 .741);--map-edge-hover-direct:color(display-p3 .2 .9 .92);--map-edge-hover-loop:color(display-p3 .7 .5 .92);--map-edge-hover-neighbor:color(display-p3 1 .8 0);--map-edge-highlight:color(display-p3 1 .9 0)}}a,button,[role=button],.interactive,.glass-card,.data-card,.chart-container,.pill-tag,.pill-subtle,.toggle-group-item,.roster-row,.nav-item{transition:all .15s ease-out}a:hover,button:hover,[role=button]:hover,.interactive:hover,.glass-card:hover,.data-card:hover,.chart-container:hover,.pill-tag:hover,.pill-subtle:hover,.toggle-group-item:hover,.roster-row:hover,.nav-item:hover{transition-duration:0s}a,button,[role=button],input,select,textarea{touch-action:manipulation;-webkit-tap-highlight-color:transparent}a,button{cursor:pointer}body{background:var(--bg-body);color:var(--text-secondary);font-family:var(--font-display),system-ui,-apple-system,sans-serif;font-weight:var(--font-normal);font-size:var(--text-base);line-height:var(--leading-normal);letter-spacing:var(--tracking-normal);font-feature-settings:"cv02","cv03","cv04";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-height:100vh}.type-hero{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-5xl);font-weight:var(--font-semibold);letter-spacing:var(--tracking-tight);color:var(--text-primary);line-height:1.05}.type-metric{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-4xl);font-weight:var(--font-semibold);letter-spacing:var(--tracking-tight);color:var(--text-primary);line-height:1.1}.type-title{font-family:var(--font-title),system-ui,sans-serif;font-size:var(--text-2xl);font-weight:var(--font-semibold);line-height:var(--leading-snug);color:var(--text-primary)}.type-heading,.type-subheading{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-lg);font-weight:var(--font-semibold);line-height:var(--leading-snug);color:var(--text-primary)}.type-body{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-base);font-weight:var(--font-normal);line-height:var(--leading-normal);color:var(--text-secondary)}.type-body-lg{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-md);font-weight:var(--font-normal);line-height:var(--leading-normal);color:var(--text-secondary)}.type-body-sm,.type-label{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-sm);font-weight:var(--font-medium);line-height:var(--leading-normal);color:var(--text-secondary)}.type-micro{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-normal);letter-spacing:.12em;text-transform:uppercase;color:var(--text-secondary)}.type-data{font-family:var(--font-data);font-size:var(--text-base);font-weight:var(--font-normal);line-height:var(--leading-normal);letter-spacing:var(--tracking-wide);font-feature-settings:"zero","tnum"}.type-data-lg{font-family:var(--font-data);font-size:var(--text-lg);font-weight:var(--font-medium);line-height:var(--leading-snug);letter-spacing:var(--tracking-normal);font-feature-settings:"zero","tnum"}.type-data-hero{font-family:var(--font-data);font-size:var(--text-3xl);font-weight:var(--font-medium);letter-spacing:var(--tracking-normal);font-feature-settings:"zero","tnum";line-height:1.1}.type-data-sm{font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);line-height:var(--leading-normal);letter-spacing:var(--tracking-wider);font-feature-settings:"zero","tnum"}.type-data-xs{font-family:var(--font-data);font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-normal);letter-spacing:var(--tracking-widest);font-feature-settings:"zero","tnum"}.type-code{font-family:var(--font-data);font-size:.875em;font-weight:var(--font-normal);line-height:var(--leading-relaxed);font-feature-settings:"zero","tnum"}.type-badge{font-family:var(--font-data);font-size:var(--text-xs);font-weight:var(--font-medium);letter-spacing:.08em;text-transform:uppercase;line-height:1}.type-tag{font-family:var(--font-display),system-ui,sans-serif;font-size:var(--text-xs);font-weight:var(--font-medium);letter-spacing:.05em;line-height:1}.data-box{background:var(--data-box-bg);border:1px solid var(--data-box-border);font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);--data-box-color:var(--text-primary);color:var(--data-box-color);letter-spacing:-.03em;font-variant-numeric:tabular-nums;font-feature-settings:"zero","tnum";white-space:nowrap;text-overflow:ellipsis;border-radius:.375rem;justify-content:center;align-items:center;min-width:0;padding:.25rem .5rem;line-height:1.2;display:inline-flex;overflow:hidden}.data-box-compact{font-size:var(--text-xs);border-radius:.25rem;padding:.125rem .375rem}.data-box-hug{width:auto}.data-box-fill{width:100%;display:flex}.data-box-left{justify-content:flex-start}.data-box-center{justify-content:center}.data-box-right{justify-content:flex-end}.data-box-label{font-family:var(--font-data);font-size:var(--text-sm);font-weight:var(--font-normal);color:var(--text-muted);margin-bottom:.25rem;line-height:1.3}.liquid-glass{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.liquid-glass{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-elevated{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass-elevated{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity-elevated),transparent)}}.liquid-glass-elevated{-webkit-backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass-elevated{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass-elevated:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-glow{background-color:var(--glass-tint);border:none;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.liquid-glass-glow{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.liquid-glass-glow{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--accent-primary),inset 1.8px 3px 0 -2px var(--accent-primary),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.liquid-glass-glow{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.liquid-glass-glow:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.liquid-glass-sm{border-radius:.5rem}.liquid-glass-md{border-radius:.875rem}.liquid-glass-lg{border-radius:1.125rem}.liquid-glass-xl{border-radius:1.5rem}.liquid-glass-pill{border-radius:9999px}.liquid-glass-none{border-radius:0}.glass-card{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-glow{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card-glow{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-card-glow{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--accent-primary),inset 1.8px 3px 0 -2px var(--accent-primary),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card-glow{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--accent-primary)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card-glow:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-elevated{background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-card-elevated{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity-elevated),transparent)}}.glass-card-elevated{-webkit-backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur-elevated))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-card-elevated{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.glass-card-elevated:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-sidebar{background-color:var(--glass-tint);border:none;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.glass-sidebar{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.glass-sidebar{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset -1px 0 0 0 var(--glass-light),inset 1px 0 0 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-sidebar{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset -1px 0 color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*8%),transparent),inset 1px 0 color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent)}}.glass-sidebar:before{content:"";pointer-events:none;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.glass-card-inner{background-color:var(--glass-tint)}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{background-color:color-mix(in srgb,var(--glass-tint)8%,transparent)}}.glass-card-inner{border:1px solid var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{border:1px solid color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*5%),transparent)}}.glass-card-inner{box-shadow:inset 0 1px 2px var(--glass-dark);border-radius:.75rem}@supports (color:color-mix(in lab,red,red)){.glass-card-inner{box-shadow:inset 0 1px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*5%),transparent)}}.glass-thumbnail{border:none;border-radius:.375rem;position:relative;overflow:hidden}.glass-thumbnail:after{content:"";z-index:10;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 .5px var(--glass-light),inset .9px 1.5px 0 -1px var(--glass-light),inset -1px -1px 0 -1px var(--glass-light),inset -1.5px -4px .5px -3px var(--glass-light),inset -.15px -.5px 2px 0 var(--glass-dark),inset -.75px 1.25px 0 -1px var(--glass-dark),inset 0 1.5px 2px -1px var(--glass-dark);position:absolute;top:0;right:0;bottom:0;left:0}@supports (color:color-mix(in lab,red,red)){.glass-thumbnail:after{box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*16%),transparent),inset .9px 1.5px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*140%),transparent),inset -1px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*125%),transparent),inset -1.5px -4px .5px -3px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*94%),transparent),inset -.15px -.5px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*18%),transparent),inset -.75px 1.25px 0 -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent),inset 0 1.5px 2px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent)}}.glass-thumbnail-selected:after{box-shadow:inset 0 0 0 1.5px var(--accent-primary),inset .9px 1.5px 0 -1px var(--glass-light),inset -1px -1px 0 -1px var(--glass-light),inset -1.5px -4px .5px -3px var(--glass-light),inset -.15px -.5px 2px 0 var(--glass-dark),inset -.75px 1.25px 0 -1px var(--glass-dark),inset 0 1.5px 2px -1px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.glass-thumbnail-selected:after{box-shadow:inset 0 0 0 1.5px var(--accent-primary),inset .9px 1.5px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*140%),transparent),inset -1px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*125%),transparent),inset -1.5px -4px .5px -3px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*94%),transparent),inset -.15px -.5px 2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*18%),transparent),inset -.75px 1.25px 0 -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent),inset 0 1.5px 2px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*31%),transparent)}}.glass-card-frame{z-index:1000;box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark);border-radius:1.125rem;position:relative}@supports (color:color-mix(in lab,red,red)){.glass-card-frame{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*15%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*25%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*25%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*15%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.glass-card-frame:before{content:"";pointer-events:none;border-radius:inherit;z-index:1001;background:var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.separator-line{background:linear-gradient(to right,transparent,var(--glass-light)20%,var(--glass-light)80%,transparent);height:1px}@supports (color:color-mix(in lab,red,red)){.separator-line{background:linear-gradient(to right,transparent,color-mix(in srgb,var(--glass-light)8%,transparent)20%,color-mix(in srgb,var(--glass-light)8%,transparent)80%,transparent)}}.separator-line-vertical{background:linear-gradient(to bottom,transparent,var(--glass-light)20%,var(--glass-light)80%,transparent);width:1px}@supports (color:color-mix(in lab,red,red)){.separator-line-vertical{background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--glass-light)8%,transparent)20%,color-mix(in srgb,var(--glass-light)8%,transparent)80%,transparent)}}.rounded-pill{border-radius:9999px}.rounded-card{border-radius:1.125rem}.card-sm{min-height:7rem}.card-md{min-height:11rem}.card-lg{min-height:14rem}.card-hero{min-height:20rem}.card-auto{min-height:auto}@media(max-width:640px){.card-sm{min-height:6rem}.card-md{min-height:9rem}.card-lg{min-height:12rem}.card-hero{min-height:16rem}}.icon-sm{flex-shrink:0;width:1rem;height:1rem}.icon-md{flex-shrink:0;width:1.25rem;height:1.25rem}.icon-lg{flex-shrink:0;width:1.5rem;height:1.5rem}.icon-xl{flex-shrink:0;width:2rem;height:2rem}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--bg-surface)}::-webkit-scrollbar-thumb{background-color:var(--border-strong);border-radius:4px}::-webkit-scrollbar-thumb:hover{background-color:var(--text-muted)}.map-container-16-9{aspect-ratio:16/9;width:100%;position:relative}@supports not (aspect-ratio:16 / 9){.map-container-16-9{height:0;padding-bottom:56.25%}}.map-container-16-9{min-height:280px;max-height:80dvh}@supports not (aspect-ratio:16 / 9){.map-container-16-9>*{width:100%;height:100%;position:absolute;top:0;left:0}}@media(max-width:639px){.map-container-16-9{aspect-ratio:4/5;min-height:320px;max-height:75dvh}@supports not (aspect-ratio:4 / 5){.map-container-16-9{padding-bottom:125%}}}@media(min-width:640px)and (max-width:1023px){.map-container-16-9{aspect-ratio:3/2}@supports not (aspect-ratio:3 / 2){.map-container-16-9{padding-bottom:66.67%}}}@media(min-width:1920px){.map-container-16-9{max-height:720px}}.map-container-fullscreen{width:100vw!important;height:calc(100dvh - 3.5rem)!important;aspect-ratio:unset!important;min-height:unset!important;max-height:unset!important;z-index:999!important;border-radius:0!important;padding-bottom:0!important;position:fixed!important;top:3.5rem!important;right:0!important;bottom:0!important;left:0!important}@media(min-width:1024px){.map-container-fullscreen{height:100dvh!important;top:0!important}}.map-blue-water{position:relative}.map-blue-water .leaflet-tile-pane{filter:sepia(.15)hue-rotate(180deg)saturate(.7)brightness(.95)}.map-blue-water:after{content:"";pointer-events:none;z-index:400;mix-blend-mode:multiply;background:linear-gradient(#0d1e3226,#14284614);position:absolute;top:0;right:0;bottom:0;left:0}.map-blue-water .leaflet-marker-pane,.map-blue-water .leaflet-popup-pane,.map-blue-water .leaflet-overlay-pane{filter:none!important}.leaflet-control-attribution{color:var(--text-muted)!important;background:#141416d9!important;border-radius:4px 0 0!important;padding:2px 6px!important;font-size:10px!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.leaflet-control-zoom{-webkit-backdrop-filter:blur(12px);overflow:hidden;background:#141416d9!important;border:1px solid #8ca0c833!important;border-radius:.75rem!important;margin-top:1rem!important;margin-left:1rem!important}.leaflet-control-zoom a{color:var(--text-secondary)!important;background:0 0!important;border:none!important;border-bottom:1px solid #8ca0c826!important;width:32px!important;height:32px!important;font-size:16px!important;font-weight:500!important;line-height:32px!important}.leaflet-control-zoom a:last-child{border-bottom:none!important}.leaflet-control-zoom a:hover{color:var(--text-primary)!important;background:#ffffff1a!important}.leaflet-control-zoom a.leaflet-disabled{opacity:.5;color:var(--text-muted)!important}.map-dot-marker{background:0 0!important;border:none!important}.map-ring-marker,.map-filled-marker,.map-local-marker{cursor:pointer!important;z-index:500!important;pointer-events:auto!important;background:0 0!important;border:none!important}.leaflet-marker-pane{z-index:600!important;pointer-events:auto!important}.leaflet-marker-pane .leaflet-marker-icon{pointer-events:auto!important}.leaflet-popup-content-wrapper{-webkit-backdrop-filter:blur(12px)brightness(.7)saturate(.9)!important;backdrop-filter:blur(12px)brightness(.7)saturate(.9)!important;background-color:#20242aeb!important;border:none!important;border-radius:.75rem!important;padding:0!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff1a,0 4px 16px #00000080!important}.leaflet-popup-content{color:var(--text-primary)!important;margin:.75rem!important}.leaflet-popup-content strong{color:var(--text-primary)!important}.leaflet-popup-content hr{border-color:#8ca0c826!important;margin:.5rem 0!important}.leaflet-popup-tip-container{display:none!important}.leaflet-popup-close-button{color:var(--text-muted)!important;width:24px!important;height:24px!important;padding:6px!important;font-size:18px!important;top:4px!important;right:4px!important}.leaflet-popup-close-button:hover{color:var(--text-primary)!important;background:#ffffff1a!important;border-radius:4px!important}.leaflet-tooltip{white-space:nowrap;color:var(--text-primary)!important;background-color:#050505!important;border:none!important;border-radius:.5rem!important;padding:.375rem .5rem!important;font-size:11px!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026!important}.leaflet-tooltip:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.leaflet-tooltip:before{display:none!important}.leaflet-tooltip .text-text-muted{color:var(--text-muted)!important}.maplibregl-popup{font-family:var(--font-display),system-ui,-apple-system,sans-serif;font-size:var(--text-sm)}.maplibregl-popup-content{min-width:140px;color:var(--text-primary)!important;background-color:#050505!important;border:none!important;border-radius:.75rem!important;padding:.75rem!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.8px 3px 0 -2px #ffffff1f,inset -2px -2px 0 -2px #ffffff14,inset -3px -8px 1px -6px #ffffff0f,inset -.3px -1px 4px #00000026,inset 0 3px 4px -2px #0000001f!important}.maplibregl-popup-content:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.maplibregl-popup-close-button{border-radius:4px;transition:background .1s,color .1s;color:var(--text-muted)!important;width:24px!important;height:24px!important;padding:6px!important;font-size:18px!important;top:4px!important;right:4px!important}.maplibregl-popup-close-button:hover{color:var(--text-primary)!important;background:#ffffff1a!important}.maplibregl-popup-tip{display:none!important}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{border-top-color:var(--tooltip-bg)!important}.maplibregl-marker.local-node-marker{z-index:10!important}.maplibregl-popup{z-index:100!important}.maplibregl-ctrl-attrib{color:var(--text-muted)!important;background:#141416cc!important;padding:2px 6px!important;font-size:10px!important}.maplibregl-ctrl-attrib a{color:var(--text-secondary)!important}.maplibregl-ctrl-attrib.maplibregl-compact{background:#141416cc!important;border-radius:4px!important}.maplibregl-map,.leaflet-container{touch-action:pan-x pan-y;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.maplibregl-ctrl button:focus,.leaflet-control a:focus{outline:2px solid var(--accent-primary);outline-offset:2px}@media(prefers-contrast:high){.maplibregl-ctrl button,.leaflet-control a{border:2px solid!important}.map-legend,.map-controls{border:2px solid var(--text-primary)!important}}@media(prefers-reduced-motion:reduce){.maplibregl-map,.leaflet-container{transition:none!important}.maplibregl-map *{transition:none!important;animation:none!important}}@-moz-document url-prefix(){.maplibregl-canvas{transform:translateZ(0)}}@supports (-webkit-touch-callout:none){.maplibregl-canvas{will-change:transform;transform:translateZ(0)}}@media(forced-colors:active){.maplibregl-ctrl button,.leaflet-control a{forced-color-adjust:none;color:buttontext!important;background:canvas!important;border:1px solid buttontext!important}.maplibregl-popup-content,.leaflet-popup-content-wrapper{color:canvastext!important;background:canvas!important;border:2px solid canvastext!important}}.maplibregl-ctrl-attrib-button{background-color:#141416cc!important;border-radius:4px!important}.maplibregl-ctrl-group{background-color:#050505!important;border:none!important;border-radius:.75rem!important;position:relative!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026!important}.maplibregl-ctrl-group:after{content:""!important;pointer-events:none!important;border-radius:inherit!important;z-index:999!important;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom)!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important}.maplibregl-ctrl-group button{background:0 0!important;border:none!important;border-bottom:1px solid #8ca0c81f!important;width:32px!important;height:32px!important}.maplibregl-ctrl-group button:last-child{border-bottom:none!important}.maplibregl-ctrl-group button:hover{background:#ffffff14!important}.maplibregl-ctrl-group button .maplibregl-ctrl-icon{filter:invert()brightness(.75)}.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon{filter:invert()brightness()}.maplibregl-ctrl-scale{border:1px solid var(--map-local-color)!important;color:var(--map-local-color)!important;font-size:10px!important;font-family:var(--font-data)!important;background:0 0!important;border-top:none!important;border-radius:0!important;padding:2px 6px!important;line-height:1.2!important}.map-control-glass{background-color:#050505;border:none;border-radius:.75rem;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026}.map-control-glass:after{content:"";pointer-events:none;border-radius:inherit;z-index:999;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.map-control-glass-active{background-color:#050505;border:none;border-radius:.75rem;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff1f,inset 1.5px 2px 0 -1px #ffffff2e,inset -1.5px -1.5px 0 -1px #ffffff1a,inset 0 -1px 3px #00000026}.map-control-glass-active:after{content:"";pointer-events:none;border-radius:inherit;z-index:999;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.map-controls-container{background-color:#050505;border-radius:.75rem;flex-direction:column;align-items:stretch;gap:0;max-width:calc(100vw - 1.5rem);display:flex;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff14,inset 1.5px 2px 0 -1px #ffffff1f,inset -1.5px -1.5px 0 -1px #ffffff14,inset 0 -1px 3px #00000026}.map-controls-row{flex-wrap:wrap;justify-content:flex-end;gap:.375rem;padding:.375rem;display:flex}.map-controls-row+.map-controls-row{border-top:1px solid #ffffff0f}.map-controls-secondary{flex-wrap:wrap}.map-control-btn{touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;padding:.5rem;transition:background-color .15s}@media(hover:hover)and (pointer:fine){.map-control-btn:hover{background-color:#151515}}.map-control-btn:active{background-color:#1a1a1a}.map-control-icon{width:16px;height:16px}.map-nav-module{padding:.375rem}@media(max-width:639px){.map-controls-container{max-width:calc(100vw - 1rem)}.map-controls-row{gap:.25rem;padding:.25rem}.map-control-btn{justify-content:center;align-items:center;min-width:44px;min-height:44px;padding:.625rem;display:flex}.map-control-icon{width:18px;height:18px}.map-control-label{display:none}.map-nav-module{padding:.25rem}}@media(min-width:640px)and (max-width:1023px){.map-controls-row,.map-nav-module{padding:.375rem}}@media(min-width:1024px){.map-controls-row{gap:.5rem;padding:.5rem}.map-nav-module{padding:.5rem}}.map-legend-stack{z-index:600;flex-direction:column;gap:0;max-width:150px;max-height:calc(100% - 1.5rem);display:flex;position:absolute;bottom:.75rem;left:.75rem;overflow:hidden auto}.map-legend-stack>*{border-radius:0}.map-legend-stack>:first-child{border-radius:.75rem .75rem 0 0}.map-legend-stack>:last-child{border-radius:0 0 .75rem .75rem}.map-legend-stack>:only-child{border-radius:.75rem}.map-legend-stack>*+*{border-top:1px solid #ffffff0f}@media(min-width:640px){.map-legend-stack{max-width:160px;bottom:1rem;left:1rem}}.map-edge-tooltip{z-index:1000;pointer-events:none;max-width:calc(100vw - 2rem);position:absolute;bottom:1rem;left:calc(50% + 85px);transform:translate(-50%)}.map-edge-tooltip-inner{pointer-events:auto;padding:.625rem 1rem}@media(max-width:639px){.map-edge-tooltip{bottom:.5rem;left:.5rem;right:.5rem;transform:none}.map-edge-tooltip-inner{background-color:#050505f2;border-radius:.75rem;padding:.75rem}.map-edge-tooltip .w-\[540px\]{width:100%;max-width:100%}}.map-container-fullscreen .map-edge-tooltip{bottom:1.5rem}.font-mono{font-feature-settings:"zero";font-family:var(--font-data)!important}.font-title{font-family:var(--font-title),system-ui,sans-serif!important}.font-display{font-family:var(--font-display),system-ui,sans-serif!important}.tabular-nums{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}.layout-container{width:100%;max-width:80rem;margin-left:auto;margin-right:auto}.grid-12{grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem;display:grid}@media(min-width:768px){.grid-12{gap:1.5rem}}.col-span-6{grid-column:span 6/span 6}.col-span-4{grid-column:span 4/span 4}.col-span-3{grid-column:span 3/span 3}@media(min-width:640px){.sm\:col-span-6{grid-column:span 6/span 6}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-3{grid-column:span 3/span 3}}@media(min-width:768px){.md\:col-span-6{grid-column:span 6/span 6}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-3{grid-column:span 3/span 3}.md\:col-span-8{grid-column:span 8/span 8}.md\:col-span-12{grid-column:span 12/span 12}}@media(min-width:1024px){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-span-9{grid-column:span 9/span 9}.lg\:col-span-10{grid-column:span 10/span 10}.lg\:col-span-12{grid-column:span 12/span 12}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-8{grid-column:span 8/span 8}}.gap-space-2{gap:.5rem}.gap-space-3{gap:.75rem}.gap-space-4{gap:1rem}.gap-space-6{gap:1.5rem}.gap-space-8{gap:2rem}.gap-y-space-4{row-gap:1rem}.gap-y-space-6{row-gap:1.5rem}.gap-y-space-8{row-gap:2rem}.gap-x-space-4{column-gap:1rem}.gap-x-space-6{column-gap:1.5rem}.gap-x-space-8{column-gap:2rem}.card-padding{padding:1rem}@media(min-width:768px){.card-padding{padding:1.5rem}}.card-padding-sm{padding:.75rem}@media(min-width:768px){.card-padding-sm{padding:1rem}}.section-gap{flex-direction:column;gap:1rem;display:flex}@media(min-width:640px){.section-gap{gap:1.5rem}}@media(min-width:1024px){.section-gap{gap:2rem}}.stats-row-hero{grid-template-columns:repeat(2,1fr);gap:1rem;display:grid}@media(min-width:768px){.stats-row-hero{grid-template-columns:repeat(3,1fr);gap:1.5rem}}@media(min-width:1280px){.stats-row-hero{grid-template-columns:repeat(5,1fr)}}.stats-row-secondary{grid-template-columns:1fr;gap:1rem;display:grid}@media(min-width:640px){.stats-row-secondary{grid-template-columns:repeat(2,1fr)}}@media(min-width:1024px){.stats-row-secondary{grid-template-columns:repeat(4,1fr);gap:1.5rem}}.content-grid{grid-template-columns:1fr;gap:1rem;display:grid}@media(min-width:768px){.content-grid{gap:1.5rem}}@media(min-width:1280px){.content-grid{grid-template-columns:2fr 1fr}}.content-main,.content-sidebar{min-width:0}.pill-filled{background:var(--accent-primary);color:var(--bg-body);border-radius:9999px;align-items:center;gap:.375rem;padding:.375rem .75rem;font-size:.75rem;font-weight:500;line-height:1;transition:opacity .15s;display:inline-flex}.pill-filled:hover{opacity:.9}.pill-subtle{background:var(--bg-subtle);color:var(--text-secondary);border:1px solid var(--border-subtle);border-radius:9999px;align-items:center;gap:.375rem;padding:.375rem .75rem;font-size:.75rem;font-weight:500;line-height:1;transition:all .15s;display:inline-flex}.pill-subtle:hover{background:var(--bg-elevated);color:var(--text-primary)}.pill-metric{text-transform:uppercase;letter-spacing:.05em;border-radius:9999px;align-items:center;gap:.25rem;padding:.25rem .5rem;font-size:.625rem;font-weight:600;line-height:1;display:inline-flex}.pill-metric-positive{background:var(--accent-success)}@supports (color:color-mix(in lab,red,red)){.pill-metric-positive{background:color-mix(in srgb,var(--accent-success)15%,transparent)}}.pill-metric-positive{color:var(--accent-success)}.pill-metric-negative{background:var(--accent-danger)}@supports (color:color-mix(in lab,red,red)){.pill-metric-negative{background:color-mix(in srgb,var(--accent-danger)15%,transparent)}}.pill-metric-negative{color:var(--accent-danger)}.pill-metric-neutral{background:var(--overlay-soft);color:var(--text-secondary)}.pill-tag{background:var(--accent-primary);border-radius:9999px;align-items:center;padding:.125rem .5rem;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.pill-tag{background:color-mix(in srgb,var(--accent-primary)10%,transparent)}}.pill-tag{color:var(--accent-primary);text-transform:uppercase;letter-spacing:.08em;font-size:.625rem;font-weight:600}.toggle-group{background-color:var(--glass-tint);border-radius:9999px;padding:.25rem;display:inline-flex;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.toggle-group{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.toggle-group{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.toggle-group{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.toggle-group:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.toggle-group-item{color:var(--text-muted);border-radius:9999px;padding:.375rem .75rem;font-size:.75rem;font-weight:500;transition:all .15s}.toggle-group-item:hover{color:var(--text-secondary)}.toggle-group-item.active{background-color:var(--glass-tint)}@supports (color:color-mix(in lab,red,red)){.toggle-group-item.active{background-color:color-mix(in srgb,var(--glass-tint)36%,transparent)}}.toggle-group-item.active{color:var(--accent-primary);box-shadow:inset 0 0 0 1px var(--glass-light),inset 2px 1px 0 -1px var(--glass-light),inset -1.5px -1px 0 -1px var(--glass-light),inset -2px -6px 1px -5px var(--glass-light),inset -1px 2px 3px -1px var(--glass-dark),inset 0 -4px 1px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.toggle-group-item.active{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 2px 1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -1.5px -1px 0 -1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -2px -6px 1px -5px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -1px 2px 3px -1px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 -4px 1px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.toggle-group-sm{padding:.1875rem}.toggle-group-sm .toggle-group-item{padding:.25rem .5rem;font-size:.6875rem}.data-card{contain:layout style;isolation:isolate;background-color:var(--glass-tint);border:none;border-radius:1.125rem;padding:1.25rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.data-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.data-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.data-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.data-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.data-card-header{justify-content:space-between;align-items:center;margin-bottom:.75rem;display:flex}.data-card-title{text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);font-size:.6875rem;font-weight:600}.data-card-controls{align-items:center;gap:.5rem;display:flex}.data-card-value{color:var(--text-primary);font-variant-numeric:tabular-nums;font-size:2rem;font-weight:600;line-height:1.1}.data-card-secondary{color:var(--text-muted);margin-top:.25rem;font-size:.75rem}.chart-container{isolation:isolate;background-color:var(--glass-tint);border:none;border-radius:1.125rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.chart-container{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.chart-container{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.chart-container{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*6%),transparent)}}.chart-container:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.chart-header{border-bottom:1px solid var(--border-subtle);justify-content:space-between;align-items:center;padding:1rem 1.25rem;display:flex}.chart-title{color:var(--text-primary);align-items:center;gap:.5rem;font-size:.875rem;font-weight:600;display:flex}.chart-title-icon{width:1.125rem;height:1.125rem;color:var(--icon-card-title)}.chart-body{padding:1rem;position:relative}.chart-axis-label{color:var(--text-muted);font-variant-numeric:tabular-nums;font-size:.6875rem}.chart-gridline{stroke:var(--chart-grid);stroke-dasharray:4 4}.chart-glow-primary{filter:drop-shadow(0 0 6px var(--accent-primary))}.chart-glow-secondary{filter:drop-shadow(0 0 6px var(--accent-secondary))}.chart-glow-tertiary{filter:drop-shadow(0 0 6px var(--accent-tertiary))}.roster-list{flex-direction:column;display:flex}.roster-row{border-radius:.75rem;align-items:center;gap:.5rem;padding:.75rem .75rem .75rem .5rem;transition:background .15s;display:flex}@media(min-width:640px){.roster-row{gap:.75rem;padding:.75rem 1rem .75rem .75rem}}.roster-row:hover{background:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.roster-row:hover{background:color-mix(in srgb,var(--bg-subtle)80%,transparent)}}.roster-row-interactive{cursor:pointer}.roster-row-interactive:active{background:var(--bg-subtle)}.roster-row.selected{background:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.roster-row.selected{background:color-mix(in srgb,var(--accent-primary)8%,transparent)}}.roster-icon{background-color:var(--glass-tint);border-radius:.625rem;flex-shrink:0;justify-content:center;align-items:center;width:2.5rem;height:2.5rem;display:flex}@supports (color:color-mix(in lab,red,red)){.roster-icon{background-color:color-mix(in srgb,var(--glass-tint)10%,transparent)}}.roster-icon{box-shadow:inset 0 0 0 1px var(--glass-light),inset .5px 1px 0 0 var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.roster-icon{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*5%),transparent),inset .5px 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*30%),transparent)}}.roster-icon-sm{border-radius:.5rem;width:2rem;height:2rem}.roster-content{flex-direction:column;flex:1;gap:.125rem;min-width:0;display:flex}.roster-title{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:.875rem;font-weight:500;overflow:hidden}.roster-subtitle{color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;font-size:.75rem;overflow:hidden}.roster-metrics{color:var(--text-muted);align-items:center;gap:1rem;display:flex}.roster-metric{color:var(--text-secondary);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:.8125rem;font-weight:600}@media(max-width:639px){.roster-row{flex-wrap:wrap;gap:.375rem;padding:.5rem .5rem .5rem .375rem}.roster-icon{border-radius:.375rem;width:1.75rem;height:1.75rem}.roster-content{flex:1 1 0;min-width:0;overflow:hidden}.roster-title{font-size:.75rem}.roster-metrics{flex-wrap:wrap;order:3;gap:.5rem;width:100%;margin-top:.25rem;padding-left:2.25rem}.roster-metric{flex-shrink:0;margin-left:auto;font-size:.6875rem}}@media(min-width:640px)and (max-width:767px){.roster-row{gap:.5rem}.roster-icon{border-radius:.5rem;width:2rem;height:2rem}.roster-metrics{gap:.75rem}}@media(min-width:768px)and (max-width:1023px){.roster-metrics{gap:.875rem}}@media(min-width:1024px){.roster-row{gap:.875rem}.roster-metrics{gap:1rem}}.contacts-grid-header,.contacts-grid-row{grid-template-columns:1fr;grid-template-areas:"node";align-items:center;gap:.75rem;display:grid}.contacts-grid-row{padding:.625rem .75rem;transition:background .15s}.contacts-grid-row:hover{background:var(--bg-subtle)}@supports (color:color-mix(in lab,red,red)){.contacts-grid-row:hover{background:color-mix(in srgb,var(--bg-subtle)80%,transparent)}}@media(max-width:639px){.contacts-grid-row{flex-wrap:nowrap;gap:.5rem;padding:.5rem .625rem;display:flex}.contacts-col-signal,.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity{display:none}.contacts-col-node{flex:1 1 0;min-width:0}.contacts-col-seen,.contacts-col-actions{flex-shrink:0;align-self:center}}@media(min-width:640px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(200px,1fr) 100px 60px 68px;grid-template-areas:"node signal seen actions"}.contacts-col-node{grid-area:node}.contacts-col-signal{grid-area:signal;display:flex}.contacts-col-seen{grid-area:seen}.contacts-col-actions{grid-area:actions}.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity{display:none}}@media(min-width:768px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(240px,1fr) 110px 80px 60px 68px;grid-template-areas:"node signal distance seen actions"}.contacts-col-distance{grid-area:distance;display:flex}}@media(min-width:1024px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(280px,1fr) 110px 80px 64px 64px 68px;grid-template-areas:"node signal distance centrality seen actions"}.contacts-col-centrality{grid-area:centrality;display:flex}}@media(min-width:1280px){.contacts-grid-header,.contacts-grid-row{grid-template-columns:minmax(320px,1fr) 120px 80px 64px 64px 68px 68px;grid-template-areas:"node signal distance centrality activity seen actions"}.contacts-col-activity{grid-area:activity;display:flex}}.contacts-col-node{min-width:0}.contacts-col-signal,.contacts-col-distance,.contacts-col-centrality,.contacts-col-activity,.contacts-col-seen,.contacts-col-actions{white-space:nowrap;flex-shrink:0;overflow:hidden}.roster-separator{background:linear-gradient(to right,transparent,var(--border-subtle)20%,var(--border-subtle)80%,transparent);height:1px;margin:0 1rem}.roster-empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:3rem 1.5rem;display:flex}.roster-empty-icon{width:3rem;height:3rem;color:var(--text-muted);opacity:.5;margin-bottom:1rem}.roster-empty-title{color:var(--text-secondary);margin-bottom:.25rem;font-size:.875rem;font-weight:500}.roster-empty-text{color:var(--text-muted);font-size:.75rem}.btn-skeuo{cursor:pointer;background:var(--ctrl-base);border:1px solid var(--ctrl-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-shadow-dark),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset);border-radius:.5rem;justify-content:center;align-items:center;gap:.5rem;padding:.75rem 1.25rem;font-size:.875rem;font-weight:600;transition:all .12s ease-out;display:inline-flex;position:relative}.btn-skeuo:hover{background:var(--ctrl-base-hover);border-color:var(--ctrl-border-hover);box-shadow:0 4px 0 var(--ctrl-shadow-dark),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset)}.btn-skeuo:active{background:var(--ctrl-base-active);box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 3px var(--ctrl-shadow-mid),inset 0 3px 6px var(--ctrl-shadow-mid),inset 0 1px 0 var(--ctrl-shadow-dark);transform:translateY(3px)}.btn-skeuo:disabled{opacity:.4;cursor:not-allowed;transform:none}.btn-skeuo-primary{background:var(--ctrl-primary);border-color:var(--ctrl-primary-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-primary-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-primary-highlight),inset 0 -2px 0 var(--ctrl-primary-inset)}.btn-skeuo-primary:hover{background:var(--ctrl-primary-hover);border-color:var(--ctrl-primary-highlight);box-shadow:0 4px 0 var(--ctrl-primary-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-primary-highlight),inset 0 -2px 0 var(--ctrl-primary-inset)}.btn-skeuo-success{background:var(--ctrl-success);border-color:var(--ctrl-success-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-success-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-success-highlight),inset 0 -2px 0 var(--ctrl-success-inset)}.btn-skeuo-success:hover{background:var(--ctrl-success-hover);border-color:var(--ctrl-success-highlight);box-shadow:0 4px 0 var(--ctrl-success-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-success-highlight),inset 0 -2px 0 var(--ctrl-success-inset)}.btn-skeuo-warning{background:var(--ctrl-warning);border-color:var(--ctrl-warning-border);color:var(--text-primary);box-shadow:0 3px 0 var(--ctrl-warning-shadow),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-warning-highlight),inset 0 -2px 0 var(--ctrl-warning-inset)}.btn-skeuo-warning:hover{background:var(--ctrl-warning-hover);border-color:var(--ctrl-warning-highlight);box-shadow:0 4px 0 var(--ctrl-warning-shadow),0 8px 20px var(--ctrl-shadow-mid),0 3px 8px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-warning-highlight),inset 0 -2px 0 var(--ctrl-warning-inset)}.btn-skeuo-neutral{background:var(--ctrl-base);border-color:var(--ctrl-border);color:var(--text-secondary);box-shadow:0 3px 0 var(--ctrl-shadow-dark),0 6px 16px var(--ctrl-shadow-mid),0 2px 6px var(--ctrl-shadow-dark),inset 0 1px 0 var(--ctrl-highlight),inset 0 -2px 0 var(--ctrl-inset)}.btn-skeuo-neutral:hover{background:var(--ctrl-base-hover);color:var(--text-primary);box-shadow:0 4px #18191d,0 8px 20px #08090b,0 3px 8px #0d0e12,inset 0 1px #5e5f6b,inset 0 -2px #26272e}.control-card{background-color:var(--glass-tint);border-radius:.875rem;padding:1rem;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.control-card{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.control-card{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.control-card{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*50%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*40%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent)}}.control-card:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.control-card-header{justify-content:space-between;align-items:center;margin-bottom:.75rem;display:flex}.control-card-label{color:var(--text-muted);font-size:.8125rem}.control-card-value{font-size:.8125rem;font-weight:600}.control-card-value-active{color:var(--accent-success)}.control-card-value-inactive{color:var(--text-muted)}.btn-skeuo-icon{stroke-width:2.5px;width:1.125rem;height:1.125rem}.control-panel-skeuo{background:linear-gradient(180deg,var(--ctrl-panel-top)0%,var(--ctrl-panel-mid)50%,var(--ctrl-panel-bottom)100%);border:1px solid var(--ctrl-panel-border);box-shadow:inset 0 1px 0 var(--glass-light),inset 0 -1px 0 var(--glass-dark),0 4px 12px var(--glass-dark),0 1px 3px var(--glass-dark);border-radius:.75rem;flex-direction:column;gap:.5rem;padding:.75rem;display:flex}@supports (color:color-mix(in lab,red,red)){.control-panel-skeuo{box-shadow:inset 0 1px color-mix(in srgb,var(--glass-light)4%,transparent),inset 0 -1px color-mix(in srgb,var(--glass-dark)30%,transparent),0 4px 12px color-mix(in srgb,var(--glass-dark)40%,transparent),0 1px 3px color-mix(in srgb,var(--glass-dark)30%,transparent)}}.control-btn{letter-spacing:.01em;cursor:pointer;background:var(--ctrl-base);border:1px solid var(--ctrl-border);color:var(--text-primary);box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--glass-light);border-radius:.5rem;justify-content:center;align-items:center;gap:.375rem;padding:.5rem .75rem;font-size:.75rem;font-weight:600;transition:all .1s ease-out;display:flex;position:relative}@supports (color:color-mix(in lab,red,red)){.control-btn{box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 3px 8px color-mix(in srgb,var(--glass-dark)30%,transparent),inset 0 1px color-mix(in srgb,var(--glass-light)6%,transparent)}}.control-btn:hover{background:var(--ctrl-base-hover);box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--glass-light)}@supports (color:color-mix(in lab,red,red)){.control-btn:hover{box-shadow:0 2px 0 var(--ctrl-shadow-dark),0 4px 10px color-mix(in srgb,var(--glass-dark)35%,transparent),inset 0 1px color-mix(in srgb,var(--glass-light)8%,transparent)}}.control-btn:active{box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 2px var(--glass-dark),inset 0 2px 4px var(--glass-dark);transform:translateY(2px)}@supports (color:color-mix(in lab,red,red)){.control-btn:active{box-shadow:0 0 0 var(--ctrl-shadow-dark),0 1px 2px color-mix(in srgb,var(--glass-dark)20%,transparent),inset 0 2px 4px color-mix(in srgb,var(--glass-dark)20%,transparent)}}.control-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}.control-btn-primary{background:linear-gradient(180deg,var(--ctrl-primary-hover)0%,var(--ctrl-primary)100%);border-color:var(--ctrl-primary-border);box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-primary-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-primary{box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-primary-highlight)30%,transparent)}}.control-btn-primary:hover{background:linear-gradient(180deg,var(--ctrl-primary-border)0%,var(--ctrl-primary-hover)100%);box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-primary-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-primary:hover{box-shadow:0 2px 0 var(--ctrl-primary-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-primary-highlight)40%,transparent)}}.control-btn-success{background:linear-gradient(180deg,var(--ctrl-success-hover)0%,var(--ctrl-success)100%);border-color:var(--ctrl-success-border);box-shadow:0 2px 0 var(--ctrl-success-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-success-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-success{box-shadow:0 2px 0 var(--ctrl-success-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-success-highlight)25%,transparent)}}.control-btn-success:hover{background:linear-gradient(180deg,var(--ctrl-success-border)0%,var(--ctrl-success-hover)100%);box-shadow:0 2px 0 var(--ctrl-success-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-success-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-success:hover{box-shadow:0 2px 0 var(--ctrl-success-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-success-highlight)35%,transparent)}}.control-btn-warning{background:linear-gradient(180deg,var(--ctrl-warning-hover)0%,var(--ctrl-warning)100%);border-color:var(--ctrl-warning-border);box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 3px 8px var(--glass-dark),inset 0 1px 0 var(--ctrl-warning-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-warning{box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 3px 8px color-mix(in srgb,var(--glass-dark)40%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-warning-highlight)25%,transparent)}}.control-btn-warning:hover{background:linear-gradient(180deg,var(--ctrl-warning-border)0%,var(--ctrl-warning-hover)100%);box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 4px 10px var(--glass-dark),inset 0 1px 0 var(--ctrl-warning-highlight)}@supports (color:color-mix(in lab,red,red)){.control-btn-warning:hover{box-shadow:0 2px 0 var(--ctrl-warning-shadow),0 4px 10px color-mix(in srgb,var(--glass-dark)45%,transparent),inset 0 1px color-mix(in srgb,var(--ctrl-warning-highlight)35%,transparent)}}.control-btn-neutral{background:var(--ctrl-base-active);border-color:var(--ctrl-border);color:var(--text-secondary)}.control-btn-neutral:hover{background:var(--ctrl-base);color:var(--text-primary)}.control-toggle-group{flex-direction:column;gap:.25rem;display:flex}.control-toggle-label{color:var(--text-muted);justify-content:space-between;align-items:center;padding:0 .25rem;font-size:.6875rem;display:flex}.control-toggle-status{text-transform:uppercase;letter-spacing:.05em;font-size:.625rem;font-weight:600}@keyframes flash-white-fade{0%{opacity:.2}to{opacity:0}}.flash-overlay{border-radius:inherit;pointer-events:none;z-index:50;background-color:#fff;animation:.6s ease-out forwards flash-white-fade;position:absolute;top:0;right:0;bottom:0;left:0}@keyframes flash-row-bg{0%{background-color:#fff3}to{background-color:#0000}}.flash-row{animation:.6s ease-out forwards flash-row-bg}@keyframes flash-icon-pulse{0%{color:#fff;filter:drop-shadow(0 0 6px #fffc)}to{color:var(--text-muted);filter:none}}.flash-icon{animation:.6s ease-out forwards flash-icon-pulse}.mini-widget{contain:layout style;background-color:var(--glass-tint);border-radius:.875rem;flex-direction:column;gap:.25rem;padding:.75rem;display:flex;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.mini-widget{background-color:color-mix(in srgb,var(--glass-tint)var(--glass-bg-opacity),transparent)}}.mini-widget{-webkit-backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));backdrop-filter:blur(var(--glass-blur))brightness(var(--glass-brightness));box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.mini-widget{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*10%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*80%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*60%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.mini-widget:before{content:"";pointer-events:none;border-radius:inherit;background:var(--glass-surface-tint),var(--glass-reflection-top),var(--glass-reflection-bottom);position:absolute;top:0;right:0;bottom:0;left:0}.mini-widget:hover{box-shadow:inset 0 0 0 1px var(--glass-light),inset 1.8px 3px 0 -2px var(--glass-light),inset -2px -2px 0 -2px var(--glass-light),inset -3px -8px 1px -6px var(--glass-light),inset -.3px -1px 4px 0 var(--glass-dark),inset -1.5px 2.5px 0 -2px var(--glass-dark),inset 0 3px 4px -2px var(--glass-dark),inset 2px -6.5px 1px -4px var(--glass-dark),0 1px 5px 0 var(--glass-dark),0 6px 16px 0 var(--glass-dark)}@supports (color:color-mix(in lab,red,red)){.mini-widget:hover{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*15%),transparent),inset 1.8px 3px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*100%),transparent),inset -2px -2px 0 -2px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*90%),transparent),inset -3px -8px 1px -6px color-mix(in srgb,var(--glass-light)calc(var(--glass-reflex-light)*70%),transparent),inset -.3px -1px 4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*12%),transparent),inset -1.5px 2.5px 0 -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 0 3px 4px -2px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*20%),transparent),inset 2px -6.5px 1px -4px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 1px 5px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*10%),transparent),0 6px 16px color-mix(in srgb,var(--glass-dark)calc(var(--glass-reflex-dark)*8%),transparent)}}.mini-widget-header{align-items:center;gap:.375rem;min-height:1.25rem;display:flex}.mini-widget-icon{width:1rem;height:1rem;color:var(--icon-widget);flex-shrink:0}.mini-widget-title{font-family:Poppins,sans-serif;font-size:var(--text-xs);color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;text-overflow:ellipsis;font-weight:500;line-height:1.2;overflow:hidden}.mini-widget-value{font-family:var(--font-data);font-size:var(--text-xl);color:var(--text-primary);font-weight:600;line-height:1.1}.mini-widget-value-lg{font-size:var(--text-2xl)}.mini-widget-value-sm{font-size:var(--text-lg)}.mini-widget-unit{font-size:var(--text-xs);color:var(--text-muted);margin-left:.125rem;font-weight:400}.mini-widget-subtitle{font-family:var(--font-data);font-size:var(--text-sm);color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;line-height:1.3;overflow:hidden}.mini-widget-status-dot{border-radius:50%;flex-shrink:0;width:.5rem;height:.5rem}.mini-widget-status-dot.excellent{background:var(--signal-excellent)}.mini-widget-status-dot.good{background:var(--signal-good)}.mini-widget-status-dot.fair{background:var(--signal-fair)}.mini-widget-status-dot.poor{background:var(--signal-poor)}.mini-widget-status-dot.critical{background:var(--signal-critical)}.mini-widget-status-dot.unknown{background:var(--signal-unknown)}.mini-widget-trend{font-size:var(--text-xs);align-items:center;gap:.125rem;font-weight:500;display:flex}.mini-widget-trend.up{color:var(--accent-danger)}.mini-widget-trend.down{color:var(--accent-success)}.mini-widget-trend.stable{color:var(--text-muted)}.mini-widget-sparkline{width:100%;min-width:1px;height:1.5rem;min-height:1px;margin-top:auto}.mini-widget-loading{justify-content:center;align-items:center;min-height:4rem;display:flex}.mini-widget-loading-spinner{border:2px solid var(--border-subtle);border-top-color:var(--accent-primary);border-radius:50%;width:1rem;height:1rem;animation:.8s linear infinite spin}.mini-widget-error{min-height:4rem;color:var(--text-muted);font-size:var(--text-sm);justify-content:center;align-items:center;display:flex}.mini-widget-progress{background:var(--bg-subtle);border-radius:.125rem;height:.25rem;margin-top:auto;overflow:hidden}.mini-widget-progress-bar{border-radius:.125rem;height:100%;transition:width .3s}.mini-widget-progress-bar.excellent{background:var(--signal-excellent)}.mini-widget-progress-bar.good{background:var(--signal-good)}.mini-widget-progress-bar.fair{background:var(--signal-fair)}.mini-widget-progress-bar.poor{background:var(--signal-poor)}.mini-widget-progress-bar.critical{background:var(--signal-critical)}.mini-widget-toggle{align-items:center;gap:.5rem;display:flex}.mini-widget-toggle-track{background:var(--bg-subtle);border:1px solid var(--border-subtle);cursor:pointer;border-radius:.5rem;width:2rem;height:1rem;transition:all .2s;position:relative}.mini-widget-toggle-track.active{background:var(--accent-success);border-color:var(--accent-success)}.mini-widget-toggle-thumb{background:#fff;border-radius:50%;width:.75rem;height:.75rem;transition:left .2s;position:absolute;top:50%;left:.125rem;transform:translateY(-50%)}.mini-widget-toggle-track.active .mini-widget-toggle-thumb{left:calc(100% - .875rem)}.mesh-health-container{margin-bottom:1.5rem}.mesh-health-header{align-items:center;gap:.5rem;margin-bottom:.75rem;display:flex}.widget-row{gap:.75rem;display:grid}@media(min-width:768px){.widget-row{grid-template-columns:repeat(3,1fr)}.mini-widget{height:7.5rem}}@media(max-width:767px){.widget-row{grid-template-columns:repeat(2,1fr)}.mini-widget{height:7rem;padding:.625rem}.mini-widget-value{font-size:var(--text-lg)}.mini-widget-value-lg{font-size:var(--text-xl)}}.mini-widget-value.excellent{color:var(--signal-excellent)}.mini-widget-value.good{color:var(--signal-good)}.mini-widget-value.fair{color:var(--signal-fair)}.mini-widget-value.poor{color:var(--signal-poor)}.mini-widget-value.critical{color:var(--signal-critical)}.pb-safe{padding-bottom:env(safe-area-inset-bottom,0)}.pt-safe{padding-top:env(safe-area-inset-top,0)}.pl-safe{padding-left:env(safe-area-inset-left,0)}.pr-safe{padding-right:env(safe-area-inset-right,0)}.p-safe{padding-top:env(safe-area-inset-top,0);padding-right:env(safe-area-inset-right,0);padding-bottom:env(safe-area-inset-bottom,0);padding-left:env(safe-area-inset-left,0)}@keyframes shimmer{0%{opacity:.5;transform:translate(-100%)}50%{opacity:1}to{opacity:.5;transform:translate(100%)}}@keyframes shimmer-border{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-border{z-index:1;pointer-events:none;background:linear-gradient(90deg,transparent 0%,transparent 25%,var(--accent-primary)50%,transparent 75%,transparent 100%);border-radius:inherit;opacity:.8;background-size:200% 100%;padding:2px;animation:2s ease-in-out infinite shimmer-border;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);mask-image:linear-gradient(#fff 0,#fff 0),linear-gradient(#fff 0,#fff 0);-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0;-webkit-mask-size:auto,auto;mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}.shimmer-border-light{background:linear-gradient(90deg,#0000,#0000,#fff6,#0000,#0000)}.shimmer-indicator{background:var(--bg-elevated);border-radius:2px;width:40px;height:4px;position:relative;overflow:hidden}.shimmer-indicator-inner{background:linear-gradient(90deg,transparent 0%,var(--accent-primary)50%,transparent 100%);background-size:200% 100%;animation:1.5s ease-in-out infinite shimmer-border;position:absolute;top:0;right:0;bottom:0;left:0}.bento-row{grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch;display:grid}.bento-row-hero{min-height:15rem}@media(min-width:768px){.bento-row-hero{min-height:17.5rem}}@media(min-width:1024px){.bento-row-hero{min-height:20rem}}.bento-row-hero-tall{height:20rem;min-height:20rem}@media(min-width:768px){.bento-row-hero-tall{height:23.3125rem;min-height:23.3125rem}}@media(min-width:1024px){.bento-row-hero-tall{height:26.625rem;min-height:26.625rem}}.bento-row-hero-auto{min-height:20rem}@media(min-width:768px){.bento-row-hero-auto{min-height:23.3125rem}}@media(min-width:1024px){.bento-row-hero-auto{min-height:26.625rem}}.bento-row-panel{grid-auto-rows:18.75rem}.bento-row-feature{grid-auto-rows:12.5rem}@media(min-width:768px){.bento-row-feature{grid-auto-rows:15rem}}@media(min-width:1024px){.bento-row-feature{grid-auto-rows:16.25rem}}.bento-row-standard{min-height:11.25rem}@media(min-width:768px){.bento-row-standard{min-height:12.5rem}}@media(min-width:1024px){.bento-row-standard{min-height:13.75rem}}.bento-row-compact{min-height:8.75rem}@media(min-width:768px){.bento-row-compact{min-height:10rem}}@media(min-width:1024px){.bento-row-compact{min-height:11.25rem}}.bento-row-widget{min-height:6.25rem}@media(min-width:768px){.bento-row-widget{min-height:6.875rem}}@media(min-width:1024px){.bento-row-widget{min-height:7.5rem}}.bento-row-auto{min-height:auto}.analyzer-chart-height{height:13rem}@media(min-width:768px){.analyzer-chart-height{height:17rem}}@media(min-width:1024px){.analyzer-chart-height{height:20rem}}.legend-item{cursor:pointer;border-radius:.25rem;align-items:center;gap:.25rem;padding:.25rem .375rem;font-size:.6875rem;line-height:1.2;transition:background-color .15s,opacity .15s;display:flex}.legend-item:hover{background-color:var(--hover-tint)}.legend-item-active{background-color:var(--bg-subtle);opacity:1}.legend-item-dimmed{opacity:.35}.legend-item-chart-active{background-color:var(--hover-tint);opacity:1}.legend-label{color:var(--text-muted);white-space:nowrap;text-overflow:ellipsis;max-width:5.5rem;overflow:hidden}.legend-value{font-family:var(--font-data);font-variant-numeric:tabular-nums;color:var(--text-secondary);flex-shrink:0;margin-left:auto;font-weight:600}.legend-value-live{color:var(--text-primary)}.bento-gap{gap:.75rem}@media(min-width:640px){.bento-gap{gap:1rem}}@media(min-width:768px){.bento-gap{gap:1.25rem}}@media(min-width:1024px){.bento-gap{gap:1.5rem}}.bento-gap-sm{gap:.5rem}@media(min-width:640px){.bento-gap-sm{gap:.75rem}}@media(min-width:768px){.bento-gap-sm{gap:1rem}}.bento-gap-lg{gap:1rem}@media(min-width:640px){.bento-gap-lg{gap:1.25rem}}@media(min-width:768px){.bento-gap-lg{gap:1.5rem}}@media(min-width:1024px){.bento-gap-lg{gap:2rem}}.bento-cell{flex-direction:column;min-width:0;min-height:0;display:flex}.bento-cell>*{flex:auto;min-height:0}.bento-col-1{grid-column:span 1/span 1}.bento-col-2{grid-column:span 2/span 2}.bento-col-3{grid-column:span 3/span 3}.bento-col-4{grid-column:span 4/span 4}.bento-col-5{grid-column:span 5/span 5}.bento-col-6{grid-column:span 6/span 6}.bento-col-7{grid-column:span 7/span 7}.bento-col-8{grid-column:span 8/span 8}.bento-col-9{grid-column:span 9/span 9}.bento-col-10{grid-column:span 10/span 10}.bento-col-11{grid-column:span 11/span 11}.bento-col-12{grid-column:span 12/span 12}.col-span-full{grid-column:1/-1}.col-auto{grid-column:auto}.bento-col-1-5{grid-column:span 2/span 2}@media(min-width:640px){.sm\:bento-col-1{grid-column:span 1/span 1}.sm\:bento-col-2{grid-column:span 2/span 2}.sm\:bento-col-3{grid-column:span 3/span 3}.sm\:bento-col-4{grid-column:span 4/span 4}.sm\:bento-col-5{grid-column:span 5/span 5}.sm\:bento-col-6{grid-column:span 6/span 6}.sm\:bento-col-7{grid-column:span 7/span 7}.sm\:bento-col-8{grid-column:span 8/span 8}.sm\:bento-col-9{grid-column:span 9/span 9}.sm\:bento-col-10{grid-column:span 10/span 10}.sm\:bento-col-11{grid-column:span 11/span 11}.sm\:bento-col-12{grid-column:span 12/span 12}.sm\:col-span-full{grid-column:1/-1}.sm\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:768px){.md\:bento-col-1{grid-column:span 1/span 1}.md\:bento-col-2{grid-column:span 2/span 2}.md\:bento-col-3{grid-column:span 3/span 3}.md\:bento-col-4{grid-column:span 4/span 4}.md\:bento-col-5{grid-column:span 5/span 5}.md\:bento-col-6{grid-column:span 6/span 6}.md\:bento-col-7{grid-column:span 7/span 7}.md\:bento-col-8{grid-column:span 8/span 8}.md\:bento-col-9{grid-column:span 9/span 9}.md\:bento-col-10{grid-column:span 10/span 10}.md\:bento-col-11{grid-column:span 11/span 11}.md\:bento-col-12{grid-column:span 12/span 12}.md\:col-span-full{grid-column:1/-1}.md\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:1024px){.lg\:bento-col-1{grid-column:span 1/span 1}.lg\:bento-col-2{grid-column:span 2/span 2}.lg\:bento-col-3{grid-column:span 3/span 3}.lg\:bento-col-4{grid-column:span 4/span 4}.lg\:bento-col-5{grid-column:span 5/span 5}.lg\:bento-col-6{grid-column:span 6/span 6}.lg\:bento-col-7{grid-column:span 7/span 7}.lg\:bento-col-8{grid-column:span 8/span 8}.lg\:bento-col-9{grid-column:span 9/span 9}.lg\:bento-col-10{grid-column:span 10/span 10}.lg\:bento-col-11{grid-column:span 11/span 11}.lg\:bento-col-12{grid-column:span 12/span 12}.lg\:col-span-full{grid-column:1/-1}.lg\:bento-col-1-5{grid-column:span 2/span 2}}@media(min-width:1280px){.xl\:bento-col-1{grid-column:span 1/span 1}.xl\:bento-col-2{grid-column:span 2/span 2}.xl\:bento-col-3{grid-column:span 3/span 3}.xl\:bento-col-4{grid-column:span 4/span 4}.xl\:bento-col-5{grid-column:span 5/span 5}.xl\:bento-col-6{grid-column:span 6/span 6}.xl\:bento-col-7{grid-column:span 7/span 7}.xl\:bento-col-8{grid-column:span 8/span 8}.xl\:bento-col-9{grid-column:span 9/span 9}.xl\:bento-col-10{grid-column:span 10/span 10}.xl\:bento-col-11{grid-column:span 11/span 11}.xl\:bento-col-12{grid-column:span 12/span 12}.xl\:col-span-full{grid-column:1/-1}.xl\:bento-col-1-5{grid-column:span 2/span 2}}.terminal-card{height:calc(100dvh - 160px);min-height:300px;max-height:calc(100vh - 120px);padding-bottom:env(safe-area-inset-bottom,0)}@media(min-width:640px){.terminal-card{height:calc(100dvh - 180px);min-height:400px}}@media(min-width:1024px){.terminal-card{height:calc(100vh - 180px);min-height:500px}}.terminal-ascii{letter-spacing:-.5px;font-size:8px}@media(min-width:375px){.terminal-ascii{letter-spacing:0;font-size:9px}}@media(min-width:414px){.terminal-ascii{font-size:10px}}@media(min-width:640px){.terminal-ascii{font-size:11px}}@media(min-width:768px){.terminal-ascii{font-size:12px}}@media(min-width:1024px){.terminal-ascii{font-size:13px}}@supports (-webkit-touch-callout:none){.terminal-card input{font-size:16px}}.terminal-card>div:first-child{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input:focus-visible{box-shadow:0 0 0 2px var(--accent-primary);outline:none}select{background-image:none}@supports (color:color(display-p3 1 1 1)){.signal-bar-active{background-color:var(--p3-color,inherit)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend/dist/assets/index-wYLFmyyS.js b/frontend/dist/assets/index-DrUSC4Ks.js similarity index 73% rename from frontend/dist/assets/index-wYLFmyyS.js rename to frontend/dist/assets/index-DrUSC4Ks.js index 09309232..45715677 100644 --- a/frontend/dist/assets/index-wYLFmyyS.js +++ b/frontend/dist/assets/index-DrUSC4Ks.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-D0VAcvfg.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/Dashboard-BIGBrxNX.js","assets/useThemeColors-DL9Pr7sC.js","assets/PageLayout-DAadOF4d.js","assets/PacketDetailModal-DU2ZzX69.js","assets/SignalIndicator-C1cW0knK.js","assets/HashBadge-CAy9V6Vn.js","assets/TimeRangeSelector-COrVm3Yj.js","assets/link-scoring-lk0Wk34S.js","assets/Grid-F2RfSVk7.js","assets/Packets-CuPG-YBS.js","assets/Contacts-B1sA0BbK.js","assets/CollisionExplorerModal-DdrurDtW.js","assets/ConfirmModal-B37DcPi-.js","assets/leaflet-CIGW-MKW.css","assets/Statistics-WWZtRE3M.js","assets/usePolling-ul9y_if7.js","assets/System-CPE03-m2.js","assets/Logs-Bj21D9nq.js","assets/Terminal-BmUaRX2Y.js","assets/Configuration-BkRSvuMT.js"])))=>i.map(i=>d[i]); -var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);import{r as s,j as n,c as a,u as o,X as i,M as r,L as l,d as c,e as u,C as d,G as h,F as f,S as p,f as m,g,h as y,i as b,k as x,l as w,m as k,n as v,o as S,p as C,q as T,b as M,t as _,v as L,N as j,w as E,B as P}from"./vendor-react-C0qkT9dV.js";import{_ as N}from"./deckgl-DTsmDcfs.js";import{c as D}from"./recharts-DRDKmvXb.js";import"./vendor-core-WoOfkQwm.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const s of e)if("childList"===s.type)for(const e of s.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const I={surfaces:{glass:{tint:"#252525",light:"#ffffff",dark:"#000000",reflexLight:.15,reflexDark:.8,blur:6,blurElevated:8,brightness:1,opacity:8,opacityElevated:12},card:{radius:"1.125rem",padding:"1.25rem",paddingCompact:"0.75rem"},sidebar:{tint:"rgba(113, 156, 223, 0.06)",width:"16rem",drawerWidth:"85vw"},modal:{radius:"1.125rem",backdropBlur:"8px",backdropColor:"rgba(0, 0, 0, 0.6)"}},colors:{bg:{body:"#171717",surface:"#252525",elevated:"#333233",subtle:"#3F3F3F"},border:{subtle:"#4B4B4B",strong:"#616161"},text:{primary:"#E1E1E1",secondary:"#BFBFBF",muted:"#727272",inverse:"#171717"},accent:{primary:"#719CDF",secondary:"#DFBC72",tertiary:"#6FBCBD",success:"#719872",danger:"#E12672"},signal:{excellent:"#00FF00",good:"#8CE619",fair:"#FFD900",poor:"#FF8C26",critical:"#FF3333",unknown:"#616161"},status:{success:"#719872",warning:"#DFBC72",danger:"#E12672",info:"#6FBCBD",muted:"#616161"},chart:{c1:"#719CDF",c2:"#0074BE",c3:"#6FBCBD",c4:"#DFBC72",c5:"#719872",c6:"#E12672",c7:"#E17899",c8:"#999ABD",grid:"rgba(255, 255, 255, 0.06)",axis:"rgba(255, 255, 255, 0.4)",cursor:"rgba(255, 255, 255, 0.2)"},metric:{received:"#719872",forwarded:"#0074BE",transmitted:"#DFBC72",dropped:"#E12672"},map:{nodeFill:"#F5F5F0",nodeStroke:"#4A5568",hub:"#8B7BAD",local:"#FBBF24",neighbor:"#FBBF24",mobile:"#F97316",room:"#E17899",edge:"#4B4B4B",edgeHover:"#6FBCBD"}},typography:{font:{title:"'Inter', system-ui, sans-serif",display:"'Inter', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},size:{xs:"0.64rem",sm:"0.8rem",base:"1rem",md:"1.125rem",lg:"1.25rem",xl:"1.563rem",xxl:"1.953rem",hero:"3.052rem"},weight:{normal:400,medium:500,semibold:600,bold:700},leading:{tight:1.1,snug:1.25,normal:1.5}},spacing:{space:{gap:"1.5rem",gapMobile:"0.75rem",page:"1.5rem",pageMobile:"1rem",section:"2rem"},radius:{sm:"0.5rem",md:"0.875rem",lg:"1.125rem",xl:"1.5rem",pill:"9999px"}},motion:{fast:"0.1s",normal:"0.15s",slow:"0.4s",easing:"ease-out"}};function F(e){const t=e.replace("#","");if(6!==t.length&&3!==t.length)return e;let s,n,a;return 3===t.length?(s=parseInt(t[0]+t[0],16)/255,n=parseInt(t[1]+t[1],16)/255,a=parseInt(t[2]+t[2],16)/255):(s=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255),`color(display-p3 ${s.toFixed(3)} ${n.toFixed(3)} ${a.toFixed(3)})`}function A(){return"undefined"!=typeof window&&CSS.supports("color","color(display-p3 1 1 1)")}function R(e){return A()?F(e):e}function z(e,t){const s={...e};for(const n of Object.keys(t)){const a=t[n],o=e[n];void 0!==a&&("object"!=typeof a||null===a||Array.isArray(a)||"object"!=typeof o||null===o||Array.isArray(o)?s[n]=a:s[n]=z(o,a))}return s}function O(e){return{meta:e.meta,display:e.display,surfaces:e.surfaces?z(I.surfaces,e.surfaces):I.surfaces,colors:e.colors?z(I.colors,e.colors):I.colors,typography:e.typography?z(I.typography,e.typography):I.typography,spacing:e.spacing?z(I.spacing,e.spacing):I.spacing,motion:e.motion?z(I.motion,e.motion):I.motion}}function B(e){const t=e.replace("#","");return 6===t.length?`${parseInt(t.slice(0,2),16)}, ${parseInt(t.slice(2,4),16)}, ${parseInt(t.slice(4,6),16)}`:"255, 255, 255"}function $(e){return{id:e.meta.id,colorScheme:{name:e.meta.name,dataTheme:e.meta.dataTheme,previewColor:e.meta.previewColor},background:{src:e.meta.backgroundImage,suggestedBrightness:e.meta.backgroundBrightness},display:{font:e.display.font,color:e.display.color,size:e.display.size,paletteColors:e.display.palette}}}const W=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#58b99d",backgroundImage:"",backgroundBrightness:100,isDark:!0},display:{font:"'JetBrains Mono', monospace",color:"#58b99d",size:1,palette:[["#58b99d","#4997ec","#60ce41","#e67b2f","#da3529"],["#242627","#818c8d","#925cb1","#5face4","#fcfcfc"]]},typography:{font:{title:"'JetBrains Mono', monospace",display:"'Noto Sans', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},weight:{normal:400,medium:500,semibold:600,bold:700}},surfaces:{glass:{tint:"#242627",light:"#4997ec",dark:"#000000",reflexLight:0,reflexDark:0,blur:0,blurElevated:0,brightness:1,opacity:95,opacityElevated:98},sidebar:{tint:"rgba(88, 185, 157, 0.04)"},card:{radius:"4px"},modal:{radius:"6px"}},colors:{bg:{body:"#1a1c1d",surface:"#242627",elevated:"#2e3133",subtle:"#383b3d"},border:{subtle:"#383b3d",strong:"#4a4e50"},text:{primary:"#fcfcfc",secondary:"#c8c8c8",muted:"#818c8d",inverse:"#242627"},accent:{primary:"#58b99d",secondary:"#e67b2f",tertiary:"#4997ec",success:"#60ce41",danger:"#da3529"},signal:{excellent:"#60ce41",good:"#67d99f",fair:"#e67b2f",poor:"#b14434",critical:"#da3529",unknown:"#818c8d"},status:{success:"#60ce41",warning:"#e67b2f",danger:"#da3529",info:"#58b99d",muted:"#818c8d"},chart:{c1:"#58b99d",c2:"#4997ec",c3:"#60ce41",c4:"#e67b2f",c5:"#da3529",c6:"#925cb1",c7:"#67d99f",c8:"#818c8d",grid:"rgba(252, 252, 252, 0.06)",axis:"rgba(252, 252, 252, 0.3)",cursor:"rgba(88, 185, 157, 0.2)"},metric:{received:"#58b99d",forwarded:"#4997ec",transmitted:"#e67b2f",dropped:"#da3529"},map:{nodeFill:"#fcfcfc",nodeStroke:"#4a4e50",hub:"#925cb1",local:"#58b99d",neighbor:"#58b99d",mobile:"#e67b2f",room:"#58b99d",edge:"#4a4e50",edgeHover:"#58b99d"}}}),H=W;$(W);const q=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#B39DF3",backgroundImage:"/assets/sand.jpg",backgroundBrightness:80,isDark:!0},display:{font:"'Rubik Mono One', monospace",color:"#4A4A52",size:.8,palette:[["#B49DFF","#F9D26F","#71F8E5","#39D98A","#FF5C7A"],["#4CFFB5","#FF8A5C","#A78BFA","#60A5FA","#F472B6"]]},typography:{font:{title:"'Rubik Mono One', monospace"}},surfaces:{glass:{tint:"#252525",blur:6,blurElevated:8},sidebar:{tint:"rgba(113, 156, 223, 0.06)"}}}),U=q;$(q);const J=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#fabd2f",backgroundImage:"/assets/magma.webp",backgroundBrightness:50,isDark:!0},display:{font:"'Jacquard 12', serif",color:"#fe8019",size:1.75,palette:[["#fabd2f","#fb4934","#8ec07c","#b8bb26","#d3869b"],["#fe8019","#83a598","#d65d0e","#928374","#ebdbb2"]]},typography:{font:{title:"'Jacquard 12', serif"},size:{xxl:"2.344rem"}},surfaces:{glass:{tint:"#282828"},sidebar:{tint:"rgba(250, 189, 47, 0.06)"}},colors:{accent:{primary:"#fabd2f",secondary:"#fb4934",tertiary:"#8ec07c",success:"#b8bb26",danger:"#fb4934"},signal:{excellent:"#b8bb26",good:"#8ec07c",fair:"#fabd2f",poor:"#fe8019",critical:"#fb4934",unknown:"#928374"},status:{success:"#b8bb26",warning:"#fabd2f",danger:"#fb4934",info:"#83a598",muted:"#928374"},chart:{c1:"#fabd2f",c2:"#fe8019",c3:"#fb4934",c4:"#d3869b",c5:"#b8bb26",c6:"#8ec07c",c7:"#83a598",c8:"#d65d0e",grid:"rgba(251, 241, 199, 0.06)",axis:"rgba(251, 241, 199, 0.4)",cursor:"rgba(251, 241, 199, 0.2)"},metric:{received:"#b8bb26",forwarded:"#83a598",transmitted:"#fabd2f",dropped:"#fb4934"},map:{nodeFill:"#fbf1c7",nodeStroke:"#504945",hub:"#b16286",local:"#fabd2f",neighbor:"#fabd2f",mobile:"#fe8019",room:"#d3869b",edge:"#665c54",edgeHover:"#8ec07c"}}}),G=J;$(J);const Y=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#83a598",backgroundImage:"/assets/water.webp",backgroundBrightness:40,isDark:!0},display:{font:"'Cantora One', sans-serif",color:"#83a598",size:1.25,palette:[["#83a598","#a89984","#8ec07c","#d79921","#b16286"],["#fe8019","#cc241d","#7c6f64","#bdae93","#ebdbb2"]]},typography:{font:{title:"'Cantora One', sans-serif"},size:{xxl:"2.148rem"},weight:{semibold:500}},surfaces:{glass:{tint:"#1e1e1e"},sidebar:{tint:"rgba(131, 165, 152, 0.06)"}},colors:{accent:{primary:"#83a598",secondary:"#a89984",tertiary:"#8ec07c",success:"#8ec07c",danger:"#cc241d"},signal:{excellent:"#8ec07c",good:"#b8bb26",fair:"#d79921",poor:"#fe8019",critical:"#cc241d",unknown:"#7c6f64"},status:{success:"#8ec07c",warning:"#d79921",danger:"#cc241d",info:"#83a598",muted:"#7c6f64"},chart:{c1:"#83a598",c2:"#8ec07c",c3:"#d79921",c4:"#b16286",c5:"#fe8019",c6:"#cc241d",c7:"#a89984",c8:"#7c6f64",grid:"rgba(213, 196, 161, 0.06)",axis:"rgba(213, 196, 161, 0.4)",cursor:"rgba(213, 196, 161, 0.2)"},metric:{received:"#8ec07c",forwarded:"#83a598",transmitted:"#d79921",dropped:"#cc241d"},map:{nodeFill:"#ebdbb2",nodeStroke:"#504945",hub:"#b16286",local:"#d79921",neighbor:"#d79921",mobile:"#fe8019",room:"#b16286",edge:"#504945",edgeHover:"#83a598"}}}),V=Y;$(Y);const K=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#33859d",backgroundImage:"/assets/stars.jpg",backgroundBrightness:100,isDark:!0},display:{font:"'IBM Plex Mono', monospace",color:"#c23127",size:1.25,palette:[["#33859d","#edb54b","#26a98b","#c23127","#888ca6"],["#195465","#d26939","#99d1ce","#4e5165","#0c1014"]]},typography:{font:{title:"'IBM Plex Mono', monospace"}},surfaces:{glass:{tint:"#0a0e14",blur:1,blurElevated:2},sidebar:{tint:"rgba(51, 133, 157, 0.06)"}},colors:{accent:{primary:"#33859d",secondary:"#edb54b",tertiary:"#26a98b",success:"#26a98b",danger:"#c33027"},signal:{excellent:"#26a98b",good:"#7ec07c",fair:"#edb54b",poor:"#d26939",critical:"#c33027",unknown:"#195465"},status:{success:"#26a98b",warning:"#edb54b",danger:"#c33027",info:"#599caa",muted:"#195465"},chart:{c1:"#33859d",c2:"#edb54b",c3:"#26a98b",c4:"#599caa",c5:"#d26939",c6:"#c33027",c7:"#888ba5",c8:"#195465",grid:"rgba(153, 209, 206, 0.06)",axis:"rgba(153, 209, 206, 0.4)",cursor:"rgba(153, 209, 206, 0.2)"},metric:{received:"#26a98b",forwarded:"#33859d",transmitted:"#edb54b",dropped:"#c33027"},map:{nodeFill:"#edf5f4",nodeStroke:"#195465",hub:"#888ba5",local:"#edb54b",neighbor:"#edb54b",mobile:"#d26939",room:"#888ba5",edge:"#245361",edgeHover:"#26a98b"}}}),X=K;$(K);const Q=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#9ed072",backgroundImage:"/assets/ribbons.webp",backgroundBrightness:75,isDark:!0},display:{font:"'Instrument Serif', serif",color:"#E2E2E3",size:1.4,palette:[["#9ed072","#fc5d7c","#76cce0","#e7c664","#b39df3"],["#f39660","#7f8490","#e2e2e3","#55575e","#2c2e34"]]},typography:{font:{title:"'Instrument Serif', Georgia, serif",display:"'Instrument Sans', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},size:{xxl:"3.25rem",xl:"2.5rem",lg:"1.875rem",md:"1.25rem"},weight:{normal:400,medium:500,semibold:600,bold:600}},surfaces:{glass:{tint:"#23212d"},sidebar:{tint:"rgba(158, 208, 114, 0.06)"}},colors:{accent:{primary:"#9ed072",secondary:"#e7c664",tertiary:"#76cce0",success:"#9ed072",danger:"#fc5d7c"},signal:{excellent:"#9ed072",good:"#c5d93d",fair:"#e7c664",poor:"#f39660",critical:"#fc5d7c",unknown:"#7f8490"},status:{success:"#9ed072",warning:"#e7c664",danger:"#fc5d7c",info:"#76cce0",muted:"#7f8490"},chart:{c1:"#9ed072",c2:"#fc5d7c",c3:"#e7c664",c4:"#76cce0",c5:"#b39df3",c6:"#f39660",c7:"#7f8490",c8:"#e2e2e3",grid:"rgba(226, 226, 227, 0.06)",axis:"rgba(226, 226, 227, 0.4)",cursor:"rgba(226, 226, 227, 0.2)"},metric:{received:"#9ed072",forwarded:"#76cce0",transmitted:"#e7c664",dropped:"#fc5d7c"},map:{nodeFill:"#e2e2e3",nodeStroke:"#33353f",hub:"#b39df3",local:"#e7c664",neighbor:"#e7c664",mobile:"#f39660",room:"#fc5d7c",edge:"#444751",edgeHover:"#76cce0"}}}),Z=Q;$(Q);const ee=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#7E9CD8",backgroundImage:"/assets/folds.webp",backgroundBrightness:50,isDark:!0},display:{font:"'Inter', sans-serif",color:"#7E9CD8",size:1.25,palette:[["#7E9CD8","#E46876","#7AA89F","#DCA561","#957FB8"],["#7FB4CA","#D27E99","#98BB6C","#727169","#1F1F28"]]},typography:{font:{title:"'Inter', sans-serif"}},surfaces:{glass:{tint:"#1F1F28"},sidebar:{tint:"rgba(126, 156, 216, 0.06)"}},colors:{accent:{primary:"#7E9CD8",secondary:"#E6C384",tertiary:"#7FB4CA",success:"#98BB6C",danger:"#E46876"},signal:{excellent:"#98BB6C",good:"#B8CC5C",fair:"#E6C384",poor:"#FFA066",critical:"#E46876",unknown:"#54546D"},status:{success:"#98BB6C",warning:"#E6C384",danger:"#E46876",info:"#7FB4CA",muted:"#727169"},chart:{c1:"#7E9CD8",c2:"#E6C384",c3:"#98BB6C",c4:"#957FB8",c5:"#7FB4CA",c6:"#E46876",c7:"#FFA066",c8:"#D27E99",grid:"rgba(220, 215, 186, 0.06)",axis:"rgba(220, 215, 186, 0.4)",cursor:"rgba(220, 215, 186, 0.2)"},metric:{received:"#98BB6C",forwarded:"#7E9CD8",transmitted:"#E6C384",dropped:"#E46876"},map:{nodeFill:"#DCD7BA",nodeStroke:"#363646",hub:"#957FB8",local:"#E6C384",neighbor:"#E6C384",mobile:"#FFA066",room:"#D27E99",edge:"#54546D",edgeHover:"#7AA89F"}}}),te=ee;$(ee);const se={"KDE Breeze":H,Magma:G,Folds:te,Ribbon:Z,BLKSAND:U,Waves:V,Stars:X};function ne(e,t){const s=e.toLowerCase();return{...t,meta:{...t.meta,id:s,name:e,dataTheme:s}}}const ae=Object.fromEntries(Object.entries(se).map(([e,t])=>[e,ne(e,t)])),oe=Object.fromEntries(Object.entries(ae).map(([e,t])=>[e,$(t)])),ie=Object.values(ae);function re(e){return ie.find(t=>t.meta.id===e)}new Map(Object.entries(ae));const le=Object.values(oe);new Map(Object.entries(oe));const ce=Object.entries(oe).map(([e,t])=>function(e,t){return{id:e.id,name:e.colorScheme.name,displayName:t,colorScheme:e.id,backgroundImage:e.background.src,paletteColors:e.display.paletteColors,displayFont:e.display.font,displayColor:e.display.color,displaySize:e.display.size}}(t,e)),ue=le.map(function(e){return{id:e.id,name:e.colorScheme.name,dataTheme:e.colorScheme.dataTheme,previewColor:e.colorScheme.previewColor}}),de=le.map(function(e){return{id:e.id,src:e.background.src,suggestedScheme:e.id,suggestedBrightness:e.background.suggestedBrightness}}),he=ae["KDE Breeze"];oe["KDE Breeze"];const fe=he.meta.id,pe=he.meta.backgroundImage,me=he.meta.backgroundBrightness,ge=ue,ye=de,be=ce,xe={colorScheme:fe,backgroundImage:pe,brightness:me},we="pymc-color-scheme",ke="pymc-background-image",ve="pymc-bg-brightness",Se="pymc-background";function Ce(e){(new Image).src=e}const Te={50:.97,100:.92,200:.84,300:.73,400:.62,500:.5,600:.4,700:.32,800:.24,900:.16},Me=[50,100,200,300,400,500,600,700,800,900],_e=["red","orange","yellow","green","aqua","blue","purple"];function Le(e,t,s){const n=e=>Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0");return`#${n(e)}${n(t)}${n(s)}`}function je(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ee(e){const t=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;return Math.round(255*t)}function Pe(e,t,s){const n=s*(Math.PI/180),a=t*Math.cos(n),o=t*Math.sin(n),i=e+.3963377774*a+.2158037573*o,r=e-.1055613458*a-.0638541728*o,l=e-.0894841775*a-1.291485548*o,c=i*i*i,u=r*r*r,d=l*l*l,h=-1.2684380046*c+2.6097574011*u-.3413193965*d,f=-.0041960863*c-.7034186147*u+1.707614701*d;return[Ee(4.0767416621*c-3.3077115913*u+.2309699292*d),Ee(h),Ee(f)]}function Ne(e){const[t,s,n]=function(e){const t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}(e),[,a,o]=function(e,t,s){const n=je(e),a=je(t),o=je(s),i=.4122214708*n+.5363325363*a+.0514459929*o,r=.2119034982*n+.6806995451*a+.1073969566*o,l=.0883024619*n+.2817188376*a+.6299787005*o,c=Math.cbrt(i),u=Math.cbrt(r),d=Math.cbrt(l),h=.2104542553*c+.793617785*u-.0040720468*d,f=1.9779984951*c-2.428592205*u+.4505937099*d,p=.0259040371*c+.7827717662*u-.808675766*d,m=Math.sqrt(f*f+p*p);let g=Math.atan2(p,f)*(180/Math.PI);return g<0&&(g+=360),[h,m,g]}(t,s,n),i={};for(const r of Me){const e=Te[r],t=a*(1-.3*Math.abs(e-.5)),[s,n,l]=Pe(e,t,o);i[r]=Le(s,n,l)}return i}function De(e){return"undefined"==typeof window?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function Ie(e,t){"undefined"!=typeof document&&document.documentElement.style.setProperty(e,t)}const Fe="u-off",Ae="u-label",Re="width",ze="height",Oe="top",Be="bottom",$e="left",We="right",He="#000",qe=He+"0",Ue="mousemove",Je="mousedown",Ge="mouseup",Ye="mouseenter",Ve="mouseleave",Ke="dblclick",Xe="change",Qe="dppxchange",Ze="--",et="undefined"!=typeof window,tt=et?document:null,st=et?window:null,nt=et?navigator:null;let at,ot;function it(e,t){if(null!=t){let s=e.classList;!s.contains(t)&&s.add(t)}}function rt(e,t){let s=e.classList;s.contains(t)&&s.remove(t)}function lt(e,t,s){e.style[t]=s+"px"}function ct(e,t,s,n){let a=tt.createElement(e);return null!=t&&it(a,t),null!=s&&s.insertBefore(a,n),a}function ut(e,t){return ct("div",e,t)}const dt=new WeakMap;function ht(e,t,s,n,a){let o="translate("+t+"px,"+s+"px)";o!=dt.get(e)&&(e.style.transform=o,dt.set(e,o),t<0||s<0||t>n||s>a?it(e,Fe):rt(e,Fe))}const ft=new WeakMap;function pt(e,t,s){let n=t+s;n!=ft.get(e)&&(ft.set(e,n),e.style.background=t,e.style.borderColor=s)}const mt=new WeakMap;function gt(e,t,s,n){let a=t+""+s;a!=mt.get(e)&&(mt.set(e,a),e.style.height=s+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-s/2+"px":0)}const yt={passive:!0},bt={...yt,capture:!0};function xt(e,t,s,n){t.addEventListener(e,s,n?bt:yt)}function wt(e,t,s,n){t.removeEventListener(e,s,yt)}function kt(e,t,s,n){let a;s=s||0;let o=(n=n||t.length-1)<=2147483647;for(;n-s>1;)a=o?s+n>>1:Bt((s+n)/2),t[a]{let a=-1,o=-1;for(let i=s;i<=n;i++)if(e(t[i])){a=i;break}for(let i=n;i>=s;i--)if(e(t[i])){o=i;break}return[a,o]}}et&&function e(){let t=devicePixelRatio;at!=t&&(at=t,ot&&wt(Xe,ot,e),ot=matchMedia(`(min-resolution: ${at-.001}dppx) and (max-resolution: ${at+.001}dppx)`),xt(Xe,ot,e),st.dispatchEvent(new CustomEvent(Qe)))}();const St=e=>null!=e,Ct=e=>null!=e&&e>0,Tt=vt(St),Mt=vt(Ct);function _t(e,t,s,n){let a=Jt(e),o=Jt(t);e==t&&(-1==a?(e*=s,t/=s):(e/=s,t*=s));let i=10==s?Gt:Yt,r=1==o?Wt:Bt,l=(1==a?Bt:Wt)(i(Ot(e))),c=r(i(Ot(t))),u=Ut(s,l),d=Ut(s,c);return 10==s&&(l<0&&(u=ds(u,-l)),c<0&&(d=ds(d,-c))),n||2==s?(e=u*a,t=d*o):(e=us(e,u),t=cs(t,d)),[e,t]}function Lt(e,t,s,n){let a=_t(e,t,s,n);return 0==e&&(a[0]=0),0==t&&(a[1]=0),a}const jt={mode:3,pad:.1},Et={pad:0,soft:null,mode:0},Pt={min:Et,max:Et};function Nt(e,t,s,n){return ks(s)?It(e,t,s):(Et.pad=s,Et.soft=n?0:null,Et.mode=n?3:0,It(e,t,Pt))}function Dt(e,t){return null==e?t:e}function It(e,t,s){let n=s.min,a=s.max,o=Dt(n.pad,0),i=Dt(a.pad,0),r=Dt(n.hard,-Kt),l=Dt(a.hard,Kt),c=Dt(n.soft,Kt),u=Dt(a.soft,-Kt),d=Dt(n.mode,0),h=Dt(a.mode,0),f=t-e,p=Gt(f),m=qt(Ot(e),Ot(t)),g=Gt(m),y=Ot(g-p);(f<1e-24||y>10)&&(f=0,0!=e&&0!=t||(f=1e-24,2==d&&c!=Kt&&(o=0),2==h&&u!=-Kt&&(i=0)));let b=f||m||1e3,x=Gt(b),w=Ut(10,Bt(x)),k=ds(us(e-b*(0==f?0==e?.1:1:o),w/10),24),v=e>=c&&(1==d||3==d&&k<=c||2==d&&k>=c)?c:Kt,S=qt(r,k=v?v:Ht(v,k)),C=ds(cs(t+b*(0==f?0==t?.1:1:i),w/10),24),T=t<=u&&(1==h||3==h&&C>=u||2==h&&C<=u)?u:-Kt,M=Ht(l,C>T&&t<=T?T:qt(T,C));return S==M&&0==S&&(M=100),[S,M]}const Ft=new Intl.NumberFormat(et?nt.language:"en-US"),At=e=>Ft.format(e),Rt=Math,zt=Rt.PI,Ot=Rt.abs,Bt=Rt.floor,$t=Rt.round,Wt=Rt.ceil,Ht=Rt.min,qt=Rt.max,Ut=Rt.pow,Jt=Rt.sign,Gt=Rt.log10,Yt=Rt.log2,Vt=(e,t=1)=>Rt.asinh(e/t),Kt=1/0;function Xt(e){return 1+(0|Gt((e^e>>31)-(e>>31)))}function Qt(e,t,s){return Ht(qt(e,t),s)}function Zt(e){return"function"==typeof e}function es(e){return Zt(e)?e:()=>e}const ts=e=>e,ss=(e,t)=>t,ns=e=>null,as=e=>!0,os=(e,t)=>e==t,is=/\.\d*?(?=9{6,}|0{6,})/gm,rs=e=>{if(xs(e)||hs.has(e))return e;const t=`${e}`,s=t.match(is);if(null==s)return e;let n=s[0].length-1;if(-1!=t.indexOf("e-")){let[e,s]=t.split("e");return+`${rs(e)}e${s}`}return ds(e,n)};function ls(e,t){return rs(ds(rs(e/t))*t)}function cs(e,t){return rs(Wt(rs(e/t))*t)}function us(e,t){return rs(Bt(rs(e/t))*t)}function ds(e,t=0){if(xs(e))return e;let s=10**t,n=e*s*(1+Number.EPSILON);return $t(n)/s}const hs=new Map;function fs(e){return((""+e).split(".")[1]||"").length}function ps(e,t,s,n){let a=[],o=n.map(fs);for(let i=t;i=0?0:t)+(i>=o[r]?0:o[r]),u=10==e?l:ds(l,c);a.push(u),hs.set(u,c)}}return a}const ms={},gs=[],ys=[null,null],bs=Array.isArray,xs=Number.isInteger;function ws(e){return"string"==typeof e}function ks(e){let t=!1;if(null!=e){let s=e.constructor;t=null==s||s==Object}return t}function vs(e){return null!=e&&"object"==typeof e}const Ss=Object.getPrototypeOf(Uint8Array),Cs="__proto__";function Ts(e,t=ks){let s;if(bs(e)){let n=e.find(e=>null!=e);if(bs(n)||t(n)){s=Array(e.length);for(let n=0;no){for(n=i-1;n>=0&&null==e[n];)e[n--]=null;for(n=i+1;nPromise.resolve().then(e):queueMicrotask,js=["January","February","March","April","May","June","July","August","September","October","November","December"],Es=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ps(e){return e.slice(0,3)}const Ns=Es.map(Ps),Ds=js.map(Ps),Is={MMMM:js,MMM:Ds,WWWW:Es,WWW:Ns};function Fs(e){return(e<10?"0":"")+e}const As={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Fs(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Fs(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Fs(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Fs(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Fs(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Rs(e,t){t=t||Is;let s,n=[],a=/\{([a-z]+)\}|[^{]+/gi;for(;s=a.exec(e);)n.push("{"==s[0][0]?As[s[1]]:s[0]);return e=>{let s="";for(let a=0;ae%1==0,Bs=[1,2,2.5,5],$s=ps(10,-32,0,Bs),Ws=ps(10,0,32,Bs),Hs=Ws.filter(Os),qs=$s.concat(Ws),Us="{YYYY}",Js="\n"+Us,Gs="{M}/{D}",Ys="\n"+Gs,Vs=Ys+"/{YY}",Ks="{aa}",Xs="{h}:{mm}"+Ks,Qs="\n"+Xs,Zs=":{ss}",en=null;function tn(e){let t=1e3*e,s=60*t,n=60*s,a=24*n,o=30*a,i=365*a;return[(1==e?ps(10,0,3,Bs).filter(Os):ps(10,-3,0,Bs)).concat([t,5*t,10*t,15*t,30*t,s,5*s,10*s,15*s,30*s,n,2*n,3*n,4*n,6*n,8*n,12*n,a,2*a,3*a,4*a,5*a,6*a,7*a,8*a,9*a,10*a,15*a,o,2*o,3*o,4*o,6*o,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,Us,en,en,en,en,en,en,1],[28*a,"{MMM}",Js,en,en,en,en,en,1],[a,Gs,Js,en,en,en,en,en,1],[n,"{h}"+Ks,Vs,en,Ys,en,en,en,1],[s,Xs,Vs,en,Ys,en,en,en,1],[t,Zs,Vs+" "+Xs,en,Ys+" "+Xs,en,Qs,en,1],[e,Zs+".{fff}",Vs+" "+Xs,en,Ys+" "+Xs,en,Qs,en,1]],function(t){return(r,l,c,u,d,h)=>{let f=[],p=d>=i,m=d>=o&&d=a?a:d,i=x+(Bt(c)-Bt(y))+cs(y-x,o);f.push(i);let p=t(i),m=p.getHours()+p.getMinutes()/s+p.getSeconds()/n,g=d/n,b=h/r.axes[l]._space;for(;i=ds(i+d,1==e?0:3),!(i>u);)if(g>1){let e=Bt(ds(m+g,6))%24,s=t(i).getHours()-e;s>1&&(s=-1),i-=s*n,m=(m+g)%24,ds((i-f[f.length-1])/d,3)*b>=.7&&f.push(i)}else f.push(i)}return f}}]}const[sn,nn,an]=tn(1),[on,rn,ln]=tn(.001);function cn(e,t){return e.map(e=>e.map((s,n)=>0==n||8==n||null==s?s:t(1==n||0==e[8]?s:e[1]+s)))}function un(e,t){return(s,n,a,o,i)=>{let r,l,c,u,d,h,f=t.find(e=>i>=e[0])||t[t.length-1];return n.map(t=>{let s=e(t),n=s.getFullYear(),a=s.getMonth(),o=s.getDate(),i=s.getHours(),p=s.getMinutes(),m=s.getSeconds(),g=n!=r&&f[2]||a!=l&&f[3]||o!=c&&f[4]||i!=u&&f[5]||p!=d&&f[6]||m!=h&&f[7]||f[1];return r=n,l=a,c=o,u=i,d=p,h=m,g(s)})}}function dn(e,t,s){return new Date(e,t,s)}function hn(e,t){return t(e)}function fn(e,t){return(s,n,a,o)=>null==o?Ze:t(e(n))}ps(2,-53,53,[1]);const pn={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let s=e.series[t];return s.width?s.stroke(e,t):s.points.width?s.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},mn=[0,0];function gn(e,t,s,n=!0){return e=>{0==e.button&&(!n||e.target==t)&&s(e)}}function yn(e,t,s,n=!0){return e=>{(!n||e.target==t)&&s(e)}}const bn={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,s){return mn[0]=t,mn[1]=s,mn},points:{one:!1,show:function(e,t){let s=e.cursor.points,n=ut(),a=s.size(e,t);lt(n,Re,a),lt(n,ze,a);let o=a/-2;lt(n,"marginLeft",o),lt(n,"marginTop",o);let i=s.width(e,t,a);return i&<(n,"borderWidth",i),n},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let s=e.series[t].points;return s._stroke||s._fill},fill:function(e,t){let s=e.series[t].points;return s._fill||s._stroke}},bind:{mousedown:gn,mouseup:gn,click:gn,dblclick:gn,mousemove:yn,mouseleave:yn,mouseenter:yn},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,s,n,a)=>n-a,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},xn={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},wn=Ms({},xn,{filter:ss}),kn=Ms({},wn,{size:10}),vn=Ms({},xn,{show:!1}),Sn='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Cn="bold "+Sn,Tn={show:!0,scale:"x",stroke:He,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Cn,side:2,grid:wn,ticks:kn,border:vn,font:Sn,lineGap:1.5,rotate:0},Mn={show:!0,scale:"x",auto:!1,sorted:1,min:Kt,max:-Kt,idxs:[]};function _n(e,t,s,n,a){return t.map(e=>null==e?"":At(e))}function Ln(e,t,s,n,a,o,i){let r=[],l=hs.get(a)||0;for(let c=s=i?s:ds(cs(s,a),l);c<=n;c=ds(c+a,l))r.push(Object.is(c,-0)?0:c);return r}function jn(e,t,s,n,a,o,i){const r=[],l=e.scales[e.axes[t].scale].log,c=Bt((10==l?Gt:Yt)(s));a=Ut(l,c),10==l&&(a=qs[kt(a,qs)]);let u=s,d=a*l;10==l&&(d=qs[kt(d,qs)]);do{r.push(u),u+=a,10!=l||hs.has(u)||(u=ds(u,hs.get(a))),u>=d&&(d=(a=u)*l,10==l&&(d=qs[kt(d,qs)]))}while(u<=n);return r}function En(e,t,s,n,a,o,i){let r=e.scales[e.axes[t].scale].asinh,l=n>r?jn(e,t,qt(r,s),n,a):[r],c=n>=0&&s<=0?[0]:[];return(s<-r?jn(e,t,qt(r,-n),-s,a):[r]).reverse().map(e=>-e).concat(c,l)}const Pn=/./,Nn=/[12357]/,Dn=/[125]/,In=/1/,Fn=(e,t,s,n)=>e.map((e,a)=>4==t&&0==e||a%n==0&&s.test(e.toExponential()[e<0?1:0])?e:null);function An(e,t,s,n,a){let o=e.axes[s],i=o.scale,r=e.scales[i],l=e.valToPos,c=o._space,u=l(10,i),d=l(9,i)-u>=c?Pn:l(7,i)-u>=c?Nn:l(5,i)-u>=c?Dn:In;if(d==In){let e=Ot(l(1,i)-u);if(ea,Wn={show:!0,auto:!0,sorted:0,gaps:$n,alpha:1,facets:[Ms({},Bn,{scale:"x"}),Ms({},Bn,{scale:"y"})]},Hn={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:$n,alpha:1,points:{show:function(e,t){let{scale:s,idxs:n}=e.series[0],a=e._data[0],o=e.valToPos(a[n[0]],s,!0),i=e.valToPos(a[n[1]],s,!0),r=Ot(i-o)/(e.series[t].points.space*at);return n[1]-n[0]<=r},filter:null},values:null,min:Kt,max:-Kt,idxs:[],path:null,clip:null};function qn(e,t,s,n,a){return s/10}const Un={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Jn=Ms({},Un,{time:!1,ori:1}),Gn={};function Yn(e,t){let s=Gn[e];return s||(s={key:e,plots:[],sub(e){s.plots.push(e)},unsub(e){s.plots=s.plots.filter(t=>t!=e)},pub(e,t,n,a,o,i,r){for(let l=0;l{let m=e.pxRound;const g=r.dir*(0==r.ori?1:-1),y=0==r.ori?oa:ia;let b,x;1==g?(b=s,x=n):(b=n,x=s);let w=m(c(t[b],r,f,d)),k=m(u(i[b],l,p,h)),v=m(c(t[x],r,f,d)),S=m(u(1==o?l.max:l.min,l,p,h)),C=new Path2D(a);return y(C,v,S),y(C,w,S),y(C,w,k),C})}function Zn(e,t,s,n,a,o){let i=null;if(e.length>0){i=new Path2D;const r=0==t?ra:la;let l=s;for(let t=0;ts[0]){let e=s[0]-l;e>0&&r(i,l,n,e,n+o),l=s[1]}}let c=s+a-l,u=10;c>0&&r(i,l,n-u/2,c,n+o+u)}return i}function ea(e,t,s,n,a,o,i){let r=[],l=e.length;for(let c=1==a?s:n;c>=s&&c<=n;c+=a)if(null===t[c]){let u=c,d=c;if(1==a)for(;++c<=n&&null===t[c];)d=c;else for(;--c>=s&&null===t[c];)d=c;let h=o(e[u]),f=d==u?h:o(e[d]),p=u-a;h=i<=0&&p>=0&&p=0&&m>=0&&m=h&&r.push([h,f])}return r}function ta(e){return 0==e?ts:1==e?$t:t=>ls(t,e)}function sa(e){let t=0==e?na:aa,s=0==e?(e,t,s,n,a,o)=>{e.arcTo(t,s,n,a,o)}:(e,t,s,n,a,o)=>{e.arcTo(s,t,a,n,o)},n=0==e?(e,t,s,n,a)=>{e.rect(t,s,n,a)}:(e,t,s,n,a)=>{e.rect(s,t,a,n)};return(e,a,o,i,r,l=0,c=0)=>{0==l&&0==c?n(e,a,o,i,r):(l=Ht(l,i/2,r/2),c=Ht(c,i/2,r/2),t(e,a+l,o),s(e,a+i,o,a+i,o+r,l),s(e,a+i,o+r,a,o+r,c),s(e,a,o+r,a,o,c),s(e,a,o,a+i,o,l),e.closePath())}}const na=(e,t,s)=>{e.moveTo(t,s)},aa=(e,t,s)=>{e.moveTo(s,t)},oa=(e,t,s)=>{e.lineTo(t,s)},ia=(e,t,s)=>{e.lineTo(s,t)},ra=sa(0),la=sa(1),ca=(e,t,s,n,a,o)=>{e.arc(t,s,n,a,o)},ua=(e,t,s,n,a,o)=>{e.arc(s,t,n,a,o)},da=(e,t,s,n,a,o,i)=>{e.bezierCurveTo(t,s,n,a,o,i)},ha=(e,t,s,n,a,o,i)=>{e.bezierCurveTo(s,t,a,n,i,o)};function fa(e){return(e,t,s,n,a)=>Vn(e,t,(t,o,i,r,l,c,u,d,h,f,p)=>{let m,g,{pxRound:y,points:b}=t;0==r.ori?(m=na,g=ca):(m=aa,g=ua);const x=ds(b.width*at,3);let w=(b.size-b.width)/2*at,k=ds(2*w,3),v=new Path2D,S=new Path2D,{left:C,top:T,width:M,height:_}=e.bbox;ra(S,C-k,T-k,M+2*k,_+2*k);const L=e=>{if(null!=i[e]){let t=y(c(o[e],r,f,d)),s=y(u(i[e],l,p,h));m(v,t+w,s),g(v,t,s,w,0,2*zt)}};if(a)a.forEach(L);else for(let e=s;e<=n;e++)L(e);return{stroke:x>0?v:null,fill:v,clip:S,flags:3}})}function pa(e){return(t,s,n,a,o,i)=>{n!=a&&(o!=n&&i!=n&&e(t,s,n),o!=a&&i!=a&&e(t,s,a),e(t,s,i))}}const ma=pa(oa),ga=pa(ia);function ya(e){const t=Dt(null==e?void 0:e.alignGaps,0);return(e,s,n,a)=>Vn(e,s,(o,i,r,l,c,u,d,h,f,p,m)=>{[n,a]=Tt(r,n,a);let g,y,b=o.pxRound,x=e=>b(u(e,l,p,h)),w=e=>b(d(e,c,m,f));0==l.ori?(g=oa,y=ma):(g=ia,y=ga);const k=l.dir*(0==l.ori?1:-1),v={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},S=v.stroke;let C=!1;if(a-n>=4*p){let t,s,o,c=t=>e.posToVal(t,l.key,!0),u=null,d=null,h=x(i[1==k?n:a]),f=x(i[n]),p=x(i[a]),m=c(1==k?f+1:p-1);for(let e=1==k?n:a;e>=n&&e<=a;e+=k){let n=i[e],a=(1==k?nm)?h:x(n),o=r[e];a==h?null!=o?(s=o,null==u?(g(S,a,w(s)),t=u=d=s):sd&&(d=s)):null===o&&(C=!0):(null!=u&&y(S,h,w(u),w(d),w(t),w(s)),null!=o?(s=o,g(S,a,w(s)),u=d=t=s):(u=d=null,null===o&&(C=!0)),h=a,m=c(h+k))}null!=u&&u!=d&&o!=h&&y(S,h,w(u),w(d),w(t),w(s))}else for(let e=1==k?n:a;e>=n&&e<=a;e+=k){let t=r[e];null===t?C=!0:null!=t&&g(S,x(i[e]),w(t))}let[T,M]=Kn(e,s);if(null!=o.fill||0!=T){let t=v.fill=new Path2D(S),r=w(o.fillTo(e,s,o.min,o.max,T)),l=x(i[n]),c=x(i[a]);-1==k&&([c,l]=[l,c]),g(t,c,r),g(t,l,r)}if(!o.spanGaps){let c=[];C&&c.push(...ea(i,r,n,a,k,x,t)),v.gaps=c=o.gaps(e,s,n,a,c),v.clip=Zn(c,l.ori,h,f,p,m)}return 0!=M&&(v.band=2==M?[Qn(e,s,n,a,S,-1),Qn(e,s,n,a,S,1)]:Qn(e,s,n,a,S,M)),v})}function ba(e,t,s,n,a,o,i=Kt){if(e.length>1){let r=null;for(let l=0,c=1/0;l0!=n[e]>0?s[e]=0:(s[e]=3*(l[e-1]+l[e])/((2*l[e]+l[e-1])/n[e-1]+(l[e]+2*l[e-1])/n[e]),isFinite(s[e])||(s[e]=0));s[i-1]=n[i-2];for(let c=0;c{Fa.pxRatio=at}));const va=ya(),Sa=fa();function Ca(e,t,s,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((e,n)=>Ta(e,n,t,s))}function Ta(e,t,s,n){return Ms({},0==t?s:n,e)}function Ma(e,t,s){return null==t?ys:[t,s]}const _a=Ma;function La(e,t,s){return null==t?ys:Nt(t,s,.1,!0)}function ja(e,t,s,n){return null==t?ys:_t(t,s,e.scales[n].log,!1)}const Ea=ja;function Pa(e,t,s,n){return null==t?ys:Lt(t,s,e.scales[n].log,!1)}const Na=Pa;function Da(e){let t,s;return[e=e.replace(/(\d+)px/,(e,n)=>(t=$t((s=+n)*at))+"px"),t,s]}function Ia(e){e.show&&[e.font,e.labelFont].forEach(e=>{let t=ds(e[2]*at,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t})}function Fa(e,t,s){const n={mode:Dt(e.mode,1)},a=n.mode;function o(e,t,s,n){let a=t.valToPct(e);return n+s*(-1==t.dir?1-a:a)}function i(e,t,s,n){let a=t.valToPct(e);return n+s*(-1==t.dir?a:1-a)}function r(e,t,s,n){return 0==t.ori?o(e,t,s,n):i(e,t,s,n)}n.valToPosH=o,n.valToPosV=i;let l=!1;n.status=0;const c=n.root=ut("uplot");null!=e.id&&(c.id=e.id),it(c,e.class),e.title&&(ut("u-title",c).textContent=e.title);const u=ct("canvas"),d=n.ctx=u.getContext("2d"),h=ut("u-wrap",c);xt("click",h,e=>{e.target===p&&(Qs!=Ys||Zs!=Vs)&&kn.click(n,e)},!0);const f=n.under=ut("u-under",h);h.appendChild(u);const p=n.over=ut("u-over",h),m=+Dt((e=Ts(e)).pxAlign,1),g=ta(m);(e.plugins||[]).forEach(t=>{t.opts&&(e=t.opts(n,e)||e)});const y=e.ms||.001,b=n.series=1==a?Ca(e.series||[],Mn,Hn,!1):(x=e.series||[null],w=Wn,x.map((e,t)=>0==t?{}:Ms({},w,e)));var x,w;const k=n.axes=Ca(e.axes||[],Tn,On,!0),v=n.scales={},S=n.bands=e.bands||[];S.forEach(e=>{e.fill=es(e.fill||null),e.dir=Dt(e.dir,-1)});const C=2==a?b[1].facets[0].scale:b[0].scale,T={axes:function(){for(let e=0;ers[e]):y,x=2==f.distr?rs[y[1]]-rs[y[0]]:u,w=t.ticks,S=t.border,C=w.show?w.size:0,T=$t(C*at),M=$t((2==t.alignTo?t._size-C-t.gap:t.gap)*at),_=t._rotate*-zt/180,L=g(t._pos*at),j=L+(T+M)*c;a=0==i?j:0,s=1==i?j:0,Ss(t.font[0],l,1==t.align?$e:2==t.align?We:_>0?$e:_<0?We:0==i?"center":3==o?We:$e,_||1==i?"middle":2==o?Oe:Be);let E=t.font[1]*t.lineGap,P=y.map(e=>g(r(e,f,p,m))),N=t._values;for(let e=0;e0){let e=b.some(e=>e._focus)&&is!=Ee.alpha;e&&(d.globalAlpha=is=Ee.alpha),b.forEach((e,s)=>{if(s>0&&e.show&&(js(s,!1),js(s,!0),null==e._paths)){let o=is;is!=e.alpha&&(d.globalAlpha=is=e.alpha);let i=2==a?[0,t[s][0].length-1]:function(e){let t=Qt(yt-1,0,mt-1),s=Qt(bt+1,0,mt-1);for(;null==e[t]&&t>0;)t--;for(;null==e[s]&&s{if(t>0&&e.show){let s=is;is!=e.alpha&&(d.globalAlpha=is=e.alpha),null!=e._paths&&Es(t,!1);{let s=null!=e._paths?e._paths.gaps:null,a=e.points.show(n,t,yt,bt,s),o=e.points.filter(n,t,a,s);(a||o)&&(e.points._paths=e.points.paths(n,t,yt,bt,o),Es(t,!0))}is!=s&&(d.globalAlpha=is=s),Fa("drawSeries",t)}}),e&&(d.globalAlpha=is=1)}}},M=(e.drawOrder||["axes","series"]).map(e=>T[e]);function _(e){const t=3==e.distr?t=>Gt(t>0?t:e.clamp(n,t,e.min,e.max,e.key)):4==e.distr?t=>Vt(t,e.asinh):100==e.distr?t=>e.fwd(t):e=>e;return s=>{let n=t(s),{_min:a,_max:o}=e;return(n-a)/(o-a)}}function L(t){let s=v[t];if(null==s){let n=(e.scales||ms)[t]||ms;if(null!=n.from){L(n.from);let e=Ms({},v[n.from],n,{key:t});e.valToPct=_(e),v[t]=e}else{s=v[t]=Ms({},t==C?Un:Jn,n),s.key=t;let e=s.time,o=s.range,i=bs(o);if((t!=C||2==a&&!e)&&(!i||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?jt:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?jt:{mode:1,hard:o[1],soft:o[1]}},i=!1),!i&&ks(o))){let e=o;o=(t,s,n)=>null==s?ys:Nt(s,n,e)}s.range=es(o||(e?_a:t==C?3==s.distr?Ea:4==s.distr?Na:Ma:3==s.distr?ja:4==s.distr?Pa:La)),s.auto=es(!i&&s.auto),s.clamp=es(s.clamp||qn),s._min=s._max=null,s.valToPct=_(s)}}}L("x"),L("y"),1==a&&b.forEach(e=>{L(e.scale)}),k.forEach(e=>{L(e.scale)});for(let Fe in e.scales)L(Fe);const j=v[C],E=j.distr;let P,N;0==j.ori?(it(c,"u-hz"),P=o,N=i):(it(c,"u-vt"),P=i,N=o);const D={};for(let Fe in v){let e=v[Fe];null==e.min&&null==e.max||(D[Fe]={min:e.min,max:e.max},e.min=e.max=null)}const I=e.tzDate||(e=>new Date($t(e/y))),F=e.fmtDate||Rs,A=1==y?an(I):ln(I),R=un(I,cn(1==y?nn:rn,F)),z=fn(I,hn("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",F)),O=[],B=n.legend=Ms({},pn,e.legend),$=n.cursor=Ms({},bn,{drag:{y:2==a}},e.cursor),W=B.show,H=$.show,q=B.markers;let U,J,G;B.idxs=O,q.width=es(q.width),q.dash=es(q.dash),q.stroke=es(q.stroke),q.fill=es(q.fill);let Y,V=[],K=[],X=!1,Q={};if(B.live){const e=b[1]?b[1].values:null;X=null!=e,Y=X?e(n,1,0):{_:0};for(let t in Y)Q[t]=Ze}if(W)if(U=ct("table","u-legend",c),G=ct("tbody",null,U),B.mount(n,U),X){J=ct("thead",null,U,G);let e=ct("tr",null,J);for(var Z in ct("th",null,e),Y)ct("th",Ae,e).textContent=Z}else it(U,"u-inline"),B.live&&it(U,"u-live");const ee={show:!0},te={show:!1},se=new Map;function ne(e,t,s,a=!0){const o=se.get(t)||{},i=$.bind[e](n,t,s,a);i&&(xt(e,t,o[e]=i),se.set(t,o))}function ae(e,t,s){const n=se.get(t)||{};for(let a in n)null!=e&&a!=e||(wt(a,t,n[a]),delete n[a]);null==e&&se.delete(t)}let oe=0,ie=0,re=0,le=0,ce=0,ue=0,de=ce,he=ue,fe=re,pe=le,me=0,ge=0,ye=0,be=0;n.bbox={};let xe=!1,we=!1,ke=!1,ve=!1,Se=!1,Ce=!1;function Te(e,t,s){(s||e!=n.width||t!=n.height)&&Me(e,t),Os(!1),ke=!0,we=!0,gn()}function Me(e,t){n.width=oe=re=e,n.height=ie=le=t,ce=ue=0,function(){let e=!1,t=!1,s=!1,n=!1;k.forEach((a,o)=>{if(a.show&&a._show){let{side:o,_size:i}=a,r=o%2,l=i+(null!=a.label?a.labelSize:0);l>0&&(r?(re-=l,3==o?(ce+=l,n=!0):s=!0):(le-=l,0==o?(ue+=l,e=!0):t=!0))}}),nt[0]=e,nt[1]=s,nt[2]=t,nt[3]=n,re-=ft[1]+ft[3],ce+=ft[3],le-=ft[2]+ft[0],ue+=ft[0]}(),function(){let e=ce+re,t=ue+le,s=ce,n=ue;function a(a,o){switch(a){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return s-=o,s+o;case 0:return n-=o,n+o}}k.forEach((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=a(t,e._size),null!=e.label&&(e._lpos=a(t,e.labelSize))}})}();let s=n.bbox;me=s.left=ls(ce*at,.5),ge=s.top=ls(ue*at,.5),ye=s.width=ls(re*at,.5),be=s.height=ls(le*at,.5)}const _e=3;if(n.setSize=function({width:e,height:t}){Te(e,t)},null==$.dataIdx){let e=$.hover,s=e.skip=new Set(e.skip??[]);s.add(void 0);let n=e.prox=es(e.prox),a=e.bias??(e.bias=0);$.dataIdx=(e,o,i,r)=>{if(0==o)return i;let l=i,c=n(e,o,i,r)??Kt,u=c>=0&&c0;)s.has(p[e])||(t=e);if(0==a||1==a)for(e=i;null==n&&e++c&&(l=null);return l}}const Le=e=>{$.event=e};$.idxs=O,$._lock=!1;let je=$.points;je.show=es(je.show),je.size=es(je.size),je.stroke=es(je.stroke),je.width=es(je.width),je.fill=es(je.fill);const Ee=n.focus=Ms({},e.focus||{alpha:.3},$.focus),Pe=Ee.prox>=0,Ne=Pe&&je.one;let De=[],Ie=[],He=[];function Xe(e,t){let s=je.show(n,t);if(s instanceof HTMLElement)return it(s,"u-cursor-pt"),it(s,e.class),ht(s,-10,-10,re,le),p.insertBefore(s,De[t]),s}function et(e,t){if(1==a||t>0){let t=1==a&&v[e.scale].time,s=e.value;e.value=t?ws(s)?fn(I,hn(s,F)):s||z:s||zn,e.label=e.label||(t?"Time":"Value")}if(Ne||t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||va||ns,e.fillTo=es(e.fillTo||Xn),e.pxAlign=+Dt(e.pxAlign,m),e.pxRound=ta(e.pxAlign),e.stroke=es(e.stroke||null),e.fill=es(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=ds(1*(3+2*(qt(1,e.width)||1)),3),s=e.points=Ms({},{size:t,width:qt(1,.2*t),stroke:e.stroke,space:2*t,paths:Sa,_stroke:null,_fill:null},e.points);s.show=es(s.show),s.filter=es(s.filter),s.fill=es(s.fill),s.stroke=es(s.stroke),s.paths=es(s.paths),s.pxAlign=e.pxAlign}if(W){let s=function(e,t){if(0==t&&(X||!B.live||2==a))return ys;let s=[],o=ct("tr","u-series",G,G.childNodes[t]);it(o,e.class),e.show||it(o,Fe);let i=ct("th",null,o);if(q.show){let e=ut("u-marker",i);if(t>0){let s=q.width(n,t);s&&(e.style.border=s+"px "+q.dash(n,t)+" "+q.stroke(n,t)),e.style.background=q.fill(n,t)}}let r=ut(Ae,i);for(var l in e.label instanceof HTMLElement?r.appendChild(e.label):r.textContent=e.label,t>0&&(q.show||(r.style.color=e.width>0?q.stroke(n,t):q.fill(n,t)),ne("click",i,t=>{if($._lock)return;Le(t);let s=b.indexOf(e);if((t.ctrlKey||t.metaKey)!=B.isolate){let e=b.some((e,t)=>t>0&&t!=s&&e.show);b.forEach((t,n)=>{n>0&&In(n,e?n==s?ee:te:ee,!0,Ra.setSeries)})}else In(s,{show:!e.show},!0,Ra.setSeries)},!1),Pe&&ne(Ye,i,t=>{$._lock||(Le(t),In(b.indexOf(e),Gn,!0,Ra.setSeries))},!1)),Y){let e=ct("td","u-value",o);e.textContent="--",s.push(e)}return[o,s]}(e,t);V.splice(t,0,s[0]),K.splice(t,0,s[1]),B.values.push(null)}if(H){O.splice(t,0,null);let s=null;Ne?0==t&&(s=Xe(e,t)):t>0&&(s=Xe(e,t)),De.splice(t,0,s),Ie.splice(t,0,0),He.splice(t,0,0)}Fa("addSeries",t)}n.addSeries=function(e,t){t=null==t?b.length:t,e=1==a?Ta(e,t,Mn,Hn):Ta(e,t,{},Wn),b.splice(t,0,e),et(b[t],t)},n.delSeries=function(e){if(b.splice(e,1),W){B.values.splice(e,1),K.splice(e,1);let t=V.splice(e,1)[0];ae(null,t.firstChild),t.remove()}H&&(O.splice(e,1),De.splice(e,1)[0].remove(),Ie.splice(e,1),He.splice(e,1)),Fa("delSeries",e)};const nt=[!1,!1,!1,!1];function ot(e,t,s,n){let[a,o,i,r]=s,l=t%2,c=0;return 0==l&&(r||o)&&(c=0==t&&!a||2==t&&!i?$t(Tn.size/3):0),1==l&&(a||i)&&(c=1==t&&!o||3==t&&!r?$t(On.size/2):0),c}const dt=n.padding=(e.padding||[ot,ot,ot,ot]).map(e=>es(Dt(e,ot))),ft=n._padding=dt.map((e,t)=>e(n,t,nt,0));let mt,yt=null,bt=null;const vt=1==a?b[0].idxs:null;let Et,Pt,It,Ft,At,Bt,Jt,Yt,ts,is,rs=null,cs=!1;function us(e,s){if(t=null==e?[]:e,n.data=n._data=t,2==a){mt=0;for(let e=1;e=0,Ce=!0,gn()}}function ps(){let e,s;cs=!0,1==a&&(mt>0?(yt=vt[0]=0,bt=vt[1]=mt-1,e=t[0][yt],s=t[0][bt],2==E?(e=yt,s=bt):e==s&&(3==E?[e,s]=_t(e,e,j.log,!1):4==E?[e,s]=Lt(e,e,j.log,!1):j.time?s=e+$t(86400/y):[e,s]=Nt(e,s,.1,!0))):(yt=vt[0]=e=null,bt=vt[1]=s=null)),Dn(C,e,s)}function xs(e,t,s,n,a,o){e??(e=qe),s??(s=gs),n??(n="butt"),a??(a=qe),o??(o="round"),e!=Et&&(d.strokeStyle=Et=e),a!=Pt&&(d.fillStyle=Pt=a),t!=It&&(d.lineWidth=It=t),o!=At&&(d.lineJoin=At=o),n!=Bt&&(d.lineCap=Bt=n),s!=Ft&&d.setLineDash(Ft=s)}function Ss(e,t,s,n){t!=Pt&&(d.fillStyle=Pt=t),e!=Jt&&(d.font=Jt=e),s!=Yt&&(d.textAlign=Yt=s),n!=ts&&(d.textBaseline=ts=n)}function Cs(e,t,s,a,o=0){if(a.length>0&&e.auto(n,cs)&&(null==t||null==t.min)){let t=Dt(yt,0),n=Dt(bt,a.length-1),i=null==s.min?function(e,t,s,n=0,a=!1){let o=a?Mt:Tt,i=a?Ct:St;[t,s]=o(e,t,s);let r=e[t],l=e[t];if(t>-1)if(1==n)r=e[t],l=e[s];else if(-1==n)r=e[s],l=e[t];else for(let c=t;c<=s;c++){let t=e[c];i(t)&&(tl&&(l=t))}return[r??Kt,l??-Kt]}(a,t,n,o,3==e.distr):[s.min,s.max];e.min=Ht(e.min,s.min=i[0]),e.max=qt(e.max,s.max=i[1])}}n.setData=us;const _s={min:null,max:null};function js(e,t){let s=t?b[e].points:b[e];s._stroke=s.stroke(n,e),s._fill=s.fill(n,e)}function Es(e,s){let a=s?b[e].points:b[e],{stroke:o,fill:i,clip:r,flags:l,_stroke:c=a._stroke,_fill:u=a._fill,_width:h=a.width}=a._paths;h=ds(h*at,3);let f=null,p=h%2/2;s&&null==u&&(u=h>0?"#fff":c);let m=1==a.pxAlign&&p>0;if(m&&d.translate(p,p),!s){let e=me-h/2,t=ge-h/2,s=ye+h,n=be+h;f=new Path2D,f.rect(e,t,s,n)}s?Ns(c,h,a.dash,a.cap,u,o,i,l,r):function(e,s,a,o,i,r,l,c,u,d,h){let f=!1;0!=u&&S.forEach((p,m)=>{if(p.series[0]==e){let e,g=b[p.series[1]],y=t[p.series[1]],x=(g._paths||ms).band;bs(x)&&(x=1==p.dir?x[0]:x[1]);let w=null;g.show&&x&&function(e,t,s){for(t=Dt(t,0),s=Dt(s,e.length-1);t<=s;){if(null!=e[t])return!0;t++}return!1}(y,yt,bt)?(w=p.fill(n,m)||r,e=g._paths.clip):x=null,Ns(s,a,o,i,w,l,c,u,d,h,e,x),f=!0}}),f||Ns(s,a,o,i,r,l,c,u,d,h)}(e,c,h,a.dash,a.cap,u,o,i,l,f,r),m&&d.translate(-p,-p)}const Ps=3;function Ns(e,t,s,n,a,o,i,r,l,c,u,h){xs(e,t,s,n,a),(l||c||h)&&(d.save(),l&&d.clip(l),c&&d.clip(c)),h?(r&Ps)==Ps?(d.clip(h),u&&d.clip(u),Is(a,i),Ds(e,o,t)):2&r?(Is(a,i),d.clip(h),Ds(e,o,t)):1&r&&(d.save(),d.clip(h),u&&d.clip(u),Is(a,i),d.restore(),Ds(e,o,t)):(Is(a,i),Ds(e,o,t)),(l||c||h)&&d.restore()}function Ds(e,t,s){s>0&&(t instanceof Map?t.forEach((e,t)=>{d.strokeStyle=Et=t,d.stroke(e)}):null!=t&&e&&d.stroke(t))}function Is(e,t){t instanceof Map?t.forEach((e,t)=>{d.fillStyle=Pt=t,d.fill(e)}):null!=t&&e&&d.fill(t)}function Fs(e,t,s,n,a,o,i,r,l,c){let u=i%2/2;1==m&&d.translate(u,u),xs(r,i,l,c,r),d.beginPath();let h,f,p,g,y=a+(0==n||3==n?-o:o);0==s?(f=a,g=y):(h=a,p=y);for(let m=0;m{if(!s.show)return;let o=v[s.scale];if(null==o.min)return void(s._show&&(t=!1,s._show=!1,Os(!1)));s._show||(t=!1,s._show=!0,Os(!1));let i=s.side,r=i%2,{min:l,max:c}=o,[u,d]=function(e,t,s,a){let o,i=k[e];if(a<=0)o=[0,0];else{let r=i._space=i.space(n,e,t,s,a);o=function(e,t,s,n,a){let o=qt(Xt(e),Xt(t)),i=t-e,r=kt(a/n*i,s);do{let e=s[r],t=n*e/i;if(t>=a&&o+(e<5?hs.get(e):0)<=17)return[e,t]}while(++rrs[e]):f,m=2==o.distr?rs[f[1]]-rs[f[0]]:u,g=s._values=s.values(n,s.filter(n,p,a,d,m),a,d,m);s._rotate=2==i?s.rotate(n,g,a,d):0;let y=s._size;s._size=Wt(s.size(n,g,a,e)),null!=y&&s._size!=y&&(t=!1)}),t}function zs(e){let t=!0;return dt.forEach((s,a)=>{let o=s(n,a,nt,e);o!=ft[a]&&(t=!1),ft[a]=o}),t}function Os(e){b.forEach((t,s)=>{s>0&&(t._paths=null,e&&(1==a?(t.min=null,t.max=null):t.facets.forEach(e=>{e.min=null,e.max=null})))})}let Bs,$s,Ws,Us,Js,Gs,Ys,Vs,Ks,Xs,Qs,Zs,en=!1,tn=!1,dn=[];function mn(){tn=!1;for(let e=0;e0){b.forEach((s,o)=>{if(1==a){let a=s.scale,i=D[a];if(null==i)return;let r=e[a];if(0==o){let e=r.range(n,r.min,r.max,a);r.min=e[0],r.max=e[1],yt=kt(r.min,t[0]),bt=kt(r.max,t[0]),bt-yt>1&&(t[0][yt]r.max&&bt--),s.min=rs[yt],s.max=rs[bt]}else s.show&&s.auto&&Cs(r,i,s,t[o],s.sorted);s.idxs[0]=yt,s.idxs[1]=bt}else if(o>0&&s.show&&s.auto){let[n,a]=s.facets,i=n.scale,r=a.scale,[l,c]=t[o],u=e[i],d=e[r];null!=u&&Cs(u,D[i],n,l,n.sorted),null!=d&&Cs(d,D[r],a,c,a.sorted),s.min=a.min,s.max=a.max}});for(let t in e){let s=e[t],a=D[t];if(null==s.from&&(null==a||null==a.min)){let e=s.range(n,s.min==Kt?null:s.min,s.max==-Kt?null:s.max,t);s.min=e[0],s.max=e[1]}}}for(let t in e){let s=e[t];if(null!=s.from){let a=e[s.from];if(null==a.min)s.min=s.max=null;else{let e=s.range(n,a.min,a.max,t);s.min=e[0],s.max=e[1]}}}let s={},o=!1;for(let t in e){let n=e[t],a=v[t];if(a.min!=n.min||a.max!=n.max){a.min=n.min,a.max=n.max;let e=a.distr;a._min=3==e?Gt(a.min):4==e?Vt(a.min,a.asinh):100==e?a.fwd(a.min):a.min,a._max=3==e?Gt(a.max):4==e?Vt(a.max,a.asinh):100==e?a.fwd(a.max):a.max,s[t]=o=!0}}if(o){b.forEach((e,t)=>{2==a?t>0&&s.y&&(e._paths=null):s[e.scale]&&(e._paths=null)});for(let e in s)ke=!0,Fa("setScale",e);H&&$.left>=0&&(ve=Ce=!0)}for(let t in D)D[t]=null}(),xe=!1),ke&&(function(){let e=!1,t=0;for(;!e;){t++;let s=As(t),a=zs(t);e=t==_e||s&&a,e||(Me(n.width,n.height),we=!0)}}(),ke=!1),we){if(lt(f,$e,ce),lt(f,Oe,ue),lt(f,Re,re),lt(f,ze,le),lt(p,$e,ce),lt(p,Oe,ue),lt(p,Re,re),lt(p,ze,le),lt(h,Re,oe),lt(h,ze,ie),u.width=$t(oe*at),u.height=$t(ie*at),k.forEach(({_el:e,_show:t,_size:s,_pos:n,side:a})=>{if(null!=e)if(t){let t=a%2==1;lt(e,t?"left":"top",n-(3===a||0===a?s:0)),lt(e,t?"width":"height",s),lt(e,t?"top":"left",t?ue:ce),lt(e,t?"height":"width",t?le:re),rt(e,Fe)}else it(e,Fe)}),Et=Pt=It=At=Bt=Jt=Yt=ts=Ft=null,is=1,ia(!0),ce!=de||ue!=he||re!=fe||le!=pe){Os(!1);let e=re/fe,t=le/pe;if(H&&!ve&&$.left>=0){$.left*=e,$.top*=t,Ws&&ht(Ws,$t($.left),0,re,le),Us&&ht(Us,0,$t($.top),re,le);for(let s=0;s=0&&Cn.width>0){Cn.left*=e,Cn.width*=e,Cn.top*=t,Cn.height*=t;for(let e in ca)lt(Pn,e,Cn[e])}de=ce,he=ue,fe=re,pe=le}Fa("setSize"),we=!1}oe>0&&ie>0&&(d.clearRect(0,0,u.width,u.height),Fa("drawClear"),M.forEach(e=>e()),Fa("draw")),Cn.show&&Se&&(Nn(Cn),Se=!1),H&&ve&&(aa(null,!0,!1),ve=!1),B.show&&B.live&&Ce&&(sa(),Ce=!1),l||(l=!0,n.status=1,Fa("ready")),cs=!1,en=!1}function xn(e,s){let a=v[e];if(null==a.from){if(0==mt){let t=a.range(n,s.min,s.max,e);s.min=t[0],s.max=t[1]}if(s.min>s.max){let e=s.min;s.min=s.max,s.max=e}if(mt>1&&null!=s.min&&null!=s.max&&s.max-s.min<1e-16)return;e==C&&2==a.distr&&mt>0&&(s.min=kt(s.min,t[0]),s.max=kt(s.max,t[0]),s.min==s.max&&s.max++),D[e]=s,xe=!0,gn()}}n.batch=function(e,t=!1){en=!0,tn=t,e(n),yn(),t&&dn.length>0&&queueMicrotask(mn)},n.redraw=(e,t)=>{ke=t||!1,!1!==e?Dn(C,j.min,j.max):gn()},n.setScale=xn;let wn=!1;const kn=$.drag;let vn=kn.x,Sn=kn.y;H&&($.x&&(Bs=ut("u-cursor-x",p)),$.y&&($s=ut("u-cursor-y",p)),0==j.ori?(Ws=Bs,Us=$s):(Ws=$s,Us=Bs),Qs=$.left,Zs=$.top);const Cn=n.select=Ms({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Pn=Cn.show?ut("u-select",Cn.over?p:f):null;function Nn(e,t){if(Cn.show){for(let t in e)Cn[t]=e[t],t in ca&<(Pn,t,e[t]);!1!==t&&Fa("setSelect")}}function Dn(e,t,s){xn(e,{min:t,max:s})}function In(e,t,s,o){null!=t.focus&&function(e){if(e!=$n){let t=null==e,s=1!=Ee.alpha;b.forEach((n,o)=>{if(1==a||o>0){let a=t||0==o||o==e;n._focus=t?null:a,s&&function(e,t){b[e].alpha=t,H&&null!=De[e]&&(De[e].style.opacity=t),W&&V[e]&&(V[e].style.opacity=t)}(o,a?1:Ee.alpha)}}),$n=e,s&&gn()}}(e),null!=t.show&&b.forEach((s,n)=>{n>0&&(e==n||null==e)&&(s.show=t.show,function(e){if(b[e].show)W&&rt(V[e],Fe);else if(W&&it(V[e],Fe),H){let t=Ne?De[0]:De[e];null!=t&&ht(t,-10,-10,re,le)}}(n),2==a?(Dn(s.facets[0].scale,null,null),Dn(s.facets[1].scale,null,null)):Dn(s.scale,null,null),gn())}),!1!==s&&Fa("setSeries",e,t),o&&Ba("setSeries",n,e,t)}let Fn,Bn,$n;n.setSelect=Nn,n.setSeries=In,n.addBand=function(e,t){e.fill=es(e.fill||null),e.dir=Dt(e.dir,-1),t=null==t?S.length:t,S.splice(t,0,e)},n.setBand=function(e,t){Ms(S[e],t)},n.delBand=function(e){null==e?S.length=0:S.splice(e,1)};const Gn={focus:!0};function Vn(e,t,s){let n=v[t];s&&(e=e/at-(1==n.ori?ue:ce));let a=re;1==n.ori&&(a=le,e=a-e),-1==n.dir&&(e=a-e);let o=n._min,i=o+(n._max-o)*(e/a),r=n.distr;return 3==r?Ut(10,i):4==r?((e,t=1)=>Rt.sinh(e)*t)(i,n.asinh):100==r?n.bwd(i):i}function Kn(e,t){lt(Pn,$e,Cn.left=e),lt(Pn,Re,Cn.width=t)}function Qn(e,t){lt(Pn,Oe,Cn.top=e),lt(Pn,ze,Cn.height=t)}W&&Pe&&ne(Ve,U,e=>{$._lock||(Le(e),null!=$n&&In(null,Gn,!0,Ra.setSeries))}),n.valToIdx=e=>kt(e,t[0]),n.posToIdx=function(e,s){return kt(Vn(e,C,s),t[0],yt,bt)},n.posToVal=Vn,n.valToPos=(e,t,s)=>0==v[t].ori?o(e,v[t],s?ye:re,s?me:0):i(e,v[t],s?be:le,s?ge:0),n.setCursor=(e,t,s)=>{Qs=e.left,Zs=e.top,aa(null,t,s)};let Zn=0==j.ori?Kn:Qn,ea=1==j.ori?Kn:Qn;function sa(e,t){if(null!=e&&(e.idxs?e.idxs.forEach((e,t)=>{O[t]=e}):void 0!==e.idx&&O.fill(e.idx),B.idx=O[0]),W&&B.live){for(let e=0;e0||1==a&&!X)&&na(e,O[e]);!function(){if(W&&B.live)for(let e=2==a?1:0;ebt;Fn=Kt,Bn=null;let l=0==j.ori?re:le,c=1==j.ori?re:le;if(Qs<0||0==mt||r){i=$.idx=null;for(let e=0;e0&&e.show){let s=null==w?-10:w==i?o:P(1==a?t[0][w]:t[g][0][w],j,l,0),y=null==k?-10:N(k,1==a?v[e.scale]:v[e.facets[1].scale],c,0);if(Pe&&null!=k){let t=1==j.ori?Qs:Zs,s=Ot(Ee.dist(n,g,w,y,t));if(s=0?1:-1;o==(k>=0?1:-1)&&(1==o?1==n?k>=a:k<=a:1==n?k<=a:k>=a)&&(Fn=s,Bn=g)}else Fn=s,Bn=g}}if(Ce||Ne){let e,t;0==j.ori?(e=s,t=y):(e=y,t=s);let a,o,i,l,c,b,x=!0,w=je.bbox;if(null!=w){x=!1;let e=w(n,g);i=e.left,l=e.top,a=e.width,o=e.height}else i=e,l=t,a=o=je.size(n,g);if(b=je.fill(n,g),c=je.stroke(n,g),Ne)g==Bn&&Fn<=Ee.prox&&(r=i,u=l,d=a,h=o,f=x,p=b,m=c);else{let e=De[g];null!=e&&(Ie[g]=i,He[g]=l,gt(e,a,o,x),pt(e,b,c),ht(e,Wt(i),Wt(l),re,le))}}}}if(Ne){let e=Ee.prox;if(Ce||(null==$n?Fn<=e:Fn>e||Bn!=$n)){let e=De[0];null!=e&&(Ie[0]=r,He[0]=u,gt(e,d,h,f),pt(e,p,m),ht(e,Wt(r),Wt(u),re,le))}}}if(Cn.show&&wn)if(null!=e){let[t,s]=Ra.scales,[n,a]=Ra.match,[o,i]=e.cursor.sync.scales,r=e.cursor.drag;if(vn=r._x,Sn=r._y,vn||Sn){let r,u,d,h,f,{left:p,top:m,width:g,height:y}=e.select,b=e.scales[o].ori,x=e.posToVal,w=null!=t&&n(t,o),k=null!=s&&a(s,i);w&&vn?(0==b?(r=p,u=g):(r=m,u=y),d=v[t],h=P(x(r,o),d,l,0),f=P(x(r+u,o),d,l,0),Zn(Ht(h,f),Ot(f-h))):Zn(0,l),k&&Sn?(1==b?(r=p,u=g):(r=m,u=y),d=v[s],h=N(x(r,i),d,c,0),f=N(x(r+u,i),d,c,0),ea(Ht(h,f),Ot(f-h))):ea(0,c)}else ua()}else{let e=Ot(Ks-Js),t=Ot(Xs-Gs);if(1==j.ori){let s=e;e=t,t=s}vn=kn.x&&e>=kn.dist,Sn=kn.y&&t>=kn.dist;let s,n,a=kn.uni;null!=a?vn&&Sn&&(vn=e>=a,Sn=t>=a,vn||Sn||(t>e?Sn=!0:vn=!0)):kn.x&&kn.y&&(vn||Sn)&&(vn=Sn=!0),vn&&(0==j.ori?(s=Ys,n=Qs):(s=Vs,n=Zs),Zn(Ht(s,n),Ot(n-s)),Sn||ea(0,c)),Sn&&(1==j.ori?(s=Ys,n=Qs):(s=Vs,n=Zs),ea(Ht(s,n),Ot(n-s)),vn||Zn(0,l)),vn||Sn||(Zn(0,0),ea(0,0))}if(kn._x=vn,kn._y=Sn,null==e){if(o){if(null!=za){let[e,t]=Ra.scales;Ra.values[0]=null!=e?Vn(0==j.ori?Qs:Zs,e):null,Ra.values[1]=null!=t?Vn(1==j.ori?Qs:Zs,t):null}Ba(Ue,n,Qs,Zs,re,le,i)}if(Pe){let e=o&&Ra.setSeries,t=Ee.prox;null==$n?Fn<=t&&In(Bn,Gn,!0,e):Fn>t?In(null,Gn,!0,e):Bn!=$n&&In(Bn,Gn,!0,e)}}Ce&&(B.idx=i,sa()),!1!==s&&Fa("setCursor")}n.setLegend=sa;let oa=null;function ia(e=!1){e?oa=null:(oa=p.getBoundingClientRect(),Fa("syncRect",oa))}function ra(e,t,s,n,a,o,i){$._lock||wn&&null!=e&&0==e.movementX&&0==e.movementY||(la(e,t,s,n,a,o,0,!1,null!=e),null!=e?aa(null,!0,!0):aa(t,!0,!1))}function la(e,t,s,a,o,i,l,c,u){if(null==oa&&ia(!1),Le(e),null!=e)s=e.clientX-oa.left,a=e.clientY-oa.top;else{if(s<0||a<0)return Qs=-10,void(Zs=-10);let[e,n]=Ra.scales,l=t.cursor.sync,[c,u]=l.values,[d,h]=l.scales,[f,p]=Ra.match,m=t.axes[0].side%2==1,g=0==j.ori?re:le,y=1==j.ori?re:le,b=m?i:o,x=m?o:i,w=m?a:s,k=m?s:a;if(s=null!=d?f(e,d)?r(c,v[e],g,0):-10:g*(w/b),a=null!=h?p(n,h)?r(u,v[n],y,0):-10:y*(k/x),1==j.ori){let e=s;s=a,a=e}}!u||null!=t&&t.cursor.event.type!=Ue||((s<=1||s>=re-1)&&(s=ls(s,re)),(a<=1||a>=le-1)&&(a=ls(a,le))),c?(Js=s,Gs=a,[Ys,Vs]=$.move(n,s,a)):(Qs=s,Zs=a)}Object.defineProperty(n,"rect",{get:()=>(null==oa&&ia(!1),oa)});const ca={width:0,height:0,left:0,top:0};function ua(){Nn(ca,!1)}let da,ha,fa,pa;function ma(e,t,s,a,o,i,r){wn=!0,vn=Sn=kn._x=kn._y=!1,la(e,t,s,a,o,i,0,!0,!1),null!=e&&(ne(Ge,tt,ga,!1),Ba(Je,n,Ys,Vs,re,le,null));let{left:l,top:c,width:u,height:d}=Cn;da=l,ha=c,fa=u,pa=d}function ga(e,t,s,a,o,i,r){wn=kn._x=kn._y=!1,la(e,t,s,a,o,i,0,!1,!0);let{left:l,top:c,width:u,height:d}=Cn,h=u>0||d>0,f=da!=l||ha!=c||fa!=u||pa!=d;if(h&&f&&Nn(Cn),kn.setScale&&h&&f){let e=l,t=u,s=c,n=d;if(1==j.ori&&(e=c,t=d,s=l,n=u),vn&&Dn(C,Vn(e,C),Vn(e+t,C)),Sn)for(let a in v){let e=v[a];a!=C&&null==e.from&&e.min!=Kt&&Dn(a,Vn(s+n,a),Vn(s,a))}ua()}else $.lock&&($._lock=!$._lock,aa(t,!0,null!=e));null!=e&&(ae(Ge,tt),Ba(Ge,n,Qs,Zs,re,le,null))}function ya(e,t,s,a,o,i,r){$._lock||(Le(e),ps(),ua(),null!=e&&Ba(Ke,n,Qs,Zs,re,le,null))}function ba(){k.forEach(Ia),Te(n.width,n.height,!0)}xt(Qe,st,ba);const xa={};xa.mousedown=ma,xa.mousemove=ra,xa.mouseup=ga,xa.dblclick=ya,xa.setSeries=(e,t,s,a)=>{-1!=(s=(0,Ra.match[2])(n,t,s))&&In(s,a,!0,!1)},H&&(ne(Je,p,ma),ne(Ue,p,ra),ne(Ye,p,e=>{Le(e),ia(!1)}),ne(Ve,p,function(e,t,s,n,a,o,i){if($._lock)return;Le(e);let r=wn;if(wn){let e,t,s=!0,n=!0,a=10;0==j.ori?(e=vn,t=Sn):(e=Sn,t=vn),e&&t&&(s=Qs<=a||Qs>=re-a,n=Zs<=a||Zs>=le-a),e&&s&&(Qs=Qs{e.call(null,n,t,s)})}(e.plugins||[]).forEach(e=>{for(let t in e.hooks)ka[t]=(ka[t]||[]).concat(e.hooks[t])});const Aa=(e,t,s)=>s,Ra=Ms({key:null,setSeries:!1,filters:{pub:as,sub:as},scales:[C,b[1]?b[1].scale:null],match:[os,os,Aa],values:[null,null]},$.sync);2==Ra.match.length&&Ra.match.push(Aa),$.sync=Ra;const za=Ra.key,Oa=Yn(za);function Ba(e,t,s,n,a,o,i){Ra.filters.pub(e,t,s,n,a,o,i)&&Oa.pub(e,t,s,n,a,o,i)}function $a(){Fa("init",e,t),us(t||e.data,!1),D[C]?xn(C,D[C]):ps(),Se=Cn.show&&(Cn.width>0||Cn.height>0),ve=Ce=!0,Te(e.width,e.height)}return Oa.sub(n),n.pub=function(e,t,s,n,a,o,i){Ra.filters.sub(e,t,s,n,a,o,i)&&xa[e](null,t,s,n,a,o,i)},n.destroy=function(){Oa.unsub(n),wa.delete(n),se.clear(),wt(Qe,st,ba),c.remove(),null==U||U.remove(),Fa("destroy")},b.forEach(et),k.forEach(function(e,t){if(e._show=e.show,e.show){let s=e.side%2,a=v[e.scale];null==a&&(e.scale=s?b[1].scale:C,a=v[e.scale]);let o=a.time;e.size=es(e.size),e.space=es(e.space),e.rotate=es(e.rotate),bs(e.incrs)&&e.incrs.forEach(e=>{!hs.has(e)&&hs.set(e,fs(e))}),e.incrs=es(e.incrs||(2==a.distr?Hs:o?1==y?sn:on:qs)),e.splits=es(e.splits||(o&&1==a.distr?A:3==a.distr?jn:4==a.distr?En:Ln)),e.stroke=es(e.stroke),e.grid.stroke=es(e.grid.stroke),e.ticks.stroke=es(e.ticks.stroke),e.border.stroke=es(e.border.stroke);let i=e.values;e.values=bs(i)&&!bs(i[0])?es(i):o?bs(i)?un(I,cn(i,F)):ws(i)?function(e,t){let s=Rs(t);return(t,n,a,o,i)=>n.map(t=>s(e(t)))}(I,i):i||R:i||_n,e.filter=es(e.filter||(a.distr>=3&&10==a.log?An:3==a.distr&&2==a.log?Rn:ss)),e.font=Da(e.font),e.labelFont=Da(e.labelFont),e._size=e.size(n,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(nt[t]=!0,e._el=ut("u-axis",h))}}),s?s instanceof HTMLElement?(s.appendChild(c),$a()):s(n,$a):$a(),n}Fa.assign=Ms,Fa.fmtNum=At,Fa.rangeNum=Nt,Fa.rangeLog=_t,Fa.rangeAsinh=Lt,Fa.orient=Vn,Fa.pxRatio=at,Fa.join=function(e,t){if(function(e){let t=e[0][0],s=t.length;for(let n=1;n=n&&null==e[a];)a--;if(a<=n)return!0;const o=qt(1,Bt((a-n+1)/t));for(let i=e[n],r=n+o;r<=a;r+=o){const t=e[r];if(null!=t){if(t<=i)return!1;i=t}}return!0}(t[0])||(t=function(e){let t=e[0],s=t.length,n=Array(s);for(let o=0;ot[e]-t[s]);let a=[];for(let o=0;oe-t)],a=n[0].length,o=new Map;for(let i=0;iVn(e,o,(l,c,u,d,h,f,p,m,g,y,b)=>{[i,r]=Tt(u,i,r);let x=l.pxRound,{left:w,width:k}=e.bbox,v=e=>x(f(e,d,y,m)),S=e=>x(p(e,h,b,g)),C=0==d.ori?oa:ia;const T={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},M=T.stroke,_=d.dir*(0==d.ori?1:-1);let L=S(u[1==_?i:r]),j=v(c[1==_?i:r]),E=j,P=j;a&&-1==t&&(P=w,C(M,P,L)),C(M,j,L);for(let e=1==_?i:r;e>=i&&e<=r;e+=_){let s=u[e];if(null==s)continue;let n=v(c[e]),a=S(s);1==t?C(M,n,L):C(M,E,a),C(M,n,a),L=a,E=n}let N=E;a&&1==t&&(N=w+k,C(M,N,L));let[D,I]=Kn(e,o);if(null!=l.fill||0!=D){let t=T.fill=new Path2D(M),s=S(l.fillTo(e,o,l.min,l.max,D));C(t,N,s),C(t,P,s)}if(!l.spanGaps){let a=[];a.push(...ea(c,u,i,r,_,v,n));let h=l.width*at/2,f=s||1==t?h:-h,p=s||-1==t?-h:h;a.forEach(e=>{e[0]+=f,e[1]+=p}),T.gaps=a=l.gaps(e,o,i,r,a),T.clip=Zn(a,d.ori,m,g,y,b)}return 0!=I&&(T.band=2==I?[Qn(e,o,i,r,M,-1),Qn(e,o,i,r,M,1)]:Qn(e,o,i,r,M,I)),T})},e.bars=function(e){const t=Dt((e=e||ms).size,[.6,Kt,1]),s=e.align||0,n=e.gap||0;let a=e.radius;a=null==a?[0,0]:"number"==typeof a?[a,0]:a;const o=es(a),i=1-t[0],r=Dt(t[1],Kt),l=Dt(t[2],1),c=Dt(e.disp,ms),u=Dt(e.each,e=>{}),{fill:d,stroke:h}=c;return(e,t,a,f)=>Vn(e,t,(p,m,g,y,b,x,w,k,v,S,C)=>{let T,M,_=p.pxRound,L=s,j=n*at,E=r*at,P=l*at;0==y.ori?[T,M]=o(e,t):[M,T]=o(e,t);const N=y.dir*(0==y.ori?1:-1);let D,I,F,A=0==y.ori?ra:la,R=0==y.ori?u:(e,t,s,n,a,o,i)=>{u(e,t,s,a,n,i,o)},z=Dt(e.bands,gs).find(e=>e.series[0]==t),O=null!=z?z.dir:0,B=p.fillTo(e,t,p.min,p.max,O),$=_(w(B,b,C,v)),W=S,H=_(p.width*at),q=!1,U=null,J=null,G=null,Y=null;null==d||0!=H&&null==h||(q=!0,U=d.values(e,t,a,f),J=new Map,new Set(U).forEach(e=>{null!=e&&J.set(e,new Path2D)}),H>0&&(G=h.values(e,t,a,f),Y=new Map,new Set(G).forEach(e=>{null!=e&&Y.set(e,new Path2D)})));let{x0:V,size:K}=c;if(null!=V&&null!=K){L=1,m=V.values(e,t,a,f),2==V.unit&&(m=m.map(t=>e.posToVal(k+t*S,y.key,!0)));let s=K.values(e,t,a,f);I=2==K.unit?s[0]*S:x(s[0],y,S,k)-x(0,y,S,k),W=ba(m,g,x,y,S,k,W),F=W-I+j}else W=ba(m,g,x,y,S,k,W),F=W*i+j,I=W-F;F<1&&(F=0),H>=I/2&&(H=0),F<5&&(_=ts);let X=F>0;I=_(Qt(W-F-(X?H:0),P,E)),D=(0==L?I/2:L==N?0:I)-L*N*((0==L?j/2:0)+(X?H/2:0));const Q={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Z=q?null:new Path2D;let ee=null;if(null!=z)ee=e.data[z.series[1]];else{let{y0:s,y1:n}=c;null!=s&&null!=n&&(g=n.values(e,t,a,f),ee=s.values(e,t,a,f))}let te=T*I,se=M*I;for(let s=1==N?a:f;s>=a&&s<=f;s+=N){let n=g[s];if(null==n)continue;if(null!=ee){let e=ee[s]??0;if(n-e==0)continue;$=w(e,b,C,v)}let a=x(2!=y.distr||null!=c?m[s]:s,y,S,k),o=w(Dt(n,B),b,C,v),i=_(a-D),r=_(qt(o,$)),l=_(Ht(o,$)),u=r-l;if(null!=n){let a=n<0?se:te,o=n<0?te:se;q?(H>0&&null!=G[s]&&A(Y.get(G[s]),i,l+Bt(H/2),I,qt(0,u-H),a,o),null!=U[s]&&A(J.get(U[s]),i,l+Bt(H/2),I,qt(0,u-H),a,o)):A(Z,i,l+Bt(H/2),I,qt(0,u-H),a,o),R(e,t,s,i-H/2,l,I+H,u)}}return H>0?Q.stroke=q?Y:Z:q||(Q._fill=0==p.width?p._fill:p._stroke??p._fill,Q.width=0),Q.fill=q?J:Z,Q})},e.spline=function(e){return function(e,t){const s=Dt(null==t?void 0:t.alignGaps,0);return(t,n,a,o)=>Vn(t,n,(i,r,l,c,u,d,h,f,p,m,g)=>{[a,o]=Tt(l,a,o);let y,b,x,w=i.pxRound,k=e=>w(d(e,c,m,f)),v=e=>w(h(e,u,g,p));0==c.ori?(y=na,x=oa,b=da):(y=aa,x=ia,b=ha);const S=c.dir*(0==c.ori?1:-1);let C=k(r[1==S?a:o]),T=C,M=[],_=[];for(let e=1==S?a:o;e>=a&&e<=o;e+=S)if(null!=l[e]){let t=k(r[e]);M.push(T=t),_.push(v(l[e]))}const L={stroke:e(M,_,y,x,b,w),fill:null,clip:null,band:null,gaps:null,flags:1},j=L.stroke;let[E,P]=Kn(t,n);if(null!=i.fill||0!=E){let e=L.fill=new Path2D(j),s=v(i.fillTo(t,n,i.min,i.max,E));x(e,T,s),x(e,C,s)}if(!i.spanGaps){let e=[];e.push(...ea(r,l,a,o,S,k,s)),L.gaps=e=i.gaps(t,n,a,o,e),L.clip=Zn(e,c.ori,f,p,m,g)}return 0!=P&&(L.band=2==P?[Qn(t,n,a,o,j,-1),Qn(t,n,a,o,j,1)]:Qn(t,n,a,o,j,P)),L})}(xa,e)}}const Aa=new Map;function Ra(e){var t;if(!e.startsWith("var("))return e;const s=Aa.get(e);if(s)return s;const n=e.match(/var\(([^,)]+)(?:,\s*([^)]+))?\)/);if(!n)return e;const a=n[1].trim(),o=(null==(t=n[2])?void 0:t.trim())||"#888888",i=getComputedStyle(document.documentElement).getPropertyValue(a).trim()||o;return Aa.set(e,i),i}const za=s.memo(function({timestamps:e,series:t,onHover:a,highlightedKey:o=null,cursorColor:i="rgba(255,255,255,0.5)"}){const r=s.useRef(null),l=s.useRef(null),c=s.useRef(t),u=s.useRef(o),d=s.useRef(a),h=s.useRef(e.length);s.useLayoutEffect(()=>{c.current=t,u.current=o,d.current=a});const f=s.useMemo(()=>{const t=new Array(e.length).fill(1);return[e,t]},[e]),p=s.useMemo(()=>({hooks:{draw:e=>{!function(e,t,s){if(0===t.length)return;const n=e.ctx,a=e.bbox,o=a.left,i=a.top,r=a.width,l=a.height;if(r<=0||l<=0)return;const c=e.data[0],u=c.length;if(0===u)return;const d=c[0],h=c[u-1]-d||1,f=e=>{const t=c[e];return o+(t-d)/h*r},p=e=>i+l*(1-e);for(let m=0;m=0;t--){const e=f(t),s=p(o[t]);if(t===u-1)n.lineTo(e,s);else{const a=f(t+1);n.lineTo(a,s),n.lineTo(e,s)}}n.closePath(),n.fill(),n.restore()}}(e,c.current,u.current),function(e){const t=e.ctx,{left:s,top:n,width:a,height:o}=e.bbox,i=window.devicePixelRatio||1,r=function(){const e=getComputedStyle(document.documentElement);return{fontFamily:e.getPropertyValue("--font-data").trim()||'"JetBrains Mono", ui-monospace, monospace',textPrimary:e.getPropertyValue("--text-primary").trim()||"#FFFFFF"}}();t.save(),t.strokeStyle=r.textPrimary,t.globalAlpha=.15,t.lineWidth=1*i,t.setLineDash([4*i,4*i]);for(const c of[.2,.4,.6,.8]){const e=Math.round(n+o*(1-c))+.5;t.beginPath(),t.moveTo(Math.round(s),e),t.lineTo(Math.round(s+a),e),t.stroke()}t.restore(),t.save(),t.font=`bold ${10*i}px ${r.fontFamily}`,t.fillStyle=r.textPrimary,t.textBaseline="middle",t.textAlign="left";const l=8*i;for(const c of[0,20,40,60,80,100]){const e=n+o*(1-c/100),s=Math.max(n+l,Math.min(n+o-l,e));t.fillText(`${c}%`,0,s)}t.restore()}(e)}}}),[]),m=s.useMemo(()=>({width:400,height:200,padding:[8,0,0,32],cursor:{show:!0,x:!0,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],hooks:{setCursor:[e=>{var t,s;const n=e.cursor.idx;if(null!=n&&n>=0){const s=e.data[0][n];null==(t=d.current)||t.call(d,n,s)}else null==(s=d.current)||s.call(d,null,null)}]},plugins:[p]}),[p]);s.useEffect(()=>{const t=r.current;if(!t||0===e.length)return;const s=h.current,n=e.length,a=Math.abs(n-s);if(!(!l.current||a>100||s>0&&a/s>.1)&&l.current)return l.current.setData(f),void(h.current=n);l.current&&l.current.destroy();const o=t.getBoundingClientRect(),i=Math.floor(o.width)||400,c=Math.floor(o.height)||200,u=new Fa({...m,width:i,height:c},f,t);return l.current=u,h.current=n,()=>{u.destroy(),l.current=null}},[m,f,e.length]),s.useEffect(()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!l.current)return;const{width:s,height:n}=t.contentRect;s>0&&n>0&&l.current.setSize({width:Math.floor(s),height:Math.floor(n)})});return t.observe(e),()=>{t.disconnect()}},[]),s.useEffect(()=>{l.current&&l.current.redraw()},[o,t]);const g=s.useCallback(()=>{null==a||a(null,null)},[a]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:r,className:"w-full h-full rounded-2xl overflow-hidden",onMouseLeave:g})}),Oa=s.createContext(null);function Ba(e){const t=re(e);t&&function(e){if("undefined"==typeof document)return;const t=function(e){const t={},s=e.surfaces.glass;t["--glass-tint"]=s.tint,t["--glass-light"]=s.light,t["--glass-dark"]=s.dark,t["--glass-reflex-light"]=String(s.reflexLight),t["--glass-reflex-dark"]=String(s.reflexDark),t["--glass-blur"]=`${s.blur}px`,t["--glass-blur-elevated"]=`${s.blurElevated}px`,t["--glass-brightness"]=String(s.brightness),t["--glass-bg-opacity"]=`${s.opacity}%`,t["--glass-bg-opacity-elevated"]=`${s.opacityElevated}%`,t["--sidebar-tint"]=e.surfaces.sidebar.tint,t["--tooltip-bg"]=e.colors.bg.surface,t["--hover-tint"]=`rgba(${B(e.colors.accent.primary)}, 0.08)`,t["--shadow-tint"]=`rgba(${B(e.colors.accent.primary)}, 0.35)`,t["--bg-body"]=e.colors.bg.body,t["--bg-surface"]=e.colors.bg.surface,t["--bg-elevated"]=e.colors.bg.elevated,t["--bg-subtle"]=e.colors.bg.subtle,t["--border-subtle"]=e.colors.border.subtle,t["--border-strong"]=e.colors.border.strong,t["--text-primary"]=e.colors.text.primary,t["--text-secondary"]=e.colors.text.secondary,t["--text-muted"]=e.colors.text.muted,t["--text-invert"]=e.colors.text.inverse,t["--accent-primary"]=e.colors.accent.primary,t["--accent-secondary"]=e.colors.accent.secondary,t["--accent-tertiary"]=e.colors.accent.tertiary,t["--accent-success"]=e.colors.accent.success,t["--accent-danger"]=e.colors.accent.danger,t["--signal-excellent"]=e.colors.signal.excellent,t["--signal-good"]=e.colors.signal.good,t["--signal-fair"]=e.colors.signal.fair,t["--signal-poor"]=e.colors.signal.poor,t["--signal-critical"]=e.colors.signal.critical,t["--signal-unknown"]=e.colors.signal.unknown,t["--sparkline-excellent"]=e.colors.signal.excellent,t["--sparkline-good"]=e.colors.signal.good,t["--sparkline-fair"]=e.colors.signal.fair,t["--sparkline-poor"]=e.colors.signal.poor,t["--sparkline-critical"]=e.colors.signal.critical,t["--status-success"]=e.colors.status.success,t["--status-warning"]=e.colors.status.warning,t["--status-danger"]=e.colors.status.danger,t["--status-info"]=e.colors.status.info,t["--status-muted"]=e.colors.status.muted;const n=e.colors.chart;t["--pkt-advert"]=e.colors.accent.secondary,t["--pkt-flood"]=e.colors.accent.tertiary,t["--pkt-txt-msg"]=e.colors.accent.success,t["--pkt-ack"]=n.c8,t["--pkt-trace"]=n.c3,t["--pkt-req"]=n.c2,t["--pkt-response"]=n.c5,t["--pkt-grp-txt"]=e.colors.map.room,t["--pkt-grp-data"]=e.colors.accent.danger,t["--pkt-path"]=n.c3,t["--pkt-anon"]=e.colors.accent.secondary,t["--pkt-unknown"]=e.colors.status.muted,t["--route-flood"]=e.colors.accent.tertiary,t["--route-direct"]=e.colors.accent.secondary,t["--route-transport"]=n.c8,t["--chart-1"]=n.c1,t["--chart-2"]=n.c2,t["--chart-3"]=n.c3,t["--chart-4"]=n.c4,t["--chart-5"]=n.c5,t["--chart-6"]=n.c6,t["--chart-7"]=n.c7,t["--chart-8"]=n.c8,t["--chart-grid"]=n.grid,t["--chart-axis-tick"]=n.axis,t["--chart-cursor"]=n.cursor,t["--metric-received"]=e.colors.metric.received,t["--metric-forwarded"]=e.colors.metric.forwarded,t["--metric-transmitted"]=e.colors.metric.transmitted,t["--metric-dropped"]=e.colors.metric.dropped,t["--metric-neutral"]=e.colors.text.secondary,t["--log-debug"]=e.colors.status.muted,t["--log-info"]=e.colors.status.info,t["--log-warning"]=e.colors.status.warning,t["--log-error"]=e.colors.accent.danger,t["--log-critical"]=e.colors.accent.danger;const a=e.colors.map;t["--map-node-fill"]=a.nodeFill,t["--map-node-stroke"]=a.nodeStroke,t["--map-hub-color"]=a.hub,t["--map-local-color"]=a.local,t["--map-neighbor-color"]=a.neighbor,t["--map-mobile-color"]=a.mobile,t["--map-room-color"]=a.room,t["--map-edge-rest"]=a.edge,t["--map-edge-rest-bright"]=e.colors.border.strong,t["--map-edge-rest-dim"]=e.colors.bg.subtle,t["--map-edge-hover-direct"]=a.edgeHover,t["--map-edge-hover-loop"]=a.hub,t["--map-edge-hover-standard"]=e.colors.text.muted,t["--map-edge-hover-neighbor"]=a.local,t["--link-strong"]=e.colors.accent.success,t["--link-medium"]=e.colors.accent.secondary,t["--link-weak"]=e.colors.accent.danger,t["--hop-0"]=e.colors.accent.tertiary,t["--hop-1"]=e.colors.accent.success,t["--hop-2"]=n.c3,t["--hop-3"]=e.colors.accent.secondary,t["--hop-distant"]=e.colors.text.muted,t["--hop-hub"]=a.local,t["--icon-page-title"]=e.colors.accent.primary,t["--icon-card-title"]=e.colors.accent.primary,t["--icon-widget"]=e.colors.text.secondary,t["--icon-action"]=e.colors.text.secondary,t["--icon-nav"]=e.colors.text.muted,t["--icon-nav-active"]=e.colors.accent.primary,t["--toggle-on"]=e.colors.accent.success,t["--toggle-off"]=e.colors.bg.elevated,t["--font-title"]=e.typography.font.title,t["--font-display"]=e.typography.font.display,t["--font-data"]=e.typography.font.mono,t["--font-normal"]=String(e.typography.weight.normal),t["--font-medium"]=String(e.typography.weight.medium),t["--font-semibold"]=String(e.typography.weight.semibold),t["--font-bold"]=String(e.typography.weight.bold);const o=e.typography.size;return o.xxl&&(t["--text-2xl"]=o.xxl),o.xl&&(t["--text-xl"]=o.xl),o.lg&&(t["--text-lg"]=o.lg),o.md&&(t["--text-md"]=o.md),o.base&&(t["--text-base"]=o.base),o.sm&&(t["--text-sm"]=o.sm),o.xs&&(t["--text-xs"]=o.xs),o.hero&&(t["--text-5xl"]=o.hero),t["--theme-transition"]=`${e.motion.slow} ${e.motion.easing}`,function(e){if(!A())return e;const t={},s=/^#[0-9A-Fa-f]{3,6}$/;for(const[n,a]of Object.entries(e))t[n]=s.test(a)?F(a):a;return t}(t)}(e),s=document.documentElement;for(const[n,a]of Object.entries(t))s.style.setProperty(n,a)}(t),document.documentElement.dataset.colorScheme=e}function $a({children:e}){const[t,a]=s.useState(()=>function(){if("undefined"==typeof window)return xe;try{let s=localStorage.getItem(we),n=localStorage.getItem(ke);const a=localStorage.getItem(ve);if(!s&&!n){const e=localStorage.getItem(Se);if(e){const t=be.find(t=>t.id===e);t&&(s=t.colorScheme,n=t.backgroundImage,localStorage.setItem(we,s),localStorage.setItem(ke,n),localStorage.removeItem(Se))}}const o=s&&"string"==typeof(t=s)&&ge.some(e=>e.id===t)?s:xe.colorScheme;let i=xe.backgroundImage;""===n?i="":n&&"string"==typeof(e=n)&&ye.some(t=>t.src===e)&&(i=n);let r=xe.brightness;if(a){const e=parseInt(a,10);!isNaN(e)&&e>=0&&e<=100&&(r=e)}return{colorScheme:o,backgroundImage:i,brightness:r}}catch{return xe}var e,t}());s.useEffect(()=>{Ba(t.colorScheme),Aa.clear(),requestAnimationFrame(()=>{!function(){if("undefined"==typeof window)return;for(const t of _e){const e=De(`--palette-${t}-bright`),s=De(`--palette-${t}`),n=e||s;if(!n)continue;const a=Ne(n);for(const o of Me)Ie(`--palette-${t}-${o}`,a[o])}const e=De("--palette-bg-4");if(e){const t=Ne(e);for(const e of Me)Ie(`--palette-neutral-${e}`,t[e])}}()})},[t.colorScheme]),s.useEffect(()=>{!function(e){if("undefined"!=typeof window)try{localStorage.setItem(we,e.colorScheme),localStorage.setItem(ke,e.backgroundImage),localStorage.setItem(ve,String(e.brightness))}catch{}}(t)},[t]),s.useEffect(()=>{ye.forEach(e=>{(new Image).src=e.src})},[]);const o=s.useCallback(e=>{a(t=>({...t,colorScheme:e}))},[]),i=s.useCallback(e=>{const t=ye.find(t=>t.src===e);a(s=>({...s,backgroundImage:e,brightness:(null==t?void 0:t.suggestedBrightness)??s.brightness}))},[]),r=s.useCallback(e=>{const t=Math.max(0,Math.min(100,Math.round(e)));a(e=>({...e,brightness:t}))},[]),l=s.useCallback(e=>{const t=be.find(t=>t.id===e);t&&a(e=>({...e,colorScheme:t.colorScheme,backgroundImage:t.backgroundImage}))},[]),c=s.useMemo(()=>({theme:t,setColorScheme:o,setBackgroundImage:i,setBrightness:r,setThemePreset:l}),[t,o,i,r,l]);return n.jsx(Oa.Provider,{value:c,children:e})}function Wa(){const e=s.useContext(Oa);if(!e)throw new Error("useTheme must be used within a ThemeProvider. Wrap your app with in App.tsx.");return e}const Ha="0.9.153",qa="'JetBrains Mono', monospace",Ua=s.memo(function({height:e=16,responsive:t=!1,className:s=""}){const a="var(--accent-primary)",o="#FFFFFF";if(t){const e=145,t=24;return n.jsxs("svg",{className:s,viewBox:`0 0 ${e} ${t}`,preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"pyMC:Console",style:{display:"block",width:"80%",height:"auto"},children:[n.jsx("style",{children:`\n .logo-text {\n font-family: ${qa};\n }\n .logo-accent {\n fill: var(--accent-primary, #719CDF);\n }\n `}),n.jsxs("text",{x:"0",y:"18",className:"logo-text",fontSize:"20",fontWeight:"400",letterSpacing:"-0.02em",children:[n.jsx("tspan",{className:"logo-accent",children:"py"}),n.jsx("tspan",{fill:o,children:"MC"}),n.jsx("tspan",{className:"logo-accent",children:":"}),n.jsx("tspan",{fill:o,children:"Console"})]})]})}const i="string"==typeof e?parseFloat(e):e,r={fontFamily:qa,fontSize:.8*i+"px",fontWeight:400,lineHeight:1,letterSpacing:"-0.02em",whiteSpace:"nowrap"};return n.jsxs("span",{className:s,style:r,role:"img","aria-label":"pyMC:Console",children:[n.jsx("span",{style:{color:a},children:"py"}),n.jsx("span",{style:{color:o},children:"MC"}),n.jsx("span",{style:{color:a},children:":"}),n.jsx("span",{style:{color:o},children:"Console"})]})}),Ja={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"},Ga={0:"T_FLOOD",1:"FLOOD",2:"DIRECT",3:"T_DIRECT"},Ya={REQ:0,RESPONSE:1,TXT_MSG:2,ACK:3,ADVERT:4,GRP_TXT:5,GRP_DATA:6,ANON_REQ:7,PATH:8,TRACE:9,MULTIPART:10,RAW_CUSTOM:15};function Va(e){return 1===e||0===e}const Ka={spreadingFactor:7,bandwidthHz:125e3,codingRate:5,preambleLength:8,crcEnabled:!0,explicitHeader:!0};function Xa(e){if(e.raw_packet){const t=e.raw_packet;if(/^[0-9a-fA-F]+$/.test(t)&&t.length%2==0)return t.length/2;if(/^[A-Za-z0-9+/=]+$/.test(t)){const e=(t.match(/=+$/)||[""])[0].length;return Math.floor(3*t.length/4)-e}return t.length}if(e.length&&e.length>0)return e.length;if(e.payload_length&&e.payload_length>0)return e.payload_length;if(e.payload){const t=e.payload;return/^[0-9a-fA-F]+$/.test(t)&&t.length%2==0?t.length/2:t.length}return 32}function Qa(e,t={}){const s=t.spreadingFactor??Ka.spreadingFactor,n=t.bandwidthHz??Ka.bandwidthHz,a=t.codingRate??Ka.codingRate,o=t.preambleLength??Ka.preambleLength??8,i=t.crcEnabled??Ka.crcEnabled?1:0,r=t.explicitHeader??Ka.explicitHeader?0:1,l=s>=11&&n<=125e3?1:0,c=n/1e3,u=Math.pow(2,s)/c,d=(o+4.25)*u,h=Math.max(8*e-4*s+28+16*i-20*r,0),f=4*(s-2*l);return d+(8+Math.ceil(h/f)*a)*u}const Za="pymc_jwt_token",eo="pymc_client_id",to="pymc_remember_me",so=new Set;function no(e){return so.add(e),()=>so.delete(e)}function ao(e){for(const s of so)try{s(e)}catch(t){}}function oo(){let e=localStorage.getItem(eo);return e||(e=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(eo,e)),e}function io(){return"true"===localStorage.getItem(to)}function ro(e){e?localStorage.setItem(to,"true"):localStorage.removeItem(to)}function lo(){return io()?localStorage:sessionStorage}function co(){return lo().getItem(Za)||localStorage.getItem(Za)||sessionStorage.getItem(Za)}function uo(e){lo().setItem(Za,e),io()?sessionStorage.removeItem(Za):localStorage.removeItem(Za),ao(e)}function ho(){localStorage.removeItem(Za),sessionStorage.removeItem(Za),ao(null)}function fo(){return!(!co()||mo()&&(ho(),1))}function po(e){try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(t).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(s)}catch{return null}}function mo(){const e=co();if(!e)return!0;const t=po(e);return!t||!t.exp||Date.now()>=1e3*t.exp-6e4}function go(){const e=co();if(!e)return 0;const t=po(e);return t&&t.exp?Math.max(0,Math.floor((1e3*t.exp-Date.now())/1e3)):0}function yo(){const e=co();if(!e)return!1;const t=po(e);if(!t||!t.exp)return!1;const s=1e3*t.exp-Date.now();return s>0&&s<3e5}function bo(){const e=co();if(!e)return null;const t=po(e);return t&&t.sub?t.sub:null}async function xo(e,t,s=!1){ro(s);try{const s=await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,client_id:oo()})}),n=s.headers.get("content-type");if(!n||!n.includes("application/json"))return{success:!1,error:`Server error: ${s.status}`};const a=await s.json();return a.success&&a.token?(uo(a.token),{success:!0}):{success:!1,error:a.error||"Login failed"}}catch(n){return{success:!1,error:"Connection error. Please try again."}}}async function wo(){const e=co();if(!e)return!1;const t=po(e);(null==t?void 0:t.exp)&&Math.floor((1e3*t.exp-Date.now())/1e3);try{const t=await fetch("/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({client_id:oo()})});if(!t.ok){let e="";try{const s=await t.json();e=s.error||JSON.stringify(s)}catch{e=t.statusText}return!1}const s=await t.json();if(s.success&&s.token){uo(s.token);const e=po(s.token);return(null==e?void 0:e.exp)&&Math.floor((1e3*e.exp-Date.now())/1e3),!0}return!1}catch(s){return!1}}let ko=null;async function vo(){const e=co();if(!e)return!1;const t=po(e);return(null==t?void 0:t.exp)&&Math.floor((1e3*t.exp-Date.now())/1e3),!yo()||ko||(ko=wo().finally(()=>{ko=null}),ko)}function So(){ho()}let Co=!1;function To(){if(Co)return;if("undefined"==typeof document)return;const e=async()=>{if("visible"!==document.visibilityState)return;if(!co())return;if(mo())return ho(),void("undefined"==typeof window||window.location.pathname.includes("/login")||(window.location.href="/login"));const e=go();e>0&&e<300&&await wo()};document.addEventListener("visibilitychange",e),Co=!0,"visible"===document.visibilityState&&e()}const Mo=Object.freeze(Object.defineProperty({__proto__:null,clearToken:ho,getClientId:oo,getRememberMe:io,getToken:co,getTokenTimeRemaining:go,getUsername:bo,isAuthenticated:fo,isTokenExpired:mo,login:xo,logout:So,onTokenChange:no,parseJWT:po,refreshToken:wo,refreshTokenIfNeeded:vo,setRememberMe:ro,setToken:uo,shouldRefreshToken:yo,startVisibilityBasedRefresh:To},Symbol.toStringTag,{value:"Module"})),_o=new Map;let Lo=!1;async function jo(e,t,s=!1){const n=function(e,t){return(null==t?void 0:t.method)&&"GET"!==t.method?"":e}(e,t);if(n){const e=_o.get(n);if(e)return e}const a=`${e}`;!s&&yo()&&await wo();const o=co();if(!o&&!e.includes("/auth/"))throw window.location.href="/login",new Error("Not authenticated");const i=o?{Authorization:`Bearer ${o}`}:{};if(null==t?void 0:t.headers){const e=t.headers;e instanceof Headers?e.forEach((e,t)=>{i[t]=e}):Array.isArray(e)?e.forEach(([e,t])=>{i[e]=t}):Object.assign(i,e)}(null==t?void 0:t.body)&&(i["Content-Type"]="application/json");const r=(async()=>{const n=await fetch(a,{...t,headers:i});if(401===n.status){if(!s&&!Lo&&await wo())return jo(e,t,!0);throw Lo||(Lo=!0,ho(),window.location.replace("/login")),new Error("Session expired. Please log in again.")}if(!n.ok)throw new Error(`API error: ${n.status} ${n.statusText} (${e})`);return n.json()})();return n&&(_o.set(n,r),r.finally(()=>{_o.delete(n)})),r}function Eo(e){return e&&"chat node"===e.toLowerCase()?"Companion":e}async function Po(){return function(e){if(e.neighbors)for(const t of Object.values(e.neighbors))t.contact_type=Eo(t.contact_type);return e}(await jo("/api/stats"))}async function No(){return jo("/api/logs")}async function Do(e=24){return jo(`/api/noise_floor_history?hours=${e}`)}async function Io(){return jo("/api/hardware_stats")}async function Fo(){return jo("/api/send_advert",{method:"POST",body:"{}"})}async function Ao(e){return jo("/api/set_mode",{method:"POST",body:JSON.stringify({mode:e})})}async function Ro(e){return jo("/api/set_duty_cycle",{method:"POST",body:JSON.stringify({enabled:e})})}const zo=new Map;function Oo(e=!1){if(e)zo.clear();else for(const[t]of zo)parseInt(t.split("-")[0],10)<=60&&zo.delete(t)}function Bo(e,t,s,n){const a=60*e/t,o=Math.floor(Date.now()/1e3),i=Math.floor(o/a)*a,r=i-60*e,l=s.filter(e=>e.timestamp>=r&&e.timestamp<=i),c=n?function(e){var t;const s=null==(t=null==e?void 0:e.config)?void 0:t.radio;return{spreadingFactor:(null==s?void 0:s.spreading_factor)??Ka.spreadingFactor,bandwidthHz:(null==s?void 0:s.bandwidth)??Ka.bandwidthHz,codingRate:(null==s?void 0:s.coding_rate)??Ka.codingRate,preambleLength:(null==s?void 0:s.preamble_length)??Ka.preambleLength,crcEnabled:!0,explicitHeader:!0}}(n):Ka,u=function(e,t,s,n,a){const o=new Array(t),i=new Array(t),r=new Array(t),l=new Array(t),c=new Array(t);for(let d=0;d=t)continue;const f=Qa(Xa(u),a),p=u.packet_origin;"tx_local"===p?(i[h].count++,i[h].airtime_ms+=f):"tx_forward"===p||u.transmitted?(r[h].count++,r[h].airtime_ms+=f):u.drop_reason&&(l[h].count++,l[h].airtime_ms+=f),"tx_local"!==p&&(o[h].count++,o[h].airtime_ms+=f,c[h].snr+=u.snr||0,c[h].rssi+=u.rssi||0,c[h].count++)}for(let d=0;d0&&(o[d].avg_snr=c[d].snr/c[d].count,o[d].avg_rssi=c[d].rssi/c[d].count);return{received:o,transmitted:i,forwarded:r,dropped:l}}(l,t,r,a,c);return{time_range_minutes:e,bucket_count:t,bucket_duration_seconds:a,start_time:r,end_time:i,...u}}async function $o(e){return jo("/api/update_radio_config",{method:"POST",body:JSON.stringify(e)})}async function Wo(e){return jo("/api/set_log_level",{method:"POST",body:JSON.stringify({level:e})})}async function Ho(){return jo("/api/transport_keys")}async function qo(e){return jo("/api/transport_keys",{method:"POST",body:JSON.stringify(e)})}async function Uo(e,t){return jo(`/api/transport_key/${e}`,{method:"PUT",body:JSON.stringify(t)})}async function Jo(e){return jo(`/api/transport_key/${e}`,{method:"DELETE"})}async function Go(e){return jo("/api/global_flood_policy",{method:"POST",body:JSON.stringify({global_flood_allow:e})})}async function Yo(e,t=10){return jo("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:e,timeout:t})})}async function Vo(e){return jo("/api/update_web_config",{method:"POST",body:JSON.stringify(e)})}async function Ko(){return jo("/api/check_pymc_console")}async function Xo(){return jo("/api/restart_service",{method:"POST",body:"{}"})}async function Qo(){return jo("/auth/tokens")}async function Zo(e){return jo("/auth/tokens",{method:"POST",body:JSON.stringify({name:e})})}async function ei(e){return jo(`/auth/tokens/${e}`,{method:"DELETE"})}const ti="pymc-packet-cache",si="pymc-packet-cache-meta",ni=36e5,ai=12096e5,oi=5e3,ii=5e5,ri=new class{constructor(){t(this,"packets",new Map),t(this,"sortedPackets",[]),t(this,"sortedDirty",!0),t(this,"meta",{oldestTimestamp:0,newestTimestamp:0,lastUpdated:0,packetCount:0,backgroundLoadComplete:!1,topologyLoadComplete:!1,dataTier:"24h",threeDayLoadComplete:!1,sevenDayLoadComplete:!1,fourteenDayLoadComplete:!1}),t(this,"isLoading",!1),t(this,"isBackgroundLoading",!1),t(this,"isTopologyLoading",!1),t(this,"listeners",new Set),t(this,"loadProgress",null),t(this,"statusMessage",""),this.loadFromStorage()}subscribe(e){return this.listeners.add(e),e(this.getState()),()=>this.listeners.delete(e)}getState(){return{isLoading:this.isLoading,isBackgroundLoading:this.isBackgroundLoading,isTopologyLoading:this.isTopologyLoading,backgroundLoadComplete:this.meta.backgroundLoadComplete,topologyLoadComplete:this.meta.topologyLoadComplete,packetCount:this.packets.size,statusMessage:this.statusMessage,loadProgress:this.loadProgress,dataTier:this.meta.dataTier,threeDayLoadComplete:this.meta.threeDayLoadComplete,sevenDayLoadComplete:this.meta.sevenDayLoadComplete,fourteenDayLoadComplete:this.meta.fourteenDayLoadComplete}}getDataTier(){return this.meta.dataTier}getPackets(){return this.sortedDirty&&(this.sortedPackets=Array.from(this.packets.values()).sort((e,t)=>(e.timestamp??0)-(t.timestamp??0)),this.sortedDirty=!1),this.sortedPackets}isStale(){return 0===this.packets.size||Date.now()-this.meta.lastUpdated>ni}isHeavyLoadInProgress(){return this.isBackgroundLoading||this.isTopologyLoading}async initialLoad(e){if(this.isStale()&&this.packets.size>0&&this.clear(),this.meta.backgroundLoadComplete&&this.packets.size>0)return this.getPackets();this.isLoading=!0;const t=Date.now(),s=Math.floor((t-864e5)/1e3),n=3e4;this.loadProgress={loaded:0,target:n,percent:0},this.statusMessage="Loading 24h history...",this.notifyListeners();try{let t;this.packets.size>0&&(this.packets.clear(),this.sortedPackets=[],this.sortedDirty=!0,this.meta.oldestTimestamp=0,this.meta.newestTimestamp=0);let a=0,o=0,i=0;const r=Math.ceil(100);for(let l=0;l0))break;{const n=this.packets.size;this.mergePackets(u.data);const i=this.packets.size-n;a+=i;const r=Math.min(...u.data.map(e=>e.timestamp??1/0));if(r!==1/0&&(void 0===t||r=2)break}else o=0;if(u.data.length=ii)break}l=5){this.statusMessage="Connection issues, loaded partial data",this.notifyListeners();break}await this.delay(2e3)}}this.enforceMemoryCap(),this.meta.backgroundLoadComplete=!0,this.meta.dataTier="24h",this.loadProgress={loaded:this.packets.size,target:this.packets.size,percent:100},this.notifyListeners(),this.saveToStorage()}catch(a){this.statusMessage="Load failed"}finally{this.isLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}return this.getPackets()}async quickLoad(){return this.initialLoad()}async backgroundLoad(){await this.initialLoad()}async loadThreeDays(e){this.meta.threeDayLoadComplete||this.isBackgroundLoading||await this.loadExtendedData("3d",2592e5,e)}async loadSevenDays(e){this.meta.sevenDayLoadComplete||this.isBackgroundLoading||(this.meta.threeDayLoadComplete||await this.loadThreeDays(e),await this.loadExtendedData("7d",6048e5,e))}async loadFourteenDays(e){this.meta.fourteenDayLoadComplete||this.isBackgroundLoading||(this.meta.sevenDayLoadComplete||await this.loadSevenDays(e),await this.loadExtendedData("14d",ai,e))}async loadExtendedData(e,t,s){this.isBackgroundLoading=!0;const n=Date.now(),a=Math.floor((n-t)/1e3),o=3e4*("3d"===e?2:"7d"===e?4:7);this.loadProgress={loaded:0,target:o,percent:0},this.statusMessage=`Loading ${e} history...`,this.notifyListeners();try{let t=this.meta.oldestTimestamp||void 0,n=0,i=0,r=0;const l=Math.ceil(100);for(let c=0;c0))break;{const e=this.packets.size;this.mergePackets(d.data);const o=this.packets.size-e;n+=o;const r=Math.min(...d.data.map(e=>e.timestamp??1/0));if(r!==1/0&&(void 0===t||r=2)break}else i=0;if(d.data.length=ii)break}c=5)break;await this.delay(2e3)}}this.enforceMemoryCap(),"3d"===e?(this.meta.threeDayLoadComplete=!0,this.meta.dataTier="3d"):"7d"===e?(this.meta.sevenDayLoadComplete=!0,this.meta.dataTier="7d"):(this.meta.fourteenDayLoadComplete=!0,this.meta.dataTier="14d"),this.loadProgress={loaded:n,target:n,percent:100},this.notifyListeners(),this.saveToStorage()}catch(i){this.statusMessage=`${e} load failed`}finally{this.isBackgroundLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}}isDataTierAvailable(e){switch(e){case"24h":return this.meta.backgroundLoadComplete;case"3d":return this.meta.threeDayLoadComplete;case"7d":return this.meta.sevenDayLoadComplete;case"14d":return this.meta.fourteenDayLoadComplete;default:return!1}}async topologyLoad(){if(!this.meta.topologyLoadComplete&&!this.isTopologyLoading)return this.doTopologyLoad()}async forceTopologyLoad(){if(!this.isTopologyLoading)return this.meta.topologyLoadComplete=!1,this.doTopologyLoad()}async forceDeepLoad(){return this.forceTopologyLoad()}async doTopologyLoad(){this.isTopologyLoading=!0;const e=Date.now(),t=Math.floor((e-ai)/1e3),s=42e4;this.statusMessage="Loading 14-day topology...",this.loadProgress={loaded:0,target:s,percent:0},this.notifyListeners();try{let e,n=0,a=0,o=0;const i=Math.ceil(100);for(let r=0;r0))break;{const s=this.packets.size;this.mergePackets(c.data);const o=this.packets.size-s;n+=o;const i=Math.min(...c.data.map(e=>e.timestamp??1/0));if(i!==1/0&&(void 0===e||i=2)break}else a=0;if(c.data.length=ii)break}r=5){this.statusMessage="Connection issues, loaded partial data",this.notifyListeners();break}await this.delay(2e3)}}this.statusMessage=`Processing ${this.packets.size.toLocaleString()} packets...`,this.loadProgress={loaded:this.packets.size,target:this.packets.size,percent:100},this.notifyListeners(),this.enforceMemoryCap(),this.meta.topologyLoadComplete=!0,this.meta.threeDayLoadComplete=!0,this.meta.sevenDayLoadComplete=!0,this.meta.fourteenDayLoadComplete=!0,this.meta.dataTier="14d",this.saveToStorage()}catch(n){this.statusMessage="Topology load failed"}finally{this.isTopologyLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}}async poll(){try{const e=await this.fetchRecentPackets(100);if(e.success&&e.data){const t=this.packets.size;this.mergePackets(e.data),this.packets.size>t&&(this.saveToStorage(),this.notifyListeners())}}catch(e){}return this.getPackets()}clear(){this.packets.clear(),this.sortedPackets=[],this.sortedDirty=!0,this.meta={oldestTimestamp:0,newestTimestamp:0,lastUpdated:0,packetCount:0,backgroundLoadComplete:!1,topologyLoadComplete:!1,dataTier:"24h",threeDayLoadComplete:!1,sevenDayLoadComplete:!1,fourteenDayLoadComplete:!1},this.clearStorage(),this.notifyListeners()}mergePacketsDirectly(e){const t=this.packets.size;this.mergePackets(e);const s=this.packets.size-t;return s>0&&(this.enforceMemoryCap(),this.saveToStorage(),this.notifyListeners()),s}mergePackets(e){let t=!1;for(const s of e){const e=s.packet_hash;if(e&&!this.packets.has(e)){this.packets.set(e,s),t=!0;const n=s.timestamp??0;(0===this.meta.oldestTimestamp||nthis.meta.newestTimestamp&&(this.meta.newestTimestamp=n)}}t&&(this.sortedDirty=!0),this.meta.lastUpdated=Date.now(),this.meta.packetCount=this.packets.size}notifyListeners(){const e=this.getState();for(const t of this.listeners)t(e)}delay(e){return new Promise(t=>setTimeout(t,e))}async fetchChunkWithRetry(e,t,s,n,a){for(let i=0;i<3;i++)try{return await this.fetchFilteredPackets(e,t,!1,a)}catch(o){const e=2===i,t=1e3*Math.pow(2,i);o instanceof Error&&o.name,e||(this.statusMessage=`Retry in ${Math.round(t/1e3)}s...`,this.notifyListeners(),await this.delay(t))}return null}enforceMemoryCap(){if(this.packets.size<=ii)return;const e=this.getPackets(),t=e.length-ii;for(let s=0;st&&(this.meta.oldestTimestamp=e[t].timestamp??0)}loadFromStorage(){if("undefined"!=typeof window)try{const e=localStorage.getItem(si);e&&(this.meta=JSON.parse(e));const t=localStorage.getItem(ti);if(t){const e=JSON.parse(t);for(const t of e)t.packet_hash&&this.packets.set(t.packet_hash,t)}if(this.meta.lastUpdated>0&&Date.now()-this.meta.lastUpdated>ni)return void this.clear();this.meta.backgroundLoadComplete=!1,this.meta.threeDayLoadComplete=!1,this.meta.sevenDayLoadComplete=!1,this.meta.fourteenDayLoadComplete=!1,this.meta.dataTier="24h";const s=37500;this.meta.topologyLoadComplete&&this.packets.size3e3?e.slice(-3e3):e;localStorage.setItem(ti,JSON.stringify(t))}catch(e){if(e instanceof DOMException&&"QuotaExceededError"===e.name)try{localStorage.removeItem(ti),localStorage.setItem(si,JSON.stringify(this.meta))}catch{}}}clearStorage(){if("undefined"!=typeof window)try{localStorage.removeItem(ti),localStorage.removeItem(si)}catch(e){}}async fetchRecentPackets(e=1e3,t=!1){const s=`/api/recent_packets?limit=${e}`,{getToken:n}=await N(async()=>{const{getToken:e}=await Promise.resolve().then(()=>Mo);return{getToken:e}},void 0),a=n(),o={};a&&(o.Authorization=`Bearer ${a}`);const i=await fetch(s,{headers:o});if(401===i.status&&!t){const{refreshToken:t}=await N(async()=>{const{refreshToken:e}=await Promise.resolve().then(()=>Mo);return{refreshToken:e}},void 0);if(await t())return this.fetchRecentPackets(e,!0)}if(!i.ok)throw new Error(`API error: ${i.status}`);return i.json()}async fetchFilteredPackets(e,t=5e3,s=!1,n){const a=new URLSearchParams;a.set("limit",String(t)),void 0!==e&&a.set("end_timestamp",String(e-.001)),void 0!==n&&a.set("start_timestamp",String(n));const o=`/api/filtered_packets?${a}`,{getToken:i}=await N(async()=>{const{getToken:e}=await Promise.resolve().then(()=>Mo);return{getToken:e}},void 0),r=i(),l={};r&&(l.Authorization=`Bearer ${r}`);const c=new AbortController,u=setTimeout(()=>c.abort(),3e4);try{const n=await fetch(o,{headers:l,signal:c.signal});if(401===n.status&&!s){const{refreshToken:s}=await N(async()=>{const{refreshToken:e}=await Promise.resolve().then(()=>Mo);return{refreshToken:e}},void 0);if(await s())return this.fetchFilteredPackets(e,t,!0)}if(!n.ok)throw new Error(`API error: ${n.status}`);return n.json()}finally{clearTimeout(u)}}};function li(e){return{paths:e.paths,byEndpoints:new Map(e.byEndpointsEntries),canonicalPaths:new Map(e.canonicalPathsEntries),totalObservations:e.totalObservations,uniquePathCount:e.uniquePathCount}}function ci(){return{paths:[],byEndpoints:new Map,canonicalPaths:new Map,totalObservations:0,uniquePathCount:0}}const ui=new class{constructor(){t(this,"worker",null),t(this,"listeners",new Set),t(this,"currentTopology",{edges:[],validatedEdges:[],weakEdges:[],certainEdges:[],uncertainEdges:[],edgeMap:new Map,maxPacketCount:0,maxCertainCount:0,neighborAffinity:new Map,fullAffinity:new Map,localPrefix:null,centrality:new Map,hubNodes:[],gatewayNodes:[],loops:[],loopEdgeKeys:new Set,txDelayRecommendations:new Map,pathRegistry:ci(),edgeBetweenness:new Map,backboneEdges:[],nodeMobility:new Map,mobileNodes:[],pathHealth:[],lastHopNeighbors:[],disambiguationStats:{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:[],viterbiStats:{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}}),t(this,"isComputing",!1),t(this,"pendingRequest",null),t(this,"debounceTimer",null),t(this,"debounceMs",100),this.initWorker()}initWorker(){if("undefined"!=typeof window)try{this.worker=new Worker(new URL("/assets/topology.worker-BHEhB0-W.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>{this.handleWorkerMessage(e.data)},this.worker.onerror=e=>{}}catch(e){}}handleWorkerMessage(e){if(this.isComputing=!1,"error"!==e.type){var t;this.currentTopology={edges:(t=e.payload).edges??[],validatedEdges:t.validatedEdges??[],weakEdges:t.weakEdges??[],certainEdges:t.certainEdges??[],uncertainEdges:t.uncertainEdges??[],maxPacketCount:t.maxPacketCount??0,maxCertainCount:t.maxCertainCount??0,localPrefix:t.localPrefix??null,hubNodes:t.hubNodes??[],gatewayNodes:t.gatewayNodes??[],edgeMap:new Map(t.edgeMapEntries??[]),neighborAffinity:new Map(t.neighborAffinityEntries??[]),fullAffinity:new Map(t.fullAffinityEntries??[]),centrality:new Map(t.centralityEntries??[]),loops:t.loops??[],loopEdgeKeys:new Set(t.loopEdgeKeyEntries??[]),txDelayRecommendations:new Map(t.txDelayRecommendationEntries??[]),pathRegistry:t.pathRegistry?li(t.pathRegistry):ci(),edgeBetweenness:new Map(t.edgeBetweennessEntries??[]),backboneEdges:t.backboneEdges??[],nodeMobility:new Map(t.nodeMobilityEntries??[]),mobileNodes:t.mobileNodes??[],pathHealth:t.pathHealth??[],lastHopNeighbors:t.lastHopNeighbors??[],disambiguationStats:t.disambiguationStats??{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:t.discoveredNodes??[],viterbiStats:t.viterbiStats??{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}};for(const t of this.listeners)try{t(this.currentTopology,e.computeTimeMs)}catch(s){}if(this.pendingRequest){const e=this.pendingRequest;this.pendingRequest=null,this.computeInternal(e)}}}computeInternal(e){if(!this.worker)return;this.isComputing=!0;const t={type:"compute",payload:e};this.worker.postMessage(t)}compute(e,t,s,n,a,o,i,r){const l={packets:e,neighbors:t,localHash:s,localLat:n,localLon:a,airtimeMs:o,zeroHopNeighbors:i,terrainGrid:r,enableTerrainAware:void 0!==r};this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.isComputing?this.pendingRequest=l:this.computeInternal(l)},this.debounceMs)}subscribe(e){return this.listeners.add(e),this.currentTopology.edges.length>0&&e(this.currentTopology,0),()=>{this.listeners.delete(e)}}getTopology(){return this.currentTopology}isWorking(){return this.isComputing}terminate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.worker&&(this.worker.terminate(),this.worker=null),this.listeners.clear()}},di=new class{constructor(){t(this,"worker",null),t(this,"listeners",new Set),t(this,"sparklines",new Map),t(this,"isComputing",!1),t(this,"lastComputeTimeMs",0),t(this,"pendingRequest",null),t(this,"debounceTimer",null),t(this,"debounceMs",150),this.initWorker()}initWorker(){if("undefined"!=typeof window)try{this.worker=new Worker(new URL("/assets/sparkline.worker-CmKhBAy5.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>{this.handleWorkerMessage(e.data)},this.worker.onerror=e=>{this.isComputing=!1,this.notifyListeners()}}catch(e){}}handleWorkerMessage(e){if(this.isComputing=!1,"error"!==e.type){if(this.sparklines=new Map(e.payload.sparklineEntries),this.lastComputeTimeMs=e.computeTimeMs,this.notifyListeners(),this.pendingRequest){const e=this.pendingRequest;this.pendingRequest=null,this.computeInternal(e.packets,e.nodeHashes)}}else this.notifyListeners()}computeInternal(e,t){if(!this.worker)return;if(0===t.length)return this.isComputing=!1,void this.notifyListeners();this.isComputing=!0,this.notifyListeners();const s={type:"compute",payload:{packets:e,nodeHashes:t}};this.worker.postMessage(s)}notifyListeners(){for(const t of this.listeners)try{t(this.sparklines,this.isComputing)}catch(e){}}compute(e,t){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.isComputing?this.pendingRequest={packets:e,nodeHashes:t}:this.computeInternal(e,t)},this.debounceMs)}getSparkline(e){return this.sparklines.get(e)??[]}getAllSparklines(){return this.sparklines}hasSparkline(e){return this.sparklines.has(e)}isWorking(){return this.isComputing}getLastComputeTime(){return this.lastComputeTimeMs}subscribe(e){return this.listeners.add(e),e(this.sparklines,this.isComputing),()=>{this.listeners.delete(e)}}clear(){this.sparklines.clear(),this.notifyListeners()}terminate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.worker&&(this.worker.terminate(),this.worker=null),this.listeners.clear()}},hi=new class{constructor(){t(this,"worker",null),t(this,"isInitialized",!1),t(this,"statsListeners",new Set),t(this,"packetsListeners",new Set),t(this,"errorListeners",new Set),t(this,"readyResolve",null),t(this,"readyPromise",null),t(this,"unsubscribeTokenChange",null)}async init(e){if(!this.isInitialized&&"undefined"!=typeof window){this.readyPromise=new Promise(e=>{this.readyResolve=e});try{this.worker=new Worker(new URL("/assets/polling.worker-DFp1Qyu0.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=e=>{};const t={type:"init",config:{apiBaseUrl:e.apiBaseUrl,authToken:e.authToken,statsIntervalMs:e.statsIntervalMs??3e3,packetsIntervalMs:e.packetsIntervalMs??3e3}};this.worker.postMessage(t),this.isInitialized=!0,this.unsubscribeTokenChange=no(e=>{this.setAuthToken(e)}),await this.readyPromise}catch(t){throw t}}}handleMessage(e){var t;const s=e.data;switch(s.type){case"ready":null==(t=this.readyResolve)||t.call(this);break;case"stats":for(const e of this.statsListeners)try{e(s.data,s.timestamp)}catch(n){}break;case"packets":for(const e of this.packetsListeners)try{e(s.newPackets,s.totalCount,s.newestTimestamp)}catch(n){}break;case"packetsReset":for(const e of this.packetsListeners)try{e([],0,s.newestTimestamp)}catch(n){}break;case"error":for(const e of this.errorListeners)try{e(s.source,s.error)}catch(n){}}}onStats(e){return this.statsListeners.add(e),()=>this.statsListeners.delete(e)}onPackets(e){return this.packetsListeners.add(e),()=>this.packetsListeners.delete(e)}onError(e){return this.errorListeners.add(e),()=>this.errorListeners.delete(e)}setAuthToken(e){if(!this.worker)return;const t={type:"setAuth",token:e};this.worker.postMessage(t)}setLiveMode(e){if(!this.worker)return;const t={type:"setLiveMode",enabled:e};this.worker.postMessage(t)}forceRefresh(){this.worker&&this.worker.postMessage({type:"forceRefresh"})}clearCache(){this.worker&&this.worker.postMessage({type:"clearCache"})}terminate(){if(this.unsubscribeTokenChange&&(this.unsubscribeTokenChange(),this.unsubscribeTokenChange=null),this.worker){const e={type:"stop"};this.worker.postMessage(e),this.worker.terminate(),this.worker=null}this.isInitialized=!1,this.statsListeners.clear(),this.packetsListeners.clear(),this.errorListeners.clear()}isReady(){return this.isInitialized}},fi=new class{constructor(){t(this,"ws",null),t(this,"connectionState","disconnected"),t(this,"reconnectAttempts",0),t(this,"pingIntervalId",null),t(this,"lastPongTime",Date.now()),t(this,"reconnectTimeoutId",null),t(this,"packetListeners",new Set),t(this,"statsListeners",new Set),t(this,"systemStatsListeners",new Set),t(this,"packetStatsListeners",new Set),t(this,"connectionListeners",new Set),t(this,"unsubscribeTokenChange",null),t(this,"wsSupported",!0)}buildWsUrl(){return`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/ws/packets`}connect(){var e,t;if((null==(e=this.ws)?void 0:e.readyState)!==WebSocket.OPEN&&(null==(t=this.ws)?void 0:t.readyState)!==WebSocket.CONNECTING&&this.wsSupported){this.setConnectionState("connecting");try{const e=this.buildWsUrl();this.ws=new WebSocket(e),this.ws.onopen=this.handleOpen.bind(this),this.ws.onmessage=this.handleMessage.bind(this),this.ws.onerror=this.handleError.bind(this),this.ws.onclose=this.handleClose.bind(this),this.unsubscribeTokenChange||(this.unsubscribeTokenChange=no(e=>{e&&"connected"===this.connectionState&&(this.disconnect(),this.connect())}))}catch(s){this.wsSupported=!1,this.setConnectionState("disconnected")}}}disconnect(){this.clearPingInterval(),this.clearReconnectTimeout(),this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.readyState!==WebSocket.OPEN&&this.ws.readyState!==WebSocket.CONNECTING||this.ws.close(1e3,"Client disconnect"),this.ws=null),this.setConnectionState("disconnected"),this.reconnectAttempts=0}isConnected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}getConnectionState(){return this.connectionState}isSupported(){return this.wsSupported}send(e){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(e)),!0}catch(t){return!1}}onPacket(e){return this.packetListeners.add(e),()=>this.packetListeners.delete(e)}onStats(e){return this.statsListeners.add(e),()=>this.statsListeners.delete(e)}onSystemStats(e){return this.systemStatsListeners.add(e),()=>this.systemStatsListeners.delete(e)}onPacketStats(e){return this.packetStatsListeners.add(e),()=>this.packetStatsListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),e(this.connectionState,this.reconnectAttempts),()=>this.connectionListeners.delete(e)}handleOpen(){this.setConnectionState("connected"),this.reconnectAttempts=0,this.lastPongTime=Date.now();const e=co();e&&this.ws&&this.ws.send(JSON.stringify({type:"auth",token:e})),this.startPingInterval()}handleMessage(e){try{const t=JSON.parse(e.data);switch(t.type){case"packet":this.notifyPacketListeners(t.data);break;case"stats":{const e=t.data;e&&"noise_floor_dbm"in e&&this.notifyStatsListeners(e),(null==e?void 0:e.packet_stats)&&this.notifyPacketStatsListeners(e.packet_stats),(null==e?void 0:e.system_stats)&&this.notifySystemStatsListeners(e.system_stats);break}case"packet_stats":{const e=t.data;this.notifyPacketStatsListeners(e);break}case"system_stats":this.notifySystemStatsListeners(t.data);break;case"ping":this.lastPongTime=Date.now(),this.send({type:"pong"});break;case"pong":this.lastPongTime=Date.now()}}catch(t){}}handleError(e){}handleClose(e){this.clearPingInterval(),1e3!==e.code?(1006===e.code&&this.reconnectAttempts,this.scheduleReconnect()):this.setConnectionState("disconnected")}setConnectionState(e){if(this.connectionState!==e){this.connectionState=e;for(const s of this.connectionListeners)try{s(e,this.reconnectAttempts)}catch(t){}}}notifyPacketListeners(e){for(const s of this.packetListeners)try{s(e)}catch(t){}}notifyStatsListeners(e){for(const s of this.statsListeners)try{s(e)}catch(t){}}notifySystemStatsListeners(e){for(const s of this.systemStatsListeners)try{s(e)}catch(t){}}notifyPacketStatsListeners(e){for(const s of this.packetStatsListeners)try{s(e)}catch(t){}}startPingInterval(){this.clearPingInterval(),this.pingIntervalId=setInterval(()=>{var e;(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN&&(this.send({type:"ping"}),Date.now()-this.lastPongTime>6e4&&(this.disconnect(),this.connect()))},3e4)}clearPingInterval(){this.pingIntervalId&&(clearInterval(this.pingIntervalId),this.pingIntervalId=null)}scheduleReconnect(){if(this.reconnectAttempts>=20)return this.wsSupported=!1,void this.setConnectionState("disconnected");this.setConnectionState("reconnecting");const e=Math.min(1e3*Math.pow(2,Math.min(this.reconnectAttempts,5)),3e4);this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.reconnectTimeoutId=null,this.connect()},e)}clearReconnectTimeout(){this.reconnectTimeoutId&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null)}terminate(){this.disconnect(),this.unsubscribeTokenChange&&(this.unsubscribeTokenChange(),this.unsubscribeTokenChange=null),this.packetListeners.clear(),this.statsListeners.clear(),this.systemStatsListeners.clear(),this.packetStatsListeners.clear(),this.connectionListeners.clear()}},pi=a(e=>({connectionState:"disconnected",isSupported:!0,reconnectAttempt:0,lastConnected:null,initialize:()=>{fi.onConnectionChange((t,s)=>{e(e=>({connectionState:t,reconnectAttempt:s??0,isSupported:fi.isSupported(),lastConnected:"connected"===t?Date.now():e.lastConnected}))}),fi.connect()}})),mi=.05,gi=1e3,yi="terrarium";function bi(e,t,s){try{return e.queryTerrainElevation({lng:t,lat:s})??0}catch{return 0}}const xi=a((e,t)=>({terrainGrid:null,isLoading:!1,error:null,lastLoadedAt:null,cachedBounds:null,terrainDisambiguationEnabled:!0,loadTerrain:async(s,n)=>{const a=t();if(!(a.isLoading||(o=a.cachedBounds,i=s,o&&o.minLat<=i.minLat&&o.maxLat>=i.maxLat&&o.minLng<=i.minLng&&o.maxLng>=i.maxLng))){var o,i;e({isLoading:!0,error:null});try{n.getTerrain()||(n.getSource(yi)||(n.addSource(yi,{type:"raster-dem",tiles:["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],encoding:"terrarium",tileSize:256}),await new Promise((e,t)=>{const s=setTimeout(()=>t(new Error("Terrain source load timeout")),1e4),a=t=>{t.sourceId===yi&&t.isSourceLoaded&&(clearTimeout(s),n.off("sourcedata",a),e())};n.on("sourcedata",a)})),n.setTerrain({source:yi}),await new Promise(e=>setTimeout(e,500)));const t=await async function(e,t){const{minLat:s,maxLat:n,minLng:a,maxLng:o}=t;let i=Math.ceil((o-a)/.001),r=Math.ceil((n-s)/.001);i>gi&&(i=gi),r>gi&&(r=gi);const l=(o-a)/i,c=(n-s)/r,u=Math.max(l,c),d=new Float32Array(i*r);let h=0;for(let f=0;fsetTimeout(e,0))}}return{origin:[s,a],cellSize:u,width:i,height:r,elevations:d}}(n,s);e({terrainGrid:t,isLoading:!1,lastLoadedAt:Date.now(),cachedBounds:s})}catch(r){const t=r instanceof Error?r.message:"Unknown error loading terrain";e({isLoading:!1,error:t})}}},preloadFromNodes:async(e,s)=>{const n=function(e){const t=e.filter(e=>void 0!==e.latitude&&void 0!==e.longitude&&(0!==e.latitude||0!==e.longitude));if(0===t.length)return null;let s=1/0,n=-1/0,a=1/0,o=-1/0;for(const i of t)s=Math.min(s,i.latitude),n=Math.max(n,i.latitude),a=Math.min(a,i.longitude),o=Math.max(o,i.longitude);return{minLat:s-mi,maxLat:n+mi,minLng:a-mi,maxLng:o+mi}}(e);n&&await t().loadTerrain(n,s)},clearTerrain:()=>{e({terrainGrid:null,cachedBounds:null,lastLoadedAt:null,error:null})},setTerrainDisambiguationEnabled:t=>{e({terrainDisambiguationEnabled:t})},getTerrainGridForDisambiguation:()=>{const e=t();return e.terrainDisambiguationEnabled?e.terrainGrid:null}}));function wi(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2,4).toUpperCase():e.slice(0,2).toUpperCase()}function ki(e,t){let s=e.forwarded_path??e.original_path;if("string"==typeof s)try{s=JSON.parse(s)}catch{return null}if(!s||!Array.isArray(s)||0===s.length)return null;const n=s.map(e=>String(e).toUpperCase()),a=t?wi(t):null,o=n[n.length-1],i=null!==a&&o===a,r=i?n.slice(0,-1):[...n];return{effective:r,original:n,hadLocal:i,effectiveLength:r.length}}function vi(e,t){const s=e.toUpperCase();return t.startsWith("0x")||t.startsWith("0X")?t.slice(2).toUpperCase().startsWith(s):t.toUpperCase().startsWith(s)}const Si=[{label:"20m",minutes:20,buckets:40},{label:"1h",minutes:60,buckets:60},{label:"3h",minutes:180,buckets:90},{label:"12h",minutes:720,buckets:72},{label:"24h",minutes:1440,buckets:96},{label:"3d",minutes:4320,buckets:72},{label:"7d",minutes:10080,buckets:84},{label:"14d",minutes:20160,buckets:168}],Ci=[{label:"1h",hours:1},{label:"3h",hours:3},{label:"12h",hours:12},{label:"24h",hours:24},{label:"3d",hours:72},{label:"7d",hours:168},{label:"14d",hours:336}];function Ti(e){switch(e){case 1:return 3600;case 3:case 12:return 5400;case 24:return 8640;case 72:case 168:case 336:return 720;default:{const t=3600*e,s=Math.round(t/10);return Math.min(Math.max(360,s),720)}}}const Mi="'JetBrains Mono', 'SF Mono', Monaco, monospace",_i={stats:3e3,packets:3e3,charts:3e4,logs:2e3,system:3e3},Li={DEBUG:"text-[var(--log-debug)]",INFO:"text-[var(--log-info)]",WARNING:"text-[var(--log-warning)]",ERROR:"text-[var(--log-error)]",CRITICAL:"text-[var(--log-critical)]"};function ji(e){return Li[e]??"text-text-muted border-border-subtle"}const Ei="pymc-resource-history",Pi="pymc-resource-last-fetch",Ni="pymc-hidden-contacts",Di="pymc-quick-neighbors",Ii="pymc-local-hash",Fi="pymc-global-time-range";let Ai=null,Ri=null;function zi(e,t){const s=t-1e3*e;return s<=6048e5?"active":s<=12096e5?"stale":"expired"}function Oi(e){return 4===(e.type??e.payload_type)&&!0!==e.transmitted&&function(e){const t=function(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.startsWith("["))try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}return[]}(e.original_path),s=e.route??e.route_type;return 2===(n=s)||3===n?0===t.length:Va(s)?t.length<=1:0===t.length;var n}(e)}function Bi(e,t,s,n,a){if(!e)return null;let o=e;if(e.length<=4){const n=e.replace(/^0x/i,"").toUpperCase();if(n===t)return null;const a=s.get(n);if(!a)return null;o=a}return n.has(o)?o===a?null:o:null}function $i(e,t){e.count++,void 0!==t.rssi&&null!==t.rssi&&(e.rssiSum+=t.rssi,e.rssiCount++),void 0!==t.snr&&null!==t.snr&&(e.snrSum+=t.snr,e.snrCount++);const s=t.timestamp??0;s>e.lastSeen&&(e.lastSeen=s)}function Wi(e){return{hash:e,count:0,rssiSum:0,rssiCount:0,snrSum:0,snrCount:0,lastSeen:0}}function Hi(e,t){const s=zi(e.lastSeen,t);return"expired"===s?null:{hash:e.hash,prefix:wi(e.hash),count:e.count,avgRssi:e.rssiCount>0?e.rssiSum/e.rssiCount:null,avgSnr:e.snrCount>0?e.snrSum/e.snrCount:null,lastSeen:e.lastSeen,status:s}}function qi(){if("undefined"==typeof window)return[];try{const e=localStorage.getItem(Di);if(e)return JSON.parse(e)}catch{}return[]}function Ui(e){"undefined"!=typeof window&&(Ri&&clearTimeout(Ri),Ri=setTimeout(()=>{try{localStorage.setItem(Di,JSON.stringify(e))}catch{}Ri=null},1e3))}function Ji(){if("undefined"!=typeof window)try{const e=localStorage.getItem(Ii);if(e)return e}catch{}}function Gi(e){if("undefined"!=typeof window)try{localStorage.setItem(Ii,e)}catch{}}function Yi(){if("undefined"==typeof window)return[];try{const e=localStorage.getItem(Ei);if(e)return JSON.parse(e)}catch{}return[]}function Vi(){if("undefined"==typeof window)return new Set;try{const e=localStorage.getItem(Ni);if(e)return new Set(JSON.parse(e))}catch{}return new Set}function Ki(){if("undefined"==typeof window)return 0;try{const e=localStorage.getItem(Pi);if(e)return parseInt(e,10)||0}catch{}return 0}function Xi(){if("undefined"==typeof window)return 4;try{const e=localStorage.getItem(Fi);if(e){const t=parseInt(e,10);if(!isNaN(t)&&t>=0&&t<=7)return t}}catch{}return 4}const Qi=a((e,t)=>({stats:null,statsLoading:!1,statsError:null,packets:[],packetsLoading:!1,packetsError:null,lastPacketTimestamp:0,logs:[],logsLoading:!1,liveMode:!0,flashReceived:0,flashAdvert:0,resourceHistory:Yi(),lastResourceFetch:Ki(),hiddenContacts:Vi(),quickNeighbors:qi(),cachedLocalHash:Ji(),initialized:!1,packetCacheState:ri.getState(),mutationsInFlight:new Set,globalTimeRangeIndex:Xi(),initializeApp:async()=>{const{initialized:s}=t();if(!s){e({initialized:!0,statsLoading:!0,packetsLoading:!0}),ri.subscribe(t=>{e({packetCacheState:t})});try{const{hiddenContacts:s}=t(),n=await Po(),a=n.neighbors??{},o=Date.now(),i=[];for(const[e,t]of Object.entries(a)){if(s.has(e))continue;if(!t.zero_hop)continue;const n=zi(t.last_seen??0,o);"expired"!==n&&i.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:n})}i.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const r=n.local_hash;e({stats:n,statsLoading:!1,quickNeighbors:i,cachedLocalHash:r}),Ui(i),r&&Gi(r);const l=()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>{const s=t.timestamp??0;return s>e?s:e},0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},c=await ri.initialLoad(l);if(c.length>0){const s=c.reduce((e,t)=>{const s=t.timestamp??0;return s>e?s:e},0);e({packets:[...c],packetsLoading:!1,lastPacketTimestamp:s}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}else e({packetsLoading:!1})}catch(n){e({statsError:n instanceof Error?n.message:"Failed to initialize",statsLoading:!1,packetsLoading:!1})}pi.getState().initialize(),fi.onPacket(s=>{const{lastPacketTimestamp:n,mutationsInFlight:a}=t();if(!(a.size>0)&&ri.mergePacketsDirectly([s])>0){const a=s.timestamp??0;a>n&&(e({flashReceived:t().flashReceived+1}),Oo());const o=ri.getPackets();e({packets:o,packetsLoading:!1,lastPacketTimestamp:Math.max(n,a)}),t().triggerTopologyCompute()}}),fi.onStats(s=>{const{mutationsInFlight:n,hiddenContacts:a}=t();if(n.size>0)return;const o=s.neighbors??{},i=Date.now(),r=[];for(const[e,t]of Object.entries(o)){if(a.has(e))continue;if(!t.zero_hop)continue;const s=zi(t.last_seen??0,i);"expired"!==s&&r.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:s})}r.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const l=s.local_hash;e({stats:s,statsLoading:!1,quickNeighbors:r,cachedLocalHash:l}),Ui(r),l&&Gi(l)}),fi.onPacketStats(s=>{const{stats:n,mutationsInFlight:a}=t();if(!n||a.size>0)return;const o={...n,rx_count:s.rx_count??n.rx_count,tx_count:s.tx_count??n.tx_count,forwarded_count:s.forwarded_count??n.forwarded_count,dropped_count:s.dropped_count??n.dropped_count};e({stats:o})});try{await hi.init({apiBaseUrl:"",authToken:co()??void 0,statsIntervalMs:_i.stats,packetsIntervalMs:_i.packets}),hi.onStats((s,n)=>{const{mutationsInFlight:a,hiddenContacts:o}=t();if(a.size>0)return;const i=s.neighbors??{},r=Date.now(),l=[];for(const[e,t]of Object.entries(i)){if(o.has(e))continue;if(!t.zero_hop)continue;const s=zi(t.last_seen??0,r);"expired"!==s&&l.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:s})}l.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const c=s.local_hash;e({stats:s,statsLoading:!1,quickNeighbors:l,cachedLocalHash:c}),Ui(l),c&&Gi(c)}),hi.onPackets((s,n,a)=>{if(0===s.length)return;const{lastPacketTimestamp:o}=t();for(const e of s)if(e.packet_hash){ri.mergePacketsDirectly(s);break}const i=a>o;i&&(e({flashReceived:t().flashReceived+1}),Oo());const r=ri.getPackets();e({packets:r,packetsLoading:!1,lastPacketTimestamp:a}),i&&t().triggerTopologyCompute()}),hi.onError((t,s)=>{e("stats"===t?{statsError:s}:{packetsError:s})}),"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{document.hidden||hi.forceRefresh()})}catch(n){!function(e){setInterval(()=>{e().fetchStats()},_i.stats),setInterval(()=>{e().liveMode&&!ri.isHeavyLoadInProgress()&&e().fetchPackets()},_i.packets)}(t)}}},prefetchForRoute:e=>{switch(e){case"/logs":No().catch(()=>{});break;case"/system":Io().catch(()=>{});break;case"/statistics":(async function(e=24){return jo(`/api/packet_type_graph_data?hours=${e}`)})(3).catch(()=>{}),Do(3).catch(()=>{});break;case"/settings":(async function(){return jo("/api/radio_presets")})().catch(()=>{})}},fetchStats:async s=>{const{stats:n,mutationsInFlight:a,hiddenContacts:o}=t();if(!(a.size>0)||(null==s?void 0:s.force)){n||e({statsLoading:!0}),e({statsError:null});try{const t=await Po(),s=t.neighbors??{},n=Date.now(),a=[];for(const[e,r]of Object.entries(s)){if(o.has(e))continue;if(!r.zero_hop)continue;const t=zi(r.last_seen??0,n);"expired"!==t&&a.push({hash:e,prefix:wi(e),count:r.advert_count??0,avgRssi:r.rssi??null,avgSnr:r.snr??null,lastSeen:r.last_seen??0,status:t})}a.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const i=t.local_hash;e({stats:t,statsLoading:!1,quickNeighbors:a,cachedLocalHash:i}),Ui(a),i&&Gi(i)}catch(i){e({statsError:i instanceof Error?i.message:"Failed to fetch stats",statsLoading:!1})}}},fetchPackets:async s=>{const{packets:n,lastPacketTimestamp:a}=t();0===n.length&&e({packetsLoading:!0}),e({packetsError:null});try{const s=await ri.poll(),o=s.length>0?s.reduce((e,t)=>Math.max(e,t.timestamp??0),0):0,i=o>a&&a>0,r=s.length!==n.length||i;i&&(e({flashReceived:t().flashReceived+1}),Oo()),e(r?{packets:s,packetsLoading:!1,lastPacketTimestamp:o||a}:{packetsLoading:!1}),i&&t().triggerTopologyCompute()}catch(o){e({packetsError:o instanceof Error?o.message:"Failed to fetch packets",packetsLoading:!1})}},fetchLogs:async()=>{const{logs:s}=t();0===s.length&&e({logsLoading:!0});try{const t=await No();e({logs:t.logs,logsLoading:!1})}catch{e({logsLoading:!1})}},setLiveMode:t=>{e({liveMode:t}),hi.isReady()&&hi.setLiveMode(t)},setMode:async s=>{const n="setMode",{mutationsInFlight:a}=t(),o=new Set(a);o.add(n),e({mutationsInFlight:o});try{if(!(await Ao(s)).success)throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}catch(i){const{mutationsInFlight:s}=t(),a=new Set(s);throw a.delete(n),e({mutationsInFlight:a}),i}},clearModeMutation:()=>{const{mutationsInFlight:s}=t(),n=new Set(s);n.delete("setMode"),e({mutationsInFlight:n})},setDutyCycle:async s=>{const n="setDutyCycle",{mutationsInFlight:a}=t(),o=new Set(a);o.add(n),e({mutationsInFlight:o});try{if(!(await Ro(s)).success)throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}finally{const{mutationsInFlight:s}=t(),a=new Set(s);a.delete(n),e({mutationsInFlight:a})}},setDutyCycleConfig:async s=>{var n;const a="setDutyCycleConfig",{mutationsInFlight:o}=t(),i=new Set(o);i.add(a),e({mutationsInFlight:i});try{const e=await async function(e){return jo("/api/update_duty_cycle_config",{method:"POST",body:JSON.stringify(e)})}(s);if(!e.success&&!(null==(n=e.data)?void 0:n.persisted))throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}catch(r){const{mutationsInFlight:s}=t(),n=new Set(s);throw n.delete(a),e({mutationsInFlight:n}),r}},clearDutyCycleMutation:()=>{const{mutationsInFlight:s}=t(),n=new Set(s);n.delete("setDutyCycleConfig"),e({mutationsInFlight:n})},startMutation:s=>{const{mutationsInFlight:n}=t(),a=new Set(n);a.add(s),e({mutationsInFlight:a})},clearMutation:s=>{const{mutationsInFlight:n}=t(),a=new Set(n);a.delete(s),e({mutationsInFlight:a})},sendAdvert:async()=>{try{const s=await Fo();return s.success&&e({flashAdvert:t().flashAdvert+1}),s.success}catch(s){return!1}},triggerFlashReceived:()=>{e({flashReceived:t().flashReceived+1})},triggerFlashAdvert:()=>{e({flashAdvert:t().flashAdvert+1})},addResourceDataPoint:(s,n,a)=>{const o=Date.now(),{lastResourceFetch:i,resourceHistory:r}=t();if(o-i<1e3)return;const l=[...r,{timestamp:o,time:new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),cpu:s,memory:n}],c=l.length>a?l.slice(-a):l;var u,d;e({resourceHistory:c,lastResourceFetch:o}),u=c,d=o,"undefined"!=typeof window&&(Ai&&clearTimeout(Ai),Ai=setTimeout(()=>{try{localStorage.setItem(Ei,JSON.stringify(u)),localStorage.setItem(Pi,d.toString())}catch{}Ai=null},1e3))},hideContact:s=>{const{hiddenContacts:n}=t(),a=new Set(n);a.add(s),e({hiddenContacts:a}),function(e){if("undefined"!=typeof window)try{localStorage.setItem(Ni,JSON.stringify([...e]))}catch{}}(a)},clearPacketCache:()=>{ri.clear(),e({packets:[],lastPacketTimestamp:0}),ri.quickLoad().then(s=>{if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:s,lastPacketTimestamp:n}),t().triggerTopologyCompute()}})},triggerTopologyCompute:()=>{var e,s,n,a;const{packets:o,stats:i,hiddenContacts:r}=t();if(0===o.length||!i)return;const l=i.neighbors??{},c=Object.fromEntries(Object.entries(l).filter(([e])=>!r.has(e))),u=i.local_hash,d=null==(s=null==(e=i.config)?void 0:e.repeater)?void 0:s.latitude,h=null==(a=null==(n=i.config)?void 0:n.repeater)?void 0:a.longitude,f=[];for(const[t,m]of Object.entries(c))m.zero_hop&&f.push({hash:t,advertCount:m.advert_count??1,avgRssi:m.rssi??null,avgSnr:m.snr??null,lastSeen:m.last_seen??0,latitude:m.latitude,longitude:m.longitude});const p=xi.getState().getTerrainGridForDisambiguation();ui.compute(o,c,u,d,h,void 0,f,p??void 0)},triggerDeepAnalysis:async()=>{await ri.forceDeepLoad();const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:s,lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},updateQuickNeighbors:()=>{const{packets:s,stats:n,hiddenContacts:a}=t();if(0===s.length||!n)return;const o=n.neighbors??{},i=function(e,t,s){if(!s||0===e.length||0===Object.keys(t).length)return[];const n=Date.now(),a=wi(s),o=new Set(Object.keys(t)),i=function(e){var t,s;const n=new Map;for(const a of Object.keys(e)){const o=wi(a),i=n.get(o);if(i){const r=null==(t=e[i])?void 0:t.zero_hop;(null==(s=e[a])?void 0:s.zero_hop)&&!r&&n.set(o,a)}else n.set(o,a)}return n}(t),r=new Map;for(const c of e){if(!Oi(c))continue;const e=Bi(c.src_hash,a,i,o,s);if(!e)continue;let t=r.get(e);t||(t=Wi(e),r.set(e,t)),$i(t,c)}for(const[c,u]of Object.entries(t))u.zero_hop&&!r.has(c)&&r.set(c,{hash:c,count:u.advert_count??0,rssiSum:u.rssi??0,rssiCount:void 0!==u.rssi?1:0,snrSum:u.snr??0,snrCount:void 0!==u.snr?1:0,lastSeen:u.last_seen??0});const l=[];for(const c of r.values()){const e=Hi(c,n);e&&l.push(e)}return l.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen),l}(s,Object.fromEntries(Object.entries(o).filter(([e])=>!a.has(e))),n.local_hash),r=t().quickNeighbors;(i.length!==r.length||i.some((e,t)=>{var s,n;return e.hash!==(null==(s=r[t])?void 0:s.hash)||e.count!==(null==(n=r[t])?void 0:n.count)}))&&(e({quickNeighbors:i}),Ui(i))},triggerSparklineCompute:()=>{const{packets:e,stats:s,hiddenContacts:n}=t();if(0===e.length||!s)return;const a=s.neighbors??{},o=Object.keys(a).filter(e=>!n.has(e));0!==o.length&&di.compute(e,o)},requestSevenDayData:async()=>{await ri.loadSevenDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},requestThreeDayData:async()=>{await ri.loadThreeDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},requestFourteenDayData:async()=>{await ri.loadFourteenDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},setGlobalTimeRange:s=>{e({globalTimeRangeIndex:s}),function(e){if("undefined"!=typeof window)try{localStorage.setItem(Fi,e.toString())}catch{}}(s);const{packetCacheState:n,requestThreeDayData:a,requestSevenDayData:o,requestFourteenDayData:i}=t();5!==s||n.threeDayLoadComplete||n.isBackgroundLoading||a(),6!==s||n.sevenDayLoadComplete||n.isBackgroundLoading||o(),7!==s||n.fourteenDayLoadComplete||n.isBackgroundLoading||i()}})),Zi=Qi,er=()=>Qi(e=>e.stats),tr=()=>Qi(e=>e.statsError),sr=()=>Qi(e=>e.packets),nr=()=>Qi(e=>e.packetsLoading),ar=()=>Qi(e=>e.logs),or=()=>Qi(e=>e.logsLoading),ir=()=>Qi(e=>e.liveMode),rr=()=>Qi(e=>e.flashAdvert),lr=()=>Qi(e=>e.fetchLogs),cr=()=>Qi(e=>e.setLiveMode),ur=()=>Qi(e=>e.resourceHistory),dr=()=>Qi(e=>e.addResourceDataPoint),hr=()=>Qi(e=>e.hiddenContacts),fr=()=>Qi(e=>e.hideContact),pr=()=>Qi(e=>e.packetCacheState),mr=()=>Qi(e=>e.triggerDeepAnalysis),gr=()=>Qi(e=>e.quickNeighbors),yr=()=>Qi(e=>e.cachedLocalHash),br=()=>Qi(e=>e.lastPacketTimestamp),xr=()=>Qi(e=>e.globalTimeRangeIndex),wr=()=>Qi(e=>e.setGlobalTimeRange),kr=()=>Qi(e=>null!==e.stats&&e.packetCacheState.backgroundLoadComplete);function vr({showLabel:e=!1,className:t}){const a=Qi(e=>e.flashReceived),o=rr(),i=pi(e=>"connected"===e.connectionState),[r,l]=s.useState("idle");s.useEffect(()=>{if(a<=0)return;const e=requestAnimationFrame(()=>l("received")),t=setTimeout(()=>l("idle"),300);return()=>{cancelAnimationFrame(e),clearTimeout(t)}},[a]),s.useEffect(()=>{if(o<=0)return;const e=requestAnimationFrame(()=>l("transmitted")),t=setTimeout(()=>l("idle"),300);return()=>{cancelAnimationFrame(e),clearTimeout(t)}},[o]);const c=i?"bg-chart-1":"bg-accent-danger";return n.jsxs("span",{className:D("inline-flex items-center gap-2",t),title:i?"Real-time (WebSocket)":"Database polling",children:[n.jsx("span",{className:D("inline-flex rounded-full h-[3px] w-[3px] transition-all duration-150","received"===r&&"bg-white scale-150","transmitted"===r&&"bg-accent-secondary scale-150","idle"===r&&c)}),e&&n.jsx("span",{className:"type-data-xs text-text-muted uppercase tracking-wide",children:i?"Live":"DB"})]})}function Sr({children:e,isLoading:t=!0,className:s,borderRadius:a=12}){return n.jsxs("div",{className:D("relative overflow-hidden",s),style:{borderRadius:a},children:[t&&n.jsx("div",{className:"shimmer-border",style:{borderRadius:a}}),n.jsx("div",{className:"relative z-10",children:e})]})}function Cr({className:e}){return n.jsx("div",{className:D("shimmer-indicator",e),children:n.jsx("div",{className:"shimmer-indicator-inner"})})}const Tr=a(e=>({sparklines:new Map,isComputing:!1,lastUpdated:0,nodeCount:0,setSparklines:t=>e({sparklines:t,lastUpdated:Date.now(),nodeCount:t.size,isComputing:!1}),setComputing:t=>e({isComputing:t})}));"undefined"!=typeof window&&setTimeout(()=>{di.subscribe((e,t)=>{const s=Tr.getState();t&&!s.isComputing?s.setComputing(!0):!t&&e.size>0?s.setSparklines(e):!t&&s.isComputing&&s.setComputing(!1)})},0);const Mr=()=>Tr(e=>e.isComputing),_r=[],Lr=new Map;function jr(e){return Tr(t=>{const s=t.sparklines.get(e);if(!s||0===s.length)return _r;const n=Lr.get(e);return n===s?n:(Lr.set(e,s),s)})}const Er=a(e=>({topology:{edges:[],validatedEdges:[],weakEdges:[],certainEdges:[],uncertainEdges:[],edgeMap:new Map,maxPacketCount:0,maxCertainCount:0,neighborAffinity:new Map,fullAffinity:new Map,localPrefix:null,centrality:new Map,hubNodes:[],gatewayNodes:[],loops:[],loopEdgeKeys:new Set,txDelayRecommendations:new Map,pathRegistry:ci(),edgeBetweenness:new Map,backboneEdges:[],nodeMobility:new Map,mobileNodes:[],pathHealth:[],lastHopNeighbors:[],disambiguationStats:{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:[],viterbiStats:{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}},isComputing:!1,lastComputeTimeMs:0,lastUpdated:0,setTopology:(t,s)=>e({topology:t,lastComputeTimeMs:s,lastUpdated:Date.now(),isComputing:!1}),setComputing:t=>e({isComputing:t})}));"undefined"!=typeof window&&ui.subscribe((e,t)=>{Er.getState().setTopology(e,t)});const Pr=()=>Er(e=>e.topology),Nr=()=>Er(e=>e.topology.hubNodes),Dr=()=>Er(e=>e.topology.centrality),Ir=()=>Er(e=>e.topology.fullAffinity);let Fr=null,Ar=null,Rr=null,zr=null;const Or=()=>Er(e=>(e.topology.hubNodes!==Ar&&(Ar=e.topology.hubNodes,Fr=new Set(e.topology.hubNodes)),Fr)),Br=()=>Er(e=>e.topology.pathHealth),$r=()=>Er(e=>e.topology.disambiguationStats),Wr=()=>Er(e=>e.topology.disambiguationStats.highCollisionPrefixes),Hr=()=>Er(e=>e.topology.disambiguationStats.totalPrefixes>0),qr=()=>Er(e=>e.topology.discoveredNodes),Ur=()=>Er(e=>e.topology.viterbiStats),Jr=()=>Er(e=>(e.topology.discoveredNodes!==zr&&(zr=e.topology.discoveredNodes,Rr=e.topology.discoveredNodes.filter(e=>e.isLikelyReal)),Rr));function Gr(e){if(e<60)return`${Math.floor(e)}s`;const t=Math.floor(e/86400),s=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),a=[];return t>0&&a.push(`${t}d`),s>0&&a.push(`${s}h`),(n>0||0===a.length)&&a.push(`${n}m`),a.join(" ")}function Yr(e){const t=Date.now()/1e3-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Vr(e){const t=Date.now()/1e3-e;return t<60?`${Math.floor(t)}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function Kr(e){return new Date(1e3*e).toLocaleString()}function Xr(e){const t=new Date(1e3*e);return`${t.toLocaleString("en-US",{month:"short"})} ${t.getDate()}, ${t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}`}function Qr(e){return`${(e/1e6).toFixed(3)} MHz`}function Zr(e){return`${(e/1e3).toFixed(1)} kHz`}function el(e){const t=e>1e12?e:1e3*e,s=Date.now(),n=Math.abs(s-t),a=Math.floor(n/1e3),o=Math.floor(a/60),i=Math.floor(o/60),r=Math.floor(i/24);return r>0?`${r} day${1!==r?"s":""}`:i>0?`${i} hour${1!==i?"s":""}`:o>0?`${o} minute${1!==o?"s":""}`:`${a} second${1!==a?"s":""}`}const tl=[{name:"Dashboard",to:"/",icon:l},{name:"Contacts",to:"/contacts",icon:c},{name:"Packets",to:"/packets",icon:u},{name:"Statistics",to:"/statistics",icon:d},{name:"System",to:"/system",icon:h},{name:"Logs",to:"/logs",icon:f},{name:"Terminal",to:"/terminal",icon:p},{name:"Configuration",to:"/configuration",icon:m}],sl="pymc-controls-expanded";function nl(){var e,t,a,l;const{pathname:c}=o(),{stats:u,setMode:d,setDutyCycle:f,sendAdvert:p}=Zi(),m=bo(),M=Qi(e=>e.prefetchForRoute),_=pr(),L=Qi(e=>e.packetCacheState.dataTier),j=Mr(),E=Er(e=>e.isComputing),P=Jr(),[N,I]=s.useState(!1),[F,A]=s.useState(!0),[R,z]=s.useState(!1),O=s.useRef(null),B=s.useCallback(e=>{e!==c&&(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{M(e)},100))},[c,M]),$=s.useCallback(()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]);s.useEffect(()=>{const e=localStorage.getItem(sl);null!==e&&queueMicrotask(()=>A("true"===e))},[]);const W=()=>{const e=!F;A(e),localStorage.setItem(sl,String(e))};s.useEffect(()=>{queueMicrotask(()=>I(!1))},[c]),s.useEffect(()=>(document.body.style.overflow=N?"hidden":"",()=>{document.body.style.overflow=""}),[N]);const H=null==u?void 0:u.noise_floor_dbm,q=(null==(t=null==(e=null==u?void 0:u.config)?void 0:e.repeater)?void 0:t.mode)??"forward",U=(null==(l=null==(a=null==u?void 0:u.config)?void 0:a.duty_cycle)?void 0:l.enforcement_enabled)??!1,J=async()=>{z(!0),await p(),setTimeout(()=>z(!1),1e3)},G=()=>{d("forward"===q?"monitor":"forward")},Y=()=>{f(!U)},V=()=>{So(),window.location.href="/login"},K=_.isLoading||_.isBackgroundLoading||_.isTopologyLoading,X=K||j||E,Q=_.loadProgress,Z=e=>{switch(e){case"24h":return"24 hours";case"3d":return"3 days";case"7d":return"7 days";case"14d":return"14 days";default:return e}},ee=()=>{if(!X)return null;let e="Analyzing database";_.isLoading&&Q?e="Loading 24h history...":_.isBackgroundLoading&&Q?e=_.statusMessage||`Loading ${L} history...`:_.isTopologyLoading?e="Loading topology data...":j?e="Computing sparklines":E&&(e="Building topology");const t=(null==Q?void 0:Q.percent)??null,s=null!==t&&K;return n.jsx("div",{className:"px-3 pb-2",children:n.jsx(Sr,{isLoading:K,borderRadius:12,children:n.jsxs("div",{className:"bg-glass-surface/50 rounded-xl p-2",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1 py-0.5",children:[n.jsxs("div",{className:"relative flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent-primary"})]}),n.jsx("span",{className:"type-data-xs text-text-muted flex-1 truncate",children:e}),s&&n.jsxs("span",{className:"type-data-xs text-text-muted tabular-nums",children:[t,"%"]})]}),n.jsx("div",{className:"mt-1.5 h-1 bg-white/5 rounded-full overflow-hidden",children:s?n.jsx("div",{className:"h-full bg-accent-primary/60 rounded-full transition-all duration-300 ease-out",style:{width:`${t}%`}}):n.jsx("div",{className:"h-full bg-accent-primary/40 rounded-full",style:{width:"100%"}})}),!K&&n.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 px-1",children:[n.jsx("span",{className:"type-micro text-text-muted",children:"Data:"}),n.jsx("span",{className:"type-data-xs text-accent-primary",children:Z(L)})]})]})})})},te=()=>n.jsx("nav",{className:"flex-1 px-3 py-4 space-y-1 overflow-y-auto",children:tl.map(e=>{const t=c===e.to;return n.jsxs(g,{to:e.to,onClick:()=>I(!1),onMouseEnter:()=>B(e.to),onMouseLeave:$,className:D("flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-150 min-h-[44px]",t?"bg-accent-primary/15 text-accent-primary":"text-text-muted hover:text-text-primary hover:bg-white/5"),children:[n.jsx(e.icon,{className:D("w-5 h-5 flex-shrink-0",t&&"text-accent-primary")}),n.jsx("span",{className:"type-body-sm font-medium",children:e.name}),"/contacts"===e.to&&P.length>0&&n.jsxs("span",{className:"ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-accent-tertiary/20 text-accent-tertiary",children:[n.jsx(y,{className:"w-3 h-3"}),n.jsx("span",{className:"type-data-xs font-medium",children:P.length})]})]},e.name)})}),se=()=>n.jsxs("div",{className:"px-3 py-3",children:[n.jsxs("button",{onClick:W,className:"w-full flex items-center justify-between px-3 py-1.5 mb-2 rounded-lg hover:bg-white/5 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(b,{className:"w-5 h-5 text-accent-primary"}),n.jsx("span",{className:"type-data-xs text-text-muted uppercase tracking-wide",children:"Controls"})]}),n.jsx(x,{className:D("w-4 h-4 text-text-muted transition-transform duration-200",F?"rotate-0":"-rotate-90")})]}),n.jsx("div",{className:D("overflow-hidden transition-all duration-300 ease-out",F?"max-h-96 opacity-100":"max-h-0 opacity-0"),children:n.jsxs("div",{className:"control-panel-skeuo",children:[n.jsxs("button",{onClick:J,disabled:R,className:D("control-btn control-btn-primary w-full",R&&"opacity-70"),children:[n.jsx(w,{className:D("w-4 h-4",R&&"animate-pulse")}),n.jsx("span",{children:R?"Sending...":"Send Advert"})]}),n.jsxs("div",{className:"control-toggle-group",children:[n.jsxs("div",{className:"control-toggle-label",children:[n.jsx("span",{children:"Mode"}),n.jsx("span",{className:D("control-toggle-status","forward"===q?"text-accent-success":"text-accent-secondary"),children:"forward"===q?"FWD":"MON"})]}),n.jsx("button",{onClick:G,className:D("control-btn w-full","forward"===q?"control-btn-success":"control-btn-warning"),children:"forward"===q?n.jsxs(n.Fragment,{children:[n.jsx(k,{className:"w-4 h-4"}),n.jsx("span",{children:"Forward"})]}):n.jsxs(n.Fragment,{children:[n.jsx(v,{className:"w-4 h-4"}),n.jsx("span",{children:"Monitor"})]})})]}),n.jsxs("div",{className:"control-toggle-group",children:[n.jsxs("div",{className:"control-toggle-label",children:[n.jsx("span",{children:"Duty Cycle"}),n.jsx("span",{className:D("control-toggle-status",U?"text-accent-success":"text-text-muted"),children:U?"ON":"OFF"})]}),n.jsxs("button",{onClick:Y,className:D("control-btn w-full",U?"control-btn-success":"control-btn-neutral"),children:[n.jsx(h,{className:"w-4 h-4"}),n.jsx("span",{children:U?"Enabled":"Disabled"})]})]})]})})]}),ne=()=>n.jsxs("div",{className:"mt-auto border-t border-white/5",children:[void 0!==(null==u?void 0:u.uptime_seconds)&&n.jsxs("div",{className:"px-6 py-3 flex items-center gap-3",children:[n.jsx(S,{className:"w-5 h-5 text-text-muted flex-shrink-0"}),n.jsxs("span",{className:"type-data-xs text-text-secondary tabular-nums",children:[Gr(u.uptime_seconds)," uptime"]})]}),n.jsx("div",{className:"px-3 pb-3",children:n.jsx("div",{className:"bg-white/[0.03] rounded-xl p-3",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(C,{className:"w-4 h-4 text-accent-primary"}),n.jsx("span",{className:"type-data-xs text-text-muted",children:"Noise Floor"})]}),n.jsx("span",{className:"type-data text-text-primary tabular-nums",children:null!=H?`${H.toFixed(0)} dBm`:"—"})]})})}),n.jsxs("div",{className:"px-6 py-3 flex items-center gap-3 border-t border-white/5",children:[n.jsx(vr,{showLabel:!0}),(null==u?void 0:u.version)&&n.jsxs("span",{className:"type-data-xs text-text-muted truncate max-w-[140px]",title:`v${u.version}`,children:["v",u.version]})]}),n.jsx("div",{className:"px-3 pb-3",children:n.jsxs("button",{onClick:V,className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-text-muted hover:text-accent-danger hover:bg-accent-danger/10 transition-all duration-150",children:[n.jsx(T,{className:"w-4 h-4"}),n.jsx("span",{className:"type-body-sm",children:"Sign Out"}),m&&n.jsxs("span",{className:"ml-auto type-data-xs text-text-muted",children:["(",m,")"]})]})})]});return n.jsxs(n.Fragment,{children:[n.jsx("header",{className:"lg:hidden fixed top-0 inset-x-0 z-[10001] h-14 bg-bg-body/70 backdrop-blur-xl border-b border-white/10",children:n.jsxs("div",{className:"flex items-center justify-between h-full px-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(Ua,{height:26,className:"block"}),K&&n.jsx(Cr,{className:"ml-2"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("p",{className:"type-data-xs text-text-muted",children:["v",Ha]}),n.jsx(vr,{}),n.jsx("button",{onClick:()=>I(!N),className:"w-10 h-10 flex items-center justify-center rounded-xl hover:bg-white/5 active:bg-white/10 transition-colors","aria-label":N?"Close menu":"Open menu",children:N?n.jsx(i,{className:"w-5 h-5 text-text-primary"}):n.jsx(r,{className:"w-5 h-5 text-text-primary"})})]})]})}),n.jsx("div",{className:D("lg:hidden fixed inset-0 z-[10002] bg-black/60 backdrop-blur-sm transition-opacity duration-300",N?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>I(!1),"aria-hidden":"true"}),n.jsxs("aside",{className:D("lg:hidden fixed top-0 left-0 z-[10003] w-72 max-w-[85vw] h-full","glass-sidebar","flex flex-col","transform transition-transform duration-300 ease-out",N?"translate-x-0":"-translate-x-full pointer-events-none"),children:[n.jsxs("div",{className:"px-4 py-5 border-b border-white/5",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(Ua,{responsive:!0,className:"block"}),n.jsxs("p",{className:"type-data-xs text-text-muted mt-1.5",children:["v",Ha]})]}),te(),ee(),se(),ne()]}),n.jsxs("aside",{className:"hidden lg:flex flex-col w-64 flex-shrink-0 h-full relative glass-sidebar",children:[n.jsxs("div",{className:"px-5 py-6 border-b border-white/5",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(Ua,{responsive:!0,className:"block"}),n.jsxs("p",{className:"type-data-xs text-text-muted mt-1.5",children:["v",Ha]})]}),te(),ee(),se(),ne()]})]})}const al=s.memo(function(){const{theme:e}=Wa(),{backgroundImage:t,brightness:a}=e,[o,i]=s.useState(t),[r,l]=s.useState(!1);s.useEffect(()=>{if(t===o)return;if(!t)return void i("");const e=new Image;e.onload=()=>{l(!0),requestAnimationFrame(()=>{i(t),setTimeout(()=>l(!1),300)})},e.onerror=()=>{i(t)},e.src=t},[t,o]);const c=(100-a)/100;return n.jsxs(n.Fragment,{children:[o&&n.jsx("div",{className:"fixed inset-0 -z-20",style:{contain:"paint",willChange:r?"opacity":"auto"},"aria-hidden":"true",children:n.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat transition-opacity duration-300 ease-out",style:{backgroundImage:`url(${o})`,opacity:r?.7:1}})}),n.jsx("div",{className:"fixed inset-0 -z-10 bg-black pointer-events-none transition-opacity duration-200 ease-out",style:{opacity:c,contain:"paint"},"aria-hidden":"true"})]})}),ol=20,il=12,rl=s.createContext(null);function ll({children:e}){const[t,a]=s.useState({content:null,mouseX:0,mouseY:0,visible:!1}),o=s.useRef(null),[i,r]=s.useState({x:0,y:0}),l=s.useCallback((e,t,s)=>{a({content:e,mouseX:t,mouseY:s,visible:!0})},[]),c=s.useCallback(()=>{a(e=>({...e,visible:!1}))},[]),u=s.useCallback((e,t)=>{a(s=>s.visible?{...s,mouseX:e,mouseY:t}:s)},[]);s.useEffect(()=>{if(!t.visible||!o.current)return;const e=o.current.getBoundingClientRect(),{mouseX:s,mouseY:n}=t,a=window.innerWidth,i=window.innerHeight;let l,c;l=s+ol+e.width+il>a?s-ol-e.width:s+ol,l=Math.max(il,Math.min(l,a-e.width-il)),c=n-ol-e.height{c.current&&(clearTimeout(c.current),c.current=null)},h=s.useCallback(t=>{d(),c.current=setTimeout(()=>{u.current=!0,o(e,t.clientX,t.clientY)},a)},[o,e,a]),f=s.useCallback(e=>{u.current&&r(e.clientX,e.clientY)},[r]),p=s.useCallback(()=>{d(),u.current=!1,i()},[i]),m=s.useCallback(()=>{if(d(),!l.current)return;const t=l.current.getBoundingClientRect();c.current=setTimeout(()=>{u.current=!0,o(e,t.left+t.width/2,t.top)},a)},[o,e,a]),g=s.useCallback(()=>{d(),u.current=!1,i()},[i]);return s.useEffect(()=>()=>{d(),u.current&&(u.current=!1,i())},[i]),s.useEffect(()=>{const e=()=>{u.current&&(d(),u.current=!1,i())};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[i]),n.jsx("span",{ref:l,onMouseEnter:h,onMouseMove:f,onMouseLeave:p,onFocus:m,onBlur:g,className:"contents",children:t})}function ul({className:e=""}){return n.jsx("div",{className:`bg-white/5 animate-pulse rounded-lg ${e}`,"aria-hidden":"true"})}function dl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-48"}),n.jsx(ul,{className:"h-8 w-32"})]}),n.jsx(ul,{className:"h-72"}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 gap-3",children:Array.from({length:8}).map((e,t)=>n.jsx(ul,{className:"h-24"},t))}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4}).map((e,t)=>n.jsx(ul,{className:"h-44"},t))}),n.jsx(ul,{className:"h-96"})]})}function hl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading list",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-40"}),n.jsx(ul,{className:"h-8 w-24"})]}),n.jsx(ul,{className:"h-20"}),n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsx(ul,{className:"h-10 rounded-none"}),n.jsx("div",{className:"divide-y divide-border-subtle/30",children:Array.from({length:10}).map((e,t)=>n.jsx("div",{className:"px-4 py-3",children:n.jsx(ul,{className:"h-6"})},t))})]})]})}function fl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading map",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-32"}),n.jsx(ul,{className:"h-6 w-48"})]}),n.jsx(ul,{className:"h-[500px]"}),n.jsx(ul,{className:"h-64"})]})}function pl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading charts",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-36"}),n.jsx(ul,{className:"h-8 w-40"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[n.jsx(ul,{className:"h-80"}),n.jsx(ul,{className:"h-80"})]}),n.jsx(ul,{className:"h-64"})]})}function ml(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading settings",children:[n.jsx(ul,{className:"h-8 w-32"}),n.jsxs("div",{className:"space-y-6",children:[n.jsx(ul,{className:"h-48"}),n.jsx(ul,{className:"h-64"}),n.jsx(ul,{className:"h-32"})]})]})}function gl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading system info",children:[n.jsx(ul,{className:"h-8 w-28"}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4}).map((e,t)=>n.jsx(ul,{className:"h-28"},t))}),n.jsx(ul,{className:"h-64"}),n.jsx(ul,{className:"h-48"})]})}const yl=s.lazy(()=>N(()=>import("./Login-D0VAcvfg.js"),__vite__mapDeps([0,1,2]))),bl=s.lazy(()=>N(()=>import("./Dashboard-BIGBrxNX.js"),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11]))),xl=s.lazy(()=>N(()=>import("./Packets-CuPG-YBS.js"),__vite__mapDeps([12,1,2,6,7,8,5]))),wl=s.lazy(()=>N(()=>import("./Contacts-B1sA0BbK.js").then(e=>e.C),__vite__mapDeps([13,1,2,5,8,7,14,15,16]))),kl=s.lazy(()=>N(()=>import("./Statistics-WWZtRE3M.js"),__vite__mapDeps([17,1,2,18,4,9,5,14,11,16]))),vl=s.lazy(()=>N(()=>import("./System-CPE03-m2.js"),__vite__mapDeps([19,1,2,4,5,11]))),Sl=s.lazy(()=>N(()=>import("./Logs-Bj21D9nq.js"),__vite__mapDeps([20,1,2,18,5]))),Cl=s.lazy(()=>N(()=>import("./Terminal-BmUaRX2Y.js"),__vite__mapDeps([21,1,2,5]))),Tl=s.lazy(()=>N(()=>import("./Configuration-BkRSvuMT.js"),__vite__mapDeps([22,1,2,8,15,5,11])));function Ml({children:e}){const t=o();return fo()?n.jsx(n.Fragment,{children:e}):n.jsx(j,{to:"/login",state:{from:t},replace:!0})}class _l extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){var e;return this.state.hasError?n.jsxs("div",{className:"glass-card p-8 text-center",children:[n.jsx("p",{className:"type-subheading text-accent-red mb-2",children:"Page failed to render"}),n.jsx("p",{className:"type-body text-white/50 mb-4",children:(null==(e=this.state.error)?void 0:e.message)||"Unknown error"}),n.jsx("button",{onClick:()=>this.setState({hasError:!1}),className:"px-4 py-2 bg-accent-primary/20 text-accent-primary rounded-lg hover:bg-accent-primary/30 transition-colors",children:"Try Again"})]}):this.props.children}}function Ll(){const e=Qi(e=>e.initializeApp),t=fo();return s.useEffect(()=>{if(!t)return;e();const s=setInterval(()=>{vo()},3e4);return vo(),To(),()=>clearInterval(s)},[e,t]),n.jsxs(ll,{children:[n.jsx(al,{}),n.jsxs(_,{children:[n.jsx(L,{path:"/login",element:n.jsx(s.Suspense,{fallback:n.jsx("div",{className:"min-h-screen bg-bg-body"}),children:n.jsx(yl,{})})}),n.jsx(L,{path:"/*",element:n.jsx(Ml,{children:n.jsxs("div",{className:"flex h-screen overflow-hidden",children:[n.jsx(nl,{}),n.jsx("main",{className:"flex-1 w-full min-w-0 pt-14 lg:pt-0 overflow-y-auto",children:n.jsx("div",{className:"px-4 sm:px-6 lg:px-8 pt-5 pb-4 sm:pb-6 lg:pb-8 max-w-7xl mx-auto",children:n.jsx(_l,{children:n.jsxs(_,{children:[n.jsx(L,{path:"/",element:n.jsx(s.Suspense,{fallback:n.jsx(dl,{}),children:n.jsx(bl,{})})}),n.jsx(L,{path:"/packets",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(xl,{})})}),n.jsx(L,{path:"/contacts",element:n.jsx(s.Suspense,{fallback:n.jsx(fl,{}),children:n.jsx(wl,{})})}),n.jsx(L,{path:"/statistics",element:n.jsx(s.Suspense,{fallback:n.jsx(pl,{}),children:n.jsx(kl,{})})}),n.jsx(L,{path:"/system",element:n.jsx(s.Suspense,{fallback:n.jsx(gl,{}),children:n.jsx(vl,{})})}),n.jsx(L,{path:"/logs",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(Sl,{})})}),n.jsx(L,{path:"/terminal",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(Cl,{})})}),n.jsx(L,{path:"/configuration",element:n.jsx(s.Suspense,{fallback:n.jsx(ml,{}),children:n.jsx(Tl,{})})})]})})})})]})})})]})]})}const jl=console.warn;console.warn=(...e)=>{const t=e[0];"string"==typeof t&&t.includes("width")&&t.includes("height")&&t.includes("chart should be greater than 0")||jl.apply(console,e)},E.createRoot(document.getElementById("root")).render(n.jsx(s.StrictMode,{children:n.jsx($a,{children:n.jsx(P,{children:n.jsx(Ll,{})})})}));export{za as $,Ir as A,qr as B,Kr as C,Si as D,Br as E,Mi as F,Ur as G,el as H,jr as I,Mr as J,Wr as K,Zi as L,fr as M,Nr as N,Dr as O,Ua as P,Yo as Q,Ga as R,Yr as S,cl as T,Xa as U,Qa as V,Fa as W,R as X,A as Y,re as Z,Ya as _,nr as a,Wa as a0,$r as a1,Hr as a2,Jr as a3,Ci as a4,Ti as a5,ur as a6,dr as a7,Io as a8,_i as a9,ki as aA,Va as aB,Pr as aC,mr as aD,yr as aE,xi as aF,ar as aa,or as ab,lr as ac,Wo as ad,ji as ae,Po as af,Fo as ag,Ao as ah,Ro as ai,$o as aj,be as ak,Ce as al,Qo as am,Ho as an,Qr as ao,Zr as ap,Vo as aq,Ko as ar,Xo as as,Zo as at,ei as au,Go as av,qo as aw,Uo as ax,Jo as ay,ri as az,ir as b,rr as c,er as d,wi as e,gr as f,io as g,hr as h,fo as i,xr as j,Do as k,xo as l,br as m,tr as n,kr as o,wr as p,pr as q,Bo as r,ro as s,cr as t,sr as u,Ja as v,Vr as w,Xr as x,vi as y,Or as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-DW1MXg6s.js","assets/vendor-react-C0qkT9dV.js","assets/vendor-core-WoOfkQwm.js","assets/Dashboard-I4-zVbBf.js","assets/useThemeColors-DL9Pr7sC.js","assets/PageLayout-DAadOF4d.js","assets/PacketDetailModal-D1jT4M4x.js","assets/SignalIndicator-C1cW0knK.js","assets/HashBadge-CAy9V6Vn.js","assets/TimeRangeSelector-COrVm3Yj.js","assets/link-scoring-y9pf-GTv.js","assets/Grid-F2RfSVk7.js","assets/Packets-KLe38miu.js","assets/Contacts-DVK_9PWN.js","assets/CollisionExplorerModal-B0_yuX1j.js","assets/ConfirmModal-B37DcPi-.js","assets/leaflet-CIGW-MKW.css","assets/Statistics-GNsxMYwC.js","assets/usePolling-ul9y_if7.js","assets/System-fGLn0Map.js","assets/Logs-CFPI4LFW.js","assets/Terminal-CKEpJ-hg.js","assets/Configuration-Dh8yao9Z.js"])))=>i.map(i=>d[i]); +var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);import{r as s,j as n,c as a,u as o,X as i,M as r,L as l,d as c,e as u,C as d,G as h,F as f,S as p,f as m,g,h as y,i as b,k as x,l as w,m as k,n as v,o as S,p as C,q as T,b as M,t as _,v as L,N as j,w as E,B as P}from"./vendor-react-C0qkT9dV.js";import{_ as N}from"./deckgl-DTsmDcfs.js";import{c as D}from"./recharts-DRDKmvXb.js";import"./vendor-core-WoOfkQwm.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const s of e)if("childList"===s.type)for(const e of s.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const I={surfaces:{glass:{tint:"#252525",light:"#ffffff",dark:"#000000",reflexLight:.15,reflexDark:.8,blur:6,blurElevated:8,brightness:1,opacity:8,opacityElevated:12},card:{radius:"1.125rem",padding:"1.25rem",paddingCompact:"0.75rem"},sidebar:{tint:"rgba(113, 156, 223, 0.06)",width:"16rem",drawerWidth:"85vw"},modal:{radius:"1.125rem",backdropBlur:"8px",backdropColor:"rgba(0, 0, 0, 0.6)"}},colors:{bg:{body:"#171717",surface:"#252525",elevated:"#333233",subtle:"#3F3F3F"},border:{subtle:"#4B4B4B",strong:"#616161"},text:{primary:"#E1E1E1",secondary:"#BFBFBF",muted:"#727272",inverse:"#171717"},accent:{primary:"#719CDF",secondary:"#DFBC72",tertiary:"#6FBCBD",success:"#719872",danger:"#E12672"},signal:{excellent:"#00FF00",good:"#8CE619",fair:"#FFD900",poor:"#FF8C26",critical:"#FF3333",unknown:"#616161"},status:{success:"#719872",warning:"#DFBC72",danger:"#E12672",info:"#6FBCBD",muted:"#616161"},chart:{c1:"#719CDF",c2:"#0074BE",c3:"#6FBCBD",c4:"#DFBC72",c5:"#719872",c6:"#E12672",c7:"#E17899",c8:"#999ABD",grid:"rgba(255, 255, 255, 0.06)",axis:"rgba(255, 255, 255, 0.4)",cursor:"rgba(255, 255, 255, 0.2)"},metric:{received:"#719872",forwarded:"#0074BE",transmitted:"#DFBC72",dropped:"#E12672"},map:{nodeFill:"#F5F5F0",nodeStroke:"#4A5568",hub:"#8B7BAD",local:"#FBBF24",neighbor:"#FBBF24",mobile:"#F97316",room:"#E17899",edge:"#4B4B4B",edgeHover:"#6FBCBD"}},typography:{font:{title:"'Inter', system-ui, sans-serif",display:"'Inter', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},size:{xs:"0.64rem",sm:"0.8rem",base:"1rem",md:"1.125rem",lg:"1.25rem",xl:"1.563rem",xxl:"1.953rem",hero:"3.052rem"},weight:{normal:400,medium:500,semibold:600,bold:700},leading:{tight:1.1,snug:1.25,normal:1.5}},spacing:{space:{gap:"1.5rem",gapMobile:"0.75rem",page:"1.5rem",pageMobile:"1rem",section:"2rem"},radius:{sm:"0.5rem",md:"0.875rem",lg:"1.125rem",xl:"1.5rem",pill:"9999px"}},motion:{fast:"0.1s",normal:"0.15s",slow:"0.4s",easing:"ease-out"}};function F(e){const t=e.replace("#","");if(6!==t.length&&3!==t.length)return e;let s,n,a;return 3===t.length?(s=parseInt(t[0]+t[0],16)/255,n=parseInt(t[1]+t[1],16)/255,a=parseInt(t[2]+t[2],16)/255):(s=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255),`color(display-p3 ${s.toFixed(3)} ${n.toFixed(3)} ${a.toFixed(3)})`}function A(){return"undefined"!=typeof window&&CSS.supports("color","color(display-p3 1 1 1)")}function R(e){return A()?F(e):e}function z(e,t){const s={...e};for(const n of Object.keys(t)){const a=t[n],o=e[n];void 0!==a&&("object"!=typeof a||null===a||Array.isArray(a)||"object"!=typeof o||null===o||Array.isArray(o)?s[n]=a:s[n]=z(o,a))}return s}function O(e){return{meta:e.meta,display:e.display,surfaces:e.surfaces?z(I.surfaces,e.surfaces):I.surfaces,colors:e.colors?z(I.colors,e.colors):I.colors,typography:e.typography?z(I.typography,e.typography):I.typography,spacing:e.spacing?z(I.spacing,e.spacing):I.spacing,motion:e.motion?z(I.motion,e.motion):I.motion}}function B(e){const t=e.replace("#","");return 6===t.length?`${parseInt(t.slice(0,2),16)}, ${parseInt(t.slice(2,4),16)}, ${parseInt(t.slice(4,6),16)}`:"255, 255, 255"}function $(e){return{id:e.meta.id,colorScheme:{name:e.meta.name,dataTheme:e.meta.dataTheme,previewColor:e.meta.previewColor},background:{src:e.meta.backgroundImage,suggestedBrightness:e.meta.backgroundBrightness},display:{font:e.display.font,color:e.display.color,size:e.display.size,paletteColors:e.display.palette}}}const W=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#58b99d",backgroundImage:"",backgroundBrightness:100,isDark:!0},display:{font:"'JetBrains Mono', monospace",color:"#58b99d",size:1,palette:[["#58b99d","#4997ec","#60ce41","#e67b2f","#da3529"],["#242627","#818c8d","#925cb1","#5face4","#fcfcfc"]]},typography:{font:{title:"'JetBrains Mono', monospace",display:"'Noto Sans', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},weight:{normal:400,medium:500,semibold:600,bold:700}},surfaces:{glass:{tint:"#242627",light:"#4997ec",dark:"#000000",reflexLight:0,reflexDark:0,blur:0,blurElevated:0,brightness:1,opacity:95,opacityElevated:98},sidebar:{tint:"rgba(88, 185, 157, 0.04)"},card:{radius:"4px"},modal:{radius:"6px"}},colors:{bg:{body:"#1a1c1d",surface:"#242627",elevated:"#2e3133",subtle:"#383b3d"},border:{subtle:"#383b3d",strong:"#4a4e50"},text:{primary:"#fcfcfc",secondary:"#c8c8c8",muted:"#818c8d",inverse:"#242627"},accent:{primary:"#58b99d",secondary:"#e67b2f",tertiary:"#4997ec",success:"#60ce41",danger:"#da3529"},signal:{excellent:"#60ce41",good:"#67d99f",fair:"#e67b2f",poor:"#b14434",critical:"#da3529",unknown:"#818c8d"},status:{success:"#60ce41",warning:"#e67b2f",danger:"#da3529",info:"#58b99d",muted:"#818c8d"},chart:{c1:"#58b99d",c2:"#4997ec",c3:"#60ce41",c4:"#e67b2f",c5:"#da3529",c6:"#925cb1",c7:"#67d99f",c8:"#818c8d",grid:"rgba(252, 252, 252, 0.06)",axis:"rgba(252, 252, 252, 0.3)",cursor:"rgba(88, 185, 157, 0.2)"},metric:{received:"#58b99d",forwarded:"#4997ec",transmitted:"#e67b2f",dropped:"#da3529"},map:{nodeFill:"#fcfcfc",nodeStroke:"#4a4e50",hub:"#925cb1",local:"#58b99d",neighbor:"#58b99d",mobile:"#e67b2f",room:"#58b99d",edge:"#4a4e50",edgeHover:"#58b99d"}}}),H=W;$(W);const U=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#B39DF3",backgroundImage:"/assets/sand.jpg",backgroundBrightness:80,isDark:!0},display:{font:"'Rubik Mono One', monospace",color:"#4A4A52",size:.8,palette:[["#B49DFF","#F9D26F","#71F8E5","#39D98A","#FF5C7A"],["#4CFFB5","#FF8A5C","#A78BFA","#60A5FA","#F472B6"]]},typography:{font:{title:"'Rubik Mono One', monospace"}},surfaces:{glass:{tint:"#252525",blur:6,blurElevated:8},sidebar:{tint:"rgba(113, 156, 223, 0.06)"}}}),q=U;$(U);const J=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#fabd2f",backgroundImage:"/assets/magma.webp",backgroundBrightness:50,isDark:!0},display:{font:"'Jacquard 12', serif",color:"#fe8019",size:1.75,palette:[["#fabd2f","#fb4934","#8ec07c","#b8bb26","#d3869b"],["#fe8019","#83a598","#d65d0e","#928374","#ebdbb2"]]},typography:{font:{title:"'Jacquard 12', serif"},size:{xxl:"2.344rem"}},surfaces:{glass:{tint:"#282828"},sidebar:{tint:"rgba(250, 189, 47, 0.06)"}},colors:{accent:{primary:"#fabd2f",secondary:"#fb4934",tertiary:"#8ec07c",success:"#b8bb26",danger:"#fb4934"},signal:{excellent:"#b8bb26",good:"#8ec07c",fair:"#fabd2f",poor:"#fe8019",critical:"#fb4934",unknown:"#928374"},status:{success:"#b8bb26",warning:"#fabd2f",danger:"#fb4934",info:"#83a598",muted:"#928374"},chart:{c1:"#fabd2f",c2:"#fe8019",c3:"#fb4934",c4:"#d3869b",c5:"#b8bb26",c6:"#8ec07c",c7:"#83a598",c8:"#d65d0e",grid:"rgba(251, 241, 199, 0.06)",axis:"rgba(251, 241, 199, 0.4)",cursor:"rgba(251, 241, 199, 0.2)"},metric:{received:"#b8bb26",forwarded:"#83a598",transmitted:"#fabd2f",dropped:"#fb4934"},map:{nodeFill:"#fbf1c7",nodeStroke:"#504945",hub:"#b16286",local:"#fabd2f",neighbor:"#fabd2f",mobile:"#fe8019",room:"#d3869b",edge:"#665c54",edgeHover:"#8ec07c"}}}),G=J;$(J);const Y=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#83a598",backgroundImage:"/assets/water.webp",backgroundBrightness:40,isDark:!0},display:{font:"'Cantora One', sans-serif",color:"#83a598",size:1.25,palette:[["#83a598","#a89984","#8ec07c","#d79921","#b16286"],["#fe8019","#cc241d","#7c6f64","#bdae93","#ebdbb2"]]},typography:{font:{title:"'Cantora One', sans-serif"},size:{xxl:"2.148rem"},weight:{semibold:500}},surfaces:{glass:{tint:"#1e1e1e"},sidebar:{tint:"rgba(131, 165, 152, 0.06)"}},colors:{accent:{primary:"#83a598",secondary:"#a89984",tertiary:"#8ec07c",success:"#8ec07c",danger:"#cc241d"},signal:{excellent:"#8ec07c",good:"#b8bb26",fair:"#d79921",poor:"#fe8019",critical:"#cc241d",unknown:"#7c6f64"},status:{success:"#8ec07c",warning:"#d79921",danger:"#cc241d",info:"#83a598",muted:"#7c6f64"},chart:{c1:"#83a598",c2:"#8ec07c",c3:"#d79921",c4:"#b16286",c5:"#fe8019",c6:"#cc241d",c7:"#a89984",c8:"#7c6f64",grid:"rgba(213, 196, 161, 0.06)",axis:"rgba(213, 196, 161, 0.4)",cursor:"rgba(213, 196, 161, 0.2)"},metric:{received:"#8ec07c",forwarded:"#83a598",transmitted:"#d79921",dropped:"#cc241d"},map:{nodeFill:"#ebdbb2",nodeStroke:"#504945",hub:"#b16286",local:"#d79921",neighbor:"#d79921",mobile:"#fe8019",room:"#b16286",edge:"#504945",edgeHover:"#83a598"}}}),V=Y;$(Y);const K=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#33859d",backgroundImage:"/assets/stars.jpg",backgroundBrightness:100,isDark:!0},display:{font:"'IBM Plex Mono', monospace",color:"#c23127",size:1.25,palette:[["#33859d","#edb54b","#26a98b","#c23127","#888ca6"],["#195465","#d26939","#99d1ce","#4e5165","#0c1014"]]},typography:{font:{title:"'IBM Plex Mono', monospace"}},surfaces:{glass:{tint:"#0a0e14",blur:1,blurElevated:2},sidebar:{tint:"rgba(51, 133, 157, 0.06)"}},colors:{accent:{primary:"#33859d",secondary:"#edb54b",tertiary:"#26a98b",success:"#26a98b",danger:"#c33027"},signal:{excellent:"#26a98b",good:"#7ec07c",fair:"#edb54b",poor:"#d26939",critical:"#c33027",unknown:"#195465"},status:{success:"#26a98b",warning:"#edb54b",danger:"#c33027",info:"#599caa",muted:"#195465"},chart:{c1:"#33859d",c2:"#edb54b",c3:"#26a98b",c4:"#599caa",c5:"#d26939",c6:"#c33027",c7:"#888ba5",c8:"#195465",grid:"rgba(153, 209, 206, 0.06)",axis:"rgba(153, 209, 206, 0.4)",cursor:"rgba(153, 209, 206, 0.2)"},metric:{received:"#26a98b",forwarded:"#33859d",transmitted:"#edb54b",dropped:"#c33027"},map:{nodeFill:"#edf5f4",nodeStroke:"#195465",hub:"#888ba5",local:"#edb54b",neighbor:"#edb54b",mobile:"#d26939",room:"#888ba5",edge:"#245361",edgeHover:"#26a98b"}}}),X=K;$(K);const Q=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#9ed072",backgroundImage:"/assets/ribbons.webp",backgroundBrightness:75,isDark:!0},display:{font:"'Instrument Serif', serif",color:"#E2E2E3",size:1.4,palette:[["#9ed072","#fc5d7c","#76cce0","#e7c664","#b39df3"],["#f39660","#7f8490","#e2e2e3","#55575e","#2c2e34"]]},typography:{font:{title:"'Instrument Serif', Georgia, serif",display:"'Instrument Sans', system-ui, sans-serif",mono:"'JetBrains Mono', 'SF Mono', Monaco, monospace"},size:{xxl:"3.25rem",xl:"2.5rem",lg:"1.875rem",md:"1.25rem"},weight:{normal:400,medium:500,semibold:600,bold:600}},surfaces:{glass:{tint:"#23212d"},sidebar:{tint:"rgba(158, 208, 114, 0.06)"}},colors:{accent:{primary:"#9ed072",secondary:"#e7c664",tertiary:"#76cce0",success:"#9ed072",danger:"#fc5d7c"},signal:{excellent:"#9ed072",good:"#c5d93d",fair:"#e7c664",poor:"#f39660",critical:"#fc5d7c",unknown:"#7f8490"},status:{success:"#9ed072",warning:"#e7c664",danger:"#fc5d7c",info:"#76cce0",muted:"#7f8490"},chart:{c1:"#9ed072",c2:"#fc5d7c",c3:"#e7c664",c4:"#76cce0",c5:"#b39df3",c6:"#f39660",c7:"#7f8490",c8:"#e2e2e3",grid:"rgba(226, 226, 227, 0.06)",axis:"rgba(226, 226, 227, 0.4)",cursor:"rgba(226, 226, 227, 0.2)"},metric:{received:"#9ed072",forwarded:"#76cce0",transmitted:"#e7c664",dropped:"#fc5d7c"},map:{nodeFill:"#e2e2e3",nodeStroke:"#33353f",hub:"#b39df3",local:"#e7c664",neighbor:"#e7c664",mobile:"#f39660",room:"#fc5d7c",edge:"#444751",edgeHover:"#76cce0"}}}),Z=Q;$(Q);const ee=O({meta:{id:"",name:"",dataTheme:"",previewColor:"#7E9CD8",backgroundImage:"/assets/folds.webp",backgroundBrightness:50,isDark:!0},display:{font:"'Inter', sans-serif",color:"#7E9CD8",size:1.25,palette:[["#7E9CD8","#E46876","#7AA89F","#DCA561","#957FB8"],["#7FB4CA","#D27E99","#98BB6C","#727169","#1F1F28"]]},typography:{font:{title:"'Inter', sans-serif"}},surfaces:{glass:{tint:"#1F1F28"},sidebar:{tint:"rgba(126, 156, 216, 0.06)"}},colors:{accent:{primary:"#7E9CD8",secondary:"#E6C384",tertiary:"#7FB4CA",success:"#98BB6C",danger:"#E46876"},signal:{excellent:"#98BB6C",good:"#B8CC5C",fair:"#E6C384",poor:"#FFA066",critical:"#E46876",unknown:"#54546D"},status:{success:"#98BB6C",warning:"#E6C384",danger:"#E46876",info:"#7FB4CA",muted:"#727169"},chart:{c1:"#7E9CD8",c2:"#E6C384",c3:"#98BB6C",c4:"#957FB8",c5:"#7FB4CA",c6:"#E46876",c7:"#FFA066",c8:"#D27E99",grid:"rgba(220, 215, 186, 0.06)",axis:"rgba(220, 215, 186, 0.4)",cursor:"rgba(220, 215, 186, 0.2)"},metric:{received:"#98BB6C",forwarded:"#7E9CD8",transmitted:"#E6C384",dropped:"#E46876"},map:{nodeFill:"#DCD7BA",nodeStroke:"#363646",hub:"#957FB8",local:"#E6C384",neighbor:"#E6C384",mobile:"#FFA066",room:"#D27E99",edge:"#54546D",edgeHover:"#7AA89F"}}}),te=ee;$(ee);const se={"KDE Breeze":H,Magma:G,Folds:te,Ribbon:Z,BLKSAND:q,Waves:V,Stars:X};function ne(e,t){const s=e.toLowerCase();return{...t,meta:{...t.meta,id:s,name:e,dataTheme:s}}}const ae=Object.fromEntries(Object.entries(se).map(([e,t])=>[e,ne(e,t)])),oe=Object.fromEntries(Object.entries(ae).map(([e,t])=>[e,$(t)])),ie=Object.values(ae);function re(e){return ie.find(t=>t.meta.id===e)}new Map(Object.entries(ae));const le=Object.values(oe);new Map(Object.entries(oe));const ce=Object.entries(oe).map(([e,t])=>function(e,t){return{id:e.id,name:e.colorScheme.name,displayName:t,colorScheme:e.id,backgroundImage:e.background.src,paletteColors:e.display.paletteColors,displayFont:e.display.font,displayColor:e.display.color,displaySize:e.display.size}}(t,e)),ue=le.map(function(e){return{id:e.id,name:e.colorScheme.name,dataTheme:e.colorScheme.dataTheme,previewColor:e.colorScheme.previewColor}}),de=le.map(function(e){return{id:e.id,src:e.background.src,suggestedScheme:e.id,suggestedBrightness:e.background.suggestedBrightness}}),he=ae["KDE Breeze"];oe["KDE Breeze"];const fe=he.meta.id,pe=he.meta.backgroundImage,me=he.meta.backgroundBrightness,ge=ue,ye=de,be=ce,xe={colorScheme:fe,backgroundImage:pe,brightness:me},we="pymc-color-scheme",ke="pymc-background-image",ve="pymc-bg-brightness",Se="pymc-background";function Ce(e){(new Image).src=e}const Te={50:.97,100:.92,200:.84,300:.73,400:.62,500:.5,600:.4,700:.32,800:.24,900:.16},Me=[50,100,200,300,400,500,600,700,800,900],_e=["red","orange","yellow","green","aqua","blue","purple"];function Le(e,t,s){const n=e=>Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0");return`#${n(e)}${n(t)}${n(s)}`}function je(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ee(e){const t=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;return Math.round(255*t)}function Pe(e,t,s){const n=s*(Math.PI/180),a=t*Math.cos(n),o=t*Math.sin(n),i=e+.3963377774*a+.2158037573*o,r=e-.1055613458*a-.0638541728*o,l=e-.0894841775*a-1.291485548*o,c=i*i*i,u=r*r*r,d=l*l*l,h=-1.2684380046*c+2.6097574011*u-.3413193965*d,f=-.0041960863*c-.7034186147*u+1.707614701*d;return[Ee(4.0767416621*c-3.3077115913*u+.2309699292*d),Ee(h),Ee(f)]}function Ne(e){const[t,s,n]=function(e){const t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}(e),[,a,o]=function(e,t,s){const n=je(e),a=je(t),o=je(s),i=.4122214708*n+.5363325363*a+.0514459929*o,r=.2119034982*n+.6806995451*a+.1073969566*o,l=.0883024619*n+.2817188376*a+.6299787005*o,c=Math.cbrt(i),u=Math.cbrt(r),d=Math.cbrt(l),h=.2104542553*c+.793617785*u-.0040720468*d,f=1.9779984951*c-2.428592205*u+.4505937099*d,p=.0259040371*c+.7827717662*u-.808675766*d,m=Math.sqrt(f*f+p*p);let g=Math.atan2(p,f)*(180/Math.PI);return g<0&&(g+=360),[h,m,g]}(t,s,n),i={};for(const r of Me){const e=Te[r],t=a*(1-.3*Math.abs(e-.5)),[s,n,l]=Pe(e,t,o);i[r]=Le(s,n,l)}return i}function De(e){return"undefined"==typeof window?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function Ie(e,t){"undefined"!=typeof document&&document.documentElement.style.setProperty(e,t)}const Fe="u-off",Ae="u-label",Re="width",ze="height",Oe="top",Be="bottom",$e="left",We="right",He="#000",Ue=He+"0",qe="mousemove",Je="mousedown",Ge="mouseup",Ye="mouseenter",Ve="mouseleave",Ke="dblclick",Xe="change",Qe="dppxchange",Ze="--",et="undefined"!=typeof window,tt=et?document:null,st=et?window:null,nt=et?navigator:null;let at,ot;function it(e,t){if(null!=t){let s=e.classList;!s.contains(t)&&s.add(t)}}function rt(e,t){let s=e.classList;s.contains(t)&&s.remove(t)}function lt(e,t,s){e.style[t]=s+"px"}function ct(e,t,s,n){let a=tt.createElement(e);return null!=t&&it(a,t),null!=s&&s.insertBefore(a,n),a}function ut(e,t){return ct("div",e,t)}const dt=new WeakMap;function ht(e,t,s,n,a){let o="translate("+t+"px,"+s+"px)";o!=dt.get(e)&&(e.style.transform=o,dt.set(e,o),t<0||s<0||t>n||s>a?it(e,Fe):rt(e,Fe))}const ft=new WeakMap;function pt(e,t,s){let n=t+s;n!=ft.get(e)&&(ft.set(e,n),e.style.background=t,e.style.borderColor=s)}const mt=new WeakMap;function gt(e,t,s,n){let a=t+""+s;a!=mt.get(e)&&(mt.set(e,a),e.style.height=s+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-s/2+"px":0)}const yt={passive:!0},bt={...yt,capture:!0};function xt(e,t,s,n){t.addEventListener(e,s,n?bt:yt)}function wt(e,t,s,n){t.removeEventListener(e,s,yt)}function kt(e,t,s,n){let a;s=s||0;let o=(n=n||t.length-1)<=2147483647;for(;n-s>1;)a=o?s+n>>1:Bt((s+n)/2),t[a]{let a=-1,o=-1;for(let i=s;i<=n;i++)if(e(t[i])){a=i;break}for(let i=n;i>=s;i--)if(e(t[i])){o=i;break}return[a,o]}}et&&function e(){let t=devicePixelRatio;at!=t&&(at=t,ot&&wt(Xe,ot,e),ot=matchMedia(`(min-resolution: ${at-.001}dppx) and (max-resolution: ${at+.001}dppx)`),xt(Xe,ot,e),st.dispatchEvent(new CustomEvent(Qe)))}();const St=e=>null!=e,Ct=e=>null!=e&&e>0,Tt=vt(St),Mt=vt(Ct);function _t(e,t,s,n){let a=Jt(e),o=Jt(t);e==t&&(-1==a?(e*=s,t/=s):(e/=s,t*=s));let i=10==s?Gt:Yt,r=1==o?Wt:Bt,l=(1==a?Bt:Wt)(i(Ot(e))),c=r(i(Ot(t))),u=qt(s,l),d=qt(s,c);return 10==s&&(l<0&&(u=ds(u,-l)),c<0&&(d=ds(d,-c))),n||2==s?(e=u*a,t=d*o):(e=us(e,u),t=cs(t,d)),[e,t]}function Lt(e,t,s,n){let a=_t(e,t,s,n);return 0==e&&(a[0]=0),0==t&&(a[1]=0),a}const jt={mode:3,pad:.1},Et={pad:0,soft:null,mode:0},Pt={min:Et,max:Et};function Nt(e,t,s,n){return ks(s)?It(e,t,s):(Et.pad=s,Et.soft=n?0:null,Et.mode=n?3:0,It(e,t,Pt))}function Dt(e,t){return null==e?t:e}function It(e,t,s){let n=s.min,a=s.max,o=Dt(n.pad,0),i=Dt(a.pad,0),r=Dt(n.hard,-Kt),l=Dt(a.hard,Kt),c=Dt(n.soft,Kt),u=Dt(a.soft,-Kt),d=Dt(n.mode,0),h=Dt(a.mode,0),f=t-e,p=Gt(f),m=Ut(Ot(e),Ot(t)),g=Gt(m),y=Ot(g-p);(f<1e-24||y>10)&&(f=0,0!=e&&0!=t||(f=1e-24,2==d&&c!=Kt&&(o=0),2==h&&u!=-Kt&&(i=0)));let b=f||m||1e3,x=Gt(b),w=qt(10,Bt(x)),k=ds(us(e-b*(0==f?0==e?.1:1:o),w/10),24),v=e>=c&&(1==d||3==d&&k<=c||2==d&&k>=c)?c:Kt,S=Ut(r,k=v?v:Ht(v,k)),C=ds(cs(t+b*(0==f?0==t?.1:1:i),w/10),24),T=t<=u&&(1==h||3==h&&C>=u||2==h&&C<=u)?u:-Kt,M=Ht(l,C>T&&t<=T?T:Ut(T,C));return S==M&&0==S&&(M=100),[S,M]}const Ft=new Intl.NumberFormat(et?nt.language:"en-US"),At=e=>Ft.format(e),Rt=Math,zt=Rt.PI,Ot=Rt.abs,Bt=Rt.floor,$t=Rt.round,Wt=Rt.ceil,Ht=Rt.min,Ut=Rt.max,qt=Rt.pow,Jt=Rt.sign,Gt=Rt.log10,Yt=Rt.log2,Vt=(e,t=1)=>Rt.asinh(e/t),Kt=1/0;function Xt(e){return 1+(0|Gt((e^e>>31)-(e>>31)))}function Qt(e,t,s){return Ht(Ut(e,t),s)}function Zt(e){return"function"==typeof e}function es(e){return Zt(e)?e:()=>e}const ts=e=>e,ss=(e,t)=>t,ns=e=>null,as=e=>!0,os=(e,t)=>e==t,is=/\.\d*?(?=9{6,}|0{6,})/gm,rs=e=>{if(xs(e)||hs.has(e))return e;const t=`${e}`,s=t.match(is);if(null==s)return e;let n=s[0].length-1;if(-1!=t.indexOf("e-")){let[e,s]=t.split("e");return+`${rs(e)}e${s}`}return ds(e,n)};function ls(e,t){return rs(ds(rs(e/t))*t)}function cs(e,t){return rs(Wt(rs(e/t))*t)}function us(e,t){return rs(Bt(rs(e/t))*t)}function ds(e,t=0){if(xs(e))return e;let s=10**t,n=e*s*(1+Number.EPSILON);return $t(n)/s}const hs=new Map;function fs(e){return((""+e).split(".")[1]||"").length}function ps(e,t,s,n){let a=[],o=n.map(fs);for(let i=t;i=0?0:t)+(i>=o[r]?0:o[r]),u=10==e?l:ds(l,c);a.push(u),hs.set(u,c)}}return a}const ms={},gs=[],ys=[null,null],bs=Array.isArray,xs=Number.isInteger;function ws(e){return"string"==typeof e}function ks(e){let t=!1;if(null!=e){let s=e.constructor;t=null==s||s==Object}return t}function vs(e){return null!=e&&"object"==typeof e}const Ss=Object.getPrototypeOf(Uint8Array),Cs="__proto__";function Ts(e,t=ks){let s;if(bs(e)){let n=e.find(e=>null!=e);if(bs(n)||t(n)){s=Array(e.length);for(let n=0;no){for(n=i-1;n>=0&&null==e[n];)e[n--]=null;for(n=i+1;nPromise.resolve().then(e):queueMicrotask,js=["January","February","March","April","May","June","July","August","September","October","November","December"],Es=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ps(e){return e.slice(0,3)}const Ns=Es.map(Ps),Ds=js.map(Ps),Is={MMMM:js,MMM:Ds,WWWW:Es,WWW:Ns};function Fs(e){return(e<10?"0":"")+e}const As={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Fs(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Fs(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Fs(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Fs(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Fs(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Rs(e,t){t=t||Is;let s,n=[],a=/\{([a-z]+)\}|[^{]+/gi;for(;s=a.exec(e);)n.push("{"==s[0][0]?As[s[1]]:s[0]);return e=>{let s="";for(let a=0;ae%1==0,Bs=[1,2,2.5,5],$s=ps(10,-32,0,Bs),Ws=ps(10,0,32,Bs),Hs=Ws.filter(Os),Us=$s.concat(Ws),qs="{YYYY}",Js="\n"+qs,Gs="{M}/{D}",Ys="\n"+Gs,Vs=Ys+"/{YY}",Ks="{aa}",Xs="{h}:{mm}"+Ks,Qs="\n"+Xs,Zs=":{ss}",en=null;function tn(e){let t=1e3*e,s=60*t,n=60*s,a=24*n,o=30*a,i=365*a;return[(1==e?ps(10,0,3,Bs).filter(Os):ps(10,-3,0,Bs)).concat([t,5*t,10*t,15*t,30*t,s,5*s,10*s,15*s,30*s,n,2*n,3*n,4*n,6*n,8*n,12*n,a,2*a,3*a,4*a,5*a,6*a,7*a,8*a,9*a,10*a,15*a,o,2*o,3*o,4*o,6*o,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,qs,en,en,en,en,en,en,1],[28*a,"{MMM}",Js,en,en,en,en,en,1],[a,Gs,Js,en,en,en,en,en,1],[n,"{h}"+Ks,Vs,en,Ys,en,en,en,1],[s,Xs,Vs,en,Ys,en,en,en,1],[t,Zs,Vs+" "+Xs,en,Ys+" "+Xs,en,Qs,en,1],[e,Zs+".{fff}",Vs+" "+Xs,en,Ys+" "+Xs,en,Qs,en,1]],function(t){return(r,l,c,u,d,h)=>{let f=[],p=d>=i,m=d>=o&&d=a?a:d,i=x+(Bt(c)-Bt(y))+cs(y-x,o);f.push(i);let p=t(i),m=p.getHours()+p.getMinutes()/s+p.getSeconds()/n,g=d/n,b=h/r.axes[l]._space;for(;i=ds(i+d,1==e?0:3),!(i>u);)if(g>1){let e=Bt(ds(m+g,6))%24,s=t(i).getHours()-e;s>1&&(s=-1),i-=s*n,m=(m+g)%24,ds((i-f[f.length-1])/d,3)*b>=.7&&f.push(i)}else f.push(i)}return f}}]}const[sn,nn,an]=tn(1),[on,rn,ln]=tn(.001);function cn(e,t){return e.map(e=>e.map((s,n)=>0==n||8==n||null==s?s:t(1==n||0==e[8]?s:e[1]+s)))}function un(e,t){return(s,n,a,o,i)=>{let r,l,c,u,d,h,f=t.find(e=>i>=e[0])||t[t.length-1];return n.map(t=>{let s=e(t),n=s.getFullYear(),a=s.getMonth(),o=s.getDate(),i=s.getHours(),p=s.getMinutes(),m=s.getSeconds(),g=n!=r&&f[2]||a!=l&&f[3]||o!=c&&f[4]||i!=u&&f[5]||p!=d&&f[6]||m!=h&&f[7]||f[1];return r=n,l=a,c=o,u=i,d=p,h=m,g(s)})}}function dn(e,t,s){return new Date(e,t,s)}function hn(e,t){return t(e)}function fn(e,t){return(s,n,a,o)=>null==o?Ze:t(e(n))}ps(2,-53,53,[1]);const pn={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let s=e.series[t];return s.width?s.stroke(e,t):s.points.width?s.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},mn=[0,0];function gn(e,t,s,n=!0){return e=>{0==e.button&&(!n||e.target==t)&&s(e)}}function yn(e,t,s,n=!0){return e=>{(!n||e.target==t)&&s(e)}}const bn={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,s){return mn[0]=t,mn[1]=s,mn},points:{one:!1,show:function(e,t){let s=e.cursor.points,n=ut(),a=s.size(e,t);lt(n,Re,a),lt(n,ze,a);let o=a/-2;lt(n,"marginLeft",o),lt(n,"marginTop",o);let i=s.width(e,t,a);return i&<(n,"borderWidth",i),n},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let s=e.series[t].points;return s._stroke||s._fill},fill:function(e,t){let s=e.series[t].points;return s._fill||s._stroke}},bind:{mousedown:gn,mouseup:gn,click:gn,dblclick:gn,mousemove:yn,mouseleave:yn,mouseenter:yn},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,s,n,a)=>n-a,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},xn={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},wn=Ms({},xn,{filter:ss}),kn=Ms({},wn,{size:10}),vn=Ms({},xn,{show:!1}),Sn='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Cn="bold "+Sn,Tn={show:!0,scale:"x",stroke:He,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Cn,side:2,grid:wn,ticks:kn,border:vn,font:Sn,lineGap:1.5,rotate:0},Mn={show:!0,scale:"x",auto:!1,sorted:1,min:Kt,max:-Kt,idxs:[]};function _n(e,t,s,n,a){return t.map(e=>null==e?"":At(e))}function Ln(e,t,s,n,a,o,i){let r=[],l=hs.get(a)||0;for(let c=s=i?s:ds(cs(s,a),l);c<=n;c=ds(c+a,l))r.push(Object.is(c,-0)?0:c);return r}function jn(e,t,s,n,a,o,i){const r=[],l=e.scales[e.axes[t].scale].log,c=Bt((10==l?Gt:Yt)(s));a=qt(l,c),10==l&&(a=Us[kt(a,Us)]);let u=s,d=a*l;10==l&&(d=Us[kt(d,Us)]);do{r.push(u),u+=a,10!=l||hs.has(u)||(u=ds(u,hs.get(a))),u>=d&&(d=(a=u)*l,10==l&&(d=Us[kt(d,Us)]))}while(u<=n);return r}function En(e,t,s,n,a,o,i){let r=e.scales[e.axes[t].scale].asinh,l=n>r?jn(e,t,Ut(r,s),n,a):[r],c=n>=0&&s<=0?[0]:[];return(s<-r?jn(e,t,Ut(r,-n),-s,a):[r]).reverse().map(e=>-e).concat(c,l)}const Pn=/./,Nn=/[12357]/,Dn=/[125]/,In=/1/,Fn=(e,t,s,n)=>e.map((e,a)=>4==t&&0==e||a%n==0&&s.test(e.toExponential()[e<0?1:0])?e:null);function An(e,t,s,n,a){let o=e.axes[s],i=o.scale,r=e.scales[i],l=e.valToPos,c=o._space,u=l(10,i),d=l(9,i)-u>=c?Pn:l(7,i)-u>=c?Nn:l(5,i)-u>=c?Dn:In;if(d==In){let e=Ot(l(1,i)-u);if(ea,Wn={show:!0,auto:!0,sorted:0,gaps:$n,alpha:1,facets:[Ms({},Bn,{scale:"x"}),Ms({},Bn,{scale:"y"})]},Hn={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:$n,alpha:1,points:{show:function(e,t){let{scale:s,idxs:n}=e.series[0],a=e._data[0],o=e.valToPos(a[n[0]],s,!0),i=e.valToPos(a[n[1]],s,!0),r=Ot(i-o)/(e.series[t].points.space*at);return n[1]-n[0]<=r},filter:null},values:null,min:Kt,max:-Kt,idxs:[],path:null,clip:null};function Un(e,t,s,n,a){return s/10}const qn={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Jn=Ms({},qn,{time:!1,ori:1}),Gn={};function Yn(e,t){let s=Gn[e];return s||(s={key:e,plots:[],sub(e){s.plots.push(e)},unsub(e){s.plots=s.plots.filter(t=>t!=e)},pub(e,t,n,a,o,i,r){for(let l=0;l{let m=e.pxRound;const g=r.dir*(0==r.ori?1:-1),y=0==r.ori?oa:ia;let b,x;1==g?(b=s,x=n):(b=n,x=s);let w=m(c(t[b],r,f,d)),k=m(u(i[b],l,p,h)),v=m(c(t[x],r,f,d)),S=m(u(1==o?l.max:l.min,l,p,h)),C=new Path2D(a);return y(C,v,S),y(C,w,S),y(C,w,k),C})}function Zn(e,t,s,n,a,o){let i=null;if(e.length>0){i=new Path2D;const r=0==t?ra:la;let l=s;for(let t=0;ts[0]){let e=s[0]-l;e>0&&r(i,l,n,e,n+o),l=s[1]}}let c=s+a-l,u=10;c>0&&r(i,l,n-u/2,c,n+o+u)}return i}function ea(e,t,s,n,a,o,i){let r=[],l=e.length;for(let c=1==a?s:n;c>=s&&c<=n;c+=a)if(null===t[c]){let u=c,d=c;if(1==a)for(;++c<=n&&null===t[c];)d=c;else for(;--c>=s&&null===t[c];)d=c;let h=o(e[u]),f=d==u?h:o(e[d]),p=u-a;h=i<=0&&p>=0&&p=0&&m>=0&&m=h&&r.push([h,f])}return r}function ta(e){return 0==e?ts:1==e?$t:t=>ls(t,e)}function sa(e){let t=0==e?na:aa,s=0==e?(e,t,s,n,a,o)=>{e.arcTo(t,s,n,a,o)}:(e,t,s,n,a,o)=>{e.arcTo(s,t,a,n,o)},n=0==e?(e,t,s,n,a)=>{e.rect(t,s,n,a)}:(e,t,s,n,a)=>{e.rect(s,t,a,n)};return(e,a,o,i,r,l=0,c=0)=>{0==l&&0==c?n(e,a,o,i,r):(l=Ht(l,i/2,r/2),c=Ht(c,i/2,r/2),t(e,a+l,o),s(e,a+i,o,a+i,o+r,l),s(e,a+i,o+r,a,o+r,c),s(e,a,o+r,a,o,c),s(e,a,o,a+i,o,l),e.closePath())}}const na=(e,t,s)=>{e.moveTo(t,s)},aa=(e,t,s)=>{e.moveTo(s,t)},oa=(e,t,s)=>{e.lineTo(t,s)},ia=(e,t,s)=>{e.lineTo(s,t)},ra=sa(0),la=sa(1),ca=(e,t,s,n,a,o)=>{e.arc(t,s,n,a,o)},ua=(e,t,s,n,a,o)=>{e.arc(s,t,n,a,o)},da=(e,t,s,n,a,o,i)=>{e.bezierCurveTo(t,s,n,a,o,i)},ha=(e,t,s,n,a,o,i)=>{e.bezierCurveTo(s,t,a,n,i,o)};function fa(e){return(e,t,s,n,a)=>Vn(e,t,(t,o,i,r,l,c,u,d,h,f,p)=>{let m,g,{pxRound:y,points:b}=t;0==r.ori?(m=na,g=ca):(m=aa,g=ua);const x=ds(b.width*at,3);let w=(b.size-b.width)/2*at,k=ds(2*w,3),v=new Path2D,S=new Path2D,{left:C,top:T,width:M,height:_}=e.bbox;ra(S,C-k,T-k,M+2*k,_+2*k);const L=e=>{if(null!=i[e]){let t=y(c(o[e],r,f,d)),s=y(u(i[e],l,p,h));m(v,t+w,s),g(v,t,s,w,0,2*zt)}};if(a)a.forEach(L);else for(let e=s;e<=n;e++)L(e);return{stroke:x>0?v:null,fill:v,clip:S,flags:3}})}function pa(e){return(t,s,n,a,o,i)=>{n!=a&&(o!=n&&i!=n&&e(t,s,n),o!=a&&i!=a&&e(t,s,a),e(t,s,i))}}const ma=pa(oa),ga=pa(ia);function ya(e){const t=Dt(null==e?void 0:e.alignGaps,0);return(e,s,n,a)=>Vn(e,s,(o,i,r,l,c,u,d,h,f,p,m)=>{[n,a]=Tt(r,n,a);let g,y,b=o.pxRound,x=e=>b(u(e,l,p,h)),w=e=>b(d(e,c,m,f));0==l.ori?(g=oa,y=ma):(g=ia,y=ga);const k=l.dir*(0==l.ori?1:-1),v={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},S=v.stroke;let C=!1;if(a-n>=4*p){let t,s,o,c=t=>e.posToVal(t,l.key,!0),u=null,d=null,h=x(i[1==k?n:a]),f=x(i[n]),p=x(i[a]),m=c(1==k?f+1:p-1);for(let e=1==k?n:a;e>=n&&e<=a;e+=k){let n=i[e],a=(1==k?nm)?h:x(n),o=r[e];a==h?null!=o?(s=o,null==u?(g(S,a,w(s)),t=u=d=s):sd&&(d=s)):null===o&&(C=!0):(null!=u&&y(S,h,w(u),w(d),w(t),w(s)),null!=o?(s=o,g(S,a,w(s)),u=d=t=s):(u=d=null,null===o&&(C=!0)),h=a,m=c(h+k))}null!=u&&u!=d&&o!=h&&y(S,h,w(u),w(d),w(t),w(s))}else for(let e=1==k?n:a;e>=n&&e<=a;e+=k){let t=r[e];null===t?C=!0:null!=t&&g(S,x(i[e]),w(t))}let[T,M]=Kn(e,s);if(null!=o.fill||0!=T){let t=v.fill=new Path2D(S),r=w(o.fillTo(e,s,o.min,o.max,T)),l=x(i[n]),c=x(i[a]);-1==k&&([c,l]=[l,c]),g(t,c,r),g(t,l,r)}if(!o.spanGaps){let c=[];C&&c.push(...ea(i,r,n,a,k,x,t)),v.gaps=c=o.gaps(e,s,n,a,c),v.clip=Zn(c,l.ori,h,f,p,m)}return 0!=M&&(v.band=2==M?[Qn(e,s,n,a,S,-1),Qn(e,s,n,a,S,1)]:Qn(e,s,n,a,S,M)),v})}function ba(e,t,s,n,a,o,i=Kt){if(e.length>1){let r=null;for(let l=0,c=1/0;l0!=n[e]>0?s[e]=0:(s[e]=3*(l[e-1]+l[e])/((2*l[e]+l[e-1])/n[e-1]+(l[e]+2*l[e-1])/n[e]),isFinite(s[e])||(s[e]=0));s[i-1]=n[i-2];for(let c=0;c{Fa.pxRatio=at}));const va=ya(),Sa=fa();function Ca(e,t,s,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((e,n)=>Ta(e,n,t,s))}function Ta(e,t,s,n){return Ms({},0==t?s:n,e)}function Ma(e,t,s){return null==t?ys:[t,s]}const _a=Ma;function La(e,t,s){return null==t?ys:Nt(t,s,.1,!0)}function ja(e,t,s,n){return null==t?ys:_t(t,s,e.scales[n].log,!1)}const Ea=ja;function Pa(e,t,s,n){return null==t?ys:Lt(t,s,e.scales[n].log,!1)}const Na=Pa;function Da(e){let t,s;return[e=e.replace(/(\d+)px/,(e,n)=>(t=$t((s=+n)*at))+"px"),t,s]}function Ia(e){e.show&&[e.font,e.labelFont].forEach(e=>{let t=ds(e[2]*at,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t})}function Fa(e,t,s){const n={mode:Dt(e.mode,1)},a=n.mode;function o(e,t,s,n){let a=t.valToPct(e);return n+s*(-1==t.dir?1-a:a)}function i(e,t,s,n){let a=t.valToPct(e);return n+s*(-1==t.dir?a:1-a)}function r(e,t,s,n){return 0==t.ori?o(e,t,s,n):i(e,t,s,n)}n.valToPosH=o,n.valToPosV=i;let l=!1;n.status=0;const c=n.root=ut("uplot");null!=e.id&&(c.id=e.id),it(c,e.class),e.title&&(ut("u-title",c).textContent=e.title);const u=ct("canvas"),d=n.ctx=u.getContext("2d"),h=ut("u-wrap",c);xt("click",h,e=>{e.target===p&&(Qs!=Ys||Zs!=Vs)&&kn.click(n,e)},!0);const f=n.under=ut("u-under",h);h.appendChild(u);const p=n.over=ut("u-over",h),m=+Dt((e=Ts(e)).pxAlign,1),g=ta(m);(e.plugins||[]).forEach(t=>{t.opts&&(e=t.opts(n,e)||e)});const y=e.ms||.001,b=n.series=1==a?Ca(e.series||[],Mn,Hn,!1):(x=e.series||[null],w=Wn,x.map((e,t)=>0==t?{}:Ms({},w,e)));var x,w;const k=n.axes=Ca(e.axes||[],Tn,On,!0),v=n.scales={},S=n.bands=e.bands||[];S.forEach(e=>{e.fill=es(e.fill||null),e.dir=Dt(e.dir,-1)});const C=2==a?b[1].facets[0].scale:b[0].scale,T={axes:function(){for(let e=0;ers[e]):y,x=2==f.distr?rs[y[1]]-rs[y[0]]:u,w=t.ticks,S=t.border,C=w.show?w.size:0,T=$t(C*at),M=$t((2==t.alignTo?t._size-C-t.gap:t.gap)*at),_=t._rotate*-zt/180,L=g(t._pos*at),j=L+(T+M)*c;a=0==i?j:0,s=1==i?j:0,Ss(t.font[0],l,1==t.align?$e:2==t.align?We:_>0?$e:_<0?We:0==i?"center":3==o?We:$e,_||1==i?"middle":2==o?Oe:Be);let E=t.font[1]*t.lineGap,P=y.map(e=>g(r(e,f,p,m))),N=t._values;for(let e=0;e0){let e=b.some(e=>e._focus)&&is!=Ee.alpha;e&&(d.globalAlpha=is=Ee.alpha),b.forEach((e,s)=>{if(s>0&&e.show&&(js(s,!1),js(s,!0),null==e._paths)){let o=is;is!=e.alpha&&(d.globalAlpha=is=e.alpha);let i=2==a?[0,t[s][0].length-1]:function(e){let t=Qt(yt-1,0,mt-1),s=Qt(bt+1,0,mt-1);for(;null==e[t]&&t>0;)t--;for(;null==e[s]&&s{if(t>0&&e.show){let s=is;is!=e.alpha&&(d.globalAlpha=is=e.alpha),null!=e._paths&&Es(t,!1);{let s=null!=e._paths?e._paths.gaps:null,a=e.points.show(n,t,yt,bt,s),o=e.points.filter(n,t,a,s);(a||o)&&(e.points._paths=e.points.paths(n,t,yt,bt,o),Es(t,!0))}is!=s&&(d.globalAlpha=is=s),Fa("drawSeries",t)}}),e&&(d.globalAlpha=is=1)}}},M=(e.drawOrder||["axes","series"]).map(e=>T[e]);function _(e){const t=3==e.distr?t=>Gt(t>0?t:e.clamp(n,t,e.min,e.max,e.key)):4==e.distr?t=>Vt(t,e.asinh):100==e.distr?t=>e.fwd(t):e=>e;return s=>{let n=t(s),{_min:a,_max:o}=e;return(n-a)/(o-a)}}function L(t){let s=v[t];if(null==s){let n=(e.scales||ms)[t]||ms;if(null!=n.from){L(n.from);let e=Ms({},v[n.from],n,{key:t});e.valToPct=_(e),v[t]=e}else{s=v[t]=Ms({},t==C?qn:Jn,n),s.key=t;let e=s.time,o=s.range,i=bs(o);if((t!=C||2==a&&!e)&&(!i||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?jt:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?jt:{mode:1,hard:o[1],soft:o[1]}},i=!1),!i&&ks(o))){let e=o;o=(t,s,n)=>null==s?ys:Nt(s,n,e)}s.range=es(o||(e?_a:t==C?3==s.distr?Ea:4==s.distr?Na:Ma:3==s.distr?ja:4==s.distr?Pa:La)),s.auto=es(!i&&s.auto),s.clamp=es(s.clamp||Un),s._min=s._max=null,s.valToPct=_(s)}}}L("x"),L("y"),1==a&&b.forEach(e=>{L(e.scale)}),k.forEach(e=>{L(e.scale)});for(let Fe in e.scales)L(Fe);const j=v[C],E=j.distr;let P,N;0==j.ori?(it(c,"u-hz"),P=o,N=i):(it(c,"u-vt"),P=i,N=o);const D={};for(let Fe in v){let e=v[Fe];null==e.min&&null==e.max||(D[Fe]={min:e.min,max:e.max},e.min=e.max=null)}const I=e.tzDate||(e=>new Date($t(e/y))),F=e.fmtDate||Rs,A=1==y?an(I):ln(I),R=un(I,cn(1==y?nn:rn,F)),z=fn(I,hn("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",F)),O=[],B=n.legend=Ms({},pn,e.legend),$=n.cursor=Ms({},bn,{drag:{y:2==a}},e.cursor),W=B.show,H=$.show,U=B.markers;let q,J,G;B.idxs=O,U.width=es(U.width),U.dash=es(U.dash),U.stroke=es(U.stroke),U.fill=es(U.fill);let Y,V=[],K=[],X=!1,Q={};if(B.live){const e=b[1]?b[1].values:null;X=null!=e,Y=X?e(n,1,0):{_:0};for(let t in Y)Q[t]=Ze}if(W)if(q=ct("table","u-legend",c),G=ct("tbody",null,q),B.mount(n,q),X){J=ct("thead",null,q,G);let e=ct("tr",null,J);for(var Z in ct("th",null,e),Y)ct("th",Ae,e).textContent=Z}else it(q,"u-inline"),B.live&&it(q,"u-live");const ee={show:!0},te={show:!1},se=new Map;function ne(e,t,s,a=!0){const o=se.get(t)||{},i=$.bind[e](n,t,s,a);i&&(xt(e,t,o[e]=i),se.set(t,o))}function ae(e,t,s){const n=se.get(t)||{};for(let a in n)null!=e&&a!=e||(wt(a,t,n[a]),delete n[a]);null==e&&se.delete(t)}let oe=0,ie=0,re=0,le=0,ce=0,ue=0,de=ce,he=ue,fe=re,pe=le,me=0,ge=0,ye=0,be=0;n.bbox={};let xe=!1,we=!1,ke=!1,ve=!1,Se=!1,Ce=!1;function Te(e,t,s){(s||e!=n.width||t!=n.height)&&Me(e,t),Os(!1),ke=!0,we=!0,gn()}function Me(e,t){n.width=oe=re=e,n.height=ie=le=t,ce=ue=0,function(){let e=!1,t=!1,s=!1,n=!1;k.forEach((a,o)=>{if(a.show&&a._show){let{side:o,_size:i}=a,r=o%2,l=i+(null!=a.label?a.labelSize:0);l>0&&(r?(re-=l,3==o?(ce+=l,n=!0):s=!0):(le-=l,0==o?(ue+=l,e=!0):t=!0))}}),nt[0]=e,nt[1]=s,nt[2]=t,nt[3]=n,re-=ft[1]+ft[3],ce+=ft[3],le-=ft[2]+ft[0],ue+=ft[0]}(),function(){let e=ce+re,t=ue+le,s=ce,n=ue;function a(a,o){switch(a){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return s-=o,s+o;case 0:return n-=o,n+o}}k.forEach((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=a(t,e._size),null!=e.label&&(e._lpos=a(t,e.labelSize))}})}();let s=n.bbox;me=s.left=ls(ce*at,.5),ge=s.top=ls(ue*at,.5),ye=s.width=ls(re*at,.5),be=s.height=ls(le*at,.5)}const _e=3;if(n.setSize=function({width:e,height:t}){Te(e,t)},null==$.dataIdx){let e=$.hover,s=e.skip=new Set(e.skip??[]);s.add(void 0);let n=e.prox=es(e.prox),a=e.bias??(e.bias=0);$.dataIdx=(e,o,i,r)=>{if(0==o)return i;let l=i,c=n(e,o,i,r)??Kt,u=c>=0&&c0;)s.has(p[e])||(t=e);if(0==a||1==a)for(e=i;null==n&&e++c&&(l=null);return l}}const Le=e=>{$.event=e};$.idxs=O,$._lock=!1;let je=$.points;je.show=es(je.show),je.size=es(je.size),je.stroke=es(je.stroke),je.width=es(je.width),je.fill=es(je.fill);const Ee=n.focus=Ms({},e.focus||{alpha:.3},$.focus),Pe=Ee.prox>=0,Ne=Pe&&je.one;let De=[],Ie=[],He=[];function Xe(e,t){let s=je.show(n,t);if(s instanceof HTMLElement)return it(s,"u-cursor-pt"),it(s,e.class),ht(s,-10,-10,re,le),p.insertBefore(s,De[t]),s}function et(e,t){if(1==a||t>0){let t=1==a&&v[e.scale].time,s=e.value;e.value=t?ws(s)?fn(I,hn(s,F)):s||z:s||zn,e.label=e.label||(t?"Time":"Value")}if(Ne||t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||va||ns,e.fillTo=es(e.fillTo||Xn),e.pxAlign=+Dt(e.pxAlign,m),e.pxRound=ta(e.pxAlign),e.stroke=es(e.stroke||null),e.fill=es(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=ds(1*(3+2*(Ut(1,e.width)||1)),3),s=e.points=Ms({},{size:t,width:Ut(1,.2*t),stroke:e.stroke,space:2*t,paths:Sa,_stroke:null,_fill:null},e.points);s.show=es(s.show),s.filter=es(s.filter),s.fill=es(s.fill),s.stroke=es(s.stroke),s.paths=es(s.paths),s.pxAlign=e.pxAlign}if(W){let s=function(e,t){if(0==t&&(X||!B.live||2==a))return ys;let s=[],o=ct("tr","u-series",G,G.childNodes[t]);it(o,e.class),e.show||it(o,Fe);let i=ct("th",null,o);if(U.show){let e=ut("u-marker",i);if(t>0){let s=U.width(n,t);s&&(e.style.border=s+"px "+U.dash(n,t)+" "+U.stroke(n,t)),e.style.background=U.fill(n,t)}}let r=ut(Ae,i);for(var l in e.label instanceof HTMLElement?r.appendChild(e.label):r.textContent=e.label,t>0&&(U.show||(r.style.color=e.width>0?U.stroke(n,t):U.fill(n,t)),ne("click",i,t=>{if($._lock)return;Le(t);let s=b.indexOf(e);if((t.ctrlKey||t.metaKey)!=B.isolate){let e=b.some((e,t)=>t>0&&t!=s&&e.show);b.forEach((t,n)=>{n>0&&In(n,e?n==s?ee:te:ee,!0,Ra.setSeries)})}else In(s,{show:!e.show},!0,Ra.setSeries)},!1),Pe&&ne(Ye,i,t=>{$._lock||(Le(t),In(b.indexOf(e),Gn,!0,Ra.setSeries))},!1)),Y){let e=ct("td","u-value",o);e.textContent="--",s.push(e)}return[o,s]}(e,t);V.splice(t,0,s[0]),K.splice(t,0,s[1]),B.values.push(null)}if(H){O.splice(t,0,null);let s=null;Ne?0==t&&(s=Xe(e,t)):t>0&&(s=Xe(e,t)),De.splice(t,0,s),Ie.splice(t,0,0),He.splice(t,0,0)}Fa("addSeries",t)}n.addSeries=function(e,t){t=null==t?b.length:t,e=1==a?Ta(e,t,Mn,Hn):Ta(e,t,{},Wn),b.splice(t,0,e),et(b[t],t)},n.delSeries=function(e){if(b.splice(e,1),W){B.values.splice(e,1),K.splice(e,1);let t=V.splice(e,1)[0];ae(null,t.firstChild),t.remove()}H&&(O.splice(e,1),De.splice(e,1)[0].remove(),Ie.splice(e,1),He.splice(e,1)),Fa("delSeries",e)};const nt=[!1,!1,!1,!1];function ot(e,t,s,n){let[a,o,i,r]=s,l=t%2,c=0;return 0==l&&(r||o)&&(c=0==t&&!a||2==t&&!i?$t(Tn.size/3):0),1==l&&(a||i)&&(c=1==t&&!o||3==t&&!r?$t(On.size/2):0),c}const dt=n.padding=(e.padding||[ot,ot,ot,ot]).map(e=>es(Dt(e,ot))),ft=n._padding=dt.map((e,t)=>e(n,t,nt,0));let mt,yt=null,bt=null;const vt=1==a?b[0].idxs:null;let Et,Pt,It,Ft,At,Bt,Jt,Yt,ts,is,rs=null,cs=!1;function us(e,s){if(t=null==e?[]:e,n.data=n._data=t,2==a){mt=0;for(let e=1;e=0,Ce=!0,gn()}}function ps(){let e,s;cs=!0,1==a&&(mt>0?(yt=vt[0]=0,bt=vt[1]=mt-1,e=t[0][yt],s=t[0][bt],2==E?(e=yt,s=bt):e==s&&(3==E?[e,s]=_t(e,e,j.log,!1):4==E?[e,s]=Lt(e,e,j.log,!1):j.time?s=e+$t(86400/y):[e,s]=Nt(e,s,.1,!0))):(yt=vt[0]=e=null,bt=vt[1]=s=null)),Dn(C,e,s)}function xs(e,t,s,n,a,o){e??(e=Ue),s??(s=gs),n??(n="butt"),a??(a=Ue),o??(o="round"),e!=Et&&(d.strokeStyle=Et=e),a!=Pt&&(d.fillStyle=Pt=a),t!=It&&(d.lineWidth=It=t),o!=At&&(d.lineJoin=At=o),n!=Bt&&(d.lineCap=Bt=n),s!=Ft&&d.setLineDash(Ft=s)}function Ss(e,t,s,n){t!=Pt&&(d.fillStyle=Pt=t),e!=Jt&&(d.font=Jt=e),s!=Yt&&(d.textAlign=Yt=s),n!=ts&&(d.textBaseline=ts=n)}function Cs(e,t,s,a,o=0){if(a.length>0&&e.auto(n,cs)&&(null==t||null==t.min)){let t=Dt(yt,0),n=Dt(bt,a.length-1),i=null==s.min?function(e,t,s,n=0,a=!1){let o=a?Mt:Tt,i=a?Ct:St;[t,s]=o(e,t,s);let r=e[t],l=e[t];if(t>-1)if(1==n)r=e[t],l=e[s];else if(-1==n)r=e[s],l=e[t];else for(let c=t;c<=s;c++){let t=e[c];i(t)&&(tl&&(l=t))}return[r??Kt,l??-Kt]}(a,t,n,o,3==e.distr):[s.min,s.max];e.min=Ht(e.min,s.min=i[0]),e.max=Ut(e.max,s.max=i[1])}}n.setData=us;const _s={min:null,max:null};function js(e,t){let s=t?b[e].points:b[e];s._stroke=s.stroke(n,e),s._fill=s.fill(n,e)}function Es(e,s){let a=s?b[e].points:b[e],{stroke:o,fill:i,clip:r,flags:l,_stroke:c=a._stroke,_fill:u=a._fill,_width:h=a.width}=a._paths;h=ds(h*at,3);let f=null,p=h%2/2;s&&null==u&&(u=h>0?"#fff":c);let m=1==a.pxAlign&&p>0;if(m&&d.translate(p,p),!s){let e=me-h/2,t=ge-h/2,s=ye+h,n=be+h;f=new Path2D,f.rect(e,t,s,n)}s?Ns(c,h,a.dash,a.cap,u,o,i,l,r):function(e,s,a,o,i,r,l,c,u,d,h){let f=!1;0!=u&&S.forEach((p,m)=>{if(p.series[0]==e){let e,g=b[p.series[1]],y=t[p.series[1]],x=(g._paths||ms).band;bs(x)&&(x=1==p.dir?x[0]:x[1]);let w=null;g.show&&x&&function(e,t,s){for(t=Dt(t,0),s=Dt(s,e.length-1);t<=s;){if(null!=e[t])return!0;t++}return!1}(y,yt,bt)?(w=p.fill(n,m)||r,e=g._paths.clip):x=null,Ns(s,a,o,i,w,l,c,u,d,h,e,x),f=!0}}),f||Ns(s,a,o,i,r,l,c,u,d,h)}(e,c,h,a.dash,a.cap,u,o,i,l,f,r),m&&d.translate(-p,-p)}const Ps=3;function Ns(e,t,s,n,a,o,i,r,l,c,u,h){xs(e,t,s,n,a),(l||c||h)&&(d.save(),l&&d.clip(l),c&&d.clip(c)),h?(r&Ps)==Ps?(d.clip(h),u&&d.clip(u),Is(a,i),Ds(e,o,t)):2&r?(Is(a,i),d.clip(h),Ds(e,o,t)):1&r&&(d.save(),d.clip(h),u&&d.clip(u),Is(a,i),d.restore(),Ds(e,o,t)):(Is(a,i),Ds(e,o,t)),(l||c||h)&&d.restore()}function Ds(e,t,s){s>0&&(t instanceof Map?t.forEach((e,t)=>{d.strokeStyle=Et=t,d.stroke(e)}):null!=t&&e&&d.stroke(t))}function Is(e,t){t instanceof Map?t.forEach((e,t)=>{d.fillStyle=Pt=t,d.fill(e)}):null!=t&&e&&d.fill(t)}function Fs(e,t,s,n,a,o,i,r,l,c){let u=i%2/2;1==m&&d.translate(u,u),xs(r,i,l,c,r),d.beginPath();let h,f,p,g,y=a+(0==n||3==n?-o:o);0==s?(f=a,g=y):(h=a,p=y);for(let m=0;m{if(!s.show)return;let o=v[s.scale];if(null==o.min)return void(s._show&&(t=!1,s._show=!1,Os(!1)));s._show||(t=!1,s._show=!0,Os(!1));let i=s.side,r=i%2,{min:l,max:c}=o,[u,d]=function(e,t,s,a){let o,i=k[e];if(a<=0)o=[0,0];else{let r=i._space=i.space(n,e,t,s,a);o=function(e,t,s,n,a){let o=Ut(Xt(e),Xt(t)),i=t-e,r=kt(a/n*i,s);do{let e=s[r],t=n*e/i;if(t>=a&&o+(e<5?hs.get(e):0)<=17)return[e,t]}while(++rrs[e]):f,m=2==o.distr?rs[f[1]]-rs[f[0]]:u,g=s._values=s.values(n,s.filter(n,p,a,d,m),a,d,m);s._rotate=2==i?s.rotate(n,g,a,d):0;let y=s._size;s._size=Wt(s.size(n,g,a,e)),null!=y&&s._size!=y&&(t=!1)}),t}function zs(e){let t=!0;return dt.forEach((s,a)=>{let o=s(n,a,nt,e);o!=ft[a]&&(t=!1),ft[a]=o}),t}function Os(e){b.forEach((t,s)=>{s>0&&(t._paths=null,e&&(1==a?(t.min=null,t.max=null):t.facets.forEach(e=>{e.min=null,e.max=null})))})}let Bs,$s,Ws,qs,Js,Gs,Ys,Vs,Ks,Xs,Qs,Zs,en=!1,tn=!1,dn=[];function mn(){tn=!1;for(let e=0;e0){b.forEach((s,o)=>{if(1==a){let a=s.scale,i=D[a];if(null==i)return;let r=e[a];if(0==o){let e=r.range(n,r.min,r.max,a);r.min=e[0],r.max=e[1],yt=kt(r.min,t[0]),bt=kt(r.max,t[0]),bt-yt>1&&(t[0][yt]r.max&&bt--),s.min=rs[yt],s.max=rs[bt]}else s.show&&s.auto&&Cs(r,i,s,t[o],s.sorted);s.idxs[0]=yt,s.idxs[1]=bt}else if(o>0&&s.show&&s.auto){let[n,a]=s.facets,i=n.scale,r=a.scale,[l,c]=t[o],u=e[i],d=e[r];null!=u&&Cs(u,D[i],n,l,n.sorted),null!=d&&Cs(d,D[r],a,c,a.sorted),s.min=a.min,s.max=a.max}});for(let t in e){let s=e[t],a=D[t];if(null==s.from&&(null==a||null==a.min)){let e=s.range(n,s.min==Kt?null:s.min,s.max==-Kt?null:s.max,t);s.min=e[0],s.max=e[1]}}}for(let t in e){let s=e[t];if(null!=s.from){let a=e[s.from];if(null==a.min)s.min=s.max=null;else{let e=s.range(n,a.min,a.max,t);s.min=e[0],s.max=e[1]}}}let s={},o=!1;for(let t in e){let n=e[t],a=v[t];if(a.min!=n.min||a.max!=n.max){a.min=n.min,a.max=n.max;let e=a.distr;a._min=3==e?Gt(a.min):4==e?Vt(a.min,a.asinh):100==e?a.fwd(a.min):a.min,a._max=3==e?Gt(a.max):4==e?Vt(a.max,a.asinh):100==e?a.fwd(a.max):a.max,s[t]=o=!0}}if(o){b.forEach((e,t)=>{2==a?t>0&&s.y&&(e._paths=null):s[e.scale]&&(e._paths=null)});for(let e in s)ke=!0,Fa("setScale",e);H&&$.left>=0&&(ve=Ce=!0)}for(let t in D)D[t]=null}(),xe=!1),ke&&(function(){let e=!1,t=0;for(;!e;){t++;let s=As(t),a=zs(t);e=t==_e||s&&a,e||(Me(n.width,n.height),we=!0)}}(),ke=!1),we){if(lt(f,$e,ce),lt(f,Oe,ue),lt(f,Re,re),lt(f,ze,le),lt(p,$e,ce),lt(p,Oe,ue),lt(p,Re,re),lt(p,ze,le),lt(h,Re,oe),lt(h,ze,ie),u.width=$t(oe*at),u.height=$t(ie*at),k.forEach(({_el:e,_show:t,_size:s,_pos:n,side:a})=>{if(null!=e)if(t){let t=a%2==1;lt(e,t?"left":"top",n-(3===a||0===a?s:0)),lt(e,t?"width":"height",s),lt(e,t?"top":"left",t?ue:ce),lt(e,t?"height":"width",t?le:re),rt(e,Fe)}else it(e,Fe)}),Et=Pt=It=At=Bt=Jt=Yt=ts=Ft=null,is=1,ia(!0),ce!=de||ue!=he||re!=fe||le!=pe){Os(!1);let e=re/fe,t=le/pe;if(H&&!ve&&$.left>=0){$.left*=e,$.top*=t,Ws&&ht(Ws,$t($.left),0,re,le),qs&&ht(qs,0,$t($.top),re,le);for(let s=0;s=0&&Cn.width>0){Cn.left*=e,Cn.width*=e,Cn.top*=t,Cn.height*=t;for(let e in ca)lt(Pn,e,Cn[e])}de=ce,he=ue,fe=re,pe=le}Fa("setSize"),we=!1}oe>0&&ie>0&&(d.clearRect(0,0,u.width,u.height),Fa("drawClear"),M.forEach(e=>e()),Fa("draw")),Cn.show&&Se&&(Nn(Cn),Se=!1),H&&ve&&(aa(null,!0,!1),ve=!1),B.show&&B.live&&Ce&&(sa(),Ce=!1),l||(l=!0,n.status=1,Fa("ready")),cs=!1,en=!1}function xn(e,s){let a=v[e];if(null==a.from){if(0==mt){let t=a.range(n,s.min,s.max,e);s.min=t[0],s.max=t[1]}if(s.min>s.max){let e=s.min;s.min=s.max,s.max=e}if(mt>1&&null!=s.min&&null!=s.max&&s.max-s.min<1e-16)return;e==C&&2==a.distr&&mt>0&&(s.min=kt(s.min,t[0]),s.max=kt(s.max,t[0]),s.min==s.max&&s.max++),D[e]=s,xe=!0,gn()}}n.batch=function(e,t=!1){en=!0,tn=t,e(n),yn(),t&&dn.length>0&&queueMicrotask(mn)},n.redraw=(e,t)=>{ke=t||!1,!1!==e?Dn(C,j.min,j.max):gn()},n.setScale=xn;let wn=!1;const kn=$.drag;let vn=kn.x,Sn=kn.y;H&&($.x&&(Bs=ut("u-cursor-x",p)),$.y&&($s=ut("u-cursor-y",p)),0==j.ori?(Ws=Bs,qs=$s):(Ws=$s,qs=Bs),Qs=$.left,Zs=$.top);const Cn=n.select=Ms({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Pn=Cn.show?ut("u-select",Cn.over?p:f):null;function Nn(e,t){if(Cn.show){for(let t in e)Cn[t]=e[t],t in ca&<(Pn,t,e[t]);!1!==t&&Fa("setSelect")}}function Dn(e,t,s){xn(e,{min:t,max:s})}function In(e,t,s,o){null!=t.focus&&function(e){if(e!=$n){let t=null==e,s=1!=Ee.alpha;b.forEach((n,o)=>{if(1==a||o>0){let a=t||0==o||o==e;n._focus=t?null:a,s&&function(e,t){b[e].alpha=t,H&&null!=De[e]&&(De[e].style.opacity=t),W&&V[e]&&(V[e].style.opacity=t)}(o,a?1:Ee.alpha)}}),$n=e,s&&gn()}}(e),null!=t.show&&b.forEach((s,n)=>{n>0&&(e==n||null==e)&&(s.show=t.show,function(e){if(b[e].show)W&&rt(V[e],Fe);else if(W&&it(V[e],Fe),H){let t=Ne?De[0]:De[e];null!=t&&ht(t,-10,-10,re,le)}}(n),2==a?(Dn(s.facets[0].scale,null,null),Dn(s.facets[1].scale,null,null)):Dn(s.scale,null,null),gn())}),!1!==s&&Fa("setSeries",e,t),o&&Ba("setSeries",n,e,t)}let Fn,Bn,$n;n.setSelect=Nn,n.setSeries=In,n.addBand=function(e,t){e.fill=es(e.fill||null),e.dir=Dt(e.dir,-1),t=null==t?S.length:t,S.splice(t,0,e)},n.setBand=function(e,t){Ms(S[e],t)},n.delBand=function(e){null==e?S.length=0:S.splice(e,1)};const Gn={focus:!0};function Vn(e,t,s){let n=v[t];s&&(e=e/at-(1==n.ori?ue:ce));let a=re;1==n.ori&&(a=le,e=a-e),-1==n.dir&&(e=a-e);let o=n._min,i=o+(n._max-o)*(e/a),r=n.distr;return 3==r?qt(10,i):4==r?((e,t=1)=>Rt.sinh(e)*t)(i,n.asinh):100==r?n.bwd(i):i}function Kn(e,t){lt(Pn,$e,Cn.left=e),lt(Pn,Re,Cn.width=t)}function Qn(e,t){lt(Pn,Oe,Cn.top=e),lt(Pn,ze,Cn.height=t)}W&&Pe&&ne(Ve,q,e=>{$._lock||(Le(e),null!=$n&&In(null,Gn,!0,Ra.setSeries))}),n.valToIdx=e=>kt(e,t[0]),n.posToIdx=function(e,s){return kt(Vn(e,C,s),t[0],yt,bt)},n.posToVal=Vn,n.valToPos=(e,t,s)=>0==v[t].ori?o(e,v[t],s?ye:re,s?me:0):i(e,v[t],s?be:le,s?ge:0),n.setCursor=(e,t,s)=>{Qs=e.left,Zs=e.top,aa(null,t,s)};let Zn=0==j.ori?Kn:Qn,ea=1==j.ori?Kn:Qn;function sa(e,t){if(null!=e&&(e.idxs?e.idxs.forEach((e,t)=>{O[t]=e}):void 0!==e.idx&&O.fill(e.idx),B.idx=O[0]),W&&B.live){for(let e=0;e0||1==a&&!X)&&na(e,O[e]);!function(){if(W&&B.live)for(let e=2==a?1:0;ebt;Fn=Kt,Bn=null;let l=0==j.ori?re:le,c=1==j.ori?re:le;if(Qs<0||0==mt||r){i=$.idx=null;for(let e=0;e0&&e.show){let s=null==w?-10:w==i?o:P(1==a?t[0][w]:t[g][0][w],j,l,0),y=null==k?-10:N(k,1==a?v[e.scale]:v[e.facets[1].scale],c,0);if(Pe&&null!=k){let t=1==j.ori?Qs:Zs,s=Ot(Ee.dist(n,g,w,y,t));if(s=0?1:-1;o==(k>=0?1:-1)&&(1==o?1==n?k>=a:k<=a:1==n?k<=a:k>=a)&&(Fn=s,Bn=g)}else Fn=s,Bn=g}}if(Ce||Ne){let e,t;0==j.ori?(e=s,t=y):(e=y,t=s);let a,o,i,l,c,b,x=!0,w=je.bbox;if(null!=w){x=!1;let e=w(n,g);i=e.left,l=e.top,a=e.width,o=e.height}else i=e,l=t,a=o=je.size(n,g);if(b=je.fill(n,g),c=je.stroke(n,g),Ne)g==Bn&&Fn<=Ee.prox&&(r=i,u=l,d=a,h=o,f=x,p=b,m=c);else{let e=De[g];null!=e&&(Ie[g]=i,He[g]=l,gt(e,a,o,x),pt(e,b,c),ht(e,Wt(i),Wt(l),re,le))}}}}if(Ne){let e=Ee.prox;if(Ce||(null==$n?Fn<=e:Fn>e||Bn!=$n)){let e=De[0];null!=e&&(Ie[0]=r,He[0]=u,gt(e,d,h,f),pt(e,p,m),ht(e,Wt(r),Wt(u),re,le))}}}if(Cn.show&&wn)if(null!=e){let[t,s]=Ra.scales,[n,a]=Ra.match,[o,i]=e.cursor.sync.scales,r=e.cursor.drag;if(vn=r._x,Sn=r._y,vn||Sn){let r,u,d,h,f,{left:p,top:m,width:g,height:y}=e.select,b=e.scales[o].ori,x=e.posToVal,w=null!=t&&n(t,o),k=null!=s&&a(s,i);w&&vn?(0==b?(r=p,u=g):(r=m,u=y),d=v[t],h=P(x(r,o),d,l,0),f=P(x(r+u,o),d,l,0),Zn(Ht(h,f),Ot(f-h))):Zn(0,l),k&&Sn?(1==b?(r=p,u=g):(r=m,u=y),d=v[s],h=N(x(r,i),d,c,0),f=N(x(r+u,i),d,c,0),ea(Ht(h,f),Ot(f-h))):ea(0,c)}else ua()}else{let e=Ot(Ks-Js),t=Ot(Xs-Gs);if(1==j.ori){let s=e;e=t,t=s}vn=kn.x&&e>=kn.dist,Sn=kn.y&&t>=kn.dist;let s,n,a=kn.uni;null!=a?vn&&Sn&&(vn=e>=a,Sn=t>=a,vn||Sn||(t>e?Sn=!0:vn=!0)):kn.x&&kn.y&&(vn||Sn)&&(vn=Sn=!0),vn&&(0==j.ori?(s=Ys,n=Qs):(s=Vs,n=Zs),Zn(Ht(s,n),Ot(n-s)),Sn||ea(0,c)),Sn&&(1==j.ori?(s=Ys,n=Qs):(s=Vs,n=Zs),ea(Ht(s,n),Ot(n-s)),vn||Zn(0,l)),vn||Sn||(Zn(0,0),ea(0,0))}if(kn._x=vn,kn._y=Sn,null==e){if(o){if(null!=za){let[e,t]=Ra.scales;Ra.values[0]=null!=e?Vn(0==j.ori?Qs:Zs,e):null,Ra.values[1]=null!=t?Vn(1==j.ori?Qs:Zs,t):null}Ba(qe,n,Qs,Zs,re,le,i)}if(Pe){let e=o&&Ra.setSeries,t=Ee.prox;null==$n?Fn<=t&&In(Bn,Gn,!0,e):Fn>t?In(null,Gn,!0,e):Bn!=$n&&In(Bn,Gn,!0,e)}}Ce&&(B.idx=i,sa()),!1!==s&&Fa("setCursor")}n.setLegend=sa;let oa=null;function ia(e=!1){e?oa=null:(oa=p.getBoundingClientRect(),Fa("syncRect",oa))}function ra(e,t,s,n,a,o,i){$._lock||wn&&null!=e&&0==e.movementX&&0==e.movementY||(la(e,t,s,n,a,o,0,!1,null!=e),null!=e?aa(null,!0,!0):aa(t,!0,!1))}function la(e,t,s,a,o,i,l,c,u){if(null==oa&&ia(!1),Le(e),null!=e)s=e.clientX-oa.left,a=e.clientY-oa.top;else{if(s<0||a<0)return Qs=-10,void(Zs=-10);let[e,n]=Ra.scales,l=t.cursor.sync,[c,u]=l.values,[d,h]=l.scales,[f,p]=Ra.match,m=t.axes[0].side%2==1,g=0==j.ori?re:le,y=1==j.ori?re:le,b=m?i:o,x=m?o:i,w=m?a:s,k=m?s:a;if(s=null!=d?f(e,d)?r(c,v[e],g,0):-10:g*(w/b),a=null!=h?p(n,h)?r(u,v[n],y,0):-10:y*(k/x),1==j.ori){let e=s;s=a,a=e}}!u||null!=t&&t.cursor.event.type!=qe||((s<=1||s>=re-1)&&(s=ls(s,re)),(a<=1||a>=le-1)&&(a=ls(a,le))),c?(Js=s,Gs=a,[Ys,Vs]=$.move(n,s,a)):(Qs=s,Zs=a)}Object.defineProperty(n,"rect",{get:()=>(null==oa&&ia(!1),oa)});const ca={width:0,height:0,left:0,top:0};function ua(){Nn(ca,!1)}let da,ha,fa,pa;function ma(e,t,s,a,o,i,r){wn=!0,vn=Sn=kn._x=kn._y=!1,la(e,t,s,a,o,i,0,!0,!1),null!=e&&(ne(Ge,tt,ga,!1),Ba(Je,n,Ys,Vs,re,le,null));let{left:l,top:c,width:u,height:d}=Cn;da=l,ha=c,fa=u,pa=d}function ga(e,t,s,a,o,i,r){wn=kn._x=kn._y=!1,la(e,t,s,a,o,i,0,!1,!0);let{left:l,top:c,width:u,height:d}=Cn,h=u>0||d>0,f=da!=l||ha!=c||fa!=u||pa!=d;if(h&&f&&Nn(Cn),kn.setScale&&h&&f){let e=l,t=u,s=c,n=d;if(1==j.ori&&(e=c,t=d,s=l,n=u),vn&&Dn(C,Vn(e,C),Vn(e+t,C)),Sn)for(let a in v){let e=v[a];a!=C&&null==e.from&&e.min!=Kt&&Dn(a,Vn(s+n,a),Vn(s,a))}ua()}else $.lock&&($._lock=!$._lock,aa(t,!0,null!=e));null!=e&&(ae(Ge,tt),Ba(Ge,n,Qs,Zs,re,le,null))}function ya(e,t,s,a,o,i,r){$._lock||(Le(e),ps(),ua(),null!=e&&Ba(Ke,n,Qs,Zs,re,le,null))}function ba(){k.forEach(Ia),Te(n.width,n.height,!0)}xt(Qe,st,ba);const xa={};xa.mousedown=ma,xa.mousemove=ra,xa.mouseup=ga,xa.dblclick=ya,xa.setSeries=(e,t,s,a)=>{-1!=(s=(0,Ra.match[2])(n,t,s))&&In(s,a,!0,!1)},H&&(ne(Je,p,ma),ne(qe,p,ra),ne(Ye,p,e=>{Le(e),ia(!1)}),ne(Ve,p,function(e,t,s,n,a,o,i){if($._lock)return;Le(e);let r=wn;if(wn){let e,t,s=!0,n=!0,a=10;0==j.ori?(e=vn,t=Sn):(e=Sn,t=vn),e&&t&&(s=Qs<=a||Qs>=re-a,n=Zs<=a||Zs>=le-a),e&&s&&(Qs=Qs{e.call(null,n,t,s)})}(e.plugins||[]).forEach(e=>{for(let t in e.hooks)ka[t]=(ka[t]||[]).concat(e.hooks[t])});const Aa=(e,t,s)=>s,Ra=Ms({key:null,setSeries:!1,filters:{pub:as,sub:as},scales:[C,b[1]?b[1].scale:null],match:[os,os,Aa],values:[null,null]},$.sync);2==Ra.match.length&&Ra.match.push(Aa),$.sync=Ra;const za=Ra.key,Oa=Yn(za);function Ba(e,t,s,n,a,o,i){Ra.filters.pub(e,t,s,n,a,o,i)&&Oa.pub(e,t,s,n,a,o,i)}function $a(){Fa("init",e,t),us(t||e.data,!1),D[C]?xn(C,D[C]):ps(),Se=Cn.show&&(Cn.width>0||Cn.height>0),ve=Ce=!0,Te(e.width,e.height)}return Oa.sub(n),n.pub=function(e,t,s,n,a,o,i){Ra.filters.sub(e,t,s,n,a,o,i)&&xa[e](null,t,s,n,a,o,i)},n.destroy=function(){Oa.unsub(n),wa.delete(n),se.clear(),wt(Qe,st,ba),c.remove(),null==q||q.remove(),Fa("destroy")},b.forEach(et),k.forEach(function(e,t){if(e._show=e.show,e.show){let s=e.side%2,a=v[e.scale];null==a&&(e.scale=s?b[1].scale:C,a=v[e.scale]);let o=a.time;e.size=es(e.size),e.space=es(e.space),e.rotate=es(e.rotate),bs(e.incrs)&&e.incrs.forEach(e=>{!hs.has(e)&&hs.set(e,fs(e))}),e.incrs=es(e.incrs||(2==a.distr?Hs:o?1==y?sn:on:Us)),e.splits=es(e.splits||(o&&1==a.distr?A:3==a.distr?jn:4==a.distr?En:Ln)),e.stroke=es(e.stroke),e.grid.stroke=es(e.grid.stroke),e.ticks.stroke=es(e.ticks.stroke),e.border.stroke=es(e.border.stroke);let i=e.values;e.values=bs(i)&&!bs(i[0])?es(i):o?bs(i)?un(I,cn(i,F)):ws(i)?function(e,t){let s=Rs(t);return(t,n,a,o,i)=>n.map(t=>s(e(t)))}(I,i):i||R:i||_n,e.filter=es(e.filter||(a.distr>=3&&10==a.log?An:3==a.distr&&2==a.log?Rn:ss)),e.font=Da(e.font),e.labelFont=Da(e.labelFont),e._size=e.size(n,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(nt[t]=!0,e._el=ut("u-axis",h))}}),s?s instanceof HTMLElement?(s.appendChild(c),$a()):s(n,$a):$a(),n}Fa.assign=Ms,Fa.fmtNum=At,Fa.rangeNum=Nt,Fa.rangeLog=_t,Fa.rangeAsinh=Lt,Fa.orient=Vn,Fa.pxRatio=at,Fa.join=function(e,t){if(function(e){let t=e[0][0],s=t.length;for(let n=1;n=n&&null==e[a];)a--;if(a<=n)return!0;const o=Ut(1,Bt((a-n+1)/t));for(let i=e[n],r=n+o;r<=a;r+=o){const t=e[r];if(null!=t){if(t<=i)return!1;i=t}}return!0}(t[0])||(t=function(e){let t=e[0],s=t.length,n=Array(s);for(let o=0;ot[e]-t[s]);let a=[];for(let o=0;oe-t)],a=n[0].length,o=new Map;for(let i=0;iVn(e,o,(l,c,u,d,h,f,p,m,g,y,b)=>{[i,r]=Tt(u,i,r);let x=l.pxRound,{left:w,width:k}=e.bbox,v=e=>x(f(e,d,y,m)),S=e=>x(p(e,h,b,g)),C=0==d.ori?oa:ia;const T={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},M=T.stroke,_=d.dir*(0==d.ori?1:-1);let L=S(u[1==_?i:r]),j=v(c[1==_?i:r]),E=j,P=j;a&&-1==t&&(P=w,C(M,P,L)),C(M,j,L);for(let e=1==_?i:r;e>=i&&e<=r;e+=_){let s=u[e];if(null==s)continue;let n=v(c[e]),a=S(s);1==t?C(M,n,L):C(M,E,a),C(M,n,a),L=a,E=n}let N=E;a&&1==t&&(N=w+k,C(M,N,L));let[D,I]=Kn(e,o);if(null!=l.fill||0!=D){let t=T.fill=new Path2D(M),s=S(l.fillTo(e,o,l.min,l.max,D));C(t,N,s),C(t,P,s)}if(!l.spanGaps){let a=[];a.push(...ea(c,u,i,r,_,v,n));let h=l.width*at/2,f=s||1==t?h:-h,p=s||-1==t?-h:h;a.forEach(e=>{e[0]+=f,e[1]+=p}),T.gaps=a=l.gaps(e,o,i,r,a),T.clip=Zn(a,d.ori,m,g,y,b)}return 0!=I&&(T.band=2==I?[Qn(e,o,i,r,M,-1),Qn(e,o,i,r,M,1)]:Qn(e,o,i,r,M,I)),T})},e.bars=function(e){const t=Dt((e=e||ms).size,[.6,Kt,1]),s=e.align||0,n=e.gap||0;let a=e.radius;a=null==a?[0,0]:"number"==typeof a?[a,0]:a;const o=es(a),i=1-t[0],r=Dt(t[1],Kt),l=Dt(t[2],1),c=Dt(e.disp,ms),u=Dt(e.each,e=>{}),{fill:d,stroke:h}=c;return(e,t,a,f)=>Vn(e,t,(p,m,g,y,b,x,w,k,v,S,C)=>{let T,M,_=p.pxRound,L=s,j=n*at,E=r*at,P=l*at;0==y.ori?[T,M]=o(e,t):[M,T]=o(e,t);const N=y.dir*(0==y.ori?1:-1);let D,I,F,A=0==y.ori?ra:la,R=0==y.ori?u:(e,t,s,n,a,o,i)=>{u(e,t,s,a,n,i,o)},z=Dt(e.bands,gs).find(e=>e.series[0]==t),O=null!=z?z.dir:0,B=p.fillTo(e,t,p.min,p.max,O),$=_(w(B,b,C,v)),W=S,H=_(p.width*at),U=!1,q=null,J=null,G=null,Y=null;null==d||0!=H&&null==h||(U=!0,q=d.values(e,t,a,f),J=new Map,new Set(q).forEach(e=>{null!=e&&J.set(e,new Path2D)}),H>0&&(G=h.values(e,t,a,f),Y=new Map,new Set(G).forEach(e=>{null!=e&&Y.set(e,new Path2D)})));let{x0:V,size:K}=c;if(null!=V&&null!=K){L=1,m=V.values(e,t,a,f),2==V.unit&&(m=m.map(t=>e.posToVal(k+t*S,y.key,!0)));let s=K.values(e,t,a,f);I=2==K.unit?s[0]*S:x(s[0],y,S,k)-x(0,y,S,k),W=ba(m,g,x,y,S,k,W),F=W-I+j}else W=ba(m,g,x,y,S,k,W),F=W*i+j,I=W-F;F<1&&(F=0),H>=I/2&&(H=0),F<5&&(_=ts);let X=F>0;I=_(Qt(W-F-(X?H:0),P,E)),D=(0==L?I/2:L==N?0:I)-L*N*((0==L?j/2:0)+(X?H/2:0));const Q={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Z=U?null:new Path2D;let ee=null;if(null!=z)ee=e.data[z.series[1]];else{let{y0:s,y1:n}=c;null!=s&&null!=n&&(g=n.values(e,t,a,f),ee=s.values(e,t,a,f))}let te=T*I,se=M*I;for(let s=1==N?a:f;s>=a&&s<=f;s+=N){let n=g[s];if(null==n)continue;if(null!=ee){let e=ee[s]??0;if(n-e==0)continue;$=w(e,b,C,v)}let a=x(2!=y.distr||null!=c?m[s]:s,y,S,k),o=w(Dt(n,B),b,C,v),i=_(a-D),r=_(Ut(o,$)),l=_(Ht(o,$)),u=r-l;if(null!=n){let a=n<0?se:te,o=n<0?te:se;U?(H>0&&null!=G[s]&&A(Y.get(G[s]),i,l+Bt(H/2),I,Ut(0,u-H),a,o),null!=q[s]&&A(J.get(q[s]),i,l+Bt(H/2),I,Ut(0,u-H),a,o)):A(Z,i,l+Bt(H/2),I,Ut(0,u-H),a,o),R(e,t,s,i-H/2,l,I+H,u)}}return H>0?Q.stroke=U?Y:Z:U||(Q._fill=0==p.width?p._fill:p._stroke??p._fill,Q.width=0),Q.fill=U?J:Z,Q})},e.spline=function(e){return function(e,t){const s=Dt(null==t?void 0:t.alignGaps,0);return(t,n,a,o)=>Vn(t,n,(i,r,l,c,u,d,h,f,p,m,g)=>{[a,o]=Tt(l,a,o);let y,b,x,w=i.pxRound,k=e=>w(d(e,c,m,f)),v=e=>w(h(e,u,g,p));0==c.ori?(y=na,x=oa,b=da):(y=aa,x=ia,b=ha);const S=c.dir*(0==c.ori?1:-1);let C=k(r[1==S?a:o]),T=C,M=[],_=[];for(let e=1==S?a:o;e>=a&&e<=o;e+=S)if(null!=l[e]){let t=k(r[e]);M.push(T=t),_.push(v(l[e]))}const L={stroke:e(M,_,y,x,b,w),fill:null,clip:null,band:null,gaps:null,flags:1},j=L.stroke;let[E,P]=Kn(t,n);if(null!=i.fill||0!=E){let e=L.fill=new Path2D(j),s=v(i.fillTo(t,n,i.min,i.max,E));x(e,T,s),x(e,C,s)}if(!i.spanGaps){let e=[];e.push(...ea(r,l,a,o,S,k,s)),L.gaps=e=i.gaps(t,n,a,o,e),L.clip=Zn(e,c.ori,f,p,m,g)}return 0!=P&&(L.band=2==P?[Qn(t,n,a,o,j,-1),Qn(t,n,a,o,j,1)]:Qn(t,n,a,o,j,P)),L})}(xa,e)}}const Aa=new Map;function Ra(e){var t;if(!e.startsWith("var("))return e;const s=Aa.get(e);if(s)return s;const n=e.match(/var\(([^,)]+)(?:,\s*([^)]+))?\)/);if(!n)return e;const a=n[1].trim(),o=(null==(t=n[2])?void 0:t.trim())||"#888888",i=getComputedStyle(document.documentElement).getPropertyValue(a).trim()||o;return Aa.set(e,i),i}const za=s.memo(function({timestamps:e,series:t,onHover:a,highlightedKey:o=null,cursorColor:i="rgba(255,255,255,0.5)"}){const r=s.useRef(null),l=s.useRef(null),c=s.useRef(t),u=s.useRef(o),d=s.useRef(a),h=s.useRef(e.length);s.useLayoutEffect(()=>{c.current=t,u.current=o,d.current=a});const f=s.useMemo(()=>{const t=new Array(e.length).fill(1);return[e,t]},[e]),p=s.useMemo(()=>({hooks:{draw:e=>{!function(e,t,s){if(0===t.length)return;const n=e.ctx,a=e.bbox,o=a.left,i=a.top,r=a.width,l=a.height;if(r<=0||l<=0)return;const c=e.data[0],u=c.length;if(0===u)return;const d=c[0],h=c[u-1]-d||1,f=e=>{const t=c[e];return o+(t-d)/h*r},p=e=>i+l*(1-e);for(let m=0;m=0;t--){const e=f(t),s=p(o[t]);if(t===u-1)n.lineTo(e,s);else{const a=f(t+1);n.lineTo(a,s),n.lineTo(e,s)}}n.closePath(),n.fill(),n.restore()}}(e,c.current,u.current),function(e){const t=e.ctx,{left:s,top:n,width:a,height:o}=e.bbox,i=window.devicePixelRatio||1,r=function(){const e=getComputedStyle(document.documentElement);return{fontFamily:e.getPropertyValue("--font-data").trim()||'"JetBrains Mono", ui-monospace, monospace',textPrimary:e.getPropertyValue("--text-primary").trim()||"#FFFFFF"}}();t.save(),t.strokeStyle=r.textPrimary,t.globalAlpha=.15,t.lineWidth=1*i,t.setLineDash([4*i,4*i]);for(const c of[.2,.4,.6,.8]){const e=Math.round(n+o*(1-c))+.5;t.beginPath(),t.moveTo(Math.round(s),e),t.lineTo(Math.round(s+a),e),t.stroke()}t.restore(),t.save(),t.font=`bold ${10*i}px ${r.fontFamily}`,t.fillStyle=r.textPrimary,t.textBaseline="middle",t.textAlign="left";const l=8*i;for(const c of[0,20,40,60,80,100]){const e=n+o*(1-c/100),s=Math.max(n+l,Math.min(n+o-l,e));t.fillText(`${c}%`,0,s)}t.restore()}(e)}}}),[]),m=s.useMemo(()=>({width:400,height:200,padding:[8,0,0,32],cursor:{show:!0,x:!0,y:!1,drag:{x:!1,y:!1},points:{show:!1}},scales:{x:{time:!0},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],hooks:{setCursor:[e=>{var t,s;const n=e.cursor.idx;if(null!=n&&n>=0){const s=e.data[0][n];null==(t=d.current)||t.call(d,n,s)}else null==(s=d.current)||s.call(d,null,null)}]},plugins:[p]}),[p]);s.useEffect(()=>{const t=r.current;if(!t||0===e.length)return;const s=h.current,n=e.length,a=Math.abs(n-s);if(!(!l.current||a>100||s>0&&a/s>.1)&&l.current)return l.current.setData(f),void(h.current=n);l.current&&l.current.destroy();const o=t.getBoundingClientRect(),i=Math.floor(o.width)||400,c=Math.floor(o.height)||200,u=new Fa({...m,width:i,height:c},f,t);return l.current=u,h.current=n,()=>{u.destroy(),l.current=null}},[m,f,e.length]),s.useEffect(()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(e=>{const t=e[0];if(!t||!l.current)return;const{width:s,height:n}=t.contentRect;s>0&&n>0&&l.current.setSize({width:Math.floor(s),height:Math.floor(n)})});return t.observe(e),()=>{t.disconnect()}},[]),s.useEffect(()=>{l.current&&l.current.redraw()},[o,t]);const g=s.useCallback(()=>{null==a||a(null,null)},[a]);return 0===e.length?n.jsx("div",{className:"h-full flex items-center justify-center text-text-muted",children:"No data available"}):n.jsx("div",{ref:r,className:"w-full h-full rounded-2xl overflow-hidden",onMouseLeave:g})}),Oa=s.createContext(null);function Ba(e){const t=re(e);t&&function(e){if("undefined"==typeof document)return;const t=function(e){const t={},s=e.surfaces.glass;t["--glass-tint"]=s.tint,t["--glass-light"]=s.light,t["--glass-dark"]=s.dark,t["--glass-reflex-light"]=String(s.reflexLight),t["--glass-reflex-dark"]=String(s.reflexDark),t["--glass-blur"]=`${s.blur}px`,t["--glass-blur-elevated"]=`${s.blurElevated}px`,t["--glass-brightness"]=String(s.brightness),t["--glass-bg-opacity"]=`${s.opacity}%`,t["--glass-bg-opacity-elevated"]=`${s.opacityElevated}%`,t["--sidebar-tint"]=e.surfaces.sidebar.tint,t["--tooltip-bg"]=e.colors.bg.surface,t["--hover-tint"]=`rgba(${B(e.colors.accent.primary)}, 0.08)`,t["--shadow-tint"]=`rgba(${B(e.colors.accent.primary)}, 0.35)`,t["--bg-body"]=e.colors.bg.body,t["--bg-surface"]=e.colors.bg.surface,t["--bg-elevated"]=e.colors.bg.elevated,t["--bg-subtle"]=e.colors.bg.subtle,t["--border-subtle"]=e.colors.border.subtle,t["--border-strong"]=e.colors.border.strong,t["--text-primary"]=e.colors.text.primary,t["--text-secondary"]=e.colors.text.secondary,t["--text-muted"]=e.colors.text.muted,t["--text-invert"]=e.colors.text.inverse,t["--accent-primary"]=e.colors.accent.primary,t["--accent-secondary"]=e.colors.accent.secondary,t["--accent-tertiary"]=e.colors.accent.tertiary,t["--accent-success"]=e.colors.accent.success,t["--accent-danger"]=e.colors.accent.danger,t["--signal-excellent"]=e.colors.signal.excellent,t["--signal-good"]=e.colors.signal.good,t["--signal-fair"]=e.colors.signal.fair,t["--signal-poor"]=e.colors.signal.poor,t["--signal-critical"]=e.colors.signal.critical,t["--signal-unknown"]=e.colors.signal.unknown,t["--sparkline-excellent"]=e.colors.signal.excellent,t["--sparkline-good"]=e.colors.signal.good,t["--sparkline-fair"]=e.colors.signal.fair,t["--sparkline-poor"]=e.colors.signal.poor,t["--sparkline-critical"]=e.colors.signal.critical,t["--status-success"]=e.colors.status.success,t["--status-warning"]=e.colors.status.warning,t["--status-danger"]=e.colors.status.danger,t["--status-info"]=e.colors.status.info,t["--status-muted"]=e.colors.status.muted;const n=e.colors.chart;t["--pkt-advert"]=e.colors.accent.secondary,t["--pkt-flood"]=e.colors.accent.tertiary,t["--pkt-txt-msg"]=e.colors.accent.success,t["--pkt-ack"]=n.c8,t["--pkt-trace"]=n.c3,t["--pkt-req"]=n.c2,t["--pkt-response"]=n.c5,t["--pkt-grp-txt"]=e.colors.map.room,t["--pkt-grp-data"]=e.colors.accent.danger,t["--pkt-path"]=n.c3,t["--pkt-anon"]=e.colors.accent.secondary,t["--pkt-unknown"]=e.colors.status.muted,t["--route-flood"]=e.colors.accent.tertiary,t["--route-direct"]=e.colors.accent.secondary,t["--route-transport"]=n.c8,t["--chart-1"]=n.c1,t["--chart-2"]=n.c2,t["--chart-3"]=n.c3,t["--chart-4"]=n.c4,t["--chart-5"]=n.c5,t["--chart-6"]=n.c6,t["--chart-7"]=n.c7,t["--chart-8"]=n.c8,t["--chart-grid"]=n.grid,t["--chart-axis-tick"]=n.axis,t["--chart-cursor"]=n.cursor,t["--metric-received"]=e.colors.metric.received,t["--metric-forwarded"]=e.colors.metric.forwarded,t["--metric-transmitted"]=e.colors.metric.transmitted,t["--metric-dropped"]=e.colors.metric.dropped,t["--metric-neutral"]=e.colors.text.secondary,t["--log-debug"]=e.colors.status.muted,t["--log-info"]=e.colors.status.info,t["--log-warning"]=e.colors.status.warning,t["--log-error"]=e.colors.accent.danger,t["--log-critical"]=e.colors.accent.danger;const a=e.colors.map;t["--map-node-fill"]=a.nodeFill,t["--map-node-stroke"]=a.nodeStroke,t["--map-hub-color"]=a.hub,t["--map-local-color"]=a.local,t["--map-neighbor-color"]=a.neighbor,t["--map-mobile-color"]=a.mobile,t["--map-room-color"]=a.room,t["--map-edge-rest"]=a.edge,t["--map-edge-rest-bright"]=e.colors.border.strong,t["--map-edge-rest-dim"]=e.colors.bg.subtle,t["--map-edge-hover-direct"]=a.edgeHover,t["--map-edge-hover-loop"]=a.hub,t["--map-edge-hover-standard"]=e.colors.text.muted,t["--map-edge-hover-neighbor"]=a.local,t["--link-strong"]=e.colors.accent.success,t["--link-medium"]=e.colors.accent.secondary,t["--link-weak"]=e.colors.accent.danger,t["--hop-0"]=e.colors.accent.tertiary,t["--hop-1"]=e.colors.accent.success,t["--hop-2"]=n.c3,t["--hop-3"]=e.colors.accent.secondary,t["--hop-distant"]=e.colors.text.muted,t["--hop-hub"]=a.local,t["--icon-page-title"]=e.colors.accent.primary,t["--icon-card-title"]=e.colors.accent.primary,t["--icon-widget"]=e.colors.text.secondary,t["--icon-action"]=e.colors.text.secondary,t["--icon-nav"]=e.colors.text.muted,t["--icon-nav-active"]=e.colors.accent.primary,t["--toggle-on"]=e.colors.accent.success,t["--toggle-off"]=e.colors.bg.elevated,t["--font-title"]=e.typography.font.title,t["--font-display"]=e.typography.font.display,t["--font-data"]=e.typography.font.mono,t["--font-normal"]=String(e.typography.weight.normal),t["--font-medium"]=String(e.typography.weight.medium),t["--font-semibold"]=String(e.typography.weight.semibold),t["--font-bold"]=String(e.typography.weight.bold);const o=e.typography.size;return o.xxl&&(t["--text-2xl"]=o.xxl),o.xl&&(t["--text-xl"]=o.xl),o.lg&&(t["--text-lg"]=o.lg),o.md&&(t["--text-md"]=o.md),o.base&&(t["--text-base"]=o.base),o.sm&&(t["--text-sm"]=o.sm),o.xs&&(t["--text-xs"]=o.xs),o.hero&&(t["--text-5xl"]=o.hero),t["--theme-transition"]=`${e.motion.slow} ${e.motion.easing}`,function(e){if(!A())return e;const t={},s=/^#[0-9A-Fa-f]{3,6}$/;for(const[n,a]of Object.entries(e))t[n]=s.test(a)?F(a):a;return t}(t)}(e),s=document.documentElement;for(const[n,a]of Object.entries(t))s.style.setProperty(n,a)}(t),document.documentElement.dataset.colorScheme=e}function $a({children:e}){const[t,a]=s.useState(()=>function(){if("undefined"==typeof window)return xe;try{let s=localStorage.getItem(we),n=localStorage.getItem(ke);const a=localStorage.getItem(ve);if(!s&&!n){const e=localStorage.getItem(Se);if(e){const t=be.find(t=>t.id===e);t&&(s=t.colorScheme,n=t.backgroundImage,localStorage.setItem(we,s),localStorage.setItem(ke,n),localStorage.removeItem(Se))}}const o=s&&"string"==typeof(t=s)&&ge.some(e=>e.id===t)?s:xe.colorScheme;let i=xe.backgroundImage;""===n?i="":n&&"string"==typeof(e=n)&&ye.some(t=>t.src===e)&&(i=n);let r=xe.brightness;if(a){const e=parseInt(a,10);!isNaN(e)&&e>=0&&e<=100&&(r=e)}return{colorScheme:o,backgroundImage:i,brightness:r}}catch{return xe}var e,t}());s.useEffect(()=>{Ba(t.colorScheme),Aa.clear(),requestAnimationFrame(()=>{!function(){if("undefined"==typeof window)return;for(const t of _e){const e=De(`--palette-${t}-bright`),s=De(`--palette-${t}`),n=e||s;if(!n)continue;const a=Ne(n);for(const o of Me)Ie(`--palette-${t}-${o}`,a[o])}const e=De("--palette-bg-4");if(e){const t=Ne(e);for(const e of Me)Ie(`--palette-neutral-${e}`,t[e])}}()})},[t.colorScheme]),s.useEffect(()=>{!function(e){if("undefined"!=typeof window)try{localStorage.setItem(we,e.colorScheme),localStorage.setItem(ke,e.backgroundImage),localStorage.setItem(ve,String(e.brightness))}catch{}}(t)},[t]),s.useEffect(()=>{ye.forEach(e=>{(new Image).src=e.src})},[]);const o=s.useCallback(e=>{a(t=>({...t,colorScheme:e}))},[]),i=s.useCallback(e=>{const t=ye.find(t=>t.src===e);a(s=>({...s,backgroundImage:e,brightness:(null==t?void 0:t.suggestedBrightness)??s.brightness}))},[]),r=s.useCallback(e=>{const t=Math.max(0,Math.min(100,Math.round(e)));a(e=>({...e,brightness:t}))},[]),l=s.useCallback(e=>{const t=be.find(t=>t.id===e);t&&a(e=>({...e,colorScheme:t.colorScheme,backgroundImage:t.backgroundImage}))},[]),c=s.useMemo(()=>({theme:t,setColorScheme:o,setBackgroundImage:i,setBrightness:r,setThemePreset:l}),[t,o,i,r,l]);return n.jsx(Oa.Provider,{value:c,children:e})}function Wa(){const e=s.useContext(Oa);if(!e)throw new Error("useTheme must be used within a ThemeProvider. Wrap your app with in App.tsx.");return e}const Ha="0.9.154",Ua="'JetBrains Mono', monospace",qa=s.memo(function({height:e=16,responsive:t=!1,className:s=""}){const a="var(--accent-primary)",o="#FFFFFF";if(t){const e=145,t=24;return n.jsxs("svg",{className:s,viewBox:`0 0 ${e} ${t}`,preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"pyMC:Console",style:{display:"block",width:"80%",height:"auto"},children:[n.jsx("style",{children:`\n .logo-text {\n font-family: ${Ua};\n }\n .logo-accent {\n fill: var(--accent-primary, #719CDF);\n }\n `}),n.jsxs("text",{x:"0",y:"18",className:"logo-text",fontSize:"20",fontWeight:"400",letterSpacing:"-0.02em",children:[n.jsx("tspan",{className:"logo-accent",children:"py"}),n.jsx("tspan",{fill:o,children:"MC"}),n.jsx("tspan",{className:"logo-accent",children:":"}),n.jsx("tspan",{fill:o,children:"Console"})]})]})}const i="string"==typeof e?parseFloat(e):e,r={fontFamily:Ua,fontSize:.8*i+"px",fontWeight:400,lineHeight:1,letterSpacing:"-0.02em",whiteSpace:"nowrap"};return n.jsxs("span",{className:s,style:r,role:"img","aria-label":"pyMC:Console",children:[n.jsx("span",{style:{color:a},children:"py"}),n.jsx("span",{style:{color:o},children:"MC"}),n.jsx("span",{style:{color:a},children:":"}),n.jsx("span",{style:{color:o},children:"Console"})]})}),Ja={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"},Ga={0:"T_FLOOD",1:"FLOOD",2:"DIRECT",3:"T_DIRECT"},Ya={REQ:0,RESPONSE:1,TXT_MSG:2,ACK:3,ADVERT:4,GRP_TXT:5,GRP_DATA:6,ANON_REQ:7,PATH:8,TRACE:9,MULTIPART:10,RAW_CUSTOM:15};function Va(e){return 1===e||0===e}const Ka={spreadingFactor:7,bandwidthHz:125e3,codingRate:5,preambleLength:8,crcEnabled:!0,explicitHeader:!0};function Xa(e){if(e.raw_packet){const t=e.raw_packet;if(/^[0-9a-fA-F]+$/.test(t)&&t.length%2==0)return t.length/2;if(/^[A-Za-z0-9+/=]+$/.test(t)){const e=(t.match(/=+$/)||[""])[0].length;return Math.floor(3*t.length/4)-e}return t.length}if(e.length&&e.length>0)return e.length;if(e.payload_length&&e.payload_length>0)return e.payload_length;if(e.payload){const t=e.payload;return/^[0-9a-fA-F]+$/.test(t)&&t.length%2==0?t.length/2:t.length}return 32}function Qa(e,t={}){const s=t.spreadingFactor??Ka.spreadingFactor,n=t.bandwidthHz??Ka.bandwidthHz,a=t.codingRate??Ka.codingRate,o=t.preambleLength??Ka.preambleLength??8,i=t.crcEnabled??Ka.crcEnabled?1:0,r=t.explicitHeader??Ka.explicitHeader?0:1,l=s>=11&&n<=125e3?1:0,c=n/1e3,u=Math.pow(2,s)/c,d=(o+4.25)*u,h=Math.max(8*e-4*s+28+16*i-20*r,0),f=4*(s-2*l);return d+(8+Math.ceil(h/f)*a)*u}const Za="pymc_jwt_token",eo="pymc_client_id",to="pymc_remember_me",so=new Set;function no(e){return so.add(e),()=>so.delete(e)}function ao(e){for(const s of so)try{s(e)}catch(t){}}function oo(){let e=localStorage.getItem(eo);return e||(e=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(eo,e)),e}function io(){return"true"===localStorage.getItem(to)}function ro(e){e?localStorage.setItem(to,"true"):localStorage.removeItem(to)}function lo(){return io()?localStorage:sessionStorage}function co(){return lo().getItem(Za)||localStorage.getItem(Za)||sessionStorage.getItem(Za)}function uo(e){lo().setItem(Za,e),io()?sessionStorage.removeItem(Za):localStorage.removeItem(Za),ao(e)}function ho(){localStorage.removeItem(Za),sessionStorage.removeItem(Za),ao(null)}function fo(){return!(!co()||mo()&&(ho(),1))}function po(e){try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(t).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(s)}catch{return null}}function mo(){const e=co();if(!e)return!0;const t=po(e);return!t||!t.exp||Date.now()>=1e3*t.exp-6e4}function go(){const e=co();if(!e)return 0;const t=po(e);return t&&t.exp?Math.max(0,Math.floor((1e3*t.exp-Date.now())/1e3)):0}function yo(){const e=co();if(!e)return!1;const t=po(e);if(!t||!t.exp)return!1;const s=1e3*t.exp-Date.now();return s>0&&s<3e5}function bo(){const e=co();if(!e)return null;const t=po(e);return t&&t.sub?t.sub:null}async function xo(e,t,s=!1){ro(s);try{const s=await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,client_id:oo()})}),n=s.headers.get("content-type");if(!n||!n.includes("application/json"))return{success:!1,error:`Server error: ${s.status}`};const a=await s.json();return a.success&&a.token?(uo(a.token),{success:!0}):{success:!1,error:a.error||"Login failed"}}catch(n){return{success:!1,error:"Connection error. Please try again."}}}async function wo(){const e=co();if(!e)return!1;const t=po(e);(null==t?void 0:t.exp)&&Math.floor((1e3*t.exp-Date.now())/1e3);try{const t=await fetch("/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({client_id:oo()})});if(!t.ok){let e="";try{const s=await t.json();e=s.error||JSON.stringify(s)}catch{e=t.statusText}return!1}const s=await t.json();if(s.success&&s.token){uo(s.token);const e=po(s.token);return(null==e?void 0:e.exp)&&Math.floor((1e3*e.exp-Date.now())/1e3),!0}return!1}catch(s){return!1}}let ko=null;async function vo(){const e=co();if(!e)return!1;const t=po(e);return(null==t?void 0:t.exp)&&Math.floor((1e3*t.exp-Date.now())/1e3),!yo()||ko||(ko=wo().finally(()=>{ko=null}),ko)}function So(){ho()}let Co=!1;function To(){if(Co)return;if("undefined"==typeof document)return;const e=async()=>{if("visible"!==document.visibilityState)return;if(!co())return;if(mo())return ho(),void("undefined"==typeof window||window.location.pathname.includes("/login")||(window.location.href="/login"));const e=go();e>0&&e<300&&await wo()};document.addEventListener("visibilitychange",e),Co=!0,"visible"===document.visibilityState&&e()}const Mo=Object.freeze(Object.defineProperty({__proto__:null,clearToken:ho,getClientId:oo,getRememberMe:io,getToken:co,getTokenTimeRemaining:go,getUsername:bo,isAuthenticated:fo,isTokenExpired:mo,login:xo,logout:So,onTokenChange:no,parseJWT:po,refreshToken:wo,refreshTokenIfNeeded:vo,setRememberMe:ro,setToken:uo,shouldRefreshToken:yo,startVisibilityBasedRefresh:To},Symbol.toStringTag,{value:"Module"})),_o=new Map;let Lo=!1;async function jo(e,t,s=!1){const n=function(e,t){return(null==t?void 0:t.method)&&"GET"!==t.method?"":e}(e,t);if(n){const e=_o.get(n);if(e)return e}const a=`${e}`;!s&&yo()&&await wo();const o=co();if(!o&&!e.includes("/auth/"))throw window.location.href="/login",new Error("Not authenticated");const i=o?{Authorization:`Bearer ${o}`}:{};if(null==t?void 0:t.headers){const e=t.headers;e instanceof Headers?e.forEach((e,t)=>{i[t]=e}):Array.isArray(e)?e.forEach(([e,t])=>{i[e]=t}):Object.assign(i,e)}(null==t?void 0:t.body)&&(i["Content-Type"]="application/json");const r=(async()=>{const n=await fetch(a,{...t,headers:i});if(401===n.status){if(!s&&!Lo&&await wo())return jo(e,t,!0);throw Lo||(Lo=!0,ho(),window.location.replace("/login")),new Error("Session expired. Please log in again.")}if(!n.ok)throw new Error(`API error: ${n.status} ${n.statusText} (${e})`);return n.json()})();return n&&(_o.set(n,r),r.finally(()=>{_o.delete(n)})),r}function Eo(e){return e&&"chat node"===e.toLowerCase()?"Companion":e}async function Po(){return function(e){if(e.neighbors)for(const t of Object.values(e.neighbors))t.contact_type=Eo(t.contact_type);return e}(await jo("/api/stats"))}async function No(){return jo("/api/logs")}async function Do(e=24){return jo(`/api/noise_floor_history?hours=${e}`)}async function Io(){return jo("/api/hardware_stats")}async function Fo(){return jo("/api/send_advert",{method:"POST",body:"{}"})}async function Ao(e){return jo("/api/set_mode",{method:"POST",body:JSON.stringify({mode:e})})}async function Ro(e){return jo("/api/set_duty_cycle",{method:"POST",body:JSON.stringify({enabled:e})})}const zo=new Map;function Oo(e=!1){if(e)zo.clear();else for(const[t]of zo)parseInt(t.split("-")[0],10)<=60&&zo.delete(t)}function Bo(e,t,s,n){const a=60*e/t,o=Math.floor(Date.now()/1e3),i=Math.floor(o/a)*a,r=i-60*e,l=s.filter(e=>e.timestamp>=r&&e.timestamp<=i),c=n?function(e){var t;const s=null==(t=null==e?void 0:e.config)?void 0:t.radio;return{spreadingFactor:(null==s?void 0:s.spreading_factor)??Ka.spreadingFactor,bandwidthHz:(null==s?void 0:s.bandwidth)??Ka.bandwidthHz,codingRate:(null==s?void 0:s.coding_rate)??Ka.codingRate,preambleLength:(null==s?void 0:s.preamble_length)??Ka.preambleLength,crcEnabled:!0,explicitHeader:!0}}(n):Ka,u=function(e,t,s,n,a){const o=new Array(t),i=new Array(t),r=new Array(t),l=new Array(t),c=new Array(t);for(let d=0;d=t)continue;const f=Qa(Xa(u),a),p=u.packet_origin;"tx_local"===p?(i[h].count++,i[h].airtime_ms+=f):"tx_forward"===p||u.transmitted?(r[h].count++,r[h].airtime_ms+=f):u.drop_reason&&(l[h].count++,l[h].airtime_ms+=f),"tx_local"!==p&&(o[h].count++,o[h].airtime_ms+=f,c[h].snr+=u.snr||0,c[h].rssi+=u.rssi||0,c[h].count++)}for(let d=0;d0&&(o[d].avg_snr=c[d].snr/c[d].count,o[d].avg_rssi=c[d].rssi/c[d].count);return{received:o,transmitted:i,forwarded:r,dropped:l}}(l,t,r,a,c);return{time_range_minutes:e,bucket_count:t,bucket_duration_seconds:a,start_time:r,end_time:i,...u}}async function $o(e){return jo("/api/update_radio_config",{method:"POST",body:JSON.stringify(e)})}async function Wo(e){return jo("/api/set_log_level",{method:"POST",body:JSON.stringify({level:e})})}async function Ho(){return jo("/api/transport_keys")}async function Uo(e){return jo("/api/transport_keys",{method:"POST",body:JSON.stringify(e)})}async function qo(e,t){return jo(`/api/transport_key/${e}`,{method:"PUT",body:JSON.stringify(t)})}async function Jo(e){return jo(`/api/transport_key/${e}`,{method:"DELETE"})}async function Go(e){return jo("/api/global_flood_policy",{method:"POST",body:JSON.stringify({global_flood_allow:e})})}async function Yo(e,t=10){return jo("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:e,timeout:t})})}async function Vo(e){return jo("/api/update_web_config",{method:"POST",body:JSON.stringify(e)})}async function Ko(){return jo("/api/check_pymc_console")}async function Xo(){return jo("/api/restart_service",{method:"POST",body:"{}"})}async function Qo(){return jo("/auth/tokens")}async function Zo(e){return jo("/auth/tokens",{method:"POST",body:JSON.stringify({name:e})})}async function ei(e){return jo(`/auth/tokens/${e}`,{method:"DELETE"})}const ti="pymc-packet-cache",si="pymc-packet-cache-meta",ni=36e5,ai=12096e5,oi=5e3,ii=5e5,ri=new class{constructor(){t(this,"packets",new Map),t(this,"sortedPackets",[]),t(this,"sortedDirty",!0),t(this,"meta",{oldestTimestamp:0,newestTimestamp:0,lastUpdated:0,packetCount:0,backgroundLoadComplete:!1,topologyLoadComplete:!1,dataTier:"24h",threeDayLoadComplete:!1,sevenDayLoadComplete:!1,fourteenDayLoadComplete:!1}),t(this,"isLoading",!1),t(this,"isBackgroundLoading",!1),t(this,"isTopologyLoading",!1),t(this,"listeners",new Set),t(this,"loadProgress",null),t(this,"statusMessage",""),this.loadFromStorage()}subscribe(e){return this.listeners.add(e),e(this.getState()),()=>this.listeners.delete(e)}getState(){return{isLoading:this.isLoading,isBackgroundLoading:this.isBackgroundLoading,isTopologyLoading:this.isTopologyLoading,backgroundLoadComplete:this.meta.backgroundLoadComplete,topologyLoadComplete:this.meta.topologyLoadComplete,packetCount:this.packets.size,statusMessage:this.statusMessage,loadProgress:this.loadProgress,dataTier:this.meta.dataTier,threeDayLoadComplete:this.meta.threeDayLoadComplete,sevenDayLoadComplete:this.meta.sevenDayLoadComplete,fourteenDayLoadComplete:this.meta.fourteenDayLoadComplete}}getDataTier(){return this.meta.dataTier}getPackets(){return this.sortedDirty&&(this.sortedPackets=Array.from(this.packets.values()).sort((e,t)=>(e.timestamp??0)-(t.timestamp??0)),this.sortedDirty=!1),this.sortedPackets}isStale(){return 0===this.packets.size||Date.now()-this.meta.lastUpdated>ni}isHeavyLoadInProgress(){return this.isBackgroundLoading||this.isTopologyLoading}async initialLoad(e){if(this.isStale()&&this.packets.size>0&&this.clear(),this.meta.backgroundLoadComplete&&this.packets.size>0)return this.getPackets();this.isLoading=!0;const t=Date.now(),s=Math.floor((t-864e5)/1e3),n=3e4;this.loadProgress={loaded:0,target:n,percent:0},this.statusMessage="Loading 24h history...",this.notifyListeners();try{let t;this.packets.size>0&&(this.packets.clear(),this.sortedPackets=[],this.sortedDirty=!0,this.meta.oldestTimestamp=0,this.meta.newestTimestamp=0);let a=0,o=0,i=0;const r=Math.ceil(100);for(let l=0;l0))break;{const n=this.packets.size;this.mergePackets(u.data);const i=this.packets.size-n;a+=i;const r=Math.min(...u.data.map(e=>e.timestamp??1/0));if(r!==1/0&&(void 0===t||r=2)break}else o=0;if(u.data.length=ii)break}l=5){this.statusMessage="Connection issues, loaded partial data",this.notifyListeners();break}await this.delay(2e3)}}this.enforceMemoryCap(),this.meta.backgroundLoadComplete=!0,this.meta.dataTier="24h",this.loadProgress={loaded:this.packets.size,target:this.packets.size,percent:100},this.notifyListeners(),this.saveToStorage()}catch(a){this.statusMessage="Load failed"}finally{this.isLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}return this.getPackets()}async quickLoad(){return this.initialLoad()}async backgroundLoad(){await this.initialLoad()}async loadThreeDays(e){this.meta.threeDayLoadComplete||this.isBackgroundLoading||await this.loadExtendedData("3d",2592e5,e)}async loadSevenDays(e){this.meta.sevenDayLoadComplete||this.isBackgroundLoading||(this.meta.threeDayLoadComplete||await this.loadThreeDays(e),await this.loadExtendedData("7d",6048e5,e))}async loadFourteenDays(e){this.meta.fourteenDayLoadComplete||this.isBackgroundLoading||(this.meta.sevenDayLoadComplete||await this.loadSevenDays(e),await this.loadExtendedData("14d",ai,e))}async loadExtendedData(e,t,s){this.isBackgroundLoading=!0;const n=Date.now(),a=Math.floor((n-t)/1e3),o=3e4*("3d"===e?2:"7d"===e?4:7);this.loadProgress={loaded:0,target:o,percent:0},this.statusMessage=`Loading ${e} history...`,this.notifyListeners();try{let t=this.meta.oldestTimestamp||void 0,n=0,i=0,r=0;const l=Math.ceil(100);for(let c=0;c0))break;{const e=this.packets.size;this.mergePackets(d.data);const o=this.packets.size-e;n+=o;const r=Math.min(...d.data.map(e=>e.timestamp??1/0));if(r!==1/0&&(void 0===t||r=2)break}else i=0;if(d.data.length=ii)break}c=5)break;await this.delay(2e3)}}this.enforceMemoryCap(),"3d"===e?(this.meta.threeDayLoadComplete=!0,this.meta.dataTier="3d"):"7d"===e?(this.meta.sevenDayLoadComplete=!0,this.meta.dataTier="7d"):(this.meta.fourteenDayLoadComplete=!0,this.meta.dataTier="14d"),this.loadProgress={loaded:n,target:n,percent:100},this.notifyListeners(),this.saveToStorage()}catch(i){this.statusMessage=`${e} load failed`}finally{this.isBackgroundLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}}isDataTierAvailable(e){switch(e){case"24h":return this.meta.backgroundLoadComplete;case"3d":return this.meta.threeDayLoadComplete;case"7d":return this.meta.sevenDayLoadComplete;case"14d":return this.meta.fourteenDayLoadComplete;default:return!1}}async topologyLoad(){if(!this.meta.topologyLoadComplete&&!this.isTopologyLoading)return this.doTopologyLoad()}async forceTopologyLoad(){if(!this.isTopologyLoading)return this.meta.topologyLoadComplete=!1,this.doTopologyLoad()}async forceDeepLoad(){return this.forceTopologyLoad()}async doTopologyLoad(){this.isTopologyLoading=!0;const e=Date.now(),t=Math.floor((e-ai)/1e3),s=42e4;this.statusMessage="Loading 14-day topology...",this.loadProgress={loaded:0,target:s,percent:0},this.notifyListeners();try{let e,n=0,a=0,o=0;const i=Math.ceil(100);for(let r=0;r0))break;{const s=this.packets.size;this.mergePackets(c.data);const o=this.packets.size-s;n+=o;const i=Math.min(...c.data.map(e=>e.timestamp??1/0));if(i!==1/0&&(void 0===e||i=2)break}else a=0;if(c.data.length=ii)break}r=5){this.statusMessage="Connection issues, loaded partial data",this.notifyListeners();break}await this.delay(2e3)}}this.statusMessage=`Processing ${this.packets.size.toLocaleString()} packets...`,this.loadProgress={loaded:this.packets.size,target:this.packets.size,percent:100},this.notifyListeners(),this.enforceMemoryCap(),this.meta.topologyLoadComplete=!0,this.meta.threeDayLoadComplete=!0,this.meta.sevenDayLoadComplete=!0,this.meta.fourteenDayLoadComplete=!0,this.meta.dataTier="14d",this.saveToStorage()}catch(n){this.statusMessage="Topology load failed"}finally{this.isTopologyLoading=!1,this.statusMessage="",this.loadProgress=null,this.notifyListeners()}}async poll(){try{const e=await this.fetchRecentPackets(100);if(e.success&&e.data){const t=this.packets.size;this.mergePackets(e.data),this.packets.size>t&&(this.saveToStorage(),this.notifyListeners())}}catch(e){}return this.getPackets()}clear(){this.packets.clear(),this.sortedPackets=[],this.sortedDirty=!0,this.meta={oldestTimestamp:0,newestTimestamp:0,lastUpdated:0,packetCount:0,backgroundLoadComplete:!1,topologyLoadComplete:!1,dataTier:"24h",threeDayLoadComplete:!1,sevenDayLoadComplete:!1,fourteenDayLoadComplete:!1},this.clearStorage(),this.notifyListeners()}mergePacketsDirectly(e){const t=this.packets.size;this.mergePackets(e);const s=this.packets.size-t;return s>0&&(this.enforceMemoryCap(),this.saveToStorage(),this.notifyListeners()),s}mergePackets(e){let t=!1;for(const s of e){const e=s.packet_hash;if(e&&!this.packets.has(e)){this.packets.set(e,s),t=!0;const n=s.timestamp??0;(0===this.meta.oldestTimestamp||nthis.meta.newestTimestamp&&(this.meta.newestTimestamp=n)}}t&&(this.sortedDirty=!0),this.meta.lastUpdated=Date.now(),this.meta.packetCount=this.packets.size}notifyListeners(){const e=this.getState();for(const t of this.listeners)t(e)}delay(e){return new Promise(t=>setTimeout(t,e))}async fetchChunkWithRetry(e,t,s,n,a){for(let i=0;i<3;i++)try{return await this.fetchFilteredPackets(e,t,!1,a)}catch(o){const e=2===i,t=1e3*Math.pow(2,i);o instanceof Error&&o.name,e||(this.statusMessage=`Retry in ${Math.round(t/1e3)}s...`,this.notifyListeners(),await this.delay(t))}return null}enforceMemoryCap(){if(this.packets.size<=ii)return;const e=this.getPackets(),t=e.length-ii;for(let s=0;st&&(this.meta.oldestTimestamp=e[t].timestamp??0)}loadFromStorage(){if("undefined"!=typeof window)try{const e=localStorage.getItem(si);e&&(this.meta=JSON.parse(e));const t=localStorage.getItem(ti);if(t){const e=JSON.parse(t);for(const t of e)t.packet_hash&&this.packets.set(t.packet_hash,t)}if(this.meta.lastUpdated>0&&Date.now()-this.meta.lastUpdated>ni)return void this.clear();this.meta.backgroundLoadComplete=!1,this.meta.threeDayLoadComplete=!1,this.meta.sevenDayLoadComplete=!1,this.meta.fourteenDayLoadComplete=!1,this.meta.dataTier="24h";const s=37500;this.meta.topologyLoadComplete&&this.packets.size3e3?e.slice(-3e3):e;localStorage.setItem(ti,JSON.stringify(t))}catch(e){if(e instanceof DOMException&&"QuotaExceededError"===e.name)try{localStorage.removeItem(ti),localStorage.setItem(si,JSON.stringify(this.meta))}catch{}}}clearStorage(){if("undefined"!=typeof window)try{localStorage.removeItem(ti),localStorage.removeItem(si)}catch(e){}}async fetchRecentPackets(e=1e3,t=!1){const s=`/api/recent_packets?limit=${e}`,{getToken:n}=await N(async()=>{const{getToken:e}=await Promise.resolve().then(()=>Mo);return{getToken:e}},void 0),a=n(),o={};a&&(o.Authorization=`Bearer ${a}`);const i=await fetch(s,{headers:o});if(401===i.status&&!t){const{refreshToken:t}=await N(async()=>{const{refreshToken:e}=await Promise.resolve().then(()=>Mo);return{refreshToken:e}},void 0);if(await t())return this.fetchRecentPackets(e,!0)}if(!i.ok)throw new Error(`API error: ${i.status}`);return i.json()}async fetchFilteredPackets(e,t=5e3,s=!1,n){const a=new URLSearchParams;a.set("limit",String(t)),void 0!==e&&a.set("end_timestamp",String(e-.001)),void 0!==n&&a.set("start_timestamp",String(n));const o=`/api/filtered_packets?${a}`,{getToken:i}=await N(async()=>{const{getToken:e}=await Promise.resolve().then(()=>Mo);return{getToken:e}},void 0),r=i(),l={};r&&(l.Authorization=`Bearer ${r}`);const c=new AbortController,u=setTimeout(()=>c.abort(),3e4);try{const n=await fetch(o,{headers:l,signal:c.signal});if(401===n.status&&!s){const{refreshToken:s}=await N(async()=>{const{refreshToken:e}=await Promise.resolve().then(()=>Mo);return{refreshToken:e}},void 0);if(await s())return this.fetchFilteredPackets(e,t,!0)}if(!n.ok)throw new Error(`API error: ${n.status}`);return n.json()}finally{clearTimeout(u)}}};function li(e){return{paths:e.paths,byEndpoints:new Map(e.byEndpointsEntries),canonicalPaths:new Map(e.canonicalPathsEntries),totalObservations:e.totalObservations,uniquePathCount:e.uniquePathCount}}function ci(){return{paths:[],byEndpoints:new Map,canonicalPaths:new Map,totalObservations:0,uniquePathCount:0}}const ui=new class{constructor(){t(this,"worker",null),t(this,"listeners",new Set),t(this,"currentTopology",{edges:[],validatedEdges:[],weakEdges:[],certainEdges:[],uncertainEdges:[],edgeMap:new Map,maxPacketCount:0,maxCertainCount:0,neighborAffinity:new Map,fullAffinity:new Map,localPrefix:null,centrality:new Map,hubNodes:[],gatewayNodes:[],loops:[],loopEdgeKeys:new Set,txDelayRecommendations:new Map,pathRegistry:ci(),edgeBetweenness:new Map,backboneEdges:[],nodeMobility:new Map,mobileNodes:[],pathHealth:[],lastHopNeighbors:[],disambiguationStats:{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:[],viterbiStats:{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}}),t(this,"isComputing",!1),t(this,"pendingRequest",null),t(this,"debounceTimer",null),t(this,"debounceMs",100),this.initWorker()}initWorker(){if("undefined"!=typeof window)try{this.worker=new Worker(new URL("/assets/topology.worker-BHEhB0-W.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>{this.handleWorkerMessage(e.data)},this.worker.onerror=e=>{}}catch(e){}}handleWorkerMessage(e){if(this.isComputing=!1,"error"!==e.type){var t;this.currentTopology={edges:(t=e.payload).edges??[],validatedEdges:t.validatedEdges??[],weakEdges:t.weakEdges??[],certainEdges:t.certainEdges??[],uncertainEdges:t.uncertainEdges??[],maxPacketCount:t.maxPacketCount??0,maxCertainCount:t.maxCertainCount??0,localPrefix:t.localPrefix??null,hubNodes:t.hubNodes??[],gatewayNodes:t.gatewayNodes??[],edgeMap:new Map(t.edgeMapEntries??[]),neighborAffinity:new Map(t.neighborAffinityEntries??[]),fullAffinity:new Map(t.fullAffinityEntries??[]),centrality:new Map(t.centralityEntries??[]),loops:t.loops??[],loopEdgeKeys:new Set(t.loopEdgeKeyEntries??[]),txDelayRecommendations:new Map(t.txDelayRecommendationEntries??[]),pathRegistry:t.pathRegistry?li(t.pathRegistry):ci(),edgeBetweenness:new Map(t.edgeBetweennessEntries??[]),backboneEdges:t.backboneEdges??[],nodeMobility:new Map(t.nodeMobilityEntries??[]),mobileNodes:t.mobileNodes??[],pathHealth:t.pathHealth??[],lastHopNeighbors:t.lastHopNeighbors??[],disambiguationStats:t.disambiguationStats??{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:t.discoveredNodes??[],viterbiStats:t.viterbiStats??{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}};for(const t of this.listeners)try{t(this.currentTopology,e.computeTimeMs)}catch(s){}if(this.pendingRequest){const e=this.pendingRequest;this.pendingRequest=null,this.computeInternal(e)}}}computeInternal(e){if(!this.worker)return;this.isComputing=!0;const t={type:"compute",payload:e};this.worker.postMessage(t)}compute(e,t,s,n,a,o,i,r){const l={packets:e,neighbors:t,localHash:s,localLat:n,localLon:a,airtimeMs:o,zeroHopNeighbors:i,terrainGrid:r,enableTerrainAware:void 0!==r};this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.isComputing?this.pendingRequest=l:this.computeInternal(l)},this.debounceMs)}subscribe(e){return this.listeners.add(e),this.currentTopology.edges.length>0&&e(this.currentTopology,0),()=>{this.listeners.delete(e)}}getTopology(){return this.currentTopology}isWorking(){return this.isComputing}terminate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.worker&&(this.worker.terminate(),this.worker=null),this.listeners.clear()}},di=new class{constructor(){t(this,"worker",null),t(this,"listeners",new Set),t(this,"sparklines",new Map),t(this,"isComputing",!1),t(this,"lastComputeTimeMs",0),t(this,"pendingRequest",null),t(this,"debounceTimer",null),t(this,"debounceMs",150),this.initWorker()}initWorker(){if("undefined"!=typeof window)try{this.worker=new Worker(new URL("/assets/sparkline.worker-CmKhBAy5.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>{this.handleWorkerMessage(e.data)},this.worker.onerror=e=>{this.isComputing=!1,this.notifyListeners()}}catch(e){}}handleWorkerMessage(e){if(this.isComputing=!1,"error"!==e.type){if(this.sparklines=new Map(e.payload.sparklineEntries),this.lastComputeTimeMs=e.computeTimeMs,this.notifyListeners(),this.pendingRequest){const e=this.pendingRequest;this.pendingRequest=null,this.computeInternal(e.packets,e.nodeHashes)}}else this.notifyListeners()}computeInternal(e,t){if(!this.worker)return;if(0===t.length)return this.isComputing=!1,void this.notifyListeners();this.isComputing=!0,this.notifyListeners();const s={type:"compute",payload:{packets:e,nodeHashes:t}};this.worker.postMessage(s)}notifyListeners(){for(const t of this.listeners)try{t(this.sparklines,this.isComputing)}catch(e){}}compute(e,t){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.isComputing?this.pendingRequest={packets:e,nodeHashes:t}:this.computeInternal(e,t)},this.debounceMs)}getSparkline(e){return this.sparklines.get(e)??[]}getAllSparklines(){return this.sparklines}hasSparkline(e){return this.sparklines.has(e)}isWorking(){return this.isComputing}getLastComputeTime(){return this.lastComputeTimeMs}subscribe(e){return this.listeners.add(e),e(this.sparklines,this.isComputing),()=>{this.listeners.delete(e)}}clear(){this.sparklines.clear(),this.notifyListeners()}terminate(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.worker&&(this.worker.terminate(),this.worker=null),this.listeners.clear()}},hi=new class{constructor(){t(this,"worker",null),t(this,"isInitialized",!1),t(this,"statsListeners",new Set),t(this,"packetsListeners",new Set),t(this,"errorListeners",new Set),t(this,"readyResolve",null),t(this,"readyPromise",null),t(this,"unsubscribeTokenChange",null)}async init(e){if(!this.isInitialized&&"undefined"!=typeof window){this.readyPromise=new Promise(e=>{this.readyResolve=e});try{this.worker=new Worker(new URL("/assets/polling.worker-DFp1Qyu0.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=e=>{};const t={type:"init",config:{apiBaseUrl:e.apiBaseUrl,authToken:e.authToken,statsIntervalMs:e.statsIntervalMs??3e3,packetsIntervalMs:e.packetsIntervalMs??3e3}};this.worker.postMessage(t),this.isInitialized=!0,this.unsubscribeTokenChange=no(e=>{this.setAuthToken(e)}),await this.readyPromise}catch(t){throw t}}}handleMessage(e){var t;const s=e.data;switch(s.type){case"ready":null==(t=this.readyResolve)||t.call(this);break;case"stats":for(const e of this.statsListeners)try{e(s.data,s.timestamp)}catch(n){}break;case"packets":for(const e of this.packetsListeners)try{e(s.newPackets,s.totalCount,s.newestTimestamp)}catch(n){}break;case"packetsReset":for(const e of this.packetsListeners)try{e([],0,s.newestTimestamp)}catch(n){}break;case"error":for(const e of this.errorListeners)try{e(s.source,s.error)}catch(n){}}}onStats(e){return this.statsListeners.add(e),()=>this.statsListeners.delete(e)}onPackets(e){return this.packetsListeners.add(e),()=>this.packetsListeners.delete(e)}onError(e){return this.errorListeners.add(e),()=>this.errorListeners.delete(e)}setAuthToken(e){if(!this.worker)return;const t={type:"setAuth",token:e};this.worker.postMessage(t)}setLiveMode(e){if(!this.worker)return;const t={type:"setLiveMode",enabled:e};this.worker.postMessage(t)}forceRefresh(){this.worker&&this.worker.postMessage({type:"forceRefresh"})}clearCache(){this.worker&&this.worker.postMessage({type:"clearCache"})}terminate(){if(this.unsubscribeTokenChange&&(this.unsubscribeTokenChange(),this.unsubscribeTokenChange=null),this.worker){const e={type:"stop"};this.worker.postMessage(e),this.worker.terminate(),this.worker=null}this.isInitialized=!1,this.statsListeners.clear(),this.packetsListeners.clear(),this.errorListeners.clear()}isReady(){return this.isInitialized}},fi=new class{constructor(){t(this,"ws",null),t(this,"connectionState","disconnected"),t(this,"reconnectAttempts",0),t(this,"pingIntervalId",null),t(this,"lastPongTime",Date.now()),t(this,"reconnectTimeoutId",null),t(this,"packetListeners",new Set),t(this,"statsListeners",new Set),t(this,"systemStatsListeners",new Set),t(this,"packetStatsListeners",new Set),t(this,"connectionListeners",new Set),t(this,"unsubscribeTokenChange",null),t(this,"wsSupported",!0)}buildWsUrl(){return`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/ws/packets`}connect(){var e,t;if((null==(e=this.ws)?void 0:e.readyState)!==WebSocket.OPEN&&(null==(t=this.ws)?void 0:t.readyState)!==WebSocket.CONNECTING&&this.wsSupported){this.setConnectionState("connecting");try{const e=this.buildWsUrl();this.ws=new WebSocket(e),this.ws.onopen=this.handleOpen.bind(this),this.ws.onmessage=this.handleMessage.bind(this),this.ws.onerror=this.handleError.bind(this),this.ws.onclose=this.handleClose.bind(this),this.unsubscribeTokenChange||(this.unsubscribeTokenChange=no(e=>{e&&"connected"===this.connectionState&&(this.disconnect(),this.connect())}))}catch(s){this.wsSupported=!1,this.setConnectionState("disconnected")}}}disconnect(){this.clearPingInterval(),this.clearReconnectTimeout(),this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.readyState!==WebSocket.OPEN&&this.ws.readyState!==WebSocket.CONNECTING||this.ws.close(1e3,"Client disconnect"),this.ws=null),this.setConnectionState("disconnected"),this.reconnectAttempts=0}isConnected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}getConnectionState(){return this.connectionState}isSupported(){return this.wsSupported}send(e){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(e)),!0}catch(t){return!1}}onPacket(e){return this.packetListeners.add(e),()=>this.packetListeners.delete(e)}onStats(e){return this.statsListeners.add(e),()=>this.statsListeners.delete(e)}onSystemStats(e){return this.systemStatsListeners.add(e),()=>this.systemStatsListeners.delete(e)}onPacketStats(e){return this.packetStatsListeners.add(e),()=>this.packetStatsListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),e(this.connectionState,this.reconnectAttempts),()=>this.connectionListeners.delete(e)}handleOpen(){this.setConnectionState("connected"),this.reconnectAttempts=0,this.lastPongTime=Date.now();const e=co();e&&this.ws&&this.ws.send(JSON.stringify({type:"auth",token:e})),this.startPingInterval()}handleMessage(e){try{const t=JSON.parse(e.data);switch(t.type){case"packet":this.notifyPacketListeners(t.data);break;case"stats":{const e=t.data;e&&"noise_floor_dbm"in e&&this.notifyStatsListeners(e),(null==e?void 0:e.packet_stats)&&this.notifyPacketStatsListeners(e.packet_stats),(null==e?void 0:e.system_stats)&&this.notifySystemStatsListeners(e.system_stats);break}case"packet_stats":{const e=t.data;this.notifyPacketStatsListeners(e);break}case"system_stats":this.notifySystemStatsListeners(t.data);break;case"ping":this.lastPongTime=Date.now(),this.send({type:"pong"});break;case"pong":this.lastPongTime=Date.now()}}catch(t){}}handleError(e){}handleClose(e){this.clearPingInterval(),1e3!==e.code?(1006===e.code&&this.reconnectAttempts,this.scheduleReconnect()):this.setConnectionState("disconnected")}setConnectionState(e){if(this.connectionState!==e){this.connectionState=e;for(const s of this.connectionListeners)try{s(e,this.reconnectAttempts)}catch(t){}}}notifyPacketListeners(e){for(const s of this.packetListeners)try{s(e)}catch(t){}}notifyStatsListeners(e){for(const s of this.statsListeners)try{s(e)}catch(t){}}notifySystemStatsListeners(e){for(const s of this.systemStatsListeners)try{s(e)}catch(t){}}notifyPacketStatsListeners(e){for(const s of this.packetStatsListeners)try{s(e)}catch(t){}}startPingInterval(){this.clearPingInterval(),this.pingIntervalId=setInterval(()=>{var e;(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN&&(this.send({type:"ping"}),Date.now()-this.lastPongTime>6e4&&(this.disconnect(),this.connect()))},3e4)}clearPingInterval(){this.pingIntervalId&&(clearInterval(this.pingIntervalId),this.pingIntervalId=null)}scheduleReconnect(){if(this.reconnectAttempts>=20)return this.wsSupported=!1,void this.setConnectionState("disconnected");this.setConnectionState("reconnecting");const e=Math.min(1e3*Math.pow(2,Math.min(this.reconnectAttempts,5)),3e4);this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.reconnectTimeoutId=null,this.connect()},e)}clearReconnectTimeout(){this.reconnectTimeoutId&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null)}terminate(){this.disconnect(),this.unsubscribeTokenChange&&(this.unsubscribeTokenChange(),this.unsubscribeTokenChange=null),this.packetListeners.clear(),this.statsListeners.clear(),this.systemStatsListeners.clear(),this.packetStatsListeners.clear(),this.connectionListeners.clear()}},pi=a(e=>({connectionState:"disconnected",isSupported:!0,reconnectAttempt:0,lastConnected:null,initialize:()=>{fi.onConnectionChange((t,s)=>{e(e=>({connectionState:t,reconnectAttempt:s??0,isSupported:fi.isSupported(),lastConnected:"connected"===t?Date.now():e.lastConnected}))}),fi.connect()}})),mi=.05,gi=1e3,yi="terrarium";function bi(e,t,s){try{return e.queryTerrainElevation({lng:t,lat:s})??0}catch{return 0}}const xi=a((e,t)=>({terrainGrid:null,isLoading:!1,error:null,lastLoadedAt:null,cachedBounds:null,terrainDisambiguationEnabled:!0,loadTerrain:async(s,n)=>{const a=t();if(!(a.isLoading||(o=a.cachedBounds,i=s,o&&o.minLat<=i.minLat&&o.maxLat>=i.maxLat&&o.minLng<=i.minLng&&o.maxLng>=i.maxLng))){var o,i;e({isLoading:!0,error:null});try{n.getTerrain()||(n.getSource(yi)||(n.addSource(yi,{type:"raster-dem",tiles:["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],encoding:"terrarium",tileSize:256}),await new Promise((e,t)=>{const s=setTimeout(()=>t(new Error("Terrain source load timeout")),1e4),a=t=>{t.sourceId===yi&&t.isSourceLoaded&&(clearTimeout(s),n.off("sourcedata",a),e())};n.on("sourcedata",a)})),n.setTerrain({source:yi}),await new Promise(e=>setTimeout(e,500)));const t=await async function(e,t){const{minLat:s,maxLat:n,minLng:a,maxLng:o}=t;let i=Math.ceil((o-a)/.001),r=Math.ceil((n-s)/.001);i>gi&&(i=gi),r>gi&&(r=gi);const l=(o-a)/i,c=(n-s)/r,u=Math.max(l,c),d=new Float32Array(i*r);let h=0;for(let f=0;fsetTimeout(e,0))}}return{origin:[s,a],cellSize:u,width:i,height:r,elevations:d}}(n,s);e({terrainGrid:t,isLoading:!1,lastLoadedAt:Date.now(),cachedBounds:s})}catch(r){const t=r instanceof Error?r.message:"Unknown error loading terrain";e({isLoading:!1,error:t})}}},preloadFromNodes:async(e,s)=>{const n=function(e){const t=e.filter(e=>void 0!==e.latitude&&void 0!==e.longitude&&(0!==e.latitude||0!==e.longitude));if(0===t.length)return null;let s=1/0,n=-1/0,a=1/0,o=-1/0;for(const i of t)s=Math.min(s,i.latitude),n=Math.max(n,i.latitude),a=Math.min(a,i.longitude),o=Math.max(o,i.longitude);return{minLat:s-mi,maxLat:n+mi,minLng:a-mi,maxLng:o+mi}}(e);n&&await t().loadTerrain(n,s)},clearTerrain:()=>{e({terrainGrid:null,cachedBounds:null,lastLoadedAt:null,error:null})},setTerrainDisambiguationEnabled:t=>{e({terrainDisambiguationEnabled:t})},getTerrainGridForDisambiguation:()=>{const e=t();return e.terrainDisambiguationEnabled?e.terrainGrid:null}}));function wi(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2,4).toUpperCase():e.slice(0,2).toUpperCase()}function ki(e,t){let s=e.forwarded_path??e.original_path;if("string"==typeof s)try{s=JSON.parse(s)}catch{return null}if(!s||!Array.isArray(s)||0===s.length)return null;const n=s.map(e=>String(e).toUpperCase()),a=t?wi(t):null,o=n[n.length-1],i=null!==a&&o===a,r=i?n.slice(0,-1):[...n];return{effective:r,original:n,hadLocal:i,effectiveLength:r.length}}function vi(e,t){const s=e.toUpperCase();return t.startsWith("0x")||t.startsWith("0X")?t.slice(2).toUpperCase().startsWith(s):t.toUpperCase().startsWith(s)}const Si=[{label:"20m",minutes:20,buckets:40},{label:"1h",minutes:60,buckets:60},{label:"3h",minutes:180,buckets:90},{label:"12h",minutes:720,buckets:72},{label:"24h",minutes:1440,buckets:96},{label:"3d",minutes:4320,buckets:72},{label:"7d",minutes:10080,buckets:84},{label:"14d",minutes:20160,buckets:168}],Ci=[{label:"1h",hours:1},{label:"3h",hours:3},{label:"12h",hours:12},{label:"24h",hours:24},{label:"3d",hours:72},{label:"7d",hours:168},{label:"14d",hours:336}];function Ti(e){switch(e){case 1:return 3600;case 3:case 12:return 5400;case 24:return 8640;case 72:case 168:case 336:return 720;default:{const t=3600*e,s=Math.round(t/10);return Math.min(Math.max(360,s),720)}}}const Mi="'JetBrains Mono', 'SF Mono', Monaco, monospace",_i={stats:3e3,packets:3e3,charts:3e4,logs:2e3,system:3e3},Li={DEBUG:"text-[var(--log-debug)]",INFO:"text-[var(--log-info)]",WARNING:"text-[var(--log-warning)]",ERROR:"text-[var(--log-error)]",CRITICAL:"text-[var(--log-critical)]"};function ji(e){return Li[e]??"text-text-muted border-border-subtle"}const Ei="pymc-resource-history",Pi="pymc-resource-last-fetch",Ni="pymc-hidden-contacts",Di="pymc-quick-neighbors",Ii="pymc-local-hash",Fi="pymc-global-time-range";let Ai=null,Ri=null;function zi(e,t){const s=t-1e3*e;return s<=6048e5?"active":s<=12096e5?"stale":"expired"}function Oi(e){return 4===(e.type??e.payload_type)&&!0!==e.transmitted&&function(e){const t=function(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.startsWith("["))try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}return[]}(e.original_path),s=e.route??e.route_type;return 2===(n=s)||3===n?0===t.length:Va(s)?t.length<=1:0===t.length;var n}(e)}function Bi(e,t,s,n,a){if(!e)return null;let o=e;if(e.length<=4){const n=e.replace(/^0x/i,"").toUpperCase();if(n===t)return null;const a=s.get(n);if(!a)return null;o=a}return n.has(o)?o===a?null:o:null}function $i(e,t){e.count++,void 0!==t.rssi&&null!==t.rssi&&(e.rssiSum+=t.rssi,e.rssiCount++),void 0!==t.snr&&null!==t.snr&&(e.snrSum+=t.snr,e.snrCount++);const s=t.timestamp??0;s>e.lastSeen&&(e.lastSeen=s)}function Wi(e){return{hash:e,count:0,rssiSum:0,rssiCount:0,snrSum:0,snrCount:0,lastSeen:0}}function Hi(e,t){const s=zi(e.lastSeen,t);return"expired"===s?null:{hash:e.hash,prefix:wi(e.hash),count:e.count,avgRssi:e.rssiCount>0?e.rssiSum/e.rssiCount:null,avgSnr:e.snrCount>0?e.snrSum/e.snrCount:null,lastSeen:e.lastSeen,status:s}}function Ui(){if("undefined"==typeof window)return[];try{const e=localStorage.getItem(Di);if(e)return JSON.parse(e)}catch{}return[]}function qi(e){"undefined"!=typeof window&&(Ri&&clearTimeout(Ri),Ri=setTimeout(()=>{try{localStorage.setItem(Di,JSON.stringify(e))}catch{}Ri=null},1e3))}function Ji(){if("undefined"!=typeof window)try{const e=localStorage.getItem(Ii);if(e)return e}catch{}}function Gi(e){if("undefined"!=typeof window)try{localStorage.setItem(Ii,e)}catch{}}function Yi(){if("undefined"==typeof window)return[];try{const e=localStorage.getItem(Ei);if(e)return JSON.parse(e)}catch{}return[]}function Vi(){if("undefined"==typeof window)return new Set;try{const e=localStorage.getItem(Ni);if(e)return new Set(JSON.parse(e))}catch{}return new Set}function Ki(){if("undefined"==typeof window)return 0;try{const e=localStorage.getItem(Pi);if(e)return parseInt(e,10)||0}catch{}return 0}function Xi(){if("undefined"==typeof window)return 4;try{const e=localStorage.getItem(Fi);if(e){const t=parseInt(e,10);if(!isNaN(t)&&t>=0&&t<=7)return t}}catch{}return 4}const Qi=a((e,t)=>({stats:null,statsLoading:!1,statsError:null,packets:[],packetsLoading:!1,packetsError:null,lastPacketTimestamp:0,logs:[],logsLoading:!1,liveMode:!0,flashReceived:0,flashAdvert:0,pendingAdvertLocalHash:null,pendingAdvertTimestamp:null,resourceHistory:Yi(),lastResourceFetch:Ki(),hiddenContacts:Vi(),quickNeighbors:Ui(),cachedLocalHash:Ji(),initialized:!1,packetCacheState:ri.getState(),mutationsInFlight:new Set,globalTimeRangeIndex:Xi(),initializeApp:async()=>{const{initialized:s}=t();if(!s){e({initialized:!0,statsLoading:!0,packetsLoading:!0}),ri.subscribe(t=>{e({packetCacheState:t})});try{const{hiddenContacts:s}=t(),n=await Po(),a=n.neighbors??{},o=Date.now(),i=[];for(const[e,t]of Object.entries(a)){if(s.has(e))continue;if(!t.zero_hop)continue;const n=zi(t.last_seen??0,o);"expired"!==n&&i.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:n})}i.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const r=n.local_hash;e({stats:n,statsLoading:!1,quickNeighbors:i,cachedLocalHash:r}),qi(i),r&&Gi(r);const l=()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>{const s=t.timestamp??0;return s>e?s:e},0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},c=await ri.initialLoad(l);if(c.length>0){const s=c.reduce((e,t)=>{const s=t.timestamp??0;return s>e?s:e},0);e({packets:[...c],packetsLoading:!1,lastPacketTimestamp:s}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}else e({packetsLoading:!1})}catch(n){e({statsError:n instanceof Error?n.message:"Failed to initialize",statsLoading:!1,packetsLoading:!1})}pi.getState().initialize(),fi.onPacket(s=>{const{lastPacketTimestamp:n,mutationsInFlight:a}=t();if(!(a.size>0)&&ri.mergePacketsDirectly([s])>0){const a=s.timestamp??0;a>n&&(e({flashReceived:t().flashReceived+1}),Oo());const o=ri.getPackets();e({packets:o,packetsLoading:!1,lastPacketTimestamp:Math.max(n,a)}),t().triggerTopologyCompute()}}),fi.onStats(s=>{const{mutationsInFlight:n,hiddenContacts:a}=t();if(n.size>0)return;const o=s.neighbors??{},i=Date.now(),r=[];for(const[e,t]of Object.entries(o)){if(a.has(e))continue;if(!t.zero_hop)continue;const s=zi(t.last_seen??0,i);"expired"!==s&&r.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:s})}r.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const l=s.local_hash;e({stats:s,statsLoading:!1,quickNeighbors:r,cachedLocalHash:l}),qi(r),l&&Gi(l)}),fi.onPacketStats(s=>{const{stats:n,mutationsInFlight:a}=t();if(!n||a.size>0)return;const o={...n,rx_count:s.rx_count??n.rx_count,tx_count:s.tx_count??n.tx_count,forwarded_count:s.forwarded_count??n.forwarded_count,dropped_count:s.dropped_count??n.dropped_count};e({stats:o})});try{await hi.init({apiBaseUrl:"",authToken:co()??void 0,statsIntervalMs:_i.stats,packetsIntervalMs:_i.packets}),hi.onStats((s,n)=>{const{mutationsInFlight:a,hiddenContacts:o}=t();if(a.size>0)return;const i=s.neighbors??{},r=Date.now(),l=[];for(const[e,t]of Object.entries(i)){if(o.has(e))continue;if(!t.zero_hop)continue;const s=zi(t.last_seen??0,r);"expired"!==s&&l.push({hash:e,prefix:wi(e),count:t.advert_count??0,avgRssi:t.rssi??null,avgSnr:t.snr??null,lastSeen:t.last_seen??0,status:s})}l.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const c=s.local_hash;e({stats:s,statsLoading:!1,quickNeighbors:l,cachedLocalHash:c}),qi(l),c&&Gi(c)}),hi.onPackets((s,n,a)=>{if(0===s.length)return;const{lastPacketTimestamp:o}=t();for(const e of s)if(e.packet_hash){ri.mergePacketsDirectly(s);break}const i=a>o;i&&(e({flashReceived:t().flashReceived+1}),Oo());const r=ri.getPackets();e({packets:r,packetsLoading:!1,lastPacketTimestamp:a}),i&&t().triggerTopologyCompute()}),hi.onError((t,s)=>{e("stats"===t?{statsError:s}:{packetsError:s})}),"undefined"!=typeof document&&document.addEventListener("visibilitychange",()=>{document.hidden||hi.forceRefresh()})}catch(n){!function(e){setInterval(()=>{e().fetchStats()},_i.stats),setInterval(()=>{e().liveMode&&!ri.isHeavyLoadInProgress()&&e().fetchPackets()},_i.packets)}(t)}}},prefetchForRoute:e=>{switch(e){case"/logs":No().catch(()=>{});break;case"/system":Io().catch(()=>{});break;case"/statistics":(async function(e=24){return jo(`/api/packet_type_graph_data?hours=${e}`)})(3).catch(()=>{}),Do(3).catch(()=>{});break;case"/settings":(async function(){return jo("/api/radio_presets")})().catch(()=>{})}},fetchStats:async s=>{const{stats:n,mutationsInFlight:a,hiddenContacts:o}=t();if(!(a.size>0)||(null==s?void 0:s.force)){n||e({statsLoading:!0}),e({statsError:null});try{const t=await Po(),s=t.neighbors??{},n=Date.now(),a=[];for(const[e,r]of Object.entries(s)){if(o.has(e))continue;if(!r.zero_hop)continue;const t=zi(r.last_seen??0,n);"expired"!==t&&a.push({hash:e,prefix:wi(e),count:r.advert_count??0,avgRssi:r.rssi??null,avgSnr:r.snr??null,lastSeen:r.last_seen??0,status:t})}a.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen);const i=t.local_hash;e({stats:t,statsLoading:!1,quickNeighbors:a,cachedLocalHash:i}),qi(a),i&&Gi(i)}catch(i){e({statsError:i instanceof Error?i.message:"Failed to fetch stats",statsLoading:!1})}}},fetchPackets:async s=>{const{packets:n,lastPacketTimestamp:a}=t();0===n.length&&e({packetsLoading:!0}),e({packetsError:null});try{const s=await ri.poll(),o=s.length>0?s.reduce((e,t)=>Math.max(e,t.timestamp??0),0):0,i=o>a&&a>0,r=s.length!==n.length||i;i&&(e({flashReceived:t().flashReceived+1}),Oo()),e(r?{packets:s,packetsLoading:!1,lastPacketTimestamp:o||a}:{packetsLoading:!1}),i&&t().triggerTopologyCompute()}catch(o){e({packetsError:o instanceof Error?o.message:"Failed to fetch packets",packetsLoading:!1})}},fetchLogs:async()=>{const{logs:s}=t();0===s.length&&e({logsLoading:!0});try{const t=await No();e({logs:t.logs,logsLoading:!1})}catch{e({logsLoading:!1})}},setLiveMode:t=>{e({liveMode:t}),hi.isReady()&&hi.setLiveMode(t)},setMode:async s=>{const n="setMode",{mutationsInFlight:a}=t(),o=new Set(a);o.add(n),e({mutationsInFlight:o});try{if(!(await Ao(s)).success)throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}catch(i){const{mutationsInFlight:s}=t(),a=new Set(s);throw a.delete(n),e({mutationsInFlight:a}),i}},clearModeMutation:()=>{const{mutationsInFlight:s}=t(),n=new Set(s);n.delete("setMode"),e({mutationsInFlight:n})},setDutyCycle:async s=>{const n="setDutyCycle",{mutationsInFlight:a}=t(),o=new Set(a);o.add(n),e({mutationsInFlight:o});try{if(!(await Ro(s)).success)throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}finally{const{mutationsInFlight:s}=t(),a=new Set(s);a.delete(n),e({mutationsInFlight:a})}},setDutyCycleConfig:async s=>{var n;const a="setDutyCycleConfig",{mutationsInFlight:o}=t(),i=new Set(o);i.add(a),e({mutationsInFlight:i});try{const e=await async function(e){return jo("/api/update_duty_cycle_config",{method:"POST",body:JSON.stringify(e)})}(s);if(!e.success&&!(null==(n=e.data)?void 0:n.persisted))throw new Error("Backend returned unsuccessful response");await t().fetchStats({force:!0})}catch(r){const{mutationsInFlight:s}=t(),n=new Set(s);throw n.delete(a),e({mutationsInFlight:n}),r}},clearDutyCycleMutation:()=>{const{mutationsInFlight:s}=t(),n=new Set(s);n.delete("setDutyCycleConfig"),e({mutationsInFlight:n})},startMutation:s=>{const{mutationsInFlight:n}=t(),a=new Set(n);a.add(s),e({mutationsInFlight:a})},clearMutation:s=>{const{mutationsInFlight:n}=t(),a=new Set(n);a.delete(s),e({mutationsInFlight:a})},sendAdvert:async()=>{try{const s=await Fo();return s.success?(e({flashAdvert:t().flashAdvert+1}),{success:!0}):{success:!1,error:s.error||"Failed to send advert"}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error"}}},triggerFlashReceived:()=>{e({flashReceived:t().flashReceived+1})},triggerFlashAdvert:()=>{e({flashAdvert:t().flashAdvert+1})},addResourceDataPoint:(s,n,a)=>{const o=Date.now(),{lastResourceFetch:i,resourceHistory:r}=t();if(o-i<1e3)return;const l=[...r,{timestamp:o,time:new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),cpu:s,memory:n}],c=l.length>a?l.slice(-a):l;var u,d;e({resourceHistory:c,lastResourceFetch:o}),u=c,d=o,"undefined"!=typeof window&&(Ai&&clearTimeout(Ai),Ai=setTimeout(()=>{try{localStorage.setItem(Ei,JSON.stringify(u)),localStorage.setItem(Pi,d.toString())}catch{}Ai=null},1e3))},hideContact:s=>{const{hiddenContacts:n}=t(),a=new Set(n);a.add(s),e({hiddenContacts:a}),function(e){if("undefined"!=typeof window)try{localStorage.setItem(Ni,JSON.stringify([...e]))}catch{}}(a)},clearPacketCache:()=>{ri.clear(),e({packets:[],lastPacketTimestamp:0}),ri.quickLoad().then(s=>{if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:s,lastPacketTimestamp:n}),t().triggerTopologyCompute()}})},triggerTopologyCompute:()=>{var e,s,n,a;const{packets:o,stats:i,hiddenContacts:r}=t();if(0===o.length||!i)return;const l=i.neighbors??{},c=Object.fromEntries(Object.entries(l).filter(([e])=>!r.has(e))),u=i.local_hash,d=null==(s=null==(e=i.config)?void 0:e.repeater)?void 0:s.latitude,h=null==(a=null==(n=i.config)?void 0:n.repeater)?void 0:a.longitude,f=[];for(const[t,m]of Object.entries(c))m.zero_hop&&f.push({hash:t,advertCount:m.advert_count??1,avgRssi:m.rssi??null,avgSnr:m.snr??null,lastSeen:m.last_seen??0,latitude:m.latitude,longitude:m.longitude});const p=xi.getState().getTerrainGridForDisambiguation();ui.compute(o,c,u,d,h,void 0,f,p??void 0)},triggerDeepAnalysis:async()=>{await ri.forceDeepLoad();const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:s,lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},updateQuickNeighbors:()=>{const{packets:s,stats:n,hiddenContacts:a}=t();if(0===s.length||!n)return;const o=n.neighbors??{},i=function(e,t,s){if(!s||0===e.length||0===Object.keys(t).length)return[];const n=Date.now(),a=wi(s),o=new Set(Object.keys(t)),i=function(e){var t,s;const n=new Map;for(const a of Object.keys(e)){const o=wi(a),i=n.get(o);if(i){const r=null==(t=e[i])?void 0:t.zero_hop;(null==(s=e[a])?void 0:s.zero_hop)&&!r&&n.set(o,a)}else n.set(o,a)}return n}(t),r=new Map;for(const c of e){if(!Oi(c))continue;const e=Bi(c.src_hash,a,i,o,s);if(!e)continue;let t=r.get(e);t||(t=Wi(e),r.set(e,t)),$i(t,c)}for(const[c,u]of Object.entries(t))u.zero_hop&&!r.has(c)&&r.set(c,{hash:c,count:u.advert_count??0,rssiSum:u.rssi??0,rssiCount:void 0!==u.rssi?1:0,snrSum:u.snr??0,snrCount:void 0!==u.snr?1:0,lastSeen:u.last_seen??0});const l=[];for(const c of r.values()){const e=Hi(c,n);e&&l.push(e)}return l.sort((e,t)=>t.count!==e.count?t.count-e.count:t.lastSeen-e.lastSeen),l}(s,Object.fromEntries(Object.entries(o).filter(([e])=>!a.has(e))),n.local_hash),r=t().quickNeighbors;(i.length!==r.length||i.some((e,t)=>{var s,n;return e.hash!==(null==(s=r[t])?void 0:s.hash)||e.count!==(null==(n=r[t])?void 0:n.count)}))&&(e({quickNeighbors:i}),qi(i))},triggerSparklineCompute:()=>{const{packets:e,stats:s,hiddenContacts:n}=t();if(0===e.length||!s)return;const a=s.neighbors??{},o=Object.keys(a).filter(e=>!n.has(e));0!==o.length&&di.compute(e,o)},requestSevenDayData:async()=>{await ri.loadSevenDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},requestThreeDayData:async()=>{await ri.loadThreeDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},requestFourteenDayData:async()=>{await ri.loadFourteenDays(()=>{const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}});const s=ri.getPackets();if(s.length>0){const n=s.reduce((e,t)=>Math.max(e,t.timestamp??0),0);e({packets:[...s],lastPacketTimestamp:n}),t().triggerTopologyCompute(),t().triggerSparklineCompute()}},setGlobalTimeRange:s=>{e({globalTimeRangeIndex:s}),function(e){if("undefined"!=typeof window)try{localStorage.setItem(Fi,e.toString())}catch{}}(s);const{packetCacheState:n,requestThreeDayData:a,requestSevenDayData:o,requestFourteenDayData:i}=t();5!==s||n.threeDayLoadComplete||n.isBackgroundLoading||a(),6!==s||n.sevenDayLoadComplete||n.isBackgroundLoading||o(),7!==s||n.fourteenDayLoadComplete||n.isBackgroundLoading||i()}})),Zi=Qi,er=()=>Qi(e=>e.stats),tr=()=>Qi(e=>e.statsError),sr=()=>Qi(e=>e.packets),nr=()=>Qi(e=>e.packetsLoading),ar=()=>Qi(e=>e.logs),or=()=>Qi(e=>e.logsLoading),ir=()=>Qi(e=>e.liveMode),rr=()=>Qi(e=>e.fetchLogs),lr=()=>Qi(e=>e.setLiveMode),cr=()=>Qi(e=>e.resourceHistory),ur=()=>Qi(e=>e.addResourceDataPoint),dr=()=>Qi(e=>e.hiddenContacts),hr=()=>Qi(e=>e.hideContact),fr=()=>Qi(e=>e.packetCacheState),pr=()=>Qi(e=>e.triggerDeepAnalysis),mr=()=>Qi(e=>e.quickNeighbors),gr=()=>Qi(e=>e.cachedLocalHash),yr=()=>Qi(e=>e.lastPacketTimestamp),br=()=>Qi(e=>e.globalTimeRangeIndex),xr=()=>Qi(e=>e.setGlobalTimeRange),wr=()=>Qi(e=>null!==e.stats&&e.packetCacheState.backgroundLoadComplete),kr={rx:{p3:"color(display-p3 0.2 1 0.4)",fallback:"#00FF66"},tx:{p3:"color(display-p3 1 0.9 0.2)",fallback:"#FFDD00"},idle:{p3:"color(display-p3 0.4 0.4 0.45)",fallback:"#666677"}};function vr({showLabel:e=!1,className:t}){var a;const o=Qi(e=>e.flashReceived),i=Qi(e=>e.flashAdvert),r=pi(e=>"connected"===e.connectionState),[l,c]=s.useState("idle"),u=s.useRef(0),d=s.useRef(0);s.useEffect(()=>{if(o<=0)return;const e=Date.now();if(e-u.current<50)return;u.current=e,c("rx");const t=setTimeout(()=>c("idle"),100);return()=>clearTimeout(t)},[o]),s.useEffect(()=>{if(i<=0)return;const e=Date.now();if(e-d.current<50)return;d.current=e,c("tx");const t=setTimeout(()=>c("idle"),100);return()=>clearTimeout(t)},[i]);const h="rx"===l?kr.rx:"tx"===l?kr.tx:kr.idle;return n.jsxs("span",{className:D("inline-flex items-center gap-2",t),title:r?"Real-time (WebSocket)":"Database polling",children:[n.jsx("span",{className:"inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:h.fallback,...(null==(a=CSS.supports)?void 0:a.call(CSS,"color","color(display-p3 1 1 1)"))&&{backgroundColor:h.p3}}}),e&&n.jsx("span",{className:"type-data-xs text-text-muted uppercase tracking-wide",children:r?"Live":"DB"})]})}function Sr({children:e,isLoading:t=!0,className:s,borderRadius:a=12}){return n.jsxs("div",{className:D("relative overflow-hidden",s),style:{borderRadius:a},children:[t&&n.jsx("div",{className:"shimmer-border",style:{borderRadius:a}}),n.jsx("div",{className:"relative z-10",children:e})]})}function Cr({className:e}){return n.jsx("div",{className:D("shimmer-indicator",e),children:n.jsx("div",{className:"shimmer-indicator-inner"})})}const Tr=a(e=>({sparklines:new Map,isComputing:!1,lastUpdated:0,nodeCount:0,setSparklines:t=>e({sparklines:t,lastUpdated:Date.now(),nodeCount:t.size,isComputing:!1}),setComputing:t=>e({isComputing:t})}));"undefined"!=typeof window&&setTimeout(()=>{di.subscribe((e,t)=>{const s=Tr.getState();t&&!s.isComputing?s.setComputing(!0):!t&&e.size>0?s.setSparklines(e):!t&&s.isComputing&&s.setComputing(!1)})},0);const Mr=()=>Tr(e=>e.isComputing),_r=[],Lr=new Map;function jr(e){return Tr(t=>{const s=t.sparklines.get(e);if(!s||0===s.length)return _r;const n=Lr.get(e);return n===s?n:(Lr.set(e,s),s)})}const Er=a(e=>({topology:{edges:[],validatedEdges:[],weakEdges:[],certainEdges:[],uncertainEdges:[],edgeMap:new Map,maxPacketCount:0,maxCertainCount:0,neighborAffinity:new Map,fullAffinity:new Map,localPrefix:null,centrality:new Map,hubNodes:[],gatewayNodes:[],loops:[],loopEdgeKeys:new Set,txDelayRecommendations:new Map,pathRegistry:ci(),edgeBetweenness:new Map,backboneEdges:[],nodeMobility:new Map,mobileNodes:[],pathHealth:[],lastHopNeighbors:[],disambiguationStats:{totalPrefixes:0,unambiguousPrefixes:0,collisionPrefixes:0,collisionRate:0,avgConfidence:0,lowConfidencePrefixes:[],highCollisionPrefixes:[],totalResolutions:0},discoveredNodes:[],viterbiStats:{totalPaths:0,pathsWithGhosts:0,avgPathCost:0,avgPathConfidence:0,observationOverrideCount:0,tracePacketsProcessed:0,pathPacketsProcessed:0,distantEdgesDiscovered:0,duplicateGroupsFound:0,duplicatePathsUnique:0,echolocationEdgesInferred:0}},isComputing:!1,lastComputeTimeMs:0,lastUpdated:0,setTopology:(t,s)=>e({topology:t,lastComputeTimeMs:s,lastUpdated:Date.now(),isComputing:!1}),setComputing:t=>e({isComputing:t})}));"undefined"!=typeof window&&ui.subscribe((e,t)=>{Er.getState().setTopology(e,t)});const Pr=()=>Er(e=>e.topology),Nr=()=>Er(e=>e.topology.hubNodes),Dr=()=>Er(e=>e.topology.centrality),Ir=()=>Er(e=>e.topology.fullAffinity);let Fr=null,Ar=null,Rr=null,zr=null;const Or=()=>Er(e=>(e.topology.hubNodes!==Ar&&(Ar=e.topology.hubNodes,Fr=new Set(e.topology.hubNodes)),Fr)),Br=()=>Er(e=>e.topology.pathHealth),$r=()=>Er(e=>e.topology.disambiguationStats),Wr=()=>Er(e=>e.topology.disambiguationStats.highCollisionPrefixes),Hr=()=>Er(e=>e.topology.disambiguationStats.totalPrefixes>0),Ur=()=>Er(e=>e.topology.discoveredNodes),qr=()=>Er(e=>e.topology.viterbiStats),Jr=()=>Er(e=>(e.topology.discoveredNodes!==zr&&(zr=e.topology.discoveredNodes,Rr=e.topology.discoveredNodes.filter(e=>e.isLikelyReal)),Rr));function Gr(e){if(e<60)return`${Math.floor(e)}s`;const t=Math.floor(e/86400),s=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),a=[];return t>0&&a.push(`${t}d`),s>0&&a.push(`${s}h`),(n>0||0===a.length)&&a.push(`${n}m`),a.join(" ")}function Yr(e){const t=Date.now()/1e3-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Vr(e){const t=Date.now()/1e3-e;return t<60?`${Math.floor(t)}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function Kr(e){return new Date(1e3*e).toLocaleString()}function Xr(e){const t=new Date(1e3*e);return`${t.toLocaleString("en-US",{month:"short"})} ${t.getDate()}, ${t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}`}function Qr(e){return`${(e/1e6).toFixed(3)} MHz`}function Zr(e){return`${(e/1e3).toFixed(1)} kHz`}function el(e){const t=e>1e12?e:1e3*e,s=Date.now(),n=Math.abs(s-t),a=Math.floor(n/1e3),o=Math.floor(a/60),i=Math.floor(o/60),r=Math.floor(i/24);return r>0?`${r} day${1!==r?"s":""}`:i>0?`${i} hour${1!==i?"s":""}`:o>0?`${o} minute${1!==o?"s":""}`:`${a} second${1!==a?"s":""}`}const tl=[{name:"Dashboard",to:"/",icon:l},{name:"Contacts",to:"/contacts",icon:c},{name:"Packets",to:"/packets",icon:u},{name:"Statistics",to:"/statistics",icon:d},{name:"System",to:"/system",icon:h},{name:"Logs",to:"/logs",icon:f},{name:"Terminal",to:"/terminal",icon:p},{name:"Configuration",to:"/configuration",icon:m}],sl="pymc-controls-expanded";function nl(){var e,t,a,l;const{pathname:c}=o(),{stats:u,setMode:d,setDutyCycle:f,sendAdvert:p}=Zi(),m=bo(),M=Qi(e=>e.prefetchForRoute),_=fr(),L=Qi(e=>e.packetCacheState.dataTier),j=Mr(),E=Er(e=>e.isComputing),P=Jr(),[N,I]=s.useState(!1),[F,A]=s.useState(!0),[R,z]=s.useState(!1),[O,B]=s.useState("idle"),[$,W]=s.useState(null),H=s.useRef(null),U=s.useCallback(e=>{e!==c&&(H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{M(e)},100))},[c,M]),q=s.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=null)},[]);s.useEffect(()=>{const e=localStorage.getItem(sl);null!==e&&queueMicrotask(()=>A("true"===e))},[]);const J=()=>{const e=!F;A(e),localStorage.setItem(sl,String(e))};s.useEffect(()=>{queueMicrotask(()=>I(!1))},[c]),s.useEffect(()=>(document.body.style.overflow=N?"hidden":"",()=>{document.body.style.overflow=""}),[N]);const G=null==u?void 0:u.noise_floor_dbm,Y=(null==(t=null==(e=null==u?void 0:u.config)?void 0:e.repeater)?void 0:t.mode)??"forward",V=(null==(l=null==(a=null==u?void 0:u.config)?void 0:a.duty_cycle)?void 0:l.enforcement_enabled)??!1,K=async()=>{z(!0),B("idle"),W(null);const e=await p();z(!1),e.success?(B("success"),setTimeout(()=>B("idle"),1500)):(B("error"),W(e.error||"Failed to send"),setTimeout(()=>{B("idle"),W(null)},3e3))},X=()=>{d("forward"===Y?"monitor":"forward")},Q=()=>{f(!V)},Z=()=>{So(),window.location.href="/login"},ee=_.isLoading||_.isBackgroundLoading||_.isTopologyLoading,te=ee||j||E,se=_.loadProgress,ne=e=>{switch(e){case"24h":return"24 hours";case"3d":return"3 days";case"7d":return"7 days";case"14d":return"14 days";default:return e}},ae=()=>{if(!te)return null;let e="Analyzing database";_.isLoading&&se?e="Loading 24h history...":_.isBackgroundLoading&&se?e=_.statusMessage||`Loading ${L} history...`:_.isTopologyLoading?e="Loading topology data...":j?e="Computing sparklines":E&&(e="Building topology");const t=(null==se?void 0:se.percent)??null,s=null!==t&ⅇreturn n.jsx("div",{className:"px-3 pb-2",children:n.jsx(Sr,{isLoading:ee,borderRadius:12,children:n.jsxs("div",{className:"bg-glass-surface/50 rounded-xl p-2",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1 py-0.5",children:[n.jsxs("div",{className:"relative flex h-2 w-2",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent-primary"})]}),n.jsx("span",{className:"type-data-xs text-text-muted flex-1 truncate",children:e}),s&&n.jsxs("span",{className:"type-data-xs text-text-muted tabular-nums",children:[t,"%"]})]}),n.jsx("div",{className:"mt-1.5 h-1 bg-white/5 rounded-full overflow-hidden",children:s?n.jsx("div",{className:"h-full bg-accent-primary/60 rounded-full transition-all duration-300 ease-out",style:{width:`${t}%`}}):n.jsx("div",{className:"h-full bg-accent-primary/40 rounded-full",style:{width:"100%"}})}),!ee&&n.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 px-1",children:[n.jsx("span",{className:"type-micro text-text-muted",children:"Data:"}),n.jsx("span",{className:"type-data-xs text-accent-primary",children:ne(L)})]})]})})})},oe=()=>n.jsx("nav",{className:"flex-1 px-3 py-4 space-y-1 overflow-y-auto",children:tl.map(e=>{const t=c===e.to;return n.jsxs(g,{to:e.to,onClick:()=>I(!1),onMouseEnter:()=>U(e.to),onMouseLeave:q,className:D("flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-150 min-h-[44px]",t?"bg-accent-primary/15 text-accent-primary":"text-text-muted hover:text-text-primary hover:bg-white/5"),children:[n.jsx(e.icon,{className:D("w-5 h-5 flex-shrink-0",t&&"text-accent-primary")}),n.jsx("span",{className:"type-body-sm font-medium",children:e.name}),"/contacts"===e.to&&P.length>0&&n.jsxs("span",{className:"ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-accent-tertiary/20 text-accent-tertiary",children:[n.jsx(y,{className:"w-3 h-3"}),n.jsx("span",{className:"type-data-xs font-medium",children:P.length})]})]},e.name)})}),ie=()=>n.jsxs("div",{className:"px-3 py-3",children:[n.jsxs("button",{onClick:J,className:"w-full flex items-center justify-between px-3 py-1.5 mb-2 rounded-lg hover:bg-white/5 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(b,{className:"w-5 h-5 text-accent-primary"}),n.jsx("span",{className:"type-data-xs text-text-muted uppercase tracking-wide",children:"Controls"})]}),n.jsx(x,{className:D("w-4 h-4 text-text-muted transition-transform duration-200",F?"rotate-0":"-rotate-90")})]}),n.jsx("div",{className:D("overflow-hidden transition-all duration-300 ease-out",F?"max-h-96 opacity-100":"max-h-0 opacity-0"),children:n.jsxs("div",{className:"control-panel-skeuo",children:[n.jsxs("button",{onClick:K,disabled:R,className:D("control-btn control-btn-primary w-full transition-all duration-300",R&&"opacity-70","success"===O&&"ring-2 ring-accent-success ring-offset-1 ring-offset-transparent","error"===O&&"ring-2 ring-accent-danger ring-offset-1 ring-offset-transparent"),children:[n.jsx(w,{className:D("w-4 h-4",R&&"animate-pulse")}),n.jsx("span",{children:R?"Sending...":"success"===O?"Sent!":"error"===O?"Failed":"Send Advert"})]}),$&&n.jsx("div",{className:"text-accent-danger type-data-xs px-2 py-1 text-center",children:$}),n.jsxs("div",{className:"control-toggle-group",children:[n.jsxs("div",{className:"control-toggle-label",children:[n.jsx("span",{children:"Mode"}),n.jsx("span",{className:D("control-toggle-status","forward"===Y?"text-accent-success":"text-accent-secondary"),children:"forward"===Y?"FWD":"MON"})]}),n.jsx("button",{onClick:X,className:D("control-btn w-full","forward"===Y?"control-btn-success":"control-btn-warning"),children:"forward"===Y?n.jsxs(n.Fragment,{children:[n.jsx(k,{className:"w-4 h-4"}),n.jsx("span",{children:"Forward"})]}):n.jsxs(n.Fragment,{children:[n.jsx(v,{className:"w-4 h-4"}),n.jsx("span",{children:"Monitor"})]})})]}),n.jsxs("div",{className:"control-toggle-group",children:[n.jsxs("div",{className:"control-toggle-label",children:[n.jsx("span",{children:"Duty Cycle"}),n.jsx("span",{className:D("control-toggle-status",V?"text-accent-success":"text-text-muted"),children:V?"ON":"OFF"})]}),n.jsxs("button",{onClick:Q,className:D("control-btn w-full",V?"control-btn-success":"control-btn-neutral"),children:[n.jsx(h,{className:"w-4 h-4"}),n.jsx("span",{children:V?"Enabled":"Disabled"})]})]})]})})]}),re=()=>n.jsxs("div",{className:"mt-auto border-t border-white/5",children:[void 0!==(null==u?void 0:u.uptime_seconds)&&n.jsxs("div",{className:"px-6 py-3 flex items-center gap-3",children:[n.jsx(S,{className:"w-5 h-5 text-text-muted flex-shrink-0"}),n.jsxs("span",{className:"type-data-xs text-text-secondary tabular-nums",children:[Gr(u.uptime_seconds)," uptime"]})]}),n.jsx("div",{className:"px-3 pb-3",children:n.jsx("div",{className:"bg-white/[0.03] rounded-xl p-3",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(C,{className:"w-4 h-4 text-accent-primary"}),n.jsx("span",{className:"type-data-xs text-text-muted",children:"Noise Floor"})]}),n.jsx("span",{className:"type-data text-text-primary tabular-nums",children:null!=G?`${G.toFixed(0)} dBm`:"—"})]})})}),n.jsxs("div",{className:"px-6 py-3 flex items-center gap-3 border-t border-white/5",children:[n.jsx(vr,{showLabel:!0}),(null==u?void 0:u.version)&&n.jsxs("span",{className:"type-data-xs text-text-muted truncate max-w-[140px]",title:`v${u.version}`,children:["v",u.version]})]}),n.jsx("div",{className:"px-3 pb-3",children:n.jsxs("button",{onClick:Z,className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-text-muted hover:text-accent-danger hover:bg-accent-danger/10 transition-all duration-150",children:[n.jsx(T,{className:"w-4 h-4"}),n.jsx("span",{className:"type-body-sm",children:"Sign Out"}),m&&n.jsxs("span",{className:"ml-auto type-data-xs text-text-muted",children:["(",m,")"]})]})})]});return n.jsxs(n.Fragment,{children:[n.jsx("header",{className:"lg:hidden fixed top-0 inset-x-0 z-[10001] h-14 bg-bg-body/70 backdrop-blur-xl border-b border-white/10",children:n.jsxs("div",{className:"flex items-center justify-between h-full px-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(qa,{height:26,className:"block"}),ee&&n.jsx(Cr,{className:"ml-2"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("p",{className:"type-data-xs text-text-muted",children:["v",Ha]}),n.jsx(vr,{}),n.jsx("button",{onClick:()=>I(!N),className:"w-10 h-10 flex items-center justify-center rounded-xl hover:bg-white/5 active:bg-white/10 transition-colors","aria-label":N?"Close menu":"Open menu",children:N?n.jsx(i,{className:"w-5 h-5 text-text-primary"}):n.jsx(r,{className:"w-5 h-5 text-text-primary"})})]})]})}),n.jsx("div",{className:D("lg:hidden fixed inset-0 z-[10002] bg-black/60 backdrop-blur-sm transition-opacity duration-300",N?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>I(!1),"aria-hidden":"true"}),n.jsxs("aside",{className:D("lg:hidden fixed top-0 left-0 z-[10003] w-72 max-w-[85vw] h-full","glass-sidebar","flex flex-col","transform transition-transform duration-300 ease-out",N?"translate-x-0":"-translate-x-full pointer-events-none"),children:[n.jsxs("div",{className:"px-4 py-5 border-b border-white/5",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(qa,{responsive:!0,className:"block"}),n.jsxs("p",{className:"type-data-xs text-text-muted mt-1.5",children:["v",Ha]})]}),oe(),ae(),ie(),re()]}),n.jsxs("aside",{className:"hidden lg:flex flex-col w-64 flex-shrink-0 h-full relative glass-sidebar",children:[n.jsxs("div",{className:"px-5 py-6 border-b border-white/5",children:[n.jsx("h1",{className:"sr-only",children:"pyMC Console"}),n.jsx(qa,{responsive:!0,className:"block"}),n.jsxs("p",{className:"type-data-xs text-text-muted mt-1.5",children:["v",Ha]})]}),oe(),ae(),ie(),re()]})]})}const al=s.memo(function(){const{theme:e}=Wa(),{backgroundImage:t,brightness:a}=e,[o,i]=s.useState(t),[r,l]=s.useState(!1);s.useEffect(()=>{if(t===o)return;if(!t)return void i("");const e=new Image;e.onload=()=>{l(!0),requestAnimationFrame(()=>{i(t),setTimeout(()=>l(!1),300)})},e.onerror=()=>{i(t)},e.src=t},[t,o]);const c=(100-a)/100;return n.jsxs(n.Fragment,{children:[o&&n.jsx("div",{className:"fixed inset-0 -z-20",style:{contain:"paint",willChange:r?"opacity":"auto"},"aria-hidden":"true",children:n.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat transition-opacity duration-300 ease-out",style:{backgroundImage:`url(${o})`,opacity:r?.7:1}})}),n.jsx("div",{className:"fixed inset-0 -z-10 bg-black pointer-events-none transition-opacity duration-200 ease-out",style:{opacity:c,contain:"paint"},"aria-hidden":"true"})]})}),ol=20,il=12,rl=s.createContext(null);function ll({children:e}){const[t,a]=s.useState({content:null,mouseX:0,mouseY:0,visible:!1}),o=s.useRef(null),[i,r]=s.useState({x:0,y:0}),l=s.useCallback((e,t,s)=>{a({content:e,mouseX:t,mouseY:s,visible:!0})},[]),c=s.useCallback(()=>{a(e=>({...e,visible:!1}))},[]),u=s.useCallback((e,t)=>{a(s=>s.visible?{...s,mouseX:e,mouseY:t}:s)},[]);s.useEffect(()=>{if(!t.visible||!o.current)return;const e=o.current.getBoundingClientRect(),{mouseX:s,mouseY:n}=t,a=window.innerWidth,i=window.innerHeight;let l,c;l=s+ol+e.width+il>a?s-ol-e.width:s+ol,l=Math.max(il,Math.min(l,a-e.width-il)),c=n-ol-e.height{c.current&&(clearTimeout(c.current),c.current=null)},h=s.useCallback(t=>{d(),c.current=setTimeout(()=>{u.current=!0,o(e,t.clientX,t.clientY)},a)},[o,e,a]),f=s.useCallback(e=>{u.current&&r(e.clientX,e.clientY)},[r]),p=s.useCallback(()=>{d(),u.current=!1,i()},[i]),m=s.useCallback(()=>{if(d(),!l.current)return;const t=l.current.getBoundingClientRect();c.current=setTimeout(()=>{u.current=!0,o(e,t.left+t.width/2,t.top)},a)},[o,e,a]),g=s.useCallback(()=>{d(),u.current=!1,i()},[i]);return s.useEffect(()=>()=>{d(),u.current&&(u.current=!1,i())},[i]),s.useEffect(()=>{const e=()=>{u.current&&(d(),u.current=!1,i())};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[i]),n.jsx("span",{ref:l,onMouseEnter:h,onMouseMove:f,onMouseLeave:p,onFocus:m,onBlur:g,className:"contents",children:t})}function ul({className:e=""}){return n.jsx("div",{className:`bg-white/5 animate-pulse rounded-lg ${e}`,"aria-hidden":"true"})}function dl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-48"}),n.jsx(ul,{className:"h-8 w-32"})]}),n.jsx(ul,{className:"h-72"}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 gap-3",children:Array.from({length:8}).map((e,t)=>n.jsx(ul,{className:"h-24"},t))}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4}).map((e,t)=>n.jsx(ul,{className:"h-44"},t))}),n.jsx(ul,{className:"h-96"})]})}function hl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading list",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-40"}),n.jsx(ul,{className:"h-8 w-24"})]}),n.jsx(ul,{className:"h-20"}),n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsx(ul,{className:"h-10 rounded-none"}),n.jsx("div",{className:"divide-y divide-border-subtle/30",children:Array.from({length:10}).map((e,t)=>n.jsx("div",{className:"px-4 py-3",children:n.jsx(ul,{className:"h-6"})},t))})]})]})}function fl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading map",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-32"}),n.jsx(ul,{className:"h-6 w-48"})]}),n.jsx(ul,{className:"h-[500px]"}),n.jsx(ul,{className:"h-64"})]})}function pl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading charts",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(ul,{className:"h-8 w-36"}),n.jsx(ul,{className:"h-8 w-40"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[n.jsx(ul,{className:"h-80"}),n.jsx(ul,{className:"h-80"})]}),n.jsx(ul,{className:"h-64"})]})}function ml(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading settings",children:[n.jsx(ul,{className:"h-8 w-32"}),n.jsxs("div",{className:"space-y-6",children:[n.jsx(ul,{className:"h-48"}),n.jsx(ul,{className:"h-64"}),n.jsx(ul,{className:"h-32"})]})]})}function gl(){return n.jsxs("div",{className:"section-gap","aria-label":"Loading system info",children:[n.jsx(ul,{className:"h-8 w-28"}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:4}).map((e,t)=>n.jsx(ul,{className:"h-28"},t))}),n.jsx(ul,{className:"h-64"}),n.jsx(ul,{className:"h-48"})]})}const yl=s.lazy(()=>N(()=>import("./Login-DW1MXg6s.js"),__vite__mapDeps([0,1,2]))),bl=s.lazy(()=>N(()=>import("./Dashboard-I4-zVbBf.js"),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11]))),xl=s.lazy(()=>N(()=>import("./Packets-KLe38miu.js"),__vite__mapDeps([12,1,2,6,7,8,5]))),wl=s.lazy(()=>N(()=>import("./Contacts-DVK_9PWN.js").then(e=>e.C),__vite__mapDeps([13,1,2,5,8,7,14,15,16]))),kl=s.lazy(()=>N(()=>import("./Statistics-GNsxMYwC.js"),__vite__mapDeps([17,1,2,18,4,9,5,14,11,16]))),vl=s.lazy(()=>N(()=>import("./System-fGLn0Map.js"),__vite__mapDeps([19,1,2,4,5,11]))),Sl=s.lazy(()=>N(()=>import("./Logs-CFPI4LFW.js"),__vite__mapDeps([20,1,2,18,5]))),Cl=s.lazy(()=>N(()=>import("./Terminal-CKEpJ-hg.js"),__vite__mapDeps([21,1,2,5]))),Tl=s.lazy(()=>N(()=>import("./Configuration-Dh8yao9Z.js"),__vite__mapDeps([22,1,2,8,15,5,11])));function Ml({children:e}){const t=o();return fo()?n.jsx(n.Fragment,{children:e}):n.jsx(j,{to:"/login",state:{from:t},replace:!0})}class _l extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){var e;return this.state.hasError?n.jsxs("div",{className:"glass-card p-8 text-center",children:[n.jsx("p",{className:"type-subheading text-accent-red mb-2",children:"Page failed to render"}),n.jsx("p",{className:"type-body text-white/50 mb-4",children:(null==(e=this.state.error)?void 0:e.message)||"Unknown error"}),n.jsx("button",{onClick:()=>this.setState({hasError:!1}),className:"px-4 py-2 bg-accent-primary/20 text-accent-primary rounded-lg hover:bg-accent-primary/30 transition-colors",children:"Try Again"})]}):this.props.children}}function Ll(){const e=Qi(e=>e.initializeApp),t=fo();return s.useEffect(()=>{if(!t)return;e();const s=setInterval(()=>{vo()},3e4);return vo(),To(),()=>clearInterval(s)},[e,t]),n.jsxs(ll,{children:[n.jsx(al,{}),n.jsxs(_,{children:[n.jsx(L,{path:"/login",element:n.jsx(s.Suspense,{fallback:n.jsx("div",{className:"min-h-screen bg-bg-body"}),children:n.jsx(yl,{})})}),n.jsx(L,{path:"/*",element:n.jsx(Ml,{children:n.jsxs("div",{className:"flex h-screen overflow-hidden",children:[n.jsx(nl,{}),n.jsx("main",{className:"flex-1 w-full min-w-0 pt-14 lg:pt-0 overflow-y-auto",children:n.jsx("div",{className:"px-4 sm:px-6 lg:px-8 pt-5 pb-4 sm:pb-6 lg:pb-8 max-w-7xl mx-auto",children:n.jsx(_l,{children:n.jsxs(_,{children:[n.jsx(L,{path:"/",element:n.jsx(s.Suspense,{fallback:n.jsx(dl,{}),children:n.jsx(bl,{})})}),n.jsx(L,{path:"/packets",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(xl,{})})}),n.jsx(L,{path:"/contacts",element:n.jsx(s.Suspense,{fallback:n.jsx(fl,{}),children:n.jsx(wl,{})})}),n.jsx(L,{path:"/statistics",element:n.jsx(s.Suspense,{fallback:n.jsx(pl,{}),children:n.jsx(kl,{})})}),n.jsx(L,{path:"/system",element:n.jsx(s.Suspense,{fallback:n.jsx(gl,{}),children:n.jsx(vl,{})})}),n.jsx(L,{path:"/logs",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(Sl,{})})}),n.jsx(L,{path:"/terminal",element:n.jsx(s.Suspense,{fallback:n.jsx(hl,{}),children:n.jsx(Cl,{})})}),n.jsx(L,{path:"/configuration",element:n.jsx(s.Suspense,{fallback:n.jsx(ml,{}),children:n.jsx(Tl,{})})})]})})})})]})})})]})]})}const jl=console.warn;console.warn=(...e)=>{const t=e[0];"string"==typeof t&&t.includes("width")&&t.includes("height")&&t.includes("chart should be greater than 0")||jl.apply(console,e)},E.createRoot(document.getElementById("root")).render(n.jsx(s.StrictMode,{children:n.jsx($a,{children:n.jsx(P,{children:n.jsx(Ll,{})})})}));export{Wa as $,Ur as A,Kr as B,Br as C,Si as D,qr as E,Mi as F,el as G,jr as H,Mr as I,Wr as J,Zi as K,hr as L,Nr as M,Dr as N,Yo as O,qa as P,Yr as Q,Ga as R,Xa as S,cl as T,Qa as U,Fa as V,R as W,A as X,re as Y,Ya as Z,za as _,nr as a,$r as a0,Hr as a1,Jr as a2,Ci as a3,Ti as a4,cr as a5,ur as a6,Io as a7,_i as a8,ar as a9,Va as aA,Pr as aB,pr as aC,gr as aD,xi as aE,or as aa,rr as ab,Wo as ac,ji as ad,Po as ae,Fo as af,Ao as ag,Ro as ah,$o as ai,be as aj,Ce as ak,Qo as al,Ho as am,Qr as an,Zr as ao,Vo as ap,Ko as aq,Xo as ar,Zo as as,ei as at,Go as au,Uo as av,qo as aw,Jo as ax,ri as ay,ki as az,ir as b,er as c,wi as d,mr as e,dr as f,io as g,br as h,fo as i,Do as j,yr as k,xo as l,tr as m,wr as n,xr as o,fr as p,Bo as q,lr as r,ro as s,Ja as t,sr as u,Vr as v,Xr as w,vi as x,Or as y,Ir as z}; diff --git a/frontend/dist/assets/link-scoring-lk0Wk34S.js b/frontend/dist/assets/link-scoring-y9pf-GTv.js similarity index 73% rename from frontend/dist/assets/link-scoring-lk0Wk34S.js rename to frontend/dist/assets/link-scoring-y9pf-GTv.js index 59c18d3b..3af7d727 100644 --- a/frontend/dist/assets/link-scoring-lk0Wk34S.js +++ b/frontend/dist/assets/link-scoring-y9pf-GTv.js @@ -1 +1 @@ -import{e as t,aB as e}from"./index-wYLFmyyS.js";function o(t){if(Array.isArray(t))return t;if("string"==typeof t&&t.startsWith("["))try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return[]}function n(n,r,s){const a=new Map;for(const e of r){const o=t(e);a.has(o)||a.set(o,e)}const c=new Map,i=new Map;for(const t of n){const n=t.route??t.route_type;if(!e(n))continue;const r=o(t.original_path);if(0===r.length)continue;const f=r.map(t=>t.toUpperCase());if(!t.transmitted&&f.length>=2){const t=f[f.length-2];if(t){const e=a.get(t);e&&i.set(e,(i.get(e)??0)+1)}}if(f.includes(s))for(const t of f){if(t===s)continue;const e=a.get(t);e&&c.set(e,(c.get(e)??0)+1)}}let f=0,u=0;for(const t of r)f=Math.max(f,c.get(t)??0),u=Math.max(u,i.get(t)??0);const h=new Map;let g=0,l=0,p=0;for(const t of r){const e=c.get(t)??0,o=i.get(t)??0,n=f>0?Math.round(e/f*100):0,r=u>0?Math.round(o/u*100):0,s=n+r;h.set(t,{hash:t,listenerCount:e,loudCount:o,listenerScore:n,loudScore:r,blendedScore:s}),g=Math.max(g,n),l=Math.max(l,r),p=Math.max(p,s)}return{scores:h,maxListenerScore:g,maxLoudScore:l,maxBlendedScore:p}}const r={YELLOW:"#FBBF24",GREEN:"#719872",RED:"#E12672",GRAY:"#505050"};export{r as L,n as c}; +import{d as t,aA as e}from"./index-DrUSC4Ks.js";function o(t){if(Array.isArray(t))return t;if("string"==typeof t&&t.startsWith("["))try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return[]}function n(n,r,s){const a=new Map;for(const e of r){const o=t(e);a.has(o)||a.set(o,e)}const c=new Map,i=new Map;for(const t of n){const n=t.route??t.route_type;if(!e(n))continue;const r=o(t.original_path);if(0===r.length)continue;const f=r.map(t=>t.toUpperCase());if(!t.transmitted&&f.length>=2){const t=f[f.length-2];if(t){const e=a.get(t);e&&i.set(e,(i.get(e)??0)+1)}}if(f.includes(s))for(const t of f){if(t===s)continue;const e=a.get(t);e&&c.set(e,(c.get(e)??0)+1)}}let f=0,u=0;for(const t of r)f=Math.max(f,c.get(t)??0),u=Math.max(u,i.get(t)??0);const h=new Map;let d=0,g=0,l=0;for(const t of r){const e=c.get(t)??0,o=i.get(t)??0,n=f>0?Math.round(e/f*100):0,r=u>0?Math.round(o/u*100):0,s=n+r;h.set(t,{hash:t,listenerCount:e,loudCount:o,listenerScore:n,loudScore:r,blendedScore:s}),d=Math.max(d,n),g=Math.max(g,r),l=Math.max(l,s)}return{scores:h,maxListenerScore:d,maxLoudScore:g,maxBlendedScore:l}}const r={YELLOW:"#FBBF24",GREEN:"#719872",RED:"#E12672",GRAY:"#505050"};export{r as L,n as c}; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index cf988863..04c04f90 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -39,10 +39,10 @@ --font-data: 'JetBrains Mono', 'SF Mono', Monaco, monospace; } - + - +
diff --git a/frontend/package.json b/frontend/package.json index 90cae770..9679a89a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "pymc_console", - "version": "0.9.153", + "version": "0.9.154", "description": "Vite + React Dashboard for pyMC_Repeater", "private": true, "type": "module",