@mxtommy/kip 4.8.5 → 4.9.0-beta.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.
Files changed (59) hide show
  1. package/package.json +2 -2
  2. package/public/3rdpartylicenses.txt +78 -78
  3. package/public/assets/help-docs/kiosk.md +4 -2
  4. package/public/{chunk-ByFzHU1s.js → chunk-5jtM3b20.js} +1 -1
  5. package/public/{chunk-Co8V0LUu.js → chunk-B1H8b4W3.js} +1 -1
  6. package/public/{chunk-DufX2AHa.js → chunk-BJObkbow.js} +1 -1
  7. package/public/{chunk-CuPmfpgh.js → chunk-BLEfD_P7.js} +1 -1
  8. package/public/{chunk-Fy40z1B2.js → chunk-BO34LrGA.js} +1 -1
  9. package/public/{chunk-BZG04c3j.js → chunk-BSNfaGK3.js} +1 -1
  10. package/public/{chunk-DxS7HN4G.js → chunk-BbE36LU3.js} +1 -1
  11. package/public/{chunk-6MiGh2Ts.js → chunk-BoY2UDvb.js} +1 -1
  12. package/public/{chunk-BTv5PhTr.js → chunk-BrjwTjz7.js} +1 -1
  13. package/public/{chunk-Bp1YVCJL.js → chunk-BufDbUf3.js} +1 -1
  14. package/public/{chunk-DiDkZnhZ.js → chunk-C11zYqw7.js} +1 -1
  15. package/public/{chunk-BwYOFdBA.js → chunk-C8uxDv1M.js} +1 -1
  16. package/public/{chunk-7QXXQf2h.js → chunk-CDG3g9Eq.js} +1 -1
  17. package/public/{chunk-BAVmyVwG.js → chunk-CEtt0kr-.js} +1 -1
  18. package/public/{chunk-DN39qO63.js → chunk-CKnQ07BR.js} +1 -1
  19. package/public/{chunk-BaGEtCmz.js → chunk-COM48ir-.js} +1 -1
  20. package/public/{chunk-CQtqkz1Y.js → chunk-CSCVkGWE.js} +1 -1
  21. package/public/{chunk-MakCt36b.js → chunk-C_mCGLT_.js} +1 -1
  22. package/public/{chunk-CLIWxVhS.js → chunk-CnVELVOx.js} +1 -1
  23. package/public/{chunk-Cj0AJQ8U.js → chunk-Csxy6yVz.js} +1 -1
  24. package/public/{chunk-TdI_E-cf.js → chunk-CvG4thmf.js} +1 -1
  25. package/public/{chunk-Be5KcT7R.js → chunk-CxOyBrqL.js} +1 -1
  26. package/public/{chunk-Bbyk4dOu.js → chunk-CzY2nk08.js} +1 -1
  27. package/public/{chunk-Bx77STup.js → chunk-CzquTNBp.js} +1 -1
  28. package/public/{chunk-CteyWXZ_.js → chunk-D59G2Xua.js} +1 -1
  29. package/public/chunk-D8CQ-x45.js +1 -0
  30. package/public/{chunk-CJhkckXA.js → chunk-DA2JBQHi.js} +1 -1
  31. package/public/chunk-DCdZRAXa.js +1 -0
  32. package/public/{chunk-YZWhRxa9.js → chunk-DES7U9G6.js} +1 -1
  33. package/public/{chunk-CRy9Da7a.js → chunk-DHj2hm9r.js} +1 -1
  34. package/public/{chunk-CzEDfe2A.js → chunk-DJVnrrxC.js} +1 -1
  35. package/public/{chunk-C7ax8Sqz.js → chunk-DN6HP97P.js} +1 -1
  36. package/public/{chunk-ByC_hFSP.js → chunk-DTznNQod.js} +1 -1
  37. package/public/{chunk-DNbLx4NZ.js → chunk-DZQzZeIV.js} +1 -1
  38. package/public/{chunk-D63LEt5t.js → chunk-DakdT7bi.js} +1 -1
  39. package/public/{chunk-DonRL_4T.js → chunk-DizMY7FW.js} +1 -1
  40. package/public/{chunk-MO2v041V.js → chunk-DjPkdMGz.js} +1 -1
  41. package/public/{chunk-BOlUTHo6.js → chunk-DlLiKS0n.js} +1 -1
  42. package/public/{chunk-B4Wxwb2y.js → chunk-Dt2HCrSr.js} +1 -1
  43. package/public/{chunk-Dddd8rAh.js → chunk-Duhmjpm9.js} +1 -1
  44. package/public/{chunk-CkFpNfxN.js → chunk-DulH4zwM.js} +1 -1
  45. package/public/{chunk-Cn9j0-tJ.js → chunk-DwAXe6Wn.js} +1 -1
  46. package/public/{chunk-C89yhdsn.js → chunk-DxD20B-E.js} +1 -1
  47. package/public/{chunk-CwGTKplC.js → chunk-DzQ_fUpO.js} +1 -1
  48. package/public/{chunk-tbyiK3Ur.js → chunk-GyA81uXZ.js} +1 -1
  49. package/public/{chunk-0ijGpqkR.js → chunk-GzqVKhHm.js} +1 -1
  50. package/public/{chunk-CdNfAZ0G.js → chunk-MPbL1AwE.js} +1 -1
  51. package/public/{chunk-_toW-rHA.js → chunk-Qlya07CF.js} +1 -1
  52. package/public/{chunk-BzH86te1.js → chunk-VshNFG3q.js} +1 -1
  53. package/public/{chunk-D1Yncgg5.js → chunk-YBp9CH_2.js} +1 -1
  54. package/public/{chunk-DRPjASjZ.js → chunk-_S08GvV8.js} +1 -1
  55. package/public/{chunk-TneLdWrI.js → chunk-dvm9QV-B.js} +1 -1
  56. package/public/{chunk-urAQA4U_.js → chunk-ipFM9wbJ.js} +1 -1
  57. package/public/index.html +1 -1
  58. package/public/{main-F7NMHHV4.js → main-IINF7HD6.js} +473 -473
  59. package/public/chunk-CcaPRVAZ.js +0 -1
@@ -1 +1 @@
1
- import {v,R,S}from'./chunk-CQNVyz8q.js';import {d1 as Hj,w,du as p,dv as rt$1,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,ao as ue,dz as es,cn as wd,ci as dl,cp as Uh,cj as fl,T as TT,bD as HT,e as EE,d as ig,an as Hh,bp as gl,dA as UT,aA as gg,f as eg,K as Kw,aI as ms}from'./main-F7NMHHV4.js';var it=["rotatingDial"],at=["twaIndicator"],ot=["wptIndicator"],rt=["setIndicator"],st=["tackIndicator"],Q=([y,K],[t,n],[e,a])=>(Math.atan2(a-n,e-t)-Math.atan2(K-n,y-t)+3*Math.PI)%(2*Math.PI)-Math.PI,J=(()=>{class y{rotatingDial=$j.required("rotatingDial");twaIndicator=$j.required("twaIndicator");wptIndicator=$j.required("wptIndicator");setIndicator=$j.required("setIndicator");tackIndicator=$j.required("tackIndicator");compassHeading=Hj.required();tackTrue=Hj.required();polarSpeedRatio=Hj.required();trueWindAngle=Hj.required();trueWindSpeed=Hj.required();targetAngle=Hj.required();optimalWindAngle=Hj.required();targetVMG=Hj.required();VMG=Hj.required();sailSetupEnabled=Hj.required();driftEnabled=Hj.required();driftSet=Hj();driftFlow=Hj();waypointEnabled=Hj.required();waypointAngle=Hj();vmgToWaypoint=Hj();trueWindMinHistoric=Hj();trueWindMidHistoric=Hj();trueWindMaxHistoric=Hj();gradianColor=Hj.required();compass={oldValue:0,newValue:0};twa={oldValue:0,newValue:0};wpt={oldValue:0,newValue:0};tack={oldValue:0,newValue:0};set={oldValue:0,newValue:0};compassInitialized=false;twaInitialized=false;wptInitialized=false;tackInitialized=false;setInitialized=false;laylinesInitialized=false;headingValue=vt("--");windSectorsInitialized=false;trueWindHeading=0;nextTargetDirection=Dt(()=>{let t=this.compassHeading(),n=this.tackTrue();return t==null||n==null?0:this.unsignedAngleDelta(t,n)});trueWindSpeedDisplay=Dt(()=>{let t=this.trueWindSpeed();return t==null?"--":t.toFixed(1)});windAnglePerformanceRatioColor=Dt(()=>{let t=this.optimalWindAngle(),n=this.targetAngle(),e=this.gradianColor().start,a=this.gradianColor().stop;if(t==null||n==null)return e;let i=1-Math.abs(t-n)/180;return this.interpolateColor(e,a,i)});targetVMGOffset=Dt(()=>{let t=this.VMG(),n=this.targetVMG();return t==null||n==null?"--":(t-n).toFixed(1)});targetVMGOffsetRatioColor=Dt(()=>{let t=this.VMG(),n=this.targetVMG(),e=this.gradianColor().start,a=this.gradianColor().stop;if(t==null||n==null)return e;let i=t/n;return this.interpolateColor(e,a,i)});waypointActive=vt(false);flow=Dt(()=>{let t=this.driftFlow();return t==null?"--":t.toFixed(1)});portLaylinePrev=0;stbdLaylinePrev=0;portLaylineAnimId=null;stbdLaylineAnimId=null;CENTER_X=600;CENTER_Y=620;RADIUS=540;ANIMATION_DURATION=1e3;laylinePortPath=vt(`M ${this.CENTER_X},${this.CENTER_Y} ${this.CENTER_X},${this.CENTER_Y}`);laylineStbdPath=vt(`M ${this.CENTER_X},${this.CENTER_Y} ${this.CENTER_X},${this.CENTER_Y}`);portSectorPrev={min:0,mid:0,max:0};stbdSectorPrev={min:0,mid:0,max:0};portSectorAnimId=null;stbdSectorAnimId=null;portWindSectorPath=vt("");stbdWindSectorPath=vt("");speedLineTipY=vt(620);speedTipPoints=vt("600,570 580,600 620,600");speedRatioColor=vt("");speedLinePrevRatio=0;speedLinePrevTipY=600;speedLineAnimId=null;speedLineInitialized=false;animationFrameIds=new WeakMap;ngZone=w(ue);setRotationImmediate(t,n){t.setAttribute("transform",`rotate(${n} 600 620)`);}constructor(){Fa(()=>{let t=this.waypointEnabled();ge(()=>{this.waypointActive.set(t);});}),Fa(()=>{let t=this.compassHeading(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.compassInitialized?(this.compass.oldValue=this.compass.newValue,this.compass.newValue=n):(this.compass.oldValue=n,this.compass.newValue=n,this.compassInitialized=true),this.headingValue.set(n.toString()),this.rotatingDial()?.nativeElement&&(this.compass.oldValue===this.compass.newValue?this.setRotationImmediate(this.rotatingDial().nativeElement,-this.compass.newValue):S(this.rotatingDial().nativeElement,-this.compass.oldValue,-this.compass.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone),this.updateWindSectors());});}),Fa(()=>{let t=this.targetAngle(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.tackInitialized?(this.tack.oldValue=this.tack.newValue,this.tack.newValue=n):(this.tack.oldValue=n,this.tack.newValue=n,this.tackInitialized=true),this.tackIndicator()?.nativeElement&&(this.tack.oldValue===this.tack.newValue?this.setRotationImmediate(this.tackIndicator().nativeElement,this.tack.newValue):S(this.tackIndicator().nativeElement,this.tack.oldValue,this.tack.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620])),this.updateLaylines();});}),Fa(()=>{let t=this.waypointAngle();ge(()=>{if(!t){this.waypointActive.set(false);return}this.waypointEnabled()?this.waypointActive.set(true):this.waypointActive.set(false),this.wptInitialized?(this.wpt.oldValue=this.wpt.newValue,this.wpt.newValue=t):(this.wpt.oldValue=t,this.wpt.newValue=t,this.wptInitialized=true),this.wptIndicator()?.nativeElement&&(this.wpt.oldValue===this.wpt.newValue?this.setRotationImmediate(this.wptIndicator().nativeElement,this.wpt.newValue):S(this.wptIndicator().nativeElement,this.wpt.oldValue,this.wpt.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620]));});}),Fa(()=>{let t=this.trueWindAngle(),n=Number.isFinite(t)?Math.round(t):null,e=this.compassHeading(),a=Number.isFinite(e)?Math.round(e):null;n==null||a==null||ge(()=>{this.trueWindHeading=n;let i=this.addHeading(this.trueWindHeading,a*-1);this.twaInitialized?(this.twa.oldValue=this.twa.newValue,this.twa.newValue=i):(this.twa.oldValue=i,this.twa.newValue=i,this.twaInitialized=true),this.twaIndicator()?.nativeElement&&(this.twa.oldValue===this.twa.newValue?this.setRotationImmediate(this.twaIndicator().nativeElement,this.twa.newValue):S(this.twaIndicator().nativeElement,this.twa.oldValue,this.twa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone),this.updateLaylines());});}),Fa(()=>{let t=this.polarSpeedRatio(),n=Math.max(0,Math.min(1,t)),e=620,i=e-166,r=e-i*n;if(!this.speedLineInitialized){this.speedLineInitialized=true,this.speedLineTipY.set(r);let f=30,w=20,g=r-f;this.speedTipPoints.set(`600,${g} ${600-w},${r} ${600+w},${r}`),this.speedRatioColor.set(this.interpolateColor(this.gradianColor().start,this.gradianColor().stop,n)),this.speedLinePrevTipY=r,this.speedLinePrevRatio=n;return}this.animateSpeedLine(this.speedLinePrevTipY,r),this.speedLinePrevTipY=r,this.speedLinePrevRatio=n;}),Fa(()=>{let t=this.driftSet(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.setInitialized?(this.set.oldValue=this.set.newValue,this.set.newValue=n):(this.set.oldValue=n,this.set.newValue=n,this.setInitialized=true),this.setIndicator()?.nativeElement&&(this.set.oldValue===this.set.newValue?this.setRotationImmediate(this.setIndicator().nativeElement,this.set.newValue):S(this.setIndicator().nativeElement,this.set.oldValue,this.set.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone));});});}updateLaylines(){if(!this.twaInitialized)return;let t=this.targetAngle(),n=Number.isFinite(t)?Math.round(t):null;if(n==null)return;n=n/2;let e=Number(this.twa.newValue),a=e-n,i=e+n;if(!this.laylinesInitialized){this.laylinesInitialized=true,this.setLaylinePath(a,true),this.setLaylinePath(i,false),this.portLaylinePrev=a,this.stbdLaylinePrev=i;return}this.animateLayline(this.portLaylinePrev,a,true),this.portLaylinePrev=a,this.animateLayline(this.stbdLaylinePrev,i,false),this.stbdLaylinePrev=i;}animateLayline(t,n,e){e&&this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),!e&&this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId);let a=()=>{e?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;},i=v(t,n,this.ANIMATION_DURATION,r=>this.setLaylinePath(r,e),a,this.ngZone);e?this.portLaylineAnimId=i:this.stbdLaylineAnimId=i;}updateWindSectors(){if(this.trueWindMinHistoric()==null||this.trueWindMidHistoric()==null||this.trueWindMaxHistoric()==null)return;let t={min:this.trueWindMinHistoric(),mid:this.trueWindMidHistoric(),max:this.trueWindMaxHistoric()},n={min:this.trueWindMinHistoric(),mid:this.trueWindMidHistoric(),max:this.trueWindMaxHistoric()};if(!this.windSectorsInitialized){this.portSectorPrev=t,this.stbdSectorPrev=n,this.windSectorsInitialized=true,this.animateWindSector(t,t,true),this.animateWindSector(n,n,false);return}this.animateWindSector(this.portSectorPrev,t,true),this.animateWindSector(this.stbdSectorPrev,n,false),this.portSectorPrev=t,this.stbdSectorPrev=n;}animateWindSector(t,n,e){e&&this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),!e&&this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId);let a=()=>{e?this.portSectorAnimId=null:this.stbdSectorAnimId=null;},i=R(t,n,this.ANIMATION_DURATION,r=>this.setWindSectorPath(r,e),a,this.ngZone);e?this.portSectorAnimId=i:this.stbdSectorAnimId=i;}animateSpeedLine(t,n){this.speedLineAnimId&&(cancelAnimationFrame(this.speedLineAnimId),this.speedLineAnimId=null);let e=1e3,a=performance.now(),i=this.speedLinePrevRatio,r=(600-n)/454,f=g=>g<.5?4*g*g*g:1-Math.pow(-2*g+2,3)/2,w=g=>{let E=g-a,x=Math.min(E/e,1),I=f(x),S=(H,et)=>H+(et-H)*I,v=S(t,n),R=S(i,r);this.speedLineTipY.set(v);let D=30,P=20,tt=v-D;this.speedTipPoints.set(`600,${tt} ${600-P},${v} ${600+P},${v}`),this.speedRatioColor.set(this.interpolateColor(this.gradianColor().start,this.gradianColor().stop,R)),x<1?this.speedLineAnimId=requestAnimationFrame(w):this.speedLineAnimId=null;};requestAnimationFrame(w);}interpolateColor(t,n,e){e=Math.max(0,Math.min(1,e));function a(v){v=v.replace("#",""),v.length===3&&(v=v.split("").map(D=>D+D).join(""));let R=parseInt(v,16);return [R>>16&255,R>>8&255,R&255]}let[i,r,f]=a(t),[w,g,E]=a(n),x=Math.round(i+(w-i)*e),I=Math.round(r+(g-r)*e),S=Math.round(f+(E-f)*e);return `rgb(${x},${I},${S})`}addHeading(t=0,n=0){return ((t+n)%360+360)%360}unsignedAngleDelta(t,n){let e=(t-n+540)%360-180;return Math.abs(e)}normalizeAngle(t){return (t%360+360)%360}setLaylinePath(t,n){let e=this.normalizeAngle(t)*Math.PI/180,a=Math.floor(this.RADIUS*Math.sin(e)+this.CENTER_X),i=Math.floor(this.RADIUS*Math.cos(e)*-1+this.CENTER_Y);n?this.laylinePortPath.set(`M ${this.CENTER_X},${this.CENTER_Y} L ${a},${i}`):this.laylineStbdPath.set(`M ${this.CENTER_X},${this.CENTER_Y} L ${a},${i}`);}setWindSectorPath(t,n){let e=this.addHeading(this.addHeading(t.min,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),a=this.addHeading(this.addHeading(t.mid,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),i=this.addHeading(this.addHeading(t.max,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),r=this.RADIUS*Math.sin(e*Math.PI/180)+this.CENTER_X,f=this.RADIUS*Math.cos(e*Math.PI/180)*-1+this.CENTER_Y,w=this.RADIUS*Math.sin(a*Math.PI/180)+this.CENTER_X,g=this.RADIUS*Math.cos(a*Math.PI/180)*-1+this.CENTER_Y,E=this.RADIUS*Math.sin(i*Math.PI/180)+this.CENTER_X,x=this.RADIUS*Math.cos(i*Math.PI/180)*-1+this.CENTER_Y,I=Math.abs(Q([r,f],[w,g],[E,x]))>Math.PI/2?0:1,S=Q([E,x],[r,f],[w,g])>0?0:1,v=`M ${this.CENTER_X},${this.CENTER_Y} L ${r},${f} A ${this.RADIUS},${this.RADIUS} 0 ${I} ${S} ${E},${x} z`;n?this.portWindSectorPath.set(v):this.stbdWindSectorPath.set(v);}ngOnDestroy(){this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.portLaylineAnimId=null,this.stbdLaylineAnimId=null,this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null;let t=[this.rotatingDial(),this.twaIndicator(),this.wptIndicator(),this.setIndicator()];for(let n of t){let e=n?.nativeElement;if(!e)continue;let a=this.animationFrameIds.get(e);a&&cancelAnimationFrame(a),this.animationFrameIds.delete(e);}}static \u0275fac=function(n){return new(n||y)};static \u0275cmp=JD({type:y,selectors:[["svg-racesteer"]],viewQuery:function(n,e){n&1&&eg(e.rotatingDial,it,5)(e.twaIndicator,at,5)(e.wptIndicator,ot,5)(e.setIndicator,rt,5)(e.tackIndicator,st,5),n&2&&Kw(5);},inputs:{compassHeading:[1,"compassHeading"],tackTrue:[1,"tackTrue"],polarSpeedRatio:[1,"polarSpeedRatio"],trueWindAngle:[1,"trueWindAngle"],trueWindSpeed:[1,"trueWindSpeed"],targetAngle:[1,"targetAngle"],optimalWindAngle:[1,"optimalWindAngle"],targetVMG:[1,"targetVMG"],VMG:[1,"VMG"],sailSetupEnabled:[1,"sailSetupEnabled"],driftEnabled:[1,"driftEnabled"],driftSet:[1,"driftSet"],driftFlow:[1,"driftFlow"],waypointEnabled:[1,"waypointEnabled"],waypointAngle:[1,"waypointAngle"],vmgToWaypoint:[1,"vmgToWaypoint"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"],gradianColor:[1,"gradianColor"]},decls:174,vars:39,consts:[["rotatingDial",""],["tackIndicator",""],["twaIndicator",""],["wptIndicator",""],["setIndicator",""],["viewBox","0 0 1200 1200"],["id","defs1"],["id","linearGradient18"],["offset","0",1,"boat",2,"stop-opacity","0.71372495"],["offset","1",1,"boat",2,"stop-opacity","0"],["id","linearGradient16"],["id","linearGradient13"],["offset","0.41176471",1,"drift-arrow",2,"stop-opacity","1"],["offset","1",1,"drift-arrow",2,"stop-opacity","0"],["id","swatch4"],["offset","0","id","stop4",2,"stop-color","#000000","stop-opacity","1"],["clipPathUnits","userSpaceOnUse","id","clipPath16"],["id","ellipse16","cx","311.24539","cy","-1516.3778","rx","194.27342","ry","181.83022",2,"display","inline","fill","#9a9300","fill-opacity","1","stroke","none","stroke-width","55","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],["id","linearGradient14",0,"xlink","href","#linearGradient13","x1","453.48047","y1","583.62891","x2","638.11328","y2","583.62891","gradientUnits","userSpaceOnUse","gradientTransform","matrix(0.00723393,1.2388183,-1.0538241,0.00615367,1211.2051,-79.73465)"],["id","linearGradient17",0,"xlink","href","#linearGradient16","x1","-502.04896","y1","439.35551","x2","-316","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","linearGradient19",0,"xlink","href","#linearGradient18","x1","495.83999","y1","439.35551","x2","681.88895","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","layerBackground","transform","translate(100,100)",2,"display","inline"],["id","boat",2,"display","inline"],["id","portSide","d","M 498.75049,208.89453 A 267.09439,554.67401 0 0 1 678.45974,767.81661",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient19)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","starboardSide","d","m -499.13846,208.89453 a 267.09439,554.67401 0 0 1 179.70925,558.92208","transform","scale(-1,1)",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient17)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","layerCompass"],["id","fixedDial"],["id","dialBackground","cx","600","cy","620","r","516",1,"fixed-dial-background",2,"display","inline","stroke-width","46"],["id","barsAndText","transform","scale(1.1) translate(45,64)",1,"contrast-stroke",2,"display","inline"],["d","m 416.35095,19.837399 2.78142,15.77426","id","path199",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 334.23173,41.658798 5.47834,15.051615","id","path200",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 260.27336,81.806174 12.55151,21.739856","id","path37",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 187.44581,126.00035 10.29591,12.2702","id","path197",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 127.23918,185.95785 12.27019,10.29591","id","path198",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 83.252815,257.66724 21.739865,12.55151","id","path166",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 42.289518,332.39273 15.05162,5.47835","id","path195",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 20.127799,414.42077 15.774251,2.78142","id","path196",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 17.879075,498.47765 H 42.982096","id","path167",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 19.776759,583.71187 15.77426,-2.78142","id","path193",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 41.598167,665.8311 15.051615,-5.47834","id","path194",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 81.668963,739.71246 103.40883,727.16095","id","path168",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 125.93981,812.61701 12.2702,-10.29591","id","path191",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 185.89732,872.82365 10.29591,-12.27019","id","path192",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 257.53004,916.73298 12.55151,-21.73985","id","path169",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 332.33219,957.7732 5.47835,-15.05162","id","path189",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 414.36024,979.93493 2.78142,-15.77425","id","path190",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 498.34046,982.10672 V 957.0037","id","path170",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 583.65133,980.28596 580.86991,964.5117","id","path187",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 665.77057,958.46456 -5.47834,-15.05161","id","path188",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 739.57526,918.31683 727.02375,896.57698","id","path171",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 812.55647,874.12301 802.26056,861.85282","id","path185",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 872.76312,814.16551 860.49293,803.8696","id","path186",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 916.59579,742.45577 894.85593,729.90426","id","path172",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 957.71266,667.73063 -15.05161,-5.47834","id","path183",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 979.8744,585.70259 -15.77425,-2.78142","id","path184",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 981.96954,501.64535 -25.10304,10e-6","id","path173",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 980.22542,416.41149 -15.77425,2.78143","id","path181",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 958.40403,334.29226 -15.05161,5.47834","id","path182",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 918.17964,260.41055 -21.73986,12.55151","id","path174",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 874.06247,187.50636 -12.27018,10.29591","id","path180",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 817.34594,130.05494 -10.40259,12.17987","id","path179",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 742.31857,83.390025 729.76706,105.12988","id","path175",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 667.6701,42.350172 -5.47834,15.051615","id","path178",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 585.64206,20.188432 -2.78142,15.77425","id","path176",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 501.50816,18.016286 V 43.119307","id","path177",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],[0,"xml","space","preserve","x","181.91386","y","284.25186","id","text3","transform","rotate(-30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan3","x","181.91386","y","284.25186",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-183.53558","y","283.74811","id","text14","transform","rotate(-60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan14","x","-183.53558","y","283.74811",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-499.70761","y","100.95312","id","text15","transform","rotate(-90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan15","x","-499.70761","y","100.95312",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.66119","y","-216.36243","id","text16","transform","rotate(-120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["x","-681.66119","y","-216.36243","id","tspan25",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.06616","y","-581.71271","id","text17","transform","rotate(-150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan17","x","-681.06616","y","-581.71271",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-498.3313","y","-897.40875","id","text18","transform","scale(-1)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan18","x","-498.3313","y","-897.40875",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-184.41313","y","-1080.8452","id","text19","transform","rotate(150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan19","x","-184.41313","y","-1080.8452",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","181.57225","y","-1080.8853","id","text20","transform","rotate(120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan20","x","181.57225","y","-1080.8853",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","501.42661","y","-896.93701","id","text21","transform","rotate(90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan21","x","501.42661","y","-896.93701",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","682.35815","y","-579.63336","id","text22","transform","rotate(60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan22","x","682.35815","y","-579.63336",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","681.81525","y","-214.27321","id","text23","transform","rotate(30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan23","x","681.81525","y","-214.27321",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","500.15503","y","101.96342","id","text24",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan24","x","500.15503","y","101.96342",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],["id","LayerWindShift"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.4","stroke","none"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.4","stroke","none"],["id","LayerLayline"],["id","PortLayline",1,"portLayline"],["id","StbdLayline",1,"stbdLayline"],["id","layerCounter"],["id","tackCounter"],[0,"xml","space","preserve","x","1062","y","80",1,"tack-label"],["x","936","y","95","width","252","height","100","rx","20",1,"tack-box"],[0,"xml","space","preserve","x","1072","y","175","id","text42",1,"tack-value"],[2,"font-weight","normal"],["id","windVmgCounter"],[0,"xml","space","preserve","x","600","y","780",1,"tack-label"],[0,"xml","space","preserve","x","610","y","850",1,"wind-vmg-value"],[2,"font-weight","normal","font-size","30px"],[0,"xml","space","preserve","x","610","y","890",1,"wind-vmg-offset"],["id","waypointCounter"],[0,"xml","space","preserve","x","1062","y","1030",1,"tack-label"],["x","936","y","1045","width","252","height","140","rx","20",1,"waypoint-box"],[0,"xml","space","preserve","x","1060","y","1100",1,"waypoint-value"],[1,"tack-label"],[0,"xml","space","preserve","x","1060","y","1165",1,"waypoint-value"],["id","layerIndicators",2,"display","inline"],["d","m 606.20767,217.99458 a 6.3888631,8.8250643 0 0 1 -6.38888,8.82508 6.3888631,8.8250643 0 0 1 -6.38888,-8.82508 6.3888631,8.8250643 0 0 1 6.38888,-8.82509 6.3888631,8.8250643 0 0 1 6.38888,8.82509 z M 576.25472,75.811298 593.47058,58.265068 c 3.6173,-3.6867571 9.44162,-3.6867571 13.05892,0 l 17.21586,17.546106 c 3.6173,3.686743 3.6173,9.622786 0,13.309544 l -17.21595,17.54623 c -3.61721,3.686757 -9.44153,3.686757 -13.05893,0 L 576.25472,89.120841 c -3.6174,-3.686743 -3.6174,-9.622924 0,-13.309543 z m 17.20533,-16.510116 h 12.77766 V 218.26408 h -12.77766 z",1,"tack-angle"],["d","m 451.77021,5.469207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,230.15629 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,21.357036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.60410307,0,0,0.70555435,296.91787,121.152867)",1,"true-wind",2,"display","inline","stroke","none","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","600","y","210","id","text10",1,"card-color",2,"font-weight","bold","font-size","60px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["cx","600","cy","225","rx","23","ry","23",1,"next-waypoint"],["id","layerDirectionSpeed"],["id","directionLine","x1","600","y1","620","x2","600","y2","110",1,"direction-line"],["id","speedLine","x1","600","y1","620","x2","600",1,"speed-line"],["id","speedTip",1,"speed-line"],["id","layerDrift","transform","translate(0, 20)"],["id","setArrow","d","m 663.93337,580.60403 -64.4901,-94.9673 -63.37665,95.71396 58.48691,-30.71299 0.77713,133.08346 c 0.0992,16.99331 2.52916,30.65913 5.44822,30.64209 2.91911,-0.0171 5.18926,-13.71032 5.09001,-30.70362 l -0.77782,-133.20444 z",1,"drift-arrow",2,"fill","url(#linearGradient14)"],["id","text11",0,"xml","space","preserve","x","599.78842","y","623.55145",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none"],["id","layerHeading"],["id","rect1","width","310","height","117","x","445","y","10","rx","20",1,"heading-box",2,"stroke-width","5","stroke-opacity","0.5"],["x","600","y","110",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","120px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","5","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[2,"font-weight","normal","font-size","60px"]],template:function(n,e){n&1&&(wd(),dl(0,"svg",5)(1,"defs",6)(2,"linearGradient",7),Uh(3,"stop",8)(4,"stop",9),fl(),dl(5,"linearGradient",10),Uh(6,"stop",8)(7,"stop",9),fl(),dl(8,"linearGradient",11),Uh(9,"stop",12)(10,"stop",13),fl(),dl(11,"linearGradient",14),Uh(12,"stop",15),fl(),dl(13,"clipPath",16),Uh(14,"ellipse",17),fl(),Uh(15,"linearGradient",18)(16,"linearGradient",19)(17,"linearGradient",20),fl(),dl(18,"g",21)(19,"g",22),Uh(20,"path",23)(21,"path",24),fl()(),dl(22,"g",25)(23,"g",26),Uh(24,"circle",27),fl(),dl(25,"g",null,0)(27,"g",28),Uh(28,"path",29)(29,"path",30)(30,"path",31)(31,"path",32)(32,"path",33)(33,"path",34)(34,"path",35)(35,"path",36)(36,"path",37)(37,"path",38)(38,"path",39)(39,"path",40)(40,"path",41)(41,"path",42)(42,"path",43)(43,"path",44)(44,"path",45)(45,"path",46)(46,"path",47)(47,"path",48)(48,"path",49)(49,"path",50)(50,"path",51)(51,"path",52)(52,"path",53)(53,"path",54)(54,"path",55)(55,"path",56)(56,"path",57)(57,"path",58)(58,"path",59)(59,"path",60)(60,"path",61)(61,"path",62)(62,"path",63)(63,"path",64),dl(64,"text",65)(65,"tspan",66),TT(66,"330"),fl()(),dl(67,"text",67)(68,"tspan",68),TT(69,"300"),fl()(),dl(70,"text",69)(71,"tspan",70),TT(72,"W"),fl()(),dl(73,"text",71)(74,"tspan",72),TT(75,"240"),fl()(),dl(76,"text",73)(77,"tspan",74),TT(78,"210"),fl()(),dl(79,"text",75)(80,"tspan",76),TT(81,"S"),fl()(),dl(82,"text",77)(83,"tspan",78),TT(84,"150"),fl()(),dl(85,"text",79)(86,"tspan",80),TT(87,"120"),fl()(),dl(88,"text",81)(89,"tspan",82),TT(90,"E"),fl()(),dl(91,"text",83)(92,"tspan",84),TT(93,"60"),fl()(),dl(94,"text",85)(95,"tspan",86),TT(96,"30"),fl()(),dl(97,"text",87)(98,"tspan",88),TT(99,"N"),fl()()()()(),dl(100,"g",89),Uh(101,"path",90)(102,"path",91),fl(),dl(103,"g",92),Uh(104,"path",93)(105,"path",94),fl(),dl(106,"g",95)(107,"g",96)(108,"text",97),TT(109,"Tack/Gybe"),fl(),Uh(110,"rect",98),dl(111,"text",99),TT(112),HT(113,"number"),dl(114,"tspan",100),TT(115,"\xB0"),fl()()(),dl(116,"g",101)(117,"text",102),TT(118,"Wind VMG"),fl(),dl(119,"text",103),TT(120),dl(121,"tspan",104),TT(122," kts"),fl()(),dl(123,"text",105),TT(124),dl(125,"tspan",104),TT(126," kts"),fl()()(),dl(127,"g",106)(128,"text",107),TT(129,"Waypoint"),fl(),Uh(130,"rect",108),dl(131,"text",109)(132,"tspan",110),TT(133,"VMG: "),fl(),TT(134),dl(135,"tspan",104),TT(136," kts"),fl()(),dl(137,"text",111)(138,"tspan",110),TT(139,"HDG: "),fl(),TT(140),dl(141,"tspan",100),TT(142,"\xB0"),dl(143,"tspan",104),TT(144,"T"),fl()()()()(),dl(145,"g",112)(146,"g",null,1),Uh(148,"path",113),fl(),dl(149,"g",null,2),Uh(151,"path",114),dl(152,"text",115),TT(153,"T"),fl()(),dl(154,"g",null,3),Uh(156,"ellipse",116),fl()(),dl(157,"g",117),Uh(158,"line",118)(159,"line",119)(160,"polygon",120),fl(),dl(161,"g",121),Uh(162,"path",122,4),dl(164,"text",123),TT(165),fl()(),dl(166,"g",124),Uh(167,"rect",125),dl(168,"text",126),TT(169),dl(170,"tspan",100),TT(171,"\xB0"),dl(172,"tspan",127),TT(173,"T"),fl()()()()()),n&2&&(EE(101),ig("display",e.portWindSectorPath()!="none"?"inline":"none"),Hh("d",e.portWindSectorPath()),EE(),ig("display",e.stbdWindSectorPath()!="none"?"inline":"none"),Hh("d",e.stbdWindSectorPath()),EE(2),ig("display",e.trueWindAngle()!=null?"inline":"none"),Hh("d",e.laylinePortPath()),EE(),ig("display",e.trueWindAngle()!=null?"inline":"none"),Hh("d",e.laylineStbdPath()),EE(7),gl("",UT(113,36,e.nextTargetDirection(),"1.0-0")," "),EE(7),ig("fill",e.targetVMGOffsetRatioColor()),EE(),gg(e.targetVMG()),EE(3),ig("fill",e.targetVMGOffsetRatioColor()),EE(),gg(e.targetVMGOffset()),EE(10),gg(e.vmgToWaypoint()),EE(6),gg(e.waypointAngle()),EE(11),ig("fill",e.windAnglePerformanceRatioColor()),EE(3),Hh("display",e.waypointActive()?"inline":"none"),EE(5),ig("stroke",e.speedRatioColor()),Hh("y2",e.speedLineTipY()),EE(),ig("fill",e.speedRatioColor())("stroke",e.speedRatioColor()),Hh("points",e.speedTipPoints()),EE(),ig("display",e.driftEnabled()?"inline":"none"),EE(4),gg(e.flow()),EE(4),gl(" ",e.headingValue()));},dependencies:[es],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.fixed-dial-background[_ngcontent-%COMP%]{fill:none;stroke:var(--kip-grey-color)}.rotating-dial-Backplate[_ngcontent-%COMP%]{fill:var(--mat-sys-background)}.starboard[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stroke:var(--kip-port-color)}.heading-box[_ngcontent-%COMP%]{stroke:var(--kip-grey-color);fill:var(--kip-widget-card-background-color)}.boat[_ngcontent-%COMP%]{stop-color:var(--kip-grey-color)!important}.contrast-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}.contrast-stroke[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.card-color[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color)}.tack-box[_ngcontent-%COMP%]{stroke:var(--kip-yellow-dim-color);fill:var(--kip-widget-card-background-color);stroke-width:5}.tack-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:80px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.tack-label[_ngcontent-%COMP%]{fill:var(--kip-contrast-dim-color);font-family:Roboto;font-size:35px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.waypoint-box[_ngcontent-%COMP%]{stroke:var(--kip-orange-dim-color);fill:var(--kip-widget-card-background-color);stroke-width:5}.waypoint-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:50px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.wind-vmg-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:80px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.wind-vmg-offset[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:35px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-blue-color)}.app-wind-label[_ngcontent-%COMP%]{fill:var(--kip-orange-dim-color)}.tack-angle[_ngcontent-%COMP%]{fill:var(--kip-yellow-color);stroke-width:15;stroke-linecap:square}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-orange-color);stroke-width:20;fill:none}.next-waypoint-bar[_ngcontent-%COMP%]{stroke:var(--kip-grey-color)}.portLayline[_ngcontent-%COMP%]{stroke:var(--kip-port-color);stroke-width:5}.stbdLayline[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color);stroke-width:5}.direction-line[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color);stroke-width:5}.speed-line[_ngcontent-%COMP%]{stroke:var(--kip-blue-color);stroke-width:10;fill:var(--kip-blue-color)}.wind-sector-port[_ngcontent-%COMP%]{fill:var(--kip-port-color)}.wind-sector-stbd[_ngcontent-%COMP%]{fill:var(--kip-starboard-color)}.drift-arrow[_ngcontent-%COMP%]{stop-color:var(--kip-blue-color);stroke:var(--kip-widget-card-background-color);stroke-width:3}"]})}return y})();var yt=(()=>{class y{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,filterSelfPaths:true,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},tackTrue:{description:"True Tack",path:"self.performance.tackTrue",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},polarSpeedRatio:{description:"Polar Speed Ratio",path:"self.performance.polarSpeedRatio",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"ratio",sampleTime:500},targetAngle:{description:"Target Angle",path:"self.performance.targetAngle",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"deg",sampleTime:500},optimalWindAngle:{description:"Optimal Wind Angle",path:"self.performance.optimumWindAngle",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"deg",sampleTime:500},targetVMG:{description:"Target Velocity Made Good",path:"self.performance.targetVelocityMadeGood",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},VMG:{description:"Velocity Made Good",path:"self.performance.velocityMadeGood",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},vmgToWaypoint:{description:"Velocity Made Good to Waypoint",path:"self.performance.velocityMadeGoodToWaypoint",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:true,windSectorWindowSeconds:5,laylineEnable:true,laylineAngle:40,waypointEnable:true,courseOverGroundEnable:true,driftEnable:true,awsEnable:true,twsEnable:true,sailSetupEnable:false,enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt$1);currentHeading=vt(0);courseOverGroundAngle=vt(0);appWindAngle=vt(0);appWindSpeed=vt(0);appWindSpeedUnit=vt("knots");trueWindAngle=vt(0);trueWindSpeed=vt(0);trueWindSpeedUnit=vt("knots");driftFlow=vt(0);driftSet=vt(0);waypointAngle=vt(0);vmgToWaypoint=vt(null);tackTrue=vt(0);polarSpeedRatio=vt(0);targetAngle=vt(0);optimalWindAngle=vt(0);targetVMG=vt(0);VMG=vt(0);gradianColor=vt({start:"#3298ff",stop:"#15af00"});trueWindMinHistoric=vt(0);trueWindMidHistoric=vt(0);trueWindMaxHistoric=vt(0);normalizedConfig=Dt(()=>this.runtime.options()??y.DEFAULT_CONFIG);sailSetupEnabledValue=Dt(()=>this.normalizedConfig().sailSetupEnable??false);driftEnabledValue=Dt(()=>this.normalizedConfig().driftEnable??false);waypointEnabledValue=Dt(()=>this.normalizedConfig().waypointEnable??false);windSectorSub=null;historicalWindDirection=[];constructor(){Fa(()=>{let t=this.normalizedConfig();!t||!t.paths?.headingPath?.path||ge(()=>this.streams.observe("headingPath",a=>{let i=a?.data?.value;this.currentHeading.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.courseOverGroundEnable||!t.paths?.courseOverGround?.path||ge(()=>this.streams.observe("courseOverGround",a=>{let i=a?.data?.value;this.courseOverGroundAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.driftEnable||!t.paths?.drift?.path||ge(()=>this.streams.observe("drift",a=>{let i=a?.data?.value;this.driftFlow.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.driftEnable||!t.paths?.set?.path||ge(()=>this.streams.observe("set",a=>{let i=a?.data?.value,r=i??0;this.driftSet.set(this.addHeading(-this.currentHeading(),r));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.waypointEnable||!t.paths?.nextWaypointBearing?.path||ge(()=>this.streams.observe("nextWaypointBearing",a=>{let i=a?.data?.value;if(i==null){this.waypointAngle.set(0);return}let r=i<0?360+i:i,f=this.addHeading(-this.currentHeading(),r);this.waypointAngle.set(Math.round(f));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.awsEnable||!t.paths?.appWindAngle?.path||ge(()=>this.streams.observe("appWindAngle",a=>{let i=a?.data?.value,r=i??0;if(r=r<0?360+r:r,this.appWindAngle.set(r),t.windSectorEnable){let f=this.currentHeading(),w=this.addHeading(f,i??0);this.addHistoricalWindDirection(w,t.windSectorWindowSeconds??5);}}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.tackTrue?.path||ge(()=>this.streams.observe("tackTrue",a=>{let i=a?.data?.value;this.tackTrue.set(i==null?0:Math.round(i));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.polarSpeedRatio?.path||ge(()=>this.streams.observe("polarSpeedRatio",a=>{let i=a?.data?.value;this.polarSpeedRatio.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.targetAngle?.path||ge(()=>this.streams.observe("targetAngle",a=>{let i=a?.data?.value;this.targetAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.optimalWindAngle?.path||ge(()=>this.streams.observe("optimalWindAngle",a=>{let i=a?.data?.value;this.optimalWindAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.targetVMG?.path||ge(()=>this.streams.observe("targetVMG",a=>{let i=a?.data?.value,r=i==null?0:Math.round(i*10)/10;this.targetVMG.set(r);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.VMG?.path||ge(()=>this.streams.observe("VMG",a=>{let i=a?.data?.value,r=i==null?0:Math.round(i*10)/10;this.VMG.set(r);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.vmgToWaypoint?.path||ge(()=>this.streams.observe("vmgToWaypoint",a=>{let i=a?.data?.value,r=i==null?null:Math.round(i*10)/10;this.vmgToWaypoint.set(r);}));}),Fa(()=>{let t=this.theme();if(!t)return;let n=t?.blue??"#3298ff",e=t?.green??"#15af00";ge(()=>this.gradianColor.set({start:n,stop:e}));}),Fa(()=>{let t=this.runtime.options();!t||!t.awsEnable||!t.paths?.appWindSpeed?.path||ge(()=>this.streams.observe("appWindSpeed",a=>{let i=a?.data?.value;this.appWindSpeed.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.twsEnable||!t.paths?.trueWindSpeed?.path||ge(()=>this.streams.observe("trueWindSpeed",a=>{let i=a?.data?.value;this.trueWindSpeed.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();if(!t||!t.twsEnable)return;let e=t.paths?.trueWindAngle?.path;e&&ge(()=>this.streams.observe("trueWindAngle",a=>{let i=a?.data?.value,r=i??0;if(e.includes("angleTrueWater")||e.includes("angleTrueGround")){let f=this.currentHeading();r=this.addHeading(f,r);}else r=r<0?360+r:r;this.trueWindAngle.set(r);}));}),Fa(()=>{let t=this.normalizedConfig();t&&(t.windSectorEnable?this.windSectorSub||ge(()=>this.windSectorSub=ms(500).subscribe(()=>this.historicalCleanup(t.windSectorWindowSeconds??5))):(this.windSectorSub?.unsubscribe(),this.windSectorSub=null));});}sectorArc=Dt(()=>{let t=this.trueWindMinHistoric(),n=this.trueWindMidHistoric(),e=this.trueWindMaxHistoric();return {min:t,mid:n,max:e}});addHistoricalWindDirection(t,n){this.historicalWindDirection.push({timestamp:Date.now(),windDirection:t});let e=this.arcForAngles(this.historicalWindDirection.map(a=>a.windDirection));this.trueWindMinHistoric.set(e.min),this.trueWindMaxHistoric.set(e.max),this.trueWindMidHistoric.set(e.mid),this.historicalCleanup(n);}arcForAngles(t){return !t||t.length===0?{min:0,max:0,mid:0}:t.slice(1).reduce((e,a)=>{let i=a;for(;i<e.min-180;)i+=360;for(;i>e.max+180;)i-=360;return e.min=Math.min(e.min,i),e.max=Math.max(e.max,i),e.mid=(e.max-e.min)/2+e.min,e},{min:t[0],max:t[0],mid:t[0]})}historicalCleanup(t){let n=Date.now()-t*1e3;this.historicalWindDirection=this.historicalWindDirection.filter(e=>e.timestamp>=n);}addHeading(t,n){let e=(t+n)%360;return e<0&&(e+=360),e}ngOnDestroy(){this.windSectorSub?.unsubscribe(),this.windSectorSub=null;}static \u0275fac=function(n){return new(n||y)};static \u0275cmp=JD({type:y,selectors:[["widget-racesteer"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:20,consts:[[3,"compassHeading","tackTrue","polarSpeedRatio","trueWindAngle","trueWindSpeed","targetAngle","optimalWindAngle","targetVMG","VMG","sailSetupEnabled","driftEnabled","driftFlow","driftSet","waypointEnabled","waypointAngle","vmgToWaypoint","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","gradianColor"]],template:function(n,e){n&1&&$h(0,"svg-racesteer",0),n&2&&Bh("compassHeading",e.currentHeading())("tackTrue",e.tackTrue())("polarSpeedRatio",e.polarSpeedRatio())("trueWindAngle",e.trueWindAngle())("trueWindSpeed",e.trueWindSpeed())("targetAngle",e.targetAngle())("optimalWindAngle",e.optimalWindAngle())("targetVMG",e.targetVMG())("VMG",e.VMG())("sailSetupEnabled",e.sailSetupEnabledValue())("driftEnabled",e.driftEnabledValue())("driftFlow",e.driftFlow())("driftSet",e.driftSet())("waypointEnabled",e.waypointEnabledValue())("waypointAngle",e.waypointAngle())("vmgToWaypoint",e.vmgToWaypoint()??0)("trueWindMinHistoric",e.trueWindMinHistoric())("trueWindMidHistoric",e.trueWindMidHistoric())("trueWindMaxHistoric",e.trueWindMaxHistoric())("gradianColor",e.gradianColor());},dependencies:[J],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg-racesteer[_ngcontent-%COMP%]{width:100%;height:100%}"]})}return y})();export{yt as WidgetRacesteerComponent};
1
+ import {v,R,S}from'./chunk-CQNVyz8q.js';import {d1 as Hj,w,du as p,dv as rt$1,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,ao as ue,dz as es,cn as wd,ci as dl,cp as Uh,cj as fl,T as TT,bD as HT,e as EE,d as ig,an as Hh,bp as gl,dA as UT,aA as gg,f as eg,K as Kw,aI as ms}from'./main-IINF7HD6.js';var it=["rotatingDial"],at=["twaIndicator"],ot=["wptIndicator"],rt=["setIndicator"],st=["tackIndicator"],Q=([y,K],[t,n],[e,a])=>(Math.atan2(a-n,e-t)-Math.atan2(K-n,y-t)+3*Math.PI)%(2*Math.PI)-Math.PI,J=(()=>{class y{rotatingDial=$j.required("rotatingDial");twaIndicator=$j.required("twaIndicator");wptIndicator=$j.required("wptIndicator");setIndicator=$j.required("setIndicator");tackIndicator=$j.required("tackIndicator");compassHeading=Hj.required();tackTrue=Hj.required();polarSpeedRatio=Hj.required();trueWindAngle=Hj.required();trueWindSpeed=Hj.required();targetAngle=Hj.required();optimalWindAngle=Hj.required();targetVMG=Hj.required();VMG=Hj.required();sailSetupEnabled=Hj.required();driftEnabled=Hj.required();driftSet=Hj();driftFlow=Hj();waypointEnabled=Hj.required();waypointAngle=Hj();vmgToWaypoint=Hj();trueWindMinHistoric=Hj();trueWindMidHistoric=Hj();trueWindMaxHistoric=Hj();gradianColor=Hj.required();compass={oldValue:0,newValue:0};twa={oldValue:0,newValue:0};wpt={oldValue:0,newValue:0};tack={oldValue:0,newValue:0};set={oldValue:0,newValue:0};compassInitialized=false;twaInitialized=false;wptInitialized=false;tackInitialized=false;setInitialized=false;laylinesInitialized=false;headingValue=vt("--");windSectorsInitialized=false;trueWindHeading=0;nextTargetDirection=Dt(()=>{let t=this.compassHeading(),n=this.tackTrue();return t==null||n==null?0:this.unsignedAngleDelta(t,n)});trueWindSpeedDisplay=Dt(()=>{let t=this.trueWindSpeed();return t==null?"--":t.toFixed(1)});windAnglePerformanceRatioColor=Dt(()=>{let t=this.optimalWindAngle(),n=this.targetAngle(),e=this.gradianColor().start,a=this.gradianColor().stop;if(t==null||n==null)return e;let i=1-Math.abs(t-n)/180;return this.interpolateColor(e,a,i)});targetVMGOffset=Dt(()=>{let t=this.VMG(),n=this.targetVMG();return t==null||n==null?"--":(t-n).toFixed(1)});targetVMGOffsetRatioColor=Dt(()=>{let t=this.VMG(),n=this.targetVMG(),e=this.gradianColor().start,a=this.gradianColor().stop;if(t==null||n==null)return e;let i=t/n;return this.interpolateColor(e,a,i)});waypointActive=vt(false);flow=Dt(()=>{let t=this.driftFlow();return t==null?"--":t.toFixed(1)});portLaylinePrev=0;stbdLaylinePrev=0;portLaylineAnimId=null;stbdLaylineAnimId=null;CENTER_X=600;CENTER_Y=620;RADIUS=540;ANIMATION_DURATION=1e3;laylinePortPath=vt(`M ${this.CENTER_X},${this.CENTER_Y} ${this.CENTER_X},${this.CENTER_Y}`);laylineStbdPath=vt(`M ${this.CENTER_X},${this.CENTER_Y} ${this.CENTER_X},${this.CENTER_Y}`);portSectorPrev={min:0,mid:0,max:0};stbdSectorPrev={min:0,mid:0,max:0};portSectorAnimId=null;stbdSectorAnimId=null;portWindSectorPath=vt("");stbdWindSectorPath=vt("");speedLineTipY=vt(620);speedTipPoints=vt("600,570 580,600 620,600");speedRatioColor=vt("");speedLinePrevRatio=0;speedLinePrevTipY=600;speedLineAnimId=null;speedLineInitialized=false;animationFrameIds=new WeakMap;ngZone=w(ue);setRotationImmediate(t,n){t.setAttribute("transform",`rotate(${n} 600 620)`);}constructor(){Fa(()=>{let t=this.waypointEnabled();ge(()=>{this.waypointActive.set(t);});}),Fa(()=>{let t=this.compassHeading(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.compassInitialized?(this.compass.oldValue=this.compass.newValue,this.compass.newValue=n):(this.compass.oldValue=n,this.compass.newValue=n,this.compassInitialized=true),this.headingValue.set(n.toString()),this.rotatingDial()?.nativeElement&&(this.compass.oldValue===this.compass.newValue?this.setRotationImmediate(this.rotatingDial().nativeElement,-this.compass.newValue):S(this.rotatingDial().nativeElement,-this.compass.oldValue,-this.compass.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone),this.updateWindSectors());});}),Fa(()=>{let t=this.targetAngle(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.tackInitialized?(this.tack.oldValue=this.tack.newValue,this.tack.newValue=n):(this.tack.oldValue=n,this.tack.newValue=n,this.tackInitialized=true),this.tackIndicator()?.nativeElement&&(this.tack.oldValue===this.tack.newValue?this.setRotationImmediate(this.tackIndicator().nativeElement,this.tack.newValue):S(this.tackIndicator().nativeElement,this.tack.oldValue,this.tack.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620])),this.updateLaylines();});}),Fa(()=>{let t=this.waypointAngle();ge(()=>{if(!t){this.waypointActive.set(false);return}this.waypointEnabled()?this.waypointActive.set(true):this.waypointActive.set(false),this.wptInitialized?(this.wpt.oldValue=this.wpt.newValue,this.wpt.newValue=t):(this.wpt.oldValue=t,this.wpt.newValue=t,this.wptInitialized=true),this.wptIndicator()?.nativeElement&&(this.wpt.oldValue===this.wpt.newValue?this.setRotationImmediate(this.wptIndicator().nativeElement,this.wpt.newValue):S(this.wptIndicator().nativeElement,this.wpt.oldValue,this.wpt.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620]));});}),Fa(()=>{let t=this.trueWindAngle(),n=Number.isFinite(t)?Math.round(t):null,e=this.compassHeading(),a=Number.isFinite(e)?Math.round(e):null;n==null||a==null||ge(()=>{this.trueWindHeading=n;let i=this.addHeading(this.trueWindHeading,a*-1);this.twaInitialized?(this.twa.oldValue=this.twa.newValue,this.twa.newValue=i):(this.twa.oldValue=i,this.twa.newValue=i,this.twaInitialized=true),this.twaIndicator()?.nativeElement&&(this.twa.oldValue===this.twa.newValue?this.setRotationImmediate(this.twaIndicator().nativeElement,this.twa.newValue):S(this.twaIndicator().nativeElement,this.twa.oldValue,this.twa.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone),this.updateLaylines());});}),Fa(()=>{let t=this.polarSpeedRatio(),n=Math.max(0,Math.min(1,t)),e=620,i=e-166,r=e-i*n;if(!this.speedLineInitialized){this.speedLineInitialized=true,this.speedLineTipY.set(r);let f=30,w=20,g=r-f;this.speedTipPoints.set(`600,${g} ${600-w},${r} ${600+w},${r}`),this.speedRatioColor.set(this.interpolateColor(this.gradianColor().start,this.gradianColor().stop,n)),this.speedLinePrevTipY=r,this.speedLinePrevRatio=n;return}this.animateSpeedLine(this.speedLinePrevTipY,r),this.speedLinePrevTipY=r,this.speedLinePrevRatio=n;}),Fa(()=>{let t=this.driftSet(),n=Number.isFinite(t)?Math.round(t):null;n!=null&&ge(()=>{this.setInitialized?(this.set.oldValue=this.set.newValue,this.set.newValue=n):(this.set.oldValue=n,this.set.newValue=n,this.setInitialized=true),this.setIndicator()?.nativeElement&&(this.set.oldValue===this.set.newValue?this.setRotationImmediate(this.setIndicator().nativeElement,this.set.newValue):S(this.setIndicator().nativeElement,this.set.oldValue,this.set.newValue,this.ANIMATION_DURATION,void 0,this.animationFrameIds,[600,620],this.ngZone));});});}updateLaylines(){if(!this.twaInitialized)return;let t=this.targetAngle(),n=Number.isFinite(t)?Math.round(t):null;if(n==null)return;n=n/2;let e=Number(this.twa.newValue),a=e-n,i=e+n;if(!this.laylinesInitialized){this.laylinesInitialized=true,this.setLaylinePath(a,true),this.setLaylinePath(i,false),this.portLaylinePrev=a,this.stbdLaylinePrev=i;return}this.animateLayline(this.portLaylinePrev,a,true),this.portLaylinePrev=a,this.animateLayline(this.stbdLaylinePrev,i,false),this.stbdLaylinePrev=i;}animateLayline(t,n,e){e&&this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),!e&&this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId);let a=()=>{e?this.portLaylineAnimId=null:this.stbdLaylineAnimId=null;},i=v(t,n,this.ANIMATION_DURATION,r=>this.setLaylinePath(r,e),a,this.ngZone);e?this.portLaylineAnimId=i:this.stbdLaylineAnimId=i;}updateWindSectors(){if(this.trueWindMinHistoric()==null||this.trueWindMidHistoric()==null||this.trueWindMaxHistoric()==null)return;let t={min:this.trueWindMinHistoric(),mid:this.trueWindMidHistoric(),max:this.trueWindMaxHistoric()},n={min:this.trueWindMinHistoric(),mid:this.trueWindMidHistoric(),max:this.trueWindMaxHistoric()};if(!this.windSectorsInitialized){this.portSectorPrev=t,this.stbdSectorPrev=n,this.windSectorsInitialized=true,this.animateWindSector(t,t,true),this.animateWindSector(n,n,false);return}this.animateWindSector(this.portSectorPrev,t,true),this.animateWindSector(this.stbdSectorPrev,n,false),this.portSectorPrev=t,this.stbdSectorPrev=n;}animateWindSector(t,n,e){e&&this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),!e&&this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId);let a=()=>{e?this.portSectorAnimId=null:this.stbdSectorAnimId=null;},i=R(t,n,this.ANIMATION_DURATION,r=>this.setWindSectorPath(r,e),a,this.ngZone);e?this.portSectorAnimId=i:this.stbdSectorAnimId=i;}animateSpeedLine(t,n){this.speedLineAnimId&&(cancelAnimationFrame(this.speedLineAnimId),this.speedLineAnimId=null);let e=1e3,a=performance.now(),i=this.speedLinePrevRatio,r=(600-n)/454,f=g=>g<.5?4*g*g*g:1-Math.pow(-2*g+2,3)/2,w=g=>{let E=g-a,x=Math.min(E/e,1),I=f(x),S=(H,et)=>H+(et-H)*I,v=S(t,n),R=S(i,r);this.speedLineTipY.set(v);let D=30,P=20,tt=v-D;this.speedTipPoints.set(`600,${tt} ${600-P},${v} ${600+P},${v}`),this.speedRatioColor.set(this.interpolateColor(this.gradianColor().start,this.gradianColor().stop,R)),x<1?this.speedLineAnimId=requestAnimationFrame(w):this.speedLineAnimId=null;};requestAnimationFrame(w);}interpolateColor(t,n,e){e=Math.max(0,Math.min(1,e));function a(v){v=v.replace("#",""),v.length===3&&(v=v.split("").map(D=>D+D).join(""));let R=parseInt(v,16);return [R>>16&255,R>>8&255,R&255]}let[i,r,f]=a(t),[w,g,E]=a(n),x=Math.round(i+(w-i)*e),I=Math.round(r+(g-r)*e),S=Math.round(f+(E-f)*e);return `rgb(${x},${I},${S})`}addHeading(t=0,n=0){return ((t+n)%360+360)%360}unsignedAngleDelta(t,n){let e=(t-n+540)%360-180;return Math.abs(e)}normalizeAngle(t){return (t%360+360)%360}setLaylinePath(t,n){let e=this.normalizeAngle(t)*Math.PI/180,a=Math.floor(this.RADIUS*Math.sin(e)+this.CENTER_X),i=Math.floor(this.RADIUS*Math.cos(e)*-1+this.CENTER_Y);n?this.laylinePortPath.set(`M ${this.CENTER_X},${this.CENTER_Y} L ${a},${i}`):this.laylineStbdPath.set(`M ${this.CENTER_X},${this.CENTER_Y} L ${a},${i}`);}setWindSectorPath(t,n){let e=this.addHeading(this.addHeading(t.min,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),a=this.addHeading(this.addHeading(t.mid,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),i=this.addHeading(this.addHeading(t.max,Number(this.compass.newValue)*-1),this.targetAngle()/2*(n?-1:1)),r=this.RADIUS*Math.sin(e*Math.PI/180)+this.CENTER_X,f=this.RADIUS*Math.cos(e*Math.PI/180)*-1+this.CENTER_Y,w=this.RADIUS*Math.sin(a*Math.PI/180)+this.CENTER_X,g=this.RADIUS*Math.cos(a*Math.PI/180)*-1+this.CENTER_Y,E=this.RADIUS*Math.sin(i*Math.PI/180)+this.CENTER_X,x=this.RADIUS*Math.cos(i*Math.PI/180)*-1+this.CENTER_Y,I=Math.abs(Q([r,f],[w,g],[E,x]))>Math.PI/2?0:1,S=Q([E,x],[r,f],[w,g])>0?0:1,v=`M ${this.CENTER_X},${this.CENTER_Y} L ${r},${f} A ${this.RADIUS},${this.RADIUS} 0 ${I} ${S} ${E},${x} z`;n?this.portWindSectorPath.set(v):this.stbdWindSectorPath.set(v);}ngOnDestroy(){this.portLaylineAnimId&&cancelAnimationFrame(this.portLaylineAnimId),this.stbdLaylineAnimId&&cancelAnimationFrame(this.stbdLaylineAnimId),this.portLaylineAnimId=null,this.stbdLaylineAnimId=null,this.portSectorAnimId&&cancelAnimationFrame(this.portSectorAnimId),this.stbdSectorAnimId&&cancelAnimationFrame(this.stbdSectorAnimId),this.portSectorAnimId=null,this.stbdSectorAnimId=null;let t=[this.rotatingDial(),this.twaIndicator(),this.wptIndicator(),this.setIndicator()];for(let n of t){let e=n?.nativeElement;if(!e)continue;let a=this.animationFrameIds.get(e);a&&cancelAnimationFrame(a),this.animationFrameIds.delete(e);}}static \u0275fac=function(n){return new(n||y)};static \u0275cmp=JD({type:y,selectors:[["svg-racesteer"]],viewQuery:function(n,e){n&1&&eg(e.rotatingDial,it,5)(e.twaIndicator,at,5)(e.wptIndicator,ot,5)(e.setIndicator,rt,5)(e.tackIndicator,st,5),n&2&&Kw(5);},inputs:{compassHeading:[1,"compassHeading"],tackTrue:[1,"tackTrue"],polarSpeedRatio:[1,"polarSpeedRatio"],trueWindAngle:[1,"trueWindAngle"],trueWindSpeed:[1,"trueWindSpeed"],targetAngle:[1,"targetAngle"],optimalWindAngle:[1,"optimalWindAngle"],targetVMG:[1,"targetVMG"],VMG:[1,"VMG"],sailSetupEnabled:[1,"sailSetupEnabled"],driftEnabled:[1,"driftEnabled"],driftSet:[1,"driftSet"],driftFlow:[1,"driftFlow"],waypointEnabled:[1,"waypointEnabled"],waypointAngle:[1,"waypointAngle"],vmgToWaypoint:[1,"vmgToWaypoint"],trueWindMinHistoric:[1,"trueWindMinHistoric"],trueWindMidHistoric:[1,"trueWindMidHistoric"],trueWindMaxHistoric:[1,"trueWindMaxHistoric"],gradianColor:[1,"gradianColor"]},decls:174,vars:39,consts:[["rotatingDial",""],["tackIndicator",""],["twaIndicator",""],["wptIndicator",""],["setIndicator",""],["viewBox","0 0 1200 1200"],["id","defs1"],["id","linearGradient18"],["offset","0",1,"boat",2,"stop-opacity","0.71372495"],["offset","1",1,"boat",2,"stop-opacity","0"],["id","linearGradient16"],["id","linearGradient13"],["offset","0.41176471",1,"drift-arrow",2,"stop-opacity","1"],["offset","1",1,"drift-arrow",2,"stop-opacity","0"],["id","swatch4"],["offset","0","id","stop4",2,"stop-color","#000000","stop-opacity","1"],["clipPathUnits","userSpaceOnUse","id","clipPath16"],["id","ellipse16","cx","311.24539","cy","-1516.3778","rx","194.27342","ry","181.83022",2,"display","inline","fill","#9a9300","fill-opacity","1","stroke","none","stroke-width","55","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],["id","linearGradient14",0,"xlink","href","#linearGradient13","x1","453.48047","y1","583.62891","x2","638.11328","y2","583.62891","gradientUnits","userSpaceOnUse","gradientTransform","matrix(0.00723393,1.2388183,-1.0538241,0.00615367,1211.2051,-79.73465)"],["id","linearGradient17",0,"xlink","href","#linearGradient16","x1","-502.04896","y1","439.35551","x2","-316","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","linearGradient19",0,"xlink","href","#linearGradient18","x1","495.83999","y1","439.35551","x2","681.88895","y2","439.35551","gradientUnits","userSpaceOnUse","gradientTransform","translate(0,49.000266)"],["id","layerBackground","transform","translate(100,100)",2,"display","inline"],["id","boat",2,"display","inline"],["id","portSide","d","M 498.75049,208.89453 A 267.09439,554.67401 0 0 1 678.45974,767.81661",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient19)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","starboardSide","d","m -499.13846,208.89453 a 267.09439,554.67401 0 0 1 179.70925,558.92208","transform","scale(-1,1)",2,"fill","none","fill-opacity","1","stroke","url(#linearGradient17)","stroke-width","5.821","stroke-linecap","round","stroke-miterlimit","0","stroke-dasharray","none"],["id","layerCompass"],["id","fixedDial"],["id","dialBackground","cx","600","cy","620","r","516",1,"fixed-dial-background",2,"display","inline","stroke-width","46"],["id","barsAndText","transform","scale(1.1) translate(45,64)",1,"contrast-stroke",2,"display","inline"],["d","m 416.35095,19.837399 2.78142,15.77426","id","path199",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 334.23173,41.658798 5.47834,15.051615","id","path200",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 260.27336,81.806174 12.55151,21.739856","id","path37",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 187.44581,126.00035 10.29591,12.2702","id","path197",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 127.23918,185.95785 12.27019,10.29591","id","path198",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 83.252815,257.66724 21.739865,12.55151","id","path166",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 42.289518,332.39273 15.05162,5.47835","id","path195",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 20.127799,414.42077 15.774251,2.78142","id","path196",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 17.879075,498.47765 H 42.982096","id","path167",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 19.776759,583.71187 15.77426,-2.78142","id","path193",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 41.598167,665.8311 15.051615,-5.47834","id","path194",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 81.668963,739.71246 103.40883,727.16095","id","path168",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 125.93981,812.61701 12.2702,-10.29591","id","path191",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 185.89732,872.82365 10.29591,-12.27019","id","path192",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 257.53004,916.73298 12.55151,-21.73985","id","path169",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 332.33219,957.7732 5.47835,-15.05162","id","path189",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 414.36024,979.93493 2.78142,-15.77425","id","path190",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 498.34046,982.10672 V 957.0037","id","path170",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 583.65133,980.28596 580.86991,964.5117","id","path187",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 665.77057,958.46456 -5.47834,-15.05161","id","path188",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 739.57526,918.31683 727.02375,896.57698","id","path171",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 812.55647,874.12301 802.26056,861.85282","id","path185",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 872.76312,814.16551 860.49293,803.8696","id","path186",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 916.59579,742.45577 894.85593,729.90426","id","path172",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 957.71266,667.73063 -15.05161,-5.47834","id","path183",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 979.8744,585.70259 -15.77425,-2.78142","id","path184",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 981.96954,501.64535 -25.10304,10e-6","id","path173",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 980.22542,416.41149 -15.77425,2.78143","id","path181",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 958.40403,334.29226 -15.05161,5.47834","id","path182",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 918.17964,260.41055 -21.73986,12.55151","id","path174",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 874.06247,187.50636 -12.27018,10.29591","id","path180",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 817.34594,130.05494 -10.40259,12.17987","id","path179",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 742.31857,83.390025 729.76706,105.12988","id","path175",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 667.6701,42.350172 -5.47834,15.051615","id","path178",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","m 585.64206,20.188432 -2.78142,15.77425","id","path176",2,"fill","none","fill-opacity","0","stroke-width","4.18042","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],["d","M 501.50816,18.016286 V 43.119307","id","path177",2,"fill","none","fill-opacity","0","stroke-width","15","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0","stroke-dasharray","none"],[0,"xml","space","preserve","x","181.91386","y","284.25186","id","text3","transform","rotate(-30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan3","x","181.91386","y","284.25186",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-183.53558","y","283.74811","id","text14","transform","rotate(-60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan14","x","-183.53558","y","283.74811",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-499.70761","y","100.95312","id","text15","transform","rotate(-90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan15","x","-499.70761","y","100.95312",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.66119","y","-216.36243","id","text16","transform","rotate(-120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["x","-681.66119","y","-216.36243","id","tspan25",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-681.06616","y","-581.71271","id","text17","transform","rotate(-150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan17","x","-681.06616","y","-581.71271",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-498.3313","y","-897.40875","id","text18","transform","scale(-1)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan18","x","-498.3313","y","-897.40875",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","-184.41313","y","-1080.8452","id","text19","transform","rotate(150)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan19","x","-184.41313","y","-1080.8452",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","181.57225","y","-1080.8853","id","text20","transform","rotate(120)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan20","x","181.57225","y","-1080.8853",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","501.42661","y","-896.93701","id","text21","transform","rotate(90)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan21","x","501.42661","y","-896.93701",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","682.35815","y","-579.63336","id","text22","transform","rotate(60)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan22","x","682.35815","y","-579.63336",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","681.81525","y","-214.27321","id","text23","transform","rotate(30)",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan23","x","681.81525","y","-214.27321",2,"font-style","normal","font-variant","normal","font-weight","normal","font-stretch","normal","font-size","44.0972px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],[0,"xml","space","preserve","x","500.15503","y","101.96342","id","text24",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","display","inline","stroke","none","stroke-width","0.47625","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0"],["id","tspan24","x","500.15503","y","101.96342",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","52.9167px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke-width","0.47625"],["id","LayerWindShift"],["id","portSectorShift",1,"wind-sector-port",2,"fill-opacity","0.4","stroke","none"],["id","StbdSectorShift",1,"wind-sector-stbd",2,"fill-opacity","0.4","stroke","none"],["id","LayerLayline"],["id","PortLayline",1,"portLayline"],["id","StbdLayline",1,"stbdLayline"],["id","layerCounter"],["id","tackCounter"],[0,"xml","space","preserve","x","1062","y","80",1,"tack-label"],["x","936","y","95","width","252","height","100","rx","20",1,"tack-box"],[0,"xml","space","preserve","x","1072","y","175","id","text42",1,"tack-value"],[2,"font-weight","normal"],["id","windVmgCounter"],[0,"xml","space","preserve","x","600","y","780",1,"tack-label"],[0,"xml","space","preserve","x","610","y","850",1,"wind-vmg-value"],[2,"font-weight","normal","font-size","30px"],[0,"xml","space","preserve","x","610","y","890",1,"wind-vmg-offset"],["id","waypointCounter"],[0,"xml","space","preserve","x","1062","y","1030",1,"tack-label"],["x","936","y","1045","width","252","height","140","rx","20",1,"waypoint-box"],[0,"xml","space","preserve","x","1060","y","1100",1,"waypoint-value"],[1,"tack-label"],[0,"xml","space","preserve","x","1060","y","1165",1,"waypoint-value"],["id","layerIndicators",2,"display","inline"],["d","m 606.20767,217.99458 a 6.3888631,8.8250643 0 0 1 -6.38888,8.82508 6.3888631,8.8250643 0 0 1 -6.38888,-8.82508 6.3888631,8.8250643 0 0 1 6.38888,-8.82509 6.3888631,8.8250643 0 0 1 6.38888,8.82509 z M 576.25472,75.811298 593.47058,58.265068 c 3.6173,-3.6867571 9.44162,-3.6867571 13.05892,0 l 17.21586,17.546106 c 3.6173,3.686743 3.6173,9.622786 0,13.309544 l -17.21595,17.54623 c -3.61721,3.686757 -9.44153,3.686757 -13.05893,0 L 576.25472,89.120841 c -3.6174,-3.686743 -3.6174,-9.622924 0,-13.309543 z m 17.20533,-16.510116 h 12.77766 V 218.26408 h -12.77766 z",1,"tack-angle"],["d","m 451.77021,5.469207 42.08541,-33.202814 a 12.555638,12.555638 0.26446337 0 1 15.64423,0.07221 l 42.20046,33.930296 a 15.557694,15.557694 71.53185 0 1 5.32954,15.957795 L 504.17034,230.15629 a 2.5373267,2.5373267 0.02614114 0 1 -4.91879,-0.002 L 446.37431,21.357036 a 15.416336,15.416336 108.75875 0 1 5.3959,-15.887829 z","transform","matrix(0.60410307,0,0,0.70555435,296.91787,121.152867)",1,"true-wind",2,"display","inline","stroke","none","stroke-width","5.8876","stroke-miterlimit","0"],[0,"xml","space","preserve","x","600","y","210","id","text10",1,"card-color",2,"font-weight","bold","font-size","60px","font-family","Roboto","text-align","center","text-anchor","middle","display","inline","stroke","none"],["cx","600","cy","225","rx","23","ry","23",1,"next-waypoint"],["id","layerDirectionSpeed"],["id","directionLine","x1","600","y1","620","x2","600","y2","110",1,"direction-line"],["id","speedLine","x1","600","y1","620","x2","600",1,"speed-line"],["id","speedTip",1,"speed-line"],["id","layerDrift","transform","translate(0, 20)"],["id","setArrow","d","m 663.93337,580.60403 -64.4901,-94.9673 -63.37665,95.71396 58.48691,-30.71299 0.77713,133.08346 c 0.0992,16.99331 2.52916,30.65913 5.44822,30.64209 2.91911,-0.0171 5.18926,-13.71032 5.09001,-30.70362 l -0.77782,-133.20444 z",1,"drift-arrow",2,"fill","url(#linearGradient14)"],["id","text11",0,"xml","space","preserve","x","599.78842","y","623.55145",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-stretch","normal","font-size","66.6667px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none"],["id","layerHeading"],["id","rect1","width","310","height","117","x","445","y","10","rx","20",1,"heading-box",2,"stroke-width","5","stroke-opacity","0.5"],["x","600","y","110",1,"contrast-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","120px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","text-align","center","text-anchor","middle","stroke","none","stroke-width","5","stroke-linejoin","bevel","stroke-miterlimit","0","stroke-dasharray","none","stroke-opacity","1"],[2,"font-weight","normal","font-size","60px"]],template:function(n,e){n&1&&(wd(),dl(0,"svg",5)(1,"defs",6)(2,"linearGradient",7),Uh(3,"stop",8)(4,"stop",9),fl(),dl(5,"linearGradient",10),Uh(6,"stop",8)(7,"stop",9),fl(),dl(8,"linearGradient",11),Uh(9,"stop",12)(10,"stop",13),fl(),dl(11,"linearGradient",14),Uh(12,"stop",15),fl(),dl(13,"clipPath",16),Uh(14,"ellipse",17),fl(),Uh(15,"linearGradient",18)(16,"linearGradient",19)(17,"linearGradient",20),fl(),dl(18,"g",21)(19,"g",22),Uh(20,"path",23)(21,"path",24),fl()(),dl(22,"g",25)(23,"g",26),Uh(24,"circle",27),fl(),dl(25,"g",null,0)(27,"g",28),Uh(28,"path",29)(29,"path",30)(30,"path",31)(31,"path",32)(32,"path",33)(33,"path",34)(34,"path",35)(35,"path",36)(36,"path",37)(37,"path",38)(38,"path",39)(39,"path",40)(40,"path",41)(41,"path",42)(42,"path",43)(43,"path",44)(44,"path",45)(45,"path",46)(46,"path",47)(47,"path",48)(48,"path",49)(49,"path",50)(50,"path",51)(51,"path",52)(52,"path",53)(53,"path",54)(54,"path",55)(55,"path",56)(56,"path",57)(57,"path",58)(58,"path",59)(59,"path",60)(60,"path",61)(61,"path",62)(62,"path",63)(63,"path",64),dl(64,"text",65)(65,"tspan",66),TT(66,"330"),fl()(),dl(67,"text",67)(68,"tspan",68),TT(69,"300"),fl()(),dl(70,"text",69)(71,"tspan",70),TT(72,"W"),fl()(),dl(73,"text",71)(74,"tspan",72),TT(75,"240"),fl()(),dl(76,"text",73)(77,"tspan",74),TT(78,"210"),fl()(),dl(79,"text",75)(80,"tspan",76),TT(81,"S"),fl()(),dl(82,"text",77)(83,"tspan",78),TT(84,"150"),fl()(),dl(85,"text",79)(86,"tspan",80),TT(87,"120"),fl()(),dl(88,"text",81)(89,"tspan",82),TT(90,"E"),fl()(),dl(91,"text",83)(92,"tspan",84),TT(93,"60"),fl()(),dl(94,"text",85)(95,"tspan",86),TT(96,"30"),fl()(),dl(97,"text",87)(98,"tspan",88),TT(99,"N"),fl()()()()(),dl(100,"g",89),Uh(101,"path",90)(102,"path",91),fl(),dl(103,"g",92),Uh(104,"path",93)(105,"path",94),fl(),dl(106,"g",95)(107,"g",96)(108,"text",97),TT(109,"Tack/Gybe"),fl(),Uh(110,"rect",98),dl(111,"text",99),TT(112),HT(113,"number"),dl(114,"tspan",100),TT(115,"\xB0"),fl()()(),dl(116,"g",101)(117,"text",102),TT(118,"Wind VMG"),fl(),dl(119,"text",103),TT(120),dl(121,"tspan",104),TT(122," kts"),fl()(),dl(123,"text",105),TT(124),dl(125,"tspan",104),TT(126," kts"),fl()()(),dl(127,"g",106)(128,"text",107),TT(129,"Waypoint"),fl(),Uh(130,"rect",108),dl(131,"text",109)(132,"tspan",110),TT(133,"VMG: "),fl(),TT(134),dl(135,"tspan",104),TT(136," kts"),fl()(),dl(137,"text",111)(138,"tspan",110),TT(139,"HDG: "),fl(),TT(140),dl(141,"tspan",100),TT(142,"\xB0"),dl(143,"tspan",104),TT(144,"T"),fl()()()()(),dl(145,"g",112)(146,"g",null,1),Uh(148,"path",113),fl(),dl(149,"g",null,2),Uh(151,"path",114),dl(152,"text",115),TT(153,"T"),fl()(),dl(154,"g",null,3),Uh(156,"ellipse",116),fl()(),dl(157,"g",117),Uh(158,"line",118)(159,"line",119)(160,"polygon",120),fl(),dl(161,"g",121),Uh(162,"path",122,4),dl(164,"text",123),TT(165),fl()(),dl(166,"g",124),Uh(167,"rect",125),dl(168,"text",126),TT(169),dl(170,"tspan",100),TT(171,"\xB0"),dl(172,"tspan",127),TT(173,"T"),fl()()()()()),n&2&&(EE(101),ig("display",e.portWindSectorPath()!="none"?"inline":"none"),Hh("d",e.portWindSectorPath()),EE(),ig("display",e.stbdWindSectorPath()!="none"?"inline":"none"),Hh("d",e.stbdWindSectorPath()),EE(2),ig("display",e.trueWindAngle()!=null?"inline":"none"),Hh("d",e.laylinePortPath()),EE(),ig("display",e.trueWindAngle()!=null?"inline":"none"),Hh("d",e.laylineStbdPath()),EE(7),gl("",UT(113,36,e.nextTargetDirection(),"1.0-0")," "),EE(7),ig("fill",e.targetVMGOffsetRatioColor()),EE(),gg(e.targetVMG()),EE(3),ig("fill",e.targetVMGOffsetRatioColor()),EE(),gg(e.targetVMGOffset()),EE(10),gg(e.vmgToWaypoint()),EE(6),gg(e.waypointAngle()),EE(11),ig("fill",e.windAnglePerformanceRatioColor()),EE(3),Hh("display",e.waypointActive()?"inline":"none"),EE(5),ig("stroke",e.speedRatioColor()),Hh("y2",e.speedLineTipY()),EE(),ig("fill",e.speedRatioColor())("stroke",e.speedRatioColor()),Hh("points",e.speedTipPoints()),EE(),ig("display",e.driftEnabled()?"inline":"none"),EE(4),gg(e.flow()),EE(4),gl(" ",e.headingValue()));},dependencies:[es],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.fixed-dial-background[_ngcontent-%COMP%]{fill:none;stroke:var(--kip-grey-color)}.rotating-dial-Backplate[_ngcontent-%COMP%]{fill:var(--mat-sys-background)}.starboard[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color)}.port[_ngcontent-%COMP%]{stroke:var(--kip-port-color)}.heading-box[_ngcontent-%COMP%]{stroke:var(--kip-grey-color);fill:var(--kip-widget-card-background-color)}.boat[_ngcontent-%COMP%]{stop-color:var(--kip-grey-color)!important}.contrast-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}.contrast-stroke[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color)}.card-color[_ngcontent-%COMP%]{fill:var(--kip-widget-card-background-color)}.tack-box[_ngcontent-%COMP%]{stroke:var(--kip-yellow-dim-color);fill:var(--kip-widget-card-background-color);stroke-width:5}.tack-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:80px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.tack-label[_ngcontent-%COMP%]{fill:var(--kip-contrast-dim-color);font-family:Roboto;font-size:35px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.waypoint-box[_ngcontent-%COMP%]{stroke:var(--kip-orange-dim-color);fill:var(--kip-widget-card-background-color);stroke-width:5}.waypoint-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:50px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.wind-vmg-value[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:80px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.wind-vmg-offset[_ngcontent-%COMP%]{fill:var(--kip-contrast-color);font-family:Roboto;font-size:35px;font-style:normal;font-weight:700;text-align:center;text-anchor:middle;stroke:none}.true-wind[_ngcontent-%COMP%]{fill:var(--kip-blue-color)}.app-wind-label[_ngcontent-%COMP%]{fill:var(--kip-orange-dim-color)}.tack-angle[_ngcontent-%COMP%]{fill:var(--kip-yellow-color);stroke-width:15;stroke-linecap:square}.next-waypoint[_ngcontent-%COMP%]{stroke:var(--kip-orange-color);stroke-width:20;fill:none}.next-waypoint-bar[_ngcontent-%COMP%]{stroke:var(--kip-grey-color)}.portLayline[_ngcontent-%COMP%]{stroke:var(--kip-port-color);stroke-width:5}.stbdLayline[_ngcontent-%COMP%]{stroke:var(--kip-starboard-color);stroke-width:5}.direction-line[_ngcontent-%COMP%]{stroke:var(--kip-contrast-color);stroke-width:5}.speed-line[_ngcontent-%COMP%]{stroke:var(--kip-blue-color);stroke-width:10;fill:var(--kip-blue-color)}.wind-sector-port[_ngcontent-%COMP%]{fill:var(--kip-port-color)}.wind-sector-stbd[_ngcontent-%COMP%]{fill:var(--kip-starboard-color)}.drift-arrow[_ngcontent-%COMP%]{stop-color:var(--kip-blue-color);stroke:var(--kip-widget-card-background-color);stroke-width:3}"]})}return y})();var yt=(()=>{class y{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,filterSelfPaths:true,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},tackTrue:{description:"True Tack",path:"self.performance.tackTrue",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},polarSpeedRatio:{description:"Polar Speed Ratio",path:"self.performance.polarSpeedRatio",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"ratio",sampleTime:500},targetAngle:{description:"Target Angle",path:"self.performance.targetAngle",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"deg",sampleTime:500},optimalWindAngle:{description:"Optimal Wind Angle",path:"self.performance.optimumWindAngle",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"deg",sampleTime:500},targetVMG:{description:"Target Velocity Made Good",path:"self.performance.targetVelocityMadeGood",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},VMG:{description:"Velocity Made Good",path:"self.performance.velocityMadeGood",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:true,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},vmgToWaypoint:{description:"Velocity Made Good to Waypoint",path:"self.performance.velocityMadeGoodToWaypoint",source:"default",pathType:"number",isPathConfigurable:false,pathRequired:false,convertUnitTo:"knots",sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:true,pathRequired:false,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:true,windSectorWindowSeconds:5,laylineEnable:true,laylineAngle:40,waypointEnable:true,courseOverGroundEnable:true,driftEnable:true,awsEnable:true,twsEnable:true,sailSetupEnable:false,enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt$1);currentHeading=vt(0);courseOverGroundAngle=vt(0);appWindAngle=vt(0);appWindSpeed=vt(0);appWindSpeedUnit=vt("knots");trueWindAngle=vt(0);trueWindSpeed=vt(0);trueWindSpeedUnit=vt("knots");driftFlow=vt(0);driftSet=vt(0);waypointAngle=vt(0);vmgToWaypoint=vt(null);tackTrue=vt(0);polarSpeedRatio=vt(0);targetAngle=vt(0);optimalWindAngle=vt(0);targetVMG=vt(0);VMG=vt(0);gradianColor=vt({start:"#3298ff",stop:"#15af00"});trueWindMinHistoric=vt(0);trueWindMidHistoric=vt(0);trueWindMaxHistoric=vt(0);normalizedConfig=Dt(()=>this.runtime.options()??y.DEFAULT_CONFIG);sailSetupEnabledValue=Dt(()=>this.normalizedConfig().sailSetupEnable??false);driftEnabledValue=Dt(()=>this.normalizedConfig().driftEnable??false);waypointEnabledValue=Dt(()=>this.normalizedConfig().waypointEnable??false);windSectorSub=null;historicalWindDirection=[];constructor(){Fa(()=>{let t=this.normalizedConfig();!t||!t.paths?.headingPath?.path||ge(()=>this.streams.observe("headingPath",a=>{let i=a?.data?.value;this.currentHeading.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.courseOverGroundEnable||!t.paths?.courseOverGround?.path||ge(()=>this.streams.observe("courseOverGround",a=>{let i=a?.data?.value;this.courseOverGroundAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.driftEnable||!t.paths?.drift?.path||ge(()=>this.streams.observe("drift",a=>{let i=a?.data?.value;this.driftFlow.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.driftEnable||!t.paths?.set?.path||ge(()=>this.streams.observe("set",a=>{let i=a?.data?.value,r=i??0;this.driftSet.set(this.addHeading(-this.currentHeading(),r));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.waypointEnable||!t.paths?.nextWaypointBearing?.path||ge(()=>this.streams.observe("nextWaypointBearing",a=>{let i=a?.data?.value;if(i==null){this.waypointAngle.set(0);return}let r=i<0?360+i:i,f=this.addHeading(-this.currentHeading(),r);this.waypointAngle.set(Math.round(f));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.awsEnable||!t.paths?.appWindAngle?.path||ge(()=>this.streams.observe("appWindAngle",a=>{let i=a?.data?.value,r=i??0;if(r=r<0?360+r:r,this.appWindAngle.set(r),t.windSectorEnable){let f=this.currentHeading(),w=this.addHeading(f,i??0);this.addHistoricalWindDirection(w,t.windSectorWindowSeconds??5);}}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.tackTrue?.path||ge(()=>this.streams.observe("tackTrue",a=>{let i=a?.data?.value;this.tackTrue.set(i==null?0:Math.round(i));}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.polarSpeedRatio?.path||ge(()=>this.streams.observe("polarSpeedRatio",a=>{let i=a?.data?.value;this.polarSpeedRatio.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.targetAngle?.path||ge(()=>this.streams.observe("targetAngle",a=>{let i=a?.data?.value;this.targetAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.optimalWindAngle?.path||ge(()=>this.streams.observe("optimalWindAngle",a=>{let i=a?.data?.value;this.optimalWindAngle.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.targetVMG?.path||ge(()=>this.streams.observe("targetVMG",a=>{let i=a?.data?.value,r=i==null?0:Math.round(i*10)/10;this.targetVMG.set(r);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.VMG?.path||ge(()=>this.streams.observe("VMG",a=>{let i=a?.data?.value,r=i==null?0:Math.round(i*10)/10;this.VMG.set(r);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.paths?.vmgToWaypoint?.path||ge(()=>this.streams.observe("vmgToWaypoint",a=>{let i=a?.data?.value,r=i==null?null:Math.round(i*10)/10;this.vmgToWaypoint.set(r);}));}),Fa(()=>{let t=this.theme();if(!t)return;let n=t?.blue??"#3298ff",e=t?.green??"#15af00";ge(()=>this.gradianColor.set({start:n,stop:e}));}),Fa(()=>{let t=this.runtime.options();!t||!t.awsEnable||!t.paths?.appWindSpeed?.path||ge(()=>this.streams.observe("appWindSpeed",a=>{let i=a?.data?.value;this.appWindSpeed.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();!t||!t.twsEnable||!t.paths?.trueWindSpeed?.path||ge(()=>this.streams.observe("trueWindSpeed",a=>{let i=a?.data?.value;this.trueWindSpeed.set(i??0);}));}),Fa(()=>{let t=this.runtime.options();if(!t||!t.twsEnable)return;let e=t.paths?.trueWindAngle?.path;e&&ge(()=>this.streams.observe("trueWindAngle",a=>{let i=a?.data?.value,r=i??0;if(e.includes("angleTrueWater")||e.includes("angleTrueGround")){let f=this.currentHeading();r=this.addHeading(f,r);}else r=r<0?360+r:r;this.trueWindAngle.set(r);}));}),Fa(()=>{let t=this.normalizedConfig();t&&(t.windSectorEnable?this.windSectorSub||ge(()=>this.windSectorSub=ms(500).subscribe(()=>this.historicalCleanup(t.windSectorWindowSeconds??5))):(this.windSectorSub?.unsubscribe(),this.windSectorSub=null));});}sectorArc=Dt(()=>{let t=this.trueWindMinHistoric(),n=this.trueWindMidHistoric(),e=this.trueWindMaxHistoric();return {min:t,mid:n,max:e}});addHistoricalWindDirection(t,n){this.historicalWindDirection.push({timestamp:Date.now(),windDirection:t});let e=this.arcForAngles(this.historicalWindDirection.map(a=>a.windDirection));this.trueWindMinHistoric.set(e.min),this.trueWindMaxHistoric.set(e.max),this.trueWindMidHistoric.set(e.mid),this.historicalCleanup(n);}arcForAngles(t){return !t||t.length===0?{min:0,max:0,mid:0}:t.slice(1).reduce((e,a)=>{let i=a;for(;i<e.min-180;)i+=360;for(;i>e.max+180;)i-=360;return e.min=Math.min(e.min,i),e.max=Math.max(e.max,i),e.mid=(e.max-e.min)/2+e.min,e},{min:t[0],max:t[0],mid:t[0]})}historicalCleanup(t){let n=Date.now()-t*1e3;this.historicalWindDirection=this.historicalWindDirection.filter(e=>e.timestamp>=n);}addHeading(t,n){let e=(t+n)%360;return e<0&&(e+=360),e}ngOnDestroy(){this.windSectorSub?.unsubscribe(),this.windSectorSub=null;}static \u0275fac=function(n){return new(n||y)};static \u0275cmp=JD({type:y,selectors:[["widget-racesteer"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:20,consts:[[3,"compassHeading","tackTrue","polarSpeedRatio","trueWindAngle","trueWindSpeed","targetAngle","optimalWindAngle","targetVMG","VMG","sailSetupEnabled","driftEnabled","driftFlow","driftSet","waypointEnabled","waypointAngle","vmgToWaypoint","trueWindMinHistoric","trueWindMidHistoric","trueWindMaxHistoric","gradianColor"]],template:function(n,e){n&1&&$h(0,"svg-racesteer",0),n&2&&Bh("compassHeading",e.currentHeading())("tackTrue",e.tackTrue())("polarSpeedRatio",e.polarSpeedRatio())("trueWindAngle",e.trueWindAngle())("trueWindSpeed",e.trueWindSpeed())("targetAngle",e.targetAngle())("optimalWindAngle",e.optimalWindAngle())("targetVMG",e.targetVMG())("VMG",e.VMG())("sailSetupEnabled",e.sailSetupEnabledValue())("driftEnabled",e.driftEnabledValue())("driftFlow",e.driftFlow())("driftSet",e.driftSet())("waypointEnabled",e.waypointEnabledValue())("waypointAngle",e.waypointAngle())("vmgToWaypoint",e.vmgToWaypoint()??0)("trueWindMinHistoric",e.trueWindMinHistoric())("trueWindMidHistoric",e.trueWindMidHistoric())("trueWindMaxHistoric",e.trueWindMaxHistoric())("gradianColor",e.gradianColor());},dependencies:[J],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}svg-racesteer[_ngcontent-%COMP%]{width:100%;height:100%}"]})}return y})();export{yt as WidgetRacesteerComponent};
@@ -1,4 +1,4 @@
1
- import {O}from'./chunk-BTv5PhTr.js';import {m as me}from'./chunk-DxS7HN4G.js';import {J as JD,aO as Sn$1,aP as Nt,c as $h,P as Pi,u as ul,B as Bh,w,aQ as ee,G as Gi$1,N,aR as lt,aS as De,aT as T,aU as I,aV as We,aW as w$1,aX as He$1,aY as xe,a7 as Gj,aZ as R,$ as $j,D as Dt$1,a_ as Gp,a$ as Zr,b0 as Wl,b1 as U,b2 as Ln$1,b3 as Gn$1,b4 as Xe,b5 as Pn$1,b6 as kn$1,b7 as ft$1,b8 as Ht,b9 as rn,ba as Qt,bb as rt,bc as ae,bd as an$1,be as It$1,bf as Kt,bg as mt,bh as xp,h as Fw,k as Qh,T as TT,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,bm as Ig,bn as FT,bo as lD,bp as gl,bq as yg,br as vg,f as eg,K as Kw,i as ir,W as Wp,E as Em,bs as dp,bt as u,_ as _w,M as Mw,bu as ut$1,bv as Tn$1,bw as Bn$1,bx as Wn,by as gn$1,bz as hn$1,bA as Ft,bB as F,bC as Qa,X as xw,bD as HT,Y as Aw,bE as $T,bF as w$2,v as vt$1,bG as Bj,r as f,O as Op,bH as ln,bI as Lt,bJ as va,bK as an$2,bL as ft$2,t as pT,bM as Ge,bN as Hn$1,bO as ve,F as Fa,bP as si,a6 as Lr,bQ as Dn$1,aa as N$1,bR as ot,ad as Qe,aD as Ce$1,bS as oa$1,bT as Lg,ac as Mr,U as Kh,bU as jt,ay as lv,al as Zj,bV as Gw,bW as zw,s as sg,an as Hh,am as LT,bX as L,bY as m,bZ as Po,az as Yj,b_ as Gh,b$ as Jh,c0 as Zw,c1 as Yw,c2 as bh,c3 as Qs,c4 as Fn$1,c5 as Ut,c6 as Ii,af as Tu,c7 as Ir,c8 as Sv,ak as nw,c9 as Sh,ca as Kh$1,ap as Ki$1,aB as gr,ao as ue,aG as tD,ab as te,cb as E,cc as fn$1,av as _t$1,cd as N$2,ce as Ri,cf as xh,aH as j,cg as Ct,aj as zm,ch as Wo,ci as dl,cj as fl,d as ig,g as qw,aA as gg,S as ca,a9 as ru,ck as Nr,cl as G,cm as Kj,cn as wd,co as Mr$1,cp as Uh,cq as ie,cr as mg,cs as Sw,ct as Lh}from'./main-F7NMHHV4.js';import'./chunk-CJhkckXA.js';var tn=()=>[],nn=(n,u)=>u.key,an=(n,u)=>u.measure;function on(n,u){if(n&1&&(Pi(0,"mat-option",6),TT(1),ul()),n&2){let e=u.$implicit;Bh("value",e.measure),EE(),gg(e.description);}}function sn(n,u){if(n&1&&(Pi(0,"mat-form-field")(1,"mat-label"),TT(2),ul(),Pi(3,"mat-select",5),xw(4,on,2,2,"mat-option",6,an),ul(),cD(),ul()),n&2){let e=u.$implicit,t=qw();EE(2),gg(e.key),EE(),Bh("placeholder",e.key)("formControlName",e.key),lD(),EE(),Aw(t.groupUnits[e.key]??FT(3,tn));}}var Oi=(()=>{class n{units=w(ut$1);settings=w(Gi$1);toast=w(lt);unitsFormGroup=new Tn$1({});groupUnits={};ngOnInit(){let e=this.settings.getDefaultUnits(),t=this.units.getConversions();for(let i of t){if(i.group==="Position")continue;let s=[];for(let d of i.units)s.push(d);this.groupUnits[i.group]=s,this.unitsFormGroup.addControl(i.group,new Bn$1(e[i.group]));}this.unitsFormGroup.updateValueAndValidity();}submitConfig(){this.settings.setDefaultUnits(this.unitsFormGroup.value),this.toast.show("Configuration saved",1e3,true,"message");}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(t,i){t&1&&(Pi(0,"form",0),Qh("ngSubmit",function(){return i.submitConfig()}),Pi(1,"p"),TT(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),ul(),Pi(3,"div",1),xw(4,sn,6,4,"mat-form-field",null,nn),HT(6,"keyvalue"),ul(),Pi(7,"div",2),$h(8,"mat-divider",3),Pi(9,"button",4),TT(10,"Save"),ul()()()),t&2&&(Bh("formGroup",i.unitsFormGroup),EE(4),Aw($T(6,2,i.unitsFormGroup.controls)),EE(5),Bh("disabled",!i.unitsFormGroup.valid));},dependencies:[Ln$1,Gn$1,Pn$1,kn$1,ft$1,Wn,gn$1,hn$1,rt,ae,Ft,F,u,xp,Qa],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var Tt=new N$1("CdkAccordion"),Fi=(()=>{class n{_stateChanges=new te;_openCloseAllActions=new te;id=w(Mr).getId("cdk-accordion-");multi=false;openAll(){this.multi&&this._openCloseAllActions.next(true);}closeAll(){this._openCloseAllActions.next(false);}ngOnChanges(e){this._stateChanges.next(e);}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",Zj]},exportAs:["cdkAccordion"],features:[LT([{provide:Tt,useExisting:n}]),lv]})}return n})(),Li=(()=>{class n{accordion=w(Tt,{optional:true,skipSelf:true});_changeDetectorRef=w(Gj);_expansionDispatcher=w(E);_openCloseAllSubscription=j.EMPTY;closed=new Qe;opened=new Qe;destroyed=new Qe;expandedChange=new Qe;id=w(Mr).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let t=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,t);}else this.closed.emit();this._changeDetectorRef.markForCheck();}}_expanded=false;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e);}_disabled=vt$1(false);_removeUniqueSelectionListener=()=>{};ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=false);}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions());}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe();}toggle(){this.disabled||(this.expanded=!this.expanded);}close(){this.disabled||(this.expanded=false);}open(){this.disabled||(this.expanded=true);}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e);})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",Zj],disabled:[2,"disabled","disabled",Zj]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[LT([{provide:Tt,useValue:void 0}])]})}return n})(),Ui=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=bh({type:n});static \u0275inj=Qs({})}return n})();var dn=["body"],cn=["bodyWrapper"],mn=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],hn=["mat-expansion-panel-header","*","mat-action-row"];function pn(n,u){}var gn=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],un=["mat-panel-title","mat-panel-description","*"];function _n(n,u){n&1&&(dl(0,"span",1),wd(),dl(1,"svg",2),Uh(2,"path",3),fl()());}var Et=new N$1("MAT_ACCORDION"),Bi=new N$1("MAT_EXPANSION_PANEL"),fn=(()=>{class n{_template=w(Mr$1);_expansionPanel=w(Bi,{optional:true});static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Wi=new N$1("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),He=(()=>{class n extends Li{_viewContainerRef=w(Ki$1);_animationsDisabled=ot();_document=w(gr);_ngZone=w(ue);_elementRef=w(Lr);_renderer=w(tD);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e;}_hideToggle=false;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e;}_togglePosition;afterExpand=new Qe;afterCollapse=new Qe;_inputChanges=new te;accordion=w(Et,{optional:true,skipSelf:true});_lazyContent;_body;_bodyWrapper;_portal;_headerId=w(Mr).getId("mat-expansion-panel-header-");constructor(){super();let e=w(Wi,{optional:true});this._expansionDispatcher=w(E),e&&(this.hideToggle=e.hideToggle);}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":false}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded;}close(){this.expanded=false;}open(){this.expanded=true;}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(Tu(null),fn$1(()=>this.expanded&&!this._portal),_t$1(1)).subscribe(()=>{this._portal=new N$2(this._lazyContent._template,this._viewContainerRef);}),this._setupAnimationEvents();}ngOnChanges(e){this._inputChanges.next(e);}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete();}_containsFocus(){if(this._body){let e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return false}_transitionEndListener=({target:e,propertyName:t})=>{e===this._bodyWrapper?.nativeElement&&t==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit();});};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled");},200);});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,s){if(t&1&&Kh$1(s,fn,5),t&2){let d;Zw(d=Yw())&&(i._lazyContent=d.first);}},viewQuery:function(t,i){if(t&1&&Jh(dn,5)(cn,5),t&2){let s;Zw(s=Yw())&&(i._body=s.first),Zw(s=Yw())&&(i._bodyWrapper=s.first);}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,i){t&2&&sg("mat-expanded",i.expanded)("mat-expansion-panel-spacing",i._hasSpacing());},inputs:{hideToggle:[2,"hideToggle","hideToggle",Zj],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[LT([{provide:Et,useValue:void 0},{provide:Bi,useExisting:n}]),Sh,lv],ngContentSelectors:hn,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){t&1&&(Gw(mn),zw(0),Pi(1,"div",2,0)(3,"div",3,1)(5,"div",4),zw(6,1),xh(7,pn,0,0,"ng-template",5),ul(),zw(8,2),ul()()),t&2&&(EE(),Hh("inert",i.expanded?null:""),EE(2),Bh("id",i.id),Hh("aria-labelledby",i._headerId),EE(4),Bh("cdkPortalOutlet",i._portal));},dependencies:[Ri],styles:[`.mat-expansion-panel {
1
+ import {O}from'./chunk-BrjwTjz7.js';import {m as me}from'./chunk-BbE36LU3.js';import {J as JD,aO as Sn$1,aP as Nt,c as $h,P as Pi,u as ul,B as Bh,w,aQ as ee,G as Gi$1,N,aR as lt,aS as De,aT as T,aU as I,aV as We,aW as w$1,aX as He$1,aY as xe,a7 as Gj,aZ as R,$ as $j,D as Dt$1,a_ as Gp,a$ as Zr,b0 as Wl,b1 as U,b2 as Ln$1,b3 as Gn$1,b4 as Xe,b5 as Pn$1,b6 as kn$1,b7 as ft$1,b8 as Ht,b9 as rn,ba as Qt,bb as rt,bc as ae,bd as an$1,be as It$1,bf as Kt,bg as mt,bh as xp,h as Fw,k as Qh,T as TT,bi as Eg,l as ud,bj as ST,m as dd,bk as cD,bl as Jw,e as EE,bm as Ig,bn as FT,bo as lD,bp as gl,bq as yg,br as vg,f as eg,K as Kw,i as ir,W as Wp,E as Em,bs as dp,bt as u,_ as _w,M as Mw,bu as ut$1,bv as Tn$1,bw as Bn$1,bx as Wn,by as gn$1,bz as hn$1,bA as Ft,bB as F,bC as Qa,X as xw,bD as HT,Y as Aw,bE as $T,bF as w$2,v as vt$1,bG as Bj,r as f,O as Op,bH as ln,bI as Lt,bJ as va,bK as an$2,bL as ft$2,t as pT,bM as Ge,bN as Hn$1,bO as ve,F as Fa,bP as si,a6 as Lr,bQ as Dn$1,aa as N$1,bR as ot,ad as Qe,aD as Ce$1,bS as oa$1,bT as Lg,ac as Mr,U as Kh,bU as jt,ay as lv,al as Zj,bV as Gw,bW as zw,s as sg,an as Hh,am as LT,bX as L,bY as m,bZ as Po,az as Yj,b_ as Gh,b$ as Jh,c0 as Zw,c1 as Yw,c2 as bh,c3 as Qs,c4 as Fn$1,c5 as Ut,c6 as Ii,af as Tu,c7 as Ir,c8 as Sv,ak as nw,c9 as Sh,ca as Kh$1,ap as Ki$1,aB as gr,ao as ue,aG as tD,ab as te,cb as E,cc as fn$1,av as _t$1,cd as N$2,ce as Ri,cf as xh,aH as j,cg as Ct,aj as zm,ch as Wo,ci as dl,cj as fl,d as ig,g as qw,aA as gg,S as ca,a9 as ru,ck as Nr,cl as G,cm as Kj,cn as wd,co as Mr$1,cp as Uh,cq as ie,cr as mg,cs as Sw,ct as Lh}from'./main-IINF7HD6.js';import'./chunk-DA2JBQHi.js';var tn=()=>[],nn=(n,u)=>u.key,an=(n,u)=>u.measure;function on(n,u){if(n&1&&(Pi(0,"mat-option",6),TT(1),ul()),n&2){let e=u.$implicit;Bh("value",e.measure),EE(),gg(e.description);}}function sn(n,u){if(n&1&&(Pi(0,"mat-form-field")(1,"mat-label"),TT(2),ul(),Pi(3,"mat-select",5),xw(4,on,2,2,"mat-option",6,an),ul(),cD(),ul()),n&2){let e=u.$implicit,t=qw();EE(2),gg(e.key),EE(),Bh("placeholder",e.key)("formControlName",e.key),lD(),EE(),Aw(t.groupUnits[e.key]??FT(3,tn));}}var Oi=(()=>{class n{units=w(ut$1);settings=w(Gi$1);toast=w(lt);unitsFormGroup=new Tn$1({});groupUnits={};ngOnInit(){let e=this.settings.getDefaultUnits(),t=this.units.getConversions();for(let i of t){if(i.group==="Position")continue;let s=[];for(let d of i.units)s.push(d);this.groupUnits[i.group]=s,this.unitsFormGroup.addControl(i.group,new Bn$1(e[i.group]));}this.unitsFormGroup.updateValueAndValidity();}submitConfig(){this.settings.setDefaultUnits(this.unitsFormGroup.value),this.toast.show("Configuration saved",1e3,true,"message");}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(t,i){t&1&&(Pi(0,"form",0),Qh("ngSubmit",function(){return i.submitConfig()}),Pi(1,"p"),TT(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),ul(),Pi(3,"div",1),xw(4,sn,6,4,"mat-form-field",null,nn),HT(6,"keyvalue"),ul(),Pi(7,"div",2),$h(8,"mat-divider",3),Pi(9,"button",4),TT(10,"Save"),ul()()()),t&2&&(Bh("formGroup",i.unitsFormGroup),EE(4),Aw($T(6,2,i.unitsFormGroup.controls)),EE(5),Bh("disabled",!i.unitsFormGroup.valid));},dependencies:[Ln$1,Gn$1,Pn$1,kn$1,ft$1,Wn,gn$1,hn$1,rt,ae,Ft,F,u,xp,Qa],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var Tt=new N$1("CdkAccordion"),Fi=(()=>{class n{_stateChanges=new te;_openCloseAllActions=new te;id=w(Mr).getId("cdk-accordion-");multi=false;openAll(){this.multi&&this._openCloseAllActions.next(true);}closeAll(){this._openCloseAllActions.next(false);}ngOnChanges(e){this._stateChanges.next(e);}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",Zj]},exportAs:["cdkAccordion"],features:[LT([{provide:Tt,useExisting:n}]),lv]})}return n})(),Li=(()=>{class n{accordion=w(Tt,{optional:true,skipSelf:true});_changeDetectorRef=w(Gj);_expansionDispatcher=w(E);_openCloseAllSubscription=j.EMPTY;closed=new Qe;opened=new Qe;destroyed=new Qe;expandedChange=new Qe;id=w(Mr).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let t=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,t);}else this.closed.emit();this._changeDetectorRef.markForCheck();}}_expanded=false;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e);}_disabled=vt$1(false);_removeUniqueSelectionListener=()=>{};ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=false);}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions());}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe();}toggle(){this.disabled||(this.expanded=!this.expanded);}close(){this.disabled||(this.expanded=false);}open(){this.disabled||(this.expanded=true);}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e);})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",Zj],disabled:[2,"disabled","disabled",Zj]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[LT([{provide:Tt,useValue:void 0}])]})}return n})(),Ui=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=bh({type:n});static \u0275inj=Qs({})}return n})();var dn=["body"],cn=["bodyWrapper"],mn=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],hn=["mat-expansion-panel-header","*","mat-action-row"];function pn(n,u){}var gn=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],un=["mat-panel-title","mat-panel-description","*"];function _n(n,u){n&1&&(dl(0,"span",1),wd(),dl(1,"svg",2),Uh(2,"path",3),fl()());}var Et=new N$1("MAT_ACCORDION"),Bi=new N$1("MAT_EXPANSION_PANEL"),fn=(()=>{class n{_template=w(Mr$1);_expansionPanel=w(Bi,{optional:true});static \u0275fac=function(t){return new(t||n)};static \u0275dir=nw({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Wi=new N$1("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),He=(()=>{class n extends Li{_viewContainerRef=w(Ki$1);_animationsDisabled=ot();_document=w(gr);_ngZone=w(ue);_elementRef=w(Lr);_renderer=w(tD);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e;}_hideToggle=false;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e;}_togglePosition;afterExpand=new Qe;afterCollapse=new Qe;_inputChanges=new te;accordion=w(Et,{optional:true,skipSelf:true});_lazyContent;_body;_bodyWrapper;_portal;_headerId=w(Mr).getId("mat-expansion-panel-header-");constructor(){super();let e=w(Wi,{optional:true});this._expansionDispatcher=w(E),e&&(this.hideToggle=e.hideToggle);}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":false}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded;}close(){this.expanded=false;}open(){this.expanded=true;}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(Tu(null),fn$1(()=>this.expanded&&!this._portal),_t$1(1)).subscribe(()=>{this._portal=new N$2(this._lazyContent._template,this._viewContainerRef);}),this._setupAnimationEvents();}ngOnChanges(e){this._inputChanges.next(e);}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete();}_containsFocus(){if(this._body){let e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return false}_transitionEndListener=({target:e,propertyName:t})=>{e===this._bodyWrapper?.nativeElement&&t==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit();});};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled");},200);});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JD({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,s){if(t&1&&Kh$1(s,fn,5),t&2){let d;Zw(d=Yw())&&(i._lazyContent=d.first);}},viewQuery:function(t,i){if(t&1&&Jh(dn,5)(cn,5),t&2){let s;Zw(s=Yw())&&(i._body=s.first),Zw(s=Yw())&&(i._bodyWrapper=s.first);}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,i){t&2&&sg("mat-expanded",i.expanded)("mat-expansion-panel-spacing",i._hasSpacing());},inputs:{hideToggle:[2,"hideToggle","hideToggle",Zj],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[LT([{provide:Et,useValue:void 0},{provide:Bi,useExisting:n}]),Sh,lv],ngContentSelectors:hn,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){t&1&&(Gw(mn),zw(0),Pi(1,"div",2,0)(3,"div",3,1)(5,"div",4),zw(6,1),xh(7,pn,0,0,"ng-template",5),ul(),zw(8,2),ul()()),t&2&&(EE(),Hh("inert",i.expanded?null:""),EE(2),Bh("id",i.id),Hh("aria-labelledby",i._headerId),EE(4),Bh("cdkPortalOutlet",i._portal));},dependencies:[Ri],styles:[`.mat-expansion-panel {
2
2
  box-sizing: content-box;
3
3
  display: block;
4
4
  margin: 0;
@@ -1 +1 @@
1
- import {e as e$1}from'./chunk-CzEDfe2A.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,D as Dt,$ as $j,v as vt,dx as n$1,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-F7NMHHV4.js';import {c,e}from'./chunk-CRy9Da7a.js';var pe=["solarSvg"];function he(l,e){l&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No solar chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K solar paths or select chargers in widget settings."),ul()());}var te=class l{static SOLAR_DESCRIPTOR=a("widget-solar-charger");static SELF_ROOT_PATH=(()=>{let e=l.SOLAR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetSolarChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${l.SELF_ROOT_PATH}.*`;id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,solarCharger:{trackedDevices:[],optionsById:{}}};static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static CARD_GAP=8;static SOLAR_PANEL_SYMBOL_WIDTH=158.90796;static SOLAR_PANEL_SYMBOL_HEIGHT=94.949027;static SOLAR_PANEL_SCALE=.77;static SOLAR_PANEL_TRANSLATE_X=-36;static SOLAR_PANEL_TRANSLATE_Y=0;static SOLAR_PANEL_X=(135+l.SOLAR_PANEL_TRANSLATE_X)*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_Y=(0+l.SOLAR_PANEL_TRANSLATE_Y)*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_WIDTH=l.SOLAR_PANEL_SYMBOL_WIDTH*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_HEIGHT=l.SOLAR_PANEL_SYMBOL_HEIGHT*l.SOLAR_PANEL_SCALE;static PATH_BATCH_WINDOW_MS=500;runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);displayLabel=Dt(()=>{let e=this.visibleSolarUnits();return e.length!==1?"Solar Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});svgRef=$j.required("solarSvg");svg;layer;glowFilterId="";renderFrameId=null;pendingRenderSnapshot=null;pathBatchTimerId=null;initialPathPaintDone=false;pendingPathUpdates=new Map;discoveredSolarIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["panelVoltage","panelCurrent","voltage","current"]});chargersByKey=vt({});visibleSolarKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(a=>a.key);let r=this.chargersByKey(),t=new Set(this.discoveredSolarIds());return Object.keys(r).filter(a=>{let s=r[a];return !!s&&t.has(s.id)}).sort((a,s)=>a.localeCompare(s))});visibleSolarUnits=Dt(()=>{let e=this.visibleSolarKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleSolarUnits(),r=this.optionsById(),t=this.theme(),a=this.widgetColors(),s=this.ignoreZones()??false,i={};for(let n of e$1){let u=r[n.id]?.arrayRatedPowerW??null,c=n.panelPower??null,g=this.formatPowerAuto(c),m=u&&u>0&&c!=null?Math.max(0,Math.min(1,c/u)):0,d=n.panelPowerState??n.panelCurrentState??null,o=n.currentState??null,p=e(d,a?.dim??"var(--kip-contrast-dim-color)",t,s),T=!s&&(d===n$1.Warn||d===n$1.Alarm||d===n$1.Alert),y=e(o,"var(--kip-contrast-color)",t,s),w=this.resolveMostSevereState(n.voltageState??null,n.temperatureState??null),v=e(w,"var(--kip-contrast-color)",t,s),S=this.resolveMostSevereState(n.panelCurrentState??null,n.panelVoltageState??null,n.panelTemperatureState??null),re=e(S,"var(--kip-contrast-color)",t,s),ae=!s&&(S===n$1.Warn||S===n$1.Alarm||S===n$1.Alert),ne=e(n.loadCurrentState??null,"var(--kip-contrast-color)",t,s),I=this.valueOrDash(n.controllerMode),V=this.isRelayActive(n.load),oe=V?`${this.formatRelayState(n.load)}\xA0\xA0\xA0\xA04.5A${this.formatCurrent(n.loadCurrent)}`.trim():"",se=n.yieldToday!=null?`${this.formatEnergyYield(n.yieldToday)} Today`:"",ie=n.yieldYesterday!=null?`${this.formatEnergyYield(n.yieldYesterday)} Yesterday`:"",le=n.deviceKey??n.id;i[le]={id:n.id,source:n.source??null,deviceKey:n.deviceKey,titleText:this.resolveTitleText(n),panelPowerText:g.value,panelPowerUnitText:g.unit,panelPowerColor:p,panelPowerGlowEnabled:T,chargerCurrentTextColor:y,chargerMetaTextColor:v,panelValuesTextColor:re,panelValuesGlowEnabled:ae,gaugeProgress:m,gaugeSectionText:`${this.formatVoltage(n.panelVoltage)}`+(n.panelCurrent!=null?`, ${this.formatCurrent(n.panelCurrent)}`:"")+(n.panelTemperature!=null?`, ${this.formatTemperature(n.panelTemperature)}`:""),yieldTodayText:se,yieldYesterdayText:ie,chargerSectionCurrent:`${this.formatCurrent(n.current)}`,chargerMode:`${I.charAt(0).toUpperCase()+I.slice(1)} mode`,chargerSectionMetadata:`${n.voltage!=null?this.formatVoltage(n.voltage):""}\xA0\xA0\xA0\xA0${n.temperature!=null?this.formatTemperature(n.temperature):""}`.trim(),relaySectionVisible:V,relaySectionText:oe,relayValuesTextColor:ne};}return i});hasChargers=Dt(()=>this.visibleSolarUnits().length>0);constructor(){Fa(()=>{let r=this.runtime.options();r&&ge(()=>{this.applyConfig(r);});}),Fa(()=>{let r=this.displayModels(),t=this.visibleSolarUnits(),a=this.widgetColors();!this.svg||!a||this.requestRender({solarUnits:t,displayModels:r,widgetColors:a});});let e=this.data.subscribePathTreeWithInitial(l.ROOT_PATTERN);if(e.initial.length){for(let r of e.initial)this.enqueuePathUpdate(r,true);this.flushPendingPathUpdates(),this.initialPathPaintDone=true;}e.live$.pipe(Gp(this.destroyRef)).subscribe(r=>{this.enqueuePathUpdate(r);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${l.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Solar Charger View"),this.glowFilterId=`solar-panel-glow-${this.id()}`;let r=this.svg.append("defs").append("filter").attr("id",this.glowFilterId).attr("x","-30%").attr("y","-30%").attr("width","160%").attr("height","160%");r.append("feFlood").attr("class","solar-panel-glow-flood").attr("flood-color","var(--kip-widget-card-background-color)").attr("flood-opacity",.9).attr("result","color"),r.append("feComposite").attr("in","color").attr("in2","SourceGraphic").attr("operator","in").attr("result","coloredGlow"),r.append("feGaussianBlur").attr("in","coloredGlow").attr("stdDeviation",2).attr("result","blur");let t=r.append("feMerge");t.append("feMergeNode").attr("in","blur"),t.append("feMergeNode").attr("in","blur"),t.append("feMergeNode").attr("in","SourceGraphic"),this.layer=this.svg.append("g").attr("class","solar-layer");}applyConfig(e){let r=this.resolveSolarConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById??{}),this.cardMode.set(this.normalizeCardMode(r.cardMode));}resolveSolarConfig(e){let r=e.solarCharger,t=this.normalizeTrackedDevices(r?.trackedDevices),a=this.normalizeOptionsById(r?.optionsById);return {trackedDevices:t,optionsById:a,cardMode:this.normalizeCardMode(r?.cardMode)}}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(typeof t=="string"){let u=t.trim();if(!u)return;let c=`${u}||default`;r.set(c,{id:u,source:"default",key:c});return}if(!t||typeof t!="object")return;let a=t,s=typeof a.id=="string"?a.id.trim():"",i=typeof a.source=="string"?a.source.trim():"default";if(!s||!i)return;let n=typeof a.key=="string"&&a.key.trim().length>0?a.key.trim():`${s}||${i}`;r.set(n,{id:s,source:i,key:n});}),[...r.values()].sort((t,a)=>t.key.localeCompare(a.key))}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let a=r.get(t.id)??[];a.push(t.key),r.set(t.id,a);}),this.chargersByKey.update(t=>{let a=t,s=false;return r.forEach((i,n)=>{let u=t[n];if(u){for(let c of i){if(t[c])continue;let g=e.find(m=>m.key===c);s||(a=G({},t),s=true),a[c]=z(G({},u),{source:g?.source??null,deviceKey:c});}s&&a[n]?.deviceKey===void 0&&delete a[n];}}),s?a:t});}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null,t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["panelVoltage","panelCurrent","voltage","current"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let a=t.trim();a.length>0&&r.add(a);}),[...r].sort((t,a)=>t.localeCompare(a))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r=Object.entries(e),t={};return r.forEach(([a,s])=>{let i=this.normalizeOptionalString(a);if(!i)return;let n=s?.arrayRatedPowerW;t[i]={arrayRatedPowerW:typeof n=="number"&&Number.isFinite(n)?n:null};}),t}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parseSolarPath(e.path);if(!t)return;let{id:a,key:s}=t,i=e.update?.data?.value??null,n=e.update?.state??null,u=`${a}::${s}`;if(this.pendingPathUpdates.set(u,{id:a,key:s,value:i,state:n}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},l.PATH_BATCH_WINDOW_MS));}}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(t=>t.id)).forEach(t=>this.trackDiscoveredSolar(t)),this.chargersByKey.update(t=>{let a=t,s=false,i=this.trackedDevices(),n=i.length>0,u=new Map;n&&i.forEach(c=>{let g=u.get(c.id)??[];g.push(c.key),u.set(c.id,g);});for(let c of e){let g=n?u.get(c.id)??[]:[c.id];for(let m of g){let d=i.find(S=>S.key===m),o=a[m]??{id:c.id,source:d?.source??null,deviceKey:n?m:void 0},p=G({},o),T=this.applyChargerValue(p,c.key,c.value,c.state),y=false,w=this.resolvePowerValue(p.rawBatteryPower,p.voltage,p.current);Object.is(p.power,w)||(p.power=w,y=true);let v=this.resolvePowerValue(p.rawPanelPower,p.panelVoltage,p.panelCurrent);Object.is(p.panelPower,v)||(p.panelPower=v,y=true),!(!T&&!y)&&(s||(a=G({},a),s=true),a[m]=p);}}return s?a:t});}parseSolarPath(e){let r=e.match(/self\.electrical\.solar\.([^.]+)\.(.+)$/);if(!r)return null;let t=r[1],a=r[2],s=this.normalizeSolarMetricKey(a);return {id:t,key:s}}normalizeSolarMetricKey(e){if(e.startsWith("controller."))return e.slice(11);switch(e){case "solar.power":return "panelPower";case "solar.voltage":return "panelVoltage";case "solar.current":return "panelCurrent";case "solar.temperature":return "panelTemperature";case "charge.status":return "controllerMode";default:return e}}trackDiscoveredSolar(e){let r=this.discoveredSolarIds();r.includes(e)||this.discoveredSolarIds.set([...r,e].sort());}applyChargerValue(e,r,t,a){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "voltage":{let s=this.toNumber(t,"V"),i=!Object.is(e.voltageState??null,a??null);return Object.is(e.voltage,s)&&!i?false:(e.voltage=s,e.voltageState=a,true)}case "current":{let s=this.toNumber(t,"A"),i=!Object.is(e.currentState??null,a??null);return Object.is(e.current,s)&&!i?false:(e.current=s,e.currentState=a,true)}case "power":return this.setPowerPathValue(e,"rawBatteryPower",t);case "temperature":{let s=this.toNumber(t,this.units.getDefaults().Temperature),i=!Object.is(e.temperatureState??null,a??null);return Object.is(e.temperature,s)&&!i?false:(e.temperature=s,e.temperatureState=a,true)}case "chargingAlgorithm":return this.setValue(e,"chargingAlgorithm",this.toStringValue(t));case "chargerRole":return this.setValue(e,"chargerRole",this.toStringValue(t));case "chargingMode":return this.setValue(e,"chargingMode",this.toStringValue(t));case "setpointVoltage":return this.setValue(e,"setpointVoltage",this.toNumber(t,"V"));case "setpointCurrent":return this.setValue(e,"setpointCurrent",this.toNumber(t,"A"));case "controllerMode":return this.setValue(e,"controllerMode",this.toStringValue(t));case "panelVoltage":{let s=this.toNumber(t,"V"),i=!Object.is(e.panelVoltageState??null,a??null);return Object.is(e.panelVoltage,s)&&!i?false:(e.panelVoltage=s,e.panelVoltageState=a,true)}case "panelCurrent":{let s=this.toNumber(t,"A"),i=!Object.is(e.panelCurrentState??null,a??null);return Object.is(e.panelCurrent,s)&&!i?false:(e.panelCurrent=s,e.panelCurrentState=a,true)}case "panelPower":{let s=this.toNumber(t,"W"),i=!Object.is(e.panelPowerState??null,a??null);return Object.is(e.rawPanelPower,s)&&!i?false:(e.rawPanelPower=s,e.panelPowerState=a,true)}case "yieldToday":return this.setValue(e,"yieldToday",this.toNumber(t,"kWh"));case "yieldYesterday":return this.setValue(e,"yieldYesterday",this.toNumber(t,"kWh"));case "panelTemperature":{let s=this.toNumber(t,this.units.getDefaults().Temperature),i=!Object.is(e.panelTemperatureState??null,a??null);return Object.is(e.panelTemperature,s)&&!i?false:(e.panelTemperature=s,e.panelTemperatureState=a,true)}case "load":case "loadState":case "load.state":return this.setValue(e,"load",t);case "loadCurrent":{let s=this.toNumber(t,"A"),i=!Object.is(e.loadCurrentState??null,a??null);return Object.is(e.loadCurrent,s)&&!i?false:(e.loadCurrent=s,e.loadCurrentState=a,true)}default:return false}}setPowerPathValue(e,r,t){let a=this.toNumber(t,"W");return this.setValue(e,r,a)}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}resolvePowerValue(e,r,t){if(e!=null)return e;if(r!=null&&t!=null)return r*t}requestRender(e){this.svg&&(this.pendingRenderSnapshot=e??this.buildRenderSnapshot(),this.pendingRenderSnapshot&&this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let r=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,r&&this.render(r);})));}buildRenderSnapshot(){let e=this.widgetColors();return e?{solarUnits:this.visibleSolarUnits(),displayModels:this.displayModels(),widgetColors:e}:null}render(e){if(!this.layer||!this.svg)return;let t=this.isCompactCardMode()?e$1:e$1,a=e.solarUnits.map((o,p)=>({key:o.deviceKey??o.id,model:e.displayModels[o.deviceKey??o.id],y:p*(l.CARD_HEIGHT+l.CARD_GAP)})),s=a.length?a[a.length-1].y+l.CARD_HEIGHT:l.CARD_HEIGHT;this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${s}`);let i=this.layer.selectAll("g.solar-card").data(a,o=>o.key),n=i.enter().append("g").attr("class","solar-card");n.append("text").attr("class","solar-charger-title");let u=n.append("text").attr("class","solar-charger-current");u.append("tspan").attr("class","current-metric-value"),u.append("tspan").attr("class","current-metric-unit"),n.append("text").attr("class","solar-charger"),n.append("text").attr("class","solar-charger-meta"),n.append("text").attr("class","solar-relay-label"),n.append("text").attr("class","solar-relay-values"),n.append("text").attr("class","solar-panel-values"),n.append("text").attr("class","solar-yield-label"),n.append("text").attr("class","solar-yield-today"),n.append("text").attr("class","solar-yield-yesterday");let c=n.append("g").attr("class","solar-panel-icon").attr("transform",`translate(${l.SOLAR_PANEL_X}, ${l.SOLAR_PANEL_Y})`);c.append("use").attr("class","solar-panel-bg").attr("href","assets/svg/symbols.svg#solar-panel-cells").attr("x",0).attr("y",0).attr("width",l.SOLAR_PANEL_WIDTH).attr("height",l.SOLAR_PANEL_HEIGHT);let g=c.append("g").attr("class","solar-panel-progress");g.append("defs").append("clipPath").attr("clipPathUnits","objectBoundingBox").attr("id",o=>`solar-panel-clip-${this.id()}-${o.key}`).append("rect").attr("x",0).attr("y",0).attr("height",1).attr("width",0),g.append("use").attr("class","solar-panel-colored").attr("href","assets/svg/symbols.svg#solar-panel-cells").attr("x",0).attr("y",0).attr("width",l.SOLAR_PANEL_WIDTH).attr("height",l.SOLAR_PANEL_HEIGHT).attr("clip-path",o=>`url(#solar-panel-clip-${this.id()}-${o.key})`);let m=n.append("text").attr("class","solar-panel-power");m.append("tspan").attr("class","solar-panel-power-value"),m.append("tspan").attr("class","solar-panel-power-unit");let d=n.merge(i);d.attr("transform",o=>`translate(0, ${o.y})`),e.solarUnits.length>1?d.select("text.solar-charger-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.titleText??this.displayName(o.model)):d.select("text.solar-charger-title").text(""),d.select("text.solar-charger-current").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",o=>o.model.chargerCurrentTextColor),d.select("tspan.current-metric-value").text(o=>o.model.chargerSectionCurrent),d.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),d.select("text.solar-charger").attr("x",5).attr("y",40).attr("fill","var(--kip-contrast-color)").attr("font-size",8).attr("opacity",.8).text(o=>o.model.chargerMode),d.select("text.solar-charger-meta").attr("x",t.metaLeftX).attr("y",48).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>o.model.chargerMetaTextColor).text(o=>o.model.chargerSectionMetadata),d.select("text.solar-relay-label").attr("x",5).attr("y",73).attr("font-size",10).attr("fill","var(--kip-contrast-color)").text(o=>o.model.relaySectionVisible?"Load Output":""),d.select("text.solar-relay-values").attr("x",10).attr("y",83).attr("font-size",t.lineTwoFontSize).attr("fill",o=>o.model.relayValuesTextColor).attr("opacity",o=>o.model.relaySectionVisible?.8:0).text(o=>o.model.relaySectionText),d.select("g.solar-panel-icon").attr("transform",`translate(${l.SOLAR_PANEL_X}, ${l.SOLAR_PANEL_Y})`),d.select("use.solar-panel-bg").attr("color","var(--kip-contrast-dimmer-color)"),d.select("g.solar-panel-progress").each((o,p,T)=>{ge$1(T[p]).select("rect").attr("x",0).attr("y",0).attr("height",1).attr("width",Math.max(0,Math.min(1,o.model.gaugeProgress))),this.debugSolarLayout(o.key,o.model.gaugeProgress);}),d.select("use.solar-panel-colored").attr("color",o=>o.model.panelPowerColor),d.select("text.solar-panel-power").attr("x",137.5).attr("y",t.primaryY).attr("text-anchor","middle").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("filter",o=>o.model.panelPowerGlowEnabled?`url(#${this.glowFilterId})`:null).attr("fill","var(--kip-contrast-color)"),d.select("tspan.solar-panel-power-value").text(o=>o.model.panelPowerText),d.select("tspan.solar-panel-power-unit").attr("dx",o=>o.model.panelPowerUnitText?1:0).attr("font-size",20).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").attr("opacity",o=>o.model.panelPowerUnitText?1:0).text(o=>o.model.panelPowerUnitText),d.select("text.solar-panel-values").attr("x",137.5).attr("y",60).attr("text-anchor","middle").attr("font-size",10).attr("font-weight",500).attr("opacity",.8).attr("filter",o=>o.model.panelValuesGlowEnabled?`url(#${this.glowFilterId})`:null).attr("fill",o=>o.model.panelValuesTextColor).text(o=>o.model.gaugeSectionText).raise(),d.select("text.solar-yield-label").attr("x",104).attr("y",88).attr("text-anchor","middle").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text("Yield (kWh):"),d.select("text.solar-yield-today").attr("x",130).attr("y",88).attr("text-anchor","start").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text(o=>o.model.yieldTodayText),d.select("text.solar-yield-yesterday").attr("x",130).attr("y",97.5).attr("text-anchor","start").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text(o=>o.model.yieldYesterdayText),i.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Solar ${e.id}`}toNumber(e,r){return e==null||typeof e!="number"?null:this.units.convertToUnit(r,e)??e}isRelayActive(e){if(e==null)return false;if(typeof e=="boolean")return e;if(typeof e=="number")return e>0;let r=e.trim().toLowerCase();return !(!r||r==="off"||r==="false"||r==="0")}toStringValue(e){return typeof e=="string"?e:e==null?null:`${e}`}valueOrDash(e){return e===null?"--":e===void 0?"":e}formatVoltage(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)}V`}formatCurrent(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)}`}formatTemperature(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRelayState(e){return e===null?"--":e===void 0?"":typeof e=="boolean"?e?"On":"Off":typeof e=="number"?e>0?"On":"Off":e}formatPowerAuto(e){return e===null?{value:"--",unit:""}:e===void 0?{value:"",unit:""}:Math.abs(e)>=1e3?{value:(e/1e3).toFixed(2),unit:"kW"}:{value:e.toFixed(0),unit:"W"}}formatEnergyYield(e){return e===null?"--":e===void 0?"":`${e.toFixed(2)}`}resolveMostSevereState(...e){let r=null,t={[n$1.Normal]:0,[n$1.Nominal]:1,[n$1.Alert]:2,[n$1.Warn]:3,[n$1.Alarm]:4,[n$1.Emergency]:5};for(let a of e)a&&(!r||t[a]>t[r])&&(r=a);return r}debugSolarLayout(e,r){typeof window<"u"&&window.__KIP_DEBUG_SOLAR_LAYOUT===true&&console.debug("[solar-layout]",{id:e,gaugeProgress:r,panelX:l.SOLAR_PANEL_X,panelY:l.SOLAR_PANEL_Y,panelWidth:l.SOLAR_PANEL_WIDTH,panelHeight:l.SOLAR_PANEL_HEIGHT,clippedWidth:l.SOLAR_PANEL_WIDTH*r});}static \u0275fac=function(r){return new(r||l)};static \u0275cmp=JD({type:l,selectors:[["widget-solar-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,pe,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["solarSvg",""],[3,"text","color"],["aria-hidden","false",1,"solar-svg"],[1,"solar-empty"],[1,"solar-empty-title"],[1,"solar-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,he,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.solar-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.solar-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.solar-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.solar-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{te as WidgetSolarChargerComponent};
1
+ import {e as e$1}from'./chunk-DJVnrrxC.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,D as Dt,$ as $j,v as vt,dx as n$1,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-IINF7HD6.js';import {c,e}from'./chunk-DHj2hm9r.js';var pe=["solarSvg"];function he(l,e){l&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No solar chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K solar paths or select chargers in widget settings."),ul()());}var te=class l{static SOLAR_DESCRIPTOR=a("widget-solar-charger");static SELF_ROOT_PATH=(()=>{let e=l.SOLAR_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetSolarChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${l.SELF_ROOT_PATH}.*`;id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,solarCharger:{trackedDevices:[],optionsById:{}}};static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static CARD_GAP=8;static SOLAR_PANEL_SYMBOL_WIDTH=158.90796;static SOLAR_PANEL_SYMBOL_HEIGHT=94.949027;static SOLAR_PANEL_SCALE=.77;static SOLAR_PANEL_TRANSLATE_X=-36;static SOLAR_PANEL_TRANSLATE_Y=0;static SOLAR_PANEL_X=(135+l.SOLAR_PANEL_TRANSLATE_X)*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_Y=(0+l.SOLAR_PANEL_TRANSLATE_Y)*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_WIDTH=l.SOLAR_PANEL_SYMBOL_WIDTH*l.SOLAR_PANEL_SCALE;static SOLAR_PANEL_HEIGHT=l.SOLAR_PANEL_SYMBOL_HEIGHT*l.SOLAR_PANEL_SCALE;static PATH_BATCH_WINDOW_MS=500;runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);displayLabel=Dt(()=>{let e=this.visibleSolarUnits();return e.length!==1?"Solar Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});svgRef=$j.required("solarSvg");svg;layer;glowFilterId="";renderFrameId=null;pendingRenderSnapshot=null;pathBatchTimerId=null;initialPathPaintDone=false;pendingPathUpdates=new Map;discoveredSolarIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["panelVoltage","panelCurrent","voltage","current"]});chargersByKey=vt({});visibleSolarKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(a=>a.key);let r=this.chargersByKey(),t=new Set(this.discoveredSolarIds());return Object.keys(r).filter(a=>{let s=r[a];return !!s&&t.has(s.id)}).sort((a,s)=>a.localeCompare(s))});visibleSolarUnits=Dt(()=>{let e=this.visibleSolarKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleSolarUnits(),r=this.optionsById(),t=this.theme(),a=this.widgetColors(),s=this.ignoreZones()??false,i={};for(let n of e$1){let u=r[n.id]?.arrayRatedPowerW??null,c=n.panelPower??null,g=this.formatPowerAuto(c),m=u&&u>0&&c!=null?Math.max(0,Math.min(1,c/u)):0,d=n.panelPowerState??n.panelCurrentState??null,o=n.currentState??null,p=e(d,a?.dim??"var(--kip-contrast-dim-color)",t,s),T=!s&&(d===n$1.Warn||d===n$1.Alarm||d===n$1.Alert),y=e(o,"var(--kip-contrast-color)",t,s),w=this.resolveMostSevereState(n.voltageState??null,n.temperatureState??null),v=e(w,"var(--kip-contrast-color)",t,s),S=this.resolveMostSevereState(n.panelCurrentState??null,n.panelVoltageState??null,n.panelTemperatureState??null),re=e(S,"var(--kip-contrast-color)",t,s),ae=!s&&(S===n$1.Warn||S===n$1.Alarm||S===n$1.Alert),ne=e(n.loadCurrentState??null,"var(--kip-contrast-color)",t,s),I=this.valueOrDash(n.controllerMode),V=this.isRelayActive(n.load),oe=V?`${this.formatRelayState(n.load)}\xA0\xA0\xA0\xA04.5A${this.formatCurrent(n.loadCurrent)}`.trim():"",se=n.yieldToday!=null?`${this.formatEnergyYield(n.yieldToday)} Today`:"",ie=n.yieldYesterday!=null?`${this.formatEnergyYield(n.yieldYesterday)} Yesterday`:"",le=n.deviceKey??n.id;i[le]={id:n.id,source:n.source??null,deviceKey:n.deviceKey,titleText:this.resolveTitleText(n),panelPowerText:g.value,panelPowerUnitText:g.unit,panelPowerColor:p,panelPowerGlowEnabled:T,chargerCurrentTextColor:y,chargerMetaTextColor:v,panelValuesTextColor:re,panelValuesGlowEnabled:ae,gaugeProgress:m,gaugeSectionText:`${this.formatVoltage(n.panelVoltage)}`+(n.panelCurrent!=null?`, ${this.formatCurrent(n.panelCurrent)}`:"")+(n.panelTemperature!=null?`, ${this.formatTemperature(n.panelTemperature)}`:""),yieldTodayText:se,yieldYesterdayText:ie,chargerSectionCurrent:`${this.formatCurrent(n.current)}`,chargerMode:`${I.charAt(0).toUpperCase()+I.slice(1)} mode`,chargerSectionMetadata:`${n.voltage!=null?this.formatVoltage(n.voltage):""}\xA0\xA0\xA0\xA0${n.temperature!=null?this.formatTemperature(n.temperature):""}`.trim(),relaySectionVisible:V,relaySectionText:oe,relayValuesTextColor:ne};}return i});hasChargers=Dt(()=>this.visibleSolarUnits().length>0);constructor(){Fa(()=>{let r=this.runtime.options();r&&ge(()=>{this.applyConfig(r);});}),Fa(()=>{let r=this.displayModels(),t=this.visibleSolarUnits(),a=this.widgetColors();!this.svg||!a||this.requestRender({solarUnits:t,displayModels:r,widgetColors:a});});let e=this.data.subscribePathTreeWithInitial(l.ROOT_PATTERN);if(e.initial.length){for(let r of e.initial)this.enqueuePathUpdate(r,true);this.flushPendingPathUpdates(),this.initialPathPaintDone=true;}e.live$.pipe(Gp(this.destroyRef)).subscribe(r=>{this.enqueuePathUpdate(r);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${l.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Solar Charger View"),this.glowFilterId=`solar-panel-glow-${this.id()}`;let r=this.svg.append("defs").append("filter").attr("id",this.glowFilterId).attr("x","-30%").attr("y","-30%").attr("width","160%").attr("height","160%");r.append("feFlood").attr("class","solar-panel-glow-flood").attr("flood-color","var(--kip-widget-card-background-color)").attr("flood-opacity",.9).attr("result","color"),r.append("feComposite").attr("in","color").attr("in2","SourceGraphic").attr("operator","in").attr("result","coloredGlow"),r.append("feGaussianBlur").attr("in","coloredGlow").attr("stdDeviation",2).attr("result","blur");let t=r.append("feMerge");t.append("feMergeNode").attr("in","blur"),t.append("feMergeNode").attr("in","blur"),t.append("feMergeNode").attr("in","SourceGraphic"),this.layer=this.svg.append("g").attr("class","solar-layer");}applyConfig(e){let r=this.resolveSolarConfig(e);this.trackedDevices.set(r.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(r.trackedDevices??[]),this.optionsById.set(r.optionsById??{}),this.cardMode.set(this.normalizeCardMode(r.cardMode));}resolveSolarConfig(e){let r=e.solarCharger,t=this.normalizeTrackedDevices(r?.trackedDevices),a=this.normalizeOptionsById(r?.optionsById);return {trackedDevices:t,optionsById:a,cardMode:this.normalizeCardMode(r?.cardMode)}}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(typeof t=="string"){let u=t.trim();if(!u)return;let c=`${u}||default`;r.set(c,{id:u,source:"default",key:c});return}if(!t||typeof t!="object")return;let a=t,s=typeof a.id=="string"?a.id.trim():"",i=typeof a.source=="string"?a.source.trim():"default";if(!s||!i)return;let n=typeof a.key=="string"&&a.key.trim().length>0?a.key.trim():`${s}||${i}`;r.set(n,{id:s,source:i,key:n});}),[...r.values()].sort((t,a)=>t.key.localeCompare(a.key))}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map;e.forEach(t=>{let a=r.get(t.id)??[];a.push(t.key),r.set(t.id,a);}),this.chargersByKey.update(t=>{let a=t,s=false;return r.forEach((i,n)=>{let u=t[n];if(u){for(let c of i){if(t[c])continue;let g=e.find(m=>m.key===c);s||(a=G({},t),s=true),a[c]=z(G({},u),{source:g?.source??null,deviceKey:c});}s&&a[n]?.deviceKey===void 0&&delete a[n];}}),s?a:t});}normalizeCardMode(e){let r=e&&typeof e=="object"?e:null,t=this.normalizeStringList(r?.metrics);return {displayMode:r?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["panelVoltage","panelCurrent","voltage","current"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let r=new Set;return e.forEach(t=>{if(typeof t!="string")return;let a=t.trim();a.length>0&&r.add(a);}),[...r].sort((t,a)=>t.localeCompare(a))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let r=Object.entries(e),t={};return r.forEach(([a,s])=>{let i=this.normalizeOptionalString(a);if(!i)return;let n=s?.arrayRatedPowerW;t[i]={arrayRatedPowerW:typeof n=="number"&&Number.isFinite(n)?n:null};}),t}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parseSolarPath(e.path);if(!t)return;let{id:a,key:s}=t,i=e.update?.data?.value??null,n=e.update?.state??null,u=`${a}::${s}`;if(this.pendingPathUpdates.set(u,{id:a,key:s,value:i,state:n}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},l.PATH_BATCH_WINDOW_MS));}}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(t=>t.id)).forEach(t=>this.trackDiscoveredSolar(t)),this.chargersByKey.update(t=>{let a=t,s=false,i=this.trackedDevices(),n=i.length>0,u=new Map;n&&i.forEach(c=>{let g=u.get(c.id)??[];g.push(c.key),u.set(c.id,g);});for(let c of e){let g=n?u.get(c.id)??[]:[c.id];for(let m of g){let d=i.find(S=>S.key===m),o=a[m]??{id:c.id,source:d?.source??null,deviceKey:n?m:void 0},p=G({},o),T=this.applyChargerValue(p,c.key,c.value,c.state),y=false,w=this.resolvePowerValue(p.rawBatteryPower,p.voltage,p.current);Object.is(p.power,w)||(p.power=w,y=true);let v=this.resolvePowerValue(p.rawPanelPower,p.panelVoltage,p.panelCurrent);Object.is(p.panelPower,v)||(p.panelPower=v,y=true),!(!T&&!y)&&(s||(a=G({},a),s=true),a[m]=p);}}return s?a:t});}parseSolarPath(e){let r=e.match(/self\.electrical\.solar\.([^.]+)\.(.+)$/);if(!r)return null;let t=r[1],a=r[2],s=this.normalizeSolarMetricKey(a);return {id:t,key:s}}normalizeSolarMetricKey(e){if(e.startsWith("controller."))return e.slice(11);switch(e){case "solar.power":return "panelPower";case "solar.voltage":return "panelVoltage";case "solar.current":return "panelCurrent";case "solar.temperature":return "panelTemperature";case "charge.status":return "controllerMode";default:return e}}trackDiscoveredSolar(e){let r=this.discoveredSolarIds();r.includes(e)||this.discoveredSolarIds.set([...r,e].sort());}applyChargerValue(e,r,t,a){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "voltage":{let s=this.toNumber(t,"V"),i=!Object.is(e.voltageState??null,a??null);return Object.is(e.voltage,s)&&!i?false:(e.voltage=s,e.voltageState=a,true)}case "current":{let s=this.toNumber(t,"A"),i=!Object.is(e.currentState??null,a??null);return Object.is(e.current,s)&&!i?false:(e.current=s,e.currentState=a,true)}case "power":return this.setPowerPathValue(e,"rawBatteryPower",t);case "temperature":{let s=this.toNumber(t,this.units.getDefaults().Temperature),i=!Object.is(e.temperatureState??null,a??null);return Object.is(e.temperature,s)&&!i?false:(e.temperature=s,e.temperatureState=a,true)}case "chargingAlgorithm":return this.setValue(e,"chargingAlgorithm",this.toStringValue(t));case "chargerRole":return this.setValue(e,"chargerRole",this.toStringValue(t));case "chargingMode":return this.setValue(e,"chargingMode",this.toStringValue(t));case "setpointVoltage":return this.setValue(e,"setpointVoltage",this.toNumber(t,"V"));case "setpointCurrent":return this.setValue(e,"setpointCurrent",this.toNumber(t,"A"));case "controllerMode":return this.setValue(e,"controllerMode",this.toStringValue(t));case "panelVoltage":{let s=this.toNumber(t,"V"),i=!Object.is(e.panelVoltageState??null,a??null);return Object.is(e.panelVoltage,s)&&!i?false:(e.panelVoltage=s,e.panelVoltageState=a,true)}case "panelCurrent":{let s=this.toNumber(t,"A"),i=!Object.is(e.panelCurrentState??null,a??null);return Object.is(e.panelCurrent,s)&&!i?false:(e.panelCurrent=s,e.panelCurrentState=a,true)}case "panelPower":{let s=this.toNumber(t,"W"),i=!Object.is(e.panelPowerState??null,a??null);return Object.is(e.rawPanelPower,s)&&!i?false:(e.rawPanelPower=s,e.panelPowerState=a,true)}case "yieldToday":return this.setValue(e,"yieldToday",this.toNumber(t,"kWh"));case "yieldYesterday":return this.setValue(e,"yieldYesterday",this.toNumber(t,"kWh"));case "panelTemperature":{let s=this.toNumber(t,this.units.getDefaults().Temperature),i=!Object.is(e.panelTemperatureState??null,a??null);return Object.is(e.panelTemperature,s)&&!i?false:(e.panelTemperature=s,e.panelTemperatureState=a,true)}case "load":case "loadState":case "load.state":return this.setValue(e,"load",t);case "loadCurrent":{let s=this.toNumber(t,"A"),i=!Object.is(e.loadCurrentState??null,a??null);return Object.is(e.loadCurrent,s)&&!i?false:(e.loadCurrent=s,e.loadCurrentState=a,true)}default:return false}}setPowerPathValue(e,r,t){let a=this.toNumber(t,"W");return this.setValue(e,r,a)}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}resolvePowerValue(e,r,t){if(e!=null)return e;if(r!=null&&t!=null)return r*t}requestRender(e){this.svg&&(this.pendingRenderSnapshot=e??this.buildRenderSnapshot(),this.pendingRenderSnapshot&&this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let r=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,r&&this.render(r);})));}buildRenderSnapshot(){let e=this.widgetColors();return e?{solarUnits:this.visibleSolarUnits(),displayModels:this.displayModels(),widgetColors:e}:null}render(e){if(!this.layer||!this.svg)return;let t=this.isCompactCardMode()?e$1:e$1,a=e.solarUnits.map((o,p)=>({key:o.deviceKey??o.id,model:e.displayModels[o.deviceKey??o.id],y:p*(l.CARD_HEIGHT+l.CARD_GAP)})),s=a.length?a[a.length-1].y+l.CARD_HEIGHT:l.CARD_HEIGHT;this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${s}`);let i=this.layer.selectAll("g.solar-card").data(a,o=>o.key),n=i.enter().append("g").attr("class","solar-card");n.append("text").attr("class","solar-charger-title");let u=n.append("text").attr("class","solar-charger-current");u.append("tspan").attr("class","current-metric-value"),u.append("tspan").attr("class","current-metric-unit"),n.append("text").attr("class","solar-charger"),n.append("text").attr("class","solar-charger-meta"),n.append("text").attr("class","solar-relay-label"),n.append("text").attr("class","solar-relay-values"),n.append("text").attr("class","solar-panel-values"),n.append("text").attr("class","solar-yield-label"),n.append("text").attr("class","solar-yield-today"),n.append("text").attr("class","solar-yield-yesterday");let c=n.append("g").attr("class","solar-panel-icon").attr("transform",`translate(${l.SOLAR_PANEL_X}, ${l.SOLAR_PANEL_Y})`);c.append("use").attr("class","solar-panel-bg").attr("href","assets/svg/symbols.svg#solar-panel-cells").attr("x",0).attr("y",0).attr("width",l.SOLAR_PANEL_WIDTH).attr("height",l.SOLAR_PANEL_HEIGHT);let g=c.append("g").attr("class","solar-panel-progress");g.append("defs").append("clipPath").attr("clipPathUnits","objectBoundingBox").attr("id",o=>`solar-panel-clip-${this.id()}-${o.key}`).append("rect").attr("x",0).attr("y",0).attr("height",1).attr("width",0),g.append("use").attr("class","solar-panel-colored").attr("href","assets/svg/symbols.svg#solar-panel-cells").attr("x",0).attr("y",0).attr("width",l.SOLAR_PANEL_WIDTH).attr("height",l.SOLAR_PANEL_HEIGHT).attr("clip-path",o=>`url(#solar-panel-clip-${this.id()}-${o.key})`);let m=n.append("text").attr("class","solar-panel-power");m.append("tspan").attr("class","solar-panel-power-value"),m.append("tspan").attr("class","solar-panel-power-unit");let d=n.merge(i);d.attr("transform",o=>`translate(0, ${o.y})`),e.solarUnits.length>1?d.select("text.solar-charger-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.titleText??this.displayName(o.model)):d.select("text.solar-charger-title").text(""),d.select("text.solar-charger-current").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",o=>o.model.chargerCurrentTextColor),d.select("tspan.current-metric-value").text(o=>o.model.chargerSectionCurrent),d.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),d.select("text.solar-charger").attr("x",5).attr("y",40).attr("fill","var(--kip-contrast-color)").attr("font-size",8).attr("opacity",.8).text(o=>o.model.chargerMode),d.select("text.solar-charger-meta").attr("x",t.metaLeftX).attr("y",48).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>o.model.chargerMetaTextColor).text(o=>o.model.chargerSectionMetadata),d.select("text.solar-relay-label").attr("x",5).attr("y",73).attr("font-size",10).attr("fill","var(--kip-contrast-color)").text(o=>o.model.relaySectionVisible?"Load Output":""),d.select("text.solar-relay-values").attr("x",10).attr("y",83).attr("font-size",t.lineTwoFontSize).attr("fill",o=>o.model.relayValuesTextColor).attr("opacity",o=>o.model.relaySectionVisible?.8:0).text(o=>o.model.relaySectionText),d.select("g.solar-panel-icon").attr("transform",`translate(${l.SOLAR_PANEL_X}, ${l.SOLAR_PANEL_Y})`),d.select("use.solar-panel-bg").attr("color","var(--kip-contrast-dimmer-color)"),d.select("g.solar-panel-progress").each((o,p,T)=>{ge$1(T[p]).select("rect").attr("x",0).attr("y",0).attr("height",1).attr("width",Math.max(0,Math.min(1,o.model.gaugeProgress))),this.debugSolarLayout(o.key,o.model.gaugeProgress);}),d.select("use.solar-panel-colored").attr("color",o=>o.model.panelPowerColor),d.select("text.solar-panel-power").attr("x",137.5).attr("y",t.primaryY).attr("text-anchor","middle").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("filter",o=>o.model.panelPowerGlowEnabled?`url(#${this.glowFilterId})`:null).attr("fill","var(--kip-contrast-color)"),d.select("tspan.solar-panel-power-value").text(o=>o.model.panelPowerText),d.select("tspan.solar-panel-power-unit").attr("dx",o=>o.model.panelPowerUnitText?1:0).attr("font-size",20).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").attr("opacity",o=>o.model.panelPowerUnitText?1:0).text(o=>o.model.panelPowerUnitText),d.select("text.solar-panel-values").attr("x",137.5).attr("y",60).attr("text-anchor","middle").attr("font-size",10).attr("font-weight",500).attr("opacity",.8).attr("filter",o=>o.model.panelValuesGlowEnabled?`url(#${this.glowFilterId})`:null).attr("fill",o=>o.model.panelValuesTextColor).text(o=>o.model.gaugeSectionText).raise(),d.select("text.solar-yield-label").attr("x",104).attr("y",88).attr("text-anchor","middle").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text("Yield (kWh):"),d.select("text.solar-yield-today").attr("x",130).attr("y",88).attr("text-anchor","start").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text(o=>o.model.yieldTodayText),d.select("text.solar-yield-yesterday").attr("x",130).attr("y",97.5).attr("text-anchor","start").attr("font-size",8).attr("fill","var(--kip-contrast-dim-color)").attr("opacity",.8).text(o=>o.model.yieldYesterdayText),i.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`Solar ${e.id}`}toNumber(e,r){return e==null||typeof e!="number"?null:this.units.convertToUnit(r,e)??e}isRelayActive(e){if(e==null)return false;if(typeof e=="boolean")return e;if(typeof e=="number")return e>0;let r=e.trim().toLowerCase();return !(!r||r==="off"||r==="false"||r==="0")}toStringValue(e){return typeof e=="string"?e:e==null?null:`${e}`}valueOrDash(e){return e===null?"--":e===void 0?"":e}formatVoltage(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)}V`}formatCurrent(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)}`}formatTemperature(e){return e===null?"--":e===void 0?"":`${e.toFixed(1)} ${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`}formatRelayState(e){return e===null?"--":e===void 0?"":typeof e=="boolean"?e?"On":"Off":typeof e=="number"?e>0?"On":"Off":e}formatPowerAuto(e){return e===null?{value:"--",unit:""}:e===void 0?{value:"",unit:""}:Math.abs(e)>=1e3?{value:(e/1e3).toFixed(2),unit:"kW"}:{value:e.toFixed(0),unit:"W"}}formatEnergyYield(e){return e===null?"--":e===void 0?"":`${e.toFixed(2)}`}resolveMostSevereState(...e){let r=null,t={[n$1.Normal]:0,[n$1.Nominal]:1,[n$1.Alert]:2,[n$1.Warn]:3,[n$1.Alarm]:4,[n$1.Emergency]:5};for(let a of e)a&&(!r||t[a]>t[r])&&(r=a);return r}debugSolarLayout(e,r){typeof window<"u"&&window.__KIP_DEBUG_SOLAR_LAYOUT===true&&console.debug("[solar-layout]",{id:e,gaugeProgress:r,panelX:l.SOLAR_PANEL_X,panelY:l.SOLAR_PANEL_Y,panelWidth:l.SOLAR_PANEL_WIDTH,panelHeight:l.SOLAR_PANEL_HEIGHT,clippedWidth:l.SOLAR_PANEL_WIDTH*r});}static \u0275fac=function(r){return new(r||l)};static \u0275cmp=JD({type:l,selectors:[["widget-solar-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,pe,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["solarSvg",""],[3,"text","color"],["aria-hidden","false",1,"solar-svg"],[1,"solar-empty"],[1,"solar-empty-title"],[1,"solar-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,he,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.solar-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.solar-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.solar-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.solar-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{te as WidgetSolarChargerComponent};