@mxtommy/kip 4.8.1 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/package.json +1 -1
  3. package/public/{chunk-CNMFlw_H.js → chunk-7lulvsGI.js} +1 -1
  4. package/public/{chunk-CIlfzV9R.js → chunk-8hkXyEzG.js} +1 -1
  5. package/public/{chunk-DWLISAZi.js → chunk-B15lj2T8.js} +1 -1
  6. package/public/{chunk-BQr-tSkv.js → chunk-B6AwCAvV.js} +1 -1
  7. package/public/{chunk-CwSa_BNV.js → chunk-B6XxnPxk.js} +1 -1
  8. package/public/{chunk-DE4ylhpq.js → chunk-B8gfh4xf.js} +1 -1
  9. package/public/{chunk-C2VQxCXa.js → chunk-B8zRhoG8.js} +1 -1
  10. package/public/{chunk-Bp0MQwPM.js → chunk-BIYHVfJl.js} +1 -1
  11. package/public/{chunk-DzTTqoF_.js → chunk-BW4m3O2L.js} +1 -1
  12. package/public/{chunk-Ii9n-oiL.js → chunk-B_PiPxb4.js} +1 -1
  13. package/public/chunk-Bb1mO304.js +1 -0
  14. package/public/{chunk-MjWuPUhu.js → chunk-BdBWqZzL.js} +1 -1
  15. package/public/{chunk-hd2_AKwt.js → chunk-BgyxBAyq.js} +1 -1
  16. package/public/{chunk-JbEkcxJm.js → chunk-Bhah8DNM.js} +1 -1
  17. package/public/{chunk-DDqeRiB0.js → chunk-Bq-eHuZV.js} +1 -1
  18. package/public/{chunk-CpuB_ZZz.js → chunk-BxV0O2fU.js} +1 -1
  19. package/public/{chunk-PheXEqie.js → chunk-Bz9bswDl.js} +1 -1
  20. package/public/{chunk-BOAD0N2a.js → chunk-C3CwUYvD.js} +1 -1
  21. package/public/{chunk-CkXTl3su.js → chunk-C4FGoLDg.js} +1 -1
  22. package/public/{chunk-sNakMDHi.js → chunk-CCiqU2uY.js} +1 -1
  23. package/public/{chunk-00hwknVI.js → chunk-CHKQxw6E.js} +1 -1
  24. package/public/{chunk-B82ADJSs.js → chunk-CJIxuzvd.js} +1 -1
  25. package/public/{chunk-DumLX5k_.js → chunk-COMZv7NY.js} +1 -1
  26. package/public/{chunk-dgaOX1wC.js → chunk-CSpA60X7.js} +1 -1
  27. package/public/{chunk-C6UXF7BI.js → chunk-CU8RPnsi.js} +1 -1
  28. package/public/{chunk-CNNTuNlM.js → chunk-CcvYOops.js} +1 -1
  29. package/public/{chunk-CA6RRaxd.js → chunk-CdSWuWKr.js} +1 -1
  30. package/public/{chunk-DQnoPLyC.js → chunk-CjsnWLUr.js} +1 -1
  31. package/public/{chunk-BX6skw5k.js → chunk-CkfPr-c5.js} +1 -1
  32. package/public/{chunk-nu4vZg-z.js → chunk-CoEM_FqS.js} +1 -1
  33. package/public/{chunk-DNS-qsFC.js → chunk-Cr34s2uQ.js} +1 -1
  34. package/public/{chunk-BJz7Ij9E.js → chunk-Cu9FE8cB.js} +1 -1
  35. package/public/{chunk-B6bEhzNR.js → chunk-CyURmwWh.js} +1 -1
  36. package/public/{chunk-CrBxxZCe.js → chunk-D-xDPCf7.js} +1 -1
  37. package/public/{chunk-5U8d2Ygo.js → chunk-D0MyVrEL.js} +1 -1
  38. package/public/{chunk-DjZgzSiH.js → chunk-DBA0eRqb.js} +1 -1
  39. package/public/{chunk-BKj60jdq.js → chunk-DGOvRnAo.js} +1 -1
  40. package/public/{chunk-CXvG8mMq.js → chunk-DMhuBqKs.js} +1 -1
  41. package/public/{chunk-DchvLV_Y.js → chunk-DMoEBcor.js} +1 -1
  42. package/public/chunk-DSvdWjO4.js +1 -0
  43. package/public/{chunk-D4xZ2tGB.js → chunk-DVB9tiW3.js} +1 -1
  44. package/public/{chunk-Dxlia2NE.js → chunk-D_wrJJxl.js} +1 -1
  45. package/public/{chunk-BwOIef42.js → chunk-DfGLo6Tb.js} +1 -1
  46. package/public/{chunk-BdokyhBM.js → chunk-Di5pPpU7.js} +1 -1
  47. package/public/{chunk-BoNDCNGE.js → chunk-DjavLLpP.js} +1 -1
  48. package/public/{chunk-CL2xiH57.js → chunk-Dv77RFHm.js} +1 -1
  49. package/public/{chunk-AANk-NXH.js → chunk-NnB8OYZt.js} +3 -3
  50. package/public/{chunk-By8ZVvDx.js → chunk-h2q_pbbF.js} +1 -1
  51. package/public/{chunk-tAiV3ARh.js → chunk-o977r5_s.js} +1 -1
  52. package/public/{chunk-DXkKj21H.js → chunk-oPq9Nexl.js} +1 -1
  53. package/public/{chunk-VgxMqRPk.js → chunk-oZiyAw_P.js} +1 -1
  54. package/public/chunk-zg7II0hz.js +1 -0
  55. package/public/index.html +1 -1
  56. package/public/{main-BAV5VDOD.js → main-BNR44HGB.js} +20 -20
  57. package/public/chunk-Blokg6Ds.js +0 -1
  58. package/public/chunk-CpMCBDvH.js +0 -1
  59. package/public/chunk-y1imvaA-.js +0 -1
@@ -1 +1 @@
1
- import {k}from'./chunk-BwOIef42.js';import {d1 as Hj,w,du as p,dv as rt,dD as _$1,bu as ut,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,cn as wd,ci as dl,cp as Uh,cj as fl,X as xw,cs as Sw,T as TT,e as EE,an as Hh,d as ig,Y as Aw,bp as gl,aA as gg,f as eg,K as Kw,g as qw,dx as n$1}from'./main-BAV5VDOD.js';import {c}from'./chunk-Dxlia2NE.js';var O=["gaugeBarAnimate"];function Z(n,U){if(n&1&&(wd(),Uh(0,"rect",14)),n&2){let t=U.$implicit,a=qw();Hh("fill",t.color)("x",5+(t.from-a.gaugeMinValue())*a.scaleSliceValue())("width",(t.to-t.from)*a.scaleSliceValue());}}var _=(()=>{class n{gaugeBarAnimate=$j("gaugeBarAnimate");displayName=Hj.required();displayNameColor=Hj.required();dataValue=Hj.required();dataValueLabel=Hj.required();unitLabel=Hj.required();barColor=Hj.required();barColorGradient=Hj.required();barColorBackground=Hj.required();gaugeMinValue=Hj.required();gaugeMaxValue=Hj.required();highlights=Hj.required();scaleSliceValue=Dt(()=>{let t=this.gaugeMaxValue()-this.gaugeMinValue();return t!==0?195/t:0});newGaugeValue=vt(null);oldGaugeValue=vt(null);firstRenderApplied=false;scheduleRafId=null;constructor(){Fa(()=>{let t=this.gaugeMinValue(),a=this.dataValue();a==null&&(a=t);let e=(a-t)*this.scaleSliceValue();ge(()=>{let o=this.newGaugeValue();!this.firstRenderApplied||o===null?(this.oldGaugeValue.set(e),this.newGaugeValue.set(e),this.firstRenderApplied=true):(this.oldGaugeValue.set(o),this.newGaugeValue.set(e)),this.gaugeBarAnimate()?.nativeElement&&(this.scheduleRafId!==null&&cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=requestAnimationFrame(()=>{let r=this.gaugeBarAnimate();r?.nativeElement&&r.nativeElement.beginElement(),this.scheduleRafId=null;}));});});}ngOnDestroy(){this.scheduleRafId!==null&&(cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=null);}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(a,e){a&1&&eg(e.gaugeBarAnimate,O,5),a&2&&Kw();},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],dataValueLabel:[1,"dataValueLabel"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"],highlights:[1,"highlights"]},decls:26,vars:11,consts:[["gaugeBarAnimate",""],["viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke","none"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke","none"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["y","39.5","height","0.75","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(a,e){a&1&&(wd(),dl(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),Uh(3,"stop",4)(4,"stop",5),fl(),Uh(5,"linearGradient",6),fl(),dl(6,"g",7),Uh(7,"rect",8),dl(8,"defs")(9,"g",9),Uh(10,"rect",10)(11,"rect",11),fl()(),dl(12,"use",12),Uh(13,"animateTransform",13,0),fl(),xw(15,Z,1,3,":svg:rect",14,Sw),fl(),dl(17,"g",15)(18,"text",16)(19,"tspan",17),TT(20),fl()(),dl(21,"text",18)(22,"tspan",19),TT(23),fl(),dl(24,"tspan",20),TT(25),fl()()()()),a&2&&(EE(3),Hh("stop-color",e.barColorGradient()),EE(),Hh("stop-color",e.barColorGradient()),EE(3),Hh("fill",e.barColorBackground()),EE(5),ig("fill",e.barColor()),EE(),Hh("from",e.oldGaugeValue()+" 1")("to",e.newGaugeValue()+" 1"),EE(2),Aw(e.highlights()),EE(4),Hh("fill",e.displayNameColor()),EE(),gl(" ",e.displayName()),EE(3),gg(e.dataValueLabel()),EE(2),gg(e.unitLabel()));},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return n})();var oe=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:false,color:"contrast",enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt);metadata=w(_$1,{optional:true});unitsService=w(ut);unitsLabel=vt("");dataLabelValue=vt("0");dataValue=vt(0);barColor=vt("");barColorGradient=vt("");barColorBackground=vt("");cfg=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);displayNameSafe=Dt(()=>this.cfg().displayName??"Gauge Label");gaugeMaxValue=Dt(()=>this.cfg().displayScale?.upper??15);gaugeMinValue=Dt(()=>this.cfg().displayScale?.lower??0);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);highlights=Dt(()=>{let t=this.cfg(),a=this.theme(),e=this.gaugePathConfig();if(!a)return [];if(t.ignoreZones||!this.metadata)return [];let o=this.metadata.zones();if(!o?.length)return [];let r=e?.convertUnitTo??"",y=t.displayScale?.lower??0,u=t.displayScale?.upper??15;return k(o,a,r,this.unitsService,y,u)});lastState=null;constructor(){Fa(()=>{let t=this.cfg(),a=this.gaugePathConfig();a?.path&&ge(()=>{this.streams.observe("gaugePath",o=>{let r=this.theme();if(!r)return;let y=o?.data?.value;if(y==null)this.dataValue.set(t.displayScale?.lower??0),this.dataLabelValue.set("--");else {let u=Math.min(Math.max(y,t.displayScale?.lower??0),t.displayScale?.upper??15);this.dataValue.set(u),this.dataLabelValue.set(u.toFixed(t.numDecimal??2));}if(!t.ignoreZones){let u=o?.state;if(u&&u!==this.lastState)switch(this.lastState=u,u){case n$1.Alarm:this.barColor.set(r.zoneAlarm);break;case n$1.Warn:this.barColor.set(r.zoneWarn);break;case n$1.Alert:this.barColor.set(r.zoneAlert);break;case n$1.Nominal:this.barColor.set(r.zoneNominal);break;default:this.barColor.set(c(t.color??"contrast",r).color);break}}});let e=a.convertUnitTo??"";this.unitsLabel.set(t.gauge?.unitLabelFormat==="abr"?e.substring(0,1):e);});}),Fa(()=>{let t=this.cfg(),a=this.theme();a&&ge(()=>{this.barColorBackground.set(a.background);let e=c(t.color??"contrast",a);if(t.ignoreZones)this.barColor.set(e.color);else if(this.lastState)switch(this.lastState){case n$1.Alarm:this.barColor.set(a.zoneAlarm);break;case n$1.Warn:this.barColor.set(a.zoneWarn);break;case n$1.Alert:this.barColor.set(a.zoneAlert);break;case n$1.Nominal:this.barColor.set(a.zoneNominal);break;default:this.barColor.set(e.color);break}else this.barColor.set(e.color);this.barColorGradient.set(e.dimmer||e.dim||e.color);});}),Fa(()=>{let t=this.cfg(),a=this.metadata;t.ignoreZones||!a||ge(()=>a.observe("gaugePath"));});}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["widget-simple-linear"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:11,consts:[[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","dataValueLabel","barColor","barColorGradient","barColorBackground","gaugeMaxValue","gaugeMinValue","highlights"]],template:function(a,e){if(a&1&&$h(0,"svg-simple-linear-gauge",0),a&2){let o;Bh("displayName",e.displayNameSafe())("displayNameColor",(o=e.theme())==null?null:o.contrastDim)("unitLabel",e.unitsLabel())("dataValue",e.dataValue())("dataValueLabel",e.dataLabelValue())("barColor",e.barColor())("barColorGradient",e.barColorGradient())("barColorBackground",e.barColorBackground())("gaugeMaxValue",e.gaugeMaxValue())("gaugeMinValue",e.gaugeMinValue())("highlights",e.highlights());}},dependencies:[_],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return n})();export{oe as WidgetSimpleLinearComponent};
1
+ import {k}from'./chunk-DfGLo6Tb.js';import {d1 as Hj,w,du as p,dv as rt,dD as _$1,bu as ut,v as vt,D as Dt,F as Fa,dn as ge,J as JD,c as $h,B as Bh,$ as $j,cn as wd,ci as dl,cp as Uh,cj as fl,X as xw,cs as Sw,T as TT,e as EE,an as Hh,d as ig,Y as Aw,bp as gl,aA as gg,f as eg,K as Kw,g as qw,dx as n$1}from'./main-BNR44HGB.js';import {c}from'./chunk-D_wrJJxl.js';var O=["gaugeBarAnimate"];function Z(n,U){if(n&1&&(wd(),Uh(0,"rect",14)),n&2){let t=U.$implicit,a=qw();Hh("fill",t.color)("x",5+(t.from-a.gaugeMinValue())*a.scaleSliceValue())("width",(t.to-t.from)*a.scaleSliceValue());}}var _=(()=>{class n{gaugeBarAnimate=$j("gaugeBarAnimate");displayName=Hj.required();displayNameColor=Hj.required();dataValue=Hj.required();dataValueLabel=Hj.required();unitLabel=Hj.required();barColor=Hj.required();barColorGradient=Hj.required();barColorBackground=Hj.required();gaugeMinValue=Hj.required();gaugeMaxValue=Hj.required();highlights=Hj.required();scaleSliceValue=Dt(()=>{let t=this.gaugeMaxValue()-this.gaugeMinValue();return t!==0?195/t:0});newGaugeValue=vt(null);oldGaugeValue=vt(null);firstRenderApplied=false;scheduleRafId=null;constructor(){Fa(()=>{let t=this.gaugeMinValue(),a=this.dataValue();a==null&&(a=t);let e=(a-t)*this.scaleSliceValue();ge(()=>{let o=this.newGaugeValue();!this.firstRenderApplied||o===null?(this.oldGaugeValue.set(e),this.newGaugeValue.set(e),this.firstRenderApplied=true):(this.oldGaugeValue.set(o),this.newGaugeValue.set(e)),this.gaugeBarAnimate()?.nativeElement&&(this.scheduleRafId!==null&&cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=requestAnimationFrame(()=>{let r=this.gaugeBarAnimate();r?.nativeElement&&r.nativeElement.beginElement(),this.scheduleRafId=null;}));});});}ngOnDestroy(){this.scheduleRafId!==null&&(cancelAnimationFrame(this.scheduleRafId),this.scheduleRafId=null);}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["svg-simple-linear-gauge"]],viewQuery:function(a,e){a&1&&eg(e.gaugeBarAnimate,O,5),a&2&&Kw();},inputs:{displayName:[1,"displayName"],displayNameColor:[1,"displayNameColor"],dataValue:[1,"dataValue"],dataValueLabel:[1,"dataValueLabel"],unitLabel:[1,"unitLabel"],barColor:[1,"barColor"],barColorGradient:[1,"barColorGradient"],barColorBackground:[1,"barColorBackground"],gaugeMinValue:[1,"gaugeMinValue"],gaugeMaxValue:[1,"gaugeMaxValue"],highlights:[1,"highlights"]},decls:26,vars:11,consts:[["gaugeBarAnimate",""],["viewBox","0 0 205 50","preserveAspectRatio","xMidYMid","version","1.1","id","svg8",1,"svg-simple-linear"],["id","defs2"],["id","gaugeBarGradient"],["id","stop849","offset","0",2,"stop-opacity","1"],["id","stop851","offset","0.40",2,"stop-opacity","0"],["id","linearGradient855","gradientTransform","translate(5,-30)","gradientUnits","userSpaceOnUse","y2","34.5","x2","-5","y1","34.5","x1","-6","href","#gaugeBarGradient"],["id","layer1",2,"display","inline"],["id","GaugeBackground","width","195","height","9","x","5","y","30","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","gaugeBar"],["id","gaugeValue","width","1","height","9","x","0","y","0","ry","0",2,"mix-blend-mode","normal","fill-opacity","1","stroke","none"],["id","gaugeValueGradient","transform","scale(-1,1)","width","1","height","9","x","-1","y","0","ry","0",2,"display","inline","opacity","1","mix-blend-mode","multiply","fill","url(#linearGradient855)","stroke","none"],[0,"xlink","href","#gaugeBar","transform","translate(5,30)"],["attributeName","transform","type","scale","begin","indefinite","dur","0.5s","additive","sum","fill","freeze"],["y","39.5","height","0.75","ry","0",2,"opacity","1","fill-opacity","1","stroke","none","stroke-width","0.265899","stroke-miterlimit","4","stroke-dasharray","none","stroke-opacity","1"],["id","layer2",2,"display","inline"],[0,"xml","space","preserve","x","4.1731763","y","25.413595","id","displayNameText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["id","tspan1945","x","4.1731763","y","25.413595",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","12.7px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["text-anchor","end","id","gaugeTexts","y","25.293016","x","200.37138",0,"xml","space","preserve",1,"simpleLinear-text",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","line-height","1.25","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal","letter-spacing","0px","word-spacing","0px"],["y","25.293016","x","200.37138","id","valueText",2,"font-style","normal","font-variant","normal","font-weight","bold","font-stretch","normal","font-size","22.5778px","font-family","Roboto","font-variant-ligatures","normal","font-variant-caps","normal","font-variant-numeric","normal","font-variant-east-asian","normal"],["dy","-9","id","unitText",2,"text-transform","capitalize","font-size","9.87778px"]],template:function(a,e){a&1&&(wd(),dl(0,"svg",1)(1,"defs",2)(2,"linearGradient",3),Uh(3,"stop",4)(4,"stop",5),fl(),Uh(5,"linearGradient",6),fl(),dl(6,"g",7),Uh(7,"rect",8),dl(8,"defs")(9,"g",9),Uh(10,"rect",10)(11,"rect",11),fl()(),dl(12,"use",12),Uh(13,"animateTransform",13,0),fl(),xw(15,Z,1,3,":svg:rect",14,Sw),fl(),dl(17,"g",15)(18,"text",16)(19,"tspan",17),TT(20),fl()(),dl(21,"text",18)(22,"tspan",19),TT(23),fl(),dl(24,"tspan",20),TT(25),fl()()()()),a&2&&(EE(3),Hh("stop-color",e.barColorGradient()),EE(),Hh("stop-color",e.barColorGradient()),EE(3),Hh("fill",e.barColorBackground()),EE(5),ig("fill",e.barColor()),EE(),Hh("from",e.oldGaugeValue()+" 1")("to",e.newGaugeValue()+" 1"),EE(2),Aw(e.highlights()),EE(4),Hh("fill",e.displayNameColor()),EE(),gl(" ",e.displayName()),EE(3),gg(e.dataValueLabel()),EE(2),gg(e.unitLabel()));},styles:["svg[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;left:0;top:0}.simpleLinear-text[_ngcontent-%COMP%]{fill:var(--kip-contrast-color)}"]})}return n})();var oe=(()=>{class n{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:false,color:"contrast",enableTimeout:false,dataTimeout:5};runtime=w(p);streams=w(rt);metadata=w(_$1,{optional:true});unitsService=w(ut);unitsLabel=vt("");dataLabelValue=vt("0");dataValue=vt(0);barColor=vt("");barColorGradient=vt("");barColorBackground=vt("");cfg=Dt(()=>this.runtime.options()??n.DEFAULT_CONFIG);displayNameSafe=Dt(()=>this.cfg().displayName??"Gauge Label");gaugeMaxValue=Dt(()=>this.cfg().displayScale?.upper??15);gaugeMinValue=Dt(()=>this.cfg().displayScale?.lower??0);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);highlights=Dt(()=>{let t=this.cfg(),a=this.theme(),e=this.gaugePathConfig();if(!a)return [];if(t.ignoreZones||!this.metadata)return [];let o=this.metadata.zones();if(!o?.length)return [];let r=e?.convertUnitTo??"",y=t.displayScale?.lower??0,u=t.displayScale?.upper??15;return k(o,a,r,this.unitsService,y,u)});lastState=null;constructor(){Fa(()=>{let t=this.cfg(),a=this.gaugePathConfig();a?.path&&ge(()=>{this.streams.observe("gaugePath",o=>{let r=this.theme();if(!r)return;let y=o?.data?.value;if(y==null)this.dataValue.set(t.displayScale?.lower??0),this.dataLabelValue.set("--");else {let u=Math.min(Math.max(y,t.displayScale?.lower??0),t.displayScale?.upper??15);this.dataValue.set(u),this.dataLabelValue.set(u.toFixed(t.numDecimal??2));}if(!t.ignoreZones){let u=o?.state;if(u&&u!==this.lastState)switch(this.lastState=u,u){case n$1.Alarm:this.barColor.set(r.zoneAlarm);break;case n$1.Warn:this.barColor.set(r.zoneWarn);break;case n$1.Alert:this.barColor.set(r.zoneAlert);break;case n$1.Nominal:this.barColor.set(r.zoneNominal);break;default:this.barColor.set(c(t.color??"contrast",r).color);break}}});let e=a.convertUnitTo??"";this.unitsLabel.set(t.gauge?.unitLabelFormat==="abr"?e.substring(0,1):e);});}),Fa(()=>{let t=this.cfg(),a=this.theme();a&&ge(()=>{this.barColorBackground.set(a.background);let e=c(t.color??"contrast",a);if(t.ignoreZones)this.barColor.set(e.color);else if(this.lastState)switch(this.lastState){case n$1.Alarm:this.barColor.set(a.zoneAlarm);break;case n$1.Warn:this.barColor.set(a.zoneWarn);break;case n$1.Alert:this.barColor.set(a.zoneAlert);break;case n$1.Nominal:this.barColor.set(a.zoneNominal);break;default:this.barColor.set(e.color);break}else this.barColor.set(e.color);this.barColorGradient.set(e.dimmer||e.dim||e.color);});}),Fa(()=>{let t=this.cfg(),a=this.metadata;t.ignoreZones||!a||ge(()=>a.observe("gaugePath"));});}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=JD({type:n,selectors:[["widget-simple-linear"]],inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:11,consts:[[1,"simpleLinearGaugeContainer",3,"displayName","displayNameColor","unitLabel","dataValue","dataValueLabel","barColor","barColorGradient","barColorBackground","gaugeMaxValue","gaugeMinValue","highlights"]],template:function(a,e){if(a&1&&$h(0,"svg-simple-linear-gauge",0),a&2){let o;Bh("displayName",e.displayNameSafe())("displayNameColor",(o=e.theme())==null?null:o.contrastDim)("unitLabel",e.unitsLabel())("dataValue",e.dataValue())("dataValueLabel",e.dataLabelValue())("barColor",e.barColor())("barColorGradient",e.barColorGradient())("barColorBackground",e.barColorBackground())("gaugeMaxValue",e.gaugeMaxValue())("gaugeMinValue",e.gaugeMinValue())("highlights",e.highlights());}},dependencies:[_],styles:[".simpleLinearGaugeContainer[_ngcontent-%COMP%]{display:block;position:relative;height:100%;width:100%;padding:0}"]})}return n})();export{oe as WidgetSimpleLinearComponent};
@@ -1 +1 @@
1
- import {C,e as e$1}from'./chunk-B6bEhzNR.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-BAV5VDOD.js';import {c,e}from'./chunk-Dxlia2NE.js';var ie=["acSvg"];function re(l,e){l&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No AC buses detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K AC paths or select buses in widget settings."),ul()());}var Y=class l{static AC_DESCRIPTOR=a("widget-ac");static SELF_ROOT_PATH=(()=>{let e=l.AC_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAcComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${l.SELF_ROOT_PATH}.*`;static ROOT_PREFIX=`${l.SELF_ROOT_PATH}.`;static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static RESERVED_AC_AGGREGATE_IDS=new Set(["totalCurrent","totalPower"]);static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,ac:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("acSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredBusIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["line1Voltage","line1Current","line1Frequency","line2Voltage"]});busesByKey=vt({});visibleBusKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(r=>r.key);let i=this.busesByKey(),t=new Set(this.discoveredBusIds());return Object.keys(i).filter(r=>{let s=i[r];return !!s&&t.has(s.id)}).sort((r,s)=>r.localeCompare(s))});visibleBuses=Dt(()=>{let e=this.visibleBusKeys(),i=this.busesByKey();return e.map(t=>i[t]).filter(t=>!!t)});hasBuses=Dt(()=>this.visibleBuses().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleBuses();return e.length!==1?"AC Buses":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleBuses(),i=this.theme(),t=this.widgetColors(),r=this.ignoreZones(),s=new Map;e$1.forEach(n=>s.set(n.id,(s.get(n.id)??0)+1));let c=new Set([...s.entries()].filter(([,n])=>n>1).map(([n])=>n)),a={};for(let n of e$1){let d=n.deviceKey??n.id,o=!!n.source&&c.has(n.id),h=this.resolveMostSevereState(n.line1VoltageState??null,n.line1CurrentState??null,n.line2VoltageState??null,n.line2CurrentState??null,n.line3VoltageState??null,n.line3CurrentState??null,n.modeState??null),v=this.resolveMostSevereState(n.line1VoltageState??null,n.line1CurrentState??null,n.line1FrequencyState??null),T=this.resolveMostSevereState(n.line2VoltageState??null,n.line2CurrentState??null,n.line3VoltageState??null,n.line3CurrentState??null),[M,I]=this.buildMetricRows(n);a[d]={id:n.id,titleText:this.resolveTitleText(n),modeText:this.isCompactCardMode()?"":this.resolveModeText(n),busText:this.isCompactCardMode()?"":o?n.source??"-":n.associatedBus||n.location||"-",metricsLineOne:M,metricsLineTwo:I,stateBarColor:e(h,t?.dim??"var(--kip-contrast-color)",i,r),titleTextColor:e(h,"var(--kip-contrast-color)",i,r),metaTextColor:e(n.modeState??null,"var(--kip-contrast-dim-color)",i,r),primaryMetricsTextColor:e(v,"var(--kip-contrast-color)",i,r),secondaryMetricsTextColor:e(T,"var(--kip-contrast-color)",i,r)};}return a});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),r=this.visibleBuses(),s=this.widgetColors();!this.svg||!s||this.requestRender({buses:r,displayModels:t,widgetColors:s});});let e=[this.data.subscribePathTreeWithInitial(l.ROOT_PATTERN)],i=false;for(let t of e)if(t.initial.length){i=true;for(let r of t.initial)this.enqueuePathUpdate(r,true);}i&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(r=>this.enqueuePathUpdate(r));}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${l.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","AC View"),this.layer=this.svg.append("g").attr("class","ac-layer");}applyConfig(e){let i=this.resolveAcConfig(e);this.trackedDevices.set(i.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(i.trackedDevices??[]),this.optionsById.set(i.optionsById),this.cardMode.set(this.normalizeCardMode(i.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let i=new Map;e.forEach(t=>{let r=i.get(t.id)??[];r.push(t.key),i.set(t.id,r);}),this.busesByKey.update(t=>{let r=t,s=false;return i.forEach((c,a)=>{let n=t[a];if(n){for(let d of c){if(t[d])continue;let o=e.find(h=>h.key===d);s||(r=G({},t),s=true),r[d]=z(G({},n),{source:o?.source??null,deviceKey:d});}s&&r[a]?.deviceKey===void 0&&delete r[a];}}),s?r:t});}resolveAcConfig(e){let i=e.ac;return {trackedDevices:this.normalizeAcTrackedDevices(i?.trackedDevices),optionsById:this.normalizeOptionsById(i?.optionsById),cardMode:this.normalizeCardMode(i?.cardMode)}}normalizeAcTrackedDevices(e){if(!Array.isArray(e))return [];let i=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let r=t,s=this.normalizeOptionalString(r.id),c=this.normalizeOptionalString(r.source);if(!s||!c||l.RESERVED_AC_AGGREGATE_IDS.has(s))return;let a=this.normalizeOptionalString(r.key)??`${s}||${c}`;i.set(a,{id:s,source:c,key:a});}),[...i.values()].sort((t,r)=>t.key.localeCompare(r.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(i=>{let t=e.get(i.id)??[];t.push(i.key),e.set(i.id,t);}),e}normalizeCardMode(e){let i=e&&typeof e=="object"?e:null,t=this.normalizeStringList(i?.metrics);return {displayMode:i?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["line1Voltage","line1Current","line1Frequency","line2Voltage"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let i=new Set;return e.forEach(t=>{if(typeof t!="string")return;let r=t.trim();r.length>0&&i.add(r);}),[...i].sort((t,r)=>t.localeCompare(r))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let i={};return Object.entries(e).forEach(([t])=>{let r=this.normalizeOptionalString(t);r&&(i[r]={});}),i}normalizeOptionalString(e){if(typeof e!="string")return null;let i=e.trim();return i.length>0?i:null}enqueuePathUpdate(e,i=false){let t=this.parsePath(e.path);if(!t)return;let r=e.update?.data?.value??null,s=e.update?.state??null;if(this.pendingPathUpdates.set(`${t.id}::${t.key}`,{id:t.id,key:t.key,value:r,state:s}),!i){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},l.PATH_BATCH_WINDOW_MS));}}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(r=>r.id)).forEach(r=>this.trackDiscoveredBus(r));let t=this.buildIdToDeviceKeysMap();this.busesByKey.update(r=>{let s=r,c=false;for(let a of e){let n=t.get(a.id),d=n?.length?n:[a.id];for(let o of d){let h=!!n?.length,v=h?this.trackedDevices().find(Z=>Z.key===o):null,T=s[o]??{id:a.id,source:v?.source??null,deviceKey:h?o:void 0},M=G({},T);this.applyValue(M,a.key,a.value,a.state)&&(c||(s=G({},s),c=true),s[o]=M);}}return c?s:r});}parsePath(e){if(!e.startsWith(l.ROOT_PREFIX))return null;let i=e.slice(l.ROOT_PREFIX.length),t=i.indexOf(".");return t<=0||t===i.length-1?null:{id:i.slice(0,t),key:i.slice(t+1)}}normalizeMetricKey(e){let i=e.match(/^phase\.([^.]+)\.(current|frequency|lineNeutralVoltage|realPower)$/);if(i){let t=this.resolveLineKey(i[1]);if(!t)return null;let r=i[2];return r==="current"?`${t}.current`:r==="frequency"?`${t}.frequency`:r==="lineNeutralVoltage"?`${t}.voltage`:`${t}.realPower`}return e==="total.realPower"?"power":e}resolveLineKey(e){let i=e.trim().toLowerCase();return ["0","1","l1","line1","phase1","a"].includes(i)?"line1":["2","l2","line2","phase2","b"].includes(i)?"line2":["3","l3","line3","phase3","c"].includes(i)?"line3":null}trackDiscoveredBus(e){let i=this.discoveredBusIds();i.includes(e)||this.discoveredBusIds.set([...i,e].sort((t,r)=>t.localeCompare(r)));}applyValue(e,i,t,r){let s=this.normalizeMetricKey(i);if(!s)return false;switch(s){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),r);case "voltage":return this.setMetricValue(e,"line1Voltage","line1VoltageState",this.toNumber(t,"V"),r);case "current":return this.setMetricValue(e,"line1Current","line1CurrentState",this.toNumber(t,"A"),r);case "frequency":return this.setMetricValue(e,"line1Frequency","line1FrequencyState",this.toNumber(t,"Hz"),r);case "line1.voltage":return this.setMetricValue(e,"line1Voltage","line1VoltageState",this.toNumber(t,"V"),r);case "line1.current":return this.setMetricValue(e,"line1Current","line1CurrentState",this.toNumber(t,"A"),r);case "line1.frequency":return this.setMetricValue(e,"line1Frequency","line1FrequencyState",this.toNumber(t,"Hz"),r);case "line1.realPower":return this.setMetricValue(e,"power","line1CurrentState",this.toNumber(t,"W"),r);case "line2.voltage":return this.setMetricValue(e,"line2Voltage","line2VoltageState",this.toNumber(t,"V"),r);case "line2.current":return this.setMetricValue(e,"line2Current","line2CurrentState",this.toNumber(t,"A"),r);case "line2.frequency":return this.setMetricValue(e,"line2Frequency","line2FrequencyState",this.toNumber(t,"Hz"),r);case "line2.realPower":return this.setMetricValue(e,"power","line2CurrentState",this.toNumber(t,"W"),r);case "line3.voltage":return this.setMetricValue(e,"line3Voltage","line3VoltageState",this.toNumber(t,"V"),r);case "line3.current":return this.setMetricValue(e,"line3Current","line3CurrentState",this.toNumber(t,"A"),r);case "line3.frequency":return this.setMetricValue(e,"line3Frequency","line3FrequencyState",this.toNumber(t,"Hz"),r);case "line3.realPower":return this.setMetricValue(e,"power","line3CurrentState",this.toNumber(t,"W"),r);case "power":return this.setMetricValue(e,"power","line1CurrentState",this.toNumber(t,"W"),r);default:return false}}setValue(e,i,t){return Object.is(e[i],t)?false:(e[i]=t,true)}setMetricValue(e,i,t,r,s){let c=!Object.is(e[i],r),a=!Object.is(e[t],s);return !c&&!a?false:(e[i]=r,e[t]=s,true)}requestRender(e){let i=this.widgetColors();!this.svg||!i||(this.pendingRenderSnapshot=e??{buses:this.visibleBuses(),displayModels:this.displayModels(),widgetColors:i},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e){if(!this.layer||!this.svg)return;let i=this.isCompactCardMode(),t=i?C:e$1,r=i?l.COMPACT_CARD_HEIGHT:l.CARD_HEIGHT,s=e.buses.map((o,h)=>({key:o.deviceKey??o.id,bus:o,y:h*(r+l.CARD_GAP)})),c=s.length?s[s.length-1].y+r:r;this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${c}`);let a=this.layer.selectAll("g.ac-card").data(s,o=>o.key),n=a.enter().append("g").attr("class","ac-card");n.append("rect").attr("class","ac-state-bar"),n.append("text").attr("class","ac-title"),n.append("text").attr("class","ac-id"),n.append("text").attr("class","ac-mode"),n.append("text").attr("class","ac-bus"),n.append("text").attr("class","ac-metrics-1"),n.append("text").attr("class","ac-metrics-2");let d=n.merge(a);d.attr("transform",o=>`translate(0, ${o.y})`),d.select("rect.ac-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",r-3).attr("fill",o=>e.displayModels[o.key]?.stateBarColor??e.widgetColors.dim),e.buses.length>1?d.select("text.ac-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",o=>e.displayModels[o.key]?.titleTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.titleText??this.resolveTitleText(o.bus)):d.select("text.ac-title").text(""),d.select("text.ac-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(o=>o.bus.id),d.select("text.ac-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>e.displayModels[o.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.modeText??""),d.select("text.ac-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>e.displayModels[o.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.busText??""),d.select("text.ac-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",o=>e.displayModels[o.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.metricsLineOne??""),d.select("text.ac-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",o=>e.displayModels[o.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.metricsLineTwo??""),a.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`AC ${e.id}`}resolveModeText(e){return e.mode?`Mode ${e.mode}`:"Mode -"}buildMetricRows(e){let i=this.cardMode(),t=(i.metrics.length?i.metrics:l.DEFAULT_CONFIG.ac?.cardMode?.metrics??[]).map(c=>this.toMetricLabel(c,e)).filter(c=>!!c);if(!t.length)return ["L1 - - -","L2 - - L3 - -"];let r=t.slice(0,2).join(" "),s=t.slice(2,4).join(" ");return [r||" ",s||" "]}toMetricLabel(e,i){switch(e){case "line1Voltage":return `L1V ${this.formatValue(i.line1Voltage,"V")}`;case "line1Current":return `L1A ${this.formatValue(i.line1Current,"A")}`;case "line1Frequency":return `L1Hz ${this.formatValue(i.line1Frequency,"Hz")}`;case "line2Voltage":return `L2V ${this.formatValue(i.line2Voltage,"V")}`;case "line2Current":return `L2A ${this.formatValue(i.line2Current,"A")}`;case "line2Frequency":return `L2Hz ${this.formatValue(i.line2Frequency,"Hz")}`;case "line3Voltage":return `L3V ${this.formatValue(i.line3Voltage,"V")}`;case "line3Current":return `L3A ${this.formatValue(i.line3Current,"A")}`;case "line3Frequency":return `L3Hz ${this.formatValue(i.line3Frequency,"Hz")}`;default:return null}}formatValue(e,i){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${i}`}toStringValue(e){return typeof e=="string"?e:null}resolveMostSevereState(...e){return e.some(i=>i===n$1.Alert)?n$1.Alert:e.some(i=>i===n$1.Alarm)?n$1.Alarm:e.some(i=>i===n$1.Warn)?n$1.Warn:e.some(i=>i===n$1.Normal)?n$1.Normal:null}toNumber(e,i){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let r=this.units.convertToUnit(i,t);return typeof r=="number"&&Number.isFinite(r)?r:null}static \u0275fac=function(i){return new(i||l)};static \u0275cmp=JD({type:l,selectors:[["widget-ac"]],viewQuery:function(i,t){i&1&&eg(t.svgRef,ie,5),i&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["acSvg",""],[3,"text","color"],["aria-hidden","false",1,"ac-svg"],[1,"ac-empty"],[1,"ac-empty-title"],[1,"ac-empty-sub"]],template:function(i,t){i&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,re,5,0,"div",3)),i&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasBuses()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.ac-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.ac-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.ac-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.ac-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Y as WidgetAcComponent};
1
+ import {C,e as e$1}from'./chunk-CyURmwWh.js';import {g as ge$1}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-BNR44HGB.js';import {c,e}from'./chunk-D_wrJJxl.js';var ie=["acSvg"];function re(l,e){l&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No AC buses detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K AC paths or select buses in widget settings."),ul()());}var Y=class l{static AC_DESCRIPTOR=a("widget-ac");static SELF_ROOT_PATH=(()=>{let e=l.AC_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetAcComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${l.SELF_ROOT_PATH}.*`;static ROOT_PREFIX=`${l.SELF_ROOT_PATH}.`;static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static RESERVED_AC_AGGREGATE_IDS=new Set(["totalCurrent","totalPower"]);static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,ac:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("acSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredBusIds=vt([]);trackedDevices=vt([]);optionsById=vt({});cardMode=vt({displayMode:"full",metrics:["line1Voltage","line1Current","line1Frequency","line2Voltage"]});busesByKey=vt({});visibleBusKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(r=>r.key);let i=this.busesByKey(),t=new Set(this.discoveredBusIds());return Object.keys(i).filter(r=>{let s=i[r];return !!s&&t.has(s.id)}).sort((r,s)=>r.localeCompare(s))});visibleBuses=Dt(()=>{let e=this.visibleBusKeys(),i=this.busesByKey();return e.map(t=>i[t]).filter(t=>!!t)});hasBuses=Dt(()=>this.visibleBuses().length>0);activeDisplayMode=Dt(()=>this.renderMode()??this.cardMode().displayMode??"full");isCompactCardMode=Dt(()=>this.activeDisplayMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleBuses();return e.length!==1?"AC Buses":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e$1=this.visibleBuses(),i=this.theme(),t=this.widgetColors(),r=this.ignoreZones(),s=new Map;e$1.forEach(n=>s.set(n.id,(s.get(n.id)??0)+1));let c=new Set([...s.entries()].filter(([,n])=>n>1).map(([n])=>n)),a={};for(let n of e$1){let d=n.deviceKey??n.id,o=!!n.source&&c.has(n.id),h=this.resolveMostSevereState(n.line1VoltageState??null,n.line1CurrentState??null,n.line2VoltageState??null,n.line2CurrentState??null,n.line3VoltageState??null,n.line3CurrentState??null,n.modeState??null),v=this.resolveMostSevereState(n.line1VoltageState??null,n.line1CurrentState??null,n.line1FrequencyState??null),T=this.resolveMostSevereState(n.line2VoltageState??null,n.line2CurrentState??null,n.line3VoltageState??null,n.line3CurrentState??null),[M,I]=this.buildMetricRows(n);a[d]={id:n.id,titleText:this.resolveTitleText(n),modeText:this.isCompactCardMode()?"":this.resolveModeText(n),busText:this.isCompactCardMode()?"":o?n.source??"-":n.associatedBus||n.location||"-",metricsLineOne:M,metricsLineTwo:I,stateBarColor:e(h,t?.dim??"var(--kip-contrast-color)",i,r),titleTextColor:e(h,"var(--kip-contrast-color)",i,r),metaTextColor:e(n.modeState??null,"var(--kip-contrast-dim-color)",i,r),primaryMetricsTextColor:e(v,"var(--kip-contrast-color)",i,r),secondaryMetricsTextColor:e(T,"var(--kip-contrast-color)",i,r)};}return a});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),r=this.visibleBuses(),s=this.widgetColors();!this.svg||!s||this.requestRender({buses:r,displayModels:t,widgetColors:s});});let e=[this.data.subscribePathTreeWithInitial(l.ROOT_PATTERN)],i=false;for(let t of e)if(t.initial.length){i=true;for(let r of t.initial)this.enqueuePathUpdate(r,true);}i&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(r=>this.enqueuePathUpdate(r));}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$1(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${l.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","AC View"),this.layer=this.svg.append("g").attr("class","ac-layer");}applyConfig(e){let i=this.resolveAcConfig(e);this.trackedDevices.set(i.trackedDevices??[]),this.reprojectSnapshotsToDeviceKeys(i.trackedDevices??[]),this.optionsById.set(i.optionsById),this.cardMode.set(this.normalizeCardMode(i.cardMode));}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let i=new Map;e.forEach(t=>{let r=i.get(t.id)??[];r.push(t.key),i.set(t.id,r);}),this.busesByKey.update(t=>{let r=t,s=false;return i.forEach((c,a)=>{let n=t[a];if(n){for(let d of c){if(t[d])continue;let o=e.find(h=>h.key===d);s||(r=G({},t),s=true),r[d]=z(G({},n),{source:o?.source??null,deviceKey:d});}s&&r[a]?.deviceKey===void 0&&delete r[a];}}),s?r:t});}resolveAcConfig(e){let i=e.ac;return {trackedDevices:this.normalizeAcTrackedDevices(i?.trackedDevices),optionsById:this.normalizeOptionsById(i?.optionsById),cardMode:this.normalizeCardMode(i?.cardMode)}}normalizeAcTrackedDevices(e){if(!Array.isArray(e))return [];let i=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let r=t,s=this.normalizeOptionalString(r.id),c=this.normalizeOptionalString(r.source);if(!s||!c||l.RESERVED_AC_AGGREGATE_IDS.has(s))return;let a=this.normalizeOptionalString(r.key)??`${s}||${c}`;i.set(a,{id:s,source:c,key:a});}),[...i.values()].sort((t,r)=>t.key.localeCompare(r.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(i=>{let t=e.get(i.id)??[];t.push(i.key),e.set(i.id,t);}),e}normalizeCardMode(e){let i=e&&typeof e=="object"?e:null,t=this.normalizeStringList(i?.metrics);return {displayMode:i?.displayMode==="compact"?"compact":"full",metrics:t.length?t:["line1Voltage","line1Current","line1Frequency","line2Voltage"]}}normalizeStringList(e){if(!Array.isArray(e))return [];let i=new Set;return e.forEach(t=>{if(typeof t!="string")return;let r=t.trim();r.length>0&&i.add(r);}),[...i].sort((t,r)=>t.localeCompare(r))}normalizeOptionsById(e){if(!e||typeof e!="object")return {};let i={};return Object.entries(e).forEach(([t])=>{let r=this.normalizeOptionalString(t);r&&(i[r]={});}),i}normalizeOptionalString(e){if(typeof e!="string")return null;let i=e.trim();return i.length>0?i:null}enqueuePathUpdate(e,i=false){let t=this.parsePath(e.path);if(!t)return;let r=e.update?.data?.value??null,s=e.update?.state??null;if(this.pendingPathUpdates.set(`${t.id}::${t.key}`,{id:t.id,key:t.key,value:r,state:s}),!i){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},l.PATH_BATCH_WINDOW_MS));}}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(r=>r.id)).forEach(r=>this.trackDiscoveredBus(r));let t=this.buildIdToDeviceKeysMap();this.busesByKey.update(r=>{let s=r,c=false;for(let a of e){let n=t.get(a.id),d=n?.length?n:[a.id];for(let o of d){let h=!!n?.length,v=h?this.trackedDevices().find(Z=>Z.key===o):null,T=s[o]??{id:a.id,source:v?.source??null,deviceKey:h?o:void 0},M=G({},T);this.applyValue(M,a.key,a.value,a.state)&&(c||(s=G({},s),c=true),s[o]=M);}}return c?s:r});}parsePath(e){if(!e.startsWith(l.ROOT_PREFIX))return null;let i=e.slice(l.ROOT_PREFIX.length),t=i.indexOf(".");return t<=0||t===i.length-1?null:{id:i.slice(0,t),key:i.slice(t+1)}}normalizeMetricKey(e){let i=e.match(/^phase\.([^.]+)\.(current|frequency|lineNeutralVoltage|realPower)$/);if(i){let t=this.resolveLineKey(i[1]);if(!t)return null;let r=i[2];return r==="current"?`${t}.current`:r==="frequency"?`${t}.frequency`:r==="lineNeutralVoltage"?`${t}.voltage`:`${t}.realPower`}return e==="total.realPower"?"power":e}resolveLineKey(e){let i=e.trim().toLowerCase();return ["0","1","l1","line1","phase1","a"].includes(i)?"line1":["2","l2","line2","phase2","b"].includes(i)?"line2":["3","l3","line3","phase3","c"].includes(i)?"line3":null}trackDiscoveredBus(e){let i=this.discoveredBusIds();i.includes(e)||this.discoveredBusIds.set([...i,e].sort((t,r)=>t.localeCompare(r)));}applyValue(e,i,t,r){let s=this.normalizeMetricKey(i);if(!s)return false;switch(s){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),r);case "voltage":return this.setMetricValue(e,"line1Voltage","line1VoltageState",this.toNumber(t,"V"),r);case "current":return this.setMetricValue(e,"line1Current","line1CurrentState",this.toNumber(t,"A"),r);case "frequency":return this.setMetricValue(e,"line1Frequency","line1FrequencyState",this.toNumber(t,"Hz"),r);case "line1.voltage":return this.setMetricValue(e,"line1Voltage","line1VoltageState",this.toNumber(t,"V"),r);case "line1.current":return this.setMetricValue(e,"line1Current","line1CurrentState",this.toNumber(t,"A"),r);case "line1.frequency":return this.setMetricValue(e,"line1Frequency","line1FrequencyState",this.toNumber(t,"Hz"),r);case "line1.realPower":return this.setMetricValue(e,"power","line1CurrentState",this.toNumber(t,"W"),r);case "line2.voltage":return this.setMetricValue(e,"line2Voltage","line2VoltageState",this.toNumber(t,"V"),r);case "line2.current":return this.setMetricValue(e,"line2Current","line2CurrentState",this.toNumber(t,"A"),r);case "line2.frequency":return this.setMetricValue(e,"line2Frequency","line2FrequencyState",this.toNumber(t,"Hz"),r);case "line2.realPower":return this.setMetricValue(e,"power","line2CurrentState",this.toNumber(t,"W"),r);case "line3.voltage":return this.setMetricValue(e,"line3Voltage","line3VoltageState",this.toNumber(t,"V"),r);case "line3.current":return this.setMetricValue(e,"line3Current","line3CurrentState",this.toNumber(t,"A"),r);case "line3.frequency":return this.setMetricValue(e,"line3Frequency","line3FrequencyState",this.toNumber(t,"Hz"),r);case "line3.realPower":return this.setMetricValue(e,"power","line3CurrentState",this.toNumber(t,"W"),r);case "power":return this.setMetricValue(e,"power","line1CurrentState",this.toNumber(t,"W"),r);default:return false}}setValue(e,i,t){return Object.is(e[i],t)?false:(e[i]=t,true)}setMetricValue(e,i,t,r,s){let c=!Object.is(e[i],r),a=!Object.is(e[t],s);return !c&&!a?false:(e[i]=r,e[t]=s,true)}requestRender(e){let i=this.widgetColors();!this.svg||!i||(this.pendingRenderSnapshot=e??{buses:this.visibleBuses(),displayModels:this.displayModels(),widgetColors:i},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e){if(!this.layer||!this.svg)return;let i=this.isCompactCardMode(),t=i?C:e$1,r=i?l.COMPACT_CARD_HEIGHT:l.CARD_HEIGHT,s=e.buses.map((o,h)=>({key:o.deviceKey??o.id,bus:o,y:h*(r+l.CARD_GAP)})),c=s.length?s[s.length-1].y+r:r;this.svg.attr("viewBox",`0 0 ${l.VIEWBOX_WIDTH} ${c}`);let a=this.layer.selectAll("g.ac-card").data(s,o=>o.key),n=a.enter().append("g").attr("class","ac-card");n.append("rect").attr("class","ac-state-bar"),n.append("text").attr("class","ac-title"),n.append("text").attr("class","ac-id"),n.append("text").attr("class","ac-mode"),n.append("text").attr("class","ac-bus"),n.append("text").attr("class","ac-metrics-1"),n.append("text").attr("class","ac-metrics-2");let d=n.merge(a);d.attr("transform",o=>`translate(0, ${o.y})`),d.select("rect.ac-state-bar").attr("x",1.5).attr("y",1.5).attr("rx",t.stateBarCornerRadius).attr("ry",t.stateBarCornerRadius).attr("width",3).attr("height",r-3).attr("fill",o=>e.displayModels[o.key]?.stateBarColor??e.widgetColors.dim),e.buses.length>1?d.select("text.ac-title").attr("x",t.titleX).attr("y",t.titleY).attr("font-size",t.titleFontSize).attr("fill",o=>e.displayModels[o.key]?.titleTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.titleText??this.resolveTitleText(o.bus)):d.select("text.ac-title").text(""),d.select("text.ac-id").attr("x",t.idX).attr("y",t.idY).attr("text-anchor","end").attr("font-size",t.idFontSize).attr("fill","var(--kip-contrast-dim-color)").text(o=>o.bus.id),d.select("text.ac-mode").attr("x",t.metaLeftX).attr("y",t.metaY).attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>e.displayModels[o.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.modeText??""),d.select("text.ac-bus").attr("x",t.metaRightX).attr("y",t.metaY).attr("text-anchor","end").attr("font-size",t.metaFontSize).attr("opacity",.8).attr("fill",o=>e.displayModels[o.key]?.metaTextColor??"var(--kip-contrast-dim-color)").text(o=>e.displayModels[o.key]?.busText??""),d.select("text.ac-metrics-1").attr("x",t.lineOneX).attr("y",t.lineOneY).attr("font-size",t.lineOneFontSize).attr("fill",o=>e.displayModels[o.key]?.primaryMetricsTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.metricsLineOne??""),d.select("text.ac-metrics-2").attr("x",t.lineTwoX).attr("y",t.lineTwoY).attr("font-size",t.lineTwoFontSize).attr("opacity",.85).attr("fill",o=>e.displayModels[o.key]?.secondaryMetricsTextColor??"var(--kip-contrast-color)").text(o=>e.displayModels[o.key]?.metricsLineTwo??""),a.exit().remove();}displayName(e){return e.name?.trim()||e.id}resolveTitleText(e){return e.name||`AC ${e.id}`}resolveModeText(e){return e.mode?`Mode ${e.mode}`:"Mode -"}buildMetricRows(e){let i=this.cardMode(),t=(i.metrics.length?i.metrics:l.DEFAULT_CONFIG.ac?.cardMode?.metrics??[]).map(c=>this.toMetricLabel(c,e)).filter(c=>!!c);if(!t.length)return ["L1 - - -","L2 - - L3 - -"];let r=t.slice(0,2).join(" "),s=t.slice(2,4).join(" ");return [r||" ",s||" "]}toMetricLabel(e,i){switch(e){case "line1Voltage":return `L1V ${this.formatValue(i.line1Voltage,"V")}`;case "line1Current":return `L1A ${this.formatValue(i.line1Current,"A")}`;case "line1Frequency":return `L1Hz ${this.formatValue(i.line1Frequency,"Hz")}`;case "line2Voltage":return `L2V ${this.formatValue(i.line2Voltage,"V")}`;case "line2Current":return `L2A ${this.formatValue(i.line2Current,"A")}`;case "line2Frequency":return `L2Hz ${this.formatValue(i.line2Frequency,"Hz")}`;case "line3Voltage":return `L3V ${this.formatValue(i.line3Voltage,"V")}`;case "line3Current":return `L3A ${this.formatValue(i.line3Current,"A")}`;case "line3Frequency":return `L3Hz ${this.formatValue(i.line3Frequency,"Hz")}`;default:return null}}formatValue(e,i){return e==null||Number.isNaN(e)?"-":`${e.toFixed(1)} ${i}`}toStringValue(e){return typeof e=="string"?e:null}resolveMostSevereState(...e){return e.some(i=>i===n$1.Alert)?n$1.Alert:e.some(i=>i===n$1.Alarm)?n$1.Alarm:e.some(i=>i===n$1.Warn)?n$1.Warn:e.some(i=>i===n$1.Normal)?n$1.Normal:null}toNumber(e,i){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let r=this.units.convertToUnit(i,t);return typeof r=="number"&&Number.isFinite(r)?r:null}static \u0275fac=function(i){return new(i||l)};static \u0275cmp=JD({type:l,selectors:[["widget-ac"]],viewQuery:function(i,t){i&1&&eg(t.svgRef,ie,5),i&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["acSvg",""],[3,"text","color"],["aria-hidden","false",1,"ac-svg"],[1,"ac-empty"],[1,"ac-empty-title"],[1,"ac-empty-sub"]],template:function(i,t){i&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,re,5,0,"div",3)),i&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasBuses()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.ac-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.ac-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.ac-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.ac-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{Y as WidgetAcComponent};
@@ -1 +1 @@
1
- import'./chunk-By8ZVvDx.js';import {d1 as Hj,w,du as p,dy as K,ao as ue,aZ as F,bu as ut,dw as S,$ as $j,a6 as Lr,D as Dt,F as Fa,dn as ge,b0 as Wl,J as JD,_ as _w,M as Mw,f as eg,K as Kw,cp as Uh,ci as dl,T as TT,cj as fl}from'./main-BAV5VDOD.js';var _=["widgetDataChart"];function E(m,t){m&1&&Uh(0,"canvas",1,0);}function I(m,t){m&1&&(dl(0,"div",2)(1,"p"),TT(2,"Ready to configure"),fl(),dl(3,"p",3),TT(4,"Double-tap to begin"),fl()());}var U=class m{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);dsService=w(K);ngZone=w(ue);canvasService=w(F);unitsService=w(ut);datasetLifecycle=w(S);widgetDataChart=$j("widgetDataChart",{read:Lr});static DEFAULT_CONFIG={displayName:"Chart Label",color:"contrast",filterSelfPaths:true,datachartPath:null,datachartSource:null,convertUnitTo:null,timeScale:"minute",period:10,numDecimal:1,inverseYAxis:false,datasetAverageArray:"sma",showDataPoints:false,showAverageData:true,trackAgainstAverage:false,showDatasetMinimumValueLine:false,showDatasetMaximumValueLine:false,showDatasetAverageValueLine:true,showDatasetAngleAverageValueLine:false,showLabel:true,showTimeScale:false,startScaleAtZero:false,verticalChart:false,showYScale:false,yScaleSuggestedMin:void 0,yScaleSuggestedMax:void 0,enableMinMaxScaleLimit:false,yScaleMin:void 0,yScaleMax:void 0};lineChartData={datasets:[]};lineChartOptions={parsing:false,datasets:{line:{pointRadius:0,pointHoverRadius:0,tension:.4}},animations:{tension:{easing:"easeInOutCubic"}}};lineChartType="line";chart=null;dsServiceSub=null;datasetConfig=null;dataSourceInfo=null;lastVerticalChart=null;lastAverageValue=null;lastMinimumValue=null;lastMaximumValue=null;hasPath=Dt(()=>!!this.runtime.options()?.datachartPath);pathSignature=Dt(()=>{let t=this.runtime.options();if(t?.datachartPath)return [t.datachartPath,t.convertUnitTo,t.datachartSource,t.timeScale,t.period].join("|")});previousPathSignature=void 0;constructor(){Fa(()=>{let t=this.pathSignature();ge(()=>{t!==this.previousPathSignature&&ge(()=>{this.previousPathSignature=t;let e=this.runtime.options();e&&this.rebuildForDataset(e);});});}),Fa(()=>{let t=this.runtime.options(),e=this.theme();!t||!e||ge(()=>{this.lastVerticalChart!==null&&this.lastVerticalChart!==t.verticalChart?(this.lastVerticalChart=t.verticalChart??false,this.rebuildForDataset(t)):this.chart&&(this.ensureAverageDatasetPresence(),this.updateAnnotationVisibility(),this.applyDynamicTrackAverageStyling(),this.setChartOptions(t),this.setDatasetsColors(),this.ngZone.runOutsideAngular(()=>this.chart?.update("none")));});}),Fa(()=>{let t=this.runtime.options(),e=this.widgetDataChart(),a=this.hasPath();!t||!a||!e||this.chart||ge(()=>this.rebuildForDataset(t));});}rebuildForDataset(t){if(!t.datachartPath||!this.widgetDataChart()||(this.dsServiceSub?.unsubscribe(),this.lineChartData.datasets=[],this.datasetLifecycle.syncDataChartDataset(this.id(),t,this.pathSignature()),this.datasetConfig=this.dsService.getDatasetConfig(this.id())??null,this.dataSourceInfo=this.dsService.getDataSourceInfo(this.id())??null,!this.datasetConfig))return;this.createDatasets(t),this.setChartOptions(t),this.chart?.destroy();let a=this.widgetDataChart()?.nativeElement?.getContext("2d");a&&(this.chart=new Wl(a,{type:this.lineChartType,data:this.lineChartData,options:this.lineChartOptions}),this.startStreaming(),this.ngZone.runOutsideAngular(()=>this.chart?.update()));}setChartOptions(t){let e=this.datasetConfig;e&&(this.lineChartOptions.maintainAspectRatio=false,this.lineChartOptions.animation=false,this.lineChartOptions.indexAxis=t.verticalChart?"y":"x",t.verticalChart?this.lineChartOptions.scales={y:{type:"realtime",display:t.showTimeScale,position:t.verticalChart?"right":"left",suggestedMin:void 0,suggestedMax:void 0,title:{display:true,text:`Last ${e.period} ${e.timeScaleFormat}`,align:"center",color:this.getThemeColors().averageChartLine},time:{unit:e.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:true,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}},x:{type:"linear",display:t.showYScale,position:t.verticalChart?"top":"bottom",suggestedMin:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMin,suggestedMax:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMax,min:t.enableMinMaxScaleLimit?t.yScaleMin:void 0,max:t.enableMinMaxScaleLimit?t.yScaleMax:void 0,beginAtZero:t.startScaleAtZero,reverse:t.inverseYAxis,title:{display:false,text:"Value Axis",align:"center",color:this.getThemeColors().averageChartLine},ticks:{maxTicksLimit:8,precision:t.numDecimal,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}}}:this.lineChartOptions.scales={x:{type:"realtime",display:t.showTimeScale,title:{display:true,text:`Last ${e.period} ${e.timeScaleFormat}`,align:"center",color:this.getThemeColors().averageChartLine},time:{unit:e.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:true,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}},y:{display:t.showYScale,position:"right",suggestedMin:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMin,suggestedMax:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMax,min:t.enableMinMaxScaleLimit?t.yScaleMin:void 0,max:t.enableMinMaxScaleLimit?t.yScaleMax:void 0,beginAtZero:t.startScaleAtZero,reverse:t.inverseYAxis,title:{display:false,text:"Value Axis",align:"center",color:this.getThemeColors().averageChartLine},ticks:{maxTicksLimit:8,precision:t.numDecimal,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}}},this.lineChartOptions.plugins={title:{display:true,align:"end",padding:{top:3,bottom:0},text:"",font:{size:32},color:this.getThemeColors().chartValue},subtitle:{display:t.showLabel,align:"start",padding:{top:-35,bottom:20},text:` ${t.displayName}`,font:{size:22},color:this.getThemeColors().chartLabel},annotation:{annotations:{minimumLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null,value:this.lastMinimumValue??0,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null,content:this.lastMinimumValue!==null?`${this.lastMinimumValue.toFixed(t.numDecimal??1)}`:"",position:"start",yAdjust:12,padding:4,color:this.getThemeColors().averageChartLine,backgroundColor:"rgba(63,63,63,0.0)"}},maximumLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null,value:this.lastMaximumValue??0,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null,content:this.lastMaximumValue!==null?`${this.lastMaximumValue.toFixed(t.numDecimal??1)}`:"",position:"start",yAdjust:-12,padding:4,color:this.getThemeColors().averageChartLine,backgroundColor:"rgba(63,63,63,0.0)"}},averageLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetAverageValueLine&&this.lastAverageValue!==null,value:this.lastAverageValue??0,borderDash:[6,6],borderColor:this.getThemeColors().averageChartLine,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetAverageValueLine&&this.lastAverageValue!==null,content:this.lastAverageValue!==null?`${this.lastAverageValue.toFixed(t.numDecimal??1)}`:"",position:"start",padding:4,color:this.getThemeColors().chartValue,backgroundColor:"rgba(63,63,63,0.7)"}}}},legend:{display:false},streaming:{duration:(this.dataSourceInfo?.maxDataPoints??0)*(this.dataSourceInfo?.sampleTime??0),delay:this.dataSourceInfo?.sampleTime??0,frameRate:e.timeScaleFormat==="day"?5:e.timeScaleFormat==="hour"?8:e.timeScaleFormat==="minute"?15:30}});}createDatasets(t){let e,a;t.inverseYAxis&&t.trackAgainstAverage?(e="start",a=false):t.inverseYAxis&&!t.trackAgainstAverage?(e=false,a="start"):!t.inverseYAxis&&t.trackAgainstAverage?(e=true,a=false):(e=false,a=true),this.lineChartData.datasets=[],this.lineChartData.datasets.push({label:"Value",data:[],order:t.trackAgainstAverage?1:0,parsing:false,tension:0,pointRadius:t.showDataPoints?t.trackAgainstAverage?0:1.5:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage||t.showDataPoints?0:3,fill:e}),t.showAverageData&&this.lineChartData.datasets.push({label:"Average",data:[],order:t.trackAgainstAverage?0:1,parsing:false,tension:.4,pointRadius:t.showDataPoints&&t.trackAgainstAverage?1.5:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage?t.showDataPoints?0:3:0,fill:a}),this.setDatasetsColors();}setDatasetsColors(){this.lineChartData.datasets.forEach(t=>{t.label==="Value"?(t.borderColor=this.getThemeColors().valueLine,t.backgroundColor=this.getThemeColors().valueFill):t.label==="Average"&&(t.borderColor=this.getThemeColors().averageLine,t.backgroundColor=this.getThemeColors().averageFill);});}ensureAverageDatasetPresence(){let t=this.runtime.options();if(!t||!this.chart)return;let e=this.lineChartData.datasets.some(a=>a.label==="Average");if(t.showAverageData&&!e){if(this.lineChartData.datasets.findIndex(n=>n.label==="Value")>=0){let n=t.inverseYAxis?t.trackAgainstAverage?false:"start":!t.trackAgainstAverage;this.lineChartData.datasets.push({label:"Average",data:[],order:t.trackAgainstAverage?0:1,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage?3:0,fill:n});}}else !t.showAverageData&&e&&(this.lineChartData.datasets=this.lineChartData.datasets.filter(a=>a.label!=="Average"));}applyDynamicTrackAverageStyling(){let t=this.runtime.options();if(!t)return;let e=this.lineChartData.datasets.find(l=>l.label==="Value"),a=this.lineChartData.datasets.find(l=>l.label==="Average"),n,r;t.inverseYAxis&&t.trackAgainstAverage?(n="start",r=false):t.inverseYAxis&&!t.trackAgainstAverage?(n=false,r="start"):!t.inverseYAxis&&t.trackAgainstAverage?(n=true,r=false):(n=false,r=true),e&&(e.order=t.trackAgainstAverage?1:0,e.borderWidth=t.trackAgainstAverage?0:3,e.fill=n),a&&(a.order=t.trackAgainstAverage?0:1,a.borderWidth=t.trackAgainstAverage?3:0,a.fill=r);}updateAnnotationVisibility(){let t=this.runtime.options();if(!t||!this.chart)return;let e=this.chart.options.plugins.annotation?.annotations;if(e){if(e.minimumLine){let a=t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null;e.minimumLine.display=a,e.minimumLine.label&&(e.minimumLine.label.display=a);}if(e.maximumLine){let a=t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null;e.maximumLine.display=a,e.maximumLine.label&&(e.maximumLine.label.display=a);}if(e.averageLine){let a=t.showDatasetAverageValueLine&&this.lastAverageValue!==null;e.averageLine.display=a,e.averageLine.label&&(e.averageLine.label.display=a);}}}getThemeColors(){let t=this.runtime.options()?.color,e={valueLine:"",valueFill:"",averageLine:"",averageFill:"",averageChartLine:"",chartLabel:"",chartValue:""};switch(t){case "contrast":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().contrastDimmer,e.valueFill=this.theme().contrastDimmer,e.averageLine=this.theme().contrast,e.averageFill=this.theme().contrast,e.chartValue=e.averageLine):(e.valueLine=this.theme().contrast,e.valueFill=this.theme().contrast,e.averageLine=this.theme().contrastDimmer,e.averageFill=this.theme().contrastDimmer,e.chartValue=this.theme().contrast),e.averageChartLine=this.theme().contrastDim,e.chartLabel=this.theme().contrastDim;break;case "blue":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().blueDimmer,e.valueFill=this.theme().blueDimmer,e.averageLine=this.theme().blue,e.averageFill=this.theme().blue,e.chartValue=e.averageLine):(e.valueLine=this.theme().blue,e.valueFill=this.theme().blue,e.averageLine=this.theme().blueDimmer,e.averageFill=this.theme().blueDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().blueDim,e.chartLabel=this.theme().contrastDim;break;case "green":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().greenDimmer,e.valueFill=this.theme().greenDimmer,e.averageLine=this.theme().green,e.averageFill=this.theme().green,e.chartValue=e.averageLine):(e.valueLine=this.theme().green,e.valueFill=this.theme().green,e.averageLine=this.theme().greenDimmer,e.averageFill=this.theme().greenDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greenDim,e.chartLabel=this.theme().contrastDim;break;case "pink":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().pinkDimmer,e.valueFill=this.theme().pinkDimmer,e.averageLine=this.theme().pink,e.averageFill=this.theme().pink,e.chartValue=e.averageLine):(e.valueLine=this.theme().pink,e.valueFill=this.theme().pink,e.averageLine=this.theme().pinkDimmer,e.averageFill=this.theme().pinkDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().pinkDim,e.chartLabel=this.theme().contrastDim;break;case "orange":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().orangeDimmer,e.valueFill=this.theme().orangeDimmer,e.averageLine=this.theme().orange,e.averageFill=this.theme().orange,e.chartValue=e.averageLine):(e.valueLine=this.theme().orange,e.valueFill=this.theme().orange,e.averageLine=this.theme().orangeDimmer,e.averageFill=this.theme().orangeDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().orangeDim,e.chartLabel=this.theme().contrastDim;break;case "purple":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().purpleDimmer,e.valueFill=this.theme().purpleDimmer,e.averageLine=this.theme().purple,e.averageFill=this.theme().purple,e.chartValue=e.averageLine):(e.valueLine=this.theme().purple,e.valueFill=this.theme().purple,e.averageLine=this.theme().purpleDimmer,e.averageFill=this.theme().purpleDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().purpleDim,e.chartLabel=this.theme().contrastDim;break;case "grey":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().greyDimmer,e.valueFill=this.theme().greyDimmer,e.averageLine=this.theme().grey,e.averageFill=this.theme().grey,e.chartValue=e.averageLine):(e.valueLine=this.theme().grey,e.valueFill=this.theme().grey,e.averageLine=this.theme().greyDimmer,e.averageFill=this.theme().greyDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greyDim,e.chartLabel=this.theme().contrastDim;break;case "yellow":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().yellowDimmer,e.valueFill=this.theme().yellowDimmer,e.averageLine=this.theme().yellow,e.averageFill=this.theme().yellow,e.chartValue=e.averageLine):(e.valueLine=this.theme().yellow,e.valueFill=this.theme().yellow,e.averageLine=this.theme().yellowDimmer,e.averageFill=this.theme().yellowDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().yellowDim,e.chartLabel=this.theme().contrastDim;break}return e}getUnitsLabel(){let t="",e=this.runtime.options()?.convertUnitTo??"";switch(e){case "percent":case "percentraw":t="%";break;case "latitudeMin":t="latitude in minutes";break;case "latitudeSec":t="latitude in secondes";break;case "longitudeMin":t="longitude in minutes";break;case "longitudeSec":t="longitude in secondes";break;default:t=e;break}return t}startStreaming(){let t=this.runtime.options();if(!t?.datachartPath)return;this.dsServiceSub?.unsubscribe();let e=this.dsService.getDatasetBatchThenLiveObservable(this.id());e&&(this.dsServiceSub=e.subscribe(a=>{if(this.chart){if(Array.isArray(a)){let n=this.transformDatasetRows(a,0);if(this.chart.data.datasets[0].data.push(...n),t.showAverageData&&this.lineChartData.datasets[1]){let l=t.datasetAverageArray??"sma",s=this.transformDatasetRows(a,l);this.chart.data.datasets[1].data.push(...s);}let r=a[a.length-1];r&&this.applyTitleAndAnnotationValues(r,t);}else {let n=this.transformDatasetRows([a],0)[0];if(this.chart.data.datasets[0].data.push(n),t.showAverageData&&this.lineChartData.datasets[1]){let r=t.datasetAverageArray??"sma",l=this.transformDatasetRows([a],r)[0];this.chart.data.datasets[1].data.push(l);}this.applyTitleAndAnnotationValues(a,t);}this.ngZone.runOutsideAngular(()=>this.chart?.update("none"));}}));}applyTitleAndAnnotationValues(t,e){if(!this.chart)return;let a=e.convertUnitTo??"",n=e.numDecimal??1,r=e.trackAgainstAverage?t.data.sma??t.data.value:t.data.value,l=this.unitsService.convertToUnit(a,r);if(l!=null&&Number.isFinite(l)){let y=this.chart.options.plugins;y?.title&&(y.title.text=`${l.toFixed(n)} ${this.getUnitsLabel()} `);}let s=t.data.lastAverage!=null?this.unitsService.convertToUnit(a,t.data.lastAverage)??void 0:void 0,h=t.data.lastMinimum!=null?this.unitsService.convertToUnit(a,t.data.lastMinimum)??void 0:void 0,g=t.data.lastMaximum!=null?this.unitsService.convertToUnit(a,t.data.lastMaximum)??void 0:void 0,i=this.chart.options.plugins.annotation?.annotations;i&&(this.lastAverageValue=s!=null&&Number.isFinite(s)?s:null,this.lastMinimumValue=h!=null&&Number.isFinite(h)?h:null,this.lastMaximumValue=g!=null&&Number.isFinite(g)?g:null,i.averageLine&&(this.lastAverageValue!==null?(i.averageLine.value=this.lastAverageValue,i.averageLine.display=e.showDatasetAverageValueLine,i.averageLine.label&&(i.averageLine.label.display=e.showDatasetAverageValueLine,i.averageLine.label.content=`${this.lastAverageValue.toFixed(n)}`)):(i.averageLine.display=false,i.averageLine.label&&(i.averageLine.label.display=false,i.averageLine.label.content=""))),i.minimumLine&&(this.lastMinimumValue!==null?(i.minimumLine.value=this.lastMinimumValue,i.minimumLine.display=e.showDatasetMinimumValueLine,i.minimumLine.label&&(i.minimumLine.label.display=e.showDatasetMinimumValueLine,i.minimumLine.label.content=`${this.lastMinimumValue.toFixed(n)}`)):(i.minimumLine.display=false,i.minimumLine.label&&(i.minimumLine.label.display=false,i.minimumLine.label.content=""))),i.maximumLine&&(this.lastMaximumValue!==null?(i.maximumLine.value=this.lastMaximumValue,i.maximumLine.display=e.showDatasetMaximumValueLine,i.maximumLine.label&&(i.maximumLine.label.display=e.showDatasetMaximumValueLine,i.maximumLine.label.content=`${this.lastMaximumValue.toFixed(n)}`)):(i.maximumLine.display=false,i.maximumLine.label&&(i.maximumLine.label.display=false,i.maximumLine.label.content=""))));}transformDatasetRows(t,e){let a=this.runtime.options();if(!a)return [];let n=s=>this.unitsService.convertToUnit(a.convertUnitTo??"",s)??s,r=a.verticalChart===true,l=a.datasetAverageArray;return t.map(s=>{if(r){if(e===0)return {x:n(s.data.value),y:s.timestamp};{let h={sma:s.data.sma,ema:s.data.ema,dema:s.data.doubleEma,avg:s.data.lastAverage};return {x:n(h[l]??s.data.value),y:s.timestamp}}}else {if(e===0)return {x:s.timestamp,y:n(s.data.value)};{let h={sma:s.data.sma,ema:s.data.ema,dema:s.data.doubleEma,avg:s.data.lastAverage};return {x:s.timestamp,y:n(h[l]??s.data.value)}}}})}ngOnDestroy(){this.dsServiceSub?.unsubscribe(),this.chart?.destroy();let t=this.widgetDataChart?.()?.nativeElement;this.canvasService.releaseCanvas(t,{clear:true,removeFromDom:true});}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["widget-data-chart"]],viewQuery:function(e,a){e&1&&eg(a.widgetDataChart,_,5,Lr),e&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:2,vars:1,consts:[["widgetDataChart",""],[2,"z-index","inherit"],[1,"empty-state"],[1,"hint"]],template:function(e,a){e&1&&_w(0,E,2,0,"canvas",1)(1,I,5,0,"div",2),e&2&&Mw(a.hasPath()?0:1);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;width:100%;text-align:center;color:var(--mat-sys-on-surface-variant)}.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0;padding:0 16px}.empty-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:.85em;opacity:.7}"]})};export{U as WidgetDataChartComponent};
1
+ import'./chunk-h2q_pbbF.js';import {d1 as Hj,w,du as p,dy as K,ao as ue,aZ as R,bu as ut,dw as S,$ as $j,a6 as Lr,D as Dt,F as Fa,dn as ge,b0 as Wl,J as JD,_ as _w,M as Mw,f as eg,K as Kw,cp as Uh,ci as dl,T as TT,cj as fl}from'./main-BNR44HGB.js';var _=["widgetDataChart"];function E(m,t){m&1&&Uh(0,"canvas",1,0);}function I(m,t){m&1&&(dl(0,"div",2)(1,"p"),TT(2,"Ready to configure"),fl(),dl(3,"p",3),TT(4,"Double-tap to begin"),fl()());}var U=class m{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);dsService=w(K);ngZone=w(ue);canvasService=w(R);unitsService=w(ut);datasetLifecycle=w(S);widgetDataChart=$j("widgetDataChart",{read:Lr});static DEFAULT_CONFIG={displayName:"Chart Label",color:"contrast",filterSelfPaths:true,datachartPath:null,datachartSource:null,convertUnitTo:null,timeScale:"minute",period:10,numDecimal:1,inverseYAxis:false,datasetAverageArray:"sma",showDataPoints:false,showAverageData:true,trackAgainstAverage:false,showDatasetMinimumValueLine:false,showDatasetMaximumValueLine:false,showDatasetAverageValueLine:true,showDatasetAngleAverageValueLine:false,showLabel:true,showTimeScale:false,startScaleAtZero:false,verticalChart:false,showYScale:false,yScaleSuggestedMin:void 0,yScaleSuggestedMax:void 0,enableMinMaxScaleLimit:false,yScaleMin:void 0,yScaleMax:void 0};lineChartData={datasets:[]};lineChartOptions={parsing:false,datasets:{line:{pointRadius:0,pointHoverRadius:0,tension:.4}},animations:{tension:{easing:"easeInOutCubic"}}};lineChartType="line";chart=null;dsServiceSub=null;datasetConfig=null;dataSourceInfo=null;lastVerticalChart=null;lastAverageValue=null;lastMinimumValue=null;lastMaximumValue=null;hasPath=Dt(()=>!!this.runtime.options()?.datachartPath);pathSignature=Dt(()=>{let t=this.runtime.options();if(t?.datachartPath)return [t.datachartPath,t.convertUnitTo,t.datachartSource,t.timeScale,t.period].join("|")});previousPathSignature=void 0;constructor(){Fa(()=>{let t=this.pathSignature();ge(()=>{t!==this.previousPathSignature&&ge(()=>{this.previousPathSignature=t;let e=this.runtime.options();e&&this.rebuildForDataset(e);});});}),Fa(()=>{let t=this.runtime.options(),e=this.theme();!t||!e||ge(()=>{this.lastVerticalChart!==null&&this.lastVerticalChart!==t.verticalChart?(this.lastVerticalChart=t.verticalChart??false,this.rebuildForDataset(t)):this.chart&&(this.ensureAverageDatasetPresence(),this.updateAnnotationVisibility(),this.applyDynamicTrackAverageStyling(),this.setChartOptions(t),this.setDatasetsColors(),this.ngZone.runOutsideAngular(()=>this.chart?.update("none")));});}),Fa(()=>{let t=this.runtime.options(),e=this.widgetDataChart(),a=this.hasPath();!t||!a||!e||this.chart||ge(()=>this.rebuildForDataset(t));});}rebuildForDataset(t){if(!t.datachartPath||!this.widgetDataChart()||(this.dsServiceSub?.unsubscribe(),this.lineChartData.datasets=[],this.datasetLifecycle.syncDataChartDataset(this.id(),t,this.pathSignature()),this.datasetConfig=this.dsService.getDatasetConfig(this.id())??null,this.dataSourceInfo=this.dsService.getDataSourceInfo(this.id())??null,!this.datasetConfig))return;this.createDatasets(t),this.setChartOptions(t),this.chart?.destroy();let a=this.widgetDataChart()?.nativeElement?.getContext("2d");a&&(this.chart=new Wl(a,{type:this.lineChartType,data:this.lineChartData,options:this.lineChartOptions}),this.startStreaming(),this.ngZone.runOutsideAngular(()=>this.chart?.update()));}setChartOptions(t){let e=this.datasetConfig;e&&(this.lineChartOptions.maintainAspectRatio=false,this.lineChartOptions.animation=false,this.lineChartOptions.indexAxis=t.verticalChart?"y":"x",t.verticalChart?this.lineChartOptions.scales={y:{type:"realtime",display:t.showTimeScale,position:t.verticalChart?"right":"left",suggestedMin:void 0,suggestedMax:void 0,title:{display:true,text:`Last ${e.period} ${e.timeScaleFormat}`,align:"center",color:this.getThemeColors().averageChartLine},time:{unit:e.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:true,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}},x:{type:"linear",display:t.showYScale,position:t.verticalChart?"top":"bottom",suggestedMin:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMin,suggestedMax:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMax,min:t.enableMinMaxScaleLimit?t.yScaleMin:void 0,max:t.enableMinMaxScaleLimit?t.yScaleMax:void 0,beginAtZero:t.startScaleAtZero,reverse:t.inverseYAxis,title:{display:false,text:"Value Axis",align:"center",color:this.getThemeColors().averageChartLine},ticks:{maxTicksLimit:8,precision:t.numDecimal,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}}}:this.lineChartOptions.scales={x:{type:"realtime",display:t.showTimeScale,title:{display:true,text:`Last ${e.period} ${e.timeScaleFormat}`,align:"center",color:this.getThemeColors().averageChartLine},time:{unit:e.timeScaleFormat,minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'ss"',millisecond:"SSS"}},ticks:{autoSkip:true,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}},y:{display:t.showYScale,position:"right",suggestedMin:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMin,suggestedMax:t.enableMinMaxScaleLimit?void 0:t.yScaleSuggestedMax,min:t.enableMinMaxScaleLimit?t.yScaleMin:void 0,max:t.enableMinMaxScaleLimit?t.yScaleMax:void 0,beginAtZero:t.startScaleAtZero,reverse:t.inverseYAxis,title:{display:false,text:"Value Axis",align:"center",color:this.getThemeColors().averageChartLine},ticks:{maxTicksLimit:8,precision:t.numDecimal,color:this.getThemeColors().averageChartLine,major:{enabled:true}},grid:{display:true,color:this.theme().contrastDimmer}}},this.lineChartOptions.plugins={title:{display:true,align:"end",padding:{top:3,bottom:0},text:"",font:{size:32},color:this.getThemeColors().chartValue},subtitle:{display:t.showLabel,align:"start",padding:{top:-35,bottom:20},text:` ${t.displayName}`,font:{size:22},color:this.getThemeColors().chartLabel},annotation:{annotations:{minimumLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null,value:this.lastMinimumValue??0,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null,content:this.lastMinimumValue!==null?`${this.lastMinimumValue.toFixed(t.numDecimal??1)}`:"",position:"start",yAdjust:12,padding:4,color:this.getThemeColors().averageChartLine,backgroundColor:"rgba(63,63,63,0.0)"}},maximumLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null,value:this.lastMaximumValue??0,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null,content:this.lastMaximumValue!==null?`${this.lastMaximumValue.toFixed(t.numDecimal??1)}`:"",position:"start",yAdjust:-12,padding:4,color:this.getThemeColors().averageChartLine,backgroundColor:"rgba(63,63,63,0.0)"}},averageLine:{type:"line",scaleID:t.verticalChart?"x":"y",display:t.showDatasetAverageValueLine&&this.lastAverageValue!==null,value:this.lastAverageValue??0,borderDash:[6,6],borderColor:this.getThemeColors().averageChartLine,drawTime:"afterDatasetsDraw",label:{display:t.showDatasetAverageValueLine&&this.lastAverageValue!==null,content:this.lastAverageValue!==null?`${this.lastAverageValue.toFixed(t.numDecimal??1)}`:"",position:"start",padding:4,color:this.getThemeColors().chartValue,backgroundColor:"rgba(63,63,63,0.7)"}}}},legend:{display:false},streaming:{duration:(this.dataSourceInfo?.maxDataPoints??0)*(this.dataSourceInfo?.sampleTime??0),delay:this.dataSourceInfo?.sampleTime??0,frameRate:e.timeScaleFormat==="day"?5:e.timeScaleFormat==="hour"?8:e.timeScaleFormat==="minute"?15:30}});}createDatasets(t){let e,a;t.inverseYAxis&&t.trackAgainstAverage?(e="start",a=false):t.inverseYAxis&&!t.trackAgainstAverage?(e=false,a="start"):!t.inverseYAxis&&t.trackAgainstAverage?(e=true,a=false):(e=false,a=true),this.lineChartData.datasets=[],this.lineChartData.datasets.push({label:"Value",data:[],order:t.trackAgainstAverage?1:0,parsing:false,tension:0,pointRadius:t.showDataPoints?t.trackAgainstAverage?0:1.5:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage||t.showDataPoints?0:3,fill:e}),t.showAverageData&&this.lineChartData.datasets.push({label:"Average",data:[],order:t.trackAgainstAverage?0:1,parsing:false,tension:.4,pointRadius:t.showDataPoints&&t.trackAgainstAverage?1.5:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage?t.showDataPoints?0:3:0,fill:a}),this.setDatasetsColors();}setDatasetsColors(){this.lineChartData.datasets.forEach(t=>{t.label==="Value"?(t.borderColor=this.getThemeColors().valueLine,t.backgroundColor=this.getThemeColors().valueFill):t.label==="Average"&&(t.borderColor=this.getThemeColors().averageLine,t.backgroundColor=this.getThemeColors().averageFill);});}ensureAverageDatasetPresence(){let t=this.runtime.options();if(!t||!this.chart)return;let e=this.lineChartData.datasets.some(a=>a.label==="Average");if(t.showAverageData&&!e){if(this.lineChartData.datasets.findIndex(n=>n.label==="Value")>=0){let n=t.inverseYAxis?t.trackAgainstAverage?false:"start":!t.trackAgainstAverage;this.lineChartData.datasets.push({label:"Average",data:[],order:t.trackAgainstAverage?0:1,parsing:false,tension:.4,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:t.trackAgainstAverage?3:0,fill:n});}}else !t.showAverageData&&e&&(this.lineChartData.datasets=this.lineChartData.datasets.filter(a=>a.label!=="Average"));}applyDynamicTrackAverageStyling(){let t=this.runtime.options();if(!t)return;let e=this.lineChartData.datasets.find(l=>l.label==="Value"),a=this.lineChartData.datasets.find(l=>l.label==="Average"),n,r;t.inverseYAxis&&t.trackAgainstAverage?(n="start",r=false):t.inverseYAxis&&!t.trackAgainstAverage?(n=false,r="start"):!t.inverseYAxis&&t.trackAgainstAverage?(n=true,r=false):(n=false,r=true),e&&(e.order=t.trackAgainstAverage?1:0,e.borderWidth=t.trackAgainstAverage?0:3,e.fill=n),a&&(a.order=t.trackAgainstAverage?0:1,a.borderWidth=t.trackAgainstAverage?3:0,a.fill=r);}updateAnnotationVisibility(){let t=this.runtime.options();if(!t||!this.chart)return;let e=this.chart.options.plugins.annotation?.annotations;if(e){if(e.minimumLine){let a=t.showDatasetMinimumValueLine&&this.lastMinimumValue!==null;e.minimumLine.display=a,e.minimumLine.label&&(e.minimumLine.label.display=a);}if(e.maximumLine){let a=t.showDatasetMaximumValueLine&&this.lastMaximumValue!==null;e.maximumLine.display=a,e.maximumLine.label&&(e.maximumLine.label.display=a);}if(e.averageLine){let a=t.showDatasetAverageValueLine&&this.lastAverageValue!==null;e.averageLine.display=a,e.averageLine.label&&(e.averageLine.label.display=a);}}}getThemeColors(){let t=this.runtime.options()?.color,e={valueLine:"",valueFill:"",averageLine:"",averageFill:"",averageChartLine:"",chartLabel:"",chartValue:""};switch(t){case "contrast":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().contrastDimmer,e.valueFill=this.theme().contrastDimmer,e.averageLine=this.theme().contrast,e.averageFill=this.theme().contrast,e.chartValue=e.averageLine):(e.valueLine=this.theme().contrast,e.valueFill=this.theme().contrast,e.averageLine=this.theme().contrastDimmer,e.averageFill=this.theme().contrastDimmer,e.chartValue=this.theme().contrast),e.averageChartLine=this.theme().contrastDim,e.chartLabel=this.theme().contrastDim;break;case "blue":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().blueDimmer,e.valueFill=this.theme().blueDimmer,e.averageLine=this.theme().blue,e.averageFill=this.theme().blue,e.chartValue=e.averageLine):(e.valueLine=this.theme().blue,e.valueFill=this.theme().blue,e.averageLine=this.theme().blueDimmer,e.averageFill=this.theme().blueDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().blueDim,e.chartLabel=this.theme().contrastDim;break;case "green":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().greenDimmer,e.valueFill=this.theme().greenDimmer,e.averageLine=this.theme().green,e.averageFill=this.theme().green,e.chartValue=e.averageLine):(e.valueLine=this.theme().green,e.valueFill=this.theme().green,e.averageLine=this.theme().greenDimmer,e.averageFill=this.theme().greenDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greenDim,e.chartLabel=this.theme().contrastDim;break;case "pink":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().pinkDimmer,e.valueFill=this.theme().pinkDimmer,e.averageLine=this.theme().pink,e.averageFill=this.theme().pink,e.chartValue=e.averageLine):(e.valueLine=this.theme().pink,e.valueFill=this.theme().pink,e.averageLine=this.theme().pinkDimmer,e.averageFill=this.theme().pinkDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().pinkDim,e.chartLabel=this.theme().contrastDim;break;case "orange":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().orangeDimmer,e.valueFill=this.theme().orangeDimmer,e.averageLine=this.theme().orange,e.averageFill=this.theme().orange,e.chartValue=e.averageLine):(e.valueLine=this.theme().orange,e.valueFill=this.theme().orange,e.averageLine=this.theme().orangeDimmer,e.averageFill=this.theme().orangeDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().orangeDim,e.chartLabel=this.theme().contrastDim;break;case "purple":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().purpleDimmer,e.valueFill=this.theme().purpleDimmer,e.averageLine=this.theme().purple,e.averageFill=this.theme().purple,e.chartValue=e.averageLine):(e.valueLine=this.theme().purple,e.valueFill=this.theme().purple,e.averageLine=this.theme().purpleDimmer,e.averageFill=this.theme().purpleDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().purpleDim,e.chartLabel=this.theme().contrastDim;break;case "grey":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().greyDimmer,e.valueFill=this.theme().greyDimmer,e.averageLine=this.theme().grey,e.averageFill=this.theme().grey,e.chartValue=e.averageLine):(e.valueLine=this.theme().grey,e.valueFill=this.theme().grey,e.averageLine=this.theme().greyDimmer,e.averageFill=this.theme().greyDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().greyDim,e.chartLabel=this.theme().contrastDim;break;case "yellow":this.runtime.options()?.trackAgainstAverage?(e.valueLine=this.theme().yellowDimmer,e.valueFill=this.theme().yellowDimmer,e.averageLine=this.theme().yellow,e.averageFill=this.theme().yellow,e.chartValue=e.averageLine):(e.valueLine=this.theme().yellow,e.valueFill=this.theme().yellow,e.averageLine=this.theme().yellowDimmer,e.averageFill=this.theme().yellowDimmer,e.chartValue=e.valueFill),e.averageChartLine=this.theme().yellowDim,e.chartLabel=this.theme().contrastDim;break}return e}getUnitsLabel(){let t="",e=this.runtime.options()?.convertUnitTo??"";switch(e){case "percent":case "percentraw":t="%";break;case "latitudeMin":t="latitude in minutes";break;case "latitudeSec":t="latitude in secondes";break;case "longitudeMin":t="longitude in minutes";break;case "longitudeSec":t="longitude in secondes";break;default:t=e;break}return t}startStreaming(){let t=this.runtime.options();if(!t?.datachartPath)return;this.dsServiceSub?.unsubscribe();let e=this.dsService.getDatasetBatchThenLiveObservable(this.id());e&&(this.dsServiceSub=e.subscribe(a=>{if(this.chart){if(Array.isArray(a)){let n=this.transformDatasetRows(a,0);if(this.chart.data.datasets[0].data.push(...n),t.showAverageData&&this.lineChartData.datasets[1]){let l=t.datasetAverageArray??"sma",s=this.transformDatasetRows(a,l);this.chart.data.datasets[1].data.push(...s);}let r=a[a.length-1];r&&this.applyTitleAndAnnotationValues(r,t);}else {let n=this.transformDatasetRows([a],0)[0];if(this.chart.data.datasets[0].data.push(n),t.showAverageData&&this.lineChartData.datasets[1]){let r=t.datasetAverageArray??"sma",l=this.transformDatasetRows([a],r)[0];this.chart.data.datasets[1].data.push(l);}this.applyTitleAndAnnotationValues(a,t);}this.ngZone.runOutsideAngular(()=>this.chart?.update("none"));}}));}applyTitleAndAnnotationValues(t,e){if(!this.chart)return;let a=e.convertUnitTo??"",n=e.numDecimal??1,r=e.trackAgainstAverage?t.data.sma??t.data.value:t.data.value,l=this.unitsService.convertToUnit(a,r);if(l!=null&&Number.isFinite(l)){let y=this.chart.options.plugins;y?.title&&(y.title.text=`${l.toFixed(n)} ${this.getUnitsLabel()} `);}let s=t.data.lastAverage!=null?this.unitsService.convertToUnit(a,t.data.lastAverage)??void 0:void 0,h=t.data.lastMinimum!=null?this.unitsService.convertToUnit(a,t.data.lastMinimum)??void 0:void 0,g=t.data.lastMaximum!=null?this.unitsService.convertToUnit(a,t.data.lastMaximum)??void 0:void 0,i=this.chart.options.plugins.annotation?.annotations;i&&(this.lastAverageValue=s!=null&&Number.isFinite(s)?s:null,this.lastMinimumValue=h!=null&&Number.isFinite(h)?h:null,this.lastMaximumValue=g!=null&&Number.isFinite(g)?g:null,i.averageLine&&(this.lastAverageValue!==null?(i.averageLine.value=this.lastAverageValue,i.averageLine.display=e.showDatasetAverageValueLine,i.averageLine.label&&(i.averageLine.label.display=e.showDatasetAverageValueLine,i.averageLine.label.content=`${this.lastAverageValue.toFixed(n)}`)):(i.averageLine.display=false,i.averageLine.label&&(i.averageLine.label.display=false,i.averageLine.label.content=""))),i.minimumLine&&(this.lastMinimumValue!==null?(i.minimumLine.value=this.lastMinimumValue,i.minimumLine.display=e.showDatasetMinimumValueLine,i.minimumLine.label&&(i.minimumLine.label.display=e.showDatasetMinimumValueLine,i.minimumLine.label.content=`${this.lastMinimumValue.toFixed(n)}`)):(i.minimumLine.display=false,i.minimumLine.label&&(i.minimumLine.label.display=false,i.minimumLine.label.content=""))),i.maximumLine&&(this.lastMaximumValue!==null?(i.maximumLine.value=this.lastMaximumValue,i.maximumLine.display=e.showDatasetMaximumValueLine,i.maximumLine.label&&(i.maximumLine.label.display=e.showDatasetMaximumValueLine,i.maximumLine.label.content=`${this.lastMaximumValue.toFixed(n)}`)):(i.maximumLine.display=false,i.maximumLine.label&&(i.maximumLine.label.display=false,i.maximumLine.label.content=""))));}transformDatasetRows(t,e){let a=this.runtime.options();if(!a)return [];let n=s=>this.unitsService.convertToUnit(a.convertUnitTo??"",s)??s,r=a.verticalChart===true,l=a.datasetAverageArray;return t.map(s=>{if(r){if(e===0)return {x:n(s.data.value),y:s.timestamp};{let h={sma:s.data.sma,ema:s.data.ema,dema:s.data.doubleEma,avg:s.data.lastAverage};return {x:n(h[l]??s.data.value),y:s.timestamp}}}else {if(e===0)return {x:s.timestamp,y:n(s.data.value)};{let h={sma:s.data.sma,ema:s.data.ema,dema:s.data.doubleEma,avg:s.data.lastAverage};return {x:s.timestamp,y:n(h[l]??s.data.value)}}}})}ngOnDestroy(){this.dsServiceSub?.unsubscribe(),this.chart?.destroy();let t=this.widgetDataChart?.()?.nativeElement;this.canvasService.releaseCanvas(t,{clear:true,removeFromDom:true});}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=JD({type:m,selectors:[["widget-data-chart"]],viewQuery:function(e,a){e&1&&eg(a.widgetDataChart,_,5,Lr),e&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:2,vars:1,consts:[["widgetDataChart",""],[2,"z-index","inherit"],[1,"empty-state"],[1,"hint"]],template:function(e,a){e&1&&_w(0,E,2,0,"canvas",1)(1,I,5,0,"div",2),e&2&&Mw(a.hasPath()?0:1);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;width:100%;text-align:center;color:var(--mat-sys-on-surface-variant)}.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0;padding:0 16px}.empty-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:.85em;opacity:.7}"]})};export{U as WidgetDataChartComponent};
@@ -1 +1 @@
1
- import {p as p$1}from'./chunk-CaD3zVfK.js';import {G as Gt,D as Dt$1}from'./chunk-BQr-tSkv.js';import {u}from'./chunk-hd2_AKwt.js';import {k}from'./chunk-BwOIef42.js';import {d1 as Hj,w,du as p,dv as rt,dD as _,bu as ut,$ as $j,a6 as Lr,v as vt,D as Dt,dx as n$1,cw as z,cv as G,F as Fa,dn as ge$1,J as JD,_ as _w,M as Mw,f as eg,K as Kw,h as Fw,P as Pi,k as Qh,u as ul,g as qw,B as Bh,an as Hh,l as ud,m as dd}from'./main-BAV5VDOD.js';import {c}from'./chunk-Dxlia2NE.js';var Z=["linearGauge"];function Q(s,H){if(s&1){let t=Fw();Pi(0,"linear-gauge",2,0),Qh("resizeChange",function(a){ud(t);let e=qw();return dd(e.onResized(a))}),ul();}if(s&2){let t=qw();Bh("options",t.gaugeOptions)("value",t.displayValue()),Hh("value-text",t.textValue());}}var ge=(()=>{class s{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);metadata=w(_);unitsService=w(ut);static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngLinear",subType:"vertical",highlightsWidth:5,enableTicks:true,enableNeedle:false},numInt:1,numDecimal:0,color:"contrast",enableTimeout:false,dataTimeout:5,ignoreZones:false};ngGauge=$j("linearGauge");gauge=$j("linearGauge",{read:Lr});textValue=vt("--");value=vt(void 0);displayValue=Dt(()=>this.value()??0);shouldRenderGauge=Dt(()=>this.value()!==void 0);gaugeOptions={};viewReady=vt(false);gaugeBootstrapped=vt(false);animationEnabled=Dt(()=>this.gaugeBootstrapped());currentState=vt(n$1.Normal);normalizedConfig=Dt(()=>this.runtime.options()??s.DEFAULT_CONFIG);gaugePathConfig=Dt(()=>this.normalizedConfig().paths?.gaugePath);normalizedScale=Dt(()=>{let t=this.normalizedConfig().displayScale??s.DEFAULT_CONFIG.displayScale;return z(G({},t),{lower:t.lower??0,upper:t.upper??100})});adjustedScale=Dt(()=>{let t=this.normalizedConfig(),i=this.normalizedScale();return t.gauge?.enableTicks?p$1(i.lower,i.upper):{min:i.lower,max:i.upper,majorTicks:[]}});highlights=Dt(()=>{let t=this.metadata.zones(),i=this.normalizedConfig(),a=this.theme(),e=this.gaugePathConfig();return t?.length?a?i.ignoreZones?[]:e?k(t,a,e.convertUnitTo??"",this.unitsService,this.adjustedScale().min,this.adjustedScale().max):[]:[]:[]});displayName=Dt(()=>this.normalizedConfig().displayName||"Gauge Label");constructor(){Fa(()=>{this.normalizedConfig();let i=this.theme(),a=this.gaugePathConfig(),e=this.normalizedScale();!i||!a?.path||ge$1(()=>this.streams.observe("gaugePath",o=>{let n=o?.data?.value??null;if(n==null)this.value.set(e.lower),this.textValue.set("--");else {let r=Math.min(Math.max(n,e.lower),e.upper);this.value.set(r),this.textValue()==="--"&&this.textValue.set("");}o.state!==this.currentState()&&this.currentState.set(o.state);}));}),Fa(()=>{this.normalizedConfig().ignoreZones||ge$1(()=>this.metadata.observe("gaugePath"));}),Fa(()=>{let t=this.highlights();this.viewReady()&&ge$1(()=>{try{if(!t.length)this.ngGauge()?.update({highlights:[]});else {let i=JSON.stringify(t);this.ngGauge()?.update({highlights:i,highlightsWidth:this.normalizedConfig().gauge?.highlightsWidth});}}catch(i){}});}),Fa(()=>{let t=this.normalizedConfig(),i=this.theme(),a=this.adjustedScale();i&&ge$1(()=>{if(this.buildGaugeOptions(t,i,a),this.viewReady())try{this.ngGauge()?.update(this.gaugeOptions),this.applyInitialSize();}catch(e){}});}),Fa(()=>{let t=this.ngGauge();!t||this.gaugeBootstrapped()||ge$1(()=>{try{requestAnimationFrame(()=>{this.gaugeBootstrapped.set(!0);try{t.update({animation:!0,animatedValue:!0});}catch(i){}});}catch(i){}});}),Fa(()=>{let t=this.currentState();this.viewReady()&&ge$1(()=>{let i=this.normalizedConfig(),a=this.theme();if(!a||i.ignoreZones)return;let e={},o=i.gauge?.enableNeedle,n=c(i.color??"contrast",a);switch(t){case n$1.Alarm:o?(e.colorNeedle=a.zoneAlarm,e.colorValueText=a.zoneAlarm):(e.colorBarProgress=a.zoneAlarm,e.colorValueText=a.zoneAlarm);break;case n$1.Warn:o?(e.colorNeedle=a.zoneWarn,e.colorValueText=a.zoneWarn):(e.colorBarProgress=a.zoneWarn,e.colorValueText=a.zoneWarn);break;case n$1.Alert:o?(e.colorNeedle=a.zoneAlert,e.colorValueText=a.zoneAlert):(e.colorBarProgress=a.zoneAlert,e.colorValueText=a.zoneAlert);break;default:o?(e.colorNeedle=n.color,e.colorValueText=n.color):(e.colorBarProgress=n.color,e.colorValueText=n.color);}try{this.ngGauge()?.update(e);}catch(r){}});});}buildGaugeOptions(t,i,a){let e=this.gaugeOptions={},o=t.gauge?.subType==="vertical",n=t.gauge?.enableNeedle,r=t.gauge?.enableTicks,m=this.gaugePathConfig();e.minValue=a.min,e.maxValue=a.max,e.valueInt=t.numInt??1,e.valueDec=t.numDecimal??2,e.title=this.displayName(),e.fontTitleSize=40,e.fontTitle="Roboto",e.fontTitleWeight="bold",e.barLength=o?80:90,e.barWidth=r?n?0:30:60,e.barProgress=true,e.barBeginCircle=0,e.barStrokeWidth=0,e.barShadow=0,e.needle=!!n,e.needleType=n?"arrow":"line",e.needleStart=n?o?200:155:-45,e.needleEnd=n?o?175:180:55,e.needleShadow=true,e.needleSide="both",e.units=m?.convertUnitTo??"",e.fontUnits="Roboto",e.fontUnitsWeight="normal",e.borders=false,e.borderOuterWidth=0,e.borderMiddleWidth=0,e.borderInnerWidth=0,e.borderShadowWidth=0,e.borderRadius=0,e.valueBox=true,e.valueBoxWidth=35,e.valueBoxStroke=0,e.valueBoxBorderRadius=10,e.colorValueBoxRect="",e.colorValueBoxRectEnd="",e.colorValueBoxShadow="",e.fontValueSize=50,e.fontValue="Roboto",e.fontValueWeight="bold",e.valueTextShadow=false,e.fontNumbers="Roboto",e.fontNumbersWeight="normal",e.fontUnitsSize=o?40:35,e.colorTitle=c("contrast",i).dim,e.colorUnits=c("contrast",i).dim,e.colorValueBoxBackground=i.background;let u=c(t.color??"contrast",i);e.colorValueText=u.color,n?(e.colorNeedle=u.color,e.colorNeedleEnd=u.color,e.needleWidth=45,e.colorNeedleShadowUp=u.color,e.colorNeedleShadowDown=u.color):(e.colorBarProgress=u.color,e.colorBarProgressEnd="",e.needleWidth=0),e.colorPlate=i.cardColor,e.colorBar=i.background,e.colorBarEnd="",e.colorBarStroke="0",e.colorMajorTicks=c("contrast",i).dim,e.colorMinorTicks=c("contrast",i).dim,e.colorNumbers=c("contrast",i).dim,e.majorTicks=r?a.majorTicks:[],e.majorTicksInt=t.numInt??1,e.majorTicksDec=t.numDecimal??2,e.strokeTicks=!!r,e.minorTicks=r?2:0,e.ticksWidthMinor=r?6:0,e.numberSide=n?"right":"left",e.fontNumbersSize=r?o?22:30:0,e.numbersMargin=o?n?-7:-3:n?-33:-5,e.ticksWidth=r?n&&o?15:10:0,e.ticksPadding=r?o?n?0:5:n?9:8:0,e.tickSide="left",e.animation=this.animationEnabled(),e.animationRule="linear",e.animatedValue=this.animationEnabled(),e.animateOnInit=false,e.animationDuration=(m?.sampleTime??500)-25,e.highlights=[],e.highlightsWidth=t.gauge?.highlightsWidth;let N=this.highlights();N.length&&(e.highlights=JSON.stringify(N));}ngAfterViewInit(){this.viewReady.set(true),this.applyInitialSize();try{this.ngGauge()?.update(this.gaugeOptions);}catch(t){}}applyInitialSize(){let t=this.gauge()?.nativeElement;if(!t)return;let i=t.getBoundingClientRect(),a=.3,e,o;this.normalizedConfig().gauge?.subType==="vertical"?(e=i.height,o=i.height*a):(o=i.width,e=i.width*a);let m={height:e,width:o};try{this.ngGauge()?.update(m);}catch(u){}}onResized(t){let i=this.normalizedConfig(),a=.3,e=i.gauge?.subType==="vertical",o=0,n=0;e?(n=t.contentRect.height,o=n*a,o>t.contentRect.width&&(o=t.contentRect.width,n=o/a)):(o=t.contentRect.width,n=o*a,n>t.contentRect.height&&(n=t.contentRect.height,o=n/a));let r={width:o,height:n-10};try{this.ngGauge()?.update(r);}catch(m){}}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=JD({type:s,selectors:[["widget-gauge-ng-linear"]],viewQuery:function(i,a){i&1&&eg(a.ngGauge,Z,5)(a.gauge,Z,5,Lr),i&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:1,consts:[["linearGauge",""],["kipResizeObserver","",1,"linearGauge",3,"options","value"],["kipResizeObserver","",1,"linearGauge",3,"resizeChange","options","value"]],template:function(i,a){i&1&&_w(0,Q,2,3,"linear-gauge",1),i&2&&Mw(a.shouldRenderGauge()?0:-1);},dependencies:[u,Gt,Dt$1],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block} linear-gauge{display:block;position:relative;width:100%;min-width:8px;height:100%;overflow:clip} linear-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:5px}"]})}return s})();export{ge as WidgetGaugeNgLinearComponent};
1
+ import {p as p$1}from'./chunk-CaD3zVfK.js';import {G as Gt,D as Dt$1}from'./chunk-B6AwCAvV.js';import {u}from'./chunk-BgyxBAyq.js';import {k}from'./chunk-DfGLo6Tb.js';import {d1 as Hj,w,du as p,dv as rt,dD as _,bu as ut,$ as $j,a6 as Lr,v as vt,D as Dt,dx as n$1,cw as z,cv as G,F as Fa,dn as ge$1,J as JD,_ as _w,M as Mw,f as eg,K as Kw,h as Fw,P as Pi,k as Qh,u as ul,g as qw,B as Bh,an as Hh,l as ud,m as dd}from'./main-BNR44HGB.js';import {c}from'./chunk-D_wrJJxl.js';var Z=["linearGauge"];function Q(s,H){if(s&1){let t=Fw();Pi(0,"linear-gauge",2,0),Qh("resizeChange",function(a){ud(t);let e=qw();return dd(e.onResized(a))}),ul();}if(s&2){let t=qw();Bh("options",t.gaugeOptions)("value",t.displayValue()),Hh("value-text",t.textValue());}}var ge=(()=>{class s{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);metadata=w(_);unitsService=w(ut);static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:true,displayName:"Gauge Label",filterSelfPaths:true,paths:{gaugePath:{description:"Numeric Data",path:null,source:null,pathType:"number",suppressBootstrapNull:true,isPathConfigurable:true,showPathSkUnitsFilter:true,pathSkUnitsFilter:null,convertUnitTo:"unitless",sampleTime:500}},displayScale:{lower:0,upper:100,type:"linear"},gauge:{type:"ngLinear",subType:"vertical",highlightsWidth:5,enableTicks:true,enableNeedle:false},numInt:1,numDecimal:0,color:"contrast",enableTimeout:false,dataTimeout:5,ignoreZones:false};ngGauge=$j("linearGauge");gauge=$j("linearGauge",{read:Lr});textValue=vt("--");value=vt(void 0);displayValue=Dt(()=>this.value()??0);shouldRenderGauge=Dt(()=>this.value()!==void 0);gaugeOptions={};viewReady=vt(false);gaugeBootstrapped=vt(false);animationEnabled=Dt(()=>this.gaugeBootstrapped());currentState=vt(n$1.Normal);normalizedConfig=Dt(()=>this.runtime.options()??s.DEFAULT_CONFIG);gaugePathConfig=Dt(()=>this.normalizedConfig().paths?.gaugePath);normalizedScale=Dt(()=>{let t=this.normalizedConfig().displayScale??s.DEFAULT_CONFIG.displayScale;return z(G({},t),{lower:t.lower??0,upper:t.upper??100})});adjustedScale=Dt(()=>{let t=this.normalizedConfig(),i=this.normalizedScale();return t.gauge?.enableTicks?p$1(i.lower,i.upper):{min:i.lower,max:i.upper,majorTicks:[]}});highlights=Dt(()=>{let t=this.metadata.zones(),i=this.normalizedConfig(),a=this.theme(),e=this.gaugePathConfig();return t?.length?a?i.ignoreZones?[]:e?k(t,a,e.convertUnitTo??"",this.unitsService,this.adjustedScale().min,this.adjustedScale().max):[]:[]:[]});displayName=Dt(()=>this.normalizedConfig().displayName||"Gauge Label");constructor(){Fa(()=>{this.normalizedConfig();let i=this.theme(),a=this.gaugePathConfig(),e=this.normalizedScale();!i||!a?.path||ge$1(()=>this.streams.observe("gaugePath",o=>{let n=o?.data?.value??null;if(n==null)this.value.set(e.lower),this.textValue.set("--");else {let r=Math.min(Math.max(n,e.lower),e.upper);this.value.set(r),this.textValue()==="--"&&this.textValue.set("");}o.state!==this.currentState()&&this.currentState.set(o.state);}));}),Fa(()=>{this.normalizedConfig().ignoreZones||ge$1(()=>this.metadata.observe("gaugePath"));}),Fa(()=>{let t=this.highlights();this.viewReady()&&ge$1(()=>{try{if(!t.length)this.ngGauge()?.update({highlights:[]});else {let i=JSON.stringify(t);this.ngGauge()?.update({highlights:i,highlightsWidth:this.normalizedConfig().gauge?.highlightsWidth});}}catch(i){}});}),Fa(()=>{let t=this.normalizedConfig(),i=this.theme(),a=this.adjustedScale();i&&ge$1(()=>{if(this.buildGaugeOptions(t,i,a),this.viewReady())try{this.ngGauge()?.update(this.gaugeOptions),this.applyInitialSize();}catch(e){}});}),Fa(()=>{let t=this.ngGauge();!t||this.gaugeBootstrapped()||ge$1(()=>{try{requestAnimationFrame(()=>{this.gaugeBootstrapped.set(!0);try{t.update({animation:!0,animatedValue:!0});}catch(i){}});}catch(i){}});}),Fa(()=>{let t=this.currentState();this.viewReady()&&ge$1(()=>{let i=this.normalizedConfig(),a=this.theme();if(!a||i.ignoreZones)return;let e={},o=i.gauge?.enableNeedle,n=c(i.color??"contrast",a);switch(t){case n$1.Alarm:o?(e.colorNeedle=a.zoneAlarm,e.colorValueText=a.zoneAlarm):(e.colorBarProgress=a.zoneAlarm,e.colorValueText=a.zoneAlarm);break;case n$1.Warn:o?(e.colorNeedle=a.zoneWarn,e.colorValueText=a.zoneWarn):(e.colorBarProgress=a.zoneWarn,e.colorValueText=a.zoneWarn);break;case n$1.Alert:o?(e.colorNeedle=a.zoneAlert,e.colorValueText=a.zoneAlert):(e.colorBarProgress=a.zoneAlert,e.colorValueText=a.zoneAlert);break;default:o?(e.colorNeedle=n.color,e.colorValueText=n.color):(e.colorBarProgress=n.color,e.colorValueText=n.color);}try{this.ngGauge()?.update(e);}catch(r){}});});}buildGaugeOptions(t,i,a){let e=this.gaugeOptions={},o=t.gauge?.subType==="vertical",n=t.gauge?.enableNeedle,r=t.gauge?.enableTicks,m=this.gaugePathConfig();e.minValue=a.min,e.maxValue=a.max,e.valueInt=t.numInt??1,e.valueDec=t.numDecimal??2,e.title=this.displayName(),e.fontTitleSize=40,e.fontTitle="Roboto",e.fontTitleWeight="bold",e.barLength=o?80:90,e.barWidth=r?n?0:30:60,e.barProgress=true,e.barBeginCircle=0,e.barStrokeWidth=0,e.barShadow=0,e.needle=!!n,e.needleType=n?"arrow":"line",e.needleStart=n?o?200:155:-45,e.needleEnd=n?o?175:180:55,e.needleShadow=true,e.needleSide="both",e.units=m?.convertUnitTo??"",e.fontUnits="Roboto",e.fontUnitsWeight="normal",e.borders=false,e.borderOuterWidth=0,e.borderMiddleWidth=0,e.borderInnerWidth=0,e.borderShadowWidth=0,e.borderRadius=0,e.valueBox=true,e.valueBoxWidth=35,e.valueBoxStroke=0,e.valueBoxBorderRadius=10,e.colorValueBoxRect="",e.colorValueBoxRectEnd="",e.colorValueBoxShadow="",e.fontValueSize=50,e.fontValue="Roboto",e.fontValueWeight="bold",e.valueTextShadow=false,e.fontNumbers="Roboto",e.fontNumbersWeight="normal",e.fontUnitsSize=o?40:35,e.colorTitle=c("contrast",i).dim,e.colorUnits=c("contrast",i).dim,e.colorValueBoxBackground=i.background;let u=c(t.color??"contrast",i);e.colorValueText=u.color,n?(e.colorNeedle=u.color,e.colorNeedleEnd=u.color,e.needleWidth=45,e.colorNeedleShadowUp=u.color,e.colorNeedleShadowDown=u.color):(e.colorBarProgress=u.color,e.colorBarProgressEnd="",e.needleWidth=0),e.colorPlate=i.cardColor,e.colorBar=i.background,e.colorBarEnd="",e.colorBarStroke="0",e.colorMajorTicks=c("contrast",i).dim,e.colorMinorTicks=c("contrast",i).dim,e.colorNumbers=c("contrast",i).dim,e.majorTicks=r?a.majorTicks:[],e.majorTicksInt=t.numInt??1,e.majorTicksDec=t.numDecimal??2,e.strokeTicks=!!r,e.minorTicks=r?2:0,e.ticksWidthMinor=r?6:0,e.numberSide=n?"right":"left",e.fontNumbersSize=r?o?22:30:0,e.numbersMargin=o?n?-7:-3:n?-33:-5,e.ticksWidth=r?n&&o?15:10:0,e.ticksPadding=r?o?n?0:5:n?9:8:0,e.tickSide="left",e.animation=this.animationEnabled(),e.animationRule="linear",e.animatedValue=this.animationEnabled(),e.animateOnInit=false,e.animationDuration=(m?.sampleTime??500)-25,e.highlights=[],e.highlightsWidth=t.gauge?.highlightsWidth;let N=this.highlights();N.length&&(e.highlights=JSON.stringify(N));}ngAfterViewInit(){this.viewReady.set(true),this.applyInitialSize();try{this.ngGauge()?.update(this.gaugeOptions);}catch(t){}}applyInitialSize(){let t=this.gauge()?.nativeElement;if(!t)return;let i=t.getBoundingClientRect(),a=.3,e,o;this.normalizedConfig().gauge?.subType==="vertical"?(e=i.height,o=i.height*a):(o=i.width,e=i.width*a);let m={height:e,width:o};try{this.ngGauge()?.update(m);}catch(u){}}onResized(t){let i=this.normalizedConfig(),a=.3,e=i.gauge?.subType==="vertical",o=0,n=0;e?(n=t.contentRect.height,o=n*a,o>t.contentRect.width&&(o=t.contentRect.width,n=o/a)):(o=t.contentRect.width,n=o*a,n>t.contentRect.height&&(n=t.contentRect.height,o=n/a));let r={width:o,height:n-10};try{this.ngGauge()?.update(r);}catch(m){}}static \u0275fac=function(i){return new(i||s)};static \u0275cmp=JD({type:s,selectors:[["widget-gauge-ng-linear"]],viewQuery:function(i,a){i&1&&eg(a.ngGauge,Z,5)(a.gauge,Z,5,Lr),i&2&&Kw(2);},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:1,vars:1,consts:[["linearGauge",""],["kipResizeObserver","",1,"linearGauge",3,"options","value"],["kipResizeObserver","",1,"linearGauge",3,"resizeChange","options","value"]],template:function(i,a){i&1&&_w(0,Q,2,3,"linear-gauge",1),i&2&&Mw(a.shouldRenderGauge()?0:-1);},dependencies:[u,Gt,Dt$1],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block} linear-gauge{display:block;position:relative;width:100%;min-width:8px;height:100%;overflow:clip} linear-gauge>canvas{display:block;position:absolute;height:100%;width:100%;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:5px}"]})}return s})();export{ge as WidgetGaugeNgLinearComponent};
@@ -1,4 +1,4 @@
1
- import {O}from'./chunk-tAiV3ARh.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-BAV5VDOD.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
1
+ import {O}from'./chunk-o977r5_s.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-BNR44HGB.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
2
2
  table-layout: fixed;
3
3
  }
4
4
  `],encapsulation:2,changeDetection:1})}return i})();function je(i,o){return i.concat(Array.from(o))}function wi(i,o){let e=o.toUpperCase(),t=i.viewContainer.element.nativeElement;for(;t;){let n=t.nodeType===1?t.nodeName:null;if(n===e)return t;if(n==="TABLE")break;t=t.parentNode;}return null}var vi=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=bh({type:i});static \u0275inj=Qs({imports:[wt$1]})}return i})();var Gi=[[["caption"]],[["colgroup"],["col"]],"*"],Ki=["caption","colgroup, col","*"];function Yi(i,o){i&1&&zw(0,2);}function Zi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",2),Wh(3,3)(4,4),ul(),Pi$1(5,"tfoot",0),Wh(6,5),ul());}function Xi(i,o){i&1&&Wh(0,1)(1,3)(2,4)(3,5);}var Si=(()=>{class i extends ct{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=false;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275cmp=JD({type:i,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-mdc-table","mdc-data-table__table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("mat-table-fixed-layout",n.fixedLayout);},exportAs:["matTable"],features:[LT([{provide:ct,useExisting:i},{provide:A,useExisting:i},{provide:xe,useValue:null}]),Sh],ngContentSelectors:Ki,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Gi),zw(0),zw(1,1),_w(2,Yi,1,0),_w(3,Zi,7,0)(4,Xi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.mat-mdc-table-sticky {