@signalk/freeboard-sk 2.11.0 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # CHANGELOG: Freeboard
2
2
 
3
+ ### v2.11.2
4
+
5
+ - **Updated**: Proxy mode operation is now the default and configuration option removed. (#159)
6
+ - **Added**: Setting to mute all sounds regardless of notification ALARM_METHOD value.(#178)
7
+ - **Updated**: Show total length of Route when editing. (#171)
8
+ - **Updated**: When editing a route (on a touch device) `long-press` on a route point to delete it. (#169)
9
+ - **Added**: Toggle charts on/of by clicking chart boundaries on map.
10
+ - **Added**: Lock in `Follow Vessel` setting to remain in this mode when map is panned. (#185)
11
+ - **Fixed**: Not rendering laylines when preferred path is `environment.wind.directionMagnetic`.
12
+ - **Fixed**: Cursor position display formatting issue when using `028°15.345'S` format. (#188)
13
+
14
+ ### v2.11.1
15
+
16
+ - **Fixed**: Display of AIS COG vector does not honor setting value. (#180)
17
+ - **Added**: Separate setting for AIS COG vector.
18
+
3
19
  ### v2.11.0
4
20
 
5
21
  - **Added**: COG vector for AIS vessels. (#180)
package/README.md CHANGED
@@ -11,6 +11,7 @@ and more from any web enabled device.
11
11
 
12
12
  ![screen](https://user-images.githubusercontent.com/38519157/128667564-0f5e1ed6-eaae-40c7-ad62-5e7011c1f082.png)
13
13
 
14
+ See the [FAQs](https://github.com/SignalK/freeboard-sk/wiki) for more information.
14
15
 
15
16
  ## Features:
16
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/freeboard-sk",
3
- "version": "2.11.0",
3
+ "version": "2.11.2",
4
4
  "description": "Openlayers chart plotter implementation for Signal K",
5
5
  "keywords": [
6
6
  "signalk-webapp",
@@ -1 +1 @@
1
- (()=>{"use strict";var CI={2222:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(942)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p,h){var g=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,m=(0,r.default)(f),y=(0,o.default)(f),v=p/g,D=(0,i.default)(h),T=(0,i.default)(m),V=(0,i.default)(y),G=Math.asin(Math.sin(T)*Math.cos(v)+Math.cos(T)*Math.sin(v)*Math.cos(D)),q=V+Math.atan2(Math.sin(D)*Math.sin(v)*Math.cos(T),Math.cos(v)-Math.sin(T)*Math.sin(G)),re=(0,s.default)(q);return(re<a.MINLON||re>a.MAXLON)&&(q=(q+3*Math.PI)%(2*Math.PI)-Math.PI,re=(0,s.default)(q)),{latitude:(0,s.default)(G),longitude:re}}},7636:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0,t.sexagesimalPattern=/^([0-9]{1,3})\xb0\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['\u2032]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["\u2033]\s*)?([NEOSW]?)$/,t.earthRadius=6378137,t.MINLAT=-90,t.MAXLAT=90,t.MINLON=-180,t.MAXLON=180,t.longitudeKeys=["lng","lon","longitude",0],t.latitudeKeys=["lat","latitude",1],t.altitudeKeys=["alt","altitude","elevation","elev",2],t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},t.timeConversion={m:60,h:3600,d:86400};var p={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=p,p.sqm=p.m2,p.sqkm=p.km2,p.sqft=p.ft2,p.sqyd=p.yd2,p.sqin=p.in2},179:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var u=r.areaConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(u)return a*u;throw new Error("Invalid unit used for area conversion.")}},917:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var u=r.distanceConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(u)return a*u;throw new Error("Invalid unit used for distance conversion.")}},1167:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh"){case"kmh":return a*r.timeConversion.h*r.distanceConversion.km;case"mph":return a*r.timeConversion.h*r.distanceConversion.mi;default:return a}}},8948:(e,t)=>{function n(d,f){return function a(d){if(Array.isArray(d))return d}(d)||function s(d,f){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(d)){var p=[],h=!0,g=!1,m=void 0;try{for(var v,y=d[Symbol.iterator]();!(h=(v=y.next()).done)&&(p.push(v.value),!f||p.length!==f);h=!0);}catch(D){g=!0,m=D}finally{try{!h&&null!=y.return&&y.return()}finally{if(g)throw m}}return p}}(d,f)||function o(d,f){if(d){if("string"==typeof d)return i(d,f);var p=Object.prototype.toString.call(d).slice(8,-1);if("Object"===p&&d.constructor&&(p=d.constructor.name),"Map"===p||"Set"===p)return Array.from(d);if("Arguments"===p||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return i(d,f)}}(d,f)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(d,f){(null==f||f>d.length)&&(f=d.length);for(var p=0,h=new Array(f);p<f;p++)h[p]=d[p];return h}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(f){var h=n(f.toString().split("."),2),m=h[1],y=Math.abs(Number(h[0])),v=60*+("0."+(m||0)),D=v.toString().split("."),T=Math.floor(v),V=function(f){var h=Math.pow(10,arguments.length>1&&void 0!==arguments[1]?arguments[1]:4);return Math.round(f*h)/h}(60*+("0."+(D[1]||0))).toString(),q=n(V.split("."),2),re=q[0],X=q[1],pe=void 0===X?"0":X;return y+"\xb0 "+T.toString().padStart(2,"0")+"' "+re.padStart(2,"0")+"."+pe.padEnd(1,"0")+'"'}},1118:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(2447));t.default=function(l,u){return(0,r.default)(l,u)[0]}},1691:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(5705)),o=a(n(7029)),i=a(n(3100)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d){var f=0;if(d.length>2){for(var p,h,g,m=0;m<d.length;m++){m===d.length-2?(p=d.length-2,h=d.length-1,g=0):m===d.length-1?(p=d.length-1,h=0,g=1):(p=m,h=m+1,g=m+2);var y=(0,i.default)(d[p]),v=(0,o.default)(d[h]),D=(0,i.default)(d[g]);f+=((0,r.default)(D)-(0,r.default)(y))*Math.sin((0,r.default)(v))}f=f*s.earthRadius*s.earthRadius/2}return Math.abs(f)}},9144:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(7029)),o=i(n(3100));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u){if(!1===Array.isArray(u)||0===u.length)throw new Error("No points were given.");return u.reduce(function(c,d){var f=(0,r.default)(d),p=(0,o.default)(d);return{maxLat:Math.max(f,c.maxLat),minLat:Math.min(f,c.minLat),maxLng:Math.max(p,c.maxLng),minLng:Math.min(p,c.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}},190:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(942)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p){var X,pe,h=(0,r.default)(f),g=(0,o.default)(f),m=(0,i.default)(h),y=(0,i.default)(g),v=p/a.earthRadius,D=m-v,T=m+v,V=(0,i.default)(a.MAXLAT),G=(0,i.default)(a.MINLAT),q=(0,i.default)(a.MAXLON),re=(0,i.default)(a.MINLON);if(D>G&&T<V){var Mn=Math.asin(Math.sin(v)/Math.cos(m));(X=y-Mn)<re&&(X+=2*Math.PI),(pe=y+Mn)>q&&(pe-=2*Math.PI)}else D=Math.max(D,G),T=Math.min(T,V),X=re,pe=q;return[{latitude:(0,s.default)(D),longitude:(0,s.default)(X)},{latitude:(0,s.default)(T),longitude:(0,s.default)(pe)}]}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d){if(!1===Array.isArray(d)||0===d.length)return!1;var f=d.length,p=d.reduce(function(y,v){var D=(0,i.default)((0,r.default)(v)),T=(0,i.default)((0,o.default)(v));return{X:y.X+Math.cos(D)*Math.cos(T),Y:y.Y+Math.cos(D)*Math.sin(T),Z:y.Z+Math.sin(D)}},{X:0,Y:0,Z:0}),h=p.X/f,g=p.Y/f,m=p.Z/f;return{longitude:(0,s.default)(Math.atan2(g,h)),latitude:(0,s.default)(Math.atan2(m,Math.sqrt(h*h+g*g)))}}},7088:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(9144));t.default=function(l){var u=(0,r.default)(l),d=u.minLng+(u.maxLng-u.minLng)/2;return{latitude:parseFloat((u.minLat+(u.maxLat-u.minLat)/2).toFixed(6)),longitude:parseFloat(d.toFixed(6))}}},9952:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(939));t.default=function(l,u){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default,d="function"==typeof c?c(l,u):(0,r.default)(l,u);if(isNaN(d))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(d/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}},8744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i,s){return s.reduce(function(a,l){if(typeof i>"u"||null===i)throw new Error("'".concat(i,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(i,l)&&typeof l<"u"&&typeof a>"u"?(a=l,l):a},void 0)}},4695:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=function i(d){return d&&d.__esModule?d:{default:d}}(n(8744));function s(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(d,g).enumerable})),p.push.apply(p,h)}return p}function l(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}t.default=function(f){var p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:r.longitudeKeys,latitude:r.latitudeKeys,altitude:r.altitudeKeys},h=(0,o.default)(f,p.longitude),g=(0,o.default)(f,p.latitude),m=(0,o.default)(f,p.altitude);return function a(d){for(var f=1;f<arguments.length;f++){var p=null!=arguments[f]?arguments[f]:{};f%2?s(Object(p),!0).forEach(function(h){l(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):s(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}({latitude:g,longitude:h},m?{altitude:m}:{})}},8674:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(6522)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;h=typeof h<"u"&&!isNaN(h)?h:1;var g=(0,r.default)(f),m=(0,o.default)(f),y=(0,r.default)(p),v=(0,o.default)(p),D=Math.acos((0,s.default)(Math.sin((0,i.default)(y))*Math.sin((0,i.default)(g))+Math.cos((0,i.default)(y))*Math.cos((0,i.default)(g))*Math.cos((0,i.default)(m)-(0,i.default)(v))))*a.earthRadius;return Math.round(D/h)*h}},7504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(8674)),o=i(n(6522));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u,c,d){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,p=(0,r.default)(c,u,f),h=(0,r.default)(u,d,f),g=(0,r.default)(c,d,f),m=Math.acos((0,o.default)((p*p+g*g-h*h)/(2*p*g))),y=Math.acos((0,o.default)((h*h+g*g-p*p)/(2*h*g)));return m>Math.PI/2?p:y>Math.PI/2?h:Math.sin(m)*p}},884:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=(0,r.default)(f),h=(0,o.default)(f),g=(0,r.default)(d),m=(0,o.default)(d);return((0,s.default)(Math.atan2(Math.sin((0,i.default)(h)-(0,i.default)(m))*Math.cos((0,i.default)(p)),Math.cos((0,i.default)(g))*Math.sin((0,i.default)(p))-Math.sin((0,i.default)(g))*Math.cos((0,i.default)(p))*Math.cos((0,i.default)(h)-(0,i.default)(m))))+360)%360}},7029:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=s(n(8744)),i=s(n(5101));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c,d){var f=(0,o.default)(c,r.latitudeKeys);if(!(typeof f>"u"||null===f)){var p=c[f];return!0===d?p:(0,i.default)(p)}}},3100:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=s(n(8744)),i=s(n(5101));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c,d){var f=(0,o.default)(c,r.longitudeKeys);if(!(typeof f>"u"||null===f)){var p=c[f];return!0===d?p:(0,i.default)(p)}}},5378:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(l){return l&&l.__esModule?l:{default:l}}(n(8674));function i(l){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(l)}t.default=function(u){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default;return u.reduce(function(d,f){return"object"===i(d)&&null!==d.last&&(d.distance+=c(f,d.last)),d.last=f,d},{last:null,distance:0}).distance}},2671:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;p=typeof p<"u"&&!isNaN(p)?p:1;var V,G,q,re,X,pe,ha,h=(0,r.default)(d),g=(0,o.default)(d),m=(0,r.default)(f),y=(0,o.default)(f),v=6356752.314245,D=1/298.257223563,T=(0,i.default)(y-g),Mn=Math.atan((1-D)*Math.tan((0,i.default)(parseFloat(h)))),pa=Math.atan((1-D)*Math.tan((0,i.default)(parseFloat(m)))),Nr=Math.sin(Mn),Sr=Math.cos(Mn),Or=Math.sin(pa),Kt=Math.cos(pa),Cn=T,ga=100;do{var ni=Math.sin(Cn),ri=Math.cos(Cn);if(0===(pe=Math.sqrt(Kt*ni*(Kt*ni)+(Sr*Or-Nr*Kt*ri)*(Sr*Or-Nr*Kt*ri))))return 0;V=Nr*Or+Sr*Kt*ri,G=Math.atan2(pe,V),X=V-2*Nr*Or/(re=1-(q=Sr*Kt*ni/pe)*q),isNaN(X)&&(X=0);var oi=D/16*re*(4+D*(4-3*re));ha=Cn,Cn=T+(1-oi)*D*q*(G+oi*pe*(X+oi*V*(2*X*X-1)))}while(Math.abs(Cn-ha)>1e-12&&--ga>0);if(0===ga)return NaN;var wt=re*(s.earthRadius*s.earthRadius-v*v)/(v*v),ii=wt/1024*(256+wt*(wt*(74-47*wt)-128));return Math.round(v*(1+wt/16384*(4096+wt*(wt*(320-175*wt)-768)))*(G-ii*pe*(X+ii/4*(V*(2*X*X-1)-ii/6*X*(4*pe*pe-3)*(4*X*X-3))))/p)*p}},939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=(0,i.default)((0,o.default)(f))-(0,i.default)((0,o.default)(d)),h=Math.log(Math.tan((0,i.default)((0,r.default)(f))/2+Math.PI/4)/Math.tan((0,i.default)((0,r.default)(d))/2+Math.PI/4));return Math.abs(p)>Math.PI&&(p=p>0?-1*(2*Math.PI-p):2*Math.PI+p),((0,s.default)(Math.atan2(p,h))+360)%360}},2845:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return/^(NNE|NE|NNW|N)$/.test(i)?"N":/^(ENE|E|ESE|SE)$/.test(i)?"E":/^(SSE|S|SSW|SW)$/.test(i)?"S":/^(WSW|W|WNW|NW)$/.test(i)?"W":void 0}},8950:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default)(l,u)/(Number(u.time)-Number(l.time))*1e3}},2541:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return Mn.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return pa.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return Nr.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return Sr.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return Or.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return Kt.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return Cn.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return ha.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return ga.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return ni.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return ri.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return oi.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return wt.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return fd.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return ii.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return pd.default}});var o=H(n(2222)),i=H(n(179)),s=H(n(917)),a=H(n(1167)),l=H(n(8948)),u=H(n(1118)),c=H(n(1691)),d=H(n(9144)),f=H(n(190)),p=H(n(5524)),h=H(n(7088)),g=H(n(9952)),m=H(n(8744)),y=H(n(4695)),v=H(n(8674)),D=H(n(7504)),T=H(n(884)),V=H(n(7029)),G=H(n(3100)),q=H(n(5378)),re=H(n(2671)),X=H(n(939)),pe=H(n(2845)),Mn=H(n(8950)),pa=H(n(3026)),Nr=H(n(4194)),Sr=H(n(3536)),Or=H(n(2787)),Kt=H(n(202)),Cn=H(n(4902)),ha=H(n(7637)),ga=H(n(6563)),ni=H(n(266)),ri=H(n(2447)),oi=H(n(1532)),wt=H(n(5101)),fd=H(n(5705)),ii=H(n(942)),pd=H(n(354)),ma=n(7636);function H(O){return O&&O.__esModule?O:{default:O}}Object.keys(ma).forEach(function(O){"default"===O||"__esModule"===O||Object.prototype.hasOwnProperty.call(r,O)||Object.defineProperty(t,O,{enumerable:!0,get:function(){return ma[O]}})})},3026:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){var s=i.toString().trim();return!isNaN(parseFloat(s))&&parseFloat(s)===Number(s)}},4194:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u,c){return(0,r.default)(u,l)+(0,r.default)(l,c)===(0,r.default)(u,c)}},3536:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(7029)),o=i(n(3100));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u,c){for(var d=!1,f=c.length,p=-1,h=f-1;++p<f;h=p)((0,o.default)(c[p])<=(0,o.default)(u)&&(0,o.default)(u)<(0,o.default)(c[h])||(0,o.default)(c[h])<=(0,o.default)(u)&&(0,o.default)(u)<(0,o.default)(c[p]))&&(0,r.default)(u)<((0,r.default)(c[h])-(0,r.default)(c[p]))*((0,o.default)(u)-(0,o.default)(c[p]))/((0,o.default)(c[h])-(0,o.default)(c[p]))+(0,r.default)(c[p])&&(d=!d);return d}},2787:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(7504));t.default=function(l,u,c,d){return(0,r.default)(l,u,c)<d}},202:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u,c){return(0,r.default)(l,u,.01)<c}},4902:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){return r.sexagesimalPattern.test(a.toString().trim())}},7637:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(4695)),o=s(n(6563)),i=s(n(266));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c){var d=(0,r.default)(c),f=d.latitude,p=d.longitude;if(Array.isArray(c)&&c.length>=2)return(0,i.default)(c[0])&&(0,o.default)(c[1]);if(typeof f>"u"||typeof p>"u")return!1;var h=c[p],g=c[f];return!(typeof g>"u"||typeof h>"u"||!1===(0,o.default)(g)||!1===(0,i.default)(h))}},6563:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(3026)),o=a(n(4902)),i=a(n(1532)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function c(d){return(0,r.default)(d)?!(parseFloat(d)>s.MAXLAT||d<s.MINLAT):!!(0,o.default)(d)&&c((0,i.default)(d))}},266:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(3026)),o=a(n(4902)),i=a(n(1532)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function c(d){return(0,r.default)(d)?!(parseFloat(d)>s.MAXLON||d<s.MINLON):!!(0,o.default)(d)&&c((0,i.default)(d))}},2447:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default;return c="function"==typeof c?c:r.default,u.slice().sort(function(d,f){return c(l,d)-c(l,f)})}},6522:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return i>1?1:i<-1?-1:i}},1532:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var l=new RegExp(r.sexagesimalPattern).exec(a.toString().trim());if(typeof l>"u"||null===l)throw new Error("Given value is not in sexagesimal format");var u=Number(l[2])/60||0,c=Number(l[4])/3600||0,d=parseFloat(l[1])+u+c;return["S","W"].includes(l[7])?-d:d}},5101:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(3026)),o=l(n(4902)),i=l(n(1532)),s=l(n(7637)),a=l(n(4695));function l(h){return h&&h.__esModule?h:{default:h}}function u(h,g){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);g&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(h,v).enumerable})),m.push.apply(m,y)}return m}function c(h){for(var g=1;g<arguments.length;g++){var m=null!=arguments[g]?arguments[g]:{};g%2?u(Object(m),!0).forEach(function(y){d(h,y,m[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):u(Object(m)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(m,y))})}return h}function d(h,g,m){return g in h?Object.defineProperty(h,g,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[g]=m,h}t.default=function h(g){if((0,r.default)(g))return Number(g);if((0,o.default)(g))return(0,i.default)(g);if((0,s.default)(g)){var m=(0,a.default)(g);return Array.isArray(g)?g.map(function(y,v){return[0,1].includes(v)?h(y):y}):c(c(c({},g),m.latitude&&d({},m.latitude,h(g[m.latitude]))),m.longitude&&d({},m.longitude,h(g[m.longitude])))}return Array.isArray(g)?g.map(function(y){return(0,s.default)(y)?h(y):y}):g}},942:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return 180*i/Math.PI}},5705:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return i*Math.PI/180}},354:(e,t)=>{function i(c,d){(null==d||d>c.length)&&(d=c.length);for(var f=0,p=new Array(d);f<d;f++)p[f]=c[f];return p}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(d){if(!d.startsWith("POLYGON"))throw new Error("Invalid wkt.");return d.slice(d.indexOf("(")+2,d.indexOf(")")).split(", ").map(function(h){var m=function n(c,d){return function a(c){if(Array.isArray(c))return c}(c)||function s(c,d){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(c)){var f=[],p=!0,h=!1,g=void 0;try{for(var y,m=c[Symbol.iterator]();!(p=(y=m.next()).done)&&(f.push(y.value),!d||f.length!==d);p=!0);}catch(v){h=!0,g=v}finally{try{!p&&null!=m.return&&m.return()}finally{if(h)throw g}}return f}}(c,d)||function o(c,d){if(c){if("string"==typeof c)return i(c,d);var f=Object.prototype.toString.call(c).slice(8,-1);if("Object"===f&&c.constructor&&(f=c.constructor.name),"Map"===f||"Set"===f)return Array.from(c);if("Arguments"===f||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return i(c,d)}}(c,d)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(h.split(" "),2),v=m[1];return{longitude:parseFloat(m[0]),latitude:parseFloat(v)}})}},6729:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u[0]-c[0],u[1]-c[1])}function o(u,c,d){var f=c[0],p=c[1],h=d[0]-f,g=d[1]-p;if(0!==h||0!==g){var m=((u[0]-f)*h+(u[1]-p)*g)/n(h,g);m>1?(f=d[0],p=d[1]):m>0&&(f+=h*m,p+=g*m)}return n(u[0]-f,u[1]-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.SimplifyAP=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}},6380:(e,t,n)=>{var o=n(6729);t.p$=o.SimplifyAP,n(5551),n(6413)},5551:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u.longitude-c.longitude,u.latitude-c.latitude)}function o(u,c,d){var f=c.longitude,p=c.latitude,h=d.longitude-f,g=d.latitude-p;if(0!==h||0!==g){var m=((u.longitude-f)*h+(u.latitude-p)*g)/n(h,g);m>1?(f=d.longitude,p=d.latitude):m>0&&(f+=h*m,p+=g*m)}return n(u.longitude-f,u.latitude-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.SimplifyLL=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}},6413:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u.x-c.x,u.y-c.y)}function o(u,c,d){var f=c.x,p=c.y,h=d.x-f,g=d.y-p;if(0!==h||0!==g){var m=((u.x-f)*h+(u.y-p)*g)/n(h,g);m>1?(f=d.x,p=d.y):m>0&&(f+=h*m,p+=g*m)}return n(u.x-f,u.y-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.Simplify=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}}},hd={};function va(e){var t=hd[e];if(void 0!==t)return t.exports;var n=hd[e]={exports:{}};return CI[e](n,n.exports,va),n.exports}function ya(e){return"function"==typeof e}let Ea=!1;const tt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else Ea&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ea=e},get useDeprecatedSynchronousErrorHandling(){return Ea}};function Ar(e){setTimeout(()=>{throw e},0)}const si={closed:!0,next(e){},error(e){if(tt.useDeprecatedSynchronousErrorHandling)throw e;Ar(e)},complete(){}},wI=Array.isArray||(e=>e&&"number"==typeof e.length),ai=(()=>{function e(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((n,r)=>`${r+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e})();class Ce{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:o,_subscriptions:i}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof Ce)n.remove(this);else if(null!==n)for(let s=0;s<n.length;++s)n[s].remove(this);if(ya(o)){r&&(this._unsubscribe=void 0);try{o.call(this)}catch(s){t=s instanceof ai?gd(s.errors):[s]}}if(wI(i)){let s=-1,a=i.length;for(;++s<a;){const l=i[s];if(null!==(e=l)&&"object"==typeof e)try{l.unsubscribe()}catch(u){t=t||[],u instanceof ai?t=t.concat(gd(u.errors)):t.push(u)}}}var e;if(t)throw new ai(t)}add(t){let n=t;if(!t)return Ce.EMPTY;switch(typeof t){case"function":n=new Ce(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof Ce)){const i=n;n=new Ce,n._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof Ce){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n}remove(t){const n=this._subscriptions;if(n){const r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}var e;function gd(e){return e.reduce((t,n)=>t.concat(n instanceof ai?n.errors:n),[])}Ce.EMPTY=((e=new Ce).closed=!0,e);const li="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class ct extends Ce{constructor(t,n,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=si;break;case 1:if(!t){this.destination=si;break}if("object"==typeof t){t instanceof ct?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new md(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new md(this,t,n,r)}}[li](){return this}static create(t,n,r){const o=new ct(t,n,r);return o.syncErrorThrowable=!1,o}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class md extends ct{constructor(t,n,r,o){super(),this._parentSubscriber=t;let i,s=this;ya(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==si&&(s=Object.create(n),ya(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=i,this._error=r,this._complete=o}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:n}=this;tt.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:n}=this,{useDeprecatedSynchronousErrorHandling:r}=tt;if(this._error)r&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(n.syncErrorThrowable)r?(n.syncErrorValue=t,n.syncErrorThrown=!0):Ar(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;Ar(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const n=()=>this._complete.call(this._context);tt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,n){try{t.call(this._context,n)}catch(r){if(this.unsubscribe(),tt.useDeprecatedSynchronousErrorHandling)throw r;Ar(r)}}__tryOrSetError(t,n,r){if(!tt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,r)}catch(o){return tt.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=o,t.syncErrorThrown=!0,!0):(Ar(o),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const SI="function"==typeof Symbol&&Symbol.observable||"@@observable";function OI(e){return e}let yd=(()=>{class e{constructor(n){this._isScalar=!1,n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,o){const{operator:i}=this,s=function NI(e,t,n){if(e){if(e instanceof ct)return e;if(e[li])return e[li]()}return e||t||n?new ct(e,t,n):new ct(si)}(n,r,o);if(s.add(i?i.call(s,this.source):this.source||tt.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),tt.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s}_trySubscribe(n){try{return this._subscribe(n)}catch(r){tt.useDeprecatedSynchronousErrorHandling&&(n.syncErrorThrown=!0,n.syncErrorValue=r),function TI(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof ct?n:null}return!0}(n)?n.error(r):console.warn(r)}}forEach(n,r){return new(r=Ed(r))((o,i)=>{let s;s=this.subscribe(a=>{try{n(a)}catch(l){i(l),s&&s.unsubscribe()}},i,o)})}_subscribe(n){const{source:r}=this;return r&&r.subscribe(n)}[SI](){return this}pipe(...n){return 0===n.length?this:function vd(e){return 0===e.length?OI:1===e.length?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}(n)(this)}toPromise(n){return new(n=Ed(n))((r,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>r(i))})}}return e.create=t=>new e(t),e})();function Ed(e){if(e||(e=tt.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const wn=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class AI extends Ce{constructor(t,n){super(),this.subject=t,this.subscriber=n,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,n=t.observers;if(this.subject=null,!n||0===n.length||t.isStopped||t.closed)return;const r=n.indexOf(this.subscriber);-1!==r&&n.splice(r,1)}}class xI extends ct{constructor(t){super(t),this.destination=t}}let Ge=(()=>{class e extends yd{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[li](){return new xI(this)}lift(n){const r=new Id(this,this);return r.operator=n,r}next(n){if(this.closed)throw new wn;if(!this.isStopped){const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].next(n)}}error(n){if(this.closed)throw new wn;this.hasError=!0,this.thrownError=n,this.isStopped=!0;const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].error(n);this.observers.length=0}complete(){if(this.closed)throw new wn;this.isStopped=!0;const{observers:n}=this,r=n.length,o=n.slice();for(let i=0;i<r;i++)o[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(n){if(this.closed)throw new wn;return super._trySubscribe(n)}_subscribe(n){if(this.closed)throw new wn;return this.hasError?(n.error(this.thrownError),Ce.EMPTY):this.isStopped?(n.complete(),Ce.EMPTY):(this.observers.push(n),new AI(this,n))}asObservable(){const n=new yd;return n.source=this,n}}return e.create=(t,n)=>new Id(t,n),e})();class Id extends Ge{constructor(t,n){super(),this.destination=t,this.source=n}next(t){const{destination:n}=this;n&&n.next&&n.next(t)}error(t){const{destination:n}=this;n&&n.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:n}=this;return n?this.source.subscribe(t):Ce.EMPTY}}let he=null;function $(e){const t=he;return he=e,t}typeof navigator<"u"&&navigator,typeof navigator<"u"&&!/Opera/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||navigator),typeof navigator<"u"&&!/Opera|WebKit/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&navigator;class b extends Error{constructor(t,n){super(function _n(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,n)),this.code=t}}function K(e){for(let t in e)if(e[t]===K)return t;throw Error("Could not find renamed property on target object.")}function De(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(De).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}globalThis;const qD=K({__forward_ref__:K});function Ra(e){return e.__forward_ref__=Ra,e.toString=function(){return De(this())},e}function S(e){return function vi(e){return"function"==typeof e&&e.hasOwnProperty(qD)&&e.__forward_ref__===Ra}(e)?e():e}function Q(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function yi(e){return Yd(e,Ii)||Yd(e,Jd)}function Yd(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ei(e){return e&&(e.hasOwnProperty(ka)||e.hasOwnProperty(YD))?e[ka]:null}const Ii=K({\u0275prov:K}),ka=K({\u0275inj:K}),Jd=K({ngInjectableDef:K}),YD=K({ngInjectorDef:K});class L{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=Q({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Ha(e){return e&&!!e.\u0275providers}const kr=K({\u0275cmp:K}),Tt=K({\u0275fac:K}),tf=K({__NG_ENV_ID__:K});var U=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(U||{});let Wa;function Fe(e){const t=Wa;return Wa=e,t}function rf(e,t,n){const r=yi(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&U.Optional?null:void 0!==t?t:void function Ba(e,t){throw new b(-201,!1)}()}const Vr={},Ga="__NG_DI_FLAG__",Di="ngTempTokenPath",rb=/\n/gm,of="__source";let An;function Ft(e){const t=An;return An=e,t}function sb(e,t=U.Default){if(void 0===An)throw new b(-203,!1);return null===An?rf(e,void 0,t):An.get(e,t&U.Optional?null:void 0,t)}function Ae(e,t=U.Default){return(function nf(){return Wa}()||sb)(S(e),t)}function qa(e){const t=[];for(let n=0;n<e.length;n++){const r=S(e[n]);if(Array.isArray(r)){if(0===r.length)throw new b(900,!1);let o,i=U.Default;for(let s=0;s<r.length;s++){const a=r[s],l=ab(a);"number"==typeof l?-1===l?o=a.token:i|=l:o=a}t.push(Ae(o,i))}else t.push(Ae(r))}return t}function ab(e){return e[Ga]}function Yt(e,t){return e.hasOwnProperty(Tt)?e[Tt]:null}function xn(e,t){e.forEach(n=>Array.isArray(n)?xn(n,t):t(n))}const B=[],ft=new L(""),cf=new L("",-1),Ya=new L("");class wi{get(t,n=Vr){if(n===Vr){const r=new Error(`NullInjectorError: No provider for ${De(t)}!`);throw r.name="NullInjectorError",r}return n}}function Rb(...e){return{\u0275providers:el(0,e),\u0275fromNgModule:!0}}function el(e,...t){const n=[],r=new Set;let o;const i=s=>{n.push(s)};return xn(t,s=>{const a=s;Si(a,i,[],r)&&(o||=[],o.push(a))}),void 0!==o&&Df(o,i),n}function Df(e,t){for(let n=0;n<e.length;n++){const{ngModule:r,providers:o}=e[n];tl(o,i=>{t(i,r)})}}function Si(e,t,n,r){if(!(e=S(e)))return!1;let o=null,i=Ei(e);const s=!i&&function F(e){return e[kr]||null}(e);if(i||s){if(s&&!s.standalone)return!1;o=e}else{const l=e.ngModule;if(i=Ei(l),!i)return!1;o=l}const a=r.has(o);if(s){if(a)return!1;if(r.add(o),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const u of l)Si(u,t,n,r)}}else{if(!i)return!1;{if(null!=i.imports&&!a){let u;r.add(o);try{xn(i.imports,c=>{Si(c,t,n,r)&&(u||=[],u.push(c))})}finally{}void 0!==u&&Df(u,t)}if(!a){const u=Yt(o)||(()=>new o);t({provide:o,useFactory:u,deps:B},o),t({provide:Ya,useValue:o,multi:!0},o),t({provide:ft,useValue:()=>Ae(o),multi:!0},o)}const l=i.providers;if(null!=l&&!a){const u=e;tl(l,c=>{t(c,u)})}}}return o!==e&&void 0!==e.providers}function tl(e,t){for(let n of e)Ha(n)&&(n=n.\u0275providers),Array.isArray(n)?tl(n,t):t(n)}const Pb=K({provide:String,useValue:K});function nl(e){return null!==e&&"object"==typeof e&&Pb in e}function en(e){return"function"==typeof e}const Cf=new L(""),Oi={},Lb={};let rl;function Ai(){return void 0===rl&&(rl=new wi),rl}class rt{}class Pn extends rt{get destroyed(){return this._destroyed}constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,il(t,s=>this.processProvider(s)),this.records.set(cf,kn(void 0,this)),o.has("environment")&&this.records.set(rt,kn(void 0,this));const i=this.records.get(Cf);null!=i&&"string"==typeof i.value&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Ya,B,U.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=$(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const n=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),$(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const n=Ft(this),r=Fe(void 0);try{return t()}finally{Ft(n),Fe(r)}}get(t,n=Vr,r=U.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(tf))return t[tf](this);r=function bi(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}(r);const i=Ft(this),s=Fe(void 0);try{if(!(r&U.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function $b(e){return"function"==typeof e||"object"==typeof e&&e instanceof L}(t)&&yi(t);l=u&&this.injectableDefInScope(u)?kn(ol(t),Oi):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(r&U.Self?Ai():this.parent).get(t,n=r&U.Optional&&n===Vr?null:n)}catch(a){if("NullInjectorError"===a.name){if((a[Di]=a[Di]||[]).unshift(De(t)),i)throw a;return function lb(e,t,n,r){const o=e[Di];throw t[of]&&o.unshift(t[of]),e.message=function ub(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let o=De(t);if(Array.isArray(t))o=t.map(De).join(" -> ");else if("object"==typeof t){let i=[];for(let s in t)if(t.hasOwnProperty(s)){let a=t[s];i.push(s+":"+("string"==typeof a?JSON.stringify(a):De(a)))}o=`{${i.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(rb,"\n ")}`}("\n"+e.message,o,n,r),e.ngTokenPath=o,e[Di]=null,e}(a,t,"R3InjectorError",this.source)}throw a}finally{Fe(s),Ft(i)}}resolveInjectorInitializers(){const t=$(null),n=Ft(this),r=Fe(void 0);try{const i=this.get(ft,B,U.Self);for(const s of i)s()}finally{Ft(n),Fe(r),$(t)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(De(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new b(205,!1)}processProvider(t){let n=en(t=S(t))?t:S(t&&t.provide);const r=function jb(e){return nl(e)?kn(void 0,e.useValue):kn(function wf(e,t,n){let r;if(en(e)){const o=S(e);return Yt(o)||ol(o)}if(nl(e))r=()=>S(e.useValue);else if(function Mf(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...qa(e.deps||[]));else if(function bf(e){return!(!e||!e.useExisting)}(e))r=()=>Ae(S(e.useExisting));else{const o=S(e&&(e.useClass||e.provide));if(!function Fb(e){return!!e.deps}(e))return Yt(o)||ol(o);r=()=>new o(...qa(e.deps))}return r}(e),Oi)}(t);if(!en(t)&&!0===t.multi){let o=this.records.get(n);o||(o=kn(void 0,Oi,!0),o.factory=()=>qa(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n){const r=$(null);try{return n.value===Oi&&(n.value=Lb,n.value=n.factory()),"object"==typeof n.value&&n.value&&function Hb(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{$(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;const n=S(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){const n=this._onDestroyHooks.indexOf(t);-1!==n&&this._onDestroyHooks.splice(n,1)}}function ol(e){const t=yi(e),n=null!==t?t.factory:Yt(e);if(null!==n)return n;if(e instanceof L)throw new b(204,!1);if(e instanceof Function)return function Vb(e){if(e.length>0)throw new b(204,!1);const n=function QD(e){return e&&(e[Ii]||e[Jd])||null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new b(204,!1)}function kn(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function il(e,t){for(const n of e)Array.isArray(n)?il(n,t):n&&Ha(n)?il(n.\u0275providers,t):t(n)}const x={lFrame:ep(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function Z(){let e=function Gf(){return x.lFrame.currentTNode}();for(;null!==e&&64===e.type;)e=e.parent;return e}function ep(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function bp(e,t=null,n=null,r){const o=function Mp(e,t=null,n=null,r,o=new Set){const i=[n||B,Rb(e)];return r=r||("object"==typeof e?void 0:De(e)),new Pn(i,t||Ai(),r||null,o)}(e,t,n,r);return o.resolveInjectorInitializers(),o}class Me{static#e=this.THROW_IF_NOT_FOUND=Vr;static#t=this.NULL=new wi;static create(t,n){if(Array.isArray(t))return bp({name:""},n,t,"");{const r=t.name??"";return bp({name:r},t.parent,t.providers,r)}}static#n=this.\u0275prov=Q({token:Me,providedIn:"any",factory:()=>Ae(cf)});static#r=this.__NG_ELEMENT_ID__=-1}new L("").__NG_ELEMENT_ID__=e=>{const t=Z();if(null===t)throw new b(204,!1);if(2&t.type)return t.value;if(e&U.Optional)return null;throw new b(204,!1)},Symbol;class vT{resolveComponentFactory(t){throw function mT(e){const t=Error(`No component factory found for ${De(e)}.`);return t.ngComponent=e,t}(t)}}class Ss{static#e=this.NULL=new vT}class pR{constructor(){this.limitUI04=this.maxFromBits(4),this.limitUI06=this.maxFromBits(6),this.limitUI08=this.maxFromBits(8),this.limitUI12=this.maxFromBits(12),this.limitUI14=this.maxFromBits(14),this.limitUI16=this.maxFromBits(16),this.limitUI32=this.maxFromBits(32),this.limitUI40=this.maxFromBits(40),this.limitUI48=this.maxFromBits(48),this.create()}toString(){return this.hex}toURN(){return"urn:uuid:"+this.hex}toSignalK(){return`urn:mrn:signalk:uuid:${this.hex}`}toBytes(){let t=this.hex.split("-"),n=[],r=0;for(let o=0;o<t.length;o++)for(let i=0;i<t[o].length;i+=2)n[r++]=parseInt(t[o].substr(i,2),16);return n}maxFromBits(t){return Math.pow(2,t)}getRandomInt(t,n){return Math.floor(Math.random()*(n-t+1))+t}randomUI04(){return this.getRandomInt(0,this.limitUI04-1)}randomUI06(){return this.getRandomInt(0,this.limitUI06-1)}randomUI08(){return this.getRandomInt(0,this.limitUI08-1)}randomUI12(){return this.getRandomInt(0,this.limitUI12-1)}randomUI14(){return this.getRandomInt(0,this.limitUI14-1)}randomUI16(){return this.getRandomInt(0,this.limitUI16-1)}randomUI32(){return this.getRandomInt(0,this.limitUI32-1)}randomUI40(){return(0|Math.random()*(1<<30))+(0|1024*Math.random())*(1<<30)}randomUI48(){return(0|Math.random()*(1<<30))+(0|Math.random()*(1<<18))*(1<<30)}create(){this.fromParts(this.randomUI32(),this.randomUI16(),16384|this.randomUI12(),128|this.randomUI06(),this.randomUI08(),this.randomUI48())}paddedString(t,n,r=null){r=r||"0";let o=n-(t=String(t)).length;for(;o>0;o>>>=1,r+=r)1&o&&(t=r+t);return t}fromParts(t,n,r,o,i,s){return this.version=r>>12&15,this.hex=this.paddedString(t.toString(16),8)+"-"+this.paddedString(n.toString(16),4)+"-"+this.paddedString(r.toString(16),4)+"-"+this.paddedString(o.toString(16),2)+this.paddedString(i.toString(16),2)+"-"+this.paddedString(s.toString(16),12),this}}class la{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:(new pR).toString()}}}let gR=(()=>{class e{constructor(){this._filter="",this._wsTimeout=2e4,this._token="",this._playbackMode=!1,this.version=1,this.endpoint="",this.selfId="",this._source=null,this._connect=new Ge,this.onConnect=this._connect.asObservable(),this._close=new Ge,this.onClose=this._close.asObservable(),this._error=new Ge,this.onError=this._error.asObservable(),this._message=new Ge,this.onMessage=this._message.asObservable()}set source(n){this._source||(this._source={}),this._source.label=n}set authToken(n){this._token=n}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(n){this._wsTimeout=n<3e3?3e3:n>6e4?6e4:n}get isOpen(){return!(!this.ws||1==this.ws.readyState||3==this.ws.readyState)}get filter(){return this._filter}set filter(n){this._filter=n&&-1!=n.indexOf("self")?this.selfId?this.selfId:"":n}get playbackMode(){return this._playbackMode}close(){this.ws&&(this.ws.close(),this.ws=null)}open(n,r,o){if(!(n=n||this.endpoint))return;let i=-1==n.indexOf("?")?"?":"&";r&&(n+=`${i}subscribe=${r}`),(this._token||o)&&(n+=`${r?"&":"?"}token=${this._token||o}`),this.close(),this.ws=new WebSocket(n),setTimeout(()=>{this.ws&&1!=this.ws.readyState&&3!=this.ws.readyState&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=s=>{this._connect.next(s)},this.ws.onclose=s=>{this._close.next(s)},this.ws.onerror=s=>{this._error.next(s)},this.ws.onmessage=s=>{this.parseOnMessage(s)}}parseOnMessage(n){let r;if("string"==typeof n.data)try{r=JSON.parse(n.data)}catch{return}this.isHello(r)?(this.selfId=r.self,this._playbackMode=typeof r.startTime<"u",this._message.next(r)):this.isResponse(r)?(typeof r.login<"u"&&typeof r.login.token<"u"&&(this._token=r.login.token),this._message.next(r)):this._filter&&this.isDelta(r)?r.context==this._filter&&this._message.next(r):this._message.next(r)}sendRequest(n){if("object"!=typeof n)return"";let r=la.request();return typeof n.login>"u"&&this._token&&(r.token=this._token),Object.keys(n).forEach(i=>{r[i]=n[i]}),this.send(r),r.requestId}put(n,r,o){return this.sendRequest({context:"self"==n?"vessels.self":n,put:{path:r,value:o}})}login(n,r){return this.sendRequest({login:{username:n,password:r}})}send(n){this.ws&&("object"==typeof n&&(n=JSON.stringify(n)),this.ws.send(n))}sendUpdate(n="self",r,o){let i=la.updates();this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token);let s=[];"string"==typeof r&&s.push({path:r,value:o}),"object"==typeof r&&Array.isArray(r)&&(s=r);let a={timestamp:(new Date).toISOString(),values:s};this._source&&(a.source=this._source),i.updates.push(a),this.send(i)}subscribe(n="*",r="*",o){let i=la.subscribe();if(this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token),"object"==typeof r&&Array.isArray(r)&&(i.subscribe=r),"string"==typeof r){let s={};s.path=r,o&&"object"==typeof o&&(o.period&&(s.period=o.period),o.minPeriod&&(s.minPeriod=o.period),o.format&&("delta"==o.format||"full"==o.format)&&(s.format=o.format),o.policy&&("instant"==o.policy||"ideal"==o.policy||"fixed"==o.policy)&&(s.policy=o.policy)),i.subscribe.push(s)}this.send(i)}unsubscribe(n="*",r="*"){let o=la.unsubscribe();this._token&&(o.token=this._token),o.context="self"==n?"vessels.self":n,this._token&&(o.token=this._token),"object"==typeof r&&Array.isArray(r)&&(o.unsubscribe=r),"string"==typeof r&&o.unsubscribe.push({path:r}),this.send(o)}raiseAlarm(n="*",r,o){let i;i="string"==typeof r&&-1==r.indexOf("notifications.")?`notifications.${r}`:r,this.put(n,i,o.value)}clearAlarm(n="*",r){let o=-1==r.indexOf("notifications.")?`notifications.${r}`:r;this.put(n,o,null)}isSelf(n){return n.context==this.selfId}isDelta(n){return typeof n.context<"u"}isHello(n){return typeof n.version<"u"&&typeof n.self<"u"}isResponse(n){return typeof n.requestId<"u"}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class vR{constructor(t,n,r,o){this._method=[],this._message="",this._message=typeof t<"u"?t:"",this._state=typeof n<"u"?n:sI.alarm,r&&this._method.push(sd.visual),o&&this._method.push(sd.sound)}get value(){return{message:this._message,state:this._state,method:this._method}}}var sI=function(e){return e.normal="normal",e.alert="alert",e.warn="warn",e.alarm="alarm",e.emergency="emergency",e}(sI||{}),sd=function(e){return e.visual="visual",e.sound="sound",e}(sd||{});class ER{constructor(){this.obsList=[],this.stream=new gR,this._connect=new Ge,this.onConnect=this._connect.asObservable(),this._close=new Ge,this.onClose=this._close.asObservable(),this._error=new Ge,this.onError=this._error.asObservable(),this._message=new Ge,this.onMessage=this._message.asObservable()}get endpoint(){return this.stream.endpoint}set endpoint(t){this.stream.endpoint=t}get selfId(){return this.stream.selfId}set selfId(t){this.stream.selfId=t}get _source(){return this.stream._source}set _source(t){this.stream._source=t}set source(t){this.stream.source=t}set authToken(t){this.stream.authToken=t}get connectionTimeout(){return this.stream.connectionTimeout}set connectionTimeout(t){this.stream.connectionTimeout=t}get isOpen(){return this.stream.isOpen}get filter(){return this.stream.filter}set filter(t){this.stream.filter=t}get playbackMode(){return this.stream.playbackMode}open(t,n="none",r){this.obsList.push(this.stream.onConnect.subscribe(o=>this._connect.next(o))),this.obsList.push(this.stream.onClose.subscribe(o=>this._close.next(o))),this.obsList.push(this.stream.onError.subscribe(o=>this._error.next(o))),this.obsList.push(this.stream.onMessage.subscribe(o=>this._message.next(o))),this.stream.open(t,n,r)}close(){this.stream.close(),this.obsList.forEach(t=>t.unsubscribe()),this.obsList=[]}sendRequest(t){return this.stream.sendRequest(t)}put(t,n,r){return this.stream.put(t,n,r)}login(t,n){return this.stream.login(t,n)}send(t){this.stream.send(t)}sendUpdate(t="self",n,r){this.stream.sendUpdate(t,n,r)}subscribe(t="*",n="*",r){this.stream.subscribe(t,n,r)}unsubscribe(t="*",n="*"){this.stream.unsubscribe(t,n)}raiseAlarm(t="*",n,r){this.stream.raiseAlarm(t,n,r)}clearAlarm(t="*",n){this.stream.clearAlarm(t,n)}isSelf(t){return this.stream.isSelf(t)}isDelta(t){return this.stream.isDelta(t)}isHello(t){return this.stream.isHello(t)}isResponse(t){return this.stream.isResponse(t)}}class ua{id;name;mmsi;position=[0,0];state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0}class aI extends ua{heading;headingTrue=null;headingMagnetic=null;cog;cogTrue=null;cogMagnetic=null;sog;registrations={};type={id:-1,name:""};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};buddy=!1;closestApproach=null;mode="day";anchor={maxRadius:null,radius:null,position:null};resourceUpdates=[];autopilot={};track=[];courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};performance={beatAngle:null,gybeAngle:null};racing;vectors={cog:[]}}class lI extends ua{constructor(){super()}}class IR extends ua{constructor(){super()}}class DR extends ua{sog=0;track=[];constructor(){super()}}class bR extends lI{twd;tws;temperature;constructor(){super()}}class ad{static celciusToKelvin(t=0){return t+273.15}static kelvinToCelcius(t=0){return t-273.15}static kelvinToFarenheit(t=0){return 1.8*t-459.67}static degreesToRadians(t=0){return t*Math.PI/180}static radiansToDegrees(t=0){return 180*t/Math.PI}static angleToDirection(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n+t;return o>r?o-r:o<0?r+o:o}static directionToAngle(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n-t;let i;if(o>0)i=o>Math.PI?r-o:0-o;else if(o<0){const s=Math.abs(o);i=s>Math.PI?s-r:s}else i=o;return i}static knotsToKm(t){return 1.852*t}static nauticalMilesToKm(t){return 1.852*t}static knotsToMSec(t){return.51444325460445*t}static kmToKnots(t){return.539957*t}static kmToNauticalMiles(t){return.539957*t}static kmToMiles(t){return.621371*t}static metersToFeet(t){return 3.28084*t}static msecToKnots(t){return 1.94384*t}static msecToKmh(t){return 3.6*t}static msecToMph(t){return 2.23694*t}static nauticalMilesToMiles(t){return 1.15078*t}static milesToKm(t){return 1.60934*t}static milesToNauticalMiles(t){return.868976*t}static rpmToHertz(t){return t/60}}var In=va(2541);class Ct{static destCoordinate(t,n,r){const o=(0,In.computeDestinationPoint)(t,r,ad.radiansToDegrees(n));return[o.longitude,o.latitude]}static distanceTo(t,n){return(0,In.getDistance)(t,n)}static routeLength(t){return(0,In.getPathLength)(t)}static routeLegs(t,n){if(t.length<2)return[];const r=[];r.push(n?{bearing:(0,In.getGreatCircleBearing)(n,t[0]),distance:Ct.distanceTo(n,t[0])}:{bearing:0,distance:0});for(let o=1;o<t.length;++o){const i={bearing:(0,In.getGreatCircleBearing)(t[o-1],t[o]),distance:Ct.distanceTo(t[o-1],t[o])};r.push(i)}return r}static centreOfPolygon(t){const n=(0,In.getCenter)(t);return[n.longitude,n.latitude]}static inDLCrossingZone(t,n=170){return Math.abs(t[0])>=n}static inBounds(t,n){return(0,In.isPointInPolygon)(t,[[n[0],n[1]],[n[0],n[3]],[n[2],n[3]],[n[2],n[1]],[n[0],n[1]]])}static calcMapifiedExtent(t,n){const o=111111*Math.cos(ad.degreesToRadians(t[1])),i=[0,0,0,0];return i[1]=t[1]+(0-Math.abs(n))/111111,i[3]=t[1]+Math.abs(n)/111111,i[0]=t[0]+(0-Math.abs(n))/o,i[2]=t[0]+Math.abs(n)/o,i}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if("number"==typeof t[0]){if(t[0]>180)for(;t[0]>180;)t[0]=t[0]-360;else if(t[0]<-180)for(;t[0]<-180;)t[0]=360+t[0];return t}return Array.isArray(t[0])?(t.forEach(n=>this.normaliseCoords(n)),t):void 0}}class MR{action;playback=!1;result=null;type;self=null;timestamp;constructor(t){this.action="notification",this.type=t}}class uI{action;playback=!1;result=null;timestamp;self=null;constructor(){this.action="update"}}class CR extends uI{constructor(){super(),this.action="trail"}}var wR=va(6380);const _R=["environment.wind.speedTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround","environment.wind.angleTrueWater","environment.wind.directionTrue","environment.wind.directionMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.headingTrue","navigation.headingMagnetic"];let k,Ie,cI;const Zo=[];let cd,ca=[],ud=!1,da=!1;const le={signalk:{},aisState:[]};let je,pI,dI=[0,0,0,0],fI=60,Qo=0,Dn={},bn=500,kt=!1;const Lt={maxAge:54e4,staleAge:36e4,lastTick:(new Date).valueOf(),maxTrack:20};let hI={cogLine:10,aisCogLine:10};const Yo={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}};let Jo,Xo="freeboard-sk";function gI(){je={updated:{},stale:{},expired:{}}}function fa({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:kt,result:t.target.readyState});break;case"onClose":console.warn("streamEvent: ",t),vI(!1);break;case"onError":console.warn("streamEvent: ",t),postMessage({action:"error",playback:kt,result:"Connection error!"});break;case"onMessage":!function xR(e){Ie.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:kt}),bn&&II()):Ie.isDelta(e)?(ud=!0,e.updates.forEach(t=>{t.values&&(Jo=t.$source,t.values.forEach(n=>{if(pI=t.timestamp,e.context)switch(e.context.split(".")[0]){case"shore":case"atons":le?.signalk.atons&&function kR(e,t){let n=!1;if(-1!==e.indexOf("shore.basestations")&&(n=!0),!k.atons.has(e)){const o=new lI;o.id=e,o.position=null,n&&(o.type.id=-1,o.type.name="Basestation"),k.atons.set(e,o)}const r=k.atons.get(e);""===t.path?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.atonType<"u"&&(r.type=t.value.atonType)):"atonType"===t.path?r.type=t.value:"navigation.position"===t.path?(r.position=[t.value.longitude,t.value.latitude],r.positionReceived=!0):r.properties[t.path]=t.value}(e.context,n),ti(e.context,k.atons,le?.signalk.atons);break;case"sar":le?.signalk.sar&&function LR(e,t){if(!k.sar.has(e)){const r=new IR;r.id=e,r.position=null,r.type.id=-1,r.type.name="SaR Beacon",k.sar.set(e,r)}const n=k.sar.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"navigation.position"===t.path&&t.value&&(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),ti(e.context,k.sar,le?.signalk.sar);break;case"aircraft":le?.signalk.aircraft&&function jR(e,t){if(!k.aircraft.has(e)){const r=new DR;r.id=e,r.position=null,k.aircraft.set(e,r)}const n=k.aircraft.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"navigation.position"===t.path&&t.value?(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0,dd(n)):"navigation.courseOverGroundTrue"===t.path?n.orientation=t.value:"navigation.speedOverGround"===t.path&&(n.sog=t.value)}(e.context,n),ti(e.context,k.aircraft,le?.signalk.aircraft);break;case"meteo":le?.signalk.meteo&&(function VR(e,t){if(!k.meteo.has(e)){const r=new bR;r.id=e,r.position=null,r.type.id=-1,r.type.name="Weather Station",k.meteo.set(e,r)}const n=k.meteo.get(e);if(""===t.path){if(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"){const r=e.split(":").slice(-2);n.mmsi=2===r.length?`${r[0]}:${r[1]}`:t.value.mmsi}}else"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"environment.outside.temperature"===t.path?n.temperature=t.value:"environment.wind.directionTrue"===t.path?n.twd=t.value:"environment.wind.averageSpeed"===t.path?n.tws=t.value:"navigation.position"===t.path&&t.value&&(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),MI(n)),ti(e.context,k.meteo,le?.signalk.meteo);break;case"vessels":if(Ie.isSelf(e))k.self.id||(k.self.id=e.context),bI(k.self,n,!0),MI(n);else{if(le?.signalk.vessels){const r=function RR(e){if(!k.aisTargets.has(e)){const t=new aI;t.id=e,t.position=null,k.aisTargets.set(e,t)}return k.aisTargets.get(e)}(e.context);bI(r,n)}ti(e.context,k.aisTargets,le?.signalk.vessels,le?.aisState)}}}))}),EI()):Ie.isResponse(e)&&postMessage({action:"response",result:e})}(t)}}function mI(e={}){e.interval&&"number"==typeof e.interval&&(bn=e.interval,DI(),II(),fI=1/(bn/1e3)*60),kt=!!e.playback,e.selections&&(typeof e.selections.preferredPaths<"u"&&(Dn=e.selections.preferredPaths),e.selections.aisMaxAge&&"number"==typeof e.selections.aisMaxAge&&(Lt.maxAge=e.selections.aisMaxAge),e.selections.aisStaleAge&&"number"==typeof e.selections.aisStaleAge&&(Lt.staleAge=e.selections.aisStaleAge),"number"==typeof e.selections.signalk.maxRadius&&(le.signalk=e.selections.signalk),typeof e.selections.aisState<"u"&&Array.isArray(e.selections.aisState)&&(le.aisState=e.selections.aisState),hI=e.selections.vessel,console.log("Worker: AIS Filter...",le))}function vI(e=!1){DI(),Zo.forEach(t=>t.unsubscribe()),Ie&&e&&Ie.close(),Ie=null,postMessage({action:"close",result:e,playback:kt})}function ei(e){return new Promise((t,n)=>{fetch(`${e}`).then(r=>{r.json().then(o=>t(o)).catch(o=>n(o))}).catch(r=>{n(r)})})}function yI(){ei(cd+"/tracks"+(le&&le.signalk&&le.signalk.maxRadius?`?radius=${le.signalk.maxRadius}`:"?radius=10000")).then(t=>{da=!0,Object.entries(t).forEach(n=>{if(k.aisTargets.has(n[0])){const r=k.aisTargets.get(n[0]);r.track=n[1].coordinates,dd(r)}})}).catch(()=>{da=!1,console.warn("Unable to fetch AIS tracks!")})}function ti(e,t,n=!0,r=[]){if(n){let o=t.get(e);o&&r.includes(o?.state)&&(console.log(`state match => ${r}, ${e}`),je.expired[e]=!0,o=null),o&&le.signalk.maxRadius?o.positionReceived&&Ct.inBounds(o.position,dI)?je.updated[e]=!0:(t.delete(e),je.expired[e]=!0):je.updated[e]=!0}else 0!==t.size&&(t.forEach((o,i)=>{je.expired[i]=!0}),t.clear())}function EI(e=!1){if(!bn||e){const t=new uI;t.playback=kt,k.aisStatus.updated=Object.keys(je.updated),k.aisStatus.stale=Object.keys(je.stale),k.aisStatus.expired=Object.keys(je.expired),t.result=k,t.timestamp=kt?pI:k.self.lastUpdated.toISOString(),postMessage(t),gI(),k.self.resourceUpdates=[],0===Qo&&(function PR(){const e=(new Date).valueOf();k.aisTargets.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.aisTargets.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)}),k.aircraft.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.aircraft.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)}),k.sar.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.sar.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)})}(),k.self.positionReceived&&le?.signalk.maxRadius&&(dI=Ct.calcMapifiedExtent(k.self.position,le.signalk.maxRadius),Qo++)),Qo=Qo>=fI?0:Qo+1}}function II(){bn&&"number"==typeof bn&&ca.push(setInterval(()=>{ud&&(EI(!0),ud=!1)},bn)),ca.push(setInterval(()=>{console.warn("hasTrackPlugin",da),da&&yI()},6e4))}function DI(){ca.forEach(e=>clearInterval(e)),ca=[]}function bI(e,t,n=!1){if(e.lastUpdated=new Date,n){const o=-1!==t.path.indexOf("course")?t.path.split(".").slice(0,2).join("."):t.path;-1!==_R.indexOf(o)&&(k.paths[o]=null),t.path.includes("navigation.racing")&&(e.properties[t.path]=t.value)}if(""===t.path)typeof t.value.name<"u"&&(e.name=t.value.name),typeof t.value.mmsi<"u"&&(e.mmsi=t.value.mmsi),typeof t.value.registrations<"u"&&(e.registrations=t.value.registrations),typeof t.value.buddy<"u"&&(e.buddy=t.value.buddy),typeof t.value.communication<"u"&&(e.callsignVhf=t.value.communication.callsignVhf??"",e.callsignHf=t.value.communication.callsignHf??"");else if("performance.beatAngle"===t.path)e.performance.beatAngle=t.value;else if("performance.gybeAngle"===t.path)e.performance.gybeAngle=t.value;else if("design.aisShipType"===t.path)e.type=t.value;else if("navigation.position"===t.path&&t.value){if(typeof t.value.latitude>"u"||typeof t.value.longitude>"u")return;e.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),e.positionReceived=!0,n||dd(e)}else"navigation.state"===t.path?e.state=t.value:"navigation.speedOverGround"===t.path?e.sog=t.value:"environment.wind.angleApparent"===t.path?e.wind.awa=t.value:"environment.wind.speedApparent"===t.path?e.wind.aws=t.value:"environment.wind.speedTrue"===t.path?e.wind.speedTrue=t.value:"environment.wind.speedOverGround"===t.path?e.wind.sog=t.value:"environment.wind.directionTrue"===t.path?e.wind.twd=t.value:"environment.wind.directionMagnetic"===t.path?e.wind.mwd=t.value:"environment.mode"===t.path?e.mode=t.value:-1!==t.path.indexOf("navigation.course.")?-1!==t.path.indexOf("navigation.course.calcValues")?-1===t.path.indexOf("navigation.course.calcValues.previousPoint")&&(e[`course.${t.path.split(".").slice(-1)[0]}`]=t.value):-1!==t.path.indexOf("navigation.course.activeRoute")?e.courseApi.activeRoute=t.value:-1!==t.path.indexOf("navigation.course.nextPoint")?e.courseApi.nextPoint=t.value:-1!==t.path.indexOf("navigation.course.previousPoint")?e.courseApi.previousPoint=t.value:"navigation.course.arrivalCircle"===t.path&&(e.courseApi.arrivalCircle=t.value):-1!==t.path.indexOf("navigation.closestApproach")?e.closestApproach=t.value:"navigation.anchor.position"===t.path?e.anchor.position=t.value:"navigation.anchor.maxRadius"===t.path?e.anchor.maxRadius=t.value:"navigation.anchor.currentRadius"===t.path?e.anchor.radius=t.value:-1!==t.path.indexOf("resources.")?e.resourceUpdates.push(t):"steering.autopilot.state"===t.path&&Jo===Xo?e.autopilot.state=t.value:"steering.autopilot.mode"===t.path&&Jo===Xo?e.autopilot.mode=t.value:"steering.autopilot.target"===t.path&&Jo===Xo?e.autopilot.target=t.value:"steering.autopilot.engaged"===t.path&&Jo===Xo?e.autopilot.enabled=t.value:"steering.autopilot.defaultPilot"===t.path?Xo=t.value:"navigation.courseOverGroundTrue"===t.path?e.cogTrue=t.value:"navigation.courseOverGroundMagnetic"===t.path?e.cogMagnetic=t.value:"navigation.headingTrue"===t.path?e.headingTrue=t.value:"navigation.headingMagnetic"===t.path&&(e.headingMagnetic=t.value);typeof Dn.heading<"u"&&t.path===Dn.heading&&(e.orientation=t.value),typeof Dn.tws<"u"&&t.path===Dn.tws&&(e.wind.tws=t.value),typeof Dn.twd<"u"&&t.path===Dn.twd&&(e.wind.direction="environment.wind.angleTrueGround"===t.path||"environment.wind.angleTrueWater"===t.path?ad.angleToDirection(t.value,e.orientation??0):t.value);const r=e.cogTrue??e.cogMagnetic??void 0;typeof r<"u"&&e.position&&(e.vectors.cog=[e.position,Ct.destCoordinate(e.position,r,(e.sog??0)*(hI.aisCogLine??600))])}function MI(e,t){const n={path:e.path,value:e.value,context:t||null};let r;const o=e.path.split(".");if(("notifications.environment.depth.belowTransducer"===e.path||"notifications.environment.depth.belowSurface"===e.path||"notifications.environment.depth.belowKeel"===e.path)&&(r=o[2]),"notifications.navigation.anchor"===e.path&&(r=o[2]),-1!==["mob","sinking","fire","piracy","flooding","collision","grounding","listing","adrift","abandon"].indexOf(o[o.length-1])&&(r=o[o.length-1]),-1!==e.path.indexOf("notifications.navigation.closestApproach")&&(r=o[2],n.context=o[3]),-1!==e.path.indexOf("notifications.buddy")&&(r=o[1],n.context=o[2]),-1!==e.path.indexOf("notifications.navigation.course.arrivalCircleEntered")&&(r=o[3]),-1!==e.path.indexOf("notifications.navigation.course.perpendicularPassed")&&(r=o[3]),-1!==e.path.indexOf("notifications.meteo.warning")&&(r=o[1]),r){const i=new MR(r);i.playback=kt,i.result=n,postMessage(i)}}function dd(e){if(e.track&&0===e.track.length)e.track.push([e.position]);else{const n=e.track[e.track.length-1][e.track[e.track.length-1].length-1];n[0]!==e.position[0]&&n[1]!==e.position[1]&&e.track[e.track.length-1].push(e.position)}e.track[e.track.length-1]=e.track[e.track.length-1].slice(0-Lt.maxTrack)}addEventListener("message",({data:e})=>{!function NR(e){if(e.cmd)switch(e.cmd){case"open":console.log("Worker control: opening stream..."),mI(e.options),function OR(e){if(Ie)return;if(!e.url)return void postMessage({action:"error",result:"Valid options not provided!"});const t=e.url.split("/");if(t.pop(),t.push("api"),t[0]="wss:"===t[0]?"https:":"http:",cd=t.join("/"),function TR(){k={self:new aI,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},k.self.positionReceived=!1,gI()}(),Ie=new ER,Zo.push(Ie.onConnect.subscribe(n=>fa({action:"onConnect",msg:n}))),Zo.push(Ie.onClose.subscribe(n=>fa({action:"onClose",msg:n}))),Zo.push(Ie.onError.subscribe(n=>fa({action:"onError",msg:n}))),Zo.push(Ie.onMessage.subscribe(n=>fa({action:"onMessage",msg:n}))),Ie.authToken=cI,e.playback){const n=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null;let r=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;r=r?n?"&"+r:"?"+r:null,Ie.open(`${e.url}${n||""}${r||""}`,e.playbackOptions.subscribe,e.token)}else Ie.open(e.url,e.subscribe,e.token),yI()}(e.options);break;case"close":console.log("Worker control: closing stream..."),vI(!0);break;case"subscribe":console.log("Worker control: subscribing to paths..."),Ie.subscribe(e.options.context,e.options.path);break;case"settings":console.log("Worker control: settings..."),mI(e.options);break;case"alarm":console.log("Worker control: alarm action..."),function AR(e){const t=-1===e.type.indexOf("notifications.")?`notifications.${e.type}`:e.type;e.raise?Ie.raiseAlarm("self",t,new vR(e.message,e.state,!0,!0)):Ie.clearAlarm("self",t)}(e.options);break;case"vessel":if(console.log("Worker control: vessel setting..."),e.options){let t;t="self"===e.options.context?k.self:k.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":console.log("Worker control: auth token..."),e.options&&typeof e.options.token<"u"&&(cI=e.options.token);break;case"trail":console.log("Worker control: Fetch vessel trail from server..."),e.options&&(Yo.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(Yo.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",Yo.trailResolution.next23=e.options.trailResolution.next23??"1m",Yo.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),function SR(e){console.info("Worker: Fetching vessel trail from server",e);const t=cd+"/self/track?",n=[];e.trailDuration>24&&(n.push(ei(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}&timespanOffset=24`)),n.push(ei(`${t}timespan=23h&resolution=${e.trailResolution.next23}&timespanOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&n.push(ei(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}&timespanOffset=1`)),n.push(ei(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let i=[];const s=new CR;s.playback=kt,Promise.all(n).then(a=>{let l=0;const u=n.length-1;a.forEach(d=>{if(d.type&&"MultiLineString"===d.type&&d.coordinates&&Array.isArray(d.coordinates))if(l!==u){let f=[];for(d.coordinates.forEach(p=>{f=f.concat(p)}),f=(0,wR.p$)(f,5e-4,true);f.length>60;){const p=f.slice(0,60);i.push(p),f=f.slice(59),f[0]=[f[0][0]+5e-9,f[0][1]+5e-9]}0!==f.length&&i.push(f)}else i=i.concat(d.coordinates);l++}),s.result=i,postMessage(s)}).catch(()=>{s.result=null,postMessage(s)})}(Yo)}}(e)})})();
1
+ (()=>{"use strict";var CI={2222:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(942)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p,h){var g=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,m=(0,r.default)(f),y=(0,o.default)(f),v=p/g,D=(0,i.default)(h),T=(0,i.default)(m),V=(0,i.default)(y),G=Math.asin(Math.sin(T)*Math.cos(v)+Math.cos(T)*Math.sin(v)*Math.cos(D)),q=V+Math.atan2(Math.sin(D)*Math.sin(v)*Math.cos(T),Math.cos(v)-Math.sin(T)*Math.sin(G)),re=(0,s.default)(q);return(re<a.MINLON||re>a.MAXLON)&&(q=(q+3*Math.PI)%(2*Math.PI)-Math.PI,re=(0,s.default)(q)),{latitude:(0,s.default)(G),longitude:re}}},7636:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0,t.sexagesimalPattern=/^([0-9]{1,3})\xb0\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['\u2032]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["\u2033]\s*)?([NEOSW]?)$/,t.earthRadius=6378137,t.MINLAT=-90,t.MAXLAT=90,t.MINLON=-180,t.MAXLON=180,t.longitudeKeys=["lng","lon","longitude",0],t.latitudeKeys=["lat","latitude",1],t.altitudeKeys=["alt","altitude","elevation","elev",2],t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},t.timeConversion={m:60,h:3600,d:86400};var p={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=p,p.sqm=p.m2,p.sqkm=p.km2,p.sqft=p.ft2,p.sqyd=p.yd2,p.sqin=p.in2},179:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var u=r.areaConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(u)return a*u;throw new Error("Invalid unit used for area conversion.")}},917:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var u=r.distanceConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(u)return a*u;throw new Error("Invalid unit used for distance conversion.")}},1167:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh"){case"kmh":return a*r.timeConversion.h*r.distanceConversion.km;case"mph":return a*r.timeConversion.h*r.distanceConversion.mi;default:return a}}},8948:(e,t)=>{function n(d,f){return function a(d){if(Array.isArray(d))return d}(d)||function s(d,f){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(d)){var p=[],h=!0,g=!1,m=void 0;try{for(var v,y=d[Symbol.iterator]();!(h=(v=y.next()).done)&&(p.push(v.value),!f||p.length!==f);h=!0);}catch(D){g=!0,m=D}finally{try{!h&&null!=y.return&&y.return()}finally{if(g)throw m}}return p}}(d,f)||function o(d,f){if(d){if("string"==typeof d)return i(d,f);var p=Object.prototype.toString.call(d).slice(8,-1);if("Object"===p&&d.constructor&&(p=d.constructor.name),"Map"===p||"Set"===p)return Array.from(d);if("Arguments"===p||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return i(d,f)}}(d,f)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(d,f){(null==f||f>d.length)&&(f=d.length);for(var p=0,h=new Array(f);p<f;p++)h[p]=d[p];return h}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(f){var h=n(f.toString().split("."),2),m=h[1],y=Math.abs(Number(h[0])),v=60*+("0."+(m||0)),D=v.toString().split("."),T=Math.floor(v),V=function(f){var h=Math.pow(10,arguments.length>1&&void 0!==arguments[1]?arguments[1]:4);return Math.round(f*h)/h}(60*+("0."+(D[1]||0))).toString(),q=n(V.split("."),2),re=q[0],X=q[1],pe=void 0===X?"0":X;return y+"\xb0 "+T.toString().padStart(2,"0")+"' "+re.padStart(2,"0")+"."+pe.padEnd(1,"0")+'"'}},1118:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(2447));t.default=function(l,u){return(0,r.default)(l,u)[0]}},1691:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(5705)),o=a(n(7029)),i=a(n(3100)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d){var f=0;if(d.length>2){for(var p,h,g,m=0;m<d.length;m++){m===d.length-2?(p=d.length-2,h=d.length-1,g=0):m===d.length-1?(p=d.length-1,h=0,g=1):(p=m,h=m+1,g=m+2);var y=(0,i.default)(d[p]),v=(0,o.default)(d[h]),D=(0,i.default)(d[g]);f+=((0,r.default)(D)-(0,r.default)(y))*Math.sin((0,r.default)(v))}f=f*s.earthRadius*s.earthRadius/2}return Math.abs(f)}},9144:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(7029)),o=i(n(3100));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u){if(!1===Array.isArray(u)||0===u.length)throw new Error("No points were given.");return u.reduce(function(c,d){var f=(0,r.default)(d),p=(0,o.default)(d);return{maxLat:Math.max(f,c.maxLat),minLat:Math.min(f,c.minLat),maxLng:Math.max(p,c.maxLng),minLng:Math.min(p,c.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}},190:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(942)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p){var X,pe,h=(0,r.default)(f),g=(0,o.default)(f),m=(0,i.default)(h),y=(0,i.default)(g),v=p/a.earthRadius,D=m-v,T=m+v,V=(0,i.default)(a.MAXLAT),G=(0,i.default)(a.MINLAT),q=(0,i.default)(a.MAXLON),re=(0,i.default)(a.MINLON);if(D>G&&T<V){var Mn=Math.asin(Math.sin(v)/Math.cos(m));(X=y-Mn)<re&&(X+=2*Math.PI),(pe=y+Mn)>q&&(pe-=2*Math.PI)}else D=Math.max(D,G),T=Math.min(T,V),X=re,pe=q;return[{latitude:(0,s.default)(D),longitude:(0,s.default)(X)},{latitude:(0,s.default)(T),longitude:(0,s.default)(pe)}]}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d){if(!1===Array.isArray(d)||0===d.length)return!1;var f=d.length,p=d.reduce(function(y,v){var D=(0,i.default)((0,r.default)(v)),T=(0,i.default)((0,o.default)(v));return{X:y.X+Math.cos(D)*Math.cos(T),Y:y.Y+Math.cos(D)*Math.sin(T),Z:y.Z+Math.sin(D)}},{X:0,Y:0,Z:0}),h=p.X/f,g=p.Y/f,m=p.Z/f;return{longitude:(0,s.default)(Math.atan2(g,h)),latitude:(0,s.default)(Math.atan2(m,Math.sqrt(h*h+g*g)))}}},7088:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(9144));t.default=function(l){var u=(0,r.default)(l),d=u.minLng+(u.maxLng-u.minLng)/2;return{latitude:parseFloat((u.minLat+(u.maxLat-u.minLat)/2).toFixed(6)),longitude:parseFloat(d.toFixed(6))}}},9952:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(939));t.default=function(l,u){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default,d="function"==typeof c?c(l,u):(0,r.default)(l,u);if(isNaN(d))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(d/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}},8744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i,s){return s.reduce(function(a,l){if(typeof i>"u"||null===i)throw new Error("'".concat(i,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(i,l)&&typeof l<"u"&&typeof a>"u"?(a=l,l):a},void 0)}},4695:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=function i(d){return d&&d.__esModule?d:{default:d}}(n(8744));function s(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(d,g).enumerable})),p.push.apply(p,h)}return p}function l(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}t.default=function(f){var p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:r.longitudeKeys,latitude:r.latitudeKeys,altitude:r.altitudeKeys},h=(0,o.default)(f,p.longitude),g=(0,o.default)(f,p.latitude),m=(0,o.default)(f,p.altitude);return function a(d){for(var f=1;f<arguments.length;f++){var p=null!=arguments[f]?arguments[f]:{};f%2?s(Object(p),!0).forEach(function(h){l(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):s(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}({latitude:g,longitude:h},m?{altitude:m}:{})}},8674:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(7029)),o=l(n(3100)),i=l(n(5705)),s=l(n(6522)),a=n(7636);function l(d){return d&&d.__esModule?d:{default:d}}t.default=function(f,p){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;h=typeof h<"u"&&!isNaN(h)?h:1;var g=(0,r.default)(f),m=(0,o.default)(f),y=(0,r.default)(p),v=(0,o.default)(p),D=Math.acos((0,s.default)(Math.sin((0,i.default)(y))*Math.sin((0,i.default)(g))+Math.cos((0,i.default)(y))*Math.cos((0,i.default)(g))*Math.cos((0,i.default)(m)-(0,i.default)(v))))*a.earthRadius;return Math.round(D/h)*h}},7504:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(8674)),o=i(n(6522));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u,c,d){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,p=(0,r.default)(c,u,f),h=(0,r.default)(u,d,f),g=(0,r.default)(c,d,f),m=Math.acos((0,o.default)((p*p+g*g-h*h)/(2*p*g))),y=Math.acos((0,o.default)((h*h+g*g-p*p)/(2*h*g)));return m>Math.PI/2?p:y>Math.PI/2?h:Math.sin(m)*p}},884:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=(0,r.default)(f),h=(0,o.default)(f),g=(0,r.default)(d),m=(0,o.default)(d);return((0,s.default)(Math.atan2(Math.sin((0,i.default)(h)-(0,i.default)(m))*Math.cos((0,i.default)(p)),Math.cos((0,i.default)(g))*Math.sin((0,i.default)(p))-Math.sin((0,i.default)(g))*Math.cos((0,i.default)(p))*Math.cos((0,i.default)(h)-(0,i.default)(m))))+360)%360}},7029:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=s(n(8744)),i=s(n(5101));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c,d){var f=(0,o.default)(c,r.latitudeKeys);if(!(typeof f>"u"||null===f)){var p=c[f];return!0===d?p:(0,i.default)(p)}}},3100:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636),o=s(n(8744)),i=s(n(5101));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c,d){var f=(0,o.default)(c,r.longitudeKeys);if(!(typeof f>"u"||null===f)){var p=c[f];return!0===d?p:(0,i.default)(p)}}},5378:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(l){return l&&l.__esModule?l:{default:l}}(n(8674));function i(l){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(l)}t.default=function(u){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.default;return u.reduce(function(d,f){return"object"===i(d)&&null!==d.last&&(d.distance+=c(f,d.last)),d.last=f,d},{last:null,distance:0}).distance}},2671:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;p=typeof p<"u"&&!isNaN(p)?p:1;var V,G,q,re,X,pe,ha,h=(0,r.default)(d),g=(0,o.default)(d),m=(0,r.default)(f),y=(0,o.default)(f),v=6356752.314245,D=1/298.257223563,T=(0,i.default)(y-g),Mn=Math.atan((1-D)*Math.tan((0,i.default)(parseFloat(h)))),pa=Math.atan((1-D)*Math.tan((0,i.default)(parseFloat(m)))),Nr=Math.sin(Mn),Sr=Math.cos(Mn),Or=Math.sin(pa),Kt=Math.cos(pa),Cn=T,ga=100;do{var ni=Math.sin(Cn),ri=Math.cos(Cn);if(0===(pe=Math.sqrt(Kt*ni*(Kt*ni)+(Sr*Or-Nr*Kt*ri)*(Sr*Or-Nr*Kt*ri))))return 0;V=Nr*Or+Sr*Kt*ri,G=Math.atan2(pe,V),X=V-2*Nr*Or/(re=1-(q=Sr*Kt*ni/pe)*q),isNaN(X)&&(X=0);var oi=D/16*re*(4+D*(4-3*re));ha=Cn,Cn=T+(1-oi)*D*q*(G+oi*pe*(X+oi*V*(2*X*X-1)))}while(Math.abs(Cn-ha)>1e-12&&--ga>0);if(0===ga)return NaN;var wt=re*(s.earthRadius*s.earthRadius-v*v)/(v*v),ii=wt/1024*(256+wt*(wt*(74-47*wt)-128));return Math.round(v*(1+wt/16384*(4096+wt*(wt*(320-175*wt)-768)))*(G-ii*pe*(X+ii/4*(V*(2*X*X-1)-ii/6*X*(4*pe*pe-3)*(4*X*X-3))))/p)*p}},939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(7029)),o=a(n(3100)),i=a(n(5705)),s=a(n(942));function a(c){return c&&c.__esModule?c:{default:c}}t.default=function(d,f){var p=(0,i.default)((0,o.default)(f))-(0,i.default)((0,o.default)(d)),h=Math.log(Math.tan((0,i.default)((0,r.default)(f))/2+Math.PI/4)/Math.tan((0,i.default)((0,r.default)(d))/2+Math.PI/4));return Math.abs(p)>Math.PI&&(p=p>0?-1*(2*Math.PI-p):2*Math.PI+p),((0,s.default)(Math.atan2(p,h))+360)%360}},2845:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return/^(NNE|NE|NNW|N)$/.test(i)?"N":/^(ENE|E|ESE|SE)$/.test(i)?"E":/^(SSE|S|SSW|SW)$/.test(i)?"S":/^(WSW|W|WNW|NW)$/.test(i)?"W":void 0}},8950:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default)(l,u)/(Number(u.time)-Number(l.time))*1e3}},2541:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return Mn.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return pa.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return Nr.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return Sr.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return Or.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return Kt.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return Cn.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return ha.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return ga.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return ni.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return ri.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return oi.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return wt.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return pd.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return ii.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return hd.default}});var o=H(n(2222)),i=H(n(179)),s=H(n(917)),a=H(n(1167)),l=H(n(8948)),u=H(n(1118)),c=H(n(1691)),d=H(n(9144)),f=H(n(190)),p=H(n(5524)),h=H(n(7088)),g=H(n(9952)),m=H(n(8744)),y=H(n(4695)),v=H(n(8674)),D=H(n(7504)),T=H(n(884)),V=H(n(7029)),G=H(n(3100)),q=H(n(5378)),re=H(n(2671)),X=H(n(939)),pe=H(n(2845)),Mn=H(n(8950)),pa=H(n(3026)),Nr=H(n(4194)),Sr=H(n(3536)),Or=H(n(2787)),Kt=H(n(202)),Cn=H(n(4902)),ha=H(n(7637)),ga=H(n(6563)),ni=H(n(266)),ri=H(n(2447)),oi=H(n(1532)),wt=H(n(5101)),pd=H(n(5705)),ii=H(n(942)),hd=H(n(354)),ma=n(7636);function H(O){return O&&O.__esModule?O:{default:O}}Object.keys(ma).forEach(function(O){"default"===O||"__esModule"===O||Object.prototype.hasOwnProperty.call(r,O)||Object.defineProperty(t,O,{enumerable:!0,get:function(){return ma[O]}})})},3026:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){var s=i.toString().trim();return!isNaN(parseFloat(s))&&parseFloat(s)===Number(s)}},4194:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u,c){return(0,r.default)(u,l)+(0,r.default)(l,c)===(0,r.default)(u,c)}},3536:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(7029)),o=i(n(3100));function i(l){return l&&l.__esModule?l:{default:l}}t.default=function(u,c){for(var d=!1,f=c.length,p=-1,h=f-1;++p<f;h=p)((0,o.default)(c[p])<=(0,o.default)(u)&&(0,o.default)(u)<(0,o.default)(c[h])||(0,o.default)(c[h])<=(0,o.default)(u)&&(0,o.default)(u)<(0,o.default)(c[p]))&&(0,r.default)(u)<((0,r.default)(c[h])-(0,r.default)(c[p]))*((0,o.default)(u)-(0,o.default)(c[p]))/((0,o.default)(c[h])-(0,o.default)(c[p]))+(0,r.default)(c[p])&&(d=!d);return d}},2787:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(7504));t.default=function(l,u,c,d){return(0,r.default)(l,u,c)<d}},202:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u,c){return(0,r.default)(l,u,.01)<c}},4902:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){return r.sexagesimalPattern.test(a.toString().trim())}},7637:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(4695)),o=s(n(6563)),i=s(n(266));function s(u){return u&&u.__esModule?u:{default:u}}t.default=function(c){var d=(0,r.default)(c),f=d.latitude,p=d.longitude;if(Array.isArray(c)&&c.length>=2)return(0,i.default)(c[0])&&(0,o.default)(c[1]);if(typeof f>"u"||typeof p>"u")return!1;var h=c[p],g=c[f];return!(typeof g>"u"||typeof h>"u"||!1===(0,o.default)(g)||!1===(0,i.default)(h))}},6563:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(3026)),o=a(n(4902)),i=a(n(1532)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function c(d){return(0,r.default)(d)?!(parseFloat(d)>s.MAXLAT||d<s.MINLAT):!!(0,o.default)(d)&&c((0,i.default)(d))}},266:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(3026)),o=a(n(4902)),i=a(n(1532)),s=n(7636);function a(c){return c&&c.__esModule?c:{default:c}}t.default=function c(d){return(0,r.default)(d)?!(parseFloat(d)>s.MAXLON||d<s.MINLON):!!(0,o.default)(d)&&c((0,i.default)(d))}},2447:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function o(a){return a&&a.__esModule?a:{default:a}}(n(8674));t.default=function(l,u){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.default;return c="function"==typeof c?c:r.default,u.slice().sort(function(d,f){return c(l,d)-c(l,f)})}},6522:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return i>1?1:i<-1?-1:i}},1532:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(7636);t.default=function(a){var l=new RegExp(r.sexagesimalPattern).exec(a.toString().trim());if(typeof l>"u"||null===l)throw new Error("Given value is not in sexagesimal format");var u=Number(l[2])/60||0,c=Number(l[4])/3600||0,d=parseFloat(l[1])+u+c;return["S","W"].includes(l[7])?-d:d}},5101:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(3026)),o=l(n(4902)),i=l(n(1532)),s=l(n(7637)),a=l(n(4695));function l(h){return h&&h.__esModule?h:{default:h}}function u(h,g){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);g&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(h,v).enumerable})),m.push.apply(m,y)}return m}function c(h){for(var g=1;g<arguments.length;g++){var m=null!=arguments[g]?arguments[g]:{};g%2?u(Object(m),!0).forEach(function(y){d(h,y,m[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):u(Object(m)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(m,y))})}return h}function d(h,g,m){return g in h?Object.defineProperty(h,g,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[g]=m,h}t.default=function h(g){if((0,r.default)(g))return Number(g);if((0,o.default)(g))return(0,i.default)(g);if((0,s.default)(g)){var m=(0,a.default)(g);return Array.isArray(g)?g.map(function(y,v){return[0,1].includes(v)?h(y):y}):c(c(c({},g),m.latitude&&d({},m.latitude,h(g[m.latitude]))),m.longitude&&d({},m.longitude,h(g[m.longitude])))}return Array.isArray(g)?g.map(function(y){return(0,s.default)(y)?h(y):y}):g}},942:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return 180*i/Math.PI}},5705:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(i){return i*Math.PI/180}},354:(e,t)=>{function i(c,d){(null==d||d>c.length)&&(d=c.length);for(var f=0,p=new Array(d);f<d;f++)p[f]=c[f];return p}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(d){if(!d.startsWith("POLYGON"))throw new Error("Invalid wkt.");return d.slice(d.indexOf("(")+2,d.indexOf(")")).split(", ").map(function(h){var m=function n(c,d){return function a(c){if(Array.isArray(c))return c}(c)||function s(c,d){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(c)){var f=[],p=!0,h=!1,g=void 0;try{for(var y,m=c[Symbol.iterator]();!(p=(y=m.next()).done)&&(f.push(y.value),!d||f.length!==d);p=!0);}catch(v){h=!0,g=v}finally{try{!p&&null!=m.return&&m.return()}finally{if(h)throw g}}return f}}(c,d)||function o(c,d){if(c){if("string"==typeof c)return i(c,d);var f=Object.prototype.toString.call(c).slice(8,-1);if("Object"===f&&c.constructor&&(f=c.constructor.name),"Map"===f||"Set"===f)return Array.from(c);if("Arguments"===f||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return i(c,d)}}(c,d)||function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(h.split(" "),2),v=m[1];return{longitude:parseFloat(m[0]),latitude:parseFloat(v)}})}},6729:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u[0]-c[0],u[1]-c[1])}function o(u,c,d){var f=c[0],p=c[1],h=d[0]-f,g=d[1]-p;if(0!==h||0!==g){var m=((u[0]-f)*h+(u[1]-p)*g)/n(h,g);m>1?(f=d[0],p=d[1]):m>0&&(f+=h*m,p+=g*m)}return n(u[0]-f,u[1]-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.SimplifyAP=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}},6380:(e,t,n)=>{var o=n(6729);t.p$=o.SimplifyAP,n(5551),n(6413)},5551:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u.longitude-c.longitude,u.latitude-c.latitude)}function o(u,c,d){var f=c.longitude,p=c.latitude,h=d.longitude-f,g=d.latitude-p;if(0!==h||0!==g){var m=((u.longitude-f)*h+(u.latitude-p)*g)/n(h,g);m>1?(f=d.longitude,p=d.latitude):m>0&&(f+=h*m,p+=g*m)}return n(u.longitude-f,u.latitude-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.SimplifyLL=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}},6413:(e,t)=>{function n(u,c){return u*u+c*c}function r(u,c){return n(u.x-c.x,u.y-c.y)}function o(u,c,d){var f=c.x,p=c.y,h=d.x-f,g=d.y-p;if(0!==h||0!==g){var m=((u.x-f)*h+(u.y-p)*g)/n(h,g);m>1?(f=d.x,p=d.y):m>0&&(f+=h*m,p+=g*m)}return n(u.x-f,u.y-p)}function s(u,c,d,f,p){for(var g,h=f,m=c+1;m<d;m++){var y=o(u[m],u[c],u[d]);y>h&&(g=m,h=y)}h>f&&(g-c>1&&s(u,c,g,f,p),p.push(u[g]),d-g>1&&s(u,g,d,f,p))}function a(u,c){var d=u.length-1,f=[u[0]];return s(u,0,d,c,f),f.push(u[d]),f}t.__esModule=!0,t.Simplify=function l(u,c,d){if(void 0===c&&(c=1),void 0===d&&(d=!1),u.length<=2)return u;var f=c*c;return a(u=d?u:function i(u,c){for(var f,d=u[0],p=[d],h=1,g=u.length;h<g;h++)r(f=u[h],d)>c&&(p.push(f),d=f);return d!==f&&p.push(f),p}(u,f),f)}}},gd={};function va(e){var t=gd[e];if(void 0!==t)return t.exports;var n=gd[e]={exports:{}};return CI[e](n,n.exports,va),n.exports}function ya(e){return"function"==typeof e}let Ea=!1;const tt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else Ea&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Ea=e},get useDeprecatedSynchronousErrorHandling(){return Ea}};function Ar(e){setTimeout(()=>{throw e},0)}const si={closed:!0,next(e){},error(e){if(tt.useDeprecatedSynchronousErrorHandling)throw e;Ar(e)},complete(){}},wI=Array.isArray||(e=>e&&"number"==typeof e.length),ai=(()=>{function e(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((n,r)=>`${r+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e})();class Ce{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:o,_subscriptions:i}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof Ce)n.remove(this);else if(null!==n)for(let s=0;s<n.length;++s)n[s].remove(this);if(ya(o)){r&&(this._unsubscribe=void 0);try{o.call(this)}catch(s){t=s instanceof ai?md(s.errors):[s]}}if(wI(i)){let s=-1,a=i.length;for(;++s<a;){const l=i[s];if(null!==(e=l)&&"object"==typeof e)try{l.unsubscribe()}catch(u){t=t||[],u instanceof ai?t=t.concat(md(u.errors)):t.push(u)}}}var e;if(t)throw new ai(t)}add(t){let n=t;if(!t)return Ce.EMPTY;switch(typeof t){case"function":n=new Ce(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof Ce)){const i=n;n=new Ce,n._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof Ce){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n}remove(t){const n=this._subscriptions;if(n){const r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}var e;function md(e){return e.reduce((t,n)=>t.concat(n instanceof ai?n.errors:n),[])}Ce.EMPTY=((e=new Ce).closed=!0,e);const li="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class ct extends Ce{constructor(t,n,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=si;break;case 1:if(!t){this.destination=si;break}if("object"==typeof t){t instanceof ct?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new vd(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new vd(this,t,n,r)}}[li](){return this}static create(t,n,r){const o=new ct(t,n,r);return o.syncErrorThrowable=!1,o}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class vd extends ct{constructor(t,n,r,o){super(),this._parentSubscriber=t;let i,s=this;ya(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==si&&(s=Object.create(n),ya(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=i,this._error=r,this._complete=o}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:n}=this;tt.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:n}=this,{useDeprecatedSynchronousErrorHandling:r}=tt;if(this._error)r&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(n.syncErrorThrowable)r?(n.syncErrorValue=t,n.syncErrorThrown=!0):Ar(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;Ar(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const n=()=>this._complete.call(this._context);tt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,n){try{t.call(this._context,n)}catch(r){if(this.unsubscribe(),tt.useDeprecatedSynchronousErrorHandling)throw r;Ar(r)}}__tryOrSetError(t,n,r){if(!tt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,r)}catch(o){return tt.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=o,t.syncErrorThrown=!0,!0):(Ar(o),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const SI="function"==typeof Symbol&&Symbol.observable||"@@observable";function OI(e){return e}let Ed=(()=>{class e{constructor(n){this._isScalar=!1,n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,o){const{operator:i}=this,s=function NI(e,t,n){if(e){if(e instanceof ct)return e;if(e[li])return e[li]()}return e||t||n?new ct(e,t,n):new ct(si)}(n,r,o);if(s.add(i?i.call(s,this.source):this.source||tt.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),tt.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s}_trySubscribe(n){try{return this._subscribe(n)}catch(r){tt.useDeprecatedSynchronousErrorHandling&&(n.syncErrorThrown=!0,n.syncErrorValue=r),function TI(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof ct?n:null}return!0}(n)?n.error(r):console.warn(r)}}forEach(n,r){return new(r=Id(r))((o,i)=>{let s;s=this.subscribe(a=>{try{n(a)}catch(l){i(l),s&&s.unsubscribe()}},i,o)})}_subscribe(n){const{source:r}=this;return r&&r.subscribe(n)}[SI](){return this}pipe(...n){return 0===n.length?this:function yd(e){return 0===e.length?OI:1===e.length?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}(n)(this)}toPromise(n){return new(n=Id(n))((r,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>r(i))})}}return e.create=t=>new e(t),e})();function Id(e){if(e||(e=tt.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const wn=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class AI extends Ce{constructor(t,n){super(),this.subject=t,this.subscriber=n,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,n=t.observers;if(this.subject=null,!n||0===n.length||t.isStopped||t.closed)return;const r=n.indexOf(this.subscriber);-1!==r&&n.splice(r,1)}}class xI extends ct{constructor(t){super(t),this.destination=t}}let Ge=(()=>{class e extends Ed{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[li](){return new xI(this)}lift(n){const r=new Dd(this,this);return r.operator=n,r}next(n){if(this.closed)throw new wn;if(!this.isStopped){const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].next(n)}}error(n){if(this.closed)throw new wn;this.hasError=!0,this.thrownError=n,this.isStopped=!0;const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].error(n);this.observers.length=0}complete(){if(this.closed)throw new wn;this.isStopped=!0;const{observers:n}=this,r=n.length,o=n.slice();for(let i=0;i<r;i++)o[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(n){if(this.closed)throw new wn;return super._trySubscribe(n)}_subscribe(n){if(this.closed)throw new wn;return this.hasError?(n.error(this.thrownError),Ce.EMPTY):this.isStopped?(n.complete(),Ce.EMPTY):(this.observers.push(n),new AI(this,n))}asObservable(){const n=new Ed;return n.source=this,n}}return e.create=(t,n)=>new Dd(t,n),e})();class Dd extends Ge{constructor(t,n){super(),this.destination=t,this.source=n}next(t){const{destination:n}=this;n&&n.next&&n.next(t)}error(t){const{destination:n}=this;n&&n.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:n}=this;return n?this.source.subscribe(t):Ce.EMPTY}}let he=null;function $(e){const t=he;return he=e,t}typeof navigator<"u"&&navigator,typeof navigator<"u"&&!/Opera/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||navigator),typeof navigator<"u"&&!/Opera|WebKit/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&navigator;class b extends Error{constructor(t,n){super(function _n(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,n)),this.code=t}}function K(e){for(let t in e)if(e[t]===K)return t;throw Error("Could not find renamed property on target object.")}function De(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(De).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}globalThis;const qD=K({__forward_ref__:K});function Ra(e){return e.__forward_ref__=Ra,e.toString=function(){return De(this())},e}function S(e){return function vi(e){return"function"==typeof e&&e.hasOwnProperty(qD)&&e.__forward_ref__===Ra}(e)?e():e}function Q(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function yi(e){return Jd(e,Ii)||Jd(e,Xd)}function Jd(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ei(e){return e&&(e.hasOwnProperty(ka)||e.hasOwnProperty(YD))?e[ka]:null}const Ii=K({\u0275prov:K}),ka=K({\u0275inj:K}),Xd=K({ngInjectableDef:K}),YD=K({ngInjectorDef:K});class L{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=Q({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Ha(e){return e&&!!e.\u0275providers}const kr=K({\u0275cmp:K}),Tt=K({\u0275fac:K}),nf=K({__NG_ENV_ID__:K});var U=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(U||{});let Wa;function Fe(e){const t=Wa;return Wa=e,t}function of(e,t,n){const r=yi(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&U.Optional?null:void 0!==t?t:void function Ba(e,t){throw new b(-201,!1)}()}const Vr={},Ga="__NG_DI_FLAG__",Di="ngTempTokenPath",rb=/\n/gm,sf="__source";let An;function Ft(e){const t=An;return An=e,t}function sb(e,t=U.Default){if(void 0===An)throw new b(-203,!1);return null===An?of(e,void 0,t):An.get(e,t&U.Optional?null:void 0,t)}function Ae(e,t=U.Default){return(function rf(){return Wa}()||sb)(S(e),t)}function qa(e){const t=[];for(let n=0;n<e.length;n++){const r=S(e[n]);if(Array.isArray(r)){if(0===r.length)throw new b(900,!1);let o,i=U.Default;for(let s=0;s<r.length;s++){const a=r[s],l=ab(a);"number"==typeof l?-1===l?o=a.token:i|=l:o=a}t.push(Ae(o,i))}else t.push(Ae(r))}return t}function ab(e){return e[Ga]}function Yt(e,t){return e.hasOwnProperty(Tt)?e[Tt]:null}function xn(e,t){e.forEach(n=>Array.isArray(n)?xn(n,t):t(n))}const B=[],ft=new L(""),df=new L("",-1),Ya=new L("");class wi{get(t,n=Vr){if(n===Vr){const r=new Error(`NullInjectorError: No provider for ${De(t)}!`);throw r.name="NullInjectorError",r}return n}}function Rb(...e){return{\u0275providers:el(0,e),\u0275fromNgModule:!0}}function el(e,...t){const n=[],r=new Set;let o;const i=s=>{n.push(s)};return xn(t,s=>{const a=s;Si(a,i,[],r)&&(o||=[],o.push(a))}),void 0!==o&&bf(o,i),n}function bf(e,t){for(let n=0;n<e.length;n++){const{ngModule:r,providers:o}=e[n];tl(o,i=>{t(i,r)})}}function Si(e,t,n,r){if(!(e=S(e)))return!1;let o=null,i=Ei(e);const s=!i&&function F(e){return e[kr]||null}(e);if(i||s){if(s&&!s.standalone)return!1;o=e}else{const l=e.ngModule;if(i=Ei(l),!i)return!1;o=l}const a=r.has(o);if(s){if(a)return!1;if(r.add(o),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const u of l)Si(u,t,n,r)}}else{if(!i)return!1;{if(null!=i.imports&&!a){let u;r.add(o);try{xn(i.imports,c=>{Si(c,t,n,r)&&(u||=[],u.push(c))})}finally{}void 0!==u&&bf(u,t)}if(!a){const u=Yt(o)||(()=>new o);t({provide:o,useFactory:u,deps:B},o),t({provide:Ya,useValue:o,multi:!0},o),t({provide:ft,useValue:()=>Ae(o),multi:!0},o)}const l=i.providers;if(null!=l&&!a){const u=e;tl(l,c=>{t(c,u)})}}}return o!==e&&void 0!==e.providers}function tl(e,t){for(let n of e)Ha(n)&&(n=n.\u0275providers),Array.isArray(n)?tl(n,t):t(n)}const Pb=K({provide:String,useValue:K});function nl(e){return null!==e&&"object"==typeof e&&Pb in e}function en(e){return"function"==typeof e}const wf=new L(""),Oi={},Lb={};let rl;function Ai(){return void 0===rl&&(rl=new wi),rl}class rt{}class Pn extends rt{get destroyed(){return this._destroyed}constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,il(t,s=>this.processProvider(s)),this.records.set(df,kn(void 0,this)),o.has("environment")&&this.records.set(rt,kn(void 0,this));const i=this.records.get(wf);null!=i&&"string"==typeof i.value&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Ya,B,U.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=$(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const n=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),$(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const n=Ft(this),r=Fe(void 0);try{return t()}finally{Ft(n),Fe(r)}}get(t,n=Vr,r=U.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(nf))return t[nf](this);r=function bi(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}(r);const i=Ft(this),s=Fe(void 0);try{if(!(r&U.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function $b(e){return"function"==typeof e||"object"==typeof e&&e instanceof L}(t)&&yi(t);l=u&&this.injectableDefInScope(u)?kn(ol(t),Oi):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(r&U.Self?Ai():this.parent).get(t,n=r&U.Optional&&n===Vr?null:n)}catch(a){if("NullInjectorError"===a.name){if((a[Di]=a[Di]||[]).unshift(De(t)),i)throw a;return function lb(e,t,n,r){const o=e[Di];throw t[sf]&&o.unshift(t[sf]),e.message=function ub(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let o=De(t);if(Array.isArray(t))o=t.map(De).join(" -> ");else if("object"==typeof t){let i=[];for(let s in t)if(t.hasOwnProperty(s)){let a=t[s];i.push(s+":"+("string"==typeof a?JSON.stringify(a):De(a)))}o=`{${i.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(rb,"\n ")}`}("\n"+e.message,o,n,r),e.ngTokenPath=o,e[Di]=null,e}(a,t,"R3InjectorError",this.source)}throw a}finally{Fe(s),Ft(i)}}resolveInjectorInitializers(){const t=$(null),n=Ft(this),r=Fe(void 0);try{const i=this.get(ft,B,U.Self);for(const s of i)s()}finally{Ft(n),Fe(r),$(t)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(De(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new b(205,!1)}processProvider(t){let n=en(t=S(t))?t:S(t&&t.provide);const r=function jb(e){return nl(e)?kn(void 0,e.useValue):kn(function _f(e,t,n){let r;if(en(e)){const o=S(e);return Yt(o)||ol(o)}if(nl(e))r=()=>S(e.useValue);else if(function Cf(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...qa(e.deps||[]));else if(function Mf(e){return!(!e||!e.useExisting)}(e))r=()=>Ae(S(e.useExisting));else{const o=S(e&&(e.useClass||e.provide));if(!function Fb(e){return!!e.deps}(e))return Yt(o)||ol(o);r=()=>new o(...qa(e.deps))}return r}(e),Oi)}(t);if(!en(t)&&!0===t.multi){let o=this.records.get(n);o||(o=kn(void 0,Oi,!0),o.factory=()=>qa(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n){const r=$(null);try{return n.value===Oi&&(n.value=Lb,n.value=n.factory()),"object"==typeof n.value&&n.value&&function Hb(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{$(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;const n=S(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){const n=this._onDestroyHooks.indexOf(t);-1!==n&&this._onDestroyHooks.splice(n,1)}}function ol(e){const t=yi(e),n=null!==t?t.factory:Yt(e);if(null!==n)return n;if(e instanceof L)throw new b(204,!1);if(e instanceof Function)return function Vb(e){if(e.length>0)throw new b(204,!1);const n=function QD(e){return e&&(e[Ii]||e[Xd])||null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new b(204,!1)}function kn(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function il(e,t){for(const n of e)Array.isArray(n)?il(n,t):n&&Ha(n)?il(n.\u0275providers,t):t(n)}const x={lFrame:tp(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function Z(){let e=function qf(){return x.lFrame.currentTNode}();for(;null!==e&&64===e.type;)e=e.parent;return e}function tp(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Mp(e,t=null,n=null,r){const o=function Cp(e,t=null,n=null,r,o=new Set){const i=[n||B,Rb(e)];return r=r||("object"==typeof e?void 0:De(e)),new Pn(i,t||Ai(),r||null,o)}(e,t,n,r);return o.resolveInjectorInitializers(),o}class Me{static#e=this.THROW_IF_NOT_FOUND=Vr;static#t=this.NULL=new wi;static create(t,n){if(Array.isArray(t))return Mp({name:""},n,t,"");{const r=t.name??"";return Mp({name:r},t.parent,t.providers,r)}}static#n=this.\u0275prov=Q({token:Me,providedIn:"any",factory:()=>Ae(df)});static#r=this.__NG_ELEMENT_ID__=-1}new L("").__NG_ELEMENT_ID__=e=>{const t=Z();if(null===t)throw new b(204,!1);if(2&t.type)return t.value;if(e&U.Optional)return null;throw new b(204,!1)},Symbol;class vT{resolveComponentFactory(t){throw function mT(e){const t=Error(`No component factory found for ${De(e)}.`);return t.ngComponent=e,t}(t)}}class Ss{static#e=this.NULL=new vT}class pR{constructor(){this.limitUI04=this.maxFromBits(4),this.limitUI06=this.maxFromBits(6),this.limitUI08=this.maxFromBits(8),this.limitUI12=this.maxFromBits(12),this.limitUI14=this.maxFromBits(14),this.limitUI16=this.maxFromBits(16),this.limitUI32=this.maxFromBits(32),this.limitUI40=this.maxFromBits(40),this.limitUI48=this.maxFromBits(48),this.create()}toString(){return this.hex}toURN(){return"urn:uuid:"+this.hex}toSignalK(){return`urn:mrn:signalk:uuid:${this.hex}`}toBytes(){let t=this.hex.split("-"),n=[],r=0;for(let o=0;o<t.length;o++)for(let i=0;i<t[o].length;i+=2)n[r++]=parseInt(t[o].substr(i,2),16);return n}maxFromBits(t){return Math.pow(2,t)}getRandomInt(t,n){return Math.floor(Math.random()*(n-t+1))+t}randomUI04(){return this.getRandomInt(0,this.limitUI04-1)}randomUI06(){return this.getRandomInt(0,this.limitUI06-1)}randomUI08(){return this.getRandomInt(0,this.limitUI08-1)}randomUI12(){return this.getRandomInt(0,this.limitUI12-1)}randomUI14(){return this.getRandomInt(0,this.limitUI14-1)}randomUI16(){return this.getRandomInt(0,this.limitUI16-1)}randomUI32(){return this.getRandomInt(0,this.limitUI32-1)}randomUI40(){return(0|Math.random()*(1<<30))+(0|1024*Math.random())*(1<<30)}randomUI48(){return(0|Math.random()*(1<<30))+(0|Math.random()*(1<<18))*(1<<30)}create(){this.fromParts(this.randomUI32(),this.randomUI16(),16384|this.randomUI12(),128|this.randomUI06(),this.randomUI08(),this.randomUI48())}paddedString(t,n,r=null){r=r||"0";let o=n-(t=String(t)).length;for(;o>0;o>>>=1,r+=r)1&o&&(t=r+t);return t}fromParts(t,n,r,o,i,s){return this.version=r>>12&15,this.hex=this.paddedString(t.toString(16),8)+"-"+this.paddedString(n.toString(16),4)+"-"+this.paddedString(r.toString(16),4)+"-"+this.paddedString(o.toString(16),2)+this.paddedString(i.toString(16),2)+"-"+this.paddedString(s.toString(16),12),this}}class la{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:(new pR).toString()}}}let gR=(()=>{class e{constructor(){this._filter="",this._wsTimeout=2e4,this._token="",this._playbackMode=!1,this.version=1,this.endpoint="",this.selfId="",this._source=null,this._connect=new Ge,this.onConnect=this._connect.asObservable(),this._close=new Ge,this.onClose=this._close.asObservable(),this._error=new Ge,this.onError=this._error.asObservable(),this._message=new Ge,this.onMessage=this._message.asObservable()}set source(n){this._source||(this._source={}),this._source.label=n}set authToken(n){this._token=n}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(n){this._wsTimeout=n<3e3?3e3:n>6e4?6e4:n}get isOpen(){return!(!this.ws||1==this.ws.readyState||3==this.ws.readyState)}get filter(){return this._filter}set filter(n){this._filter=n&&-1!=n.indexOf("self")?this.selfId?this.selfId:"":n}get playbackMode(){return this._playbackMode}close(){this.ws&&(this.ws.close(),this.ws=null)}open(n,r,o){if(!(n=n||this.endpoint))return;let i=-1==n.indexOf("?")?"?":"&";r&&(n+=`${i}subscribe=${r}`),(this._token||o)&&(n+=`${r?"&":"?"}token=${this._token||o}`),this.close(),this.ws=new WebSocket(n),setTimeout(()=>{this.ws&&1!=this.ws.readyState&&3!=this.ws.readyState&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=s=>{this._connect.next(s)},this.ws.onclose=s=>{this._close.next(s)},this.ws.onerror=s=>{this._error.next(s)},this.ws.onmessage=s=>{this.parseOnMessage(s)}}parseOnMessage(n){let r;if("string"==typeof n.data)try{r=JSON.parse(n.data)}catch{return}this.isHello(r)?(this.selfId=r.self,this._playbackMode=typeof r.startTime<"u",this._message.next(r)):this.isResponse(r)?(typeof r.login<"u"&&typeof r.login.token<"u"&&(this._token=r.login.token),this._message.next(r)):this._filter&&this.isDelta(r)?r.context==this._filter&&this._message.next(r):this._message.next(r)}sendRequest(n){if("object"!=typeof n)return"";let r=la.request();return typeof n.login>"u"&&this._token&&(r.token=this._token),Object.keys(n).forEach(i=>{r[i]=n[i]}),this.send(r),r.requestId}put(n,r,o){return this.sendRequest({context:"self"==n?"vessels.self":n,put:{path:r,value:o}})}login(n,r){return this.sendRequest({login:{username:n,password:r}})}send(n){this.ws&&("object"==typeof n&&(n=JSON.stringify(n)),this.ws.send(n))}sendUpdate(n="self",r,o){let i=la.updates();this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token);let s=[];"string"==typeof r&&s.push({path:r,value:o}),"object"==typeof r&&Array.isArray(r)&&(s=r);let a={timestamp:(new Date).toISOString(),values:s};this._source&&(a.source=this._source),i.updates.push(a),this.send(i)}subscribe(n="*",r="*",o){let i=la.subscribe();if(this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token),"object"==typeof r&&Array.isArray(r)&&(i.subscribe=r),"string"==typeof r){let s={};s.path=r,o&&"object"==typeof o&&(o.period&&(s.period=o.period),o.minPeriod&&(s.minPeriod=o.period),o.format&&("delta"==o.format||"full"==o.format)&&(s.format=o.format),o.policy&&("instant"==o.policy||"ideal"==o.policy||"fixed"==o.policy)&&(s.policy=o.policy)),i.subscribe.push(s)}this.send(i)}unsubscribe(n="*",r="*"){let o=la.unsubscribe();this._token&&(o.token=this._token),o.context="self"==n?"vessels.self":n,this._token&&(o.token=this._token),"object"==typeof r&&Array.isArray(r)&&(o.unsubscribe=r),"string"==typeof r&&o.unsubscribe.push({path:r}),this.send(o)}raiseAlarm(n="*",r,o){let i;i="string"==typeof r&&-1==r.indexOf("notifications.")?`notifications.${r}`:r,this.put(n,i,o.value)}clearAlarm(n="*",r){let o=-1==r.indexOf("notifications.")?`notifications.${r}`:r;this.put(n,o,null)}isSelf(n){return n.context==this.selfId}isDelta(n){return typeof n.context<"u"}isHello(n){return typeof n.version<"u"&&typeof n.self<"u"}isResponse(n){return typeof n.requestId<"u"}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class vR{constructor(t,n,r,o){this._method=[],this._message="",this._message=typeof t<"u"?t:"",this._state=typeof n<"u"?n:aI.alarm,r&&this._method.push(sd.visual),o&&this._method.push(sd.sound)}get value(){return{message:this._message,state:this._state,method:this._method}}}var aI=function(e){return e.normal="normal",e.alert="alert",e.warn="warn",e.alarm="alarm",e.emergency="emergency",e}(aI||{}),sd=function(e){return e.visual="visual",e.sound="sound",e}(sd||{});class ER{constructor(){this.obsList=[],this.stream=new gR,this._connect=new Ge,this.onConnect=this._connect.asObservable(),this._close=new Ge,this.onClose=this._close.asObservable(),this._error=new Ge,this.onError=this._error.asObservable(),this._message=new Ge,this.onMessage=this._message.asObservable()}get endpoint(){return this.stream.endpoint}set endpoint(t){this.stream.endpoint=t}get selfId(){return this.stream.selfId}set selfId(t){this.stream.selfId=t}get _source(){return this.stream._source}set _source(t){this.stream._source=t}set source(t){this.stream.source=t}set authToken(t){this.stream.authToken=t}get connectionTimeout(){return this.stream.connectionTimeout}set connectionTimeout(t){this.stream.connectionTimeout=t}get isOpen(){return this.stream.isOpen}get filter(){return this.stream.filter}set filter(t){this.stream.filter=t}get playbackMode(){return this.stream.playbackMode}open(t,n="none",r){this.obsList.push(this.stream.onConnect.subscribe(o=>this._connect.next(o))),this.obsList.push(this.stream.onClose.subscribe(o=>this._close.next(o))),this.obsList.push(this.stream.onError.subscribe(o=>this._error.next(o))),this.obsList.push(this.stream.onMessage.subscribe(o=>this._message.next(o))),this.stream.open(t,n,r)}close(){this.stream.close(),this.obsList.forEach(t=>t.unsubscribe()),this.obsList=[]}sendRequest(t){return this.stream.sendRequest(t)}put(t,n,r){return this.stream.put(t,n,r)}login(t,n){return this.stream.login(t,n)}send(t){this.stream.send(t)}sendUpdate(t="self",n,r){this.stream.sendUpdate(t,n,r)}subscribe(t="*",n="*",r){this.stream.subscribe(t,n,r)}unsubscribe(t="*",n="*"){this.stream.unsubscribe(t,n)}raiseAlarm(t="*",n,r){this.stream.raiseAlarm(t,n,r)}clearAlarm(t="*",n){this.stream.clearAlarm(t,n)}isSelf(t){return this.stream.isSelf(t)}isDelta(t){return this.stream.isDelta(t)}isHello(t){return this.stream.isHello(t)}isResponse(t){return this.stream.isResponse(t)}}class ua{id;name;mmsi;position=[0,0];state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0}class lI extends ua{heading;headingTrue=null;headingMagnetic=null;cog;cogTrue=null;cogMagnetic=null;sog;registrations={};type={id:-1,name:""};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};buddy=!1;closestApproach=null;mode="day";anchor={maxRadius:null,radius:null,position:null};resourceUpdates=[];autopilot={};track=[];courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};performance={beatAngle:null,gybeAngle:null};racing;vectors={cog:[]}}class uI extends ua{constructor(){super()}}class IR extends ua{constructor(){super()}}class DR extends ua{sog=0;track=[];constructor(){super()}}class bR extends uI{twd;tws;temperature;constructor(){super()}}class ad{static celciusToKelvin(t=0){return t+273.15}static kelvinToCelcius(t=0){return t-273.15}static kelvinToFarenheit(t=0){return 1.8*t-459.67}static degreesToRadians(t=0){return t*Math.PI/180}static radiansToDegrees(t=0){return 180*t/Math.PI}static angleToDirection(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n+t;return o>r?o-r:o<0?r+o:o}static directionToAngle(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n-t;let i;if(o>0)i=o>Math.PI?r-o:0-o;else if(o<0){const s=Math.abs(o);i=s>Math.PI?s-r:s}else i=o;return i}static knotsToKm(t){return 1.852*t}static nauticalMilesToKm(t){return 1.852*t}static knotsToMSec(t){return.51444325460445*t}static kmToKnots(t){return.539957*t}static kmToNauticalMiles(t){return.539957*t}static kmToMiles(t){return.621371*t}static metersToFeet(t){return 3.28084*t}static msecToKnots(t){return 1.94384*t}static msecToKmh(t){return 3.6*t}static msecToMph(t){return 2.23694*t}static nauticalMilesToMiles(t){return 1.15078*t}static milesToKm(t){return 1.60934*t}static milesToNauticalMiles(t){return.868976*t}static rpmToHertz(t){return t/60}}var In=va(2541);class Ct{static destCoordinate(t,n,r){const o=(0,In.computeDestinationPoint)(t,r,ad.radiansToDegrees(n));return[o.longitude,o.latitude]}static distanceTo(t,n){return(0,In.getDistance)(t,n)}static routeLength(t){return(0,In.getPathLength)(t)}static routeLegs(t,n){if(t.length<2)return[];const r=[];r.push(n?{bearing:(0,In.getGreatCircleBearing)(n,t[0]),distance:Ct.distanceTo(n,t[0])}:{bearing:0,distance:0});for(let o=1;o<t.length;++o){const i={bearing:(0,In.getGreatCircleBearing)(t[o-1],t[o]),distance:Ct.distanceTo(t[o-1],t[o])};r.push(i)}return r}static centreOfPolygon(t){const n=(0,In.getCenter)(t);return[n.longitude,n.latitude]}static inDLCrossingZone(t,n=170){return Math.abs(t[0])>=n}static inBounds(t,n){return(0,In.isPointInPolygon)(t,[[n[0],n[1]],[n[0],n[3]],[n[2],n[3]],[n[2],n[1]],[n[0],n[1]]])}static calcMapifiedExtent(t,n){const o=111111*Math.cos(ad.degreesToRadians(t[1])),i=[0,0,0,0];return i[1]=t[1]+(0-Math.abs(n))/111111,i[3]=t[1]+Math.abs(n)/111111,i[0]=t[0]+(0-Math.abs(n))/o,i[2]=t[0]+Math.abs(n)/o,i}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if("number"==typeof t[0]){if(t[0]>180)for(;t[0]>180;)t[0]=t[0]-360;else if(t[0]<-180)for(;t[0]<-180;)t[0]=360+t[0];return t}return Array.isArray(t[0])?(t.forEach(n=>this.normaliseCoords(n)),t):void 0}}class MR{action;playback=!1;result=null;type;self=null;timestamp;constructor(t){this.action="notification",this.type=t}}class cI{action;playback=!1;result=null;timestamp;self=null;constructor(){this.action="update"}}class CR extends cI{constructor(){super(),this.action="trail"}}var wR=va(6380);const _R=["environment.wind.speedTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround","environment.wind.angleTrueWater","environment.wind.directionTrue","environment.wind.directionMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.headingTrue","navigation.headingMagnetic"];let k,Ie,dI;const Zo=[];let cd,ca=[],ud=!1,da=!1;const le={signalk:{},aisState:[]};let je,hI,fI=[0,0,0,0],pI=60,Qo=0,Dn={},bn=500,kt=!1;const Lt={maxAge:54e4,staleAge:36e4,lastTick:(new Date).valueOf(),maxTrack:20};let dd={cogLine:10,aisCogLine:10};const Yo={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}};let Jo,Xo="freeboard-sk";function gI(){je={updated:{},stale:{},expired:{}}}function fa({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:kt,result:t.target.readyState});break;case"onClose":console.warn("streamEvent: ",t),vI(!1);break;case"onError":console.warn("streamEvent: ",t),postMessage({action:"error",playback:kt,result:"Connection error!"});break;case"onMessage":!function xR(e){Ie.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:kt}),bn&&II()):Ie.isDelta(e)?(ud=!0,e.updates.forEach(t=>{t.values&&(Jo=t.$source,t.values.forEach(n=>{if(hI=t.timestamp,e.context)switch(e.context.split(".")[0]){case"shore":case"atons":le?.signalk.atons&&function kR(e,t){let n=!1;if(-1!==e.indexOf("shore.basestations")&&(n=!0),!k.atons.has(e)){const o=new uI;o.id=e,o.position=null,n&&(o.type.id=-1,o.type.name="Basestation"),k.atons.set(e,o)}const r=k.atons.get(e);""===t.path?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.atonType<"u"&&(r.type=t.value.atonType)):"atonType"===t.path?r.type=t.value:"navigation.position"===t.path?(r.position=[t.value.longitude,t.value.latitude],r.positionReceived=!0):r.properties[t.path]=t.value}(e.context,n),ti(e.context,k.atons,le?.signalk.atons);break;case"sar":le?.signalk.sar&&function LR(e,t){if(!k.sar.has(e)){const r=new IR;r.id=e,r.position=null,r.type.id=-1,r.type.name="SaR Beacon",k.sar.set(e,r)}const n=k.sar.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"navigation.position"===t.path&&t.value&&(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),ti(e.context,k.sar,le?.signalk.sar);break;case"aircraft":le?.signalk.aircraft&&function jR(e,t){if(!k.aircraft.has(e)){const r=new DR;r.id=e,r.position=null,k.aircraft.set(e,r)}const n=k.aircraft.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"navigation.position"===t.path&&t.value?(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0,fd(n)):"navigation.courseOverGroundTrue"===t.path?n.orientation=t.value:"navigation.speedOverGround"===t.path&&(n.sog=t.value)}(e.context,n),ti(e.context,k.aircraft,le?.signalk.aircraft);break;case"meteo":le?.signalk.meteo&&(function VR(e,t){if(!k.meteo.has(e)){const r=new bR;r.id=e,r.position=null,r.type.id=-1,r.type.name="Weather Station",k.meteo.set(e,r)}const n=k.meteo.get(e);if(""===t.path){if(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"){const r=e.split(":").slice(-2);n.mmsi=2===r.length?`${r[0]}:${r[1]}`:t.value.mmsi}}else"communication.callsignVhf"===t.path?n.callsignVhf=t.value:"communication.callsignHf"===t.path?n.callsignHf=t.value:"environment.outside.temperature"===t.path?n.temperature=t.value:"environment.wind.directionTrue"===t.path?n.twd=t.value:"environment.wind.averageSpeed"===t.path?n.tws=t.value:"navigation.position"===t.path&&t.value&&(n.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),MI(n)),ti(e.context,k.meteo,le?.signalk.meteo);break;case"vessels":if(Ie.isSelf(e))k.self.id||(k.self.id=e.context),bI(k.self,n,!0),MI(n);else{if(le?.signalk.vessels){const r=function RR(e){if(!k.aisTargets.has(e)){const t=new lI;t.id=e,t.position=null,k.aisTargets.set(e,t)}return k.aisTargets.get(e)}(e.context);bI(r,n)}ti(e.context,k.aisTargets,le?.signalk.vessels,le?.aisState)}}}))}),EI()):Ie.isResponse(e)&&postMessage({action:"response",result:e})}(t)}}function mI(e={}){e.interval&&"number"==typeof e.interval&&(bn=e.interval,DI(),II(),pI=1/(bn/1e3)*60),kt=!!e.playback,e.selections&&(typeof e.selections.preferredPaths<"u"&&(Dn=e.selections.preferredPaths),e.selections.aisMaxAge&&"number"==typeof e.selections.aisMaxAge&&(Lt.maxAge=e.selections.aisMaxAge),e.selections.aisStaleAge&&"number"==typeof e.selections.aisStaleAge&&(Lt.staleAge=e.selections.aisStaleAge),"number"==typeof e.selections.signalk.maxRadius&&(le.signalk=e.selections.signalk),typeof e.selections.aisState<"u"&&Array.isArray(e.selections.aisState)&&(le.aisState=e.selections.aisState),dd=e.selections.vessel,console.log("Worker: AIS Filter...",le))}function vI(e=!1){DI(),Zo.forEach(t=>t.unsubscribe()),Ie&&e&&Ie.close(),Ie=null,postMessage({action:"close",result:e,playback:kt})}function ei(e){return new Promise((t,n)=>{fetch(`${e}`).then(r=>{r.json().then(o=>t(o)).catch(o=>n(o))}).catch(r=>{n(r)})})}function yI(){ei(cd+"/tracks"+(le&&le.signalk&&le.signalk.maxRadius?`?radius=${le.signalk.maxRadius}`:"?radius=10000")).then(t=>{da=!0,Object.entries(t).forEach(n=>{if(k.aisTargets.has(n[0])){const r=k.aisTargets.get(n[0]);r.track=n[1].coordinates,fd(r)}})}).catch(()=>{da=!1,console.warn("Unable to fetch AIS tracks!")})}function ti(e,t,n=!0,r=[]){if(n){let o=t.get(e);o&&r.includes(o?.state)&&(console.log(`state match => ${r}, ${e}`),je.expired[e]=!0,o=null),o&&le.signalk.maxRadius?o.positionReceived&&Ct.inBounds(o.position,fI)?je.updated[e]=!0:(t.delete(e),je.expired[e]=!0):je.updated[e]=!0}else 0!==t.size&&(t.forEach((o,i)=>{je.expired[i]=!0}),t.clear())}function EI(e=!1){if(!bn||e){const t=new cI;t.playback=kt,k.aisStatus.updated=Object.keys(je.updated),k.aisStatus.stale=Object.keys(je.stale),k.aisStatus.expired=Object.keys(je.expired),t.result=k,t.timestamp=kt?hI:k.self.lastUpdated.toISOString(),postMessage(t),gI(),k.self.resourceUpdates=[],0===Qo&&(function PR(){const e=(new Date).valueOf();k.aisTargets.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.aisTargets.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)}),k.aircraft.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.aircraft.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)}),k.sar.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Lt.maxAge?(je.expired[n]=!0,k.sar.delete(n)):t.lastUpdated.valueOf()<e-Lt.staleAge&&(je.stale[n]=!0)})}(),k.self.positionReceived&&le?.signalk.maxRadius&&(fI=Ct.calcMapifiedExtent(k.self.position,le.signalk.maxRadius),Qo++)),Qo=Qo>=pI?0:Qo+1}}function II(){bn&&"number"==typeof bn&&ca.push(setInterval(()=>{ud&&(EI(!0),ud=!1)},bn)),ca.push(setInterval(()=>{console.warn("hasTrackPlugin",da),da&&yI()},6e4))}function DI(){ca.forEach(e=>clearInterval(e)),ca=[]}function bI(e,t,n=!1){if(e.lastUpdated=new Date,n){const o=-1!==t.path.indexOf("course")?t.path.split(".").slice(0,2).join("."):t.path;-1!==_R.indexOf(o)&&(k.paths[o]=null),t.path.includes("navigation.racing")&&(e.properties[t.path]=t.value)}if(""===t.path)typeof t.value.name<"u"&&(e.name=t.value.name),typeof t.value.mmsi<"u"&&(e.mmsi=t.value.mmsi),typeof t.value.registrations<"u"&&(e.registrations=t.value.registrations),typeof t.value.buddy<"u"&&(e.buddy=t.value.buddy),typeof t.value.communication<"u"&&(e.callsignVhf=t.value.communication.callsignVhf??"",e.callsignHf=t.value.communication.callsignHf??"");else if("performance.beatAngle"===t.path)e.performance.beatAngle=t.value;else if("performance.gybeAngle"===t.path)e.performance.gybeAngle=t.value;else if("design.aisShipType"===t.path)e.type=t.value;else if("navigation.position"===t.path&&t.value){if(typeof t.value.latitude>"u"||typeof t.value.longitude>"u")return;e.position=Ct.normaliseCoords([t.value.longitude,t.value.latitude]),e.positionReceived=!0,n||fd(e)}else"navigation.state"===t.path?e.state=t.value:"navigation.speedOverGround"===t.path?e.sog=t.value:"environment.wind.angleApparent"===t.path?e.wind.awa=t.value:"environment.wind.speedApparent"===t.path?e.wind.aws=t.value:"environment.wind.speedTrue"===t.path?e.wind.speedTrue=t.value:"environment.wind.speedOverGround"===t.path?e.wind.sog=t.value:"environment.wind.directionTrue"===t.path?e.wind.twd=t.value:"environment.wind.directionMagnetic"===t.path?e.wind.mwd=t.value:"environment.mode"===t.path?e.mode=t.value:-1!==t.path.indexOf("navigation.course.")?-1!==t.path.indexOf("navigation.course.calcValues")?-1===t.path.indexOf("navigation.course.calcValues.previousPoint")&&(e[`course.${t.path.split(".").slice(-1)[0]}`]=t.value):-1!==t.path.indexOf("navigation.course.activeRoute")?e.courseApi.activeRoute=t.value:-1!==t.path.indexOf("navigation.course.nextPoint")?e.courseApi.nextPoint=t.value:-1!==t.path.indexOf("navigation.course.previousPoint")?e.courseApi.previousPoint=t.value:"navigation.course.arrivalCircle"===t.path&&(e.courseApi.arrivalCircle=t.value):-1!==t.path.indexOf("navigation.closestApproach")?e.closestApproach=t.value:"navigation.anchor.position"===t.path?e.anchor.position=t.value:"navigation.anchor.maxRadius"===t.path?e.anchor.maxRadius=t.value:"navigation.anchor.currentRadius"===t.path?e.anchor.radius=t.value:-1!==t.path.indexOf("resources.")?e.resourceUpdates.push(t):"steering.autopilot.state"===t.path&&Jo===Xo?e.autopilot.state=t.value:"steering.autopilot.mode"===t.path&&Jo===Xo?e.autopilot.mode=t.value:"steering.autopilot.target"===t.path&&Jo===Xo?e.autopilot.target=t.value:"steering.autopilot.engaged"===t.path&&Jo===Xo?e.autopilot.enabled=t.value:"steering.autopilot.defaultPilot"===t.path?Xo=t.value:"navigation.courseOverGroundTrue"===t.path?e.cogTrue=t.value:"navigation.courseOverGroundMagnetic"===t.path?e.cogMagnetic=t.value:"navigation.headingTrue"===t.path?e.headingTrue=t.value:"navigation.headingMagnetic"===t.path&&(e.headingMagnetic=t.value);typeof Dn.heading<"u"&&t.path===Dn.heading&&(e.orientation=t.value),typeof Dn.tws<"u"&&t.path===Dn.tws&&(e.wind.tws=t.value),typeof Dn.twd<"u"&&t.path===Dn.twd&&(e.wind.direction="environment.wind.angleTrueGround"===t.path||"environment.wind.angleTrueWater"===t.path?ad.angleToDirection(t.value,e.orientation??0):t.value);const r=e.cogTrue??e.cogMagnetic??void 0;typeof r<"u"&&e.position&&(e.vectors.cog=[e.position,Ct.destCoordinate(e.position,r,(e.sog??0)*(60*(n?dd.cogLine:dd.aisCogLine)))])}function MI(e,t){const n={path:e.path,value:e.value,context:t||null};let r;const o=e.path.split(".");if(("notifications.environment.depth.belowTransducer"===e.path||"notifications.environment.depth.belowSurface"===e.path||"notifications.environment.depth.belowKeel"===e.path)&&(r=o[2]),"notifications.navigation.anchor"===e.path&&(r=o[2]),-1!==["mob","sinking","fire","piracy","flooding","collision","grounding","listing","adrift","abandon"].indexOf(o[o.length-1])&&(r=o[o.length-1]),-1!==e.path.indexOf("notifications.navigation.closestApproach")&&(r=o[2],n.context=o[3]),-1!==e.path.indexOf("notifications.buddy")&&(r=o[1],n.context=o[2]),-1!==e.path.indexOf("notifications.navigation.course.arrivalCircleEntered")&&(r=o[3]),-1!==e.path.indexOf("notifications.navigation.course.perpendicularPassed")&&(r=o[3]),-1!==e.path.indexOf("notifications.meteo.warning")&&(r=o[1]),r){const i=new MR(r);i.playback=kt,i.result=n,postMessage(i)}}function fd(e){if(e.track&&0===e.track.length)e.track.push([e.position]);else{const n=e.track[e.track.length-1][e.track[e.track.length-1].length-1];n[0]!==e.position[0]&&n[1]!==e.position[1]&&e.track[e.track.length-1].push(e.position)}e.track[e.track.length-1]=e.track[e.track.length-1].slice(0-Lt.maxTrack)}addEventListener("message",({data:e})=>{!function NR(e){if(e.cmd)switch(e.cmd){case"open":console.log("Worker control: opening stream..."),mI(e.options),function OR(e){if(Ie)return;if(!e.url)return void postMessage({action:"error",result:"Valid options not provided!"});const t=e.url.split("/");if(t.pop(),t.push("api"),t[0]="wss:"===t[0]?"https:":"http:",cd=t.join("/"),function TR(){k={self:new lI,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},k.self.positionReceived=!1,gI()}(),Ie=new ER,Zo.push(Ie.onConnect.subscribe(n=>fa({action:"onConnect",msg:n}))),Zo.push(Ie.onClose.subscribe(n=>fa({action:"onClose",msg:n}))),Zo.push(Ie.onError.subscribe(n=>fa({action:"onError",msg:n}))),Zo.push(Ie.onMessage.subscribe(n=>fa({action:"onMessage",msg:n}))),Ie.authToken=dI,e.playback){const n=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null;let r=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;r=r?n?"&"+r:"?"+r:null,Ie.open(`${e.url}${n||""}${r||""}`,e.playbackOptions.subscribe,e.token)}else Ie.open(e.url,e.subscribe,e.token),yI()}(e.options);break;case"close":console.log("Worker control: closing stream..."),vI(!0);break;case"subscribe":console.log("Worker control: subscribing to paths..."),Ie.subscribe(e.options.context,e.options.path);break;case"settings":console.log("Worker control: settings..."),mI(e.options);break;case"alarm":console.log("Worker control: alarm action..."),function AR(e){const t=-1===e.type.indexOf("notifications.")?`notifications.${e.type}`:e.type;e.raise?Ie.raiseAlarm("self",t,new vR(e.message,e.state,!0,!0)):Ie.clearAlarm("self",t)}(e.options);break;case"vessel":if(console.log("Worker control: vessel setting..."),e.options){let t;t="self"===e.options.context?k.self:k.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":console.log("Worker control: auth token..."),e.options&&typeof e.options.token<"u"&&(dI=e.options.token);break;case"trail":console.log("Worker control: Fetch vessel trail from server..."),e.options&&(Yo.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(Yo.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",Yo.trailResolution.next23=e.options.trailResolution.next23??"1m",Yo.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),function SR(e){console.info("Worker: Fetching vessel trail from server",e);const t=cd+"/self/track?",n=[];e.trailDuration>24&&(n.push(ei(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}&timespanOffset=24`)),n.push(ei(`${t}timespan=23h&resolution=${e.trailResolution.next23}&timespanOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&n.push(ei(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}&timespanOffset=1`)),n.push(ei(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let i=[];const s=new CR;s.playback=kt,Promise.all(n).then(a=>{let l=0;const u=n.length-1;a.forEach(d=>{if(d.type&&"MultiLineString"===d.type&&d.coordinates&&Array.isArray(d.coordinates))if(l!==u){let f=[];for(d.coordinates.forEach(p=>{f=f.concat(p)}),f=(0,wR.p$)(f,5e-4,true);f.length>60;){const p=f.slice(0,60);i.push(p),f=f.slice(59),f[0]=[f[0][0]+5e-9,f[0][1]+5e-9]}0!==f.length&&i.push(f)}else i=i.concat(d.coordinates);l++}),s.result=i,postMessage(s)}).catch(()=>{s.result=null,postMessage(s)})}(Yo)}}(e)})})();
@@ -1314,7 +1314,7 @@
1314
1314
  Click and select (or drop) the file containing the resource data.
1315
1315
  </li>
1316
1316
  <li>
1317
- Click <b>Load</b> to upload the fiel contents to the server.
1317
+ Click <b>Load</b> to upload the file contents to the server.
1318
1318
  </li>
1319
1319
  <b
1320
1320
  >Important:
@@ -1771,7 +1771,7 @@
1771
1771
 
1772
1772
  <b>DISPLAY:</b><br />
1773
1773
  This section provides choices about how information is displayed.<br />
1774
- <img src="./img/settings_display.png" style="width: 300px" alt="" />
1774
+ <img src="./img/settings_display.png" style="width: 350px" alt="" />
1775
1775
  <ul>
1776
1776
  <li>
1777
1777
  <b>Instrument Panel App</b>: Select from a list of installed
@@ -1801,6 +1801,15 @@
1801
1801
  These selected Web App can be "switched in" for display in the
1802
1802
  <i>Instrument Panel</i>.
1803
1803
  </li>
1804
+ <li>
1805
+ <b>Lock Follow Vessel</b>: Check this box to remain in "Follow
1806
+ Vessel" mode when map is panned / moved.
1807
+ </li>
1808
+ <li>
1809
+ <b>Do not Play Sounds</b>: Check this box if you do not want any
1810
+ sounds played.
1811
+ <i>(Overrides ALARM_METHOD in notification message.)</i>
1812
+ </li>
1804
1813
  <li>
1805
1814
  <b>Show DEPTH Alarm Messages</b>: Check this box if you want
1806
1815
  received DEPTH notifications from the Signal K server to be
@@ -1849,11 +1858,12 @@
1849
1858
  </li>
1850
1859
  </ul>
1851
1860
  <b>MAP:</b><br />
1861
+ <img src="./img/settings_map.png" style="width: 300px" alt="" /><br />
1852
1862
  <ul>
1853
1863
  <li>
1854
- <b>Feature label zoom level</b>: Select the zoom level at which labels
1855
- for features on the map appear. Labels will be hidden at zoom levels
1856
- below this value.
1864
+ <b>Feature label zoom level</b>: Select the zoom level at which
1865
+ labels for features on the map appear. Labels will be hidden at
1866
+ zoom levels below this value.
1857
1867
  </li>
1858
1868
  <li>
1859
1869
  <b>Popover close with button</b>: Select this option in order to a
@@ -2079,6 +2089,11 @@
2079
2089
  <i>'anchored'</i>. Note: Display is updated when next vessel
2080
2090
  update is received.
2081
2091
  </li>
2092
+ <li>
2093
+ <b>COG Line</b>: Select to show / hide COG vector for AIS
2094
+ vessels.<br />
2095
+ <i>Note: COG line length is calculated for 10 mins duration.</i>
2096
+ </li>
2082
2097
  </ul>
2083
2098
  <hr />
2084
2099
  <b>RESOURCES: NOTES</b><br />
@@ -2260,10 +2275,10 @@
2260
2275
  alt=""
2261
2276
  /><br />
2262
2277
 
2263
- <b>Signal K server is behind a proxy:</b><br />
2278
+ <!--<b>Signal K server is behind a proxy:</b><br />
2264
2279
  Check this option when your browser is connecting to a Signal K server
2265
2280
  that is behind a proxy server. This enables Freeboard-SK to correctly
2266
- detect and connect to the endpoints exposed by the Signal K Server.<br />&nbsp;<br />
2281
+ detect and connect to the endpoints exposed by the Signal K Server.<br />&nbsp;<br />-->
2267
2282
 
2268
2283
  <b>Filter Stream Data:</b>
2269
2284
  Use the options in this section to select which Signal K
package/public/index.html CHANGED
@@ -74,5 +74,5 @@
74
74
  </div>
75
75
  </div>
76
76
  </app-root>
77
- <script src="runtime.5c40db27c4e51864.js" type="module"></script><script src="polyfills.f03f63a631c4a669.js" type="module"></script><script src="main.f13585e587cf4439.js" type="module"></script></body>
77
+ <script src="runtime.7bf80f342dbc62b9.js" type="module"></script><script src="polyfills.f03f63a631c4a669.js" type="module"></script><script src="main.ac054bdad63d8a39.js" type="module"></script></body>
78
78
  </html>