@mxtommy/kip 3.1.1 → 3.1.2-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/public/{chunk-6XNAATXC.js → chunk-4JDFLZMM.js} +1 -1
- package/public/{chunk-5DXBSI3U.js → chunk-ESVJJ726.js} +1 -1
- package/public/{chunk-CU7EEHLK.js → chunk-JDTWKTDJ.js} +1 -1
- package/public/{chunk-S2QRZEAO.js → chunk-JO7KJNQK.js} +1 -1
- package/public/chunk-M5YAMDFT.js +1 -0
- package/public/{chunk-G2RDI5CW.js → chunk-T4AQJP2M.js} +1 -1
- package/public/{chunk-BHXOUGEH.js → chunk-VNUEOPPK.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-AU7ZMZ6I.js → main-5SVCSSP4.js} +3 -3
- package/public/chunk-P2NQVKWN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Co,b as Mo,c as yo}from"./chunk-YQQFIIO5.js";import{a as tt,b as se}from"./chunk-MCACXEYY.js";import{a as et,b as To,c as So,d as xo}from"./chunk-FMVUDX5R.js";import{a as we,b as Nt}from"./chunk-FFCTE2U5.js";import{b as fo,c as go,d as Ot,e as ho,f as U,g as bo,h as _o,i as pt,j as ne,k as Lt}from"./chunk-7OTNT2GF.js";import{g as Da,i as Ia,n as Oa,o as N,p as ae,q as uo,u as vo}from"./chunk-VIHODUV4.js";import{a as Ja,b as eo,c as to,d as ve,e as Ce,g as ao,h as Me,i as ye,j as Te,k as $e,l as Se}from"./chunk-FCC7GNHD.js";import{a as je}from"./chunk-
|
|
1
|
+
import{a as Co,b as Mo,c as yo}from"./chunk-YQQFIIO5.js";import{a as tt,b as se}from"./chunk-MCACXEYY.js";import{a as et,b as To,c as So,d as xo}from"./chunk-FMVUDX5R.js";import{a as we,b as Nt}from"./chunk-FFCTE2U5.js";import{b as fo,c as go,d as Ot,e as ho,f as U,g as bo,h as _o,i as pt,j as ne,k as Lt}from"./chunk-7OTNT2GF.js";import{g as Da,i as Ia,n as Oa,o as N,p as ae,q as uo,u as vo}from"./chunk-VIHODUV4.js";import{a as Ja,b as eo,c as to,d as ve,e as Ce,g as ao,h as Me,i as ye,j as Te,k as $e,l as Se}from"./chunk-FCC7GNHD.js";import{a as je}from"./chunk-M5YAMDFT.js";import{a as po}from"./chunk-RCSPPHLA.js";import{A as Je,D as R,E as Pt,a as ke,d as Ga,e as Ea,f as ka,g as xt,h as Yt,i as wt,k as Fa,r as Pa,t as O,u as Ft,v as Qe,x as mo,z as L}from"./chunk-AHFD2AA5.js";import{$a as Be,$b as X,$c as k,Aa as sa,Ae as Ha,Bb as fa,Cc as te,Da as Ve,Dc as r,E as ia,Ea as M,Ec as x,Ee as Ka,Fa as y,Fc as Q,Fe as $a,Gc as yt,H as Kt,Hb as v,Ib as ge,Ic as Ma,J as Oe,Jb as lt,Jc as ya,K as pe,Kb as ga,Kc as Ta,La as ca,Lb as ha,Ld as La,Md as Na,Me as Ya,N as na,Nb as _,Ne as Za,O as bt,Oa as Y,Oc as dt,Od as Va,Pa as da,Pc as Tt,Pe as Xa,Q as Le,Ra as fe,Rc as We,Sa as f,Sc as qe,Se as Ke,T as ra,Ta as rt,Td as Ba,Va as Z,Vd as Ra,Ve as Qa,We as kt,Xc as ze,Xe as V,Yb as le,Yd as At,Zb as d,Ze as E,_b as Ct,a as me,ac as $t,af as I,b as Fe,bc as ba,bf as j,cd as Sa,cf as oo,dc as C,de as mt,df as io,eb as ma,ec as G,ee as He,ef as no,f as gt,fa as Ne,fc as Mt,fe as Ua,ff as ro,g as ht,ga as _t,gc as T,gf as H,hc as S,he as Zt,hf as lo,ia as la,ic as n,ie as Gt,if as Dt,j as jt,jc as i,jf as xe,kc as g,ke as Et,kf as ie,lc as _a,le as q,lf as K,m as it,mc as va,mf as so,na as vt,nc as Ca,nf as co,o as nt,oa as ee,oc as A,of as Ye,pa as ue,pf as It,qc as b,qd as xa,qf as Ze,ra as $,rc as u,rd as wa,re as Wa,rf as F,sc as Re,sd as Aa,se as qa,t as Ht,tc as Ue,te as z,tf as Xe,ua as p,ub as s,uc as Ee,ud as St,ue as za,uf as B,vc as st,ve as _e,vf as P,wb as pa,wc as ct,xc as he,xe as ja,yb as ua,yc as be,ye as oe,z as Pe}from"./chunk-JIJMSRKJ.js";var br=(()=>{class o{_settings=p(xt);_router=p(Ia);dashboards=Z([],{equal:Yt});activeDashboard=Z(0);_widgetAction=new nt(null);widgetAction$=this._widgetAction.asObservable();_isDashboardStatic=new nt(!0);isDashboardStatic$=this._isDashboardStatic.asObservable();isDashboardStatic=Fa(this.isDashboardStatic$);blankDashboard=[{id:null,name:"Dashboard 1",configuration:[{w:12,h:12,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-tutorial",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}]}];constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let t=this.blankDashboard.map(a=>Fe(me({},a),{id:ke.create()}));this.dashboards.set([...t])}else this.dashboards.set(this._settings.getDashboardConfig());Sa(()=>{this._settings.saveDashboards(this.dashboards())})}toggleStaticDashboard(){this._isDashboardStatic.next(!this._isDashboardStatic.value)}add(e,t){this.dashboards.update(a=>[...a,{id:ke.create(),name:e,configuration:t}])}update(e,t){this.dashboards.update(a=>a.map((l,m)=>m===e?Fe(me({},l),{name:t}):l))}delete(e){this.dashboards.update(t=>t.filter((a,l)=>l!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t){if(e<0||e>=this.dashboards().length){console.error(`[Dashboard Service] Invalid itemIndex: ${e}`);return}let a=this.dashboards()[e],l=wt(a);l.id=ke.create(),l.name=t,Array.isArray(l.configuration)?l.configuration.forEach(m=>{m&&m.input?.widgetProperties?(m.id=ke.create(),m.input.widgetProperties.uuid=m.id):console.error("Dashboard Service] Widget configuration is missing required properties:",m)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",l.configuration),l.configuration=[]),this.dashboards.update(m=>[...m,l])}updateConfiguration(e,t){this.dashboards.update(a=>a.map((l,m)=>m===e?Yt(l.configuration,t)?l:Fe(me({},l),{configuration:t}):l))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e<0||e>this.dashboards().length-1||this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this._isDashboardStatic.next(e)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=ee({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ri(o,c){o&1&&Ca(0)}var Ao=(()=>{class o{data=p(Ce);static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["dialog-frame"]],decls:8,vars:3,consts:[[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],[1,"dialog-content-padding"],[4,"ngComponentOutlet"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"h6",1),r(2),i(),n(3,"button",2)(4,"mat-icon"),r(5,"close"),i()()(),n(6,"mat-dialog-content",3),_(7,ri,1,0,"ng-container",4),i()),t&2&&(s(2),x(a.data.title),s(),d("mat-dialog-close",!1),s(4),d("ngComponentOutlet",a.data.componentType))},dependencies:[N,Se,Me,ye,Te,oe,z,xa],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.dialog-content-padding[_ngcontent-%COMP%]{--mat-dialog-content-padding: 0px 24px 20px 24px}"]})}return o})();function li(o,c){if(o&1&&(n(0,"button",4),r(1),i()),o&2){let e=u();d("mat-dialog-close",!0),s(),x(e.data.confirmBtnText)}}var Go=(()=>{class o{data=p(Ce);static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["dialog-confirmation"]],decls:12,vars:6,consts:[[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],["align","end"],["mat-flat-button","",3,"mat-dialog-close"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"h5",1),r(2),i(),n(3,"button",2)(4,"mat-icon"),r(5,"close"),i()()(),n(6,"mat-dialog-content"),r(7),i(),n(8,"mat-dialog-actions",3)(9,"button",4),r(10),i(),_(11,li,2,2,"button",4),i()),t&2&&(s(2),x(a.data.title),s(),d("mat-dialog-close",!1),s(4),Q(" ",a.data.message,`
|
|
2
2
|
`),s(2),d("mat-dialog-close",!1),s(),x(a.data.cancelBtnText),s(),C(a.data.confirmBtnText?11:-1))},dependencies:[N,Se,Me,ye,$e,Te,oe,_e,z],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return o})();function ci(o,c){if(o&1&&(n(0,"button",9),r(1),i()),o&2){let e=u(),t=te(1);d("disabled",!t.valid),s(),x(e.data.confirmBtnText)}}var ko=(()=>{class o{dialogRef=p(ve);data=p(Ce);saveName(){this.dialogRef.close(this.data)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["dialog-name"]],decls:19,vars:6,consts:[["name","ngForm"],["name","name",3,"ngSubmit"],[1,"dialogue-header"],["mat-dialog-title",""],["mat-icon-button","",1,"dialog-close-icon",3,"mat-dialog-close"],[1,"field-margin"],["matInput","","type","text","id","name","placeholder","Name","name","name","required","","cdkFocusInitial","",3,"ngModelChange","ngModel"],["align","end"],["mat-flat-button","",3,"mat-dialog-close"],["mat-flat-button","","type","submit",3,"disabled"]],template:function(t,a){if(t&1){let l=A();n(0,"form",1,0),b("ngSubmit",function(){return M(l),y(a.saveName())}),n(2,"div",2)(3,"h5",3),r(4),i(),n(5,"button",4)(6,"mat-icon"),r(7,"close"),i()()(),n(8,"mat-dialog-content")(9,"mat-form-field",5)(10,"mat-label"),r(11,"Name"),i(),n(12,"input",6),Ta("ngModelChange",function(h){return M(l),ya(a.data.name,h)||(a.data.name=h),y(h)}),i(),n(13,"mat-error"),r(14," A name is required "),i()()(),n(15,"mat-dialog-actions",7)(16,"button",8),r(17),i(),_(18,ci,2,2,"button",9),i()()}t&2&&(s(4),x(a.data.title),s(),d("mat-dialog-close",!1),s(7),Ma("ngModel",a.data.name),s(4),d("mat-dialog-close",!1),s(),x(a.data.cancelBtnText),s(),C(a.data.confirmBtnText?18:-1))},dependencies:[Se,Me,ye,$e,Te,ae,N,Je,L,O,Ft,Pt,R,oe,_e,z,B,Dt,V,I,j,F,lo,no],styles:[".dialogue-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.field-margin[_ngcontent-%COMP%]{margin-left:15px;margin-bottom:15px}"]})}return o})();function mi(o,c){if(o&1&&(n(0,"mat-option",12),r(1),i()),o&2){let e=c.$implicit;Ee("value",e.value),s(),x(e.label)}}function pi(o,c){if(o&1){let e=A();n(0,"button",21),b("click",function(){M(e);let a=u();return y(a.moveCtrlUp())}),n(1,"mat-icon"),r(2,"arrow_drop_up"),i()()}}function ui(o,c){if(o&1){let e=A();n(0,"button",22),b("click",function(){M(e);let a=u();return y(a.moveCtrlDown())}),n(1,"mat-icon"),r(2,"arrow_drop_down"),i()()}}var Do=(()=>{class o{app=p(je);ctrlFormGroup=f.required();controlIndex=f(void 0);arrayLength=f(void 0);deleteCtrl=fe();moveUp=fe();moveDown=fe();colors=[];ngOnInit(){this.colors=this.app.configurableThemeColors}deleteControl(){let e={ctrlIndex:this.controlIndex(),pathID:this.ctrlFormGroup().get("pathID").value};this.deleteCtrl.emit(e)}moveCtrlUp(){this.moveUp.emit(this.controlIndex())}moveCtrlDown(){this.moveDown.emit(this.controlIndex())}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["boolean-control-config"]],inputs:{ctrlFormGroup:[1,"ctrlFormGroup"],controlIndex:[1,"controlIndex"],arrayLength:[1,"arrayLength"]},outputs:{deleteCtrl:"deleteCtrl",moveUp:"moveUp",moveDown:"moveDown"},decls:36,vars:3,consts:[[1,"ctrl-grid","rounded-card","rounded-card-color",3,"formGroup"],[1,"controls","flex-container"],[1,"flex-label"],[1,"full-width"],["matInput","","type","string","placeholder","Enter a display label...","formControlName","ctrlLabel"],[1,"flex-settings"],[1,"settings"],["placeholder","Select Type...","formControlName","type","name","type","required",""],["value","1"],["value","2"],["value","3"],["placeholder","Select Color...","formControlName","color","name","color","required",""],[3,"value"],[1,"flex-full-width"],["formControlName","isNumeric"],[1,"actions"],[1,"flex-actions"],[1,"btn-grid"],["mat-icon-button","","type","button","aria-label","Move control up in the list",1,"up"],["mat-icon-button","","type","button","aria-label","Move control down in the list",1,"down"],["mat-icon-button","","type","button","aria-label","Delete control",1,"delete",3,"click"],["mat-icon-button","","type","button","aria-label","Move control up in the list",1,"up",3,"click"],["mat-icon-button","","type","button","aria-label","Move control down in the list",1,"down",3,"click"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),r(5,"Label"),i(),g(6,"input",4),i()(),n(7,"div",5)(8,"mat-form-field",6)(9,"mat-label"),r(10,"Type"),i(),n(11,"mat-select",7)(12,"mat-option",8),r(13,"Toggle"),i(),n(14,"mat-option",9),r(15,"Push"),i(),n(16,"mat-option",10),r(17,"Indicator"),i()()()(),n(18,"div",5)(19,"mat-form-field",6)(20,"mat-label"),r(21,"Color"),i(),n(22,"mat-select",11),T(23,mi,2,2,"mat-option",12,G),i()()(),n(25,"div",13)(26,"mat-checkbox",14),r(27," Use numeric path "),i()()(),n(28,"div",15)(29,"div",16)(30,"div",17),_(31,pi,3,0,"button",18)(32,ui,3,0,"button",19),n(33,"button",20),b("click",function(){return a.deleteControl()}),n(34,"mat-icon"),r(35,"delete"),i()()()()()()),t&2&&(d("formGroup",a.ctrlFormGroup()),s(23),S(a.colors),s(8),C(a.controlIndex()!==0?31:-1),s(),C(a.controlIndex()!==a.arrayLength()-1?32:-1))},dependencies:[B,V,I,j,F,P,K,Ye,L,O,R,ne,U,z,Nt,we,ae,N],styles:['.ctrl-grid[_ngcontent-%COMP%]{display:grid;width:auto;height:auto;margin:0 0 10px;grid-template-columns:[col-start] calc(100% - 90px) [col1-end] 80px [col2-end];grid-template-areas:"controls actions";row-gap:0px;column-gap:10px;justify-items:center;align-items:center;justify-content:center;align-content:center;padding-top:20px}.controls[_ngcontent-%COMP%]{grid-area:controls;width:100%}.actions[_ngcontent-%COMP%]{grid-area:actions}.btn-grid[_ngcontent-%COMP%]{display:grid;width:80px;height:80px;margin:0;grid-template-columns:[col-start] 50% [col1-end] 50% [col2-end];grid-template-rows:[row-start] 50% [row1-end] 50% [row2-end];grid-template-areas:"up delete" "down delete";row-gap:0px;column-gap:0px;justify-items:center;align-items:center;justify-content:center;align-content:center}.up[_ngcontent-%COMP%]{grid-area:up}.down[_ngcontent-%COMP%]{grid-area:down}.delete[_ngcontent-%COMP%]{grid-area:delete}.flex-label[_ngcontent-%COMP%]{flex-grow:2;flex-shrink:2}.flex-settings[_ngcontent-%COMP%]{flex-grow:1;flex-shrink:1}.settings[_ngcontent-%COMP%]{min-width:100px}.flex-actions[_ngcontent-%COMP%]{flex-grow:0;flex-shrink:0}.flex-full-width[_ngcontent-%COMP%]{width:100%}']})}return o})();function fi(o,c){if(o&1){let e=A();n(0,"boolean-control-config",4),b("moveUp",function(a){M(e);let l=u();return y(l.moveUp(a))})("moveDown",function(a){M(e);let l=u();return y(l.moveDown(a))})("deleteCtrl",function(a){M(e);let l=u();return y(l.deletePath(a))}),i()}if(o&2){let e=c.$implicit,t=c.$index,a=u();d("ctrlFormGroup",a.getFormGroup(e))("controlIndex",t)("arrayLength",a.arrayLength)}}var Io=(()=>{class o{fb=p(Xe);multiCtrlArray=f.required();addPath=fe();updatePath=fe();delPath=fe();multiFormGroup=null;arrayLength=0;multiCtrlArraySubscription=null;ngOnInit(){this.arrayLength=this.multiCtrlArray().length,this.multiFormGroup=new oo({multiCtrlArray:this.multiCtrlArray()}),this.multiCtrlArraySubscription=this.multiCtrlArray().valueChanges.pipe(bt(350)).subscribe(e=>{this.updatePath.emit(e)})}addCtrlGroup(){let e=ke.create();this.multiCtrlArray().push(this.fb.group({ctrlLabel:[null,E.required],type:["1",E.required],pathID:[e],color:["contrast"],isNumeric:[!1],value:[null]})),this.arrayLength=this.multiCtrlArray().length;let t={description:null,path:null,pathID:e,source:"default",pathType:"boolean",supportsPut:!0,isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"unitless",convertUnitTo:"unitless",sampleTime:500};this.addPath.emit(t)}moveUp(e){let t=this.multiCtrlArray().at(e);this.multiCtrlArray().removeAt(e,{emitEvent:!1}),this.multiCtrlArray().insert(e-1,t,{emitEvent:!1})}moveDown(e){let t=this.multiCtrlArray().at(e);this.multiCtrlArray().removeAt(e,{emitEvent:!1}),this.multiCtrlArray().insert(e+1,t,{emitEvent:!1})}deletePath(e){this.delPath.emit(e),this.arrayLength=this.multiCtrlArray().length}getFormGroup(e){return e}ngOnDestroy(){this.multiCtrlArraySubscription?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["boolean-multicontrol-options"]],inputs:{multiCtrlArray:[1,"multiCtrlArray"]},outputs:{addPath:"addPath",updatePath:"updatePath",delPath:"delPath"},decls:7,vars:1,consts:[[3,"formGroup"],["formArrayName","multiCtrlArray"],[1,"full-width",3,"ctrlFormGroup","controlIndex","arrayLength"],["type","button","mat-mini-fab","","color","primary","aria-label","Add control down in the list",1,"add-btn",3,"click"],[1,"full-width",3,"moveUp","moveDown","deleteCtrl","ctrlFormGroup","controlIndex","arrayLength"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"div",1),T(2,fi,1,3,"boolean-control-config",2,Mt),n(4,"button",3),b("click",function(){return a.addCtrlGroup()}),n(5,"mat-icon"),r(6,"add"),i()()()()),t&2&&(d("formGroup",a.multiFormGroup),s(2),S(a.multiCtrlArray().controls))},dependencies:[B,j,P,K,co,Do,oe,ja,ae,N],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding-top:15px;padding-bottom:15px}.add-btn[_ngcontent-%COMP%]{margin-left:calc(50% - 20px)}"]})}return o})();var gi=["*"];var hi=new $("MAT_CARD_CONFIG"),bl=(()=>{class o{appearance;constructor(){let e=p(hi,{optional:!0});this.appearance=e?.appearance||"raised"}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(t,a){t&2&&X("mat-mdc-card-outlined",a.appearance==="outlined")("mdc-card--outlined",a.appearance==="outlined")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:gi,decls:1,vars:0,template:function(t,a){t&1&&(Re(),Ue(0))},styles:[`.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}
|
|
3
3
|
`],encapsulation:2,changeDetection:0})}return o})();var Fo=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=ge({type:o});static \u0275inj=ue({imports:[q,q]})}return o})();function bi(o,c){if(o&1&&(n(0,"mat-option",8),r(1),i()),o&2){let e=c.$implicit;Ee("value",e.value),s(),x(e.label)}}var Oo=(()=>{class o{dsService=p(et);app=p(je);displayName=f.required();showLabel=f.required();convertUnitTo=f.required();datasetUUID=f.required();datasetAverageArray=f.required();showAverageData=f.required();trackAgainstAverage=f.required();showDatasetMinimumValueLine=f.required();showDatasetMaximumValueLine=f.required();showDatasetAverageValueLine=f.required();showDatasetAngleAverageValueLine=f.required();verticalGraph=f.required();showTimeScale=f.required();showYScale=f.required();startScaleAtZero=f.required();yScaleSuggestedMin=f.required();yScaleSuggestedMax=f.required();enableMinMaxScaleLimit=f.required();yScaleMin=f.required();yScaleMax=f.required();numDecimal=f.required();color=f.required();colors=[];ngOnInit(){this.colors=this.app.configurableThemeColors,this.showAverageData().value||this.trackAgainstAverage().disable(),this.setValueScaleOptionsControls(this.enableMinMaxScaleLimit().value)}setValueScaleOptionsControls(e){e?(this.yScaleMin()?.enable(),this.yScaleMax()?.enable(),this.yScaleSuggestedMin()?.disable(),this.yScaleSuggestedMax()?.disable()):(this.yScaleMin()?.disable(),this.yScaleMax()?.disable(),this.yScaleSuggestedMin()?.enable(),this.yScaleSuggestedMax()?.enable())}setScaleControls(e){this.setValueScaleOptionsControls(e.value)}enableTrackAgainstMovingAverage(e){e.checked?this.trackAgainstAverage().enable():(this.trackAgainstAverage().setValue(e.checked),this.trackAgainstAverage().disable())}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["config-display-chart-options"]],inputs:{displayName:[1,"displayName"],showLabel:[1,"showLabel"],convertUnitTo:[1,"convertUnitTo"],datasetUUID:[1,"datasetUUID"],datasetAverageArray:[1,"datasetAverageArray"],showAverageData:[1,"showAverageData"],trackAgainstAverage:[1,"trackAgainstAverage"],showDatasetMinimumValueLine:[1,"showDatasetMinimumValueLine"],showDatasetMaximumValueLine:[1,"showDatasetMaximumValueLine"],showDatasetAverageValueLine:[1,"showDatasetAverageValueLine"],showDatasetAngleAverageValueLine:[1,"showDatasetAngleAverageValueLine"],verticalGraph:[1,"verticalGraph"],showTimeScale:[1,"showTimeScale"],showYScale:[1,"showYScale"],startScaleAtZero:[1,"startScaleAtZero"],yScaleSuggestedMin:[1,"yScaleSuggestedMin"],yScaleSuggestedMax:[1,"yScaleSuggestedMax"],enableMinMaxScaleLimit:[1,"enableMinMaxScaleLimit"],yScaleMin:[1,"yScaleMin"],yScaleMax:[1,"yScaleMax"],numDecimal:[1,"numDecimal"],color:[1,"color"]},decls:80,vars:18,consts:[["minLine",""],[1,"tab-content"],[1,"chart-flex-container"],[1,"chart-panel-group"],[1,"full-width"],["matInput","","placeholder","Enter a label to display","name","displayName",3,"formControl"],["name","showLabel",1,"full-width",3,"formControl"],["placeholder","Select Color...","name","color","required","",3,"formControl"],[3,"value"],[1,"flex-item-rounded-card","rounded-card-color"],[2,"margin-left","10px"],["matInput","","type","number","min","0","max","5","placeholder","Enter or select number...","name","numDecimal","required","",3,"formControl"],["name","showAverageData",1,"full-width",2,"margin-top","10px",3,"change","formControl"],["name","trackAgainstAverage",1,"full-width",2,"margin-left","25px",3,"formControl"],[1,"no-margin"],[1,"mat-caption"],["aria-label","Select an option","name","enableMinMaxScaleLimit",1,"chart-option-radio-group",3,"formControl"],[1,"chart-option-radio-button",3,"change","value"],[1,"chart-option-radio-button-config"],[1,"chart-option-radio-button-config-form-field"],["matInput","","type","number","name","yScaleSuggestedMin",3,"formControl"],["matInput","","type","number","name","yScaleSuggestedMax",3,"formControl"],[1,"chart-option-radio-button-config-item"],["matInput","","type","number","name","yScaleMin","required","",3,"formControl"],["matInput","","type","number","name","yScaleMax","required","",3,"formControl"],["name","showYScale",1,"full-width",3,"formControl"],["name","showTimeScale",1,"full-width",3,"formControl"],["name","showDatasetMaximumValueLine",1,"full-width",3,"formControl"],["name","showDatasetAverageValueLine",1,"full-width",3,"formControl"],["name","showDatasetMinimumValueLine",1,"full-width",3,"formControl"]],template:function(t,a){if(t&1){let l=A();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"mat-form-field",4)(4,"mat-label"),r(5,"Widget Label"),i(),g(6,"input",5),i()(),n(7,"div",3)(8,"mat-checkbox",6),r(9," Show Label "),i()()(),n(10,"div",2)(11,"mat-form-field",4)(12,"mat-label"),r(13,"Color"),i(),n(14,"mat-select",7),T(15,bi,2,2,"mat-option",8,G),i()()(),n(17,"div",2)(18,"div",9)(19,"div")(20,"p"),r(21,"Series"),i(),n(22,"mat-form-field",10)(23,"mat-label"),r(24,"Value Decimal Places"),i(),g(25,"input",11),i(),n(26,"mat-checkbox",12),b("change",function(h){return M(l),y(a.enableTrackAgainstMovingAverage(h))}),r(27," Display Moving Average "),i(),n(28,"mat-checkbox",13),r(29," Track Against Moving Average "),i()()(),n(30,"div",9)(31,"div")(32,"p",14),r(33,"Data Scale"),i(),n(34,"span",15),r(35,"(Default node is automatic scale)"),i(),n(36,"mat-radio-group",16)(37,"mat-radio-button",17),b("change",function(h){return M(l),y(a.setScaleControls(h))}),r(38,"Auto Scale"),i(),n(39,"div",18)(40,"mat-form-field",19)(41,"mat-label"),r(42,"Suggested Min"),i(),g(43,"input",20),i(),n(44,"mat-form-field",19)(45,"mat-label"),r(46,"Suggested Max"),i(),g(47,"input",21),i()(),n(48,"mat-radio-button",17),b("change",function(h){return M(l),y(a.setScaleControls(h))}),r(49,"Fixed Scale"),i(),n(50,"div",18)(51,"div",22)(52,"mat-form-field",19)(53,"mat-label"),r(54,"Min"),i(),g(55,"input",23),i()(),n(56,"div",22)(57,"mat-form-field",19)(58,"mat-label"),r(59,"Max"),i(),g(60,"input",24),i()()()(),n(61,"mat-checkbox",25),r(62," Show Scale Ticks "),i()()(),n(63,"div",9)(64,"div")(65,"p",14),r(66,"Time Scale"),i(),n(67,"mat-checkbox",26),r(68," Show Scale Ticks "),i()()(),n(69,"div",9)(70,"div")(71,"p",14),r(72,"Dataset"),i(),n(73,"mat-checkbox",27),r(74," Show Maximum Line "),i(),n(75,"mat-checkbox",28),r(76," Show Average Line "),i(),n(77,"mat-checkbox",29,0),r(79," Show Minimum Line "),i()()()()()}t&2&&(s(6),d("formControl",a.displayName()),s(2),d("formControl",a.showLabel()),s(6),d("formControl",a.color()),s(),S(a.colors),s(10),d("formControl",a.numDecimal()),s(),d("formControl",a.showAverageData()),s(2),d("formControl",a.trackAgainstAverage()),s(8),d("formControl",a.enableMinMaxScaleLimit()),s(),d("value",!1),s(6),d("formControl",a.yScaleSuggestedMin()),s(4),d("formControl",a.yScaleSuggestedMax()),s(),d("value",!0),s(7),d("formControl",a.yScaleMin()),s(5),d("formControl",a.yScaleMax()),s(),d("formControl",a.showYScale()),s(6),d("formControl",a.showTimeScale()),s(6),d("formControl",a.showDatasetMaximumValueLine()),s(2),d("formControl",a.showDatasetAverageValueLine()),s(2),d("formControl",a.showDatasetMinimumValueLine()))},dependencies:[Fo,Je,L,O,Nt,we,Lt,ne,U,pt,Pt,R,xo,To,So,P,V,xe,I,F,Ze,It,ie],styles:[".chart-flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;margin:15px 0;gap:15px;align-items:stretch}.chart-panel-group[_ngcontent-%COMP%]{min-width:250px;flex-grow:1}.no-margin[_ngcontent-%COMP%]{margin:0}.chart-option-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:0;align-items:flex-start}.chart-option-radio-button[_ngcontent-%COMP%]{margin:0}.chart-option-radio-button-config[_ngcontent-%COMP%]{margin-left:35px;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px;align-items:flex-start}.chart-option-radio-button-config-item[_ngcontent-%COMP%]{flex-grow:0;flex-shrink:1;min-width:50px}.chart-option-radio-button-config-form-field[_ngcontent-%COMP%]{display:block;max-width:118px}"]})}return o})();function _i(o,c){if(o&1&&(n(0,"mat-option",4),r(1),i()),o&2){let e=c.$implicit;d("value",e.uuid),s(),Q(" ",e.label," ")}}function vi(o,c){if(o&1&&(n(0,"mat-option",4),r(1),i()),o&2){let e=c.$implicit;d("value",e.measure),s(),Q(" ",e.description," ")}}function Ci(o,c){if(o&1&&(n(0,"mat-optgroup",6),T(1,vi,2,2,"mat-option",4,Mt),i()),o&2){let e=c.$implicit;d("label",e.group),s(),S(e.units)}}var Lo=(()=>{class o{datasetService=p(et);units=p(tt);datasetUUID=f.required();convertUnitTo=f.required();availableDataSets=[];unitList={};ngOnInit(){this.availableDataSets=this.datasetService.list().sort();let e=this.datasetUUID();e.value?(this.setPathUnits(e.value),this.convertUnitTo().enable()):this.convertUnitTo().disable()}setPathUnits(e){this.convertUnitTo().enable(),e?this.unitList=this.units.getConversionsForPath(this.datasetService.getDatasetConfig(e).path):this.unitList=this.units.getConversionsForPath("")}datasetChanged(e){this.setPathUnits(e.value)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["config-dataset-chart-options"]],inputs:{datasetUUID:[1,"datasetUUID"],convertUnitTo:[1,"convertUnitTo"]},decls:14,vars:2,consts:[[1,"tab-content"],[1,"widget-options-grid"],[1,"options-grid-span2"],["placeholder","Select dataset...","name","datasetUUID","required","",3,"selectionChange","formControl"],[3,"value"],["placeholder","Select unit...","name","convertUnitTo","required","",3,"formControl"],[3,"label"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),r(4,"Dataset"),i(),n(5,"mat-select",3),b("selectionChange",function(m){return a.datasetChanged(m)}),T(6,_i,2,2,"mat-option",4,G),i()(),n(8,"mat-form-field",2)(9,"mat-label"),r(10,"Display Format"),i(),n(11,"mat-select",5),T(12,Ci,3,1,"mat-optgroup",6,G),i()()()()),t&2&&(s(5),d("formControl",a.datasetUUID()),s(),S(a.availableDataSets),s(5),d("formControl",a.convertUnitTo()),s(),S(a.unitList.conversions))},dependencies:[Je,L,O,Lt,ne,U,Ot,P,I,F,ie],encapsulation:2})}return o})();var No=(()=>{class o{transform(e,t){return Object.keys(e)}static \u0275fac=function(t){return new(t||o)};static \u0275pipe=ga({name:"objectKeys",type:o,pure:!0})}return o})();var yi=["panel"],Ti=["*"];function Si(o,c){if(o&1&&(n(0,"div",1,0),Ue(2),i()),o&2){let e=c.id,t=u();ba(t._classList),X("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),d("id",t.id),le("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var Qt=class{source;option;constructor(c,e){this.source=c,this.option=e}},Ro=new $("mat-autocomplete-default-options",{providedIn:"root",factory:xi});function xi(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1}}var Ut=(()=>{class o{_changeDetectorRef=p(ze);_elementRef=p(rt);_defaults=p(Ro);_animationsDisabled=p(Be,{optional:!0})==="NoopAnimations";_activeOptionChanges=ht.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new Y;opened=new Y;closed=new Y;optionActivated=new Y;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}id=p(mt).getId("mat-autocomplete-");inertGroups;constructor(){let e=p(Va);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Ua(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let t=new Qt(this,e);this.optionSelected.emit(t)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["mat-autocomplete"]],contentQueries:function(t,a,l){if(t&1&&(st(l,U,5),st(l,go,5)),t&2){let m;he(m=be())&&(a.options=m),he(m=be())&&(a.optionGroups=m)}},viewQuery:function(t,a){if(t&1&&(ct(pa,7),ct(yi,5)),t&2){let l;he(l=be())&&(a.template=l.first),he(l=be())&&(a.panel=l.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",k],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",k],requireSelection:[2,"requireSelection","requireSelection",k],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",k],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",k]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[dt([{provide:fo,useExisting:o}])],ngContentSelectors:Ti,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,a){t&1&&(Re(),_(0,Si,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
|
|
4
4
|
`],encapsulation:2,changeDetection:0})}return o})();var wi={provide:kt,useExisting:vt(()=>ut),multi:!0};var Uo=new $("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let o=p(Ke);return()=>o.scrollStrategies.reposition()}});function Ai(o){return()=>o.scrollStrategies.reposition()}var Gi={provide:Uo,deps:[Ke],useFactory:Ai},ut=(()=>{class o{_environmentInjector=p(sa);_element=p(rt);_overlay=p(Ke);_viewContainerRef=p(fa);_zone=p(da);_changeDetectorRef=p(ze);_dir=p(Et,{optional:!0});_formField=p(mo,{optional:!0,host:!0});_viewportRuler=p(Ya);_scrollStrategy=p(Uo);_renderer=p(ua);_defaults=p(Ro,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new it;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=ht.EMPTY;_breakpointObserver=p(At);_handsetLandscapeSubscription=ht.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new it;_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Gt(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Oe(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(pe(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(pe(()=>this._overlayAttached)):Ht()).pipe(Pe(e=>e instanceof ho?e:null))}optionSelections=ia(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(Ne(e),_t(()=>Oe(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(_t(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new jt(e=>{let t=l=>{let m=Na(l),h=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,D=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&m!==this._element.nativeElement&&!this._hasFocus()&&(!h||!h.contains(m))&&(!D||!D.contains(m))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(m)&&e.next(l)},a=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{a.forEach(l=>l())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e.keyCode,a=He(e);if(t===27&&!a&&e.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&t===13&&this.panelOpen&&!a)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){let l=this.autocomplete._keyManager.activeItem,m=t===38||t===40;t===9||m&&!a&&this.panelOpen?this.autocomplete._keyManager.onKeydown(e):m&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(m||this.autocomplete._keyManager.activeItem!==l)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,a=t.value;if(t.type==="number"&&(a=a==""?null:parseFloat(a)),this._previousValue!==a){if(this._previousValue=a,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(a),!a)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let l=this.autocomplete.options?.find(m=>m.selected);if(l){let m=this._getDisplayValue(l.value);a!==m&&l.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let l=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(l)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return La()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new jt(a=>{ma(()=>{a.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(la(()=>this._positionStrategy.reapplyLastPosition()),ra(0))??Ht();return Oe(e,t).pipe(_t(()=>this._zone.run(()=>{let a=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),a!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Le(1)).subscribe(a=>this._setValueAndClose(a))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,a=e?e.source:this._pendingAutoselectedOption;a?(this._clearPreviousSelectedOption(a),this._assignOptionValue(a.value),this._onChange(a.value),t._emitSelectEvent(a),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(a=>{a!==e&&a.selected&&a.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;Zt(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){this.autocomplete;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Ha(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=this._overlay.create(this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(se.HandsetLandscape).subscribe(l=>{l.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let a=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&a!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!He(e)||e.keyCode===38&&He(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Xa({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],a=this._aboveClass,l=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:a},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:a}],m;this.position==="above"?m=l:this.position==="below"?m=t:m=[...t,...l],e.withPositions(m)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let a=0;a<e.options.length;a++)if(!e.options.get(a).disabled){t=a;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,a=bo(e,t.options,t.optionGroups);if(e===0&&a===1)t._setScrollTop(0);else if(t.panel){let l=t.options.toArray()[e];if(l){let m=l._getHostElement(),h=_o(m.offsetTop,m.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(h)}}}_trackedModal=null;_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&Gt(this._trackedModal,"aria-owns",t),Zt(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;Gt(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||o)};static \u0275dir=lt({type:o,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,a){t&1&&b("focusin",function(){return a._handleFocus()})("blur",function(){return a._onTouched()})("input",function(m){return a._handleInput(m)})("keydown",function(m){return a._handleKeydown(m)})("click",function(){return a._handleClick()}),t&2&&le("autocomplete",a.autocompleteAttribute)("role",a.autocompleteDisabled?null:"combobox")("aria-autocomplete",a.autocompleteDisabled?null:"list")("aria-activedescendant",a.panelOpen&&a.activeOption?a.activeOption.id:null)("aria-expanded",a.autocompleteDisabled?null:a.panelOpen.toString())("aria-controls",a.autocompleteDisabled||!a.panelOpen||a.autocomplete==null?null:a.autocomplete.id)("aria-haspopup",a.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",k]},exportAs:["matAutocompleteTrigger"],features:[dt([wi]),Ve]})}return o})(),Wo=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=ge({type:o});static \u0275inj=ue({providers:[Gi],imports:[Qa,pt,q,Za,pt,q]})}return o})();var ki=(o,c)=>c.path;function Di(o,c){o&1&&g(0,"i",21)}function Ii(o,c){o&1&&g(0,"i",22)}function Fi(o,c){if(o&1&&(n(0,"mat-option",15),r(1),i()),o&2){let e=c.$implicit;d("value",e),s(),yt("",e.properties.quantity,": ",e.properties.display,"")}}function Pi(o,c){if(o&1){let e=A();n(0,"div",5)(1,"mat-form-field",20)(2,"mat-label"),_(3,Di,1,0,"i",21)(4,Ii,1,0,"i",22),r(5," Filter"),i(),n(6,"mat-select",23,2),b("selectionChange",function(){M(e),u();let a=te(10),l=u();return y(l.pathFormGroup.controls.path.setValue(a.value))}),n(8,"mat-option"),r(9,"All"),i(),T(10,Fi,2,3,"mat-option",15,G),i()()()}if(o&2){let e=te(7),t=u(2);s(3),C(e.value?4:3),s(3),d("formControl",t.pathSkUnitsFilterControl),s(4),S(t.pathSkUnitsFiltersList)}}function Oi(o,c){if(o&1){let e=A();n(0,"button",24),b("click",function(){M(e);let a=u(2);return y(a.pathFormGroup.controls.path.setValue(""))}),n(1,"mat-icon"),r(2,"close"),i()()}}function Li(o,c){o&1&&(n(0,"mat-error"),r(1," Path is required. Please enter a valid Signal K path. "),i())}function Ni(o,c){o&1&&(n(0,"mat-error"),r(1," Path not recognized. Please enter a path from the server's published list. "),i())}function Vi(o,c){if(o&1&&(n(0,"span"),r(1),i(),g(2,"br"),n(3,"small",25),r(4),i()),o&2){let e=u().$implicit;s(),x(e.path),s(3),x(e.meta.description)}}function Bi(o,c){if(o&1&&r(0),o&2){let e=u().$implicit;Q(" ",e.path," ")}}function Ri(o,c){if(o&1&&(n(0,"mat-option",10),_(1,Vi,5,2)(2,Bi,1,1),i()),o&2){let e=c.$implicit;d("value",e.path),s(),C(e.meta!=null?1:2)}}function Ui(o,c){if(o&1&&(n(0,"mat-option",15),r(1),i()),o&2){let e=c.$implicit;d("value",e),s(),Q(" ",e," ")}}function Wi(o,c){if(o&1&&(n(0,"mat-option",15),r(1),i()),o&2){let e=c.$implicit;d("value",e.measure),s(),Q(" ",e.description," ")}}function qi(o,c){if(o&1&&(n(0,"mat-optgroup",27),T(1,Wi,2,2,"mat-option",15,G),i()),o&2){let e=c.$implicit;d("label",e.group),s(),S(e.units)}}function zi(o,c){if(o&1&&(n(0,"mat-form-field",19)(1,"mat-label"),r(2,"Display Format"),i(),n(3,"mat-select",26),T(4,qi,3,1,"mat-optgroup",27,G),i()()),o&2){let e=u(2);s(4),S(e.unitList.conversions)}}function ji(o,c){if(o&1&&(n(0,"div",3)(1,"div",4)(2,"span"),r(3),i()(),_(4,Pi,12,2,"div",5),n(5,"div",6)(6,"mat-form-field",7)(7,"mat-label"),r(8,"Signal K Path"),i(),g(9,"input",8,0),_(11,Oi,3,0,"button",9)(12,Li,2,0,"mat-error")(13,Ni,2,0,"mat-error"),n(14,"mat-autocomplete",null,1),T(16,Ri,3,2,"mat-option",10,ki),We(18,"async"),i()()(),n(19,"div",11)(20,"div",12)(21,"mat-form-field",13)(22,"mat-label"),r(23,"Data Source"),i(),n(24,"mat-select",14),T(25,Ui,2,2,"mat-option",15,G),i()()(),n(27,"div",16)(28,"mat-form-field",13)(29,"mat-label"),r(30,"Sample Time"),i(),g(31,"input",17),i()(),n(32,"div",18),_(33,zi,6,0,"mat-form-field",19),i()()()),o&2){let e=te(15),t=u();d("formGroup",t.pathFormGroup),s(2),Ct("color",t.pathFormGroup.enabled?"":"rgba(255,255,255,0.5)"),s(),x(t.pathFormGroup.value.description),s(),C(t.pathFormGroup.value.pathType=="number"&&t.showPathSkUnitsFilter?4:-1),s(5),d("matAutocomplete",e),s(2),C(t.pathFormGroup.value.path?11:-1),s(),C(t.pathFormGroup.controls.path.errors!=null&&t.pathFormGroup.controls.path.errors.required?12:t.pathFormGroup.controls.path.errors!=null&&t.pathFormGroup.controls.path.errors.requireMatch?13:-1),s(4),S(qe(18,9,t.filteredPaths)),s(9),S(t.availableSources),s(8),C(t.pathFormGroup.value.pathType=="number"&&t.pathFormGroup.value.isConvertUnitToConfigurable===void 0||t.pathFormGroup.value.pathType=="number"&&t.pathFormGroup.value.isConvertUnitToConfigurable===!0?33:-1)}}function Hi(o){return c=>o().some(a=>a.path===c.value)?null:{requireMatch:!0}}var qo=(()=>{class o{_data=p(Pa);_units=p(tt);_connection=p(Ga);pathFormGroup;filterSelfPaths=f.required();availablePaths;filteredPaths=new nt(null);_pathValueChange$=null;_pathFormGroup$=null;availableSources;unitList={base:"",conversions:[]};showPathSkUnitsFilter=!1;pathSkUnitsFilterControl=new ro(null);pathSkUnitsFiltersList;unitlessUnit={unit:"unitless",properties:{display:"(null)",quantity:"Unitless",quantityDisplay:"(null)",description:""}};ngOnInit(){this.pathSkUnitsFiltersList=this._units.skBaseUnits.sort((e,t)=>e.properties.quantity>t.properties.quantity?1:-1),this.pathSkUnitsFiltersList.unshift(this.unitlessUnit),this.pathFormGroup.value.pathSkUnitsFilter&&this.pathSkUnitsFilterControl.setValue(this.pathSkUnitsFiltersList.find(e=>e.unit===this.pathFormGroup.value.pathSkUnitsFilter),{onlySelf:!0}),this.pathFormGroup.value.showPathSkUnitsFilter&&(this.showPathSkUnitsFilter=this.pathFormGroup.value.showPathSkUnitsFilter),this.pathFormGroup.controls.path.setValidators([E.required,Hi(()=>this.getPaths())]),this.pathFormGroup.controls.path.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this.pathFormGroup.controls.path.valid?this.enableFormFields(!1):this.disablePathFields(),this.pathFormGroup.controls.sampleTime||(this.pathFormGroup.addControl("sampleTime",new H("500",E.required)),this.pathFormGroup.controls.sampleTime.updateValueAndValidity({onlySelf:!0,emitEvent:!1})),this._pathValueChange$=this.pathFormGroup.controls.path.valueChanges.pipe(na(e=>e===""?Kt(0):Kt(350)),Ne(""),Pe(e=>this.filterPaths(e||""))).subscribe(e=>{this.pathFormGroup.controls.path.pristine||(this.pathFormGroup.controls.path.valid?(this.enableFormFields(!0),this.updatePathMetaBoundDisplayName(this.pathFormGroup.controls.path.value),this.updatePathMetaBoundDisplayScale(this.pathFormGroup.controls.path.value)):this.disablePathFields())}),this._pathFormGroup$=this.pathFormGroup.controls.pathType.valueChanges.subscribe(e=>{this.pathSkUnitsFilterControl.setValue(this.unitlessUnit),this.pathFormGroup.controls.path.updateValueAndValidity()})}ngOnChanges(e){e.filterSelfPaths&&!e.filterSelfPaths.firstChange&&this.pathFormGroup.controls.path.updateValueAndValidity()}getPaths(){let e=this.pathFormGroup.controls.pathType.value,t=this.filterSelfPaths(),a=Ea(this._connection.skServerVersion,"2.12.0",">=")?this.pathFormGroup.value.supportsPut:!1;return this._data.getPathsAndMetaByType(e,a,t).sort()}filterPaths(e){let t=e.toLowerCase(),a=this.getPaths();this.pathSkUnitsFilterControl.value!=null&&(a=a.filter(l=>l.meta&&l.meta.units&&l.meta.units===this.pathSkUnitsFilterControl.value.unit||(!l.meta||!l.meta.units)&&this.pathSkUnitsFilterControl.value.unit==="unitless")),a=a.filter(l=>l.path.toLowerCase().includes(t)),this.filteredPaths.next(a)}enableFormFields(e){let t=this._data.getPathObject(this.pathFormGroup.controls.path.value);t!=null?(this.pathFormGroup.controls.sampleTime.enable({onlySelf:!1}),this.pathFormGroup.controls.pathType.value=="number"&&(this.unitList=this._units.getConversionsForPath(this.pathFormGroup.controls.path.value),e&&this.pathFormGroup.controls.convertUnitTo.setValue(this.unitList.base,{onlySelf:!0}),this.pathFormGroup.controls.convertUnitTo.enable({onlySelf:!1})),Object.keys(t.sources).length==1?(this.availableSources=["default"],e?this.pathFormGroup.controls.source.value!="default"&&this.pathFormGroup.controls.source.setValue("default",{onlySelf:!0}):this.pathFormGroup.controls.source.value!="default"&&this.pathFormGroup.controls.source.setValue("",{onlySelf:!0})):Object.keys(t.sources).length>1&&(this.availableSources=Object.keys(t.sources),this.pathFormGroup.controls.source.value=="default"&&this.pathFormGroup.controls.source.reset()),this.pathFormGroup.controls.source.enable({onlySelf:!1})):this.disablePathFields()}disablePathFields(){this.pathFormGroup.controls.source.reset("",{onlySelf:!0}),this.pathFormGroup.controls.source.disable({onlySelf:!1}),this.pathFormGroup.controls.sampleTime.disable({onlySelf:!1}),this.pathFormGroup.controls.pathType.value=="number"&&(this.pathFormGroup.controls.convertUnitTo.reset("",{onlySelf:!0}),this.pathFormGroup.controls.convertUnitTo.disable({onlySelf:!1}))}updatePathMetaBoundDisplayName(e){if(!this.pathFormGroup.parent.parent.value.hasOwnProperty("displayName"))return;let t=this._data.getPathMeta(e);t?.displayName&&this.pathFormGroup.parent.parent.controls.displayName.setValue(t.displayName)}updatePathMetaBoundDisplayScale(e){if(!this.pathFormGroup.parent.parent.value.hasOwnProperty("displayScale"))return;let t=this._data.getPathMeta(e);if(t?.displayScale){let a=this.pathFormGroup.parent.parent.get("displayScale"),l=this.pathFormGroup.controls.convertUnitTo.value;t.displayScale.lower!==null&&t.displayScale.lower!==void 0&&a.controls.lower.setValue(this._units.convertToUnit(l,t.displayScale.lower)),t.displayScale.upper!==null&&t.displayScale.upper!==void 0&&a.controls.upper.setValue(this._units.convertToUnit(l,t.displayScale.upper)),t.displayScale.type!==null&&t.displayScale.type!==void 0&&a.controls.type.setValue(t.displayScale.type),t.displayScale.power!==null&&t.displayScale.power!==void 0&&a.controls.power.setValue(t.displayScale.power)}}ngOnDestroy(){this._pathValueChange$?.unsubscribe(),this._pathFormGroup$?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["path-control-config"]],inputs:{pathFormGroup:"pathFormGroup",filterSelfPaths:[1,"filterSelfPaths"]},features:[Ve],decls:1,vars:1,consts:[["pathInput",""],["pathAutoComplete","matAutocomplete"],["pathUnitsFilter",""],[1,"flex-container","rounded-card","rounded-card-color",3,"formGroup"],[1,"flex-field-100"],[1,"flex-field-fixed"],[1,"flex-field-to-100"],["floatLabel","auto","appearance","fill",1,"pathField"],["type","text","matInput","","placeholder","Type to use autocomplete or select from list","formControlName","path","required","",3,"matAutocomplete"],["mat-icon-button","","matIconSuffix","","aria-label","Clear"],[2,"min-height","48px","line-height","1.15","height","auto","padding","8px 16px","white-space","normal",3,"value"],[1,"pathProperties"],[1,"sourceField"],["appearance","outline","floatLabel","always",1,"fields"],["placeholder","Select source","formControlName","source","required",""],[3,"value"],[1,"sampleTimeField"],["matInput","","type","number","placeholder","Sample time in milliseconds","formControlName","sampleTime","required",""],[1,"unitField"],[1,"fields"],["floatLabel","auto","appearance","fill",1,"filter-path"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-filter-circle-xmark"],["panelWidth","",3,"selectionChange","formControl"],["mat-icon-button","","matIconSuffix","","aria-label","Clear",3,"click"],[1,"pathMetaDescription"],["placeholder","Select unit","formControlName","convertUnitTo","required",""],[3,"label"]],template:function(t,a){t&1&&_(0,ji,34,11,"div",3),t&2&&C(a.pathFormGroup.value.isPathConfigurable?0:-1)},dependencies:[B,V,xe,I,j,F,P,ie,K,Ye,L,O,R,Wo,Ut,U,Ot,ut,z,Qe,Ft,ne,St,ae,N],styles:[".pathGroup[_ngcontent-%COMP%]{width:100%}.pathGroupFields[_ngcontent-%COMP%]{display:block;width:calc(100% - 5px)}.pathField[_ngcontent-%COMP%]{width:100%}.pathProperties[_ngcontent-%COMP%]{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;align-content:flex-start;gap:10px}.fields[_ngcontent-%COMP%]{width:100%}.sourceField[_ngcontent-%COMP%]{flex:3 1}.sampleTimeField[_ngcontent-%COMP%]{flex:1 3}.unitField[_ngcontent-%COMP%]{flex:3 1}"]})}return o})();function Ki(o,c){if(o&1&&g(0,"path-control-config",6),o&2){let e=c.$implicit,t=u(2);d("pathFormGroup",e)("filterSelfPaths",t.filterSelfPaths().value)}}function $i(o,c){if(o&1&&T(0,Ki,1,2,"path-control-config",6,G),o&2){let e=u();S(e.pathsFormGroup.controls)}}function Yi(o,c){if(o&1&&g(0,"path-control-config",6),o&2){let e=c.$implicit,t=u(2);d("pathFormGroup",t.pathsFormGroup.get(e))("filterSelfPaths",t.filterSelfPaths().value)}}function Zi(o,c){if(o&1&&(T(0,Yi,1,2,"path-control-config",6,G),We(2,"objectKeys")),o&2){let e=u();S(qe(2,0,e.pathsFormGroup.controls))}}var zo=(()=>{class o{rootFormGroup=p(K);fb=p(Xe);formGroupName=f.required();isArray=f.required();enableTimeout=f.required();dataTimeout=f.required();filterSelfPaths=f.required();addPathEvent=f(void 0);pathsFormGroup;ngOnInit(){this.isArray()?this.pathsFormGroup=this.rootFormGroup.control.get(this.formGroupName()):this.pathsFormGroup=this.rootFormGroup.control.get(this.formGroupName())}addPath(e){this.pathsFormGroup.push(this.fb.group({description:[e.description],path:[e.path,E.required],pathID:[e.pathID],source:[e.source,E.required],pathType:[e.pathType],isPathConfigurable:[e.isPathConfigurable],showPathSkUnitsFilter:[e.showPathSkUnitsFilter],pathSkUnitsFilter:[e.pathSkUnitsFilter],convertUnitTo:[e.convertUnitTo],sampleTime:[e.sampleTime],supportsPut:[e.supportsPut]})),this.pathsFormGroup.updateValueAndValidity()}ngOnChanges(e){e.addPathEvent&&!e.addPathEvent.firstChange&&this.addPath(e.addPathEvent.currentValue)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["paths-options"]],inputs:{formGroupName:[1,"formGroupName"],isArray:[1,"isArray"],enableTimeout:[1,"enableTimeout"],dataTimeout:[1,"dataTimeout"],filterSelfPaths:[1,"filterSelfPaths"],addPathEvent:[1,"addPathEvent"]},features:[Ve],decls:14,vars:5,consts:[[1,"widget-options-grid"],["name","enableTimeout",3,"formControl"],["type","number","matNativeControl","","placeholder","Time in seconds...","name","dataTimeout","min","2","required","",3,"formControl"],["matTextSuffix",""],[3,"formGroup"],["name","filterSelfPaths",3,"formControl"],[2,"display","block",3,"pathFormGroup","filterSelfPaths"]],template:function(t,a){t&1&&(n(0,"div",0)(1,"mat-checkbox",1),r(2," Enable Widget Data TTL "),i(),n(3,"mat-form-field")(4,"mat-label"),r(5,"TTL Timeout For Paths"),i(),g(6,"input",2),n(7,"span",3),r(8,"Seconds"),i()()(),_a(9,4),_(10,$i,2,0)(11,Zi,3,2),va(),n(12,"mat-checkbox",5),r(13,` Restrict to own vessel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-6NIOBZZL.js";import{f as ne,j as ie}from"./chunk-7OTNT2GF.js";import{j as N}from"./chunk-VIHODUV4.js";import{a as V}from"./chunk-P2NQVKWN.js";import{a as te}from"./chunk-RCSPPHLA.js";import{D as Z,E as ee,f as L,g as P,n as I,t as Q,z as X}from"./chunk-AHFD2AA5.js";import{Cc as _,Dc as o,Ea as d,Fa as p,Gc as M,Hb as E,Ic as x,Jc as w,Kc as y,Nb as u,Pc as O,Vc as T,Xe as R,Zb as g,Ze as j,af as W,bf as q,ef as J,f as k,hf as U,ic as n,if as B,jc as i,kc as h,lf as G,oc as b,of as K,qc as f,rc as C,rd as D,rf as H,sd as F,tf as z,ua as v,ub as c,uf as Y,ve as A,vf as $}from"./chunk-JIJMSRKJ.js";var ae=()=>({standalone:!1});function re(l,m){l&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(l,m){if(l&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=C();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=C();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),u(13,re,2,0,"div",38),i()}if(l&2){let e=C();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(l,m){if(l&1&&(n(0,"mat-option",43),o(1),i()),l&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(l,m){if(l&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=C();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),u(5,ce,2,3,"mat-option",42),i()()()}if(l&2){let e=C();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(l,m){if(l&1&&(n(0,"mat-option",43),o(1),i()),l&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(l,m){if(l&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),u(5,pe,2,3,"mat-option",42),i()()()),l&2){let e=C();c(5),g("ngForOf",e.serverConfigList)}}function fe(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class l{appSettingsService=v(P);storageSvc=v(L);appService=v(V);auth=v(I);fb=v(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(r=>{let t=r.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(r=>{let t=null;switch(r.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+r.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: "+r,3e3,!1);break}})}saveConfig(e,r,t,a,s){if(this.supportApplicationData){if(r==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(r,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${r}] 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(r=>{e=r})}catch(r){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+r.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,r,t,a){this.storageSvc.removeItem(e,r,t),this.appService.sendSnackbarNotification(`Configuration [${r}] 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(),r=JSON.stringify(e,null,2),t=new Blob([r],{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 r=e.target.files[0];if(r&&r.type==="application/json"){let t=new FileReader;t.onload=a=>{try{this.jsonData=JSON.parse(a.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(s){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",s)}},t.readAsText(r)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(r){return new(r||l)};static \u0275cmp=E({type:l,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(r,t){if(r&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(),u(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(),u(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(),u(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(S){return d(a),p(t.uploadJsonConfig(S))}),i(),n(65,"button",25),f("click",function(){d(a);let S=_(64);return p(S.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(r&2){let a=_(10),s=_(17),S=_(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||!S.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 l})();export{Pe as SettingsConfigComponent};
|
|
1
|
+
import{a as oe}from"./chunk-6NIOBZZL.js";import{f as ne,j as ie}from"./chunk-7OTNT2GF.js";import{j as N}from"./chunk-VIHODUV4.js";import{a as V}from"./chunk-M5YAMDFT.js";import{a as te}from"./chunk-RCSPPHLA.js";import{D as Z,E as ee,f as L,g as P,n as I,t as Q,z as X}from"./chunk-AHFD2AA5.js";import{Cc as _,Dc as o,Ea as d,Fa as p,Gc as M,Hb as E,Ic as x,Jc as w,Kc as y,Nb as u,Pc as O,Vc as T,Xe as R,Zb as g,Ze as j,af as W,bf as q,ef as J,f as k,hf as U,ic as n,if as B,jc as i,kc as h,lf as G,oc as b,of as K,qc as f,rc as C,rd as D,rf as H,sd as F,tf as z,ua as v,ub as c,uf as Y,ve as A,vf as $}from"./chunk-JIJMSRKJ.js";var ae=()=>({standalone:!1});function re(l,m){l&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(l,m){if(l&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=C();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=C();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),u(13,re,2,0,"div",38),i()}if(l&2){let e=C();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(l,m){if(l&1&&(n(0,"mat-option",43),o(1),i()),l&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(l,m){if(l&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=C();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),u(5,ce,2,3,"mat-option",42),i()()()}if(l&2){let e=C();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(l,m){if(l&1&&(n(0,"mat-option",43),o(1),i()),l&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(l,m){if(l&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),u(5,pe,2,3,"mat-option",42),i()()()),l&2){let e=C();c(5),g("ngForOf",e.serverConfigList)}}function fe(l,m){l&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class l{appSettingsService=v(P);storageSvc=v(L);appService=v(V);auth=v(I);fb=v(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(r=>{let t=r.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(r=>{let t=null;switch(r.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+r.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: "+r,3e3,!1);break}})}saveConfig(e,r,t,a,s){if(this.supportApplicationData){if(r==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(r,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${r}] 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(r=>{e=r})}catch(r){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+r.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,r,t,a){this.storageSvc.removeItem(e,r,t),this.appService.sendSnackbarNotification(`Configuration [${r}] 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(),r=JSON.stringify(e,null,2),t=new Blob([r],{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 r=e.target.files[0];if(r&&r.type==="application/json"){let t=new FileReader;t.onload=a=>{try{this.jsonData=JSON.parse(a.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(s){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",s)}},t.readAsText(r)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(r){return new(r||l)};static \u0275cmp=E({type:l,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(r,t){if(r&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(),u(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(),u(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(),u(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(S){return d(a),p(t.uploadJsonConfig(S))}),i(),n(65,"button",25),f("click",function(){d(a);let S=_(64);return p(S.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(r&2){let a=_(10),s=_(17),S=_(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||!S.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 l})();export{Pe as SettingsConfigComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as c,k as s,r as p}from"./chunk-AHFD2AA5.js";import{Va as i,cd as a,m as n,o as m,oa as g,ua as l}from"./chunk-JIJMSRKJ.js";var u="3.1.2-beta1";var D=(()=>{class o{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new n;cssThemeColorRoles$=new m(null);_cssThemeColorRoles=null;_settings=l(c);_data=l(p);isNightMode=i(!1);_useAutoNightMode=s(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=s(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=s(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=s(this._data.subscribePath(this.MODE_PATH,"default"));appVersion=i(u);browserVersion=i("Unknown");osVersion=i("Unknown");constructor(){a(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),a(()=>{let t=this._environmentMode().data.value;this._useAutoNightMode()&&(this.isNightMode.set(t==="night"),this.toggleDayNightMode())}),a(()=>{this._redNightMode()?this.toggleDayNightMode():this.toggleDayNightMode()}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(t,e=1e4,r=!1){this.snackbarAppNotifications.next({message:t,duration:e,silent:r})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let t=document.body,e=getComputedStyle(t),r={background:e.getPropertyValue("--mat-sys-background").trim(),cardColor:e.getPropertyValue("--kip-widget-card-background-color").trim(),blue:e.getPropertyValue("--kip-blue-color").trim(),blueDim:e.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:e.getPropertyValue("--kip-blue-dimmer-color").trim(),green:e.getPropertyValue("--kip-green-color").trim(),greenDim:e.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:e.getPropertyValue("--kip-green-dimmer-color").trim(),grey:e.getPropertyValue("--kip-grey-color").trim(),greyDim:e.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:e.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:e.getPropertyValue("--kip-orange-color").trim(),orangeDim:e.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:e.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:e.getPropertyValue("--kip-pink-color").trim(),pinkDim:e.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:e.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:e.getPropertyValue("--kip-purple-color").trim(),purpleDim:e.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:e.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:e.getPropertyValue("--kip-contrast-color").trim(),contrastDim:e.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:e.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:e.getPropertyValue("--kip-yellow-color").trim(),yellowDim:e.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:e.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:e.getPropertyValue("--kip-port-color").trim(),starboard:e.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:e.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:e.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:e.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:e.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:e.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(t,e=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${t}`);let h=e?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",h)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let t=navigator.userAgent,e="Unknown";return t.includes("Edg")?e=`Edge ${t.match(/Edg\/(\d+)/)?.[1]}`:t.includes("Chrome")&&!t.includes("Edg")&&!t.includes("Chromium")?e=`Chrome ${t.match(/Chrome\/(\d+)/)?.[1]}`:t.includes("Chromium")?e=`Chromium ${t.match(/Chromium\/(\d+)/)?.[1]}`:t.includes("Firefox")?e=`Firefox ${t.match(/Firefox\/(\d+)/)?.[1]}`:t.includes("Safari")&&!t.includes("Chrome")&&!t.includes("Chromium")?e=`Safari ${t.match(/Version\/(\d+)/)?.[1]}`:(t.includes("Opera")||t.includes("OPR"))&&(e=`Opera ${t.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),e}getOSVersion(){let t=navigator.platform,e=navigator.userAgent;return t.startsWith("Mac")?"macOS":t.startsWith("Win")?"Windows":/Linux/.test(t)?e.includes("ARM")||e.includes("aarch64")||e.includes("Raspberry")||t.includes("armv7l")||t.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(e){return new(e||o)};static \u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-LTMJXHF3.js";import{g as l}from"./chunk-FCC7GNHD.js";import"./chunk-SGYCFQGT.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-LTMJXHF3.js";import{g as l}from"./chunk-FCC7GNHD.js";import"./chunk-SGYCFQGT.js";import{a as g}from"./chunk-M5YAMDFT.js";import"./chunk-RCSPPHLA.js";import{g as a,n as r}from"./chunk-AHFD2AA5.js";import{Hb as s,ua as t}from"./chunk-JIJMSRKJ.js";var v=(()=>{class o{dialog=t(l);auth=t(r);appService=t(g);appSettingsService=t(a);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(n=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};
|