@mxtommy/kip 3.8.2 → 3.9.0-beta.3
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 +3 -2
- package/package.json +1 -1
- package/public/3rdpartylicenses.txt +0 -26
- package/public/{chunk-SIMUFQFG.js → chunk-4JJLPUET.js} +1 -1
- package/public/chunk-5I4RHHVN.js +11 -0
- package/public/{chunk-WD5WD3GY.js → chunk-CQXWGD3T.js} +1 -1
- package/public/chunk-K22CSA3Y.js +1 -0
- package/public/{chunk-OPPBJYH7.js → chunk-Q2Y75POI.js} +1 -1
- package/public/{chunk-KPQDHC2Z.js → chunk-QJ7KN34C.js} +1 -1
- package/public/{chunk-ZWNGAG3P.js → chunk-RRTCHHRC.js} +1 -1
- package/public/{chunk-7BMBGIZI.js → chunk-S3HDPCXO.js} +1 -1
- package/public/chunk-TXPLRBW5.js +2 -0
- package/public/chunk-VHFBF47T.js +1 -0
- package/public/{chunk-4WFDZ6FH.js → chunk-YP4L5CLU.js} +1 -1
- package/public/chunk-YRM4OGRD.js +2 -0
- package/public/index.html +1 -1
- package/public/main-Z53UATGE.js +64 -0
- package/public/chunk-7VNHJHIE.js +0 -1
- package/public/chunk-FYMQ3PE4.js +0 -1
- package/public/chunk-GQ3O7IYU.js +0 -11
- package/public/chunk-SMXTNO74.js +0 -2
- package/public/chunk-TE3Z6IE7.js +0 -2
- package/public/main-ZQQ2KBG6.js +0 -237
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Se}from"./chunk-VYUMZVH2.js";import{a as De,b as Me,c as ve,d as Pe,e as Oe,f as V,g as Te,h as Ie,i as ke,j as Re,k as Ee,l as Ve,m as Fe,n as b,o as He,p as y,q as Ue,r as Be}from"./chunk-HCXH72CD.js";import"./chunk-KTDDP73O.js";import{a as xe}from"./chunk-
|
|
1
|
+
import{a as Se}from"./chunk-VYUMZVH2.js";import{a as De,b as Me,c as ve,d as Pe,e as Oe,f as V,g as Te,h as Ie,i as ke,j as Re,k as Ee,l as Ve,m as Fe,n as b,o as He,p as y,q as Ue,r as Be}from"./chunk-HCXH72CD.js";import"./chunk-KTDDP73O.js";import{a as xe}from"./chunk-VHFBF47T.js";import{d as we,f as be,n as ye}from"./chunk-ZBCOJLI4.js";import{m as re,n as le}from"./chunk-TXPLRBW5.js";import{d as pe,e as se,g as me,h as de,i as ue,j as fe,k as ge}from"./chunk-3LEMFOCV.js";import{$ as he,T as R,_ as E,ca as _e,da as Ce,p as ie}from"./chunk-TA4GACKT.js";import{$b as u,A as $,Aa as D,Ac as k,Bc as C,Bd as ae,Cb as g,Ec as J,Fa as K,Fc as X,Fe as L,Gc as Y,Ie as A,P as q,Pd as z,Qc as Z,Qd as ne,Rc as ee,Sb as M,Tb as v,Vb as U,Wb as h,Xb as _,Yb as s,Yc as te,Zb as o,_b as i,a as F,ad as w,b as H,bd as j,dc as P,ec as O,ee as oe,gc as T,ic as I,ja as Q,kc as d,lb as c,m as N,sc as B,ta as m,tc as W,uc as G,ve as ce,wb as f,za as x,zc as l}from"./chunk-35L7BBBD.js";function Ae(e,r){e&1&&(o(0,"span",3),l(1,"Boolean"),i())}function Ne(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function $e(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function qe(e,r){e&1&&(o(0,"span",3),l(1,"Object"),i())}function Qe(e,r){if(e&1){let t=T();o(0,"button",5),I("click",function(){x(t);let n=d();return D(n.openDialog())}),l(1),i()}if(e&2){let t=d();c(),k(t.selectedUnit)}}function Ke(e,r){if(e&1&&(o(0,"mat-option",6),l(1),i()),e&2){let t=r.$implicit;s("value",t.measure),c(),C(" ",t.measure," ")}}function We(e,r){if(e&1&&(o(0,"mat-optgroup",3),h(1,Ke,2,2,"mat-option",6,U),i()),e&2){let t=r.$implicit;s("label",t.group),c(),_(t.units)}}var je=(()=>{class e{_units=m(Se);_dialog=m(me);path=w.required();source=w(void 0);pathValue=w(void 0);type=w.required();units=null;selectedUnit="unitless";ngOnInit(){this.units=this._units.getConversionsForPath(this.path()),this.selectedUnit=this.units.base}convertValue(t,a){return a==="number"?this._units.convertToUnit(this.selectedUnit,t):t}openDialog(){this._dialog.open(Ge,{data:{selectedUnit:this.selectedUnit,units:this.units}}).afterClosed().subscribe(a=>{a&&(this.selectedUnit=a)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector-row"]],inputs:{path:[1,"path"],source:[1,"source"],pathValue:[1,"pathValue"],type:[1,"type"]},decls:10,vars:3,consts:[[1,"cell-source","cells"],[1,"cell-value","cells"],[1,"cell-action","cells"],[1,"path-type"],["mat-stroked-button","",1,"change-units-btn"],["mat-stroked-button","",1,"change-units-btn",3,"click"]],template:function(a,n){if(a&1&&(o(0,"mat-cell",0),l(1),i(),o(2,"mat-cell",1),l(3),i(),o(4,"mat-cell",2),M(5,Ae,2,0,"span",3)(6,Ne,2,0,"span",3)(7,$e,2,0,"span",3)(8,qe,2,0,"span",3)(9,Qe,2,1,"button",4),i()),a&2){let p;c(),k(n.source()),c(2),k(n.convertValue(n.pathValue(),n.type())),c(2),v((p=n.type())==="boolean"?5:p==="string"?6:p==="Date"?7:p==="object"?8:9)}},dependencies:[V,A,L],styles:[`.change-units-btn{width:100%}.cell-source:first-of-type{padding-left:0;flex:1 1 30%}.cells{border:0px solid white;word-break:break-word;overflow-wrap:break-word}.cell-value{justify-content:flex-start;flex:1 1 70%;padding:0}.cell-action{justify-content:end;flex:0 0 107px}.cell-action:last-of-type{padding:0}.path-type{width:100%;height:40px;align-content:center;text-align:center;color:var(--mat-sys-primary)}
|
|
2
2
|
`],encapsulation:2})}return e})(),Ge=(()=>{class e{dialogRef=m(pe);data=m(se);selectedUnit=null;static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["dialog-unit-selector"]],decls:14,vars:2,consts:[["mat-dialog-title",""],["appearance","outline","floatLabel","always",2,"padding-top","15px","padding-bottom","15px"],[3,"valueChange","value"],[3,"label"],["mat-flat-button","","mat-dialog-close",""],["mat-flat-button","",3,"mat-dialog-close"],[3,"value"]],template:function(a,n){a&1&&(o(0,"h2",0),l(1,"Select Unit type"),i(),o(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"mat-label"),l(5,"Unit"),i(),o(6,"mat-select",2),Y("valueChange",function(S){return X(n.data.selectedUnit,S)||(n.data.selectedUnit=S),S}),h(7,We,3,1,"mat-optgroup",3,U),i()()(),o(9,"mat-dialog-actions")(10,"button",4),l(11,"Cancel"),i(),o(12,"button",5),l(13,"Ok"),i()()),a&2&&(c(6),J("value",n.data.selectedUnit),c(),_(n.data.units.conversions),c(5),s("mat-dialog-close",n.data.selectedUnit))},dependencies:[ue,fe,E,R,ye,we,be,ge,A,L,de],encapsulation:2})}return e})();var Je=(e,r)=>r.key;function Xe(e,r){e&1&&(o(0,"mat-header-cell",19),l(1," Path "),i())}function Ye(e,r){if(e&1&&(o(0,"mat-cell",20),l(1),i()),e&2){let t=r.$implicit;c(),C(" ",t.path," ")}}function Ze(e,r){e&1&&(o(0,"mat-header-cell",21),l(1," PUT Support "),i())}function et(e,r){e&1&&(o(0,"mat-icon",23),l(1,"check_circle"),i())}function tt(e,r){if(e&1&&(o(0,"mat-cell",22),M(1,et,2,0,"mat-icon",23),i()),e&2){let t=r.$implicit;c(),v(t.meta!=null&&t.meta.supportsPut?1:-1)}}function at(e,r){e&1&&(o(0,"mat-header-cell",24),l(1," Source "),i())}function nt(e,r){if(e&1&&u(0,"data-inspector-row",27),e&2){let t=r.$implicit,a=d().$implicit,n=d();s("path",a.path)("source",n.getSourceKey(t))("pathValue",n.getSourceValue(t))("type",a.type)}}function it(e,r){if(e&1&&(o(0,"mat-cell",25)(1,"div",26),h(2,nt,1,4,"data-inspector-row",27,Je),Z(4,"keyvalue"),i()()),e&2){let t=r.$implicit;c(2),_(ee(4,0,t.sources))}}function ot(e,r){e&1&&u(0,"mat-header-row",28)}function rt(e,r){e&1&&u(0,"mat-row",29)}function lt(e,r){if(e&1&&(o(0,"tr",30)(1,"td",31),l(2),i()()),e&2){d();let t=G(6);c(2),C('No data matching the filter "',t.value,'"')}}var Nt=(()=>{class e{dataService=m(ie);destroyRef=m(K);_responsive=m(oe);isPhonePortrait;filterSubject=new N;paginator=j.required(b);sort=j.required(y);pageTitle="Data Inspector";pageSize=25;hidePageSize=!1;showFirstLastButtons=!0;showPageSizeOptions=[5,10,25,100];tableData=new Fe([]);displayedColumns=["path","supportsPut","defaultSource"];constructor(){this.filterSubject.pipe(q(500)).pipe(z(this.destroyRef)).subscribe(t=>{this.tableData.filter=t.trim().toLowerCase(),this.tableData.paginator&&this.tableData.paginator.firstPage()}),this.isPhonePortrait=ne(this._responsive.observe(ce.HandsetPortrait)),te(()=>{this.isPhonePortrait().matches?(this.hidePageSize=!0,this.showFirstLastButtons=!1,this.showPageSizeOptions=[]):(this.hidePageSize=!1,this.showFirstLastButtons=!0,this.showPageSizeOptions=[5,10,25,100])})}ngAfterViewInit(){this.dataService.startSkDataFullTree().pipe($(t=>t.filter(a=>Object.keys(a.sources||{}).length>0).map(a=>H(F({},a),{sources:a.type&&a.type.includes("object")&&typeof a.sources=="object"?Object.fromEntries(Object.entries(a.sources).map(([n,p])=>[n,H(F({},p),{sourceValue:typeof p.sourceValue=="object"?JSON.stringify(p.sourceValue):p.sourceValue})])):a.sources}))),Q(500),z(this.destroyRef)).subscribe(t=>{this.tableData.data=t}),this.tableData.paginator=this.paginator(),this.tableData.sort=this.sort(),this.tableData.sortingDataAccessor=(t,a)=>{switch(a){case"supportsPut":return t.meta?.supportsPut?1:0;default:return t[a]}}}applyFilter(t){let a=t.target.value;this.filterSubject.next(a)}trackByPath(t,a){return`${a.path}`}trackBySource(t,a){return`${a.key}`}getSourceKey(t){return String(t.key)}getSourceValue(t){return t.value.sourceValue}ngOnDestroy(){this.filterSubject.complete(),this.dataService.stopSkDataFullTree()}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector"]],viewQuery:function(a,n){a&1&&(B(n.paginator,b,5),B(n.sort,y,5)),a&2&&W(2)},decls:21,vars:10,consts:[["input",""],[3,"pageTitle"],[1,"data-inspector-container"],[1,"filter-field"],["matInput","","placeholder","Type any part of the path, source or value...","value","",3,"keyup"],["matSort","","matSortActive","path","matSortDirection","asc",1,"table-content-area","mat-elevation-z8",3,"dataSource","trackBy"],["matColumnDef","path"],["class","pathHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","pathCell row-cell",4,"matCellDef"],["matColumnDef","supportsPut"],["class","putHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","putCell row-cell",4,"matCellDef"],["matColumnDef","defaultSource"],["class","dataHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","dataCell row-cell",4,"matCellDef"],["class","headerRow",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","table-row",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],[1,"paginator",3,"pageSize","pageSizeOptions","hidePageSize","showFirstLastButtons"],["mat-sort-header","",1,"pathHeader"],[1,"pathCell","row-cell"],["mat-sort-header","",1,"putHeader"],[1,"putCell","row-cell"],["matTooltip","Supports PUT operation",1,"put-icon"],["mat-sort-header","",1,"dataHeader"],[1,"dataCell","row-cell"],[1,"flex-container"],[1,"source-sub-row",3,"path","source","pathValue","type"],[1,"headerRow"],[1,"table-row"],[1,"mat-row"],["colspan","4",1,"mat-cell"]],template:function(a,n){if(a&1){let p=T();u(0,"page-header",1),o(1,"div",2)(2,"mat-form-field",3)(3,"mat-label"),l(4,"Filter"),i(),o(5,"input",4,0),I("keyup",function(ze){return x(p),D(n.applyFilter(ze))}),i()(),o(7,"mat-table",5),P(8,6),g(9,Xe,2,0,"mat-header-cell",7)(10,Ye,2,1,"mat-cell",8),O(),P(11,9),g(12,Ze,2,0,"mat-header-cell",10)(13,tt,2,1,"mat-cell",11),O(),P(14,12),g(15,at,2,0,"mat-header-cell",13)(16,it,5,2,"mat-cell",14),O(),g(17,ot,1,0,"mat-header-row",15)(18,rt,1,0,"mat-row",16)(19,lt,3,1,"tr",17),i(),u(20,"mat-paginator",18),i()}a&2&&(s("pageTitle",n.pageTitle),c(7),s("dataSource",n.tableData)("trackBy",n.trackByPath),c(10),s("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),c(),s("matRowDefColumns",n.displayedColumns),c(2),s("pageSize",n.pageSize)("pageSizeOptions",n.showPageSizeOptions)("hidePageSize",n.hidePageSize)("showFirstLastButtons",n.showFirstLastButtons))},dependencies:[he,E,R,Ve,De,ve,Te,Pe,Me,Ie,Oe,V,ke,Re,Ee,Ce,_e,He,b,Be,y,Ue,je,xe,le,re,ae],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%}.data-inspector-container[_ngcontent-%COMP%]{margin-left:24px;margin-right:24px;height:calc(100% - 63px)}.table-content-area[_ngcontent-%COMP%]{height:calc(100% - 142px);overflow-y:auto;width:100%;scroll-behavior:smooth}.mat-column-path[_ngcontent-%COMP%]{flex:0 0 50%;width:50%}.mat-mdc-table[_ngcontent-%COMP%]{overflow:auto}.paginator[_ngcontent-%COMP%]{width:100%;height:56px;background-color:var(--mat-sys-background)}.filter-field[_ngcontent-%COMP%]{padding:15px 0;width:100%;height:86px}.pathHeader[_ngcontent-%COMP%]{flex:1 1 45%}.putHeader[_ngcontent-%COMP%]{flex:1 1 10%}.dataHeader[_ngcontent-%COMP%]{flex:1 1 45%}.table-row[_ngcontent-%COMP%]{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}.row-cell[_ngcontent-%COMP%]{border-bottom-color:#fff;border-bottom-width:0px;border-bottom-style:solid}.pathCell[_ngcontent-%COMP%]{flex:1 1 45%;word-break:break-word;overflow-wrap:break-word}.putCell[_ngcontent-%COMP%]{flex:1 1 10%}.dataCell[_ngcontent-%COMP%]{flex:1 1 45%;flex-flow:column;flex-wrap:nowrap;gap:2px}.flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;gap:5px;margin:5px 0;height:100%;width:100%}.source-sub-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;width:100%}.put-icon[_ngcontent-%COMP%]{color:var(--kip-starboard-color)}@media screen and (max-width: 750px){.pathHeader[_ngcontent-%COMP%], .dataHeader[_ngcontent-%COMP%]{flex:1 1 50%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%;margin-left:24px}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]{flex-direction:row;flex-wrap:wrap}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:attr(data-label);float:left;padding-right:5px}mat-row[_ngcontent-%COMP%]:after{min-height:auto;padding-bottom:10px}.dataRow[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.actionCell[_ngcontent-%COMP%]{margin-left:24px}}"]})}return e})();export{Nt as DataInspectorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as p,p as d}from"./chunk-TA4GACKT.js";import{Ja as i,Qd as s,Wc as u,Yc as a,m,o as g,oa as c,ta as l}from"./chunk-35L7BBBD.js";var h={name:"@mxtommy/kip",version:"3.9.0-beta.3",description:"An advanced and versatile marine instrumentation package to display Signal K data.",license:"MIT",author:{name:"Thomas St.Pierre, David Godin"},contributors:[{name:"David Godin",email:"godind@hotmail.com"},{name:"Thomas St.Pierre",email:"thomas@samoht.ca"}],homepage:"https://github.com/mxtommy/Kip",bugs:"https://github.com/mxtommy/Kip/issues",repository:{type:"git",url:"git+https://github.com/mxtommy/Kip.git"},keywords:["signalk-webapp","signalk-category-instruments","signal k","signalk","instruments","dashboard","marine","nmea"],signalk:{appIcon:"assets/icon-72x72.png",displayName:"KIP Instrument MFD"},scripts:{dev:"ng serve --configuration=dev --serve-path=/@mxtommy/kip/","build-dev":"ng build --configuration=dev","build-prod":"ng build --configuration=production",test:"ng test",lint:"ng lint",e2e:"ng e2e"},devDependencies:{"@angular-devkit/build-angular":"^20.1.6","@angular/animations":"20.1.7","@angular/build":"^20.1.6","@angular/cdk":"20.1.6","@angular/cli":"^20.1.6","@angular/common":"20.1.7","@angular/compiler":"20.1.7","@angular/compiler-cli":"20.1.7","@angular/core":"20.1.7","@angular/forms":"20.1.7","@angular/language-service":"20.1.7","@angular/material":"20.1.6","@angular/platform-browser":"20.1.7","@angular/platform-browser-dynamic":"20.1.7","@angular/router":"20.1.7","@godind/ng-canvas-gauges":"^6.2.1","@robloche/chartjs-plugin-streaming":"^3.1.0","@types/canvas-gauges":"^2.1.8","@types/hammerjs":"^2.0.45","@types/howler":"^2.2.10","@types/jasmine":"~3.6.0","@types/jasminewd2":"^2.0.9","@types/js-quantities":"^1.6.6","@types/lodash-es":"^4.17.9","@types/node":"^24.1.0","angular-eslint":"20.1.1","chart.js":"^4.4.9","chartjs-adapter-date-fns":"^3.0.0","chartjs-plugin-annotation":"^3.0.1",codelyzer:"^6.0.0","compare-versions":"^6.1.1","core-js":"^3.13.1","date-fns":"^2.30.0",eslint:"^9.29.0",gridstack:"^11.4.0",hammerjs:"^2.0.8",howler:"^2.2.4","jasmine-core":"~4.0.1","jasmine-spec-reporter":"~5.0.0","js-quantities":"^1.8.0",karma:"^6.4.4","karma-chrome-launcher":"~3.1.0","karma-cli":"~2.0.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-jasmine":"~4.0.0","karma-jasmine-html-reporter":"^1.6.0","lodash-es":"^4.17.21","ng-packagr":"^20.0.1","ngx-markdown":"^20.0.0","ngx-resize-observer":"^3.1.0",protractor:"~7.0.0","pwa-asset-generator":"^8.0.4",rxjs:"^7.8.2",sass:"^1.49.9",screenfull:"^6.0.2","@zakj/no-sleep":"^0.13.5",steelseries:"^2.0.9","ts-node":"^10.9.2",tslib:"^2.6.2",typescript:"^5.8.3","zone.js":"^0.15.1"}};var N=(()=>{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 m;cssThemeColorRoles$=new g(null);_cssThemeColorRoles=null;_settings=l(p);_data=l(d);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(h.version);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(()=>{let t=this._redNightMode();u(()=>{t?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,n="Dismiss"){this.snackbarAppNotifications.next({message:t,duration:e,silent:r,action:n})}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 n=e?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",n)}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=c({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();export{N as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,c as j,d as z,e as B,f as $,g as U}from"./chunk-
|
|
1
|
+
import{a as I,c as j,d as z,e as B,f as $,g as U}from"./chunk-4JJLPUET.js";import{g as S,m as D,n as O}from"./chunk-TXPLRBW5.js";import{a as R,b as V}from"./chunk-2YVW3TBK.js";import{$b as C,Aa as f,Ac as k,Bc as E,Cb as F,De as L,Fe as P,Ie as N,Ja as h,Od as A,Sb as d,Tb as c,Wb as T,Xb as w,Xc as _,Yb as u,Yc as H,Zb as o,_b as l,gc as M,ic as x,kc as m,lb as p,ta as b,uc as y,wb as v,za as g,zc as a}from"./chunk-35L7BBBD.js";var W=(e,n)=>n.file;function q(e,n){e&1&&a(0," Loading... ")}function G(e,n){e&1&&a(0," Table of Content ")}function J(e,n){e&1&&(o(0,"button",8),a(1,"Error loading menu"),l())}function K(e,n){e&1&&(o(0,"button",8),a(1,"No help entries"),l())}function Q(e,n){if(e&1){let t=M();o(0,"button",10),x("click",function(){let i=g(t).$implicit,s=m(3);return f(s.selectFile(i.file))}),a(1),l()}if(e&2){let t=n.$implicit,r=m(3);u("disabled",r.selectedFile()===t.file),p(),E(" ",t.title," ")}}function X(e,n){if(e&1&&T(0,Q,2,2,"button",9,W),e&2){let t=m(2);w(t.helpFiles())}}function Y(e,n){if(e&1&&d(0,J,2,0,"button",8)(1,K,2,0,"button",8)(2,X,2,0),e&2){let t=m();c(t.hasError()?0:!t.isLoading()&&t.helpFiles().length===0?1:2)}}function Z(e,n){e&1&&(o(0,"div",6),a(1,"Unable to load help content."),l())}function ee(e,n){e&1&&(o(0,"div",6),a(1,"Loading help..."),l())}function te(e,n){if(e&1&&C(0,"markdown",7),e&2){let t=m();u("src","assets/help-docs/"+t.selectedFile())}}var he=(()=>{class e{pageTitle="Help";_router=b(S);_helpMenuRes=A(()=>"assets/help-docs/menu.json");helpFiles=_(()=>this._helpMenuRes.hasValue()?(this._helpMenuRes.value()??[]).filter(t=>t.file.endsWith(".md")):[]);selectedFile=h("");_initSelectionOnce=h(!1);_syncEffect=H(()=>{let t=this.helpFiles();!this._initSelectionOnce()&&t.length>0&&(this.selectedFile.set(t[0].file),this._initSelectionOnce.set(!0))});hasError=_(()=>this._helpMenuRes.error()!=null);isLoading=_(()=>this._helpMenuRes.isLoading());selectFile(t){this.selectedFile.set(t)}closePage(){this._router.navigate(["/dashboard"])}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=v({type:e,selectors:[["app-help"]],decls:16,vars:5,consts:[["helpMenu","matMenu"],[1,"fullpage-header"],[1,"fullpage-header-title"],["mat-flat-button","",3,"matMenuTriggerFor","disabled"],["matMenuContent",""],["mat-icon-button","","aria-label","Close",1,"dialog-close-icon",3,"click"],[1,"markdown-content"],[1,"markdown-content",3,"src"],["mat-menu-item","","disabled",""],["mat-menu-item","",3,"disabled"],["mat-menu-item","",3,"click","disabled"]],template:function(r,i){if(r&1){let s=M();o(0,"div",1)(1,"h6",2),a(2),l(),o(3,"button",3),d(4,q,1,0)(5,G,1,0),l(),o(6,"mat-menu",null,0),F(8,Y,3,1,"ng-template",4),l(),o(9,"button",5),x("click",function(){return g(s),f(i.closePage())}),o(10,"mat-icon"),a(11,"close"),l()()(),C(12,"mat-divider"),d(13,Z,2,0,"div",6)(14,ee,2,0,"div",6)(15,te,1,1,"markdown",7)}if(r&2){let s=y(7);p(2),k(i.pageTitle),p(),u("matMenuTriggerFor",s)("disabled",i.isLoading()||i.hasError()||i.helpFiles().length===0),p(),c(i.isLoading()?4:5),p(9),c(i.hasError()?13:i.isLoading()&&i.helpFiles().length===0?14:i.selectedFile()?15:-1)}},dependencies:[I,N,P,L,U,B,j,z,$,V,R,O,D],styles:[".fullpage-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline}.fullpage-header-title[_ngcontent-%COMP%]{margin-block-start:0px;margin-block-end:0px;padding:18px 24px 13px;color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, .03125em))}.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}.markdown-content[_ngcontent-%COMP%]{display:block;height:calc(100% - 75px);width:100%;overflow-x:scroll;padding:25px}"]})}return e})();export{he as AppHelpComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-NMEZOCU2.js";import{g as l}from"./chunk-3LEMFOCV.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-NMEZOCU2.js";import{g as l}from"./chunk-3LEMFOCV.js";import{a as g}from"./chunk-K22CSA3Y.js";import"./chunk-2YVW3TBK.js";import{g as a,i as r}from"./chunk-TA4GACKT.js";import{ta as t,wb as s}from"./chunk-35L7BBBD.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);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(()=>{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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as zt,b as Ft,c as At,d as Lt,e as Ht,f as Vt,g as Nt,h as Bt,i as Qt,j as jt,k as $t,m as qt,n as pe,p as de,q as Wt}from"./chunk-HCXH72CD.js";import"./chunk-KTDDP73O.js";import{c as Ot,d as Pt}from"./chunk-CBUY7NMR.js";import{a as kt}from"./chunk-JY3WVS7C.js";import{a as Rt}from"./chunk-FYMQ3PE4.js";import{f as It,n as Tt}from"./chunk-ZBCOJLI4.js";import{p as pt}from"./chunk-SMXTNO74.js";import{d as ft,e as _t,g as gt,i as vt,j as bt}from"./chunk-3LEMFOCV.js";import{a as we}from"./chunk-2YVW3TBK.js";import{A as be,D as xt,E as ye,F as Dt,L as Mt,M as wt,N as Et,Q as Se,T as Ce,_ as xe,aa as De,ca as Me,k as Je,p as Xe,r as yt,u as St,w as Ct,x as ve}from"./chunk-TA4GACKT.js";import{$b as v,$d as it,A as Re,Aa as _,Ab as P,Ac as k,Bc as I,Be as ct,Cb as g,Ce as mt,Db as Be,Ec as G,Fb as N,Fc as K,Fe as ge,Gb as Qe,Gc as U,Ja as x,Ke as ut,Lc as qe,Mc as ue,Na as Le,Nc as We,Oa as X,Oc as he,Oe as ht,Pc as Ge,Qa as ee,Qc as Ke,Ra as te,Rb as B,Sb as D,Sc as Ue,Tb as M,Uc as Ze,Ud as et,Vb as R,Wb as z,Wd as tt,Xb as F,Xc as le,Yb as u,Zb as r,_b as s,bd as fe,be as at,ce as nt,dc as Q,ec as j,ed as Z,fa as O,fc as A,g as Oe,ga as ze,gc as $,ha as T,hc as q,ic as C,id as Y,jd as Ye,kc as h,lb as l,lc as ie,le as rt,m as oe,mc as ae,me as ot,nb as V,nc as w,oa as Fe,oc as ne,oe as st,pb as He,pc as b,qc as y,ra as Ae,sb as Ve,sc as me,se as lt,t as Pe,ta as c,tc as je,uc as W,vc as $e,wb as E,wc as L,we as dt,yb as S,yc as se,yd as _e,za as f,zb as Ne,zc as p}from"./chunk-35L7BBBD.js";var Gt=(()=>{class t{transform(e,i){return!e||!e.length?[]:i?e.filter(a=>a.includes("self")):e}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=Ne({name:"filterSelf",type:t,pure:!0})}return t})();var oi=["*"];function si(t,o){t&1&&ae(0)}var Ie=(()=>{class t{_elementRef=c(ee);constructor(){}focus(){this._elementRef.nativeElement.focus()}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"]})}return t})(),Te=(()=>{class t{template=c(V);constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepLabel",""]]})}return t})();var H={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},li=new Ae("STEPPER_GLOBAL_OPTIONS"),ce=(()=>{class t{_stepperOptions;_stepper=c(J);_displayDefaultIndicatorType;stepLabel;_childForms;content;stepControl;get interacted(){return this._interacted()}set interacted(e){this._interacted.set(e)}_interacted=x(!1);interactedStream=new N;label;errorMessage;ariaLabel;ariaLabelledby;get state(){return this._state()}set state(e){this._state.set(e)}_state=x(void 0);get editable(){return this._editable()}set editable(e){this._editable.set(e)}_editable=x(!0);optional=!1;get completed(){let e=this._completedOverride(),i=this._interacted();return e??(i&&(!this.stepControl||this.stepControl.valid))}set completed(e){this._completedOverride.set(e)}_completedOverride=x(null);index=x(-1);isSelected=le(()=>this._stepper.selectedIndex===this.index());indicatorType=le(()=>{let e=this.isSelected(),i=this.completed,a=this._state()??H.NUMBER,n=this._editable();return this._showError()&&this.hasError&&!e?H.ERROR:this._displayDefaultIndicatorType?!i||e?H.NUMBER:n?H.EDIT:H.DONE:i&&!e?H.DONE:i&&e?a:n&&e?H.EDIT:a});isNavigable=le(()=>{let e=this.isSelected();return this.completed||e||!this._stepper.linear});get hasError(){let e=this._customError();return e??this._getDefaultError()}set hasError(e){this._customError.set(e)}_customError=x(null);_getDefaultError(){return this.interacted&&!!this.stepControl?.invalid}constructor(){let e=c(li,{optional:!0});this._stepperOptions=e||{},this._displayDefaultIndicatorType=this._stepperOptions.displayDefaultIndicatorType!==!1}select(){this._stepper.selected=this}reset(){this._interacted.set(!1),this._completedOverride()!=null&&this._completedOverride.set(!1),this._customError()!=null&&this._customError.set(!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this._interacted()||(this._interacted.set(!0),this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??this._customError()!=null}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["cdk-step"]],contentQueries:function(i,a,n){if(i&1&&(w(n,Te,5),w(n,St,5)),i&2){let d;b(d=y())&&(a.stepLabel=d.first),b(d=y())&&(a._childForms=d)}},viewQuery:function(i,a){if(i&1&&ne(V,7),i&2){let n;b(n=y())&&(a.content=n.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",Y],optional:[2,"optional","optional",Y],completed:[2,"completed","completed",Y],hasError:[2,"hasError","hasError",Y]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],features:[Le],ngContentSelectors:oi,decls:1,vars:0,template:function(i,a){i&1&&(ie(),Be(0,si,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}return t})(),J=(()=>{class t{_dir=c(lt,{optional:!0});_changeDetectorRef=c(Z);_elementRef=c(ee);_destroyed=new oe;_keyManager;_steps;steps=new te;_stepHeader;_sortedHeaders=new te;linear=!1;get selectedIndex(){return this._selectedIndex()}set selectedIndex(e){this._steps?(this._isValidIndex(e),this.selectedIndex!==e&&(this.selected?._markAsInteracted(),!this._anyControlsInvalidOrPending(e)&&(e>=this.selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e))):this._selectedIndex.set(e)}_selectedIndex=x(0);get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}selectionChange=new N;selectedIndexChange=new N;_groupId=c(rt).getId("cdk-stepper-");get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation(e==="vertical")}_orientation="horizontal";constructor(){}ngAfterContentInit(){this._steps.changes.pipe(O(this._steps),T(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(i=>i._stepper===this)),this.steps.forEach((i,a)=>i.index.set(a)),this.steps.notifyOnChanges()})}ngAfterViewInit(){if(this._stepHeader.changes.pipe(O(this._stepHeader),T(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((i,a)=>i._elementRef.nativeElement.compareDocumentPosition(a._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new st(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),this._keyManager.updateActiveItem(this.selectedIndex),(this._dir?this._dir.change:Pe()).pipe(O(this._layoutDirection()),T(this._destroyed)).subscribe(e=>this._keyManager?.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this.selectedIndex),this.steps.changes.subscribe(()=>{this.selected||this._selectedIndex.set(Math.max(this.selectedIndex-1,0))}),this._isValidIndex(this.selectedIndex)||this._selectedIndex.set(0),this.linear&&this.selectedIndex>0){let e=this.steps.toArray().slice(0,this._selectedIndex());for(let i of e)i._markAsInteracted()}}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex()+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex()-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`${this._groupId}-label-${e}`}_getStepContentId(e){return`${this._groupId}-content-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){let i=e-this._selectedIndex();return i<0?this._layoutDirection()==="rtl"?"next":"previous":i>0?this._layoutDirection()==="rtl"?"previous":"next":"current"}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex()}_updateSelectedItemIndex(e){let i=this.steps.toArray(),a=this._selectedIndex();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:a,selectedStep:i[e],previouslySelectedStep:i[a]}),this._keyManager&&(this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e)),this._selectedIndex.set(e),this.selectedIndexChange.emit(e),this._stateChanged()}_onKeydown(e){let i=ot(e),a=e.keyCode,n=this._keyManager;n?.activeItemIndex!=null&&!i&&(a===32||a===13)?(this.selectedIndex=n.activeItemIndex,e.preventDefault()):n?.setFocusOrigin("keyboard").onKeydown(e)}_anyControlsInvalidOrPending(e){return this.linear&&e>=0?this.steps.toArray().slice(0,e).some(i=>{let a=i.stepControl;return(a?a.invalid||a.pending||!i.interacted:!i.completed)&&!i.optional&&!i._completedOverride()}):!1}_layoutDirection(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_containsFocus(){let e=this._elementRef.nativeElement,i=et();return e===i||e.contains(i)}_isValidIndex(e){return e>-1&&(!this.steps||e<this.steps.length)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepper",""]],contentQueries:function(i,a,n){if(i&1&&(w(n,ce,5),w(n,Ie,5)),i&2){let d;b(d=y())&&(a._steps=d),b(d=y())&&(a._stepHeader=d)}},inputs:{linear:[2,"linear","linear",Y],selectedIndex:[2,"selectedIndex","selectedIndex",Ye],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"]})}return t})(),Kt=(()=>{class t{_stepper=c(J);type="submit";constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(i,a){i&1&&C("click",function(){return a._stepper.next()}),i&2&&q("type",a.type)},inputs:{type:"type"}})}return t})(),Ut=(()=>{class t{_stepper=c(J);type="button";constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(i,a){i&1&&C("click",function(){return a._stepper.previous()}),i&2&&q("type",a.type)},inputs:{type:"type"}})}return t})();var pi=(t,o,e)=>({index:t,active:o,optional:e});function di(t,o){if(t&1&&A(0,2),t&2){let e=h();u("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",Ge(2,pi,e.index,e.active,e.optional))}}function ci(t,o){if(t&1&&(r(0,"span",7),p(1),s()),t&2){let e=h(2);l(),k(e._getDefaultTextForState(e.state))}}function mi(t,o){if(t&1&&(r(0,"span",8),p(1),s()),t&2){let e=h(3);l(),k(e._intl.completedLabel)}}function ui(t,o){if(t&1&&(r(0,"span",8),p(1),s()),t&2){let e=h(3);l(),k(e._intl.editableLabel)}}function hi(t,o){if(t&1&&(D(0,mi,2,1,"span",8)(1,ui,2,1,"span",8),r(2,"mat-icon",7),p(3),s()),t&2){let e=h(2);M(e.state==="done"?0:e.state==="edit"?1:-1),l(3),k(e._getDefaultTextForState(e.state))}}function fi(t,o){if(t&1&&D(0,ci,2,1,"span",7)(1,hi,4,2),t&2){let e,i=h();M((e=i.state)==="number"?0:1)}}function _i(t,o){t&1&&(r(0,"div",4),A(1,9),s()),t&2&&(l(),u("ngTemplateOutlet",o.template))}function gi(t,o){if(t&1&&(r(0,"div",4),p(1),s()),t&2){let e=h();l(),k(e.label)}}function vi(t,o){if(t&1&&(r(0,"div",5),p(1),s()),t&2){let e=h();l(),k(e._intl.optionalLabel)}}function bi(t,o){if(t&1&&(r(0,"div",6),p(1),s()),t&2){let e=h();l(),k(e.errorMessage)}}var Yt=["*"];function yi(t,o){}function Si(t,o){if(t&1&&(ae(0),g(1,yi,0,0,"ng-template",0)),t&2){let e=h();l(),u("cdkPortalOutlet",e._portal)}}var Ci=["animatedContainer"],Jt=t=>({step:t});function xi(t,o){t&1&&ae(0)}function Di(t,o){t&1&&v(0,"div",7)}function Mi(t,o){if(t&1&&(A(0,6),D(1,Di,1,0,"div",7)),t&2){let e=o.$implicit,i=o.$index,a=o.$count;h(2);let n=W(4);u("ngTemplateOutlet",n)("ngTemplateOutletContext",he(3,Jt,e)),l(),M(i!==a-1?1:-1)}}function wi(t,o){if(t&1&&(r(0,"div",8,1),A(2,9),s()),t&2){let e=o.$implicit,i=o.$index,a=h(2);se("mat-horizontal-stepper-content-"+a._getAnimationDirection(i)),u("id",a._getStepContentId(i)),B("aria-labelledby",a._getStepLabelId(i))("inert",a.selectedIndex===i?null:""),l(2),u("ngTemplateOutlet",e.content)}}function Ei(t,o){if(t&1&&(r(0,"div",2)(1,"div",3),z(2,Mi,2,5,null,null,R),s(),r(4,"div",4),z(5,wi,3,6,"div",5,R),s()()),t&2){let e=h();l(2),F(e.steps),l(3),F(e.steps)}}function Ii(t,o){if(t&1&&(r(0,"div",10),A(1,6),r(2,"div",11,1)(4,"div",12)(5,"div",13),A(6,9),s()()()()),t&2){let e=o.$implicit,i=o.$index,a=o.$index,n=o.$count,d=h(2),m=W(4);l(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",he(10,Jt,e)),l(),L("mat-stepper-vertical-line",a!==n-1)("mat-vertical-content-container-active",d.selectedIndex===i),B("inert",d.selectedIndex===i?null:""),l(2),u("id",d._getStepContentId(i)),B("aria-labelledby",d._getStepLabelId(i)),l(2),u("ngTemplateOutlet",e.content)}}function Ti(t,o){if(t&1&&z(0,Ii,7,12,"div",10,R),t&2){let e=h();F(e.steps)}}function ki(t,o){if(t&1){let e=$();r(0,"mat-step-header",14),C("click",function(){let a=f(e).step;return _(a.select())})("keydown",function(a){f(e);let n=h();return _(n._onKeydown(a))}),s()}if(t&2){let e=o.step,i=h();L("mat-horizontal-stepper-header",i.orientation==="horizontal")("mat-vertical-stepper-header",i.orientation==="vertical"),u("tabIndex",i._getFocusIndex()===e.index()?0:-1)("id",i._getStepLabelId(e.index()))("index",e.index())("state",e.indicatorType())("label",e.stepLabel||e.label)("selected",e.isSelected())("active",e.isNavigable())("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",i._iconOverrides)("disableRipple",i.disableRipple||!e.isNavigable())("color",e.color||i.color),B("aria-posinset",e.index()+1)("aria-setsize",i.steps.length)("aria-controls",i._getStepContentId(e.index()))("aria-selected",e.isSelected())("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",e.isNavigable()?null:!0)}}var re=(()=>{class t extends Te{static \u0275fac=(()=>{let e;return function(a){return(e||(e=X(t)))(a||t)}})();static \u0275dir=S({type:t,selectors:[["","matStepLabel",""]],features:[P]})}return t})(),Oi=(()=>{class t{changes=new oe;optionalLabel="Optional";completedLabel="Completed";editableLabel="Editable";static \u0275fac=function(i){return new(i||t)};static \u0275prov=Fe({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Zt=(()=>{class t extends Ie{_intl=c(Oi);_focusMonitor=c(it);_intlSubscription;state;label;errorMessage;iconOverrides;index;selected;active;optional;disableRipple;color;constructor(){super();let e=c(at);e.load(mt),e.load(nt);let i=c(Z);this._intlSubscription=this._intl.changes.subscribe(()=>i.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,i){e?this._focusMonitor.focusVia(this._elementRef,e,i):this._elementRef.nativeElement.focus(i)}_stringLabel(){return this.label instanceof re?null:this.label}_templateLabel(){return this.label instanceof re?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getDefaultTextForState(e){return e=="number"?`${this.index+1}`:e=="edit"?"create":e=="error"?"warning":e}_hasEmptyLabel(){return!this._stringLabel()&&!this._templateLabel()&&!this._hasOptionalLabel()&&!this._hasErrorLabel()}_hasOptionalLabel(){return this.optional&&this.state!=="error"}_hasErrorLabel(){return this.state==="error"}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:4,hostBindings:function(i,a){i&2&&(se("mat-"+(a.color||"primary")),L("mat-step-header-empty-label",a._hasEmptyLabel()))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},features:[P],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(i,a){if(i&1&&(v(0,"div",0),r(1,"div")(2,"div",1),D(3,di,1,6,"ng-container",2)(4,fi,2,1),s()(),r(5,"div",3),D(6,_i,2,1,"div",4)(7,gi,2,1,"div",4),D(8,vi,2,1,"div",5),D(9,bi,2,1,"div",6),s()),i&2){let n;u("matRippleTrigger",a._getHostElement())("matRippleDisabled",a.disableRipple),l(),se(qe("mat-step-icon-state-",a.state," mat-step-icon")),L("mat-step-icon-selected",a.selected),l(2),M(a.iconOverrides&&a.iconOverrides[a.state]?3:4),l(2),L("mat-step-label-active",a.active)("mat-step-label-selected",a.selected)("mat-step-label-error",a.state=="error"),l(),M((n=a._templateLabel())?6:a._stringLabel()?7:-1,n),l(2),M(a._hasOptionalLabel()?8:-1),l(),M(a._hasErrorLabel()?9:-1)}},dependencies:[ct,_e,pt],styles:[`.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-sys-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-sys-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}@media(forced-colors: active){.mat-step-header{outline:solid 1px}.mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-header[aria-disabled=true]{outline-color:GrayText}.mat-step-header[aria-disabled=true] .mat-step-label,.mat-step-header[aria-disabled=true] .mat-step-icon,.mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-sys-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-sys-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color, transparent);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-sys-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-sys-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-sys-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-sys-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-sys-title-small-weight))}.mat-step-header-empty-label .mat-step-label{min-width:0}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-done-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-sys-on-primary))}
|
|
1
|
+
import{a as zt,b as Ft,c as At,d as Lt,e as Ht,f as Vt,g as Nt,h as Bt,i as Qt,j as jt,k as $t,m as qt,n as pe,p as de,q as Wt}from"./chunk-HCXH72CD.js";import"./chunk-KTDDP73O.js";import{c as Ot,d as Pt}from"./chunk-CBUY7NMR.js";import{a as kt}from"./chunk-JY3WVS7C.js";import{a as Rt}from"./chunk-VHFBF47T.js";import{f as It,n as Tt}from"./chunk-ZBCOJLI4.js";import{m as pt}from"./chunk-TXPLRBW5.js";import{d as ft,e as _t,g as gt,i as vt,j as bt}from"./chunk-3LEMFOCV.js";import{a as we}from"./chunk-2YVW3TBK.js";import{A as be,D as xt,E as ye,F as Dt,L as Mt,M as wt,N as Et,Q as Se,T as Ce,_ as xe,aa as De,ca as Me,k as Je,p as Xe,r as yt,u as St,w as Ct,x as ve}from"./chunk-TA4GACKT.js";import{$b as v,$d as it,A as Re,Aa as _,Ab as P,Ac as k,Bc as I,Be as ct,Cb as g,Ce as mt,Db as Be,Ec as G,Fb as N,Fc as K,Fe as ge,Gb as Qe,Gc as U,Ja as x,Ke as ut,Lc as qe,Mc as ue,Na as Le,Nc as We,Oa as X,Oc as he,Oe as ht,Pc as Ge,Qa as ee,Qc as Ke,Ra as te,Rb as B,Sb as D,Sc as Ue,Tb as M,Uc as Ze,Ud as et,Vb as R,Wb as z,Wd as tt,Xb as F,Xc as le,Yb as u,Zb as r,_b as s,bd as fe,be as at,ce as nt,dc as Q,ec as j,ed as Z,fa as O,fc as A,g as Oe,ga as ze,gc as $,ha as T,hc as q,ic as C,id as Y,jd as Ye,kc as h,lb as l,lc as ie,le as rt,m as oe,mc as ae,me as ot,nb as V,nc as w,oa as Fe,oc as ne,oe as st,pb as He,pc as b,qc as y,ra as Ae,sb as Ve,sc as me,se as lt,t as Pe,ta as c,tc as je,uc as W,vc as $e,wb as E,wc as L,we as dt,yb as S,yc as se,yd as _e,za as f,zb as Ne,zc as p}from"./chunk-35L7BBBD.js";var Gt=(()=>{class t{transform(e,i){return!e||!e.length?[]:i?e.filter(a=>a.includes("self")):e}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=Ne({name:"filterSelf",type:t,pure:!0})}return t})();var oi=["*"];function si(t,o){t&1&&ae(0)}var Ie=(()=>{class t{_elementRef=c(ee);constructor(){}focus(){this._elementRef.nativeElement.focus()}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"]})}return t})(),Te=(()=>{class t{template=c(V);constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepLabel",""]]})}return t})();var H={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},li=new Ae("STEPPER_GLOBAL_OPTIONS"),ce=(()=>{class t{_stepperOptions;_stepper=c(J);_displayDefaultIndicatorType;stepLabel;_childForms;content;stepControl;get interacted(){return this._interacted()}set interacted(e){this._interacted.set(e)}_interacted=x(!1);interactedStream=new N;label;errorMessage;ariaLabel;ariaLabelledby;get state(){return this._state()}set state(e){this._state.set(e)}_state=x(void 0);get editable(){return this._editable()}set editable(e){this._editable.set(e)}_editable=x(!0);optional=!1;get completed(){let e=this._completedOverride(),i=this._interacted();return e??(i&&(!this.stepControl||this.stepControl.valid))}set completed(e){this._completedOverride.set(e)}_completedOverride=x(null);index=x(-1);isSelected=le(()=>this._stepper.selectedIndex===this.index());indicatorType=le(()=>{let e=this.isSelected(),i=this.completed,a=this._state()??H.NUMBER,n=this._editable();return this._showError()&&this.hasError&&!e?H.ERROR:this._displayDefaultIndicatorType?!i||e?H.NUMBER:n?H.EDIT:H.DONE:i&&!e?H.DONE:i&&e?a:n&&e?H.EDIT:a});isNavigable=le(()=>{let e=this.isSelected();return this.completed||e||!this._stepper.linear});get hasError(){let e=this._customError();return e??this._getDefaultError()}set hasError(e){this._customError.set(e)}_customError=x(null);_getDefaultError(){return this.interacted&&!!this.stepControl?.invalid}constructor(){let e=c(li,{optional:!0});this._stepperOptions=e||{},this._displayDefaultIndicatorType=this._stepperOptions.displayDefaultIndicatorType!==!1}select(){this._stepper.selected=this}reset(){this._interacted.set(!1),this._completedOverride()!=null&&this._completedOverride.set(!1),this._customError()!=null&&this._customError.set(!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this._interacted()||(this._interacted.set(!0),this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??this._customError()!=null}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["cdk-step"]],contentQueries:function(i,a,n){if(i&1&&(w(n,Te,5),w(n,St,5)),i&2){let d;b(d=y())&&(a.stepLabel=d.first),b(d=y())&&(a._childForms=d)}},viewQuery:function(i,a){if(i&1&&ne(V,7),i&2){let n;b(n=y())&&(a.content=n.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",Y],optional:[2,"optional","optional",Y],completed:[2,"completed","completed",Y],hasError:[2,"hasError","hasError",Y]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],features:[Le],ngContentSelectors:oi,decls:1,vars:0,template:function(i,a){i&1&&(ie(),Be(0,si,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}return t})(),J=(()=>{class t{_dir=c(lt,{optional:!0});_changeDetectorRef=c(Z);_elementRef=c(ee);_destroyed=new oe;_keyManager;_steps;steps=new te;_stepHeader;_sortedHeaders=new te;linear=!1;get selectedIndex(){return this._selectedIndex()}set selectedIndex(e){this._steps?(this._isValidIndex(e),this.selectedIndex!==e&&(this.selected?._markAsInteracted(),!this._anyControlsInvalidOrPending(e)&&(e>=this.selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e))):this._selectedIndex.set(e)}_selectedIndex=x(0);get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}selectionChange=new N;selectedIndexChange=new N;_groupId=c(rt).getId("cdk-stepper-");get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation(e==="vertical")}_orientation="horizontal";constructor(){}ngAfterContentInit(){this._steps.changes.pipe(O(this._steps),T(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(i=>i._stepper===this)),this.steps.forEach((i,a)=>i.index.set(a)),this.steps.notifyOnChanges()})}ngAfterViewInit(){if(this._stepHeader.changes.pipe(O(this._stepHeader),T(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((i,a)=>i._elementRef.nativeElement.compareDocumentPosition(a._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new st(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),this._keyManager.updateActiveItem(this.selectedIndex),(this._dir?this._dir.change:Pe()).pipe(O(this._layoutDirection()),T(this._destroyed)).subscribe(e=>this._keyManager?.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this.selectedIndex),this.steps.changes.subscribe(()=>{this.selected||this._selectedIndex.set(Math.max(this.selectedIndex-1,0))}),this._isValidIndex(this.selectedIndex)||this._selectedIndex.set(0),this.linear&&this.selectedIndex>0){let e=this.steps.toArray().slice(0,this._selectedIndex());for(let i of e)i._markAsInteracted()}}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex()+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex()-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`${this._groupId}-label-${e}`}_getStepContentId(e){return`${this._groupId}-content-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){let i=e-this._selectedIndex();return i<0?this._layoutDirection()==="rtl"?"next":"previous":i>0?this._layoutDirection()==="rtl"?"previous":"next":"current"}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex()}_updateSelectedItemIndex(e){let i=this.steps.toArray(),a=this._selectedIndex();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:a,selectedStep:i[e],previouslySelectedStep:i[a]}),this._keyManager&&(this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e)),this._selectedIndex.set(e),this.selectedIndexChange.emit(e),this._stateChanged()}_onKeydown(e){let i=ot(e),a=e.keyCode,n=this._keyManager;n?.activeItemIndex!=null&&!i&&(a===32||a===13)?(this.selectedIndex=n.activeItemIndex,e.preventDefault()):n?.setFocusOrigin("keyboard").onKeydown(e)}_anyControlsInvalidOrPending(e){return this.linear&&e>=0?this.steps.toArray().slice(0,e).some(i=>{let a=i.stepControl;return(a?a.invalid||a.pending||!i.interacted:!i.completed)&&!i.optional&&!i._completedOverride()}):!1}_layoutDirection(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_containsFocus(){let e=this._elementRef.nativeElement,i=et();return e===i||e.contains(i)}_isValidIndex(e){return e>-1&&(!this.steps||e<this.steps.length)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["","cdkStepper",""]],contentQueries:function(i,a,n){if(i&1&&(w(n,ce,5),w(n,Ie,5)),i&2){let d;b(d=y())&&(a._steps=d),b(d=y())&&(a._stepHeader=d)}},inputs:{linear:[2,"linear","linear",Y],selectedIndex:[2,"selectedIndex","selectedIndex",Ye],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"]})}return t})(),Kt=(()=>{class t{_stepper=c(J);type="submit";constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(i,a){i&1&&C("click",function(){return a._stepper.next()}),i&2&&q("type",a.type)},inputs:{type:"type"}})}return t})(),Ut=(()=>{class t{_stepper=c(J);type="button";constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(i,a){i&1&&C("click",function(){return a._stepper.previous()}),i&2&&q("type",a.type)},inputs:{type:"type"}})}return t})();var pi=(t,o,e)=>({index:t,active:o,optional:e});function di(t,o){if(t&1&&A(0,2),t&2){let e=h();u("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",Ge(2,pi,e.index,e.active,e.optional))}}function ci(t,o){if(t&1&&(r(0,"span",7),p(1),s()),t&2){let e=h(2);l(),k(e._getDefaultTextForState(e.state))}}function mi(t,o){if(t&1&&(r(0,"span",8),p(1),s()),t&2){let e=h(3);l(),k(e._intl.completedLabel)}}function ui(t,o){if(t&1&&(r(0,"span",8),p(1),s()),t&2){let e=h(3);l(),k(e._intl.editableLabel)}}function hi(t,o){if(t&1&&(D(0,mi,2,1,"span",8)(1,ui,2,1,"span",8),r(2,"mat-icon",7),p(3),s()),t&2){let e=h(2);M(e.state==="done"?0:e.state==="edit"?1:-1),l(3),k(e._getDefaultTextForState(e.state))}}function fi(t,o){if(t&1&&D(0,ci,2,1,"span",7)(1,hi,4,2),t&2){let e,i=h();M((e=i.state)==="number"?0:1)}}function _i(t,o){t&1&&(r(0,"div",4),A(1,9),s()),t&2&&(l(),u("ngTemplateOutlet",o.template))}function gi(t,o){if(t&1&&(r(0,"div",4),p(1),s()),t&2){let e=h();l(),k(e.label)}}function vi(t,o){if(t&1&&(r(0,"div",5),p(1),s()),t&2){let e=h();l(),k(e._intl.optionalLabel)}}function bi(t,o){if(t&1&&(r(0,"div",6),p(1),s()),t&2){let e=h();l(),k(e.errorMessage)}}var Yt=["*"];function yi(t,o){}function Si(t,o){if(t&1&&(ae(0),g(1,yi,0,0,"ng-template",0)),t&2){let e=h();l(),u("cdkPortalOutlet",e._portal)}}var Ci=["animatedContainer"],Jt=t=>({step:t});function xi(t,o){t&1&&ae(0)}function Di(t,o){t&1&&v(0,"div",7)}function Mi(t,o){if(t&1&&(A(0,6),D(1,Di,1,0,"div",7)),t&2){let e=o.$implicit,i=o.$index,a=o.$count;h(2);let n=W(4);u("ngTemplateOutlet",n)("ngTemplateOutletContext",he(3,Jt,e)),l(),M(i!==a-1?1:-1)}}function wi(t,o){if(t&1&&(r(0,"div",8,1),A(2,9),s()),t&2){let e=o.$implicit,i=o.$index,a=h(2);se("mat-horizontal-stepper-content-"+a._getAnimationDirection(i)),u("id",a._getStepContentId(i)),B("aria-labelledby",a._getStepLabelId(i))("inert",a.selectedIndex===i?null:""),l(2),u("ngTemplateOutlet",e.content)}}function Ei(t,o){if(t&1&&(r(0,"div",2)(1,"div",3),z(2,Mi,2,5,null,null,R),s(),r(4,"div",4),z(5,wi,3,6,"div",5,R),s()()),t&2){let e=h();l(2),F(e.steps),l(3),F(e.steps)}}function Ii(t,o){if(t&1&&(r(0,"div",10),A(1,6),r(2,"div",11,1)(4,"div",12)(5,"div",13),A(6,9),s()()()()),t&2){let e=o.$implicit,i=o.$index,a=o.$index,n=o.$count,d=h(2),m=W(4);l(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",he(10,Jt,e)),l(),L("mat-stepper-vertical-line",a!==n-1)("mat-vertical-content-container-active",d.selectedIndex===i),B("inert",d.selectedIndex===i?null:""),l(2),u("id",d._getStepContentId(i)),B("aria-labelledby",d._getStepLabelId(i)),l(2),u("ngTemplateOutlet",e.content)}}function Ti(t,o){if(t&1&&z(0,Ii,7,12,"div",10,R),t&2){let e=h();F(e.steps)}}function ki(t,o){if(t&1){let e=$();r(0,"mat-step-header",14),C("click",function(){let a=f(e).step;return _(a.select())})("keydown",function(a){f(e);let n=h();return _(n._onKeydown(a))}),s()}if(t&2){let e=o.step,i=h();L("mat-horizontal-stepper-header",i.orientation==="horizontal")("mat-vertical-stepper-header",i.orientation==="vertical"),u("tabIndex",i._getFocusIndex()===e.index()?0:-1)("id",i._getStepLabelId(e.index()))("index",e.index())("state",e.indicatorType())("label",e.stepLabel||e.label)("selected",e.isSelected())("active",e.isNavigable())("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",i._iconOverrides)("disableRipple",i.disableRipple||!e.isNavigable())("color",e.color||i.color),B("aria-posinset",e.index()+1)("aria-setsize",i.steps.length)("aria-controls",i._getStepContentId(e.index()))("aria-selected",e.isSelected())("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",e.isNavigable()?null:!0)}}var re=(()=>{class t extends Te{static \u0275fac=(()=>{let e;return function(a){return(e||(e=X(t)))(a||t)}})();static \u0275dir=S({type:t,selectors:[["","matStepLabel",""]],features:[P]})}return t})(),Oi=(()=>{class t{changes=new oe;optionalLabel="Optional";completedLabel="Completed";editableLabel="Editable";static \u0275fac=function(i){return new(i||t)};static \u0275prov=Fe({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Zt=(()=>{class t extends Ie{_intl=c(Oi);_focusMonitor=c(it);_intlSubscription;state;label;errorMessage;iconOverrides;index;selected;active;optional;disableRipple;color;constructor(){super();let e=c(at);e.load(mt),e.load(nt);let i=c(Z);this._intlSubscription=this._intl.changes.subscribe(()=>i.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,i){e?this._focusMonitor.focusVia(this._elementRef,e,i):this._elementRef.nativeElement.focus(i)}_stringLabel(){return this.label instanceof re?null:this.label}_templateLabel(){return this.label instanceof re?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getDefaultTextForState(e){return e=="number"?`${this.index+1}`:e=="edit"?"create":e=="error"?"warning":e}_hasEmptyLabel(){return!this._stringLabel()&&!this._templateLabel()&&!this._hasOptionalLabel()&&!this._hasErrorLabel()}_hasOptionalLabel(){return this.optional&&this.state!=="error"}_hasErrorLabel(){return this.state==="error"}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:4,hostBindings:function(i,a){i&2&&(se("mat-"+(a.color||"primary")),L("mat-step-header-empty-label",a._hasEmptyLabel()))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},features:[P],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(i,a){if(i&1&&(v(0,"div",0),r(1,"div")(2,"div",1),D(3,di,1,6,"ng-container",2)(4,fi,2,1),s()(),r(5,"div",3),D(6,_i,2,1,"div",4)(7,gi,2,1,"div",4),D(8,vi,2,1,"div",5),D(9,bi,2,1,"div",6),s()),i&2){let n;u("matRippleTrigger",a._getHostElement())("matRippleDisabled",a.disableRipple),l(),se(qe("mat-step-icon-state-",a.state," mat-step-icon")),L("mat-step-icon-selected",a.selected),l(2),M(a.iconOverrides&&a.iconOverrides[a.state]?3:4),l(2),L("mat-step-label-active",a.active)("mat-step-label-selected",a.selected)("mat-step-label-error",a.state=="error"),l(),M((n=a._templateLabel())?6:a._stringLabel()?7:-1,n),l(2),M(a._hasOptionalLabel()?8:-1),l(),M(a._hasErrorLabel()?9:-1)}},dependencies:[ct,_e,pt],styles:[`.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-sys-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-sys-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}@media(forced-colors: active){.mat-step-header{outline:solid 1px}.mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-header[aria-disabled=true]{outline-color:GrayText}.mat-step-header[aria-disabled=true] .mat-step-label,.mat-step-header[aria-disabled=true] .mat-step-icon,.mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-sys-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-sys-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color, transparent);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-sys-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-sys-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-sys-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-sys-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-sys-title-small-weight))}.mat-step-header-empty-label .mat-step-label{min-width:0}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-done-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-sys-on-primary))}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return t})(),Pi=(()=>{class t{templateRef=c(V);name;constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]}})}return t})(),Ri=(()=>{class t{_template=c(V);constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275dir=S({type:t,selectors:[["ng-template","matStepContent",""]]})}return t})(),ke=(()=>{class t extends ce{_errorStateMatcher=c(De,{skipSelf:!0});_viewContainerRef=c(Ve);_isSelected=Oe.EMPTY;stepLabel=void 0;color;_lazyContent;_portal;ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe(ze(()=>this._stepper.selectionChange.pipe(Re(e=>e.selectedStep===this),O(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new ut(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,i){let a=this._errorStateMatcher.isErrorState(e,i),n=!!(e&&e.invalid&&this.interacted);return a||n}static \u0275fac=(()=>{let e;return function(a){return(e||(e=X(t)))(a||t)}})();static \u0275cmp=E({type:t,selectors:[["mat-step"]],contentQueries:function(i,a,n){if(i&1&&(w(n,re,5),w(n,Ri,5)),i&2){let d;b(d=y())&&(a.stepLabel=d.first),b(d=y())&&(a._lazyContent=d.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],features:[ue([{provide:De,useExisting:t},{provide:ce,useExisting:t}]),P],ngContentSelectors:Yt,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(i,a){i&1&&(ie(),g(0,Si,2,1,"ng-template"))},dependencies:[ht],encapsulation:2,changeDetection:0})}return t})(),Xt=(()=>{class t extends J{_ngZone=c(Qe);_renderer=c(He);_animationsDisabled=dt();_cleanupTransition;_isAnimating=x(!1);_stepHeader=void 0;_animatedContainers;_steps=void 0;steps=new te;_icons;animationDone=new N;disableRipple;color;labelPosition="end";headerPosition="top";_iconOverrides={};get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}_animationDuration="";_isServer=!c(tt).isBrowser;constructor(){super();let i=c(ee).nativeElement.nodeName.toLowerCase();this.orientation=i==="mat-vertical-stepper"?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:i})=>this._iconOverrides[e]=i),this.steps.changes.pipe(T(this._destroyed)).subscribe(()=>this._stateChanged()),this.selectedIndexChange.pipe(T(this._destroyed)).subscribe(()=>{let e=this._getAnimationDuration();e==="0ms"||e==="0s"?this._onAnimationDone():this._isAnimating.set(!0)}),this._ngZone.runOutsideAngular(()=>{this._animationsDisabled||setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-stepper-animations-enabled"),this._cleanupTransition=this._renderer.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionend)},200)})}ngAfterViewInit(){if(super.ngAfterViewInit(),typeof queueMicrotask=="function"){let e=!1;this._animatedContainers.changes.pipe(O(null),T(this._destroyed)).subscribe(()=>queueMicrotask(()=>{e||(e=!0,this.animationDone.emit()),this._stateChanged()}))}}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransition?.()}_getAnimationDuration(){return this._animationsDisabled?"0ms":this.animationDuration?this.animationDuration:this.orientation==="horizontal"?"500ms":"225ms"}_handleTransitionend=e=>{let i=e.target;if(!i)return;let a=this.orientation==="horizontal"&&e.propertyName==="transform"&&i.classList.contains("mat-horizontal-stepper-content-current"),n=this.orientation==="vertical"&&e.propertyName==="grid-template-rows"&&i.classList.contains("mat-vertical-content-container-active");(a||n)&&this._animatedContainers.find(m=>m.nativeElement===i)&&this._onAnimationDone()};_onAnimationDone(){this._isAnimating.set(!1),this.animationDone.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(i,a,n){if(i&1&&(w(n,ke,5),w(n,Pi,5)),i&2){let d;b(d=y())&&(a._steps=d),b(d=y())&&(a._icons=d)}},viewQuery:function(i,a){if(i&1&&(ne(Zt,5),ne(Ci,5)),i&2){let n;b(n=y())&&(a._stepHeader=n),b(n=y())&&(a._animatedContainers=n)}},hostAttrs:["role","tablist"],hostVars:15,hostBindings:function(i,a){i&2&&(B("aria-orientation",a.orientation),$e("--mat-stepper-animation-duration",a._getAnimationDuration()),L("mat-stepper-horizontal",a.orientation==="horizontal")("mat-stepper-vertical",a.orientation==="vertical")("mat-stepper-label-position-end",a.orientation==="horizontal"&&a.labelPosition=="end")("mat-stepper-label-position-bottom",a.orientation==="horizontal"&&a.labelPosition=="bottom")("mat-stepper-header-position-bottom",a.headerPosition==="bottom")("mat-stepper-animating",a._isAnimating()))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],features:[ue([{provide:J,useExisting:t}]),P],ngContentSelectors:Yt,decls:5,vars:2,consts:[["stepTemplate",""],["animatedContainer",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","class"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"]],template:function(i,a){if(i&1&&(ie(),D(0,xi,1,0),D(1,Ei,7,0,"div",2)(2,Ti,2,0),g(3,ki,1,23,"ng-template",null,0,Ze)),i&2){let n;M(a._isServer?0:-1),l(),M((n=a.orientation)==="horizontal"?1:n==="vertical"?2:-1)}},dependencies:[_e,Zt],styles:[`.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-sys-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-sys-surface))}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height, 72px)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header.mat-step-header-empty-label .mat-step-icon{margin:0}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{visibility:hidden;overflow:hidden;outline:0;height:0}.mat-stepper-animations-enabled .mat-horizontal-stepper-content{transition:transform var(--mat-stepper-animation-duration, 0) cubic-bezier(0.35, 0, 0.25, 1)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-previous{transform:translate3d(-100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-next{transform:translate3d(100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{visibility:visible;transform:none;height:auto}.mat-stepper-horizontal:not(.mat-stepper-animating) .mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{overflow:visible}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}@media(forced-colors: active){.mat-horizontal-content-container{outline:solid 1px}}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{display:grid;grid-template-rows:0fr;grid-template-columns:100%;margin-left:36px;border:0;position:relative}.mat-stepper-animations-enabled .mat-vertical-content-container{transition:grid-template-rows var(--mat-stepper-animation-duration, 0) cubic-bezier(0.4, 0, 0.2, 1)}.mat-vertical-content-container.mat-vertical-content-container-active{grid-template-rows:1fr}.mat-step:last-child .mat-vertical-content-container{border:none}@media(forced-colors: active){.mat-vertical-content-container{outline:solid 1px}}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}@supports not (grid-template-rows: 0fr){.mat-vertical-content-container{height:0}.mat-vertical-content-container.mat-vertical-content-container-active{height:auto}}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-sys-outline));top:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0;visibility:hidden}.mat-stepper-animations-enabled .mat-vertical-stepper-content{transition:visibility var(--mat-stepper-animation-duration, 0) linear}.mat-vertical-content-container-active>.mat-vertical-stepper-content{visibility:visible}.mat-vertical-content{padding:0 24px 24px 24px}
|
|
3
3
|
`],encapsulation:2,changeDetection:0})}return t})(),ei=(()=>{class t extends Kt{static \u0275fac=(()=>{let e;return function(a){return(e||(e=X(t)))(a||t)}})();static \u0275dir=S({type:t,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(i,a){i&2&&q("type",a.type)},features:[P]})}return t})(),ti=(()=>{class t extends Ut{static \u0275fac=(()=>{let e;return function(a){return(e||(e=X(t)))(a||t)}})();static \u0275dir=S({type:t,selectors:[["button","matStepperPrevious",""]],hostAttrs:[1,"mat-stepper-previous"],hostVars:1,hostBindings:function(i,a){i&2&&q("type",a.type)},features:[P]})}return t})();var zi=()=>[5,10,25,100];function Fi(t,o){t&1&&(r(0,"mat-header-cell",30),p(1," Path "),s())}function Ai(t,o){if(t&1&&(r(0,"mat-cell",31),p(1),s()),t&2){let e=o.$implicit;l(),I(" ",e.path," ")}}function Li(t,o){t&1&&(r(0,"mat-header-cell",32),p(1," Source "),s())}function Hi(t,o){if(t&1&&(r(0,"mat-cell",33),p(1),s()),t&2){let e=o.$implicit;l(),I(" ",e.pathSource," ")}}function Vi(t,o){t&1&&(r(0,"mat-header-cell",32),p(1," Time Scale "),s())}function Ni(t,o){if(t&1&&(r(0,"mat-cell",34),p(1),s()),t&2){let e=o.$implicit;l(),I(" ",e.timeScaleFormat," ")}}function Bi(t,o){t&1&&(r(0,"mat-header-cell",32),p(1," Duration "),s())}function Qi(t,o){if(t&1&&(r(0,"mat-cell",34),p(1),s()),t&2){let e=o.$implicit;l(),I(" ",e.period," ")}}function ji(t,o){t&1&&v(0,"mat-header-cell",35)}function $i(t,o){if(t&1){let e=$();r(0,"mat-cell",36)(1,"button",37),C("click",function(){let a=f(e).$implicit,n=h();return _(n.openDatasetModal(a.uuid))}),p(2,"Edit"),s(),r(3,"button",37),C("click",function(){let a=f(e).$implicit,n=h();return _(n.deleteDataset(a.uuid))}),p(4,"Delete"),s()()}}function qi(t,o){t&1&&v(0,"mat-header-row",38)}function Wi(t,o){t&1&&v(0,"mat-row",39)}function Gi(t,o){if(t&1&&(r(0,"mat-row"),p(1),s()),t&2){h();let e=W(10);l(),I(' No data matching the filter "',e.value,'" ')}}function Ki(t,o){t&1&&p(0,"Source Data")}function Ui(t,o){if(t&1&&(r(0,"mat-option",7),p(1),s()),t&2){let e=o.$implicit;u("value",e),l(),I(" ",e," ")}}function Zi(t,o){if(t&1&&(r(0,"mat-option",7),p(1),s()),t&2){let e=o.$implicit;u("value",e),l(),I(" ",e," ")}}function Yi(t,o){t&1&&p(0,"Sampling")}var ai="[_nghost-%COMP%]{display:block;height:100%;width:100%}.content-area[_ngcontent-%COMP%]{height:calc(100% - 63px);overflow-y:auto;width:100%;scroll-behavior:smooth}.filter[_ngcontent-%COMP%]{margin-bottom:10px}.buttons[_ngcontent-%COMP%]{margin-top:10px}.mat-column-actions[_ngcontent-%COMP%]{text-align:end}.buttons[_ngcontent-%COMP%]{margin-right:5px}.pathCell[_ngcontent-%COMP%], .pathHeader[_ngcontent-%COMP%]{flex:1 1 50%}.dataHeader[_ngcontent-%COMP%], .dataCell[_ngcontent-%COMP%]{flex:1 1 10%;justify-content:center}.actionHeader[_ngcontent-%COMP%]{flex:1 1 20%}.actionCell[_ngcontent-%COMP%]{flex:1 1 20%;justify-content:end}@media screen and (max-width: 750px){.pathHeader[_ngcontent-%COMP%], .dataHeader[_ngcontent-%COMP%]{flex:1 1 30%}.actionHeader[_ngcontent-%COMP%]{display:none}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:attr(data-label);float:left;padding-right:5px}mat-row[_ngcontent-%COMP%]:after{min-height:auto;padding-bottom:10px}.dataRow[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.dataCell[_ngcontent-%COMP%], .actionCell[_ngcontent-%COMP%]{margin-left:24px}}",Sn=(()=>{class t{paginator=fe(pe);sort=fe(de);pageTitle="Datasets";selectedDataset;tableData=new qt([]);displayedColumns=["path","pathSource","timeScaleFormat","period","actions"];dialog=c(gt);cdRef=c(Z);dsService=c(Pt);ngOnInit(){this.loadDatasets()}loadDatasets(){this.tableData.data=this.dsService.list().filter(e=>e.editable!==!1)}ngAfterViewInit(){this.tableData.paginator=this.paginator(),this.tableData.sort=this.sort(),this.tableData.filter="",this.cdRef.detectChanges()}openDatasetModal(e){let i;if(e){let a=Je(this.tableData.data.find(n=>n.uuid===e));a&&(i=this.dialog.open(ii,{data:a,disableClose:!1}))}else i=this.dialog.open(ii,{disableClose:!1});i.afterClosed().subscribe(a=>{a===void 0||!a||(a.label=`${a.path}, Source: ${a.pathSource}, Scale: ${a.timeScaleFormat}, Period: ${a.period} `,a.uuid?this.editDataset(a):this.addDataset(a),this.loadDatasets())})}addDataset(e){this.dsService.create(e.path,e.pathSource,e.timeScaleFormat,e.period,e.label,!0,!0),this.loadDatasets()}editDataset(e){this.dsService.edit(e),this.loadDatasets()}deleteDataset(e){this.dsService.remove(e),this.loadDatasets()}trackByUuid(e,i){return`${i.uuid}`}applyFilter(e){let i=e.target.value;this.tableData.filter=i.trim().toLowerCase(),this.tableData.paginator&&this.tableData.paginator.firstPage()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["settings-datasets"]],viewQuery:function(i,a){i&1&&(me(a.paginator,pe,5),me(a.sort,de,5)),i&2&&je(2)},decls:37,vars:8,consts:[["existingDataSet","ngForm"],["input",""],[3,"pageTitle"],[1,"content-area"],["name","existingDataSet",1,"page-content-wrapper","content-area"],[1,"mat-card-subtitle","description-text"],[1,"filter"],["matInput","","placeholder","Ex: navigation","value","",3,"keyup"],[1,"mat-elevation-z8","full-width","table-container"],["matSort","","matSortActive","path","matSortDirection","asc",1,"full-display",3,"dataSource","trackBy"],["matColumnDef","path"],["class","pathHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","pathCell","data-label","Path: ",4,"matCellDef"],["matColumnDef","pathSource"],["class","dataHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","dataCell","data-label","Source: ",4,"matCellDef"],["matColumnDef","timeScaleFormat"],["class","dataCell","data-label","Scale: ",4,"matCellDef"],["matColumnDef","period"],["matColumnDef","actions"],["class","actionHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","actionCell",4,"matCellDef"],["class","headerRow",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","dataRow",4,"matRowDef","matRowDefColumns"],[4,"matNoDataRow"],[1,"paginator"],["pageSize","5",3,"pageSizeOptions"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","",1,"formActionButton",3,"click"],["mat-sort-header","",1,"pathHeader"],["data-label","Path: ",1,"pathCell"],["mat-sort-header","",1,"dataHeader"],["data-label","Source: ",1,"dataCell"],["data-label","Scale: ",1,"dataCell"],["mat-sort-header","",1,"actionHeader"],[1,"actionCell"],["mat-raised-button","","color","accent",1,"small-button","buttons",3,"click"],[1,"headerRow"],[1,"dataRow"]],template:function(i,a){if(i&1){let n=$();v(0,"page-header",2),r(1,"div",3)(2,"form",4,0)(4,"p",5),p(5,"Datasets are background processes that record path values over time. Combine with the Data Chart widget they offer data visualization graphs. Care should be applied to manage Datasets and evaluate system resources usage. "),s(),r(6,"mat-form-field",6)(7,"mat-label"),p(8,"Filter"),s(),r(9,"input",7,1),C("keyup",function(m){return f(n),_(a.applyFilter(m))}),s()(),r(11,"div",8)(12,"mat-table",9),Q(13,10),g(14,Fi,2,0,"mat-header-cell",11)(15,Ai,2,1,"mat-cell",12),j(),Q(16,13),g(17,Li,2,0,"mat-header-cell",14)(18,Hi,2,1,"mat-cell",15),j(),Q(19,16),g(20,Vi,2,0,"mat-header-cell",14)(21,Ni,2,1,"mat-cell",17),j(),Q(22,18),g(23,Bi,2,0,"mat-header-cell",14)(24,Qi,2,1,"mat-cell",17),j(),Q(25,19),g(26,ji,1,0,"mat-header-cell",20)(27,$i,5,0,"mat-cell",21),j(),g(28,qi,1,0,"mat-header-row",22)(29,Wi,1,0,"mat-row",23)(30,Gi,2,1,"mat-row",24),s()(),r(31,"div",25),v(32,"mat-paginator",26),s(),r(33,"div",27),v(34,"mat-divider",28),r(35,"button",29),C("click",function(){return f(n),_(a.openDatasetModal())}),p(36,"Add"),s()()()()}i&2&&(u("pageTitle",a.pageTitle),l(12),u("dataSource",a.tableData)("trackBy",a.trackByUuid),l(16),u("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",!0),l(),u("matRowDefColumns",a.displayedColumns),l(3),u("pageSizeOptions",We(7,zi)))},dependencies:[Se,ye,ve,be,xe,Ce,Me,zt,de,Lt,At,Ht,Wt,Ft,Vt,ge,Nt,Qt,Bt,jt,$t,pe,we,Rt],styles:[ai]})}return t})(),ii=(()=>{class t{SignalKDataService=c(Xe);dialogRef=c(ft);dataset=c(_t);titleDialog=null;newDataset={uuid:null,path:null,pathSource:null,baseUnit:null,timeScaleFormat:"second",period:10,label:null};formDataset=null;availablePaths=[];availableSources=[];filterSelfPaths=!0;ngOnInit(){if(this.dataset){this.titleDialog="Edit Dataset",this.formDataset=this.dataset;let e=this.SignalKDataService.getPathObject(this.formDataset.path);e!==null&&(this.availableSources=["default"].concat(Object.keys(e.sources)))}else this.titleDialog="Add Dataset",this.formDataset=this.newDataset;this.availablePaths=this.SignalKDataService.getPathsByType("number").sort()}changePath(){let e=this.SignalKDataService.getPathObject(this.formDataset.path);e!==null&&(this.availableSources=["default"].concat(Object.keys(e.sources)),this.formDataset.pathSource="default")}closeForm(){this.dialogRef.close(this.formDataset)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=E({type:t,selectors:[["settings-datasets-modal"]],decls:67,vars:11,consts:[["datasetForm","ngForm"],["mat-dialog-title",""],["name","datasetForm",3,"ngSubmit"],["matStepLabel",""],[1,"tab-content"],[1,"full-width"],["placeholder","Select data path","name","selectedPath","required","",3,"ngModelChange","ngModel"],[3,"value"],["name","filterSelfPaths",3,"ngModelChange","ngModel"],["placeholder","Select data source","name","selectedSource","required","",3,"ngModelChange","ngModel"],[1,"buttons"],["type","button","mat-raised-button","","color","accent","matStepperNext","",3,"disabled"],[1,"mat-subtitle-1"],[1,"flex-container",2,"margin-top","10px"],[1,"flex-field-50"],["placeholder","Select dataset time scale","name","timeScaleFormat","required","",3,"ngModelChange","ngModel"],["value","hour"],["value","minute"],["value","second"],["matInput","","type","number","min","1","max","60","step","1","placeholder","Enter or select number...","name","period","required","",3,"ngModelChange","ngModel"],[2,"margin-top","10px"],["type","button","mat-raised-button","","color","accent","matStepperPrevious","",1,"buttons"],["mat-raised-button","","type","submit","color","accent",1,"buttons",3,"disabled"]],template:function(i,a){if(i&1){let n=$();r(0,"h6",1),p(1),s(),r(2,"mat-dialog-content")(3,"form",2,0),C("ngSubmit",function(){return f(n),_(a.closeForm())}),r(5,"mat-horizontal-stepper")(6,"mat-step"),g(7,Ki,1,0,"ng-template",3),r(8,"div",4)(9,"mat-form-field",5)(10,"mat-label"),p(11,"Signal K Path"),s(),r(12,"mat-select",6),U("ngModelChange",function(m){return f(n),K(a.formDataset.path,m)||(a.formDataset.path=m),_(m)}),C("ngModelChange",function(){return f(n),_(a.changePath())}),z(13,Ui,2,2,"mat-option",7,R),Ke(15,"filterSelf"),s()(),r(16,"mat-checkbox",8),U("ngModelChange",function(m){return f(n),K(a.filterSelfPaths,m)||(a.filterSelfPaths=m),_(m)}),p(17," Restrict to own vessel "),s(),v(18,"br")(19,"br"),r(20,"mat-form-field",5)(21,"mat-label"),p(22,"Source"),s(),r(23,"mat-select",9),U("ngModelChange",function(m){return f(n),K(a.formDataset.pathSource,m)||(a.formDataset.pathSource=m),_(m)}),z(24,Zi,2,2,"mat-option",7,R),s()()(),v(26,"mat-divider"),r(27,"div",10)(28,"button",11),p(29," Next "),s()()(),r(30,"mat-step"),g(31,Yi,1,0,"ng-template",3),r(32,"div",4)(33,"span",12),p(34,"Time Scales"),s(),r(35,"div",13)(36,"div",14)(37,"mat-form-field",5)(38,"mat-label"),p(39,"Scale"),s(),r(40,"mat-select",15),U("ngModelChange",function(m){return f(n),K(a.formDataset.timeScaleFormat,m)||(a.formDataset.timeScaleFormat=m),_(m)}),r(41,"mat-option",16),p(42,"Hours"),s(),r(43,"mat-option",17),p(44,"Minutes"),s(),r(45,"mat-option",18),p(46,"Seconds"),s()()()(),r(47,"div",14)(48,"mat-form-field",5)(49,"mat-label"),p(50,"Duration"),s(),r(51,"input",19),U("ngModelChange",function(m){return f(n),K(a.formDataset.period,m)||(a.formDataset.period=m),_(m)}),s()()()(),r(52,"p",20),p(53,"Time scales define the data sampling rate and overall Dataset level of precision. Select a Time Scale that is targeted to your intended usage. Shorter Time Scales have higher system resources costs, for both the data capture and widget rendering process. "),s(),r(54,"ul")(55,"li"),p(56,"Hours: per minute sampling rate. Intended for long sampling periods when slow refresh rate is acceptable and system resource usage should be minimized. Grafana is the perfect alternative to this Time Scale. "),s(),r(57,"li"),p(58,"Minutes: per second sampling rate. Meant for trends observations such wind speed, depth, solar power, voltage, etc. "),s(),r(59,"li"),p(60,"Secondes: 200ms sampling rate. Intended for use cases where user may act upon realtime information such as when racing. "),s()()(),v(61,"mat-divider"),r(62,"div",10)(63,"button",21),p(64," Back "),s(),r(65,"button",22),p(66," Save "),s()()()()()()}if(i&2){let n=W(4);l(),I(" ",a.titleDialog," "),l(11),G("ngModel",a.formDataset.path),l(),F(Ue(15,8,a.availablePaths,a.filterSelfPaths)),l(3),G("ngModel",a.filterSelfPaths),l(7),G("ngModel",a.formDataset.pathSource),l(),F(a.availableSources),l(4),u("disabled",!a.formDataset.path),l(12),G("ngModel",a.formDataset.timeScaleFormat),l(11),G("ngModel",a.formDataset.period),l(14),u("disabled",!n.valid)}},dependencies:[Ot,vt,bt,Se,ye,yt,Dt,Ct,ve,Et,wt,Mt,xt,be,Xt,ke,re,xe,Ce,Tt,It,kt,we,ge,ei,Me,ti,Gt],styles:[ai]})}return t})();export{Sn as SettingsDatasetsComponent,ii as SettingsDatasetsModalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-FYMQ3PE4.js";import{f as oe,n as ae}from"./chunk-ZBCOJLI4.js";import{k as I}from"./chunk-SMXTNO74.js";import{a as R}from"./chunk-7VNHJHIE.js";import{a as ie}from"./chunk-2YVW3TBK.js";import{A as B,D as G,E as K,H,K as z,N as Y,P as $,Q,R as X,T as Z,_ as ee,ca as te,da as ne,g as N,h as V,i as A,r as W,t as q,w as J,x as U}from"./chunk-TA4GACKT.js";import{$b as _,Aa as g,Cc as E,Ec as w,Fc as T,Fe as j,Gc as y,Nc as F,Sb as v,Tb as h,Ub as L,Vb as P,Wb as M,Xb as k,Yb as f,Zb as n,_b as i,f as O,gc as b,ic as m,kc as u,lb as c,ta as C,uc as x,wb as D,za as d,zc as o}from"./chunk-35L7BBBD.js";var le=()=>({standalone:!1});function se(r,p){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function ce(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",31)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",32),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigScope,t)||(a.saveConfigScope=t),g(t)}),n(5,"mat-option",33),o(6," Global "),i(),n(7,"mat-option",34),o(8," User "),i()()(),n(9,"mat-form-field",35)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",36),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigName,t)||(a.saveConfigName=t),g(t)}),i()(),v(13,se,2,0,"div"),i()}if(r&2){let e=u();c(4),w("ngModel",e.saveConfigScope),c(8),w("ngModel",e.saveConfigName),f("ngModelOptions",F(4,le)),c(),h(e.hasToken?-1:13)}}function de(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ge(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function pe(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",38),y("ngModelChange",function(t){d(e);let a=u();return T(a.deleteConfigItem,t)||(a.deleteConfigItem=t),g(t)}),M(5,ge,2,3,"mat-option",39,P),i()()()}if(r&2){let e=u();c(4),w("ngModel",e.deleteConfigItem),c(),k(e.serverConfigList)}}function me(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function fe(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function ue(r,p){if(r&1&&(n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",40),M(5,fe,2,3,"mat-option",39,L),i()()()),r&2){let e=u();c(5),k(e.serverConfigList)}}function Ce(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Ne=(()=>{class r{appSettingsService=C(A);storageSvc=C(V);appService=C(R);auth=C(N);fb=C($);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},q.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.hasToken&&this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return O(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(S){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",S)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=D({type:r,selectors:[["settings-config"]],decls:82,vars:8,consts:[["saveConfigForm","ngForm"],["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"],[1,"no-token-notice"],[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"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();_(0,"page-header",3),n(1,"div",4)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",5),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",6)(8,"div",7)(9,"form",8,0),m("ngSubmit",function(){return d(a),g(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",9),o(14," Create a backup of the current active configuration on the server. "),i(),v(15,ce,14,5,"div")(16,de,3,0,"div",10),n(17,"div",11),_(18,"mat-divider",12),n(19,"button",13),o(20," Create "),i()()()(),n(21,"div",7)(22,"form",14,1),m("ngSubmit",function(){return d(a),g(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(24,"h2"),o(25,"Delete"),i(),n(26,"p",9),o(27," Select a backup configuration to permanently delete from the server. "),i(),v(28,pe,7,1,"div")(29,me,3,0,"div",10),n(30,"div",11),_(31,"mat-divider",12),n(32,"button",13),o(33," Delete "),i()()()(),n(34,"div",7)(35,"form",15),m("ngSubmit",function(){return d(a),g(t.copyConfig())}),n(36,"h2"),o(37,"Restore"),i(),n(38,"p",9),o(39," Replace the current configuration with a backup from the server. "),i(),v(40,ue,7,0,"div")(41,Ce,3,0,"div",10),n(42,"div",11),_(43,"mat-divider",12),n(44,"button",13),o(45," Restore "),i()()()(),n(46,"div",16)(47,"h2"),o(48,"Advanced"),i(),n(49,"div",17)(50,"div",18)(51,"p"),o(52,"Download the active configuration to a file."),i()(),n(53,"div",19)(54,"button",20),m("click",function(){return d(a),g(t.downloadJsonConfig())}),o(55," Download "),i()(),n(56,"div",21)(57,"p"),o(58," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(59,"div",22)(60,"input",23,2),m("change",function(S){return d(a),g(t.uploadJsonConfig(S))}),i(),n(62,"button",24),m("click",function(){d(a);let S=x(61);return g(S.click())}),o(63," Upload "),i()(),n(64,"div",25)(65,"p"),o(66," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(67,"div",26)(68,"button",20),m("click",function(){return d(a),g(t.loadDemoConfig())}),o(69," Demo "),i()(),n(70,"div",27)(71,"p"),o(72," 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(73,"div",28)(74,"button",20),m("click",function(){return d(a),g(t.resetConfigToDefault())}),o(75," Default "),i()(),n(76,"div",29)(77,"p"),o(78," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(79,"div",30)(80,"button",20),m("click",function(){return d(a),g(t.resetConnectionToDefault())}),o(81," Connection "),i()()()()()()}if(l&2){let a=x(10),s=x(23);f("pageTitle",t.pageTitle),c(15),h(t.hasToken?15:16),c(4),f("disabled",!t.hasToken||!a.valid),c(9),h(t.hasToken?28:29),c(4),f("disabled",!t.hasToken||!s.valid),c(3),f("formGroup",t.copyConfigForm),c(5),h(t.hasToken?40:41),c(4),f("disabled",!t.copyConfigForm.valid)}},dependencies:[I,Q,K,W,J,U,Y,G,B,ie,j,ee,Z,ae,oe,te,X,H,z,re,ne],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:auto;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Ne as SettingsConfigComponent};
|
|
1
|
+
import{a as re}from"./chunk-VHFBF47T.js";import{f as oe,n as ae}from"./chunk-ZBCOJLI4.js";import{h as I}from"./chunk-TXPLRBW5.js";import{a as R}from"./chunk-K22CSA3Y.js";import{a as ie}from"./chunk-2YVW3TBK.js";import{A as B,D as G,E as K,H,K as z,N as Y,P as $,Q,R as X,T as Z,_ as ee,ca as te,da as ne,g as N,h as V,i as A,r as W,t as q,w as J,x as U}from"./chunk-TA4GACKT.js";import{$b as _,Aa as g,Cc as E,Ec as w,Fc as T,Fe as j,Gc as y,Nc as F,Sb as v,Tb as h,Ub as L,Vb as P,Wb as M,Xb as k,Yb as f,Zb as n,_b as i,f as O,gc as b,ic as m,kc as u,lb as c,ta as C,uc as x,wb as D,za as d,zc as o}from"./chunk-35L7BBBD.js";var le=()=>({standalone:!1});function se(r,p){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function ce(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",31)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",32),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigScope,t)||(a.saveConfigScope=t),g(t)}),n(5,"mat-option",33),o(6," Global "),i(),n(7,"mat-option",34),o(8," User "),i()()(),n(9,"mat-form-field",35)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",36),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigName,t)||(a.saveConfigName=t),g(t)}),i()(),v(13,se,2,0,"div"),i()}if(r&2){let e=u();c(4),w("ngModel",e.saveConfigScope),c(8),w("ngModel",e.saveConfigName),f("ngModelOptions",F(4,le)),c(),h(e.hasToken?-1:13)}}function de(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ge(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function pe(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",38),y("ngModelChange",function(t){d(e);let a=u();return T(a.deleteConfigItem,t)||(a.deleteConfigItem=t),g(t)}),M(5,ge,2,3,"mat-option",39,P),i()()()}if(r&2){let e=u();c(4),w("ngModel",e.deleteConfigItem),c(),k(e.serverConfigList)}}function me(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function fe(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function ue(r,p){if(r&1&&(n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",40),M(5,fe,2,3,"mat-option",39,L),i()()()),r&2){let e=u();c(5),k(e.serverConfigList)}}function Ce(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Ne=(()=>{class r{appSettingsService=C(A);storageSvc=C(V);appService=C(R);auth=C(N);fb=C($);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},q.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.hasToken&&this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return O(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(S){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",S)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=D({type:r,selectors:[["settings-config"]],decls:82,vars:8,consts:[["saveConfigForm","ngForm"],["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"],[1,"no-token-notice"],[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"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();_(0,"page-header",3),n(1,"div",4)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",5),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",6)(8,"div",7)(9,"form",8,0),m("ngSubmit",function(){return d(a),g(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",9),o(14," Create a backup of the current active configuration on the server. "),i(),v(15,ce,14,5,"div")(16,de,3,0,"div",10),n(17,"div",11),_(18,"mat-divider",12),n(19,"button",13),o(20," Create "),i()()()(),n(21,"div",7)(22,"form",14,1),m("ngSubmit",function(){return d(a),g(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(24,"h2"),o(25,"Delete"),i(),n(26,"p",9),o(27," Select a backup configuration to permanently delete from the server. "),i(),v(28,pe,7,1,"div")(29,me,3,0,"div",10),n(30,"div",11),_(31,"mat-divider",12),n(32,"button",13),o(33," Delete "),i()()()(),n(34,"div",7)(35,"form",15),m("ngSubmit",function(){return d(a),g(t.copyConfig())}),n(36,"h2"),o(37,"Restore"),i(),n(38,"p",9),o(39," Replace the current configuration with a backup from the server. "),i(),v(40,ue,7,0,"div")(41,Ce,3,0,"div",10),n(42,"div",11),_(43,"mat-divider",12),n(44,"button",13),o(45," Restore "),i()()()(),n(46,"div",16)(47,"h2"),o(48,"Advanced"),i(),n(49,"div",17)(50,"div",18)(51,"p"),o(52,"Download the active configuration to a file."),i()(),n(53,"div",19)(54,"button",20),m("click",function(){return d(a),g(t.downloadJsonConfig())}),o(55," Download "),i()(),n(56,"div",21)(57,"p"),o(58," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(59,"div",22)(60,"input",23,2),m("change",function(S){return d(a),g(t.uploadJsonConfig(S))}),i(),n(62,"button",24),m("click",function(){d(a);let S=x(61);return g(S.click())}),o(63," Upload "),i()(),n(64,"div",25)(65,"p"),o(66," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(67,"div",26)(68,"button",20),m("click",function(){return d(a),g(t.loadDemoConfig())}),o(69," Demo "),i()(),n(70,"div",27)(71,"p"),o(72," 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(73,"div",28)(74,"button",20),m("click",function(){return d(a),g(t.resetConfigToDefault())}),o(75," Default "),i()(),n(76,"div",29)(77,"p"),o(78," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(79,"div",30)(80,"button",20),m("click",function(){return d(a),g(t.resetConnectionToDefault())}),o(81," Connection "),i()()()()()()}if(l&2){let a=x(10),s=x(23);f("pageTitle",t.pageTitle),c(15),h(t.hasToken?15:16),c(4),f("disabled",!t.hasToken||!a.valid),c(9),h(t.hasToken?28:29),c(4),f("disabled",!t.hasToken||!s.valid),c(3),f("formGroup",t.copyConfigForm),c(5),h(t.hasToken?40:41),c(4),f("disabled",!t.copyConfigForm.valid)}},dependencies:[I,Q,K,W,J,U,Y,G,B,ie,j,ee,Z,ae,oe,te,X,H,z,re,ne],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:auto;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Ne as SettingsConfigComponent};
|