ocearo-ui 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +1 -1
- package/README.fr.md +27 -3
- package/README.md +27 -3
- package/__next.__PAGE__.txt +3 -3
- package/__next._full.txt +4 -4
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/0m7wbuocx-b4_.js +9 -0
- package/_next/static/chunks/0voiofm58khqd.js +1 -0
- package/_next/static/chunks/{3xjnsskh0tayo.js → 15imr2-f_8n-x.js} +1 -1
- package/_next/static/chunks/{32j_j396qs7be.js → 18_i6mf6hb_c7.js} +1 -1
- package/_next/static/chunks/{1fzzb4jtgv5gg.js → 1gt2hhqk1821k.js} +2 -2
- package/_next/static/chunks/{3ktj0iemsr1m-.js → 1pa1cfmfts0i9.js} +1 -1
- package/_next/static/chunks/1zm03hw2ylxw8.js +1 -0
- package/_next/static/chunks/2dvwb-mfasp68.js +1 -0
- package/_next/static/chunks/2kwn4iymxaom3.js +1 -0
- package/_next/static/chunks/2ryo_bbmt6t74.css +3 -0
- package/_next/static/chunks/{0oaqe70syw_b5.js → 2s6w3x5jnc2tg.js} +1 -1
- package/_next/static/chunks/{34_oyzp8_pi_m.js → 2w44atvyp9o_w.js} +1 -1
- package/_next/static/chunks/{0yiqocv54ogoq.js → 3p9ziqn6r35qf.js} +1 -1
- package/_next/static/chunks/{31lugryguappr.js → 3q8o52_juxmdp.js} +1 -1
- package/_next/static/chunks/3wwn1rti8oc_r.js +1 -0
- package/_not-found/__next._full.txt +3 -3
- package/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +3 -3
- package/apple-touch-icon.png +0 -0
- package/favicon-96x96.png +0 -0
- package/favicon.ico +0 -0
- package/favicon.svg +1 -3
- package/icons/favicon-16x16.png +0 -0
- package/icons/favicon-32x32.png +0 -0
- package/icons/favicon-48x48.png +0 -0
- package/icons/icon-192x192.png +0 -0
- package/icons/icon-512x512.png +0 -0
- package/icons/ocearo.webp +0 -0
- package/index.html +1 -1
- package/index.txt +4 -4
- package/manifest.json +2 -3
- package/package.json +2 -1
- package/settings/__next._full.txt +3 -3
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +2 -2
- package/settings.html +1 -1
- package/settings.txt +3 -3
- package/_next/static/chunks/01atsfq_4opab.js +0 -1
- package/_next/static/chunks/0cx639tthxlz4.js +0 -1
- package/_next/static/chunks/0zlk2mlkvbtj1.js +0 -1
- package/_next/static/chunks/1gaiqhzy_0d7s.js +0 -1
- package/_next/static/chunks/2r_h93rt76vka.js +0 -1
- package/_next/static/chunks/2y3d8zopa8r5r.css +0 -3
- package/_next/static/chunks/3k5itcabq5oqs.js +0 -9
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_buildManifest.js +0 -0
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13992,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(49721),n=e.i(68757);e.i(85269);var s=e.i(22831),l=e.i(66799),r=e.i(85709),o=e.i(46991),c=e.i(95430),d=e.i(71029);let u="px-3 py-2 rounded-lg font-bold uppercase tracking-wider text-label border-2 border-white/80 disabled:opacity-40 transition-colors",m=({mob:e,now:r,ownPosition:c,heading:m,canNavigate:h})=>{var g;let{t:b}=(0,s.useTranslation)(),[p,x]=(0,a.useState)(null),[f,v]=(0,a.useState)(!1),[N,M]=(0,a.useState)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>clearTimeout(w.current),[]);let j=e.status||{},S=e.createdAt?Date.parse(e.createdAt):NaN,T=(0,d.distanceAndBearing)(c,e.position),y=async(e,t)=>{x(e),M(null);try{await t()}catch(e){M(e?.message||String(e))}finally{x(null)}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:n.faLifeRing,className:"text-3xl animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-label sm:text-value font-semibold uppercase tracking-wider leading-tight",children:b("mob.title")}),e.message&&"Person Overboard!"!==e.message&&(0,t.jsx)("div",{className:"text-label opacity-90 truncate",children:e.message})]}),(0,t.jsxs)("div",{className:"text-right font-mono",children:[(0,t.jsx)("div",{className:"text-value font-bold",children:(e=>{if(!Number.isFinite(e)||e<0)return"--:--";let t=Math.floor(e/1e3),a=Math.floor(t/3600),i=String(Math.floor(t%3600/60)).padStart(2,"0"),n=String(t%60).padStart(2,"0");return a>0?`${a}:${i}:${n}`:`${i}:${n}`})(r-S)}),(0,t.jsx)("div",{className:"text-caption uppercase opacity-80",children:b("mob.elapsed")})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 font-mono text-value",children:T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:(g=T.distance)<200?`${Math.round(g)} m`:`${(0,o.convertDistanceUnit)(g)} ${(0,o.getDistanceUnitLabel)()}`}),(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[Number.isFinite(m)&&(0,t.jsx)(i.FontAwesomeIcon,{icon:n.faArrowUp,title:b("mob.relativeBearing"),style:{transform:`rotate(${T.bearing-180*m/Math.PI}deg)`}}),String(Math.round(T.bearing)%360).padStart(3,"0"),"°T"]})]}):(0,t.jsx)("span",{className:"text-label opacity-80",children:b("mob.noPosition")})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[j.canAcknowledge&&!j.acknowledged&&(0,t.jsx)("button",{type:"button",className:`${u} bg-white text-oRed`,disabled:null!==p,onClick:()=>y("ack",()=>l.default.notificationAction(e.id,"acknowledge")),children:b("mob.acknowledge")}),h&&e.position&&(0,t.jsx)("button",{type:"button",className:`${u} hover:bg-white/20`,disabled:null!==p,onClick:()=>y("goto",()=>l.default.setDestinationPosition(e.position.latitude,e.position.longitude)),children:b("mob.navigateTo")}),!1!==j.canClear&&e.id&&(0,t.jsx)("button",{type:"button",className:`${u} ${f?"bg-white text-oRed":"hover:bg-white/20"}`,disabled:null!==p,onClick:()=>{if(!f){v(!0),w.current=setTimeout(()=>v(!1),5e3);return}clearTimeout(w.current),v(!1),y("clear",()=>l.default.clearNotification(e.id))},children:b(f?"mob.confirmClear":"mob.clear")})]}),N&&(0,t.jsx)("div",{className:"text-label bg-black/30 rounded px-2 py-1",children:N})]})},h=({mobs:e,canNavigate:i})=>{let n=(0,r.useSignalKPath)("navigation.position"),s=(0,r.useSignalKPath)("navigation.headingTrue"),l=(0,r.useSignalKPath)("navigation.courseOverGroundTrue"),o=Number.isFinite(s)?s:l,[d,u]=(0,a.useState)(()=>(0,c.vesselNow)().getTime());return(0,a.useEffect)(()=>{let e=setInterval(()=>u((0,c.vesselNow)().getTime()),1e3);return()=>clearInterval(e)},[]),(0,t.jsx)("div",{role:"alert",className:"absolute top-
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13992,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(49721),n=e.i(68757);e.i(85269);var s=e.i(22831),l=e.i(66799),r=e.i(85709),o=e.i(46991),c=e.i(95430),d=e.i(71029);let u="px-3 py-2 rounded-lg font-bold uppercase tracking-wider text-label border-2 border-white/80 disabled:opacity-40 transition-colors",m=({mob:e,now:r,ownPosition:c,heading:m,canNavigate:h})=>{var g;let{t:b}=(0,s.useTranslation)(),[p,x]=(0,a.useState)(null),[f,v]=(0,a.useState)(!1),[N,M]=(0,a.useState)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>clearTimeout(w.current),[]);let j=e.status||{},S=e.createdAt?Date.parse(e.createdAt):NaN,T=(0,d.distanceAndBearing)(c,e.position),y=async(e,t)=>{x(e),M(null);try{await t()}catch(e){M(e?.message||String(e))}finally{x(null)}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:n.faLifeRing,className:"text-3xl animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-label sm:text-value font-semibold uppercase tracking-wider leading-tight",children:b("mob.title")}),e.message&&"Person Overboard!"!==e.message&&(0,t.jsx)("div",{className:"text-label opacity-90 truncate",children:e.message})]}),(0,t.jsxs)("div",{className:"text-right font-mono",children:[(0,t.jsx)("div",{className:"text-value font-bold",children:(e=>{if(!Number.isFinite(e)||e<0)return"--:--";let t=Math.floor(e/1e3),a=Math.floor(t/3600),i=String(Math.floor(t%3600/60)).padStart(2,"0"),n=String(t%60).padStart(2,"0");return a>0?`${a}:${i}:${n}`:`${i}:${n}`})(r-S)}),(0,t.jsx)("div",{className:"text-caption uppercase opacity-80",children:b("mob.elapsed")})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 font-mono text-value",children:T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:(g=T.distance)<200?`${Math.round(g)} m`:`${(0,o.convertDistanceUnit)(g)} ${(0,o.getDistanceUnitLabel)()}`}),(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[Number.isFinite(m)&&(0,t.jsx)(i.FontAwesomeIcon,{icon:n.faArrowUp,title:b("mob.relativeBearing"),style:{transform:`rotate(${T.bearing-180*m/Math.PI}deg)`}}),String(Math.round(T.bearing)%360).padStart(3,"0"),"°T"]})]}):(0,t.jsx)("span",{className:"text-label opacity-80",children:b("mob.noPosition")})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[j.canAcknowledge&&!j.acknowledged&&(0,t.jsx)("button",{type:"button",className:`${u} bg-white text-oRed`,disabled:null!==p,onClick:()=>y("ack",()=>l.default.notificationAction(e.id,"acknowledge")),children:b("mob.acknowledge")}),h&&e.position&&(0,t.jsx)("button",{type:"button",className:`${u} hover:bg-white/20`,disabled:null!==p,onClick:()=>y("goto",()=>l.default.setDestinationPosition(e.position.latitude,e.position.longitude)),children:b("mob.navigateTo")}),!1!==j.canClear&&e.id&&(0,t.jsx)("button",{type:"button",className:`${u} ${f?"bg-white text-oRed":"hover:bg-white/20"}`,disabled:null!==p,onClick:()=>{if(!f){v(!0),w.current=setTimeout(()=>v(!1),5e3);return}clearTimeout(w.current),v(!1),y("clear",()=>l.default.clearNotification(e.id))},children:b(f?"mob.confirmClear":"mob.clear")})]}),N&&(0,t.jsx)("div",{className:"text-label bg-black/30 rounded px-2 py-1",children:N})]})},h=({mobs:e,canNavigate:i})=>{let n=(0,r.useSignalKPath)("navigation.position"),s=(0,r.useSignalKPath)("navigation.headingTrue"),l=(0,r.useSignalKPath)("navigation.courseOverGroundTrue"),o=Number.isFinite(s)?s:l,[d,u]=(0,a.useState)(()=>(0,c.vesselNow)().getTime());return(0,a.useEffect)(()=>{let e=setInterval(()=>u((0,c.vesselNow)().getTime()),1e3);return()=>clearInterval(e)},[]),(0,t.jsx)("div",{role:"alert",className:"absolute top-[calc(0.75rem+env(safe-area-inset-top))] left-1/2 -translate-x-1/2 z-40 w-[min(32rem,calc(100%-2rem))] max-h-[70%] overflow-y-auto bg-oRed text-white rounded-2xl shadow-2xl border-2 border-white/60 p-4 flex flex-col gap-4 divide-y divide-white/30",children:e.map(e=>(0,t.jsx)("div",{className:"pt-4 first:pt-0",children:(0,t.jsx)(m,{mob:e,now:d,ownPosition:n,heading:o,canNavigate:i})},e.path))})};e.s(["default",0,()=>{let e=(0,d.useActiveMobs)(),a=(0,d.useMobSupport)();return 0===e.length?null:(0,t.jsx)(h,{mobs:e,canNavigate:a.navigate})}])},50637,function(e){e.n(e.i(13992))},71029,e=>{"use strict";var t=e.i(71645),a=e.i(85709),i=e.i(66799),n=e.i(46991);let s="notifications.mob",l=e=>e*Math.PI/180;e.s(["distanceAndBearing",0,(e,t)=>{if(!Number.isFinite(e?.latitude)||!Number.isFinite(e?.longitude)||!Number.isFinite(t?.latitude)||!Number.isFinite(t?.longitude))return null;let a=l(e.latitude),i=l(t.latitude),s=l(t.longitude-e.longitude),r=Math.sin((i-a)/2)**2+Math.cos(a)*Math.cos(i)*Math.sin(s/2)**2;return{distance:2*n.EARTH_RADIUS_METERS*Math.asin(Math.min(1,Math.sqrt(r))),bearing:(180*Math.atan2(Math.sin(s)*Math.cos(i),Math.cos(a)*Math.sin(i)-Math.sin(a)*Math.cos(i)*Math.cos(s))/Math.PI+360)%360}},"useActiveMobs",0,()=>{let e=(0,a.useSignalKPrefix)(s);return(0,t.useMemo)(()=>Object.entries(e).filter(([e,t])=>(e===s||e.startsWith(`${s}.`))&&t?.state&&"normal"!==t.state).map(([e,t])=>({...t,path:e})).sort((e,t)=>String(e.createdAt??"").localeCompare(String(t.createdAt??""))),[e])},"useMobSupport",0,()=>{let e=(()=>{let[e,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=!1,t=null,n=async()=>{let s=await i.default.getFeatures();e||(s?a(s):t=setTimeout(n,3e4))};return n(),()=>{e=!0,clearTimeout(t)}},[]),e})();return(0,t.useMemo)(()=>({raise:!!e?.apis.includes("notifications"),navigate:!!e?.apis.includes("course")}),[e])}],71029)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";var t=e.i(43476),i=e.i(71645),r=e.i(70703);let n={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function s(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function o(e,t,i,r=.15){return 0===r?Math.max(t,Math.min(e,i)):e<t?-s(t-e,i-t,r)+t:e>i?+s(e-i,i-t,r)+i:e}function a(e,t,i){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let u={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(e){return e?e[0].toUpperCase()+e.slice(1):""}let h=["enter","leave"],f=["gotpointercapture","lostpointercapture"];function p(e){return"touches"in e}function m(e){return p(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function g(e){return p(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function v(e){let t=g(e);return p(e)?t.identifier:t.pointerId}function b(e){let t=g(e);return[t.clientX,t.clientY]}function w(e,...t){return"function"==typeof e?e(...t):e}function x(){}function y(e,t){return Object.assign({},t,e||{})}class _{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:r}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?w(i.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s}=e;Object.assign(t,{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);n.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,l]=t._movement,[c,u]=i.threshold,{_step:d,values:h}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(a)>=c&&h[0]),!1===d[1]&&(d[1]=Math.abs(l)>=u&&h[1])):(!1===d[0]&&(d[0]=Math.abs(a)>=c&&Math.sign(a)*c),!1===d[1]&&(d[1]=Math.abs(l)>=u&&Math.sign(l)*u)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let f=[0,0];if(i.hasCustomTransform){let[e,t]=h;f[0]=!1!==d[0]?e-d[0]:0,f[1]=!1!==d[1]?t-d[1]:0}else f[0]=!1!==d[0]?a-d[0]:0,f[1]=!1!==d[1]?l-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);let p=t.offset,m=t._active&&!t._blocked||t.active;m&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=w(i.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));let[g,v]=t.offset,[[b,x],[y,_]]=t._bounds;t.overflow=[g<b?-1:+(g>x),v<y?-1:+(v>_)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let S=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[r,n]){let[[s,a],[l,c]]=e;return[o(t,s,a,r),o(i,l,c,n)]}(t._bounds,t.offset,S),t.delta=n.sub(t.offset,p),this.computeMovement(),m&&(!t.last||s>32)){t.delta=n.sub(t.offset,p);let e=t.delta.map(Math.abs);n.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[e[0]/s,e[1]/s],t.timeDelta=s)}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let r=this.handler(c(c(c({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class S extends _{constructor(...e){super(...e),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let r="object"==typeof i.axisThreshold?i.axisThreshold[m(e)]:i.axisThreshold;t.axis=function([e,t],i){let r=Math.abs(e),n=Math.abs(t);return r>n&&r>i?"x":n>r&&n>i?"y":void 0}(t._movement,r)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let T=e=>e,k={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>c(c({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return n.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?n.toVector(e):void 0,transform(e,t,i){let r=e||i.shared.transform;return this.hasCustomTransform=!!r,r||T},threshold:e=>n.toVector(e,0)},j=0,P=c(c({},k),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=j)=>e,bounds(e={}){if("function"==typeof e)return t=>P.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:r=-1/0,bottom:n=1/0}=e;return[[t,i],[r,n]]}}),A={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},O="u">typeof window&&window.document&&window.document.createElement;function E(){return O&&"ontouchstart"in window}let C={isBrowser:O,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:E(),touchscreen:E()||O&&window.navigator.maxTouchPoints>1,pointer:O&&"onpointerdown"in window,pointerLock:O&&"exitPointerLock"in window.document},D=10,I={mouse:0,touch:0,pen:8},M=c(c({},P),{},{device(e,t,{pointer:{touch:i=!1,lock:r=!1,mouse:n=!1}={}}){return(this.pointerLock=r&&C.pointerLock,C.touch&&i)?"touch":this.pointerLock?"mouse":C.pointer&&!n?"pointer":C.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,C.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:r=1,keys:n=!0}={}}){return this.pointerButtons=r,this.keys=n,!this.pointerLock&&"pointer"===this.device&&i},threshold(e,t,{filterTaps:i=!1,tapsThreshold:r=3,axis:s}){let o=n.toVector(e,i?r:+!!s);return this.filterTaps=i,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(n.toVector(e)),distance:this.transform(n.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?c(c({},I),e):I,keyboardDisplacement:(e=D)=>e});c(c({},k),{},{device(e,t,{shared:i,pointer:{touch:r=!1}={}}){if(i.target&&!C.touch&&C.gesture)return"gesture";if(C.touch&&r)return"touch";if(C.touchscreen){if(C.pointer)return"pointer";if(C.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:r={}}){let n=e=>{let t=y(w(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{let t=y(w(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof r?[n(),s()]:e=>[n(e),s(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,n.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e});let B=new Map,L=new Map,N={key:"drag",engine:class extends S{constructor(...e){super(...e),a(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),r={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=P.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=v(e),i._pointerActive=!0,this.computeValues(b(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==m(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;let s=b(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=n.sub(s,t._values),this.computeValues(s)),n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[n,s]=t._distance;if(t.tap=n<=i.tapsThreshold&&s<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,r]=t._delta,[n,s]=t._movement,[o,a]=i.swipe.velocity,[l,c]=i.swipe.distance,u=i.swipe.duration;if(t.elapsedTime<u){let i=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);i>o&&Math.abs(n)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=A[e.key];if(t){let i=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(this.config.keyboardDisplacement,r),i._keyboardActive=!0,n.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in A&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:M},R={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=C.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},V=["target","eventOptions","window","enabled","transform"];function K(e={},t){let i={};for(let[r,n]of Object.entries(t))switch(typeof n){case"function":i[r]=n.call(i,e[r],r,e);break;case"object":i[r]=K(e[r],n);break;case"boolean":n&&(i[r]=e[r])}return i}class U{constructor(e,t){a(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,r,n){let s=this._listeners,o=function(e,t=""){let i=u[e];return e+(i&&i[t]||t)}(t,i),a=c(c({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),n);e.addEventListener(o,r,a);let l=()=>{e.removeEventListener(o,r,a),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class F{constructor(){a(this,"_timeouts",new Map)}add(e,t,i=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class G{constructor(e){a(this,"gestures",new Set),a(this,"_targetEventStore",new U(this)),a(this,"gestureEventStores",{}),a(this,"gestureTimeoutStores",{}),a(this,"handlers",{}),a(this,"config",{}),a(this,"pointerIds",new Set),a(this,"touchIds",new Set),a(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&H(e,"drag"),t.wheel&&H(e,"wheel"),t.scroll&&H(e,"scroll"),t.move&&H(e,"move"),t.pinch&&H(e,"pinch"),t.hover&&H(e,"hover")}(this,e)}setEventIds(e){if(p(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,r;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(r=i.contains)?void 0:r.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,i={}){let{target:r,eventOptions:n,window:s,enabled:o,transform:a}=e,l=function(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}(e,V);if(i.shared=K({target:r,eventOptions:n,window:s,enabled:o,transform:a},R),t){let e=L.get(t);i[t]=K(c({shared:i.shared},l),e)}else for(let e in l){let t=L.get(e);t&&(i[e]=K(c({shared:i.shared},l[e]),t))}return i}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,r={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let n=this.config[i],s=W(r,n.eventOptions,!!t);n.enabled&&new(B.get(i))(this,e,i).bind(s)}let n=W(r,i.eventOptions,!!t);for(let t in this.nativeHandlers)n(t,"",i=>this.nativeHandlers[t](c(c({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in r)r[e]=function(...e){return 0===e.length?x:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...r[e]);if(!t)return r;for(let e in r){let{device:i,capture:n,passive:s}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let r=f.includes(t)?"capturecapture":"capture",n=!!~t.indexOf(r);return n&&(t=t.replace("capture","")),{device:t,capture:n,passive:i}}(e);this._targetEventStore.add(t,i,"",r[e],{capture:n,passive:s})}}}}function H(e,t){e.gestures.add(t),e.gestureEventStores[t]=new U(e,t),e.gestureTimeoutStores[t]=new F}let W=(e,t,i)=>(r,n,s,o={},a=!1)=>{var l,c;let f=null!=(l=o.capture)?l:t.capture,p=null!=(c=o.passive)?c:t.passive,m=a?r:function(e,t="",i=!1){let r=u[e],n=r&&r[t]||t;return"on"+d(e)+d(n)+(!function(e=!1,t){return e&&!h.includes(t)}(i,n)?"":"Capture")}(r,n,f);i&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(s)};var z=e.i(67561),q=e.i(62588),X=e.i(83934),Y=e.i(11426),$=i;class J extends $.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.error("Error caught in Error Boundary:",e,t)}handleRefresh=()=>{window.location.reload()};handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))};render(){if(this.state.hasError){let{error:e,errorInfo:i}=this.state;return(0,t.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-hud-bg text-hud-main p-6",children:(0,t.jsxs)("div",{className:"tesla-card max-w-2xl w-full backdrop-blur-xl flex flex-col items-center text-center",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-oRed/20 flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-oRed animate-soft-pulse"})}),(0,t.jsx)("h1",{className:"text-value font-semibold uppercase tracking-tight text-oRed mb-6",children:"System Critical Error"}),(0,t.jsxs)("p",{className:"text-value font-medium text-hud-main/80 mb-8 max-w-md",children:[(0,t.jsx)("span",{className:"text-hud-muted uppercase text-caption font-semibold tracking-widest block mb-2",children:"Technical Status"}),e?e.toString():"Unknown exception detected in UI thread"]}),i&&(0,t.jsxs)("details",{className:"w-full whitespace-pre-wrap bg-hud-bg/5 p-6 rounded-2xl mb-10 text-left border border-hud group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-oBlue text-caption font-semibold uppercase tracking-widest hover:text-hud-main transition-colors flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Diagnostic Stack Trace"}),(0,t.jsx)("span",{className:"opacity-40 group-open:rotate-180 transition-transform",children:"▼"})]}),(0,t.jsx)("pre",{className:"mt-6 text-caption font-mono text-hud-muted overflow-auto max-h-60 custom-scrollbar leading-relaxed",children:i.componentStack})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 w-full justify-center",children:[(0,t.jsx)("button",{onClick:this.handleRefresh,className:"px-8 py-4 bg-oBlue hover:bg-blue-600 text-hud-main rounded-xl text-caption font-semibold uppercase tracking-[0.2em] transition-all duration-500 shadow-lg shadow-oBlue/20 active:scale-95",children:"Reboot Session"}),(0,t.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-8 py-4 bg-hud-elevated hover:bg-hud-bg text-hud-main border border-hud rounded-xl text-caption font-semibold uppercase tracking-[0.2em] transition-all duration-500 active:scale-95",children:"Exit Console"})]})]})})}return this.props.children}}e.i(85269);var Q=e.i(71),Z=e.i(18850),ee=e.i(83402);function et({children:e}){return(0,i.useEffect)(()=>{let e=ee.default.get("language");e&&e!==Z.default.language&&Z.default.changeLanguage(e)},[]),(0,t.jsx)(Q.I18nextProvider,{i18n:Z.default,children:e})}var ei=e.i(44485),er=e.i(30206);let en=(e,t)=>{let i=e(t);return null==i?void 0:i},es=()=>{let{getSignalKValue:e,updateSignalKData:t}=(0,z.useOcearoContext)(),r=(0,i.useRef)(0);return(0,i.useEffect)(()=>{(0,er.setReplaySink)(t)},[t]),(0,i.useEffect)(()=>{if(!1===ee.default.get("recordVoyages"))return;let t=0,i=setInterval(()=>{if((0,er.isReplaying)()||ee.default.get("debugMode"))return;let i=en(e,"navigation.position");if(!Number.isFinite(i?.latitude)||!Number.isFinite(i?.longitude))return;let n=Date.now(),s=en(e,"navigation.speedOverGround")??0;if(s<.4&&n-r.current<6e4)return;r.current=n;let o=en(e,"navigation.attitude");(0,ei.addSample)({t:n,lat:i.latitude,lon:i.longitude,hdg:en(e,"navigation.headingTrue"),cog:en(e,"navigation.courseOverGroundTrue"),sog:s,stw:en(e,"navigation.speedThroughWater"),tws:en(e,"environment.wind.speedTrue"),twa:en(e,"environment.wind.angleTrueWater"),twd:en(e,"environment.wind.directionTrue"),aws:en(e,"environment.wind.speedApparent"),awa:en(e,"environment.wind.angleApparent"),rud:en(e,"steering.rudderAngle"),roll:o?.roll,depth:en(e,"environment.depth.belowKeel")??en(e,"environment.depth.belowTransducer")}).catch(()=>{}),++t%720==0&&(0,ei.trimSamples)().catch(()=>{})},5e3);return()=>clearInterval(i)},[e]),null},eo=(0,r.default)(()=>e.A(45344),{loadableGenerated:{modules:[42602]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:"Loading..."})}),ea=(0,r.default)(()=>e.A(10520),{loadableGenerated:{modules:[61891]}}),el=(0,r.default)(()=>e.A(49063),{loadableGenerated:{modules:[85626]}}),ec=(0,r.default)(()=>e.A(23e3),{loadableGenerated:{modules:[50637]}}),eu=(0,r.default)(()=>e.A(13181),{loadableGenerated:{modules:[23595]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-hud-main text-value",children:"Loading 3D View..."})}),ssr:!1}),ed={BOAT:"boat",APP:"app",SPLIT:"split"};e.s(["VIEW_MODES",0,ed,"default",0,function(){var e,r;let n=(0,i.useRef)(!1),s=(0,i.useRef)(null),[o,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(()=>ee.default.getCurrentView()||"navigation"),[u,d]=(0,i.useState)(!1),[h,f]=(0,i.useState)(!1),p=(0,i.useRef)(!1);(0,i.useEffect)(()=>{},[]),(0,i.useEffect)(()=>{let e,t=ee.default.get("viewMode");a(Object.values(ed).includes(t)?t:window.innerWidth>=1366?ed.SPLIT:ed.BOAT),n.current=!0;let i=()=>{clearTimeout(e),e=setTimeout(()=>{p.current||ee.default.get("viewMode")||a(window.innerWidth>=1366?ed.SPLIT:ed.BOAT)},250)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),clearTimeout(e)}},[]);let m=(0,i.useCallback)(()=>{d(e=>!e)},[]),g=(0,i.useCallback)(e=>{a(e),ee.default.set("viewMode",e)},[]),v=(e=({movement:[e]})=>{let t=window.innerWidth/5;e>t?g(ed.BOAT):e<-t?g(ed.APP):g(ed.SPLIT)},r={axis:"x"},B.set(N.key,N.engine),L.set(N.key,N.resolver),function(e,t={},r){let n=i.default.useMemo(()=>new G(e),[]);if(n.applyHandlers(e,void 0),n.applyConfig(t,r),i.default.useEffect(n.effect.bind(n)),i.default.useEffect(()=>n.clean.bind(n),[]),void 0===t.target)return n.bind.bind(n)}({drag:e},r||{},"drag")),b=(0,i.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),w=(0,i.useCallback)(e=>{o===ed.BOAT&&g(ed.APP),c(e),ee.default.setCurrentView(e)},[o,g]);(0,i.useEffect)(()=>(0,er.subscribeReplay)(e=>{e.active&&o===ed.APP&&g(ed.SPLIT)}),[o,g]);let x=(0,i.useRef)(null),y=(0,i.useRef)(null),_=(0,i.useCallback)(()=>{if("settings"===l){p.current=!1,f(!1);let e=y.current||"navigation";c(e),ee.default.setCurrentView(e),g(x.current||ed.BOAT)}else x.current=o,y.current=l,p.current=!0,f(!0),w("settings"),a(ed.APP)},[l,o,g,w]);(0,i.useEffect)(()=>{if("settings"===l){p.current||(p.current=!0,f(!0));return}p.current&&(p.current=!1,f(!1))},[l]);let S=(0,i.useMemo)(()=>null===o?{}:{leftPane:`transition-all duration-300 ${o===ed.BOAT?"w-full":o===ed.APP?"hidden":"w-2/5"} bg-leftPaneBg h-full relative`,rightPane:`transition-all duration-300 ${o===ed.APP?"w-full":o===ed.BOAT?"hidden":"w-3/5"} h-full bg-rightPaneBg`},[o]);return n.current?(0,t.jsx)(J,{children:(0,t.jsx)(et,{children:(0,t.jsxs)(z.OcearoContextProvider,{children:[(0,t.jsx)(es,{}),(0,t.jsx)(q.AISProvider,{children:(0,t.jsx)(X.WeatherContextProvider,{children:(0,t.jsx)(Y.TideContextProvider,{children:(0,t.jsxs)("div",{className:"h-[100dvh] flex flex-col bg-hud-bg relative overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,t.jsx)("div",{className:S.leftPane,children:(0,t.jsx)(eu,{active:o!==ed.APP,fullscreen:o===ed.BOAT})}),(0,t.jsx)("div",{ref:s,...v(),className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center touch-none",children:(0,t.jsx)("div",{className:"rounded-full w-3 bg-hud-dim h-40 transition-all duration-200 hover:bg-hud-muted border border-hud"})}),(0,t.jsx)("div",{className:S.rightPane,children:(0,t.jsx)(eo,{view:l})})]}),(0,t.jsx)("div",{className:"w-full h-16 min-h-16 bg-leftPaneBg border-t border-hud flex items-center justify-center shrink-0",children:(0,t.jsx)(ea,{setRightView:w,toggleAppMenu:m,toggleSettings:_})}),(0,t.jsx)(ec,{}),u&&(0,t.jsx)(el,{currentViewMode:o,toggleViewMode:g,handleSetRightView:w,toggleSettings:_,toggleFullscreen:b,setShowAppMenu:d})]})})})})]})})}):(0,t.jsx)("div",{className:"h-[100dvh] bg-hud-bg flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse text-hud-main",children:"Loading..."})})}],81694)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";var t=e.i(43476),i=e.i(71645),n=e.i(70703);let r={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function s(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function o(e,t,i,n=.15){return 0===n?Math.max(t,Math.min(e,i)):e<t?-s(t-e,i-t,n)+t:e>i?+s(e-i,i-t,n)+i:e}function a(e,t,i){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let u={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(e){return e?e[0].toUpperCase()+e.slice(1):""}let h=["enter","leave"],f=["gotpointercapture","lostpointercapture"];function p(e){return"touches"in e}function m(e){return p(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function v(e){return p(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function g(e){let t=v(e);return p(e)?t.identifier:t.pointerId}function b(e){let t=v(e);return[t.clientX,t.clientY]}function w(e,...t){return"function"==typeof e?e(...t):e}function x(){}function y(e,t){return Object.assign({},t,e||{})}class _{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:n}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?w(i.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:n}=this;t.args=this.args;let s=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:n,metaKey:r,ctrlKey:s}=e;Object.assign(t,{shiftKey:i,altKey:n,metaKey:r,ctrlKey:s})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);r.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,l]=t._movement,[c,u]=i.threshold,{_step:d,values:h}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(a)>=c&&h[0]),!1===d[1]&&(d[1]=Math.abs(l)>=u&&h[1])):(!1===d[0]&&(d[0]=Math.abs(a)>=c&&Math.sign(a)*c),!1===d[1]&&(d[1]=Math.abs(l)>=u&&Math.sign(l)*u)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let f=[0,0];if(i.hasCustomTransform){let[e,t]=h;f[0]=!1!==d[0]?e-d[0]:0,f[1]=!1!==d[1]?t-d[1]:0}else f[0]=!1!==d[0]?a-d[0]:0,f[1]=!1!==d[1]?l-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);let p=t.offset,m=t._active&&!t._blocked||t.active;m&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=w(i.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));let[v,g]=t.offset,[[b,x],[y,_]]=t._bounds;t.overflow=[v<b?-1:+(v>x),g<y?-1:+(g>_)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let S=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[n,r]){let[[s,a],[l,c]]=e;return[o(t,s,a,n),o(i,l,c,r)]}(t._bounds,t.offset,S),t.delta=r.sub(t.offset,p),this.computeMovement(),m&&(!t.last||s>32)){t.delta=r.sub(t.offset,p);let e=t.delta.map(Math.abs);r.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[e[0]/s,e[1]/s],t.timeDelta=s)}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let n=this.handler(c(c(c({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class S extends _{constructor(...e){super(...e),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=r.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=r.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let n="object"==typeof i.axisThreshold?i.axisThreshold[m(e)]:i.axisThreshold;t.axis=function([e,t],i){let n=Math.abs(e),r=Math.abs(t);return n>r&&n>i?"x":r>n&&r>i?"y":void 0}(t._movement,n)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let T=e=>e,k={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>c(c({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return r.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?r.toVector(e):void 0,transform(e,t,i){let n=e||i.shared.transform;return this.hasCustomTransform=!!n,n||T},threshold:e=>r.toVector(e,0)},j=0,P=c(c({},k),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=j)=>e,bounds(e={}){if("function"==typeof e)return t=>P.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:n=-1/0,bottom:r=1/0}=e;return[[t,i],[n,r]]}}),A={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},O="u">typeof window&&window.document&&window.document.createElement;function E(){return O&&"ontouchstart"in window}let C={isBrowser:O,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:E(),touchscreen:E()||O&&window.navigator.maxTouchPoints>1,pointer:O&&"onpointerdown"in window,pointerLock:O&&"exitPointerLock"in window.document},D=10,I={mouse:0,touch:0,pen:8},M=c(c({},P),{},{device(e,t,{pointer:{touch:i=!1,lock:n=!1,mouse:r=!1}={}}){return(this.pointerLock=n&&C.pointerLock,C.touch&&i)?"touch":this.pointerLock?"mouse":C.pointer&&!r?"pointer":C.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,C.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:n=1,keys:r=!0}={}}){return this.pointerButtons=n,this.keys=r,!this.pointerLock&&"pointer"===this.device&&i},threshold(e,t,{filterTaps:i=!1,tapsThreshold:n=3,axis:s}){let o=r.toVector(e,i?n:+!!s);return this.filterTaps=i,this.tapsThreshold=n,o},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(r.toVector(e)),distance:this.transform(r.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?c(c({},I),e):I,keyboardDisplacement:(e=D)=>e});c(c({},k),{},{device(e,t,{shared:i,pointer:{touch:n=!1}={}}){if(i.target&&!C.touch&&C.gesture)return"gesture";if(C.touch&&n)return"touch";if(C.touchscreen){if(C.pointer)return"pointer";if(C.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:n={}}){let r=e=>{let t=y(w(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{let t=y(w(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof n?[r(),s()]:e=>[r(e),s(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,r.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e});let B=new Map,L=new Map,N={key:"drag",engine:class extends S{constructor(...e){super(...e),a(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),n={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=P.bounds(n)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),n&&n.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=g(e),i._pointerActive=!0,this.computeValues(b(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==m(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive)return;let n=g(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;let s=b(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=r.sub(s,t._values),this.computeValues(s)),r.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let n=g(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[r,s]=t._distance;if(t.tap=r<=i.tapsThreshold&&s<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,n]=t._delta,[r,s]=t._movement,[o,a]=i.swipe.velocity,[l,c]=i.swipe.distance,u=i.swipe.duration;if(t.elapsedTime<u){let i=Math.abs(e/t.timeDelta),u=Math.abs(n/t.timeDelta);i>o&&Math.abs(r)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(n))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=A[e.key];if(t){let i=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(this.config.keyboardDisplacement,n),i._keyboardActive=!0,r.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in A&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:M},R={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=C.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},V=["target","eventOptions","window","enabled","transform"];function K(e={},t){let i={};for(let[n,r]of Object.entries(t))switch(typeof r){case"function":i[n]=r.call(i,e[n],n,e);break;case"object":i[n]=K(e[n],r);break;case"boolean":r&&(i[n]=e[n])}return i}class U{constructor(e,t){a(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,n,r){let s=this._listeners,o=function(e,t=""){let i=u[e];return e+(i&&i[t]||t)}(t,i),a=c(c({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),r);e.addEventListener(o,n,a);let l=()=>{e.removeEventListener(o,n,a),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class F{constructor(){a(this,"_timeouts",new Map)}add(e,t,i=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...n))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class W{constructor(e){a(this,"gestures",new Set),a(this,"_targetEventStore",new U(this)),a(this,"gestureEventStores",{}),a(this,"gestureTimeoutStores",{}),a(this,"handlers",{}),a(this,"config",{}),a(this,"pointerIds",new Set),a(this,"touchIds",new Set),a(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&z(e,"drag"),t.wheel&&z(e,"wheel"),t.scroll&&z(e,"scroll"),t.move&&z(e,"move"),t.pinch&&z(e,"pinch"),t.hover&&z(e,"hover")}(this,e)}setEventIds(e){if(p(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,n;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(n=i.contains)?void 0:n.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,i={}){let{target:n,eventOptions:r,window:s,enabled:o,transform:a}=e,l=function(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}(e,V);if(i.shared=K({target:n,eventOptions:r,window:s,enabled:o,transform:a},R),t){let e=L.get(t);i[t]=K(c({shared:i.shared},l),e)}else for(let e in l){let t=L.get(e);t&&(i[e]=K(c({shared:i.shared},l[e]),t))}return i}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,n={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let r=this.config[i],s=G(n,r.eventOptions,!!t);r.enabled&&new(B.get(i))(this,e,i).bind(s)}let r=G(n,i.eventOptions,!!t);for(let t in this.nativeHandlers)r(t,"",i=>this.nativeHandlers[t](c(c({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in n)n[e]=function(...e){return 0===e.length?x:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...n[e]);if(!t)return n;for(let e in n){let{device:i,capture:r,passive:s}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let n=f.includes(t)?"capturecapture":"capture",r=!!~t.indexOf(n);return r&&(t=t.replace("capture","")),{device:t,capture:r,passive:i}}(e);this._targetEventStore.add(t,i,"",n[e],{capture:r,passive:s})}}}}function z(e,t){e.gestures.add(t),e.gestureEventStores[t]=new U(e,t),e.gestureTimeoutStores[t]=new F}let G=(e,t,i)=>(n,r,s,o={},a=!1)=>{var l,c;let f=null!=(l=o.capture)?l:t.capture,p=null!=(c=o.passive)?c:t.passive,m=a?n:function(e,t="",i=!1){let n=u[e],r=n&&n[t]||t;return"on"+d(e)+d(r)+(!function(e=!1,t){return e&&!h.includes(t)}(i,r)?"":"Capture")}(n,r,f);i&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(s)};var H=e.i(67561),q=e.i(62588),X=e.i(83934),Y=e.i(11426),$=i;class J extends $.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.error("Error caught in Error Boundary:",e,t)}handleRefresh=()=>{window.location.reload()};handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))};render(){if(this.state.hasError){let{error:e,errorInfo:i}=this.state;return(0,t.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-hud-bg text-hud-main p-6",children:(0,t.jsxs)("div",{className:"tesla-card max-w-2xl w-full backdrop-blur-xl flex flex-col items-center text-center",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-oRed/20 flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-oRed animate-soft-pulse"})}),(0,t.jsx)("h1",{className:"text-value font-semibold uppercase tracking-tight text-oRed mb-6",children:"System Critical Error"}),(0,t.jsxs)("p",{className:"text-value font-medium text-hud-main/80 mb-8 max-w-md",children:[(0,t.jsx)("span",{className:"text-hud-muted uppercase text-caption font-semibold tracking-widest block mb-2",children:"Technical Status"}),e?e.toString():"Unknown exception detected in UI thread"]}),i&&(0,t.jsxs)("details",{className:"w-full whitespace-pre-wrap bg-hud-bg/5 p-6 rounded-2xl mb-10 text-left border border-hud group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-oBlue text-caption font-semibold uppercase tracking-widest hover:text-hud-main transition-colors flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Diagnostic Stack Trace"}),(0,t.jsx)("span",{className:"opacity-40 group-open:rotate-180 transition-transform",children:"▼"})]}),(0,t.jsx)("pre",{className:"mt-6 text-caption font-mono text-hud-muted overflow-auto max-h-60 custom-scrollbar leading-relaxed",children:i.componentStack})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 w-full justify-center",children:[(0,t.jsx)("button",{onClick:this.handleRefresh,className:"px-8 py-4 bg-oBlue hover:bg-blue-600 text-hud-main rounded-xl text-caption font-semibold uppercase tracking-[0.2em] transition-all duration-500 shadow-lg shadow-oBlue/20 active:scale-95",children:"Reboot Session"}),(0,t.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-8 py-4 bg-hud-elevated hover:bg-hud-bg text-hud-main border border-hud rounded-xl text-caption font-semibold uppercase tracking-[0.2em] transition-all duration-500 active:scale-95",children:"Exit Console"})]})]})})}return this.props.children}}e.i(85269);var Q=e.i(71),Z=e.i(18850),ee=e.i(83402);function et({children:e}){return(0,i.useEffect)(()=>{let e=ee.default.get("language");e&&e!==Z.default.language&&Z.default.changeLanguage(e)},[]),(0,t.jsx)(Q.I18nextProvider,{i18n:Z.default,children:e})}var ei=e.i(44485),en=e.i(30206);let er=(e,t)=>{let i=e(t);return null==i?void 0:i},es=()=>{let{getSignalKValue:e,updateSignalKData:t}=(0,H.useOcearoContext)(),n=(0,i.useRef)(0);return(0,i.useEffect)(()=>{(0,en.setReplaySink)(t)},[t]),(0,i.useEffect)(()=>{if(!1===ee.default.get("recordVoyages"))return;let t=0,i=setInterval(()=>{if((0,en.isReplaying)()||ee.default.get("debugMode"))return;let i=er(e,"navigation.position");if(!Number.isFinite(i?.latitude)||!Number.isFinite(i?.longitude))return;let r=Date.now(),s=er(e,"navigation.speedOverGround")??0;if(s<.4&&r-n.current<6e4)return;n.current=r;let o=er(e,"navigation.attitude");(0,ei.addSample)({t:r,lat:i.latitude,lon:i.longitude,hdg:er(e,"navigation.headingTrue"),cog:er(e,"navigation.courseOverGroundTrue"),sog:s,stw:er(e,"navigation.speedThroughWater"),tws:er(e,"environment.wind.speedTrue"),twa:er(e,"environment.wind.angleTrueWater"),twd:er(e,"environment.wind.directionTrue"),aws:er(e,"environment.wind.speedApparent"),awa:er(e,"environment.wind.angleApparent"),rud:er(e,"steering.rudderAngle"),roll:o?.roll,depth:er(e,"environment.depth.belowKeel")??er(e,"environment.depth.belowTransducer")}).catch(()=>{}),++t%720==0&&(0,ei.trimSamples)().catch(()=>{})},5e3);return()=>clearInterval(i)},[e]),null},eo=(0,n.default)(()=>e.A(45344),{loadableGenerated:{modules:[42602]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:"Loading..."})}),ea=(0,n.default)(()=>e.A(10520),{loadableGenerated:{modules:[61891]}}),el=(0,n.default)(()=>e.A(49063),{loadableGenerated:{modules:[85626]}}),ec=(0,n.default)(()=>e.A(23e3),{loadableGenerated:{modules:[50637]}}),eu=(0,n.default)(()=>e.A(13181),{loadableGenerated:{modules:[23595]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-hud-main text-value",children:"Loading 3D View..."})}),ssr:!1}),ed={BOAT:"boat",APP:"app",SPLIT:"split"};e.s(["VIEW_MODES",0,ed,"default",0,function(){var e,n;let r=(0,i.useRef)(!1),s=(0,i.useRef)(null),[o,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=()=>c(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let u=o===ed.SPLIT&&l?ed.BOAT:o,[d,h]=(0,i.useState)(()=>ee.default.getCurrentView()||"navigation"),[f,p]=(0,i.useState)(!1),[m,v]=(0,i.useState)(!1),g=(0,i.useRef)(!1);(0,i.useEffect)(()=>{},[]),(0,i.useEffect)(()=>{let e,t=ee.default.get("viewMode");a(Object.values(ed).includes(t)?t:window.innerWidth>=1366?ed.SPLIT:ed.BOAT),r.current=!0;let i=()=>{clearTimeout(e),e=setTimeout(()=>{g.current||ee.default.get("viewMode")||a(window.innerWidth>=1366?ed.SPLIT:ed.BOAT)},250)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),clearTimeout(e)}},[]);let b=(0,i.useCallback)(()=>{p(e=>!e)},[]),w=(0,i.useCallback)(e=>{a(e),ee.default.set("viewMode",e)},[]),x=(e=({movement:[e]})=>{let t=window.innerWidth/5;e>t?w(ed.BOAT):e<-t?w(ed.APP):window.innerWidth<768||w(ed.SPLIT)},n={axis:"x"},B.set(N.key,N.engine),L.set(N.key,N.resolver),function(e,t={},n){let r=i.default.useMemo(()=>new W(e),[]);if(r.applyHandlers(e,void 0),r.applyConfig(t,n),i.default.useEffect(r.effect.bind(r)),i.default.useEffect(()=>r.clean.bind(r),[]),void 0===t.target)return r.bind.bind(r)}({drag:e},n||{},"drag")),y=(0,i.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),_=(0,i.useCallback)(e=>{u===ed.BOAT&&w(ed.APP),h(e),ee.default.setCurrentView(e)},[u,w]);(0,i.useEffect)(()=>(0,en.subscribeReplay)(e=>{e.active&&u===ed.APP&&w(ed.SPLIT)}),[u,w]);let S=(0,i.useRef)(null),T=(0,i.useRef)(null),k=(0,i.useCallback)(()=>{if("settings"===d){g.current=!1,v(!1);let e=T.current||"navigation";h(e),ee.default.setCurrentView(e),w(S.current||ed.BOAT)}else S.current=u,T.current=d,g.current=!0,v(!0),_("settings"),a(ed.APP)},[d,u,w,_]);(0,i.useEffect)(()=>{if("settings"===d){g.current||(g.current=!0,v(!0));return}g.current&&(g.current=!1,v(!1))},[d]);let j=(0,i.useMemo)(()=>null===u?{}:{leftPane:`transition-all duration-300 ${u===ed.BOAT?"w-full":u===ed.APP?"hidden":"w-2/5"} bg-leftPaneBg h-full relative`,rightPane:`transition-all duration-300 ${u===ed.APP?"w-full":u===ed.BOAT?"hidden":"w-3/5"} h-full bg-rightPaneBg`},[u]);return r.current?(0,t.jsx)(J,{children:(0,t.jsx)(et,{children:(0,t.jsxs)(H.OcearoContextProvider,{children:[(0,t.jsx)(es,{}),(0,t.jsx)(q.AISProvider,{children:(0,t.jsx)(X.WeatherContextProvider,{children:(0,t.jsx)(Y.TideContextProvider,{children:(0,t.jsxs)("div",{className:"h-[100dvh] flex flex-col bg-hud-bg relative overflow-hidden pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",children:[(0,t.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,t.jsx)("div",{className:j.leftPane,children:(0,t.jsx)(eu,{active:u!==ed.APP,fullscreen:u===ed.BOAT})}),(0,t.jsx)("div",{ref:s,...x(),className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center touch-none",children:(0,t.jsx)("div",{className:"rounded-full w-3 bg-hud-dim h-40 transition-all duration-200 hover:bg-hud-muted border border-hud"})}),(0,t.jsx)("div",{className:j.rightPane,children:(0,t.jsx)(eo,{view:d})})]}),(0,t.jsx)("div",{className:"w-full h-16 min-h-16 bg-leftPaneBg border-t border-hud flex items-center justify-center shrink-0",children:(0,t.jsx)(ea,{setRightView:_,toggleAppMenu:b,toggleSettings:k})}),(0,t.jsx)(ec,{}),f&&(0,t.jsx)(el,{currentViewMode:u,canSplit:!l,toggleViewMode:w,handleSetRightView:_,toggleSettings:k,toggleFullscreen:y,setShowAppMenu:p})]})})})})]})})}):(0,t.jsx)("div",{className:"h-[100dvh] bg-hud-bg flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse text-hud-main",children:"Loading..."})})}],81694)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68192,e=>{"use strict";var t=e.i(43476),s=e.i(71645),o=e.i(70703),
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68192,e=>{"use strict";var t=e.i(43476),s=e.i(71645),o=e.i(70703),n=e.i(46932),l=e.i(88653);e.i(85269);var r=e.i(22831),a=e.i(85709),i=e.i(83402);let u=({messageKey:e})=>{let{t:s}=(0,r.useTranslation)();return(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center text-hud-main",children:s(e)})},c=(0,o.default)(()=>e.A(56489),{loadableGenerated:{modules:[92094]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingDocuments"})}),d=(0,o.default)(()=>e.A(22155),{loadableGenerated:{modules:[34900]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingSettings"})}),m=(0,o.default)(()=>e.A(30455),{loadableGenerated:{modules:[13268]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingMediaPlayer"})}),f=(0,o.default)(()=>e.A(71074),{loadableGenerated:{modules:[65862]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingBatteryMonitor"})}),h=(0,o.default)(()=>e.A(3523),{loadableGenerated:{modules:[8161]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingEngineMonitor"})}),p=(0,o.default)(()=>e.A(88913),{loadableGenerated:{modules:[25294]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingDashboard"})}),g=(0,o.default)(()=>e.A(26371),{loadableGenerated:{modules:[70127]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingLogbook"})}),x=(0,o.default)(()=>e.A(58293),{loadableGenerated:{modules:[33946]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loadingAutopilot"})}),j=(0,o.default)(()=>e.A(47853),{loadableGenerated:{modules:[58652]},loading:()=>(0,t.jsx)(u,{messageKey:"common.loading"})}),y={latitude:46.1591,longitude:-1.1522},v={navigation:e=>!e||e.includes("localhost:3000")?null:`${e}/@signalk/freeboard-sk/`,instrument:e=>`${e}/@mxtommy/kip/`,dashboard:e=>e.replace(":3000",":3001")+"/grafana",webcam1:()=>"https://pv.viewsurf.com/2080/Chatelaillon-Port?i=NzU4Mjp1bmRlZmluZWQ",webcam2:()=>"https://pv.viewsurf.com/1478/Chatelaillon-Plage?i=NTkyMDp1bmRlZmluZWQ",weather:(e,t)=>t&&`https://embed.windy.com/embed.html?type=map&location=coordinates&metricRain=mm&metricTemp=\xb0C&metricWind=kt&zoom=10&overlay=wind&product=ecmwf&level=surface&lat=${t.latitude}&lon=${t.longitude}&message=true`};e.s(["default",0,({view:e})=>{let{t:o}=(0,r.useTranslation)(),[u,b]=(0,s.useState)(y),[k,w]=(0,s.useState)(null);i.default.getAll();let P=i.default.getSignalKUrl(),E=(0,a.useSignalKPath)("navigation.position");(0,s.useEffect)(()=>{w(null)},[e]),(0,s.useEffect)(()=>{E&&b(e=>e?Math.abs(e.latitude-E.latitude)>.01||Math.abs(e.longitude-E.longitude)>.01?E:e:E)},[E]);let C=(0,s.useMemo)(()=>{let t=i.default.getAll(),s=t.customExternalUrls||{};if(t.showCustomUrls&&s[e])try{if("string"==typeof s[e]&&s[e].includes("${signalkUrl}"))return s[e].replace("${signalkUrl}",P).replace("${latitude}",u?.latitude||y.latitude).replace("${longitude}",u?.longitude||y.longitude);return s[e]}catch(e){console.error("Error using custom URL:",e)}let o=v[e];if(!o)return null;try{return o(P,u)}catch(e){return console.error("Error generating URL:",e),null}},[e,u,P]),$=["motor","logbook","autopilot","battery","dashboard","debug"].includes(e);return(0,t.jsx)("div",{className:"flex flex-col w-full h-full overflow-hidden bg-hud-bg backdrop-blur-sm relative z-0",children:(0,t.jsx)(l.AnimatePresence,{mode:"wait",children:(0,t.jsx)(n.motion.div,{initial:{opacity:0,x:10,scale:.99},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-10,scale:.99},transition:{duration:.4,ease:[.16,1,.3,1]},style:{flex:"1 1 0%",minHeight:0},className:`flex flex-col w-full absolute inset-0 ${$?"overflow-hidden":"overflow-auto"}`,children:(()=>{if(k)return(0,t.jsx)("div",{className:"text-oRed p-4 font-semibold uppercase text-caption",children:k});switch(e){case"manual":return(0,t.jsx)(c,{path:"./docs"});case"settings":return(0,t.jsx)(d,{});case"mediaplayer":return(0,t.jsx)(m,{});case"battery":return(0,t.jsx)(f,{});case"motor":return(0,t.jsx)(h,{});case"dashboard":return(0,t.jsx)(p,{});case"logbook":return(0,t.jsx)(g,{});case"autopilot":return(0,t.jsx)(x,{});case"debug":return(0,t.jsx)(j,{});default:if(!C)return(0,t.jsx)("div",{className:"text-hud-muted p-4 text-label",children:o("errors.failedToLoadExternal")});return(0,t.jsx)("iframe",{className:"flex-grow border-none",src:C,title:"External Application",onError:()=>w(o("errors.failedToLoadExternal"))})}})()},e)})})}])},42602,function(e){e.n(e.i(68192))},58293,e=>{e.v(t=>Promise.all(["static/chunks/2dvwb-mfasp68.js","static/chunks/0jfox92up1jvy.js"].map(t=>e.l(t))).then(()=>t(33946)))},71074,e=>{e.v(t=>Promise.all(["static/chunks/1xekc18cyi4sx.js","static/chunks/0jfox92up1jvy.js","static/chunks/2s6w3x5jnc2tg.js"].map(t=>e.l(t))).then(()=>t(65862)))},88913,e=>{e.v(t=>Promise.all(["static/chunks/2aq8orcir5h03.js","static/chunks/0jfox92up1jvy.js","static/chunks/2kwn4iymxaom3.js"].map(t=>e.l(t))).then(()=>t(25294)))},47853,e=>{e.v(t=>Promise.all(["static/chunks/2fdpvhx4oo81h.js"].map(t=>e.l(t))).then(()=>t(58652)))},56489,e=>{e.v(t=>Promise.all(["static/chunks/37t6vg8fb1-z8.js","static/chunks/0jfox92up1jvy.js"].map(t=>e.l(t))).then(()=>t(92094)))},3523,e=>{e.v(t=>Promise.all(["static/chunks/1pa1cfmfts0i9.js","static/chunks/0jfox92up1jvy.js"].map(t=>e.l(t))).then(()=>t(8161)))},26371,e=>{e.v(t=>Promise.all(["static/chunks/3wwn1rti8oc_r.js","static/chunks/0jfox92up1jvy.js"].map(t=>e.l(t))).then(()=>t(70127)))},30455,e=>{e.v(t=>Promise.all(["static/chunks/0n95joti2n2py.js","static/chunks/0jfox92up1jvy.js"].map(t=>e.l(t))).then(()=>t(13268)))},22155,e=>{e.v(t=>Promise.all(["static/chunks/0zwc9m4qgtwle.js","static/chunks/2rebcvig176xk.js","static/chunks/0jfox92up1jvy.js","static/chunks/0ohleay4roayh.js"].map(t=>e.l(t))).then(()=>t(34900)))},88653,e=>{"use strict";var t=e.i(43476),s=e.i(71645),o=e.i(31178),n=e.i(47414),l=e.i(74008),r=e.i(21476),a=e.i(72846),i=s,u=e.i(37806);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,a.isHTMLElement)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,s=(0,a.isHTMLElement)(e)&&e.offsetWidth||0,o=(0,a.isHTMLElement)(e)&&e.offsetHeight||0,n=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(n.height),l.width=parseFloat(n.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=s-l.width-l.left,l.bottom=o-l.height-l.top,l.direction=n.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function m({children:e,isPresent:o,anchorX:n,anchorY:l,root:r,pop:a}){let f=(0,i.useId)(),h=(0,i.useRef)(null),p=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:g}=(0,i.useContext)(u.MotionConfigContext),x=function(...e){return s.useCallback(function(...e){return t=>{let s=!1,o=e.map(e=>{let o=c(e,t);return s||"function"!=typeof o||(s=!0),o});if(s)return()=>{for(let t=0;t<o.length;t++){let s=o[t];"function"==typeof s?s():c(e[t],null)}}}}(...e),e)}(h,!1!==a?e.props?.ref??e?.ref:void 0);return(0,i.useInsertionEffect)(()=>{let{width:e,height:t,top:s,left:i,right:u,bottom:c,direction:d}=p.current;if(o||!1===a||!h.current||!e||!t)return;let m="rtl"===d,x="left"===n?m?`right: ${u}`:`left: ${i}`:m?`left: ${i}`:`right: ${u}`,j="bottom"===l?`bottom: ${c}`:`top: ${s}`;h.current.dataset.motionPopId=f;let y=document.createElement("style");g&&(y.nonce=g);let v=r??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${f}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${e}px !important;
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
${x}px !important;
|
|
7
7
|
${j}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{h.current?.removeAttribute("data-motion-pop-id"),
|
|
9
|
+
`),()=>{h.current?.removeAttribute("data-motion-pop-id"),v.contains(y)&&v.removeChild(y)}},[o]),(0,t.jsx)(d,{isPresent:o,childRef:h,sizeRef:p,pop:a,children:!1===a?e:i.cloneElement(e,{ref:x})})}let f=({children:e,initial:o,isPresent:a,onExitComplete:i,custom:u,presenceAffectsLayout:c,mode:d,anchorX:f,anchorY:p,root:g})=>{let x=(0,n.useConstant)(h),j=(0,s.useId)(),y=(0,s.useRef)(a),v=(0,s.useRef)(i);(0,l.useIsomorphicLayoutEffect)(()=>{y.current=a,v.current=i});let b=!0,k=(0,s.useMemo)(()=>(b=!1,{id:j,initial:o,isPresent:a,custom:u,onExitComplete:e=>{for(let t of(x.set(e,!0),x.values()))if(!t)return;i&&i()},register:e=>(x.set(e,!1),()=>{x.delete(e),y.current||x.size||v.current?.()})}),[a,x,i]);return c&&b&&(k={...k}),(0,s.useMemo)(()=>{x.forEach((e,t)=>x.set(t,!1))},[a]),s.useEffect(()=>{a||x.size||!i||i()},[a]),e=(0,t.jsx)(m,{pop:"popLayout"===d,isPresent:a,anchorX:f,anchorY:p,root:g,children:e}),(0,t.jsx)(r.PresenceContext.Provider,{value:k,children:e})};function h(){return new Map}var p=e.i(64978);let g=e=>e.key||"";function x(e){let t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:r,initial:a=!0,onExitComplete:i,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1,anchorX:m="left",anchorY:h="top",root:j})=>{let[y,v]=(0,p.usePresence)(d),b=(0,s.useMemo)(()=>x(e),[e]),k=d&&!y?[]:b.map(g),w=(0,s.useRef)(!0),P=(0,n.useConstant)(()=>new Map),E=(0,s.useRef)(new Set),[C,$]=(0,s.useState)(b),[A,R]=(0,s.useState)(b);(0,l.useIsomorphicLayoutEffect)(()=>{!d||y||A.length||v?.()},[y,d,A.length,v]),(0,l.useIsomorphicLayoutEffect)(()=>{w.current=!1;for(let e=0;e<A.length;e++){let t=g(A[e]);k.includes(t)?(P.delete(t),E.current.delete(t)):!0!==P.get(t)&&P.set(t,!1)}},[A,k.length,k.join("-")]);let M=[];if(b!==C){let e=[...b],t=0;for(let s of A){let o=k.indexOf(g(s));-1===o?(e.splice(t++,0,s),M.push(s)):t=o+M.length+1}return M.every(e=>P.get(g(e)))?e=b:"wait"===c&&(e=M),R(x(e)),$(b),null}let{forceRender:L}=(0,s.useContext)(o.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:A.map(e=>{let s=g(e),o=(!d||!!y)&&(b===A||k.includes(s));return(0,t.jsx)(f,{isPresent:o,initial:(!w.current||!!a)&&void 0,custom:r,presenceAffectsLayout:u,mode:c,root:j,onExitComplete:o?void 0:()=>{if(E.current.has(s)||!P.has(s))return;E.current.add(s),P.set(s,!0);let e=!0;P.forEach(t=>{t||(e=!1)}),e&&(L?.(),$([]),d&&v?.(),i&&i())},anchorX:m,anchorY:h,children:e},s)})})}],88653)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73064,e=>{"use strict";var t=e.i(43476),l=e.i(71645),a=e.i(88653),s=e.i(46932),n=e.i(85709),i=e.i(83402),r=e.i(49721),o=e.i(68757);let d=e=>null==e?null:(e/1e5).toFixed(1),c=e=>null==e?null:Math.round(100*e);var u=e.i(46991);let m=({label:e,value:l,unit:a,min:s=0,max:n=100,icon:i,warningThreshold:o,criticalThreshold:d,size:c=120,showValue:u=!0,reversed:m=!1})=>{let h=null==l||isNaN(l)?"N/A":l,x="N/A"!==h,p=x?Math.min(100,Math.max(0,(l-s)/(n-s)*100)):0,f=x&&void 0!==d&&(m?l<=d:l>=d),g=x&&void 0!==o&&(m?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card tesla-hover flex flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"relative",style:{width:c,height:c},children:[(0,t.jsxs)("svg",{style:{width:c,height:c},className:"transform -rotate-90",viewBox:"0 0 100 100",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"var(--hud-border)",strokeWidth:"6"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:x?f?"var(--color-oRed)":g?"var(--color-oYellow)":"var(--color-oGreen)":"var(--color-oGray)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*40}`,strokeDashoffset:`${x?2*Math.PI*40*(1-p/100):2*Math.PI*40}`,className:"transition-all duration-1000"})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[i&&(0,t.jsx)(r.FontAwesomeIcon,{icon:i,className:"text-hud-muted text-sm mb-1"}),u&&(0,t.jsx)("div",{className:`text-value font-semibold tracking-tight gliding-value ${x?"text-hud-main":"text-hud-muted"} ${f||!m&&p>=90?"animate-soft-pulse":""}`,children:h}),u&&x&&a&&(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-secondary uppercase tracking-widest",children:a})]})]}),(0,t.jsx)("div",{className:"text-hud-muted text-caption font-semibold mt-1 text-center uppercase tracking-widest",children:e})]})},h=({label:e,value:l,unit:a,min:s=0,max:n=100,icon:i,warningThreshold:o,criticalThreshold:d,showMinMax:c=!1,reversed:u=!1})=>{let m=null==l||isNaN(l)?"N/A":`${l}${a?` ${a}`:""}`,h="N/A"!==m,x=h?Math.min(100,Math.max(0,(l-s)/(n-s)*100)):0,p=h&&void 0!==d&&(u?l<=d:l>=d),f=h&&void 0!==o&&(u?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center text-hud-muted text-caption font-semibold uppercase tracking-widest",children:[i&&(0,t.jsx)(r.FontAwesomeIcon,{icon:i,className:"mr-2 fa-fw opacity-50"}),e]}),(0,t.jsx)("div",{className:`font-semibold text-value gliding-value ${h?"text-hud-main":"text-hud-dim"} ${p||!u&&x>=90?"animate-soft-pulse":""}`,children:m})]}),(0,t.jsx)("div",{className:"relative w-full bg-hud-elevated rounded-full h-1.5 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${!h?"bg-hud-elevated":p?"bg-oRed":f?"bg-oYellow":"bg-oGreen"}`,style:{width:`${x}%`}})}),c&&(0,t.jsxs)("div",{className:"flex justify-between text-caption font-semibold text-hud-dim mt-2 uppercase tracking-tighter",children:[(0,t.jsx)("span",{children:s}),(0,t.jsx)("span",{children:n})]})]})},x=({label:e,value:l,unit:a,icon:s,warningThreshold:n,criticalThreshold:i,reversed:o=!1})=>{let d=null==l||"number"==typeof l&&Number.isNaN(l)?"N/A":l,c="N/A"!==d;return(0,t.jsxs)("div",{className:"tesla-card tesla-hover flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0 text-hud-muted text-caption font-semibold uppercase tracking-widest leading-snug",children:[s&&(0,t.jsx)(r.FontAwesomeIcon,{icon:s,className:"mr-2 fa-fw opacity-50 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0",children:e})]}),(0,t.jsx)("div",{className:`shrink-0 whitespace-nowrap font-semibold text-value gliding-value ${(()=>{if(!c)return"text-hud-dim";if(o){if(void 0!==i&&l<=i)return"text-oRed";if(void 0!==n&&l<=n)return"text-oYellow"}else{if(void 0!==i&&l>=i)return"text-oRed";if(void 0!==n&&l>=n)return"text-oYellow"}return"text-oGreen"})()} ${i&&(o?l<=i:l>=i)?"animate-soft-pulse":""}`,children:"N/A"!==d?`${d}${a?` ${a}`:""}`:"N/A"})]})},p=({label:e,value:l,unit:a,icon:s,max:n=100,warningThreshold:i,criticalThreshold:o,reversed:d=!1})=>{let c=null==l||isNaN(l)?"N/A":Math.round(l),u="N/A"!==c,m=u&&void 0!==o&&(d?l<=o:l>=o),h=u&&void 0!==i&&(d?l<=i:l>=i),x=u?Math.min(100,l/n*100):0;return(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover",children:[s&&(0,t.jsx)(r.FontAwesomeIcon,{icon:s,className:"text-lg text-hud-muted mb-2 opacity-50"}),(0,t.jsx)("div",{className:`text-hero font-medium mb-1 tracking-tight gliding-value ${!u?"text-hud-muted":m?"text-oRed":h?"text-oYellow":"text-oGreen"} ${m||!d&&x>=90?"animate-soft-pulse":""}`,children:c}),u&&a&&(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mb-2",children:a}),(0,t.jsx)("div",{className:"text-hud-muted text-caption font-semibold uppercase tracking-widest mb-3",children:e}),(0,t.jsx)("div",{className:"w-full bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${u?m?"bg-oRed":h?"bg-oYellow":"bg-oGreen":"bg-hud-elevated"}`,style:{width:`${x}%`}})})]})};e.i(85269);var f=e.i(22831);let g=({isOpen:e,onClose:a,onSave:s,currentEngineHours:n=null,lastRefillEngineHours:i=null,loading:d=!1})=>{let{t:c}=(0,f.useTranslation)(),[u,m]=(0,l.useState)({liters:"",cost:"",additive:!1,engineHours:"",hoursSinceLastRefill:""}),[h,x]=(0,l.useState)({});(0,l.useEffect)(()=>{if(e){let e=null!==n?Math.round(10*n)/10:"",t="";null!==n&&null!==i&&(t=Math.round((n-i)*10)/10),m({liters:"",cost:"",additive:!1,engineHours:e,hoursSinceLastRefill:t}),x({})}},[e,n,i]);let p=(e,t)=>{m(l=>({...l,[e]:t})),h[e]&&x(t=>({...t,[e]:null}))};return e?(0,t.jsx)("div",{className:"fixed inset-0 bg-hud-bg/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:a,children:(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-xl rounded-3xl p-6 sm:p-8 max-w-md w-full mx-4 shadow-2xl border border-hud max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,t.jsxs)("h3",{className:"text-value font-semibold text-hud-main flex items-center tracking-tight",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-3 text-oYellow"}),c("fuelLog.logFuelRefill")]}),(0,t.jsx)("button",{onClick:a,className:"w-10 h-10 rounded-full flex items-center justify-center text-hud-secondary hover:text-hud-main hover:bg-hud-elevated transition-all duration-300",disabled:d,children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faTimes,size:"lg"})})]}),(0,t.jsxs)("form",{onSubmit:e=>{let t;if(e.preventDefault(),t={},(!u.liters||0>=parseFloat(u.liters))&&(t.liters=c("fuelLog.errorLiters")),""!==u.cost&&0>parseFloat(u.cost)&&(t.cost=c("fuelLog.errorCost")),(!u.engineHours||0>parseFloat(u.engineHours))&&(t.engineHours=c("fuelLog.errorEngineHours")),x(t),0!==Object.keys(t).length)return;let l=""!==u.cost?parseFloat(u.cost):null;s({liters:parseFloat(u.liters),cost:l,additive:u.additive,engineHours:parseFloat(u.engineHours),hoursSinceLastRefill:u.hoursSinceLastRefill?parseFloat(u.hoursSinceLastRefill):null,previousEngineHours:i})},className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-2 text-oBlue"}),c("fuelLog.litersAdded")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.liters,onChange:e=>p("liters",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.liters?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 50",disabled:d}),h.liters&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.liters})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faEuroSign,className:"mr-2 text-oGreen"}),c("fuelLog.cost")," ",(0,t.jsxs)("span",{className:"text-hud-dim font-normal normal-case ml-1",children:["(",c("fuelLog.optional"),")"]})]}),(0,t.jsx)("input",{type:"number",step:"0.01",min:"0",value:u.cost,onChange:e=>p("cost",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.cost?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 85.50",disabled:d}),h.cost&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.cost})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-oYellow"}),c("fuelLog.currentEngineHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.engineHours,onChange:e=>(e=>{let t=parseFloat(e),l=u.hoursSinceLastRefill;if(!isNaN(t)&&null!==i){let e=Math.round((t-i)*10)/10;e>=0&&(l=e)}m(t=>({...t,engineHours:e,hoursSinceLastRefill:l})),h.engineHours&&x(e=>({...e,engineHours:null}))})(e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.engineHours?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 245.5",disabled:d}),h.engineHours&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.engineHours}),null!==n&&(0,t.jsxs)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:[c("fuelLog.signalkValue")," ",Math.round(10*n)/10," h"]}),null===n&&(0,t.jsx)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:c("fuelLog.noSignalkHours")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-hud-dim"}),c("fuelLog.hoursSinceLastRefill")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.hoursSinceLastRefill,onChange:e=>p("hoursSinceLastRefill",e.target.value),className:"w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border border-hud focus:border-oBlue focus:outline-none transition-all duration-300 disabled:opacity-60",placeholder:"Ex: 25.5",disabled:d||null!==i&&""!==u.hoursSinceLastRefill}),null!==i&&(0,t.jsxs)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:[c("fuelLog.lastRefillAt")," ",Math.round(10*i)/10," h"]})]}),(0,t.jsxs)("div",{className:"flex items-center p-1",children:[(0,t.jsx)("input",{type:"checkbox",id:"additive",checked:u.additive,onChange:e=>p("additive",e.target.checked),className:"w-5 h-5 rounded border-hud bg-hud-elevated text-oBlue focus:ring-oBlue transition-all duration-300",disabled:d}),(0,t.jsxs)("label",{htmlFor:"additive",className:"ml-3 text-label font-bold text-hud-secondary flex items-center cursor-pointer hover:text-hud-main transition-colors duration-300",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faFlask,className:"mr-2 text-oBlue opacity-70"}),c("fuelLog.additiveAdded")]})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-4 pt-6 border-t border-hud",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"px-6 py-3 bg-hud-elevated hover:bg-hud-bg text-hud-main font-bold rounded-xl transition-all duration-300",disabled:d,children:c("fuelLog.cancel")}),(0,t.jsx)("button",{type:"submit",className:"px-8 py-3 bg-oBlue hover:bg-oBlue/80 text-hud-main font-bold rounded-xl transition-all duration-300 flex items-center disabled:opacity-50 shadow-lg shadow-oBlue/20",disabled:d,children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"animate-spin mr-3 font-normal",children:"⏳"}),c("fuelLog.saving")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faSave,className:"mr-2"}),c("fuelLog.save")]})})]})]})]})}):null};var v=e.i(95430);let b=[{id:"oilChange",intervalHours:200,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:400,intervalMonths:12},{id:"fuelPreFilter",intervalHours:400,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:500,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:200,intervalMonths:12},{id:"saildriveDiaphragm",intervalHours:null,intervalMonths:84},{id:"engineMounts",intervalHours:null,intervalMonths:12}],j=[{id:"oilChange",intervalHours:100,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:200,intervalMonths:12},{id:"fuelPreFilter",intervalHours:200,intervalMonths:12},{id:"impeller",intervalHours:500,intervalMonths:12},{id:"driveBelt",intervalHours:250,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:250,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}],N={"volvo-d1-20":{name:"Volvo Penta D1-20",items:b},"volvo-d1-30":{name:"Volvo Penta D1-13/30",items:b},"volvo-d2-40":{name:"Volvo Penta D2-40/50",items:b},"yanmar-2ym15":{name:"Yanmar 2YM15",items:j},"yanmar-3ym30":{name:"Yanmar 3YM20/30",items:j},"generic-diesel":{name:"Generic diesel",items:[{id:"oilChange",intervalHours:150,intervalMonths:12},{id:"oilFilter",intervalHours:150,intervalMonths:12},{id:"fuelFilter",intervalHours:300,intervalMonths:12},{id:"fuelPreFilter",intervalHours:300,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:400,intervalMonths:12},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}]}},w="volvo-d1-20",y="ocearo_maintenance",k={hours:525,date:"2026-06-15"},T={engineModel:w,lastDone:{...Object.fromEntries(["oilChange","oilFilter","fuelFilter","fuelPreFilter","impeller","driveBelt","airFilter","anodes","saildriveOil","engineMounts"].map(e=>[e,{...k}])),saildriveDiaphragm:{hours:null,date:"2023-07-03"}}},M={overdue:{dot:"bg-oRed",text:"text-oRed"},due:{dot:"bg-oYellow",text:"text-oYellow"},ok:{dot:"bg-oGreen",text:"text-oGreen"},unknown:{dot:"bg-hud-muted",text:"text-hud-muted"}},R=()=>new Date().toISOString().slice(0,10),F=({currentEngineHours:e})=>{let{t:a}=(0,f.useTranslation)(),[s,n]=(0,l.useState)(()=>(()=>{try{let e=localStorage.getItem(y);if(e)return JSON.parse(e)}catch(e){}return T})()),[i,d]=(0,l.useState)(null),[c,u]=(0,l.useState)(""),[m,h]=(0,l.useState)(R()),x=N[s.engineModel]||N[w],p=(0,l.useCallback)(e=>{n(t=>{let l=e(t);try{localStorage.setItem(y,JSON.stringify(l))}catch(e){}return l})},[]),g=()=>{let e=parseFloat(c);p(t=>({...t,lastDone:{...t.lastDone,[i]:{hours:Number.isFinite(e)?e:null,date:m||R()}}})),d(null)},b=(0,l.useMemo)(()=>x.items.map(t=>({item:t,lastDone:s.lastDone[t.id]||null,...((e,t,l)=>{if(!t||null==t.hours&&!t.date)return{status:"unknown",hoursLeft:null,daysLeft:null,dueHours:null,dueDate:null};let a=null,s=null;null!=e.intervalHours&&null!=t.hours&&null!=l&&(a=Math.round(((s=t.hours+e.intervalHours)-l)*10)/10);let n=null,i=null;if(null!=e.intervalMonths&&t.date){let l=new Date(t.date);l.setMonth(l.getMonth()+e.intervalMonths),i=l,n=Math.floor((l.getTime()-(0,v.vesselNow)().getTime())/864e5)}let r="ok";return null!=a&&a<0||null!=n&&n<0?r="overdue":(null!=a&&a<=25||null!=n&&n<=30)&&(r="due"),{status:r,hoursLeft:a,daysLeft:n,dueHours:s,dueDate:i}})(t,s.lastDone[t.id],e)})),[x,s.lastDone,e]),j=b.filter(e=>"overdue"===e.status).length,k=b.filter(e=>"due"===e.status).length;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),a("maintenance.title")]}),(0,t.jsx)("select",{value:s.engineModel,onChange:e=>{p(t=>({...t,engineModel:e.target.value}))},className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-caption font-semibold uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:Object.entries(N).map(([e,l])=>(0,t.jsx)("option",{value:e,className:"bg-leftPaneBg text-hud-main",children:l.name},e))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:"tesla-card text-center ",children:[(0,t.jsx)("div",{className:"text-value font-semibold text-hud-main gliding-value",children:null!=e?e.toFixed(1):a("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("motor.currentEngineHours")})]}),(0,t.jsxs)("div",{className:`tesla-card text-center ${j>0?"bg-oRed/10 border-oRed/30":" "}`,children:[(0,t.jsx)("div",{className:`text-value font-semibold gliding-value ${j>0?"text-oRed":"text-hud-main"}`,children:j}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("maintenance.overdue")})]}),(0,t.jsxs)("div",{className:`tesla-card text-center ${k>0?"bg-oYellow/10 border-oYellow/30":" "}`,children:[(0,t.jsx)("div",{className:`text-value font-semibold gliding-value ${k>0?"text-oYellow":"text-hud-main"}`,children:k}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("maintenance.dueSoon")})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:b.map(({item:l,lastDone:n,status:x,hoursLeft:p,daysLeft:f,dueHours:v,dueDate:b})=>{let j=M[x],N=i===l.id;return(0,t.jsxs)("div",{className:"tesla-card tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,t.jsx)("span",{className:`w-2 h-2 rounded-full mr-3 flex-shrink-0 ${j.dot} ${"overdue"===x?"animate-soft-pulse":""}`}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest truncate",children:a(`maintenance.items.${l.id}`)}),(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight mt-0.5",children:[null!=l.intervalHours?`${l.intervalHours} h`:null,null!=l.intervalMonths?a("maintenance.everyMonths",{count:l.intervalMonths}):null].filter(Boolean).join(" / ")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-shrink-0",children:[(0,t.jsx)("div",{className:"text-right",children:"unknown"===x?(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest",children:a("maintenance.neverDone")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase tracking-widest ${j.text}`,children:"overdue"===x?a("maintenance.overdueLabel"):[null!=p?`${p.toFixed(0)} h`:null,null!=f?a("maintenance.inDays",{count:f}):null].filter(Boolean).join(" · ")}),(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold tracking-tight mt-0.5",children:[null!=v?`→ ${v.toFixed(0)} h`:null,b?`→ ${b.toLocaleDateString("fr-FR")}`:null].filter(Boolean).join(" · ")})]})}),(0,t.jsx)("button",{onClick:()=>{let t;return N?d(null):(t=s.lastDone[l.id],void(d(l.id),u(t?.hours!=null?String(t.hours):null!=e?e.toFixed(1):""),h(t?.date||R())))},className:"px-3 py-1.5 text-caption bg-hud-elevated text-hud-secondary rounded-sm font-semibold uppercase tracking-widest tesla-hover border border-hud transition-all duration-500",children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faWrench,className:"text-xs"})})]})]}),N&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-hud flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption text-hud-muted font-semibold uppercase tracking-widest mb-1",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-1 text-xs"}),a("maintenance.doneAtHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",value:c,onChange:e=>u(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-caption font-semibold border border-hud focus:outline-none w-28"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption text-hud-muted font-semibold uppercase tracking-widest mb-1",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCalendarDays,className:"mr-1 text-xs"}),a("maintenance.doneOnDate")]}),(0,t.jsx)("input",{type:"date",value:m,onChange:e=>h(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-caption font-semibold border border-hud focus:outline-none"})]}),(0,t.jsxs)("button",{onClick:g,className:"bg-oGreen/80 hover:bg-oGreen text-black px-4 py-1.5 rounded-sm text-caption font-semibold uppercase tracking-widest transition-all duration-500",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"mr-2 text-xs"}),a("maintenance.markDone")]}),n&&(0,t.jsxs)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight ml-auto",children:[a("maintenance.lastDone"),": ",null!=n.hours?`${n.hours} h`:"—"," · ",n.date?new Date(n.date).toLocaleDateString("fr-FR"):"—"]})]})]},l.id)})}),(0,t.jsxs)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-2 text-xs opacity-50"}),a("maintenance.disclaimer")]})]})};var C=e.i(66799),L=e.i(48390);let H=["chargeIndicator","checkEngine","commError","eGRSystem","emergencyStopMode","highBoostPressure","lowCoolantLevel","lowFuelPressure","lowOilLevel","lowOilPressure","lowSystemVoltage","maintenanceNeeded","neutralStartProtect","overTemperature","powerReduction","preheatIndicator","revLimitExceeded","shuttingDown","subOrSecondaryThrottle","throttlePositionSensor","warningLevel1","warningLevel2","waterFlow","waterInFuel","transmission.overTemperature","transmission.lowOilPressure","temperature","exhaustTemperature"],S=["notifications.environment.inside.engineRoom.temperature"],$=["alarm","emergency"],A=({notification:e})=>{let{t:a}=(0,f.useTranslation)(),[s,n]=(0,l.useState)(null),i=e.status;if(!e.id||!i)return null;let r=async t=>{n(t);try{await C.default.notificationAction(e.id,t)}catch(e){console.warn(`Notification ${t} failed:`,e?.message||e)}finally{n(null)}},o="px-3 py-1.5 rounded-sm border border-hud bg-hud-elevated text-hud-main tesla-hover disabled:opacity-40 transition-all";return(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 normal-case tracking-normal",children:[i.silenced?(0,t.jsx)("span",{className:"text-hud-muted",children:a("motor.alarmSilenced")}):i.canSilence&&(0,t.jsx)("button",{type:"button",className:o,disabled:null!==s,onClick:()=>r("silence"),children:a("motor.silenceAlarm")}),i.acknowledged?(0,t.jsx)("span",{className:"text-hud-muted",children:a("motor.alarmAcknowledged")}):i.canAcknowledge&&(0,t.jsx)("button",{type:"button",className:o,disabled:null!==s,onClick:()=>r("acknowledge"),children:a("motor.acknowledgeAlarm")})]})},P=["alert","warn","warning","caution"];e.s(["default",0,()=>{let{t:e}=(0,f.useTranslation)(),v=i.default.get("debugMode"),[b,j]=(0,l.useState)("0"),[N,w]=(0,l.useState)("engine"),[y,k]=(0,l.useState)([]),[T,M]=(0,l.useState)(!1),R=(0,l.useMemo)(()=>{let e=[],t=["revolutions","runTime","coolantTemperature","temperature","exhaustTemperature","coolantPressure","boostPressure","oilPressure","oilTemperature","fuel.rate","fuel.pressure","load","torque","intakeManifoldTemperature","tilt","state","transmission.gear","transmission.oilPressure","transmission.oilTemperature"];return["0","1","port","main","starboard"].forEach(l=>{t.forEach(t=>{e.push(`propulsion.${l}.${t}`)}),H.forEach(t=>{e.push(`notifications.propulsion.${l}.${t}`)})}),e.push("environment.inside.engineRoom.temperature",...S),e.push("electrical.batteries.0.voltage","electrical.batteries.0.current","electrical.batteries.1.voltage","electrical.batteries.1.current","electrical.alternators.0.voltage","electrical.alternators.1.voltage","electrical.alternators.0.current","electrical.alternators.1.current","tanks.fuel.0.currentLevel","tanks.fuel.0.capacity"),e},[]),C=(0,n.useSignalKPaths)(R),E=(0,n.useSignalKPath)("navigation.position"),B=(0,l.useCallback)(e=>C[e]??null,[C]),I=(0,l.useCallback)(()=>{let t=[];for(let l=0;l<=1;l++){let a=B(`propulsion.${l}.revolutions`),s=B(`propulsion.${l}.runTime`);0===l&&null===a&&null===s?(a=B("propulsion.port.revolutions")??B("propulsion.main.revolutions"),s=B("propulsion.port.runTime")??B("propulsion.main.runTime")):1===l&&null===a&&null===s&&(a=B("propulsion.starboard.revolutions"),s=B("propulsion.starboard.runTime")),(null!==a||null!==s||v)&&t.push({id:l.toString(),name:0===l?e("motor.portMainEngine"):e("motor.starboardEngine"),hasData:null!==a||null!==s})}return t.length>0?t:[{id:"0",name:e("motor.mainEngine"),hasData:!1}]},[B,v,e]);(0,l.useEffect)(()=>{k(I())},[I]);let D=(0,l.useCallback)(e=>{let t=B(`propulsion.${b}.${e}`);return null===t&&"0"===b?t=B(`propulsion.port.${e}`)??B(`propulsion.main.${e}`):null===t&&"1"===b&&(t=B(`propulsion.starboard.${e}`)),t},[b,B]),G=(0,l.useMemo)(()=>{var e,t;let l=D("coolantTemperature")??D("temperature")??B("propulsion.port.temperature"),a=D("exhaustTemperature")??B("propulsion.main.exhaustTemperature");return{rpm:null==(e=D("revolutions"))?null:60*e,runTime:(e=>{if(null==e)return null;let t=(e/3600).toFixed(1);return`${t} h`})(D("runTime")),coolantTemp:u.kelvinToCelsius(l),coolantPressure:d(D("coolantPressure")),boostPressure:d(D("boostPressure")),oilPressure:d(D("oilPressure")),oilTemp:u.kelvinToCelsius(D("oilTemperature")),fuelRate:null==(t=D("fuel.rate"))?null:Math.round(1e3*t*3600),fuelPressure:d(D("fuel.pressure")),load:c(D("load")),torque:c(D("torque")),exhaustTemp:u.kelvinToCelsius(a),engineRoomTemp:u.kelvinToCelsius(B("environment.inside.engineRoom.temperature")),intakeTemp:u.kelvinToCelsius(D("intakeManifoldTemperature")),tilt:u.radiansToDegrees(D("tilt")),state:D("state"),gear:D("transmission.gear"),transOilPressure:d(D("transmission.oilPressure")),transOilTemp:u.kelvinToCelsius(D("transmission.oilTemperature")),batteryVoltage:B("electrical.batteries.0.voltage"),batteryCurrent:B("electrical.batteries.0.current"),alternatorVoltage:B(`electrical.alternators.${b}.voltage`)??B("propulsion.port.alternatorVoltage"),alternatorCurrent:B(`electrical.alternators.${b}.current`)??B("propulsion.port.alternatorCurrent"),fuelLevel:c(B("tanks.fuel.0.currentLevel")),fuelCapacity:B("tanks.fuel.0.capacity")}},[b,D,B]),O=(0,l.useMemo)(()=>{let e=[];return H.forEach(t=>{let l=B(`notifications.propulsion.${b}.${t}`);l||"0"!==b?l||"1"!==b||(l=B(`notifications.propulsion.starboard.${t}`)):l=B(`notifications.propulsion.port.${t}`)??B(`notifications.propulsion.main.${t}`),l&&"object"==typeof l&&e.push({type:t,...l})}),S.forEach(t=>{let l=B(t);l&&"object"==typeof l&&e.push({type:"engineRoomTemperature",...l})}),e},[b,B]),Y=(0,l.useMemo)(()=>O.filter(e=>e.state&&"normal"!==e.state&&"nominal"!==e.state),[O]),V=Y.some(e=>$.includes(e.state)),W=Y.some(e=>P.includes(e.state)),z=B("electrical.batteries.1.current"),U="number"==typeof z?Math.round(10*z)/10:z,_=D("runTime"),q=null!==_?_/3600:null;(0,l.useEffect)(()=>{if(null!==q)try{localStorage.setItem("ocearo_lastEngineHours",String(q))}catch(e){}},[q]);let[K,Z]=(0,l.useState)(!1),[J,Q]=(0,l.useState)([]),[X,ee]=(0,l.useState)(null),[et,el]=(0,l.useState)(!1),[ea,es]=(0,l.useState)(null),en=(0,l.useMemo)(()=>{if(null!==q)return q;try{let e=parseFloat(localStorage.getItem("ocearo_lastEngineHours"));if(Number.isFinite(e))return e}catch(e){}return X?.lastRefill?.engineHours??null},[q,X]),ei=(0,l.useCallback)(async()=>{el(!0),es(null);try{let e=await (0,L.fetchFuelLogEntries)();Q(e);let t=(0,L.calculateFuelStats)(e,G.fuelCapacity);ee(t)}catch(e){es((0,L.handleOcearoCoreError)(e,"Fuel log fetch")),Q([]),ee(null)}finally{el(!1)}},[G.fuelCapacity]);(0,l.useEffect)(()=>{"fuel"===N&&ei()},[N,ei]);let er=(0,l.useCallback)(async e=>{el(!0),es(null);try{await (0,L.addFuelLogEntry)(e,E),Z(!1),await ei()}catch(e){es((0,L.handleOcearoCoreError)(e,"Fuel log save"))}finally{el(!1)}},[E,ei]),eo=X?.lastRefill?.engineHours||null,ed=(0,l.useMemo)(()=>(0,L.estimateTankLevel)(J,en,G.fuelCapacity,null!==G.fuelLevel?G.fuelLevel/100:null),[J,en,G.fuelCapacity,G.fuelLevel]);return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg",children:[{id:"engine",label:e("motor.engine"),icon:o.faCar},{id:"maintenance",label:e("motor.maintenance"),icon:o.faWrench},{id:"electrical",label:e("motor.electrical"),icon:o.faBolt},{id:"fuel",label:e("motor.fuel"),icon:o.faGasPump},{id:"warnings",label:e("motor.warnings"),icon:o.faExclamationTriangle}].map(e=>(0,t.jsxs)("button",{onClick:()=>w(e.id),className:`flex-1 py-3 px-2 text-caption font-semibold uppercase flex items-center justify-center transition-all duration-500 ${N===e.id?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label,"warnings"===e.id&&(V||W)&&(0,t.jsx)("span",{className:`ml-2 w-2 h-2 rounded-full animate-soft-pulse ${V?"bg-oRed":"bg-oYellow"}`})]},e.id))}),Y.length>0&&"warnings"!==N&&(0,t.jsxs)("button",{onClick:()=>w("warnings"),className:`w-full text-left px-4 py-2 text-caption font-semibold uppercase tracking-widest flex items-center border-b ${V?"bg-oRed/15 border-oRed/30 text-oRed animate-soft-pulse":"bg-oYellow/15 border-oYellow/30 text-oYellow"}`,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-3"}),(0,t.jsx)("span",{className:"truncate",children:Y.map(e=>e.message||e.type.replace(/([A-Z])/g," $1").trim()).join(" — ")})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsx)(a.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(s.motion.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.4,ease:"easeOut"},className:"p-3",children:["engine"===N&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h2",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),e("motor.propulsionSystems")]}),(0,t.jsx)("select",{value:b,onChange:e=>j(e.target.value),className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-caption font-semibold uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:y.map(e=>(0,t.jsx)("option",{value:e.id,className:"bg-leftPaneBg text-hud-main",children:e.name},e.id))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[(0,t.jsx)(p,{label:e("motor.propulsionSpeed"),value:G.rpm,unit:"RPM",icon:o.faTachometerAlt,max:4e3,warningThreshold:3200,criticalThreshold:3600}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover flex flex-col justify-center ",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"text-lg text-hud-dim mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-value font-semibold text-hud-main leading-none gliding-value tracking-tight",children:G.runTime||e("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase mt-2 tracking-[0.2em]",children:e("motor.serviceHours")})]}),(0,t.jsx)(m,{label:e("motor.load"),value:G.load,unit:"%",min:0,max:100,icon:o.faChartLine,warningThreshold:70,criticalThreshold:85,size:100}),(0,t.jsx)(m,{label:e("motor.torque"),value:G.torque,unit:"%",min:0,max:100,icon:o.faRotate,warningThreshold:75,criticalThreshold:90,size:100})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faTemperatureHalf,className:"mr-2 text-oYellow text-xs"}),e("motor.temperatureSection")]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(m,{label:e("motor.coolant"),value:G.coolantTemp,unit:"°C",min:0,max:120,icon:o.faSnowflake,warningThreshold:95,criticalThreshold:100,size:90}),(0,t.jsx)(m,{label:e("motor.oil"),value:G.oilTemp,unit:"°C",min:0,max:150,icon:o.faOilCan,warningThreshold:110,criticalThreshold:130,size:90}),(0,t.jsx)(m,{label:e("motor.engineRoom"),value:G.engineRoomTemp,unit:"°C",min:0,max:120,icon:o.faFire,warningThreshold:55,criticalThreshold:70,size:90}),(0,t.jsx)(m,{label:e("motor.intake"),value:G.intakeTemp,unit:"°C",min:0,max:100,icon:o.faArrowDown,warningThreshold:60,criticalThreshold:80,size:90})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGaugeHigh,className:"mr-2 text-oBlue text-xs"}),e("motor.pressures")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(h,{label:e("motor.oil"),value:G.oilPressure,unit:"bar",min:0,max:6,icon:o.faOilCan,warningThreshold:1.5,criticalThreshold:1,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.coolant"),value:G.coolantPressure,unit:"bar",min:0,max:3,icon:o.faWater,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.boost"),value:G.boostPressure,unit:"bar",min:0,max:2.5,icon:o.faArrowUp,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.fuel"),value:G.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGasPump,warningThreshold:2.5,criticalThreshold:2,reversed:!0,showMinMax:!0})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(x,{label:e("motor.state"),value:G.state||e("motor.unknown"),icon:o.faCar}),(0,t.jsx)(x,{label:e("motor.alternatorOutput"),value:G.alternatorVoltage?.toFixed?.(1)??G.alternatorVoltage,unit:"V",icon:o.faBolt}),(0,t.jsx)(x,{label:e("motor.tilt"),value:G.tilt,unit:"°",icon:o.faRuler}),(0,t.jsx)(x,{label:e("motor.fuelRate"),value:G.fuelRate,unit:"L/h",icon:o.faGasPump}),(0,t.jsx)(x,{label:e("motor.transmissionGear"),value:((e,t)=>{if(null==e)return null;if("string"==typeof e){let l=e.trim().toLowerCase();return l.startsWith("forw")?t("motor.forward"):l.startsWith("neut")?t("motor.neutral"):l.startsWith("rev")?t("motor.reverse"):e}return -1===e?t("motor.reverse"):0===e?t("motor.neutral"):e>1?`${t("motor.forward")} ${e}`:t("motor.forward")})(G.gear,e),icon:o.faCogs}),(0,t.jsx)(x,{label:e("motor.transOilPressure"),value:G.transOilPressure,unit:"bar",icon:o.faOilCan}),(0,t.jsx)(x,{label:e("motor.transOilTemp"),value:G.transOilTemp,unit:"°C",icon:o.faTemperatureHalf})]})]}),"maintenance"===N&&(0,t.jsx)(F,{currentEngineHours:en}),"electrical"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.energyDistribution")]}),(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)("h4",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest px-1",children:e("motor.ignitionBank")}),(0,t.jsx)(h,{label:e("motor.voltageNode"),value:G.batteryVoltage,unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.amperageLoad"),value:G.batteryCurrent,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest px-1",children:e("motor.serviceBank")}),(0,t.jsx)(h,{label:e("motor.voltageNode"),value:B("electrical.batteries.1.voltage"),unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.amperageLoad"),value:U,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.chargingSystems")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(m,{label:e("motor.alternatorOutput"),value:G.alternatorVoltage,unit:"V",min:10,max:16,icon:o.faBolt,warningThreshold:15,criticalThreshold:15.5,size:120}),(0,t.jsx)(m,{label:e("motor.chargeIntensity"),value:G.alternatorCurrent,unit:"A",min:0,max:100,icon:o.faBolt,size:120})]})]})]}),"fuel"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oYellow mr-3 animate-soft-pulse"}),e("motor.resourceManagement")]}),(0,t.jsxs)("button",{onClick:()=>Z(!0),className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded-sm text-caption font-semibold uppercase tracking-widest transition-all duration-500 flex items-center shadow-lg shadow-oBlue/20",disabled:et,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faPlus,className:"mr-2 text-xs"}),e("motor.registerRefill")]})]}),ea&&(0,t.jsxs)("div",{className:"tesla-card bg-oRed/10 border-oRed/20 text-oRed text-caption font-semibold uppercase tracking-widest animate-soft-pulse",children:[e("motor.nodeError")," ",ea]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(m,{label:e("motor.consumptionRate"),value:G.fuelRate,unit:"L/h",min:0,max:50,icon:o.faGasPump,size:100}),(0,t.jsx)(m,{label:e("motor.injectionPressure"),value:G.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGaugeHigh,warningThreshold:2.5,criticalThreshold:2,reversed:!0,size:100}),(0,t.jsx)(m,{label:e("motor.primaryReservoir"),value:G.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,size:100})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.telemetryDetails")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(h,{label:e("motor.levelPercentage"),value:G.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.totalCapacity"),value:G.fuelCapacity?.toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(x,{label:e("motor.currentEngineHours"),value:en?.toFixed(1),unit:"h",icon:o.faClock})]}),null!==G.fuelLevel&&null!==G.fuelCapacity&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(x,{label:e("motor.currentVolume"),value:(G.fuelLevel/100*G.fuelCapacity).toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(x,{label:e("motor.enduranceEst"),value:G.fuelRate>0&&null!==G.fuelLevel&&null!==G.fuelCapacity?(G.fuelLevel/100*G.fuelCapacity/G.fuelRate).toFixed(1):"N/A",unit:G.fuelRate>0?"h":"",icon:o.faClock})]})]}),ed&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.predictiveAnalysis")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[null!==ed.estimatedLiters&&(0,t.jsx)(x,{label:e("motor.estimatedVolume"),value:null!==ed.estimatedLitersWorst&&ed.estimatedLitersWorst!==ed.estimatedLiters?`${ed.estimatedLitersWorst.toFixed(0)}–${ed.estimatedLiters.toFixed(0)}`:ed.estimatedLiters,unit:"L",icon:o.faGasPump}),null!==ed.estimatedPercent&&(0,t.jsx)(h,{label:e("motor.computedLevel"),value:ed.estimatedPercentWorst??ed.estimatedPercent,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0}),null!==ed.hoursRemaining&&(0,t.jsx)(x,{label:e("motor.timeToExhaustion"),value:null!==ed.hoursRemainingWorst&&ed.hoursRemainingWorst!==ed.hoursRemaining?`${ed.hoursRemainingWorst.toFixed(0)}–${ed.hoursRemaining.toFixed(0)}`:ed.hoursRemaining,unit:"h",icon:o.faClock,warningThreshold:10,criticalThreshold:5,reversed:!0})]})]}),J.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-hud-muted mr-3"}),e("motor.logHistory")]}),(0,t.jsx)("div",{className:"tesla-card overflow-hidden transition-all duration-500 ",children:(0,t.jsxs)("table",{className:"w-full text-caption font-semibold uppercase tracking-widest",children:[(0,t.jsx)("thead",{className:"bg-hud-elevated",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.meridianDate")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.liters")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.refillCost")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hmr")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.avgConsumption")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hoursSinceRefill")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-center font-black",children:e("motor.additive")})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-hud",children:[...J].reverse().map((e,l)=>{let a=e.fuel||{},s=a.liters&&a.hoursSinceLastRefill&&a.hoursSinceLastRefill>0?Math.round(a.liters/a.hoursSinceLastRefill*10)/10:null,n=a.hoursSinceLastRefill&&a.hoursSinceLastRefill>0?Math.round(10*a.hoursSinceLastRefill)/10:null;return(0,t.jsxs)("tr",{className:"text-hud-main tesla-hover group",children:[(0,t.jsx)("td",{className:"p-4 opacity-60 group-hover:opacity-100 transition-opacity",children:new Date(e.datetime).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric"})}),(0,t.jsxs)("td",{className:"p-4 gliding-value text-oBlue",children:[a.liters," L"]}),(0,t.jsx)("td",{className:"p-4 gliding-value",children:null!=a.cost?`${a.cost} €`:"—"}),(0,t.jsxs)("td",{className:"p-4 gliding-value opacity-60",children:[a.engineHoursAtRefill," h"]}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oYellow",children:null!=s?`${s} L/h`:"—"}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oGreen",children:null!=n?`${n} h`:"—"}),(0,t.jsx)("td",{className:"p-4 text-center",children:a.additive?(0,t.jsx)("span",{className:"text-oBlue animate-soft-pulse",children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faFlask,className:"text-xs"})}):(0,t.jsx)("span",{className:"text-hud-dim font-black",children:"—"})})]},e.datetime||l)})})]})})]})]}),"warnings"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oRed mr-3 animate-soft-pulse"}),e("motor.warningsSummary")]}),(0,t.jsx)("button",{onClick:()=>M(!T),className:"px-4 py-1.5 text-caption bg-hud-elevated text-hud-secondary rounded-sm font-semibold uppercase tracking-widest tesla-hover border border-hud transition-all duration-500 shadow-soft",children:T?e("motor.showLess"):e("motor.showAll")})]}),0===Y.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"text-center text-hud-secondary py-8 tesla-card ",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-4xl mb-4 text-oGreen/40 animate-soft-pulse"}),(0,t.jsx)("h4",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em]",children:e("motor.allSystemsNominal")}),(0,t.jsx)("p",{className:"text-caption font-semibold mt-2 uppercase text-hud-muted tracking-widest opacity-60",children:e("motor.noActiveWarnings")})]}),T&&O.length>0&&(0,t.jsxs)("div",{className:"tesla-card bg-oGreen/5 border-oGreen/10 ",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oGreen mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.healthyTelemetryNodes")," (",O.length,")"]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 text-caption font-semibold uppercase tracking-tight",children:O.map((e,l)=>(0,t.jsxs)("div",{className:"text-hud-secondary flex items-center bg-hud-elevated p-3 rounded-sm tesla-hover border border-hud",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-oGreen mr-3 text-xs opacity-40"}),(0,t.jsx)("span",{className:"truncate opacity-60",children:e.type.replace(/([A-Z])/g," $1").trim()})]},l))})]})]}):(0,t.jsxs)("div",{className:"space-y-8",children:[V&&(0,t.jsxs)("div",{className:"bg-oRed/5 border border-oRed/20 p-6 rounded-sm shadow-soft animate-soft-pulse",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oRed mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oRed mr-3"}),e("motor.criticalNodeAlarms")]}),(0,t.jsx)("div",{className:"space-y-4",children:O.filter(e=>$.includes(e.state)).map((l,a)=>(0,t.jsxs)("div",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest bg-oRed/10 p-4 rounded-sm tesla-hover border border-oRed/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-caption",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oRed text-caption font-semibold tracking-tighter",children:e("motor.alertLevel3")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption mt-3 normal-case font-semibold tracking-normal opacity-80",children:l.message}),(0,t.jsx)(A,{notification:l})]},a))})]}),W&&(0,t.jsxs)("div",{className:"bg-oYellow/5 border border-oYellow/20 p-6 rounded-sm shadow-soft",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oYellow mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.systemAnomalies")]}),(0,t.jsx)("div",{className:"space-y-4",children:O.filter(e=>P.includes(e.state)).map((l,a)=>(0,t.jsxs)("div",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest bg-oYellow/10 p-4 rounded-sm tesla-hover border border-oYellow/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-caption",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oYellow text-caption font-semibold tracking-tighter",children:e("motor.warnLevel2")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption mt-3 normal-case font-semibold tracking-normal opacity-80",children:l.message}),(0,t.jsx)(A,{notification:l})]},a))})]})]})]}),v&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-oBlue mb-6 uppercase tracking-[0.3em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.internalDebugTelemetry")]}),(0,t.jsx)("div",{className:"space-y-4 text-caption font-semibold font-mono text-hud-secondary uppercase tracking-widest",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.REVOLUTIONS:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".revs"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.REVOLUTIONS:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:B(`propulsion.${b}.revolutions`)??"NULL"}),(0,t.jsx)("div",{className:"col-span-2 my-4 border-t border-hud"}),(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.TEMPERATURE:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".temp"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.TEMPERATURE:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:B(`propulsion.${b}.coolantTemperature`)??"NULL"})]})})]})]})]},N)})}),(0,t.jsx)(g,{isOpen:K,onClose:()=>Z(!1),onSave:er,currentEngineHours:en,lastRefillEngineHours:eo,loading:et})]})}],73064)},8161,function(e){e.n(e.i(73064))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73064,e=>{"use strict";var t=e.i(43476),l=e.i(71645),a=e.i(88653),s=e.i(46932),n=e.i(85709),i=e.i(83402),r=e.i(49721),o=e.i(68757);let d=e=>null==e?null:(e/1e5).toFixed(1),c=e=>null==e?null:Math.round(100*e);var u=e.i(46991);let m=({label:e,value:l,unit:a,min:s=0,max:n=100,icon:i,warningThreshold:o,criticalThreshold:d,size:c=120,showValue:u=!0,reversed:m=!1})=>{let h=null==l||isNaN(l)?"N/A":l,x="N/A"!==h,p=x?Math.min(100,Math.max(0,(l-s)/(n-s)*100)):0,f=x&&void 0!==d&&(m?l<=d:l>=d),g=x&&void 0!==o&&(m?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card tesla-hover flex flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"relative",style:{width:c,height:c},children:[(0,t.jsxs)("svg",{style:{width:c,height:c},className:"transform -rotate-90",viewBox:"0 0 100 100",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"var(--hud-border)",strokeWidth:"6"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:x?f?"var(--color-oRed)":g?"var(--color-oYellow)":"var(--color-oGreen)":"var(--color-oGray)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*40}`,strokeDashoffset:`${x?2*Math.PI*40*(1-p/100):2*Math.PI*40}`,className:"transition-all duration-1000"})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[i&&(0,t.jsx)(r.FontAwesomeIcon,{icon:i,className:"text-hud-muted text-sm mb-1"}),u&&(0,t.jsx)("div",{className:`text-value font-semibold tracking-tight gliding-value ${x?"text-hud-main":"text-hud-muted"} ${f||!m&&p>=90?"animate-soft-pulse":""}`,children:h}),u&&x&&a&&(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-secondary uppercase tracking-widest",children:a})]})]}),(0,t.jsx)("div",{className:"text-hud-muted text-caption font-semibold mt-1 text-center uppercase tracking-widest",children:e})]})},h=({label:e,value:l,unit:a,min:s=0,max:n=100,icon:i,warningThreshold:o,criticalThreshold:d,showMinMax:c=!1,reversed:u=!1})=>{let m=null==l||isNaN(l)?"N/A":`${l}${a?` ${a}`:""}`,h="N/A"!==m,x=h?Math.min(100,Math.max(0,(l-s)/(n-s)*100)):0,p=h&&void 0!==d&&(u?l<=d:l>=d),f=h&&void 0!==o&&(u?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center text-hud-muted text-caption font-semibold uppercase tracking-widest",children:[i&&(0,t.jsx)(r.FontAwesomeIcon,{icon:i,className:"mr-2 fa-fw opacity-50"}),e]}),(0,t.jsx)("div",{className:`font-semibold text-value gliding-value ${h?"text-hud-main":"text-hud-dim"} ${p||!u&&x>=90?"animate-soft-pulse":""}`,children:m})]}),(0,t.jsx)("div",{className:"relative w-full bg-hud-elevated rounded-full h-1.5 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${!h?"bg-hud-elevated":p?"bg-oRed":f?"bg-oYellow":"bg-oGreen"}`,style:{width:`${x}%`}})}),c&&(0,t.jsxs)("div",{className:"flex justify-between text-caption font-semibold text-hud-dim mt-2 uppercase tracking-tighter",children:[(0,t.jsx)("span",{children:s}),(0,t.jsx)("span",{children:n})]})]})},x=({label:e,value:l,unit:a,icon:s,warningThreshold:n,criticalThreshold:i,reversed:o=!1})=>{let d=null==l||"number"==typeof l&&Number.isNaN(l)?"N/A":l,c="N/A"!==d;return(0,t.jsxs)("div",{className:"tesla-card tesla-hover flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0 text-hud-muted text-caption font-semibold uppercase tracking-widest leading-snug",children:[s&&(0,t.jsx)(r.FontAwesomeIcon,{icon:s,className:"mr-2 fa-fw opacity-50 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0",children:e})]}),(0,t.jsx)("div",{className:`shrink-0 whitespace-nowrap font-semibold text-value gliding-value ${(()=>{if(!c)return"text-hud-dim";if(o){if(void 0!==i&&l<=i)return"text-oRed";if(void 0!==n&&l<=n)return"text-oYellow"}else{if(void 0!==i&&l>=i)return"text-oRed";if(void 0!==n&&l>=n)return"text-oYellow"}return"text-oGreen"})()} ${i&&(o?l<=i:l>=i)?"animate-soft-pulse":""}`,children:"N/A"!==d?`${d}${a?` ${a}`:""}`:"N/A"})]})},p=({label:e,value:l,unit:a,icon:s,max:n=100,warningThreshold:i,criticalThreshold:o,reversed:d=!1})=>{let c=null==l||isNaN(l)?"N/A":Math.round(l),u="N/A"!==c,m=u&&void 0!==o&&(d?l<=o:l>=o),h=u&&void 0!==i&&(d?l<=i:l>=i),x=u?Math.min(100,l/n*100):0;return(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover",children:[s&&(0,t.jsx)(r.FontAwesomeIcon,{icon:s,className:"text-lg text-hud-muted mb-2 opacity-50"}),(0,t.jsx)("div",{className:`text-hero font-medium mb-1 tracking-tight gliding-value ${!u?"text-hud-muted":m?"text-oRed":h?"text-oYellow":"text-oGreen"} ${m||!d&&x>=90?"animate-soft-pulse":""}`,children:c}),u&&a&&(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mb-2",children:a}),(0,t.jsx)("div",{className:"text-hud-muted text-caption font-semibold uppercase tracking-widest mb-3",children:e}),(0,t.jsx)("div",{className:"w-full bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${u?m?"bg-oRed":h?"bg-oYellow":"bg-oGreen":"bg-hud-elevated"}`,style:{width:`${x}%`}})})]})};e.i(85269);var f=e.i(22831);let g=({isOpen:e,onClose:a,onSave:s,currentEngineHours:n=null,lastRefillEngineHours:i=null,loading:d=!1})=>{let{t:c}=(0,f.useTranslation)(),[u,m]=(0,l.useState)({liters:"",cost:"",additive:!1,engineHours:"",hoursSinceLastRefill:""}),[h,x]=(0,l.useState)({});(0,l.useEffect)(()=>{if(e){let e=null!==n?Math.round(10*n)/10:"",t="";null!==n&&null!==i&&(t=Math.round((n-i)*10)/10),m({liters:"",cost:"",additive:!1,engineHours:e,hoursSinceLastRefill:t}),x({})}},[e,n,i]);let p=(e,t)=>{m(l=>({...l,[e]:t})),h[e]&&x(t=>({...t,[e]:null}))};return e?(0,t.jsx)("div",{className:"fixed inset-0 bg-hud-bg/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:a,children:(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-xl rounded-3xl p-6 sm:p-8 max-w-md w-full mx-4 shadow-2xl border border-hud max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,t.jsxs)("h3",{className:"text-value font-semibold text-hud-main flex items-center tracking-tight",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-3 text-oYellow"}),c("fuelLog.logFuelRefill")]}),(0,t.jsx)("button",{onClick:a,className:"w-10 h-10 rounded-full flex items-center justify-center text-hud-secondary hover:text-hud-main hover:bg-hud-elevated transition-all duration-300",disabled:d,children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faTimes,size:"lg"})})]}),(0,t.jsxs)("form",{onSubmit:e=>{let t;if(e.preventDefault(),t={},(!u.liters||0>=parseFloat(u.liters))&&(t.liters=c("fuelLog.errorLiters")),""!==u.cost&&0>parseFloat(u.cost)&&(t.cost=c("fuelLog.errorCost")),(!u.engineHours||0>parseFloat(u.engineHours))&&(t.engineHours=c("fuelLog.errorEngineHours")),x(t),0!==Object.keys(t).length)return;let l=""!==u.cost?parseFloat(u.cost):null;s({liters:parseFloat(u.liters),cost:l,additive:u.additive,engineHours:parseFloat(u.engineHours),hoursSinceLastRefill:u.hoursSinceLastRefill?parseFloat(u.hoursSinceLastRefill):null,previousEngineHours:i})},className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-2 text-oBlue"}),c("fuelLog.litersAdded")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.liters,onChange:e=>p("liters",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.liters?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 50",disabled:d}),h.liters&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.liters})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faEuroSign,className:"mr-2 text-oGreen"}),c("fuelLog.cost")," ",(0,t.jsxs)("span",{className:"text-hud-dim font-normal normal-case ml-1",children:["(",c("fuelLog.optional"),")"]})]}),(0,t.jsx)("input",{type:"number",step:"0.01",min:"0",value:u.cost,onChange:e=>p("cost",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.cost?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 85.50",disabled:d}),h.cost&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.cost})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-oYellow"}),c("fuelLog.currentEngineHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.engineHours,onChange:e=>(e=>{let t=parseFloat(e),l=u.hoursSinceLastRefill;if(!isNaN(t)&&null!==i){let e=Math.round((t-i)*10)/10;e>=0&&(l=e)}m(t=>({...t,engineHours:e,hoursSinceLastRefill:l})),h.engineHours&&x(e=>({...e,engineHours:null}))})(e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${h.engineHours?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 245.5",disabled:d}),h.engineHours&&(0,t.jsx)("p",{className:"text-oRed text-caption mt-2 font-medium",children:h.engineHours}),null!==n&&(0,t.jsxs)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:[c("fuelLog.signalkValue")," ",Math.round(10*n)/10," h"]}),null===n&&(0,t.jsx)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:c("fuelLog.noSignalkHours")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-hud-dim"}),c("fuelLog.hoursSinceLastRefill")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.hoursSinceLastRefill,onChange:e=>p("hoursSinceLastRefill",e.target.value),className:"w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border border-hud focus:border-oBlue focus:outline-none transition-all duration-300 disabled:opacity-60",placeholder:"Ex: 25.5",disabled:d||null!==i&&""!==u.hoursSinceLastRefill}),null!==i&&(0,t.jsxs)("p",{className:"text-hud-dim text-caption mt-2 font-medium",children:[c("fuelLog.lastRefillAt")," ",Math.round(10*i)/10," h"]})]}),(0,t.jsxs)("div",{className:"flex items-center p-1",children:[(0,t.jsx)("input",{type:"checkbox",id:"additive",checked:u.additive,onChange:e=>p("additive",e.target.checked),className:"w-5 h-5 rounded border-hud bg-hud-elevated text-oBlue focus:ring-oBlue transition-all duration-300",disabled:d}),(0,t.jsxs)("label",{htmlFor:"additive",className:"ml-3 text-label font-bold text-hud-secondary flex items-center cursor-pointer hover:text-hud-main transition-colors duration-300",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faFlask,className:"mr-2 text-oBlue opacity-70"}),c("fuelLog.additiveAdded")]})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-4 pt-6 border-t border-hud",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"px-6 py-3 bg-hud-elevated hover:bg-hud-bg text-hud-main font-bold rounded-xl transition-all duration-300",disabled:d,children:c("fuelLog.cancel")}),(0,t.jsx)("button",{type:"submit",className:"px-8 py-3 bg-oBlue hover:bg-oBlue/80 text-hud-main font-bold rounded-xl transition-all duration-300 flex items-center disabled:opacity-50 shadow-lg shadow-oBlue/20",disabled:d,children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"animate-spin mr-3 font-normal",children:"⏳"}),c("fuelLog.saving")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faSave,className:"mr-2"}),c("fuelLog.save")]})})]})]})]})}):null};var v=e.i(95430);let b=[{id:"oilChange",intervalHours:200,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:400,intervalMonths:12},{id:"fuelPreFilter",intervalHours:400,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:500,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:200,intervalMonths:12},{id:"saildriveDiaphragm",intervalHours:null,intervalMonths:84},{id:"engineMounts",intervalHours:null,intervalMonths:12}],j=[{id:"oilChange",intervalHours:100,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:200,intervalMonths:12},{id:"fuelPreFilter",intervalHours:200,intervalMonths:12},{id:"impeller",intervalHours:500,intervalMonths:12},{id:"driveBelt",intervalHours:250,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:250,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}],N={"volvo-d1-20":{name:"Volvo Penta D1-20",items:b},"volvo-d1-30":{name:"Volvo Penta D1-13/30",items:b},"volvo-d2-40":{name:"Volvo Penta D2-40/50",items:b},"yanmar-2ym15":{name:"Yanmar 2YM15",items:j},"yanmar-3ym30":{name:"Yanmar 3YM20/30",items:j},"generic-diesel":{name:"Generic diesel",items:[{id:"oilChange",intervalHours:150,intervalMonths:12},{id:"oilFilter",intervalHours:150,intervalMonths:12},{id:"fuelFilter",intervalHours:300,intervalMonths:12},{id:"fuelPreFilter",intervalHours:300,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:400,intervalMonths:12},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}]}},w="volvo-d1-20",y="ocearo_maintenance",k={hours:525,date:"2026-06-15"},T={engineModel:w,lastDone:{...Object.fromEntries(["oilChange","oilFilter","fuelFilter","fuelPreFilter","impeller","driveBelt","airFilter","anodes","saildriveOil","engineMounts"].map(e=>[e,{...k}])),saildriveDiaphragm:{hours:null,date:"2023-07-03"}}},M={overdue:{dot:"bg-oRed",text:"text-oRed"},due:{dot:"bg-oYellow",text:"text-oYellow"},ok:{dot:"bg-oGreen",text:"text-oGreen"},unknown:{dot:"bg-hud-muted",text:"text-hud-muted"}},R=()=>new Date().toISOString().slice(0,10),F=({currentEngineHours:e})=>{let{t:a}=(0,f.useTranslation)(),[s,n]=(0,l.useState)(()=>(()=>{try{let e=localStorage.getItem(y);if(e)return JSON.parse(e)}catch(e){}return T})()),[i,d]=(0,l.useState)(null),[c,u]=(0,l.useState)(""),[m,h]=(0,l.useState)(R()),x=N[s.engineModel]||N[w],p=(0,l.useCallback)(e=>{n(t=>{let l=e(t);try{localStorage.setItem(y,JSON.stringify(l))}catch(e){}return l})},[]),g=()=>{let e=parseFloat(c);p(t=>({...t,lastDone:{...t.lastDone,[i]:{hours:Number.isFinite(e)?e:null,date:m||R()}}})),d(null)},b=(0,l.useMemo)(()=>x.items.map(t=>({item:t,lastDone:s.lastDone[t.id]||null,...((e,t,l)=>{if(!t||null==t.hours&&!t.date)return{status:"unknown",hoursLeft:null,daysLeft:null,dueHours:null,dueDate:null};let a=null,s=null;null!=e.intervalHours&&null!=t.hours&&null!=l&&(a=Math.round(((s=t.hours+e.intervalHours)-l)*10)/10);let n=null,i=null;if(null!=e.intervalMonths&&t.date){let l=new Date(t.date);l.setMonth(l.getMonth()+e.intervalMonths),i=l,n=Math.floor((l.getTime()-(0,v.vesselNow)().getTime())/864e5)}let r="ok";return null!=a&&a<0||null!=n&&n<0?r="overdue":(null!=a&&a<=25||null!=n&&n<=30)&&(r="due"),{status:r,hoursLeft:a,daysLeft:n,dueHours:s,dueDate:i}})(t,s.lastDone[t.id],e)})),[x,s.lastDone,e]),j=b.filter(e=>"overdue"===e.status).length,k=b.filter(e=>"due"===e.status).length;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),a("maintenance.title")]}),(0,t.jsx)("select",{value:s.engineModel,onChange:e=>{p(t=>({...t,engineModel:e.target.value}))},className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-caption font-semibold uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:Object.entries(N).map(([e,l])=>(0,t.jsx)("option",{value:e,className:"bg-leftPaneBg text-hud-main",children:l.name},e))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:"tesla-card text-center ",children:[(0,t.jsx)("div",{className:"text-value font-semibold text-hud-main gliding-value",children:null!=e?e.toFixed(1):a("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("motor.currentEngineHours")})]}),(0,t.jsxs)("div",{className:`tesla-card text-center ${j>0?"bg-oRed/10 border-oRed/30":" "}`,children:[(0,t.jsx)("div",{className:`text-value font-semibold gliding-value ${j>0?"text-oRed":"text-hud-main"}`,children:j}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("maintenance.overdue")})]}),(0,t.jsxs)("div",{className:`tesla-card text-center ${k>0?"bg-oYellow/10 border-oYellow/30":" "}`,children:[(0,t.jsx)("div",{className:`text-value font-semibold gliding-value ${k>0?"text-oYellow":"text-hud-main"}`,children:k}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-widest mt-1",children:a("maintenance.dueSoon")})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:b.map(({item:l,lastDone:n,status:x,hoursLeft:p,daysLeft:f,dueHours:v,dueDate:b})=>{let j=M[x],N=i===l.id;return(0,t.jsxs)("div",{className:"tesla-card tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,t.jsx)("span",{className:`w-2 h-2 rounded-full mr-3 flex-shrink-0 ${j.dot} ${"overdue"===x?"animate-soft-pulse":""}`}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest truncate",children:a(`maintenance.items.${l.id}`)}),(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight mt-0.5",children:[null!=l.intervalHours?`${l.intervalHours} h`:null,null!=l.intervalMonths?a("maintenance.everyMonths",{count:l.intervalMonths}):null].filter(Boolean).join(" / ")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-shrink-0",children:[(0,t.jsx)("div",{className:"text-right",children:"unknown"===x?(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest",children:a("maintenance.neverDone")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase tracking-widest ${j.text}`,children:"overdue"===x?a("maintenance.overdueLabel"):[null!=p?`${p.toFixed(0)} h`:null,null!=f?a("maintenance.inDays",{count:f}):null].filter(Boolean).join(" · ")}),(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold tracking-tight mt-0.5",children:[null!=v?`→ ${v.toFixed(0)} h`:null,b?`→ ${b.toLocaleDateString("fr-FR")}`:null].filter(Boolean).join(" · ")})]})}),(0,t.jsx)("button",{onClick:()=>{let t;return N?d(null):(t=s.lastDone[l.id],void(d(l.id),u(t?.hours!=null?String(t.hours):null!=e?e.toFixed(1):""),h(t?.date||R())))},className:"px-3 py-1.5 text-caption bg-hud-elevated text-hud-secondary rounded-sm font-semibold uppercase tracking-widest tesla-hover border border-hud transition-all duration-500",children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faWrench,className:"text-xs"})})]})]}),N&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-hud flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption text-hud-muted font-semibold uppercase tracking-widest mb-1",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"mr-1 text-xs"}),a("maintenance.doneAtHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",value:c,onChange:e=>u(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-caption font-semibold border border-hud focus:outline-none w-28"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption text-hud-muted font-semibold uppercase tracking-widest mb-1",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCalendarDays,className:"mr-1 text-xs"}),a("maintenance.doneOnDate")]}),(0,t.jsx)("input",{type:"date",value:m,onChange:e=>h(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-caption font-semibold border border-hud focus:outline-none"})]}),(0,t.jsxs)("button",{onClick:g,className:"bg-oGreen/80 hover:bg-oGreen text-black px-4 py-1.5 rounded-sm text-caption font-semibold uppercase tracking-widest transition-all duration-500",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"mr-2 text-xs"}),a("maintenance.markDone")]}),n&&(0,t.jsxs)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight ml-auto",children:[a("maintenance.lastDone"),": ",null!=n.hours?`${n.hours} h`:"—"," · ",n.date?new Date(n.date).toLocaleDateString("fr-FR"):"—"]})]})]},l.id)})}),(0,t.jsxs)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-tight flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-2 text-xs opacity-50"}),a("maintenance.disclaimer")]})]})};var C=e.i(66799),L=e.i(48390);let H=["chargeIndicator","checkEngine","commError","eGRSystem","emergencyStopMode","highBoostPressure","lowCoolantLevel","lowFuelPressure","lowOilLevel","lowOilPressure","lowSystemVoltage","maintenanceNeeded","neutralStartProtect","overTemperature","powerReduction","preheatIndicator","revLimitExceeded","shuttingDown","subOrSecondaryThrottle","throttlePositionSensor","warningLevel1","warningLevel2","waterFlow","waterInFuel","transmission.overTemperature","transmission.lowOilPressure","temperature","exhaustTemperature"],S=["notifications.environment.inside.engineRoom.temperature"],$=["alarm","emergency"],A=({notification:e})=>{let{t:a}=(0,f.useTranslation)(),[s,n]=(0,l.useState)(null),i=e.status;if(!e.id||!i)return null;let r=async t=>{n(t);try{await C.default.notificationAction(e.id,t)}catch(e){console.warn(`Notification ${t} failed:`,e?.message||e)}finally{n(null)}},o="px-3 py-1.5 rounded-sm border border-hud bg-hud-elevated text-hud-main tesla-hover disabled:opacity-40 transition-all";return(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 normal-case tracking-normal",children:[i.silenced?(0,t.jsx)("span",{className:"text-hud-muted",children:a("motor.alarmSilenced")}):i.canSilence&&(0,t.jsx)("button",{type:"button",className:o,disabled:null!==s,onClick:()=>r("silence"),children:a("motor.silenceAlarm")}),i.acknowledged?(0,t.jsx)("span",{className:"text-hud-muted",children:a("motor.alarmAcknowledged")}):i.canAcknowledge&&(0,t.jsx)("button",{type:"button",className:o,disabled:null!==s,onClick:()=>r("acknowledge"),children:a("motor.acknowledgeAlarm")})]})},P=["alert","warn","warning","caution"];e.s(["default",0,()=>{let{t:e}=(0,f.useTranslation)(),v=i.default.get("debugMode"),[b,j]=(0,l.useState)("0"),[N,w]=(0,l.useState)("engine"),[y,k]=(0,l.useState)([]),[T,M]=(0,l.useState)(!1),R=(0,l.useMemo)(()=>{let e=[],t=["revolutions","runTime","coolantTemperature","temperature","exhaustTemperature","coolantPressure","boostPressure","oilPressure","oilTemperature","fuel.rate","fuel.pressure","load","torque","intakeManifoldTemperature","tilt","state","transmission.gear","transmission.oilPressure","transmission.oilTemperature"];return["0","1","port","main","starboard"].forEach(l=>{t.forEach(t=>{e.push(`propulsion.${l}.${t}`)}),H.forEach(t=>{e.push(`notifications.propulsion.${l}.${t}`)})}),e.push("environment.inside.engineRoom.temperature",...S),e.push("electrical.batteries.0.voltage","electrical.batteries.0.current","electrical.batteries.1.voltage","electrical.batteries.1.current","electrical.alternators.0.voltage","electrical.alternators.1.voltage","electrical.alternators.0.current","electrical.alternators.1.current","tanks.fuel.0.currentLevel","tanks.fuel.0.capacity"),e},[]),C=(0,n.useSignalKPaths)(R),E=(0,n.useSignalKPath)("navigation.position"),B=(0,l.useCallback)(e=>C[e]??null,[C]),I=(0,l.useCallback)(()=>{let t=[];for(let l=0;l<=1;l++){let a=B(`propulsion.${l}.revolutions`),s=B(`propulsion.${l}.runTime`);0===l&&null===a&&null===s?(a=B("propulsion.port.revolutions")??B("propulsion.main.revolutions"),s=B("propulsion.port.runTime")??B("propulsion.main.runTime")):1===l&&null===a&&null===s&&(a=B("propulsion.starboard.revolutions"),s=B("propulsion.starboard.runTime")),(null!==a||null!==s||v)&&t.push({id:l.toString(),name:0===l?e("motor.portMainEngine"):e("motor.starboardEngine"),hasData:null!==a||null!==s})}return t.length>0?t:[{id:"0",name:e("motor.mainEngine"),hasData:!1}]},[B,v,e]);(0,l.useEffect)(()=>{k(I())},[I]);let D=(0,l.useCallback)(e=>{let t=B(`propulsion.${b}.${e}`);return null===t&&"0"===b?t=B(`propulsion.port.${e}`)??B(`propulsion.main.${e}`):null===t&&"1"===b&&(t=B(`propulsion.starboard.${e}`)),t},[b,B]),G=(0,l.useMemo)(()=>{var e,t;let l=D("coolantTemperature")??D("temperature")??B("propulsion.port.temperature"),a=D("exhaustTemperature")??B("propulsion.main.exhaustTemperature");return{rpm:null==(e=D("revolutions"))?null:60*e,runTime:(e=>{if(null==e)return null;let t=(e/3600).toFixed(1);return`${t} h`})(D("runTime")),coolantTemp:u.kelvinToCelsius(l),coolantPressure:d(D("coolantPressure")),boostPressure:d(D("boostPressure")),oilPressure:d(D("oilPressure")),oilTemp:u.kelvinToCelsius(D("oilTemperature")),fuelRate:null==(t=D("fuel.rate"))?null:Math.round(1e3*t*3600),fuelPressure:d(D("fuel.pressure")),load:c(D("load")),torque:c(D("torque")),exhaustTemp:u.kelvinToCelsius(a),engineRoomTemp:u.kelvinToCelsius(B("environment.inside.engineRoom.temperature")),intakeTemp:u.kelvinToCelsius(D("intakeManifoldTemperature")),tilt:u.radiansToDegrees(D("tilt")),state:D("state"),gear:D("transmission.gear"),transOilPressure:d(D("transmission.oilPressure")),transOilTemp:u.kelvinToCelsius(D("transmission.oilTemperature")),batteryVoltage:B("electrical.batteries.0.voltage"),batteryCurrent:B("electrical.batteries.0.current"),alternatorVoltage:B(`electrical.alternators.${b}.voltage`)??B("propulsion.port.alternatorVoltage"),alternatorCurrent:B(`electrical.alternators.${b}.current`)??B("propulsion.port.alternatorCurrent"),fuelLevel:c(B("tanks.fuel.0.currentLevel")),fuelCapacity:Number.isFinite(B("tanks.fuel.0.capacity"))?1e3*B("tanks.fuel.0.capacity"):null}},[b,D,B]),O=(0,l.useMemo)(()=>{let e=[];return H.forEach(t=>{let l=B(`notifications.propulsion.${b}.${t}`);l||"0"!==b?l||"1"!==b||(l=B(`notifications.propulsion.starboard.${t}`)):l=B(`notifications.propulsion.port.${t}`)??B(`notifications.propulsion.main.${t}`),l&&"object"==typeof l&&e.push({type:t,...l})}),S.forEach(t=>{let l=B(t);l&&"object"==typeof l&&e.push({type:"engineRoomTemperature",...l})}),e},[b,B]),Y=(0,l.useMemo)(()=>O.filter(e=>e.state&&"normal"!==e.state&&"nominal"!==e.state),[O]),V=Y.some(e=>$.includes(e.state)),W=Y.some(e=>P.includes(e.state)),z=B("electrical.batteries.1.current"),U="number"==typeof z?Math.round(10*z)/10:z,_=D("runTime"),q=null!==_?_/3600:null;(0,l.useEffect)(()=>{if(null!==q)try{localStorage.setItem("ocearo_lastEngineHours",String(q))}catch(e){}},[q]);let[K,Z]=(0,l.useState)(!1),[J,Q]=(0,l.useState)([]),[X,ee]=(0,l.useState)(null),[et,el]=(0,l.useState)(!1),[ea,es]=(0,l.useState)(null),en=(0,l.useMemo)(()=>{if(null!==q)return q;try{let e=parseFloat(localStorage.getItem("ocearo_lastEngineHours"));if(Number.isFinite(e))return e}catch(e){}return X?.lastRefill?.engineHours??null},[q,X]),ei=(0,l.useCallback)(async()=>{el(!0),es(null);try{let e=await (0,L.fetchFuelLogEntries)();Q(e);let t=(0,L.calculateFuelStats)(e,G.fuelCapacity);ee(t)}catch(e){es((0,L.handleOcearoCoreError)(e,"Fuel log fetch")),Q([]),ee(null)}finally{el(!1)}},[G.fuelCapacity]);(0,l.useEffect)(()=>{"fuel"===N&&ei()},[N,ei]);let er=(0,l.useCallback)(async e=>{el(!0),es(null);try{await (0,L.addFuelLogEntry)(e,E),Z(!1),await ei()}catch(e){es((0,L.handleOcearoCoreError)(e,"Fuel log save"))}finally{el(!1)}},[E,ei]),eo=X?.lastRefill?.engineHours||null,ed=(0,l.useMemo)(()=>(0,L.estimateTankLevel)(J,en,G.fuelCapacity,null!==G.fuelLevel?G.fuelLevel/100:null),[J,en,G.fuelCapacity,G.fuelLevel]);return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg overflow-x-auto scrollbar-hide",children:[{id:"engine",label:e("motor.engine"),icon:o.faCar},{id:"maintenance",label:e("motor.maintenance"),icon:o.faWrench},{id:"electrical",label:e("motor.electrical"),icon:o.faBolt},{id:"fuel",label:e("motor.fuel"),icon:o.faGasPump},{id:"warnings",label:e("motor.warnings"),icon:o.faExclamationTriangle}].map(e=>(0,t.jsxs)("button",{onClick:()=>w(e.id),className:`flex-1 py-3 px-3 whitespace-nowrap text-caption font-semibold uppercase flex items-center justify-center transition-all duration-500 ${N===e.id?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label,"warnings"===e.id&&(V||W)&&(0,t.jsx)("span",{className:`ml-2 w-2 h-2 rounded-full animate-soft-pulse ${V?"bg-oRed":"bg-oYellow"}`})]},e.id))}),Y.length>0&&"warnings"!==N&&(0,t.jsxs)("button",{onClick:()=>w("warnings"),className:`w-full text-left px-4 py-2 text-caption font-semibold uppercase tracking-widest flex items-center border-b ${V?"bg-oRed/15 border-oRed/30 text-oRed animate-soft-pulse":"bg-oYellow/15 border-oYellow/30 text-oYellow"}`,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-3"}),(0,t.jsx)("span",{className:"truncate",children:Y.map(e=>e.message||e.type.replace(/([A-Z])/g," $1").trim()).join(" — ")})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsx)(a.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(s.motion.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.4,ease:"easeOut"},className:"p-3",children:["engine"===N&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h2",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),e("motor.propulsionSystems")]}),(0,t.jsx)("select",{value:b,onChange:e=>j(e.target.value),className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-caption font-semibold uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:y.map(e=>(0,t.jsx)("option",{value:e.id,className:"bg-leftPaneBg text-hud-main",children:e.name},e.id))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[(0,t.jsx)(p,{label:e("motor.propulsionSpeed"),value:G.rpm,unit:"RPM",icon:o.faTachometerAlt,max:4e3,warningThreshold:3200,criticalThreshold:3600}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover flex flex-col justify-center ",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faClock,className:"text-lg text-hud-dim mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-value font-semibold text-hud-main leading-none gliding-value tracking-tight",children:G.runTime||e("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption font-semibold uppercase mt-2 tracking-[0.2em]",children:e("motor.serviceHours")})]}),(0,t.jsx)(m,{label:e("motor.load"),value:G.load,unit:"%",min:0,max:100,icon:o.faChartLine,warningThreshold:70,criticalThreshold:85,size:100}),(0,t.jsx)(m,{label:e("motor.torque"),value:G.torque,unit:"%",min:0,max:100,icon:o.faRotate,warningThreshold:75,criticalThreshold:90,size:100})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faTemperatureHalf,className:"mr-2 text-oYellow text-xs"}),e("motor.temperatureSection")]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(m,{label:e("motor.coolant"),value:G.coolantTemp,unit:"°C",min:0,max:120,icon:o.faSnowflake,warningThreshold:95,criticalThreshold:100,size:90}),(0,t.jsx)(m,{label:e("motor.oil"),value:G.oilTemp,unit:"°C",min:0,max:150,icon:o.faOilCan,warningThreshold:110,criticalThreshold:130,size:90}),(0,t.jsx)(m,{label:e("motor.engineRoom"),value:G.engineRoomTemp,unit:"°C",min:0,max:120,icon:o.faFire,warningThreshold:55,criticalThreshold:70,size:90}),(0,t.jsx)(m,{label:e("motor.intake"),value:G.intakeTemp,unit:"°C",min:0,max:100,icon:o.faArrowDown,warningThreshold:60,criticalThreshold:80,size:90})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faGaugeHigh,className:"mr-2 text-oBlue text-xs"}),e("motor.pressures")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(h,{label:e("motor.oil"),value:G.oilPressure,unit:"bar",min:0,max:6,icon:o.faOilCan,warningThreshold:1.5,criticalThreshold:1,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.coolant"),value:G.coolantPressure,unit:"bar",min:0,max:3,icon:o.faWater,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.boost"),value:G.boostPressure,unit:"bar",min:0,max:2.5,icon:o.faArrowUp,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.fuel"),value:G.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGasPump,warningThreshold:2.5,criticalThreshold:2,reversed:!0,showMinMax:!0})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(x,{label:e("motor.state"),value:G.state||e("motor.unknown"),icon:o.faCar}),(0,t.jsx)(x,{label:e("motor.alternatorOutput"),value:G.alternatorVoltage?.toFixed?.(1)??G.alternatorVoltage,unit:"V",icon:o.faBolt}),(0,t.jsx)(x,{label:e("motor.tilt"),value:G.tilt,unit:"°",icon:o.faRuler}),(0,t.jsx)(x,{label:e("motor.fuelRate"),value:G.fuelRate,unit:"L/h",icon:o.faGasPump}),(0,t.jsx)(x,{label:e("motor.transmissionGear"),value:((e,t)=>{if(null==e)return null;if("string"==typeof e){let l=e.trim().toLowerCase();return l.startsWith("forw")?t("motor.forward"):l.startsWith("neut")?t("motor.neutral"):l.startsWith("rev")?t("motor.reverse"):e}return -1===e?t("motor.reverse"):0===e?t("motor.neutral"):e>1?`${t("motor.forward")} ${e}`:t("motor.forward")})(G.gear,e),icon:o.faCogs}),(0,t.jsx)(x,{label:e("motor.transOilPressure"),value:G.transOilPressure,unit:"bar",icon:o.faOilCan}),(0,t.jsx)(x,{label:e("motor.transOilTemp"),value:G.transOilTemp,unit:"°C",icon:o.faTemperatureHalf})]})]}),"maintenance"===N&&(0,t.jsx)(F,{currentEngineHours:en}),"electrical"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.energyDistribution")]}),(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)("h4",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest px-1",children:e("motor.ignitionBank")}),(0,t.jsx)(h,{label:e("motor.voltageNode"),value:G.batteryVoltage,unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.amperageLoad"),value:G.batteryCurrent,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-caption font-semibold text-hud-muted uppercase tracking-widest px-1",children:e("motor.serviceBank")}),(0,t.jsx)(h,{label:e("motor.voltageNode"),value:B("electrical.batteries.1.voltage"),unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.amperageLoad"),value:U,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.chargingSystems")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(m,{label:e("motor.alternatorOutput"),value:G.alternatorVoltage,unit:"V",min:10,max:16,icon:o.faBolt,warningThreshold:15,criticalThreshold:15.5,size:120}),(0,t.jsx)(m,{label:e("motor.chargeIntensity"),value:G.alternatorCurrent,unit:"A",min:0,max:100,icon:o.faBolt,size:120})]})]})]}),"fuel"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oYellow mr-3 animate-soft-pulse"}),e("motor.resourceManagement")]}),(0,t.jsxs)("button",{onClick:()=>Z(!0),className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded-sm text-caption font-semibold uppercase tracking-widest transition-all duration-500 flex items-center shadow-lg shadow-oBlue/20",disabled:et,children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faPlus,className:"mr-2 text-xs"}),e("motor.registerRefill")]})]}),ea&&(0,t.jsxs)("div",{className:"tesla-card bg-oRed/10 border-oRed/20 text-oRed text-caption font-semibold uppercase tracking-widest animate-soft-pulse",children:[e("motor.nodeError")," ",ea]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[(0,t.jsx)(m,{label:e("motor.consumptionRate"),value:G.fuelRate,unit:"L/h",min:0,max:50,icon:o.faGasPump,size:100}),(0,t.jsx)(m,{label:e("motor.injectionPressure"),value:G.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGaugeHigh,warningThreshold:2.5,criticalThreshold:2,reversed:!0,size:100}),(0,t.jsx)(m,{label:e("motor.primaryReservoir"),value:G.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,size:100})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.telemetryDetails")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(h,{label:e("motor.levelPercentage"),value:G.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.totalCapacity"),value:G.fuelCapacity?.toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(x,{label:e("motor.currentEngineHours"),value:en?.toFixed(1),unit:"h",icon:o.faClock})]}),null!==G.fuelLevel&&null!==G.fuelCapacity&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(x,{label:e("motor.currentVolume"),value:(G.fuelLevel/100*G.fuelCapacity).toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(x,{label:e("motor.enduranceEst"),value:G.fuelRate>0&&null!==G.fuelLevel&&null!==G.fuelCapacity?(G.fuelLevel/100*G.fuelCapacity/G.fuelRate).toFixed(1):"N/A",unit:G.fuelRate>0?"h":"",icon:o.faClock})]})]}),ed&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.predictiveAnalysis")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[null!==ed.estimatedLiters&&(0,t.jsx)(x,{label:e("motor.estimatedVolume"),value:null!==ed.estimatedLitersWorst&&ed.estimatedLitersWorst!==ed.estimatedLiters?`${ed.estimatedLitersWorst.toFixed(0)}–${ed.estimatedLiters.toFixed(0)}`:ed.estimatedLiters,unit:"L",icon:o.faGasPump}),null!==ed.estimatedPercent&&(0,t.jsx)(h,{label:e("motor.computedLevel"),value:ed.estimatedPercentWorst??ed.estimatedPercent,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0}),null!==ed.hoursRemaining&&(0,t.jsx)(x,{label:e("motor.timeToExhaustion"),value:null!==ed.hoursRemainingWorst&&ed.hoursRemainingWorst!==ed.hoursRemaining?`${ed.hoursRemainingWorst.toFixed(0)}–${ed.hoursRemaining.toFixed(0)}`:ed.hoursRemaining,unit:"h",icon:o.faClock,warningThreshold:10,criticalThreshold:5,reversed:!0})]})]}),J.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-hud-muted mr-3"}),e("motor.logHistory")]}),(0,t.jsx)("div",{className:"tesla-card overflow-x-auto transition-all duration-500 ",children:(0,t.jsxs)("table",{className:"w-full text-caption font-semibold uppercase tracking-widest",children:[(0,t.jsx)("thead",{className:"bg-hud-elevated",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.meridianDate")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.liters")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.refillCost")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hmr")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.avgConsumption")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hoursSinceRefill")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-center font-black",children:e("motor.additive")})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-hud",children:[...J].reverse().map((e,l)=>{let a=e.fuel||{},s=a.liters&&a.hoursSinceLastRefill&&a.hoursSinceLastRefill>0?Math.round(a.liters/a.hoursSinceLastRefill*10)/10:null,n=a.hoursSinceLastRefill&&a.hoursSinceLastRefill>0?Math.round(10*a.hoursSinceLastRefill)/10:null;return(0,t.jsxs)("tr",{className:"text-hud-main tesla-hover group",children:[(0,t.jsx)("td",{className:"p-4 opacity-60 group-hover:opacity-100 transition-opacity",children:new Date(e.datetime).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric"})}),(0,t.jsxs)("td",{className:"p-4 gliding-value text-oBlue",children:[a.liters," L"]}),(0,t.jsx)("td",{className:"p-4 gliding-value",children:null!=a.cost?`${a.cost} €`:"—"}),(0,t.jsxs)("td",{className:"p-4 gliding-value opacity-60",children:[a.engineHoursAtRefill," h"]}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oYellow",children:null!=s?`${s} L/h`:"—"}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oGreen",children:null!=n?`${n} h`:"—"}),(0,t.jsx)("td",{className:"p-4 text-center",children:a.additive?(0,t.jsx)("span",{className:"text-oBlue animate-soft-pulse",children:(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faFlask,className:"text-xs"})}):(0,t.jsx)("span",{className:"text-hud-dim font-black",children:"—"})})]},e.datetime||l)})})]})})]})]}),"warnings"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsxs)("h3",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oRed mr-3 animate-soft-pulse"}),e("motor.warningsSummary")]}),(0,t.jsx)("button",{onClick:()=>M(!T),className:"px-4 py-1.5 text-caption bg-hud-elevated text-hud-secondary rounded-sm font-semibold uppercase tracking-widest tesla-hover border border-hud transition-all duration-500 shadow-soft",children:T?e("motor.showLess"):e("motor.showAll")})]}),0===Y.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"text-center text-hud-secondary py-8 tesla-card ",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-4xl mb-4 text-oGreen/40 animate-soft-pulse"}),(0,t.jsx)("h4",{className:"text-label font-semibold text-hud-main uppercase tracking-[0.2em]",children:e("motor.allSystemsNominal")}),(0,t.jsx)("p",{className:"text-caption font-semibold mt-2 uppercase text-hud-muted tracking-widest opacity-60",children:e("motor.noActiveWarnings")})]}),T&&O.length>0&&(0,t.jsxs)("div",{className:"tesla-card bg-oGreen/5 border-oGreen/10 ",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oGreen mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.healthyTelemetryNodes")," (",O.length,")"]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 text-caption font-semibold uppercase tracking-tight",children:O.map((e,l)=>(0,t.jsxs)("div",{className:"text-hud-secondary flex items-center bg-hud-elevated p-3 rounded-sm tesla-hover border border-hud",children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-oGreen mr-3 text-xs opacity-40"}),(0,t.jsx)("span",{className:"truncate opacity-60",children:e.type.replace(/([A-Z])/g," $1").trim()})]},l))})]})]}):(0,t.jsxs)("div",{className:"space-y-8",children:[V&&(0,t.jsxs)("div",{className:"bg-oRed/5 border border-oRed/20 p-6 rounded-sm shadow-soft animate-soft-pulse",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oRed mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oRed mr-3"}),e("motor.criticalNodeAlarms")]}),(0,t.jsx)("div",{className:"space-y-4",children:O.filter(e=>$.includes(e.state)).map((l,a)=>(0,t.jsxs)("div",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest bg-oRed/10 p-4 rounded-sm tesla-hover border border-oRed/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-caption",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oRed text-caption font-semibold tracking-tighter",children:e("motor.alertLevel3")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption mt-3 normal-case font-semibold tracking-normal opacity-80",children:l.message}),(0,t.jsx)(A,{notification:l})]},a))})]}),W&&(0,t.jsxs)("div",{className:"bg-oYellow/5 border border-oYellow/20 p-6 rounded-sm shadow-soft",children:[(0,t.jsxs)("h4",{className:"text-caption font-semibold text-oYellow mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.systemAnomalies")]}),(0,t.jsx)("div",{className:"space-y-4",children:O.filter(e=>P.includes(e.state)).map((l,a)=>(0,t.jsxs)("div",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest bg-oYellow/10 p-4 rounded-sm tesla-hover border border-oYellow/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-caption",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oYellow text-caption font-semibold tracking-tighter",children:e("motor.warnLevel2")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption mt-3 normal-case font-semibold tracking-normal opacity-80",children:l.message}),(0,t.jsx)(A,{notification:l})]},a))})]})]})]}),v&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-oBlue mb-6 uppercase tracking-[0.3em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.internalDebugTelemetry")]}),(0,t.jsx)("div",{className:"space-y-4 text-caption font-semibold font-mono text-hud-secondary uppercase tracking-widest",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.REVOLUTIONS:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".revs"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.REVOLUTIONS:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:B(`propulsion.${b}.revolutions`)??"NULL"}),(0,t.jsx)("div",{className:"col-span-2 my-4 border-t border-hud"}),(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.TEMPERATURE:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".temp"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.TEMPERATURE:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:B(`propulsion.${b}.coolantTemperature`)??"NULL"})]})})]})]})]},N)})}),(0,t.jsx)(g,{isOpen:K,onClose:()=>Z(!1),onSave:er,currentEngineHours:en,lastRefillEngineHours:eo,loading:et})]})}],73064)},8161,function(e){e.n(e.i(73064))}]);
|