@mxtommy/kip 3.4.1 → 3.4.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/public/{chunk-VCFBXEUV.js → chunk-5FUAHCDM.js} +1 -1
  4. package/public/{chunk-AERKQXJA.js → chunk-5KKRPVJE.js} +15 -15
  5. package/public/{chunk-KP4DUCFG.js → chunk-5R5BV2XK.js} +1 -1
  6. package/public/{chunk-UMSIBYU7.js → chunk-BDMHNK6W.js} +1 -1
  7. package/public/{chunk-PYQ6T3Y3.js → chunk-BVMWKICM.js} +1 -1
  8. package/public/chunk-DAVKA3BG.js +1 -0
  9. package/public/{chunk-2GTOB75T.js → chunk-FRJM6ZUY.js} +1 -1
  10. package/public/{chunk-E6ASIJQQ.js → chunk-HZN6ZOWD.js} +1 -1
  11. package/public/{chunk-X2CUXUMC.js → chunk-JX2ORMOL.js} +1 -1
  12. package/public/{chunk-IMRKPLTP.js → chunk-NXU5RHTP.js} +1 -1
  13. package/public/{chunk-QBA5REXT.js → chunk-O6UODD7I.js} +1 -1
  14. package/public/{chunk-MRXTLXGU.js → chunk-OJAICHIT.js} +1 -1
  15. package/public/{chunk-OGPSK2OV.js → chunk-OKDNLHRI.js} +1 -1
  16. package/public/chunk-P457HUA5.js +8 -0
  17. package/public/{chunk-F5AFZMSJ.js → chunk-SE4IM4AK.js} +1 -1
  18. package/public/{chunk-SGY2DUWG.js → chunk-SK4FQEPS.js} +1 -1
  19. package/public/{chunk-EGXTT4GK.js → chunk-T7T34DNY.js} +1 -1
  20. package/public/{chunk-JITOBNFA.js → chunk-U7WT5AK3.js} +1 -1
  21. package/public/chunk-UPJO7TXR.js +4 -0
  22. package/public/{chunk-SZ4C5OKG.js → chunk-VTJ7KOEH.js} +1 -1
  23. package/public/{chunk-KUPVE24U.js → chunk-WVZ5YLYA.js} +1 -1
  24. package/public/{chunk-HTFWAMIE.js → chunk-WXPXINX2.js} +1 -1
  25. package/public/{chunk-GSG5IFZ7.js → chunk-WXZOPZRK.js} +1 -1
  26. package/public/{chunk-BK65F7S6.js → chunk-YEKIPLS4.js} +1 -1
  27. package/public/{chunk-IJ7MVHXO.js → chunk-ZI6ZQBWP.js} +1 -1
  28. package/public/{chunk-FQWKFMCL.js → chunk-ZZZPD7N5.js} +1 -1
  29. package/public/index.html +1 -1
  30. package/public/{main-NXRG2VPY.js → main-RY7FDAHK.js} +15 -16
  31. package/public/chunk-LJVNQ7AL.js +0 -8
  32. package/public/chunk-MS7A7ML2.js +0 -1
  33. package/public/chunk-VYP5YLKW.js +0 -4
@@ -0,0 +1,4 @@
1
+ import{$b as ue,A as ge,Aa as ji,B as Ai,Cb as ht,Fa as ut,Fb as P,H as Mi,Hd as Te,I as Di,Ia as $i,Ic as Ce,Ja as pt,K as Ei,L as be,Ld as L,M as xe,N as Fi,Na as Wi,Qa as re,Qc as Ki,Rb as Qe,Sb as F,Sd as we,Tb as R,Tc as gt,Uc as Gi,V as Ri,Wd as ti,Yb as ye,Zb as N,Zc as Xe,Zd as Xi,_ as Oi,_b as U,_c as Qi,ad as Ji,ce as er,da as Ii,dc as Hi,ec as Je,ed as ei,f as I,fa as Pi,fc as Ze,g as ct,ga as Ni,gc as oe,gd as Zi,h as Ci,ha as mt,hc as Zt,he as ke,hf as rr,ia as Ui,ic as V,j as qe,jc as Se,jf as or,kc as K,lb as k,lc as D,m as g,mc as E,n as Ti,nc as Bi,o as v,oa as y,ob as zi,oc as Ye,oe as tr,of as ar,p as he,pa as ve,pb as Ke,pc as Yt,pe as Ae,qc as Xt,qe as ii,r as wi,ra as H,sc as G,se as ir,t as ki,ta as c,te as Me,u as Jt,vc as Vi,vd as Yi,vf as nr,wb as Ge,wc as qi,x as j,xb as _e,yb as B,z as ft,za as Li}from"./chunk-5KKRPVJE.js";var f=function(t){return t.Disconnected="Disconnected",t.HTTPDiscovering="HTTPDiscovering",t.HTTPConnected="HTTPConnected",t.HTTPError="HTTPError",t.HTTPRetrying="HTTPRetrying",t.WebSocketConnecting="WebSocketConnecting",t.Connected="Connected",t.WebSocketError="WebSocketError",t.WebSocketRetrying="WebSocketRetrying",t.PermanentFailure="PermanentFailure",t}(f||{}),bt=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[1e3,2e3,4e3],notificationDebounceMs:0};_currentState$=new v(f.Disconnected);_status$=new v(this.createStatus(f.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(f.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(f.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(f.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(f.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===f.HTTPConnected||this.currentState===f.WebSocketRetrying||this.currentState===f.WebSocketConnecting||this.currentState===f.Connected))return this.currentState===f.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(f.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(f.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==f.HTTPConnected&&this.currentState!==f.WebSocketConnecting&&this.currentState!==f.Connected&&this.currentState!==f.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount<this.config.webSocketRetryCount?(this._webSocketRetryCount++,this.setState(f.WebSocketRetrying,`WebSocket connection failed. Retrying (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()):this.setState(f.PermanentFailure,`WebSocket connection failed after ${this.config.webSocketRetryCount} attempts. Server unreachable.`,this.config.webSocketRetryCount,this.config.webSocketRetryCount)}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(f.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===f.HTTPConnected||this.currentState===f.WebSocketConnecting||this.currentState===f.Connected||this.currentState===f.WebSocketRetrying}isFullyConnected(){return this.currentState===f.Connected}setState(e,i,o,a){this._currentState$.next(e);let n=this.createStatus(e,i,o,a);e===f.HTTPDiscovering||e===f.WebSocketConnecting?this._status$.next(n):e===f.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(n)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(n))}createStatus(e,i,o,a){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:o||0,maxRetries:a||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case f.Disconnected:return 0;case f.HTTPDiscovering:case f.WebSocketConnecting:return 1;case f.Connected:return 2;case f.HTTPError:case f.WebSocketError:case f.HTTPRetrying:case f.WebSocketRetrying:return 3;case f.HTTPConnected:return 2;case f.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(f.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer();let e=Math.min(this._webSocketRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${i}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(f.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},i)}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var De=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=c(bt);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new v({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new v(null);serverRoles=[];http=c(Te);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return I(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let o=new URL(e);if(!["http:","https:"].includes(o.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 j(this.http.get(i,{observe:"response"}).pipe(ft(5e3),xe(a=>{throw console.error("[Connection Service] HTTP Error details:",a),a.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")):a.status===0||a.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):a.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):a.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):a.status>=500?new Error(`Server error (${a.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${a.status}) - ${a.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(o){throw console.error(`[Connection Service] Validation failed for ${e}:`,o.message),o}})}initializeConnection(e,i,o){return I(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=o;let a={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(a),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let n=this.signalKURL.url;n.endsWith("signalk/")||(n+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let s=yield j(this.http.get(n,{observe:"response"}).pipe(ft(this.TIMEOUT_DURATION),xe(p=>(p.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Jt(p)))));console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(s.body.server.version);let l=s.body.endpoints.v1["signalk-http"],d=s.body.endpoints.v1["signalk-ws"];i?(console.debug("[Connection Service] Proxy Mode Enabled"),a.httpServiceUrl=window.location.origin+new URL(l).pathname,a.WsServiceUrl=(window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+new URL(d).pathname):(a.httpServiceUrl=l,a.WsServiceUrl=d),console.debug("[Connection Service] HTTP URI: "+a.httpServiceUrl),console.debug("[Connection Service] WebSocket URI: "+a.WsServiceUrl),a.operation=2,a.message=s.status.toString(),a.serverDescription=`${s.body.server.id} ${s.body.server.version}`,this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){a.operation=3,a.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{a.subscribeAll=!!o,this.serverServiceEndpoint$.next(a)}})}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 I(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 j(this.http.get(e,{observe:"response"}).pipe(ft(this.TIMEOUT_DURATION),xe(s=>(s.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Jt(s)))));console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(i.body.server.version);let o=i.body.endpoints.v1["signalk-http"],a=i.body.endpoints.v1["signalk-ws"],n={operation:2,message:"Connected",serverDescription:i.body.server.id,httpServiceUrl:null,WsServiceUrl:null};this.currentProxyEnabled?(console.debug("[Connection Service] Proxy Mode Enabled"),n.httpServiceUrl=window.location.origin+new URL(o).pathname,n.WsServiceUrl=(window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+new URL(a).pathname):(n.httpServiceUrl=o,n.WsServiceUrl=a),this.connectionStateMachine.onHTTPDiscoverySuccess(),n.subscribeAll=!!this.currentSubscribeAll,this.serverServiceEndpoint$.next(n)}catch(i){let o={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(o),this.handleError(i)}})}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,o){this.serverName=e,this.serverRoles=o,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(o)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Va=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ri=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let r=t.match(Va);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},sr=t=>t==="*"||t==="x"||t==="X",lr=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},qa=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],Ka=(t,r)=>{if(sr(t)||sr(r))return 0;let[e,i]=qa(lr(t),lr(r));return e>i?1:e<i?-1:0},oi=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=Ka(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var dr=(t,r)=>{let e=ri(t),i=ri(r),o=e.pop(),a=i.pop(),n=oi(e,i);return n!==0?n:o&&a?oi(o.split("."),a.split(".")):o||a?o?-1:1:0};var ai=(t,r,e)=>{Ga(e);let i=dr(t,r);return fr[e].includes(i)},fr={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},cr=Object.keys(fr),Ga=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(cr.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${cr.join("|")}`)};var mr=(()=>{class t{server=c(De);http=c(Te);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;storageServiceReady$=new g;patchQueue$=new g;patch=function(e){return this.http.post(e.url,e.document).pipe(Ui(()=>console.log("[Storage Service] Remote config patch request completed successfully")),xe(i=>this.handleError(i)))};constructor(){let e=this.server;e.serverServiceEndpoint$.subscribe(i=>{i.httpServiceUrl!==null&&(this.serverEndpoint=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4)+"applicationData/",console.log("[Storage Service] Service startup. AppData API set to: "+this.serverEndpoint)),i.operation===2?this.storageServiceReady$.next(!0):this.storageServiceReady$.next(!1)}),e.serverVersion$.subscribe(i=>{i&&(this.isAppDataSupported=ai(i,"1.27.0",">="))}),this.patchQueue$.pipe(Fi(i=>this.patch(i))).subscribe(()=>{})}listConfigs(e){return I(this,null,function*(){let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let o=this.serverEndpoint,a=o+"global/kip/"+this.configFileVersion+"/?keys=true",n=o+"user/kip/"+this.configFileVersion+"/?keys=true";return e&&(a=o+"global/kip/"+e+"/?keys=true",n=o+"user/kip/"+e+"/?keys=true"),yield j(this.http.get(a)).then(s=>{for(let l of s)i.push({scope:"global",name:l});console.log("[Storage Service] Retrieved Global config list")}).catch(s=>{this.handleError(s)}),yield j(this.http.get(n)).then(s=>{for(let l of s)i.push({scope:"user",name:l});console.log("[Storage Service] Retrieved User config list")}).catch(s=>{this.handleError(s)}),i})}getConfig(e,i,o,a){return I(this,null,function*(){let n=null,s=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+i;return o&&(s=this.serverEndpoint+e+"/kip/"+o+"/"+i),yield j(this.http.get(s)).then(l=>{n=l,console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`),a&&(this.InitConfig=l)}).catch(l=>{this.handleError(l)}),n})}setConfig(e,i,o,a){return I(this,null,function*(){let n=this.serverEndpoint+e+"/kip/"+this.configFileVersion+"/"+i,s=null;return a&&(n=this.serverEndpoint+e+"/kip/"+a+"/"+i),yield j(this.http.post(n,o)).then(l=>{console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),s=l}).catch(l=>{this.handleError(l)}),s})}patchConfig(e,i,o){let a=this.serverEndpoint+"user/kip/"+this.configFileVersion,n;switch(o&&(a=this.serverEndpoint+"user/kip/"+o),e){case"IAppConfig":n=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:i}];break;case"IThemeConfig":n=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:i.themeName}];break;case"IWidgetConfig":n=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:i}];break;case"ILayoutConfig":n=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:i}];break;case"Dashboards":n=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:i}];break;case"Array<IUnitDefaults>":n=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:i}];break;case"Array<IDatasetDef>":n=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:i}];break;case"INotificationConfig":n=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:i}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let s={url:a,document:n};this.patchQueue$.next(s)}patchGlobal(e,i,o,a,n){let s=this.serverEndpoint+i+"/kip/"+this.configFileVersion;n&&(s=this.serverEndpoint+i+"/kip/"+n);let l;switch(a){case"add":l=[{op:"add",path:`/${e}`,value:o}];break;case"replace":l=[{op:"replace",path:`/${e}`,value:o}];break;case"remove":l=[{op:"remove",path:`/${e}`,value:o}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let d={url:s,document:l};this.patchQueue$.next(d)}removeItem(e,i,o){let a=this.serverEndpoint+e+"/kip/"+this.configFileVersion;o&&(a=this.serverEndpoint+e+"/kip/"+o);let n=[{op:"remove",path:`/${i}`}],s={url:a,document:n};this.patchQueue$.next(s)}clear(){}set activeConfigFileVersion(e){this.configFileVersion=e}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ae=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}};var et={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 xt={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 ur={configVersion:11,autoNightMode:!0,redNightMode:!1,nightModeBrightness:.27,dataSets:[],unitDefaults:xt,notificationConfig:et},pr={themeName:""};var hr={configVersion:11,kipUUID:ae.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var ni={configVersion:11,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,dataSets:[{uuid:"afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",path:"self.environment.wind.speedApparent",pathSource:"default",period:1,baseUnit:"m/s",label:"self.environment.wind.speedApparent, Source: default, Scale: minute, Period: 1",timeScaleFormat:"minute"}],unitDefaults:{Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"},notificationConfig:{disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}}},si=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",configuration:[{w:3,h:4,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,numInt:1,color:"yellow",enableTimeout:!1,dataTimeout:5}}},x:0,y:0},{w:5,h:10,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-wind-steer",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},courseOverGround:{description:"Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint Bearing",path:"self.navigation.courseGreatCircle.nextPoint.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:3,y:0},{w:4,h:6,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-gauge-ng-radial",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,compassUseNumbers:!1},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5}}},x:8,y:0},{w:3,h:4,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,numInt:1,color:"contrast",enableTimeout:!1,dataTimeout:5}}},x:0,y:4},{w:4,h:6,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-data-chart",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,convertUnitTo:"knots",datasetUUID:"afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",invertData:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalGraph:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"green"}}},x:8,y:6},{w:3,h:4,id:"05414722-733a-4483-89b0-07f3945ffd97",selector:"widget-numeric",input:{widgetProperties:{type:"widget-numeric",uuid:"05414722-733a-4483-89b0-07f3945ffd97",config:{displayName:"Engine Room",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.inside.engineRoom.temperature",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"celsius",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,numInt:1,color:"blue",enableTimeout:!1,dataTimeout:5}}},x:0,y:8},{w:5,h:2,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-simple-linear",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.0.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,color:"green",enableTimeout:!1,dataTimeout:5}}},x:3,y:10}]},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",configuration:[{x:0,y:0,w:8,h:12,id:"488d620a-37d4-4b98-849d-304cd18003e9",selector:"widget-freeboardsk",input:{widgetProperties:{type:"widget-freeboardsk",uuid:"488d620a-37d4-4b98-849d-304cd18003e9"}}},{x:8,y:0,w:2,h:3,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-gauge-ng-compass",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",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"}}}}]}],li={themeName:""};var Hm={configVersion:11,kipUUID:ae.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Qa="",Ja=11,tt=11,eu=(()=>{class t{storage=c(mr);unitDefaults=new v({});themeName=new v(Qa);kipKNotificationConfig=new v(et);autoNightMode=new v(!1);redNightMode=new v(!1);nightModeBrightness=new v(1);proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=pt(!1);constructor(){if(console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=Ja,!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!==tt&&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=>I(this,null,function*(){for(let o of i)try{if((yield this.storage.getConfig(o.scope,o.name,9)).app?.configVersion===10){this.configUpgrade.set(!0),console.log("[AppSettings Service] Configuration upgrade required for version 10.");break}}catch(a){console.error(`[AppSettings Service] Error fetching configuration for ${o.name}:`,a)}})).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!==tt)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}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()}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.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.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,o){let a=JSON.stringify(i);localStorage.setItem(e,a),o&&this.reloadApp()}loadDemoConfig(){if(this.useSharedConfig){let e={app:ni,dashboards:si,theme:li};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",ni),this.replaceConfig("dashboardsConfig",si),this.replaceConfig("themeConfig",li,!0)}reloadApp(){console.log("[AppSettings Service] Reload app"),location.replace("./")}buildAppStorageObject(){return{configVersion:tt,autoNightMode:this.autoNightMode.getValue(),redNightMode:this.redNightMode.getValue(),nightModeBrightness:this.nightModeBrightness.getValue(),dataSets:this.dataSets,unitDefaults:this.unitDefaults.getValue(),notificationConfig:this.kipKNotificationConfig.getValue()}}buildConnectionStorageObject(){return{configVersion:tt,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=ur;return e.notificationConfig=et,e.unitDefaults=xt,e.configVersion=tt,localStorage.setItem("appConfig",JSON.stringify(e)),e}getDefaultConnectionConfig(){let e=hr;return e.kipUUID=ae.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=pr;return localStorage.setItem("themeConfig",JSON.stringify(e)),e}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Za(){this.__data__=[],this.size=0}var gr=Za;function Ya(t,r){return t===r||t!==t&&r!==r}var Q=Ya;function Xa(t,r){for(var e=t.length;e--;)if(Q(t[e][0],r))return e;return-1}var ne=Xa;var en=Array.prototype,tn=en.splice;function rn(t){var r=this.__data__,e=ne(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():tn.call(r,e,1),--this.size,!0}var br=rn;function on(t){var r=this.__data__,e=ne(r,t);return e<0?void 0:r[e][1]}var xr=on;function an(t){return ne(this.__data__,t)>-1}var vr=an;function nn(t,r){var e=this.__data__,i=ne(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var _r=nn;function Ee(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Ee.prototype.clear=gr;Ee.prototype.delete=br;Ee.prototype.get=xr;Ee.prototype.has=vr;Ee.prototype.set=_r;var se=Ee;function sn(){this.__data__=new se,this.size=0}var yr=sn;function ln(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var Sr=ln;function dn(t){return this.__data__.get(t)}var Cr=dn;function cn(t){return this.__data__.has(t)}var Tr=cn;var fn=typeof global=="object"&&global&&global.Object===Object&&global,vt=fn;var mn=typeof self=="object"&&self&&self.Object===Object&&self,un=vt||mn||Function("return this")(),S=un;var pn=S.Symbol,W=pn;var wr=Object.prototype,hn=wr.hasOwnProperty,gn=wr.toString,it=W?W.toStringTag:void 0;function bn(t){var r=hn.call(t,it),e=t[it];try{t[it]=void 0;var i=!0}catch{}var o=gn.call(t);return i&&(r?t[it]=e:delete t[it]),o}var kr=bn;var xn=Object.prototype,vn=xn.toString;function _n(t){return vn.call(t)}var Ar=_n;var yn="[object Null]",Sn="[object Undefined]",Mr=W?W.toStringTag:void 0;function Cn(t){return t==null?t===void 0?Sn:yn:Mr&&Mr in Object(t)?kr(t):Ar(t)}var q=Cn;function Tn(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var A=Tn;var wn="[object AsyncFunction]",kn="[object Function]",An="[object GeneratorFunction]",Mn="[object Proxy]";function Dn(t){if(!A(t))return!1;var r=q(t);return r==kn||r==An||r==wn||r==Mn}var Fe=Dn;var En=S["__core-js_shared__"],_t=En;var Dr=function(){var t=/[^.]+$/.exec(_t&&_t.keys&&_t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Fn(t){return!!Dr&&Dr in t}var Er=Fn;var Rn=Function.prototype,On=Rn.toString;function In(t){if(t!=null){try{return On.call(t)}catch{}try{return t+""}catch{}}return""}var Y=In;var Pn=/[\\^$.*+?()[\]{}|]/g,Nn=/^\[object .+?Constructor\]$/,Un=Function.prototype,Ln=Object.prototype,jn=Un.toString,$n=Ln.hasOwnProperty,Wn=RegExp("^"+jn.call($n).replace(Pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zn(t){if(!A(t)||Er(t))return!1;var r=Fe(t)?Wn:Nn;return r.test(Y(t))}var Fr=zn;function Hn(t,r){return t?.[r]}var Rr=Hn;function Bn(t,r){var e=Rr(t,r);return Fr(e)?e:void 0}var O=Bn;var Vn=O(S,"Map"),le=Vn;var qn=O(Object,"create"),X=qn;function Kn(){this.__data__=X?X(null):{},this.size=0}var Or=Kn;function Gn(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Ir=Gn;var Qn="__lodash_hash_undefined__",Jn=Object.prototype,Zn=Jn.hasOwnProperty;function Yn(t){var r=this.__data__;if(X){var e=r[t];return e===Qn?void 0:e}return Zn.call(r,t)?r[t]:void 0}var Pr=Yn;var Xn=Object.prototype,es=Xn.hasOwnProperty;function ts(t){var r=this.__data__;return X?r[t]!==void 0:es.call(r,t)}var Nr=ts;var is="__lodash_hash_undefined__";function rs(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=X&&r===void 0?is:r,this}var Ur=rs;function Re(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Re.prototype.clear=Or;Re.prototype.delete=Ir;Re.prototype.get=Pr;Re.prototype.has=Nr;Re.prototype.set=Ur;var di=Re;function os(){this.size=0,this.__data__={hash:new di,map:new(le||se),string:new di}}var Lr=os;function as(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var jr=as;function ns(t,r){var e=t.__data__;return jr(r)?e[typeof r=="string"?"string":"hash"]:e.map}var de=ns;function ss(t){var r=de(this,t).delete(t);return this.size-=r?1:0,r}var $r=ss;function ls(t){return de(this,t).get(t)}var Wr=ls;function ds(t){return de(this,t).has(t)}var zr=ds;function cs(t,r){var e=de(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Hr=cs;function Oe(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Oe.prototype.clear=Lr;Oe.prototype.delete=$r;Oe.prototype.get=Wr;Oe.prototype.has=zr;Oe.prototype.set=Hr;var yt=Oe;var fs=200;function ms(t,r){var e=this.__data__;if(e instanceof se){var i=e.__data__;if(!le||i.length<fs-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new yt(i)}return e.set(t,r),this.size=e.size,this}var Br=ms;function Ie(t){var r=this.__data__=new se(t);this.size=r.size}Ie.prototype.clear=yr;Ie.prototype.delete=Sr;Ie.prototype.get=Cr;Ie.prototype.has=Tr;Ie.prototype.set=Br;var ce=Ie;function us(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var Vr=us;var ps=function(){try{var t=O(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Pe=ps;function hs(t,r,e){r=="__proto__"&&Pe?Pe(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Ne=hs;var gs=Object.prototype,bs=gs.hasOwnProperty;function xs(t,r,e){var i=t[r];(!(bs.call(t,r)&&Q(i,e))||e===void 0&&!(r in t))&&Ne(t,r,e)}var St=xs;function vs(t,r,e,i){var o=!e;e||(e={});for(var a=-1,n=r.length;++a<n;){var s=r[a],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),o?Ne(e,s,l):St(e,s,l)}return e}var J=vs;function _s(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var qr=_s;function ys(t){return t!=null&&typeof t=="object"}var w=ys;var Ss="[object Arguments]";function Cs(t){return w(t)&&q(t)==Ss}var ci=Cs;var Kr=Object.prototype,Ts=Kr.hasOwnProperty,ws=Kr.propertyIsEnumerable,ks=ci(function(){return arguments}())?ci:function(t){return w(t)&&Ts.call(t,"callee")&&!ws.call(t,"callee")},rt=ks;var As=Array.isArray,z=As;function Ms(){return!1}var Gr=Ms;var Zr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qr=Zr&&typeof module=="object"&&module&&!module.nodeType&&module,Ds=Qr&&Qr.exports===Zr,Jr=Ds?S.Buffer:void 0,Es=Jr?Jr.isBuffer:void 0,Fs=Es||Gr,ee=Fs;var Rs=9007199254740991,Os=/^(?:0|[1-9]\d*)$/;function Is(t,r){var e=typeof t;return r=r??Rs,!!r&&(e=="number"||e!="symbol"&&Os.test(t))&&t>-1&&t%1==0&&t<r}var Ct=Is;var Ps=9007199254740991;function Ns(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ps}var Tt=Ns;var Us="[object Arguments]",Ls="[object Array]",js="[object Boolean]",$s="[object Date]",Ws="[object Error]",zs="[object Function]",Hs="[object Map]",Bs="[object Number]",Vs="[object Object]",qs="[object RegExp]",Ks="[object Set]",Gs="[object String]",Qs="[object WeakMap]",Js="[object ArrayBuffer]",Zs="[object DataView]",Ys="[object Float32Array]",Xs="[object Float64Array]",el="[object Int8Array]",tl="[object Int16Array]",il="[object Int32Array]",rl="[object Uint8Array]",ol="[object Uint8ClampedArray]",al="[object Uint16Array]",nl="[object Uint32Array]",_={};_[Ys]=_[Xs]=_[el]=_[tl]=_[il]=_[rl]=_[ol]=_[al]=_[nl]=!0;_[Us]=_[Ls]=_[Js]=_[js]=_[Zs]=_[$s]=_[Ws]=_[zs]=_[Hs]=_[Bs]=_[Vs]=_[qs]=_[Ks]=_[Gs]=_[Qs]=!1;function sl(t){return w(t)&&Tt(t.length)&&!!_[q(t)]}var Yr=sl;function ll(t){return function(r){return t(r)}}var Ue=ll;var Xr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ot=Xr&&typeof module=="object"&&module&&!module.nodeType&&module,dl=ot&&ot.exports===Xr,fi=dl&&vt.process,cl=function(){try{var t=ot&&ot.require&&ot.require("util").types;return t||fi&&fi.binding&&fi.binding("util")}catch{}}(),te=cl;var eo=te&&te.isTypedArray,fl=eo?Ue(eo):Yr,Le=fl;var ml=Object.prototype,ul=ml.hasOwnProperty;function pl(t,r){var e=z(t),i=!e&&rt(t),o=!e&&!i&&ee(t),a=!e&&!i&&!o&&Le(t),n=e||i||o||a,s=n?qr(t.length,String):[],l=s.length;for(var d in t)(r||ul.call(t,d))&&!(n&&(d=="length"||o&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ct(d,l)))&&s.push(d);return s}var wt=pl;var hl=Object.prototype;function gl(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||hl;return t===e}var je=gl;function bl(t,r){return function(e){return t(r(e))}}var kt=bl;var xl=kt(Object.keys,Object),to=xl;var vl=Object.prototype,_l=vl.hasOwnProperty;function yl(t){if(!je(t))return to(t);var r=[];for(var e in Object(t))_l.call(t,e)&&e!="constructor"&&r.push(e);return r}var io=yl;function Sl(t){return t!=null&&Tt(t.length)&&!Fe(t)}var fe=Sl;function Cl(t){return fe(t)?wt(t):io(t)}var $e=Cl;function Tl(t,r){return t&&J(r,$e(r),t)}var ro=Tl;function wl(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var oo=wl;var kl=Object.prototype,Al=kl.hasOwnProperty;function Ml(t){if(!A(t))return oo(t);var r=je(t),e=[];for(var i in t)i=="constructor"&&(r||!Al.call(t,i))||e.push(i);return e}var ao=Ml;function Dl(t){return fe(t)?wt(t,!0):ao(t)}var Z=Dl;function El(t,r){return t&&J(r,Z(r),t)}var no=El;var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,so=fo&&typeof module=="object"&&module&&!module.nodeType&&module,Fl=so&&so.exports===fo,lo=Fl?S.Buffer:void 0,co=lo?lo.allocUnsafe:void 0;function Rl(t,r){if(r)return t.slice();var e=t.length,i=co?co(e):new t.constructor(e);return t.copy(i),i}var At=Rl;function Ol(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var Mt=Ol;function Il(t,r){for(var e=-1,i=t==null?0:t.length,o=0,a=[];++e<i;){var n=t[e];r(n,e,t)&&(a[o++]=n)}return a}var mo=Il;function Pl(){return[]}var Dt=Pl;var Nl=Object.prototype,Ul=Nl.propertyIsEnumerable,uo=Object.getOwnPropertySymbols,Ll=uo?function(t){return t==null?[]:(t=Object(t),mo(uo(t),function(r){return Ul.call(t,r)}))}:Dt,We=Ll;function jl(t,r){return J(t,We(t),r)}var po=jl;function $l(t,r){for(var e=-1,i=r.length,o=t.length;++e<i;)t[o+e]=r[e];return t}var Et=$l;var Wl=kt(Object.getPrototypeOf,Object),ze=Wl;var zl=Object.getOwnPropertySymbols,Hl=zl?function(t){for(var r=[];t;)Et(r,We(t)),t=ze(t);return r}:Dt,Ft=Hl;function Bl(t,r){return J(t,Ft(t),r)}var ho=Bl;function Vl(t,r,e){var i=r(t);return z(t)?i:Et(i,e(t))}var Rt=Vl;function ql(t){return Rt(t,$e,We)}var at=ql;function Kl(t){return Rt(t,Z,Ft)}var go=Kl;var Gl=O(S,"DataView"),Ot=Gl;var Ql=O(S,"Promise"),It=Ql;var Jl=O(S,"Set"),Pt=Jl;var Zl=O(S,"WeakMap"),Nt=Zl;var bo="[object Map]",Yl="[object Object]",xo="[object Promise]",vo="[object Set]",_o="[object WeakMap]",yo="[object DataView]",Xl=Y(Ot),ed=Y(le),td=Y(It),id=Y(Pt),rd=Y(Nt),pe=q;(Ot&&pe(new Ot(new ArrayBuffer(1)))!=yo||le&&pe(new le)!=bo||It&&pe(It.resolve())!=xo||Pt&&pe(new Pt)!=vo||Nt&&pe(new Nt)!=_o)&&(pe=function(t){var r=q(t),e=r==Yl?t.constructor:void 0,i=e?Y(e):"";if(i)switch(i){case Xl:return yo;case ed:return bo;case td:return xo;case id:return vo;case rd:return _o}return r});var ie=pe;var od=Object.prototype,ad=od.hasOwnProperty;function nd(t){var r=t.length,e=new t.constructor(r);return r&&typeof t[0]=="string"&&ad.call(t,"index")&&(e.index=t.index,e.input=t.input),e}var So=nd;var sd=S.Uint8Array,He=sd;function ld(t){var r=new t.constructor(t.byteLength);return new He(r).set(new He(t)),r}var Be=ld;function dd(t,r){var e=r?Be(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var Co=dd;var cd=/\w*$/;function fd(t){var r=new t.constructor(t.source,cd.exec(t));return r.lastIndex=t.lastIndex,r}var To=fd;var wo=W?W.prototype:void 0,ko=wo?wo.valueOf:void 0;function md(t){return ko?Object(ko.call(t)):{}}var Ao=md;function ud(t,r){var e=r?Be(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Ut=ud;var pd="[object Boolean]",hd="[object Date]",gd="[object Map]",bd="[object Number]",xd="[object RegExp]",vd="[object Set]",_d="[object String]",yd="[object Symbol]",Sd="[object ArrayBuffer]",Cd="[object DataView]",Td="[object Float32Array]",wd="[object Float64Array]",kd="[object Int8Array]",Ad="[object Int16Array]",Md="[object Int32Array]",Dd="[object Uint8Array]",Ed="[object Uint8ClampedArray]",Fd="[object Uint16Array]",Rd="[object Uint32Array]";function Od(t,r,e){var i=t.constructor;switch(r){case Sd:return Be(t);case pd:case hd:return new i(+t);case Cd:return Co(t,e);case Td:case wd:case kd:case Ad:case Md:case Dd:case Ed:case Fd:case Rd:return Ut(t,e);case gd:return new i;case bd:case _d:return new i(t);case xd:return To(t);case vd:return new i;case yd:return Ao(t)}}var Mo=Od;var Do=Object.create,Id=function(){function t(){}return function(r){if(!A(r))return{};if(Do)return Do(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}(),Eo=Id;function Pd(t){return typeof t.constructor=="function"&&!je(t)?Eo(ze(t)):{}}var Lt=Pd;var Nd="[object Map]";function Ud(t){return w(t)&&ie(t)==Nd}var Fo=Ud;var Ro=te&&te.isMap,Ld=Ro?Ue(Ro):Fo,Oo=Ld;var jd="[object Set]";function $d(t){return w(t)&&ie(t)==jd}var Io=$d;var Po=te&&te.isSet,Wd=Po?Ue(Po):Io,No=Wd;var zd=1,Hd=2,Bd=4,Uo="[object Arguments]",Vd="[object Array]",qd="[object Boolean]",Kd="[object Date]",Gd="[object Error]",Lo="[object Function]",Qd="[object GeneratorFunction]",Jd="[object Map]",Zd="[object Number]",jo="[object Object]",Yd="[object RegExp]",Xd="[object Set]",ec="[object String]",tc="[object Symbol]",ic="[object WeakMap]",rc="[object ArrayBuffer]",oc="[object DataView]",ac="[object Float32Array]",nc="[object Float64Array]",sc="[object Int8Array]",lc="[object Int16Array]",dc="[object Int32Array]",cc="[object Uint8Array]",fc="[object Uint8ClampedArray]",mc="[object Uint16Array]",uc="[object Uint32Array]",b={};b[Uo]=b[Vd]=b[rc]=b[oc]=b[qd]=b[Kd]=b[ac]=b[nc]=b[sc]=b[lc]=b[dc]=b[Jd]=b[Zd]=b[jo]=b[Yd]=b[Xd]=b[ec]=b[tc]=b[cc]=b[fc]=b[mc]=b[uc]=!0;b[Gd]=b[Lo]=b[ic]=!1;function jt(t,r,e,i,o,a){var n,s=r&zd,l=r&Hd,d=r&Bd;if(e&&(n=o?e(t,i,o,a):e(t)),n!==void 0)return n;if(!A(t))return t;var p=z(t);if(p){if(n=So(t),!s)return Mt(t,n)}else{var u=ie(t),m=u==Lo||u==Qd;if(ee(t))return At(t,s);if(u==jo||u==Uo||m&&!o){if(n=l||m?{}:Lt(t),!s)return l?ho(t,no(n,t)):po(t,ro(n,t))}else{if(!b[u])return o?t:{};n=Mo(t,u,s)}}a||(a=new ce);var x=a.get(t);if(x)return x;a.set(t,n),No(t)?t.forEach(function(C){n.add(jt(C,r,e,C,t,a))}):Oo(t)&&t.forEach(function(C,M){n.set(M,jt(C,r,e,M,t,a))});var h=d?l?go:at:l?Z:$e,T=p?void 0:h(t);return Vr(T||t,function(C,M){T&&(M=C,C=t[M]),St(n,M,jt(C,r,e,M,t,a))}),n}var $o=jt;var pc=1,hc=4;function gc(t){return $o(t,pc|hc)}var mi=gc;var bc="/signalk/v1/",Wo="auth/login",xc="auth/logout",vc="auth/validate",_c=60,zo=(()=>{class t{http=c(Te);conn=c(De);_IsLoggedIn$=new v(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new v(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(be(i=>!!i&&i.expiry!==null),Ri((i,o)=>i.expiry===o.expiry),ge(i=>{let o=this.getTokenExpirationDate(i.expiry,_c),a=o.getTime()-Date.now();return console.log(`[Authentication Service] Token refresh timer set for ${a} ms (Token Expiry: ${o.toISOString()})`),Math.max(a,0)}),Ni(i=>Di(i))).subscribe(()=>{this.handleTokenRenewal()}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let o=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=o+Wo,this.logoutUrl=o+xc,this.validateTokenUrl=o+vc}})}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(o=>{console.error("[Authentication Service] Token renewal failed. Server returned:",o.error)}).finally(()=>{this.isRenewingToken=!1})}}login(a){return I(this,arguments,function*({usr:e,pwd:i,newUrl:o}){let n;if(o?n=o.replace(/\/+$/,"")+bc+Wo:n=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!n)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield j(this.http.post(n,{username:e,password:i},{observe:"response"})).then(s=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(s.body.token)}).catch(s=>{this.deleteToken(),this.handleError(s)})})}handleError(e){throw e.status===0?(console.error("[Authentication Service] An error occurred:",e.error),this.deleteToken()):console.error(`[Authentication Service] Backend returned code ${e.status}, body was: `,e.error),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,o={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(o.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let o=new Date(0);if(i){let a=new Date(0);a.setUTCSeconds(e-i),o=a}else o.setUTCSeconds(e);return o}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return I(this,null,function*(){localStorage.removeItem("authorization_token"),yield j(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,o={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(o.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(o.token=e,o.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(o.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(o),localStorage.setItem("authorization_token",JSON.stringify(o)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var yc={url:"",deserializer:t=>JSON.parse(t.data),serializer:t=>JSON.stringify(t)},Sc="WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }",$t=class t extends Ti{constructor(r,e){if(super(),this._socket=null,r instanceof qe)this.destination=e,this.source=r;else{let i=this._config=Object.assign({},yc);if(this._output=new g,typeof r=="string")i.url=r;else for(let o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);if(!i.WebSocketCtor&&WebSocket)i.WebSocketCtor=WebSocket;else if(!i.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new he}}lift(r){let e=new t(this._config,this.destination);return e.operator=r,e.source=this,e}_resetState(){this._socket=null,this.source||(this.destination=new he),this._output=new g}multiplex(r,e,i){let o=this;return new qe(a=>{try{o.next(r())}catch(s){a.error(s)}let n=o.subscribe({next:s=>{try{i(s)&&a.next(s)}catch(l){a.error(l)}},error:s=>a.error(s),complete:()=>a.complete()});return()=>{try{o.next(e())}catch(s){a.error(s)}n.unsubscribe()}})}_connectSocket(){let{WebSocketCtor:r,protocol:e,url:i,binaryType:o}=this._config,a=this._output,n=null;try{n=e?new r(i,e):new r(i),this._socket=n,o&&(this._socket.binaryType=o)}catch(l){a.error(l);return}let s=new ct(()=>{this._socket=null,n&&n.readyState===1&&n.close()});n.onopen=l=>{let{_socket:d}=this;if(!d){n.close(),this._resetState();return}let{openObserver:p}=this._config;p&&p.next(l);let u=this.destination;this.destination=Ci.create(m=>{if(n.readyState===1)try{let{serializer:x}=this._config;n.send(x(m))}catch(x){this.destination.error(x)}},m=>{let{closingObserver:x}=this._config;x&&x.next(void 0),m&&m.code?n.close(m.code,m.reason):a.error(new TypeError(Sc)),this._resetState()},()=>{let{closingObserver:m}=this._config;m&&m.next(void 0),n.close(),this._resetState()}),u&&u instanceof he&&s.add(u.subscribe(this.destination))},n.onerror=l=>{this._resetState(),a.error(l)},n.onclose=l=>{n===this._socket&&this._resetState();let{closeObserver:d}=this._config;d&&d.next(l),l.wasClean?a.complete():a.error(l)},n.onmessage=l=>{try{let{deserializer:d}=this._config;a.next(d(l))}catch(d){a.error(d)}}}_subscribe(r){let{source:e}=this;return e?e.subscribe(r):(this._socket||this._connectSocket(),this._output.subscribe(r),r.add(()=>{let{_socket:i}=this;this._output.observers.length===0&&(i&&(i.readyState===1||i.readyState===0)&&i.close(),this._resetState())}),r)}unsubscribe(){let{_socket:r}=this;r&&(r.readyState===1||r.readyState===0)&&r.close(),this._resetState(),super.unsubscribe()}};function ui(t){return new $t(t)}var Ho=(()=>{class t{_destroyRef=c(ut);_skRequests$=new g;_skNotificationsMsg$=new g;_skValue$=new g;_skMetadata$=new g;_vesselSelfUrn$=new g;_selfUrn=void 0;streamEndpoint={operation:0,message:"Not connected",hasToken:!1};streamEndpoint$=new v(this.streamEndpoint);endpointWS=null;SubscriptionType="self";WS_CONNECTION_SUBSCRIBE="?subscribe=";WS_CONNECTION_META="&sendMeta=all";socketWS$;socketWSCloseEvent$=new g;socketWSOpenEvent$=new g;authToken=null;server=c(De);auth=c(zo);connectionStateMachine=c(bt);zones=c(P);FLATTEN_CONFIG={maxDepth:3,maxObjectSize:20,enableFlattening:!0};constructor(){this.connectionStateMachine.setWebSocketRetryCallback(()=>{console.log("[Delta Service] Executing WebSocket retry via callback"),this.retryWebSocketConnection()}),this.server.serverServiceEndpoint$.pipe(L(this._destroyRef)).subscribe(e=>{e.operation===2&&(this.endpointWS=e.WsServiceUrl,e.subscribeAll?this.SubscriptionType="all":this.SubscriptionType="self")}),this.connectionStateMachine.state$.pipe(L(this._destroyRef)).subscribe(e=>{switch(e){case f.WebSocketConnecting:this.handleWebSocketConnecting();break;case f.Connected:break;case f.Disconnected:case f.WebSocketError:case f.PermanentFailure:this.handleDisconnection();break}}),this.auth.authToken$.pipe(L(this._destroyRef)).subscribe(e=>{this.authToken!=e&&(this.authToken=e,this.socketWS$&&this.connectionStateMachine.isFullyConnected()&&(this.closeWS("Token changed"),this.connectionStateMachine.startWebSocketConnection()))}),this.socketWSOpenEvent$.pipe(L(this._destroyRef)).subscribe(()=>{this.streamEndpoint.message="Connected",this.streamEndpoint.operation=2,this.authToken?console.log("[Delta Service] WebSocket connected with Authorization Token"):console.log("[Delta Service] WebSocket connected without Authorization Token"),this.streamEndpoint$.next(this.streamEndpoint),this.connectionStateMachine.onWebSocketConnected()}),this.socketWSCloseEvent$.pipe(L(this._destroyRef)).subscribe(e=>{e.wasClean?(console.log("[Delta Service] WebSocket closed cleanly"),this.streamEndpoint.message="WebSocket closed",this.streamEndpoint.operation=0):(console.log("[Delta Service] WebSocket terminated due to socket error"),this.streamEndpoint.message="WebSocket error",this.streamEndpoint.operation=3,this.connectionStateMachine.onWebSocketError("WebSocket connection lost")),this.streamEndpoint$.next(this.streamEndpoint)}),Mi(document,"visibilitychange").pipe(L(this._destroyRef)).subscribe(()=>{document.visibilityState==="visible"?(console.log("[Delta Service] App resumed, checking WebSocket connection..."),this.checkAndReconnect("App resumed")):document.visibilityState==="hidden"&&console.log("[Delta Service] App suspended")})}connectWS(e){this.streamEndpoint.message="Connecting",this.streamEndpoint.operation=1,console.log(`[Delta Service] ${e}: WebSocket opening...`),this.streamEndpoint$.next(this.streamEndpoint),this.socketWS$=this.getNewWebSocket(),this.zones.runOutsideAngular(()=>{this.socketWS$.pipe(L(this._destroyRef)).subscribe({next:i=>this.processWebsocketMessage(i),error:i=>{console.error("[Delta Service] WebSocket error:",i)}})})}retryWebSocketConnection(){if(console.log("[Delta Service] Retrying WebSocket connection"),!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available for retry"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Retrying connection"),this.connectWS("WebSocket retry attempt")}handleWebSocketConnecting(){if(!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Starting new connection"),this.connectWS("ConnectionStateMachine request")}handleDisconnection(){this.socketWS$&&this.closeWS("ConnectionStateMachine disconnection"),this.streamEndpoint.message="Not connected",this.streamEndpoint.operation=0,this.streamEndpoint$.next(this.streamEndpoint)}getNewWebSocket(){let e=this.WS_CONNECTION_SUBSCRIBE+this.SubscriptionType+this.WS_CONNECTION_META;return this.authToken!=null?(e+="&token="+this.authToken.token,this.streamEndpoint.hasToken=!0):this.streamEndpoint.hasToken=!1,ui({url:this.endpointWS+e,closeObserver:this.socketWSCloseEvent$,openObserver:this.socketWSOpenEvent$})}closeWS(e){this.socketWS$&&(this.streamEndpoint.operation=4,console.log("[Delta Service] "+e+": WebSocket closing..."),this.socketWS$.complete())}publishDelta(e){this.socketWS$?(console.log("[Delta Service] WebSocket sending message"),this.socketWS$.next(e)):console.log("[Delta Service] No WebSocket present to send message - dropping message")}processWebsocketMessage(e){if(e.updates){this.parseUpdates(e.updates,e.context);return}if(e.requestId){this._skRequests$.next(e);return}if(e.errorMessage){console.warn("[Delta Service] Service received stream error message: "+e.errorMessage);return}if(e.self){this._selfUrn=e.self,this._vesselSelfUrn$.next(e.self),this.server.setServerInfo(e.name,e.version,e.roles);return}console.warn("[Delta Service] Unknown message type. Message content:"+e)}parseUpdates(e,i){e.forEach(o=>{o.meta!==void 0&&o.meta.forEach(a=>this.parseSkMeta(a,i)),o.values!==void 0&&o.values.forEach(a=>{if(a.path.startsWith("notifications."))this._skNotificationsMsg$.next(a);else if(typeof a.value=="object"&&a.value!==null)this.FLATTEN_CONFIG.enableFlattening&&this.canFlattenCompletely(a.value,this.FLATTEN_CONFIG.maxDepth,this.FLATTEN_CONFIG.maxObjectSize)?this.flattenObjectValue(a.value,a.path).forEach(s=>{let l={context:i,path:s.path,source:o.$source,timestamp:o.timestamp,value:s.value};this._skValue$.next(l)}):Object.keys(a.value).forEach(n=>{let s={context:i,path:`${a.path}.${n}`,source:o.$source,timestamp:o.timestamp,value:a.value[n]};this._skValue$.next(s)});else{let n={context:i,path:a.path,source:o.$source,timestamp:o.timestamp,value:a.value};this._skValue$.next(n)}})})}canFlattenCompletely(e,i,o,a=0){if(a>=i)return!1;if(typeof e!="object"||e===null)return!0;let n=Object.keys(e);if(n.length>o)return!1;for(let s of n)if(!this.canFlattenCompletely(e[s],i,o,a+1))return!1;return!0}flattenObjectValue(e,i,o=0){let a=[];if(typeof e!="object"||e===null||o>=this.FLATTEN_CONFIG.maxDepth)return[{path:i,value:e}];let n=Object.keys(e);for(let s of n){let l=i?`${i}.${s}`:s,d=this.flattenObjectValue(e[s],l,o+1);a.push(...d)}return a}parseSkMeta(e,i){e.value.properties!==void 0?Object.keys(e.value.properties).forEach(o=>{this._skMetadata$.next({context:i,path:`${e.path}.${o}`,meta:e.value.properties[o]})}):this._skMetadata$.next({context:i,path:e.path,meta:e.value})}getDataStreamStatusAsO(){return this.streamEndpoint$.asObservable()}subscribeRequestUpdates(){return this._skRequests$.asObservable()}subscribeNotificationsUpdates(){return this._skNotificationsMsg$.asObservable()}subscribeDataPathsUpdates(){return this._skValue$.asObservable()}subscribeMetadataUpdates(){return this._skMetadata$.asObservable()}subscribeSelfUpdates(){return this._vesselSelfUrn$.asObservable()}checkAndReconnect(e){this.connectionStateMachine.isFullyConnected()?console.log(`[Delta Service] ${e}: Already fully connected.`):(console.log(`[Delta Service] ${e}: Not fully connected, requesting reconnection...`),this.connectionStateMachine.isHTTPConnected()?this.connectionStateMachine.startWebSocketConnection():console.log(`[Delta Service] ${e}: HTTP not connected, cannot start WebSocket`))}ngOnDestroy(){this.closeWS("App terminated"),this._skRequests$.complete(),this._skNotificationsMsg$.complete(),this._skValue$.complete(),this._skMetadata$.complete(),this._vesselSelfUrn$.complete(),this.streamEndpoint$.complete(),this.socketWSOpenEvent$.complete(),this.socketWSCloseEvent$.complete(),this.socketWS$?.complete()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Cc(t){return t}var Wt=Cc;function Tc(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var Bo=Tc;var wc=800,kc=16,Ac=Date.now;function Mc(t){var r=0,e=0;return function(){var i=Ac(),o=kc-(i-e);if(e=i,o>0){if(++r>=wc)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Vo=Mc;function Dc(t){return function(){return t}}var qo=Dc;var Ec=Pe?function(t,r){return Pe(t,"toString",{configurable:!0,enumerable:!1,value:qo(r),writable:!0})}:Wt,Ko=Ec;var Fc=Vo(Ko),Go=Fc;var Qo=Math.max;function Rc(t,r,e){return r=Qo(r===void 0?t.length-1:r,0),function(){for(var i=arguments,o=-1,a=Qo(i.length-r,0),n=Array(a);++o<a;)n[o]=i[r+o];o=-1;for(var s=Array(r+1);++o<r;)s[o]=i[o];return s[r]=e(n),Bo(t,this,s)}}var Jo=Rc;function Oc(t,r){return Go(Jo(t,r,Wt),t+"")}var Zo=Oc;function Ic(t,r,e){if(!A(e))return!1;var i=typeof r;return(i=="number"?fe(e)&&Ct(r,e.length):i=="string"&&r in e)?Q(e[r],t):!1}var Yo=Ic;function Pc(t){return Zo(function(r,e){var i=-1,o=e.length,a=o>1?e[o-1]:void 0,n=o>2?e[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,n&&Yo(e[0],e[1],n)&&(a=o<3?void 0:a,o=1),r=Object(r);++i<o;){var s=e[i];s&&t(r,s,i,a)}return r})}var Xo=Pc;var Nc="[object Object]",Uc=Function.prototype,Lc=Object.prototype,ea=Uc.toString,jc=Lc.hasOwnProperty,$c=ea.call(Object);function Wc(t){if(!w(t)||q(t)!=Nc)return!1;var r=ze(t);if(r===null)return!0;var e=jc.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&ea.call(e)==$c}var ta=Wc;var zc="__lodash_hash_undefined__";function Hc(t){return this.__data__.set(t,zc),this}var ia=Hc;function Bc(t){return this.__data__.has(t)}var ra=Bc;function zt(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new yt;++r<e;)this.add(t[r])}zt.prototype.add=zt.prototype.push=ia;zt.prototype.has=ra;var oa=zt;function Vc(t,r){for(var e=-1,i=t==null?0:t.length;++e<i;)if(r(t[e],e,t))return!0;return!1}var aa=Vc;function qc(t,r){return t.has(r)}var na=qc;var Kc=1,Gc=2;function Qc(t,r,e,i,o,a){var n=e&Kc,s=t.length,l=r.length;if(s!=l&&!(n&&l>s))return!1;var d=a.get(t),p=a.get(r);if(d&&p)return d==r&&p==t;var u=-1,m=!0,x=e&Gc?new oa:void 0;for(a.set(t,r),a.set(r,t);++u<s;){var h=t[u],T=r[u];if(i)var C=n?i(T,h,u,r,t,a):i(h,T,u,t,r,a);if(C!==void 0){if(C)continue;m=!1;break}if(x){if(!aa(r,function(M,me){if(!na(x,me)&&(h===M||o(h,M,e,i,a)))return x.push(me)})){m=!1;break}}else if(!(h===T||o(h,T,e,i,a))){m=!1;break}}return a.delete(t),a.delete(r),m}var Ht=Qc;function Jc(t){var r=-1,e=Array(t.size);return t.forEach(function(i,o){e[++r]=[o,i]}),e}var sa=Jc;function Zc(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var la=Zc;var Yc=1,Xc=2,ef="[object Boolean]",tf="[object Date]",rf="[object Error]",of="[object Map]",af="[object Number]",nf="[object RegExp]",sf="[object Set]",lf="[object String]",df="[object Symbol]",cf="[object ArrayBuffer]",ff="[object DataView]",da=W?W.prototype:void 0,pi=da?da.valueOf:void 0;function mf(t,r,e,i,o,a,n){switch(e){case ff:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case cf:return!(t.byteLength!=r.byteLength||!a(new He(t),new He(r)));case ef:case tf:case af:return Q(+t,+r);case rf:return t.name==r.name&&t.message==r.message;case nf:case lf:return t==r+"";case of:var s=sa;case sf:var l=i&Yc;if(s||(s=la),t.size!=r.size&&!l)return!1;var d=n.get(t);if(d)return d==r;i|=Xc,n.set(t,r);var p=Ht(s(t),s(r),i,o,a,n);return n.delete(t),p;case df:if(pi)return pi.call(t)==pi.call(r)}return!1}var ca=mf;var uf=1,pf=Object.prototype,hf=pf.hasOwnProperty;function gf(t,r,e,i,o,a){var n=e&uf,s=at(t),l=s.length,d=at(r),p=d.length;if(l!=p&&!n)return!1;for(var u=l;u--;){var m=s[u];if(!(n?m in r:hf.call(r,m)))return!1}var x=a.get(t),h=a.get(r);if(x&&h)return x==r&&h==t;var T=!0;a.set(t,r),a.set(r,t);for(var C=n;++u<l;){m=s[u];var M=t[m],me=r[m];if(i)var Si=n?i(me,M,m,r,t,a):i(M,me,m,t,r,a);if(!(Si===void 0?M===me||o(M,me,e,i,a):Si)){T=!1;break}C||(C=m=="constructor")}if(T&&!C){var lt=t.constructor,dt=r.constructor;lt!=dt&&"constructor"in t&&"constructor"in r&&!(typeof lt=="function"&&lt instanceof lt&&typeof dt=="function"&&dt instanceof dt)&&(T=!1)}return a.delete(t),a.delete(r),T}var fa=gf;var bf=1,ma="[object Arguments]",ua="[object Array]",Bt="[object Object]",xf=Object.prototype,pa=xf.hasOwnProperty;function vf(t,r,e,i,o,a){var n=z(t),s=z(r),l=n?ua:ie(t),d=s?ua:ie(r);l=l==ma?Bt:l,d=d==ma?Bt:d;var p=l==Bt,u=d==Bt,m=l==d;if(m&&ee(t)){if(!ee(r))return!1;n=!0,p=!1}if(m&&!p)return a||(a=new ce),n||Le(t)?Ht(t,r,e,i,o,a):ca(t,r,l,e,i,o,a);if(!(e&bf)){var x=p&&pa.call(t,"__wrapped__"),h=u&&pa.call(r,"__wrapped__");if(x||h){var T=x?t.value():t,C=h?r.value():r;return a||(a=new ce),o(T,C,e,i,a)}}return m?(a||(a=new ce),fa(t,r,e,i,o,a)):!1}var ha=vf;function ga(t,r,e,i,o){return t===r?!0:t==null||r==null||!w(t)&&!w(r)?t!==t&&r!==r:ha(t,r,e,i,ga,o)}var ba=ga;function _f(t){return function(r,e,i){for(var o=-1,a=Object(r),n=i(r),s=n.length;s--;){var l=n[t?s:++o];if(e(a[l],l,a)===!1)break}return r}}var xa=_f;var yf=xa(),va=yf;function Sf(t,r,e){(e!==void 0&&!Q(t[r],e)||e===void 0&&!(r in t))&&Ne(t,r,e)}var nt=Sf;function Cf(t){return w(t)&&fe(t)}var _a=Cf;function Tf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var st=Tf;function wf(t){return J(t,Z(t))}var ya=wf;function kf(t,r,e,i,o,a,n){var s=st(t,e),l=st(r,e),d=n.get(l);if(d){nt(t,e,d);return}var p=a?a(s,l,e+"",t,r,n):void 0,u=p===void 0;if(u){var m=z(l),x=!m&&ee(l),h=!m&&!x&&Le(l);p=l,m||x||h?z(s)?p=s:_a(s)?p=Mt(s):x?(u=!1,p=At(l,!0)):h?(u=!1,p=Ut(l,!0)):p=[]:ta(l)||rt(l)?(p=s,rt(s)?p=ya(s):(!A(s)||Fe(s))&&(p=Lt(l))):u=!1}u&&(n.set(l,p),o(p,l,i,a,n),n.delete(l)),nt(t,e,p)}var Sa=kf;function Ca(t,r,e,i,o){t!==r&&va(r,function(a,n){if(o||(o=new ce),A(a))Sa(t,r,n,e,Ca,i,o);else{var s=i?i(st(t,n),a,n+"",t,r,o):void 0;s===void 0&&(s=a),nt(t,n,s)}},Z)}var Ta=Ca;function Af(t,r){return ba(t,r)}var Mf=Af;var Df=Xo(function(t,r,e){Ta(t,r,e)}),hi=Df;var Ve=function(t){return t.Normal="normal",t.Nominal="nominal",t.Alert="alert",t.Warn="warn",t.Alarm="alarm",t.Emergency="emergency",t}(Ve||{});var Ef=function(t){return t.Visual="visual",t.Sound="sound",t}(Ef||{});var Ff="self",wa=t=>isFinite(+(t instanceof Date?t:new Date(t)))?!!new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$").test(t):!1,ka=t=>{if(t)return t==="RFC 3339 (UTC)"?"Date":"number"},cy=(()=>{class t{delta=c(Ho);_destroyRef=c(ut);_deltaUpdatesCounter=null;_deltaUpdatesSubject=new he(60);_deltaUpdatesCounterTimer=null;_isSkDataFullTreeActive=!1;_skDataSubject$=new v([]);_dataServiceMeta=[];_isSkMetaFullTreeActive=!1;_dataServiceMetaSubject$=new v([]);_skNotificationMsg$=new g;_skNotificationMeta$=new g;_isReset=new g;_selfUrn="self";_skData=[];_pathRegister=[];constructor(){this._deltaUpdatesCounterTimer=setInterval(()=>{if(this._deltaUpdatesCounter!==null){let e={timestamp:Date.now(),value:this._deltaUpdatesCounter};this._deltaUpdatesSubject.next(e),this._deltaUpdatesCounter=0}},1e3),this.delta.subscribeDataPathsUpdates().pipe(L(this._destroyRef)).subscribe(e=>{this.updatePathData(e)}),this.delta.subscribeMetadataUpdates().pipe(L(this._destroyRef)).subscribe(e=>{this.setMeta(e)}),this.delta.subscribeNotificationsUpdates().pipe(L(this._destroyRef)).subscribe(e=>{let i=e.path.replace("notifications.","self."),o=this._skData.find(a=>a.path==i);if(o&&o.state!==e.value.state){o.state=e.value.state;let a=this._pathRegister.find(n=>n.path==i);a&&a._pathState$.next(o.state)}this._skNotificationMsg$.next(e)}),this.delta.subscribeSelfUpdates().pipe(L(this._destroyRef)).subscribe(e=>{this.setSelfUrn(e)})}getSignalkDeltaUpdateStatistics(){return this._deltaUpdatesSubject.asObservable()}resetSignalKData(){this._skData=[],this._selfUrn="self",this._isReset.next(!0)}unsubscribePath(e){let i=this._pathRegister.findIndex(o=>o.path===e);if(i!==-1){let o=this._pathRegister[i];o._pathData$?.complete(),o._pathState$?.complete(),o.pathDataUpdate$?.complete(),o.pathMeta$?.complete(),this._pathRegister.splice(i,1)}}subscribePath(e,i){let o=this._pathRegister.find(h=>h.path===e&&h.source===i);if(o)return o.pathDataUpdate$;let a=null,n=null,s=null,l=Ve.Normal,d={data:{value:null,timestamp:null},state:l},p=null,u=this._skData.find(h=>h.path==e);this._skData.length&&u&&(a=i==="default"?u.pathValue:u.sources?.[i]?.sourceValue??null,n=i==="default"?u.pathTimestamp:u.sources?.[i]?.sourceTimestamp??null,s=n?new Date(n):null,d={data:{value:a,timestamp:s},state:u.state||l},l=u.state||l,p=u.meta||null);let m={path:e,source:i,_pathData$:new v(d.data),_pathState$:new v(d.state),pathDataUpdate$:new v(d),pathMeta$:new v(p)};return Ai([m._pathData$,m._pathState$]).pipe(ge(([h,T])=>({data:h,state:T}))).subscribe(h=>m.pathDataUpdate$.next(h)),this._pathRegister.push(m),m.pathDataUpdate$}updatePathData(e){this._deltaUpdatesCounter++;let i=this.setPathContext(e.context,e.path),o=this._skData.find(n=>n.path==i);if(o)o.defaultSource===void 0&&(o.defaultSource=e.source),o.type===void 0&&e.value!==null&&(o.type=typeof e.value,o.type==="string"&&wa(e.value)&&(o.type="Date")),o.pathValue=e.value,o.pathTimestamp=e.timestamp,o.sources[e.source]={sourceTimestamp:e.timestamp,sourceValue:e.value};else{let n=typeof e.value;n==="string"&&wa(e.value)&&(n="Date"),o={path:i,pathValue:e.value,pathTimestamp:e.timestamp,defaultSource:e.source,type:n,state:Ve.Normal,sources:{[e.source]:{sourceTimestamp:e.timestamp,sourceValue:e.value}}},this._skData.push(o)}let a=this._pathRegister.filter(n=>n.path===i);if(a.length){let n={value:o.pathValue,timestamp:new Date(o.pathTimestamp)},s=a.find(d=>d.source==="default");s&&s._pathData$.next(n);let l=a.find(d=>d.source===e.source);l&&l._pathData$.next(n)}this._isSkDataFullTreeActive&&this._skDataSubject$.next(this._skData)}setMeta(e){if(e.path.startsWith("notifications."))this._skNotificationMeta$.next(e);else{let i=this.setPathContext(e.context,e.path),o=this._skData.find(n=>n.path===i);o?(o.type==="object"&&e.meta.units&&(o.type=ka(e.meta.units)),o.meta=hi(o.meta,e.meta)):(o={path:i,pathValue:void 0,pathTimestamp:void 0,type:ka(e.meta.units),state:Ve.Normal,defaultSource:void 0,sources:{},meta:e.meta},this._skData.push(o));let a=this._pathRegister.find(n=>n.path===i);a&&a.pathMeta$.next(o.meta),this._isSkMetaFullTreeActive&&(this._dataServiceMeta.push({path:i,meta:o.meta}),this._dataServiceMetaSubject$.next(this._dataServiceMeta))}}startSkMetaFullTree(){return this._isSkMetaFullTreeActive=!0,this._dataServiceMeta=this._skData.filter(e=>e.meta!==void 0&&e.path.startsWith("self.")).map(e=>({path:e.path,meta:e.meta})),this._dataServiceMetaSubject$.next(this._dataServiceMeta),this._dataServiceMetaSubject$}stopSkMetaFullTree(){this._isSkMetaFullTreeActive=!1,this._dataServiceMetaSubject$.next(null),this._dataServiceMeta=null}startSkDataFullTree(){return this._isSkDataFullTreeActive=!0,this._skDataSubject$.next(this._skData),this._skDataSubject$}stopSkDataFullTree(){this._isSkDataFullTreeActive=!1}setSelfUrn(e){e!==""||e!==null?(console.debug("[Signal K Data Service] Setting self to: "+e),this._selfUrn=e):console.error("[Signal K Data Service] Invalid self URN: "+e)}setPathContext(e,i){return e!==this._selfUrn?`${e}.${i}`:`${Ff}.${i}`}getPathsByType(e,i){return this._skData.filter(o=>o.type===e&&(!i||o.path.startsWith("self"))).map(o=>o.path)}getPathsAndMetaByType(e,i,o){return this._skData.filter(a=>{let n=a.type===e,s=!o||a.path.startsWith("self"),l=i===!0?a.meta?.supportsPut===!0:!0;return n&&s&&l}).map(a=>({path:a.path,meta:a.meta}))}getPathObject(e){return mi(this._skData.find(i=>i.path===e))||null}getPathUnitType(e){return this._skData.find(i=>i.path===e)?.meta?.units||null}timeoutPathObservable(e,i){let o=this._pathRegister.find(a=>a.path==e);if(o){let a;["string","Date","number"].includes(i)&&(a={data:{value:null,timestamp:null},state:Ve.Normal}),o.pathDataUpdate$.next(a)}}getNotificationMsgObservable(){return this._skNotificationMsg$.asObservable()}getNotificationMetaObservable(){return this._skNotificationMeta$.asObservable()}getPathMetaObservable(e){return this._pathRegister.find(o=>o.path==e)?.pathMeta$.asObservable()||ki(null)}getPathMeta(e){return this._skData.find(i=>i.path===e)?.meta||null}isResetService(){return this._isReset.asObservable()}ngOnDestroy(){this._deltaUpdatesSubject?.complete(),this._skNotificationMsg$?.complete(),this._skNotificationMeta$?.complete(),this._isReset?.complete(),this._skDataSubject$?.complete(),this._dataServiceMetaSubject$?.complete(),this._deltaUpdatesCounterTimer&&clearInterval(this._deltaUpdatesCounterTimer)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var gi=class{_box;_destroyed=new g;_resizeSubject=new g;_resizeObserver;_elementObservables=new Map;constructor(r){this._box=r,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(r){return this._elementObservables.has(r)||this._elementObservables.set(r,new qe(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(r,{box:this._box}),()=>{this._resizeObserver?.unobserve(r),i.unsubscribe(),this._elementObservables.delete(r)}}).pipe(be(e=>e.some(i=>i.target===r)),Ii({bufferSize:1,refCount:!0}),mt(this._destroyed))),this._elementObservables.get(r)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Aa=(()=>{class t{_cleanupErrorListener;_observers=new Map;_ngZone=c(P);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let o=i?.box||"content-box";return this._observers.has(o)||this._observers.set(o,new gi(o)),this._observers.get(o).observe(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Rf=["notch"],Of=["matFormFieldNotchedOutline",""],If=["*"],Ma=["iconPrefixContainer"],Da=["textPrefixContainer"],Ea=["iconSuffixContainer"],Fa=["textSuffixContainer"],Pf=["textField"],Nf=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Uf=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Lf(t,r){t&1&&ue(0,"span",20)}function jf(t,r){if(t&1&&(N(0,"label",19),V(1,1),F(2,Lf,1,0,"span",20),U()),t&2){let e=oe(2);ye("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Qe("for",e._control.disableAutomaticLabeling?null:e._control.id),k(2),R(!e.hideRequiredMarker&&e._control.required?2:-1)}}function $f(t,r){if(t&1&&F(0,jf,3,5,"label",19),t&2){let e=oe();R(e._hasFloatingLabel()?0:-1)}}function Wf(t,r){t&1&&ue(0,"div",7)}function zf(t,r){}function Hf(t,r){if(t&1&&ht(0,zf,0,0,"ng-template",13),t&2){oe(2);let e=Xt(1);ye("ngTemplateOutlet",e)}}function Bf(t,r){if(t&1&&(N(0,"div",9),F(1,Hf,1,1,null,13),U()),t&2){let e=oe();ye("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),k(),R(e._forceDisplayInfixLabel()?-1:1)}}function Vf(t,r){t&1&&(N(0,"div",10,2),V(2,2),U())}function qf(t,r){t&1&&(N(0,"div",11,3),V(2,3),U())}function Kf(t,r){}function Gf(t,r){if(t&1&&ht(0,Kf,0,0,"ng-template",13),t&2){oe();let e=Xt(1);ye("ngTemplateOutlet",e)}}function Qf(t,r){t&1&&(N(0,"div",14,4),V(2,4),U())}function Jf(t,r){t&1&&(N(0,"div",15,5),V(2,5),U())}function Zf(t,r){t&1&&ue(0,"div",16)}function Yf(t,r){t&1&&V(0,6)}function Xf(t,r){if(t&1&&(N(0,"mat-hint",21),Vi(1),U()),t&2){let e=oe(2);ye("id",e._hintLabelId),k(),qi(e.hintLabel)}}function em(t,r){if(t&1&&(F(0,Xf,2,2,"mat-hint",21),V(1,7),ue(2,"div",22),V(3,8)),t&2){let e=oe();R(e.hintLabel?0:-1)}}var bi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["mat-label"]]})}return t})(),vi=new H("MatError"),tm=(()=>{class t{id=c(ke).getId("mat-mdc-error-");constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["mat-error"],["","matError",""]],hostAttrs:[1,"mat-mdc-form-field-error","mat-mdc-form-field-bottom-align"],hostVars:1,hostBindings:function(i,o){i&2&&Je("id",o.id)},inputs:{id:"id"},features:[Ce([{provide:vi,useExisting:t}])]})}return t})(),xi=(()=>{class t{align="start";id=c(ke).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,o){i&2&&(Je("id",o.id),Qe("align",null),G("mat-mdc-form-field-hint-end",o.align==="end"))},inputs:{align:"align",id:"id"}})}return t})(),La=new H("MatPrefix");var _i=new H("MatSuffix"),im=(()=>{class t{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[Ce([{provide:_i,useExisting:t}])]})}return t})(),ja=new H("FloatingLabelParent"),Ra=(()=>{class t{_elementRef=c(re);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=c(Aa);_ngZone=c(P);_parent=c(ja);_resizeSubscription=new ct;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return rm(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,o){i&2&&G("mdc-floating-label--float-above",o.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return t})();function rm(t){let r=t;if(r.offsetParent!==null)return r.scrollWidth;let e=r.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var Oa="mdc-line-ripple--active",Vt="mdc-line-ripple--deactivating",Ia=(()=>{class t{_elementRef=c(re);_cleanupTransitionEnd;constructor(){let e=c(P),i=c(Ke);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(Vt),e.add(Oa)}deactivate(){this._elementRef.nativeElement.classList.add(Vt)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,o=i.contains(Vt);e.propertyName==="opacity"&&o&&i.remove(Oa,Vt)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return t})(),Pa=(()=>{class t{_elementRef=c(re);_ngZone=c(P);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Ge({type:t,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,o){if(i&1&&K(Rf,5),i&2){let a;D(a=E())&&(o._notch=a.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,o){i&2&&G("mdc-notched-outline--notched",o.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Of,ngContentSelectors:If,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,o){i&1&&(Zt(),ue(0,"div",1),N(1,"div",2,0),V(3),U(),ue(4,"div",3))},encapsulation:2,changeDetection:0})}return t})(),qt=(()=>{class t{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t})}return t})();var Kt=new H("MatFormField"),$a=new H("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Na="fill",om="auto",Ua="fixed",am="translateY(-50%)",yi=(()=>{class t{_elementRef=c(re);_changeDetectorRef=c(Ji);_dir=c(tr);_platform=c(we);_idGenerator=c(ke);_ngZone=c(P);_defaults=c($a,{optional:!0});_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Xe("iconPrefixContainer");_textPrefixContainerSignal=Xe("textPrefixContainer");_iconSuffixContainerSignal=Xe("iconSuffixContainer");_textSuffixContainerSignal=Xe("textSuffixContainer");_prefixSuffixContainers=gt(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=Qi(bi);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Me(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||om}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||Na;this._appearanceSignal.set(i)}_appearanceSignal=pt(Na);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||Ua}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||Ua}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new g;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_animationsDisabled=ir();constructor(){let e=this._defaults;e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=gt(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,o="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(o+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(o+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(Pi([void 0,void 0]),ge(()=>[i.errorState,i.userAriaDescribedBy]),Oi(),be(([[a,n],[s,l]])=>a!==s||n!==l)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(mt(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ei(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){this._control.focused&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!this._control.focused&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",this._control.focused)}_outlineLabelOffsetResizeObserver=null;_syncOutlineLabelOffset(){Zi({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=gt(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let a=this._hintChildren?this._hintChildren.find(s=>s.align==="start"):null,n=this._hintChildren?this._hintChildren.find(s=>s.align==="end"):null;a?e.push(a.id):this._hintLabel&&e.push(this._hintLabelId),n&&e.push(n.id)}else this._errorChildren&&e.push(...this._errorChildren.map(a=>a.id));let i=this._control.describedByIds,o;if(i){let a=this._describedByIds||e;o=e.concat(i.filter(n=>n&&!a.includes(n)))}else o=e;this._control.setDescribedByIds(o),this._describedByIds=e}}_getOutlinedLabelOffset(){let e=this._dir.valueSignal();if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let i=this._iconPrefixContainer?.nativeElement,o=this._textPrefixContainer?.nativeElement,a=this._iconSuffixContainer?.nativeElement,n=this._textSuffixContainer?.nativeElement,s=i?.getBoundingClientRect().width??0,l=o?.getBoundingClientRect().width??0,d=a?.getBoundingClientRect().width??0,p=n?.getBoundingClientRect().width??0,u=e==="rtl"?"-1":"1",m=`${s+l}px`,h=`calc(${u} * (${m} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,T=`var(--mat-mdc-form-field-label-transform, ${am} translateX(${h}))`,C=s+l+d+p;return[T,C]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,o]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),o!==null&&this._notchedOutline?._setMaxWidth(o)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Ge({type:t,selectors:[["mat-form-field"]],contentQueries:function(i,o,a){if(i&1&&(Bi(a,o._labelChild,bi,5),Se(a,qt,5),Se(a,La,5),Se(a,_i,5),Se(a,vi,5),Se(a,xi,5)),i&2){Yt();let n;D(n=E())&&(o._formFieldControl=n.first),D(n=E())&&(o._prefixChildren=n),D(n=E())&&(o._suffixChildren=n),D(n=E())&&(o._errorChildren=n),D(n=E())&&(o._hintChildren=n)}},viewQuery:function(i,o){if(i&1&&(Ye(o._iconPrefixContainerSignal,Ma,5),Ye(o._textPrefixContainerSignal,Da,5),Ye(o._iconSuffixContainerSignal,Ea,5),Ye(o._textSuffixContainerSignal,Fa,5),K(Pf,5),K(Ma,5),K(Da,5),K(Ea,5),K(Fa,5),K(Ra,5),K(Pa,5),K(Ia,5)),i&2){Yt(4);let a;D(a=E())&&(o._textField=a.first),D(a=E())&&(o._iconPrefixContainer=a.first),D(a=E())&&(o._textPrefixContainer=a.first),D(a=E())&&(o._iconSuffixContainer=a.first),D(a=E())&&(o._textSuffixContainer=a.first),D(a=E())&&(o._floatingLabel=a.first),D(a=E())&&(o._notchedOutline=a.first),D(a=E())&&(o._lineRipple=a.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:40,hostBindings:function(i,o){i&2&&G("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-appearance-fill",o.appearance=="fill")("mat-form-field-appearance-outline",o.appearance=="outline")("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-focused",o._control.focused)("mat-primary",o.color!=="accent"&&o.color!=="warn")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Ce([{provide:Kt,useExisting:t},{provide:ja,useExisting:t}])],ngContentSelectors:Uf,decls:19,vars:25,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],["aria-atomic","true","aria-live","polite"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,o){if(i&1){let a=Hi();Zt(Nf),ht(0,$f,1,1,"ng-template",null,0,Ki),N(2,"div",6,1),Ze("click",function(s){return Li(a),ji(o._control.onContainerClick(s))}),F(4,Wf,1,0,"div",7),N(5,"div",8),F(6,Bf,2,2,"div",9),F(7,Vf,3,0,"div",10),F(8,qf,3,0,"div",11),N(9,"div",12),F(10,Gf,1,1,null,13),V(11),U(),F(12,Qf,3,0,"div",14),F(13,Jf,3,0,"div",15),U(),F(14,Zf,1,0,"div",16),U(),N(15,"div",17)(16,"div",18),F(17,Yf,1,0)(18,em,4,1),U()()}if(i&2){let a;k(2),G("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),k(2),R(!o._hasOutline()&&!o._control.disabled?4:-1),k(2),R(o._hasOutline()?6:-1),k(),R(o._hasIconPrefix?7:-1),k(),R(o._hasTextPrefix?8:-1),k(2),R(!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),k(2),R(o._hasTextSuffix?12:-1),k(),R(o._hasIconSuffix?13:-1),k(),R(o._hasOutline()?-1:14),k(),G("mat-mdc-form-field-subscript-dynamic-size",o.subscriptSizing==="dynamic");let n=o._getSubscriptMessageType();k(),G("mat-mdc-form-field-error-wrapper",n==="error")("mat-mdc-form-field-hint-wrapper",n==="hint"),k(),R((a=n)==="error"?17:a==="hint"?18:-1)}},dependencies:[Ra,Pa,Yi,Ia,xi],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
3
+ `],encapsulation:2,changeDetection:0})}return t})();var Gt=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=_e({type:t});static \u0275inj=ve({imports:[Ae,er,yi,Ae]})}return t})();var nm=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=Ge({type:t,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,o){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
4
+ `],encapsulation:2,changeDetection:0})}return t})(),sm={passive:!0},Wa=(()=>{class t{_platform=c(we);_ngZone=c(P);_renderer=c(zi).createRenderer(null,null);_styleLoader=c(Xi);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return wi;this._styleLoader.load(nm);let i=ti(e),o=this._monitoredElements.get(i);if(o)return o.subject;let a=new g,n="cdk-text-field-autofilled",s=d=>{d.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(n)?(i.classList.add(n),this._ngZone.run(()=>a.next({target:d.target,isAutofilled:!0}))):d.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(n)&&(i.classList.remove(n),this._ngZone.run(()=>a.next({target:d.target,isAutofilled:!1})))},l=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",s,sm)));return this._monitoredElements.set(i,{subject:a,unlisten:l}),a}stopMonitoring(e){let i=ti(e),o=this._monitoredElements.get(i);o&&(o.unlisten(),o.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var za=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=_e({type:t});static \u0275inj=ve({})}return t})();var Ha=new H("MAT_INPUT_VALUE_ACCESSOR");var Ba=(()=>{class t{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Qt=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(r,e,i,o,a){this._defaultMatcher=r,this.ngControl=e,this._parentFormGroup=i,this._parentForm=o,this._stateChanges=a}updateErrorState(){let r=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,a=i?.isErrorState(o,e)??!1;a!==r&&(this.errorState=a,this._stateChanges.next())}};var lm=["button","checkbox","file","hidden","image","radio","range","reset","submit"],dm=new H("MAT_INPUT_CONFIG"),NS=(()=>{class t{_elementRef=c(re);_platform=c(we);ngControl=c(or,{optional:!0,self:!0});_autofillMonitor=c(Wa);_ngZone=c(P);_formField=c(Kt,{optional:!0});_renderer=c(Ke);_uid=c(ke).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=c(dm,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new g;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Me(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(rr.required)??!1}set required(e){this._required=Me(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&ii().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Me(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>ii().has(e));constructor(){let e=c(ar,{optional:!0}),i=c(nr,{optional:!0}),o=c(Ba),a=c(Ha,{optional:!0,self:!0}),n=this._elementRef.nativeElement,s=n.nodeName.toLowerCase();a?$i(a.value)?this._signalBasedValueAccessor=a:this._inputValueAccessor=a:this._inputValueAccessor=n,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(n,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new Qt(o,this.ngControl,i,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=s==="select",this._isTextarea=s==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=n.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&Gi(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){lm.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||t)};static \u0275dir=B({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,o){i&1&&Ze("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),i&2&&(Je("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),Qe("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),G("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",ei]},exportAs:["matInput"],features:[Ce([{provide:qt,useExisting:t}]),Wi]})}return t})(),US=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=_e({type:t});static \u0275inj=ve({imports:[Ae,Gt,Gt,za,Ae]})}return t})();export{ae as a,et as b,hr as c,bt as d,De as e,ai as f,mr as g,eu as h,Mf as i,mi as j,Ve as k,Ef as l,zo as m,Ho as n,hi as o,cy as p,Aa as q,bi as r,tm as s,xi as t,im as u,qt as v,Kt as w,$a as x,yi as y,Gt as z,Ba as A,Qt as B,NS as C,US as D};
@@ -1 +1 @@
1
- import{a as oe}from"./chunk-QBA5REXT.js";import{f as ne,j as ie}from"./chunk-UMSIBYU7.js";import{j as N}from"./chunk-PYQ6T3Y3.js";import{a as V}from"./chunk-MS7A7ML2.js";import{a as te}from"./chunk-MRXTLXGU.js";import{C as Z,D as ee,g as L,h as P,m as I,r as Q,y as X}from"./chunk-VYP5YLKW.js";import{Ac as w,Ae as A,Af as H,Bb as C,Bc as y,Cf as z,Df as Y,Ef as $,Ic as O,Pc as T,Xb as g,Yb as n,Zb as i,_b as h,cc as b,ec as f,ef as R,f as k,fc as v,gf as j,jf as W,kb as c,kf as q,nf as J,pc as _,qf as U,rf as B,sa as S,sd as D,td as F,uc as o,uf as G,vb as E,xc as M,xf as K,ya as d,za as p,zc as x}from"./chunk-AERKQXJA.js";var ae=()=>({standalone:!1});function re(r,m){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",32)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",33),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigScope,t)||(a.saveConfigScope=t),p(t)}),n(5,"mat-option",34),o(6," Global "),i(),n(7,"mat-option",35),o(8," User "),i()()(),n(9,"mat-form-field",36)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",37),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),C(13,re,2,0,"div",38),i()}if(r&2){let e=v();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",41),y("ngModelChange",function(t){d(e);let a=v();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),C(5,ce,2,3,"mat-option",42),i()()()}if(r&2){let e=v();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(r,m){if(r&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),C(5,pe,2,3,"mat-option",42),i()()()),r&2){let e=v();c(5),g("ngForOf",e.serverConfigList)}}function fe(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class r{appSettingsService=S(P);storageSvc=S(L);appService=S(V);auth=S(I);fb=S(z);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},j.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return k(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(u){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",u)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=E({type:r,selectors:[["settings-config"]],decls:85,vars:11,consts:[["saveConfigForm","ngForm"],["elseBlock",""],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[4,"ngIf","ngIfElse"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[4,"ngIf"],[1,"no-token-notice"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();h(0,"page-header",4),n(1,"div",5)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",6),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",7)(8,"div",8)(9,"form",9,0),f("ngSubmit",function(){return d(a),p(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",10),o(14," Create a backup of the current active configuration on the server. "),i(),C(15,le,14,5,"div",11)(16,se,3,0,"ng-template",null,1,T),n(18,"div",12),h(19,"mat-divider",13),n(20,"button",14),o(21," Create "),i()()()(),n(22,"div",8)(23,"form",15,2),f("ngSubmit",function(){return d(a),p(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(25,"h2"),o(26,"Delete"),i(),n(27,"p",10),o(28," Select a backup configuration to permanently delete from the server. "),i(),C(29,ge,6,2,"div",11)(30,de,3,0,"ng-template",null,1,T),n(32,"div",12),h(33,"mat-divider",13),n(34,"button",14),o(35," Delete "),i()()()(),n(36,"div",8)(37,"form",16),f("ngSubmit",function(){return d(a),p(t.copyConfig())}),n(38,"h2"),o(39,"Restore"),i(),n(40,"p",10),o(41," Replace the current configuration with a backup from the server. "),i(),C(42,me,6,1,"div",11)(43,fe,3,0,"ng-template",null,1,T),n(45,"div",12),h(46,"mat-divider",13),n(47,"button",14),o(48," Restore "),i()()()(),n(49,"div",17)(50,"h2"),o(51,"Advanced"),i(),n(52,"div",18)(53,"div",19)(54,"p"),o(55,"Download the active configuration to a file."),i()(),n(56,"div",20)(57,"button",21),f("click",function(){return d(a),p(t.downloadJsonConfig())}),o(58," Download "),i()(),n(59,"div",22)(60,"p"),o(61," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(62,"div",23)(63,"input",24,3),f("change",function(u){return d(a),p(t.uploadJsonConfig(u))}),i(),n(65,"button",25),f("click",function(){d(a);let u=_(64);return p(u.click())}),o(66," Upload "),i()(),n(67,"div",26)(68,"p"),o(69," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(70,"div",27)(71,"button",21),f("click",function(){return d(a),p(t.loadDemoConfig())}),o(72," Demo "),i()(),n(73,"div",28)(74,"p"),o(75," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(76,"div",29)(77,"button",21),f("click",function(){return d(a),p(t.resetConfigToDefault())}),o(78," Default "),i()(),n(79,"div",30)(80,"p"),o(81," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(82,"div",31)(83,"button",21),f("click",function(){return d(a),p(t.resetConnectionToDefault())}),o(84," Connection "),i()()()()()()}if(l&2){let a=_(10),s=_(17),u=_(24);g("pageTitle",t.pageTitle),c(15),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!a.valid),c(9),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!u.valid),c(3),g("formGroup",t.copyConfigForm),c(5),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.copyConfigForm.valid)}},dependencies:[N,F,Y,B,R,W,q,H,U,J,te,A,X,Q,ie,ne,Z,D,$,G,K,oe,ee],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:scroll;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Pe as SettingsConfigComponent};
1
+ import{a as oe}from"./chunk-O6UODD7I.js";import{f as ne,j as ie}from"./chunk-BDMHNK6W.js";import{j as N}from"./chunk-BVMWKICM.js";import{a as V}from"./chunk-DAVKA3BG.js";import{a as te}from"./chunk-OJAICHIT.js";import{C as Z,D as ee,g as L,h as P,m as I,r as Q,y as X}from"./chunk-UPJO7TXR.js";import{$b as h,Aa as p,Ac as x,Bc as w,Be as A,Bf as H,Cb as C,Cc as y,Df as z,Ef as Y,Ff as $,Jc as O,Qc as T,Yb as g,Zb as n,_b as i,dc as b,f as k,fc as f,ff as R,gc as v,hf as j,kf as W,lb as c,lf as q,of as J,qc as _,rf as U,sf as B,ta as S,td as D,ud as F,vc as o,vf as G,wb as E,yc as M,yf as K,za as d}from"./chunk-5KKRPVJE.js";var ae=()=>({standalone:!1});function re(r,m){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",32)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",33),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigScope,t)||(a.saveConfigScope=t),p(t)}),n(5,"mat-option",34),o(6," Global "),i(),n(7,"mat-option",35),o(8," User "),i()()(),n(9,"mat-form-field",36)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",37),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),C(13,re,2,0,"div",38),i()}if(r&2){let e=v();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",41),y("ngModelChange",function(t){d(e);let a=v();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),C(5,ce,2,3,"mat-option",42),i()()()}if(r&2){let e=v();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(r,m){if(r&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),C(5,pe,2,3,"mat-option",42),i()()()),r&2){let e=v();c(5),g("ngForOf",e.serverConfigList)}}function fe(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class r{appSettingsService=S(P);storageSvc=S(L);appService=S(V);auth=S(I);fb=S(z);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},j.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return k(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(u){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",u)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=E({type:r,selectors:[["settings-config"]],decls:85,vars:11,consts:[["saveConfigForm","ngForm"],["elseBlock",""],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[4,"ngIf","ngIfElse"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[4,"ngIf"],[1,"no-token-notice"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();h(0,"page-header",4),n(1,"div",5)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",6),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",7)(8,"div",8)(9,"form",9,0),f("ngSubmit",function(){return d(a),p(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",10),o(14," Create a backup of the current active configuration on the server. "),i(),C(15,le,14,5,"div",11)(16,se,3,0,"ng-template",null,1,T),n(18,"div",12),h(19,"mat-divider",13),n(20,"button",14),o(21," Create "),i()()()(),n(22,"div",8)(23,"form",15,2),f("ngSubmit",function(){return d(a),p(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(25,"h2"),o(26,"Delete"),i(),n(27,"p",10),o(28," Select a backup configuration to permanently delete from the server. "),i(),C(29,ge,6,2,"div",11)(30,de,3,0,"ng-template",null,1,T),n(32,"div",12),h(33,"mat-divider",13),n(34,"button",14),o(35," Delete "),i()()()(),n(36,"div",8)(37,"form",16),f("ngSubmit",function(){return d(a),p(t.copyConfig())}),n(38,"h2"),o(39,"Restore"),i(),n(40,"p",10),o(41," Replace the current configuration with a backup from the server. "),i(),C(42,me,6,1,"div",11)(43,fe,3,0,"ng-template",null,1,T),n(45,"div",12),h(46,"mat-divider",13),n(47,"button",14),o(48," Restore "),i()()()(),n(49,"div",17)(50,"h2"),o(51,"Advanced"),i(),n(52,"div",18)(53,"div",19)(54,"p"),o(55,"Download the active configuration to a file."),i()(),n(56,"div",20)(57,"button",21),f("click",function(){return d(a),p(t.downloadJsonConfig())}),o(58," Download "),i()(),n(59,"div",22)(60,"p"),o(61," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(62,"div",23)(63,"input",24,3),f("change",function(u){return d(a),p(t.uploadJsonConfig(u))}),i(),n(65,"button",25),f("click",function(){d(a);let u=_(64);return p(u.click())}),o(66," Upload "),i()(),n(67,"div",26)(68,"p"),o(69," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(70,"div",27)(71,"button",21),f("click",function(){return d(a),p(t.loadDemoConfig())}),o(72," Demo "),i()(),n(73,"div",28)(74,"p"),o(75," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(76,"div",29)(77,"button",21),f("click",function(){return d(a),p(t.resetConfigToDefault())}),o(78," Default "),i()(),n(79,"div",30)(80,"p"),o(81," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(82,"div",31)(83,"button",21),f("click",function(){return d(a),p(t.resetConnectionToDefault())}),o(84," Connection "),i()()()()()()}if(l&2){let a=_(10),s=_(17),u=_(24);g("pageTitle",t.pageTitle),c(15),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!a.valid),c(9),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!u.valid),c(3),g("formGroup",t.copyConfigForm),c(5),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.copyConfigForm.valid)}},dependencies:[N,F,Y,B,R,W,q,H,U,J,te,A,X,Q,ie,ne,Z,D,$,G,K,oe,ee],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:scroll;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Pe as SettingsConfigComponent};
@@ -1,2 +1,2 @@
1
- import{a as xe}from"./chunk-GSG5IFZ7.js";import{a as De,b as Me,c as ve,d as Pe,e as Oe,f as R,g as Te,h as Ie,i as ke,j as Re,k as Ee,l as Ve,m as Fe,n as E,o as He,p as V,q as Ue,r as Be}from"./chunk-HTFWAMIE.js";import"./chunk-KP4DUCFG.js";import{a as Se}from"./chunk-QBA5REXT.js";import{d as we,f as be,j as ye}from"./chunk-UMSIBYU7.js";import{o as re,p as le}from"./chunk-PYQ6T3Y3.js";import{d as ce,e as pe,g as me,h as de,i as ue,j as fe,k as ge}from"./chunk-IMRKPLTP.js";import{C as _e,D as Ce,p as ie,r as I,y as k,z as he}from"./chunk-VYP5YLKW.js";import{$b as M,$d as oe,Ac as X,Ae as A,Bb as g,Bc as Y,De as $,Ea as W,Kd as L,Lc as Z,Ld as ne,Mc as ee,O as N,Rb as S,Sb as D,Tc as te,Ub as U,Vb as h,Wb as _,Xb as p,Xc as w,Yb as o,Zb as i,_b as u,a as F,ac as v,b as H,cc as P,ec as O,fc as d,ia as K,jc as B,kb as s,kc as j,lc as z,m as Q,pc as G,qe as se,sa as m,uc as l,vb as f,vc as T,wc as C,xd as ae,ya as y,z as q,za as x,zc as J}from"./chunk-AERKQXJA.js";function Ae(e,r){e&1&&(o(0,"span",3),l(1,"Boolean"),i())}function $e(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function Qe(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function qe(e,r){e&1&&(o(0,"span",3),l(1,"Object"),i())}function Ne(e,r){if(e&1){let t=P();o(0,"button",5),O("click",function(){y(t);let n=d();return x(n.openDialog())}),l(1),i()}if(e&2){let t=d();s(),T(t.selectedUnit)}}function Ke(e,r){if(e&1&&(o(0,"mat-option",6),l(1),i()),e&2){let t=r.$implicit;p("value",t.measure),s(),C(" ",t.measure," ")}}function We(e,r){if(e&1&&(o(0,"mat-optgroup",3),h(1,Ke,2,2,"mat-option",6,U),i()),e&2){let t=r.$implicit;p("label",t.group),s(),_(t.units)}}var je=(()=>{class e{_units=m(xe);_dialog=m(me);path=w.required();source=w(void 0);pathValue=w(void 0);type=w.required();units=null;selectedUnit="unitless";ngOnInit(){this.units=this._units.getConversionsForPath(this.path()),this.selectedUnit=this.units.base}convertValue(t,a){return a==="number"?this._units.convertToUnit(this.selectedUnit,t):t}openDialog(){this._dialog.open(Ge,{data:{selectedUnit:this.selectedUnit,units:this.units}}).afterClosed().subscribe(a=>{a&&(this.selectedUnit=a)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector-row"]],inputs:{path:[1,"path"],source:[1,"source"],pathValue:[1,"pathValue"],type:[1,"type"]},decls:10,vars:3,consts:[[1,"cell-source","cells"],[1,"cell-value","cells"],[1,"cell-action","cells"],[1,"path-type"],["mat-stroked-button","",1,"change-units-btn"],["mat-stroked-button","",1,"change-units-btn",3,"click"]],template:function(a,n){if(a&1&&(o(0,"mat-cell",0),l(1),i(),o(2,"mat-cell",1),l(3),i(),o(4,"mat-cell",2),S(5,Ae,2,0,"span",3)(6,$e,2,0,"span",3)(7,Qe,2,0,"span",3)(8,qe,2,0,"span",3)(9,Ne,2,1,"button",4),i()),a&2){let c;s(),T(n.source()),s(2),T(n.convertValue(n.pathValue(),n.type())),s(2),D((c=n.type())==="boolean"?5:c==="string"?6:c==="Date"?7:c==="object"?8:9)}},dependencies:[R,$,A],styles:[`.change-units-btn{width:100%}.cell-source:first-of-type{padding-left:0;flex:1 1 30%}.cells{border:0px solid white;word-break:break-word;overflow-wrap:break-word}.cell-value{justify-content:flex-start;flex:1 1 70%;padding:0}.cell-action{justify-content:end;flex:0 0 107px}.cell-action:last-of-type{padding:0}.path-type{width:100%;height:40px;align-content:center;text-align:center;color:var(--mat-sys-primary)}
1
+ import{a as xe}from"./chunk-WXZOPZRK.js";import{a as De,b as Me,c as ve,d as Pe,e as Oe,f as R,g as Te,h as Ie,i as ke,j as Re,k as Ee,l as Ve,m as Fe,n as E,o as He,p as V,q as Ue,r as Be}from"./chunk-WXPXINX2.js";import"./chunk-5R5BV2XK.js";import{a as Se}from"./chunk-O6UODD7I.js";import{d as we,f as be,j as ye}from"./chunk-BDMHNK6W.js";import{o as re,p as le}from"./chunk-BVMWKICM.js";import{d as ce,e as pe,g as me,h as de,i as ue,j as fe,k as ge}from"./chunk-NXU5RHTP.js";import{C as _e,D as Ce,p as ie,r as I,y as k,z as he}from"./chunk-UPJO7TXR.js";import{$b as u,A as q,Aa as x,Ac as J,Bc as X,Be as A,Cb as g,Cc as Y,Ee as $,Fa as W,Ld as L,Mc as Z,Md as ne,Nc as ee,P as N,Sb as S,Tb as D,Uc as te,Vb as U,Wb as h,Xb as _,Yb as p,Yc as w,Zb as o,_b as i,a as F,ac as M,ae as oe,b as H,bc as v,dc as P,fc as O,gc as d,ja as K,kc as B,lb as s,lc as j,m as Q,mc as z,qc as G,re as se,ta as m,vc as l,wb as f,wc as T,xc as C,yd as ae,za as y}from"./chunk-5KKRPVJE.js";function Ae(e,r){e&1&&(o(0,"span",3),l(1,"Boolean"),i())}function $e(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function Qe(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function qe(e,r){e&1&&(o(0,"span",3),l(1,"Object"),i())}function Ne(e,r){if(e&1){let t=P();o(0,"button",5),O("click",function(){y(t);let n=d();return x(n.openDialog())}),l(1),i()}if(e&2){let t=d();s(),T(t.selectedUnit)}}function Ke(e,r){if(e&1&&(o(0,"mat-option",6),l(1),i()),e&2){let t=r.$implicit;p("value",t.measure),s(),C(" ",t.measure," ")}}function We(e,r){if(e&1&&(o(0,"mat-optgroup",3),h(1,Ke,2,2,"mat-option",6,U),i()),e&2){let t=r.$implicit;p("label",t.group),s(),_(t.units)}}var je=(()=>{class e{_units=m(xe);_dialog=m(me);path=w.required();source=w(void 0);pathValue=w(void 0);type=w.required();units=null;selectedUnit="unitless";ngOnInit(){this.units=this._units.getConversionsForPath(this.path()),this.selectedUnit=this.units.base}convertValue(t,a){return a==="number"?this._units.convertToUnit(this.selectedUnit,t):t}openDialog(){this._dialog.open(Ge,{data:{selectedUnit:this.selectedUnit,units:this.units}}).afterClosed().subscribe(a=>{a&&(this.selectedUnit=a)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector-row"]],inputs:{path:[1,"path"],source:[1,"source"],pathValue:[1,"pathValue"],type:[1,"type"]},decls:10,vars:3,consts:[[1,"cell-source","cells"],[1,"cell-value","cells"],[1,"cell-action","cells"],[1,"path-type"],["mat-stroked-button","",1,"change-units-btn"],["mat-stroked-button","",1,"change-units-btn",3,"click"]],template:function(a,n){if(a&1&&(o(0,"mat-cell",0),l(1),i(),o(2,"mat-cell",1),l(3),i(),o(4,"mat-cell",2),S(5,Ae,2,0,"span",3)(6,$e,2,0,"span",3)(7,Qe,2,0,"span",3)(8,qe,2,0,"span",3)(9,Ne,2,1,"button",4),i()),a&2){let c;s(),T(n.source()),s(2),T(n.convertValue(n.pathValue(),n.type())),s(2),D((c=n.type())==="boolean"?5:c==="string"?6:c==="Date"?7:c==="object"?8:9)}},dependencies:[R,$,A],styles:[`.change-units-btn{width:100%}.cell-source:first-of-type{padding-left:0;flex:1 1 30%}.cells{border:0px solid white;word-break:break-word;overflow-wrap:break-word}.cell-value{justify-content:flex-start;flex:1 1 70%;padding:0}.cell-action{justify-content:end;flex:0 0 107px}.cell-action:last-of-type{padding:0}.path-type{width:100%;height:40px;align-content:center;text-align:center;color:var(--mat-sys-primary)}
2
2
  `],encapsulation:2})}return e})(),Ge=(()=>{class e{dialogRef=m(ce);data=m(pe);selectedUnit=null;static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["dialog-unit-selector"]],decls:14,vars:2,consts:[["mat-dialog-title",""],["appearance","outline","floatLabel","always",2,"padding-top","15px","padding-bottom","15px"],[3,"valueChange","value"],[3,"label"],["mat-flat-button","","mat-dialog-close",""],["mat-flat-button","",3,"mat-dialog-close"],[3,"value"]],template:function(a,n){a&1&&(o(0,"h2",0),l(1,"Select Unit type"),i(),o(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"mat-label"),l(5,"Unit"),i(),o(6,"mat-select",2),Y("valueChange",function(b){return X(n.data.selectedUnit,b)||(n.data.selectedUnit=b),b}),h(7,We,3,1,"mat-optgroup",3,U),i()()(),o(9,"mat-dialog-actions")(10,"button",4),l(11,"Cancel"),i(),o(12,"button",5),l(13,"Ok"),i()()),a&2&&(s(6),J("value",n.data.selectedUnit),s(),_(n.data.units.conversions),s(5),p("mat-dialog-close",n.data.selectedUnit))},dependencies:[ue,fe,k,I,ye,we,be,ge,$,A,de],encapsulation:2})}return e})();var Je=(e,r)=>r.key;function Xe(e,r){e&1&&(o(0,"mat-header-cell",19),l(1," Path "),i())}function Ye(e,r){if(e&1&&(o(0,"mat-cell",20),l(1),i()),e&2){let t=r.$implicit;s(),C(" ",t.path," ")}}function Ze(e,r){e&1&&(o(0,"mat-header-cell",21),l(1," PUT Support "),i())}function et(e,r){e&1&&(o(0,"mat-icon",23),l(1,"check_circle"),i())}function tt(e,r){if(e&1&&(o(0,"mat-cell",22),S(1,et,2,0,"mat-icon",23),i()),e&2){let t=r.$implicit;s(),D(t.meta!=null&&t.meta.supportsPut?1:-1)}}function at(e,r){e&1&&(o(0,"mat-header-cell",24),l(1," Source "),i())}function nt(e,r){if(e&1&&u(0,"data-inspector-row",27),e&2){let t=r.$implicit,a=d().$implicit,n=d();p("path",a.path)("source",n.getSourceKey(t))("pathValue",n.getSourceValue(t))("type",a.type)}}function it(e,r){if(e&1&&(o(0,"mat-cell",25)(1,"div",26),h(2,nt,1,4,"data-inspector-row",27,Je),Z(4,"keyvalue"),i()()),e&2){let t=r.$implicit;s(2),_(ee(4,0,t.sources))}}function ot(e,r){e&1&&u(0,"mat-header-row",28)}function rt(e,r){e&1&&u(0,"mat-row",29)}function lt(e,r){if(e&1&&(o(0,"tr",30)(1,"td",31),l(2),i()()),e&2){d();let t=G(6);s(2),C('No data matching the filter "',t.value,'"')}}var Qt=(()=>{class e{dataService=m(ie);destroyRef=m(W);_responsive=m(oe);isPhonePortrait;filterSubject=new Q;paginator;sort;pageTitle="Data Inspector";pageSize=25;hidePageSize=!1;showFirstLastButtons=!0;showPageSizeOptions=[5,10,25,100];tableData=new Fe([]);displayedColumns=["path","supportsPut","defaultSource"];constructor(){this.filterSubject.pipe(N(500)).pipe(L(this.destroyRef)).subscribe(t=>{this.tableData.filter=t.trim().toLowerCase(),this.tableData.paginator&&this.tableData.paginator.firstPage()}),this.isPhonePortrait=ne(this._responsive.observe(se.HandsetPortrait)),te(()=>{this.isPhonePortrait().matches?(this.hidePageSize=!0,this.showFirstLastButtons=!1,this.showPageSizeOptions=[]):(this.hidePageSize=!1,this.showFirstLastButtons=!0,this.showPageSizeOptions=[5,10,25,100])})}ngAfterViewInit(){this.dataService.startSkDataFullTree().pipe(q(t=>t.filter(a=>Object.keys(a.sources||{}).length>0).map(a=>H(F({},a),{sources:a.type&&a.type.includes("object")&&typeof a.sources=="object"?Object.fromEntries(Object.entries(a.sources).map(([n,c])=>[n,H(F({},c),{sourceValue:typeof c.sourceValue=="object"?JSON.stringify(c.sourceValue):c.sourceValue})])):a.sources}))),K(500),L(this.destroyRef)).subscribe(t=>{this.tableData.data=t}),this.tableData.paginator=this.paginator,this.tableData.sort=this.sort,this.tableData.sortingDataAccessor=(t,a)=>{switch(a){case"supportsPut":return t.meta?.supportsPut?1:0;default:return t[a]}}}applyFilter(t){let a=t.target.value;this.filterSubject.next(a)}trackByPath(t,a){return`${a.path}`}trackBySource(t,a){return`${a.key}`}getSourceKey(t){return String(t.key)}getSourceValue(t){return t.value.sourceValue}ngOnDestroy(){this.filterSubject.complete(),this.dataService.stopSkDataFullTree()}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector"]],viewQuery:function(a,n){if(a&1&&(B(E,5),B(V,5)),a&2){let c;j(c=z())&&(n.paginator=c.first),j(c=z())&&(n.sort=c.first)}},decls:21,vars:10,consts:[["input",""],[3,"pageTitle"],[1,"data-inspector-container"],[1,"filter-field"],["matInput","","placeholder","Ex: navigation","value","self.",3,"keyup"],["matSort","","matSortActive","path","matSortDirection","asc",1,"table-content-area","mat-elevation-z8",3,"dataSource","trackBy"],["matColumnDef","path"],["class","pathHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","pathCell row-cell",4,"matCellDef"],["matColumnDef","supportsPut"],["class","putHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","putCell row-cell",4,"matCellDef"],["matColumnDef","defaultSource"],["class","dataHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","dataCell row-cell",4,"matCellDef"],["class","headerRow",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","table-row",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],[1,"paginator",3,"pageSize","pageSizeOptions","hidePageSize","showFirstLastButtons"],["mat-sort-header","",1,"pathHeader"],[1,"pathCell","row-cell"],["mat-sort-header","",1,"putHeader"],[1,"putCell","row-cell"],["matTooltip","Supports PUT operation",1,"put-icon"],["mat-sort-header","",1,"dataHeader"],[1,"dataCell","row-cell"],[1,"flex-container"],[1,"source-sub-row",3,"path","source","pathValue","type"],[1,"headerRow"],[1,"table-row"],[1,"mat-row"],["colspan","4",1,"mat-cell"]],template:function(a,n){if(a&1){let c=P();u(0,"page-header",1),o(1,"div",2)(2,"mat-form-field",3)(3,"mat-label"),l(4,"Filter"),i(),o(5,"input",4,0),O("keyup",function(ze){return y(c),x(n.applyFilter(ze))}),i()(),o(7,"mat-table",5),M(8,6),g(9,Xe,2,0,"mat-header-cell",7)(10,Ye,2,1,"mat-cell",8),v(),M(11,9),g(12,Ze,2,0,"mat-header-cell",10)(13,tt,2,1,"mat-cell",11),v(),M(14,12),g(15,at,2,0,"mat-header-cell",13)(16,it,5,2,"mat-cell",14),v(),g(17,ot,1,0,"mat-header-row",15)(18,rt,1,0,"mat-row",16)(19,lt,3,1,"tr",17),i(),u(20,"mat-paginator",18),i()}a&2&&(p("pageTitle",n.pageTitle),s(7),p("dataSource",n.tableData)("trackBy",n.trackByPath),s(10),p("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),s(),p("matRowDefColumns",n.displayedColumns),s(2),p("pageSize",n.pageSize)("pageSizeOptions",n.showPageSizeOptions)("hidePageSize",n.hidePageSize)("showFirstLastButtons",n.showFirstLastButtons))},dependencies:[he,k,I,Ve,De,ve,Te,Pe,Me,Ie,Oe,R,ke,Re,Ee,Ce,_e,He,E,Be,V,Ue,je,ae,Se,le,re],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%}.data-inspector-container[_ngcontent-%COMP%]{margin-left:24px;margin-right:24px;height:calc(100% - 63px)}.table-content-area[_ngcontent-%COMP%]{height:calc(100% - 142px);overflow-y:scroll;width:100%;scroll-behavior:smooth}.mat-column-path[_ngcontent-%COMP%]{flex:0 0 50%;width:50%}.mat-mdc-table[_ngcontent-%COMP%]{overflow:auto}.paginator[_ngcontent-%COMP%]{width:100%;height:56px;background-color:var(--mat-sys-background)}.filter-field[_ngcontent-%COMP%]{padding:15px 0;width:100%;height:86px}.pathHeader[_ngcontent-%COMP%]{flex:1 1 45%}.putHeader[_ngcontent-%COMP%]{flex:1 1 10%}.dataHeader[_ngcontent-%COMP%]{flex:1 1 45%}.table-row[_ngcontent-%COMP%]{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}.row-cell[_ngcontent-%COMP%]{border-bottom-color:#fff;border-bottom-width:0px;border-bottom-style:solid}.pathCell[_ngcontent-%COMP%]{flex:1 1 45%;word-break:break-word;overflow-wrap:break-word}.putCell[_ngcontent-%COMP%]{flex:1 1 10%}.dataCell[_ngcontent-%COMP%]{flex:1 1 45%;flex-flow:column;flex-wrap:nowrap;gap:2px}.flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;gap:5px;margin:5px 0;height:100%;width:100%}.source-sub-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;width:100%}.put-icon[_ngcontent-%COMP%]{color:var(--kip-starboard-color)}@media screen and (max-width: 750px){.pathHeader[_ngcontent-%COMP%], .dataHeader[_ngcontent-%COMP%]{flex:1 1 50%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%;margin-left:24px}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]{flex-direction:row;flex-wrap:wrap}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:attr(data-label);float:left;padding-right:5px}mat-row[_ngcontent-%COMP%]:after{min-height:auto;padding-bottom:10px}.dataRow[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.actionCell[_ngcontent-%COMP%]{margin-left:24px}}"]})}return e})();export{Qt as DataInspectorComponent};