@mxtommy/kip
Version:
An advanced and versatile marine instrumentation package to display Signal K data.
1 lines • 173 kB
JavaScript
import{$a as Ui,$b as ce,$c as Er,$e as eo,A as vi,Bc as Bi,Ca as Tr,Cc as Ar,Da as Oi,Db as ji,Dc as Wi,Ea as Ii,Ec as Hi,Ed as Ke,Fa as Ri,G as _i,H as yi,Hb as bt,Ib as We,J as Si,Jb as ae,K as $e,Ka as Cr,L as Nt,Lc as Vi,M as wi,Ma as ye,Nb as W,Nd as Qi,Oc as qe,Od as Ge,Pa as G,Sd as Mr,T as Ti,Ta as Se,U as Ci,Ua as Ni,Va as ht,Vc as qi,Vd as Ji,Xc as Ki,Yb as xt,Z as ki,Zb as He,Ze as Xi,_ as Ai,_d as Zi,bd as yt,cd as Dr,d as bs,da as Ei,db as Pi,dc as H,de as Qe,e as xs,ef as to,f as ie,fa as Di,g as It,ga as Mi,h as pi,ha as Ue,ia as Fi,ic as V,j as Re,jc as Q,kc as Pe,ke as Yi,la as wr,le as Je,lf as ro,m as T,me as Fr,n as hi,ne as Ze,o as D,oa as I,oc as zi,p as Ne,pa as Be,pc as vt,qc as _t,r as gi,ra as oe,rc as we,sc as kr,t as Rt,tc as ne,td as Gi,u as bi,ua as g,ub as L,vc as Ve,wc as fe,x as de,xb as Li,xc as z,y as xi,yb as gt,yc as $,z as ze,zc as $i}from"./chunk-Y7X77HSW.js";var Sn=bs((Vr,qr)=>{(function(t,i){typeof Vr=="object"&&typeof qr<"u"?qr.exports=i():typeof define=="function"&&define.amd?define(i):(t=typeof globalThis<"u"?globalThis:t||self,t.Qty=i())})(Vr,function(){"use strict";function t(a){return typeof a=="string"||a instanceof String}var i=Number.isFinite||window.isFinite;function e(a){return i(a)}function r(a){return a}function o(a){var l={};return a.filter(function(d){return l.hasOwnProperty(d)?!1:l[d]=!0})}function n(a,l){if(l.length!==a.length)return!1;for(var d=0;d<a.length;d++)if(l[d].compareArray&&!l[d].compareArray(a[d])||l[d]!==a[d])return!1;return!0}function s(a,l){Object.keys(l).forEach(function(d){a[d]=l[d]})}function c(){for(var a=1,l=0,d=0;d<arguments.length;d++){var f=arguments[d];l=l+_(f),a*=f}return l!==0?b(a,l):a}function m(a,l){if(l===0)throw new Error("Divide by zero");var d=Math.pow(10,_(l)),f=d/(d*l);return c(a,f)}function b(a,l){return Math.round(a*Math.pow(10,l))/Math.pow(10,l)}function _(a){if(!isFinite(a))return 0;for(var l=0;a%1!==0;)a*=10,l++;return l}function u(){var a;if(!this)return a=Object.create(u.prototype),u.apply(a,arguments),a;a=Error.apply(this,arguments),this.name="QtyError",this.message=a.message,this.stack=a.stack}u.prototype=Object.create(Error.prototype,{constructor:{value:u}});function v(a,l){throw new u("Incompatible units: "+a+" and "+l)}var y={"<googol>":[["googol"],1e100,"prefix"],"<kibi>":[["Ki","Kibi","kibi"],Math.pow(2,10),"prefix"],"<mebi>":[["Mi","Mebi","mebi"],Math.pow(2,20),"prefix"],"<gibi>":[["Gi","Gibi","gibi"],Math.pow(2,30),"prefix"],"<tebi>":[["Ti","Tebi","tebi"],Math.pow(2,40),"prefix"],"<pebi>":[["Pi","Pebi","pebi"],Math.pow(2,50),"prefix"],"<exi>":[["Ei","Exi","exi"],Math.pow(2,60),"prefix"],"<zebi>":[["Zi","Zebi","zebi"],Math.pow(2,70),"prefix"],"<yebi>":[["Yi","Yebi","yebi"],Math.pow(2,80),"prefix"],"<yotta>":[["Y","Yotta","yotta"],1e24,"prefix"],"<zetta>":[["Z","Zetta","zetta"],1e21,"prefix"],"<exa>":[["E","Exa","exa"],1e18,"prefix"],"<peta>":[["P","Peta","peta"],1e15,"prefix"],"<tera>":[["T","Tera","tera"],1e12,"prefix"],"<giga>":[["G","Giga","giga"],1e9,"prefix"],"<mega>":[["M","Mega","mega"],1e6,"prefix"],"<kilo>":[["k","kilo"],1e3,"prefix"],"<hecto>":[["h","Hecto","hecto"],100,"prefix"],"<deca>":[["da","Deca","deca","deka"],10,"prefix"],"<deci>":[["d","Deci","deci"],.1,"prefix"],"<centi>":[["c","Centi","centi"],.01,"prefix"],"<milli>":[["m","Milli","milli"],.001,"prefix"],"<micro>":[["u","\u03BC","\xB5","Micro","mc","micro"],1e-6,"prefix"],"<nano>":[["n","Nano","nano"],1e-9,"prefix"],"<pico>":[["p","Pico","pico"],1e-12,"prefix"],"<femto>":[["f","Femto","femto"],1e-15,"prefix"],"<atto>":[["a","Atto","atto"],1e-18,"prefix"],"<zepto>":[["z","Zepto","zepto"],1e-21,"prefix"],"<yocto>":[["y","Yocto","yocto"],1e-24,"prefix"],"<1>":[["1","<1>"],1,""],"<meter>":[["m","meter","meters","metre","metres"],1,"length",["<meter>"]],"<inch>":[["in","inch","inches",'"'],.0254,"length",["<meter>"]],"<foot>":[["ft","foot","feet","'"],.3048,"length",["<meter>"]],"<yard>":[["yd","yard","yards"],.9144,"length",["<meter>"]],"<mile>":[["mi","mile","miles"],1609.344,"length",["<meter>"]],"<naut-mile>":[["nmi","naut-mile"],1852,"length",["<meter>"]],"<league>":[["league","leagues"],4828,"length",["<meter>"]],"<furlong>":[["furlong","furlongs"],201.2,"length",["<meter>"]],"<rod>":[["rd","rod","rods"],5.029,"length",["<meter>"]],"<mil>":[["mil","mils"],254e-7,"length",["<meter>"]],"<angstrom>":[["ang","angstrom","angstroms"],1e-10,"length",["<meter>"]],"<fathom>":[["fathom","fathoms"],1.829,"length",["<meter>"]],"<pica>":[["pica","picas"],.00423333333,"length",["<meter>"]],"<point>":[["pt","point","points"],.000352777778,"length",["<meter>"]],"<redshift>":[["z","red-shift","redshift"],1302773e20,"length",["<meter>"]],"<AU>":[["AU","astronomical-unit"],1495979e5,"length",["<meter>"]],"<light-second>":[["ls","light-second"],299792500,"length",["<meter>"]],"<light-minute>":[["lmin","light-minute"],1798755e4,"length",["<meter>"]],"<light-year>":[["ly","light-year"],9460528e9,"length",["<meter>"]],"<parsec>":[["pc","parsec","parsecs"],3085678e10,"length",["<meter>"]],"<datamile>":[["DM","datamile"],1828.8,"length",["<meter>"]],"<kilogram>":[["kg","kilogram","kilograms"],1,"mass",["<kilogram>"]],"<AMU>":[["u","AMU","amu"],1660538921e-36,"mass",["<kilogram>"]],"<dalton>":[["Da","Dalton","Daltons","dalton","daltons"],1660538921e-36,"mass",["<kilogram>"]],"<slug>":[["slug","slugs"],14.5939029,"mass",["<kilogram>"]],"<short-ton>":[["tn","ton","short-ton"],907.18474,"mass",["<kilogram>"]],"<metric-ton>":[["t","tonne","metric-ton"],1e3,"mass",["<kilogram>"]],"<carat>":[["ct","carat","carats"],2e-4,"mass",["<kilogram>"]],"<pound>":[["lbs","lb","pound","pounds","#"],.45359237,"mass",["<kilogram>"]],"<ounce>":[["oz","ounce","ounces"],.0283495231,"mass",["<kilogram>"]],"<gram>":[["g","gram","grams","gramme","grammes"],.001,"mass",["<kilogram>"]],"<grain>":[["grain","grains","gr"],6479891e-11,"mass",["<kilogram>"]],"<dram>":[["dram","drams","dr"],.0017718452,"mass",["<kilogram>"]],"<stone>":[["stone","stones","st"],6.35029318,"mass",["<kilogram>"]],"<hectare>":[["hectare"],1e4,"area",["<meter>","<meter>"]],"<acre>":[["acre","acres"],4046.85642,"area",["<meter>","<meter>"]],"<sqft>":[["sqft"],1,"area",["<foot>","<foot>"]],"<liter>":[["l","L","liter","liters","litre","litres"],.001,"volume",["<meter>","<meter>","<meter>"]],"<gallon>":[["gal","gallon","gallons"],.0037854118,"volume",["<meter>","<meter>","<meter>"]],"<gallon-imp>":[["galimp","gallon-imp","gallons-imp"],.00454609,"volume",["<meter>","<meter>","<meter>"]],"<quart>":[["qt","quart","quarts"],.00094635295,"volume",["<meter>","<meter>","<meter>"]],"<pint>":[["pt","pint","pints"],.000473176475,"volume",["<meter>","<meter>","<meter>"]],"<pint-imp>":[["ptimp","pint-imp","pints-imp"],.00056826125,"volume",["<meter>","<meter>","<meter>"]],"<cup>":[["cu","cup","cups"],.000236588238,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce>":[["floz","fluid-ounce","fluid-ounces"],295735297e-13,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce-imp>":[["flozimp","floz-imp","fluid-ounce-imp","fluid-ounces-imp"],284130625e-13,"volume",["<meter>","<meter>","<meter>"]],"<tablespoon>":[["tb","tbsp","tbs","tablespoon","tablespoons"],147867648e-13,"volume",["<meter>","<meter>","<meter>"]],"<teaspoon>":[["tsp","teaspoon","teaspoons"],492892161e-14,"volume",["<meter>","<meter>","<meter>"]],"<bushel>":[["bu","bsh","bushel","bushels"],.035239072,"volume",["<meter>","<meter>","<meter>"]],"<oilbarrel>":[["bbl","oilbarrel","oilbarrels","oil-barrel","oil-barrels"],.158987294928,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel>":[["bl","bl-us","beerbarrel","beerbarrels","beer-barrel","beer-barrels"],.1173477658,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel-imp>":[["blimp","bl-imp","beerbarrel-imp","beerbarrels-imp","beer-barrel-imp","beer-barrels-imp"],.16365924,"volume",["<meter>","<meter>","<meter>"]],"<kph>":[["kph"],.277777778,"speed",["<meter>"],["<second>"]],"<mph>":[["mph"],.44704,"speed",["<meter>"],["<second>"]],"<knot>":[["kt","kn","kts","knot","knots"],.514444444,"speed",["<meter>"],["<second>"]],"<fps>":[["fps"],.3048,"speed",["<meter>"],["<second>"]],"<gee>":[["gee"],9.80665,"acceleration",["<meter>"],["<second>","<second>"]],"<Gal>":[["Gal"],.01,"acceleration",["<meter>"],["<second>","<second>"]],"<kelvin>":[["degK","kelvin"],1,"temperature",["<kelvin>"]],"<celsius>":[["degC","celsius","celsius","centigrade"],1,"temperature",["<kelvin>"]],"<fahrenheit>":[["degF","fahrenheit"],5/9,"temperature",["<kelvin>"]],"<rankine>":[["degR","rankine"],5/9,"temperature",["<kelvin>"]],"<temp-K>":[["tempK","temp-K"],1,"temperature",["<temp-K>"]],"<temp-C>":[["tempC","temp-C"],1,"temperature",["<temp-K>"]],"<temp-F>":[["tempF","temp-F"],5/9,"temperature",["<temp-K>"]],"<temp-R>":[["tempR","temp-R"],5/9,"temperature",["<temp-K>"]],"<second>":[["s","sec","secs","second","seconds"],1,"time",["<second>"]],"<minute>":[["min","mins","minute","minutes"],60,"time",["<second>"]],"<hour>":[["h","hr","hrs","hour","hours"],3600,"time",["<second>"]],"<day>":[["d","day","days"],3600*24,"time",["<second>"]],"<week>":[["wk","week","weeks"],7*3600*24,"time",["<second>"]],"<fortnight>":[["fortnight","fortnights"],1209600,"time",["<second>"]],"<year>":[["y","yr","year","years","annum"],31556926,"time",["<second>"]],"<decade>":[["decade","decades"],315569260,"time",["<second>"]],"<century>":[["century","centuries"],3155692600,"time",["<second>"]],"<pascal>":[["Pa","pascal","Pascal"],1,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<bar>":[["bar","bars"],1e5,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<mmHg>":[["mmHg"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inHg>":[["inHg"],3386.3881472,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<torr>":[["torr"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<atm>":[["atm","ATM","atmosphere","atmospheres"],101325,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<psi>":[["psi"],6894.76,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<cmh2o>":[["cmH2O","cmh2o"],98.0638,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inh2o>":[["inH2O","inh2o"],249.082052,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<poise>":[["P","poise"],.1,"viscosity",["<kilogram>"],["<meter>","<second>"]],"<stokes>":[["St","stokes"],1e-4,"viscosity",["<meter>","<meter>"],["<second>"]],"<mole>":[["mol","mole"],1,"substance",["<mole>"]],"<molar>":[["M","molar"],1e3,"molar_concentration",["<mole>"],["<meter>","<meter>","<meter>"]],"<wtpercent>":[["wt%","wtpercent"],10,"molar_concentration",["<kilogram>"],["<meter>","<meter>","<meter>"]],"<katal>":[["kat","katal","Katal"],1,"activity",["<mole>"],["<second>"]],"<unit>":[["U","enzUnit","unit"],16667e-19,"activity",["<mole>"],["<second>"]],"<farad>":[["F","farad","Farad"],1,"capacitance",["<second>","<second>","<second>","<second>","<ampere>","<ampere>"],["<meter>","<meter>","<kilogram>"]],"<coulomb>":[["C","coulomb","Coulomb"],1,"charge",["<ampere>","<second>"]],"<Ah>":[["Ah"],3600,"charge",["<ampere>","<second>"]],"<ampere>":[["A","Ampere","ampere","amp","amps"],1,"current",["<ampere>"]],"<siemens>":[["S","Siemens","siemens"],1,"conductance",["<second>","<second>","<second>","<ampere>","<ampere>"],["<kilogram>","<meter>","<meter>"]],"<henry>":[["H","Henry","henry"],1,"inductance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>","<ampere>"]],"<volt>":[["V","Volt","volt","volts"],1,"potential",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>"]],"<ohm>":[["Ohm","ohm","\u03A9","\u2126"],1,"resistance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>","<ampere>"]],"<weber>":[["Wb","weber","webers"],1,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<tesla>":[["T","tesla","teslas"],1,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<gauss>":[["G","gauss"],1e-4,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<maxwell>":[["Mx","maxwell","maxwells"],1e-8,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<oersted>":[["Oe","oersted","oersteds"],250/Math.PI,"magnetism",["<ampere>"],["<meter>"]],"<joule>":[["J","joule","Joule","joules","Joules"],1,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<erg>":[["erg","ergs"],1e-7,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<btu>":[["BTU","btu","BTUs"],1055.056,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<calorie>":[["cal","calorie","calories"],4.184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Calorie>":[["Cal","Calorie","Calories"],4184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<therm-US>":[["th","therm","therms","Therm","therm-US"],105480400,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Wh>":[["Wh"],3600,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<electronvolt>":[["eV","electronvolt","electronvolts"],1602176634e-28,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<newton>":[["N","Newton","newton"],1,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<dyne>":[["dyn","dyne"],1e-5,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<pound-force>":[["lbf","pound-force"],4.448222,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<hertz>":[["Hz","hertz","Hertz"],1,"frequency",["<1>"],["<second>"]],"<radian>":[["rad","radian","radians"],1,"angle",["<radian>"]],"<degree>":[["deg","degree","degrees"],Math.PI/180,"angle",["<radian>"]],"<arcminute>":[["arcmin","arcminute","arcminutes"],Math.PI/10800,"angle",["<radian>"]],"<arcsecond>":[["arcsec","arcsecond","arcseconds"],Math.PI/648e3,"angle",["<radian>"]],"<gradian>":[["gon","grad","gradian","grads"],Math.PI/200,"angle",["<radian>"]],"<steradian>":[["sr","steradian","steradians"],1,"solid_angle",["<steradian>"]],"<rotation>":[["rotation"],2*Math.PI,"angle",["<radian>"]],"<rpm>":[["rpm"],2*Math.PI/60,"angular_velocity",["<radian>"],["<second>"]],"<byte>":[["B","byte","bytes"],1,"information",["<byte>"]],"<bit>":[["b","bit","bits"],.125,"information",["<byte>"]],"<Bps>":[["Bps"],1,"information_rate",["<byte>"],["<second>"]],"<bps>":[["bps"],.125,"information_rate",["<byte>"],["<second>"]],"<dollar>":[["USD","dollar"],1,"currency",["<dollar>"]],"<cents>":[["cents"],.01,"currency",["<dollar>"]],"<candela>":[["cd","candela"],1,"luminosity",["<candela>"]],"<lumen>":[["lm","lumen"],1,"luminous_power",["<candela>","<steradian>"]],"<lux>":[["lux"],1,"illuminance",["<candela>","<steradian>"],["<meter>","<meter>"]],"<watt>":[["W","watt","watts"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere>":[["VA","volt-ampere"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere-reactive>":[["var","Var","VAr","VAR","volt-ampere-reactive"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<horsepower>":[["hp","horsepower"],745.699872,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<gray>":[["Gy","gray","grays"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<roentgen>":[["R","roentgen"],.00933,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<sievert>":[["Sv","sievert","sieverts"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<becquerel>":[["Bq","becquerel","becquerels"],1,"radiation",["<1>"],["<second>"]],"<curie>":[["Ci","curie","curies"],37e9,"radiation",["<1>"],["<second>"]],"<cpm>":[["cpm"],1/60,"rate",["<count>"],["<second>"]],"<dpm>":[["dpm"],1/60,"rate",["<count>"],["<second>"]],"<bpm>":[["bpm"],1/60,"rate",["<count>"],["<second>"]],"<dot>":[["dot","dots"],1,"resolution",["<each>"]],"<pixel>":[["pixel","px"],1,"resolution",["<each>"]],"<ppi>":[["ppi"],1,"resolution",["<pixel>"],["<inch>"]],"<dpi>":[["dpi"],1,"typography",["<dot>"],["<inch>"]],"<cell>":[["cells","cell"],1,"counting",["<each>"]],"<each>":[["each"],1,"counting",["<each>"]],"<count>":[["count"],1,"counting",["<each>"]],"<base-pair>":[["bp","base-pair"],1,"counting",["<each>"]],"<nucleotide>":[["nt","nucleotide"],1,"counting",["<each>"]],"<molecule>":[["molecule","molecules"],1,"counting",["<1>"]],"<dozen>":[["doz","dz","dozen"],12,"prefix_only",["<each>"]],"<percent>":[["%","percent"],.01,"prefix_only",["<1>"]],"<ppm>":[["ppm"],1e-6,"prefix_only",["<1>"]],"<ppb>":[["ppb"],1e-9,"prefix_only",["<1>"]],"<ppt>":[["ppt"],1e-12,"prefix_only",["<1>"]],"<ppq>":[["ppq"],1e-15,"prefix_only",["<1>"]],"<gross>":[["gr","gross"],144,"prefix_only",["<dozen>","<dozen>"]],"<decibel>":[["dB","decibel","decibels"],1,"logarithmic",["<decibel>"]]},w=["<meter>","<kilogram>","<second>","<mole>","<ampere>","<radian>","<kelvin>","<temp-K>","<byte>","<dollar>","<candela>","<each>","<steradian>","<decibel>"],E="<1>",S=[E];function R(a,l){var d=l[1],f=l[3]||[],p=l[4]||[];if(!e(d))throw new u(a+": Invalid unit definition. 'scalar' must be a number");f.forEach(function(h){if(y[h]===void 0)throw new u(a+": Invalid unit definition. Unit "+h+" in 'numerator' is not recognized")}),p.forEach(function(h){if(y[h]===void 0)throw new u(a+": Invalid unit definition. Unit "+h+" in 'denominator' is not recognized")})}var N={},Fe={},F={},X={},Mt={};for(var _e in y)if(y.hasOwnProperty(_e)){var ee=y[_e];if(ee[2]==="prefix"){N[_e]=ee[1];for(var pr=0;pr<ee[0].length;pr++)Fe[ee[0][pr]]=_e}else{R(_e,ee),F[_e]={scalar:ee[1],numerator:ee[3],denominator:ee[4]};for(var hr=0;hr<ee[0].length;hr++)X[ee[0][hr]]=_e}Mt[_e]=ee[0][0]}function jn(a){var l,d=[],f=Object.keys(y);if(typeof a>"u")for(l=0;l<f.length;l++)["","prefix"].indexOf(y[f[l]][2])===-1&&d.push(f[l].substr(1,f[l].length-2));else{if(this.getKinds().indexOf(a)===-1)throw new u("Kind not recognized");for(l=0;l<f.length;l++)y[f[l]][2]===a&&d.push(f[l].substr(1,f[l].length-2))}return d.sort(function(p,h){return p.toLowerCase()<h.toLowerCase()?-1:p.toLowerCase()>h.toLowerCase()?1:0})}function zn(a){if(!X[a])throw new u("Unit not recognized");return y[X[a]][0]}var gr=["length","time","temperature","mass","current","substance","luminosity","currency","information","angle"];function $n(){if(this.signature)return this.signature;for(var a=Yr.call(this),l=0;l<a.length;l++)a[l]*=Math.pow(20,l);return a.reduce(function(d,f){return d+f},0)}function Yr(){if(!this.isBase())return Yr.call(this.toBase());for(var a=new Array(gr.length),l=0;l<a.length;l++)a[l]=0;for(var d,f,p=0;p<this.numerator.length;p++)(d=y[this.numerator[p]])&&(f=gr.indexOf(d[2]),f>=0&&(a[f]=a[f]+1));for(var h=0;h<this.denominator.length;h++)(d=y[this.denominator[h]])&&(f=gr.indexOf(d[2]),f>=0&&(a[f]=a[f]-1));return a}var Xr="[+-]",br="\\d+",Bn=Xr+"?"+br,ei="\\."+br,Wn="(?:"+br+"(?:"+ei+")?)|(?:"+ei+")",Hn="[Ee]"+Bn,Vn="(?:"+Wn+")(?:"+Hn+")?",qn=Xr+"?\\s*"+Vn,Kn="("+qn+")?\\s*([^/]*)(?:/(.+))?",Gn=new RegExp("^"+Kn+"$"),ti="\\^|\\*{2}",ri="[01234]",Qn=new RegExp("([^ \\*\\d]+?)(?:"+ti+")?(-?"+ri+"(?![a-zA-Z]))"),Jn=new RegExp("([^ \\*\\d]+?)(?:"+ti+")?("+ri+"(?![a-zA-Z]))");function ii(a){t(a)||(a=a.toString()),a=a.trim();var l=Gn.exec(a);if(!l)throw new u(a+": Quantity not recognized");var d=l[1];d?(d=d.replace(/\s/g,""),this.scalar=parseFloat(d)):this.scalar=1;for(var f=l[2],p=l[3],h,O,A;l=Qn.exec(f);){if(h=parseFloat(l[2]),isNaN(h))throw new u("Unit exponent is not a number");if(h===0&&!xr.test(l[1]))throw new u("Unit not recognized");O=l[1]+" ",A="";for(var P=0;P<Math.abs(h);P++)A+=O;h>=0?f=f.replace(l[0],A):(p=p?p+A:A,f=f.replace(l[0],""))}for(;l=Jn.exec(p);){if(h=parseFloat(l[2]),isNaN(h))throw new u("Unit exponent is not a number");if(h===0&&!xr.test(l[1]))throw new u("Unit not recognized");O=l[1]+" ",A="";for(var K=0;K<h;K++)A+=O;p=p.replace(l[0],A)}f&&(this.numerator=ni(f.trim())),p&&(this.denominator=ni(p.trim()))}var Zn=Object.keys(Fe).sort(function(a,l){return l.length-a.length}).join("|"),Yn=Object.keys(X).sort(function(a,l){return l.length-a.length}).join("|"),Xn="\\b|$",oi="("+Zn+")??("+Yn+")(?:"+Xn+")",xr=new RegExp("^\\s*("+oi+"[\\s\\*]*)+$"),es=new RegExp(oi,"g"),ai={};function ni(a){var l=ai[a];if(l)return l;var d,f=[];if(!xr.test(a))throw new u("Unit not recognized");for(;d=es.exec(a);)f.push(d.slice(1));return f=f.map(function(p){return Fe[p[0]]?[Fe[p[0]],X[p[1]]]:[X[p[1]]]}),f=f.reduce(function(p,h){return p.concat(h)},[]),f=f.filter(function(p){return p}),ai[a]=f,f}function ts(a){if(!t(a))throw new u("Argument should be a string");try{return this(a)}catch{return null}}function Ft(a){return a instanceof x}function x(a,l){if(rs.apply(null,arguments),!Ft(this))return new x(a,l);if(this.scalar=null,this.baseScalar=null,this.signature=null,this._conversionCache={},this.numerator=S,this.denominator=S,si(a)?(this.scalar=a.scalar,this.numerator=a.numerator&&a.numerator.length!==0?a.numerator:S,this.denominator=a.denominator&&a.denominator.length!==0?a.denominator:S):l?(ii.call(this,l),this.scalar=a):ii.call(this,a),this.denominator.join("*").indexOf("temp")>=0)throw new u("Cannot divide with temperatures");if(this.numerator.join("*").indexOf("temp")>=0){if(this.numerator.length>1)throw new u("Cannot multiply by temperatures");if(!n(this.denominator,S))throw new u("Cannot divide with temperatures")}if(this.initValue=a,is.call(this),this.isTemperature()&&this.baseScalar<0)throw new u("Temperatures must not be less than absolute zero")}x.prototype={constructor:x};function rs(a,l){if(l){if(!(e(a)&&t(l)))throw new u("Only number accepted as initialization value when units are explicitly provided")}else if(!(t(a)||e(a)||Ft(a)||si(a)))throw new u("Only string, number or quantity accepted as single initialization value")}function si(a){return a&&typeof a=="object"&&a.hasOwnProperty("scalar")}function is(){if(this.baseScalar)return this.baseScalar;if(this.isBase())this.baseScalar=this.scalar,this.signature=$n.call(this);else{var a=this.toBase();this.baseScalar=a.scalar,this.signature=a.signature}}var vr={"-312078":"elastance","-312058":"resistance","-312038":"inductance","-152058":"potential","-152040":"magnetism","-152038":"magnetism","-7997":"specific_volume","-79":"snap","-59":"jolt","-39":"acceleration","-38":"radiation","-20":"frequency","-19":"speed","-18":"viscosity","-17":"volumetric_flow","-1":"wavenumber",0:"unitless",1:"length",2:"area",3:"volume",20:"time",400:"temperature",7941:"yank",7942:"power",7959:"pressure",7961:"force",7962:"energy",7979:"viscosity",7981:"momentum",7982:"angular_momentum",7997:"density",7998:"area_density",8e3:"mass",152020:"radiation_exposure",159999:"magnetism",16e4:"current",160020:"charge",312058:"conductance",312078:"capacitance",3199980:"activity",3199997:"molar_concentration",32e5:"substance",63999998:"illuminance",64e6:"luminous_power",128e7:"currency","25599999980":"information_rate","25600000000":"information","511999999980":"angular_velocity","512000000000":"angle"};function os(){return o(Object.keys(vr).map(function(a){return vr[a]}))}x.prototype.kind=function(){return vr[this.signature.toString()]},s(x.prototype,{isDegrees:function(){return(this.signature===null||this.signature===400)&&this.numerator.length===1&&n(this.denominator,S)&&(this.numerator[0].match(/<temp-[CFRK]>/)||this.numerator[0].match(/<(kelvin|celsius|rankine|fahrenheit)>/))},isTemperature:function(){return this.isDegrees()&&this.numerator[0].match(/<temp-[CFRK]>/)}});function as(a,l){var d=a.units(),f=l.to(d),p=x(_r(d));return x({scalar:a.scalar-f.scalar,numerator:p.numerator,denominator:p.denominator})}function ns(a,l){var d=l.to(_r(a.units()));return x({scalar:a.scalar-d.scalar,numerator:a.numerator,denominator:a.denominator})}function li(a,l){var d=l.to(_r(a.units()));return x({scalar:a.scalar+d.scalar,numerator:a.numerator,denominator:a.denominator})}function _r(a){if(a==="tempK")return"degK";if(a==="tempC")return"degC";if(a==="tempF")return"degF";if(a==="tempR")return"degR";throw new u("Unknown type for temp conversion from: "+a)}function ss(a,l){var d=ls(a),f=l.units(),p;if(f==="degK")p=d.scalar;else if(f==="degC")p=d.scalar;else if(f==="degF")p=d.scalar*9/5;else if(f==="degR")p=d.scalar*9/5;else throw new u("Unknown type for degree conversion to: "+f);return x({scalar:p,numerator:l.numerator,denominator:l.denominator})}function ls(a){var l=a.units(),d;if(l.match(/(deg)[CFRK]/))d=a.baseScalar;else if(l==="tempK")d=a.scalar;else if(l==="tempC")d=a.scalar;else if(l==="tempF")d=a.scalar*5/9;else if(l==="tempR")d=a.scalar*5/9;else throw new u("Unknown type for temp conversion from: "+l);return x({scalar:d,numerator:["<kelvin>"],denominator:S})}function ds(a,l){var d=l.units(),f;if(d==="tempK")f=a.baseScalar;else if(d==="tempC")f=a.baseScalar-273.15;else if(d==="tempF")f=a.baseScalar*9/5-459.67;else if(d==="tempR")f=a.baseScalar*9/5;else throw new u("Unknown type for temp conversion to: "+d);return x({scalar:f,numerator:l.numerator,denominator:l.denominator})}function cs(a){var l=a.units(),d;if(l.match(/(deg)[CFRK]/))d=a.baseScalar;else if(l==="tempK")d=a.scalar;else if(l==="tempC")d=a.scalar+273.15;else if(l==="tempF")d=(a.scalar+459.67)*5/9;else if(l==="tempR")d=a.scalar*5/9;else throw new u("Unknown type for temp conversion from: "+l);return x({scalar:d,numerator:["<temp-K>"],denominator:S})}s(x.prototype,{to:function(a){var l,d;if(a==null)return this;if(!t(a))return this.to(a.units());if(l=this._conversionCache[a],l)return l;if(d=x(a),d.units()===this.units())return this;if(!this.isCompatible(d))this.isInverse(d)?d=this.inverse().to(a):v(this.units(),d.units());else if(d.isTemperature())d=ds(this,d);else if(d.isDegrees())d=ss(this,d);else{var f=m(this.baseScalar,d.baseScalar);d=x({scalar:f,numerator:d.numerator,denominator:d.denominator})}return this._conversionCache[a]=d,d},toBase:function(){if(this.isBase())return this;if(this.isTemperature())return cs(this);var a=di[this.units()];return a||(a=ms(this.numerator,this.denominator),di[this.units()]=a),a.mul(this.scalar)},toFloat:function(){if(this.isUnitless())return this.scalar;throw new u("Can't convert to Float unless unitless. Use Unit#scalar")},toPrec:function(a){if(t(a)&&(a=x(a)),e(a)&&(a=x(a+" "+this.units())),this.isUnitless()?a.isUnitless()||v(this.units(),a.units()):a=a.to(this.units()),a.scalar===0)throw new u("Divide by zero");var l=c(Math.round(this.scalar/a.scalar),a.scalar);return x(l+this.units())}});function fs(a,l){var d=x(a),f=x(l);if(d.eq(f))return r;var p;return d.isTemperature()?p=function(h){return d.mul(h).to(f).scalar}:p=function(h){return h*d.baseScalar/f.baseScalar},function(O){var A,P,K;if(Array.isArray(O)){for(P=O.length,K=[],A=0;A<P;A++)K.push(p(O[A]));return K}else return p(O)}}var di={};function ms(a,l){for(var d=[],f=[],p=1,h,O=0;O<a.length;O++)h=a[O],N[h]?p=c(p,N[h]):F[h]&&(p*=F[h].scalar,F[h].numerator&&d.push(F[h].numerator),F[h].denominator&&f.push(F[h].denominator));for(var A=0;A<l.length;A++)h=l[A],N[h]?p/=N[h]:F[h]&&(p/=F[h].scalar,F[h].numerator&&f.push(F[h].numerator),F[h].denominator&&d.push(F[h].denominator));return d=d.reduce(function(P,K){return P.concat(K)},[]),f=f.reduce(function(P,K){return P.concat(K)},[]),x({scalar:p,numerator:d,denominator:f})}x.parse=ts,x.getUnits=jn,x.getAliases=zn,x.mulSafe=c,x.divSafe=m,x.getKinds=os,x.swiftConverter=fs,x.Error=u,s(x.prototype,{add:function(a){if(t(a)&&(a=x(a)),this.isCompatible(a)||v(this.units(),a.units()),this.isTemperature()&&a.isTemperature())throw new u("Cannot add two temperatures");return this.isTemperature()?li(this,a):a.isTemperature()?li(a,this):x({scalar:this.scalar+a.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},sub:function(a){if(t(a)&&(a=x(a)),this.isCompatible(a)||v(this.units(),a.units()),this.isTemperature()&&a.isTemperature())return as(this,a);if(this.isTemperature())return ns(this,a);if(a.isTemperature())throw new u("Cannot subtract a temperature from a differential degree unit");return x({scalar:this.scalar-a.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},mul:function(a){if(e(a))return x({scalar:c(this.scalar,a),numerator:this.numerator,denominator:this.denominator});if(t(a)&&(a=x(a)),(this.isTemperature()||a.isTemperature())&&!(this.isUnitless()||a.isUnitless()))throw new u("Cannot multiply by temperatures");var l=this,d=a;l.isCompatible(d)&&l.signature!==400&&(d=d.to(l));var f=ci(l.numerator,l.denominator,d.numerator,d.denominator);return x({scalar:c(l.scalar,d.scalar,f[2]),numerator:f[0],denominator:f[1]})},div:function(a){if(e(a)){if(a===0)throw new u("Divide by zero");return x({scalar:this.scalar/a,numerator:this.numerator,denominator:this.denominator})}else t(a)&&(a=x(a));if(a.scalar===0)throw new u("Divide by zero");if(a.isTemperature())throw new u("Cannot divide with temperatures");if(this.isTemperature()&&!a.isUnitless())throw new u("Cannot divide with temperatures");var l=this,d=a;l.isCompatible(d)&&l.signature!==400&&(d=d.to(l));var f=ci(l.numerator,l.denominator,d.denominator,d.numerator);return x({scalar:c(l.scalar,f[2])/d.scalar,numerator:f[0],denominator:f[1]})},inverse:function(){if(this.isTemperature())throw new u("Cannot divide with temperatures");if(this.scalar===0)throw new u("Divide by zero");return x({scalar:1/this.scalar,numerator:this.denominator,denominator:this.numerator})}});function ci(a,l,d,f){function p(te){return te!==E}a=a.filter(p),d=d.filter(p),l=l.filter(p),f=f.filter(p);var h={};function O(te,Oe){for(var re,Ot,Sr,Ie=0;Ie<te.length;Ie++)if(N[te[Ie]]?(re=te[Ie+1],Ot=te[Ie],Sr=N[Ot],Ie++):(re=te[Ie],Ot=null,Sr=1),re&&re!==E)if(h[re]){h[re][0]+=Oe;var gs=h[re][2]?N[h[re][2]]:1;h[re][Oe===1?3:4]*=m(Sr,gs)}else h[re]=[Oe,re,Ot,1,1]}O(a,1),O(l,-1),O(d,1),O(f,-1);var A=[],P=[],K=1;for(var ui in h)if(h.hasOwnProperty(ui)){var B=h[ui],je;if(B[0]>0)for(je=0;je<B[0];je++)A.push(B[2]===null?B[1]:[B[2],B[1]]);else if(B[0]<0)for(je=0;je<-B[0];je++)P.push(B[2]===null?B[1]:[B[2],B[1]]);K*=m(B[3],B[4])}return A.length===0&&(A=S),P.length===0&&(P=S),A=A.reduce(function(te,Oe){return te.concat(Oe)},[]),P=P.reduce(function(te,Oe){return te.concat(Oe)},[]),[A,P,K]}s(x.prototype,{eq:function(a){return this.compareTo(a)===0},lt:function(a){return this.compareTo(a)===-1},lte:function(a){return this.eq(a)||this.lt(a)},gt:function(a){return this.compareTo(a)===1},gte:function(a){return this.eq(a)||this.gt(a)},compareTo:function(a){if(t(a))return this.compareTo(x(a));if(this.isCompatible(a)||v(this.units(),a.units()),this.baseScalar<a.baseScalar)return-1;if(this.baseScalar===a.baseScalar)return 0;if(this.baseScalar>a.baseScalar)return 1},same:function(a){return this.scalar===a.scalar&&this.units()===a.units()}}),s(x.prototype,{isUnitless:function(){return[this.numerator,this.denominator].every(function(a){return n(a,S)})},isCompatible:function(a){return t(a)?this.isCompatible(x(a)):Ft(a)&&a.signature!==void 0?this.signature===a.signature:!1},isInverse:function(a){return this.inverse().isCompatible(a)},isBase:function(){return this._isBase!==void 0?this._isBase:this.isDegrees()&&this.numerator[0].match(/<(kelvin|temp-K)>/)?(this._isBase=!0,this._isBase):(this.numerator.concat(this.denominator).forEach(function(a){a!==E&&w.indexOf(a)===-1&&(this._isBase=!1)},this),this._isBase===!1?this._isBase:(this._isBase=!0,this._isBase))}});function yr(){}yr.prototype.get=function(a){return arguments.length>1&&(a=Array.apply(null,arguments)),a.reduce(function(l,d,f){if(l){var p=l[d];return f===a.length-1?p?p.data:void 0:p}},this)},yr.prototype.set=function(a,l){return arguments.length>2&&(a=Array.prototype.slice.call(arguments,0,-1),l=arguments[arguments.length-1]),a.reduce(function(d,f,p){var h=d[f];return h===void 0&&(h=d[f]={}),p===a.length-1?(h.data=l,l):h},this)};function us(a,l){return(a+" "+l).trim()}x.formatter=us,s(x.prototype,{units:function(){if(this._units!==void 0)return this._units;var a=n(this.numerator,S),l=n(this.denominator,S);if(a&&l)return this._units="",this._units;var d=mi(this.numerator),f=mi(this.denominator);return this._units=d+(l?"":"/"+f),this._units},toString:function(a,l){var d;if(e(a))d=this.units(),l=a;else if(t(a))d=a;else if(Ft(a))return this.toPrec(a).toString(l);var f=this.to(d),p=l!==void 0?b(f.scalar,l):f.scalar;return f=(p+" "+f.units()).trim(),f},format:function(a,l){arguments.length===1&&typeof a=="function"&&(l=a,a=void 0),l=l||x.formatter;var d=this.to(a);return l.call(this,d.scalar,d.units())}});var fi=new yr;function mi(a){var l=fi.get(a);if(l)return l;var d=n(a,S);return d?l="1":l=hs(ps(a)).join("*"),fi.set(a,l),l}function ps(a){for(var l=[],d,f,p=0;p<a.length;p++)d=a[p],f=a[p+1],N[d]?(l.push(Mt[d]+Mt[f]),p++):l.push(Mt[d]);return l}function hs(a){var l=a.reduce(function(d,f){var p=d[f];return p||d.push(p=d[f]=[f,0]),p[1]++,d},[]);return l.map(function(d){return d[0]+(d[1]>1?d[1]:"")})}return x.version="1.8.0",x})});var Ye=(()=>{class t{TIMEOUT_DURATION=1e4;serverServiceEndpoint$=new D({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new D(null);serverRoles=[];http=g(Ke);resetSignalK(e,r,o){return ie(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection reset called with null or empty URL value");return}let n={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(n);let s=this.signalKURL.url;s.endsWith("signalk/")||(s+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let c=yield de(this.http.get(s,{observe:"response"}).pipe(xi(this.TIMEOUT_DURATION),Nt(_=>(_.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),bi(_)))));console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(c.body.server.version);let m=c.body.endpoints.v1["signalk-http"],b=c.body.endpoints.v1["signalk-ws"];r?(console.debug("[Connection Service] Proxy Mode Enabled"),n.httpServiceUrl=window.location.origin+new URL(m).pathname,n.WsServiceUrl=(window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+new URL(b).pathname):(n.httpServiceUrl=m,n.WsServiceUrl=b),console.debug("[Connection Service] HTTP URI: "+n.httpServiceUrl),console.debug("[Connection Service] WebSocket URI: "+n.WsServiceUrl),n.operation=2,n.message=c.status.toString(),n.serverDescription=`${c.body.server.id} ${c.body.server.version}`}catch(c){n.operation=3,n.message=c.message,this.handleError(c)}finally{o?n.subscribeAll=!0:n.subscribeAll=!1,this.serverServiceEndpoint$.next(n)}})}handleError(e){let r=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(r),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,r,o){this.serverName=e,this.serverRoles=o,console.log(`[Connection Service] Server Name: ${e}, Version: ${r}, Roles: ${JSON.stringify(o)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(r){return new(r||t)};static \u0275prov=I({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var vs=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Or=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let i=t.match(vs);if(!i)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return i.shift(),i},io=t=>t==="*"||t==="x"||t==="X",oo=t=>{let i=parseInt(t,10);return isNaN(i)?t:i},_s=(t,i)=>typeof t!=typeof i?[String(t),String(i)]:[t,i],ys=(t,i)=>{if(io(t)||io(i))return 0;let[e,r]=_s(oo(t),oo(i));return e>r?1:e<r?-1:0},Ir=(t,i)=>{for(let e=0;e<Math.max(t.length,i.length);e++){let r=ys(t[e]||"0",i[e]||"0");if(r!==0)return r}return 0};var ao=(t,i)=>{let e=Or(t),r=Or(i),o=e.pop(),n=r.pop(),s=Ir(e,r);return s!==0?s:o&&n?Ir(o.split("."),n.split(".")):o||n?o?-1:1:0};var Rr=(t,i,e)=>{Ss(e);let r=ao(t,i);return so[e].includes(r)},so={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},no=Object.keys(so),Ss=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(no.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${no.join("|")}`)};var lo=(()=>{class t{server=g(Ye);http=g(Ke);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;storageServiceReady$=new T;patchQueue$=new T;patch=function(e){return this.http.post(e.url,e.document).pipe(Fi(r=>console.log("[Storage Service] Remote config patch request completed successfully")),Nt(r=>this.handleError(r)))};constructor(){let e=this.server;e.serverServiceEndpoint$.subscribe(r=>{r.httpServiceUrl!==null&&(this.serverEndpoint=r.httpServiceUrl.substring(0,r.httpServiceUrl.length-4)+"applicationData/",console.log("[Storage Service] Service startup. AppData API set to: "+this.serverEndpoint)),r.operation===2?this.storageServiceReady$.next(!0):this.storageServiceReady$.next(!1)}),e.serverVersion$.subscribe(r=>{r&&(this.isAppDataSupported=Rr(r,"1.27.0",">="))}),this.patchQueue$.pipe(wi(r=>this.patch(r))).subscribe(r=>{})}listConfigs(e){return ie(this,null,function*(){let r=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let o=this.serverEndpoint,n=o+"global/kip/"+this.configFileVersion+"/?keys=true",s=o+"user/kip/"+this.configFileVersion+"/?keys=true";return e&&(n=o+"global/kip/"+e+"/?keys=true",s=o+"user/kip/"+e+"/?keys=true"),yield de(this.http.get(n)).then(c=>{for(let m of c)r.push({scope:"global",name:m});console.log("[Storage Service] Retrieved Global config list")}).catch(c=>{this.handleError(c)}),yield de(this.http.get(s)).then(c=>{for(let m of c)r.push({scope:"user",name:m});console.log("[Storage Service] Retrieved User config list")}).catch(c=>{this.handleError(c)}),r})}getConfig(e,r,o,n){return ie(this,null,function*(){let s=null,c=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+r;return o&&(c=this.serverEndpoint+e+"/kip/"+o+"/"+r),yield de(this.http.get(c)).then(m=>{s=m,console.log(`[Storage Service] Retrieved config [${r}] from [${e}] scope`),n&&(this.InitConfig=m)}).catch(m=>{this.handleError(m)}),s})}setConfig(e,r,o,n){return ie(this,null,function*(){let s=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+r,c;return n&&(s=this.serverEndpoint+e+"/kip/"+n+"/"+r),yield de(this.http.post(s,o)).then(m=>{console.log(`[Storage Service] Saved config [${r}] to [${e}] scope`),c=m}).catch(m=>{this.handleError(m)}),c})}patchConfig(e,r,o){let n=this.serverEndpoint+"user/kip/"+this.configFileVersion,s;switch(o&&(n=this.serverEndpoint+"user/kip/"+o),e){case"IAppConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:r}];break;case"IThemeConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:r.themeName}];break;case"IWidgetConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:r}];break;case"ILayoutConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:r}];break;case"Dashboards":s=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:r}];break;case"Array<IUnitDefaults>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:r}];break;case"Array<IDatasetDef>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:r}];break;case"INotificationConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:r}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let c={url:n,document:s};this.patchQueue$.next(c)}patchGlobal(e,r,o,n,s){let c=this.serverEndpoint+r+"/kip/"+this.configFileVersion;s&&(c=this.serverEndpoint+r+"/kip/"+s);let m;switch(n){case"add":m=[{op:"add",path:`/${e}`,value:o}];break;case"replace":m=[{op:"replace",path:`/${e}`,value:o}];break;case"remove":m=[{op:"remove",path:`/${e}`,value:o}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let b={url:c,document:m};this.patchQueue$.next(b)}removeItem(e,r,o){let n=this.serverEndpoint+e+"/kip/"+this.configFileVersion;o&&(n=this.serverEndpoint+e+"/kip/"+o);let s=[{op:"remove",path:`/${r}`}],c={url:n,document:s};this.patchQueue$.next(c)}clear(){}set activeConfigFileVersion(e){this.configFileVersion=e}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(r){return new(r||t)};static \u0275prov=I({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Te=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){let e=Math.random()*16|0;return(i=="x"?e:e&3|8).toString(16)})}};var St={disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}};var Ut={Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"};var co={configVersion:11,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,dataSets:[],unitDefaults:Ut,notificationConfig:St},fo={themeName:""};var mo={configVersion:11,kipUUID:Te.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Nr={configVersion:11,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,dataSets:[{uuid:"afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",path:"self.environment.wind.speedApparent",pathSource:"default",period:1,baseUnit:"m/s",label:"self.environment.wind.speedApparent, Source: default, Scale: minute, Period: 1",timeScaleFormat:"minute"}],unitDefaults:{Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"},notificationConfig:{disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}}},Ur=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",configuration:[{w:3,h:4,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,numInt:1,color:"yellow",enableTimeout:!1,dataTimeout:5}}},x:0,y:0},{w:5,h:10,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-wind-steer",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},courseOverGround:{description:"Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:3,y:0},{w:4,h:6,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-gauge-ng-radial",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,compassUseNumbers:!1},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5}}},x:8,y:0},{w:3,h:4,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,numInt:1,color:"contrast",enableTimeout:!1,dataTimeout:5}}},x:0,y:4},{w:4,h:6,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-data-chart",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,convertUnitTo:"knots",datasetUUID:"afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",invertData:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalGraph:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"green"}}},x:8,y:6},{w:3,h:4,id:"05414722-733a-4483-89b0-07f3945ffd97",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"05414722-733a-4483-89b0-07f3945ffd97",config:{displayName:"Engine Room",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.inside.engineRoom.temperature",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"celsius",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,numInt:1,color:"blue",enableTimeout:!1,dataTimeout:5}}},x:0,y:8},{w:5,h:2,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-simple-linear",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.0.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,color:"green",enableTimeout:!1,dataTimeout:5}}},x:3,y:10}]},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",configuration:[{x:0,y:0,w:8,h:12,id:"488d620a-37d4-4b98-849d-304cd18003e9",selector:"widget-freeboardsk",input:{widgetProperties:{type:"widget-freeboardsk",uuid:"488d620a-37d4-4b98-849d-304cd18003e9"}}},{x:8,y:0,w:2,h:3,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-gauge-ng-compass",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",isConvertUnitToConfigurable:!1,convertUnitTo:"deg",sampleTime:500}},gauge:{type:"ngRadial",subType:"marineCompass",enableTicks:!0,compassUseNumbers:!0,showValueBox:!1},enableTimeout:!1,color:"purple",dataTimeout:5}}}},{x:10,y:0,w:2,h:3,id:"caf9ca47-fcf6-4736-a314-2b5210edaf03",selector:"widget-datetime",input:{widgetProperties:{type:"widget-datetime",uuid:"caf9ca47-fcf6-4736-a314-2b5210edaf03",config:{displayName:"Next WP Arrival",filt