ocearo-ui 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/404.html +1 -1
  2. package/README.fr.md +23 -3
  3. package/README.md +23 -3
  4. package/__next.__PAGE__.txt +3 -3
  5. package/__next._full.txt +3 -3
  6. package/__next._tree.txt +2 -2
  7. package/_next/static/chunks/0-jqvc-r0kh0c.js +1 -0
  8. package/_next/static/chunks/{2g-xpe7xnropn.js → 05do10p9ldt1p.js} +1 -1
  9. package/_next/static/chunks/07gn9z0d6clzs.js +1 -0
  10. package/_next/static/chunks/{2w44atvyp9o_w.js → 096zaxs1gf_3q.js} +2 -1
  11. package/_next/static/chunks/0b3cus8izqkmg.js +119 -0
  12. package/_next/static/chunks/0j11dppxb9l0b.js +1 -0
  13. package/_next/static/chunks/0jucaltuccn03.js +1 -0
  14. package/_next/static/chunks/{1gt2hhqk1821k.js → 0zvzu5fnwh4_a.js} +3 -3
  15. package/_next/static/chunks/1_g85m2d7jjpo.css +3 -0
  16. package/_next/static/chunks/1arvue9o-atui.js +739 -0
  17. package/_next/static/chunks/1bo0ke8gjc1c2.js +1 -0
  18. package/_next/static/chunks/1cp1kkarm5gxz.js +1 -0
  19. package/_next/static/chunks/1e-w_-usen7fy.js +3 -0
  20. package/_next/static/chunks/1hz_mzl8l35j8.js +1 -0
  21. package/_next/static/chunks/1k72cpd0x8veh.js +1 -0
  22. package/_next/static/chunks/1mtfh1vqpvit2.js +1 -0
  23. package/_next/static/chunks/1u6o5_s2b39xh.js +1 -0
  24. package/_next/static/chunks/{1exvcc71cgr4t.js → 2aivnrnff0avu.js} +1 -1
  25. package/_next/static/chunks/2fe99e03gnvg9.js +1 -0
  26. package/_next/static/chunks/{3nm7o0eq5abhg.js → 2fthh9f57zzm2.js} +1 -1
  27. package/_next/static/chunks/{0jfox92up1jvy.js → 2gr1d26f-ymoh.js} +1 -1
  28. package/_next/static/chunks/2r98jty3a4wel.js +564 -0
  29. package/_next/static/chunks/2v6ebsavxlgyw.js +1 -0
  30. package/_next/static/chunks/{1w1xks0hp_tlr.js → 33u782y6vhw-f.js} +9 -9
  31. package/_next/static/chunks/3qik_nv7zlj4e.js +1 -0
  32. package/_next/static/chunks/3qzb9nvvw-b-k.js +1 -0
  33. package/_next/static/chunks/41mro59si-xxc.js +1 -0
  34. package/_next/static/chunks/41odv061mfm6t.js +1 -0
  35. package/_not-found/__next._full.txt +2 -2
  36. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  37. package/_not-found/__next._tree.txt +2 -2
  38. package/_not-found.html +1 -1
  39. package/_not-found.txt +2 -2
  40. package/docs/index.json +10 -5
  41. package/docs/signalk-server.html +3751 -0
  42. package/docs/signalk-specification.html +8507 -0
  43. package/guide/anchor.jpg +0 -0
  44. package/guide/bathymetry.jpg +0 -0
  45. package/guide/dashboard.jpg +0 -0
  46. package/guide/hero.jpg +0 -0
  47. package/guide/logbook.jpg +0 -0
  48. package/guide/mob.jpg +0 -0
  49. package/guide/parking.jpg +0 -0
  50. package/guide/polars.jpg +0 -0
  51. package/guide/traffic.jpg +0 -0
  52. package/guide/weather.jpg +0 -0
  53. package/index.html +1 -1
  54. package/index.txt +3 -3
  55. package/package.json +5 -7
  56. package/settings/__next._full.txt +3 -3
  57. package/settings/__next._tree.txt +2 -2
  58. package/settings/__next.settings.__PAGE__.txt +3 -3
  59. package/settings.html +1 -1
  60. package/settings.txt +3 -3
  61. package/_next/static/chunks/0iqdztntvxh3c.js +0 -119
  62. package/_next/static/chunks/0iztd835j5p1n.js +0 -700
  63. package/_next/static/chunks/0voiofm58khqd.js +0 -1
  64. package/_next/static/chunks/0w_skktmh3e48.js +0 -1
  65. package/_next/static/chunks/0zwc9m4qgtwle.js +0 -1
  66. package/_next/static/chunks/144mjqdrx42lq.js +0 -1
  67. package/_next/static/chunks/1ed7ayfg19cjb.js +0 -1
  68. package/_next/static/chunks/1epya-yh2wvj2.js +0 -1
  69. package/_next/static/chunks/1gq4t2dyr7rq3.js +0 -1
  70. package/_next/static/chunks/1ptj3mv8b_tzs.js +0 -1
  71. package/_next/static/chunks/1y35unwvy8p98.js +0 -1
  72. package/_next/static/chunks/1zm03hw2ylxw8.js +0 -1
  73. package/_next/static/chunks/2aq8orcir5h03.js +0 -1
  74. package/_next/static/chunks/2kmptoy43h0mx.js +0 -1
  75. package/_next/static/chunks/2kwn4iymxaom3.js +0 -1
  76. package/_next/static/chunks/2rebcvig176xk.js +0 -564
  77. package/_next/static/chunks/2ryo_bbmt6t74.css +0 -3
  78. package/_next/static/chunks/3--qzv1u6c7_7.js +0 -1
  79. package/_next/static/chunks/37t6vg8fb1-z8.js +0 -1
  80. package/_next/static/chunks/3p9ziqn6r35qf.js +0 -1
  81. package/_next/static/chunks/3q8o52_juxmdp.js +0 -1
  82. package/docs/opencpn.pdf +0 -0
  83. package/docs/signalk.pdf +0 -0
  84. /package/_next/static/{01VWnAYjs9QwBnnMyWbQF → EuchA2ImhjrwCnR5WjCLX}/_buildManifest.js +0 -0
  85. /package/_next/static/{01VWnAYjs9QwBnnMyWbQF → EuchA2ImhjrwCnR5WjCLX}/_clientMiddlewareManifest.js +0 -0
  86. /package/_next/static/{01VWnAYjs9QwBnnMyWbQF → EuchA2ImhjrwCnR5WjCLX}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44651,e=>{"use strict";var t=e.i(43476),i=e.i(71645);e.i(85269);var l=e.i(22831),n=e.i(85709),s=e.i(46991),r=e.i(14922),a=e.i(37917);let o=["environment.depth.belowKeel","environment.depth.belowTransducer","environment.depth.belowSurface"];e.s(["default",0,()=>{let{t:e}=(0,l.useTranslation)(),d=(0,n.useSignalKPaths)(o),c=d["environment.depth.belowKeel"]??d["environment.depth.belowTransducer"]??d["environment.depth.belowSurface"],h=(0,i.useRef)(c),[u,m]=(0,i.useState)([]);if((0,i.useEffect)(()=>{h.current=c},[c]),(0,i.useEffect)(()=>{let e=setInterval(()=>{let e=h.current;Number.isFinite(e)&&m(t=>[...t.slice(-119),e])},5e3);return()=>clearInterval(e)},[]),!Number.isFinite(c))return null;let x=u.slice(-12),f=x.length>=2?(x[x.length-1]-x[0])/((x.length-1)*5e3/6e4):null,v=c<3;return(0,t.jsxs)(r.default,{title:e("hud.depth"),className:"w-[17rem]",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:`text-value font-semibold ${v?"text-oRed":"text-hud-main"}`,children:(0,s.convertDepthUnit)(c)?.toFixed(1)}),(0,t.jsx)("span",{className:"text-caption text-hud-secondary",children:(0,s.getDepthUnitLabel)()}),Number.isFinite(f)&&Math.abs(f)>=.05&&(0,t.jsxs)("span",{className:`text-caption font-semibold ${f<0?"text-oYellow":"text-hud-secondary"}`,children:[f<0?"▲":"▼"," ",Math.abs(f).toFixed(1)," m/min"]})]}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(a.default,{values:u,width:240,height:48,invert:!0,endDot:!0,color:v?"var(--color-oRed)":"var(--color-oBlue)"})}),(0,t.jsx)("div",{className:"text-caption text-hud-muted mt-1",children:e("hud.depthHistory")})]})}])},41994,function(e){e.n(e.i(44651))},14922,37917,e=>{"use strict";var t=e.i(43476);e.i(71645),e.s(["default",0,({title:e,right:i,className:l="",children:n})=>(0,t.jsxs)("div",{className:`hud-halo px-1 py-1 select-none ${l}`,children:[(e||i)&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted",children:e}),i]}),n]})],14922),e.s(["default",0,({values:e,width:i=240,height:l=60,color:n="var(--color-oBlue)",marker:s=null,endDot:r=!1,invert:a=!1})=>{let o=e.filter(Number.isFinite);if(o.length<2)return(0,t.jsx)("svg",{width:i,height:l});let d=Math.min(...o),c=Math.max(...o)-d||1,h=i/(e.length-1),u=e=>(a?(e-d)/c:1-(e-d)/c)*(l-8)+4,m="";e.forEach((e,t)=>{Number.isFinite(e)&&(m+=`${m?"L":"M"}${(t*h).toFixed(1)},${u(e).toFixed(1)}`)});let x=`${m}L${i},${a?0:l}L0,${a?0:l}Z`,f=null;if(null!==s){let t=s*(e.length-1),l=Math.min(e.length-2,Math.floor(t)),n=e[l],r=e[l+1];Number.isFinite(n)&&Number.isFinite(r)&&(f={x:s*i,y:u(n+(r-n)*(t-l))})}let v=e[e.length-1];return(0,t.jsxs)("svg",{width:i,height:l,className:"block overflow-visible",children:[(0,t.jsx)("path",{d:x,fill:n,opacity:"0.12"}),(0,t.jsx)("path",{d:m,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round"}),null!==s&&(0,t.jsx)("line",{x1:s*i,x2:s*i,y1:"0",y2:l,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),f&&(0,t.jsx)("circle",{cx:f.x,cy:f.y,r:"4",fill:n,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),r&&Number.isFinite(v)&&(0,t.jsx)("circle",{cx:i,cy:u(v),r:"3.5",fill:n})]})}],37917)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87628,e=>{"use strict";var t=e.i(43476),s=e.i(71645);e.i(85269);var a=e.i(22831),r=e.i(49721),l=e.i(68757),n=e.i(85709),d=e.i(3950),i=e.i(71415),c=e.i(3666),o=e.i(48390);let u=[5,10,20],h=({shom:e,t:s})=>{let a=new Map((e.jobs||[]).map(e=>[e.id,e])),r=(e.available||[]).filter(e=>"coastal"===e.kind||e.installed);for(let t of e.regions||[])r.some(e=>e.id===t.id)||r.push({id:t.id,name:t.name,resolutionM:t.resolutionM,installed:!0});return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-secondary",children:s("offline.shomTitle")}),0===r.length&&(0,t.jsx)("div",{className:"text-caption text-hud-muted",children:s("offline.shomNone")}),r.map(e=>{let r=a.get(e.id),l=e.installed?s("offline.shom_done"):r?"downloading"===r.state&&r.total?s("offline.shomDownloading",{pct:Math.round(r.received/r.total*100)}):s(`offline.shom_${r.state}`,{error:r.error}):s("offline.shomAvailable");return(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-caption",children:[(0,t.jsxs)("span",{className:"text-hud-main truncate",children:[e.name,Number.isFinite(e.resolutionM)&&(0,t.jsxs)("span",{className:"text-hud-muted tabular-nums",children:[" · ",e.resolutionM," m"]})]}),(0,t.jsx)("span",{className:`shrink-0 tabular-nums ${e.installed?"text-oGreen":r?.state==="error"?"text-oRed":"text-hud-muted"}`,children:l})]},e.id)}),null===e.sevenZip&&(0,t.jsx)("div",{className:"text-caption text-oYellow",children:s("offline.shomNo7z")}),(0,t.jsx)("div",{className:"text-caption text-hud-muted",children:s("offline.shomCredit")})]})},p=()=>{let{t:e}=(0,a.useTranslation)(),p=(0,n.useSignalKPath)("navigation.position"),[m,x]=(0,s.useState)(10),[b,g]=(0,s.useState)(null),[f,j]=(0,s.useState)(null),[N,v]=(0,s.useState)(null),y=(0,s.useCallback)(()=>{(0,d.offlineCacheSize)().then(j).catch(()=>{})},[]);(0,s.useEffect)(()=>{y()},[y]);let w=(0,s.useCallback)(()=>{(0,o.isOcearoCoreEnabled)()&&(0,o.getBathymetryStatus)().then(v).catch(()=>v(null))},[]);(0,s.useEffect)(()=>{w()},[w]);let k=N?.jobs?.some(e=>!["done","error"].includes(e.state));(0,s.useEffect)(()=>{if(!k)return;let e=setInterval(w,2e3);return()=>clearInterval(e)},[k,w]);let B=async()=>{if(!Number.isFinite(p?.latitude))return;let{latitude:e,longitude:t}=p;g({done:0,total:0,failed:0}),N&&(0,o.downloadBathymetry)(e,t,m).then(w).catch(()=>{});let s=await (0,d.prefetchArea)({lat:e,lon:t,radiusM:1852*m,layers:[{template:i.TERRARIUM,zooms:[i.BATHY_ZOOM-1,i.BATHY_ZOOM]}],urls:[(0,c.windFieldUrl)(Number(e.toFixed(1)),Number(t.toFixed(1)))],onProgress:(e,t,s)=>g({done:e,total:t,failed:s})});g({...s,finished:!0}),y()},C=async()=>{await (0,d.clearOfflineCache)(),g(null),y()},S=b&&!b.finished;return(0,t.jsxs)("section",{className:"tesla-card space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:e("offline.title")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsx)("p",{className:"text-caption text-hud-secondary max-w-prose",children:e("offline.explain")}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)("div",{className:"flex rounded-xl bg-hud-bg p-1",children:u.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>x(e),className:`px-3 py-1.5 rounded-lg text-caption font-semibold ${m===e?"bg-oBlue text-white":"text-hud-secondary"}`,children:[e," NM"]},e))}),(0,t.jsxs)("button",{type:"button",onClick:B,disabled:S||!Number.isFinite(p?.latitude),className:"bg-oBlue hover:bg-oBlue/80 text-white px-4 py-2 rounded-xl text-caption font-semibold uppercase flex items-center gap-2 disabled:opacity-50",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:l.faCloudArrowDown}),e("offline.download")]}),(0,t.jsxs)("button",{type:"button",onClick:C,disabled:S,className:"text-hud-secondary hover:text-hud-main px-3 py-2 rounded-xl text-caption font-semibold uppercase flex items-center gap-2 disabled:opacity-50",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:l.faTrash}),e("offline.clear")]}),Number.isFinite(f)&&(0,t.jsx)("span",{className:"text-caption text-hud-muted tabular-nums",children:e("offline.used",{mb:(f/1e6).toFixed(0)})})]}),N&&(0,t.jsx)(h,{shom:N,t:e}),b&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"h-1.5 rounded-full bg-hud-bg overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-oBlue transition-all",style:{width:`${b.total?b.done/b.total*100:0}%`}})}),(0,t.jsx)("div",{className:"text-caption text-hud-muted tabular-nums",children:b.finished?e("offline.finished",{count:b.done-b.failed,failed:b.failed}):e("offline.progress",{done:b.done,total:b.total})})]})]})};var m=e.i(46932),x=e.i(83402),b=e.i(18638),g=e.i(58567),f=e.i(67561),j=e.i(18850);let N=({color:e})=>(0,t.jsx)("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${e} animate-pulse ml-2 shrink-0`});e.s(["default",0,({onSave:e})=>{let{t:r,i18n:l}=(0,a.useTranslation)(),{themeMode:n,setTheme:d}=(0,f.useOcearoContext)(),i=x.default.getAll(),c=x.default.getComputedSignalKUrl(),o=x.default.getBoatsData(),[u,h]=(0,s.useState)(i),[v,y]=(0,s.useState)(i.useAuthentication||!!i.username||!!i.password),[w,k]=(0,s.useState)(i.signalKUrlSet||!1),[B,C]=(0,s.useState)(null),[S,U]=(0,s.useState)({visible:!1,message:""}),[T,A]=(0,s.useState)("system");(0,s.useEffect)(()=>{(async()=>{let e=x.default.getAll();h(e),k(e.signalKUrlSet||!1),y(e.useAuthentication||!!e.username||!!e.password),e.selectedBoat&&C(o.find(t=>t.name===e.selectedBoat)||null)})()},[o]);let M=t=>{let s={...u,...t};h(s);let a={...s};t.theme&&t.theme!==n&&d(t.theme),t.hasOwnProperty("signalKUrlSet")?!1===t.signalKUrlSet&&(a.signalkUrl=c,a.username="",a.password="",a.useAuthentication=!1):w||t.hasOwnProperty("signalkUrl")||(a.signalkUrl=c,a.username="",a.password=""),t.hasOwnProperty("useAuthentication")&&(a.useAuthentication=t.useAuthentication,t.useAuthentication||(a.username="",a.password="")),x.default.saveConfig(a),e?.(a),U({visible:!0,message:r("settings.savedAuto")}),setTimeout(()=>U({visible:!1,message:""}),2e3)};return(0,t.jsxs)("div",{className:"p-8 text-hud-main w-full relative",children:[(0,t.jsxs)("header",{className:"mb-10 flex justify-between items-start sm:items-center relative min-h-[4rem]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-value font-semibold uppercase tracking-tight mb-1",children:r("settings.title")}),(0,t.jsx)("p",{className:"text-hud-secondary text-label font-medium uppercase tracking-widest",children:r("settings.subtitle")})]}),S.visible&&(0,t.jsx)(m.motion.span,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"absolute right-0 top-0 sm:relative text-caption font-semibold bg-oGreen/20 text-oGreen border border-oGreen/30 px-4 py-2 rounded-full uppercase tracking-widest whitespace-nowrap",children:S.message})]}),(0,t.jsxs)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud mb-8",children:[(0,t.jsx)("button",{onClick:()=>A("system"),className:`flex-1 py-3 px-6 text-caption font-semibold uppercase tracking-widest transition-all rounded-lg ${"system"===T?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:r("settings.tabSystem")}),(0,t.jsx)("button",{onClick:()=>A("interface"),className:`flex-1 py-3 px-6 text-caption font-semibold uppercase tracking-widest transition-all rounded-lg ${"interface"===T?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:r("settings.tabInterface")})]}),(0,t.jsx)("div",{className:"space-y-8",children:"system"===T?(0,t.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,t.jsx)(p,{}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.connection")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,t.jsxs)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[r("settings.signalkServer"),!w&&(0,t.jsx)(N,{color:"bg-oBlue"})]}),(0,t.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:w,onChange:e=>{k(e.target.checked),M({signalKUrlSet:e.target.checked})}}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),!w&&(0,t.jsxs)("div",{className:"p-4 rounded-xl bg-hud-bg border border-hud",children:[(0,t.jsx)("span",{className:"text-caption font-bold uppercase tracking-widest text-hud-muted block mb-1",children:r("settings.detectedUrl")}),(0,t.jsx)("span",{className:"text-label font-mono text-oBlue",children:c})]})]}),w&&(0,t.jsxs)(m.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.customEndpoint")}),(0,t.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:"https://your-signalk-server.local",value:u.signalkUrl||"",onChange:e=>M({signalkUrl:e.target.value})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,t.jsxs)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[r("settings.authentication"),w&&!v&&(0,t.jsx)(N,{color:"bg-oBlue"})]}),(0,t.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:v,onChange:e=>{y(e.target.checked),M({useAuthentication:e.target.checked})}}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),v&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.username")}),(0,t.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:u.username||"",onChange:e=>M({username:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.password")}),(0,t.jsx)("input",{type:"password",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:u.password||"",onChange:e=>M({password:e.target.value})})]})]})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.vessel")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.activeProfile")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.selectedBoat||"",onChange:e=>{let t=e.target.value;C(o.find(e=>e.name===t)||null),M({selectedBoat:t,boatChosen:!0})},children:[(0,t.jsx)("option",{value:"",className:"bg-hud-bg",children:r("settings.selectVessel")}),o.map(e=>(0,t.jsx)("option",{value:e.name,className:"bg-hud-bg",children:e.name},e.name))]})]}),B&&(0,t.jsxs)("div",{className:"p-4 rounded-xl bg-oBlue/10 border border-oBlue/20 space-y-1",children:[(0,t.jsx)("div",{className:"text-caption font-semibold uppercase tracking-widest text-oBlue mb-2",children:r("settings.specifications")}),(0,t.jsxs)("div",{className:"text-label font-medium",children:[r("settings.model"),": ",(0,t.jsx)("span",{className:"text-hud-main",children:B.modelPath})]}),(0,t.jsxs)("div",{className:"text-label font-medium",children:[r("settings.capabilities"),": ",(0,t.jsx)("span",{className:"text-hud-main",children:B.capabilities?.join(", ")})]})]})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.advanced")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[r("settings.debugMode"),u.debugMode&&(0,t.jsx)(N,{color:"bg-oYellow"})]}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:r("settings.debugModeDesc")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.debugMode||!1,onChange:e=>{let t={debugMode:e.target.checked};!w&&e.target.checked&&(t.signalkUrl="https://demo.signalk.org:443"),M(t)}}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,t.jsxs)("section",{className:"tesla-card border-oRed/10",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-oRed/80",children:r("settings.critical")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-oRed/5 mx-4"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-oRed/5 border border-oRed/10",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-oRed/80",children:r("settings.factoryReset")}),(0,t.jsx)("p",{className:"text-caption text-oRed/40 font-medium uppercase tracking-wider",children:r("settings.factoryResetDesc")})]}),(0,t.jsx)("button",{onClick:()=>{let e=x.default.getDefaultConfig();h(e),y(!1),e.useAuthentication=!1,k(!1),e.signalKUrlSet=!1,e.showCustomUrls=!1,e.customExternalUrls={},e.theme&&d(e.theme),e.language&&l.changeLanguage(e.language),x.default.saveConfig(e)},className:"bg-oRed/20 text-oRed border border-oRed/30 px-6 py-2 rounded-xl text-caption font-semibold uppercase tracking-widest hover:bg-oRed hover:text-hud-main transition-all duration-300 shadow-lg shadow-oRed/10",children:r("common.reset")})]})]})]}):(0,t.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.appearance")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.themeMode")}),(0,t.jsx)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud",children:b.THEME_MODES.map(e=>(0,t.jsx)("button",{onClick:()=>M({theme:e}),className:`flex-1 py-3 px-4 rounded-lg text-caption font-semibold uppercase tracking-widest transition-all ${n===e?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:"auto"===e?r("settings.themeAuto"):r(`toolbar.theme_${e}`).replace(/ \(.*\)$/,"")},e))})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.renderQuality")}),(0,t.jsx)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud",children:g.RENDER_QUALITIES.map(e=>(0,t.jsx)("button",{onClick:()=>M({renderQuality:e}),className:`flex-1 py-3 px-4 rounded-lg text-caption font-semibold uppercase tracking-widest transition-all ${(u.renderQuality||"auto")===e?"bg-oBlue/15 text-oBlue border border-oBlue/40":"text-hud-secondary hover:text-hud-main"}`,children:r(`settings.renderQuality_${e}`)},e))}),(0,t.jsx)("p",{className:"text-caption text-hud-muted ml-1",children:r("settings.renderQualityHint")})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.hudStyle")}),(0,t.jsx)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud",children:["minimal","classic"].map(e=>(0,t.jsx)("button",{onClick:()=>M({hudStyle:e}),className:`flex-1 py-3 px-4 rounded-lg text-caption font-semibold uppercase tracking-widest transition-all ${(u.hudStyle||"minimal")===e?"bg-oBlue/15 text-oBlue border border-oBlue/40":"text-hud-secondary hover:text-hud-main"}`,children:r(`settings.hudStyle_${e}`)},e))})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.uiAccents")}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover self-end h-[60px]",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.metallic")}),(0,t.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.metallicEffect||!1,onChange:e=>M({metallicEffect:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),(0,t.jsxs)("div",{className:"p-2 rounded-xl bg-hud-bg border border-hud flex items-center space-x-4",children:[(0,t.jsx)("input",{type:"color",className:"w-12 h-10 bg-transparent cursor-pointer rounded overflow-hidden border-none",value:u.primaryColor||"#09bfff",onChange:e=>M({primaryColor:e.target.value})}),(0,t.jsx)("span",{className:"text-caption font-mono uppercase text-hud-main/60",children:u.primaryColor||"#09bfff"})]})]})]})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.language")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.languageDesc")}),(0,t.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-1 bg-hud-bg p-1 rounded-xl border border-hud",children:j.SUPPORTED_LANGUAGES.map(e=>(0,t.jsxs)("button",{onClick:()=>{l.changeLanguage(e.code),M({language:e.code})},className:`py-3 px-2 rounded-lg text-caption font-semibold uppercase tracking-widest transition-all flex items-center justify-center space-x-2 ${(u.language||"en")===e.code?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:[(0,t.jsx)("span",{children:e.flag}),(0,t.jsx)("span",{children:e.label})]},e.code))})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.navigationHud")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.compassOrientation")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:u.compassNorthUp?r("settings.northAtTop"):r("settings.northAtBottom")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.compassNorthUp||!1,onChange:e=>M({compassNorthUp:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.hide3DCompass")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:u.hide3DCompass?r("settings.hidden"):r("settings.visible")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.hide3DCompass||!1,onChange:e=>M({hide3DCompass:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.hideTrueWind")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:u.hideTrueWind?r("settings.hidden"):r("settings.visible")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.hideTrueWind||!1,onChange:e=>M({hideTrueWind:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.attitudeIndicator")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:!1!==u.showAttitudeIndicator?r("settings.visible"):r("settings.hidden")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==u.showAttitudeIndicator,onChange:e=>M({showAttitudeIndicator:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.sailTrimSliders")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:!1!==u.showSailTrimSliders?r("settings.visible"):r("settings.hidden")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==u.showSailTrimSliders,onChange:e=>M({showSailTrimSliders:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.rigging")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:!1!==u.showRigging?r("settings.visible"):r("settings.hidden")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==u.showRigging,onChange:e=>M({showRigging:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,t.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-end",children:[(0,t.jsxs)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:[r("settings.aisLengthScaling"),(0,t.jsx)("span",{className:"block text-caption text-hud-muted font-medium mt-1 uppercase",children:r("settings.mapTargetVisibility")})]}),(0,t.jsx)("span",{className:"text-value font-semibold text-oBlue bg-oBlue/10 px-3 py-1 rounded-lg",children:u.aisLengthScalingFactor||.7})]}),(0,t.jsx)("input",{type:"range",className:"w-full h-1.5 bg-hud-bg-elevated rounded-lg appearance-none cursor-pointer accent-oBlue",min:"0.1",max:"2.0",step:"0.1",value:u.aisLengthScalingFactor||.7,onChange:e=>M({aisLengthScalingFactor:parseFloat(e.target.value)})})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.unitsValues")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.distanceUnits")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.distanceUnits||"nm",onChange:e=>M({distanceUnits:e.target.value}),children:[(0,t.jsx)("option",{value:"nm",className:"bg-hud-bg",children:"Nautical Miles"}),(0,t.jsx)("option",{value:"km",className:"bg-hud-bg",children:"Kilometres"}),(0,t.jsx)("option",{value:"mi",className:"bg-hud-bg",children:"Miles"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.depthUnits")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.depthUnits||"m",onChange:e=>M({depthUnits:e.target.value}),children:[(0,t.jsx)("option",{value:"m",className:"bg-hud-bg",children:"metres"}),(0,t.jsx)("option",{value:"ft",className:"bg-hud-bg",children:"feet"}),(0,t.jsx)("option",{value:"fa",className:"bg-hud-bg",children:"fathoms"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.speedUnits")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.speedUnits||"kn",onChange:e=>M({speedUnits:e.target.value}),children:[(0,t.jsx)("option",{value:"kn",className:"bg-hud-bg",children:"knots"}),(0,t.jsx)("option",{value:"km/h",className:"bg-hud-bg",children:"km/h"}),(0,t.jsx)("option",{value:"mph",className:"bg-hud-bg",children:"mph"}),(0,t.jsx)("option",{value:"m/s",className:"bg-hud-bg",children:"m/s"})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.temperatureUnits")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.temperatureUnits||"C",onChange:e=>M({temperatureUnits:e.target.value}),children:[(0,t.jsx)("option",{value:"C",className:"bg-hud-bg",children:"Celsius"}),(0,t.jsx)("option",{value:"F",className:"bg-hud-bg",children:"Fahrenheit"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.positionFormat")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:u.positionFormat||"DD",onChange:e=>M({positionFormat:e.target.value}),children:[(0,t.jsx)("option",{value:"DD",className:"bg-hud-bg",children:"-128.12345"}),(0,t.jsx)("option",{value:"DM",className:"bg-hud-bg",children:"-128° 07.407'"}),(0,t.jsx)("option",{value:"DMS",className:"bg-hud-bg",children:"-128° 07' 24.4\""})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.preferTrueValues")}),(0,t.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:!1!==u.preferTrueValues?"true":"false",onChange:e=>M({preferTrueValues:"true"===e.target.value}),children:[(0,t.jsx)("option",{value:"true",className:"bg-hud-bg",children:r("settings.preferTrue")}),(0,t.jsx)("option",{value:"false",className:"bg-hud-bg",children:r("settings.preferMagnetic")})]})]})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.preferredPaths")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.trueWindSpeed")}),(0,t.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"speedTrue",label:r("settings.pathSpeedTrue")},{value:"speedApparent",label:r("settings.pathSpeedApparent")}].map(e=>(0,t.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"preferredWindSpeedPath",value:e.value,checked:(u.preferredWindSpeedPath||"speedTrue")===e.value,onChange:e=>M({preferredWindSpeedPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,t.jsx)("span",{className:"text-label text-hud-main",children:e.label})]},e.value))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.trueWindDirection")}),(0,t.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"directionTrue",label:r("settings.pathDirectionTrue")},{value:"angleApparent",label:r("settings.pathAngleApparent")},{value:"angleTrueWater",label:r("settings.pathAngleTrueWater")}].map(e=>(0,t.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"preferredWindDirectionPath",value:e.value,checked:(u.preferredWindDirectionPath||"directionTrue")===e.value,onChange:e=>M({preferredWindDirectionPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,t.jsx)("span",{className:"text-label text-hud-main",children:e.label})]},e.value))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:r("settings.headingCog")}),(0,t.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"courseOverGroundTrue",label:r("settings.pathCourseOverGroundTrue")},{value:"headingTrue",label:r("settings.pathHeadingTrue")},{value:"courseOverGroundMagnetic",label:r("settings.pathCourseOverGroundMagnetic")},{value:"headingMagnetic",label:r("settings.pathHeadingMagnetic")}].map(e=>(0,t.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"preferredHeadingPath",value:e.value,checked:(u.preferredHeadingPath||"courseOverGroundTrue")===e.value,onChange:e=>M({preferredHeadingPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,t.jsx)("span",{className:"text-label text-hud-main",children:e.label})]},e.value))})]})]})]}),(0,t.jsxs)("section",{className:"tesla-card space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"text-label font-semibold uppercase tracking-widest text-hud-main/90",children:r("settings.externalLinks")}),(0,t.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,t.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-label font-bold uppercase tracking-widest text-hud-secondary",children:r("settings.customToolUrls")}),(0,t.jsx)("p",{className:"text-caption text-hud-muted font-medium uppercase tracking-wider",children:r("settings.customToolUrlsDesc")})]}),(0,t.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:u.showCustomUrls||!1,onChange:e=>M({showCustomUrls:e.target.checked})}),(0,t.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),u.showCustomUrls&&(0,t.jsx)(m.motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"space-y-6 pt-4 border-t border-hud",children:(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[{id:"navigation",label:r("settings.urlNavigation"),placeholder:"${signalkUrl}/@signalk/freeboard-sk/"},{id:"instrument",label:r("settings.urlInstruments"),placeholder:"${signalkUrl}/@mxtommy/kip/"},{id:"dashboard",label:r("settings.urlMetrics"),placeholder:"${signalkUrl}/grafana"},{id:"webcam1",label:r("settings.urlWebcamAlpha"),placeholder:"https://example.com/stream1"},{id:"webcam2",label:r("settings.urlWebcamBeta"),placeholder:"https://example.com/stream2"},{id:"weather",label:r("settings.urlAtmospheric"),placeholder:"https://windy.com/..."}].map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary ml-1",children:e.label}),(0,t.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-label text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:e.placeholder,value:u.customExternalUrls?.[e.id]||"",onChange:t=>{let s={...u.customExternalUrls};s[e.id]=t.target.value,M({customExternalUrls:s})}})]},e.id))})})]})]})})]})}],87628)},34900,function(e){e.n(e.i(87628))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44188,e=>{"use strict";var t=e.i(43476),a=e.i(71645);e.i(85269);var n=e.i(22831),l=e.i(49721),s=e.i(68757),i=e.i(83646),r=e.i(83402),o=e.i(5941);let d=[0,.5,1].map(e=>{let{r:t,g:a,b:n}=(0,o.tensionToColor)(e);return`rgb(${Math.round(255*t)}, ${Math.round(255*a)}, ${Math.round(255*n)})`}),h=({kind:e,colors:a})=>{let[n,l,s]=a;return"chevrons"===e?(0,t.jsxs)("svg",{width:"28",height:"14",viewBox:"0 0 28 14","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"0",y:"2",width:"28",height:"10",rx:"2",fill:n,opacity:"0.35"}),[4,13,22].map(e=>(0,t.jsx)("path",{d:`M${e} 4 l4 3 l-4 3`,stroke:n,strokeWidth:"2",fill:"none"},e))]}):"bands"===e?(0,t.jsx)("svg",{width:"28",height:"14",viewBox:"0 0 28 14","aria-hidden":"true",children:[n,l,s].filter(Boolean).map((e,a,n)=>(0,t.jsx)("rect",{x:28/n.length*a,y:"4",width:28/n.length,height:"6",fill:e},e))}):"dashed"===e?(0,t.jsx)("svg",{width:"28",height:"14",viewBox:"0 0 28 14","aria-hidden":"true",children:(0,t.jsx)("line",{x1:"1",y1:"7",x2:"27",y2:"7",stroke:n,strokeWidth:"2",strokeDasharray:"4 3"})}):"hull"===e?(0,t.jsx)("svg",{width:"28",height:"14",viewBox:"0 0 28 14","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 7 Q8 1 22 2 L26 7 L22 12 Q8 13 2 7 Z",fill:n,stroke:l,strokeWidth:"1"})}):"arrow"===e?(0,t.jsx)("svg",{width:"28",height:"14",viewBox:"0 0 28 14","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 7 H20 M15 2 L21 7 L15 12",stroke:n,strokeWidth:"2.5",fill:"none"})}):null};e.s(["default",0,()=>{let{t:e}=(0,n.useTranslation)(),{scene:o,accent:c}=(0,i.default)(),[u,g]=(0,a.useState)(()=>!0===r.default.get("sceneLegendOpen")),m=()=>{r.default.set("sceneLegendOpen",!u),g(!u)},x=[{kind:"chevrons",colors:[o.route],label:e("legend.route")},{kind:"bands",colors:[o.wakeGood,o.wakeFair,o.wakeBad],label:e("legend.wake")},{kind:"bands",colors:[o.laylinePort,o.laylineStarboard],label:e("legend.laylines")},{kind:"dashed",colors:[o.compass],label:e("legend.isochrones")},{kind:"hull",colors:[o.ghost,o.ghost],label:e("legend.ghost")},{kind:"hull",colors:[o.vessel,o.vessel],label:e("legend.vessel")},{kind:"hull",colors:[o.vesselDanger,o.vesselDanger],label:e("legend.danger")},{kind:"hull",colors:[o.vesselYields,o.vesselYields],label:e("legend.yields")},{kind:"hull",colors:[o.vesselClose,o.vesselClose],label:e("legend.close")},{kind:"dashed",colors:[o.vesselDanger],label:e("legend.cpa")},{kind:"hull",colors:[o.giveWay,o.giveWay],label:e("legend.giveWay")},{kind:"dashed",colors:[o.target],label:e("legend.advice")},{kind:"bands",colors:[c],label:e("legend.trim")},{kind:"bands",colors:d,label:e("legend.loads")}];return u?(0,t.jsxs)("div",{className:"relative z-40 px-3 py-2 max-w-[19rem] max-h-[45vh] overflow-y-auto select-none rounded-2xl bg-hud-bg/90 backdrop-blur shadow-soft",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted",children:e("legend.title")}),(0,t.jsx)("button",{type:"button",onClick:m,"aria-label":e("legend.close"),className:"text-hud-muted hover:text-hud-main px-1",children:(0,t.jsx)(l.FontAwesomeIcon,{icon:s.faXmark})})]}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:x.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-caption text-hud-main leading-tight",children:[(0,t.jsx)("span",{className:"shrink-0 w-7 flex justify-center",children:(0,t.jsx)(h,{kind:e.kind,colors:e.colors})}),(0,t.jsx)("span",{children:e.label})]},e.label))})]}):(0,t.jsxs)("button",{type:"button",onClick:m,className:"hud-halo flex items-center gap-2 px-2 py-1 text-caption font-semibold uppercase tracking-widest text-hud-muted hover:text-hud-main",children:[(0,t.jsx)(l.FontAwesomeIcon,{icon:s.faCircleInfo}),e("legend.title")]})}])},75058,function(e){e.n(e.i(44188))},5941,e=>{"use strict";let t=[1,.8,.6];function a(e){return t[Math.min(Math.max(e,0),2)]}function n(e,t){return Math.max(.05,Math.min(1,1-.6*e-.3*t))}function l(e,t){return Math.PI/6*Math.max(0,1-1.9438444924574*t/30)*(1-e)}function s(e,t,a){let n=Math.min(1,1.9438444924574*(e.tws||0)/30),l=t.tension||.5;switch(a){case"mainSheet":return Math.min(1,.5*n+.3*l+.3*t.mainCar);case"jibSheet":return Math.min(1,.5*n+.3*l+.3*t.jibCar);case"vang":return Math.min(1,.6*n+.4*l);case"cunningham":return Math.min(1,.4*n+.6*l);case"backstay":return Math.min(1,Math.max(0,1-Math.abs(Math.atan2(Math.sin(e.awa||0),Math.cos(e.awa||0)))/Math.PI)*n*.9+.3*l);default:return l}}function i(e){let t=Math.max(0,Math.min(1,e));if(t<=.5){let e=2*t;return{r:e,g:1-.3*e,b:0}}return{r:1,g:.7*(1-(t-.5)*2),b:0}}e.s(["getReefHeightFactor",0,a,"tensionToColor",0,i,"updateSailTrim",0,function({tws:e=0,twa:t=0,awa:r=0,mainCar:o=.5,jibCar:d=.5,tension:h=.5}){let c,u=(c=1.9438444924574*e)>25?2:+(c>18),g=a(u),m=n(o,h),x=n(d,h),b=l(o,e),k=l(d,e),v={tws:e,twa:t,awa:r},f={mainCar:o,jibCar:d,tension:h},p={mainSheet:s(v,f,"mainSheet"),jibSheet:s(v,f,"jibSheet"),vang:s(v,f,"vang"),cunningham:s(v,f,"cunningham"),backstay:s(v,f,"backstay")},j={mainSheet:i(p.mainSheet),jibSheet:i(p.jibSheet),vang:i(p.vang),cunningham:i(p.cunningham),backstay:i(p.backstay)};return{reefLevel:u,reefHeightFactor:g,mainCamber:m,jibCamber:x,mainTwist:b,jibTwist:k,tensions:p,tensionColors:j}}])},83646,e=>{"use strict";var t=e.i(67561);e.s(["default",0,()=>(0,t.useOcearoContext)().tokens])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58700,e=>{"use strict";var t=e.i(43476);e.i(71645);var s=e.i(49721),i=e.i(68757);e.s(["default",0,({content:e,onClose:n})=>{if(!e)return null;let a=e.split("\n").filter(e=>e.trim());return(0,t.jsxs)("div",{className:"tesla-card min-w-[180px] max-w-[240px] bg-hud-bg/90 backdrop-blur-xl ",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-[0.2em] text-hud-muted",children:"VESSEL"}),(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n?.()},className:"w-5 h-5 flex items-center justify-center rounded-full bg-hud-elevated text-hud-muted hover:text-hud-main hover:bg-oRed/20 transition-all",children:(0,t.jsx)(s.FontAwesomeIcon,{icon:i.faTimes,className:"text-xs"})})]}),(0,t.jsx)("div",{className:"space-y-1.5",children:a.map((e,s)=>{let i=e.indexOf(":"),n=-1!==i?e.substring(0,i).trim():null,a=-1!==i?e.substring(i+1).trim():e.trim();return(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[n&&(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted whitespace-nowrap",children:n}),(0,t.jsx)("span",{className:"text-caption font-semibold text-hud-main truncate text-right",children:a})]},s)})})]})}])},77021,function(e){e.n(e.i(58700))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43322,t=>{t.v(e=>Promise.all(["static/chunks/2kmptoy43h0mx.js"].map(e=>t.l(e))).then(()=>e(56101)))},34882,t=>{t.v(e=>Promise.all(["static/chunks/1ed7ayfg19cjb.js"].map(e=>t.l(e))).then(()=>e(77021)))},59499,t=>{t.v(e=>Promise.all(["static/chunks/3td9mnhvcj9cq.js"].map(e=>t.l(e))).then(()=>e(85003)))},30150,t=>{t.v(e=>Promise.all(["static/chunks/1d81m3g9jqkob.js"].map(e=>t.l(e))).then(()=>e(84237)))},64390,t=>{t.v(e=>Promise.all(["static/chunks/3zqx8h9yg5-ch.js"].map(e=>t.l(e))).then(()=>e(39554)))},93170,t=>{t.v(e=>Promise.all(["static/chunks/0-c2-u5p6bxzo.js","static/chunks/11awvgcou7v4r.js"].map(e=>t.l(e))).then(()=>e(50226)))},48217,t=>{t.v(e=>Promise.all(["static/chunks/2n86yq1wz1yx7.js"].map(e=>t.l(e))).then(()=>e(14774)))},29882,t=>{t.v(e=>Promise.all(["static/chunks/2w71oj1brox5z.js"].map(e=>t.l(e))).then(()=>e(56665)))},93889,t=>{t.v(e=>Promise.all(["static/chunks/1ptj3mv8b_tzs.js"].map(e=>t.l(e))).then(()=>e(58166)))},36258,t=>{t.v(e=>Promise.all(["static/chunks/0iqdztntvxh3c.js","static/chunks/1exvcc71cgr4t.js","static/chunks/0iztd835j5p1n.js","static/chunks/1w1xks0hp_tlr.js"].map(e=>t.l(e))).then(()=>e(59465)))},97820,t=>{t.v(e=>Promise.all(["static/chunks/2wayx8t5r5fi9.js","static/chunks/1w1xks0hp_tlr.js","static/chunks/1exvcc71cgr4t.js"].map(e=>t.l(e))).then(()=>e(69675)))},82041,t=>{t.v(e=>Promise.all(["static/chunks/0w_skktmh3e48.js"].map(e=>t.l(e))).then(()=>e(41994)))},73321,t=>{t.v(e=>Promise.all(["static/chunks/1y35unwvy8p98.js"].map(e=>t.l(e))).then(()=>e(78938)))},11657,t=>{t.v(e=>Promise.all(["static/chunks/144mjqdrx42lq.js"].map(e=>t.l(e))).then(()=>e(75058)))},93540,t=>{t.v(e=>Promise.all(["static/chunks/1g8fbzv0hu0i2.js"].map(e=>t.l(e))).then(()=>e(84809)))},71762,t=>{t.v(e=>Promise.all(["static/chunks/3--qzv1u6c7_7.js"].map(e=>t.l(e))).then(()=>e(91999)))},32598,t=>{t.v(e=>Promise.all(["static/chunks/3nm7o0eq5abhg.js"].map(e=>t.l(e))).then(()=>e(79224)))},32673,t=>{t.v(e=>Promise.all(["static/chunks/2g-xpe7xnropn.js"].map(e=>t.l(e))).then(()=>e(36540)))},11220,t=>{t.v(e=>Promise.all(["static/chunks/1l-jew0-1-3eq.js","static/chunks/1w1xks0hp_tlr.js","static/chunks/1exvcc71cgr4t.js"].map(e=>t.l(e))).then(()=>e(27404)))},39271,t=>{"use strict";var e=t.i(43476),a=t.i(71645);t.i(85269);var s=t.i(22831),l=t.i(49721),n=t.i(68757),i=t.i(30206);let r=[10,30,60,120],c=()=>(0,a.useSyncExternalStore)(i.subscribeReplay,i.getReplayState,i.getReplayState);t.s(["default",0,()=>{let{t}=(0,s.useTranslation)(),a=c();if(!a.active)return null;let u=Math.max(1,a.end-a.start);return(0,e.jsxs)("div",{className:"hud-halo flex items-center gap-3 px-3 py-2 rounded-2xl bg-hud-bg/80 backdrop-blur select-none w-[min(40rem,100%)] flex-wrap",children:[(0,e.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-oBlue shrink-0",children:t("replay.title")}),(0,e.jsx)("button",{type:"button",onClick:i.togglePlay,"aria-label":t(a.playing?"replay.pause":"replay.play"),className:"w-9 h-9 rounded-full bg-hud-elevated text-hud-main flex items-center justify-center shrink-0",children:(0,e.jsx)(l.FontAwesomeIcon,{icon:a.playing?n.faPause:n.faPlay})}),(0,e.jsx)("input",{type:"range",min:a.start,max:a.end,step:1e3,value:a.time,onChange:t=>(0,i.seekReplay)(Number(t.target.value)),"aria-label":t("replay.timeline"),className:"flex-1 min-w-0 accent-oBlue"}),(0,e.jsx)("span",{className:"text-label font-semibold tabular-nums text-hud-main shrink-0",children:new Date(a.time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),(0,e.jsxs)("span",{className:"text-caption text-hud-muted tabular-nums shrink-0",children:[Math.round((a.time-a.start)/u*100),"%"]}),(0,e.jsx)("div",{className:"flex gap-1 shrink-0",children:r.map(t=>(0,e.jsxs)("button",{type:"button",onClick:()=>(0,i.setReplaySpeed)(t),className:`px-2 py-1 rounded-lg text-caption font-semibold ${a.speed===t?"bg-oBlue text-white":"text-hud-muted hover:text-hud-main"}`,children:["×",t]},t))}),(0,e.jsx)("button",{type:"button",onClick:i.stopReplay,"aria-label":t("replay.close"),className:"w-8 h-8 rounded-full text-hud-muted hover:text-hud-main flex items-center justify-center shrink-0",children:(0,e.jsx)(l.FontAwesomeIcon,{icon:n.faXmark})})]})},"useReplay",0,c])},66984,t=>{t.v(e=>Promise.all(["static/chunks/0jpa5m78l0ib0.js"].map(e=>t.l(e))).then(()=>e(79261)))},72466,t=>{"use strict";let e={WARNING_THRESHOLD:50,DANGER_THRESHOLD:20,CHARGING_THRESHOLD:13.2,MIN_VOLTAGE:10.5,MAX_VOLTAGE:14.4};t.s(["BATTERY_CONFIG",0,e,"estimateStateOfCharge",0,t=>{if(!t||"number"!=typeof t)return 0;if(t>=13)return 100;if(t<=e.MIN_VOLTAGE)return 0;let a=[{voltage:12.85,soc:100},{voltage:12.75,soc:90},{voltage:12.65,soc:80},{voltage:12.55,soc:70},{voltage:12.45,soc:60},{voltage:12.35,soc:50},{voltage:12.25,soc:40},{voltage:12.15,soc:30},{voltage:12.05,soc:20},{voltage:11.95,soc:15},{voltage:11.8,soc:10},{voltage:11.6,soc:5},{voltage:10.5,soc:0}];for(let e=0;e<a.length-1;e++)if(t>=a[e+1].voltage){let s=a[e].voltage,l=a[e+1].voltage,n=a[e].soc,i=a[e+1].soc;return Math.round(i+(t-l)/(s-l)*(n-i))}return 0},"isBatteryCharging",0,t=>t>e.CHARGING_THRESHOLD])},58567,t=>{"use strict";var e=t.i(83402);t.s(["RENDER_QUALITIES",0,["auto","high","pi"],"getRenderProfile",0,()=>{let t=e.default.get("renderQuality")||"auto";return"pi"===t||"auto"===t&&(()=>{if("u"<typeof navigator)return!1;if(/aarch64|armv7|armv8|arm64|raspbian|raspberry/i.test(navigator.userAgent))return!0;let t=navigator.hardwareConcurrency||8,e=navigator.deviceMemory||8;return t<=4&&e<=4})()?{id:"pi",fps:30,dpr:1,antialias:!1}:{id:"high",fps:60,dpr:Math.min(window.devicePixelRatio||1,1.5),antialias:!0}}])},52822,(t,e,a)=>{"use strict";var s=t.r(71645),l=t.r(2239),n="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=l.useSyncExternalStore,r=s.useRef,c=s.useEffect,u=s.useMemo,o=s.useDebugValue;a.useSyncExternalStoreWithSelector=function(t,e,a,s,l){var h=r(null);if(null===h.current){var m={hasValue:!1,value:null};h.current=m}else m=h.current;var p=i(t,(h=u(function(){function t(t){if(!c){if(c=!0,i=t,t=s(t),void 0!==l&&m.hasValue){var e=m.value;if(l(e,t))return r=e}return r=t}if(e=r,n(i,t))return e;var a=s(t);return void 0!==l&&l(e,a)?(i=t,e):(i=t,r=a)}var i,r,c=!1,u=void 0===a?null:a;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,a,s,l]))[0],h[1]);return c(function(){m.hasValue=!0,m.value=p},[p]),o(p),p}},30224,(t,e,a)=>{"use strict";t.i(47167),e.exports=t.r(52822)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5445,t=>{"use strict";var e=t.i(71645),i=t.i(18566),a=t.i(83402);t.s(["default",0,function(){let t=(0,i.useRouter)();return(0,e.useEffect)(()=>{a.default.setCurrentView("settings"),t.replace("/")},[t]),null}])},18566,(t,e,i)=>{e.exports=t.r(76562)},79866,(t,e,i)=>{e.exports={boats:[{name:"Default",modelPath:"default",capabilities:["navigation","rudder","sail","color"]},{name:"Racer 10.8",modelPath:"racer",capabilities:["navigation","sail","color"]},{name:"Catamaran 14",modelPath:"catamaran",capabilities:["navigation","sail","color"]},{name:"Optimist",modelPath:"optimist",capabilities:["navigation","ais"]},{name:"Sailboat",modelPath:"sailboat",capabilities:["navigation","ais"]},{name:"Ship",modelPath:"ship",capabilities:["navigation","ais"]},{name:"Windsurf",modelPath:"windsurf",capabilities:["navigation","ais"]}]}},83402,t=>{"use strict";var e=t.i(79866);let i=new class{constructor(){this.defaultConfig={signalkUrl:"http://localhost:3000",username:"",password:"",useAuthentication:!1,signalKUrlSet:!1,debugMode:!1,selectedBoat:"Racer 10.8",primaryColor:null,metallicEffect:!1,aisLengthScalingFactor:.7,compassNorthUp:!1,hide3DCompass:!1,hideTrueWind:!1,showCustomUrls:!1,customExternalUrls:{},currentView:"default",theme:"dark",language:"en",distanceUnits:"nm",depthUnits:"m",speedUnits:"kn",temperatureUnits:"C",positionFormat:"DD",preferTrueValues:!0,preferredWindSpeedPath:"speedTrue",preferredWindDirectionPath:"directionTrue",preferredHeadingPath:"courseOverGroundTrue",debugWindOverride:!1,debugWindSpeed:10,debugWindDirection:0,debugShowAxes:!1,showSailTrimSliders:!0,showRigging:!0},this.configKey="ocearoConfig",this.inMemoryConfig={...this.defaultConfig},this.config=this.loadConfig()}isLocalStorageAvailable(){try{return"u">typeof localStorage}catch{return!1}}loadConfig(){if(this.isLocalStorageAvailable()){let t=localStorage.getItem(this.configKey);if(!t)return this.saveConfig(this.defaultConfig),{...this.defaultConfig};try{let e={...this.defaultConfig,...JSON.parse(t)};return(e.boatChosen||"Default"!==e.selectedBoat)&&"RM1080"!==e.selectedBoat||(e.selectedBoat="Racer 10.8"),e}catch(t){return console.error("Failed to parse stored configuration:",t),{...this.defaultConfig}}}return{...this.inMemoryConfig}}saveConfig(t){this.config={...this.config,...t},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.config}}get(t){return this.config[t]}set(t,e){this.config[t]=e,this.saveConfig(this.config)}resetConfig(){this.config={...this.defaultConfig},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.defaultConfig}}getAll(){return{...this.config}}getDefaultConfig(){return{...this.defaultConfig}}getSelectedBoat(){let t=this.config.selectedBoat;return t?this.getBoatsData().find(e=>e.name===t):null}getBoatsData(){return e.default.boats}getSignalKUrl(){return this.config.signalKUrlSet&&this.config.signalkUrl?this.config.signalkUrl:this.getComputedSignalKUrl()}getComputedSignalKUrl(){return this.config.debugMode?"https://demo.signalk.org:443":`${window.location.protocol}//${window.location.hostname}${window.location.port?":"+window.location.port:""}`}getCurrentView(){return this.config.currentView||this.defaultConfig.currentView}setCurrentView(t){this.set("currentView",t)}};t.s(["default",0,i])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9229,e=>{"use strict";var t=e.i(43476),i=e.i(11426),l=e.i(71645),n=e.i(85709);e.i(85269);var s=e.i(22831),a=e.i(95430);let o={BACKGROUND:"bg-oGreen",TEXT:"text-oGreen"},r={BACKGROUND:"bg-oYellow",TEXT:"text-oYellow"};e.s(["default",0,()=>{let{t:e}=(0,s.useTranslation)(),[u,c]=(0,l.useState)(240),m=(0,l.useMemo)(()=>["environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.tide.timeLow","environment.tide.timeHigh","environment.tide.coeffNow"],[]),d=(0,n.useSignalKPaths)(m),{tideData:h}=(0,i.useTide)(),g=(0,l.useCallback)(e=>{if(!e)return null;if("string"==typeof e&&(e.includes("T")||e.includes("-"))){let t=new Date(e);return isNaN(t.getTime())?null:t}if("string"==typeof e){let t=e.split(":").map(Number);if(t.length<2)return null;let i=(0,a.vesselNow)();return i.setHours(t[0],t[1],0,0),i}return null},[]),p=(0,l.useCallback)(e=>{if(!e)return null;if("string"==typeof e&&(e.includes("T")||e.includes("-"))){let t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}return e},[]),f=(0,l.useCallback)((e,t)=>{let i=g(t),l=g(e);return!!i&&!!l&&i.getTime()<l.getTime()},[g]),x=(0,l.useCallback)((e,t,i)=>i<=t||!e?0:Math.min(100,Math.max(0,(e-t)/(i-t)*100)),[]);(0,l.useEffect)(()=>{let e=()=>{let e=window.innerHeight;c(e<640?Math.min(.25*e,240):Math.min(.35*e,240))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let{level:v,high:b,low:N,timeLow:w,timeHigh:T,coefficient:y,isRising:j}=(0,l.useMemo)(()=>{let e=d["environment.tide.heightNow"]??h?.level??null,t=d["environment.tide.heightHigh"]??h?.high??null,i=d["environment.tide.heightLow"]??h?.low??null,l=d["environment.tide.timeLow"]??h?.timeLow??null,n=d["environment.tide.timeHigh"]??h?.timeHigh??null,s=d["environment.tide.coeffNow"]??h?.coefficient??null;return[e,t,i,l,n].every(e=>null!=e)?{level:e,high:t,low:i,timeLow:l,timeHigh:n,coefficient:s,isRising:f(l,n)}:{level:null,high:null,low:null,timeLow:null,timeHigh:null,coefficient:null,isRising:null}},[d,h,f]),$="text-hud-main",k=j?o:r,C=(0,l.useMemo)(()=>x(v,N,b),[v,N,b,x]);return null===v||null===b||null===N?null:(0,t.jsxs)("div",{className:"flex flex-col items-center group p-3 transition-all duration-300",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase tracking-[0.2em] mb-1 opacity-40 group-hover:opacity-100 transition-opacity ${$}`,children:e("indicators.tide")}),(0,t.jsxs)("div",{className:`text-caption font-semibold uppercase tracking-widest mb-4 ${$} flex items-center gap-1.5 opacity-60`,children:[(0,t.jsx)("span",{className:"text-oBlue",children:p(T)}),(0,t.jsx)("span",{className:`inline-block transform ${!j&&"rotate-180"} ${k.TEXT} text-caption`,children:"▲"}),null!=y&&(0,t.jsxs)("span",{className:"text-hud-muted",children:["C",y]})]}),(0,t.jsxs)("div",{className:"relative flex flex-col w-12",style:{height:u},children:[(0,t.jsx)("div",{className:"absolute left-0 top-0 w-1.5 h-full bg-hud-elevated rounded-full overflow-hidden",children:(0,t.jsx)("div",{role:"progressbar",className:`${k.BACKGROUND} w-full rounded-full transition-all duration-1000 ease-in-out absolute bottom-0 left-0`,"aria-valuenow":C,"aria-valuemin":"0","aria-valuemax":"100","aria-label":`Tide level: ${v.toFixed(2)} meters`,style:{height:`${C}%`}})}),(0,t.jsxs)("div",{className:"ml-4 h-full relative",children:[(0,t.jsxs)("span",{className:`absolute ${$} text-caption font-semibold uppercase tracking-tighter opacity-30`,style:{top:"0%"},children:[Number(b).toFixed(1),"m"]}),C>10&&C<90&&(0,t.jsxs)("div",{className:"absolute transition-all duration-500 flex items-center space-x-1",style:{bottom:`${C}%`,transform:"translateY(50%)"},children:[(0,t.jsx)("div",{className:`w-2 h-[1px] ${k.BACKGROUND} opacity-50`}),(0,t.jsxs)("span",{className:`${$} text-caption font-semibold tracking-tight`,children:[v.toFixed(2),"m"]})]}),(0,t.jsxs)("span",{className:`absolute ${$} text-caption font-semibold uppercase tracking-tighter opacity-30`,style:{bottom:"0%"},children:[Number(N).toFixed(1),"m"]})]})]}),(0,t.jsx)("div",{className:`text-caption font-semibold uppercase tracking-widest mt-4 opacity-40 ${$}`,children:p(w)})]})}])},58166,function(e){e.n(e.i(9229))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95163,e=>{"use strict";var r=e.i(43476);e.i(71645),e.i(85269);var t=e.i(22831),n=e.i(49721),i=e.i(68757),a=e.i(83646),o=e.i(77291);e.s(["default",0,()=>{let{t:e}=(0,t.useTranslation)(),{scene:s}=(0,a.default)(),{giveWayTo:l,encounters:u}=(0,o.default)();if(!l)return null;let{target:g,role:d}=l,c=u.filter(e=>"stand-on"!==e.role.ownRole).length-1;return(0,r.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 rounded-2xl select-none text-white backdrop-blur",style:{background:`color-mix(in srgb, ${s.giveWay} 82%, transparent)`},role:"alert",children:[(0,r.jsx)(n.FontAwesomeIcon,{icon:i.faTriangleExclamation,className:"text-lg"}),(0,r.jsxs)("div",{className:"leading-tight",children:[(0,r.jsx)("div",{className:"text-label font-bold uppercase tracking-widest",children:e("colregs.youGiveWay")}),(0,r.jsxs)("div",{className:"text-caption font-semibold opacity-95",children:[e(`colregs.${d.reason}`,{name:g.name})," · ",e("colregs.rule",{rule:d.rule}),c>0&&` \xb7 +${c}`]})]})]})}])},78938,function(e){e.n(e.i(95163))},77291,e=>{"use strict";var r=e.i(71645),t=e.i(62588),n=e.i(85709),i=e.i(61969),a=e.i(539);let o=Math.PI/180,s={power:1,sail:2,fishing:3,restricted:4},l=e=>{let r=String(e.navState||"").toLowerCase();if(/not under command|restricted|constrained/.test(r))return"restricted";if(/fishing/.test(r))return"fishing";if(/sailing/.test(r))return"sail";if(/motoring|engine/.test(r))return"power";let t=Number(e.shipType);return 36===t?"sail":30===t?"fishing":33===t?"restricted":"power"},u=(e,r,t)=>(0,a.wrapPi)(Math.atan2(r.x-e.x,r.y-e.y)-t),g=(e,r,t)=>{let n={x:0,y:0},i=u(n,r,e.course),l=u(r,n,r.course),g=Math.sign(l)||1,d=e=>Math.abs(e)>112.5*o;if(d(i)&&r.speed>e.speed)return{ownRole:"stand-on",rule:"13",reason:"overtakenByTarget",targetTurn:0};if(d(l)&&e.speed>r.speed)return{ownRole:"give-way",rule:"13",reason:"overtaking",targetTurn:0};let c=s[e.category]??1,p=s[r.category]??1;if(c!==p)return c<p?{ownRole:"give-way",rule:"18",reason:`giveWayTo_${r.category}`,targetTurn:0}:{ownRole:"stand-on",rule:"18",reason:`standOnFrom_${r.category}`,targetTurn:g};if("sail"===e.category&&Number.isFinite(t)){let n=(0,a.wrapPi)(t-e.course)>=0?"starboard":"port";return n!==((0,a.wrapPi)(t-r.course)>=0?"starboard":"port")?"port"===n?{ownRole:"give-way",rule:"12a-i",reason:"portTack",targetTurn:0}:{ownRole:"stand-on",rule:"12a-i",reason:"targetPortTack",targetTurn:g}:r.x*Math.sin(t)+r.y*Math.cos(t)>0?{ownRole:"stand-on",rule:"12a-ii",reason:"targetWindward",targetTurn:g}:{ownRole:"give-way",rule:"12a-ii",reason:"ownWindward",targetTurn:0}}return Math.abs((0,a.wrapPi)(r.course-e.course-Math.PI))<10*o&&Math.abs(i)<6*o?{ownRole:"both",rule:"14",reason:"headOn",targetTurn:1}:i>0?{ownRole:"give-way",rule:"15",reason:"crossingStarboard",targetTurn:0}:{ownRole:"stand-on",rule:"15",reason:"crossingPort",targetTurn:g}};var d=e.i(83402),c=e.i(67561);let p=[],m=["navigation.speedOverGround","navigation.courseOverGroundTrue"];e.s(["default",0,({always:e=!1}={})=>{let a,o,{targets:s}=(0,t.useAIS)({passive:!0}),{states:u}=(0,c.useOcearoContext)(),v=e||u.ais?s:p,{twd:h,heading:f}=(0,i.default)(),b=(0,n.useSignalKPaths)(m),w=(a=(0,n.useSignalKPrefix)("propulsion."),o=d.default.get("ownVesselCategory"),(0,r.useMemo)(()=>"sail"===o||"power"===o?o:Object.entries(a).some(([e,r])=>e.endsWith(".revolutions")&&Number(r)>.5||e.endsWith(".state")&&"started"===r)?"power":"sail",[a,o])),T=d.default.get("aisLengthScalingFactor")||.7;return(0,r.useMemo)(()=>{let e=b["navigation.courseOverGroundTrue"]??f,r=b["navigation.speedOverGround"]??0,t=[];if(Number.isFinite(e))for(let n of v){if("danger"!==n.risk)continue;let i=n.cog??n.cogMagnetic??n.heading;if(!Number.isFinite(i)||null===n.sceneX)continue;let a=g({course:e,speed:r,category:w},{x:n.sceneX/T,y:-n.sceneZ/T,course:i,speed:n.sog??0,category:l(n)},h);t.push({target:{...n},role:a})}t.sort((e,r)=>(e.target.tcpaSeconds??1/0)-(r.target.tcpaSeconds??1/0));let n={};for(let e of v)"close"===e.risk?n[e.mmsi]="close":"danger"===e.risk&&(n[e.mmsi]="giveWay");for(let e of t)n[e.target.mmsi]="stand-on"===e.role.ownRole?"yields":"giveWay";let i=t.filter(e=>"stand-on"!==e.role.ownRole);return{ownCategory:w,encounters:t,statuses:n,giveWay:i.length>0,giveWayTo:i[0]||null,primary:t[0]||null}},[v,h,f,b,w,T])}],77291)},61969,e=>{"use strict";var r=e.i(71645),t=e.i(85709),n=e.i(539);let i=180/Math.PI,a=["navigation.speedThroughWater","navigation.speedOverGround","navigation.headingTrue","navigation.courseOverGroundTrue","environment.wind.speedTrue","environment.wind.angleTrueWater","environment.wind.directionTrue","performance.polarSpeed","performance.polarSpeedRatio","navigation.courseGreatCircle.nextPoint.bearingTrue"];e.s(["default",0,()=>{let e=(0,t.useSignalKPaths)(a);return(0,r.useMemo)(()=>{let r=e["navigation.speedThroughWater"]??e["navigation.speedOverGround"]??null,t=e["navigation.headingTrue"]??e["navigation.courseOverGroundTrue"]??null,a=e["environment.wind.speedTrue"]??null,o=e["environment.wind.angleTrueWater"]??null,s=e["environment.wind.directionTrue"]??null;null===s&&Number.isFinite(o)&&Number.isFinite(t)&&(s=(0,n.wrapPi)(t+o));let l=e["performance.polarSpeed"]??(Number.isFinite(a)&&Number.isFinite(o)?(0,n.polarSpeedSi)(a,o):null),u=e["performance.polarSpeedRatio"]??null;null===u&&Number.isFinite(r)&&Number.isFinite(l)&&l>.2&&(u=r/l);let g=Number.isFinite(r)&&Number.isFinite(l)?(r-l)*1.943844:null,d=null,c=null,p=!Number.isFinite(o)||Math.abs(o)<Math.PI/2;if(Number.isFinite(a)){let e=p?(0,n.optimalUpwind)(1.943844*a):(0,n.optimalDownwind)(1.943844*a);e&&(d=e.twa/i,Number.isFinite(s)&&Number.isFinite(o)&&(c=(0,n.wrapPi)(s-Math.sign(o||1)*d)))}let m=e["navigation.courseGreatCircle.nextPoint.bearingTrue"],v=null;if(Number.isFinite(m)&&Number.isFinite(s)&&Number.isFinite(a)){let e=(0,n.bestVmcHeading)({twd:s,tws:a,bearing:m}),r=Number.isFinite(t)?(0,n.vmcForHeading)({twd:s,tws:a,bearing:m,heading:t}):null;v=e?{bearing:m,best:e,current:r}:null}return{ratio:u,polarSpeed:l,boatSpeed:r,deltaKn:g,heading:t,twd:s,tws:a,twa:o,targetTwa:d,targetHeading:c,upwind:p,vmc:v}},[e])}])},83646,e=>{"use strict";var r=e.i(67561);e.s(["default",0,()=>(0,r.useOcearoContext)().tokens])},74452,(e,r,t)=>{r.exports={vpp:{angles:[52,60,75,90,110,120,135,150],speeds:[6,8,10,12,14,16,20],52:[4.98,5.86,6.31,6.45,6.51,6.52,6.41],60:[5.25,6.11,6.56,6.73,6.79,6.82,6.79],75:[5.45,6.33,6.77,7.01,7.13,7.2,7.24],90:[5.66,6.55,7,7.25,7.38,7.53,7.7],110:[5.49,6.49,7.04,7.4,7.69,7.97,8.38],120:[5.32,6.36,6.97,7.39,7.77,8.1,8.6],135:[4.81,5.92,6.68,7.15,7.55,7.95,8.85],150:[4.09,5.17,6.04,6.61,6.99,7.31,7.93],beat_angle:[43.6,42,41.2,41.2,41.7,42.1,44.2],beat_vmg:[3.26,3.91,4.24,4.34,4.36,4.34,4.16],run_angle:[144.8,147.8,148.5,149.6,171.8,175.4,177.2],run_vmg:[3.54,4.48,5.23,5.73,6.17,6.67,7.36]}}},539,e=>{"use strict";var r=e.i(74452);let t=180/Math.PI,n=r.default.vpp,i=(e,r,t)=>e+(r-e)*t,a=(e,r)=>{if(r<=e[0])return[0,0];let t=e.length-1;if(r>=e[t])return[t-1,1];let n=0;for(;r>e[n+1];)n++;return[n,(r-e[n])/(e[n+1]-e[n])]},o=n.speeds.map((e,r)=>(e=>{let r=n.beat_angle[e],i=n.run_angle[e],a=n.beat_vmg[e]/Math.cos(r/t),o=n.run_vmg[e]/Math.abs(Math.cos(i/t)),s=[[0,0],[.7*r,.55*a],[r,a]];for(let t of n.angles)t>r&&t<i&&s.push([t,n[String(t)][e]]);return s.push([i,o]),i<180&&s.push([180,n.run_vmg[e]]),s})(r)),s=(e,r)=>{let[t,n]=a(e.map(e=>e[0]),r);return i(e[t][1],e[t+1][1],n)},l=(e,r)=>{if(!Number.isFinite(e)||!Number.isFinite(r)||e<=0)return null;let t=Math.min(180,Math.abs((r+540)%360-180)),l=n.speeds;if(e<l[0])return s(o[0],t)*(e/l[0]);let[u,g]=a(l,e);return i(s(o[u],t),s(o[u+1],t),g)},u=(e,r)=>{let[t,o]=a(n.speeds,r);return i(e[t],e[t+1],o)},g=(e,r)=>{let n=l(1.943844*e,r*t);return null===n?null:n/1.943844},d=e=>{let r=(e+Math.PI)%(2*Math.PI);return r<0&&(r+=2*Math.PI),r-Math.PI};e.s(["bestVmcHeading",0,({twd:e,tws:r,bearing:n})=>{if(![e,r,n].every(Number.isFinite)||r<=0)return null;let i=null;for(let a=-100;a<=100;a++){let o=n+a/t,s=g(r,d(e-o));if(null===s)continue;let l=s*Math.cos(o-n);(!i||l>i.vmc)&&(i={heading:d(o),speed:s,vmc:l})}return i},"optimalDownwind",0,e=>{if(!Number.isFinite(e)||e<=0)return null;let r=u(n.run_angle,e),i=l(e,r);return{twa:r,speed:i,vmg:-i*Math.cos(r/t)}},"optimalUpwind",0,e=>{if(!Number.isFinite(e)||e<=0)return null;let r=u(n.beat_angle,e),i=l(e,r);return{twa:r,speed:i,vmg:i*Math.cos(r/t)}},"polarSpeed",0,l,"polarSpeedSi",0,g,"vmcForHeading",0,({twd:e,tws:r,bearing:t,heading:n})=>{if(![e,r,t,n].every(Number.isFinite))return null;let i=g(r,d(e-n));return null===i?null:i*Math.cos(n-t)},"wrapPi",0,d])}]);