@mxtommy/kip 3.10.0-beta.34 → 3.10.0-beta.35
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/package.json +1 -1
- package/plugin/index.js +3 -1
- package/public/3rdpartylicenses.txt +26 -26
- package/public/assets/svg/icons.svg +5 -1
- package/public/chunk-27I36ZYA.js +2 -0
- package/public/{chunk-DW3FZIIP.js → chunk-2ATGKBWP.js} +1 -1
- package/public/chunk-2YGPLTEW.js +6 -0
- package/public/chunk-4MSEQKGR.js +2 -0
- package/public/chunk-5UBH6OWU.js +5 -0
- package/public/chunk-5W42HKGA.js +1 -0
- package/public/chunk-ARVJVELO.js +1 -0
- package/public/chunk-EKP64XG5.js +2 -0
- package/public/chunk-FXJ4AF7G.js +1 -0
- package/public/chunk-HO743WL4.js +3 -0
- package/public/{chunk-RSFIBBDU.js → chunk-I772OX6I.js} +1 -1
- package/public/chunk-IUCJGG6N.js +1 -0
- package/public/chunk-JNQX4WPI.js +1 -0
- package/public/chunk-JNXVWBL2.js +1 -0
- package/public/chunk-LKF7CNOE.js +2 -0
- package/public/{chunk-EWWJTY5U.js → chunk-MZURT7UO.js} +1 -1
- package/public/chunk-PB7HT3XU.js +15 -0
- package/public/chunk-PR5DAT3I.js +2 -0
- package/public/{chunk-QFA6EGZZ.js → chunk-QG3TFUUS.js} +1 -1
- package/public/{chunk-UMX5S3AL.js → chunk-QXMATZB6.js} +1 -1
- package/public/chunk-SD3MSKSI.js +9 -0
- package/public/chunk-SPUZNRYQ.js +5 -0
- package/public/chunk-TFULQA7J.js +3 -0
- package/public/{chunk-PBYG5L2Q.js → chunk-USU5F3L5.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-BAIQ3IBV.js → main-3DWTWTVZ.js} +12 -14
- package/COPILOT.md +0 -362
- package/eslint.config.js +0 -45
- package/kip-plugin/README.md +0 -64
- package/kip-plugin/src/index.ts +0 -244
- package/kip-plugin/src/openApi.json +0 -141
- package/kip-plugin/tsconfig.plugin.json +0 -13
- package/public/chunk-7FXC6ZCG.js +0 -5
- package/public/chunk-H2UHZISE.js +0 -1
- package/public/chunk-HWRYGZHY.js +0 -11
- package/public/chunk-JBNATG4K.js +0 -1
- package/public/chunk-KSORZFLR.js +0 -7
- package/public/chunk-LA7JUGVG.js +0 -2
- package/public/chunk-QHWRRGKT.js +0 -2
- package/public/chunk-QKZFW37P.js +0 -1
- package/public/chunk-YN2WYPNC.js +0 -16
- package/public/chunk-ZFPSXMA5.js +0 -1
- package/public/chunk-ZZOEEKZS.js +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as mi,d as di,e as ui}from"./chunk-LKF7CNOE.js";import{C as oi,D as li,E as ci,g as Jt,y as ai,z as si}from"./chunk-SPUZNRYQ.js";import{B as ni,j as Kt,n as ti,p as ii,u as ri}from"./chunk-4MSEQKGR.js";import{i as it,q as rt,r as nt,s as ei}from"./chunk-27I36ZYA.js";import{Ab as L,Bb as q,Bd as jt,Cd as Ze,E as be,Ed as Yt,F as Be,Fa as x,Fb as Lt,Gd as de,Hb as V,Ia as Rt,Jb as qt,K as Ot,Kb as se,Lb as Qe,Mb as Xe,Nd as Qt,Oa as B,Pa as ke,Td as et,Ua as Ft,Ud as Xt,V as We,W as Ge,Wa as re,Wb as Ut,Wd as tt,X as ee,Xb as xe,ab as W,bb as G,ca as Tt,cb as j,d as tr,da as we,e as ir,ea as H,fe as $t,ga as f,ge as Zt,hb as Y,ib as D,ic as Vt,j as Z,ja as te,jb as R,ka as ie,kb as ne,la as Et,lb as Pt,mb as Nt,na as je,nd as Ht,oc as De,od as Bt,qa as At,qc as I,ra as Ce,rb as Ye,rc as $e,sb as Je,tb as J,ua as It,vb as F,vd as Wt,w as He,wa as Me,wb as Q,xb as P,xd as me,yb as Se,yc as zt,yd as oe,z as Dt,zb as ae,zd as Gt}from"./chunk-PB7HT3XU.js";var pi=tr((at,st)=>{(function(o,y){typeof at=="object"&&typeof st<"u"?st.exports=y():typeof define=="function"&&define.amd?define(y):(o=typeof globalThis<"u"?globalThis:o||self,o.Qty=y())})(at,function(){"use strict";function o(t){return typeof t=="string"||t instanceof String}var y=Number.isFinite||window.isFinite;function e(t){return y(t)}function r(t){return t}function a(t){var i={};return t.filter(function(n){return i.hasOwnProperty(n)?!1:i[n]=!0})}function l(t,i){if(i.length!==t.length)return!1;for(var n=0;n<t.length;n++)if(i[n].compareArray&&!i[n].compareArray(t[n])||i[n]!==t[n])return!1;return!0}function u(t,i){Object.keys(i).forEach(function(n){t[n]=i[n]})}function g(){for(var t=1,i=0,n=0;n<arguments.length;n++){var s=arguments[n];i=i+mt(s),t*=s}return i!==0?he(t,i):t}function v(t,i){if(i===0)throw new Error("Divide by zero");var n=Math.pow(10,mt(i)),s=n/(n*i);return g(t,s)}function he(t,i){return Math.round(t*Math.pow(10,i))/Math.pow(10,i)}function mt(t){if(!isFinite(t))return 0;for(var i=0;t%1!==0;)t*=10,i++;return i}function h(){var t;if(!this)return t=Object.create(h.prototype),h.apply(t,arguments),t;t=Error.apply(this,arguments),this.name="QtyError",this.message=t.message,this.stack=t.stack}h.prototype=Object.create(Error.prototype,{constructor:{value:h}});function ce(t,i){throw new h("Incompatible units: "+t+" and "+i)}var O={"<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>"]]},wi=["<meter>","<kilogram>","<second>","<mole>","<ampere>","<radian>","<kelvin>","<temp-K>","<byte>","<dollar>","<candela>","<each>","<steradian>","<decibel>"],fe="<1>",C=[fe];function Ci(t,i){var n=i[1],s=i[3]||[],c=i[4]||[];if(!e(n))throw new h(t+": Invalid unit definition. 'scalar' must be a number");s.forEach(function(m){if(O[m]===void 0)throw new h(t+": Invalid unit definition. Unit "+m+" in 'numerator' is not recognized")}),c.forEach(function(m){if(O[m]===void 0)throw new h(t+": Invalid unit definition. Unit "+m+" in 'denominator' is not recognized")})}var N={},ge={},k={},X={},ye={};for(var U in O)if(O.hasOwnProperty(U)){var T=O[U];if(T[2]==="prefix"){N[U]=T[1];for(var Fe=0;Fe<T[0].length;Fe++)ge[T[0][Fe]]=U}else{Ci(U,T),k[U]={scalar:T[1],numerator:T[3],denominator:T[4]};for(var Pe=0;Pe<T[0].length;Pe++)X[T[0][Pe]]=U}ye[U]=T[0][0]}function Mi(t){var i,n=[],s=Object.keys(O);if(typeof t>"u")for(i=0;i<s.length;i++)["","prefix"].indexOf(O[s[i]][2])===-1&&n.push(s[i].substr(1,s[i].length-2));else{if(this.getKinds().indexOf(t)===-1)throw new h("Kind not recognized");for(i=0;i<s.length;i++)O[s[i]][2]===t&&n.push(s[i].substr(1,s[i].length-2))}return n.sort(function(c,m){return c.toLowerCase()<m.toLowerCase()?-1:c.toLowerCase()>m.toLowerCase()?1:0})}function ki(t){if(!X[t])throw new h("Unit not recognized");return O[X[t]][0]}var Ne=["length","time","temperature","mass","current","substance","luminosity","currency","information","angle"];function Si(){if(this.signature)return this.signature;for(var t=dt.call(this),i=0;i<t.length;i++)t[i]*=Math.pow(20,i);return t.reduce(function(n,s){return n+s},0)}function dt(){if(!this.isBase())return dt.call(this.toBase());for(var t=new Array(Ne.length),i=0;i<t.length;i++)t[i]=0;for(var n,s,c=0;c<this.numerator.length;c++)(n=O[this.numerator[c]])&&(s=Ne.indexOf(n[2]),s>=0&&(t[s]=t[s]+1));for(var m=0;m<this.denominator.length;m++)(n=O[this.denominator[m]])&&(s=Ne.indexOf(n[2]),s>=0&&(t[s]=t[s]-1));return t}var ut="[+-]",Le="\\d+",xi=ut+"?"+Le,pt="\\."+Le,Di="(?:"+Le+"(?:"+pt+")?)|(?:"+pt+")",Oi="[Ee]"+xi,Ti="(?:"+Di+")(?:"+Oi+")?",Ei=ut+"?\\s*"+Ti,Ai="("+Ei+")?\\s*([^/]*)(?:/(.+))?",Ii=new RegExp("^"+Ai+"$"),ht="\\^|\\*{2}",ft="[01234]",Ri=new RegExp("([^ \\*\\d]+?)(?:"+ht+")?(-?"+ft+"(?![a-zA-Z]))"),Fi=new RegExp("([^ \\*\\d]+?)(?:"+ht+")?("+ft+"(?![a-zA-Z]))");function gt(t){o(t)||(t=t.toString()),t=t.trim();var i=Ii.exec(t);if(!i)throw new h(t+": Quantity not recognized");var n=i[1];n?(n=n.replace(/\s/g,""),this.scalar=parseFloat(n)):this.scalar=1;for(var s=i[2],c=i[3],m,b,_;i=Ri.exec(s);){if(m=parseFloat(i[2]),isNaN(m))throw new h("Unit exponent is not a number");if(m===0&&!qe.test(i[1]))throw new h("Unit not recognized");b=i[1]+" ",_="";for(var w=0;w<Math.abs(m);w++)_+=b;m>=0?s=s.replace(i[0],_):(c=c?c+_:_,s=s.replace(i[0],""))}for(;i=Fi.exec(c);){if(m=parseFloat(i[2]),isNaN(m))throw new h("Unit exponent is not a number");if(m===0&&!qe.test(i[1]))throw new h("Unit not recognized");b=i[1]+" ",_="";for(var S=0;S<m;S++)_+=b;c=c.replace(i[0],_)}s&&(this.numerator=vt(s.trim())),c&&(this.denominator=vt(c.trim()))}var Pi=Object.keys(ge).sort(function(t,i){return i.length-t.length}).join("|"),Ni=Object.keys(X).sort(function(t,i){return i.length-t.length}).join("|"),Li="\\b|$",yt="("+Pi+")??("+Ni+")(?:"+Li+")",qe=new RegExp("^\\s*("+yt+"[\\s\\*]*)+$"),qi=new RegExp(yt,"g"),_t={};function vt(t){var i=_t[t];if(i)return i;var n,s=[];if(!qe.test(t))throw new h("Unit not recognized");for(;n=qi.exec(t);)s.push(n.slice(1));return s=s.map(function(c){return ge[c[0]]?[ge[c[0]],X[c[1]]]:[X[c[1]]]}),s=s.reduce(function(c,m){return c.concat(m)},[]),s=s.filter(function(c){return c}),_t[t]=s,s}function Ui(t){if(!o(t))throw new h("Argument should be a string");try{return this(t)}catch{return null}}function _e(t){return t instanceof d}function d(t,i){if(Vi.apply(null,arguments),!_e(this))return new d(t,i);if(this.scalar=null,this.baseScalar=null,this.signature=null,this._conversionCache={},this.numerator=C,this.denominator=C,bt(t)?(this.scalar=t.scalar,this.numerator=t.numerator&&t.numerator.length!==0?t.numerator:C,this.denominator=t.denominator&&t.denominator.length!==0?t.denominator:C):i?(gt.call(this,i),this.scalar=t):gt.call(this,t),this.denominator.join("*").indexOf("temp")>=0)throw new h("Cannot divide with temperatures");if(this.numerator.join("*").indexOf("temp")>=0){if(this.numerator.length>1)throw new h("Cannot multiply by temperatures");if(!l(this.denominator,C))throw new h("Cannot divide with temperatures")}if(this.initValue=t,zi.call(this),this.isTemperature()&&this.baseScalar<0)throw new h("Temperatures must not be less than absolute zero")}d.prototype={constructor:d};function Vi(t,i){if(i){if(!(e(t)&&o(i)))throw new h("Only number accepted as initialization value when units are explicitly provided")}else if(!(o(t)||e(t)||_e(t)||bt(t)))throw new h("Only string, number or quantity accepted as single initialization value")}function bt(t){return t&&typeof t=="object"&&t.hasOwnProperty("scalar")}function zi(){if(this.baseScalar)return this.baseScalar;if(this.isBase())this.baseScalar=this.scalar,this.signature=Si.call(this);else{var t=this.toBase();this.baseScalar=t.scalar,this.signature=t.signature}}var Ue={"-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 Ki(){return a(Object.keys(Ue).map(function(t){return Ue[t]}))}d.prototype.kind=function(){return Ue[this.signature.toString()]},u(d.prototype,{isDegrees:function(){return(this.signature===null||this.signature===400)&&this.numerator.length===1&&l(this.denominator,C)&&(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 Hi(t,i){var n=t.units(),s=i.to(n),c=d(Ve(n));return d({scalar:t.scalar-s.scalar,numerator:c.numerator,denominator:c.denominator})}function Bi(t,i){var n=i.to(Ve(t.units()));return d({scalar:t.scalar-n.scalar,numerator:t.numerator,denominator:t.denominator})}function wt(t,i){var n=i.to(Ve(t.units()));return d({scalar:t.scalar+n.scalar,numerator:t.numerator,denominator:t.denominator})}function Ve(t){if(t==="tempK")return"degK";if(t==="tempC")return"degC";if(t==="tempF")return"degF";if(t==="tempR")return"degR";throw new h("Unknown type for temp conversion from: "+t)}function Wi(t,i){var n=Gi(t),s=i.units(),c;if(s==="degK")c=n.scalar;else if(s==="degC")c=n.scalar;else if(s==="degF")c=n.scalar*9/5;else if(s==="degR")c=n.scalar*9/5;else throw new h("Unknown type for degree conversion to: "+s);return d({scalar:c,numerator:i.numerator,denominator:i.denominator})}function Gi(t){var i=t.units(),n;if(i.match(/(deg)[CFRK]/))n=t.baseScalar;else if(i==="tempK")n=t.scalar;else if(i==="tempC")n=t.scalar;else if(i==="tempF")n=t.scalar*5/9;else if(i==="tempR")n=t.scalar*5/9;else throw new h("Unknown type for temp conversion from: "+i);return d({scalar:n,numerator:["<kelvin>"],denominator:C})}function ji(t,i){var n=i.units(),s;if(n==="tempK")s=t.baseScalar;else if(n==="tempC")s=t.baseScalar-273.15;else if(n==="tempF")s=t.baseScalar*9/5-459.67;else if(n==="tempR")s=t.baseScalar*9/5;else throw new h("Unknown type for temp conversion to: "+n);return d({scalar:s,numerator:i.numerator,denominator:i.denominator})}function Yi(t){var i=t.units(),n;if(i.match(/(deg)[CFRK]/))n=t.baseScalar;else if(i==="tempK")n=t.scalar;else if(i==="tempC")n=t.scalar+273.15;else if(i==="tempF")n=(t.scalar+459.67)*5/9;else if(i==="tempR")n=t.scalar*5/9;else throw new h("Unknown type for temp conversion from: "+i);return d({scalar:n,numerator:["<temp-K>"],denominator:C})}u(d.prototype,{to:function(t){var i,n;if(t==null)return this;if(!o(t))return this.to(t.units());if(i=this._conversionCache[t],i)return i;if(n=d(t),n.units()===this.units())return this;if(!this.isCompatible(n))this.isInverse(n)?n=this.inverse().to(t):ce(this.units(),n.units());else if(n.isTemperature())n=ji(this,n);else if(n.isDegrees())n=Wi(this,n);else{var s=v(this.baseScalar,n.baseScalar);n=d({scalar:s,numerator:n.numerator,denominator:n.denominator})}return this._conversionCache[t]=n,n},toBase:function(){if(this.isBase())return this;if(this.isTemperature())return Yi(this);var t=Ct[this.units()];return t||(t=Qi(this.numerator,this.denominator),Ct[this.units()]=t),t.mul(this.scalar)},toFloat:function(){if(this.isUnitless())return this.scalar;throw new h("Can't convert to Float unless unitless. Use Unit#scalar")},toPrec:function(t){if(o(t)&&(t=d(t)),e(t)&&(t=d(t+" "+this.units())),this.isUnitless()?t.isUnitless()||ce(this.units(),t.units()):t=t.to(this.units()),t.scalar===0)throw new h("Divide by zero");var i=g(Math.round(this.scalar/t.scalar),t.scalar);return d(i+this.units())}});function Ji(t,i){var n=d(t),s=d(i);if(n.eq(s))return r;var c;return n.isTemperature()?c=function(m){return n.mul(m).to(s).scalar}:c=function(m){return m*n.baseScalar/s.baseScalar},function(b){var _,w,S;if(Array.isArray(b)){for(w=b.length,S=[],_=0;_<w;_++)S.push(c(b[_]));return S}else return c(b)}}var Ct={};function Qi(t,i){for(var n=[],s=[],c=1,m,b=0;b<t.length;b++)m=t[b],N[m]?c=g(c,N[m]):k[m]&&(c*=k[m].scalar,k[m].numerator&&n.push(k[m].numerator),k[m].denominator&&s.push(k[m].denominator));for(var _=0;_<i.length;_++)m=i[_],N[m]?c/=N[m]:k[m]&&(c/=k[m].scalar,k[m].numerator&&s.push(k[m].numerator),k[m].denominator&&n.push(k[m].denominator));return n=n.reduce(function(w,S){return w.concat(S)},[]),s=s.reduce(function(w,S){return w.concat(S)},[]),d({scalar:c,numerator:n,denominator:s})}d.parse=Ui,d.getUnits=Mi,d.getAliases=ki,d.mulSafe=g,d.divSafe=v,d.getKinds=Ki,d.swiftConverter=Ji,d.Error=h,u(d.prototype,{add:function(t){if(o(t)&&(t=d(t)),this.isCompatible(t)||ce(this.units(),t.units()),this.isTemperature()&&t.isTemperature())throw new h("Cannot add two temperatures");return this.isTemperature()?wt(this,t):t.isTemperature()?wt(t,this):d({scalar:this.scalar+t.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},sub:function(t){if(o(t)&&(t=d(t)),this.isCompatible(t)||ce(this.units(),t.units()),this.isTemperature()&&t.isTemperature())return Hi(this,t);if(this.isTemperature())return Bi(this,t);if(t.isTemperature())throw new h("Cannot subtract a temperature from a differential degree unit");return d({scalar:this.scalar-t.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},mul:function(t){if(e(t))return d({scalar:g(this.scalar,t),numerator:this.numerator,denominator:this.denominator});if(o(t)&&(t=d(t)),(this.isTemperature()||t.isTemperature())&&!(this.isUnitless()||t.isUnitless()))throw new h("Cannot multiply by temperatures");var i=this,n=t;i.isCompatible(n)&&i.signature!==400&&(n=n.to(i));var s=Mt(i.numerator,i.denominator,n.numerator,n.denominator);return d({scalar:g(i.scalar,n.scalar,s[2]),numerator:s[0],denominator:s[1]})},div:function(t){if(e(t)){if(t===0)throw new h("Divide by zero");return d({scalar:this.scalar/t,numerator:this.numerator,denominator:this.denominator})}else o(t)&&(t=d(t));if(t.scalar===0)throw new h("Divide by zero");if(t.isTemperature())throw new h("Cannot divide with temperatures");if(this.isTemperature()&&!t.isUnitless())throw new h("Cannot divide with temperatures");var i=this,n=t;i.isCompatible(n)&&i.signature!==400&&(n=n.to(i));var s=Mt(i.numerator,i.denominator,n.denominator,n.numerator);return d({scalar:g(i.scalar,s[2])/n.scalar,numerator:s[0],denominator:s[1]})},inverse:function(){if(this.isTemperature())throw new h("Cannot divide with temperatures");if(this.scalar===0)throw new h("Divide by zero");return d({scalar:1/this.scalar,numerator:this.denominator,denominator:this.numerator})}});function Mt(t,i,n,s){function c(E){return E!==fe}t=t.filter(c),n=n.filter(c),i=i.filter(c),s=s.filter(c);var m={};function b(E,z){for(var A,ve,Ke,K=0;K<E.length;K++)if(N[E[K]]?(A=E[K+1],ve=E[K],Ke=N[ve],K++):(A=E[K],ve=null,Ke=1),A&&A!==fe)if(m[A]){m[A][0]+=z;var er=m[A][2]?N[m[A][2]]:1;m[A][z===1?3:4]*=v(Ke,er)}else m[A]=[z,A,ve,1,1]}b(t,1),b(i,-1),b(n,1),b(s,-1);var _=[],w=[],S=1;for(var xt in m)if(m.hasOwnProperty(xt)){var M=m[xt],$;if(M[0]>0)for($=0;$<M[0];$++)_.push(M[2]===null?M[1]:[M[2],M[1]]);else if(M[0]<0)for($=0;$<-M[0];$++)w.push(M[2]===null?M[1]:[M[2],M[1]]);S*=v(M[3],M[4])}return _.length===0&&(_=C),w.length===0&&(w=C),_=_.reduce(function(E,z){return E.concat(z)},[]),w=w.reduce(function(E,z){return E.concat(z)},[]),[_,w,S]}u(d.prototype,{eq:function(t){return this.compareTo(t)===0},lt:function(t){return this.compareTo(t)===-1},lte:function(t){return this.eq(t)||this.lt(t)},gt:function(t){return this.compareTo(t)===1},gte:function(t){return this.eq(t)||this.gt(t)},compareTo:function(t){if(o(t))return this.compareTo(d(t));if(this.isCompatible(t)||ce(this.units(),t.units()),this.baseScalar<t.baseScalar)return-1;if(this.baseScalar===t.baseScalar)return 0;if(this.baseScalar>t.baseScalar)return 1},same:function(t){return this.scalar===t.scalar&&this.units()===t.units()}}),u(d.prototype,{isUnitless:function(){return[this.numerator,this.denominator].every(function(t){return l(t,C)})},isCompatible:function(t){return o(t)?this.isCompatible(d(t)):_e(t)&&t.signature!==void 0?this.signature===t.signature:!1},isInverse:function(t){return this.inverse().isCompatible(t)},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(t){t!==fe&&wi.indexOf(t)===-1&&(this._isBase=!1)},this),this._isBase===!1?this._isBase:(this._isBase=!0,this._isBase))}});function ze(){}ze.prototype.get=function(t){return arguments.length>1&&(t=Array.apply(null,arguments)),t.reduce(function(i,n,s){if(i){var c=i[n];return s===t.length-1?c?c.data:void 0:c}},this)},ze.prototype.set=function(t,i){return arguments.length>2&&(t=Array.prototype.slice.call(arguments,0,-1),i=arguments[arguments.length-1]),t.reduce(function(n,s,c){var m=n[s];return m===void 0&&(m=n[s]={}),c===t.length-1?(m.data=i,i):m},this)};function Xi(t,i){return(t+" "+i).trim()}d.formatter=Xi,u(d.prototype,{units:function(){if(this._units!==void 0)return this._units;var t=l(this.numerator,C),i=l(this.denominator,C);if(t&&i)return this._units="",this._units;var n=St(this.numerator),s=St(this.denominator);return this._units=n+(i?"":"/"+s),this._units},toString:function(t,i){var n;if(e(t))n=this.units(),i=t;else if(o(t))n=t;else if(_e(t))return this.toPrec(t).toString(i);var s=this.to(n),c=i!==void 0?he(s.scalar,i):s.scalar;return s=(c+" "+s.units()).trim(),s},format:function(t,i){arguments.length===1&&typeof t=="function"&&(i=t,t=void 0),i=i||d.formatter;var n=this.to(t);return i.call(this,n.scalar,n.units())}});var kt=new ze;function St(t){var i=kt.get(t);if(i)return i;var n=l(t,C);return n?i="1":i=Zi($i(t)).join("*"),kt.set(t,i),i}function $i(t){for(var i=[],n,s,c=0;c<t.length;c++)n=t[c],s=t[c+1],N[n]?(i.push(ye[n]+ye[s]),c++):i.push(ye[n]);return i}function Zi(t){var i=t.reduce(function(n,s){var c=n[s];return c||n.push(c=n[s]=[s,0]),c[1]++,n},[]);return i.map(function(n){return n[0]+(n[1]>1?n[1]:"")})}return d.version="1.8.0",d})});var p=ir(pi());var Ir=(()=>{class o{AppSettingsService=f(Kt);data=f(Jt);_defaultUnitsSub;_conversionList=[{group:"Unitless",units:[{measure:"unitless",description:"As-Is numeric value"},{measure:" ",description:"No unit label - As-Is numeric value"}]},{group:"Speed",units:[{measure:"knots",description:"Knots - Nautical miles per hour"},{measure:"kph",description:"kph - Kilometers per hour"},{measure:"mph",description:"mph - Miles per hour"},{measure:"m/s",description:"m/s - Meters per second (base)"}]},{group:"Flow",units:[{measure:"m3/s",description:"Cubic meters per second (base)"},{measure:"l/min",description:"Liters per minute"},{measure:"l/h",description:"Liters per hour"},{measure:"g/min",description:"Gallons per minute"},{measure:"g/h",description:"Gallons per hour"}]},{group:"Fuel Distance",units:[{measure:"m/m3",description:"Meters per cubic meter (base)"},{measure:"nm/l",description:"Nautical Miles per liter"},{measure:"nm/g",description:"Nautical Miles per gallon"},{measure:"km/l",description:"Kilometers per liter"},{measure:"mpg",description:"Miles per Gallon"}]},{group:"Energy Distance",units:[{measure:"m/J",description:"Meters per Joule (base)"},{measure:"nm/J",description:"Nautical Miles per Joule"},{measure:"km/J",description:"Kilometers per Joule"},{measure:"nm/kWh",description:"Nautical Miles per Kilowatt-hour"},{measure:"km/kWh",description:"Kilometers per Kilowatt-hour"}]},{group:"Temperature",units:[{measure:"K",description:"Kelvin (base)"},{measure:"celsius",description:"Celsius"},{measure:"fahrenheit",description:"Fahrenheit"}]},{group:"Length",units:[{measure:"m",description:"Meters (base)"},{measure:"mm",description:"Millimeters"},{measure:"fathom",description:"Fathoms"},{measure:"nm",description:"Nautical Miles"},{measure:"km",description:"Kilometers"},{measure:"mi",description:"Miles"},{measure:"feet",description:"Feet"},{measure:"inch",description:"Inches"}]},{group:"Volume",units:[{measure:"liter",description:"Liters (base)"},{measure:"m3",description:"Cubic Meters"},{measure:"gallon",description:"Gallons"}]},{group:"Current",units:[{measure:"A",description:"Amperes (base)"},{measure:"mA",description:"Milliamperes"}]},{group:"Potential",units:[{measure:"V",description:"Volts (base)"},{measure:"mV",description:"Millivolts"}]},{group:"Charge",units:[{measure:"C",description:"Coulomb (base)"},{measure:"Ah",description:"Ampere*Hours"}]},{group:"Power",units:[{measure:"W",description:"Watts (base)"},{measure:"mW",description:"Milliwatts"}]},{group:"Energy",units:[{measure:"J",description:"Joules (base)"},{measure:"kWh",description:"Kilowatt*Hours"}]},{group:"Resistance",units:[{measure:"ohm",description:"\u2126 (base)"},{measure:"kiloohm",description:"k\u2126"}]},{group:"Pressure",units:[{measure:"Pa",description:"Pa (base)"},{measure:"kPa",description:"kPa"},{measure:"hPa",description:"hPa"},{measure:"mbar",description:"mbar"},{measure:"bar",description:"Bars"},{measure:"psi",description:"psi"},{measure:"mmHg",description:"mmHg"},{measure:"inHg",description:"inHg"}]},{group:"Density",units:[{measure:"kg/m3",description:"Air density - kg/cubic meter (base)"}]},{group:"Time",units:[{measure:"s",description:"Seconds (base)"},{measure:"Minutes",description:"Minutes"},{measure:"Hours",description:"Hours"},{measure:"Days",description:"Days"},{measure:"D HH:MM:SS",description:"Day Hour:Minute:sec"}]},{group:"Angular Velocity",units:[{measure:"rad/s",description:"Radians per second (base)"},{measure:"deg/s",description:"Degrees per second"},{measure:"deg/min",description:"Degrees per minute"}]},{group:"Angle",units:[{measure:"rad",description:"Radians (base)"},{measure:"deg",description:"Degrees"},{measure:"grad",description:"Gradians"}]},{group:"Frequency",units:[{measure:"rpm",description:"RPM - Rotations per minute"},{measure:"Hz",description:"Hz - Hertz (base)"},{measure:"KHz",description:"KHz - Kilohertz"},{measure:"MHz",description:"MHz - Megahertz"},{measure:"GHz",description:"GHz - Gigahertz"}]},{group:"Ratio",units:[{measure:"percent",description:"As percentage value"},{measure:"percentraw",description:"As ratio 0-1 with % sign"},{measure:"ratio",description:"Ratio 0-1 (base)"}]},{group:"Position",units:[{measure:"pdeg",description:"Position Degrees"},{measure:"latitudeMin",description:"Latitude in minutes"},{measure:"latitudeSec",description:"Latitude in seconds"},{measure:"longitudeMin",description:"Longitude in minutes"},{measure:"longitudeSec",description:"Longitude in seconds"}]}];skBaseUnits=[{unit:"s",properties:{display:"s",quantity:"Time",quantityDisplay:"t",description:"Elapsed time (interval) in seconds"}},{unit:"Hz",properties:{display:"Hz",quantity:"Frequency",quantityDisplay:"f",description:"Frequency in Hertz"}},{unit:"m3",properties:{display:"m\xB3",quantity:"Volume",quantityDisplay:"V",description:"Volume in cubic meters"}},{unit:"m3/s",properties:{display:"m\xB3/s",quantity:"Flow",quantityDisplay:"Q",description:"Liquid or gas flow in cubic meters per second"}},{unit:"kg/s",properties:{display:"kg/s",quantity:"Mass flow rate",quantityDisplay:"\u1E41",description:"Liquid or gas flow in kilograms per second"}},{unit:"kg/m3",properties:{display:"kg/m\xB3",quantity:"Density",quantityDisplay:"\u03C1",description:"Density in kg per cubic meter"}},{unit:"deg",properties:{display:"Position",quantity:"Angle",quantityDisplay:"\u2220",description:"Latitude or longitude in decimal degrees"}},{unit:"rad",properties:{display:"\xB0",quantity:"Angle",quantityDisplay:"\u2220",description:"Angular arc in radians"}},{unit:"rad/s",properties:{display:"\u33AD/s",quantity:"Rotation",quantityDisplay:"\u03C9",description:"Angular rate in radians per second"}},{unit:"A",properties:{display:"A",quantity:"Current",quantityDisplay:"I",description:"Electrical current in ampere"}},{unit:"C",properties:{display:"C",quantity:"Charge",quantityDisplay:"Q",description:"Electrical charge in Coulomb"}},{unit:"V",properties:{display:"V",quantity:"Voltage",quantityDisplay:"V",description:"Electrical potential in volt"}},{unit:"W",properties:{display:"W",quantity:"Power",quantityDisplay:"P",description:"Power in watt"}},{unit:"Nm",properties:{display:"Nm",quantity:"Torque",quantityDisplay:"\u03C4",description:"Torque in Newton meter"}},{unit:"J",properties:{display:"J",quantity:"Energy",quantityDisplay:"E",description:"Electrical energy in joule"}},{unit:"ohm",properties:{display:"\u2126",quantity:"Resistance",quantityDisplay:"R",description:"Electrical resistance in ohm"}},{unit:"m",properties:{display:"m",quantity:"Distance",quantityDisplay:"d",description:"Distance in meters"}},{unit:"m/s",properties:{display:"m/s",quantity:"Speed",quantityDisplay:"v",description:"Speed in meters per second"}},{unit:"m2",properties:{display:"\u33A1",quantity:"Area",quantityDisplay:"A",description:"(Surface) area in square meters"}},{unit:"K",properties:{display:"K",quantity:"Temperature",quantityDisplay:"T",description:"Temperature in kelvin"}},{unit:"Pa",properties:{display:"Pa",quantity:"Pressure",quantityDisplay:"P",description:"Pressure in pascal"}},{unit:"kg",properties:{display:"kg",quantity:"Mass",quantityDisplay:"m",description:"Mass in kilogram"}},{unit:"ratio",properties:{display:"",quantity:"Ratio",quantityDisplay:"\u03C6",description:"Relative value compared to reference or normal value. 0 = 0%, 1 = 100%, 1e-3 = 1 ppt"}},{unit:"m/s2",properties:{display:"m/s\xB2",quantity:"Acceleration",quantityDisplay:"a",description:"Acceleration in meters per second squared"}},{unit:"rad/s2",properties:{display:"rad/s\xB2",quantity:"Angular acceleration",quantityDisplay:"a",description:"Angular acceleration in radians per second squared"}},{unit:"N",properties:{display:"N",quantity:"Force",quantityDisplay:"F",description:"Force in newton"}},{unit:"T",properties:{display:"T",quantity:"Magnetic field",quantityDisplay:"B",description:"Magnetic field strength in tesla"}},{unit:"Lux",properties:{display:"lx",quantity:"Light Intensity",quantityDisplay:"Ev",description:"Light Intensity in lux"}},{unit:"Pa/s",properties:{display:"Pa/s",quantity:"Pressure rate",quantityDisplay:"R",description:"Pressure change rate in pascal per second"}},{unit:"Pa.s",properties:{display:"Pa s",quantity:"Viscosity",quantityDisplay:"\u03BC",description:"Viscosity in pascal seconds"}}];_defaultUnits=null;constructor(){this._defaultUnitsSub=this.AppSettingsService.getDefaultUnitsAsO().subscribe(e=>{this._defaultUnits=e})}unitConversionFunctions={unitless:function(e){return e}," ":function(e){return e},knots:p.default.swiftConverter("m/s","kn"),kph:p.default.swiftConverter("m/s","kph"),"m/s":function(e){return e},mph:p.default.swiftConverter("m/s","mph"),liter:p.default.swiftConverter("m^3","liter"),gallon:p.default.swiftConverter("m^3","gallon"),m3:function(e){return e},"m3/s":function(e){return e},"l/min":p.default.swiftConverter("m^3/s","liter/minute"),"l/h":p.default.swiftConverter("m^3/s","liter/hour"),"g/min":p.default.swiftConverter("m^3/s","gallon/minute"),"g/h":p.default.swiftConverter("m^3/s","gallon/hour"),"m/m3":function(e){return e},"nm/l":p.default.swiftConverter("m/m^3","naut-mile/liter"),"nm/g":p.default.swiftConverter("m/m^3","naut-mile/gallon"),"km/l":p.default.swiftConverter("m/m^3","km/liter"),mpg:p.default.swiftConverter("m/m^3","mile/gallon"),"m/J":function(e){return e},"nm/J":p.default.swiftConverter("m/J","naut-mile/J"),"km/J":p.default.swiftConverter("km/J","km/J"),"nm/kWh":p.default.swiftConverter("m/J","naut-mile/kWh"),"km/kWh":p.default.swiftConverter("m/J","km/kWh"),K:function(e){return e},celsius:p.default.swiftConverter("tempK","tempC"),fahrenheit:p.default.swiftConverter("tempK","tempF"),m:function(e){return e},mm:function(e){return e*1e3},fathom:p.default.swiftConverter("m","fathom"),feet:p.default.swiftConverter("m","foot"),inch:p.default.swiftConverter("m","in"),km:p.default.swiftConverter("m","km"),nm:p.default.swiftConverter("m","nmi"),mi:p.default.swiftConverter("m","mi"),V:function(e){return e},mV:function(e){return e*1e3},A:function(e){return e},mA:function(e){return e*1e3},C:function(e){return e},Ah:p.default.swiftConverter("C","Ah"),W:function(e){return e},mW:function(e){return e*1e3},J:function(e){return e},kWh:p.default.swiftConverter("J","kWh"),ohm:function(e){return e},kiloohm:function(e){return e/1e3},Pa:function(e){return e},bar:p.default.swiftConverter("Pa","bar"),psi:p.default.swiftConverter("Pa","psi"),mmHg:p.default.swiftConverter("Pa","mmHg"),inHg:p.default.swiftConverter("Pa","inHg"),hPa:p.default.swiftConverter("Pa","hPa"),kPa:p.default.swiftConverter("Pa","kPa"),mbar:p.default.swiftConverter("Pa","millibar"),"kg/m3":function(e){return e},s:function(e){return e},Minutes:p.default.swiftConverter("s","minutes"),Hours:p.default.swiftConverter("s","hours"),Days:p.default.swiftConverter("s","days"),"D HH:MM:SS":function(e){e=parseInt(e,10);let r=e<0;e=Math.abs(e);let a=Math.floor(e/86400),l=Math.floor(e%86400/3600),u=Math.floor(e%3600/60),g=Math.floor(e%60),v=r?"-":"";return a>0?v+=a+"d "+l.toString()+":"+u.toString().padStart(2,"0")+":"+g.toString().padStart(2,"0"):v+=l.toString()+":"+u.toString().padStart(2,"0")+":"+g.toString().padStart(2,"0"),v},"rad/s":function(e){return e},"deg/s":p.default.swiftConverter("rad/s","deg/s"),"deg/min":p.default.swiftConverter("rad/s","deg/min"),rpm:function(e){return e*60},Hz:function(e){return e},KHz:function(e){return e/1e3},MHz:function(e){return e/1e6},GHz:function(e){return e/1e9},rad:function(e){return e},deg:p.default.swiftConverter("rad","deg"),grad:p.default.swiftConverter("rad","grad"),percent:function(e){return e*100},percentraw:function(e){return e},ratio:function(e){return e},pdeg:function(e){return e},latitudeMin:function(e){let r=Math.trunc(e),a="N";e<0&&(a="S",r=r*-1);let l=e%1*60;return a=="S"&&(l=l*-1),r+"\xB0 "+l.toFixed(2).padStart(5,"0")+"' "+a},latitudeSec:function(e){let r=Math.trunc(e),a="N";e<0&&(a="S",r=r*-1);let l=e%1*60;a=="S"&&(l=l*-1);let u=Math.trunc(l),g=l%1*60;return r+"\xB0 "+u+"' "+g.toFixed(2).padStart(5,"0")+'" '+a},longitudeMin:function(e){let r=Math.trunc(e),a="E";e<0&&(a="W",r=r*-1);let l=e%1*60;return a=="W"&&(l=l*-1),r+"\xB0 "+l.toFixed(2).padStart(5,"0")+"' "+a},longitudeSec:function(e){let r=Math.trunc(e),a="E";e<0&&(a="W",r=r*-1);let l=e%1*60;a=="W"&&(l=l*-1);let u=Math.trunc(l),g=l%1*60;return r+"\xB0 "+u+"' "+g.toFixed(2).padStart(5,"0")+'" '+a}};convertToUnit(e,r){if(!(e in this.unitConversionFunctions)||r===null)return null;let a=+r;return this.unitConversionFunctions[e](a)}getDefaults(){return this._defaultUnits}getConversions(){return this._conversionList}getConversionsForPath(e){let r=this.data.getPathUnitType(e),a="unitless",l="unitless";if(r===null||r==="RFC 3339 (UTC)")return{base:a,conversions:this._conversionList};{let u=this._conversionList.filter(g=>g.group=="Position"&&(e.includes("position.latitude")||e.includes("position.longitude"))?!0:g.units.find(he=>he.measure==r)?(l=this._defaultUnits[g.group],!0):!1);return u.length>0?{base:l,conversions:u}:(console.log("[Units Service] Unit type: "+r+", found for path: "+e+`
|
|
2
|
+
but Kip does not support it.`),{base:a,conversions:this._conversionList})}}ngOnDestroy(){this._defaultUnitsSub?.unsubscribe()}static \u0275fac=function(r){return new(r||o)};static \u0275prov=Tt({token:o,factory:o.\u0275fac})}return o})();var rr=["*",[["mat-option"],["ng-container"]]],nr=["*","mat-option, ng-container"],ar=["text"],sr=[[["mat-icon"]],"*"],or=["mat-icon","*"];function lr(o,y){if(o&1&&ne(0,"mat-pseudo-checkbox",1),o&2){let e=F();Y("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function cr(o,y){if(o&1&&ne(0,"mat-pseudo-checkbox",3),o&2){let e=F();Y("disabled",e.disabled)}}function mr(o,y){if(o&1&&(D(0,"span",4),se(1),R()),o&2){let e=F();x(),Xe("(",e.group.label,")")}}var ue=new H("MAT_OPTION_PARENT_COMPONENT"),pe=new H("MatOptgroup"),hi=(()=>{class o{label;disabled=!1;_labelId=f(me).getId("mat-optgroup-label-");_inert;constructor(){let e=f(ue,{optional:!0});this._inert=e?.inertGroups??!1}static \u0275fac=function(r){return new(r||o)};static \u0275cmp=B({type:o,selectors:[["mat-optgroup"]],hostAttrs:[1,"mat-mdc-optgroup"],hostVars:3,hostBindings:function(r,a){r&2&&W("role",a._inert?null:"group")("aria-disabled",a._inert?null:a.disabled.toString())("aria-labelledby",a._inert?null:a._labelId)},inputs:{label:"label",disabled:[2,"disabled","disabled",I]},exportAs:["matOptgroup"],features:[xe([{provide:pe,useExisting:o}])],ngContentSelectors:nr,decls:5,vars:4,consts:[["role","presentation",1,"mat-mdc-optgroup-label",3,"id"],[1,"mdc-list-item__primary-text"]],template:function(r,a){r&1&&(Q(rr),Pt(0,"span",0)(1,"span",1),se(2),P(3),Nt()(),P(4,1)),r&2&&(V("mdc-list-item--disabled",a.disabled),Je("id",a._labelId),x(2),Xe("",a.label," "))},styles:[`.mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}
|
|
3
|
+
`],encapsulation:2,changeDetection:0})}return o})(),Te=class{source;isUserInput;constructor(y,e=!1){this.source=y,this.isUserInput=e}},le=(()=>{class o{_element=f(Me);_changeDetectorRef=f(De);_parent=f(ue,{optional:!0});group=f(pe,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=f(me).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ce(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new re;_text;_stateChanges=new Z;constructor(){let e=f(Ht);e.load(Xt),e.load(Bt),this._signalDisableRipple=!!this._parent&&At(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,r){let a=this._getHostElement();typeof a.focus=="function"&&a.focus(r)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!oe(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new Te(this,e))}static \u0275fac=function(r){return new(r||o)};static \u0275cmp=B({type:o,selectors:[["mat-option"]],viewQuery:function(r,a){if(r&1&&ae(ar,7),r&2){let l;L(l=q())&&(a._text=l.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(r,a){r&1&&J("click",function(){return a._selectViaInteraction()})("keydown",function(u){return a._handleKeydown(u)}),r&2&&(Je("id",a.id),W("aria-selected",a.selected)("aria-disabled",a.disabled.toString()),V("mdc-list-item--selected",a.selected)("mat-mdc-option-multiple",a.multiple)("mat-mdc-option-active",a.active)("mdc-list-item--disabled",a.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",I]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:or,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(r,a){r&1&&(Q(sr),G(0,lr,1,2,"mat-pseudo-checkbox",1),P(1),D(2,"span",2,0),P(4,1),R(),G(5,cr,1,1,"mat-pseudo-checkbox",3),G(6,mr,2,1,"span",4),ne(7,"div",5)),r&2&&(j(a.multiple?0:-1),x(5),j(!a.multiple&&a.selected&&!a.hideSingleSelectionIndicator?5:-1),x(),j(a.group&&a.group._inert?6:-1),x(),Y("matRippleTrigger",a._getHostElement())("matRippleDisabled",a.disabled||a.disableRipple))},dependencies:[mi,et],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return o})();function ot(o,y,e){if(e.length){let r=y.toArray(),a=e.toArray(),l=0;for(let u=0;u<o+1;u++)r[u].group&&r[u].group===a[l]&&l++;return l}return 0}function lt(o,y,e,r){return o<e?o:o+y>e+r?Math.max(0,o-r+y):e}var Ie=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=ke({type:o});static \u0275inj=we({imports:[tt,de,ui,le]})}return o})();var fr=["trigger"],gr=["panel"],yr=[[["mat-select-trigger"]],"*"],_r=["mat-select-trigger","*"];function vr(o,y){if(o&1&&(D(0,"span",4),se(1),R()),o&2){let e=F();x(),Qe(e.placeholder)}}function br(o,y){o&1&&P(0)}function wr(o,y){if(o&1&&(D(0,"span",11),se(1),R()),o&2){let e=F(2);x(),Qe(e.triggerValue)}}function Cr(o,y){if(o&1&&(D(0,"span",5),G(1,br,1,0)(2,wr,2,1,"span",11),R()),o&2){let e=F();x(),j(e.customTrigger?1:2)}}function Mr(o,y){if(o&1){let e=Ye();D(0,"div",12,1),J("keydown",function(a){te(e);let l=F();return ie(l._handleKeydown(a))}),P(2,1),R()}if(o&2){let e=F();qt(Ut("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),V("mat-select-panel-animations-enabled",!e._animationsDisabled),Y("ngClass",e.panelClass),W("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var ct=new H("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=f(je);return()=>it(o)}});function yi(o){let y=f(je);return()=>it(y)}var _i=new H("MAT_SELECT_CONFIG"),vi={provide:ct,deps:[],useFactory:yi},bi=new H("MatSelectTrigger"),Re=class{source;value;constructor(y,e){this.source=y,this.value=e}},kr=(()=>{class o{_viewportRuler=f($t);_changeDetectorRef=f(De);_elementRef=f(Me);_dir=f(Yt,{optional:!0});_idGenerator=f(me);_renderer=f(Rt);_parentFormField=f(si,{optional:!0});ngControl=f(ii,{self:!0,optional:!0});_liveAnnouncer=f(Wt);_defaultOptions=f(_i,{optional:!0});_animationsDisabled=Qt();_initialized=new Z;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let r=this.options.toArray()[e];if(r){let a=this.panel.nativeElement,l=ot(e,this.options,this.optionGroups),u=r._getHostElement();e===0&&l===1?a.scrollTop=0:a.scrollTop=lt(u.offsetTop,u.offsetHeight,a.scrollTop,a.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Re(this,e)}_scrollStrategyFactory=f(ct);_panelOpen=!1;_compareWith=(e,r)=>e===r;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new Z;_errorStateTracker;stateChanges=new Z;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Ce(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(ti.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Dt(()=>{let e=this.options;return e?e.changes.pipe(We(e),Ge(()=>be(...e.map(r=>r.onSelectionChange)))):this._initialized.pipe(Ge(()=>this.optionSelectionChanges))});openedChange=new re;_openedStream=this.openedChange.pipe(Be(e=>e),He(()=>{}));_closedStream=this.openedChange.pipe(Be(e=>!e),He(()=>{}));selectionChange=new re;valueChange=new re;constructor(){let e=f(li),r=f(ri,{optional:!0}),a=f(ni,{optional:!0}),l=f(new Vt("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new ci(e,this.ngControl,a,r,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=l==null?0:parseInt(l)||0,this.id=this.id}ngOnInit(){this._selectionModel=new di(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(ee(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(ee(this._destroy)).subscribe(e=>{e.added.forEach(r=>r.select()),e.removed.forEach(r=>r.deselect())}),this.options.changes.pipe(We(null),ee(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),r=this.ngControl;if(e!==this._triggerAriaLabelledBy){let a=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?a.setAttribute("aria-labelledby",e):a.removeAttribute("aria-labelledby")}r&&(this._previousControl!==r.control&&(this._previousControl!==void 0&&r.disabled!==null&&r.disabled!==this.disabled&&(this.disabled=r.disabled),this._previousControl=r.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(Ot(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let r=`${this.id}-panel`;this._trackedModal&&Ze(this._trackedModal,"aria-owns",r),jt(e,"aria-owns",r),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;Ze(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{r(),clearTimeout(a),this._cleanupDetach=void 0};let e=this.panel.nativeElement,r=this._renderer.listen(e,"animationend",l=>{l.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),a=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(r=>r.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let r=e.keyCode,a=r===40||r===38||r===37||r===39,l=r===13||r===32,u=this._keyManager;if(!u.isTyping()&&l&&!oe(e)||(this.multiple||e.altKey)&&a)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;u.onKeydown(e);let v=this.selected;v&&g!==v&&this._liveAnnouncer.announce(v.viewValue,1e4)}}_handleOpenKeydown(e){let r=this._keyManager,a=e.keyCode,l=a===40||a===38,u=r.isTyping();if(l&&e.altKey)e.preventDefault(),this.close();else if(!u&&(a===13||a===32)&&r.activeItem&&!oe(e))e.preventDefault(),r.activeItem._selectViaInteraction();else if(!u&&this._multiple&&a===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(v=>!v.disabled&&!v.selected);this.options.forEach(v=>{v.disabled||(g?v.select():v.deselect())})}else{let g=r.activeItemIndex;r.onKeydown(e),this._multiple&&l&&e.shiftKey&&r.activeItem&&r.activeItemIndex!==g&&r.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!oe(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(r=>r.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(r=>this._selectOptionByValue(r)),this._sortValues();else{let r=this._selectOptionByValue(e);r?this._keyManager.updateActiveItem(r):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let r=this.options.find(a=>{if(this._selectionModel.isSelected(a))return!1;try{return(a.value!=null||this.canSelectNullableOptions)&&this._compareWith(a.value,e)}catch{return!1}});return r&&this._selectionModel.select(r),r}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Gt(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=be(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(ee(e)).subscribe(r=>{this._onSelect(r.source,r.isUserInput),r.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),be(...this.options.map(r=>r._stateChanges)).pipe(ee(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,r){let a=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(a!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),r&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),r&&this.focus())),a!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((r,a)=>this.sortComparator?this.sortComparator(r,a,e):e.indexOf(r)-e.indexOf(a)),this.stateChanges.next()}}_propagateChanges(e){let r;this.multiple?r=this.selected.map(a=>a.value):r=this.selected?this.selected.value:e,this._value=r,this.valueChange.emit(r),this._onChange(r),this.selectionChange.emit(this._getChangeEvent(r)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let r=0;r<this.options.length;r++)if(!this.options.get(r).disabled){e=r;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,r=e?e+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(r){return new(r||o)};static \u0275cmp=B({type:o,selectors:[["mat-select"]],contentQueries:function(r,a,l){if(r&1&&(Se(l,bi,5),Se(l,le,5),Se(l,pe,5)),r&2){let u;L(u=q())&&(a.customTrigger=u.first),L(u=q())&&(a.options=u),L(u=q())&&(a.optionGroups=u)}},viewQuery:function(r,a){if(r&1&&(ae(fr,5),ae(gr,5),ae(nt,5)),r&2){let l;L(l=q())&&(a.trigger=l.first),L(l=q())&&(a.panel=l.first),L(l=q())&&(a._overlayDir=l.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(r,a){r&1&&J("keydown",function(u){return a._handleKeydown(u)})("focus",function(){return a._onFocus()})("blur",function(){return a._onBlur()}),r&2&&(W("id",a.id)("tabindex",a.disabled?-1:a.tabIndex)("aria-controls",a.panelOpen?a.id+"-panel":null)("aria-expanded",a.panelOpen)("aria-label",a.ariaLabel||null)("aria-required",a.required.toString())("aria-disabled",a.disabled.toString())("aria-invalid",a.errorState)("aria-activedescendant",a._getAriaActiveDescendant()),V("mat-mdc-select-disabled",a.disabled)("mat-mdc-select-invalid",a.errorState)("mat-mdc-select-required",a.required)("mat-mdc-select-empty",a.empty)("mat-mdc-select-multiple",a.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",I],disableRipple:[2,"disableRipple","disableRipple",I],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:$e(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",I],placeholder:"placeholder",required:[2,"required","required",I],multiple:[2,"multiple","multiple",I],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",I],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",$e],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",I]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[xe([{provide:ai,useExisting:o},{provide:ue,useExisting:o}]),It],ngContentSelectors:_r,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(r,a){if(r&1){let l=Ye();Q(yr),D(0,"div",2,0),J("click",function(){return te(l),ie(a.open())}),D(3,"div",3),G(4,vr,2,1,"span",4)(5,Cr,3,1,"span",5),R(),D(6,"div",6)(7,"div",7),Et(),D(8,"svg",8),ne(9,"path",9),R()()()(),Ft(10,Mr,3,10,"ng-template",10),J("detach",function(){return te(l),ie(a.close())})("backdropClick",function(){return te(l),ie(a.close())})("overlayKeydown",function(g){return te(l),ie(a._handleOverlayKeydown(g))})}if(r&2){let l=Lt(1);x(3),W("id",a._valueId),x(),j(a.empty?4:5),x(6),Y("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",a._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",a._scrollStrategy)("cdkConnectedOverlayOrigin",a._preferredOverlayOrigin||l)("cdkConnectedOverlayPositions",a._positions)("cdkConnectedOverlayWidth",a._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[rt,nt,zt],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
5
|
+
`],encapsulation:2,changeDetection:0})}return o})();var Sr=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=ke({type:o});static \u0275inj=we({providers:[vi],imports:[ei,Ie,de,Zt,oi,Ie,de]})}return o})();var xr=["mat-internal-form-field",""],Dr=["*"],Ln=(()=>{class o{labelPosition;static \u0275fac=function(r){return new(r||o)};static \u0275cmp=B({type:o,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(r,a){r&2&&V("mdc-form-field--align-end",a.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:xr,ngContentSelectors:Dr,decls:1,vars:0,template:function(r,a){r&1&&(Q(),P(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
6
|
+
`],encapsulation:2,changeDetection:0})}return o})();export{ue as a,pe as b,hi as c,Te as d,le as e,ot as f,lt as g,Ie as h,kr as i,Sr as j,Ln as k,Ir as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as Ye,C as Qe,F as Xe,G as I,H as et,Hb as ke,Ia as Ae,Ja as c,Jc as U,O as tt,Oc as B,Pa as ae,Qa as d,Sa as f,W as it,Wa as k,Xb as m,Z as nt,Za as rt,a as v,aa as oe,ab as W,b as S,ba as p,ca as C,da as se,dc as T,ea as N,ec as P,f as y,ga as _,j as ie,l as h,oc as ot,p as Ze,qc as Me,r as Te,ra as A,t as b,tb as G,ua as R,v as ne,va as w,vc as Ee,w as re,wa as Ve}from"./chunk-PB7HT3XU.js";var l=(function(n){return n.Disconnected="Disconnected",n.HTTPDiscovering="HTTPDiscovering",n.HTTPConnected="HTTPConnected",n.HTTPError="HTTPError",n.HTTPRetrying="HTTPRetrying",n.WebSocketConnecting="WebSocketConnecting",n.Connected="Connected",n.WebSocketError="WebSocketError",n.WebSocketRetrying="WebSocketRetrying",n.PermanentFailure="PermanentFailure",n})(l||{}),st=(()=>{class n{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new h(l.Disconnected);_status$=new h(this.createStatus(l.Disconnected,"Not connected"));_httpRetryCount=0;_webSocketRetryCount=0;_retryTimeout=null;_notificationTimeout=null;_httpRetryCallback=null;_webSocketRetryCallback=null;_isInitializationMode=!0;constructor(){console.log("[ConnectionStateMachine] Service initialized")}get state$(){return this._currentState$.asObservable()}get status$(){return this._status$.asObservable()}get currentState(){return this._currentState$.getValue()}enableWebSocketMode(){this._isInitializationMode=!1,console.log("[ConnectionStateMachine] WebSocket mode enabled");let e=this._status$.getValue();console.log(`[ConnectionStateMachine] Current status when enabling WebSocket mode: ${e.state} - ${e.message}`),this._status$.next(e)}setHTTPRetryCallback(e){this._httpRetryCallback=e}setWebSocketRetryCallback(e){this._webSocketRetryCallback=e}startHTTPDiscovery(e="Connection request"){console.log(`[ConnectionStateMachine] Starting HTTP discovery: ${e}`),this._httpRetryCount=0,this.setState(l.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(l.HTTPConnected,"Signal K server discovered"),this._isInitializationMode||this.startWebSocketConnection()}onHTTPDiscoveryError(e){console.log(`[ConnectionStateMachine] HTTP discovery failed: ${e}`),this._httpRetryCount<this.config.httpRetryCount?(this._httpRetryCount++,this.setState(l.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(l.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===l.HTTPConnected||this.currentState===l.WebSocketRetrying||this.currentState===l.WebSocketConnecting||this.currentState===l.Connected))return this.currentState===l.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(l.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(l.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==l.HTTPConnected&&this.currentState!==l.WebSocketConnecting&&this.currentState!==l.Connected&&this.currentState!==l.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(l.WebSocketRetrying,`WebSocket connection failed. Retry attempt ${this._webSocketRetryCount}...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(l.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===l.HTTPConnected||this.currentState===l.WebSocketConnecting||this.currentState===l.Connected||this.currentState===l.WebSocketRetrying}isFullyConnected(){return this.currentState===l.Connected}setState(e,i,r,o){this._currentState$.next(e);let s=this.createStatus(e,i,r,o);e===l.HTTPDiscovering||e===l.WebSocketConnecting?this._status$.next(s):e===l.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(s)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(s))}createStatus(e,i,r,o){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:r||0,maxRetries:o||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case l.Disconnected:return 0;case l.HTTPDiscovering:case l.WebSocketConnecting:return 1;case l.Connected:return 2;case l.HTTPError:case l.WebSocketError:case l.HTTPRetrying:case l.WebSocketRetrying:return 3;case l.HTTPConnected:return 2;case l.PermanentFailure:return 5;default:return 0}}scheduleHTTPRetry(){this.clearRetryTimer();let e=Math.min(this._httpRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling HTTP retry in ${i}ms`),this._retryTimeout=setTimeout(()=>{this._httpRetryCallback?(console.log(`[ConnectionStateMachine] Executing HTTP retry ${this._httpRetryCount}/${this.config.httpRetryCount}`),this._httpRetryCallback()):(console.error("[ConnectionStateMachine] No HTTP retry callback set!"),this.setState(l.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer(),console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${this.config.retryIntervals[1]}ms`),this._retryTimeout=setTimeout(()=>{this._webSocketRetryCallback?(console.log(`[ConnectionStateMachine] Executing WebSocket retry ${this._webSocketRetryCount}/${this.config.webSocketRetryCount}`),this._webSocketRetryCallback()):(console.log("[ConnectionStateMachine] No WebSocket retry callback - using state change method"),this.setState(l.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},this.config.retryIntervals[1])}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}ngOnDestroy(){this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCallback=null,this._webSocketRetryCallback=null,this._currentState$?.complete(),this._status$?.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var le=(()=>{class n{TIMEOUT_DURATION=1e4;connectionStateMachine=_(st);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new h({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new h(null);serverRoles=[];http=_(U);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return y(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let r=new URL(e);if(!["http:","https:"].includes(r.protocol))throw new Error("URL must start with http:// or https://")}catch{throw new Error("Invalid URL format - please check for typos and ensure it starts with http:// or https://")}let i=e;i.endsWith("signalk/")||(i+="/signalk/"),console.log(`[Connection Service] Validating Signal K server at: ${e}`);try{if(!(yield b(this.http.get(i,{observe:"response"}).pipe(ne(5e3),I(o=>{throw console.error("[Connection Service] HTTP Error details:",o),o.name==="TimeoutError"?(console.error("[Connection Service] Validation timed out after 5000ms"),new Error("Server is not responding - check if the URL is correct and the server is running")):o.status===0||o.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):o.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):o.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):o.status>=500?new Error(`Server error (${o.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${o.status}) - ${o.statusText||"please check the server URL"}`)})))).body?.endpoints?.v1)throw new Error("Server responded but doesn't appear to be a Signal K server - missing required endpoints");console.log(`[Connection Service] Validation successful for: ${e}`)}catch(r){throw console.error(`[Connection Service] Validation failed for ${e}:`,r.message),r}})}initializeConnection(e,i,r){return y(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection initialization called with null or empty URL value");return}this.currentProxyEnabled=i,this.currentSubscribeAll=r;let o={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(o),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let s=this.signalKURL.url;s.endsWith("signalk/")||(s+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let a=yield b(this.http.get(s,{observe:"response"}).pipe(ne(this.TIMEOUT_DURATION),I(u=>(u.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Te(u)))));Object.assign(o,this.processEndpointResponse(a,i,r)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(a){o.operation=3,o.message=a.message,this.connectionStateMachine.onHTTPDiscoveryError(a.message),this.handleError(a)}finally{o.subscribeAll=!!r,this.serverServiceEndpoint$.next(o)}})}retryCurrentConnection(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] Cannot retry - no current URL stored");return}console.log(`[SignalKConnectionService] Retrying connection to ${this.signalKURL.url}`),this.performHTTPDiscovery()}performHTTPDiscovery(){return y(this,null,function*(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] No URL available for HTTP discovery");return}let e=this.signalKURL.url;e.endsWith("signalk/")||(e+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let i=yield b(this.http.get(e,{observe:"response"}).pipe(ne(this.TIMEOUT_DURATION),I(o=>(o.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Te(o))))),r=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(r)}catch(i){let r={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(r),this.handleError(i)}})}processEndpointResponse(e,i,r){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let o=e.body.endpoints.v1["signalk-http"],s=e.body.endpoints.v1["signalk-ws"],a={operation:2,message:e.status?.toString()||"Connected",serverDescription:`${e.body.server.id} ${e.body.server.version}`,httpServiceUrl:null,WsServiceUrl:null};if(i)console.debug("[Connection Service] Proxy Mode Enabled"),a.httpServiceUrl=window.location.origin+new URL(o).pathname,a.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(s).pathname;else{a.httpServiceUrl=o;let u=window.location.protocol==="https:";a.WsServiceUrl=u?s.replace("ws://","wss://"):s}return console.debug("[Connection Service] HTTP URI: "+a.httpServiceUrl),console.debug("[Connection Service] WebSocket URI: "+a.WsServiceUrl),a.subscribeAll=!!r,a}handleError(e){let i=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(i),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,i,r){this.serverName=e,this.serverRoles=r,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(r)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ei="/signalk/v1/",at="auth/login",ti="auth/logout",ii="auth/validate",ni=60,lt=(()=>{class n{http=_(U);conn=_(le);_IsLoggedIn$=new h(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new h(null);authToken$=this._authToken$.asObservable();connectionEndpointSubscription=null;authTokenSubscription=null;isRenewingToken=!1;loginUrl=null;logoutUrl=null;validateTokenUrl=null;constructor(){let e=JSON.parse(localStorage.getItem("authorization_token"));e&&(e.isDeviceAccessToken?e.expiry===null?(console.log("[Authentication Service] Device Access Token found with expiry: NEVER"),this._authToken$.next(e)):this.isTokenExpired(e.expiry)?(console.log("[Authentication Service] Device Access Token expired. Deleting token"),localStorage.removeItem("authorization_token")):(console.log("[Authentication Service] Device Access Token found in Local Storage"),this._authToken$.next(e)):(console.log("[Authentication Service] User session token found in Local Storage"),console.log("[Authentication Service] Deleting user session token"),localStorage.removeItem("authorization_token"))),this.authTokenSubscription=this._authToken$.pipe(Xe(i=>!!i&&i.expiry!==null),tt((i,r)=>i.expiry===r.expiry),re(i=>{let r=this.getTokenExpirationDate(i.expiry,ni),o=r.getTime()-Date.now();return console.log(`[Authentication Service] Token refresh timer set for ${o} ms (Token Expiry: ${r.toISOString()})`),Math.max(o,0)}),it(i=>Qe(i))).subscribe(()=>{this.handleTokenRenewal()}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let r=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=r+at,this.logoutUrl=r+ti,this.validateTokenUrl=r+ii}})}handleTokenRenewal(){if(this.isRenewingToken){console.warn("[Authentication Service] Token renewal already in progress.");return}this.isRenewingToken=!0;let e=JSON.parse(localStorage.getItem("authorization_token"));if(!e){console.warn("[Authentication Service] No token found in local storage. Cannot renew."),this.isRenewingToken=!1;return}if(e.isDeviceAccessToken)console.warn("[Authentication Service] Device Access Token expired. Manual renewal required."),this.isRenewingToken=!1;else if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else{console.log("[Authentication Service] User session Token expires soon. Renewing token...");let i=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:i.loginName,pwd:i.loginPassword}).then(()=>{console.log("[Authentication Service] Token successfully renewed.")}).catch(r=>{console.error("[Authentication Service] Token renewal failed. Server returned:",r.error)}).finally(()=>{this.isRenewingToken=!1})}}login(o){return y(this,arguments,function*({usr:e,pwd:i,newUrl:r}){let s;if(r?s=r.replace(/\/+$/,"")+ei+at:s=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!s)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield b(this.http.post(s,{username:e,password:i},{observe:"response"})).then(a=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(a.body.token)}).catch(a=>{this.deleteToken(),this.handleError(a)})})}handleError(e){throw e.status===0&&this.deleteToken(),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,r={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(r.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(r),localStorage.setItem("authorization_token",JSON.stringify(r))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(r.token=e,r.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(r.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(r),localStorage.setItem("authorization_token",JSON.stringify(r)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let r=new Date(0);if(i){let o=new Date(0);o.setUTCSeconds(e-i),r=o}else r.setUTCSeconds(e);return r}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return y(this,null,function*(){localStorage.removeItem("authorization_token"),yield b(this.http.put(this.logoutUrl,null)).then(()=>{this._IsLoggedIn$.next(!1),e||this._authToken$.next(null),console.log("[Authentication Service] User logged out")}).catch(i=>{console.error(i)})})}deleteToken(){this._authToken$&&(console.log("[Authentication Service] Deleting Authorization token"),localStorage.removeItem("authorization_token"),this._IsLoggedIn$.next(!1),this._authToken$.next(null))}setDeviceAccessToken(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,r={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(r.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(r),localStorage.setItem("authorization_token",JSON.stringify(r))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(r.token=e,r.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(r.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(r),localStorage.setItem("authorization_token",JSON.stringify(r)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ri=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ne=n=>{if(typeof n!="string")throw new TypeError("Invalid argument expected string");let t=n.match(ri);if(!t)throw new Error(`Invalid argument not valid semver ('${n}' received)`);return t.shift(),t},ct=n=>n==="*"||n==="x"||n==="X",ut=n=>{let t=parseInt(n,10);return isNaN(t)?n:t},oi=(n,t)=>typeof n!=typeof t?[String(n),String(t)]:[n,t],si=(n,t)=>{if(ct(n)||ct(t))return 0;let[e,i]=oi(ut(n),ut(t));return e>i?1:e<i?-1:0},xe=(n,t)=>{for(let e=0;e<Math.max(n.length,t.length);e++){let i=si(n[e]||"0",t[e]||"0");if(i!==0)return i}return 0};var dt=(n,t)=>{let e=Ne(n),i=Ne(t),r=e.pop(),o=i.pop(),s=xe(e,i);return s!==0?s:r&&o?xe(r.split("."),o.split(".")):r||o?r?-1:1:0};var Fe=(n,t,e)=>{ai(e);let i=dt(n,t);return ft[e].includes(i)},ft={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ht=Object.keys(ft),ai=n=>{if(typeof n!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof n}`);if(ht.indexOf(n)===-1)throw new Error(`Invalid operator, expected one of ${ht.join("|")}`)};var gt=(()=>{class n{server=_(le);http=_(U);_auth=_(lt);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;storageServiceReady$=new h(!1);_isLoggedIn=!1;_networkStatus=void 0;patchQueue$=new ie;patch=function(e){return this.http.post(e.url,e.document).pipe(nt(()=>console.log("[Storage Service] Remote config patch request completed successfully")),I(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe(B()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe(B()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe(B()).subscribe(i=>{i&&(this.isAppDataSupported=Fe(i,"1.27.0",">="))}),this.patchQueue$.pipe(et(i=>this.patch(i)),B()).subscribe(()=>{})}isStorageServiceReady(){this._networkStatus?.httpServiceUrl&&(this.serverEndpoint=this._networkStatus.httpServiceUrl.substring(0,this._networkStatus.httpServiceUrl.length-4)+"applicationData/"),this._networkStatus?.operation===2&&this._isLoggedIn&&this.serverEndpoint?(this.storageServiceReady$.next(!0),console.log(`[Remote Storage Service] Authenticated ${this._isLoggedIn} ,AppData API: ${this.serverEndpoint}`)):this.storageServiceReady$.next(!1)}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return y(this,null,function*(){this.ensureReady();let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let r=this.serverEndpoint,o=r+"global/kip/"+this.configFileVersion+"/?keys=true",s=r+"user/kip/"+this.configFileVersion+"/?keys=true";return e&&(o=r+"global/kip/"+e+"/?keys=true",s=r+"user/kip/"+e+"/?keys=true"),yield b(this.http.get(o)).then(a=>{for(let u of a)i.push({scope:"global",name:u});console.log("[Storage Service] Retrieved Global config list")}).catch(a=>{this.handleError(a)}),yield b(this.http.get(s)).then(a=>{for(let u of a)i.push({scope:"user",name:u});console.log("[Storage Service] Retrieved User config list")}).catch(a=>{this.handleError(a)}),i})}getConfig(e,i,r,o){return y(this,null,function*(){this.ensureReady();let s=null,a=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+i;return r&&(a=this.serverEndpoint+e+"/kip/"+r+"/"+i),yield b(this.http.get(a)).then(u=>{s=u,console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`),o&&(this.InitConfig=u)}).catch(u=>{this.handleError(u)}),s})}setConfig(e,i,r,o){return y(this,null,function*(){this.ensureReady();let s=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+i,a=null;return o&&(s=this.serverEndpoint+e+"/kip/"+o+"/"+i),yield b(this.http.post(s,r)).then(u=>{console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),a=u}).catch(u=>{this.handleError(u)}),a})}patchConfig(e,i,r){this.ensureReady();let o=this.serverEndpoint+"user/kip/"+this.configFileVersion,s;switch(r&&(o=this.serverEndpoint+"user/kip/"+r),e){case"IAppConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:i}];break;case"IThemeConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:i.themeName}];break;case"IWidgetConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:i}];break;case"ILayoutConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:i}];break;case"Dashboards":s=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:i}];break;case"Array<IUnitDefaults>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:i}];break;case"Array<IDatasetDef>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:i}];break;case"INotificationConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:i}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let a={url:o,document:s};this.patchQueue$.next(a)}patchGlobal(e,i,r,o,s){this.ensureReady();let a=this.serverEndpoint+i+"/kip/"+this.configFileVersion;s&&(a=this.serverEndpoint+i+"/kip/"+s);let u;switch(o){case"add":u=[{op:"add",path:`/${e}`,value:r}];break;case"replace":u=[{op:"replace",path:`/${e}`,value:r}];break;case"remove":u=[{op:"remove",path:`/${e}`,value:r}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let Xt={url:a,document:u};this.patchQueue$.next(Xt)}removeItem(e,i,r){this.ensureReady();let o=this.serverEndpoint+e+"/kip/"+this.configFileVersion;r&&(o=this.serverEndpoint+e+"/kip/"+r);let s=[{op:"remove",path:`/${i}`}],a={url:o,document:s};this.patchQueue$.next(a)}clear(){this.ensureReady()}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(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var M=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}};var K={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 ce={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 pt={configVersion:11,autoNightMode:!0,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",dataSets:[],unitDefaults:ce,notificationConfig:K},mt={themeName:""};var vt={configVersion:11,kipUUID:M.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Ie={configVersion:11,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",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}}},Re=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",icon:"dashboard-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,showMiniChart:!0,yScaleMin:0,yScaleMax:100,inverseYAxis:!1,verticalChart:!1,color:"blue",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},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:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!1,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,driftEnable:!0,awsEnable:!0,twsEnable:!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,highlightsWidth:5,scaleStart:180},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5,ignoreZones:!1}}},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,showMiniChart:!1,yScaleMin:0,yScaleMax:10,inverseYAxis:!1,verticalChart:!1,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},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",inverseYAxis:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalChart:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"orange",invertData:!1,verticalGraph:!1}}},x:8,y:6},{x:0,y:8,w:3,h:4,minW:1,minH:1,id:"5289a84d-18fd-4ee7-9724-72249af403f2",selector:"widget-position",input:{widgetProperties:{type:"widget-position",uuid:"5289a84d-18fd-4ee7-9724-72249af403f2",config:{displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"grey",enableTimeout:!1,dataTimeout:5}}}},{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.1.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,ignoreZones:!1,color:"green",enableTimeout:!1,dataTimeout:5}}},x:3,y:10}]},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",icon:"dashboard-map",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",showConvertUnitTo:!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",filterSelfPaths:!0,paths:{gaugePath:{description:"String Data",path:"self.navigation.datetime",source:"default",pathType:"Date",isPathConfigurable:!0,sampleTime:500}},dateFormat:"dd/MM HH:mm",dateTimezone:"America/Toronto",color:"contrast",enableTimeout:!1,dataTimeout:5}}}},{x:8,y:3,w:4,h:9,id:"daa21350-009e-4d99-8209-364f9b99caee",selector:"widget-autopilot",input:{widgetProperties:{type:"widget-autopilot",uuid:"daa21350-009e-4d99-8209-364f9b99caee",config:{filterSelfPaths:!0,paths:{autopilotState:{description:"Autopilot State",path:"self.steering.autopilot.state",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotTargetHeading:{description:"Autopilot Target Magnetic Heading",path:"self.steering.autopilot.target.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetWindHeading:{description:"Autopilot Target Apparent Wind Angle",path:"self.steering.autopilot.target.windAngleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},rudderAngle:{description:"Rudder Angle",path:"self.steering.rudderAngle",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},courseXte:{description:"Cross Track Error",path:"self.navigation.course.calcValues.crossTrackError",source:"default",pathType:"number",isPathConfigurable:!1,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathRequired:!1,pathSkUnitsFilter:"m",sampleTime:500},headingMag:{description:"Magnetic Heading",path:"self.navigation.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},headingTrue:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleApparent:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleTrueWater:{description:"Wind Angle True Water",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500}},invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,enableTimeout:!1,dataTimeout:5,autopilotInstance:"_default"}}}}]}],Pe={themeName:""};var Wn={configVersion:11,kipUUID:M.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var li="",ci=11,z=11,er=(()=>{class n{storage=_(gt);unitDefaults=new h({});themeName=new h(li);kipKNotificationConfig=new h(K);autoNightMode=new h(!1);redNightMode=new h(!1);nightModeBrightness=new h(1);isRemoteControl=new h(!1);instanceName=new h("");proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=A(!1);constructor(){if(console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=ci,!window.localStorage)console.error(`[AppSettings Service] LocalStorage NOT SUPPORTED by browser
|
|
2
|
+
This is a requirement to run Kip. See browser documentation to enable this feature.`);else{this.loadConnectionConfig();let e;if(this.storage.initConfig===null&&this.useSharedConfig&&this.loginName!==null&&this.loginPassword!==null&&this.signalkUrl.url!==null?this.resetSettings():e=this.storage.initConfig,e)console.log("[AppSettings Service] Remote configuration storage enabled"),this.checkConfigUpgradeRequired(!1),this.activeConfig=e,this.pushSettings();else{console.log("[AppSettings Service] LocalStorage enabled");let i={app:null,theme:null,dashboards:null};i.app=this.loadConfigFromLocalStorage("appConfig"),i.app.configVersion!==z&&this.checkConfigUpgradeRequired(!0),i.dashboards=this.loadConfigFromLocalStorage("dashboardsConfig"),i.theme=this.loadConfigFromLocalStorage("themeConfig"),this.activeConfig=i,this.pushSettings()}}}loadConnectionConfig(){let e=this.loadConfigFromLocalStorage("connectionConfig");switch(e.configVersion){case 11:break;default:console.error(`[AppSettings Service] Invalid connectionConfig version ${e.configVersion}. Resetting and loading connection configuration default`),this.resetConnection();break}this.signalkUrl={url:e.signalKUrl,new:!1},this.proxyEnabled=e.proxyEnabled,this.signalKSubscribeAll=e.signalKSubscribeAll,this.useDeviceToken=e.useDeviceToken,this.loginName=e.loginName,this.loginPassword=e.loginPassword,this.useSharedConfig=e.useSharedConfig,this.sharedConfigName=e.sharedConfigName,this.kipUUID=e.kipUUID}resetConnection(){localStorage.setItem("connectionConfig",JSON.stringify(this.getDefaultConnectionConfig())),this.reloadApp()}checkConfigUpgradeRequired(e){e?this.configUpgrade.set(!0):this.storage.listConfigs(9).then(i=>y(this,null,function*(){for(let r of i)try{if((yield this.storage.getConfig(r.scope,r.name,9)).app?.configVersion===10){this.configUpgrade.set(!0),console.log("[AppSettings Service] Configuration upgrade required for version 10.");break}}catch(o){console.error(`[AppSettings Service] Error fetching configuration for ${r.name}:`,o)}})).catch(i=>{console.error("[AppSettings Service] Error fetching configuration data:",i)})}loadConfigFromLocalStorage(e){let i=JSON.parse(localStorage.getItem(e));if(i===null)switch(console.log(`[AppSettings Service] Error loading ${e} config. Force loading ${e} defaults`),e){case"appConfig":i=this.getDefaultAppConfig();break;case"connectionConfig":i=this.getDefaultConnectionConfig();break;case"dashboardsConfig":i=this.getDefaultDashboardsConfig();break;case"themeConfig":i=this.getDefaultThemeConfig();break;default:console.error(`[AppSettings Service] Invalid ${e} default config requested`);break}if(e==="connectionConfig"&&i.configVersion!==z)switch(console.log(`[AppSettings Service] Invalid ${e} version. Force loading defaults`),e){case"connectionConfig":i=this.getDefaultConnectionConfig();break}return i}pushSettings(){this.themeName.next(this.activeConfig.theme.themeName),this.dataSets=this.activeConfig.app.dataSets,this.unitDefaults.next(this.activeConfig.app.unitDefaults),this.kipKNotificationConfig.next(this.activeConfig.app.notificationConfig),this.activeConfig.app.autoNightMode===void 0?this.setAutoNightMode(!1):this.autoNightMode.next(this.activeConfig.app.autoNightMode),this.activeConfig.app.redNightMode===void 0?this.setRedNightMode(!1):this.redNightMode.next(this.activeConfig.app.redNightMode),this.activeConfig.app.nightModeBrightness===void 0?this.setNightModeBrightness(.2):this.nightModeBrightness.next(this.activeConfig.app.nightModeBrightness),this.activeConfig.dashboards===void 0?this._dashboards=[]:this._dashboards=this.activeConfig.dashboards,this.activeConfig.app.isRemoteControl===void 0?this.setIsRemoteControl(!1):this.isRemoteControl.next(this.activeConfig.app.isRemoteControl),this.activeConfig.app.instanceName===void 0?this.setInstanceName(""):this.instanceName.next(this.activeConfig.app.instanceName)}getDefaultUnitsAsO(){return this.unitDefaults.asObservable()}getDefaultUnits(){return this.unitDefaults.getValue()}setDefaultUnits(e){this.unitDefaults.next(e),this.useSharedConfig?this.storage.patchConfig("Array<IUnitDefaults>",e):this.saveAppConfigToLocalStorage()}getAppConfig(){return this.buildAppStorageObject()}getConnectionConfig(){return this.buildConnectionStorageObject()}setConnectionConfig(e){this.loginName=e.loginName,this.loginPassword=e.loginPassword,this.useSharedConfig=e.useSharedConfig,this.proxyEnabled=e.proxyEnabled,this.signalKSubscribeAll=e.signalKSubscribeAll,this.signalkUrl.url=e.signalKUrl,e.useSharedConfig?this.useDeviceToken=!1:this.useDeviceToken=!0,this.saveConnectionConfigToLocalStorage()}setUseDeviceToken(e){this.useDeviceToken=e,this.saveConnectionConfigToLocalStorage()}getDashboardConfig(){return this.buildDashboardStorageObject()}getThemeConfig(){return this.buildThemeStorageObject()}get KipUUID(){return this.kipUUID}getThemeNameAsO(){return this.themeName.asObservable()}setThemeName(e){if(this.themeName.next(e),this.useSharedConfig){let i={themeName:e};this.storage.patchConfig("IThemeConfig",i)}else this.saveThemeConfigToLocalStorage()}getThemeName(){return this.themeName.getValue()}getAutoNightModeAsO(){return this.autoNightMode.asObservable()}setAutoNightMode(e){this.autoNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getAutoNightMode(){return this.autoNightMode.getValue()}getRedNightModeAsO(){return this.redNightMode.asObservable()}getRedNightMode(){return this.redNightMode.getValue()}setRedNightMode(e){this.redNightMode.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getIsRemoteControlAsO(){return this.isRemoteControl.asObservable()}getIsRemoteControl(){return this.isRemoteControl.getValue()}setIsRemoteControl(e){this.isRemoteControl.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getInstanceNameAsO(){return this.instanceName.asObservable()}getInstanceName(){return this.instanceName.getValue()}setInstanceName(e){this.instanceName.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getNightModeBrightness(){return this.nightModeBrightness.getValue()}setNightModeBrightness(e){this.nightModeBrightness.next(e);let i=this.buildAppStorageObject();this.useSharedConfig?this.storage.patchConfig("IAppConfig",i):this.saveAppConfigToLocalStorage()}getWidgets(){return this.widgets}saveDashboards(e){this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.patchConfig("Dashboards",e):this.saveLDashboardsConfigToLocalStorage(e),this._dashboards=e}saveDataSets(e){this.dataSets=e,this.useSharedConfig?this.storage.patchConfig("Array<IDatasetDef>",e):this.saveAppConfigToLocalStorage()}getDataSets(){return this.dataSets}getNotificationServiceConfigAsO(){return this.kipKNotificationConfig.asObservable()}getNotificationConfig(){return this.kipKNotificationConfig.getValue()}setNotificationConfig(e){this.kipKNotificationConfig.next(e),this.useSharedConfig?this.storage.patchConfig("INotificationConfig",e):this.saveAppConfigToLocalStorage()}resetSettings(){let e={app:null,theme:null,dashboards:null};e.app=this.getDefaultAppConfig(),e.theme=this.getDefaultThemeConfig(),e.dashboards=this.getDefaultDashboardsConfig(),this.useSharedConfig?this.storage.storageServiceReady$.getValue()&&this.storage.setConfig("user",this.sharedConfigName,e).then(()=>{console.log("[AppSettings Service] Replaced server config name: "+this.sharedConfigName+", with default configuration values"),this.reloadApp()}).catch(i=>{console.error("[AppSettings Service] Error replacing server config name: "+this.sharedConfigName+", with default configuration values",i)}):this.reloadApp()}replaceConfig(e,i,r){let o=JSON.stringify(i);localStorage.setItem(e,o),r&&this.reloadApp()}loadDemoConfig(){if(this.useSharedConfig){let e={app:Ie,dashboards:Re,theme:Pe};console.log("[AppSettings Service] Loading Demo configuration settings as remote config: "+this.useSharedConfig+" and reloading app."),this.storage.setConfig("user",this.sharedConfigName,e),this.reloadApp()}else console.log("[AppSettings Service] Loading Demo configuration settings to LocalStorage"),this.replaceConfig("appConfig",Ie),this.replaceConfig("dashboardsConfig",Re),this.replaceConfig("themeConfig",Pe,!0)}reloadApp(){console.log("[AppSettings Service] Reload app"),!window.__KIP_TEST__&&location.replace("./")}buildAppStorageObject(){return{configVersion:z,autoNightMode:this.autoNightMode.getValue(),redNightMode:this.redNightMode.getValue(),nightModeBrightness:this.nightModeBrightness.getValue(),isRemoteControl:this.isRemoteControl.getValue(),instanceName:this.instanceName.getValue(),dataSets:this.dataSets,unitDefaults:this.unitDefaults.getValue(),notificationConfig:this.kipKNotificationConfig.getValue()}}buildConnectionStorageObject(){return{configVersion:z,kipUUID:this.kipUUID,signalKUrl:this.signalkUrl.url,proxyEnabled:this.proxyEnabled,signalKSubscribeAll:this.signalKSubscribeAll,useDeviceToken:this.useDeviceToken,loginName:this.loginName,loginPassword:this.loginPassword,useSharedConfig:this.useSharedConfig,sharedConfigName:this.sharedConfigName}}buildDashboardStorageObject(){return this._dashboards}buildThemeStorageObject(){return{themeName:this.themeName.getValue()}}saveAppConfigToLocalStorage(){console.log("[AppSettings Service] Saving Application config to LocalStorage"),localStorage.setItem("appConfig",JSON.stringify(this.buildAppStorageObject()))}saveConnectionConfigToLocalStorage(){console.log("[AppSettings Service] Saving Connection config to LocalStorage"),localStorage.setItem("connectionConfig",JSON.stringify(this.buildConnectionStorageObject()))}saveLDashboardsConfigToLocalStorage(e){console.log("[AppSettings Service] Saving Dashboard config to LocalStorage"),localStorage.setItem("dashboardsConfig",JSON.stringify(e))}saveThemeConfigToLocalStorage(){console.log("[AppSettings Service] Saving Theme config to LocalStorage"),localStorage.setItem("themeConfig",JSON.stringify(this.buildThemeStorageObject()))}getDefaultAppConfig(){let e=pt;return e.notificationConfig=K,e.unitDefaults=ce,e.configVersion=z,localStorage.setItem("appConfig",JSON.stringify(e)),e}getDefaultConnectionConfig(){let e=vt;return e.kipUUID=M.create(),e.signalKUrl=window.location.origin,localStorage.setItem("connectionConfig",JSON.stringify(e)),e}getDefaultDashboardsConfig(){let e=[];return localStorage.setItem("dashboardsConfig",JSON.stringify(e)),e}getDefaultThemeConfig(){let e=mt;return localStorage.setItem("themeConfig",JSON.stringify(e)),e}static \u0275fac=function(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Vt=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(c(Ae),c(Ve))};static \u0275dir=d({type:n})}return n})(),At=(()=>{class n extends Vt{static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,features:[f]})}return n})(),te=new N("");var ui={provide:te,useExisting:p(()=>kt),multi:!0};function di(){let n=Ee()?Ee().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var hi=new N(""),kt=(()=>{class n extends Vt{_compositionMode;_composing=!1;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!di())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(c(Ae),c(Ve),c(hi,8))};static \u0275dir=d({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&G("input",function(s){return r._handleInput(s.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(s){return r._compositionEnd(s.target.value)})},standalone:!1,features:[m([ui]),f]})}return n})();function je(n){return n==null||He(n)===0}function He(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var D=new N(""),F=new N(""),fi=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yt=class{static min(t){return Mt(t)}static max(t){return Et(t)}static required(t){return Nt(t)}static requiredTrue(t){return gi(t)}static email(t){return pi(t)}static minLength(t){return mi(t)}static maxLength(t){return vi(t)}static pattern(t){return xt(t)}static nullValidator(t){return de()}static compose(t){return Ot(t)}static composeAsync(t){return $t(t)}};function Mt(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function Et(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function Nt(n){return je(n.value)?{required:!0}:null}function gi(n){return n.value===!0?null:{required:!0}}function pi(n){return je(n.value)||fi.test(n.value)?null:{email:!0}}function mi(n){return t=>{let e=t.value?.length??He(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function vi(n){return t=>{let e=t.value?.length??He(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function xt(n){if(!n)return de;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(je(i.value))return null;let r=i.value;return t.test(r)?null:{pattern:{requiredPattern:e,actualValue:r}}}}function de(n){return null}function Ft(n){return n!=null}function It(n){return rt(n)?Ze(n):n}function Rt(n){let t={};return n.forEach(e=>{t=e!=null?v(v({},t),e):t}),Object.keys(t).length===0?null:t}function Pt(n,t){return t.map(e=>e(n))}function yi(n){return!n.validate}function Ut(n){return n.map(t=>yi(t)?t:e=>t.validate(e))}function Ot(n){if(!n)return null;let t=n.filter(Ft);return t.length==0?null:function(e){return Rt(Pt(e,t))}}function Le(n){return n!=null?Ot(Ut(n)):null}function $t(n){if(!n)return null;let t=n.filter(Ft);return t.length==0?null:function(e){let i=Pt(e,t).map(It);return Ye(i).pipe(re(Rt))}}function We(n){return n!=null?$t(Ut(n)):null}function Ct(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function jt(n){return n._rawValidators}function Ht(n){return n._rawAsyncValidators}function Ue(n){return n?Array.isArray(n)?n:[n]:[]}function he(n,t){return Array.isArray(n)?n.includes(t):n===t}function _t(n,t){let e=Ue(t);return Ue(n).forEach(r=>{he(e,r)||e.push(r)}),e}function bt(n,t){return Ue(t).filter(e=>!he(n,e))}var fe=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=Le(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=We(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},g=class extends fe{name;get formDirective(){return null}get path(){return null}},V=class extends fe{_parent=null;name=null;valueAccessor=null},ge=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Ci={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Dr=S(v({},Ci),{"[class.ng-submitted]":"isSubmitted"}),wr=(()=>{class n extends ge{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(c(V,2))};static \u0275dir=d({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&ke("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[f]})}return n})(),Tr=(()=>{class n extends ge{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(c(g,10))};static \u0275dir=d({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&ke("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[f]})}return n})();var J="VALID",ue="INVALID",O="PENDING",Z="DISABLED",E=class{},pe=class extends E{value;source;constructor(t,e){super(),this.value=t,this.source=e}},Q=class extends E{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},X=class extends E{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},$=class extends E{status;source;constructor(t,e){super(),this.status=t,this.source=e}},me=class extends E{source;constructor(t){super(),this.source=t}},ve=class extends E{source;constructor(t){super(),this.source=t}};function Ge(n){return(be(n)?n.validators:n)||null}function _i(n){return Array.isArray(n)?Le(n):n||null}function Be(n,t){return(be(t)?t.asyncValidators:n)||null}function bi(n){return Array.isArray(n)?We(n):n||null}function be(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function Lt(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new oe(1e3,"");if(!i[e])throw new oe(1001,"")}function Wt(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new oe(1002,"")})}var H=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return T(this.statusReactive)}set status(t){T(()=>this.statusReactive.set(t))}_status=P(()=>this.statusReactive());statusReactive=A(void 0);get valid(){return this.status===J}get invalid(){return this.status===ue}get pending(){return this.status==O}get disabled(){return this.status===Z}get enabled(){return this.status!==Z}errors;get pristine(){return T(this.pristineReactive)}set pristine(t){T(()=>this.pristineReactive.set(t))}_pristine=P(()=>this.pristineReactive());pristineReactive=A(!0);get dirty(){return!this.pristine}get touched(){return T(this.touchedReactive)}set touched(t){T(()=>this.touchedReactive.set(t))}_touched=P(()=>this.touchedReactive());touchedReactive=A(!1);get untouched(){return!this.touched}_events=new ie;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(_t(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(_t(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(bt(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(bt(t,this._rawAsyncValidators))}hasValidator(t){return he(this._rawValidators,t)}hasAsyncValidator(t){return he(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(S(v({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new X(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new X(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(S(v({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new Q(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new Q(!0,i))}markAsPending(t={}){this.status=O;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new $(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(S(v({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=Z,this.errors=null,this._forEachChild(r=>{r.disable(S(v({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new pe(this.value,i)),this._events.next(new $(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(S(v({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=J,this._forEachChild(i=>{i.enable(S(v({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(S(v({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===J||this.status===O)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new pe(this.value,e)),this._events.next(new $(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(S(v({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Z:J}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=O,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=It(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new $(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new k,this.statusChanges=new k}_calculateStatus(){return this._allControlsDisabled()?Z:this.errors?ue:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(O)?O:this._anyControlsHaveStatus(ue)?ue:J}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),r&&this._events.next(new Q(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new X(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){be(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=_i(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=bi(this._rawAsyncValidators)}},x=class extends H{constructor(t,e,i){super(Ge(e),Be(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Wt(this,!0,t),Object.keys(t).forEach(i=>{Lt(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this.controls[i];r&&r.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,o)=>{i=e(i,r,o)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var Vr=x;var Oe=class extends x{};var L=new N("",{providedIn:"root",factory:()=>Se}),Se="always";function De(n,t){return[...t.path,n]}function ee(n,t,e=Se){qe(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Di(n,t),Ti(n,t),wi(n,t),Si(n,t)}function ye(n,t,e=!0){let i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),_e(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function Ce(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Si(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function qe(n,t){let e=jt(n);t.validator!==null?n.setValidators(Ct(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=Ht(n);t.asyncValidator!==null?n.setAsyncValidators(Ct(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();Ce(t._rawValidators,r),Ce(t._rawAsyncValidators,r)}function _e(n,t){let e=!1;if(n!==null){if(t.validator!==null){let r=jt(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.validator);o.length!==r.length&&(e=!0,n.setValidators(o))}}if(t.asyncValidator!==null){let r=Ht(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.asyncValidator);o.length!==r.length&&(e=!0,n.setAsyncValidators(o))}}}let i=()=>{};return Ce(t._rawValidators,i),Ce(t._rawAsyncValidators,i),e}function Di(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Gt(n,t)})}function wi(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Gt(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function Gt(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Ti(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function Bt(n,t){n==null,qe(n,t)}function Vi(n,t){return _e(n,t)}function Ke(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function Ai(n){return Object.getPrototypeOf(n.constructor)===At}function qt(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ze(n,t){if(!t)return null;Array.isArray(t);let e,i,r;return t.forEach(o=>{o.constructor===kt?e=o:Ai(o)?i=o:r=o}),r||i||e||null}function ki(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}var Mi={provide:g,useExisting:p(()=>Ei)},Y=Promise.resolve(),Ei=(()=>{class n extends g{callSetDisabledState;get submitted(){return T(this.submittedReactive)}_submitted=P(()=>this.submittedReactive());submittedReactive=A(!1);_directives=new Set;form;ngSubmit=new k;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new x({},Le(e),We(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){Y.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),ee(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){Y.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){Y.then(()=>{let i=this._findContainer(e.path),r=new x({});Bt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){Y.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){Y.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),qt(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new me(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1),this.form._events.next(new ve(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(c(D,10),c(F,10),c(L,8))};static \u0275dir=d({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&G("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[m([Mi]),f]})}return n})();function St(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Dt(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var j=class extends H{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(Ge(e),Be(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),be(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Dt(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){St(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){St(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Dt(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}},kr=j,Ni=n=>n instanceof j,xi=(()=>{class n extends g{_parent;ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return De(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,standalone:!1,features:[f]})}return n})();var Fi={provide:V,useExisting:p(()=>Ii)},wt=Promise.resolve(),Ii=(()=>{class n extends V{_changeDetectorRef;callSetDisabledState;control=new j;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new k;constructor(e,i,r,o,s,a){super(),this._changeDetectorRef=s,this.callSetDisabledState=a,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ze(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Ke(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){ee(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){wt.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&Me(i);wt.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?De(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(c(g,9),c(D,10),c(F,10),c(te,10),c(ot,8),c(L,8))};static \u0275dir=d({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[m([Fi]),f,R]})}return n})();var Mr=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=d({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})(),Ri={provide:te,useExisting:p(()=>Pi),multi:!0},Pi=(()=>{class n extends At{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,r){i&1&&G("input",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[m([Ri]),f]})}return n})();var Je=new N(""),Ui={provide:V,useExisting:p(()=>Oi)},Oi=(()=>{class n extends V{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new k;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,r,o,s){super(),this._ngModelWarningConfig=o,this.callSetDisabledState=s,this._setValidators(e),this._setAsyncValidators(i),this.valueAccessor=ze(this,r)}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&ye(i,this,!1),ee(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}Ke(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&ye(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}static \u0275fac=function(i){return new(i||n)(c(D,10),c(F,10),c(te,10),c(Je,8),c(L,8))};static \u0275dir=d({type:n,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[m([Ui]),f,R]})}return n})(),$i={provide:g,useExisting:p(()=>Kt)},Kt=(()=>{class n extends g{callSetDisabledState;get submitted(){return T(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=P(()=>this._submittedReactive());_submittedReactive=A(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new k;constructor(e,i,r){super(),this.callSetDisabledState=r,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(_e(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return ee(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){ye(e.control||null,e,!1),ki(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),qt(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new me(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1),i?.emitEvent!==!1&&this.form._events.next(new ve(this.form))}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,r=this.form.get(e.path);i!==r&&(ye(i||null,e),Ni(r)&&(ee(r,e,this.callSetDisabledState),e.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);Bt(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&Vi(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){qe(this.form,this),this._oldForm&&_e(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(c(D,10),c(F,10),c(L,8))};static \u0275dir=d({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&G("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[m([$i]),f,R]})}return n})(),ji={provide:g,useExisting:p(()=>zt)},zt=(()=>{class n extends xi{name=null;constructor(e,i,r){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(r)}_checkParentType(){Zt(this._parent)}static \u0275fac=function(i){return new(i||n)(c(g,13),c(D,10),c(F,10))};static \u0275dir=d({type:n,selectors:[["","formGroupName",""]],inputs:{name:[0,"formGroupName","name"]},standalone:!1,features:[m([ji]),f]})}return n})(),Hi={provide:g,useExisting:p(()=>Jt)},Jt=(()=>{class n extends g{_parent;name=null;constructor(e,i,r){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(r)}ngOnInit(){Zt(this._parent),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective?.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return De(this.name==null?this.name:this.name.toString(),this._parent)}static \u0275fac=function(i){return new(i||n)(c(g,13),c(D,10),c(F,10))};static \u0275dir=d({type:n,selectors:[["","formArrayName",""]],inputs:{name:[0,"formArrayName","name"]},standalone:!1,features:[m([Hi]),f]})}return n})();function Zt(n){return!(n instanceof zt)&&!(n instanceof Kt)&&!(n instanceof Jt)}var Li={provide:V,useExisting:p(()=>Wi)},Wi=(()=>{class n extends V{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(e){}model;update=new k;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,r,o,s){super(),this._ngModelWarningConfig=s,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ze(this,o)}ngOnChanges(e){this._added||this._setUpControl(),Ke(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return De(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(i){return new(i||n)(c(g,13),c(D,10),c(F,10),c(te,10),c(Je,8))};static \u0275dir=d({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[m([Li]),f,R]})}return n})();function Yt(n){return typeof n=="number"?n:parseFloat(n)}var we=(()=>{class n{_validator=de;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):de,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=d({type:n,features:[R]})}return n})(),Gi={provide:D,useExisting:p(()=>Bi),multi:!0},Bi=(()=>{class n extends we{max;inputName="max";normalizeInput=e=>Yt(e);createValidator=e=>Et(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&W("max",r._enabled?r.max:null)},inputs:{max:"max"},standalone:!1,features:[m([Gi]),f]})}return n})(),qi={provide:D,useExisting:p(()=>Ki),multi:!0},Ki=(()=>{class n extends we{min;inputName="min";normalizeInput=e=>Yt(e);createValidator=e=>Mt(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&W("min",r._enabled?r.min:null)},inputs:{min:"min"},standalone:!1,features:[m([qi]),f]})}return n})(),zi={provide:D,useExisting:p(()=>Ji),multi:!0};var Ji=(()=>{class n extends we{required;inputName="required";normalizeInput=Me;createValidator=e=>Nt;enabled(e){return e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,r){i&2&&W("required",r._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[m([zi]),f]})}return n})();var Zi={provide:D,useExisting:p(()=>Yi),multi:!0},Yi=(()=>{class n extends we{pattern;inputName="pattern";normalizeInput=e=>e;createValidator=e=>xt(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275dir=d({type:n,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&W("pattern",r._enabled?r.pattern:null)},inputs:{pattern:"pattern"},standalone:!1,features:[m([Zi]),f]})}return n})();var Qt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=ae({type:n});static \u0275inj=se({})}return n})(),$e=class extends H{constructor(t,e,i){super(Ge(e),Be(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(t){return this.controls[this._adjustIndex(t)]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,i={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(t,e={}){let i=this._adjustIndex(t);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,i={}){let r=this._adjustIndex(t);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),e&&(this.controls.splice(r,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){Wt(this,!1,t),t.forEach((i,r)=>{Lt(this,!1,r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(t.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((i,r)=>{i.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_adjustIndex(t){return t<0?t+this.length:t}_syncPendingControls(){let t=this.controls.reduce((e,i)=>i._syncPendingControls()?!0:e,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){this.controls.forEach((e,i)=>{t(e,i)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_allControlsDisabled(){for(let t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}_find(t){return this.at(t)??null}};function Tt(n){return!!n&&(n.asyncValidators!==void 0||n.validators!==void 0||n.updateOn!==void 0)}var Qi=(()=>{class n{useNonNullable=!1;get nonNullable(){let e=new n;return e.useNonNullable=!0,e}group(e,i=null){let r=this._reduceControls(e),o={};return Tt(i)?o=i:i!==null&&(o.validators=i.validator,o.asyncValidators=i.asyncValidator),new x(r,o)}record(e,i=null){let r=this._reduceControls(e);return new Oe(r,i)}control(e,i,r){let o={};return this.useNonNullable?(Tt(i)?o=i:(o.validators=i,o.asyncValidators=r),new j(e,S(v({},o),{nonNullable:!0}))):new j(e,i,r)}array(e,i,r){let o=e.map(s=>this._createControl(s));return new $e(o,i,r)}_reduceControls(e){let i={};return Object.keys(e).forEach(r=>{i[r]=this._createControl(e[r])}),i}_createControl(e){if(e instanceof j)return e;if(e instanceof H)return e;if(Array.isArray(e)){let i=e[0],r=e.length>1?e[1]:null,o=e.length>2?e[2]:null;return this.control(i,r,o)}else return this.control(e)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Er=(()=>{class n extends Qi{group(e,i=null){return super.group(e,i)}control(e,i,r){return super.control(e,i,r)}array(e,i,r){return super.array(e,i,r)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=w(n)))(r||n)}})();static \u0275prov=C({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Nr=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:L,useValue:e.callSetDisabledState??Se}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=ae({type:n});static \u0275inj=se({imports:[Qt]})}return n})(),xr=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:Je,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:L,useValue:e.callSetDisabledState??Se}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=ae({type:n});static \u0275inj=se({imports:[Qt]})}return n})();export{M as a,K as b,vt as c,l as d,st as e,le as f,Fe as g,lt as h,gt as i,er as j,te as k,kt as l,D as m,yt as n,g as o,V as p,wr as q,Tr as r,x as s,Vr as t,Ei as u,j as v,kr as w,Ii as x,Mr as y,Pi as z,Oi as A,Kt as B,zt as C,Jt as D,Wi as E,Bi as F,Ki as G,Ji as H,Yi as I,Er as J,Nr as K,xr as L};
|