1"use strict";(self.webpackChunkairgradient_app=self.webpackChunkairgradient_app||[]).push([["default-src_app_modules_admin_admin_module_ts"],{34502:(G,C,d)=>{d.d(C,{a:()=>S,l:()=>y});var y=(()=>{return(u=y||(y={})).English="en",u.Thai="th",u.Lao="lo",u.Ukrainian="uk",u.French="fr",u.German="de",u.Spanish="es",u.Slovak="sk",y;var u})();const S={[y.English]:"English \u{1f1ec}\u{1f1e7}",[y.Thai]:"Thai \u{1f1f9}\u{1f1ed}",[y.Lao]:"Lao \u{1f1f1}\u{1f1e6}",[y.Ukrainian]:"Ukrainian \u{1f1fa}\u{1f1e6}",[y.French]:"French \u{1f1eb}\u{1f1f7}",[y.German]:"German \u{1f1e9}\u{1f1ea}",[y.Spanish]:"Spanish \u{1f1ea}\u{1f1f8}",[y.Slovak]:"Slovak \u{1f1f8}\u{1f1f0}"}},67897:(G,C,d)=>{d.r(C),d.d(C,{AdminModule:()=>HS});var y=d(68555),S=d(83364),u=d(69808),I=d(42155),e=d(5e3),k=d(27243);const E=["bcElement"];let P=(()=>{class n{constructor(t){this.renderer=t,this.elementType="svg",this.cssClass="barcode",this.format="CODE128",this.lineColor="#000000",this.width=2,this.height=100,this.displayValue=!1,this.fontOptions="",this.font="monospace",this.textAlign="center",this.textPosition="bottom",this.textMargin=2,this.fontSize=20,this.background="#ffffff",this.margin=10,this.marginTop=10,this.marginBottom=10,this.marginLeft=10,this.marginRight=10,this.value="",this.valid=()=>!0}get options(){return{format:this.format,lineColor:this.lineColor,width:this.width,height:this.height,displayValue:this.displayValue,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,valid:this.valid}}ngAfterViewInit(){this.createBarcode()}ngOnChanges(){this.bcElement&&this.createBarcode()}createBarcode(){if(!this.value)return;let t;switch(this.elementType){case"img":t=this.renderer.createElement("img");break;case"canvas":t=this.renderer.createElement("canvas");break;default:t=this.renderer.createElement("svg","svg")}k(t,this.value,this.options);for(const i of this.bcElement.nativeElement.childNodes)this.renderer.removeChild(this.bcElement.nativeElement,i);this.renderer.appendChild(this.bcElement.nativeElement,t)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(e.Renderer2))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["ngx-barcode6"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(E,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.bcElement=a.first)}},inputs:{elementType:["bc-element-type","elementType"],cssClass:["bc-class","cssClass"],format:["bc-format","format"],lineColor:["bc-line-color","lineColor"],width:["bc-width","width"],height:["bc-height","height"],displayValue:["bc-display-value","displayValue"],fontOptions:["bc-font-options","fontOptions"],font:["bc-font","font"],textAlign:["bc-text-align","textAlign"],textPosition:["bc-text-position","textPosition"],textMargin:["bc-text-margin","textMargin"],fontSize:["bc-font-size","fontSize"],background:["bc-background","background"],margin:["bc-margin","margin"],marginTop:["bc-margin-top","marginTop"],marginBottom:["bc-margin-bottom","marginBottom"],marginLeft:["bc-margin-left","marginLeft"],marginRight:["bc-margin-right","marginRight"],value:["bc-value","value"],valid:["bc-valid","valid"]},features:[e.\u0275\u0275NgOnChangesFeature],decls:2,vars:2,consts:[["bcElement",""]],template:function(t,i){1&t&&e.\u0275\u0275element(0,"div",null,0),2&t&&e.\u0275\u0275classMap(i.cssClass)},encapsulation:2}),n})(),v=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=e.\u0275\u0275defineInjector({imports:[[]]}),n})();const s=["dialogPopup"],c=["hueSlider"],m=["alphaSlider"];function p(n,o){if(1&n&&e.\u0275\u0275element(0,"div"),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275classMapInterpolate1("arrow arrow-",t.cpUsePosition,""),e.\u0275\u0275styleProp("top",t.arrowTop,"px")}}function g(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",28),e.\u0275\u0275listener("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onColorChange(a)})("dragStart",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onDragStart("saturation-lightness")})("dragEnd",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onDragEnd("saturation-lightness")}),e.\u0275\u0275element(1,"div",14),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("background-color",t.hueSliderColor),e.\u0275\u0275property("rgX",1)("rgY",1),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("top",null==t.slider?null:t.slider.v,"px")("left",null==t.slider?null:t.slider.s,"px")}}function b(n,o){1&n&&(e.\u0275\u0275namespaceSVG(),e.\u0275\u0275elementStart(0,"svg",29),e.\u0275\u0275element(1,"path",30)(2,"path",31),e.\u0275\u0275elementEnd())}function x(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",32),e.\u0275\u0275listener("click",function(a){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return r.onAddPresetColor(a,r.selectedColor)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275classMap(t.cpAddColorButtonClass),e.\u0275\u0275property("disabled",t.cpPresetColors&&t.cpPresetColors.length>=t.cpMaxPresetColorsLength),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.cpAddColorButtonText," ")}}function O(n,o){1&n&&e.\u0275\u0275element(0,"div",33)}function L(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",39),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAlphaInput(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("rg",1)("value",null==t.cmykText?null:t.cmykText.a)}}function N(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1,"A"),e.\u0275\u0275elementEnd())}function oe(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",34)(1,"div",35)(2,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onCyanInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onMagentaInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onYellowInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onBlackInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,L,1,2,"input",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",35)(8,"div"),e.\u0275\u0275text(9,"C"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div"),e.\u0275\u0275text(11,"M"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div"),e.\u0275\u0275text(13,"Y"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div"),e.\u0275\u0275text(15,"K"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(16,N,2,0,"div",38),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("display",3!==t.format?"none":"block"),e.\u0275\u0275advance(2),e.\u0275\u0275property("rg",100)("value",null==t.cmykText?null:t.cmykText.c),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",100)("value",null==t.cmykText?null:t.cmykText.m),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",100)("value",null==t.cmykText?null:t.cmykText.y),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",100)("value",null==t.cmykText?null:t.cmykText.k),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel),e.\u0275\u0275advance(10),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel)}}function Ae(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",39),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAlphaInput(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("rg",1)("value",null==t.hslaText?null:t.hslaText.a)}}function Ve(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1,"A"),e.\u0275\u0275elementEnd())}function ct(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",40)(1,"div",35)(2,"input",41),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onHueInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onSaturationInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onLightnessInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Ae,1,2,"input",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",35)(7,"div"),e.\u0275\u0275text(8,"H"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div"),e.\u0275\u0275text(10,"S"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"div"),e.\u0275\u0275text(12,"L"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,Ve,2,0,"div",38),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("display",2!==t.format?"none":"block"),e.\u0275\u0275advance(2),e.\u0275\u0275property("rg",360)("value",null==t.hslaText?null:t.hslaText.h),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",100)("value",null==t.hslaText?null:t.hslaText.s),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",100)("value",null==t.hslaText?null:t.hslaText.l),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel)}}function Yt(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",39),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAlphaInput(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("rg",1)("value",null==t.rgbaText?null:t.rgbaText.a)}}function Nt(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1,"A"),e.\u0275\u0275elementEnd())}function K(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",42)(1,"div",35)(2,"input",43),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onRedInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"input",43),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onGreenInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"input",43),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onBlueInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Yt,1,2,"input",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",35)(7,"div"),e.\u0275\u0275text(8,"R"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div"),e.\u0275\u0275text(10,"G"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"div"),e.\u0275\u0275text(12,"B"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,Nt,2,0,"div",38),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("display",1!==t.format?"none":"block"),e.\u0275\u0275advance(2),e.\u0275\u0275property("rg",255)("value",null==t.rgbaText?null:t.rgbaText.r),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",255)("value",null==t.rgbaText?null:t.rgbaText.g),e.\u0275\u0275advance(1),e.\u0275\u0275property("rg",255)("value",null==t.rgbaText?null:t.rgbaText.b),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel)}}function re(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",39),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAlphaInput(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("rg",1)("value",t.hexAlpha)}}function pe(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1,"A"),e.\u0275\u0275elementEnd())}function ie(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",44)(1,"div",35)(2,"input",45),e.\u0275\u0275listener("blur",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onHexInput(null)})("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onHexInput(a)}
1),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,re,1,2,"input",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",35)(5,"div"),e.\u0275\u0275text(6,"Hex"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,pe,2,0,"div",38),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("display",0!==t.format?"none":"block"),e.\u0275\u0275classProp("hex-alpha","forced"===t.cpAlphaChannel),e.\u0275\u0275advance(2),e.\u0275\u0275property("value",t.hexText),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","forced"===t.cpAlphaChannel),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf","forced"===t.cpAlphaChannel)}}function le(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"input",39),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAlphaInput(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("rg",1)("value",null==t.hslaText?null:t.hslaText.a)}}function ke(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",46)(1,"div",35)(2,"input",36),e.\u0275\u0275listener("keyup.enter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onAcceptColor(a)})("newValue",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onValueInput(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,le,1,2,"input",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",35)(5,"div"),e.\u0275\u0275text(6,"V"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div"),e.\u0275\u0275text(8,"A"),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("rg",100)("value",null==t.hslaText?null:t.hslaText.l),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","disabled"!==t.cpAlphaChannel)}}function hn(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",47)(1,"span",48),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onFormatToggle(-1)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"span",48),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onFormatToggle(1)}),e.\u0275\u0275elementEnd()()}}function gn(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"span",55),e.\u0275\u0275listener("click",function(a){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).onRemovePresetColor(a,r)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275classMap(t.cpRemoveColorButtonClass)}}function ca(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",53),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(3).setColorFromString(r)}),e.\u0275\u0275template(1,gn,1,3,"span",54),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(3);e.\u0275\u0275styleProp("background-color",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.cpAddColorButton)}}function pa(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,ca,2,3,"div",52),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275classMap(t.cpPresetColorsClass),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.cpPresetColors)}}function ma(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275classMap(t.cpPresetEmptyMessageClass),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.cpPresetEmptyMessage)}}function da(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",49),e.\u0275\u0275element(1,"hr"),e.\u0275\u0275elementStart(2,"div",50),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,pa,2,4,"div",51),e.\u0275\u0275template(5,ma,2,4,"div",51),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.cpPresetLabel),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.cpPresetColors?null:t.cpPresetColors.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!(null!=t.cpPresetColors&&t.cpPresetColors.length)&&t.cpAddColorButton)}}function ua(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",58),e.\u0275\u0275listener("click",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onCancelC
1olor(a)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275classMap(t.cpCancelButtonClass),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.cpCancelButtonText)}}function _a(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",58),e.\u0275\u0275listener("click",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onAcceptColor(a)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275classMap(t.cpOKButtonClass),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.cpOKButtonText)}}function fa(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",56),e.\u0275\u0275template(1,ua,2,4,"button",57),e.\u0275\u0275template(2,_a,2,4,"button",57),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.cpCancelButton),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.cpOKButton)}}function ha(n,o){1&n&&e.\u0275\u0275elementContainer(0)}function ga(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",59),e.\u0275\u0275template(1,ha,1,0,"ng-container",60),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngTemplateOutlet",t.cpExtraTemplate)}}var Ee=(()=>{return(n=Ee||(Ee={}))[n.HEX=0]="HEX",n[n.RGBA=1]="RGBA",n[n.HSLA=2]="HSLA",n[n.CMYK=3]="CMYK",Ee;var n})();class Ye{constructor(o,t,i,a){this.r=o,this.g=t,this.b=i,this.a=a}}class Xt{constructor(o,t,i,a){this.h=o,this.s=t,this.v=i,this.a=a}}class pt{constructor(o,t,i,a){this.h=o,this.s=t,this.l=i,this.a=a}}class Vt{constructor(o,t,i,a,r=1){this.c=o,this.m=t,this.y=i,this.k=a,this.a=r}}let ba=(()=>{class n{constructor(){this.newValue=new e.EventEmitter}inputChange(t){const i=t.target.value;if(void 0===this.rg)this.newValue.emit(i);else{const a=parseFloat(i);this.newValue.emit({v:a,rg:this.rg})}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.\u0275\u0275defineDirective({type:n,selectors:[["","text",""]],hostBindings:function(t,i){1&t&&e.\u0275\u0275listener("input",function(r){return i.inputChange(r)})},inputs:{rg:"rg",text:"text"},outputs:{newValue:"newValue"}}),n})(),xa=(()=>{class n{constructor(t){this.elRef=t,this.dragEnd=new e.EventEmitter,this.dragStart=new e.EventEmitter,this.newValue=new e.EventEmitter,this.listenerMove=i=>this.move(i),this.listenerStop=()=>this.stop()}mouseDown(t){this.start(t)}touchStart(t){this.start(t)}move(t){t.preventDefault(),this.setCursor(t)}start(t){this.setCursor(t),t.stopPropagation(),document.addEventListener("mouseup",this.listenerStop),document.addEventListener("touchend",this.listenerStop),document.addEventListener("mousemove",this.listenerMove),document.addEventListener("touchmove",this.listenerMove),this.dragStart.emit()}stop(){document.removeEventListener("mouseup",this.listenerStop),document.removeEventListener("touchend",this.listenerStop),document.removeEventListener("mousemove",this.listenerMove),document.removeEventListener("touchmove",this.listenerMove),this.dragEnd.emit()}getX(t){const i=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==t.pageX?t.pageX:t.touches[0].pageX)-i.left-window.pageXOffset}getY(t){const i=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==t.pageY?t.pageY:t.touches[0].pageY)-i.top-window.pageYOffset}setCursor(t){const i=this.elRef.nativeElement.offsetWidth,a=this.elRef.nativeElement.offsetHeight,r=Math.max(0,Math.min(this.getX(t),i)),l=Math.max(0,Math.min(this.getY(t),a));void 0!==this.rgX&&void 0!==this.rgY?this.newValue.emit({s:r/i,v:1-l/a,rgX:this.rgX,rgY:this.rgY}):void 0===this.rgX&&void 0!==this.rgY?this.newValue.emit({v:l/a,rgY:this.rgY}):void 0!==this.rgX&&void 0===this.rgY&&this.newValue.emit({v:r/i,rgX:this.rgX})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(e.ElementRef))},n.\u0275dir=e.\u0275\u0275defineDirective({type:n,selectors:[["","slider",""]],hostBindings:function(t,i){1&t&&e.\u0275\u0275listener("mousedown",function(r){return i.mouseDown(r)})("touchstart",function(r){return i.touchStart(r)})},inputs:{rgX:"rgX",rgY:"rgY",slider:"slider"},outputs:{dragEnd:"dragEnd",dragStart:"dragStart",newValue:"newValue"}}),n})();class oi{constructor(o,t,i,a){this.h=o,this.s=t,this.v=i,this.a=a}}class ri{constructor(o,t,i,a){this.h=o,this.s=t,this.v=i,this.a=a}}let vn=(()=>{class n{constructor(){this.active=null}setActive(t){this.active&&this.active!==t&&"inline"!==this.active.cpDialogDisplay&&this.active.closeDialog(),this.active=t}hsva2hsla(t){const i=t.h,a=t.s,r=t.v,l=t.a;if(0===r)return new pt(i,0,0,l);if(0===a&&1===r)return new pt(i,1,1,l);{const f=r*(2-a)/2;return new pt(i,r*a/(1-Math.abs(2*f-1)),f,l)}}hsla2hsva(t){const i=Math.min(t.h,1),a=Math.min(t.s,1),r=Math.min(t.l,1),l=Math.min(t.a,1);if(0===r)return new Xt(i,0,0,l);{const f=r+a*(1-Math.abs(2*r-1))/2;return new Xt(i,2*(f-r)/f,f,l)}}hsvaToRgba(t){let i,a,r;const l=t.h,f=t.s,w=t.v,T=t.a,M=Math.floor(6*l),B=6*l-M,j=w*(1-f),q=w*(1-B*f),J=w*(1-(1-B)*f);switch(M%6){case 0:i=w,a=J,r=j;break;case 1:i=q,a=w,r=j;break;case 2:i=j,a=w,r=J;break;case 3:i=j,a=q,r=w;break;case 4:i=J,a=j,r=w;break;case 5:i=w,a=j,r=q;break;default:i=0,a=0,r=0}return new Ye(i,a,r,T)}cmykToRgb(t){return new Ye((1-t.c)*(1-t.k),(1-t.m)*(1-t.k),(1-t.y)*(1-t.k),t.a)}rgbaToCmyk(t){const i=1-Math.max(t.r,t.g,t.b);return 1===i?new Vt(0,0,0,1,t.a):new Vt((1-t.r-i)/(1-i),(1-t.g-i)/(1-i),(1-t.b-i)/(1-i),i,t.a)}rgbaToHsva(t){let i,a;const r=Math.min(t.r,1),l=Math.min(t.g,1),f=Math.min(t.b,1),w=Math.min(t.a,1),T=Math.max(r,l,f),M=Math.min(r,l,f),B=T,j=T-M;if(a=0===T?0:j/T,T===M)i=0;else{switch(T){case r:i=(l-f)/j+(l<f?6:0);break;case l:i=(f-r)/j+2;break;case f:i=(r-l)/j+4;break;default:i=0}i/=6}return new Xt(i,a,B,w)}rgbaToHex(t,i){let a="#"+(16777216|t.r<<16|t.g<<8|t.b).toString(16).substr(1);return i&&(a+=(256|Math.round(255*t.a)).toString(16).substr(1)),a}normalizeCMYK(t){return new Vt(t.c/100,t.m/100,t.y/100,t.k/100,t.a)}denormalizeCMYK(t){return new Vt(Math.floor(100*t.c),Math.floor(100*t.m),Math.floor(100*t.y),Math.floor(100*t.k),t.a)}denormalizeRGBA(t){return new Ye(Math.round(255*t.r),Math.round(255*t.g),Math.round(255*t.b),t.a)}stringToHsva(t="",i=!1){let a=null;t=(t||"").toLowerCase();const r=[{re:/(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(l){return new Ye(parseInt(l[2],10)/255,parseInt(l[3],10)/255,parseInt(l[4],10)/255,isNaN(parseFloat(l[5]))?1:parseFloat(l[5]))}},{re:/(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(l){return new pt(parseInt(l[2],10)/360,parseInt(l[3],10)/100,parseInt(l[4],10)/100,isNaN(parseFloat(l[5]))?1:parseFloat(l[5]))}}];r.push(i?{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,parse:function(l){return new Ye(parseInt(l[1],16)/255,parseInt(l[2],16)/255,parseInt(l[3],16)/255,parseInt(l[4]||"FF",16)/255)}}:{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,parse:function(l){return new Ye(parseInt(l[1],16)/255,parseInt(l[2],16)/255,parseInt(l[3],16)/255,1)}}),r.push({re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,parse:function(l){return new Ye(parseInt(l[1]+l[1],16)/255,parseInt(l[2]+l[2],16)/255,parseInt(l[3]+l[3],16)/255,1)}});for(const l in r)if(r.hasOwnProperty(l)){const f=r[l],w=f.re.exec(t),T=w&&f.parse(w);if(T)return T instanceof Ye?a=this.rgbaToHsva(T):T instanceof pt&&(a=this.hsla2hsva(T)),a}return a}outputFormat(t,i,a){switch("auto"===i&&(i=t.a<1?"rgba":"hex"),i){case"hsla":const r=this.hsva2hsla(t),l=new pt(Math.round(360*r.h),Math.round(100*r.s),Math.round(100*r.l),Math.round(100*r.a)/100);return t.a<1||"always"===a?"hsla("+l.h+","+l.s+"%,"+l.l+"%,"+l.a+")":"hsl("+l.h+","+l.s+"%,"+l.l+"%
1)";case"rgba":const f=this.denormalizeRGBA(this.hsvaToRgba(t));return t.a<1||"always"===a?"rgba("+f.r+","+f.g+","+f.b+","+Math.round(100*f.a)/100+")":"rgb("+f.r+","+f.g+","+f.b+")";default:const w="always"===a||"forced"===a;return this.rgbaToHex(this.denormalizeRGBA(this.hsvaToRgba(t)),w)}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();const li="undefined"!=typeof window&&"ontouchstart"in window;let ya=(()=>{class n{constructor(t,i,a,r,l,f){this.ngZone=t,this.elRef=i,this.cdRef=a,this.document=r,this.platformId=l,this.service=f,this.isIE10=!1,this.dialogArrowSize=10,this.dialogArrowOffset=15,this.dialogInputFields=[Ee.HEX,Ee.RGBA,Ee.HSLA,Ee.CMYK],this.useRootViewContainer=!1,this.eyeDropperSupported=(0,u.isPlatformBrowser)(this.platformId)&&"EyeDropper"in this.document.defaultView}handleEsc(t){this.show&&"popup"===this.cpDialogDisplay&&this.onCancelColor(t)}handleEnter(t){this.show&&"popup"===this.cpDialogDisplay&&this.onAcceptColor(t)}ngOnInit(){this.slider=new oi(0,0,0,0),this.sliderDimMax=new ri(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.format=this.cpCmykEnabled?Ee.CMYK:"rgba"===this.cpOutputFormat?Ee.RGBA:"hsla"===this.cpOutputFormat?Ee.HSLA:Ee.HEX,this.listenerMouseDown=a=>{this.onMouseDown(a)},this.listenerResize=()=>{this.onResize()},this.openDialog(this.initialColor,!1)}ngOnDestroy(){this.closeDialog()}ngAfterViewInit(){230===this.cpWidth&&"inline"!==this.cpDialogDisplay||(this.sliderDimMax=new ri(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.updateColorPicker(!1),this.cdRef.detectChanges())}openDialog(t,i=!0){this.service.setActive(this),this.width||(this.cpWidth=this.directiveElementRef.nativeElement.offsetWidth),this.height||(this.height=320),this.setInitialColor(t),this.setColorFromString(t,i),this.openColorPicker()}closeDialog(){this.closeColorPicker()}setupDialog(t,i,a,r,l,f,w,T,M,B,j,q,J,ge,fe,Le,qe,Pe,lt,Ke,Rt,wt,st,ti,ni,ii,ai,fn,qt,Kt,jS,BS,GS,zS,$S,US,WS,QS){this.setInitialColor(a),this.setColorMode(T),this.isIE10=10===function Ca(){let n="";"undefined"!=typeof navigator&&(n=navigator.userAgent.toLowerCase());const o=n.indexOf("msie ");return o>0&&parseInt(n.substring(o+5,n.indexOf(".",o)),10)}(),this.directiveInstance=t,this.directiveElementRef=i,this.cpDisableInput=q,this.cpCmykEnabled=M,this.cpAlphaChannel=B,this.cpOutputFormat=j,this.cpDialogDisplay=f,this.cpIgnoredElements=J,this.cpSaveClickOutside=ge,this.cpCloseClickOutside=fe,this.useRootViewContainer=Le,this.width=this.cpWidth=parseInt(r,10),this.height=this.cpHeight=parseInt(l,10),this.cpPosition=qe,this.cpPositionOffset=parseInt(Pe,10),this.cpOKButton=ii,this.cpOKButtonText=fn,this.cpOKButtonClass=ai,this.cpCancelButton=qt,this.cpCancelButtonText=jS,this.cpCancelButtonClass=Kt,this.cpEyeDropper=US,this.fallbackColor=w||"#fff",this.setPresetConfig(Ke,Rt),this.cpPresetColorsClass=wt,this.cpMaxPresetColorsLength=st,this.cpPresetEmptyMessage=ti,this.cpPresetEmptyMessageClass=ni,this.cpAddColorButton=BS,this.cpAddColorButtonText=zS,this.cpAddColorButtonClass=GS,this.cpRemoveColorButtonClass=$S,this.cpTriggerElement=WS,this.cpExtraTemplate=QS,lt||(this.dialogArrowOffset=0),"inline"===f&&(this.dialogArrowSize=0,this.dialogArrowOffset=0),"hex"===j&&"always"!==B&&"forced"!==B&&(this.cpAlphaChannel="disabled")}setColorMode(t){switch(t.toString().toUpperCase()){case"1":case"C":case"COLOR":default:this.cpColorMode=1;break;case"2":case"G":case"GRAYSCALE":this.cpColorMode=2;break;case"3":case"P":case"PRESETS":this.cpColorMode=3}}setInitialColor(t){this.initialColor=t}setPresetConfig(t,i){this.cpPresetLabel=t,this.cpPresetColors=i}setColorFromString(t,i=!0,a=!0){let r;"always"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel?(r=this.service.stringToHsva(t,!0),!r&&!this.hsva&&(r=this.service.stringToHsva(t,!1))):r=this.service.stringToHsva(t,!1),!r&&!this.hsva&&(r=this.service.stringToHsva(this.fallbackColor,!1)),r&&(this.hsva=r,this.sliderH=this.hsva.h,"hex"===this.cpOutputFormat&&"disabled"===this.cpAlphaChannel&&(this.hsva.a=1),this.updateColorPicker(i,a))}onResize(){"fixed"===this.position?this.setDialogPosition():"inline"!==this.cpDialogDisplay&&this.closeColorPicker()}onDragEnd(t){this.directiveInstance.sliderDragEnd({slider:t,color:this.outputColor})}onDragStart(t){this.directiveInstance.sliderDragStart({slider:t,color:this.outputColor})}onMouseDown(t){this.show&&!this.isIE10&&"popup"===this.cpDialogDisplay&&t.target!==this.directiveElementRef.nativeElement&&!this.isDescendant(this.elRef.nativeElement,t.target)&&!this.isDescendant(this.directiveElementRef.nativeElement,t.target)&&0===this.cpIgnoredElements.filter(i=>i===t.target).length&&this.ngZone.run(()=>{this.cpSaveClickOutside?this.directiveInstance.colorSelected(this.outputColor):(this.hsva=null,this.setColorFromString(this.initialColor,!1),this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor),this.directiveInstance.colorCanceled()),this.cpCloseClickOutside&&this.closeColorPicker()})}onAcceptColor(t){t.stopPropagation(),this.outputColor&&this.directiveInstance.colorSelected(this.outputColor),"popup"===this.cpDialogDisplay&&this.closeColorPicker()}
1onCancelColor(t){this.hsva=null,t.stopPropagation(),this.directiveInstance.colorCanceled(),this.setColorFromString(this.initialColor,!0),"popup"===this.cpDialogDisplay&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor,!0),this.closeColorPicker())}onEyeDropper(){this.eyeDropperSupported&&(new window.EyeDropper).open().then(i=>{this.setColorFromString(i.sRGBHex,!0)})}onFormatToggle(t){const i=this.dialogInputFields.length-(this.cpCmykEnabled?0:1),a=((this.dialogInputFields.indexOf(this.format)+t)%i+i)%i;this.format=this.dialogInputFields[a]}onColorChange(t){this.hsva.s=t.s/t.rgX,this.hsva.v=t.v/t.rgY,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"lightness",value:this.hsva.v,color:this.outputColor}),this.directiveInstance.sliderChanged({slider:"saturation",value:this.hsva.s,color:this.outputColor})}onHueChange(t){this.hsva.h=t.v/t.rgX,this.sliderH=this.hsva.h,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"hue",value:this.hsva.h,color:this.outputColor})}onValueChange(t){this.hsva.v=t.v/t.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"value",value:this.hsva.v,color:this.outputColor})}onAlphaChange(t){this.hsva.a=t.v/t.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"alpha",value:this.hsva.a,color:this.outputColor})}onHexInput(t){if(null===t)this.updateColorPicker();else{t&&"#"!==t[0]&&(t="#"+t);let i=/^#([a-f0-9]{3}|[a-f0-9]{6})$/gi;"always"===this.cpAlphaChannel&&(i=/^#([a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})$/gi);const a=i.test(t);a&&(t.length<5&&(t="#"+t.substring(1).split("").map(r=>r+r).join("")),"forced"===this.cpAlphaChannel&&(t+=Math.round(255*this.hsva.a).toString(16)),this.setColorFromString(t,!0,!1)),this.directiveInstance.inputChanged({input:"hex",valid:a,value:t,color:this.outputColor})}}onRedInput(t){const i=this.service.hsvaToRgba(this.hsva),a=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;a&&(i.r=t.v/t.rg,this.hsva=this.service.rgbaToHsva(i),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"red",valid:a,value:i.r,color:this.outputColor})}onBlueInput(t){const i=this.service.hsvaToRgba(this.hsva),a=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;a&&(i.b=t.v/t.rg,this.hsva=this.service.rgbaToHsva(i),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"blue",valid:a,value:i.b,color:this.outputColor})}onGreenInput(t){const i=this.service.hsvaToRgba(this.hsva),a=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;a&&(i.g=t.v/t.rg,this.hsva=this.service.rgbaToHsva(i),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"green",valid:a,value:i.g,color:this.outputColor})}onHueInput(t){const i=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;i&&(this.hsva.h=t.v/t.rg,this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"hue",valid:i,value:this.hsva.h,color:this.outputColor})}onValueInput(t){const i=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;i&&(this.hsva.v=t.v/t.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"value",valid:i,value:this.hsva.v,color:this.outputColor})}onAlphaInput(t){const i=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;i&&(this.hsva.a=t.v/t.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"alpha",valid:i,value:this.hsva.a,color:this.outputColor})}onLightnessInput(t){const i=this.service.hsva2hsla(this.hsva),a=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;a&&(i.l=t.v/t.rg,this.hsva=this.service.hsla2hsva(i),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"lightness",valid:a,value:i.l,color:this.outputColor})}onSaturationInput(t){const i=this.service.hsva2hsla(this.hsva),a=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;a&&(i.s=t.v/t.rg,this.hsva=this.service.hsla2hsva(i),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"saturation",valid:a,value:i.s,color:this.outputColor})}onCyanInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.c=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"cyan",valid:!0,value:this.cmyk.c,color:this.outputColor})}onMagentaInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.m=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"magenta",valid:!0,value:this.cmyk.m,color:this.outputColor})}onYellowInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.y=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"yellow",valid:!0,value:this.cmyk.y,color:this.outputColor})}onBlackInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.k=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"black",valid:!0,value:this.cmyk.k,color:this.outputColor})}onAddPresetColor(t,i){t.stopPropagation(),this.cpPresetColors.filter(a=>a===i).length||(this.cpPresetColors=this.cpPresetColors.concat(i),this.directiveInstance.presetColorsChanged(this.cpPresetColors))}onRemovePresetColor(t,i){t.stopPropagation(),this.cpPresetColors=this.cpPresetColors.filter(a=>a!==i),this.directiveInstance.presetColorsChanged(this.cpPresetColors)}openColorPicker(){this.show||(this.show=!0,this.hidden=!0,setTimeout(()=>{this.hidden=!1,this.setDialogPosition(),this.cdRef.detectChanges()},0),this.directiveInstance.stateChanged(!0),this.isIE10||this.ngZone.runOutsideAngular(()=>{li?document.addEventListener("touchstart",this.listenerMouseDown):document.addEventListener("mousedown",this.listenerMouseDown)}),window.addEventListener("resize",this.listenerResize))}closeColorPicker(){this.show&&(this.show=!1,this.directiveInstance.stateChanged(!1),this.isIE10||(li?document.removeEventListener("touchstart",this.listenerMouseDown):document.removeEventListener("mousedown",this.listenerMouseDown)),window.removeEventListener("resize",this.listenerResize),this.cdRef.destroyed||this.cdRef.detectChanges())}updateColorPicker(t=!0,i=!0,a=!1){if(this.sliderDimMax){let r,l,f;2===this.cpColorMode&&(this.hsva.s=0);const w=this.outputColor;if(l=this.service.hsva2hsla(this.hsva),this.cpCmykEnabled?(a?(f=this.service.cmykToRgb(this.service.n
1ormalizeCMYK(this.cmyk)),this.hsva=this.service.rgbaToHsva(f)):(f=this.service.hsvaToRgba(this.hsva),this.cmyk=this.service.denormalizeCMYK(this.service.rgbaToCmyk(f))),f=this.service.denormalizeRGBA(f),this.sliderH=this.hsva.h):f=this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva)),r=this.service.denormalizeRGBA(this.service.hsvaToRgba(new Xt(this.sliderH||this.hsva.h,1,1,1))),i&&(this.hslaText=new pt(Math.round(360*l.h),Math.round(100*l.s),Math.round(100*l.l),Math.round(100*l.a)/100),this.rgbaText=new Ye(f.r,f.g,f.b,Math.round(100*f.a)/100),this.cpCmykEnabled&&(this.cmykText=new Vt(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k,Math.round(100*this.cmyk.a)/100)),this.hexText=this.service.rgbaToHex(f,"always"===this.cpAlphaChannel),this.hexAlpha=this.rgbaText.a),"auto"===this.cpOutputFormat&&this.format!==Ee.RGBA&&this.format!==Ee.CMYK&&this.format!==Ee.HSLA&&this.hsva.a<1&&(this.format=this.hsva.a<1?Ee.RGBA:Ee.HEX),this.hueSliderColor="rgb("+r.r+","+r.g+","+r.b+")",this.alphaSliderColor="rgb("+f.r+","+f.g+","+f.b+")",this.outputColor=this.service.outputFormat(this.hsva,this.cpOutputFormat,this.cpAlphaChannel),this.selectedColor=this.service.outputFormat(this.hsva,"rgba",null),this.format!==Ee.CMYK)this.cmykColor="";else if("always"===this.cpAlphaChannel||"enabled"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel){const T=Math.round(100*this.cmyk.a)/100;this.cmykColor=`cmyka(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k},${T})`}else this.cmykColor=`cmyk(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k})`;this.slider=new oi((this.sliderH||this.hsva.h)*this.sliderDimMax.h-8,this.hsva.s*this.sliderDimMax.s-8,(1-this.hsva.v)*this.sliderDimMax.v-8,this.hsva.a*this.sliderDimMax.a-8),t&&w!==this.outputColor&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.outputColor))}}setDialogPosition(){if("inline"===this.cpDialogDisplay)this.position="relative";else{let a,t="static",i="",r=null,l=null,f=this.directiveElementRef.nativeElement.parentNode;const w=this.dialogElement.nativeElement.offsetHeight;for(;null!==f&&"HTML"!==f.tagName;){if(a=window.getComputedStyle(f),t=a.getPropertyValue("position"),i=a.getPropertyValue("transform"),"static"!==t&&null===r&&(r=f),i&&"none"!==i&&null===l&&(l=f),"fixed"===t){r=l;break}f=f.parentNode}const T=this.createDialogBox(this.directiveElementRef.nativeElement,"fixed"!==t);if(this.useRootViewContainer||"fixed"===t&&(!r||r instanceof HTMLUnknownElement))this.top=T.top,this.left=T.left;else{null===r&&(r=f);const B=this.createDialogBox(r,"fixed"!==t);this.top=T.top-B.top,this.left=T.left-B.left}"fixed"===t&&(this.position="fixed");let M=this.cpPosition;"auto"===this.cpPosition&&(M=function va(n,o){let t="right",i="bottom";const{height:a,width:r}=n,{top:l,left:f}=o,w=l+o.height,T=f+o.width,M=l-a<0,B=w+a>(window.innerHeight||document.documentElement.clientHeight),j=f-r<0,q=T+r>(window.innerWidth||document.documentElement.clientWidth);return B&&(i="top"),M&&(i="bottom"),j&&(t="right"),q&&(t="left"),M&&B&&j&&q?["left","right","top","bottom"].reduce((fe,Le)=>n[fe]>n[Le]?fe:Le):j&&q?M?"bottom":B||l>w?"top":"bottom":M&&B?j?"right":q||f>
1T?"left":"right":`${i}-${t}`}(this.dialogElement.nativeElement.getBoundingClientRect(),this.cpTriggerElement.nativeElement.getBoundingClientRect())),"top"===M?(this.arrowTop=w-1,this.top-=w+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*T.width-this.dialogArrowOffset):"bottom"===M?(this.top+=T.height+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*T.width-this.dialogArrowOffset):"top-left"===M||"left-top"===M?(this.top-=w-T.height+T.height*this.cpPositionOffset/100,this.left-=this.cpWidth+this.dialogArrowSize-2-this.dialogArrowOffset):"top-right"===M||"right-top"===M?(this.top-=w-T.height+T.height*this.cpPositionOffset/100,this.left+=T.width+this.dialogArrowSize-2-this.dialogArrowOffset):"left"===M||"bottom-left"===M||"left-bottom"===M?(this.top+=T.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left-=this.cpWidth+this.dialogArrowSize-2):(this.top+=T.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left+=T.width+this.dialogArrowSize-2),this.cpUsePosition=M}}isDescendant(t,i){let a=i.parentNode;for(;null!==a;){if(a===t)return!0;a=a.parentNode}return!1}createDialogBox(t,i){const{top:a,left:r}=t.getBoundingClientRect();return{top:a+(i?window.pageYOffset:0),left:r+(i?window.pageXOffset:0),width:t.offsetWidth,height:t.offsetHeight}}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(e.ElementRef),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(u.DOCUMENT),e.\u0275\u0275directiveInject(e.PLATFORM_ID),e.\u0275\u0275directiveInject(vn))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["color-picker"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(s,7),e.\u0275\u0275viewQuery(c,7),e.\u0275\u0275viewQuery(m,7)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.dialogElement=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.hueSlider=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.alphaSlider=a.first)}},hostBindings:function(t,i){1&t&&e.\u0275\u0275listener("keyup.esc",function(r){return i.handleEsc(r)},!1,e.\u0275\u0275resolveDocument)("keyup.enter",function(r){return i.handleEnter(r)},!1,e.\u0275\u0275resolveDocument)},decls:30,vars:51,consts:[[1,"color-picker",3,"click"],["dialogPopup",""],[3,"class","top",4,"ngIf"],["class","saturation-lightness",3,"slider","rgX","rgY","background-color","newValue","dragStart","dragEnd",4,"ngIf"],[1,"hue-alpha","box"],[1,"left"],[1,"selected-color-background"],[1,"selected-color",3,"click"],["class","eyedropper-icon","xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",4,"ngIf"],["type","button",3,"class","disabled","click",4,"ngIf"],[1,"right"],["style","height: 16px;",4,"ngIf"],[1,"hue",3,"slider","rgX","newValue","dragStart","dragEnd"],["hueSlider",""],[1,"cursor"],[1,"value",3,"slider","rgX","newValue","dragStart","dragEnd"],["valueSlider",""],[1,"alpha",3,"slider","rgX","newValue","dragStart","dragEnd"],["alphaSlider",""],["class","cmyk-text",3,"display",4,"ngIf"],["class","hsla-text",3,"display",4,"ngIf"],["class","rgba-text",3,"display",4,"ngIf"],["class","hex-text",3,"hex-alpha","display",4,"ngIf"],["class","value-text",4,"ngIf"],["class","type-policy",4,"ngIf"],["class","preset-area",4,"ngIf"],["class","button-area",4,"ngIf"],["class","extra-template",4,"ngIf"],[1,"saturation-lightness",3,"slider","rgX","rgY","newValue","dragStart","dragEnd"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",1,"eyedropper-icon"],["d","M0 0h24v24H0V0z","fill","none"],["d","M17.66 5.41l.92.92-2.69 2.69-.92-.92 2.69-2.69M17.67 3c-.26 0-.51.1-.71.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42l-2.34-2.34c-.2-.19-.45-.29-.7-.29zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z"],["type","button",3,"disabled","click"],[2,"height","16px"],[1,"cmyk-text"],[1,"box"],["type","number","pattern","[0-9]*","min","0","max","100",3,"text","rg","value","keyup.enter","newValue"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue",4,"ngIf"],[4,"ngIf"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue"],[1,"hsla-text"],["type","number","pattern","[0-9]*","min","0","max","360",3,"text","rg","value","keyup.enter","newValue"],[1,"rgba-text"],["type","number","pattern","[0-9]*","min","0","max","255",3,"text","rg","value","keyup.enter","newValue"],[1,"hex-text"],[3,"text","value","blur","keyup.enter","newValue"],[1,"value-text"],[1,"type-policy"],[1,"type-policy-arrow",3,"click"],[1,"preset-area"],[1,"preset-label"],[3,"class",4,"ngIf"],["class","preset-color",3,"backgroundColor","click",4,"ngFor","ngForOf"],[1,"preset-color",3,"click"],[3,"class","click",4,"ngIf"],[3,"click"],[1,"button-area"],["type","button",3,"class","click",4,"ngIf"],["type","button",3,"click"],[1,"extra-template"],[4,"ngTemplateOutlet"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div",0,1),e.\u0275\u0275listener("click",function(r){return r.stopPropagation()}),e.\u0275\u0275template(2,p,1,5,"div",2),e.\u0275\u0275template(3,g,2,8,"div",3),e.\u0275\u0275elementStart(4,"div",4)(5,"div",5),e.\u0275\u0275element(6,"div",6),e.\u0275\u0275elementStart(7,"div",7),e.\u0275\u0275listener("click",function(){return i.eyeDropperSupp
1orted&&i.cpEyeDropper&&i.onEyeDropper()}),e.\u0275\u0275template(8,b,3,0,"svg",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(9,x,2,5,"button",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div",10),e.\u0275\u0275template(11,O,1,0,"div",11),e.\u0275\u0275elementStart(12,"div",12,13),e.\u0275\u0275listener("newValue",function(r){return i.onHueChange(r)})("dragStart",function(){return i.onDragStart("hue")})("dragEnd",function(){return i.onDragEnd("hue")}),e.\u0275\u0275element(14,"div",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"div",15,16),e.\u0275\u0275listener("newValue",function(r){return i.onValueChange(r)})("dragStart",function(){return i.onDragStart("value")})("dragEnd",function(){return i.onDragEnd("value")}),e.\u0275\u0275element(17,"div",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"div",17,18),e.\u0275\u0275listener("newValue",function(r){return i.onAlphaChange(r)})("dragStart",function(){return i.onDragStart("alpha")})("dragEnd",function(){return i.onDragEnd("alpha")}),e.\u0275\u0275element(20,"div",14),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(21,oe,17,12,"div",19),e.\u0275\u0275template(22,ct,14,10,"div",20),e.\u0275\u0275template(23,K,14,10,"div",21),e.\u0275\u0275template(24,ie,8,7,"div",22),e.\u0275\u0275template(25,ke,9,3,"div",23),e.\u0275\u0275template(26,hn,3,0,"div",24),e.\u0275\u0275template(27,da,6,3,"div",25),e.\u0275\u0275template(28,fa,3,2,"div",26),e.\u0275\u0275template(29,ga,2,1,"div",27),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275styleProp("display",i.show?"block":"none")("visibility",i.hidden?"hidden":"visible")("top",i.top,"px")("left",i.left,"px")("position",i.position)("height",i.cpHeight,"px")("width",i.cpWidth,"px"),e.\u0275\u0275classProp("open",i.show),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","popup"===i.cpDialogDisplay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",1===(i.cpColorMode||1)),e.\u0275\u0275advance(4),e.\u0275\u0275styleProp("background-color",i.selectedColor)("cursor",i.eyeDropperSupported&&i.cpEyeDropper?"pointer":null),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.eyeDropperSupported&&i.cpEyeDropper),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.cpAddColorButton),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","disabled"===i.cpAlphaChannel),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("display",1===(i.cpColorMode||1)?"block":"none"),e.\u0275\u0275property("rgX",1),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("left",null==i.slider?null:i.slider.h,"px"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("display",2===(i.cpColorMode||1)?"block":"none"),e.\u0275\u0275property("rgX",1),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("right",null==i.slider?null:i.slider.v,"px"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("display","disabled"===i.cpAlphaChannel?"none":"block")("background-color",i.alphaSliderColor),e.\u0275\u0275property("rgX",1),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("left",null==i.slider?null:i.slider.a,"px"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&1===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&1===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&1===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&1===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&2===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.cpDisableInput&&1===(i.cpColorMode||1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.cpPresetColors?null:i.cpPresetColors.length)||i.cpAddColorButton),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.cpOKButton||i.cpCancelButton),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.cpExtraTemplate))},directives:[u.NgIf,xa,ba,u.NgForOf,u.NgTemplateOutlet],styles:['.color-picker{position:absolute;z-index:1000;width:230px;height:auto;border:#777 solid 1px;cursor:default;-webkit-user-select:none;user-select:none;background-color:#fff}.color-picker *{box-sizing:border-box;margin:0;font-size:11px}.color-picker input{width:0;height:26px;min-width:0;font-size:13px;text-align:center;color:#000}.color-picker input:invalid,.color-picker input:-moz-ui-invalid,.color-picker input:-moz-submit-invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.color-picker .arrow{position:absolute;z-index:999999;width:0;height:0;border-style:solid}.color-picker .arrow.arrow-top{left:8px;border-width:10px 5px;border-color:#777 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-bottom{top:-20px;left:8px;border-width:10px 5px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #777 rgba(0,0,0,0)}.color-picker .arrow.arrow-top-left,.color-picker .arrow.arrow-left-top{right:-21px;bottom:8px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-top-right,.color-picker .arrow.arrow-right-top{bottom:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-left,.color-picker .arrow.arrow-left-bottom,.color-picker .arrow.arrow-bottom-left{top:8px;right:-21px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-right,.color-picker .arrow.arrow-right-bottom,.color-picker .arrow.arrow-bottom-right{top:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .cursor{position:relative;width:16px;height:16px;border:#222 solid 2px;border-radius:50%;cursor:default}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{position:relative;padding:16px 8px}.color-picker .right{flex:1 1 auto;padding:12px 8px}.color-picker .button-area{padding:0 16px 16px;text-align:right}.color-picker .button-area button{margin-left:8px}.color-picker .preset-area{padding:4px 15px}.color-picker .preset-area .preset-label{overflow:hidden;width:100%;padding:4px;font-size:11px;white-space:nowrap;text-align:left;text-overflow:ellipsis;color:#555}.color-picker .preset-area .preset-color{position:relative;display:inline-block;width:18px;height:18px;margin:4px 6px 8px;border:#a9a9a9 solid 1px;border-radius:25%;cursor:pointer}.color-picker .preset-area .preset-empty-message{min-height:18px;margin-top:4px;margin-bottom:8px;font-style:italic;text-align:center}.color-picker .hex-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .hex-text .box{padding:0 24px 8px 8px}.color-picker .hex-text .box div{float:left;flex:1 1 auto;text-align:center;color:#555;clear:left}.color-picker .hex-text .box input{flex:1 1 auto;padding:1px;border:#a9a9a9 solid 1px}.color-picker .hex-alpha .box div:first-child,.color-picker .hex-alpha .box input:first-child{flex-grow:3;margin-right:8px}.color-picker .cmyk-text,.color-picker .hsla-text,.color-picker .rgba-text,.color-picker .value-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .cmyk-text .box,.color-picker .hsla-text .box,.color-picker .rgba-text .box{padding:0 24px 8px 8px}.color-picker .value-text .box{padding:0 8px 8px}.color-picker .cmyk-text .box div,.color-picker .hsla-text .box div,.color-picker .rgba-text .box div,.color-picker .value-text .box div{flex:1 1 auto;margin-right:8px;text-align:center;color:#555}.color-picker .cmyk-text .box div:last-child,.color-picker .hsla-text .box div:last-child,.color-picker .rgba-text .box div:last-child,.color-picker .value-text .box div:last-child{margin-right:0}.color-picker .cmyk-text .box input,.color-picker .hsla-text .box input,.color-picker .rgba-text .box input,.color-picker .value-text .box input{float:left;flex:1;padding:1px;margin:0 8px 0 0;border:#a9a9a9 solid 1px}.color-picker .cmyk-text .box input:last-child,.color-picker .hsla-text .box input:last-child,.color-picker .rgba-text .box input:last-child,.color-picker .value-text .box input:last-child{margin-right:0}.color-picker .hue-alpha{align-items:center;margin-bottom:3px}.color-picker .hue{direction:ltr;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAA
1CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC)}.color-picker .value{direction:rtl;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAACTklEQVR42u3SYUcrABhA4U2SkmRJMmWSJklKJiWZZpKUJJskKUmaTFImKZOUzMySpGRmliRNJilJSpKSJEtmSpIpmWmSdO736/6D+x7OP3gUCoWCv1cqlSQlJZGcnExKSgqpqamkpaWRnp5ORkYGmZmZqFQqsrKyyM7OJicnh9zcXNRqNXl5eeTn56PRaCgoKKCwsJCioiK0Wi3FxcWUlJRQWlpKWVkZ5eXlVFRUUFlZiU6no6qqiurqampqaqitraWurg69Xk99fT0GgwGj0UhDQwONjY00NTXR3NxMS0sLra2ttLW10d7ejslkwmw209HRQWdnJ11dXXR3d9PT00Nvby99fX309/czMDDA4OAgFouFoaEhrFYrw8PDjIyMMDo6ytjYGDabjfHxcSYmJpicnGRqagq73c709DQzMzPMzs4yNzfH/Pw8DocDp9OJy+XC7XazsLDA4uIiS0tLLC8vs7KywurqKmtra3g8HrxeLz6fD7/fz/r6OhsbG2xubrK1tcX29jaBQICdnR2CwSC7u7vs7e2xv7/PwcEBh4eHHB0dcXx8zMnJCaenp5ydnXF+fs7FxQWXl5dcXV1xfX3Nzc0Nt7e33N3dEQqFuL+/5+HhgXA4TCQS4fHxkaenJ56fn3l5eeH19ZVoNMrb2xvv7+98fHwQi8WIx+N8fn6SSCT4+vri+/ubn58ffn9/+VcKgSWwBJbAElgCS2AJLIElsASWwBJYAktgCSyBJbAElsASWAJLYAksgSWwBJbAElgCS2AJLIElsP4/WH8AmJ5Z6jHS4h8AAAAASUVORK5CYII=)}.color-picker .alpha{direction:ltr;width:100%;height:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==)}.color-picker .type-policy{position:absolute;top:218px;right:12px;width:16px;height:24px;background-size:8px 16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center}.color-picker .type-policy .type-policy-arrow{display:block;width:100%;height:50%}.color-picker .selected-color{position:absolute;top:16px;left:8px;width:40px;height:40px;border:1px solid #a9a9a9;border-radius:50%}.color-picker .selected-color-background{width:40px;height:40px;border-radius:50%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC)}.color-picker .saturation-lightness{direction:ltr;width:100%;height:130px;border:none;cursor:pointer;touch-action:manipulation;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwksPWR6lgAAIABJREFUeNrtnVuT47gRrAHN+P//Or/61Y5wONZ7mZ1u3XAeLMjJZGZVgdKsfc5xR3S0RIIUW+CHzCpc2McYo7XGv3ex7UiZd57rjyzzv+v+33X/R/+3r/f7vR386Y+TvKNcf/wdhTLPcv9qU2wZd74uth0t1821jkIZLPcsI/6nWa4XvutquU0Z85mnx80S/ZzgpnLnOtHNt7/ofx1TKXcSNzN/7qbMQ3ju7rNQmMYYd/4s2j9aa+P+gGaMcZrb1M/tdrvf7/d2v99P9/t93O/3cbvdxu12G9frdVwul3E+n8c///nP+2+//Xb66aefxl//+tfx5z//2YK5Al2rgvf4UsbpdGrB52bAvArXpuzjmiqAVSGz5eDmGYXzhbAZmCrnmzddpUU+8Y1dAOYeXCtDUwVwV7YCGH6uAmyMcZ9l5vkUaBPGMUZ7/J5w/792/fvv9Xq93263dr/fTxPECeME8nK5jM/Pz/
1HTTz/dv337dvrll1/GP/7xj/G3v/1t/OUvfwkVswongjdOp9PzH3U3D3zmWGnZVXn4jCqs7wC2BKP4/8tAzkZsoWx6XrqeHZymvp4ABCBJhTQwKfDT8gzrZCIqi5AhiACjBfEB2rP8/X63MM7f6/V6v9/v7Xa7bYC83W7jcrlsVHIq5ffv30+//fbb+OWXX8ZPP/00/v73v4+ff/75JSvbeu+bL2WMMaFbAlpBNM85QX+ct6qoSqkPAwuQlBVKqGNFSUOAA3Bmu7gC5hNOd15nSwvAOUW7C4giUCV8Sgn5L9hNFIqTsp0GxI0ysioyjAjkY/tGJVEpz+fz+OWXX+7fv38//f777+Pbt2/j119/HT///PP49ddfx8fHRwrmTjV779EXu2px2xhjwtdJZQcAWQIPLPISsMJaSwiD8gzIKrwSyATE5j5nAbR5c1dBUwBlsEWW0h6LqiYsqFPAQxCyRZ3wOSARxmlXMX5k64pQfvv27f75+dk+Pj5OHx8f4/v37+Pbt2/jt99+G9++fRsfHx/jcrmUFLO31gYDWblxRIs/TqfT7ousxJsAxXA2Gc7TA9XdgfdoHbFsj76X2+1WArgI1ageGwA3qupqoHsmcbI6Fu93quggFa9d7LeDtgKfAFHBJ+NEByIkcJ5KervdTmhhGcgJJSZ5vn//fj+fz+18Pp8+Pz/H5+fnmGD+/vvv4/v37+Pj42N8fn6O2+1Ws7JjjP6wraMI5E4RZ8x2vV5TSwkquotV7/d7Tz6HFWsD/qNcdw0CQ3q/321c686TwDVIdbuy73zNldhSHb8I2klZznm+InBS4U6n0302aBFsLhHDAKJVJVglfI9jhvu53W53sLANYNxAiDA6MCeUHx8f9+v12i6XS7tcLqcZW57P5yeY8/fz83Ocz+fnsSmYUyknWEG85WBst9stzSLyMdfr9Qi08iY15UZ0LlDGLhR3o5zK2j7OPUTD0E+nU3tk7Xb/16NFbhloAMuY1zjLUOO3BKeIDe+Z8s3/J4gFo4TM5jPmuRg28foUKKVSwo16TgA5npywcWLHgYl/Pz8/73/605/ab7/91m63W7tcLie0sZj4mao5gTyfz88E0f1+j8EcYzwTPEG2cqjyfHNF0M8fuqEiaOVnRzZZQNh5fwQyHg/HDGfJo89Q1zb/quu5XC6773I2XKfTqd/v9+d3wuqWva/YTdUdEV3fhIv/Viyps6YE3x3r43K5bJQS66zaxVGFsvd+//j4aF+/fm3fv39vt9utff36tf3+++/tdrudvn37ZuNLBaaCMgUzC+rZRiFowxUuJI8YMqcCp9Opq5vagaYU6lGJA1XQqejchw6Cj0Gw5nYBrGw01A2O206n04BGouNNyTfp/FwElhUey6nXrIKw7QQWddxuN2ldL5fL839gSPF8ahu/JvBO48CPSuqMf8Vp9/P53L58+dLu93s7n8/tfr8/39/v9/b5+TkhPJ3P56mQ436/j+/fv+/iSgbzer0+AZx/5+88bv6OMda6S5z6kd21fYC9dxv7cIJJ2d9AOS30fPMzyHiTM8B4DF6XUlYHp4KQW3W+1t77MNB1vGHxWq7Xa7vf78+y5/N5A+H1et29xuP5dbYtyaRu4AksbPq6936fjRzXRxBbPr/b+b18+fKljTHaBBBfn8/n0/1+H1++fBnn8zm0sB8fH5u4cr5GuBhMVk0EEn9RsctgVhM+ixlJtMA23R8B6yysAstBOgFXIKKCMIgToMqNEu2fYMH7ztc732dQKkCj1ytAZtY0Kx8pIr8GGJ+AT3V+2Hirhl++fBmXy2Wz73w+b17P8p+fn8/tUwGVleVkTyUb68DkfayWY4zxNRihU4EpLJPZVrK+u7J4/mgfKqeLW9X2REWlItL1diynbDDb3+jXgYjQqn0rrxWc+NkILP7F7xIbMvx7vV53x40xnlbWJF12ZSag/N0pW6t+ZzmOMzHjajKwDfond78zYTdfq18up97zr2q8v3IioBprRtBl0EZ9og5WBRGOdOHjIjXF7UotFbgOWnXzIJyzYvjG5IYgsmMOxHkz8OsMSrVNWeq5T8DaOcbEv1Od
15rbs9aO7YvMet63EkF++fMExq+MRl4/L5bLZN/+ez+fnZ6KazuMqXSQVO5spJXflHAIzes/xJseckRJiDMog9d6VfRrqXMr6KpVV27jRwJacGovOAM1zMdQMnwK1AubK63kdCChvI1C7g0z9nf/D+Xze2Vj8H7Gx4P9duQlsYCrqyN8XqG3Hm/10Oj3jw/n+crlstuM+jPmmxT2dTuPz83Pzt2pn1XsEHX/bnPaVqVmh0xwOt0o6XLLAHePUU203wHfcrspCwmV3TryB5s0Mseeg97x/BwzCjBlbB+pRAPla0BVQuT6V6QHdBlj3d0KG147b+DqxQeUymDO43W4dQar+TIjwmAd0z8/h65vf0/yLv3Pb5XLpru/ydDo9s7ET0I+Pj6dKK9VUEIeKWQWPAOrJ8LKd4vE+t91Y3e7UFlWatg2VwJnb+HPmtvm/sfK59/OaWF3x/eP1UPHvA5DDYDpYXfb0drv1V2DkBkxtw/tEWVVlXWdC9pFYs5/jfh9dS/16vW7s6lTG+TfqsxSJHxkXXq/Xdr1eu4LsfD6P3vsT3N77DkL+zPm5jSdKL4zR3AxQd6rHkLkYlSowsrq7znzu6wSwdsMJOXmA5fBcjxtgMGBYHlr5zokhtsMCTgXLQOW4XC6dEyEMprL8mAQzXRgduix2yZzorxkYsDn3hB1VeMLGsXsVtgl2pW8S3svk0vw7R4hNaHvv4cACl5HFzwIH0Kc6zu4XjDPR/jpAVxWzO1Xk2DDb3vTcxeGU1iWZHkmIDWziWKvirCJ4Dravs6IJ/GG6cTqWdXDy+fArQDVVkLqkVjAoZIITdmmIqXwqa95N3+MGYoZQdRVNO53Y1xRkhO16vY7eu507Ca9lJnbGpxOemQhSw/AQsmmp5zU9BiU8G6wvX76M6/U6Pj4+do0Bz4CpgiknTUeDqwlKBmg3u4OVjrZ1A+rAcgaejWq6eJCvCYFDONSwOgHX4EQRw8lxbzDOdEK6gZ3Hk1b+8g2o1JFtKXyv/fEdTXuWjWXdAZiBp6ADeDrCFiim7B6ZFneeI7Gvm/PMkUDX67W7xI8b0D7/v8dA9qfN5oaCf74WZjH0mf1cmfY1Y0JUFmVrTWu8uzkNcLtEj7u5FXBTkfC6GOA5q8YMxO8KVvF6sAVGdcrUbsKODcQKkLMOMdmlxum642YrPm26AlhZW1YB1R+rrGswE8TaYAWeUMxdf+WjwSvZ2Ef3ytOyfn5+PpVPAaqOn43MtNBqvmjjxbjM4lZjZY4gqNMI5ktaW/sYKNwS+9lFQzGihmMCKPa7+Z0V6Eb0GRmobtpX8JljWu5FMLN5ja6hG9kwQgZqf5+1NH5UxzkFReCdWhJ8XdlGUkxO7HRlYRm4mVO43W7ter12TPJEw/rmEN3L5SKHIWZg9mz+pUoKOYq5bJTJdX2gme1UcxMZQFaEQIlHct32M+Y1BzGkGuzfiyAN9z+ugplZ1symCrDCYYkGxDTpI9RzBy0rHyeDUC1nWaeUaD9n4xkNyYMBDZtzZ3B++fJlY21XFDOcARJlabOyiS3uCpLI9jrZjCDkaVvcCCjwognKShWdzXZWlZMvVTgD8LpqlCLrqgbcB+qYwrgKYpT0ccCqbKyCValkEabn/FynogCrPKfqf51xJ7sGB2ZXcZmxoSOztjx300DZi7a0/2AIR0UlBag9SuDw6KcAzlaB7vHZvWpjK90dyrq6bKyDUZQbR0B05biLQkHIcSUmgIK+SwuqgHCnoio2RQU1yj+BnBy9pphVKLGyC7ZzFK1pxWK+E8IhVCWLN/uLtnUU4ayoYLoaANz8FdtaSvY4pV0BEW2ls61czqllBKpTyKgMAhrZ1cdc1RROtPmvWNkdcKZ7ZKxaWjiPLJMpp7OZKxA+rqG/oJLjxf0pnJlqLoDZo3gyU0mKGys2taKecj/d1C+rJSplBqlTyAqgR+D8KjKlmRL2gtUcAdCtsL+ijCNT1oqqqkH2OHEbG5sDFnUg5Aa+yLou2VU1ptj1S2ZQqv1ORZN9IWzRfgaRBxKoBE8UWyqlJFtrIc0AxNjSjed99CTY/XDfSzCz5M0IZoVEsWnPFNTsl8ooVC1TzbGgqFZNDSgVwKK+1sGDMKqxZCWGVMDysiEr1jVSQJUYwj5iHOlThdHt44SQg9CN+nl8D90NMIgAdgr46JqRiR9I8vRdFvbr17m/yxUMKjNLMiVUADwu2CWGhhi+F55TWM9M9cogzms1dnM4uOF/LAEYWdcqnM7yFmyq3IfwmOROd7Y1iFWtOjoY8To41mTV5IysgFFuRzsbWFGbNIIJCDv1dOo4lZG7jWBwRFtVTKuWyeCByJKOan8oZ3ep9XddNl0tDuaywLz9cXPYeDAA0SpkBO9sbVcTOVWldPv4uyzEkzxHtjvonHoSkFEWNoo1d8DhcQputd2ppNon4BzoAiJ1hBFQg0dVtdbGHHDQWushmNEQukLM2QO1G2Y8bgTXqFhcBJj7EjPgcPts8US8qPpPB/dXznOh5Z438tzH5ec6QgrOKrRRfKmysBmUDB+PhYabMlVPER+GCSITTzr7am2tArH3bgcEzPJm+cr5jJ4NnHNFDVrFXcI5Le9k5Jnw+bedbV+FfRzZIHaOOaOsLY0/7UGs58DjrGwKMIMFIGzOEW1/jGsdAtCN6hEAI4hBe9YXeRROBSVPAVPAqvIM5bx5hVKWAMP6zBRy3iescridVdFBinBxXDnG2GRY2XbCvp1lhvGtO9Bxu5h908XQu42lnSArMFdizMim8uwRCxPGnnOS8lwpnbOiDqTAjsrRN/PcoAScCbaACqVM40ylnjjTBs+bwWlAG23/UKbdkiwKWIQPGzWaczpoSlxPEj822cNWkpS7FyzsDrqpfgpG3jahw2vgbaSQAxuLWZYt7JzyNe8JoZpNAcvDFOdw0wqYT9AK1rZz/DdbSlLPp0ryIxgQJlK9AZlEq7IOXpohg9PIhrCng88JsOxiV4ZWAYfg4sikx/8ky2Z9l862uqwrfscIH8+ugTmVGyiddeVYUgEMn4GZzg14EwIsh9sx2cKKiWXReuOE5gzGOQgdlRKVVdlevqb279Xq0Qnsts2VDaBO0coezsruWtHApu6sKG4IBhN0aGU2kLrMKGRTN3HmbCDwKV14zvkMEDG4QfZVspVlaNU2mhc5TEZ3N1h/zqTheuLpW05ZWTGVjb3dbnNmxKZBnN8JqidaVLKAOyARNLS+MB54Z2+VaqoMLKroVBlngefnTPAcoHNWCSvlfA8CI0HEmBNBnBlXyMrzU7A7WVm94PPqQ2gmqKx+WDGsnvilmcSOBJqOK1nYyAIzuAyesq3UdSK3KfWcYKD95HmfYOU3qser2CtYEUA+FpfqdNvgPBZUBhDrGONRVlQsh8rLcaUCykHG0OOUwTlLBrsh5soEMGezi1E4HRVt1icp5wZEFXdibCkG8Y8vX75sbO4E0iom9z+hjSiOfy3DhpXItpVhE+UGQdvoWjtChmrGHf4YAzKgBNnGtuJxFCeGdhUAfQLLK8kBYAP6gvFJZajMG3Xkycy8KuC0q4Eyymwtwdxdv2M0mIBtK0LKnf640j00Auq4gUkdWGlhs22qJc6dZCsL19oxnlTJG4SYVRIGpD8TPFBuM6OElbS1pldid4mGAyN6ZIupbC5bXJN9fdpbThSxLUaI8IG1XIYBxW3Tjs6KQosKcxfxcQmdnwRGM10GnFcCy2XYunLMyAkdgk4mePiczsLygthcBut6goOqS7YVFXADLjaosB6s6ofcZWAZSIRYqSUkizYwttYab3vUOQ9w2HRxIIg8WwRVeE68xi4UtL3zRphxplzwuZrcqYCq1I3jPI5dnJIygEohMbPqVJSzrwzxBJTs5zN+ReUSgxikPQVF3JVBeNQxbHENrEMNvEdFZVV9lH9+ORGEsNZQpyTNc4C3AG7XF4ngzq+DrO2zbuaaOXgdaFcdkEotoSFBVX2qJ0C8OWZeG4KGlpghA0XfTOPCqV2qqwQ26QWfF2PMLhI2w1lVAa2aPsYd0za25MQRwgcZN6uQDCi+ZxiD4XEM2kZxOT41FnZnaRlcpZouzlRqqdbQVWopQoSB58RV50lBNrHi/AwXS5LrwDVlpY3Fc3ByiYGc52Trist6kOXdwInAQtJpp5QchyaquYOV7Su+fxVMaV3dc0RE2S6mUY0gLt2pMcYqrKIQ9w2l1gpQUMtQYcmmbt5DTNxdhnUCjQqtbK9SUSzvrC0mmhhE1e2FS2+oxypy/ZASutkmtjx3vcBC24PX65nbqkBCRhfjS9kIYPnee8cMagVOhI/3T1fAmdtAWZsCswTJCkQVNa0qWKSKPOpHAUhD9DrbVcyoYkwqhvh17vYAayXLQyKGYdxlUDFp494rBXRjYgO17DDYetNIUj/ezp6S0lnlpEwsWmJMkOwsKXeZKEAjIHn0EQJISaRBcO6UMINz7p/bEjjnw4ft+xmDvksxX4G2rIris7qaeKwAFMP2Oi7n4criuZwtpSUwpfLxSnORSrIqusc5ZFaXysqRWjiZ2DyAWEIL35tVSoQElFACjOeGGSE7AHEQgdo/LSvCOgGBvkxsmDbvlS3Fp5vhaB2TAGqRKrKKMrhLVpaGzEVjZ0OQxDhaCTA+QyRR1d15aQzrJntL3RibsipjG6jlgL4yqbS0sNYg1e84vhbBVrElK64CUcWYXDfKxhpIuxiVJZUxsbMy/uRBKTNRQ4kQ3LdRYLS0rJjRPlTPqY6gdJsEDc+aQXAn+HgsNUCbRuF0Oj0zwnA7bWDkbhO5Ens00qeQhS1laBMl5M/cAaxsLF8rKyql+Tf7ELLEGu/ixiimdCvo0TjfpjKwaggen4eh5v7LokLKbLuyvHhcZG8dhGrEDx7Hg93ZppJF7qBqO3iVveXEDQNInzeoe8Yq6ePaZBZ2JviM3W2UAGotekRCAGq4EkF1X3DOnR11yRsBL1tRa0PVcZiNFXZ2c34FskvomInQQ6lzpJoZbJxk43NwKJFBquJSsrByHydxKOnTxQASBmS3j+JMnsHSla3Ec6K9VWoJVn9zfjwOM7hqYAAqJQwE2a3nA48J2QGegRkpZNivSY+ys3EkKd4oJIwsvIHl3cWgLt5k4NH6OmtLWdpurOkwEMupYc7eMtDRhOcI2ui5JhVIzXzLyto/GAPuZoyo8wkoduVgJglCt7OhGbgID4Mq4si+63zUS1FuFFXFlqyaj2emHlLMcBqYu0FMuR28BbB7lOxRMSiCQXFhCKuwkhZ+pYDiGSgbsKKV8MiSRsuHSIWM9rklRiIlZZuqXjsQK8ooYJMgq3JKWVkhHbhsVxFUzthOWPkYijcbx54IKsSdT+uLr3crGKyoYgFiGR9iBk4kfloUX+JIlQRQqabmpgnhqtpQpb6RVQ1WH5DnrS4hEoGZqaerQ2dhFbz8XePxShmDbo70eISjoorO2vK8SJXI4SUmEU4zWKDzUDtWTYw7xXlbSTEj4FRg7zKnKoGRALv0Gs9Tgc1BpCywGZRQAtqVz2xrBcAMzEpfZwFSa2G5W0QBFjSMapWAEFa3HcGN7CxDzECyIkJ97qwrqWNTWVo876PPsjPkj2wvgroM5lLZKMETKVql/CvnWVFiFa/SzJUQwkoZsr67Y6vlSRV3/2tmNTOY3vnaxYwMuoPKqdzR1w7IqHymlPxaAThfU7Ko2ZXYj4AYJHL+kNdKwRQYESTRa5fsUZ/rVC1TMTyWVyYoqNtuza
1HsMyv2tvoarxdfqwYgU1axFo/cnql1FGsqK+uAROV8BX4GU8WcZTATi2q7Qcyi0O0V+GhWBMNRUkn8H1SsWVE5By3Gi0ECqUeJoBfAtDa4amkdXG37AGP5Ggeb84p7UazpoKRzdFzeQ8HkoHGxprKy/Hpm5t12p47J6xTYDEz7uINEXSuxYXvFskYAc+ySxH9sf5ftKzU6IbwVBcUGg5e5FMCEXSErZR0wGayV19woM9guPjTqJdVTqR4uE4nJnLldWVkECCZLd2VLF+xtamex7IpiriSDUpvrpn9lrwGMCHyppMH+ps6LILsuFGUj1XEOXiqbqSHPUKnClpWV68kqtURVNDY4TNaocykoYeTU5ngGEQa/S1DnnE4AeXMcKjHPAmFVjCBENaeyLVNHfr3px8xUstJ94hIpfH4HKE/eDaArK6lSyVVFbdt1gxTIVk3pppVlFXi4pEhVBTObquohU85MLXn1iahvUkHJjSCMc01tLFveVVBx0DodM6jftCu7DOtIzYxrc0qp1JGP2ayYFz2Gb6HvMrO8cnGtV6Gjm3uImSfD2GpWK6uowbZGMxFKQCo1pOMtcMXFpRst+hXGoAomF3sSTBGgTglbBKWwsQ3tZqaYSp0Z1CimRDWFcCJUPYJ00BI5FkKYNoifuQxmN88SWVXWLMaUqqqgC0BmQJR6sk3u9NCf6jYLXxAfqsYEgVLAhRY2AtgtflZNFmFyhxdrLkAdWlk4D88M2ixHyepIdhMHrG/iR1ZGtq0MGpbDbRPYOXeSY1M6Ny4ZstvGSktK+XbFPATj2D371saPEsAMXhXrsZ0km/XStkhhMyBfsa6uXFZe2VCe+YMr1+GKgwrQyNYq1VRrB+EizAow6NsdNKcyVEkYeM73ys6q4kAHp6BiFklTkIrVC5oYV7uzwOGCz4UJ0Stq2lWMJy4wtb+RetL6tZFicnJmBw5UjCvXXMZVJX2MQkbf+XN5EWd78Vz8/JEsMZTBiKNzsm1inLRUQ74H4NidaqI68j5sAFgxcRveC7ieLJXfQYxjZZ2CsiWFewZXJmBIlZ1tdtrX4hSuateKso/RZOtOKW2nmq1oTzeK6dRWAWu2NRVb4hq0SXm1GvtugHrbr5IXqmSktg5CuDE2MSlPwsY5kNE2Wp3AqiZbWVLAxiBF+2iBZbuNj6MB6rsMLC7FyasaYDyo7KkoPyEtw3pEMXfPvxAJi2jAQQgjrz0rLIZSWZlIoNhwd5xK4AR9mYNjWAaLrnuImJeBVN9zBORObVvbr+mTTfFSEJLSRnHo7hEJoIi8MFqjxmvgmF5URZz4zLFgZZ8Ctu2X7ggVccKm9gVxIsOHqxXgNMKnFWZYnf1dBnOhayXq17QwFlWW09eNKyVJFmXqaONGA5aCegMbJ3UUkGY1ic3nKWgjq8qfVYGQG1gRt6rs62a6HiqqUOqdesK5NmX4nGofJoiE1d0dF9lVVkvT1/kEEaaCoYOwFpcVcoLM+
17669PxC9rWqktH0sWUYld0VCpuBZ/stVRcGgy9WX2+U1Qthi9SzAqSxzZsy+OiFzBYnySGV6Gku44rD8BCOZBV3BvD5+AKRHNwMEsB6EzHnJpkTAeiUlEGkcECeB6GDZTp5YEJTlvdrknxYjTllMkfNtXwDjM7uVjK5JXUUn43rrqpK2jytaxHW0M5G8DC8rtHMYs7KSgduVQMGTYFqFvVS6rkD3sDJ46afdYFwoq11AOKCBLhvwoUgc8IGANycR6knZrdJPdsuxnyjfd3FovTlRMdEdtOl5CMV5EHsXQBis7TOwvIDZaGj2Vnpbh7cpK63VwYEMLwqbjzyl699sawFFkF1yqjUU31HfC6sW1ZFVFuXVXVgz9keEaw0ys1lWfm+azQAQSWA+hKYVfsZjPncAcUB9oIayy/UZXRNckDGji77GsWbvBo6tPrWPqOyVkBUq+INeqpzNdYs/u0ifh5qmpqIW+33JVSUcwY70KL4U9lYdU6ljtSls7lmfi9g3YzeQfVkaGFaV3ODCnaD2N8wsEDFklE3RzM3ZghdYkWHsszq70FIecnKkVkt8ezMzRq9bkGuKojRLBVSod3Y1yPqKgYW7JRQTPVyy5xIYLjOgxgT52RKJUY1dOrIiRd4futQx/A5AcSmEjz0vFWrkLzvbWAu9HOWbGgxFk1VNTpnBKk6TgwisI/HcxYXP1uAWO72ULFlBTq+aSu2VTUs6hrxM2CF+hEor1VIA9ZmFUaab1lSSgZsVs4sxzHlVLoJHr9H4DhONTkI1XC0/wiY2NoWAG5RlnHFnq6oLccpQddMuJ/O17JVA5OHLi0BqCztq7Y1++ucCd98qLI8MIHBV/cKjxQTme3hFBS3MyCqnDsuym2o80HjvFFTtrURmNaGJsmVahImjTsUXKtQZTAVs7Mvv8/+fzUrZAXcLJ6M4koe6XP0b6SmWWNDzyUpQ8bl+LtWx4tuqZ36cRYV3yuVxPNwvIiqiQCSmu7srgTzR6nkyhpCarXwFy1vGd5iP2cY06lFr5Njhhg1Y6+NB28ftbK83s8rf7kLJbKwDFPbLg25a0AdZJEiqr5phixKMDlRUtcssq1hriLqGoH+zeNgVm9OemjsETV8JdF0NHnkIFxWY1OB4Yrp7rtWJ7NgAAAPXklEQVQ3oNs5nplyVf8u2FoLu1JrHveaZWQjqAkshtFa2gzsSG3Zpkbvg3HafF9slPPlldjFlK80Gysm8Mr4MPhneNWENPGjAIpmilTPATdTRTXlCBYHYAQuPwA36xIpWtGN4q3Y2MhiGsUpuSSnlEJRD8PorC7CFYVw+F51qThgabxsTxWzCGY0ZSsb3lfqAy0OPNjNy8xiQQKsHYFQ2HBZVvVbBuq3m1oWKajqaonsM6uZUr6CjXWNZ0l5E3h3jURma6kP3MJIiy1Lm+kahQq41N2iZja5sjtlLYNZHZrH6qUGm4vMbDp6Rw2CFmvuyFkrBcCyMtFqBaECmsHoK9BZ2LA/lJcRqSaDqnaWbrZdGaz3DLgIvBln4woGztbyJGqslwxkhhHrTjTYFXCtOoKS8uLdofVdAbOylGU6nlYpXWZts4nXBq6WxJitMNokHUJnbnJplQm+aGpY2a5GMV2QD1hRubBPFKdumf5OHkLHz0F9luE5kjBjRa0nFE5CUGqHw32MmjZ6xkgINVnSnZ1VZStK2qKlRaLlQgK7uTq7JFXJwM+3SOEKyhZNI+tJ0I5qMYy9k2qJD7dVWdqKXa0CKNR0Ccjg+B2IYu2fcBZJZkMFgM11r0X92wilghFGgzVnexlqB7xL9mS29SiYUVY2nXOZjNBRsyDsQPRWW5hrZ4XcdC4HVWRbjgJr4sFofK5SzjQ7rhI1UebdPdEbj6sqIvTZQZ5va08rABsAW0UxeWytAk7A2KJ9ZpxzCioB24XFtYAeXYxr6anSqhLgppEqWbGwLunTgrV+IjWlL29ljaAl4EQMGsErp4apeZiquwRXLXAqOCeru32mmydc6oWTSWpFAGdzeTB8RTHVMEtlM90CbbQCYhPjq3egYr1FGdYIQjiuDGZ5zZ/AzobKGOyLxti6c4Rwtv2anyWlLICnlLhxJRXt6A5ebDBWFNONbxWZ2d02mnu4S9YECpeppV1zSWRBWxHYzVIv1CXSouwqqX3jBBBDZdYQbpTQW4ZQlS8r5kH4suSRmg2++3JN10x1PaAmEkmtYlEdeGpJEM6kOuCqCR22oSujj5IV2HdT0zj5prLKTjXFAPjdQlyq7xIBxAQP5yMczG4VxAKw0n6ilZ2QBce2pLulkuxxqnoIzFfgqyqjil9S1VNwBrFmeyeops8yOjZUybZdfS8CuaTIJumzs5tODaNtLpFDQ/PcJGweLhmeL1nB0KqiUDScsiUVD89Di3HtrKtSULw3RLiygZD+7sF8JTObgYsrGvDNUFRGl1iy0Ll1YkUc2aJYMog920I8qW6YDCg1Mqk0JHJFKXkbgbRreI+qpYNOZHrVcDUba7pjsphSJNtK6upgRNAVoOS0mugBeN4bIZgHhuPZ/s1ENaX6KsVr+YNrh1Nb7ipR0PE5zbNRegCbrHRUw6Yf07dLBJl1f8KB9as2V1nNqAsl62LBBhehwalerkHmB1JFIEZKSEusdl5JQj1nJlHXSCF342gJ9CYGrXelknJIXqVP8sD+qtplCR3XH2qfKq0ygMp+KnVkKxNlZ8m2YkIlVMiCnXUwl7qznBKSvQz3m3Pt6oQbXO5b5FixCh/fHxUQW/AEcK6zCNqKQnL9sywqmKuwvqSYzT/aPVNNpVyhvRW21aqciCsjdWvBwILUvh5VyCzbWoC1pJjJ680CWsl+udKB6T5RwG1mlohnlpbg47iz5U9ha0FGtmRLFYBtO99y97Ap0z+ZDTAog6kSLZsMHg/IFkkgp6CpvU2U0cYVSdnmkjwBdOmXbxTWNWzuIbipMioVxEckZEoahSOiy2M3K0jcC1LhVDwaqG0ZvkcWqCnrG4GIxykrqlbWdw6LQyBaZR8HmLRIhQWsHswD42ZXVLNkf9l+FlW0HVQ2lwFsC/Z1FdzlQR0KaPfo+Fdfu+/dwVRICu1CGR7AEIiAhc+AZUF0kOBaPxmUqg4i64vQnU4nFDYJ9Nz+1fVXveH9qmr+kPILx8oKcRV/BFbxbE0JMT0kSD4w6L/lNY8ocsqagVdU3A3MjxhxcGuqzsPH4irpaow1q6OyrVjvp9Npc59E91LldboYVzJWdimWfAW2SNEKcDaX2FmBLLA/uKxlmhh613Is1URQApbKfttwxL02q6Onx5pQxSbPojAg+v5hAnN6LHVRDXIsvKtRjiS0qJUyZTAXVbAK82ElFJWaQdVoqUC1Unt7BVaTQudM6SuqexjQJN4+0icaxv/utbKv83ETbT8H8gjcOKxOJmbUa6OOVXht3dFY6rHv9XoNzFLceEA1o8+pKm0LAHPHZ2rYKjFq0hfZFixsqHJgD3eD5n+U0kb1mFjXkn2lvMSSOsNE/CdIAKF0Sytq6urOHUN5gwg4GZosgbmggM5ucra2qrS2Ig1cbiBBcxYzgzUDNLCvL8GbZXNp6ORy3LmS+Kk83zRIAK6A1ioKa2I9NapIuiUFdfC9766PFZUtqUr6KbWk+zZU1a/ZrIXEztrjTOfz7hwKziCeXIaraHtbZIMz+2pGgazCmw4qWAFvEdhodYp0Xq0pV7G1YWYWbO4qhGq42+Z8BYtrLWvluNPpZAeaFFS1vubPgbgxsqcpnAaszBovKaFoDQ8BGtjfUOl4NAG2nmQV04feJgumvX2fsrQEWZghL0JnVdYkn3DOZIeRN86RqPWCmsvGVqEMRnwxQAxwS8EMYo3IzmY2+BCcLp4MKiuyuhImamlbZFcNoNl7tp+RHd18ZjQIRKyXdFRhN98/hyKqwXWNo7O1wiaXoHN108REZZWEq6grnIfjzeg8jdRf1XEL4kkXa5bBjKxoKaljBjeHlVxQ4GaycpW4lDOAKtnTxHAtOfzOtZwHAM7sqVXkV6yu6kap1nHkXKqWF/4XHqjenNKqBjpR3l1ch3Ejg1+EsgdQhsdG0B4FM9sWAVWpuAyiwTPleZxt9VyZVS2qXfReWqTAilpr9ApoWTj
1xymit7NwV4JTriZyOA9B0k7HFfULourmKYHVnRQvqGL5HMHdqFcR2qWpmcK6eTwx2dipWrviDilr+fKWq3OWRWdHKwA4eu8wjchbeRzFilqjjZN3ufCpfkJ0/scVpnYk6L0PI77lxdWCZ87WiWm7B/AGquQSnujGKsB8CJmiJq8q1pKIVWyqOiTK66r18BN8r74/AE71fdC3yPS2MxdOpnE1tlVxD9JmVOoggN+r4PjAXVFPa3Eg5jVJGFVUGNolH20GVrUB7BOySWq6WqYQdWR92pcFMYMwckbSgCKCqD67DiiWu1g8MQC9ByfcFqW1L+jL714qNCuznoSxt0da2gtWN1G8F0BK0NN0nuimelUF9dIdAfjO44UT3CjQLoUeLHJFTO3gmpRuIIOvwBQCbqNeo3qtZ9iF6xVK13GRlo4zqimq+CGdTiR1uRY8oqgE02hZBa79kZXPMquxRHKla2saZWN4mRqZUj0vLCKhkjKnqOQHNuSZVJoKvAqS1wpEquvWDC1B2ypwrCPsRMEPVTODMLJMDv6qeKXwi2JYV5Sq4qKyvgGsHCLiuj2jR59V8gMqSJ2FJZRXEHVRHj3sFPrct6OpqlW1GpatQdt0GvwfM6n63InsGVFhJGaBqgqqIV6IsXllZgySPq4R3bnt3wi5cv+cN2yqQLW1T95KYVsWWtKk4cB9W53WQQflQYR6Wl4HaJZjvVE0D5yvq+RKgZCs5qdBEP5sD94cAvQLlSgNaSMAtHx88BuNQ41zdFsX30zKbcs0MLD/ihkpQzl0wiTqKLTfbKmCmyYICnK0IbaieC4CG9iSyLQ7cIMGQwau6TKoq60Apl3WN40LZpca1CKKK9VQyyIEn8w0F8F6CL2h8o3ixGwC7s7EWzCOqmcApYxYD4jsAzVS0sl2t98pA7vrKophCVSonbYpgH6mvSn24pTBV4sdtV3BtMq5k82y+IADvUJ0uAlkCVTxIaPm+UNu/qkV4F1TzHXCGrXIAqItBKypqK99VtAOVs64O4ObX7pHLVCpYHcRmwvLR7TvYAKBBN58LGVzDuFz+hQbWgncQyCZAk+VbsPSouf93261iZgmfCpwRbAvqmSqriU2PwhjaoOyYqtIegVXViTsmyta6bGySpY3gyRrpIyAeaWDDxtpsXwKyalMDKNP7YBXMqEskUsi2uC8FNAPxAKTVfT1o6VzM0E0jF+1rWcUuHvdyg7vgoFplX8HpvHpMCOMRUPHzZkInsqlFKNX/EIO52E0SxSzOwob2VmRLW5D1XIU0rbgM1AzWgyC7fe8G7xUAK/taEBat7luqtyP7EmsaJQOj5F+mrnZfCuYCfBUAWwShyd6pMY/vAHG1UqOYpbI/gy5T0CMKm+UO3gFuC85dgfDVeguPDfITrIBLsLrcgdh3CFgFZjaKJ4Iv3F8ANEqvuxR1tVKOgLoCa1jxboBAkj6v7j/icFbA7f4rfRnQDLRViG13i0vqBQrYVqBbADZT0ZpiHoSzvQpopKIFS3sE1HfBWlHXd0H7LnArqvougMtljHBgZnh3Eoz/BKjLML4Z2Aq0+hEJr9jaVUBbvNzCIUiroC7AWmmFw4o5AK3MtB5VypZMSFgs05JyGVwlwBqsEGAAa2ZU1CjUexXGsE4rKriilBvFzOKKo3AuAroE6QFQU3u8YpNXwS5k+1TZt5UrwouN4KiUEw+k3ZWDp1RXHNRqXb21Ts39945yZSg3VnZFNQ9CF3XeZyr5DgBXKiwCMa2MxeTDYXgP1Fsf9QNKZc0k81RJk3r6EQ3rCmBVyLL75EjZ1pIVDHoFtiOAHoB0BdTVylqBsKKKS+AeBXJVLY+CXASuGvO/Auq7GuEjDfGKg1oKa1z/dmmi9I9SUGNhl0AtfulHAawoYrnSkmNXAVuGEhrEVXvUF+A5Ct2PqNOjDetyna4CmeUolmeXLN4Aq7C5Sj10Q7yjgl+t6CNxSRHmI5X+CpwreYB3Qfdqna4q21KdBuc4GoZsn49ZOOiVinwHqK9WzjvgeweEh2AU5+vtxZ9Cd9Wqkh49V18E5oj6vVyn0RStAyGIO5edXRKd5B0VGVXq2yr3xYp+5Ut+C4QJ4P1N339pQMjRejj4vb/Dcr6rQc3O/0rjmtZpeYCBiCHfCemRbNhbK/pNUPc3wfKy5f2D7OlL3/uPhve/oU4T0F8f+VNM2vyoiv0jK+KHQfdHq+0bncz4oz73/+Y6LbKw1o/5B7eOf1Rl/0du9B9tn/9bvrf/j+v0h6ttn2tp/r/4819y4/zv5391uvzzfwDifz6phT1MPgAAAABJRU5ErkJggg==)}.color-picker .cp-add-color-button-class{position:absolute;display:inline;padding:0;margin:3px -3px;border:0;cursor:pointer;background:transparent}.color-picker .cp-add-color-button-class:hover{text-decoration:underline}.color-picker .cp-add-color-button-class:disabled{cursor:not-allowed;color:#999}.color-picker .cp-add-color-button-class:disabled:hover{text-decoration:none}.color-picker .cp-remove-color-button-class{position:absolute;top:-5px;right:-5px;display:block;width:10px;height:10px;border-radius:50%;cursor:pointer;text-align:center;background:#fff;box-shadow:1px 1px 5px #333}.color-picker .cp-remove-color-button-class:before{content:"x";position:relative;bottom:3.5px;display:inline-block;font-size:10px}.color-picker .eyedropper-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);fill:#fff;mix-blend-mode:exclusion}\n'],encapsulation:2}),n})(),wa=(()=>{class n{constructor(t,i,a,r,l,f){this.injector=t,this.cfr=i,this.appRef=a,this.vcRef=r,this.elRef=l,this._service=f,this.dialogCreated=!1,this.ignoreChanges=!1,this.viewAttachedToAppRef=!1,this.cpWidth="230px",this.cpHeight="auto",this.cpToggle=!1,this.cpDisabled=!1,this.cpIgnoredElements=[],this.cpFallbackColor="",this.cpColorMode="color",this.cpCmykEnabled=!1,this.cpOutputFormat="auto",this.cpAlphaChannel="enabled",this.cpDisableInput=!1,this.cpDialogDisplay="popup",this.cpSaveClickOutside=!0,this.cpCloseClickOutside=!0,this.cpUseRootViewContainer=!1,this.cpPosition="auto",this.cpPositionOffset="0%",this.cpPositionRelativeToArrow=!1,this.cpOKButton=!1,this.cpOKButtonText="OK",this.cpOKButtonClass="cp-ok-button-class",this.cpCancelButton=!1,this.cpCancelButtonText="Cancel",this.cpCancelButtonClass="cp-cancel-button-class",this.cpEyeDropper=!1,this.cpPresetLabel="Preset colors",this.cpPresetColorsClass="cp-preset-colors-class",this.cpMaxPresetColorsLength=6,this.cpPresetEmptyMessage="No colors added",this.cpPresetEmptyMessageClass="preset-empty-message",this.cpAddColorButton=!1,this.cpAddColorButtonText="Add color",this.cpAddColorButtonClass="cp-add-color-button-class",this.cpRemoveColorButtonClass="cp-remove-color-button-class",this.cpInputChange=new e.EventEmitter(!0),this.cpToggleChange=new e.EventEmitter(!0),this.cpSliderChange=new e.EventEmitter(!0),this.cpSliderDragEnd=new e.EventEmitter(!0),this.cpSliderDragStart=new e.EventEmitter(!0),this.colorPickerOpen=new e.EventEmitter(!0),this.colorPickerClose=new e.EventEmitter(!0),this.colorPickerCancel=ne
1w e.EventEmitter(!0),this.colorPickerSelect=new e.EventEmitter(!0),this.colorPickerChange=new e.EventEmitter(!1),this.cpCmykColorChange=new e.EventEmitter(!0),this.cpPresetColorsChange=new e.EventEmitter(!0)}handleClick(){this.inputFocus()}handleFocus(){this.inputFocus()}handleInput(t){this.inputChange(t)}ngOnDestroy(){null!=this.cmpRef&&(this.viewAttachedToAppRef&&this.appRef.detachView(this.cmpRef.hostView),this.cmpRef.destroy(),this.cmpRef=null,this.dialog=null)}ngOnChanges(t){t.cpToggle&&!this.cpDisabled&&(t.cpToggle.currentValue?this.openDialog():t.cpToggle.currentValue||this.closeDialog()),t.colorPicker&&(this.dialog&&!this.ignoreChanges&&("inline"===this.cpDialogDisplay&&this.dialog.setInitialColor(t.colorPicker.currentValue),this.dialog.setColorFromString(t.colorPicker.currentValue,!1),this.cpUseRootViewContainer&&"inline"!==this.cpDialogDisplay&&this.cmpRef.changeDetectorRef.detectChanges()),this.ignoreChanges=!1),(t.cpPresetLabel||t.cpPresetColors)&&this.dialog&&this.dialog.setPresetConfig(this.cpPresetLabel,this.cpPresetColors)}openDialog(){if(this.dialogCreated)this.dialog&&this.dialog.openDialog(this.colorPicker);else{let t=this.vcRef;if(this.dialogCreated=!0,this.viewAttachedToAppRef=!1,this.cpUseRootViewContainer&&"inline"!==this.cpDialogDisplay){const r=this.injector.get(this.appRef.componentTypes[0],e.Injector.NULL);r!==e.Injector.NULL?t=r.vcRef||r.viewContainerRef||this.vcRef:this.viewAttachedToAppRef=!0}const i=this.cfr.resolveComponentFactory(ya);if(this.viewAttachedToAppRef)this.cmpRef=i.create(this.injector),this.appRef.attachView(this.cmpRef.hostView),document.body.appendChild(this.cmpRef.hostView.rootNodes[0]);else{const a=e.Injector.create({providers:[],parent:t.injector});this.cmpRef=t.createComponent(i,0,a,[])}this.cmpRef.instance.setupDialog(this,this.elRef,this.colorPicker,this.cpWidth,this.cpHeight,this.cpDialogDisplay,this.cpFallbackColor,this.cpColorMode,this.cpCmykEnabled,this.cpAlphaChannel,this.cpOutputFormat,this.cpDisableInput,this.cpIgnoredElements,this.cpSaveClickOutside,this.cpCloseClickOutside,this.cpUseRootViewContainer,this.cpPosition,this.cpPositionOffset,this.cpPositionRelativeToArrow,this.cpPresetLabel,this.cpPresetColors,this.cpPresetColorsClass,this.cpMaxPresetColorsLength,this.cpPresetEmptyMessage,this.cpPresetEmptyMessageClass,this.cpOKButton,this.cpOKButtonClass,this.cpOKButtonText,this.cpCancelButton,this.cpCancelButtonClass,this.cpCancelButtonText,this.cpAddColorButton,this.cpAddColorButtonClass,this.cpAddColorButtonText,this.cpRemoveColorButtonClass,this.cpEyeDropper,this.elRef,this.cpExtraTemplate),this.dialog=this.cmpRef.instance,this.vcRef!==t&&this.cmpRef.changeDetectorRef.detectChanges()}}closeDialog(){this.dialog&&"popup"===this.cpDialogDisplay&&this.dialog.closeDialog()}cmykChanged(t){this.cpCmykColorChange.emit(t)}stateChanged(t){this.cpToggleChange.emit(t),t?this.colorPickerOpen.emit(this.colorPicker):this.colorPickerClose.emit(this.colorPicker)}colorChanged(t,i=!0){this.ignoreChanges=i,this.colorPickerChange.emit(t)}colorSelected(t){this.colorPickerSelect.emit(t)}colorCanceled(){this.colorPickerCancel.emit()}inputFocus(){const t=this.elRef.nativeElement,i=this.cpIgnoredElements.filter(a=>a===t);!this.cpDisabled&&!i.length&&("undefined"!=typeof document&&t===document.activeElement?this.openDialog():this.dialog&&this.dialog.show?this.closeDialog():this.openDialog())}inputChange(t){this.dialog?this.dialog.setColorFromString(t.target.value,!0):(this.colorPicker=t.target.value,this.colorPickerChange.emit(this.colorPicker))}inputChanged(t){this.cpInputChange.emit(t)}sliderChanged(t){this.cpSliderChange.emit(t)}sliderDragEnd(t){this.cpSliderDragEnd.emit(t)}sliderDragStart(t){this.cpSliderDragStart.emit(t)}presetColorsChanged(t){this.cpPresetColorsChange.emit(t)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(e.Injector),e.\u0275\u0275directiveInject(e.ComponentFactoryResolver),e.\u0275\u0275directiveInject(e.ApplicationRef),e.\u0275\u0275directiveInject(e.ViewContainerRef),e.\u0275\u0275directiveInject(e.ElementRef),e.\u0275\u0275directiveInject(vn))},n.\u0275dir=e.\u0275\u0275defineDirective({type:n,selectors:[["","colorPicker",""]],hostBindings:function(t,i){1&t&&e.\u0275\u0275listener("click",function(){return i.handleClick()})("focus",function(){return i.handleFocus()})("input",function(r){return i.handleInput(r)})},inputs:{colorPicker:"colorPicker",cpWidth:"cpWidth",cpHeight:"cpHeight",cpToggle:"cpToggle",cpDisabled:"cpDisabled",cpIgnoredElements:"cpIgnoredElements",cpFallbackColor:"cpFallbackColor",cpColorMode:"cpColorMode",cpCmykEnabled:"cpCmykEnabled",cpOutputFormat:"cpOutputFormat",cpAlphaChannel:"cpAlphaChannel",cpDisableInput:"cpDisableInput",cpDialogDisplay:"cpDialogDisplay",cpSaveClickOutside:"cpSaveClickOutside",cpCloseClickOutside:"cpCloseClickOutside",cpUseRootViewContainer:"cpUseRootViewContainer",cpPosition:"cpPosition",cpPositionOffset:"cpPositionOffset",cpPositionRelativeToArrow:"cpPositionRelativeToArrow",cpOKButton:"cpOKButton",cpOKButtonText:"cpOKButtonText",cpOKButtonClass:"cpOKButtonClass",cpCancelButton:"cpCancelButton",cpCancelButtonText:"cpCancelButtonText",cpCancelButtonClass:"cpCancelButtonClass",cpEyeDropper:"cpEyeDropper",cpPresetLabel:"cpPresetLabel",cpPresetColors:"cpPresetColors",cpPresetColorsClass:"cpPresetColorsClass",cpMaxPresetColorsLength:"cpMaxPresetColorsLength",cpPresetEmptyMessage:"cpPresetEmptyMessage",cpPresetEmptyMessageClass:"cpPresetEmptyMessageClass",cpAddColorButton:"cpAddColorButton",cpAddColorButtonText:"cpAddColorButtonText",cpAddColorButtonClass:"cpAddColorButtonClass",cpRemoveColorButtonClass:"cpRemoveColorButtonClass",cpExtraTemplate:"cpExtraTemplate"},outputs:{cpInputChange:"cpInputChange",cpToggleChange:"cpToggleChange",cpSliderChange:"cpSliderChange",cpSliderDragEnd:"cpSliderDragEnd",cpSliderDragStart:"cpSliderDragStart",colorPickerOpen:"colorPickerOpen",colorPickerClose:"colorPickerClose",colorPickerCancel:"colorPickerCancel",colorPickerSelect:"colorPickerSelect",colorPickerChange:"colorPickerChange",cpCmykColorChange:"cpCmykColorChange",cpPresetColorsChange:"cpPresetColorsChange"},exportAs:["ngxColorPicker"],features:[e.\u0275\u0275NgOnChangesFeature]}),n})(),Ea=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=e.\u0275\u0275defineInjector({providers:[vn],imports:[[u.CommonModule]]}),n})();var mt=d(27809),Zt=d(41379),H=d(8929),A=d(7625),R=d(31545),xe=d(80540),Z=d(59358),Y=d(32534),De=d(28866),ee=d(15645),se=d(53251),ae=d(9524),Ta=d(68896),Et=d(92198),si=d(87545),Xe=d(72986),me=d(64409),be=d(4511),it=d(22430),He=d(92451),Oe=d(33342),Ze=d(67092),F=d(48966),ve=d(2818),_=d(93075),D=d(67322),X=d(98833),ce=d(23322),Tt=d(91079),de=d(90508),Q=d(25245);function Ia(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Minimum two letters"),e.\u0275\u0275elementEnd())}function Pa(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",15),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.country),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.country," ")}}function ka(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-hint",16),e.\u0275\u0275text(1,"Please, select a country from the list "),e.\u0275\u0275elementEnd())}function Ma(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",15),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.name),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function Aa(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-hint",16),e.\u0275\u0275text(1,"Please, select a timezone from the list "),e.\u0275\u0275elementEnd())}const ci=function(n){return{"form-field-error":n}};let Da=(()=>{class n{constructor(t,i,a,r){this.dialogRef=t,this.placesService=i,this.userService=a,this.httpHelper=r,this.name="",this.countryName="",this.timezoneName="",this.filteredCountries=He.o,this.filteredTimezones=Oe.z,this.isSaving=!1}get selectedCountry(){const t=this.normalize(this.countryName);return He.o.find(i=>this.normalize(i.country)===t)}get selectedTimezone(){const t=this.normalize(this.timezoneName);return Oe.z.find(i=>this.normalize(i.name)===t)}get isSubmitDisabled(){return this.isSaving||this.normalize(this.name).length<2||!this.selectedCountry||!this.selectedTimezone}filterCountries(t){const i=this.normalize(t);this.filteredCountries=i?He.o.filter(a=>this.normalize(a.country).includes(i)):He.o}filterTimezones(t){const i=this.normalize(t);this.filteredTimezones=i?Oe.z.filter(a=>this.normalize(a.name).includes(i)):Oe.z}clearFilter(t){"country"===t?(this.countryName="",this.filteredCountries=He.o):(this.timezoneName="",this.filteredTimezones=Oe.z)}createPlace(){const t=this.selectedCountry,i=this.selectedTimezone;if(this.isSubmitDisabled||!t||!i)return;const a={name:this.name.trim(),email:this.userService.currentUser.email,country:t.country,country_id:t.iso,timezone_id:i.timezone};this.isSaving=!0,this.placesService.createPlace(a).subscribe(r=>{this.httpHelper.showSnackbar(`Place "${a.name}" successfully created`),this.dialogRef.close(r)},r=>{this.isSaving=!1,this.httpHelper.handleHttpErrorMessage(r,{custom_default:"Could not create the place. Try again later."})})}normalize(t){return(null!=t?t:"").trim().toLowerCase()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(be.r))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-create-place-dialog"]],decls:29,vars:21,consts:[[3,"title","submitText","submitDisabled","cancel","submitting"],[1,"create-place-form",3,"ngSubmit"],["matInput","","name","place","minlength","2","required","","placeholder","Please enter your place name",3,"ngModel","ngModelChange"],["place","ngModel"],[4,"ngIf"],[3,"ngClass"],["matInput","","name","country","required","","placeholder","Country",3,"ngModel","matAutocomplete","ngModelChange"],["country","ngModel"],["countryAutocomplete","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["matSuffix","",1,"input-reset-btn",3,"click"],["class","error-message",4,"ngIf"],["matInput","","name","timezone","required","","placeholder","Timezone",3,"ngModel","matAutocomplete","ngModelChange"],["timezone","ngModel"],["timezoneAutocomplete","matAutocomplete"],[3,"value"],[1,"error-message"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.createPlace()}),e.\u0275\u0275elementStart(1,"div")(2,"p"),e.\u0275\u0275text(3," You will be the administrator of the new place, and the dashboard will switch to it once it is created. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"form",1),e.\u0275\u0275listener("ngSubmit",function(){return i.createPlace()}),e.\u0275\u0275elementStart(5,"mat-form-field")(6,"mat-label"),e.\u0275\u0275text(7,"Name of Place"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"input",2,3),e.\u0275\u0275listener("ngModelChange",function(r){return i.name=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,Ia,2,0,"mat-error",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"mat-form-field",5)(12,"input",6,7),e.\u0275\u0275listener("ngModelChange",function(r){return i.countryName=r})("ngModelChange",function(r){return i.filterCountries(r)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-autocomplete",null,8),e.\u0275\u0275template(16,Pa,2,2,"mat-option",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"mat-icon",10),e.\u0275\u0275listener("click",function(){return i.clearFilter("country")}),e.\u0275\u0275text(18,"clear "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(19,ka,2,0,"mat-hint",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"mat-form-field",5)(21,"input",12,13),e.\u0275\u0275listener("ngModelChange",function(r){return i.timezoneName=r})("ngModelChange",function(r){return i.filterTimezones(r)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"mat-autocomplete",null,14),e.\u0275\u0275template(25,Ma,2,2,"mat-option",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"mat-icon",10),e.\u0275\u0275listener("click",function(){return i.clearFilter("timezone")}),e.\u0275\u0275text(27,"clear "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(28,Aa,2,0,"mat-hint",11),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(9),r=e.\u0275\u0275reference(13),l=e.\u0275\u0275reference(15),f=e.\u0275\u0275reference(22),w=e.\u0275\u0275reference(24);e.\u0275\u0275property("title","Create New Place")("submitText","Create")("submitDisabled",i.isSubmitDisabled),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngModel",i.name),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",a.invalid),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(17,ci,r.touched&&!i.selectedCountry)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.countryName)("matAutocomplete",l),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngForOf",i.filteredCountries),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.countryName?"shown":"hidden"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.touched&&!i.selectedCountry),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(19,ci,f.touched&&!i.selectedTimezone)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.timezoneName)("matAutocomplete",w),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngForOf",i.filteredTimezones),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.timezoneName?"shown":"hidden"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",f.touched&&!i.selectedTimezone)}},directives:[ve.b,_._Y,_.JL,_.F,D.KE,D.hX,X.Nt,_.Fj,_.wO,_.Q7,_.JJ,_.On,u.NgIf,D.TO,u.NgClass,ce.oO,Tt.ZL,Tt.XC,u.NgForOf,de.ey,Q.Hw,D.R9,D.bx],styles:[".create-place-form[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],data:{animation:[Ze.j]}}),n})();var ue=d(16797),z=d(47423),dt=d(57010);const Oa=function(n){return[n]};let La=(()=>{class n{constructor(t,i,a,r,l,f){this.dialog=t,this.dialogService=i,this.placesService=a,this.locationsService=r,this.httpHelper=l,this.router=f,this.UsersPermissions=it.S}openCreatePlaceDialog(){const t=this.dialog.open(Da);this.dialogService.setFullScreenDialog(t,{desktopWidth:"500px",desktopHeight:"auto"}),t.afterClosed().pipe((0,Et.h)(i=>!!i)).subscribe(i=>this.switchToPlace(i.id))}switchToPlace(t){this.placesService.reloadPlacesAndSelect(t).pipe((0,si.w)(i=>i?this.locationsService.loadedPlaceId$.pipe((0,Et.h)(a=>a===i.id),(0,Xe.q)(1)):Ta.E)).subscribe(()=>this.router.navigate(["/dashboard"]),i=>this.httpHelper.handleHttpErrorMessage(i))}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(y.F0))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-create-place"]],decls:2,vars:5,consts:[["mat-button","","type","button",1,"button-primary",3,"click"],[3,"textContent","permissionColoredContent","permissions"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"button",0),e.\u0275\u0275listener("click",function(){return i.openCreatePlaceDialog()}),e.\u0275\u0275element(1,"app-mark-permissions",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("textContent","Create New Place")("permissionColoredContent",!1)("permissions",e.\u0275\u0275pureFunction1(3,Oa,i.UsersPermissions.advanced_config)))},directives:[z.lW,dt.S],encapsulation:2}),n})();
1var Cn=d(2994),Jt=d(1059),It=d(24850),V=d(77093),Ie=d(45141);function Fa(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Minimum two letters"),e.\u0275\u0275elementEnd())}function Ra(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",25),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.country),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.country," ")}}function Na(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-hint",26),e.\u0275\u0275text(1,"Please, select a country from the list "),e.\u0275\u0275elementEnd())}function Va(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",25),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function Ha(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-hint",26),e.\u0275\u0275text(1,"Please, select a timezone from the list "),e.\u0275\u0275elementEnd())}const pi=function(n){return{"form-field-error":n}};let ja=(()=>{class n{constructor(t,i){this.places=t,this.helpService=i,this.timezoneControl=new _.NI,this.countryControl=new _.NI,this.publicContributorNameControl=new _.NI,this.publicContributorUrlControl=new _.NI,this.showTimezoneWarning=!1,this.showCountryWarning=!1,this.destroy$=new H.xQ,this.HelpSection=Z.L}ngOnInit(){var t;let i=Oe.W.get(this.places.currentPlace.timezone_id)?Oe.W.get(this.places.currentPlace.timezone_id):this.places.currentPlace.timezone_id,a=Oe.z.find(l=>l.timezone.trim().toLowerCase()===i.trim().toLowerCase());this.timezoneControl.setValue(a),this.publicContributorNameControl.setValue(this.places.currentPlace.public_contributor_name),this.publicContributorUrlControl.setValue(this.places.currentPlace.public_url);const r=null===(t=He.o.find(l=>l.iso.trim().toLowerCase()===this.places.currentPlace.country_id.toLowerCase()))||void 0===t?void 0:t.country;this.countryControl.setValue(r),this.subscribeToCountriesChange(),this.subscribeToTimezoneChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}displayCountry(t){return t||void 0}displayTimezone(t){return(null==t?void 0:t.name)||void 0}clearFilter(t){"timezone"===t?this.timezoneControl.setValue({}):"country"===t?this.countryControl.setValue(""):"public_contributor_name"===t?this.publicContributorNameControl.setValue(""):"public_url"===t&&this.publicContributorUrlControl.setValue("")}savePlace(){var t;const i=Oe.z.find(a=>{var r,l;return a.name.trim().toLowerCase()===(null===(l=null===(r=this.timezoneControl.value.name)||void 0===r?void 0:r.trim())||void 0===l?void 0:l.toLowerCase())});this.places.currentPlace.timezone_id=i.timezone,this.places.currentPlace.public_contributor_name=this.publicContributorNameControl.value,this.places.currentPlace.public_url=this.publicContributorUrlControl.value,this.places.currentPlace.country_id=null===(t=He.o.find(a=>a.country.trim().toLowerCase()===this.countryControl.value.trim().toLowerCase()))||void 0===t?void 0:t.iso,this.places.savePlace(this.places.currentPlace)}_filterTimezones(t){const i=t.toLowerCase();return Oe.z.filter(a=>-1!==a.name.toLowerCase().indexOf(i))}_filterCountries(t){const i=t.toLowerCase();return He.o.filter(a=>-1!==a.country.toLowerCase().indexOf(i))}subscribeToCountriesChange(){this.filteredCountryOptions=this.countryControl.valueChanges.pipe((0,Cn.b)(()=>{this.showCountryWarning=!this.checkOptionsListIncludeInputValue("country")},(0,A.R)(this.destroy$)),(0,Jt.O)(""),(0,It.U)(t=>"string"==typeof t?t:t.country),(0,It.U)(t=>t?this._filterCountries(t):He.o.slice()))}subscribeToTimezoneChange(){this.filteredTimezoneOptions=this.timezoneControl.valueChanges.pipe((0,Cn.b)(()=>{this.showTimezoneWarning=!this.checkOptionsListIncludeInputValue("timezone")},(0,A.R)(this.destroy$)),(0,Jt.O)(""),(0,It.U)(t=>"string"==typeof t?t:t.name),(0,It.U)(t=>t?this._filterTimezones(t):Oe.z.slice()))}checkOptionsListIncludeInputValue(t){return Boolean("timezone"===t?Oe.z.find(i=>{var a,r,l;return(null===(a=i.name)||void 0===a?void 0:a.trim().toLowerCase())===(null===(l=null===(r=this.timezoneControl.value.name)||void 0===r?void 0:r.trim())||void 0===l?void 0:l.toLowerCase())}):He.o.find(i=>i.country.trim().toLowerCase()===this.countryControl.value.trim().toLowerCase()))}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-my-place"]],decls:46,vars:29,consts:[["fxLayout","row wrap","fxLayoutAlign","space-between center","fxLayoutGap","10px",1,"inPage"],[1,"spacer-top-nil"],["fxLayout","column","fxFill","","fxLayoutGap","5px","fxLayoutAlign","start start"],["f","ngForm"],["size","small",3,"copyValue"],[1,"form-field-responsive-m"],["name","place","matInput","","minlength","2","required","","placeholder","Please enter your place name",3,"ngModel","ngModelChange"],["place","ngModel"],[4,"ngIf"],["matInput","","type","text","placeholder","Enter Public Contributor Name","name","Public Contributor Name",3,"formControl"],["publicContributorName",""],["matInput","","type","text","placeholder","Enter Public Contributor URL","name","Public Contributor URL",3,"formControl"],["publicContributorUrl",""],[1,"form-field-responsive-m",3,"ngClass"],["required","","type","text","placeholder","Country","aria-label","Country","matInput","",3,"formControl","matAutocomplete"],["countryCtrl",""],[3,"displayWith"],["country","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["matSuffix","",1,"input-reset-btn",3,"click"],["class","error-message",4,"ngIf"],["required","","type","text","placeholder","Timezone","aria-label","Timezone","matInput","",3,"formControl","matAutocomplete"],["timezoneCtrl",""],["zone","matAutocomplete"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"],[3,"value"],[1,"error-message"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"h3",1),e.\u0275\u0275text(2,"Place"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"form",2,3)(5,"p",1),e.\u0275\u0275text(6),e.\u0275\u0275element(7,"app-clipboard-copy",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-form-field",5)(9,"mat-label"),e.\u0275\u0275text(10,"Name of Place"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"input",6,7),e.\u0275\u0275listener("ngModelChange",function(r){return i.places.currentPlace.name=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,Fa,2,0,"mat-error",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-form-field",5)(15,"mat-label"),e.\u0275\u0275text(16,"Public Contributor Name"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(17,"input",9,10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"mat-form-field",5)(20,"mat-label"),e.\u0275\u0275text(2
11,"Public Contributor URL"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(22,"input",11,12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"mat-form-field",13),e.\u0275\u0275element(25,"input",14,15),e.\u0275\u0275elementStart(27,"mat-autocomplete",16,17),e.\u0275\u0275template(29,Ra,2,2,"mat-option",18),e.\u0275\u0275pipe(30,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"mat-icon",19),e.\u0275\u0275listener("click",function(){return i.clearFilter("country")}),e.\u0275\u0275text(32,"clear "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(33,Na,2,0,"mat-hint",20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(34,"mat-form-field",13),e.\u0275\u0275element(35,"input",21,22),e.\u0275\u0275elementStart(37,"mat-autocomplete",16,23),e.\u0275\u0275template(39,Va,2,2,"mat-option",18),e.\u0275\u0275pipe(40,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(41,"mat-icon",19),e.\u0275\u0275listener("click",function(){return i.clearFilter("timezone")}),e.\u0275\u0275text(42,"clear "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(43,Ha,2,0,"mat-hint",20),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(44,"button",24),e.\u0275\u0275listener("click",function(){return i.savePlace()}),e.\u0275\u0275text(45,"Save"),e.\u0275\u0275elementEnd()()),2&t){const a=e.\u0275\u0275reference(4),r=e.\u0275\u0275reference(12),l=e.\u0275\u0275reference(26),f=e.\u0275\u0275reference(28),w=e.\u0275\u0275reference(36),T=e.\u0275\u0275reference(38);e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" Place ID: ",i.places.currentPlace.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",i.places.currentPlace.id),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",i.places.currentPlace.name),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.invalid),e.\u0275\u0275advance(4),e.\u0275\u0275property("formControl",i.publicContributorNameControl),e.\u0275\u0275advance(5),e.\u0275\u0275property("formControl",i.publicContributorUrlControl),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(25,pi,i.showCountryWarning)),e.\u0275\u0275advance(1),e.\u0275\u0275property("formControl",i.countryControl)("matAutocomplete",f),e.\u0275\u0275advance(2),e.\u0275\u0275property("displayWith",i.displayCountry),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pipeBind1(30,21,i.filteredCountryOptions)),e.\u0275\u0275advance(2),e.\u0275\u0275property("@hideInOut",l.value?"shown":"hidden"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.showCountryWarning),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(27,pi,i.showTimezoneWarning)),e.\u0275\u0275advance(1),e.\u0275\u0275property("formControl",i.timezoneControl)("matAutocomplete",T),e.\u0275\u0275advance(2),e.\u0275\u0275property("displayWith",i.displayTimezone),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pipeBind1(40,23,i.filteredTimezoneOptions)),e.\u0275\u0275advance(2),e.\u0275\u0275property("@hideInOut",w.value?"shown":"hidden"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.showTimezoneWarning),e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",!a.valid||i.showTimezoneWarning||i.showCountryWarning)}},directives:[V.xw,V.Wh,V.SQ,_._Y,_.JL,_.F,V.s9,Ie.Z,D.KE,D.hX,X.Nt,_.Fj,_.wO,_.Q7,_.JJ,_.On,u.NgIf,D.TO,_.oH,u.NgClass,ce.oO,Tt.ZL,Tt.XC,u.NgForOf,de.ey,Q.Hw,D.R9,D.bx,z.lW],pipes:[u.AsyncPipe],encapsulation:2,data:{animation:[Ze.j]}}),n})();function Ba(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",3),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Number of days the un-bucketed data of all locations is retained: ",t.placesService.currentPlace.raw_data_retention_time_days," ")}}function Ga(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1,"There is no data for number of days the un-bucketed data of all locations is retained."),e.\u0275\u0275elementEnd())}const za=function(n){return[n]};let $a=(()=>{class n{constructor(t,i){this.placesService=t,this.helpService=i,this.UsersPermissions=it.S}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-raw-data-retention"]],decls:5,vars:6,consts:[[3,"textContent","permissions"],["class","spacer-bottom-nil",4,"ngIf","ngIfElse"],["noData",""],[1,"spacer-bottom-nil"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275element(1,"app-mark-permissions",0),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(2,Ba,2,1,"p",1),e.\u0275\u0275template(3,Ga,2,0,"ng-template",null,2,e.\u0275\u0275templateRefExtractor)),2&t){const a=e.\u0275\u0275reference(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("textContent","Un-Bucketed Data Retention Time")("permissions",e.\u0275\u0275pureFunction1(4,za,i.UsersPermissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",void 0!==(null==i.placesService||null==i.placesService.currentPlace?null:i.placesService.currentPlace.raw_data_retention_time_days))("ngIfElse",a)}},directives:[dt.S,u.NgIf],encapsulation:2}),n})();var en=d(31463),tn=d(78754),Fe=d(64617),_e=d(74107);let Ua=(()=>{class n{constructor(t,i,a,r,l,f){this.placesService=t,this.dataService=i,this.helpService=a,this.httpHelper=r,this.dialog=l,this.localStore=f,this.HelpSection=Z.L}confirmSavePmStandard(){this.dialog.open(en.E,{width:"700px",data:{source:tn.$.PmStandard}}).afterClosed().subscribe(i=>{i&&this.savePmStandard()})}savePmStandard(){const t=this.placesService.currentPlace.id,i=this.placesService.currentPlace.pm_standard,a=this.placesService.currentPlace.pm_standard,l=null===this.localStore.getData("pmunit_mg");if(l){const f="us-aqi"!==a;this.dataService.pmInMG=f,this.localStore.saveData("pmunit_mg",f)}this.placesService.patchPlace(t,{pm_standard:a}).subscribe(()=>{var f;this.httpHelper.showSnackbar("Place successfully saved"),this.placesService.currentPlace.pm_standard=a;const w=null===(f=this.placesService.places)||void 0===f?void 0:f.find(T=>T.id===t);w&&(w.pm_standard=a)},f=>{if(this.placesService.currentPlace.pm_standard=i,l){const w="us-aqi"!==i;this.dataService.pmInMG=w,this.localStore.saveData("pmunit_mg",w)}this.httpHelper.handleHttpErrorMessage(f)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Fe.n))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-pm-standard"]],decls:13,vars:1,consts:[[1,"form-field-responsive-s"],[3,"ngModel","ngModelChange"],["value","ugm3"],["value","us-aqi"],["mat-button","","type","button",1,"button-primary",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," PM Standard "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"div")(3,"mat-form-field",0)(4,"mat-label"),e.\u0275\u0275text(5,"PM Standard"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-select",1),e.\u0275\u0275listener("ngModelChange",function(r){return i.placesService.currentPlace.pm_standard=r}),e.\u0275\u0275elementStart(7,"mat-option",2),e.\u0275\u0275text(8,"\u03bcg/m\xb3"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"mat-option",3),e.\u0275\u0275text(10,"US AQI"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(11,"button",4),e.\u0275\u0275listener("click",function(){return i.confirmSavePmStandard()}),e.\u0275\u0275text(12," Apply to All Locations "),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.placesService.currentPlace.pm_standard))},directives:[D.KE,D.hX,_e.gD,_.JJ,_.On,de.ey,z.lW],encapsulation:2}),n})();var Wa=d(12313);function Qa(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",4),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.title)}}let qa=(()=>{class n{constructor(t,i,a,r){this.placesService=t,this.dataService=i,this.helpService=a,this.dialog=r,this.temperatureUnits=Wa.$,this.HelpSection=Z.L}confirmSaveTemperature(){this.dialog.open(en.E,{width:"700px",data:{source:tn.$.TemperatureUnit}}).afterClosed().subscribe(i=>{i&&this.saveTemperature()})}saveTemperature(){this.dataService.setTempUnit(this.placesService.currentPlace.temperature_unit),this.placesService.saveTemperatureUnit(this.placesService.currentPlace.id,{temperature_unit:this.placesService.currentPlace.temperature_unit})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-temperature"]],decls:10,vars:2,consts:[[1,"form-field-responsive-s"],[3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["mat-button","","type","button",1,"button-primary",3,"click"],[3,"value"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," Temperature Unit "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"div")(3,"mat-form-field",0)(4,"mat-label"),e.\u0275\u0275text(5,"Temperature"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-select",1),e.\u0275\u0275listener("ngModelChange",function(r){return i.placesService.currentPlace.temperature_unit=r}),e.\u0275\u0275template(7,Qa,2,2,"mat-option",2),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(8,"button",3),e.\u0275\u0275listener("click",function(){return i.confirmSaveTemperature()}),e.\u0275\u0275text(9," Apply to All Locations "),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.placesService.currentPlace.temperature_unit),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.temperatureUnits))},directives:[D.KE,D.hX,_e.gD,_.JJ,_.On,u.NgForOf,de.ey,z.lW],encapsulation:2}),n})();var Je=d(77446);function Ka(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",4),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().fleetManagementEnabled=a}),e.\u0275\u0275text(1," Enable Fleet Management "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngModel",t.fleetManagementEnabled)}}
1let Xa=(()=>{class n{constructor(t,i){this.placesService=t,this.locationsService=i,this.showAdvancedPlaceSettings=!1,this.fleetManagementEnabled=!1,this.shouldShowFleetManagement=!1}ngOnInit(){var t;this.showAdvancedPlaceSettings=this.placesService.currentPlace.advanced_config,this.fleetManagementEnabled=this.placesService.currentPlace.fleet_management_enabled,this.shouldShowFleetManagement=(null===(t=this.locationsService.allLocations)||void 0===t?void 0:t.length)>10}saveAdvancedPlaceSettings(){this.placesService.saveAdvancedPlaceSettings(this.placesService.currentPlace.id,this.showAdvancedPlaceSettings,this.fleetManagementEnabled)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-advanced-settings"]],decls:8,vars:2,consts:[[2,"display","flex","flex-direction","column"],["name","in-reporting",1,"spacer-bottom-md",3,"ngModel","ngModelChange"],["class","spacer-bottom-md","name","fleet-management",3,"ngModel","ngModelChange",4,"ngIf"],["mat-button","","type","button",1,"button-primary",3,"click"],["name","fleet-management",1,"spacer-bottom-md",3,"ngModel","ngModelChange"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," Advanced Configuration "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"div",0)(3,"mat-checkbox",1),e.\u0275\u0275listener("ngModelChange",function(r){return i.showAdvancedPlaceSettings=r}),e.\u0275\u0275text(4," Show Advanced Configuration Settings "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Ka,2,1,"mat-checkbox",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",3),e.\u0275\u0275listener("click",function(){return i.saveAdvancedPlaceSettings()}),e.\u0275\u0275text(7," Save "),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",i.showAdvancedPlaceSettings),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.shouldShowFleetManagement))},directives:[Je.oG,_.JJ,_.On,u.NgIf,z.lW],encapsulation:2}),n})();function di(n){if(!/^\d+$/.test(n))return!1;const o=Number(n);return o>=1&&o<=1e3}function bn(n){if(!di(n))throw new Error(`Not a limit value: "${n}"`);return Number(n)}var je=d(66819);function Za(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.limitHint)}}function Ja(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.limitHint)}}function eo(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.limitHint)}}let to=(()=>{class n{constructor(t,i,a){this.dialogRef=t,this.placesService=i,this.httpHelper=a,this.LIMIT_PATTERN="0*([1-9]\\d{0,2}|1000)",this.limitHint="Enter a whole number from 1 to 1000.",this.usersInput="",this.alarmsInput="",this.groupsInput="",this.placeName="",this.savedInputs=[],this.isSaving=!1}ngOnInit(){const t=this.placesService.currentPlace;this.placeId=null==t?void 0:t.id,this.placeName=null==t?void 0:t.name,this.usersInput=this.toInput(null==t?void 0:t.max_users),this.alarmsInput=this.toInput(null==t?void 0:t.max_alarms),this.groupsInput=this.toInput(null==t?void 0:t.max_location_groups),this.savedInputs=this.currentInputs}get isSubmitDisabled(){return this.isSaving||!this.hasChanges||!this.isValid}save(){if(this.isSubmitDisabled)return;const t={max_users:bn(this.usersInput),max_alarms:bn(this.alarmsInput),max_location_groups:bn(this.groupsInput)};this.isSaving=!0,this.placesService.patchPlace(this.placeId,t).subscribe(()=>{this.applyLimits(t),this.httpHelper.showSnackbar("Limits successfully saved"),this.dialogRef.close()},i=>{this.isSaving=!1,this.httpHelper.handleHttpErrorMessage(i,{403:"Only support staff can change these limits.",custom_default:"Could not save the limits. Try again later."})})}applyLimits(t){var i;const a=null===(i=this.placesService.places)||void 0===i?void 0:i.find(r=>r.id===this.placeId);
1[this.placesService.currentPlace,a].forEach(r=>{(null==r?void 0:r.id)===this.placeId&&(r.max_users=t.max_users,r.max_alarms=t.max_alarms,r.max_location_groups=t.max_location_groups)})}get currentInputs(){return[this.usersInput,this.alarmsInput,this.groupsInput]}get hasChanges(){return this.currentInputs.some((t,i)=>t!==this.savedInputs[i])}get isValid(){return this.currentInputs.every(di)}toInput(t){return null==t?"":`${t}`}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(be.r))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-edit-limits-dialog"]],features:[e.\u0275\u0275ProvidersFeature([{provide:de.rD,useClass:de.hu}])],decls:30,vars:14,consts:[[3,"title","submitDisabled","cancel","submitting"],[1,"limits-form"],["matInput","","type","text","inputmode","numeric","autocomplete","off","required","","name","max-users",3,"pattern","ngModel","ngModelChange"],["users","ngModel"],[4,"ngIf"],["matInput","","type","text","inputmode","numeric","autocomplete","off","required","","name","max-alarms",3,"pattern","ngModel","ngModelChange"],["alarms","ngModel"],["matInput","","type","text","inputmode","numeric","autocomplete","off","required","","name","max-location-groups",3,"pattern","ngModel","ngModelChange"],["groups","ngModel"],[3,"subHeader","isAccentWarning"],["warning",""]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.save()}),e.\u0275\u0275elementStart(1,"div")(2,"p"),e.\u0275\u0275text(3," Maximum number of items that can be created in "),e.\u0275\u0275elementStart(4,"b"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(6,". "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",1)(8,"mat-form-field")(9,"mat-label"),e.\u0275\u0275text(10,"Users"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"input",2,3),e.\u0275\u0275listener("ngModelChange",function(r){return i.usersInput=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,Za,2,1,"mat-error",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-form-field")(15,"mat-label"),e.\u0275\u0275text(16,"Alarms"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"input",5,6),e.\u0275\u0275listener("ngModelChange",function(r){return i.alarmsInput=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(19,Ja,2,1,"mat-error",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"mat-form-field")(21,"mat-label"),e.\u0275\u0275text(22,"Location Groups"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"input",7,8),e.\u0275\u0275listener("ngModelChange",function(r){return i.groupsInput=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(25,eo,2,1,"mat-error",4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(26,"app-warning-message",9),e.\u0275\u0275elementContainerStart(27,10),e.\u0275\u0275elementStart(28,"p"),e.\u0275\u0275text(29," Lowering a limit does not remove items that already exist, it only blocks creating new ones until the count is back under the limit. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()()),2&t){const a=e.\u0275\u0275reference(12),r=e.\u0275\u0275reference(18),l=e.\u0275\u0275reference(24);e.\u0275\u0275property("title","Edit Limits")("submitDisabled",i.isSubmitDisabled),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(i.placeName),e.\u0275\u0275advance(6),e.\u0275\u0275property("pattern",i.LIMIT_PATTERN)("ngModel",i.usersInput),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",a.invalid),e.\u0275\u0275advance(4),e.\u0275\u0275property("pattern",i.LIMIT_PATTERN)("ngModel",i.alarmsInput),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.invalid),e.\u0275\u0275advance(4),e.\u0275\u0275property("pattern",i.LIMIT_PATTERN)("ngModel",i.groupsInput),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",l.invalid),e.\u0275\u0275advance(1),e.\u0275\u0275property("subHeader","Please note")("isAccentWarning",!0)}},directives:[ve.b,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.c5,_.JJ,_.On,u.NgIf,D.TO,je.R],styles:[".limits-form[_ngcontent-%COMP%]{display:flex;flex-direction:column}"]}),n})(),no=(()=>{class n{constructor(t,i,a){this.placesService=t,this.dialog=i,this.dialogService=a}limitText(t){return null==t?"Unlimited":`${t}`}openEditLimits(){const t=this.dialog.open(to);this.dialogService.setFullScreenDialog(t,{desktopWidth:"500px",desktopHeight:"auto"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-limits"]],decls:22,vars:3,consts:[[1,"spacer-bottom-md"],[1,"limit-row"],[1,"limit-label"],["mat-button","","type","button",1,"button-primary",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," Limits "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"p"),e.\u0275\u0275text(3,"Maximum number of items that can be created in this place:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",0)(5,"div",1)(6,"span",2),e.\u0275\u0275text(7,"Users:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"b"),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"div",1)(11,"span",2),e.\u0275\u0275text(12,"Alarms:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"b"),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(15,"div",1)(16,"span",2),e.\u0275\u0275text(17,"Location Groups:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"b"),e.\u0275\u0275text(19),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(20,"button",3),e.\u0275\u0275listener("click",function(){return i.openEditLimits()}
1),e.\u0275\u0275text(21," Edit Limits "),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(9),e.\u0275\u0275textInterpolate(i.limitText(null==i.placesService.currentPlace?null:i.placesService.currentPlace.max_users)),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(i.limitText(null==i.placesService.currentPlace?null:i.placesService.currentPlace.max_alarms)),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(i.limitText(null==i.placesService.currentPlace?null:i.placesService.currentPlace.max_location_groups)))},directives:[z.lW],styles:[".limit-row[_ngcontent-%COMP%]{margin-bottom:5px}.limit-label[_ngcontent-%COMP%]{margin-right:5px}"]}),n})();var io=d(21086),ao=d(27221),nn=d(34594);function oo(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",14),e.\u0275\u0275element(1,"span",15)(2,"span",16),e.\u0275\u0275elementEnd())}const ro=function(){return[1,2,3]};function lo(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,oo,3,0,"div",13),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pureFunction0(1,ro)))}function so(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1," We could not load what this place contains. Deleting it removes all of its locations, monitors, public displays, alarms and recorded air quality data, and every user loses access. "),e.\u0275\u0275elementEnd())}function co(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",21),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.place.name," has no locations, monitors, public displays or alarms. ")}}function po(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.icon)}}function mo(n,o){if(1&n&&e.\u0275\u0275element(0,"mat-icon",25),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("svgIcon",t.icon)}}function uo(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275template(1,po,2,1,"mat-icon",22),e.\u0275\u0275template(2,mo,1,1,"mat-icon",23),e.\u0275\u0275elementStart(3,"span")(4,"b"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isSvg),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isSvg),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.count),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.label,"")}}function _o(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Plus all air quality data recorded at ",1===t.stats.active_locations?"that location":"these locations",". ")}}function fo(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,co,2,1,"p",17),e.\u0275\u0275elementStart(2,"ul",18),e.\u0275\u0275template(3,uo,7,4,"li",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,_o,2,1,"p",20),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isEmpty),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.rows),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.stats?null:t.stats.active_locations)}}let ho=(()=>{class n{constructor(t,i,a){this.dialogRef=t,this.data=i,this.placesService=a,this.stats=null,this.loading=!0,this.failed=!1,this.typedName="",this.place=i.place}ngOnInit(){this.placesService.getPlaceStats(this.place.id).subscribe(t=>{this.stats=t,this.loading=!1},()=>{this.failed=!0,this.loading=!1})}get canDelete(){return!this.loading&&this.typedName===this.place.name}get isEmpty(){const t=this.stats;return!!t&&!(t.active_locations||t.sensors||t.displays||t.alarms)}get rows(){const t=this.stats;return t?[this.row("location_on",!1,t.active_locations,"location","locations"),this.row("uptime-downtime",!0,t.sensors,"monitor","monitors"),this.row("tv_display",!0,t.displays,"public display","public displays"),this.row("notifications_outline",!1,t.alarms,"alarm","alarms"),this.row("group",!1,t.users,"user loses access","users lose access")].filter(i=>null!==i):[]}
1row(t,i,a,r,l){return a?{icon:t,isSvg:i,count:a,label:1===a?r:l}:null}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-delete-place-dialog"]],decls:28,vars:7,consts:[["color","primary"],[1,"dialog-header"],[1,"title-modal-window-text","generic-dialog-header"],["mat-icon-button","","type","button",3,"click"],[1,"dialog-content"],[1,"spacer-top-nil"],[1,"impact-label"],[4,"ngIf"],[1,"confirm-field"],["matInput","","name","confirmName","autocomplete","off","spellcheck","false",3,"ngModel","ngModelChange"],[1,"dialog-footer"],["mat-button","","type","button",1,"button-secondary",3,"click"],["mat-button","","type","button",1,"button-danger",3,"disabled","click"],["class","skeleton-row spacer-bottom-xs",4,"ngFor","ngForOf"],[1,"skeleton-row","spacer-bottom-xs"],[1,"skeleton","icon"],[1,"skeleton","line"],["class","spacer-bottom-xs",4,"ngIf"],[1,"impact"],[4,"ngFor","ngForOf"],["class","spacer-top-sm spacer-bottom-nil",4,"ngIf"],[1,"spacer-bottom-xs"],["class","inline-icon",4,"ngIf"],["class","inline-icon",3,"svgIcon",4,"ngIf"],[1,"inline-icon"],[1,"inline-icon",3,"svgIcon"],[1,"spacer-top-sm","spacer-bottom-nil"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"mat-toolbar",0)(2,"mat-toolbar-row",1)(3,"h4",2),e.\u0275\u0275text(4," Delete Place "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",3),e.\u0275\u0275listener("click",function(){return i.dialogRef.close()}),e.\u0275\u0275elementStart(6,"mat-icon"),e.\u0275\u0275text(7,"close"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(8,"div",4)(9,"p",5),e.\u0275\u0275text(10," Deleting "),e.\u0275\u0275elementStart(11,"b"),e.\u0275\u0275text(12),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(13," cannot be undone. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"p",6),e.\u0275\u0275text(15,"What will be removed"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(16,lo,2,2,"div",7),e.\u0275\u0275template(17,so,2,0,"p",7),e.\u0275\u0275template(18,fo,5,3,"ng-container",7),e.\u0275\u0275elementStart(19,"mat-form-field",8)(20,"mat-label"),e.\u0275\u0275text(21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"input",9),e.\u0275\u0275listener("ngModelChange",function(r){return i.typedName=r}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(23,"div",10)(24,"button",11),e.\u0275\u0275listener("click",function(){return i.dialogRef.close()}),e.\u0275\u0275text(25," Cancel "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"button",12),e.\u0275\u0275listener("click",function(){return i.dialogRef.close(!0)}),e.\u0275\u0275text(27," Delete "),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(12),e.\u0275\u0275textInterpolate(i.place.name),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.loading),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.loading&&i.failed),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.loading&&!i.failed),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("Type ",i.place.name," to confirm"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.typedName),e.\u0275\u0275advance(4),e.\u0275\u0275property("disabled",!i.canDelete))},directives:[nn.Ye,nn.rD,z.lW,Q.Hw,u.NgIf,u.NgForOf,D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.On],styles:[".impact-label[_ngcontent-%COMP%]{margin:16px 0 8px;font-size:var(--verySmallFontSize);font-weight:var(--midLargeFontWeight);letter-spacing:.06em;text-transform:uppercase;color:var(--grayColor700)}.impact[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:9px 18px;gap:9px 18px}.impact[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.impact[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--primaryColor500);flex:none}.skeleton-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.skeleton[_ngcontent-%COMP%]{display:inline-block;background:var(--grayColor200);border-radius:4px;
1height:16px}.skeleton.icon[_ngcontent-%COMP%]{width:24px;height:24px;border-radius:50%}.skeleton.line[_ngcontent-%COMP%]{width:120px}.confirm-field[_ngcontent-%COMP%]{width:100%;margin-top:10px}@media (max-width: 599px){.impact[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]}),n})();var $=d(71245);let go=(()=>{class n{constructor(t,i,a,r,l,f){this.places=t,this.httpHelper=i,this._messageService=a,this.dialogService=r,this.dialog=l,this.router=f,this.isDeleting=!1,this.destroy$=new H.xQ}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get isLastPlace(){var t,i;return(null!==(i=null===(t=this.places.places)||void 0===t?void 0:t.length)&&void 0!==i?i:0)<=1}confirmDelete(){const t=this.places.currentPlace;if(!t||this.isLastPlace||this.isDeleting)return;const i=this.dialog.open(ho,{data:{place:t}});this.dialogService.setFullScreenDialog(i,{desktopWidth:"480px",desktopHeight:"auto"}),i.afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.deletePlace(t.id,t.name)})}deletePlace(t,i){this.isDeleting=!0,this.places.deletePlace(t).pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.httpHelper.showSnackbar(`Place "${i}" was deleted`),this.switchToRemainingPlace()},a=>{"TimeoutError"!==(null==a?void 0:a.name)?403!==(null==a?void 0:a.status)?(this.isDeleting=!1,this.httpHelper.handleHttpErrorMessage(a,{custom_default:"Could not delete the place. Try again later."})):this.resolveUncertainDelete(t,i,"forbidden"):this.resolveUncertainDelete(t,i,"timeout")})}resolveUncertainDelete(t,i,a){this.httpHelper.get("/places").pipe((0,ao.K)(()=>(0,io.of)(null)),(0,A.R)(this.destroy$)).subscribe(r=>{if(r&&!r.some(l=>l.id===t))return this.httpHelper.showSnackbar(`Place "${i}" was deleted`),void this.switchToRemainingPlace();this.isDeleting=!1,this.httpHelper.showSnackbar(r?"timeout"===a?"That took too long and the place is still here. Please try again.":"You do not have permission to delete this place.":"timeout"===a?"That took too long. Reload the page to check whether the place was deleted.":"Could not delete the place. Reload the page to check whether it still exists.",8e3)})}switchToRemainingPlace(){this._messageService.listenMessage().pipe((0,Et.h)(t=>"places_loaded"===t),(0,Xe.q)(1),(0,A.R)(this.destroy$)).subscribe(()=>this.router.navigate(["/dashboard"])),this.places.getPlaces()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(y.F0))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-danger-zone"]],decls:4,vars:2,consts:[["mat-button","","type","button",1,"button-danger",3,"disabled","click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1,"Danger Zone"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",0),e.\u0275\u0275listener("click",function(){return i.confirmDelete()}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",i.isLastPlace||i.isDeleting),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.isDeleting?"Deleting\u2026":"Delete Place"," "))},directives:[z.lW],encapsulation:2}),n})();function vo(n,o){1&n&&e.\u0275\u0275element(0,"app-create-place")}function Co(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"app-place-limits"),e.\u0275\u0275elementEnd())}function bo(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"app-place-danger-zone"),e.\u0275\u0275elementEnd())}let xo=(()=>{class n{constructor(t,i,a){this.places=t,this.helpService=i,this.user=a,this.HelpSection=Z.L}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-general-place-settings"]],decls:19,vars:3,consts:[["justifyContent","flex-end"],[1,"right-buttons-wrapper"],[4,"ngIf"],["type","button","mat-button","",1,"button-secondary",3,"click"],[1,"inPage"],[1,"inner"],[1,"settings-block"],[2,"width","100%"],["class","settings-block",4,"ngIf"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"div",1),e.\u0275\u0275template(2,vo,1,0,"app-create-place",2),e.\u0275\u0275elementStart(3,"button",3),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.general_place,"Place")}),e.\u0275\u0275text(4," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(5,"section",4)(6,"div",5)(7,"div",6),e.\u0275\u0275element(8,"app-administration-my-place"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div",6),e.\u0275\u0275element(10,"app-raw-data-retention"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"div",6),e.\u0275\u0275element(12,"app-place-pm-standard",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",6),e.\u0275\u0275element(14,"app-place-temperature",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"div",6),e.\u0275\u0275element(16,"app-place-advanced-settings"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,Co,2,0,"div",8),e.\u0275\u0275template(18,bo,2,0,"div",8),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",(null==i.places.currentPlace?null:i.places.currentPlace.advanced_config)&&(null==i.places.currentPlace||null==i.places.currentPlace.permissions?null:i.places.currentPlace.permissions.settings)&&!i.user.isDemoDashboardUser),e.\u0275\u0275advance(15),e.\u0275\u0275property("ngIf",null==i.user.currentUser?null:i.user.currentUser.support_staff),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.places.currentPlace?null:i.places.currentPlace.advanced_config)&&(null==i.places.currentPlace||null==i.places.currentPlace.permissions?null:i.places.currentPlace.permissions.settings)))},directives:[ae.$,u.NgIf,La,z.lW,ja,$a,Ua,qa,Xa,no,go],styles:[".inner[_ngcontent-%COMP%]{padding:20px;position:relative}"]}),n})();
1var yo=d(64579),So=d(682),Pt=d(39446),wo=d(13665);function Eo(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",4),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.label)}}let To=(()=>{class n{constructor(t,i,a){this.placesService=t,this.helpService=i,this.dialog=a,this.correctionOptions=Object.keys(Pt.lC).filter(r=>Pt.lC[r].levels.includes(wo.E.place)).map(r=>({value:r,label:Pt.lC[r].label}))}ngOnInit(){this.currentCorrectionOption=this.placesService.currentPlace.plantower_pm2_correction_algo}confirmSavePMCorrection(){this.dialog.open(en.E,{width:"700px",data:{source:tn.$.PmCorrection}}).afterClosed().subscribe(i=>{i&&this.savePMCorrection()})}savePMCorrection(){this.placesService.putPMCorrectionFormula(this.placesService.currentPlace.id,{plantower_pm2_correction_algo:this.currentCorrectionOption})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-place-pm-correction"]],decls:16,vars:2,consts:[[1,"form-field-responsive-s"],[3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["mat-button","","type","button",1,"button-primary",3,"click"],[3,"value"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Calibration Formula "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div")(6,"mat-form-field",0)(7,"mat-label"),e.\u0275\u0275text(8,"PM"),e.\u0275\u0275elementStart(9,"sub"),e.\u0275\u0275text(10,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11," Calibration Formula"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"mat-select",1),e.\u0275\u0275listener("ngModelChange",function(r){return i.currentCorrectionOption=r}),e.\u0275\u0275template(13,Eo,2,2,"mat-option",2),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(14,"button",3),e.\u0275\u0275listener("click",function(){return i.confirmSavePMCorrection()}),e.\u0275\u0275text(15," Apply to All Locations "),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(12),e.\u0275\u0275property("ngModel",i.currentCorrectionOption),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.correctionOptions))},directives:[D.KE,D.hX,_e.gD,_.JJ,_.On,u.NgForOf,de.ey,z.lW],encapsulation:2}),n})();var Io=d(40171);let Po=(()=>{class n{constructor(t){this.helpService=t,this.HelpSection=Z.L}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-calibration-configuration"]],decls:16,vars:0,consts:[["justifyContent","flex-end"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inPage"],[1,"settings-block"],[1,"spacer-bottom-nil"],[1,"spacer-top-nil"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"button",1),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.calibration,"Calibration")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"section",2)(4,"div",3),e.\u0275\u0275element(5,"app-abc-period"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",3),e.\u0275\u0275element(7,"app-learning-time-offset"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",3),e.\u0275\u0275element(9,"app-place-pm-correction"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div",3),e.\u0275\u0275element(11,"app-temperature-rh-correction"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"p",4),e.\u0275\u0275text(13," Calibration changes saved here will be applied to incoming data going forward. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"p",5),e.\u0275\u0275text(15," For this reason, it may take several minutes for the updated values to display on the dashboard and the device screen of the indoor monitor. "),e.\u0275\u0275elementEnd()())},directives:[ae.$,z.lW,yo.O,So.N,To,Io.X],styles:[".inPage[_ngcontent-%COMP%]{padding:0 20px 20px}"]}),n})();var xn=d(42855);function ko(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",18),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("value",t)("disabled","Default"===i.selectedMonitorFirmware),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t," ")}}function Mo(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10)(1,"mat-form-field",15)(2,"mat-label"),e.\u0275\u0275text(3," Selected "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-select",16),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().selectedMonitorFirmware=a}),e.\u0275\u0275template(5,ko,2,3,"mat-option",17),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("value",t.selectedMonitorFirmware),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.monitorsFirmwares)}}function Ao(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",18),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("value",t)("disabled","Default"===i.selectedMaxFirmware),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t," ")}}function Do(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10)(1,"mat-form-field",15)(2,"mat-label"),e.\u0275\u0275text(3," Selected "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-select",16),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).selectedMaxFirmware=a}),e.\u0275\u0275template(5,Ao,2,3,"mat-option",17),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("value",t.selectedMaxFirmware),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.maxFirmwares)}}function Oo(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"h3"),e.\u0275\u0275text(2," Max Firmware "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",10)(4,"mat-checkbox",11),e.\u0275\u0275listener("change",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onNewestMaxVersionChecked(a)}),e.\u0275\u0275text(5," Always update to the latest stable version "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(6,Do,6,2,"div",12),e.\u0275\u0275elementStart(7,"button",13),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onSaveMax()}),e.\u0275\u0275text(8,"Save"),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("checked","Default"===t.selectedMaxFirmware),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","Default"!==t.selectedMaxFirmware)}}let Lo=(()=>{class n{constructor(t,i,a,r,l){this._messageService=t,this.placeService=i,this.helpService=a,this.fwHandler=r,this.userService=l,this.HelpSection=Z.L,this.destroy$=new H.xQ}get canManageMaxFirmware(){var t,i;return!!(null===(t=this.userService.currentUser)||void 0===t?void 0:t.support_staff)||!!(null===(i=this.userService.currentUser)||void 0===i?void 0:i.admin)}ngOnInit(){this.fwHandler.getFirmwareVersions(this.placeService.currentPlace.id,!0,"desc"),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"monitors_firmwares_loaded"===t&&(this.monitorsFirmwares=this.fwHandler.placeFirmwares,this.latestAvailableFirmware=this.monitorsFirmwares[0],this.selectedMonitorFirmware=this.placeService.currentPlace.generic_os_sensors_ota_id||"Default",this.maxFirmwares=this.fwHandler.maxFirmwares,this.latestAvailableMaxFirmware=this.maxFirmwares?this.maxFirmwares[0]:void 0,this.selectedMaxFirmware=this.placeService.currentPlace.max_sensors_ota_id||"Default")})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onNewestVersionChecked(t){this.selectedMonitorFirmware=t.checked?"Default":this.placeService.currentPlace.generic_os_sensors_ota_id||this.latestAvailableFirmware}onSave(){this.fwHandler.putFirmwareVersion(this.placeService.currentPlace.id,"Default"===this.selectedMonitorFirmware?null:this.selectedMonitorFirmware),this.placeService.currentPlace.generic_os_sensors_ota_id="Default"===this.selectedMonitorFirmware?null:this.selectedMonitorFirmware}onNewestMaxVersionChecked(t){this.selectedMaxFirmware=t.checked?"Default":this.placeService.currentPlace.max_sensors_ota_id||this.latestAvailableMaxFirmware}onSaveMax(){this.fwHandler.putMaxFirmwareVersion(this.placeService.currentPlace.id,"Default"===this.selectedMaxFirmware?null:this.selectedMaxFirmware),this.placeService.currentPlace.max_sensors_ota_id="Default"===this.selectedMaxFirmware?null:this.selectedMaxFirmware}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(xn.K),e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-current-firmware-configuration"]],decls:36,vars:4,consts:[["justifyContent","flex-end"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inPage"],[1,"inner"],[3,"isAccentWarning"],["warning",""],[1,"content"],[1,"info-icon"],["target","_blank","href","https://www.airgradient.com/documentation/firmwares/",1,"accent-link"],[1,"firmware-grid"],[1,"spacer-bottom-md","spacer-top-md"],[3,"checked","change"],["class","spacer-bottom-md spacer-top-md",4,"ngIf"],["mat-button","","type","button",1,"button-primary",3,"click"],[4,"ngIf"],[1,"form-field-responsive-s"],[3,"value","valueChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"button",1),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.current_fw_place_level,"Current Firmware")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"section",2)(4,"div",3)(5,"app-warning-message",4),e.\u0275\u0275elementContainerStart(6,5),e.\u0275\u0275elementStart(7,"p",6)(8,"mat-icon",7),e.\u0275\u0275text(9,"info_outline"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"b"),e.\u0275\u0275text(11,"Firmware"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(12,"p"),e.\u0275\u0275text(13," On this page, you can select the firmware version to use for this place. To enable automatic updates to the latest stable firmware version, check the 'Always update to the latest stable version' checkbox. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"p")(15,"b"),e.\u0275\u0275text(16,"Note:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(17," This configuration is only available for opensource models. To learn more, please visit "),e.\u0275\u0275elementStart(18,"a",8),e.\u0275\u0275text(19," Firmware Versions "),e.\u0275\u0275elementStart(20,"mat-icon"),e.\u0275\u0275text(2
11,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(22,". "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"p"),e.\u0275\u0275text(24," It might take up to one hour for the firmware to arrive on your monitor. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",9)(26,"div")(27,"h3"),e.\u0275\u0275text(28," Open Air & ONE Firmware "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"div",10)(30,"mat-checkbox",11),e.\u0275\u0275listener("change",function(r){return i.onNewestVersionChecked(r)}),e.\u0275\u0275text(31," Always update to the latest stable version "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(32,Mo,6,2,"div",12),e.\u0275\u0275elementStart(33,"button",13),e.\u0275\u0275listener("click",function(){return i.onSave()}),e.\u0275\u0275text(34,"Save"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(35,Oo,9,2,"div",14),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(5),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(25),e.\u0275\u0275property("checked","Default"===i.selectedMonitorFirmware),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","Default"!==i.selectedMonitorFirmware),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.canManageMaxFirmware))},directives:[ae.$,z.lW,je.R,Q.Hw,Je.oG,u.NgIf,D.KE,D.hX,_e.gD,u.NgForOf,de.ey],styles:[".inner[_ngcontent-%COMP%]{padding:20px;position:relative}.firmware-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:24px;gap:24px}@media (max-width: 991px){.firmware-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]}),n})();var ut=d(98744),Fo=d(42201);function Ro(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," LEDs on (CO"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," levels) "),e.\u0275\u0275elementContainerEnd())}function No(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," LEDs on (PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," levels) "),e.\u0275\u0275elementContainerEnd())}function Vo(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," LEDs on (GO IAQS) "),e.\u0275\u0275elementContainerEnd())}function Ho(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," LEDs off "),e.\u0275\u0275elementContainerEnd())}const jo=function(n){return[n]};function Bo(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",13)(1,"h3"),e.\u0275\u0275element(2,"app-mark-permissions",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"p"),e.\u0275\u0275text(4,"Set green/amber and amber/red cutoff points:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"ngx-slider",15),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().placesService.currentPlace.led_co2_mode_threshold_1=a})("highValueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().placesService.currentPlace.led_co2_mode_threshold_2=a}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"p",16),e.\u0275\u0275text(7,"Set ppm for all red LEDs on:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"ngx-slider",17),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().placesService.currentPlace.led_co2_mode_range_end=a}),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("textContent","CO<sub>2</sub> Configuration")("permissions",e.\u0275\u0275pureFunction1(7,jo,t.UsersPermissions.pps_admin)),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.placesService.currentPlace.led_co2_mode_threshold_1)("highValue",t.placesService.currentPlace.led_co2_mode_threshold_2)("options",t.options),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.placesService.currentPlace.led_co2_mode_range_end)("options",t.options2)}}function Go(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",18)(1,"button",19),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().confirmSaveLedMode()}),e.\u0275\u0275text(2," Apply to All Locations "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",9),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().resetToDefaultValues()}),e.\u0275\u0275text(4," Default Values "),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",t.placesService.currentPlace.led_co2_mode_range_end<t.placesService.currentPlace.led_co2_mode_threshold_2)}}let zo=(()=>{class n{constructor(t,i,a,r,l){this.placesService=t,this.user=i,this.helpService=a,this.dialog=r,this.dialogService=l,this.HelpSection=Z.L,this.UsersPermissions=it.S,this.options2={floor:400,step:50,ceil:5e3,translate:(f,w)=>f+" ppm"},this.options={floor:400,step:50,ceil:5e3,translate:(f,w)=>{switch(w){case ut.JG.Low:return"<b>Amber:</b> "+f+" ppm";case ut.JG.High:return"<b>Red:</b> "+f+" ppm";default:return f+" ppm"}}}}confirmSaveLedMode(){this.dialog.open(en.E,{width:"700px",data:{source:tn.$.LedMode}}).afterClosed().subscribe(i=>{i&&this.saveLedMode()})}saveLedMode(){this.placesService.saveLEDmode(this.placesService.currentPlace)}resetToDefaultValues(){this.placesService.currentPlace.led_co2_mode_threshold_1=1e3,this.placesService.currentPlace.led_co2_mode_threshold_2=2e3,this.placesService.currentPlace.led_co2_mode_range_end=4e3}openLedModeInfoDialog(){const t=this.dialog.open(Fo.w);this.dialogService.setFullScreenDialog(t,{desktopWidth:"700px",desktopHeight:"900px"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-led-config-comp"]],decls:33,vars:7,consts:[[1,"form-field-responsive-s"],["name","led",3,"ngModel","ngModelChange"],[4,"ngIf"],["value","off"],["value","co2"],["value","pm"],["value","iaqs"],["fxLayout","row",1,"spacer-bottom-md"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary","spacer-left-md",3,"click"],[1,"settings-block"],["class","led-controls-wrapper",4,"ngIf"],["fxLayout","row",4,"ngIf"],[1,"led-controls-wrapper"],[3,"textContent","permissions"],[3,"value","highValue","options","valueChange","highValueChange"],[1,"spacer-top-md"],[3,"value","o
1ptions","valueChange"],["fxLayout","row"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," LED Mode "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"mat-form-field",0)(3,"mat-label"),e.\u0275\u0275text(4,"Select LED Mode"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"mat-select",1),e.\u0275\u0275listener("ngModelChange",function(r){return i.placesService.currentPlace.led_mode=r}),e.\u0275\u0275elementStart(6,"mat-select-trigger"),e.\u0275\u0275template(7,Ro,5,0,"ng-container",2),e.\u0275\u0275template(8,No,5,0,"ng-container",2),e.\u0275\u0275template(9,Vo,2,0,"ng-container",2),e.\u0275\u0275template(10,Ho,2,0,"ng-container",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"mat-option",3),e.\u0275\u0275text(12,"LEDs off"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"mat-option",4),e.\u0275\u0275text(14,"LEDs on (CO"),e.\u0275\u0275elementStart(15,"sub"),e.\u0275\u0275text(16,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(17," levels)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-option",5),e.\u0275\u0275text(19,"LEDs on (PM"),e.\u0275\u0275elementStart(20,"sub"),e.\u0275\u0275text(21,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(22," levels)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"mat-option",6),e.\u0275\u0275text(24,"LEDs on (GO IAQS)"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(25,"div",7)(26,"button",8),e.\u0275\u0275listener("click",function(){return i.confirmSaveLedMode()}),e.\u0275\u0275text(27," Apply to All Locations "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"button",9),e.\u0275\u0275listener("click",function(){return i.openLedModeInfoDialog()}),e.\u0275\u0275text(29," Learn About LED Modes "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(30,"div",10),e.\u0275\u0275template(31,Bo,9,9,"div",11),e.\u0275\u0275template(32,Go,5,1,"div",12),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",i.placesService.currentPlace.led_mode),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","co2"===i.placesService.currentPlace.led_mode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","pm"===i.placesService.currentPlace.led_mode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","iaqs"===i.placesService.currentPlace.led_mode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","off"===i.placesService.currentPlace.led_mode),e.\u0275\u0275advance(21),e.\u0275\u0275property("ngIf",null==i.placesService||null==i.placesService.currentPlace||null==i.placesService.currentPlace.permissions?null:i.placesService.currentPlace.permissions.pps_admin),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==i.placesService||null==i.placesService.currentPlace||null==i.placesService.currentPlace.permissions?null:i.placesService.currentPlace.permissions.pps_admin))},directives:[D.KE,D.hX,_e.gD,_.JJ,_.On,_e.$L,u.NgIf,de.ey,V.xw,z.lW,dt.S,ut.w5],styles:[".led-controls-wrapper[_ngcontent-%COMP%]{width:100%}@media (min-width: 640px){.led-controls-wrapper[_ngcontent-%COMP%]{width:600px}}"]}),n})();var $o=d(74245),Uo=d(66385);let Wo=(()=>{class n{constructor(t){this.helpService=t,this.HelpSection=Z.L}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-led-display"]],decls:8,vars:0,consts:[["justifyContent","flex-end"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inPage"],[1,"settings-block"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"button",1),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.led,"LED & Display")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"section",2),e.\u0275\u0275element(4,"app-led-config-comp"),e.\u0275\u0275elementStart(5,"div",3),e.\u0275\u0275element(6,"app-day-night-config"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(7,"app-monitor-display-config"),e.\u0275\u0275elementEnd())},directives:[ae.$,z.lW,zo,$o.z,Uo.L],styles:[".inPage[_ngcontent-%COMP%]{padding:0 20px 20px}"]}),n})();var he=d(97187),_t=d(48781),ui=d(32368),an=d(74533),ft=d(53537);function qo(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1," To enable MQTT you have to enter a valid URL "),e.\u0275\u0275elementEnd())}function Ko(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",13),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(),r=e.\u0275\u0275reference(3);return a.saveMQTT(r.valid)}),e.\u0275\u0275text(1," Save MQTT Configuration "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(),i=e.\u0275\u0275reference(3);e.\u0275\u0275property("@slowAppearing",void 0)("disabled",t.current_mqtt_url===t.placesService.currentPlace.mqtt_broker_url||!i.valid)}}const Yo=function(n){return{opacity:n}};let Xo=(()=>{class n{constructor(t,i,a){this.placesService=t,this.dialog=i,this.helpService=a,this.MQTT_VALIDATION_
1STRING="^(mqtt|mqtts)://(?:[a-zA-Z0-9_-]+(?:.[a-zA-Z0-9_-]+)*)(?::d+)?$",this.HelpSection=Z.L,this.destroy$=new H.xQ,this.disablePending=!1,this.enablePending=!1}saveMQTT(t=!0){this.placesService.currentPlace.mqtt_enabled=!!t&&this.placesService.currentPlace.mqtt_enabled,this.placesService.currentPlace.mqtt_broker_url=this.current_mqtt_url,this.placesService.saveMQTTmode(this.placesService.currentPlace)}ngOnInit(){var t;this.current_mqtt_url=null===(t=this.placesService.currentPlace)||void 0===t?void 0:t.mqtt_broker_url}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onToggleChange(){this.placesService.currentPlace.mqtt_enabled?(this.disablePending||this.disableMQTT(),this.enablePending=!0):(this.placesService.currentPlace.mqtt_enabled=!0,this.saveMQTT())}disableMQTT(){this.dialog.open(he.$,{width:"350px",data:"Are you sure you want to disable MQTT?"}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i?this.saveMQTT():(this.placesService.currentPlace.mqtt_enabled=!0,this.disablePending=!1)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-mqtt-access"]],decls:22,vars:12,consts:[[1,"spacer-top-nil"],["mqttForm","ngForm"],[1,"toggle-overlay"],["name","Toggle button to able of disable MQTT",2,"margin-bottom","15px",3,"disabled","ngModel","ngModelChange","toggleChange"],[3,"ngStyle"],["fxLayout","column"],["appearance","fill",1,"form-field-responsive-m"],["matInput","","appRegexInputValidation","","required","","maxlength","250","name","'MQTT Url Field'","placeholder","mqtts://username:[email protected]:4711",3,"cdkAutosizeMinRows","cdkTextareaAutosize","pattern","ngModel","ngModelChange"],["mqtt_url","ngModel"],[4,"ngIf"],[1,"spacer-top-xs"],["href","https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/protocols/mqtt.html","target","_blank",1,"accent-link"],["mat-button","","class","button-primary","type","button",3,"disabled","click",4,"ngIf"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"]],template:function(t,i){if(1&t){const a=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"h3",0),e.\u0275\u0275text(1," MQTT "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"form",null,1),e.\u0275\u0275element(4,"div",2),e.\u0275\u0275elementStart(5,"mat-slide-toggle",3),e.\u0275\u0275listener("ngModelChange",function(l){return i.placesService.currentPlace.mqtt_enabled=l})("toggleChange",function(){e.\u0275\u0275restoreView(a);const l=e.\u0275\u0275reference(13);return i.onToggleChange(),l.reset(i.current_mqtt_url)}),e.\u0275\u0275elementStart(6,"span",4),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(8,"div",5)(9,"mat-form-field",6)(10,"mat-label"),e.\u0275\u0275text(11,"MQTT Broker URL"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"textarea",7,8),e.\u0275\u0275listener("ngModelChange",function(l){return i.current_mqtt_url=l}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(14,qo,2,0,"mat-hint",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"p",10),e.\u0275\u0275text(16," For more information visit "),e.\u0275\u0275elementStart(17,"a",11),e.\u0275\u0275text(18," MQTT Guidelines "),e.\u0275\u0275elementStart(19,"mat-icon"),e.\u0275\u0275text(20,"open_in_new"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(21,Ko,2,2,"button",12),e.\u0275\u0275elementEnd()}if(2&t){const a=e.\u0275\u0275reference(3),r=e.\u0275\u0275reference(13);e.\u0275\u0275advance(5),e.\u0275\u0275property("disabled",!(a.valid&&i.current_mqtt_url||i.placesService.currentPlace.mqtt_enabled))("ngModel",i.placesService.currentPlace.mqtt_enabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(10,Yo,i.placesService.currentPlace.mqtt_enabled?1:.6)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.placesService.currentPlace.mqtt_enabled?"Enabled":"Disabled",""),e.\u0275\u0275advance(5),e.\u0275\u0275property("cdkAutosizeMinRows",2)("cdkTextareaAutosize",!0)("pattern",
1i.MQTT_VALIDATION_STRING)("ngModel",i.current_mqtt_url),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!a.valid&&!i.placesService.currentPlace.mqtt_enabled),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngIf",r.dirty)}},directives:[_._Y,_.JL,_.F,ui.Rr,_.JJ,_.On,u.NgStyle,ce.Zl,V.xw,D.KE,D.hX,X.Nt,an.IC,_.Fj,ft.J,_.Q7,_.nD,_.c5,u.NgIf,D.bx,Q.Hw,z.lW],styles:["[_nghost-%COMP%] .mat-form-field-appearance-fill .mat-form-field-subscript-wrapper{padding:0 var(--xxs-size)}"],data:{animation:[_t.v]}}),n})();class Zo{constructor(){this.enabled=!1}}let _i=(()=>{class n{constructor(t,i,a){this.httpHelper=t,this.dialog=i,this._messageService=a,this.token=new Zo}getTokens(t){this.httpHelper.get("/places/"+t+"/access/token").subscribe(i=>{this.token=i},i=>{404!==i.status&&this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("token_loaded")})}createTokens(t){this.httpHelper.post("/places/"+t+"/access/token",null).pipe((0,si.w)(i=>(i[0].enabled=!0,this.httpHelper.put("/places/"+t+"/access/token",i[0])))).subscribe(()=>{},i=>{console.log(i),this.token.enabled=!1,this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("token_created"),this.httpHelper.showSnackbar("Token created/renewed"),this.getTokens(t)})}saveTokensConfiguration(t,i){this.httpHelper.put("/places/"+t+"/access/token",i).subscribe(()=>{},a=>{console.log(a),this.httpHelper.handleHttpErrorMessage(a)},()=>{this._messageService.sendMessage("token_updated"),this.httpHelper.showSnackbar("API Access information saved.")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject(F.uw),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();function Jo(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",8),e.\u0275\u0275text(1," Token: "),e.\u0275\u0275elementStart(2,"span",9),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"app-clipboard-copy",10),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.token),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",t.token)}}function er(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).updateToken()}),e.\u0275\u0275text(1,"Save "),e.\u0275\u0275elementEnd()}}function tr(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"div")(2,"button",11),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().renewToken()}),e.\u0275\u0275text(3,"Renew API token "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"p"),e.\u0275\u0275text(5,"Please note that the old token will stop working if you renew the API token"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"mat-form-field",12)(7,"mat-label"),e.\u0275\u0275text(8,"Notes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"textarea",13),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().notes=a}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"div",14),e.\u0275\u0275template(11,er,2,0,"button",15),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(9),e.\u0275\u0275property("ngModel",t.notes),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.notes!==t.tokenService.token.notes)}}const nr=function(n){return{opacity:n}};let ir=(()=>{class n{constructor(t,i,a,r,l){this.tokenService=t,this.dialog=i,this.messageService=a,this.placeService=r,this.helpService=l,this.HelpSection=Z.L,this.destroy$=new H.xQ,this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(f=>{if("token_loaded"===f){const{token:w,enabled:T,notes:M}=this.tokenService.token;this.token=w,this.enabled=T,this.notes=M}}),this.tokenService.getTokens(r.currentPlace.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onToggleChange(t){t.checked?(this.token||this.tokenService.createTokens(this.placeService.currentPlace.id),this.tokenService.token.enabled=!0,this.enabled=!0,this.tokenService.saveTokensConfiguration(this.placeService.currentPlace.id,this.tokenService.token)):this.disableToken()}renewToken(){this.dialog.open(he.$,{width:"350px",data:"The current access token will stop working, proceed with creation of a new token?"}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i&&this.tokenService.createTokens(this.placeService.currentPlace.id)})}updateToken(){const t=Object.assign(Object.assign({},this.tokenService.token),{notes:this.notes});this.tokenService.saveTokensConfiguration(this.placeService.currentPlace.id,t)}disableToken(){this.dialog.open(he.$,{width:"350px",data:"Are you sure you want to disable API access?"}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i?(this.tokenService.token.token=null,this.tokenService.token.enabled=!1,this.tokenService.saveTokensConfiguration(this.placeService.currentPlace.id,this.tokenService.token)):this.enabled=!0})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(_i),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-api-access"]],decls:16,vars:7,consts:[["fxLayout","column"],[1,"toggle-wrapper","spacer-bottom-md"],[3,"ngModel","change","ngModelChange"],[3,"ngStyle"],["class","spacer-nil",4,"ngIf"],[4,"ngIf"],[1,"spacer-top-xs"],["href","https://api.airgradient.com/public/docs/api/v1/","target","_blank",1,"accent-link"],[1,"spacer-nil"],[1,"f-weight-400"],["successMessage","Token has been copied to clipboard","size","normal",3,"copyValue"],["mat-button","","type","button",1,"button-primary",3,"click"],["appearance","fill",1,"form-field-responsive-m"],["matInput","","placeholder","Notes",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutGap","20px"],["mat-button","","class","button-primary","type","button","style","width: 200px",3,"click",4,"ngIf"],["mat-button","","type","button",1,"button-primary",2,"width","200px",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"h3"),e.\u0275\u0275text(1," API Access "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"div")(3,"div",0)(4,"div",1)(5,"mat-slide-toggle",2),e.\u0275\u0275listener("change",function(r){return i.onToggleChange(r)})("ngModelChange",function(r){return i.enabled=r}),e.\u0275\u0275elementStart(6,"span",3),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(8,Jo,5,2,"p",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(9,tr,12,2,"div",5),e.\u0275\u0275elementStart(10,"p",6),e.\u0275\u0275text(11," For more information visit "),e.\u0275\u0275elementStart(12,"a",7),e.\u0275\u0275text(13," AirGradient Sensor API "),e.\u0275\u0275elementStart(14,"mat-icon"),e.\u0275\u0275text(15,"open_in_new"),e.\u0275\u0275elementEnd()()()()()),2&t&&(e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",i.enabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(5,nr,i.enabled?1:.6)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(i.enabled?"Enabled":"Disabled"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!i.token),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.enabled))},directives:[V.xw,ui.Rr,_.JJ,_.On,u.NgStyle,ce.Zl,u.NgIf,Ie.Z,z.lW,D.KE,D.hX,X.Nt,_.Fj,V.SQ,Q.Hw],styles:[".toggle-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:30px}"]}),n})();var fi=d(91159);class ar{}var ht=d(24777),kt=d(23353),Be=d(26688);const or=["userInput"],rr=["auto"];function lr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",14),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.user_email),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.user_email," ")}}function sr(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-chip",15),e.\u0275\u0275listener("removed",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext().deleteUser(r)}),e.\u0275\u0275text(1),e.\u0275\u0275elementStart(2,"mat-icon",16),e.\u0275\u0275text(3,"clear"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("removable",!0),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.user_email," ")}}let hi=(()=>{class n{constructor(t,i,a,r,l,f,w){this.dialogRef=t,this.data=i,this.groupsServices=a,this.places=r,this.helpService=l,this.permissionServices=f,this.messageService=w,this.availableUsers=[],this.selectedUsers=[],this.userControl=new _.NI,this.separatorKeysCodes=[fi.K5,fi.OC],this.destroy$=new H.xQ,null==i?(this.group=new ar,this.addModus=!0):(this.group=i,this.addModus=!1)}ngOnInit(){this.group.users||(this.group.users=[]),this.loadAvailableUsers(),this.filteredUsers$=this.userControl.valueChanges.pipe((0,Jt.O)(null),(0,It.U)(t=>this.filterUsers(t))),this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"permissions_loaded"===t&&(this.availableUsers=this.permissionServices.filteredPermissions||[],this.initializeSelectedUsers())})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initializeSelectedUsers(){this.group.users&&(this.group.users.length>0||this.availableUsers.length>0)?(this.selectedUsers=this.group.users.map(t=>{const i=this.availableUsers.find(a=>a.user_id===t.id);return i?{id:i.user_id,user_email:i.user_email}:null}).filter(t=>
1null!==t),this.selectedUsers.forEach(t=>{this.filterUsers(t.user_email)})):this.selectedUsers=[]}loadAvailableUsers(){this.permissionServices.getPermissions(this.places.currentPlace.id)}deleteUser(t){const i=this.selectedUsers.findIndex(a=>a.id===t.id);i>-1&&this.selectedUsers.splice(i,1)}addUser(t){if(this.matAutocomplete.isOpen)return;const i=t.value;(i||"").trim()&&this.addUserToGroup(i.trim()),this.resetInput()}userSelected(t){this.addUserToGroup(t.option.value),this.resetInput()}onSubmit(){this.addModus?this.groupsServices.addItem(this.places.currentPlace,this.group,this.selectedUsers.map(t=>({id:t.id}))):(this.group.users=this.selectedUsers.map(t=>({id:t.id})),this.groupsServices.editItem(this.places.currentPlace,this.group))}addUserToGroup(t){const i=this.availableUsers.find(a=>a.user_email===t);i&&!this.selectedUsers.some(a=>a.id===i.user_id)&&this.selectedUsers.push({id:i.user_id,user_email:i.user_email})}resetInput(){this.userInput.nativeElement.value="",this.userControl.setValue(null)}filterUsers(t){if(!t)return this.availableUsers.filter(a=>!this.selectedUsers.some(r=>r.id===a.user_id));const i=t.toLowerCase();return this.availableUsers.filter(a=>a.user_email.toLowerCase().includes(i)&&!this.selectedUsers.some(r=>r.id===a.user_id))}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(kt.J),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-group"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(or,5),e.\u0275\u0275viewQuery(rr,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.userInput=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matAutocomplete=a.first)}},decls:23,vars:12,consts:[[3,"title","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],["fxLayout","","fxLayoutGap","16px grid"],[1,"full-width"],["matInput","","type","text","required","","placeholder","Name of group","name","name",3,"ngModel","ngModelChange"],[2,"margin-top","16px"],["chipList",""],["placeholder","Start typing to add users...",3,"formControl","matAutocomplete","matChipInputFor","matChipInputSeparatorKeyCodes","matChipInputAddOnBlur","matChipInputTokenEnd"],["userInput",""],[3,"optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"removable","removed",4,"ngFor","ngForOf"],[3,"value"],[3,"removable","removed"],["matChipRemove",""]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),e.\u0275\u0275text(6,"Name"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"input",5),e.\u0275\u0275listener("ngModelChange",function(r){return i.group.name=r}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(8,"div",6)(9,"mat-form-field",4)(10,"mat-label"),e.\u0275\u0275text(11,"Add Users to Group"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(12,"mat-chip-list",null,7),e.\u0275\u0275elementStart(14,"input",8,9),e.\u0275\u0275listener("matChipInputTokenEnd",function(r){return i.addUser(r)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"mat-autocomplete",10,11),e.\u0275\u0275listener("optionSelected",function(r){return i.userSelected(r)}),e.\u0275\u0275template(18,lr,2,2,"mat-option",12),e.\u0275\u0275pipe(19,"async"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(20,"mat-chip-list",null,7),e.\u0275\u0275template(22,sr,4,2,"mat-chip",13),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(2),r=e.\u0275\u0275reference(13),l=e.\u0275\u0275reference(17);e.\u0275\u0275property("title",i.addModus?"Add New Group":"Edit Group")("submitDisabled",!a.valid),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.group.name),e.\u0275\u0275advance(7),e.\u0275\u0275property("formControl",i.userControl)("matAutocomplete",l)("matChipInputFor",r)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes)("matChipInputAddOnBlur",!0),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pipeBind1(19,10,i.filteredUsers$)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngForOf",i.selectedUsers)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,V.SQ,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.JJ,_.On,Be.qn,Tt.ZL,Be.oH,_.oH,Tt.XC,u.NgForOf,de.ey,Be.HS,Q.Hw,Be.qH],pipes:[u.AsyncPipe],encapsulation:2}),n})();var on=d(29509);function cr(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"p"),e.\u0275\u0275text(2),e.\u0275\u0275elementStart(3,"a",3),e.\u0275\u0275text(4," support team "),e.\u0275\u0275elementStart(5,"mat-icon"),e.\u0275\u0275text(6,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(7," if you need to increase the limit. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate2(" You have reached the maximum number of ",t.featureLabel," allowed for this place (",t.currentLimit,"). Please contact our ")}}function pr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.message)}}let yn=(()=>{class n{constructor(t,i,a){this.dialogRef=t,this.subscriptionPlanService=i,this.data=a,this.message="",this.featureLabel="",this.currentLimit=null}ngOnInit(){var t,i,a;if(this.locationName=null===(t=this.data)||void 0===t?void 0:t.locationName,null===(i=this.data)||void 0===i?void 0:i.feature)return this.featureLabel=this.getFormattedFeatureLabel(null===(a=this.data)||void 0===a?void 0:a.feature),void(this.currentLimit=this.subscriptionPlanService.getCurrentAvailableItemsByFeature(this.data.feature));this.message="This action is not available."}getFormattedFeatureLabel(t){switch(t){case"users":return"users";case"groups":return"groups";
1case"alarms":return"alarms";default:return"items"}}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(on.G),e.\u0275\u0275directiveInject(F.WI))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-trial-dialog"]],decls:4,vars:4,consts:[[3,"title","submitText","cancel","submitting"],[4,"ngIf","ngIfElse"],["genericMessage",""],["target","_blank","href","https://www.airgradient.com/support/",1,"accent-link"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.dialogRef.close()}),e.\u0275\u0275template(1,cr,8,2,"ng-container",1),e.\u0275\u0275template(2,pr,2,1,"ng-template",null,2,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&t){const a=e.\u0275\u0275reference(3);e.\u0275\u0275property("title","Limit Reached")("submitText","Ok"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==i.data?null:i.data.feature)("ngIfElse",a)}},directives:[ve.b,u.NgIf,Q.Hw],encapsulation:2}),n})();var ye=d(39398),h=d(32075),W=d(92181);function mr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",10),e.\u0275\u0275text(1," lock "),e.\u0275\u0275elementEnd())}function dr(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",11),2&n&&e.\u0275\u0275property("message","groups")}function ur(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function _r(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).edit(a)}),e.\u0275\u0275text(1,"Edit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).deleteGroup(a)}),e.\u0275\u0275text(3,"Delete"),e.\u0275\u0275elementEnd()}}function fr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"mat-menu",null,23),e.\u0275\u0275template(3,_r,4,0,"ng-template",24),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",25)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function hr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Id"),e.\u0275\u0275elementEnd())}function gr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function vr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Users Count"),e.\u0275\u0275elementEnd())}function Cr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t.users?null:t.users.length,"")}}function br(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Name"),e.\u0275\u0275elementEnd())}function xr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name,"")}}function yr(n,o){1&n&&e.\u0275\u0275element(0,"tr",27)}function Sr(n,o){1&n&&e.\u0275\u0275element(0,"tr",28)}function wr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",12),e.\u0275\u0275elementContainerStart(1,13),e.\u0275\u0275template(2,ur,2,0,"th",14),e.\u0275\u0275template(3,fr,7,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,16),e.\u0275\u0275template(5,hr,2,0,"th",14),e.\u0275\u0275template(6,gr,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,17),e.\u0275\u0275template(8,vr,2,0,"th",14),e.\u0275\u0275template(9,Cr,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,18),e.\u0275\u0275template(11,br,2,0,"th",14),e.\u0275\u0275template(12,xr,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(13,yr,1,0,"tr",19),e.\u0275\u0275template(14,Sr,1,0,"tr",20),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",null==t.groupsServices?null:t.groupsServices.groups),e.\u0275\u0275advance(13),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Er(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",29),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",null==t.groupsServices?null:t.groupsServices.groups.length," Groups")}}let Tr=(()=>{class n{constructor(t,i,a,r,l,f,w){this.dialog=t,this.place=i,this.SubscriptionPlanService=a,this.helpService=r,this.groupsServices=l,this.dialogService=f,this._messageService=w,this.isTableEmpty=!1,this.displayedColumns=["time","users","edit"],this.HelpSection=Z.L,this.destroy$=new H.xQ,this.groupsServices.getGroups(this.place.currentPlace.id),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(T=>{"group_added"===T&&this.dialog.closeAll(),"group_loaded"===T&&(this.isTableEmpty=0===this.groupsServices.groups.length)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openDialog(){var t,i,a;this.SubscriptionPlanService.getPlanAccessByFeature("groups",null===(t=this.groupsServices)||void 0===t?void 0:t.groups.length)?(this.matDialogRef=this.dialog.open(hi),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})):(this.place.currentPlace.permissions.settings||this.SubscriptionPlanService.isMaximumItemsForFeatureReached("groups",null===(i=this.groupsServices)||void 0===i?void 0:i.groups.length))&&this.dialog.open(yn,{data:{feature:"groups",featureItemsCount:null===(a=this.groupsServices)||void 0===a?void 0:a.groups.length}})}deleteGroup(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete "+t.name+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.groupsServices.deleteItem(this.place.currentPlace,t)})}edit(t){this.matDialogRef=this.dialog.open(hi,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(on.G),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-groups"]],decls:12,vars:4,consts:[["justifyContent","flex-end"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["class","subscription-plan-locked-icon in-btn",4,"ngIf"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inPage"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],["class","table-counter",4,"ngIf"],[1,"subscription-plan-locked-icon","in-btn"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","users"],["matColumnDef","time"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-header-row",""],["mat-row",""],[1,"table-counter"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"div",1)(2,"button",2),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(3," Add New "),e.\u0275\u0275template(4,mr,2,0,"mat-icon",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.groups,"Groups")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"section",5)(8,"div",6),e.\u0275\u0275template(9,dr,1,1,"app-no-data",7),e.\u0275\u0275template(10,wr,15,3,"table",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(11,Er,2,1,"div",9),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!i.SubscriptionPlanService.getPlanAccessByFeature("groups",null==i.groupsServices?null:i.groupsServices.groups.length)),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,Q.Hw,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,h.as,h.XQ,h.nj,h.Gk],encapsulation:2}),n})();const Ir=["tabGroup"];function Pr(n,o){1&n&&e.\u0275\u0275element(0,"app-general-place-settings")}function kr(n,o){1&n&&e.\u0275\u0275element(0,"app-calibration-configuration")}function Mr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab",11),e.\u0275\u0275template(1,kr,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function Ar(n,o){1&n&&e.\u0275\u0275element(0,"app-current-firmware-configuration")}function Dr(n,o){1&n&&e.\u0275\u0275element(0,"app-led-display")}function Or(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab",12),e.\u0275\u0275template(1,Dr,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function Lr(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-sub-header",13)(1,"button",14),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.helpService.openHelpDialog(a.HelpSection.connectivity,"Connectivity")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"section",15)(4,"div",16),e.\u0275\u0275element(5,"app-mqtt-access")(6,"app-api-access"),e.\u0275\u0275elementEnd()()}}function Fr(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-groups")}function Rr(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-tab-group",2,3),e.\u0275\u0275listener("selectedTabChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateRoute()}),e.\u0275\u0275elementStart(2,"mat-tab",4),e.\u0275\u0275template(3,Pr,1,0,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Mr,2,0,"mat-tab",6),e.\u0275\u0275elementStart(5,"mat-tab",7),e.\u0275\u0275template(6,Ar,1,0,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,Or,2,0,"mat-tab",8),e.\u0275\u0275elementStart(8,"mat-tab",9),e.\u0275\u0275template(9,Lr,7,0,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-tab",10),e.\u0275\u0275template(11,Fr,1,0,"ng-template",5),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",t.places.currentPlace.advanced_config),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.places.currentPlace.advanced_config)}}let Nr=(()=>{class n{constructor(t,i,a,r,l,f,w){this.dataServices=t,this.places=i,this.user=a,this.router=r,this.helpService=l,this.activatedRoute=f,this.sensorServices=w,this.HelpSection=Z.L,this.showAdvancedPlaceSettings=!1,this.destroy$=new H.xQ}ngOnInit(){this.dataServices.currentScreen="General Settings",this.showAdvancedPlaceSettings=this.places.currentPlace.advanced_config}ngAfterViewInit(){this.activatedRoute.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.setSelectedTabIndex(this.activatedRoute.snapshot.queryParams.tab||0)})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}updateRoute(){this.router.navigate([],{queryParams:{tab:this.tabGroup.selectedIndex}})}setSelectedTabIndex(t,i=!1){this.tabGroup.selectedIndex=Number(t),i&&setTimeout(()=>{window.scrollTo({top:i,behavior:"smooth"})},200)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(De.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-page-location-adminstration"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(Ir,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.tabGroup=a.first)}},decls:2,vars:1,consts:[[1,"page"],[3,"selectedTabChange",4,"ngIf"],[3,"selectedTabChange"],["tabGroup",""],["label","Place"],["matTabContent",""],["label","Calibration",4,"ngIf"],["label","Firmware"],["label","LED & Display",4,"ngIf"],["label","Connectivity"],["label","Groups"],["label","Calibration"],["label","LED & Display"],["justifyContent","flex-end"],["mat-button","","type","button",1,"button-secondary",3,"click"],["fxLayout","row wrap","fxLayoutAlign","start",1,"inPage"],["fxFlex","","fxLayoutGap","5px","fxLayout","column","fxLayoutAlign","start start",1,"control"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0),e.\u0275\u0275template(1,Rr,12,2,"mat-tab-group",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.places.currentPlace))},directives:[u.NgIf,se.SP,se.uX,se.Vc,xo,Po,Lo,Wo,ae.$,z.lW,V.xw,V.Wh,V.yH,V.SQ,Xo,ir,Tr],styles:[".control[_ngcontent-%COMP%]{padding:20px}"]}),n})();var et=d(14639),Sn=d(38440);let gi=(()=>{class n{constructor(t,i,a,r,l){this.router=t,this.dataServices=i,this.logging=a,this.placeService=r,this.userService=l}canActivate(){var t,i,a;const r=null===(t=this.userService.currentUser)||void 0===t?void 0:t.authenticated,l=null===(a=null===(i=this.placeService)||void 0===i?void 0:i.places)||void 0===a?void 0:a.length;if(r&&l)return!!this.placeService.isCaaAdmin()||(this.router.navigate(["/dashboard"]),!1);const f=new H.xQ;return this.dataServices.combinedUserPlaceData.subscribe(([w])=>{if(w){if(this.logging.sendLogEntry("Authenticated","success"),this.placeService.isCaaAdmin())return f.next(!0),!0;f.next(!1),this.router.navigate(["/dashboard"])}else this.dataServices.appLoader=!0,f.next(!1),this.router.navigate(["/signin"])}),f.asObservable()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(y.F0),e.\u0275\u0275inject(ee.O),e.\u0275\u0275inject(Sn.J),e.\u0275\u0275inject(R.E),e.\u0275\u0275inject(xe.K))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();
1var Ge=d(87872),Ce=d(86087),U=d(84847),gt=d(15439),wn=d.n(gt);let En=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i}getMakers(){this.httpHelper.get("/makers?external=true").subscribe(t=>{this.makers=t.sort((i,a)=>i.id.localeCompare(a.id))},t=>{console.log(t),this.httpHelper.handleHttpErrorMessage(t)},()=>{this._messageService.sendMessage("makers_loaded")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();var Vr=d(67172),Se=d(49973),Ht=d(12748),jt=d(66388),rn=d(12906),Tn=d(66695),ze=d(81125),ln=d(77743);const Hr=["modelControl"];function jr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275element(1,"app-outdated-firmware-banner"),e.\u0275\u0275elementEnd())}function Br(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementEnd())}function Gr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();let i;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Serial No. should be ",(null==(i=t.setupMonitorGroup.get("monitorModel"))?null:i.value)===t.MonitorModels._I1DIY?"up to 6, or 12":"12"," characters long. ")}}function zr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Only Hexadecimal value is available. "),e.\u0275\u0275elementEnd())}function $r(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),e.\u0275\u0275text(2,"Internal Notes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"input",14),e.\u0275\u0275elementEnd())}function Ur(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",15),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.name)}}function Wr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",15),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"monitorModelHandler"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,2,t)," ")}}function Qr(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Wr,3,4,"mat-option",20),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t!==i.MonitorModels._O1PPT)}}function qr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-select",17,18),e.\u0275\u0275template(2,Qr,2,1,"ng-container",19),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",null==t.sensorServices?null:t.sensorServices.sensor_models)}}function Kr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",8)(1,"mat-label"),e.\u0275\u0275text(2,"AirGradient Model"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,qr,3,1,"mat-select",16),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","airgradient"===t.setupMonitorGroup.get("makerId").value)}}function Yr(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",8)(1,"mat-label"),e.\u0275\u0275text(2,"API token"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"input",21),e.\u0275\u0275elementEnd())}function Xr(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"form",27)(1,"mat-form-field"),e.\u0275\u0275element(2,"mat-label",23)(3,"input",28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-form-field"),e.\u0275\u0275element(5,"mat-label",23)(6,"input",29),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-form-field"),e.\u0275\u0275element(8,"mat-label",23)(9,"input",30),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-form-field"),e.\u0275\u0275element(11,"mat-label",23)(12,"input",31),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"mat-form-field"),e.\u0275\u0275element(14,"mat-label",23)(15,"input",32),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"mat-form-field"),e.\u0275\u0275element(17,"mat-label",23)(18,"input",33),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"mat-form-field"),e.\u0275\u0275element(2
10,"mat-label",23)(21,"input",34),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("formGroup",t.no2O3calibrationForm),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML","NO<sub>2</sub> Serial No",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","O<sub>3</sub> Serial No",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","NO<sub>2</sub> Total Aux Electrode Zero Offset",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","O<sub>3</sub> Total Aux Electrode Zero Offset",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","NO<sub>2</sub> Sensitivity",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","O<sub>3</sub> Sensitivity",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("innerHTML","O<sub>3</sub> NO<sub>2</sub> Sensitivity",e.\u0275\u0275sanitizeHtml)}}function Zr(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",22)(1,"mat-accordion")(2,"mat-expansion-panel")(3,"mat-expansion-panel-header")(4,"mat-panel-title"),e.\u0275\u0275element(5,"span",23),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"div",24),e.\u0275\u0275template(7,Xr,22,8,"form",25),e.\u0275\u0275elementStart(8,"button",26),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onCalibrationSubmit()}),e.\u0275\u0275elementEnd()()()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("@.disabled",t.disableAnimation),e.\u0275\u0275advance(4),e.\u0275\u0275property("innerHTML","NO<sub>2</sub>/O<sub>3</sub> Calibration Parameters",e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.no2O3calibrationForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",!(null!=t.no2O3calibrationForm&&t.no2O3calibrationForm.valid))("innerHTML","Save NO<sub>2</sub>/ O<sub>3</sub> Calibration Parameters",e.\u0275\u0275sanitizeHtml)}}const Jr=function(n){return{"spacer-top-md":n}};let In=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B,j){this.dialog=t,this.sensorServices=i,this.dialogRef=a,this.data=r,this.places=l,this.userService=f,this._messageService=w,this.locationsServices=T,this.makers=M,this._formBuilder=B,this.changeDetection=j,this.modelSelectAutoOpen=!1,this.showFirmwareWarning=!1,this.disableAnimation=!0,this.updateLocationsOnSensorDetailsSave=!1,this.SENSOR_ID_VALIDATION_STRING=Ht.A,this.MonitorModels=Se.c,this.isPortrait=jt.gr,this.destroy$=new H.xQ}ngOnInit(){null==this.data?(this.sensor=new Vr.L,this.addModus=!0):(this.sensor=this.data.data,this.modelSelectAutoOpen=this.data.modelSelectAutoOpen,this.addModus=!1),this.makers.makers||this.makers.getMakers(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{var i;"sensor_added"===t&&this.dialogRef.close({sensor:this.sensor}),"sensor_saved"===t&&(this.sensor.maker_name=null===(i=this.makers.makers.find(a=>a.id===this.sensor.maker_id))||void 0===i?void 0:i.name,this.dialogRef.close({sensor:this.sensor}),this.updateLocationsOnSensorDetailsSave&&this.locationsServices.getLocations(this.places.currentPlace.id)),"no2_o3_correction_config_saved"===t&&(this.sensor.no2_sensitivity=this.no2O3calibrationForm.value.no2_sensitivity,this.sensor.o3_sensitivity=this.no2O3calibrationForm.value.o3_sensitivity,this.sensor.o3_no2_sensitivity=this.no2O3calibrationForm.value.o3_no2_sensitivity,this.sensor.no2_total_aux_electrode_zero_offset=this.no2O3calibrationForm.value.no2_total_aux_electrode_zero_offset,this.sensor.o3_total_aux_electrode_zero_offset=this.no2O3calibrationForm.value.o3_total_aux_electrode_zero_offset,this.sensor.no2_serial_no=this.no2O3calibrationForm.value.no2_serial_no,this.sensor.o3_serial_no=this.no2O3calibrationForm.value.o3_serial_no)}),this.initForm(),this.initCalibrationForm(),this.setupMonitorGroup.get("monitorModel").valueChanges.pipe((0,A.R)(this.destroy$)).subscribe(t=>{this.updateLocationsOnSensorDetailsSave=!(!rn.dA.includes(t)&&!rn.dA.includes(this.sensor.model)),this.sensor.model=t})}ngAfterViewInit(){setTimeout(()=>this.disableAnimation=!1)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initForm(){this.setupMonitorGroup=this._formBuilder.group({monitorSerialNumber:[this.sensor.serialno,_.kI.required],makerId:[this.sensor.maker_id,_.kI.required],notes:[this.sensor.notes],internalNotes:[this.sensor.internal_notes],monitorModel:[this.sensor.model],apiToken:[this.sensor.api_token]}),this.changeDetection.detectChanges(),this.modelSelectAutoOpen&&setTimeout(()=>{this.modelControl.open()},100)}initCalibrationForm(){this.no2O3calibrationForm=this._formBuilder.group({no2_serial_no:[this.sensor.no2_serial_no,_.kI.required],o3_serial_no:[this.sensor.o3_seri
1al_no,_.kI.required],no2_total_aux_electrode_zero_offset:[this.sensor.no2_total_aux_electrode_zero_offset,_.kI.required],o3_total_aux_electrode_zero_offset:[this.sensor.o3_total_aux_electrode_zero_offset,_.kI.required],no2_sensitivity:[this.sensor.no2_sensitivity,_.kI.required],o3_sensitivity:[this.sensor.o3_sensitivity,_.kI.required],o3_no2_sensitivity:[this.sensor.o3_no2_sensitivity,_.kI.required]})}get isChipIdFieldValid(){const t=this.setupMonitorGroup.value;return 12===t.monitorSerialNumber.length||t.monitorModel===Se.c._I1DIY&&(t.monitorSerialNumber.length%6==0||t.monitorSerialNumber.length<6)}onCalibrationSubmit(){this.sensorServices.saveNO2_O3_CorrectionConfig(this.places.currentPlace.id,this.sensor.id,this.no2O3calibrationForm.value)}onSubmit(){const t=this.setupMonitorGroup.value;this.isChipIdFieldValid||"airgradient"!==t.makerId?(this.sensor.serialno=t.monitorSerialNumber.toLowerCase(),this.sensor.notes=t.notes,this.sensor.internal_notes=t.internalNotes,this.sensor.maker_id=t.makerId,this.sensor.api_token=t.apiToken,this.sensor.model=t.monitorModel===this.MonitorModels._O1PPT?this.MonitorModels._O1PP:t.monitorModel,"airgradient"!==this.sensor.maker_id&&(this.sensor.model=null),this.addModus?this.sensorServices.addSensor(this.places.currentPlace,this.sensor):this.sensorServices.saveSensor(this.places.currentPlace,this.sensor)):(this.setupMonitorGroup.controls.monitorSerialNumber.setErrors(this.isChipIdFieldValid?null:{incorrect:!0}),this.setupMonitorGroup.controls.monitorSerialNumber.markAsTouched())}onDelete(){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:`Are you sure to delete the monitor with serial number ${this.sensor.serialno}?`}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i&&(this.sensorServices.deleteSensor(this.places.currentPlace,this.sensor),this.dialog.closeAll())})}removeValidationOfFormControl(t){this.setupMonitorGroup.get(t).clearValidators(),this.setupMonitorGroup.get(t).updateValueAndValidity()}makerIdChanged(){"airgradient"===this.setupMonitorGroup.value.makerId?(this.setupMonitorGroup.get("monitorModel").setValidators([_.kI.required]),this.setupMonitorGroup.get("monitorSerialNumber").setValidators([_.kI.required,_.kI.maxLength(12),_.kI.pattern(Ht.A)])):(this.removeValidationOfFormControl("monitorSerialNumber"),this.removeValidationOfFormControl("monitorModel"),this.setupMonitorGroup.get("monitorSerialNumber").setValidators([_.kI.required])),this.changeDetection.detectChanges()}getErrors(t,i="required"){var a,r;return null===(r=null===(a=this.setupMonitorGroup.controls[t])||void 0===a?void 0:a.errors)||void 0===r?void 0:r[i]}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(En),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject(e.ChangeDetectorRef))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-show-edit-sensor"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(Hr,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.modelControl=a.first)}},inputs:{addModus:"addModus",sensor:"sensor"},decls:27,vars:21,consts:[[3,"title","submitDisabled","isCustomBottomCancel","cancelText","cancel","customCancel","submitting"],["class","spacer-bottom-md",4,"ngIf"],["fxLayout","column",3,"formGroup","ngSubmit"],["matInput","","required","","appRegexInputValidation","","placeholder","Enter the monitor serial number","type","text","formControlName","monitorSerialNumber",3,"regexString","isLowerCaseOnly","maxlength"],[4,"ngIf"],[3,"ngClass"],["matInput","","type","text","formControlName","notes","placeholder","Enter any notes"],[1,"additional-settings"],[1,"form-field-responsive-s"],["required","","formControlName","makerId",3,"placeholder","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["class","form-field-responsive-s",4,"ngIf"],["class","extra-calibration-params spacer-top-md spacer-bottom-md",4,"ngIf"],[1,"spacer-bottom-md"],["matInput","","type","text","placeholder","Enter any internal notes","formControlName","internalNotes"],[3,"value"],["required","","placeholder","'Select Model'","formControlName","monitorModel",4,"ngIf"],["required","","placeholder","'Select Model'","formControlName","monitorModel"],["modelControl",""],[4,"ngFor","ngForOf"],[3,"value",4,"ngIf"],["matInput","","type","text","placeholder","Enter the API token","formControlName","apiToken"],[1,"extra-calibration-params","spacer-top-md","spacer-bottom-md"],[3,"innerHTML"],[1,"extra-calibration-params-inner"],[3,"formGroup",4,"ngIf"],["mat-button","","type","button",1,"button-secondary","spacer-top-md","spacer-left-auto",3,"disabled","innerHTML","click"],[3,"formGroup"],["matInput","","type","number","formControlName","no2_serial_no"],["matInput","","type","number","formControlName","o3_seri
1al_no"],["matInput","","type","number","formControlName","no2_total_aux_electrode_zero_offset"],["matInput","","type","number","formControlName","o3_total_aux_electrode_zero_offset"],["matInput","","type","number","formControlName","no2_sensitivity"],["matInput","","type","number","formControlName","o3_sensitivity"],["matInput","","type","number","formControlName","o3_no2_sensitivity"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("customCancel",function(){return i.onDelete()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275template(1,jr,2,0,"div",1),e.\u0275\u0275elementStart(2,"form",2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(3,"mat-form-field")(4,"mat-label"),e.\u0275\u0275text(5,"Monitor Serial Number"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(6,"input",3),e.\u0275\u0275elementStart(7,"mat-error"),e.\u0275\u0275template(8,Br,2,0,"span",4),e.\u0275\u0275template(9,Gr,2,1,"span",4),e.\u0275\u0275template(10,zr,2,0,"span",4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"mat-form-field",5)(12,"mat-label"),e.\u0275\u0275text(13,"Notes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"input",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(15,$r,4,0,"mat-form-field",4),e.\u0275\u0275elementStart(16,"div",7)(17,"mat-form-field",8)(18,"mat-label"),e.\u0275\u0275text(19,"Maker"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"mat-select",9),e.\u0275\u0275listener("selectionChange",function(){return i.makerIdChanged()}),e.\u0275\u0275template(21,Ur,2,2,"mat-option",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"mat-error"),e.\u0275\u0275text(23,"Maker is required"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(24,Kr,4,1,"mat-form-field",11),e.\u0275\u0275template(25,Yr,4,0,"mat-form-field",11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(26,Zr,9,5,"div",12),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("title",i.addModus?"Add Monitor":"Edit Monitor")("submitDisabled",!i.setupMonitorGroup.valid)("isCustomBottomCancel",!i.addModus)("cancelText",i.addModus?"Cancel":"Delete"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.sensor?null:i.sensor.model)&&(null==i.places.currentPlace?null:i.places.currentPlace.generic_os_sensors_ota_id)),e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroup",i.setupMonitorGroup),e.\u0275\u0275advance(4),e.\u0275\u0275property("regexString","airgradient"===i.setupMonitorGroup.get("makerId").value?i.SENSOR_ID_VALIDATION_STRING:"^[A-Za-z0-9!@#$%^&*()-=_+;:,.<>?`~/]*$")("isLowerCaseOnly","airgradient"===i.setupMonitorGroup.get("makerId").value)("maxlength","airgradient"===i.setupMonitorGroup.get("makerId").value?12:30),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.getErrors("monitorSerialNumber")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.getErrors("monitorSerialNumber","maxlength")||i.getErrors("monitorSerialNumber","incorrect")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.getErrors("monitorSerialNumber","pattern")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(19,Jr,i.getErrors("monitorSerialNumber","maxlength")&&i.getErrors("monitorSerialNumber","pattern")&&i.isPortrait())),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.places.currentPlace.advanced_config),e.\u0275\u0275advance(5),e.\u0275\u0275propertyInterpolate("placeholder",(null==i.sensor.maker_id?null:i.sensor.maker_id.length)>0?i.sensor.maker_id:"Select Maker"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",null==i.makers?null:i.makers.makers),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","airgradient"===i.setupMonitorGroup.get("makerId").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","airgradient"!==i.setupMonitorGroup.get("makerId").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.sensor.model===i.MonitorModels._OM1PPSTONCE&&i.userService.currentUser.support_staff))},directives:[ve.b,u.NgIf,Tn.V,_._Y,_.JL,V.xw,_.sg,D.KE,D.hX,X.Nt,_.Fj,_.Q7,ft.J,_.JJ,_.u,_.nD,D.TO,u.NgClass,ce.oO,_e.gD,u.NgForOf,de.ey,ze.pp,ze.ib,ze.yz,ze.yK,_.wV,z.lW],pipes:[ln.n],styles:[".additional-settings[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between}.extra-calibration-params[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;column-gap:30px;justify-content:flex-end}.extra-calibration-params[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:calc(50% - 15px)}.extra-calibration-params-inner[_ngcontent-%COMP%]{text-align:right}@media (max-width: 768px){.extra-calibration-params[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.extra-calibration-params-inner[_ngcontent-%COMP%]{text-align:left}}"]}),n})(),el=(()=>{class n{constructor(t,i){this.data=t,this.dialogRef=i,this.location=t}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(F.so
1))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-show-info-location"]],inputs:{location:"location"},decls:18,vars:13,consts:[["title","Location Information",3,"hideFooter","cancel"],["successMessage","Monitor serial number has been copied to clipboard",3,"copyValue"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()}),e.\u0275\u0275elementStart(1,"div")(2,"strong"),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div"),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"slice"),e.\u0275\u0275element(7,"app-clipboard-copy",1),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div"),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div"),e.\u0275\u0275text(11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div"),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div"),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div"),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275property("hideFooter",!0),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("Location name: ",i.location.name,""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Linked Monitor: ",e.\u0275\u0275pipeBind3(6,9,i.location.sensor_uid,0,20)," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("copyValue",i.location.sensor_uid),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Indoor Location: ",i.location.indoor?"Yes":"No",""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Active Location: ",i.location.active?"Yes":"No",""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Included in Reporting: ",i.location.controlled?"Yes":"No",""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Group Name: ",i.location.group_name,""),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Location Notes: ",i.location.notes,""))},directives:[ve.b,Ie.Z],pipes:[u.SlicePipe],encapsulation:2}),n})();var vi=d(44936),Re=d(2045),tl=d(79033),Pn=d(77314),at=d(85899),$e=d(29046),vt=d(4834),Ct=d(1603),Bt=d(27789),kn=d(43569),Ci=d(51018);function nl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275element(1,"app-outdated-firmware-banner"),e.\u0275\u0275elementEnd())}function il(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",14)}function al(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",15),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}2&n&&e.\u0275\u0275property("keepSearchParameterInURL",!0)}const bi=function(n){return[n]};function ol(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().new()}),e.\u0275\u0275element(1,"app-mark-permissions",17),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("textContent","Add New")("permissionColoredContent",!1)("permissions",e.\u0275\u0275pureFunction1(3,bi,t.UsersPermissions.advanced_config))}}function rl(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",19),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).refresh()}),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275element(2,"app-mark-permissions",22),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275classProp("spinner",t.loadingPage),e.\u0275\u0275advance(2),e.\u0275\u0275property("textContent","Refresh")("permissions",e.\u0275\u0275pureFunction1(4,bi,t.UsersPermissions.advanced_config))}}function ll(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275template(0,rl,3,6,"button",18),e.\u0275\u0275elementStart(1,"button",19),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.helpService.openHelpDialog(a.HelpSection.sensors,"Hardware Administration")}),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275text(3," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(4,"mat-divider"),e.\u0275\u0275elementStart(5,"span",20)(6,"mat-checkbox",21),e.\u0275\u0275listener("change",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter()})("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onlyOnline=a}),e.\u0275\u0275text(7,"Show Only Online"),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.userService||null==t.userService.currentUser?null:t.userService.currentUser.admin)),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",t.onlyOnline)}}function sl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"button",23)(1,"mat-icon",24),e.\u0275\u0275text(2,"more_vert"),e.\u0275\u0275elementEnd()()),2&n){e.\u0275\u0275nextContext();const t=e.\u0275\u0275reference(8);e.\u0275\u0275property("matMenuTriggerFor",t)}}function cl(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",25),2&n&&e.\u0275\u0275property("message","monitors")}function pl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Serial No."),e.\u0275\u0275elementEnd())}function ml(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"div",50)(2,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openLocationMonitorInfo(r)}),e.\u0275\u0275pipe(3,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"app-clipboard-copy",52),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275property("isLocationName",!1)("customWidth","fit-content")("value",t.serialno.length>40?e.\u0275\u0275pipeBind3(3,4,t.serialno,0,40)+".. ":t.serialno),e.\u0275\u0275advance(2),e.\u0275\u0275property("copyValue",t.serialno)}}function dl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Firmware"),e.\u0275\u0275elementEnd())}function ul(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",56),2&n){const t=e.\u0275\u0275nextContext().ngIf,i=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("statusText",i.fw_id)("noMobileCollapsedVersion",!0)("statusTooltipText",t.tooltip)("statusChipType",t.chipType)}}function _l(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,ul,1,4,"app-chip-status",55),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.fw_id)}}function fl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275template(1,_l,2,1,"ng-container",54),e.\u0275\u0275pipe(2,"firmwareChipConfig"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,1,t))}}function hl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Current Uptime Count"),e.\u0275\u0275elementEnd())}function gl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(2,1,t.current_boot_c
1ount,"1.0-2",i.browserLocaleService.globalLocale)," ")}}function vl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"UID"),e.\u0275\u0275elementEnd())}function Cl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.uid,"")}}function bl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Maker"),e.\u0275\u0275elementEnd())}function xl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",57),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.maker_name,"")}}function yl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Model"),e.\u0275\u0275elementEnd())}function Sl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"monitorModelHandler"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.model)," ")}}function wl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Commissioning Date"),e.\u0275\u0275elementEnd())}function El(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.commissioning_date),"")}}function Tl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Linked Location"),e.\u0275\u0275elementEnd())}function Il(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-interactive-table-cell",61),e.\u0275\u0275listener("cellClick",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).openLocationMonitorInfo(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!1)("customWidth","fit-content")("value",t.location_name)}}function Pl(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275textInterpolate1(" ",t.location_name," ")}}function kl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275template(1,Il,2,3,"ng-container",59),e.\u0275\u0275template(2,Pl,1,1,"ng-template",null,60,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.location_id)("ngIfElse",i)}}function Ml(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",62),e.\u0275\u0275text(1," Admin "),e.\u0275\u0275elementEnd())}function Al(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",63),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openLocationMonitorInfo(r)}),e.\u0275\u0275elementStart(1,"mat-icon",64),e.\u0275\u0275text(2,"settings"),e.\u0275\u0275elementEnd()()}}function Dl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Last Seen"),e.\u0275\u0275elementEnd())}function Ol(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275pipe(3,"date"),e.\u0275\u0275pipe(4,"date"),e.\u0275\u0275pipe(5,"date"),e.\u0275\u0275pipe(6,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.currentTimeStamp-t.last_seen_timestamp<864e5?e.\u0275\u0275pipeBind2(2,1,t.last_seen,"HH:mm:ss"):e.\u0275\u0275pipeBind2(3,4,t.last_seen,"y")!==e.\u0275\u0275pipeBind2(4,7,i.currentTimeStamp,"y")?e.\u0275\u0275pipeBind2(5,10,t.last_seen,"MMM d, y"):e.\u0275\u0275pipeBind2(6,13,t.last_seen,"MMM d")," ")}}function Ll(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Notes"),e.\u0275\u0275elementEnd())}function Fl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53)(1,"span",65),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.notes," ")}}function Rl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"CO"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Calibration Requested"),e.\u0275\u0275elementEnd())}function Nl(n,o){if(1&n&&e.\u0275\u0275element(0,"app-status-indicator",67),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("value",t.co2_calibration)}}function Vl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",53),e.\u0275\u0275template(1,Nl,1,1,"app-status-indicator",66),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","airgradient"===t.maker_id)}}function Hl(n,o){1&n&&e.\u0275\u0275element(0,"tr",68)}const jl=function(n){return{"opacity-50":n}};function Bl(n,o){if(1&n&&e.\u0275\u0275element(0,"tr",69),2&n){const t=o.$implicit;e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(1,jl,null==t.offline||1==t.offline))}}function Gl(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",26),e.\u0275\u0275elementContainerStart(1,27),e.\u0275\u0275template(2,pl,2,0,"th",28),e.\u0275\u0275template(3,ml,5,8,"td",29),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,30),e.\u0275\u0275template(5,dl,2,0,"th",28),e.\u0275\u0275template(6,fl,3,3,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,32),e.\u0275\u0275template(8,hl,2,0,"th",28),e.\u0275\u0275template(9,gl,3,5,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,33),e.\u0275\u0275template(11,vl,2,0,"th",28),e.\u0275\u0275template(12,Cl,2,1,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,34),e.\u0275\u0275template(14,bl,2,0,"th",28),e.\u0275\u0275template(15,xl,2,1,"td",35),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,36),e.\u0275\u0275template(17,yl,2,0,"th",28),e.\u0275\u0275template(18,Sl,3,3,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,37),e.\u0275\u0275template(20,wl,2,0,"th",28),e.\u0275\u0275template(21,El,3,3,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,38),e.\u0275\u0275template(23,Tl,2,0,"th",28),e.\u0275\u0275template(24,kl,4,2,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,40),e.\u0275\u0275template(26,Ml,2,0,"th",41),e.\u0275\u0275template(27,Al,3,0,"td",42),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,43),e.\u0275\u0275template(29,Dl,2,0,"th",28),e.\u0275\u0275template(30,Ol,7,16,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,44),e.\u0275\u0275template(32,Ll,2,0,"th",28),e.\u0275\u0275template(33,Fl,3,1,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(34,45),e.\u0275\u0275template(35,Rl,5,0,"th",28),e.\u0275\u0275template(36,Vl,2,1,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(37,Hl,1,0,"tr",46),e.\u0275\u0275template(38,Bl,1,3,"tr",47),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(37),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function zl(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",70),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let $l=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B,j,q,J,ge,fe){this.sensorServices=t,this.places=i,this.userService=a,this.dialog=r,this.helpService=l,this.dialogService=f,this.makersServices=w,this.locationsServices=T,this._messageService=M,this.httpHelper=B,this.localStore=j,this.activatedRoute=q,this.fwHandlerService=J,this.router=ge,this.browserLocaleService=fe,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.loading=null,this.displayedColumns=[],this.filterValue="",this.currentTimeStamp=0,this.onlyOnline=!1,this.HelpSection=Z.L,this.MonitorModels=Se.c,this.UsersPermissions=it.S,this.PlaceSettingTab=tl.j,this.destroy$=new H.xQ,this.displayedColumns=["serialno","fw_id","model","maker_id","current_boot_c
1ount","commissioning_date","location_name","last_seen","notes","co2_calibration","admin"],this.loadingPage=!1,this.currentTimeStamp=Date.now(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(Le=>{var qe;"sensors_loaded"===Le&&(this.dataSource=new h.by(null==t?void 0:t.filtered_sensors),this.dataSource.paginator=this.paginator,this.isTableEmpty=0===(null==t?void 0:t.filtered_sensors.length),this.dataSource.sort=this.sort,this.dataSource.filterPredicate=(Pe,lt)=>{const Ke=JSON.parse(lt),wt=null==Ke?void 0:Ke.onlyOnline,st=[],ti=(null==Ke?void 0:Ke.value).split(","),ni=[Pe.location_name,Pe.serialno,Pe.id,Pe.notes,Pe.model,Pe.maker_name,gt(Pe.commissioning_date).format("MMM D, YYYY").toString()],ii=!wt||!1===Pe.offline;return ti.forEach(ai=>{const fn=[];ni.forEach(qt=>{var Kt;return fn.push((null===(Kt=null==qt?void 0:qt.toString())||void 0===Kt?void 0:Kt.toLowerCase().includes(ai))&&ii)}),st.push(fn.some(Boolean))}),st.every(Boolean)},this.loadingPage=!1,this.applyFilter(),this.dataSource.sortingDataAccessor=(Pe,lt)=>"last_seen"===lt?Pe.last_seen_timestamp:Pe[lt],this.dataSource.paginator&&this.dataSource.paginator.firstPage()),("location_saved"===Le||"location_deleted"===Le)&&(this.dialog.closeAll(),this.sensorServices.getSensors(null===(qe=this.places.currentPlace)||void 0===qe?void 0:qe.id))})}ngOnInit(){var t;this.sensorServices.sensors=null,this.sensorServices.getSensors(null===(t=this.places.currentPlace)||void 0===t?void 0:t.id),this.makersServices.getMakers(),this.locationsServices.getLocations(this.places.currentPlace.id)}ngAfterViewInit(){this.activatedRoute.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(()=>{const t=this.activatedRoute.snapshot.queryParams.editSensorId;t&&(this.router.navigate([],{queryParams:null}),setTimeout(()=>{this.edit(t,!0)},200))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}edit(t,i=!1){this.loading=t,this.sendSensorRequest(t).subscribe(a=>{this.matDialogRef=this.dialog.open(In,{data:{data:a,modelSelectAutoOpen:i}}),this.loading=null,this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})},a=>{this.httpHelper.handleHttpErrorMessage(a),console.log("error in request")})}openLocationMonitorInfo(t){(null==t?void 0:t.location_id)?(this.loading=t.location_id,this.router.navigate(["/settings/locations",t.location_id]),this.loading=null):this.edit(null==t?void 0:t.id)}sendSensorRequest(t){var i,a;return this.httpHelper.get("/places/"+(null===(a=null===(i=this.places)||void 0===i?void 0:i.currentPlace)||void 0===a?void 0:a.id)+"/sensors/"+t)}retrieveTestReport(t,i){this.matDialogRef=this.dialog.open(vi.V,{data:i}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"90vw",desktopHeight:"90vh"})}showLocationInformation(t,i){this.loading=i,this.sendLocationRequest(t).subscribe(a=>{this.matDialogRef=this.dialog.open(el,{data:a,width:"90%",minWidth:"300px",maxWidth:"450px"}),this.loading=null},a=>{this.httpHelper.handleHttpErrorMessage(a),console.log("error in request")})}sendLocationRequest(t){var i,a;return this.httpHelper.get("/places/"+(null===(a=null===(i=this.places)||void 0===i?void 0:i.currentPlace)||void 0===a?void 0:a.id)+"/locations/"+t)}refresh(){var t;this.loadingPage=!0,this.sensorServices.getSensors(null===(t=this.places.currentPlace)||void 0===t?void 0:t.id)}new(){this.matDialogRef=this.dialog.open(In,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}savePagination(t){this.localStore.saveData("paginationSensors",t.pageSize)}getPagination(){return this.localStore.getData("paginationSensors")||"500"}applyFilter(t=this.filterValue){var i,a;this.filterValue=t.trim().toLowerCase(),this.dataSource&&(this.dataSource.filter=JSON.stringify({value:this.filterValue,onlyOnline:this.onlyOnline}),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage())}clearFilter(){this.filterValue="",this.applyFilter()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(En),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(xn.K),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(Pn.V))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-sensors"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:15,vars:9,consts:[["class","padding-left-md padding-right-md padding-top-md padding-bottom-md",4,"ngIf"],["color","primary","mode","indeterminate",4,"ngIf"],[3,"justifyContent"],["label","Search Monitors","placeholder","Enter Monitor",3,"keepSearchParameterInURL","applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","class","button-primary","type","button",3,"click",4,"ngIf"],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor",4,"ngIf"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width sticky-paginator",3,"pageSize","pageSizeOptions","page",4,"ngIf"],[1,"padding-left-md","padding-right-md","padding-top-md","padding-bottom-md"],["color","primary","mode","indeterminate"],["label","Search Monitors","placeholder","Enter Monitor",3,"keepSearchParameterInURL","applyFilter","clearFilter"],["mat-button","","type","button",1,"button-primary",3,"click"],[3,"textContent","permissionColoredContent","permissions"],["mat-menu-item","",3,"spinner","click",4,"ngIf"],["mat-menu-item","",3,"click"],["mat-menu-item",""],[3,"ngModel","change","ngModelChange"],[3,"textContent","permissions"],["mat-icon-button","",3,"matMenuTriggerFor"],["color","primary"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","serialno","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["style","padding-right: 10px;","mat-cell","",4,"matCellDef"],["matColumnDef","fw_id"],["mat-cell","",4,"matCellDef"],["matColumnDef","current_boot_c
1ount"],["matColumnDef","uid"],["matColumnDef","maker_id"],["style","padding: 0px 30px 0px 0px","mat-cell","",4,"matCellDef"],["matColumnDef","model"],["matColumnDef","commissioning_date"],["matColumnDef","location_name"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","admin"],["mat-header-cell","",4,"matHeaderCellDef"],["class","text-center","mat-cell","",3,"click",4,"matCellDef"],["matColumnDef","last_seen"],["matColumnDef","notes"],["matColumnDef","co2_calibration"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",3,"ngClass",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",2,"padding-right","10px"],[1,"flex-align-start"],[1,"zoom-td",3,"isLocationName","customWidth","value","cellClick"],["successMessage","Monitor serial number has been copied to clipboard","size","small",3,"copyValue"],["mat-cell",""],[4,"ngIf"],[3,"statusText","noMobileCollapsedVersion","statusTooltipText","statusChipType",4,"ngIf"],[3,"statusText","noMobileCollapsedVersion","statusTooltipText","statusChipType"],["mat-cell","",2,"padding","0px 30px 0px 0px"],["mat-cell","",1,"zoom-td"],[4,"ngIf","ngIfElse"],["locationNamePlain",""],[3,"isLocationName","customWidth","value","cellClick"],["mat-header-cell",""],["mat-cell","",1,"text-center",3,"click"],[2,"font-size","22px"],[1,"table-cell-notes-wrapper"],[3,"value",4,"ngIf"],[3,"value"],["mat-header-row",""],["mat-row","",3,"ngClass"],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275template(0,nl,2,0,"div",0),e.\u0275\u0275elementStart(1,"section"),e.\u0275\u0275template(2,il,1,0,"mat-progress-bar",1),e.\u0275\u0275elementStart(3,"app-sub-header",2),e.\u0275\u0275template(4,al,1,1,"app-table-filter-search",3),e.\u0275\u0275elementStart(5,"div",4),e.\u0275\u0275template(6,ol,2,5,"button",5),e.\u0275\u0275elementStart(7,"mat-menu",null,6),e.\u0275\u0275template(9,ll,8,2,"ng-template",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,sl,3,1,"button",8),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",9),e.\u0275\u0275template(12,cl,1,1,"app-no-data",10),e.\u0275\u0275template(13,Gl,39,4,"table",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(14,zl,1,2,"mat-paginator",12),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("ngIf",null==i.places.currentPlace?null:i.places.currentPlace.generic_os_sensors_ota_id),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.sensorServices.sensors),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",(null==i.places||null==i.places.currentPlace?null:i.places.currentPlace.advanced_config)||(null==i.userService||null==i.userService.currentUser?null:i.userService.currentUser.admin)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.places.currentPlace),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[u.NgIf,Tn.V,at.pW,ae.$,$e.n,z.lW,dt.S,W.VK,W.KA,W.OP,vt.d,Je.oG,_.JJ,_.On,W.p6,Q.Hw,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ct.T,Ie.Z,Bt.W,kn.w,h.as,h.XQ,h.nj,h.Gk,u.NgClass,ce.oO,Ce.NW],pipes:[u.SlicePipe,Ci.f,u.DecimalPipe,ln.n,u.DatePipe],styles:["@media (max-width: 991px){thead[_ngcontent-%COMP%]{z-index:15}}.right-panel[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:10px;justify-content:flex-end}@media (max-width: 650px){.table-upper-bar[_ngcontent-%COMP%]{flex-direction:column-reverse}.right-panel[_ngcontent-%COMP%]{justify-content:flex-start}.table-upper-bar[_ngcontent-%COMP%]{padding:15px 20px 7px;flex-direction:column-reverse;justify-content:center;align-items:flex-start}}.mat-column-serialno[_ngcontent-%COMP%]{max-width:150px!important;padding-right:10px}[_nghost-%COMP%] .mat-menu-item .mat-icon{margin-right:0}"]}),n})();class xi{constructor(){this.uid=null,this.id=null,this.displayId=null,this.notes=null,this.url=null,this.configuration={background_color:null,display_hash:null,font_family:null,params:[],text_color:null,publicContributorName:null},this.displayLocations=null}}function Ul(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",11),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function Wl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Maker is required"),e.\u0275\u0275elementEnd())}function Ql(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"mat-form-field")(2,"mat-label"),e.\u0275\u0275text(3,"Display Id"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"input",5,6),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.uid=a}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"mat-form-field")(7,"mat-label"),e.\u0275\u0275text(8,"Indoor Location"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"mat-select",7,8),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.indoor_id=a}),e.\u0275\u0275template(11,Ul,2,2,"mat-option",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,Wl,2,0,"mat-error",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275reference(10),i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",i.display.uid),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",i.display.indoor_id),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",i.locationsServices.indoorLocations),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.invalid&&(t.dirty||t.touched))}}function ql(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" You can not add New Mini Display as there is no Indoor Locations on ",t.places.currentPlace.name," place. ")}}let yi=(()=>{class n{constructor(t,i,a,r,l,f){this.locationsServices=t,this.data=i,this.dialogRef=a,this.displayServices=r,this.places=l,this.dialog=f,null==i?(this.display=new xi,this.addModus=!0):(this.display=i,this.addModus=!1)}getLocationName(t){let i;if(null==t)i="select location";else try{i=this.locationsServices.activeLocations.find(a=>a.id==t).name}catch(a){}return i}onSubmit(){var t;this.display.uid=null===(t=this.display.uid)||void 0===t?void 0:t.trim().toLowerCase(),this.locationsServices.indoorLocations.length?this.addModus?this.displayServices.addDisplay(this.places.currentPlace,this.display):this.displayServices.saveDisplay(this.places.currentPlace,this.display):this.dialog.closeAll()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-display"]],inputs:{addModus:"addModus",display:"display"},decls:6,vars:5,consts:[[3,"title","submitText","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],[4,"ngIf","ngIfElse"],["noIndoorLocationsWarning",""],["matInput","","type","text","required","","placeholder","Enter the display Id","name","serialno",3,"ngModel","ngModelChange"],["uidx",""],["placeholder","'Select location'","required","","name","indoor_id",3,"ngModel","ngModelChange"],["maker_id","ngModel"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"value"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275template(3,Ql,13,4,"ng-container",3),e.\u0275\u0275template(4,ql,2,1,"ng-template",null,4,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()()),2&t){const a=e.\u0275\u0275reference(2),r=e.\u0275\u0275reference(5);e.\u0275\u0275property("title",i.addModus?"Add Display":"Edit Display")("submitText",i.locationsServices.indoorLocations.length?"Save":"Ok")("submitDisabled",!a.valid),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.locationsServices.indoorLocations.length)("ngIfElse",r)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,u.NgIf,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.JJ,_.On,_e.gD,u.NgForOf,de.ey,D.TO],encapsulation:2}),n})();function Kl(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",9)}function Yl(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",10),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}2&n&&e.\u0275\u0275property("keepSearchParameterInURL",!0)}function Xl(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",11),2&n&&e.\u0275\u0275property("message","mini displays")}function Zl(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function Jl(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).edit(a)}),e.\u0275\u0275text(1,"Edit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).delete(a)}),e.\u0275\u0275text(3,"Delete"),e.\u0275\u0275elementEnd()}}function es(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"mat-menu",null,23),e.\u0275\u0275template(3,Jl,4,0,"ng-template",24),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",25)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function ts(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",27),e.\u0275\u0275text(1,"Id"),e.\u0275\u0275elementEnd())}function ns(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.uid," ")}}function is(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",27),e.\u0275\u0275text(1,"Linked location"),e.\u0275\u0275elementEnd())}function as(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",i.getLocationName(t.indoor_id)," ")}}function os(n,o){1&n&&e.\u0275\u0275element(0,"tr",28)}function rs(n,o){1&n&&e.\u0275\u0275element(0,"tr",29)}function ls(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",12),e.\u0275\u0275elementContainerStart(1,13),e.\u0275\u0275template(2,Zl,2,0,"th",14),e.\u0275\u0275template(3,es,7,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,16),e.\u0275\u0275template(5,ts,2,0,"th",17),e.\u0275\u0275template(6,ns,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,18),e.\u0275\u0275template(8,is,2,0,"th",17),e.\u0275\u0275template(9,as,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(10,os,1,0,"tr",19),e.\u0275\u0275template(11,rs,1,0,"tr",20),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(10),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function ss(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",30),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let cs=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.displayServices=t,this.places=i,this.dialog=a,this.dialogService=r,this.locationsServices=l,this._messageService=f,this.localStore=w,this.helpService=T,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.displayedColumns=["uid","indoor_id","edit"],this.filterValue="",this.loading=!1,this.HelpSection=Z.L,this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(M=>{"displays_loaded"===M&&(this.loading=!1,this.dataSource=new h.by(null==t?void 0:t.filtered_displays),this.dataSource.paginator=this.paginator,this.isTableEmpty=0===this.dataSource.data.length,this.dataSource.sort=this.sort,this.applyFilter()),"display_added"===M&&(this.dialog.closeAll(),this.clearFilter()),"display_saved"===M&&(this.dialog.closeAll(),this.clearFilter())})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getLocationName(t){var i;let a;if(null==t)a="select location";else try{a=null===(i=this.locationsServices.activeLocations.find(r=>r.id==t))||void 0===i?void 0:i.name}catch(r){console.log("ERROR occurred when getting location name:",r)}return a}savePagination(t){this.localStore.saveData("paginationDisplaysESP",t.pageSize)}getPagination(){return this.localStore.getData("paginationDisplaysESP")||"500"}ngOnInit(){this.loading=!0,this.displayServices.getDisplays(this.places.currentPlace.id),this.locationsServices.getLocations(this.places.currentPlace.id)}edit(t){this.matDialogRef=this.dialog.open(yi,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"500px",desktopHeight:"auto"})}new(){this.matDialogRef=this.dialog.open(yi,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"500px",desktopHeight:"auto"})}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete display "+t.uid+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.displayServices.deleteDisplay(this.places.currentPlace,t)})}applyFilter(t=this.filterValue){var i,a;this.filterValue=t.trim().toLowerCase(),this.dataSource&&(this.dataSource.filter=this.filterValue,null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage())}clearFilter(){this.dataSource&&(this.dataSource.filter="",this.applyFilter())}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-displays"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:11,vars:6,consts:[["color","primary","mode","indeterminate",4,"ngIf"],[3,"justifyContent"],["label","Search Displays","placeholder","Type in the display id",3,"keepSearchParameterInURL","applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width sticky-paginator",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["color","primary","mode","indeterminate"],["label","Search Displays","placeholder","Type in the display id",3,"keepSearchParameterInURL","applyFilter","clearFilter"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","uid","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","indoor_id"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-header-row",""],["mat-row",""],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section"),e.\u0275\u0275template(1,Kl,1,0,"mat-progress-bar",0),e.\u0275\u0275elementStart(2,"app-sub-header",1),e.\u0275\u0275template(3,Yl,1,1,"app-table-filter-search",2),e.\u0275\u0275elementStart(4,"div",3)(5,"button",4),e.\u0275\u0275listener("click",function(){return i.new()}),e.\u0275\u0275text(6," Add New "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,Xl,1,1,"app-no-data",6),e.\u0275\u0275template(9,ls,12,3,"table",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,ss,1,2,"mat-paginator",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.loading),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[u.NgIf,at.pW,ae.$,$e.n,z.lW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,Q.Hw,U.nU,h.as,h.XQ,h.nj,h.Gk,Ce.NW],encapsulation:2,changeDetection:0}),n})();var ps=d(3568);function ms(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),e.\u0275\u0275text(2,"Display Notes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"input",5,6),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.notes=a}),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",t.display.notes)}}function ds(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",9),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).addLocation(null,r.id,"locationGroup",r.name)}
1),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Group: ",t.name," ")}}function us(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",9),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).addLocation(r.id,null,"location")}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function _s(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-chip",16),e.\u0275\u0275listener("removed",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).deleteLocation(r)}),e.\u0275\u0275text(1),e.\u0275\u0275elementStart(2,"mat-icon",17),e.\u0275\u0275text(3,"cancel"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("removable",!0),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.nameToDisplay," ")}}function fs(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"div")(2,"mat-form-field",7)(3,"mat-select",8)(4,"mat-select-trigger"),e.\u0275\u0275text(5,"Add location"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-option",9),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().addLocation(null,null,"outdoorAverage")}),e.\u0275\u0275text(7," Outdoor Average "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-option",9),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().addLocation(null,null,"indoorAverage")}),e.\u0275\u0275text(9," Indoor Average "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"mat-divider"),e.\u0275\u0275template(11,ds,2,2,"mat-option",10),e.\u0275\u0275element(12,"mat-divider"),e.\u0275\u0275elementStart(13,"div",11)(14,"div",12)(15,"mat-icon"),e.\u0275\u0275text(16," search "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"input",13,14),e.\u0275\u0275listener("keyup",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275element(19,"mat-divider"),e.\u0275\u0275template(20,us,2,2,"mat-option",10),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(21,"mat-chip-list"),e.\u0275\u0275template(22,_s,4,2,"mat-chip",15),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("placeholder","Add Location"),e.\u0275\u0275advance(3),e.\u0275\u0275property("value","outdoorAverage"),e.\u0275\u0275advance(2),e.\u0275\u0275property("value","indoorAverage"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",null==t.groupsServices?null:t.groupsServices.groups),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngForOf",t.locationsServices.filteredLocations),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.display.displayLocations)}}function hs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",18),e.\u0275\u0275text(1,"You can add locations only to existing displays. Create a display first, then click on 'Add / Edit Display Locations' on the newly created display and add the locations to be displayed. "),e.\u0275\u0275elementEnd())}let Mn=(()=>{class n{constructor(t,i,a,r,l,f,w){var T;this.locationsServices=t,this.groupsServices=i,this.dialogRef=a,this.data=r,this.displayServices=l,this.places=f,this.messageService=w,this.filterValue="",this.destroy$=new H.xQ,null==r?(this.display=new xi,this.addModus=!0,this.addLocations=!1,this.formTitle="Add Admin Display"):(this.display=r,this.addModus=!1,this.addLocations=!1,r.addLocations?(this.formTitle="Add / Edit Display Locations",this.addModus=!1,this.addLocations=!0,this.displayServices.getDisplaysLocations(this.places.currentPlace,this.display.id)):(this.addModus=!1,this.addLocations=!1,this.formTitle="Edit Admin Display")),this.display.displayLocations=(null!==(T=this.display.displayLocations)&&void 0!==T?T:[]).map(M=>this.mapDisplayLocationLabel(M))}ngOnInit(){var t,i;this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(a=>{var r;"admin_displays_locations_loaded"===a&&(this.display.displayLocations=(null!==(r=this.displayServices.listOfDisplayLocations)&&void 0!==r?r:[]).map(l
1=>this.mapDisplayLocationLabel(l)))}),this.addLocations&&(this.groupsServices.getGroups(this.places.currentPlace.id),(null===(t=this.locationsServices.allLocations)||void 0===t?void 0:t.length)?this.locationsServices.filteredLocations=null!==(i=this.locationsServices.activeLocations)&&void 0!==i?i:this.locationsServices.allLocations:this.locationsServices.getLocations(this.places.currentPlace.id))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}addLocation(t,i,a,r){var l;if(this.display.displayLocations.some(T=>T.locationId===t&&T.locationGroupId===i&&T.locationType===a))return;const w={id:null,nameToDisplay:null,displayId:null,locationType:a,locationName:null,locationId:t,locationGroupId:i,locationGroupName:null};"locationGroup"===a?w.locationGroupName=r:"location"===a&&(w.locationName=null===(l=this.locationsServices.filteredLocations.find(T=>T.id===t))||void 0===l?void 0:l.name),this.displayServices.addDisplayLocation(this.places.currentPlace,this.display.id,w,!0)}deleteLocation(t){this.displayServices.deleteDisplayLocation(this.places.currentPlace,this.display.id,t)}onSubmit(){this.addLocations||(this.addModus?this.displayServices.addDisplay(this.places.currentPlace,this.display,!0):this.displayServices.saveDisplay(this.places.currentPlace,this.display,!0))}applyFilter(t){this.filterValue=t.target.value,this.locationsServices.filteredLocations=this.locationsServices.allLocations.filter(i=>i.name.toLowerCase().includes(this.filterValue.trim().toLowerCase()))}mapDisplayLocationLabel(t){switch(t.locationType){case"indoorAverage":t.nameToDisplay="Indoor Average";break;case"outdoorAverage":t.nameToDisplay="Outdoor Average";break;case"locationGroup":t.nameToDisplay=`Group: ${t.locationGroupName}`;break;default:t.nameToDisplay=t.locationName}return t}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-admin-display"]],inputs:{addModus:"addModus",display:"display"},decls:6,vars:6,consts:[[3,"title","hideFooter","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],[4,"ngIf"],["class","label",4,"ngIf"],["matInput","","type","text","placeholder","Enter the display notes","name","notes",3,"ngModel","ngModelChange"],["uidx",""],["floatLabel","never",1,"form-field-responsive-m","spacer-right-sm"],[3,"placeholder"],[3,"value","click"],[3,"value","click",4,"ngFor","ngForOf"],[1,"dropdown-filter-search-outer"],[1,"dropdown-filter-search-wrapper"],["matInput","","placeholder","Search location",3,"keyup"],["formInput",""],[3,"removable","removed",4,"ngFor","ngForOf"],[3,"removable","removed"],["matChipRemove",""],[1,"label"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275template(3,ms,5,1,"mat-form-field",3),e.\u0275\u0275template(4,fs,23,6,"div",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,hs,2,0,"div",4),e.\u0275\u0275elementEnd()),2&t){const a=e.\u0275\u0275reference(2);e.\u0275\u0275property("title",i.formTitle)("hideFooter",i.addLocations)("submitDisabled",!i.addLocations&&!a.valid),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!i.addLocations),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.addLocations),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.addModus)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,u.NgIf,D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.On,_e.gD,_e.$L,de.ey,vt.d,u.NgForOf,Q.Hw,Be.qn,Be.HS,Be.qH],styles:["mat-icon[_ngcontent-%COMP%]{margin-left:10px;cursor:pointer}"]}),n})();var bt=d(92340),Ue=d(87238);function gs(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",9)}function vs(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",10),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}}function Cs(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",11),2&n&&e.\u0275\u0275property("message","old public displays or website widgets")}function bs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",22),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function xs(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).edit(a)}),e.\u0275\u0275text(1,"Edit Display Name"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).editLocations(a)}),e.\u0275\u0275text(3,"Add / Edit Display Locations"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).printQR(a)}),e.\u0275\u0275text(5,"Print QR Code"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",29),e.\u0275\u0275text(7,"Preview"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"mat-divider"),e.\u0275\u0275elementStart(9,"button",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).delete(a)}),e.\u0275\u0275text(10,"Delete"),e.\u0275\u0275elementEnd()}if(2&n){e.\u0275\u0275nextContext();const t=e.\u0275\u0275reference(8);e.\u0275\u0275advance(6),e.\u0275\u0275property("matMenuTriggerFor",t)}}function ys(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",23)(1,"mat-menu",null,24),e.\u0275\u0275template(3,xs,11,1,"ng-template",25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",26)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"mat-menu",null,27)(9,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("bigdisplay",r)}),e.\u0275\u0275text(10,"Two Locations (in&out) US AQI"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("bigdisplaypm",r)}),e.\u0275\u0275text(12,"Two Locations (in&out) \u03bcg/m\xb3"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("classicdisplay",r)}),e.\u0275\u0275text(14,"Classic Display (only outside)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("classicdisplayindooor",r)}),e.\u0275\u0275text(16,"Classic Display (with inside)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("alldata",r)}
1),e.\u0275\u0275text(18,"PM, CO"),e.\u0275\u0275elementStart(19,"sub"),e.\u0275\u0275text(20,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(21,", Temp., Hum. (several locations)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(22,"mat-divider"),e.\u0275\u0275elementStart(23,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("videodisplay",r)}),e.\u0275\u0275text(24,"Multiple Locations with Video"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("indoorwidget",r)}),e.\u0275\u0275text(26,"Indoor Widget iFrame for Website"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openPreview("mobiledisplayea",r)}),e.\u0275\u0275text(28,"Mobile Display"),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function Ss(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Id"),e.\u0275\u0275elementEnd())}function ws(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",23),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id," ")}}function Es(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Notes"),e.\u0275\u0275elementEnd())}function Ts(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",23)(1,"span",31),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.notes," ")}}function Is(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Display Token"),e.\u0275\u0275elementEnd())}function Ps(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",23),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",t.url.substr(13,10)," ")}}function ks(n,o){1&n&&e.\u0275\u0275element(0,"tr",32)}function Ms(n,o){1&n&&e.\u0275\u0275element(0,"tr",33)}function As(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",12),e.\u0275\u0275elementContainerStart(1,13),e.\u0275\u0275template(2,bs,2,0,"th",14),e.\u0275\u0275template(3,ys,29,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,16),e.\u0275\u0275template(5,Ss,2,0,"th",17),e.\u0275\u0275template(6,ws,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,18),e.\u0275\u0275template(8,Es,2,0,"th",17),e.\u0275\u0275template(9,Ts,3,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,19),e.\u0275\u0275template(11,Is,2,0,"th",17),e.\u0275\u0275template(12,Ps,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(13,ks,1,0,"tr",20),e.\u0275\u0275template(14,Ms,1,0,"tr",21),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(13),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Ds(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",34),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let Os=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B){this.displayServices=t,this.places=i,this.dataServices=a,this.router=r,this.dialog=l,this.dialogService=f,this.locationsServices=w,this._messageService=T,this.helpService=M,this.localStore=B,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.displayedColumns=["id","notes","url","edit"],this.filterValue="",this.loading=!1,this.HelpSection=Z.L,this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(j=>{"admin_displays_loaded"===j&&(this.loading=!1,this.dataSource=new h.by(null==t?void 0:t.filtered_displays.filter(q=>!q.configuration)),this.isTableEmpty=0===this.dataSource.data.length,this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort),"admin_display_added"===j&&(this.dialog.closeAll(),this.clearFilter()),"admin_display_saved"==j&&(this.dialog.closeAll(),this.clearFilter())})}ngOnInit(){this.loading=!0,this.displayServices.getDisplays(this.places.currentPlace.id,!0),this.locationsServices.getLocations(this.places.currentPlace.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getLocationName(t){let i;if(null==t)i="select location";else try{i=this.locationsServices.activeLocations.find(a=>a.id==t).name}catch(a){console.log("ERROR occurred when getting location name:",a)}return i}edit(t){t.addLocations=!1,this.matDialogRef=this.dialog.open(Mn,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"500px",desktopHeight:"auto"})}printQR(t){this.router.navigate(["settings/location-qr"])}openPreview(t,i){window.open(bt.N.displayRoot+"/"+t+"/"+i.url.substr(13,10),"targetWindow","toolbar=no,\n location=no,\n status=no,\n menubar=no,\n scrollbars=yes,\
1n resizable=yes,\n width=1600,\n height=1100")}savePagination(t){this.localStore.saveData("paginationDisplays",t.pageSize)}getPagination(){return this.localStore.getData("paginationDisplays")||"500"}editLocations(t){t.addLocations=!0,this.matDialogRef=this.dialog.open(Mn,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"500px",desktopHeight:"auto"})}new(){this.matDialogRef=this.dialog.open(Mn,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"500px",desktopHeight:"auto"})}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete "+t.id+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.displayServices.deleteDisplay(this.places.currentPlace,t,!0)})}applyFilter(t){var i,a;this.dataSource.filter=t.trim().toLowerCase(),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage()}clearFilter(){this.dataSource&&(this.dataSource.filter="")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(Fe.n))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-admin-displays"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:11,vars:8,consts:[["color","primary","mode","indeterminate",4,"ngIf"],[3,"justifyContent"],["label","Search Admin Displays","placeholder","Type in the display id",3,"applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"disabled","matTooltip","click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width sticky-paginator",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["color","primary","mode","indeterminate"],["label","Search Admin Displays","placeholder","Type in the display id",3,"applyFilter","clearFilter"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","notes"],["matColumnDef","url"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["menuPreview","matMenu"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-header-cell","","mat-sort-header",""],[1,"table-cell-notes-wrapper"],["mat-header-row",""],["mat-row",""],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section"),e.\u0275\u0275template(1,gs,1,0,"mat-progress-bar",0),e.\u0275\u0275elementStart(2,"app-sub-header",1),e.\u0275\u0275template(3,vs,1,0,"app-table-filter-search",2),e.\u0275\u0275elementStart(4,"div",3)(5,"button",4),e.\u0275\u0275listener("click",function(){return i.new()}),e.\u0275\u0275text(6," Add New "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,Cs,1,1,"app-no-data",6),e.\u0275\u0275template(9,As,15,3,"table",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,Ds,1,2,"mat-paginator",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.loading),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",!0)("matTooltip","Please consider creating a new display using the new flow."),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[u.NgIf,at.pW,ae.$,$e.n,z.lW,Ue.gM,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,vt.d,Q.Hw,U.nU,h.as,h.XQ,h.nj,h.Gk,Ce.NW],encapsulation:2,changeDetection:0}),n})(),An=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i}getPPs(t){this.httpHelper.get("/places/"+t+"/pps").subscribe(i=>{this.pps=i.sort((a,r)=>a.uid.localeCompare(r.uid)),this.filtered_pps=i.sort((a,r)=>a.uid.localeCompare(r.uid))},i=>{console.log(i),this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("pps_loaded")}),this.pps=[]}deletePps(t,i){i.editable=!1,this.httpHelper.delete("/places/"+t.id+"/pps/"+i.id).subscribe(a=>{},a=>
1{this.httpHelper.handleHttpErrorMessage(a)},()=>{this.pps.indexOf(i),this.getPPs(t.id),this.httpHelper.showSnackbar("Successfully deleted")})}savePps(t,i){null==i.notes&&delete i.notes,this.httpHelper.put("/places/"+t.id+"/pps/"+i.id,i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a),console.log(a),i.editable=!1},()=>{this.httpHelper.showSnackbar("Successfully saved"),this._messageService.sendMessage("pps_saved"),i.editable=!1,this.getPPs(t.id)})}addPps(t,i){this.httpHelper.post("/places/"+t.id+"/pps",i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a,{409:"PPS with this ID already exists"}),console.log(a)},()=>{this.getPPs(t.id),this._messageService.sendMessage("pps_added"),this.httpHelper.showSnackbar("Successfully added")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();class Ls{constructor(){this.uid="",this.notes=""}}let Mt=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i}getProfileName(t){let i;if(null==t)i="select profile";else try{i=this.ppsProfiles.find(a=>a.id==t).title}catch(a){}return i}getPPsProfiles(t){this.httpHelper.get("/places/"+t+"/pps-profiles").subscribe(i=>{this.ppsProfiles=i.sort((a,r)=>a.title.localeCompare(r.title))},i=>{console.log(i),this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("pps_profiles_loaded")})}saveProfile(t,i){this.httpHelper.put("/places/"+t.id+"/pps-profiles/"+i.id,i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a),console.log(a)},()=>{this.httpHelper.showSnackbar("Successfully saved"),this._messageService.sendMessage("profiles_saved"),this.getPPsProfiles(t.id)})}addProfile(t,i){this.httpHelper.post("/places/"+t.id+"/pps-profiles",i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a),console.log(a)},()=>{this.getPPsProfiles(t.id),this._messageService.sendMessage("profiles_saved"),this.httpHelper.showSnackbar("Successfully added")})}deleteProfile(t,i){this.httpHelper.delete("/places/"+t.id+"/pps-profiles/"+i.id).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a,{409:"PPS profile in use. Please first unlink profile."})},()=>{this.ppsProfiles.indexOf(i),this.getPPsProfiles(t.id),this.httpHelper.showSnackbar("Successfully deleted")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();function Fs(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",13),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.name)}}function Rs(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",13),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.title)}}let Si=(()=>{class n{constructor(t,i,a,r,l,f){this.locationsServices=t,this.data=i,this.dialogRef=a,this.ppsServices=r,this.ppsProfileServices=l,this.places=f,null==i?(this.pps=new Ls,this.addModus=!0):(this.pps=i,this.addModus=!1)}onSubmit(){this.addModus?this.ppsServices.addPps(this.places.currentPlace,this.pps):this.ppsServices.savePps(this.places.currentPlace,this.pps)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(An),e.\u0275\u0275directiveInject(Mt),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-pps"]],inputs:{addModus:"addModus",pps:"pps"},decls:24,vars:12,consts:[[3,"title","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],["fxLayout","row","fxLayoutGap","10px","fxLayoutAlign","start center"],["matInput","","type","text","required","","minlength","5","placeholder","Enter the pps id","name","serialno",3,"disabled","ngModel","ngModelChange"],["uidx",""],["name","active",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutGap","10px","fxLayoutAlign","start space-evenly"],[1,"label"],["name","indoor_id","required","",3,"placeholder","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["name","profile","required","",3,"placeholder","ngModel","ngModelChange"],["matInput","","type","text","placeholder","Enter any notes","name","notes",3,"ngModel","ngModelChange"],[3,"value"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(3,"div",3)(4,"mat-form-field")(5,"mat-label"),e.\u0275\u0275text(6,"PPS Id"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"input",4,5),e.\u0275\u0275listener("ngModelChange",function(r){return i.pps.uid=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"mat-checkbox",6),e.\u0275\u0275listener("ngModelChange",function(r){return i.pps.active=r}),e.\u0275\u0275text(10,"Active"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",7)(12,"div",8),e.\u0275\u0275text(13,"Indoor Location:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-select",9),e.\u0275\u0275listener("ngModelChange",function(r){return i.pps.indoor_id=r}),e.\u0275\u0275template(15,Fs,2,2,"mat-option",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",8),e.\u0275\u0275text(17,"Profile:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-select",11),e.\u0275\u0275listener("ngModelChange",function(r){return i.pps.pps_profile_id=r}),e.\u0275\u0275template(19,Rs,2,2,"mat-option",10),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(20,"mat-form-field")(21,"mat-label"),e.\u0275\u0275text(22,"Notes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"input",12),e.\u0275\u0275listener("ngModelChange",function(r){return i.pps.notes=r}),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(2);e.\u0275\u0275property("title",i.addModus?"Add PPS":"Edit PPS")("submitDisabled",!a.valid),e.\u0275\u0275advance(7),e.\u0275\u0275property("disabled",!i.addModus)("ngModel",i.pps.uid),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.pps.active),e.\u0275\u0275advance(5),e.\u0275\u0275propertyInterpolate("placeholder",null!=i.pps.indoor_id?i.pps.indoor_id:"Select location"),e.\u0275\u0275property("ngModel",i.pps.indoor_id),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.locationsServices.indoorLocations),e.\u0275\u0275advance(3),e.\u0275\u0275propertyInterpolate("placeholder",null!=i.pps.pps_profile_id?i.pps.pps_profile_id:"Select profile"),e.\u0275\u0275property("ngModel",i.pps.pps_profile_id),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.ppsProfileServices.ppsProfiles),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",i.pps.notes)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,V.SQ,V.Wh,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.wO,_.JJ,_.On,Je.oG,_e.gD,u.NgForOf,de.ey],styles:["mat-card[_ngcontent-%COMP%]{color:#708090}"]}),n})();function Ns(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",9),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}}function Vs(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",10),2&n&&e.\u0275\u0275property("message","pps")}function Hs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",26),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function js(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",27)(1,"button",28),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).delete(r)}),e.\u0275\u0275text(2,"Delete"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).edit(r)}),e.\u0275\u0275text(4,"Edit"),e.\u0275\u0275elementEnd()()}}function Bs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Id"),e.\u0275\u0275elementEnd())}function Gs(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.uid," ")}}function zs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Linked location"),e.\u0275\u0275elementEnd())}function $s(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",t.indoor_name," ")}}function Us(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Active"),e.\u0275\u0275elementEnd())}function Ws(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.active?"Yes":"No"," ")}}function Qs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Profile"),e.\u0275\u0275elementEnd())}function qs(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.pps_profile_title," ")}}function Ks(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Current Firmware"),e.\u0275\u0275elementEnd())}function Ys(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null!=t&&t.current_firmware?t.current_firmware:""," ")}}function Xs(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Target Firmware"),e.\u0275\u0275elementEnd())}function Zs(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null!=t&&t.target_firmware?t.target_firmware:""," ")}}function Js(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",30),e.\u0275\u0275text(1,"Notes"),e.\u0275\u0275elementEnd())}function ec(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",31),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.notes," ")}}function tc(n,o){1&n&&e.\u0275\u0275element(0,"tr",32)}function nc(n,o){1&n&&e.\u0275\u0275element(0,"tr",33)}function ic(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",11),e.\u0275\u0275elementContainerStart(1,12),e.\u0275\u0275template(2,Hs,2,0,"th",13),e.\u0275\u0275template(3,js,5,0,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,15),e.\u0275\u0275template(5,Bs,2,0,"th",16),e.\u0275\u0275template(6,Gs,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,18),e.\u0275\u0275template(8,zs,2,0,"th",16),e.\u0275\u0275template(9,$s,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,19),e.\u0275\u0275template(11,Us,2,0,"th",16),e.\u0275\u0275template(12,Ws,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,20),e.\u0275\u0275template(14,Qs,2,0,"th",16),e.\u0275\u0275template(15,qs,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,21),e.\u0275\u0275template(17,Ks,2,0,"th",16),e.\u0275\u0275template(18,Ys,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,22),e.\u0275\u0275template(20,Xs,2,0,"th",16),e.\u0275\u0275template(21,Zs,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,23),e.\u0275\u0275template(23,Js,2,0,"th",16),e.\u0275\u0275template(24,ec,2,1,"td",17),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(25,tc,1,0,"tr",24),e.\u0275\u0275template(26,nc,1,0,"tr",25),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(25),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function ac(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",34),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let oc=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M){this.ppsServices=t,this.ppsProfiles=i,this.dialogService=a,this.places=r,this.dialog=l,this.locationsServices=f,this._messageService=w,this.helpService=T,this.localStore=M,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.displayedColumns=["uid","indoor_name","active","pps_profile_title","current_firmware","target_firmware","notes","edit"],this.filterValue="",this.HelpSection=Z.L,this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(B=>{"pps_loaded"===B&&(this.dataSource=new h.by(null==t?void 0:t.filtered_pps),this.dataSource.paginator=this.paginator,this.isTableEmpty=0===this.dataSource.data.length,this.dataSource.sort=this.sort,this.dialog.closeAll(),this.clearFilter()),"pps_saved"===B&&(this.dialog.closeAll(),this.clearFilter()),"place_changed"===B&&this.initialLoad()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialLoad(){this.ppsServices.pps=null,this.ppsServices.getPPs(this.places.currentPlace.id),this.ppsProfiles.getPPsProfiles(this.places.currentPlace.id),this.locationsServices.getLocations(this.places.currentPlace.id)}ngOnInit(){this.initialLoad()}edit(t){this.matDialogRef=this.dialog.open(Si,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}savePagination(t){this.localStore.saveData("paginationAddPPS",t.pageSize)}getPagination(){return this.localStore.getData("paginationAddPPS")||"500"}new(){this.matDialogRef=this.dialog.open(Si,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete "+t.uid+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.ppsServices.deletePps(this.places.currentPlace,t)})}applyFilter(t){var i,a;this.dataSource.filter=t.trim().toLowerCase(),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage()}clearFilter(){this.dataSource&&(this.dataSource.filter="")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(An),e.\u0275\u0275directiveInject(Mt),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(Fe.n))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-add-pps"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:10,vars:6,consts:[[1,"inPage"],[3,"mode"],[3,"justifyContent"],["label","Search PPS","placeholder","Type in the pps id",3,"applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-prima
1ry",3,"click"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["label","Search PPS","placeholder","Type in the pps id",3,"applyFilter","clearFilter"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","style","min-width: 160px",4,"matCellDef"],["matColumnDef","uid"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","indoor_name"],["matColumnDef","active"],["matColumnDef","pps_profile_title"],["matColumnDef","current_firmware"],["matColumnDef","target_firmware"],["matColumnDef","notes"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","",2,"min-width","160px"],["mat-button","",1,"button-danger","spacer-right-sm",3,"click"],["mat-button","",1,"button-secondary",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-row",""],["mat-row",""],[1,"full-width",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0),e.\u0275\u0275element(1,"mat-progress-bar",1),e.\u0275\u0275elementStart(2,"app-sub-header",2),e.\u0275\u0275template(3,Ns,1,0,"app-table-filter-search",3),e.\u0275\u0275elementStart(4,"div",4)(5,"button",5),e.\u0275\u0275listener("click",function(){return i.new()}),e.\u0275\u0275text(6,"Add New"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(7,Vs,1,1,"app-no-data",6),e.\u0275\u0275template(8,ic,27,3,"table",7),e.\u0275\u0275template(9,ac,1,2,"mat-paginator",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("mode",null==(null==i.ppsServices?null:i.ppsServices.filtered_pps)?"indeterminate":""),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[at.pW,ae.$,u.NgIf,$e.n,z.lW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,U.nU,h.as,h.XQ,h.nj,h.Gk,Ce.NW],encapsulation:2}),n})();class rc{}function lc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",27),e.\u0275\u0275text(1,"Selection is required"),e.\u0275\u0275elementEnd())}function sc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",27),e.\u0275\u0275text(1,"Selection is required"),e.\u0275\u0275elementEnd())}let wi=(()=>{class n{constructor(t,i,a,r){this.data=t,this.dialogRef=i,this.ppsProfileServices=a,this.places=r,null==t?(this.profile=new rc,this.addModus=!0,this.profile.pm2Target=5,this.profile.co2Target=1100,this.profile.fanMode="pmCo2Controlled"):(this.profile=t,this.addModus=!1)}onSubmit(){this.addModus?this.ppsProfileServices.addProfile(this.places.currentPlace,this.profile):this.ppsProfileServices.saveProfile(this.places.currentPlace,this.profile)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(Mt),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-pps-profile"]],inputs:{addModus:"addModus",profile:"profile"},decls:91,vars:18,consts:[[3,"title","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],[2,"margin-bottom","20px"],["matInput","","type","text","required","","minlength","2","placeholder","Enter the title of the profile","name","title",3,"ngModel","ngModelChange"],["uidx",""],["matInput","","type","text","required","","minlength","2","placeholder","Enter the description of the profile","name","description",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutGap","10px","fxLayoutAlign","start space-evenly",2,"margin-bottom","20px"],["fxFlex","1 1 200px","fxLayout","column"],[1,"label"],["name","damperMode","placeholder","Mode of damper control","required","",3,"ngModel","ngModelChange"],["o
1perator","ngModel"],["value","manual"],["value","auto"],["style","font-size: 10.5px;",4,"ngIf"],["matInput","","type","number","pattern","^$|^([0-9]|[1-9][0-9]|[1][0][0])?","placeholder","Enter the damperFreshAirManualPercent of the profile","name","damperFreshAirManualPercent",3,"required","ngModel","ngModelChange"],["matInput","","type","number","pattern","^$|^([0-9]|[1-9][0-9]|[1][0][0])?","placeholder","Enter the damperCirculatingAirManualPercent of the profile","name","damperCirculatingAirManualPercent",3,"required","ngModel","ngModelChange"],["fxLayout","row","fxLayoutGap","10px","fxLayoutAlign","start space-evenly",2,"margin-bottom","10px"],["name","fanMode","placeholder","Mode of fan control","required","",3,"ngModel","ngModelChange"],["operator2","ngModel"],["value","fixedSpeed"],["value","pmCo2Controlled"],["matInput","","type","number","pattern","^$|^([0-9]|[1-9][0-9]|[1][0][0])?","placeholder","Enter the fanSpeedFixedPercent of the profile","name","fanSpeedFixedPercent",3,"required","ngModel","ngModelChange"],["matInput","","type","number","pattern","^$|^([0-9]|[1-9][0-9]|[1][0][0])?","required","","placeholder","Enter the fanSpeedMinPercent of the profile","name","fanSpeedMinPercent",3,"ngModel","ngModelChange"],["matInput","","type","number","pattern","^$|^([0-9]|[1-9][0-9]|[1][0][0])?","required","","placeholder","Enter the fanSpeedMaxPercent of the profile","name","fanSpeedMaxPercent",3,"ngModel","ngModelChange"],["matInput","","type","number","pattern","(3[5-8][0-9]|39[0-9]|[4-9][0-9]{2}|[1-4][0-9]{3}|5000)","required","","placeholder","Enter the CO<sub>2</sub> Target of the profile","name","co2Target",3,"ngModel","ngModelChange"],["matInput","","type","number","pattern","[0-9][0-9]{0,2}","required","","placeholder","Enter the co2Target of the profile","name","pm2Target",3,"ngModel","ngModelChange"],[2,"font-size","10.5px"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(3,"mat-form-field",3)(4,"mat-label"),e.\u0275\u0275text(5,"Title"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"input",4,5),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.title=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-error"),e.\u0275\u0275text(9,"Minimum 2 characters"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"mat-form-field",3)(11,"mat-label"),e.\u0275\u0275text(12,"Description"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"input",6,5),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.description=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-error"),e.\u0275\u0275text(16,"Minimum 2 characters"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(17,"div",7)(18,"div",8)(19,"div",9),e.\u0275\u0275text(20,"Damper Mode:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"mat-select",10,11),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.damperMode=r}),e.\u0275\u0275elementStart(23,"mat-option",12),e.\u0275\u0275text(24,"Manual Mode"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"mat-option",13),e.\u0275\u0275text(26,"Automatic Mode"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(27,lc,2,0,"mat-error",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"mat-form-field")(29,"mat-label"),e.\u0275\u0275text(30,"Damper Fresh Air %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"input",15),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.damperFreshAirManualPercent=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"mat-error"),e.\u0275\u0275text(33,"Only value between 0 and 100"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(34,"mat-form-field")(35,"mat-label"),e.\u0275\u0275text(36,"Damper Circulating Air %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(37,"input",16),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.damperCirculatingAirManualPercent=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"mat-error"),e.\u0275\u0275text(39,"Only value between 0 and 100"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(40,"div",17)(41,"div",8)(42,"div",9),e.\u0275\u0275text(43,"Fan Mode:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(44,"mat-select",18,19),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.fanMode=r}),e.\u0275\u0275elementStart(46,"mat-option",20),e.\u0275\u0275text(47,"Fixed Speed"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(48,"mat-option",21),e.\u0275\u0275text(49,"PM and CO"),e.\u0275\u0275elementStart(50,"sub"),e.\u0275\u0275text(51,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(52," Controlled"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(53,sc,2,0,"mat-error",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(54,"mat-form-field")(55,"mat-label"),e.\u0275\u0275text(56,"Fan Speed Fixed %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(57,"input",22),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.fanSpeedFixedPercent=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(58,"mat-error"),e.\u0275\u0275text(59,"Only value between 0 and 100"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(60,"mat-form-field")(61,"mat-label"),e.\u0275\u0275text(62,"Fan Speed Min %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(63,"input",23),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.fanSpeedMinPercent=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(64,"mat-error"),e.\u0275\u0275text(65,"Only value between 0 and 100"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(66,"mat-form-field")(67,"mat-label"),e.\u0275\u0275text(68,"Fan Speed Max %"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(69,"input",24),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.fanSpeedMaxPercent=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(70,"mat-error"),e.\u0275\u0275text(71,"Only value between 0 and 100"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(72,"div",7)(73,"mat-form-field")(74,"mat-label"),e.\u0275\u0275text(75,"CO"),e.\u0275\u0275elementStart(76,"sub"),e.\u0275\u0275text(77,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(78," Target"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(79,"input",25),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.co2Target=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(80,"mat-error"),e.\u0275\u0275text(81,"Only value between 350 and 5000"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(82,"mat-form-field")(83,"mat-label"),e.\u0275\u0275text(84,"PM"),e.\u0275\u0275elementStart(85,"sub"),e.\u0275\u0275text(86,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(87," Target"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(88,"input",26),e.\u0275\u0275listener("ngModelChange",function(r){return i.profile.pm2Target=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(89,"mat-error"),e.\u0275\u0275text(90,"Only value between 0 and 999"),e.\u0275\u0275elementEnd()()()()()),2&t){const a=e.\u0275\u0275reference(2),r=e.\u0275\u0275reference(22),l=e.\u0275\u0275reference(45);e.\u0275\u0275property("title",i.addModus?"Add PPS Profile":"Edit PPS Profile")("submitDisabled",!a.valid),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.profile.title),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.profile.description),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngModel",i.profile.damperMode),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",null==i.profile.damperMode&&(r.dirty||r.touched)),e.\u0275\u0275advance(4),e.\u0275\u0275property("required","manual"==i.profile.damperMode)("ngModel",i.profile.damperFreshAirManualPercent),e.\u0275\u0275advance(6),e.\u0275\u0275property("required","manual"==i.profile.damperMode)("ngModel",i.profile.damperCirculatingAirManualPercent),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.profile.fanMode),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngIf",null==i.profile.fanMode&&(l.dirty||l.touched)),e.\u0275\u0275advance(4),e.\u0275\u0275property("required","fixedSpeed"==i.profile.fanMode)("ngModel",i.profile.fanSpeedFixedPercent),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.profile.fanSpeedMinPercent),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.profile.fanSpeedMaxPercent),e.\u0275\u0275advance(10),e.\u0275\u0275property("ngModel",i.profile.co2Target),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngModel",i.profile.pm2Target)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.wO,_.JJ,_.On,D.TO,V.SQ,V.Wh,V.yH,_e.gD,de.ey,u.NgIf,_.wV,_.c5],encapsulation:2}),n})();function cc(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",10),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}}function pc(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",11),2&n&&e.\u0275\u0275property("message","pps profiles")}function mc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",31),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function dc(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",32)(1,"button",33),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).delete(r)}),e.\u0275\u0275text(2,"Delete"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",34),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).edit(r)}),e.\u0275\u0275text(4,"Edit"),e.\u0275\u0275elementEnd()()}}function uc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Title"),e.\u0275\u0275elementEnd())}function _c(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.title," ")}}function fc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Description"),e.\u0275\u0275elementEnd())}function hc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function gc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Damper Mode"),e.\u0275\u0275elementEnd())}function vc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.damperMode," ")}}function Cc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Damper Fresh Air %"),e.\u0275\u0275elementEnd())}function bc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.damperFreshAirManualPercent," ")}}function xc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Damper Circulating Air %"),e.\u0275\u0275elementEnd())}function yc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.damperCirculatingAirManualPercent," ")}}function Sc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Fan Mode"),e.\u0275\u0275elementEnd())}function wc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.fanMode," ")}}function Ec(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Fan Speed Fixed %"),e.\u0275\u0275elementEnd())}function Tc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.fanSpeedFixedPercent," ")}}function Ic(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Fan Speed Max %"),e.\u0275\u0275elementEnd())}function Pc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.fanSpeedMaxPercent," ")}}function kc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Fan Speed Min %"),e.\u0275\u0275elementEnd())}function Mc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.fanSpeedMinPercent," ")}}function Ac(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"CO"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Target"),e.\u0275\u0275elementEnd())}function Dc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.co2Target," ")}}function Oc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Target"),e.\u0275\u0275elementEnd())}function Lc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.pm2Target," ")}}function Fc(n,o){1&n&&e.\u0275\u0275element(0,"tr",37)}function Rc(n,o){1&n&&e.\u0275\u0275element(0,"tr",38)}function Nc(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",12),e.\u0275\u0275elementContainerStart(1,13),e.\u0275\u0275template(2,mc,2,0,"th",14),e.\u0275\u0275template(3,dc,5,0,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,16),e.\u0275\u0275template(5,uc,2,0,"th",17),e.\u0275\u0275template(6,_c,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,19),e.\u0275\u0275template(8,fc,2,0,"th",17),e.\u0275\u0275template(9,hc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,20),e.\u0275\u0275template(11,gc,2,0,"th",17),e.\u0275\u0275template(12,vc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,21),e.\u0275\u0275template(14,Cc,2,0,"th",17),e.\u0275\u0275template(15,bc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,22),e.\u0275\u0275template(17,xc,2,0,"th",17),e.\u0275\u0275template(18,yc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,23),e.\u0275\u0275template(20,Sc,2,0,"th",17),e.\u0275\u0275template(21,wc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,24),e.\u0275\u0275template(23,Ec,2,0,"th",17),e.\u0275\u0275template(24,Tc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,25),e.\u0275\u0275template(26,Ic,2,0,"th",17),e.\u0275\u0275template(27,Pc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,26),e.\u0275\u0275template(29,kc,2,0,"th",17),e.\u0275\u0275template(30,Mc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,27),e.\u0275\u0275template(32,Ac,5,0,"th",17),e.\u0275\u0275template(33,Dc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(34,28),e.\u0275\u0275template(35,Oc,5,0,"th",17),e.\u0275\u0275template(36,
1Lc,2,1,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(37,Fc,1,0,"tr",29),e.\u0275\u0275template(38,Rc,1,0,"tr",30),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(37),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Vc(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",39),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let Hc=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.ppsProfileServices=t,this.ppsProfiles=i,this.places=a,this.dialog=r,this._messageService=l,this.localStore=f,this.helpService=w,this.dialogService=T,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.displayedColumns=["title","description","damperMode","damperFreshAirManualPercent","damperCirculatingAirManualPercent","fanMode","fanSpeedFixedPercent","fanSpeedMaxPercent","fanSpeedMinPercent","co2Target","pm2Target","edit"],this.filterValue="",this.HelpSection=Z.L,this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(M=>{"pps_profiles_loaded"===M&&(this.dataSource=new h.by(i.ppsProfiles),this.dataSource.paginator=this.paginator,this.isTableEmpty=0===i.ppsProfiles.length,this.dataSource.sort=this.sort),"profiles_loaded"===M&&(this.dialog.closeAll(),this.clearFilter()),"profiles_saved"===M&&(this.dialog.closeAll(),this.clearFilter())})}ngOnInit(){this.ppsProfiles.getPPsProfiles(this.places.currentPlace.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}edit(t){this.matDialogRef=this.dialog.open(wi,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})}savePagination(t){this.localStore.saveData("paginationAddPPS",t.pageSize)}getPagination(){return this.localStore.getData("paginationAddPPS")||"500"}new(){this.matDialogRef=this.dialog.open(wi,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete profile "+t.title+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.ppsProfileServices.deleteProfile(this.places.currentPlace,t)})}applyFilter(t){var i,a;this.dataSource.filter=t.trim().toLowerCase(),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage()}clearFilter(){this.dataSource&&(this.dataSource.filter="")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Mt),e.\u0275\u0275directiveInject(Mt),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-pps-profiles"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:11,vars:6,consts:[[1,"inPage"],[3,"mode"],[3,"justifyContent"],["label","Search PPS","placeholder","Type in the profile",3,"applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["label","Search PPS","placeholder","Type in the profile",3,"applyFilter","clearFilter"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","style","min-width: 160px",4,"matCellDef"],["matColumnDef","title"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","description"],["matColumnDef","damperMode"],["matColumnDef","damperFreshAirManualPercent"],["matColumnDef","damperCirculatingAirManualPercent"],["matColumnDef","fanMode"],["matColumnDef","fanSpeedFixedPercent"],["matColumnDef","fanSpeedMaxPercent"],["matColumnDef","fanSpeedMinPercent"],["matColumnDef","co2Target"],["matColumnDef","pm2Target"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","",2,"min-width","160px"],["mat-button","",1,"button-danger","spacer-right-sm",3,"click"],["mat-button","",1,"button-secondary",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-row",""],["mat-row",""],[1,"full-width",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0),e.\u0275\u0275element(1,"mat-progress-bar",1),e.\u0275\u0275elementStart(2,"app-sub-header",2),e.\u0275\u0275template(3,cc,1,0,"app-table-filter-search",3),e.\u0275\u0275elementStart(4,"div",4)(5,"button",5),e.\u0275\u0275listener("click",function(){return i.new()}),e.\u0275\u0275text(6,"Add New"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",6),e.\u0275\u0275template(8,pc,1,1,"app-no-data",7),e.\u0275\u0275template(9,Nc,39,3,"table",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,Vc,1,2,"mat-paginator",9),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("mode",null==i.ppsProfiles.ppsProfiles?"indeterminate":""),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[at.pW,ae.$,u.NgIf,$e.n,z.lW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,U.nU,h.as,h.XQ,h.nj,h.Gk,Ce.NW],styles:["td[_ngcontent-%COMP%]{padding:0 10px}"]}),n})(),jc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-pps"]],decls:6,vars:0,consts:[["fxLayout","row wrap","fxLayoutAlign","space-between center","fxLayoutGap","10px",1,"inPage"],["label","PPS"],["label","PPS profiles"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"mat-tab-group")(2,"mat-tab",1),e.\u0275\u0275element(3,"app-administration-add-pps"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-tab",2),e.\u0275\u0275element(5,"app-administration-pps-profiles"),e.\u0275\u0275elementEnd()()())},directives:[V.xw,V.Wh,V.SQ,se.SP,se.uX,oc,Hc],styles:["mat-icon[_ngcontent-%COMP%]{cursor:pointer}mat-tab-group[_ngcontent-%COMP%]{width:100%}"]}),n})();const Bc=["tabGroup"];function Gc(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-sensors")}const Dn=function(n){return[n]};function zc(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",9),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Mini Displays")("permissions",e.\u0275\u0275pureFunction1(2,Dn,t.UsersPermissions.advanced_config))}}function $c(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-displays")}function Uc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,zc,1,4,"ng-template",8),e.\u0275\u0275template(2,$c,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function Wc(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",9),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Public Displays / Website Widget")("permissions",e.\u0275\u0275pureFunction1(2,Dn,t.UsersPermissions.advanced_config))}}function Qc(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10)(1,"app-intro-hint",11),e.\u0275\u0275elementContainerStart(2,12),e.\u0275\u0275elementStart(3,"span"),e.\u0275\u0275text(4," We are currently migrating the existing display management system. We kindly ask you to start migrating your existing displays to our new system. You can do this by using the improved flow on the "),e.\u0275\u0275elementStart(5,"button",13),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(3).navigateToPath("/settings/hardware",{tab:3})}),e.\u0275\u0275text(6," new page "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(7," and deleting the old ones. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"br"),e.\u0275\u0275elementStart(9,"span"),e.\u0275\u0275text(10," Please consider migrating to the new displays in steps. So far, we only have the classic display, but don't worry \u2014 we plan to extend it to include the old views as well! "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(11,"app-administration-admin-displays")}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("showHideButton",!1)("isMobileSameDesktop",!0))}function qc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,Wc,1,4,"ng-template",8),e.\u0275\u0275template(2,Qc,12,2,"ng-template",5),e.\u0275\u0275elementEnd())}function Kc(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",9),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","PPS")("permissions",e.\u0275\u0275pureFunction1(2,Dn,t.UsersPermissions.pps_admin))}}function Yc(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-pps")}function Xc(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab",14),e.\u0275\u0275template(1,Kc,1,4,"ng-template",8),e.\u0275\u0275template(2,Yc,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function Zc(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"section",1)(1,"mat-tab-group",2,3),e.\u0275\u0275listener("selectedTabChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateRoute()}),e.\u0275\u0275elementStart(3,"mat-tab",4),e.\u0275\u0275template(4,Gc,1,0,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Uc,3,0,"mat-tab",6),e.\u0275\u0275template(6,qc,3,0,"mat-tab",6),e.\u0275\u0275template(7,Xc,3,0,"mat-tab",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"mat-divider"),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",((null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin))&&t.displayServices.oldDisplayTabVisible),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace||null==t.places.currentPlace.permissions?null:t.places.currentPlace.permissions.pps_admin)||t.user.currentUser.admin)}}let Jc=(()=>{class n{constructor(t,i,a,r,l,f){this.dataServices=t,this.user=i,this.router=a,this.displayServices=r,this.activatedRoute=l,this.places=f,this.destroy$=new H.xQ,this.UsersPermissions=it.S}ngOnInit(){this.dataServices.currentScreen="Hardware Administration"}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.activatedRoute.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.tabGroup?this.tabGroup.selectedIndex=this.activatedRoute.snapshot.queryParams.tab||0:setTimeout(()=>{this.tabGroup.selectedIndex=this.activatedRoute.snapshot.queryParams.tab||0},100)})}updateRoute(){const i=this.activatedRoute.snapshot.queryParams.search;this.router.navigate([],{queryParams:{tab:this.tabGroup.selectedIndex,search:+this.activatedRoute.snapshot.queryParams.tab===this.tabGroup.selectedIndex&&i?i:null}})}navigateToPath(t,i){this.router.navigate([t],{queryParams:i}
1)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-page-place-hardware"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(Bc,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.tabGroup=a.first)}},decls:1,vars:1,consts:[["class","content-wrapper",4,"ngIf"],[1,"content-wrapper"],[1,"full-width",3,"selectedTabChange"],["tabGroup",""],["label","Monitors"],["matTabContent",""],[4,"ngIf"],["label","PPS",4,"ngIf"],["matTabLabel",""],[3,"textContent","permissions"],[1,"padding-left-md","padding-right-md","padding-top-md","padding-bottom-md",2,"background-color","#ffffff"],["type","normal",3,"showHideButton","isMobileSameDesktop"],["id","desktop"],[1,"accent-link",3,"click"],["label","PPS"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Zc,9,3,"section",0),2&t&&e.\u0275\u0275property("ngIf",null==i.places?null:i.places.currentPlace)},directives:[u.NgIf,se.SP,se.uX,se.Vc,$l,se.uD,dt.S,cs,ps.$,Os,jc,vt.d],encapsulation:2}),n})();var ep=d(98443),On=d(35963),sn=d(63264),ot=d(48582);const tp=["formInput"];function np(n,o){if(1&n&&e.\u0275\u0275element(0,"app-progress-bar",7),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("show",!(null!=t.alarmServices&&t.alarmServices.currentAlarms))}}function ip(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," please contact your local admin. "),e.\u0275\u0275elementContainerEnd())}function ap(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," you can configure them in "),e.\u0275\u0275elementStart(2,"button",8),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).navigateToAlarms()}),e.\u0275\u0275text(3,"Alarms Settings"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4,". "),e.\u0275\u0275elementContainerEnd()}}function op(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1," Please subscribe to the alarms that you would like to receive. In case you need additional alarms that are not listed here, "),e.\u0275\u0275template(2,ip,2,0,"ng-container",3),e.\u0275\u0275template(3,ap,5,0,"ng-container",3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!(null!=t.place&&null!=t.place.currentPlace&&null!=t.place.currentPlace.permissions&&t.place.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.place||null==t.place.currentPlace||null==t.place.currentPlace.permissions?null:t.place.currentPlace.permissions.settings)}}function rp(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," Please contact your local admin. "),e.\u0275\u0275elementContainerEnd())}function lp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," You can set up new alarms in "),e.\u0275\u0275elementStart(2,"button",8),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).navigateToAlarms()}),e.\u0275\u0275text(3,"Alarms Settings"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4,". "),e.\u0275\u0275elementContainerEnd()}}function sp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1," No alarms have been configured for the current place. "),e.\u0275\u0275template(2,rp,2,0,"ng-container",3),e.\u0275\u0275template(3,lp,5,0,"ng-container",3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!(null!=t.place&&null!=t.place.currentPlace&&null!=t.place.currentPlace.permissions&&t.place.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.place||null==t.place.currentPlace||null==t.place.currentPlace.permissions?null:t.place.currentPlace.permissions.settings)}}function cp(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",9),2&n&&e.\u0275\u0275property("message","alarms")}function pp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Title"),e.\u0275\u0275elementEnd())}function mp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.alarmInfo.title," ")}}function dp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Description"),e.\u0275\u0275elementEnd())}function up(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.alarmInfo.description," ")}}function _p(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Location"),e.\u0275\u0275elementEnd())}function fp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.alarmInfo.locationName," ")}}function hp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Group"),e.\u0275\u0275elementEnd())}function gp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.alarmInfo.locationGroupName," ")}}function vp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Subscribed"),e.\u0275\u0275elementEnd())}function Cp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",22)(1,"mat-checkbox",23),e.\u0275\u0275listener("change",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.alarmServices.editUserAlarm(l.place.currentPlace,r)})("ngModelChange",function(a){return e.\u0275\u0275restoreView(t).$implicit.subscribed=a}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.subscribed)("disabled",!1)}}function bp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Notify when returned to normal"),e.\u0275\u0275elementEnd())}function xp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",22)(1,"mat-checkbox",23),e.\u0275\u0275listener("change",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.alarmServices.editUserAlarm(l.place.currentPlace,r)})("ngModelChange",function(a){return e.\u0275\u0275restoreView(t).$implicit.alsoNotifyOnCease=a}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.alsoNotifyOnCease)("disabled",!1)}}function yp(n,o){1&n&&e.\u0275\u0275element(0,"tr",24)}function Sp(n,o){1&n&&e.\u0275\u0275element(0,"tr",25)}function wp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",10),e.\u0275\u0275elementContainerStart(1,11),e.\u0275\u0275template(2,pp,2,0,"th",12),e.\u0275\u0275template(3,mp,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,14),e.\u0275\u0275template(5,dp,2,0,"th",12),e.\u0275\u0275template(6,up,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,15),e.\u0275\u0275template(8,_p,2,0,"th",12),e.\u0275\u0275template(9,fp,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,16),e.\u0275\u0275template(11,hp,2,0,"th",12),e.\u0275\u0275template(12,gp,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,17),e.\u0275\u0275template(14,vp,2,0,"th",12),e.\u0275\u0275template(15,Cp,2,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,
118),e.\u0275\u0275template(17,bp,2,0,"th",12),e.\u0275\u0275template(18,xp,2,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(19,yp,1,0,"tr",19),e.\u0275\u0275template(20,Sp,1,0,"tr",20),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(19),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let Ep=(()=>{class n{constructor(t,i,a,r){this.alarmServices=t,this._messageService=i,this.router=a,this.place=r,this.isTableEmpty=!1,this.displayedColumns=["title","description","location_name","location_group","subscribed","alsoNotifyOnCease"],this.filterValue="",this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(l=>{var f,w,T;"places_loaded"===l&&this.alarmServices.getUserAlarms(this.place.currentPlace.id),"current_alarms_loaded"===l&&(this.dataSource=new h.by(null===(f=this.alarmServices)||void 0===f?void 0:f.currentAlarms),this.isTableEmpty=0===(null===(T=null===(w=this.alarmServices)||void 0===w?void 0:w.currentAlarms)||void 0===T?void 0:T.length),this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator)})}ngOnInit(){this.alarmServices.getUserAlarms(this.place.currentPlace.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}applyFilter(t){this.filterValue=t.target.value,this.dataSource.filter=this.filterValue.trim().toLowerCase(),this.dataSource.paginator&&this.dataSource.paginator.firstPage()}clearFilter(){this.formInput.value="",this.filterValue="",this.dataSource.filter=this.filterValue.trim().toLowerCase()}navigateToAlarms(){this.router.navigate(["settings/alarms-and-notifications"],{queryParams:{tab:sn.p.alarms}})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(On.H),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-alarm-user"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5),e.\u0275\u0275viewQuery(tp,5,X.Nt)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.formInput=a.first)}},decls:8,vars:5,consts:[["fxLayout","row wrap","fxLayoutAlign","start",1,"inPage",2,"padding","15px"],["style","width: 100%",3,"show",4,"ngIf"],["fxFlex","","fxLayoutGap","20px","fxLayoutAlign","space-between start",1,"control"],[4,"ngIf"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],[2,"width","100%",3,"show"],["type","button",1,"accent-link",2,"font-size","15px",3,"click"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","title"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","description"],["matColumnDef","location_name"],["matColumnDef","location_group"],["matColumnDef","subscribed"],["matColumnDef","alsoNotifyOnCease"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"example-margin",3,"ngModel","disabled","change","ngModelChange"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0),e.\u0275\u0275template(1,np,1,1,"app-progress-bar",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275template(3,op,4,2,"p",3),e.\u0275\u0275template(4,sp,4,2,"p",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",4),e.\u0275\u0275template(6,cp,1,1,"app-no-data",5),e.\u0275\u0275template(7,wp,21,3,"table",6),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!(null!=i.alarmServices&&i.alarmServices.currentAlarms)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==i.alarmServices.currentAlarms?null:i.alarmServices.currentAlarms.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.alarmServices?null:i.alarmServices.currentAlarms)&&!(null!=i.alarmServices.currentAlarms&&i.alarmServices.currentAlarms.length)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[V.xw,V.Wh,u.NgIf,ot.R,V.yH,V.SQ,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,Je.oG,_.JJ,_.On,h.as,h.XQ,h.nj,h.Gk],encapsulation:2}),n})();const Tp=["tabGroup"];function Ip(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function Pp(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"ul"),e.\u0275\u0275template(2,Ip,2,1,"li",20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext().ngIf;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t)}}function kp(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"span"),e.\u0275\u0275text(2,"Member of All Groups"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd())}function Mp(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Pp,3,1,"ng-container",0),e.\u0275\u0275template(2,kp,3,0,"ng-container",0),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.ngIf;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.length>0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",0===t.length)}}function Ap(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-sub-header",7)(1,"button",8),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.helpService.openHelpDialog(a.HelpSection.user_administration,"User Profile")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"section",9)(4,"p"),e.\u0275\u0275text(5),e.\u0275\u0275element(6,"app-clipboard-copy",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"p"),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"p"),e.\u0275\u0275text(10,"Groups: "),e.\u0275\u0275template(11,Mp,3,2,"ng-container",0),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div",11)(13,"button",12),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).navigateToChangeUsername()}),e.\u0275\u0275text(14," Change Username "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"button",13),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).navigateToChangePassword()}),e.\u0275\u0275text(16),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(17,"p"),e.\u0275\u0275text(18),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"app-warning-message",14),e.\u0275\u0275elementContainerStart(20,15),e.\u0275\u0275elementStart(21,"p")(22,"span"),e.\u0275\u0275text(23," If you would like to change your email, you need to go to the "),e.\u0275\u0275elementStart(24,"a",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).helpService.navigateToRoute("/settings/permission")}),e.\u0275\u0275text(25," Users & Permissions "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(26," page. "),e.\u0275\u0275elementStart(27,"p"),e.\u0275\u0275text(28," Press 'Add New' to add a new email: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(29,"img",17),e.\u0275\u0275elementStart(30,"p"),e.\u0275\u0275text(31," Grant the new email all permissions: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(32,"img",18),e.\u0275\u0275elementStart(33,"p"),e.\u0275\u0275text(34," Log in using this new email, return to "),e.\u0275\u0275elementStart(35,"a",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).helpService.navigateToRoute("/settings/permission")}),e.\u0275\u0275text(36," Users & Permissions "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(37," page, and delete the old email: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(38,"img",19),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("justifyContent","flex-end"),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" Place ID: ",t.places.currentPlace.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",t.places.currentPlace.id),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Username: ",t.userService.currentUser.name,""),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.getUserGroupByPlace(t.userService.currentUser,t.places.currentPlace)),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",t.userService.currentUser.password_hash_present?"Change":"Create"," Password "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1("Email: ",t.userService.currentUser.email,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("subHeader","How to change the email address?")("isExpandable",!0)("isAccentWarning",!0)}}function Dp(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-alarm-user")}function Op(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"section",9)(1,"button",21),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).updatePWA()}),e.\u0275\u0275text(2," Manually update PWA "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"p"),e.\u0275\u0275text(4,"In case the screen is blank after the update, just touch the screen (iOS)"),e.\u0275\u0275elementEnd()()}}function Lp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"section")(1,"mat-tab-group",1,2),e.\u0275\u0275listener("selectedTabChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateRoute()}),e.\u0275\u0275elementStart(3,"mat-tab",3),e.\u0275\u0275template(4,Ap,39,10,"ng-template",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"mat-tab",5),e.\u0275\u0275template(6,Dp,1,0,"ng-template",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-tab",6),e.\u0275\u0275template(8,Op,5,0,"ng-template",4),e.\u0275\u0275elementEnd()()()}}let Fp=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.logging=t,this.dataServices=i,this.router=a,this.userService=r,this.activatedRoute=l,this.places=f,this.helpService=w,this.permissionServices=T,this.destroy$=new H.xQ,this.UsersPermissions=it.S,this.HelpSection=Z.L}updatePWA(){this.logging.sendLogEntry("PWA","force reload"),window.location.reload()}ngOnInit(){this.dataServices.currentScreen="User Profile"}navigateToChangePassword(){if(this.userService.currentUser.password_hash_present)this.router.navigate(["settings/c
1hange-password"]);else{const t=new ep.c;t.email=this.userService.currentUser.email,this.permissionServices.requestPassword(t)}}navigateToChangeUsername(){this.router.navigate(["settings/change-username"])}ngAfterViewInit(){this.activatedRoute.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.tabGroup?this.tabGroup.selectedIndex=this.activatedRoute.snapshot.queryParams.tab||0:setTimeout(()=>{this.tabGroup.selectedIndex=this.activatedRoute.snapshot.queryParams.tab||0},100)})}updateRoute(){this.router.navigate([],{queryParams:{tab:this.tabGroup.selectedIndex}})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}getUserGroupByPlace(t,i){return t.groups.filter(a=>a.place_id===i.id)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Sn.J),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(kt.J))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-page-user-adminstration"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(Tp,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.tabGroup=a.first)}},decls:1,vars:1,consts:[[4,"ngIf"],[3,"selectedTabChange"],["tabGroup",""],["label","General"],["matTabContent",""],["label","Subscribe to Alarms"],["label","PWA Update"],[3,"justifyContent"],["type","button","mat-button","",1,"button-secondary",3,"click"],[1,"inPage",2,"padding","15px"],["successMessage","Place ID has been copied to clipboard",3,"copyValue"],[1,"change-buttons-wrapper"],["mat-flat-button","","mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-primary",3,"click"],[3,"subHeader","isExpandable","isAccentWarning"],["expandableWarning",""],[1,"accent-link",3,"click"],["src","/assets/help_trancated_1.webp","alt","Help 1"],["src","/assets/help_trancated_2.webp","alt","Help 2"],["src","/assets/help_trancated_3.webp","alt","Help 3"],[4,"ngFor","ngForOf"],["mat-button","",1,"button-primary","spacer-top-md",3,"click"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Lp,9,0,"section",0),2&t&&e.\u0275\u0275property("ngIf",null==i.places?null:i.places.currentPlace)},directives:[u.NgIf,se.SP,se.uX,se.Vc,ae.$,z.lW,Ie.Z,u.NgForOf,je.R,Ep],styles:[".change-buttons-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--sm-size)}img[_ngcontent-%COMP%]{border-radius:var(--xxs-size);max-width:600px;width:100%}"]}),n})();var Ei=d(51120),Ti=d(83301),Rp=d(34816);function Np(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," Email is required "),e.\u0275\u0275elementEnd())}function Vp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," Incorrect email format "),e.\u0275\u0275elementEnd())}function Hp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",17),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().permission.intraday_report=a}),e.\u0275\u0275text(1," AQI / HEAT scheduled notifications "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngModel",t.permission.intraday_report)}}function jp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",18),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().permission.band_change_report=a}),e.\u0275\u0275text(1," AQI / HEAT band change notifications "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngModel",t.permission.band_change_report)}}function Bp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",19),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().permission.pps_admin=a}),e.\u0275\u0275text(1," PPS Admin "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngModel",t.permission.pps_admin)}}function Gp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",20),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().permission.community_admin=a}),e.\u0275\u0275text(1," Community Admin "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngModel",t.permission.community_admin)}}let Ii=(()=>{class n{constructor(t,i,a,r,l,f){this.userService=t,this.dialogRef=i,this.data=a,this.permissionServices=r,this.places=l,this.helpService=f,this.EMAIL_VALIDATION_
1STRING=Rp.L,this.TypeOfPermissionsSections=Ti.L,this.permission=new Ei.y,this.HelpSection=Z.L}ngOnInit(){null===this.data?(this.permission=new Ei.y,this.addModus=!0,this.permission.send_invitation=!0):(this.permission=this.data,this.addModus=!1,this.origEmail=this.permission.user_email)}checkEmailChange(){this.addModus||(this.permission.send_invitation=this.origEmail!=this.permission.user_email)}onSubmit(){this.dialogRef.componentInstance.data=this.permission,this.addModus?this.permissionServices.addPermission(this.places.currentPlace,this.permission):this.permissionServices.savePermission(this.places.currentPlace,this.permission)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(kt.J),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-permissions"]],inputs:{addModus:"addModus"},decls:26,vars:19,consts:[[3,"title","isAdditionalButton","additionalText","submitDisabled","cancel","submitting","additionalAction"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],[1,"full-width"],["matInput","","type","email","required","","placeholder","Enter the email","name","user_email",3,"ngModel","pattern","ngModelChange","keyup"],["email","ngModel"],[4,"ngIf"],["name","daily_report",3,"ngModel","ngModelChange"],["name","intraday_report",3,"ngModel","ngModelChange",4,"ngIf"],["name","band_change_report",3,"ngModel","ngModelChange",4,"ngIf"],["name","offline_report",3,"ngModel","ngModelChange"],["name","export",3,"ngModel","ngModelChange"],["name","settings",3,"ngModel","disabled","ngModelChange"],["name","pps_admin",3,"ngModel","ngModelChange",4,"ngIf"],["name","cleanair_admin",3,"ngModel","ngModelChange"],["name","community_admin",3,"ngModel","ngModelChange",4,"ngIf"],["name","send_invitation",3,"ngModel","ngModelChange"],["name","intraday_report",3,"ngModel","ngModelChange"],["name","band_change_report",3,"ngModel","ngModelChange"],["name","pps_admin",3,"ngModel","ngModelChange"],["name","community_admin",3,"ngModel","ngModelChange"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()})("additionalAction",function(){return i.helpService.openHelpDialog(i.HelpSection.users_permissions,"Users & Permissions",i.TypeOfPermissionsSections.window)}),e.\u0275\u0275elementStart(1,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(3,"mat-form-field",3)(4,"mat-label"),e.\u0275\u0275text(5,"Email"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"input",4,5),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.user_email=r})("keyup",function(){return i.checkEmailChange()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(8,Np,2,0,"mat-error",6),e.\u0275\u0275template(9,Vp,2,0,"mat-error",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-checkbox",7),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.daily_report=r}),e.\u0275\u0275text(11,"Daily / Weekly Reports "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,Hp,2,1,"mat-checkbox",8),e.\u0275\u0275template(13,jp,2,1,"mat-checkbox",9),e.\u0275\u0275elementStart(14,"mat-checkbox",10),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.offline_report=r}),e.\u0275\u0275text(15," Offline monitors notifications "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"mat-checkbox",11),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.export=r}),e.\u0275\u0275text(17,"Data export"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-checkbox",12),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.settings=r}),e.\u0275\u0275text(19," General Admin "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(20,Bp,2,1,"mat-checkbox",13),e.\u0275\u0275elementStart(21,"mat-checkbox",14),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.cleanair_admin=r}),e.\u0275\u0275text(22," Clean Air Advocates Program Admin "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(23,Gp,2,1,"mat-checkbox",15),e.\u0275\u0275elementStart(24,"mat-checkbox",16),e.\u0275\u0275listener("ngModelChange",function(r){return i.permission.send_invitation=r}),e.\u0275\u0275text(25," Send Invitation Email "),e.\u0275\u0275elementEnd()()()),2&t){const a=e.\u0275\u0275reference(2),r=e.\u0275\u0275reference(7);e.\u0275\u0275property("title",i.addModus?"Add User / Permission":"Edit Permission")("isAdditionalButton",!0)("additionalText","Help")("submitDisabled",!a.valid),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",i.permission.user_email)("pattern",
1i.EMAIL_VALIDATION_STRING),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==r.errors?null:r.errors.required),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==r.errors?null:r.errors.pattern),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.permission.daily_report),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",(null==i.places||null==i.places.currentPlace?null:i.places.currentPlace.advanced_config)||(null==i.userService||null==i.userService.currentUser?null:i.userService.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.places||null==i.places.currentPlace?null:i.places.currentPlace.advanced_config)||(null==i.userService||null==i.userService.currentUser?null:i.userService.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.permission.offline_report),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.permission.export),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.permission.settings)("disabled",(null==i.data?null:i.data.user_email)==i.userService.currentUser.email),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.userService.currentUser.admin||(null==i.places||null==i.places.currentPlace||null==i.places.currentPlace.permissions?null:i.places.currentPlace.permissions.pps_admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.permission.cleanair_admin),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.userService.currentUser.admin||i.userService.currentUser.support_staff),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.permission.send_invitation)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.JJ,_.On,_.c5,u.NgIf,D.TO,Je.oG],styles:["mat-card[_ngcontent-%COMP%]{color:#708090}"]}),n})();function zp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",13),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}}function $p(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",14),e.\u0275\u0275text(1," lock "),e.\u0275\u0275elementEnd())}function Up(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",15)}function Wp(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",16),2&n&&e.\u0275\u0275property("message","permissions")}function Qp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function qp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",40),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).edit(a)}),e.\u0275\u0275text(1,"Edit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",40),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).delete(a)}),e.\u0275\u0275text(3,"Delete"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"mat-divider"),e.\u0275\u0275elementStart(5,"button",40),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).resend(a)}),e.\u0275\u0275text(6,"Resend Invitation"),e.\u0275\u0275elementEnd()}}function Kp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36)(1,"mat-menu",null,37),e.\u0275\u0275template(3,qp,7,0,"ng-template",38),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",39)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function Yp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Email"),e.\u0275\u0275elementEnd())}function Xp(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",42)(1,"app-interactive-table-cell",43),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).edit(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!1)("customWidth","fit-content")("value",t.user_email)}}function Zp(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Daily/Weekly reports"),e.\u0275\u0275elementEnd())}function Jp(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.daily_report)}}function em(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"AQI / HEAT scheduled notifications"),e.\u0275\u0275elementEnd())}function tm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.intraday_report)}}function nm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"AQI / HEAT band change notifications"),e.\u0275\u0275elementEnd())}function im(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.band_change_report)}}function am(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Offline monitors notifications"),e.\u0275\u0275elementEnd())}function om(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.offline_report)}}function rm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Data export"),e.\u0275\u0275elementEnd())}function lm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.export)}}function sm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"General Admin"),e.\u0275\u0275elementEnd())}function cm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.settings)}}function pm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Test Admin"),e.\u0275\u0275elementEnd())}function mm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.test_admin)}}function dm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"PPS Admin"),e.\u0275\u0275elementEnd())}function um(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.pps_admin)}}function _m(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Community Admin"),e.\u0275\u0275elementEnd())}function fm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275element(1,"app-status-indicator",44),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.community_admin)}}function hm(n,o){1&n&&e.\u0275\u0275element(0,"tr",45)}function gm(n,o){1&n&&e.\u0275\u0275element(0,"tr",46)}function vm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",17),e.\u0275\u0275elementContainerStart(1,18),e.\u0275\u0275template(2,Qp,2,0,"th",19),e.\u0275\u0275template(3,Kp,7,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,21),e.\u0275\u0275template(5,Yp,2,0,"th",22),e.\u0275\u0275template(6,Xp,2,3,"td",23),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,24),e.\u0275\u0275template(8,Zp,2,0,"th",22),e.\u0275\u0275template(9,Jp,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,25),e.\u0275\u0275template(11,em,2,0,"th",22),e.\u0275\u0275template(12,tm,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,26),e.\u0275\u0275template(14,nm,2,0,"th",22),e.\u0275\u0275template(15,im,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,27),e.\u0275\u0275template(17,am,2,0,"th",22),e.\u0275\u0275template(18,om,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,28),e.\u0275\u0275template(20,rm,2,0,"th",22),e.\u0275\u0275template(21,lm,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,29),e.\u0275\u0275template(23,sm,2,0,"th",22),e.\u0275\u0275template(24,cm,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,30),e.\u0275\u0275template(26,pm,2,0,"th",22),e.\u0275\u0275template(27,mm,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,31),e.\u0275\u0275template(29,dm,2,0,"th",22),e.\u0275\u0275template(30,um,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,32),e.\u0275\u0275template(32,_m,2,0,"th",22),e.\u0275\u0275template(33,fm,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(34,hm,1,0,"tr",33),e.\u0275\u0275template(35,gm,1,0,"tr",34),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(34),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Cm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",47),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}function bm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",48),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",null==t.permissionServices||null==t.permissionServices.filteredPermissions?null:t.permissionServices.filteredPermissions.length," Users")}}let xm=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B){var j;this.permissionServices=t,this.SubscriptionPlanService=i,this.places=a,this.dialog=r,this.dataServices=l,this.dialogService=f,this._messageService=w,this.userService=T,this.localStore=M,this.helpService=B,this.HelpSection=Z.L,this.TypeOfPermissionsSections=Ti.L,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.filterValue="",this.destroy$=new H.xQ,this.displayedColumns=this.userService.currentUser.admin?["user_email","daily_report","intraday_report","band_change_report","offline_report","export","settings","test_admin","pps_admin","community_admin","edit"]:(null===(j=null==a?void 0:a.currentPlace)||void 0===j?void 0:j.advanced_config)?["user_email","daily_report","intraday_report","band_change_report","offline_report","export","settings","community_admin","edit"]:["user_email","daily_report","offline_report","export","settings","community_admin","edit"],this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(q=>{if("permissions_loaded"==q&&(this.isTableEmpty=0===(null==t?void 0:t.filteredPermissions.length),this.dataSource=new h.by(null==t?void 0:t.filteredPermissions),this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort),"permission_created"==q&&(this.dialog.closeAll(),this.clearFilter(),""!==this.filterValue&&this.tableSearchComponent&&this.tableSearchComponent.clearedFilter(),this.permissionServices.getPermissions(this.places.currentPlace.id)),"permission_added"==q&&(this.dialog.closeAll(),this.clearFilter(),this.permissionServices.getPermissions(this.places.currentPlace.id)),"open_edit_permission_dialog"===q){const J=this.matDialogRef.componentInstance.data.user_email,ge=this.permissionServices.filteredPermissions.find(fe=>fe.user_email===J);this.matDialogRef.close(),this.edit(ge)}})}ngOnInit(){this.dataServices.currentScreen="Users & Permissions",this.permissionServices.permissions=null,this.permissionServices.getPermissions(this.places.currentPlace.id)}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}edit(t){this.matDialogRef=this.dialog.open(Ii,{data:t}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}new(){var t,i,a;this.SubscriptionPlanService.getPlanAccessByFeature("users",null===(t=this.permissionServices)||void 0===t?void 0:t.filteredPermissions.length)?(this.matDialogRef=this.dialog.open(Ii,{data:null}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})):(this.places.currentPlace.permissions.settings||this.SubscriptionPlanService.isMaximumItemsForFeatureReached("users",null===(i=this.permissionServices)||void 0===i?void 0:i.filteredPermissions.length))&&this.dialog.open(yn,{data:{feature:"users",featureItemsCount:null===(a=this.permissionServices)||void 0===a?void 0:a.filteredPermissions.length}})}savePagination(t){this.localStore.saveData("paginationPermissions",t.pageSize)}getPagination(){return this.localStore.getData("paginationPermissions")||"500"}resend(t){this.permissionServices.emailInvitation(this.places.currentPlace,t.user_id)}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete the user with email "+t.user_email+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&(this.permissionServices.deletePermission(this.places.currentPlace,t),this.clearFilter())})}applyFilter(t){var i,a;this.dataSource.filter=t.trim().toLowerCase(),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage()}clearFilter(){this.dataSource&&(this.dataSource.filter="")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(kt.J),e.\u0275\u0275directiveInject(on.G),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-permissions"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5),e.\u0275\u0275viewQuery($e.n,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.tableSearchComponent=a.first)}},decls:15,vars:8,consts:[[3,"justifyContent"],["label","Search Email","placeholder","Type in the email",3,"applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["class","subscription-plan-locked-icon in-btn",4,"ngIf"],["mat-button","","type","button",1,"button-secondary",3,"click"],["fxLayout","row wrap","fxLayoutAlign","space-between center",1,"in-page-section-wrapper"],["color","primary","mode","indeterminate",4,"ngIf"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main zoom-table","mat-table","","matSort","","multiTemplateDataRows","",3,"dataSource",4,"ngIf"],["class","full-width",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["class","table-counter",4,"ngIf"],["label","Search Email","
1placeholder","Type in the email",3,"applyFilter","clearFilter"],[1,"subscription-plan-locked-icon","in-btn"],["color","primary","mode","indeterminate"],[3,"message"],["mat-table","","matSort","","multiTemplateDataRows","",1,"ag-table-main","zoom-table",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","user_email"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","daily_report"],["matColumnDef","intraday_report"],["matColumnDef","band_change_report"],["matColumnDef","offline_report"],["matColumnDef","export"],["matColumnDef","settings"],["matColumnDef","test_admin"],["matColumnDef","pps_admin"],["matColumnDef","community_admin"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",1,"zoom-td"],[3,"isLocationName","customWidth","value","cellClick"],[3,"value"],["mat-header-row",""],["mat-row",""],[1,"full-width",3,"pageSize","pageSizeOptions","page"],[1,"table-counter"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0),e.\u0275\u0275template(1,zp,1,0,"app-table-filter-search",1),e.\u0275\u0275elementStart(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.new()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275template(5,$p,2,0,"mat-icon",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",5),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.users_permissions,"Users & Permissions",i.TypeOfPermissionsSections.main)}),e.\u0275\u0275text(7," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(8,"section",6),e.\u0275\u0275template(9,Up,1,0,"mat-progress-bar",7),e.\u0275\u0275elementStart(10,"div",8),e.\u0275\u0275template(11,Wp,1,1,"app-no-data",9),e.\u0275\u0275template(12,vm,36,4,"table",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,Cm,1,2,"mat-paginator",11),e.\u0275\u0275template(14,bm,2,1,"div",12),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!i.SubscriptionPlanService.getPlanAccessByFeature("users",null==i.permissionServices||null==i.permissionServices.filteredPermissions?null:i.permissionServices.filteredPermissions.length)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!(null!=i.permissionServices&&i.permissionServices.filteredPermissions)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,u.NgIf,$e.n,z.lW,Q.Hw,V.xw,V.Wh,at.pW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,vt.d,W.p6,U.nU,Ct.T,kn.w,h.as,h.XQ,h.nj,h.Gk,Ce.NW],styles:["@media (max-width: 767px){th[_ngcontent-%COMP%]{top:-1px!important}.ag-table-wrapper[_ngcontent-%COMP%]{overflow:auto;max-height:calc(100vh - 260px)}}"]}),n})();var ym=d(72271),At=d(98817);let Ln=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i,this.intradayTimes=[],this.hours=["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],this.minutes=["00","05","10","15","20","25","30","35","40","45","50","55"]}getTimes(t=null){this.httpHelper.get("/places/"+t+"/guidelines_times").subscribe(i=>this.intradayTimes=i,i=>{console.log(i),this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("time_loaded")})}deleteItem(t,i){this.httpHelper.delete("/places/"+t.id+"/guidelines_times/"+i.id).subscribe(a=>{},a=>
1{this.httpHelper.handleHttpErrorMessage(a)},()=>{this.getTimes(t.id),this.httpHelper.showSnackbar("Successfully deleted"),this.getTimes(t.id)})}addItem(t,i){this.httpHelper.post("/places/"+t.id+"/guidelines_times",i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a),this._messageService.sendMessage("aqi_policy_close"),console.log(a)},()=>{this.getTimes(t.id),this._messageService.sendMessage("time_added"),this.httpHelper.showSnackbar("Successfully added"),this.getTimes(t.id)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})(),Gt=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i,this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}getData(t=null){this.httpHelper.get("/places/"+t+"/hours").subscribe(i=>{this.hours=i.filter(a=>null!=a.idow_min),this.holidays=i.filter(a=>null!=a.date_min)},i=>{console.log(i),this.httpHelper.handleHttpErrorMessage(i)},()=>{this._messageService.sendMessage("hours_loaded")})}addItem(t,i){i.date_max_date&&(i.date_max=gt(i.date_max_date).format("YYYY-MM-DD").toString()),i.date_min_date&&(i.date_min=gt(i.date_min_date).format("YYYY-MM-DD").toString()),delete i.date_min_date,delete i.date_max_date,i.time_max_time&&(i.time_max=gt.utc(i.time_max_time).format("HH:mm").toString()),i.time_min_time&&(i.time_min=gt.utc(i.time_min_time).format("HH:mm").toString()),delete i.time_min_time,delete i.time_max_time,delete i.time_min_m,delete i.time_min_h,delete i.time_max_m,delete i.time_max_h,this.httpHelper.post("/places/"+t.id+"/hours",i).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a,{400:"Error. User does not exist. Please contact your administrator.",409:"Error. Holiday might be in the past."}),this._messageService.sendMessage("hour_close"),console.log(a)},()=>{this.getData(t.id),this._messageService.sendMessage("hour_added"),this.httpHelper.showSnackbar("Successfully added")})}deleteItem(t,i){this.httpHelper.delete("/places/"+t.id+"/hours/"+i.id).subscribe(a=>{},a=>{this.httpHelper.handleHttpErrorMessage(a)},()=>{this.getData(t.id),this.httpHelper.showSnackbar("Successfully deleted")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac}),n})();var Pi=d(61887),ki=d(9844),Sm=d(93090);function wm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"button",7),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().addAnotherMonitor()}),e.\u0275\u0275text(2," Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",10),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().toDashboard()}),e.\u0275\u0275text(4," To Dashboard "),e.\u0275\u0275elementEnd()()}}let Em=(()=>{class n{constructor(t,i,a){this.dialogRef=t,this.messageService=i,this.router=a,this.setupComplete=!1,this.destroy$=new H.xQ}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"monitor_setup_done"===t&&(this.setupComplete=!0),"monitor_setup_reset"===t&&(this.setupComplete=!1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}addAnotherMonitor(){this.messageService.sendMessage("addAnotherMonitor")}toDashboard(){this.dialogRef.close(),this.router.navigate(["/dashboard"])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(y.F0))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-connect-monitor-dialog"]],decls:14,vars:2,consts:[["color","primary"],[1,"dialog-header"],[1,"title-modal-window-text","generic-dialog-header"],["mat-icon-button","","type","button",3,"click"],[1,"dialog-content"],[3,"embedded"],[1,"dialog-footer"],["mat-button","","type","button",1,"button-secondary",3,"click"],["class","flex-space-between","style","gap: 10px",4,"ngIf"],[1,"flex-space-between",2,"gap","10px"],["mat-button","","type","button",1,"button-primary",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"mat-toolbar",0)(2,"mat-toolbar-row",1)(3,"h3",2),e.\u0275\u0275text(4,"Connect a Monitor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",3),e.\u0275\u0275listener("click",function(){return i.dialogRef.close()}),e.\u0275\u0275elementStart(6,"mat-icon"),e.\u0275\u0275text(7,"close"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(8,"div",4),e.\u0275\u0275element(9,"app-setup-new-sensor",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div",6)(11,"button",7),e.\u0275\u0275listener("click",function(){return i.dialogRef.close()}),e.\u0275\u0275text(12," Close "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,wm,5,0,"div",8),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(9),e.\u0275\u0275property("embedded",!0),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.setupComplete))}
1,directives:[nn.Ye,nn.rD,z.lW,Q.Hw,Sm.F,u.NgIf],styles:["[_nghost-%COMP%] {.mat-stepper-horizontal {min-height: unset;} @media screen and (max-width: 768px) {.mat-stepper-label-position-bottom .mat-horizontal-stepper-header,.mat-vertical-stepper-header {padding: 24px 0;} .mat-horizontal-content-container {padding: 0;}}}"]}),n})();var Fn=d(63769),Rn=d(80144);function Tm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",20),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).clearFilter()}),e.\u0275\u0275elementEnd()}}const Mi=function(n){return[n]};function Im(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",21),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).new()}),e.\u0275\u0275element(1,"app-mark-permissions",22),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("textContent","Add New Location")("permissionColoredContent",!1)("permissions",e.\u0275\u0275pureFunction1(3,Mi,t.UsersPermissions.advanced_config))}}function Pm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",23)(2,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).moveAll()}),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",25)(5,"mat-icon",26),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).selectedPlace=null}),e.\u0275\u0275text(6,"cancel "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"mat-icon",27),e.\u0275\u0275text(8," info "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate3("Move All Indoor Locations to ",null==t.selectedPlace?null:t.selectedPlace.name," (",t.countMovedLocation," /",null==t.locationsServices?null:t.locationsServices.indoorLocations.length,") "),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","cancel"),e.\u0275\u0275advance(2),e.\u0275\u0275property("matTooltip","Click the orange button to move all locations of this place (listed below) or use the gear menu per row to move selected locations. Reference devices will not be moved.")}}function km(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"button",28),e.\u0275\u0275text(1,"Move Locations "),e.\u0275\u0275elementEnd()),2&n){e.\u0275\u0275nextContext();const t=e.\u0275\u0275reference(14);e.\u0275\u0275property("matMenuTriggerFor",t)}}function Mm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",24),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).openConnectMonitorDialog()}),e.\u0275\u0275text(1," Connect a Monitor "),e.\u0275\u0275elementEnd()}}function Am(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",24),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.helpService.openHelpDialog(a.HelpSection.locations,"Locations Administration")}),e.\u0275\u0275text(1," Help "),e.\u0275\u0275elementEnd()}}function Dm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"button",29)(1,"mat-icon",30),e.\u0275\u0275text(2,"more_vert"),e.\u0275\u0275elementEnd()()),2&n){e.\u0275\u0275nextContext();const t=e.\u0275\u0275reference(11);e.\u0275\u0275property("matMenuTriggerFor",t)}}function Om(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"button",33),e.\u0275\u0275text(1," Move Locations "),e.\u0275\u0275elementEnd()),2&n){e.\u0275\u0275nextContext(2);const t=e.\u0275\u0275reference(14);e.\u0275\u0275property("matMenuTriggerFor",t)}}function Lm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",31),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).new()}),e.\u0275\u0275element(1,"app-mark-permissions",22),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(2,Om,2,1,"button",32),e.\u0275\u0275elementStart(3,"button",31),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).openConnectMonitorDialog()}),e.\u0275\u0275text(4," Connect a Monitor "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",31),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.helpService.openHelpDialog(a.HelpSection.locations,"Locations Administration")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("textContent","Add New Location")("permissionColoredContent",!1)("permissions",e.\u0275\u0275pureFunction1(4,Mi,t.UsersPermissions.advanced_config)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.locationsServices||null==t.locationsServices.allLocations?null:t.locationsServices.allLocations.length)>0&&(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin))}}function Fm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",31),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.selectedPlace=r,l.clearFilter()}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.name)}}function Rm(n,o){if(1&n&&e.\u0275\u0275element(0,"app-progress-bar",34),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("show",!t.locationsServices.allLocations)}}function Nm(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",35)}function Vm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Location ID"),e.\u0275\u0275elementEnd())}function Hm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",59),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",t.id)}}function jm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Location"),e.\u0275\u0275elementEnd())}function Bm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",63),e.\u0275\u0275text(1,"warning "),e.\u0275\u0275elementEnd())}function Gm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",60),e.\u0275\u0275template(1,Bm,2,0,"mat-icon",61),e.\u0275\u0275elementStart(2,"app-interactive-table-cell",62),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(3).openLocationMonitorInfo(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.anomalies?null:t.anomalies.length)>0),e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!1)("customWidth","fit-content")("value",t.name)}}function zm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",64),e.\u0275\u0275text(1," Admin "),e.\u0275\u0275elementEnd())}const $m=function(n){return{row:n}};function Um(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"button",68)(2,"mat-icon",69),e.\u0275\u0275text(3,"settings"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275nextContext(2);const i=e.\u0275\u0275reference(22),a=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275classProp("spinner",a.loading==t.id),e.\u0275\u0275property("matMenuTriggerFor",i)("matMenuTriggerData",e.\u0275\u0275pureFunction1(4,$m,t))}}function Wm(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",70),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).openLocationMonitorInfo(a)}),e.\u0275\u0275elementStart(1,"mat-icon",69),e.\u0275\u0275text(2,"settings"),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext(3);e.\u0275\u0275classProp("spinner",i.loading==t.id)}}function Qm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",65),e.\u0275\u0275template(1,Um,4,6,"ng-container",66),e.\u0275\u0275template(2,Wm,3,2,"ng-template",null,67,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275reference(3),i=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.selectedPlace)("ngIfElse",t)}}function qm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Public"),e.\u0275\u0275elementEnd())}function Km(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275element(1,"app-status-indicator",71),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.public)}}function Ym(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Indoors"),e.\u0275\u0275elementEnd())}function Xm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275element(1,"app-status-indicator",71),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.indoor)}}function Zm(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Reporting"),e.\u0275\u0275elementEnd())}function Jm(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275element(1,"app-status-indicator",71),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.controlled)}}function ed(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Active"),e.\u0275\u0275elementEnd())}function td(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275element(1,"app-status-indicator",71),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.active)}}
1function nd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Monitor Serial No."),e.\u0275\u0275elementEnd())}function id(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",72),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"slice"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("matTooltip",t.sensor_uid),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",(null==t.sensor_uid?null:t.sensor_uid.length)>40?e.\u0275\u0275pipeBind3(2,2,t.sensor_uid,0,40)+"..":t.sensor_uid," ")}}function ad(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Group"),e.\u0275\u0275elementEnd())}function od(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.group_name,"")}}function rd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"LED Mode"),e.\u0275\u0275elementEnd())}function ld(n,o){1&n&&(e.\u0275\u0275element(0,"td",73),e.\u0275\u0275pipe(1,"getMeasureName")),2&n&&e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind1(1,1,o.$implicit.led_mode),e.\u0275\u0275sanitizeHtml)}function sd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",57),e.\u0275\u0275text(1,"Notes"),e.\u0275\u0275elementEnd())}function cd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",58)(1,"span",74),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.notes," ")}}function pd(n,o){1&n&&e.\u0275\u0275element(0,"tr",75)}function md(n,o){1&n&&e.\u0275\u0275element(0,"tr",76)}function dd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",36),e.\u0275\u0275elementContainerStart(1,37),e.\u0275\u0275template(2,Vm,2,0,"th",38),e.\u0275\u0275template(3,Hm,3,2,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,40),e.\u0275\u0275template(5,jm,2,0,"th",38),e.\u0275\u0275template(6,Gm,3,4,"td",41),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,42),e.\u0275\u0275template(8,zm,2,0,"th",43),e.\u0275\u0275template(9,Qm,4,2,"td",44),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,45),e.\u0275\u0275template(11,qm,2,0,"th",38),e.\u0275\u0275template(12,Km,2,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,46),e.\u0275\u0275template(14,Ym,2,0,"th",38),e.\u0275\u0275template(15,Xm,2,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,47),e.\u0275\u0275template(17,Zm,2,0,"th",38),e.\u0275\u0275template(18,Jm,2,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,48),e.\u0275\u0275template(20,ed,2,0,"th",38),e.\u0275\u0275template(21,td,2,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,49),e.\u0275\u0275template(23,nd,2,0,"th",38),e.\u0275\u0275template(24,id,3,6,"td",50),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,51),e.\u0275\u0275template(26,ad,2,0,"th",38),e.\u0275\u0275template(27,od,2,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,52),e.\u0275\u0275template(29,rd,2,0,"th",38),e.\u0275\u0275template(30,ld,2,3,"td",53),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,54),e.\u0275\u0275template(32,sd,2,0,"th",38),e.\u0275\u0275template(33,cd,3,1,"td",39),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(34,pd,1,0,"tr",55),e.\u0275\u0275template(35,md,1,0,"tr",56),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(34),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function ud(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",31),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().row;return e.\u0275\u0275nextContext(2).move(a)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Move Location to ",null==t.selectedPlace?null:t.selectedPlace.name," ")}}function _d(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",31),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).row;return e.\u0275\u0275nextContext(2).openLocationMonitorInfo(r)}),e.\u0275\u0275text(1,"Go to location details"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(2,ud,2,1,"button",77)}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.selectedPlace)}}function fd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",78),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}function hd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",79),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t.locationsServices||null==t.locationsServices.allLocations?null:t.locationsServices.allLocations.length," Locations ")}}function gd(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-sub-header",1),e.\u0275\u0275template(2,Tm,1,0,"app-table-filter-search",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275template(4,Im,2,5,"button",4),e.\u0275\u0275template(5,Pm,9,5,"ng-container",0),e.\u0275\u0275template(6,km,2,1,"button",5),e.\u0275\u0275template(7,Mm,2,0,"button",6),e.\u0275\u0275template(8,Am,2,0,"button",6),e.\u0275\u0275template(9,Dm,3,1,"button",7),e.\u0275\u0275elementStart(10,"mat-menu",null,8),e.\u0275\u0275template(12,Lm,7,6,"ng-template",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"mat-menu",null,10),e.\u0275\u0275template(15,Fm,2,1,"button",11),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(16,"section",12),e.\u0275\u0275template(17,Rm,1,1,"app-progress-bar",13),e.\u0275\u0275elementStart(18,"div",14),e.\u0275\u0275template(19,Nm,1,0,"app-no-data",15),e.\u0275\u0275template(20,dd,36,4,"table",16),e.\u0275\u0275elementStart(21,"mat-menu",null,17),e.\u0275\u0275template(23,_d,3,1,"ng-template",9),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(24,fd,1,2,"mat-paginator",18),e.\u0275\u0275template(25,hd,2,1,"div",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",t.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.selectedPlace&&t.canManageLocations&&t.isDesktop),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.selectedPlace),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.selectedPlace&&(null==t.locationsServices||null==t.locationsServices.allLocations?null:t.locationsServices.allLocations.length)>0&&(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)&&t.isDesktop),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.selectedPlace&&t.canManageLocations&&t.isDesktop),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.selectedPlace||t.isDesktop||!t.canManageLocations),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.selectedPlace&&t.canManageLocations&&!t.isDesktop),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngForOf",t.places.places),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.locationsServices.allLocations),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!t.isTableEmpty&&t.locationsServices.allLocations),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty&&t.locationsServices.allLocations)}}let vd=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B,j,q,J){this.locationsServices=t,this.places=i,this.dialogService=a,this.dialog=r,this.user=l,this.groupsServices=f,this.dataServices=w,this.httpHelper=T,this._messageService=M,this.localStore=B,this.sensorServices=j,this.helpService=q,this.router=J,this.UsersPermissions=it.S,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.displayedColumns=[],this.filterValue="",this.loading=null,this.HelpSection=Z.L,this.destroy$=new H.xQ,this.countMovedLocation=0,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(ge=>{"locations_load_single"===ge&&(this.dataSource=new h.by(null==t?void 0:t.allLocations),this.isTableEmpty=0===this.dataSource.data.length,this.dataSource.filterPredicate=(fe,Le)=>{const qe=[],Pe=Le.split(","),lt=[fe.name,fe.sensor_uid,fe.id,fe.notes,fe.group_name];return Pe.forEach(Ke=>{const Rt=[];lt.forEach(wt=>{var st;return Rt.push(null===(st=null==wt?void 0:wt.toString())||void 0===st?void 0:st.toLowerCase().includes(Ke))}),qe.push(Rt.some(Boolean))}),qe.every(Boolean)},this.applyFilter(),this.groupsServices.getGroups(this.places.currentPlace.id),this.sensorServices.getSensors(this.places.currentPlace.id),this.selectedPlace=null),"location_added"===ge&&(this.dialog.closeAll(),this.clearFilter(),this.sensorServices.getSensors(this.places.currentPlace.id)),"location_saved"===ge&&(this.dialog.closeAll(),this.sensorServices.getSensors(this.places.currentPlace.id)),"location_deleted"===ge&&this.sensorServices.getSensors(this.places.currentPlace.id),"sensor_deleted"===ge&&this.locationsServices.getLocations(this.places.currentPlace.id,!1)})}set matPaginator(t){this.dataSource&&(this.dataSource.paginator=t)}set matSort(t){this.dataSource&&(this.dataSource.sort=t)}get canManageLocations(){var t,i,a,r;return!(!(null===(i=null===(t=this.places)||void 0===t?void 0:t.currentPlace)||void 0===i?void 0:i.advanced_config)&&!(null===(r=null===(a=this.user)||void 0===a?void 0:a.currentUser)||void 0===r?void 0:r.admin))}get isDesktop(){return window.innerWidth>n.DESKTOP_MIN_WIDTH}ngOnInit(){var t;this.dataServices.currentScreen="Locations Administration",this.displayedColumns=0==this.onboarding?["name","admin"]:["id","name","public","indoor","controlled","active","sensor_uid","group_name","led_mode","notes","admin"],this.locationsServices.allLocations=null,(null===(t=this.places.currentPlace)||void 0===t?void 0:t.id)?this.locationsServices.getLocations(this.places.currentPlace.id,!1):this.places.currentPlaceSubject$.pipe((0,A.R)(this.destroy$)).subscribe(i=>{i&&this.locationsServices.getLocations(null==i?void 0:i.id,!1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}savePagination(t){this.localStore.saveData("paginationLocations",t.pageSize)}getPagination(){return this.localStore.getData("paginationLocations")||"500"}openConnectMonitorDialog(){const t=this.dialog.open(Em,{disableClose:!1});this.dialogService.setFullScreenDialog(t,{desktopWidth:"900px",desktopHeight:"auto"})}
1edit(t){this.loading=t.id,this.openLocationMonitorInfo(t)}openLocationMonitorInfo(t){this.loading=t.id,this.router.navigate(["/settings/locations",t.id],{state:{anomalies:t.anomalies}}),this.loading=null}new(){this.matDialogRef=this.dialog.open(Pi.s,{data:{loc:null,ob:this.onboarding}}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}move(t){t.place_id=this.selectedPlace.id,this.httpHelper.put("/places/"+this.places.currentPlace.id+"/locations/"+t.id,t).subscribe(i=>{},i=>{this.httpHelper.handleHttpErrorMessage(i)},()=>{this.httpHelper.showSnackbar("Successfully saved")})}moveAll(){this.countMovedLocation=0,this.dialog.open(he.$,{width:"350px",data:"Important: Only moves indoor locations. Associated alarms, PPS controllers will not be moved. In case you have any questions, please contact support. Are you sure you want to move all monitor locations? "}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i?this.moveAllNow():this.selectedPlace=null})}moveAllNow(){var t;for(const i of null===(t=this.locationsServices)||void 0===t?void 0:t.allLocations)i.indoor&&(this.dataServices.allReferences.indexOf(i.name)>-1?this.count():(i.place_id=this.selectedPlace.id,this.httpHelper.put("/places/"+this.places.currentPlace.id+"/locations/"+i.id,i).subscribe(a=>{this.count()},a=>{this.count(),this.httpHelper.handleHttpErrorMessage(a,{401:"Not authorized. Please ensure you have administrator rights on the receiving place."})})))}count(){this.countMovedLocation++,this.countMovedLocation>=this.locationsServices.indoorLocations.length&&this.locationsServices.getLocations(this.places.currentPlace.id,!1)}applyFilter(t=this.filterValue){var i,a;this.filterValue=t.trim().toLowerCase(),this.dataSource.filter=this.filterValue,null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage()}clearFilter(){this.dataSource&&(this.filterValue="",this.dataSource.filter="")}goToAdvancedMonitorSettings(t){var i,a;this.loading=t.id,this.locationsServices.getEditLocationsRequest(t.id,t.sensor_id,null===(a=null===(i=this.places)||void 0===i?void 0:i.currentPlace)||void 0===a?void 0:a.id).subscribe(r=>{this.matDialogRef=this.dialog.open(ki._,{data:{location:r.location,monitor:r.sensor,rowData:t}}),this.loading=null,this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"90vw",desktopHeight:"auto"})},r=>{this.httpHelper.handleHttpErrorMessage(r)})}checkPremiumLocationDeleteToBeRejected(t){return!1}}return n.DESKTOP_MIN_WIDTH=992,n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(y.F0))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-location"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matPaginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matSort=a.first)}},inputs:{onboarding:"onboarding"},decls:2,vars:3,consts:[[4,"ngIf"],[3,"justifyContent"],["label","Search Locations","placeholder","Enter Location",3,"applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-button","","class","button-primary","type","button",3,"click",4,"ngIf"],["mat-button","","class","button-secondary","type","button",3,"matMenuTriggerFor",4,"ngIf"],["mat-button","","class","button-secondary","type","button",3,"click",4,"ngIf"],["mat-icon-button","",3,"matMenuTriggerFor",4,"ngIf"],["mobileMenu","matMenu"],["matMenuContent",""],["moveMenu","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],[1,"in-page-section-wrapper"],["style","width: 100%",3,"show",4,"ngIf"],[1,"ag-table-wrapper"],["message","locations",4,"ngIf"],["class","ag-table-main locations","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["adminMenu","matMenu"],["class","full-width",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["class","counter","style","margin: 16px",4,"ngIf"],["label","Search Locations","placeholder","Enter Location",3,"applyFilter","clearFilter"],["mat-button","","type","button",1,"button-primary",3,"click"],[3,"textContent","permissionColoredContent","permissions"],["fxLayout","row","fxLayoutAlign","center center"],["mat-button","","type","button",1,"button-secondary",3,"click"],["mat-icon-button","","type","button",2,"color","slategray"],["appMatTooltipToggleMechanism","",3,"matTooltip","click"],["appMatTooltipToggleMechanism","",2,"color","slategray",3,"matTooltip"],["mat-button","","type","button",1,"button-secondary",3,"matMenuTriggerFor"],["mat-icon-button","",3,"matMenuTriggerFor"],["color","primary"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"matMenuTriggerFor",4,"ngIf"],["mat-menu-item","",3,"matMenuTriggerFor"],[2,"width","100%",3,"show"],["message","locations"],["mat-table","","matSort","",1,"ag-table-main","locations",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","admin"],["mat-header-cell","",4,"matHeaderCellDef"],["class","text-center","mat-cell","",4,"matCellDef"],["matColumnDef","public"],["matColumnDef","indoor"],["matColumnDef","controlled"],["matColumnDef","active"],["matColumnDef","sensor_uid"],["mat-cell","","appMatTooltipToggleMechanism","",3,"matTooltip",4,"matCellDef"],["matColumnDef","group_name"],["matColumnDef","led_mode"],["mat-cell","",3,"innerHTML",4,"matCellDef"],["matColumnDef","notes"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","main-table-row","mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["size","small",3,"copyValue"],["mat-cell","",1,"zoom-td"],["class","warning-icon",4,"ngIf"],[3,"isLocationName","customWidth","value","cellClick"],[1,"warning-icon"],["mat-header-cell",""],["mat-cell","",1,"text-center"],[4,"ngIf","ngIfElse"],["adminNavigate",""],["mat-icon-button","","type","button",3,"matMenuTriggerFor","matMenuTriggerData"],[2,"font-size","22px"],["mat-icon-button","","type","button",3,"click"],[3,"value"],["mat-cell","","appMatTooltipToggleMechanism","",3,"matTooltip"],["mat-cell","",3,"innerHTML"],[1,"table-cell-notes-wrapper"],["mat-header-row",""],["mat-row","",1,"main-table-row"],["mat-menu-item","",3,"click",4,"ngIf"],[1,"full-width",3,"pageSize","pageSizeOptions","page"],[1,"counter",2,"margin","16px"]],template:function(t,i){1&t&&(e.\u0275\u0275template(0,gd,26,14,"
1ng-container",0),e.\u0275\u0275pipe(1,"async")),2&t&&e.\u0275\u0275property("ngIf",i.places.currentPlace||e.\u0275\u0275pipeBind1(1,1,i.places.currentPlaceSubject$))},directives:[u.NgIf,ae.$,$e.n,z.lW,dt.S,V.xw,V.Wh,Q.Hw,Fn.P,Ue.gM,W.p6,W.VK,W.KA,W.OP,u.NgForOf,ot.R,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,Ct.T,kn.w,h.as,h.XQ,h.nj,h.Gk,Ce.NW],pipes:[u.AsyncPipe,u.SlicePipe,Rn.x],styles:["@media (max-width: 991px){th[_ngcontent-%COMP%]{top:-1px!important}.ag-table-wrapper[_ngcontent-%COMP%]{max-height:calc(100vh - 300px)}}"]}),n})();var Ai=d(65218),cn=d(9224),Di=d(91094);const Cd=function(){return["email"]},bd=function(n){return{email:n}};let xd=(()=>{class n{constructor(t,i){this.permissionServices=t,this.userService=i,this.AuthFormMode=Ai.G}handleFormSubmit(t){this.userService.currentUser.currentCredentials.password=t.password,this.userService.currentUser.currentCredentials.email=t.email||this.userService.currentUser.currentCredentials.email,this.userService.currentUser.newPassword=t.newPassword,this.permissionServices.changePassword(this.userService.currentUser)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(kt.J),e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-page-change-password"]],decls:5,vars:7,consts:[["fxLayoutAlign","space-around center",1,"page"],[1,"auth-card"],["fxLayout","column","fxLayoutAlign","center center",1,"wrapper"],["submitButtonText","Submit","title","Change Password",3,"disabledFields","preFillData","mode","showNameField","formSubmit"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"mat-card",1)(2,"mat-card-content")(3,"div",2)(4,"app-auth-form",3),e.\u0275\u0275listener("formSubmit",function(r){return i.handleFormSubmit(r)}),e.\u0275\u0275elementEnd()()()()()),2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275property("disabledFields",e.\u0275\u0275pureFunction0(4,Cd))("preFillData",e.\u0275\u0275pureFunction1(5,bd,i.userService.currentUser.currentCredentials.email))("mode",i.AuthFormMode.changePassword)("showNameField",!1))},directives:[V.Wh,cn.a8,cn.dn,V.xw,Di.c],styles:["app-auth-form[_ngcontent-%COMP%]{width:100%;max-width:700px}"]}),n})();var yd=d(31307),Dt=d(89306),Sd=d(9910),wd=d(50457),Nn=d(21267),Vn=d(79387),Hn=d(63186),Ed=d(29269);function Oi(n){return n.replace(/^\{/,"").replace(/\}$/,"")}var Id=d(97923),Pd=d(93737),jn=d(42795),Md=d(28722),Ad=d(60050);function Dd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"button",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.retrieveTestReport(null==a.sensor?null:a.sensor.location_id,null==a.sensor?null:a.sensor.id)}),e.\u0275\u0275elementStart(2,"span",13),e.\u0275\u0275text(3,"Retrieve Factory Test Report"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"span",14),e.\u0275\u0275text(5,"Factory Test Report"),e.\u0275\u0275elementEnd()()()}}function Od(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"button",12),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.retrieveTestReport(null==a.sensor?null:a.sensor.location_id,null==a.sensor?null:a.sensor.id)}),e.\u0275\u0275elementStart(2,"span",13),e.\u0275\u0275text(3,"Retrieve Factory Test Report"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"span",14),e.\u0275\u0275text(5,"Factory Test Report"),e.\u0275\u0275elementEnd()()()}}function Ld(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,Dd,6,0,"div",2),e.\u0275\u0275template(2,Od,6,0,"div",2),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!(null!=t.sensor&&null!=t.sensor.test_report&&t.sensor.test_report.testReportVersion||"Pass"!==(null==t.sensor||null==t.sensor.test_report||null==t.sensor.test_report.testData?null:t.sensor.test_report.testData.overallPass)&&"Limited Pass"!==(null==t.sensor||null==t.sensor.test_report||null==t.sensor.test_report.testData?null:t.sensor.test_report.testData.overallPass))),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.sensor||null==t.sensor.test_report?null:t.sensor.test_report.testReportVersion)>=2)}}function Fd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",4),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().openAnalytics()}),e.\u0275\u0275elementStart(1,"span",13),e.\u0275\u0275text(2,"Open Analytics"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"span",14),e.\u0275\u0275text(4,"Analytics"),e.\u0275\u0275elementEnd()()}}function Rd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"app-outdated-firmware-banner"),e.\u0275\u0275elementEnd())}function Nd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",15)(1,"app-warning-message",16),e.\u0275\u0275elementContainerStart(2,17),e.\u0275\u0275elementStart(3,"p",18)(4,"mat-icon",19),e.\u0275\u0275text(5,"info_outline"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"b"),e.\u0275\u0275text(7,"No monitor selected"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"br")(9,"br"),e.\u0275\u0275text(10," This page was opened without a monitor. Please select a monitor to view full details. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}function Vd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"app-warning-message",16),e.\u0275\u0275elementContainerStart(1,17),e.\u0275\u0275elementStart(2,"p",18)(3,"mat-icon",19),e.\u0275\u0275text(4,"info_outline"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"span"),e.\u0275\u0275text(6," Monitor model not set, limited configuration. Please set the correct model. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275property("isAccentWarning",!0)}function Hd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"app-warning-message",16),e.\u0275\u0275elementContainerStart(2,17),e.\u0275\u0275elementStart(3,"p",18)(4,"mat-icon",19),e.\u0275\u0275text(5,"warning"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"b"),e.\u0275\u0275text(7,"PM Module Problem Detected:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(8," Analysis of the monitor readings indicates that the Felipe phenomenon was detected. This PM module problem refers to a
1sudden and unrealistic increase in PM"),e.\u0275\u0275elementStart(9,"sub"),e.\u0275\u0275text(10,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11," readings\u2014typically a jump of around 1000 \xb5g/m\xb3 within an hour\u2014followed by very stable high values, often around 1500 \xb5g/m\xb3, that appear as a flat line on a graph. These elevated readings can last for hours, days, or even weeks, sometimes briefly dropping before spiking again. The cause is unknown and the reported values are not realistic and should not be used to assess air quality. Please contact our "),e.\u0275\u0275elementStart(12,"a",20),e.\u0275\u0275text(13," our support team "),e.\u0275\u0275elementStart(14,"mat-icon"),e.\u0275\u0275text(15,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(16,". "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}function jd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,Hd,17,1,"div",2),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isFelipeDetected)}}function Bd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," PM"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" (",t.dataService.pmInMG?"\u03bcg/m\xb3":"US AQI",") ")}}function Gd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.dataService.pmInMG?l.openDialog("pm02","PM<sub>2.5</sub> (\u03bcg/m\xb3)",r):l.openDialog("pi02","PM<sub>2.5</sub> (US AQI)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(i.dataService.pmInMG?t.pm02_clr:t.pi02_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,i.dataService.pmInMG?null==t.measures_current?null:t.measures_current.pm02:t.pi02,"1.0-2",i.browserLocaleService.globalLocale))}}function zd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," PM"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"0.3"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," Count "),e.\u0275\u0275elementEnd()())}function $d(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("pm003_count","PM<sub>0.3</sub> Count",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.pm003_count,"1.0-2",i.browserLocaleService.globalLocale))}}function Ud(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," PM"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"1"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd()())}function Wd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("pm01","PM<sub>1</sub> (\u03bcg/m\xb3)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.pm01,"1.0-2",i.browserLocaleService.globalLocale))}}function Qd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," PM"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"10"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd()())}function qd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("pm10","PM<sub>10</sub> (\u03bcg/m\xb3)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.pm10,"1.0-2",i.browserLocaleService.globalLocale))}}function Kd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," CO"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," (ppm) "),e.\u0275\u0275elementEnd()())}function Yd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("rco2","CO<sub>2</sub> in ppm",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(t.rco2_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,null==t.measures_current?null:t.measures_current.rco2,"1.0-2",i.browserLocaleService.globalLocale))}}function Xd(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2,"GO AQS"),e.\u0275\u0275elementEnd()())}function Zd(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.openDialog(l.GO_AQS_MEASURE,"GO AQS",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(t.go_aqs_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,t.go_aqs,"1.0-0",i.browserLocaleService.globalLocale))}}function Jd(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Temp. (",t.dataService.getTempMetricLabel(),") ")}}const eu=function(){return[null,void 0]};function tu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.openDialog("atmp","Temperature in "+l.dataService.getTempMetricLabel(),r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275pipe(3,"temperature"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pureFunction0(9,eu).includes(null==t.measures_current?null:t.measures_current.atmp)?void 0:e.\u0275\u0275pipeBind3(2,2,e.\u0275\u0275pipeBind2(3,6,null==t.measures_current?null:t.measures_current.atmp,i.dataService.tempInF),"1.0-2",i.browserLocaleService.globalLocale))}}function nu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"R. Hum. (%)"),e.\u0275\u0275elementEnd())}function iu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("rhum","Relative Humidity in %",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.rhum,"1.0-2",i.browserLocaleService.globalLocale))}}function au(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Heat (\xb0C)"),e.\u0275\u0275elementEnd())}function ou(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("heatindex","Heat Index",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(t.heatindex_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,null==t.measures_current?null:t.measures_current.heatindex,"1.0-2",i.browserLocaleService.globalLocale))}}function ru(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"TVOC (ppb)"),e.\u0275\u0275elementEnd())}function lu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("tvoc","TVOC (ppb)",r)}
1),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.tvoc,"1.0-2",i.browserLocaleService.globalLocale))}}function su(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"TVOC (Ind40)"),e.\u0275\u0275elementEnd())}function cu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("tvoc_index","TVOC (Ind40)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(t.tvoc_index_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,null==t.measures_current?null:t.measures_current.tvoc_index,"1.0-2",i.browserLocaleService.globalLocale))}}function pu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"TVOC (ticks)"),e.\u0275\u0275elementEnd())}function mu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("tvoc_raw","TVOC (ticks)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.tvoc_raw,"1.0-0",i.browserLocaleService.globalLocale))}}function du(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," NO"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"x"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5,"(Ind41) "),e.\u0275\u0275elementEnd()())}function uu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",50),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("nox_index","NO<sub>x</sub>(Ind41)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("markerBarColor",i.colorsServices.getColorOpen(t.nox_index_clr))("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,3,null==t.measures_current?null:t.measures_current.nox_index,"1.0-2",i.browserLocaleService.globalLocale))}}function _u(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48)(1,"span"),e.\u0275\u0275text(2," NO"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"x"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," (ticks) "),e.\u0275\u0275elementEnd()())}function fu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("nox_raw","NO<sub>x</sub> (ticks)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.nox_raw,"1.0-0",i.browserLocaleService.globalLocale))}}function hu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"VBat (Volt)"),e.\u0275\u0275elementEnd())}function gu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",52),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("volt","Battery Voltage (Volt)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("markerBarColor",i.colorsServices.getColorOpen(t.volt_clr))("value",e.\u0275\u0275pipeBind3(2,3,null==t.measures_current?null:t.measures_current.volt,"1.0-2",i.browserLocaleService.globalLocale))}}function vu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"VPanel (Volt)"),e.\u0275\u0275elementEnd())}function Cu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("light","Solar Panel Voltage (Volt)",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.light,"1.0-2",i.browserLocaleService.globalLocale))}}function bu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Signal (dBm)"),e.\u0275\u0275elementEnd())}function xu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",49)(1,"app-interactive-table-cell",51),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).openDialog("wifi","Signal Strength in dBm",r)}),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isOffline",t.offline)("value",e.\u0275\u0275pipeBind3(2,2,null==t.measures_current?null:t.measures_current.wifi,"1.0-2",i.browserLocaleService.globalLocale))}}function yu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",48),e.\u0275\u0275text(1,"Last Update"),e.\u0275\u0275elementEnd())}function Su(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275pipe(3,"date"),e.\u0275\u0275pipe(4,"date"),e.\u0275\u0275pipe(5,"date"),e.\u0275\u0275pipe(6,"date"),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.currentTimeStamp-t.measures_current.date<864e5?e.\u0275\u0275pipeBind2(2,1,t.measures_current.date,"HH:mm:ss"):e.\u0275\u0275pipeBind2(3,4,t.measures_current.date,"y")!==e.\u0275\u0275pipeBind2(4,7,i.currentTimeStamp,"y")?e.\u0275\u0275pipeBind2(5,10,t.measures_current.date,"MMM d, y, HH:mm"):e.\u0275\u0275pipeBind2(6,13,t.measures_current.date,"MMM d, HH:mm")," ")}}function wu(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",55),e.\u0275\u0275text(1," \u2500 "),e.\u0275\u0275elementEnd())}function Eu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",49),e.\u0275\u0275template(1,Su,7,16,"ng-container",53),e.\u0275\u0275template(2,wu,2,0,"ng-template",null,54,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.measures_current?null:t.measures_current.date)("ngIfElse",i)}}function Tu(n,o){1&n&&e.\u0275\u0275element(0,"tr",56)}const Iu=function(n){return{"opacity-50":n}};function Pu(n,o){1&n&&e.\u0275\u0275element(0,"tr",57),2&n&&e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(1,Iu,o.$implicit.offline))}const ku=function(n){return[n]};function Mu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",21)(1,"div",1),e.\u0275\u0275element(2,"mat-icon",22),e.\u0275\u0275elementStart(3,"h3",23),e.\u0275\u0275text(4,"Current Data"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(5,"div",24)(6,"table",25),e.\u0275\u0275elementContainerStart(7,26),e.\u0275\u0275template(8,Bd,6,1,"th",27),e.\u0275\u0275template(9,Gd,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,29),e.\u0275\u0275template(11,zd,6,0,"th",27),e.\u0275\u0275template(12,$d,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,30),e.\u0275\u0275template(14,Ud,6,0,"th",27),e.\u0275\u0275template(15,Wd,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,31),e.\u0275\u0275template(17,Qd,6,0,"th",27),e.\u0275\u0275template(18,qd,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,32),e.\u0275\u0275template(20,Kd,6,0,"th",27),e.\u0275\u0275template(21,Yd,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,33),e.\u0275\u0275template(23,Xd,3,0,"th",27),e.\u0275\u0275template(24,Zd,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,34),e.\u0275\u0275template(26,Jd,2,1,"th",27),e.\u0275\u0275template(27,tu,4,10,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,35),e.\u0275\u0275template(29,nu,2,0,"th",27),e.\u0275\u0275template(30,iu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,36),e.\u0275\u0275template(32,au,2,0,"th",27),e.\u0275\u0275template(33,ou,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(34,37),e.\u0275\u0275template(35,ru,2,0,"th",27),e.\u0275\u0275template(36,lu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(37,38),e.\u0275\u0275template(38,su,2,0,"th",27),e.\u0275\u0275template(39,cu,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(40,39),e.\u0275\u0275template(41,pu,2,0,"th",27),e.\u0275\u0275template(42,mu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(43,40),e.\u0275\u0275template(44,du,6,0,"th",27),e.\u0275\u0275template(45,uu,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(46,41),e.\u0275\u0275template(47,_u,6,0,"th",27),e.\u0275\u0275template(48,fu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(49,42),e.\u0275\u0275template(50,hu,2,0,"th",27),e.\u0275\u0275template(51,gu,3,7,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(52,43),e.\u0275\u0275template(53,vu,2,0,"th",27),e.\u0275\u0275template(54,Cu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(55,44),e.\u0275\u0275template(56,bu,2,0,"th",27),e.\u0275\u0275template(57,xu,3,6,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(58,45),e.\u0275\u0275template(59,yu,2,0,"th",27),e.\u0275\u0275template(60,Eu,4,2,"td",28),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(61,Tu,1,0,"tr",46),e.\u0275\u0275template(62,Pu,1,3,"tr",47),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(6),e.\u0275\u0275property("dataSource",e.\u0275\u0275pureFunction1(3,ku,t.location)),e.\u0275\u0275advance(55),e.\u0275\u0275property("matHeaderRowDef",t.currentDataColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.currentDataColumns)}}function Au(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",61),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Location ID: ",null==t.location?null:t.location.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",null==t.location?null:t.location.id)}}function Du(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Location Name: ",(null==t.location?null:t.location.name)||(null==t.location?null:t.location.location_name)," ")}}function Ou(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Location Notes: ",null==t.location?null:t.location.notes," ")}}function Lu(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",62)(1,"button",63),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).editLocation()}),e.\u0275\u0275text(2," Edit Location "),e.\u0275\u0275elementEnd()()}}function Fu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"h3",23)(2,"mat-icon",59),e.\u0275\u0275text(3,"location_on"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Location Information"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Au,3,2,"div",2),e.\u0275\u0275template(6,Du,2,1,"div",2),e.\u0275\u0275template(7,Ou,2,1,"div",2),e.\u0275\u0275template(8,Lu,3,0,"div",60),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",null==t.location?null:t.location.id),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.location?null:t.location.name)||(null==t.location?null:t.location.location_name)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.location?null:t.location.notes),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.location?null:t.location.id)&&(null==t.placeService.currentPlace||null==t.placeService.currentPlace.permissions?null:t.placeService.currentPlace.permissions.settings))}}function Ru(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.PLANTOWER_CORRECTION_OPTIONS_CONFIG[t.PlantowerPMCorrectionOptions.epa_2021].label," ")}}function Nu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1," PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Calibration Formulas Applied: "),e.\u0275\u0275elementStart(5,"ul",65)(6,"li"),e.\u0275\u0275element(7,"span",66),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(8,Ru,2,1,"li",2),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(7),e.\u0275\u0275property("innerHTML",t.plantowerPMCorrectionAlgo.label,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.sensor?null:t.sensor.pm2_slr_use_epa_2021)&&(null==t.plantowerPMCorrectionAlgo?null:t.plantowerPMCorrectionAlgo.value)!==t.PlantowerPMCorrectionOptions.epa_2021&&(null==t.plantowerPMCorrectionAlgo?null:t.plantowerPMCorrectionAlgo.value)!==t.PlantowerPMCorrectionOptions.none&&(null==t.plantowerPMCorrectionAlgo?null:t.plantowerPMCorrectionAlgo.value)!==t.PlantowerPMCorrectionOptions.factory_calibration)}}function Vu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1," Temperature Calibration Formula Applied: "),e.\u0275\u0275elementStart(2,"ul",65)(3,"li"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.tempCorrectionAlgo.label," ")}}function Hu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1," Humidity Calibration Formula Applied: "),e.\u0275\u0275elementStart(2,"ul",65)(3,"li"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.humCorrectionAlgo.label," ")}}function ju(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1," CO"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Calibration Request in Progress "),e.\u0275\u0275elementEnd())}function Bu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u
10275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Automatic Baseline Calibration Duration: ",null==t.location?null:t.location.automatic_baseline_calibration_days," d ")}}function Gu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" TVOC Learning Time Offset: ",null==t.location?null:t.location.tvoc_learning_time_offset_h," h ")}}function zu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" NOx Learning Time Offset: ",null==t.location?null:t.location.nox_learning_time_offset_h," h ")}}function $u(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",62)(1,"button",63),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).goToAdvancedMonitorSettings()}),e.\u0275\u0275text(2," Edit Calibration "),e.\u0275\u0275elementEnd()()}}function Uu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"h3",23),e.\u0275\u0275element(2,"mat-icon",64),e.\u0275\u0275text(3," Calibration Information"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,Nu,9,2,"div",2),e.\u0275\u0275template(5,Vu,5,1,"div",2),e.\u0275\u0275template(6,Hu,5,1,"div",2),e.\u0275\u0275template(7,ju,5,0,"div",2),e.\u0275\u0275template(8,Bu,2,1,"div",2),e.\u0275\u0275template(9,Gu,2,1,"div",2),e.\u0275\u0275template(10,zu,2,1,"div",2),e.\u0275\u0275template(11,$u,3,0,"div",60),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",t.plantowerPMCorrectionAlgo),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.tempCorrectionAlgo),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.humCorrectionAlgo),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.co2_calibration),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!=(null==t.location?null:t.location.automatic_baseline_calibration_days)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!=(null==t.location?null:t.location.tvoc_learning_time_offset_h)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!=(null==t.location?null:t.location.nox_learning_time_offset_h)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.location?null:t.location.id)&&(null==t.sensor?null:t.sensor.id)&&(null==t.placeService.currentPlace||null==t.placeService.currentPlace.permissions?null:t.placeService.currentPlace.permissions.settings))}}function Wu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"strong",71),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"slice"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("matTooltip",null==t.sensor?null:t.sensor.serialno),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Monitor Serial Number: ",(null==t.sensor?null:t.sensor.serialno.length)>40?e.\u0275\u0275pipeBind3(2,2,null==t.sensor?null:t.sensor.serialno,0,40)+"..":null==t.sensor?null:t.sensor.serialno," ")}}function Qu(n,o){if(1&n&&e.\u0275\u0275element(0,"app-clipboard-copy",72),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("copyValue",null==t.sensor?null:t.sensor.serialno)}}function qu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Monitor Maker: ",null==t.sensor?null:t.sensor.maker_name," ")}}function Ku(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Hardware Version: ",null==t.sensor?null:t.sensor.hw_id,"")}}function Yu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Current Uptime Count: ",null==t.sensor||null==t.sensor.measures_current?null:t.sensor.measures_current.boot," ")}}function Xu(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275pipe(3,"date"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Last Seen: ",t.currentTimeStamp-(null==t.sensor?null:t.sensor.last_seen_timestamp)<864e5?e.\u0275\u0275pipeBind2(2,1,null==t.sensor?null:t.sensor.last_seen,"HH:mm:ss"):e.\u0275\u0275pipeBind2(3,4,null==t.sensor?null:t.sensor.last_seen,"MMM d, YYY")," ")}}function Zu(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275element(1,"app-chip-status",74),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.ngIf,i=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("statusText",null==i.sensor?null:i.sensor.fw_id)("noMobileCollapsedVersion",!0)("statusChipType",t.chipType)("statusTooltipText",t.tooltip)}}function Ju(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",73),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"monitorModelHandler"),e.\u0275\u0275template(3,Zu,2,4,"ng-container",2),e.\u0275\u0275pipe(4,"firmwareChipConfig"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Model: ",e.\u0275\u0275pipeBind1(2,2,null==t.sensor?null:t.sensor.model)," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(4,4,t.sensor))}}function e_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Notes: ",null==t.sensor?null:t.sensor.notes,"")}}function t_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Internal Notes: ",null==t.sensor?null:t.sensor.internal_notes," ")}}function n_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Monitor Commissioning Date: ",e.\u0275\u0275pipeBind1(2,1,null==t.sensor?null:t.sensor.commissioning_date)," ")}}function i_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",75)(1,"mat-icon",76),e.\u0275\u0275text(2,"warning"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"span"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",77),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).clearAnomalies()}),e.\u0275\u0275text(6," Clear "),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("Anomalies: ",t.formattedAnomalies,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",t.clearingAnomalies)}}function a_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",62)(1,"button",63),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).editMonitor()}),e.\u0275\u0275text(2," Edit Monitor "),e.\u0275\u0275elementEnd()()}}function o_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"h3",23)(2,"mat-icon",59),e.\u0275\u0275text(3,"settings_applications"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Monitor Information"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,Wu,3,6,"strong",67),e.\u0275\u0275template(6,Qu,1,1,"app-clipboard-copy",68),e.\u0275\u0275template(7,qu,2,1,"div",2),e.\u0275\u0275template(8,Ku,2,1,"div",2),e.\u0275\u0275template(9,Yu,2,1,"div",2),e.\u0275\u0275template(10,Xu,4,7,"div",2),e.\u0275\u0275template(11,Ju,5,6,"div",69),e.\u0275\u0275template(12,e_,2,1,"div",2),e.\u0275\u0275template(13,t_,2,1,"div",2),e.\u0275\u0275template(14,n_,3,3,"div",2),e.\u0275\u0275template(15,i_,7,2,"div",70),e.\u0275\u0275template(16,a_,3,0,"div",60),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.serialno),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.serialno),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.maker_name),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.hw_id),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor||null==t.sensor.measures_current?null:t.sensor.measures_current.boot),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.last_seen_timestamp),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.model),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.notes),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.sensor?null:t.sensor.internal_notes)&&(null==t.placeService.currentPlace?null:t.placeService.currentPlace.advanced_config)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.sensor?null:t.sensor.commissioning_date),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isSupportStaff&&t.hasAnomalies&&(null==t.placeService.currentPlace||null==t.placeService.currentPlace.permissions?null:t.placeService.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.sensor?null:t.sensor.id)&&(null==t.placeService.currentPlace||null==t.placeService.currentPlace.permissions?null:t.placeService.currentPlace.permissions.settings))}}const Li=function(n){return["/settings/locations",n]};function r_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"h3",23)(2,"mat-icon",59),e.\u0275\u0275text(3,"device_hub"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Hub"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div")(6,"a",78),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(6),e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction1(2,Li,t.parentNode.id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.parentNode.name," ")}}function l_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"a",78),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction1(2,Li,t.s
1atellite_location_id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.satellite_location_name," ")}}function s_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"h3",23)(2,"mat-icon",59),e.\u0275\u0275text(3,"device_hub"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Nodes"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,l_,3,4,"div",79),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",t.nodes)}}function c_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58),e.\u0275\u0275element(1,"app-sim-card-info",80),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("iccid",null==t.sensor?null:t.sensor.iccid)("simCardInfo",t.simCardInfo)("showIcon",!0)}}var tt=(()=>{return(n=tt||(tt={})).LOCATION_FORM="location-form",n.SENSOR_FORM="sensor-form",n.ADVANCED_MONITOR_SETTINGS="advanced-monitor-settings",tt;var n})();let p_=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B,j,q,J,ge,fe,Le,qe){this.dialog=t,this.route=i,this.router=a,this.locationService=r,this.placeService=l,this.locationsService=f,this.firmwareService=w,this.dialogService=T,this.monitorService=M,this.httpHelper=B,this.dataService=j,this.colorsServices=q,this.browserLocaleService=J,this.helpService=ge,this.notesService=fe,this.messageService=Le,this.userService=qe,this.GO_AQS_MEASURE=jn.TL,this.sensor=null,this.location=null,this.simCardInfo=null,this.currentTimeStamp=0,this.locationId=null,this.sensorId=null,this.loading=!1,this.clearingAnomalies=!1,this.nodes=[],this.parentNode=null,this.tempCorrectionAlgo=null,this.humCorrectionAlgo=null,this.plantowerPMCorrectionAlgo=null,this.PlantowerPMCorrectionOptions=Dt.J7,this.PLANTOWER_CORRECTION_OPTIONS_CONFIG=Pt.lC,this.baseCurrentDataColumns=["pm02","pm003_count","pm01","pm10","rco2"],this.currentDataColumns=[...this.baseCurrentDataColumns,"atmp","rhum","heatindex","tvoc","tvoc_index","nox_index","volt","light","wifi","date"],this.destroy$=new H.xQ}ngOnInit(){this.currentTimeStamp=Date.now(),this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{["refresh_data","temperature_correction_formula_updated","rh_correction_formula_updated","pm_correction_formula_updated"].includes(t)&&this.refreshCurrentData(),"sensor_deleted"===t&&(this.sensor=null),"location_deleted"===t&&this.locationService.back(),"anomalies_deletion_success"===t&&(this.clearingAnomalies=!1,this.location&&(this.location.anomalies=null),this.sensor&&(this.sensor.anomalies=null),this.refreshCurrentData()),"anomalies_deletion_error"===t&&(this.clearingAnomalies=!1)}),this.loadFromRoute(),this.route.paramMap.pipe((0,yd.T)(1),(0,A.R)(this.destroy$)).subscribe(()=>{window.scrollTo({top:0,behavior:"smooth"}),this.loadFromRoute()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openHelp(){this.helpService.openHelpDialog(Z.L.location_monitor_info_page,"Location & Monitor Information")}openDialog(t,i,a){var r;this.dataService.currentMeasure=t,this.dataService.currentMeasureLabel=i,this.notesService.bodyScrollOnDialogOpen=window.scrollY,this.matDialogRef=this.dialog.open(Id.I,{data:Object.assign(Object.assign({},a),{location_id:null!==(r=a.location_id)&&void 0!==r?r:a.id}),autoFocus:!1}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"90%",desktopHeight:"90%"})}openAnalytics(){var t,i;!(null===(t=this.location)||void 0===t?void 0:t.id)||this.router.navigate(["/dashboard/analytics"],{queryParams:{placeId:null===(i=this.placeService.currentPlace)||void 0===i?void 0:i.id,mode:"multi",measures:["pm02",this.dataService.tempInF?"atmpf":"atmp"].join(","),timex:"24h",open:!1,locations:this.location.id}})}editLocation(){this.matDialogRef=this.dialog.open(Pi.s,{data:{loc:Object.assign({},this.location),sensor:this.sensor,ob:"yes"}}),this.matDialogRef.afterClosed().pipe((0,Xe.q)(1)).subscribe(t=>this.applyDialogResult(tt.LOCATION_FORM,t)),this.loading=null,this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"700px",desktopHeight:"auto"})}editMonitor(t=!1){this.matDialogRef=this.dialog.open(In,{data:{data:Object.assign({},this.sensor),modelSelectAutoOpen:t}}),this.matDialogRef.afterClosed().pipe((0,Xe.q)(1)).subscribe(i=>this.applyDialogResult(tt.SENSOR_FORM,i)),this.loading=null,this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"600px",desktopHeight:"auto"})}get isSupportStaff(){var t;return!!(null===(t=this.userService.currentUser)||void 0===t?void 0:t.support_staff)}get anomaliesValue(){var t;return null===(t=this.location)||void 0===t?void 0:t.anomalies}get hasAnomalies(){var t;return!!(null===(t=this.sensor)||void 0===t?void 0:t.id)&&!!this.formattedAnomalies}get formattedAnomalies(){return function Td(n){return n?Oi(n).split(",").map(o=>
1o.trim().replace(/^"|"$/g,"")).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(", "):""}(this.anomaliesValue)}clearAnomalies(){var t,i;if(this.clearingAnomalies)return;const a=null===(t=this.placeService.currentPlace)||void 0===t?void 0:t.id;if(!a||!(null===(i=this.sensor)||void 0===i?void 0:i.id))return;const r=this.sensor.id;this.clearingAnomalies=!0,this.dialog.open(he.$,{width:"350px",data:{yes:"Clear",no:"Cancel",danger_button:!0,data:"Are you sure you want to clear all anomalies for this monitor? This cannot be undone."}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(l=>{l?this.monitorService.deleteAnomalies(a,r):this.clearingAnomalies=!1})}goToAdvancedMonitorSettings(){this.matDialogRef=this.dialog.open(ki._,{data:{location:this.location,monitor:this.sensor,rowData:this.location}}),this.matDialogRef.afterClosed().pipe((0,Xe.q)(1)).subscribe(t=>{this.applyDialogResult(tt.ADVANCED_MONITOR_SETTINGS,t)}),this.loading=null,this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"90vw",desktopHeight:"auto"})}applyDialogResult(t,i){var a,r,l,f,w;if(t===tt.LOCATION_FORM&&(null==i?void 0:i.location))this.location.sensor_id!==(null===(a=i.location)||void 0===a?void 0:a.sensor_id)&&(null===(r=i.location)||void 0===r?void 0:r.sensor_id)&&this.loadSensorFromLocation(null===(l=i.location)||void 0===l?void 0:l.sensor_id),(null===(f=i.location)||void 0===f?void 0:f.sensor_id)||(this.sensor=void 0),this.location=Object.assign(Object.assign({},this.location),i.location);else if(t===tt.SENSOR_FORM&&(null==i?void 0:i.sensor))this.sensor=Object.assign(Object.assign({},this.sensor),i.sensor);else if(t===tt.ADVANCED_MONITOR_SETTINGS){const T=this.locationsService.allLocations.find(M=>{var B;return M.id===(null===(B=this.location)||void 0===B?void 0:B.id)});T&&(this.location=Object.assign(Object.assign({},this.location),T),this.updateCorrectionState()),(null===(w=this.sensor)||void 0===w?void 0:w.id)&&this.loadSensorFromLocation(this.sensor.id)}}refreshCurrentData(){var t,i,a,r,l,f;if(!this.locationId||!(null===(t=this.placeService.currentPlace)||void 0===t?void 0:t.id))return;const w=null!==(l=null!==(a=null===(i=this.sensor)||void 0===i?void 0:i.id)&&void 0!==a?a:null===(r=this.location)||void 0===r?void 0:r.sensor_id)&&void 0!==l?l:null,T=null===(f=this.sensor)||void 0===f?void 0:f.anomalies;this.locationsService.getEditLocationsRequest(this.locationId,w,this.placeService.currentPlace.id).subscribe(M=>{var B;this.location=M.location,this.sensor=M.sensor||null,this.applyReturnedAnomalies(null===(B=this.sensor)||void 0===B?void 0:B.anomalies),this.applyReturnedAnomalies(T),this.syncOfflineState(),this.applyCurrentMeasureColors(),this.updateCorrectionState(),this.currentTimeStamp=Date.now()},M=>{this.httpHelper.handleHttpErrorMessage(M)})}loadFromRoute(){var t,i,a;const r=this.route.snapshot.paramMap.get("locationId"),l=null===(i=null===(t=this.router.getCurrentNavigation())||void 0===t?void 0:t.extras)||void 0===i?void 0:i.state;this.locationId=this.parseNumericParam(r),this.locationId&&(null===(a=this.placeService.currentPlace)||void 0===a?void 0:a.id)&&(this.loading=!0,this.resetCorrectionState(),this.loadNodes(),this.locationsService.getEditLocationsRequest(this.locationId,null,this.placeService.currentPlace.id).subscribe(f=>{var w,T,M;this.location=f.location,this.syncOfflineState(),this.dataService.currentScreen=`${null===(w=this.location)||void 0===w?void 0:w.name}`,this.applyNavigationAnomalies(null==l?void 0:l.anomalies),this.applyCurrentMeasureColors(),this.sensorId=null!==(M=null===(T=this.location)||void 0===T?void 0:T.sensor_id)&&void 0!==M?M:null,this.sensorId?this.loadSensorFromLocation(this.sensorId,null==l?void 0:l.anomalies):(this.sensor=null,this.updateCorrectionState(),this.loading=null)},f=>{this.httpHelper.handleHttpErrorMessage(f),this.loading=null}))}loadNodes(){var t,i,a;this.nodes=[],this.parentNode=null;const r=null===(t=this.placeService.currentPlace)||void 0===t?void 0:t.id;if(!this.locationId||!r||!(null===(a=null===(i=this.placeService.currentPlace)||void 0===i?void 0:i.permissions)||void 0===a?void 0:a.settings))return;const l=this.locationId;this.locationsService.getSatellitesByLocation(r,l).pipe((0,Xe.q)(1),(0,A.R)(this.destroy$)).subscribe(f=>{this.locationId===l&&(this.nodes=null!=f?f:[])},f=>{console.error("Failed to load nodes",f)}),this.locationsService.getSatellitesByPlace(r).pipe((0,Xe.q)(1),(0,A.R)(this.destroy$)).subscribe(f=>{this.locationId===l&&(this.parentNode=function kd(n,o,t){const i=(null!=n?n:[]).find(a=>a.satellite_location_id===o);return i?{id:i.star_location_id,name:t(i.star_location_id)||`Location ${i.star_location_id}`}:null}(f,l,w=>{var T;return null===(T=this.getFullLocationInfo(w))||void 0===T?void 0:T.name}))},f=>{console.error("Failed to load parent node",f)})}loadSensorFromLocation(t,i){this.loading=!0,this.locationsService.getEditLocationsRequest(this.locationId,t,this.placeService.currentPlace.id).subscribe(a=>{var r,l;this.location=a.location;const f=this.getFullLocationInfo(this.location.id);null!=(null==f?void 0:f.share_indoor_data)&&(this.location.share_indoor_data=f.share_indoor_data),this.applyNavigationAnomalies(i),this.sensor=a.sensor||null,this.applyReturnedAnomalies(null===(r=this.sensor)||void 0===r?void 0:r.anomalies),this.applyNavigationAnomalies(i),this.syncOfflineState(),this.applyCurrentMeasureColors(),this.sensor&&(null===(l=this.location)||void 0===l?void 0:l.location_name)&&(this.sensor.location_name=this.location.location_name),this.updateCorrectionState(),this.sensor&&this.get
1SimCardData(),this.loading=null},a=>{this.httpHelper.handleHttpErrorMessage(a),this.loading=null})}applyNavigationAnomalies(t){var i;const a=this.normalizeAnomalies(t);null==(null===(i=this.location)||void 0===i?void 0:i.anomalies)&&a&&(this.location.anomalies=a)}applyReturnedAnomalies(t){var i;const a=this.normalizeAnomalies(t);null==(null===(i=this.location)||void 0===i?void 0:i.anomalies)&&a&&(this.location.anomalies=a)}normalizeAnomalies(t){if(Array.isArray(t)){const i=t.filter(Boolean);return i.length?i.join(","):null}if("string"==typeof t){const i=Oi(t.trim());return i.length?i:null}return null}syncOfflineState(){var t,i,a,r,l,f,w,T,M;if(!this.location)return;const B=this.location.offline,j=null===(t=this.sensor)||void 0===t?void 0:t.offline,q=null===(a=null===(i=this.sensor)||void 0===i?void 0:i.measures_current)||void 0===a?void 0:a.offline,J=null===(l=null===(r=this.location)||void 0===r?void 0:r.measures_current)||void 0===l?void 0:l.offline;if(this.hasRenderableCurrentData(null===(f=this.location)||void 0===f?void 0:f.measures_current)||this.hasRenderableCurrentData(null===(w=this.sensor)||void 0===w?void 0:w.measures_current))return this.location.offline=!1,(null===(T=this.location)||void 0===T?void 0:T.measures_current)&&(this.location.measures_current.offline=!1),void(this.sensor&&(this.sensor.offline=!1,(null===(M=this.sensor)||void 0===M?void 0:M.measures_current)&&(this.sensor.measures_current.offline=!1)));this.location.offline=Boolean(B||j||q||J)}hasRenderableCurrentData(t){return!!t&&(!!t.date||Object.entries(t).some(([i,a])=>"offline"!==i&&"date"!==i&&null!=a))}applyCurrentMeasureColors(){var t,i;if(!(null===(t=this.location)||void 0===t?void 0:t.measures_current))return;if(this.location.pm02=this.location.measures_current.pm02,this.location.rco2=this.location.measures_current.rco2,this.location.volt=this.location.measures_current.volt,this.location.tvoc_index=this.location.measures_current.tvoc_index,this.location.nox_index=this.location.measures_current.nox_index,this.location.heat_index_celsius=this.location.measures_current.heatindex,this.location.pi02=(0,Ed.c)(this.location.pm02),this.location.indoor&&Number.isFinite(this.location.pm02)&&Number.isFinite(this.location.rco2)){const r=(0,jn.GM)(this.location.pm02,this.location.rco2);this.location.go_aqs=r.totalScore,this.location.go_aqs_clr=(0,jn.A9)(r.totalScore)}else this.location.go_aqs=null,this.location.go_aqs_clr=null;this.location.tvoc_index_clr=this.colorsServices.getColorByValue(this.location.tvoc_index,"tvoc_index"),this.location.nox_index_clr=this.colorsServices.getColorByValue(this.location.nox_index,"nox_index"),this.location.rco2_clr=this.colorsServices.getColorByValue(this.location.rco2,"rco2"),this.location.heatindex_clr=this.colorsServices.getColorByValue(this.location.heat_index_celsius,"heatindex"),this.location.pi02_clr=this.colorsServices.getColorByValue(this.location.pi02,"pi02"),this.location.pm02_clr=this.colorsServices.getColorByValue(this.location.pm02,"pm02"),this.location.volt_clr=this.colorsServices.getColorByValue(this.location.volt,"volt");const a=(null===(i=this.placeService.currentPlace)||void 0===i?void 0:i.advanced_config)?["tvoc","tvoc_index","tvoc_raw","
1nox_index","nox_raw"]:["tvoc","tvoc_index","nox_index"];this.currentDataColumns=this.location.indoor?[...this.baseCurrentDataColumns,"go_aqs","atmp","rhum","heatindex",...a,"volt","light","wifi","date"]:[...this.baseCurrentDataColumns,"atmp","rhum","heatindex",...a,"volt","light","wifi","date"]}parseNumericParam(t,i=!1){if(!t||i&&"null"===t)return null;const a=Number(t);return Number.isFinite(a)?a:null}resetCorrectionState(){this.tempCorrectionAlgo=null,this.humCorrectionAlgo=null,this.plantowerPMCorrectionAlgo=null}updateCorrectionState(){this.location&&(this.getTempCorrectionAlgo(),this.getHumCorrectionAlgo(),this.getPlantowerPMCorrectionAlgo())}get isFelipeDetected(){var t,i;return!!(null===(i=null===(t=this.location)||void 0===t?void 0:t.anomalies)||void 0===i?void 0:i.includes("felipe"))}getSimCardData(){var t,i;(null===(t=this.sensor)||void 0===t?void 0:t.iccid)&&this.monitorService.getSimCardInfo(this.placeService.currentPlace.id,null===(i=this.sensor)||void 0===i?void 0:i.iccid).subscribe(a=>{this.simCardInfo=a},a=>{404!==a.status&&this.httpHelper.handleHttpErrorMessage(a)})}getTempCorrectionAlgo(){this.location.temp_correction_algo&&this.location.temp_correction_algo!==Nn.u.none?this.tempCorrectionAlgo=Sd.p[this.location.temp_correction_algo]:this.location.temp_correction_algo===Nn.u.none&&(this.tempCorrectionAlgo=null)}getHumCorrectionAlgo(){this.location.hum_correction_algo&&this.location.hum_correction_algo!==Vn.z.none?this.humCorrectionAlgo=wd.Ay[this.location.hum_correction_algo]:this.location.hum_correction_algo===Vn.z.none&&(this.humCorrectionAlgo=null)}getPlantowerPMCorrectionAlgo(){const t=this.location.plantower_pm2_correction_algo;t!==Dt.J7.none?t&&(this.plantowerPMCorrectionAlgo=Pt.lC[t]):this.plantowerPMCorrectionAlgo=Pt.lC[Dt.J7.none]}retrieveTestReport(t,i){this.matDialogRef=this.dialog.open(vi.V,{data:i}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"90vw",desktopHeight:"90vh"})}getFullLocationInfo(t){return(this.locationsService.allLocations||[]).find(a=>a.id===t)||null}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(u.Location),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(xn.K),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Hn.h),e.\u0275\u0275directiveInject(Pn.V),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(Pd.U),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-location-monitor-info-page"]],decls:26,vars:14,consts:[["justifyContent","space-between"],[1,"flex-start","gap-1"],[4,"ngIf"],["mat-button","","class","button-secondary","type","button",3,"click",4,"ngIf"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inPage"],[3,"show"],["class","spacer-bottom-lg spacer-top-lg",4,"ngIf"],[3,"isAccentWarning",4,"ngIf"],["class","settings-block spacer-top-lg",4,"ngIf"],[1,"info-grid"],["class","settings-block",4,"ngIf"],["mat-button","",1,"button-primary",3,"click"],[1,"label-desktop"],[1,"label-mobile"],[1,"spacer-bottom-lg","spacer-top-lg"],[3,"isAccentWarning"],["warning",""],[1,"content"],[1,"info-icon"],["href","https://www.airgradient.com/support/","target","_blank",1,"accent-link"],[1,"settings-block","spacer-top-lg"],["svgIcon","current_data",1,"inline-icon"],[1,"spacer-bottom-sm","spacer-top-sm"],[1,"ag-table-wrapper"],["mat-table","",1,"ag-table-main","locations","zoom-table",3,"dataSource"],["matColumnDef","pm02"],["mat-header-cell","",4,"matHeaderCellDef"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","pm003_count"],["matColumnDef","pm01"],["matColumnDef","pm10"],["matColumnDef","rco2"],["matColumnDef","go_aqs"],["matColumnDef","atmp"],["matColumnDef","rhum"],["matColumnDef","heatindex"],["matColumnDef","tvoc"],["matColumnDef","tvoc_index"],["matColumnDef","tvoc_raw"],["matColumnDef","nox_index"],["matColumnDef","nox_raw"],["matColumnDef","volt"],["matColumnDef","light"],["matColumnDef","wifi"],["matColumnDef","date"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"ngClass",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell","",1,"zoom-td"],[3,"markerBarColor","isOffline","value","cellClick"],[3,"isOffline","value","cellClick"],[3,"isOffline","markerBarColor","value","cellClick"],[4,"ngIf","ngIfElse"],["offlineOrUnknownUpdateDate",""],[1,"padding-left-xxs","offline-interactive-cell-content"],["mat-header-row",""],["mat-row","",3,"ngClass"],[1,"settings-block"],[1,"inline-icon"],["class","spacer-top-sm",4,"ngIf"],["successMessage","Location ID has been copied to clipboard","size","small",3,"copyValue"],[1,"spacer-top-sm"],["mat-button","","type","button",1,"button-primary",3,"click"],["svgIcon","line_axis",1,"inline-icon"],[1,"spacer-bottom-xs","spacer-top-xs"],[3,"innerHTML"],["appMatTooltipToggleMechanism","",3,"matTooltip",4,"ngIf"],["successMessage","Monitor serial number has been copied to clipboard","size","small",3,"copyValue",4,"ngIf"],["class","flex-start",4,"ngIf"],["class","flex-start gap-1 flex-align-center spacer-top-sm",4,"ngIf"],["appMatTooltipToggleMechanism","",3,"matTooltip"],["successMessage","Monitor serial number has been copied to clipboard","size","small",3,"copyValue"],[1,"flex-start"],[1,"spacer-left-xs",3,"statusText","noMobileCollapsedVersion","statusChipType","statusTooltipText"],[1,"flex-start","gap-1","flex-align-center","spacer-top-sm"],[1,"inline-icon","warning-icon"],["mat-button","","type","button",1,"button-secondary",3,"disabled","click"],[1,"accent-link",3,"routerLink"],[4,"ngFor","ngForOf"],["headingLevel","h3","clipboardSize","small",3,"iccid","simCardInfo","showIcon"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0),e.\u0275\u0275element(1,"div"),e.\u0275\u0275elementStart(2,"div",1),e.\u0275\u0275template(3,Ld,3,2,"div",2),e.\u0275\u0275template(4,Fd,5,0,"button",3),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.openHelp()}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"section",5),e.\u0275\u0275element(8,"app-progress-bar",6),e.\u0275\u0275template(9,Rd,2,0,"div",2),e.\u0275\u0275template(10,Nd,11,1,"div",7),e.\u0275\u0275template(11,Vd,7,1,"app-warning-message",8),e.\u0275\u0275template(12,jd,2,1,"div",2),e.\u0275\u0275template(13,Mu,63,5,"div",9),e.\u0275\u0275elementStart(14,"div",10)(15,"div")(16,"div"),e.\u0275\u0275template(17,Fu,9,4,"div",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"div"),e.\u0275\u0275template(19,Uu,12,8,"div",11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(20,"div")(21,"div"),e.\u0275\u0275template(22,o_,17,12,"div",11),e.\u0275\u0275template(23,r_,8,4,"div",11),e.\u0275\u0275template(24,s_,6,1,"div",11),e.\u0275\u0275template(25,c_,2,3,"div",11),e.\u0275\u0275elementEnd()()()()),2&t&&(e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!(null==i.placeService.currentPlace||null==i.placeService.currentPlace.permissions||!i.placeService.currentPlace.permissions.settings||(null!=i.sensor&&null!=i.sensor.test_report&&i.sensor.test_report.testReportVersion||"Pass"!==(null==i.sensor||null==i.sensor.test_report||null==i.sensor.test_report.testData?null:i.sensor.test_report.testData.overallPass)&&"Limited Pass"!==(null==i.sensor||null==i.sensor.test_report||null==i.sensor.test_report.testData?null:i.sensor.test_report.testData.overallPass))&&!((null==i.sensor||null==i.sensor.test_report?null:i.sensor.test_report.testReportVersion)>=2))),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.location&&i.sensor),e.\u0275\u0275advance(4),e.\u0275\u0275property("show",i.loading),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.sensor?null:i.sensor.model)&&(null==i.placeService.currentPlace?null:i.placeService.currentPlace.generic_os_sensors_ota_id)&&(null==i.placeService.currentPlace||null==i.placeService.currentPlace.permissions?null:i.placeService.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.location&&!(null!=i.sensor&&i.sensor.id)&&!i.loading&&(null==i.placeService.currentPlace||null==i.placeService.currentPlace.permissions?null:i.placeService.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!i.sensor&&!(null!=i.sensor&&i.sensor.model)&&"airgradient"===i.sensor.maker_id&&(null==i.placeService.currentPlace||null==i.placeService.currentPlace.permissions?null:i.placeService.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==i.location||null==i.location.anomalies?null:i.location.anomalies.length)&&(null==i.placeService.currentPlace||null==i.placeService.currentPlace.permissions?null:i.placeService.currentPlace.permissions.settings)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.location&&i.sensor),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.location),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.sensor&&(i.plantowerPMCorrectionAlgo||(null==i.sensor?null:i.sensor.co2_calibration)||i.tempCorrectionAlgo||i.humCorrectionAlgo)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.sensor),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.parentNode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.nodes.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==i.sensor?null:i.sensor.iccid))},directives:[ae.$,u.NgIf,z.lW,ot.R,Tn.V,je.R,Q.Hw,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,Ct.T,h.as,h.XQ,h.nj,h.Gk,u.NgClass,ce.oO,Ie.Z,Fn.P,Ue.gM,Bt.W,y.yS,u.NgForOf,Md.s],pipes:[u.DecimalPipe,Ad.m,u.DatePipe,u.SlicePipe,ln.n,Ci.f],styles:[".inPage[_ngcontent-%COMP%]{padding:20px}.info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:24px;gap:24px}@media (max-width: 991px){.info-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.label-mobile[_ngcontent-%COMP%]{display:none}@media (max-width: 600px){.label-desktop[_ngcontent-%COMP%]{display:none}.label-mobile[_ngcontent-%COMP%]{display:inline}}"]}),n})();var Ot=d(64348),Bn=d(77700);class Gn{}
1var Fi=d(59519),Ri=d(79814),zt=d(78029);function m_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",48),e.\u0275\u0275element(1,"qrcode",11),e.\u0275\u0275elementStart(2,"div",49),e.\u0275\u0275text(3," samhe.org.uk/qr/"),e.\u0275\u0275element(4,"br"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata","https://www.samhe.org.uk/qr/"+(null==t.chipid?null:t.chipid.trim()))("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("",t.chipid," ")}}function d_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",48),e.\u0275\u0275element(1,"qrcode",11),e.\u0275\u0275elementStart(2,"div",50),e.\u0275\u0275text(3,"Add to Dashboard "),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata","SGP"===t.serverid?"https://app.airgradient.com/onb/"+(null==t.chipid?null:t.chipid.trim()):"https://app.airgradient.cn/onb/"+(null==t.chipid?null:t.chipid.trim()))("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function u_(n,o){1&n&&e.\u0275\u0275element(0,"img",51)}function __(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",20),e.\u0275\u0275text(1,"Contains FCC ID: "),e.\u0275\u0275element(2,"br"),e.\u0275\u0275text(3," 2AC7Z-ESP32WROVERE "),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("font-family",t.font)}}function f_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",20),e.\u0275\u0275text(1,"Contains FCC ID: "),e.\u0275\u0275element(2,"br"),e.\u0275\u0275text(3," 2AC7Z-ESPC3MINI1 "),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("font-family",t.font)}}function h_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("AirGradient ",t.productFamilyName," ")}}function g_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",20),e.\u0275\u0275text(1,"AirGradient"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("font-family",t.font)}}function v_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",20),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.productFamilyName)}}function C_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",52),e.\u0275\u0275element(1,"qrcode",11),e.\u0275\u0275elementStart(2,"div",53),e.\u0275\u0275text(3," samhe.org.uk/qr/ "),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata","https://www.samhe.org.uk/qr/"+(null==t.chipid?null:t.chipid.trim()))("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function b_(n,o){if(1&n&&e.\u0275\u0275element(0,"qrcode",11),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("qrdata",null==t.chipid?null:t.chipid.trim())("scale",1)("width",180)("errorCorrectionLevel","M")}}function x_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",52),e.\u0275\u0275template(1,b_,1,4,"qrcode",54),e.\u0275\u0275element(2,"div",53),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!t.chipid),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function y_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",58)(1,"div",57)(2,"div",20),e.\u0275\u0275text(3,"A B + -"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",t.font)}}function S_(n,o){if(1&n&&e.\u0275\u0275element(0,"qrcode",11),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("qrdata",null==t.chipid?null:t.chipid.trim())("scale",1)("width",100)("errorCorrectionLevel","M")}}function w_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",55),e.\u0275\u0275template(1,y_,4,2,"div",56),e.\u0275\u0275template(2,S_,1,4,"qrcode",54),e.\u0275\u0275elementStart(3,"div",57)(4,"div",20),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",20),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",20),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.modelName==t.MonitorModels._8PSLM),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!t.chipid),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" AirGradient ",t.productFamilyName," "),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2("Model:",t.modelName,"-",t.serveri
1d,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",t.chipid,"")}}function E_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"p")(2,"strong"),e.\u0275\u0275text(3,"Select model:"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"mat-radio-group",59),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().modelName=a}),e.\u0275\u0275elementStart(5,"p"),e.\u0275\u0275text(6,"Current Models:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",60)(8,"mat-radio-button",61),e.\u0275\u0275text(9,"P-1PSG"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"br"),e.\u0275\u0275elementStart(11,"mat-radio-button",61),e.\u0275\u0275text(12,"I-9PSL-DE (One Gen 9, Display Edition) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(13,"br"),e.\u0275\u0275elementStart(14,"mat-radio-button",61),e.\u0275\u0275text(15,"O-1PST (Open Air Gen 1 with PMS5003T, SenseAir S8 and SGP41) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(16,"br"),e.\u0275\u0275elementStart(17,"mat-radio-button",61),e.\u0275\u0275text(18,"O-1PPT (Open Air Gen 1 with 2x PMS5003T and SGP41) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(19,"br"),e.\u0275\u0275elementStart(20,"mat-radio-button",61),e.\u0275\u0275text(21,"I-9PSL-DE-CE (One Gen 9, Display Edition, Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(22,"br"),e.\u0275\u0275elementStart(23,"mat-radio-button",61),e.\u0275\u0275text(24,"O-1PST-CE (Open Air Gen 1 with PMS5003T, SenseAir S8 and SGP41, Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(25,"br"),e.\u0275\u0275elementStart(26,"mat-radio-button",61),e.\u0275\u0275text(27,"O-1PPT-CE (Open Air Gen 1 with 2x PMS5003T and SGP41, Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(28,"br"),e.\u0275\u0275elementStart(29,"mat-radio-button",61),e.\u0275\u0275text(30,"O-1S-CE (Open Air Gen 1, Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(31,"br"),e.\u0275\u0275elementStart(32,"mat-radio-button",61),e.\u0275\u0275text(33,"O-M-1PPST-CE (Open Air Max, Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(34,"br"),e.\u0275\u0275elementStart(35,"mat-radio-button",61),e.\u0275\u0275text(36,"O-M-1PPSTON-CE (Open Air Max with NO"),e.\u0275\u0275elementStart(37,"sub"),e.\u0275\u0275text(38,"2"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(39,"/O"),e.\u0275\u0275elementStart(40,"sub"),e.\u0275\u0275text(41,"3"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(42,", Cellular) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(43,"br"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(44,"p"),e.\u0275\u0275text(45,"Other Models:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"div",60)(47,"mat-radio-button",61),e.\u0275\u0275text(48,"I-9PSL (One Gen 9)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(49,"br"),e.\u0275\u0275elementStart(50,"mat-radio-button",61),e.\u0275\u0275text(51,"8PSL (One Gen 8)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(52,"br"),e.\u0275\u0275elementStart(53,"mat-radio-button",61),e.\u0275\u0275text(54,"8PSL-DE (One Gen 8, Display Edition) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(55,"br"),e.\u0275\u0275elementStart(56,"mat-radio-button",61),e.\u0275\u0275text(57,"8PSLM (One Gen 8 with Modbus)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(58,"br"),e.\u0275\u0275elementStart(59,"mat-radio-button",61),e.\u0275\u0275text(60,"8PSLM-DE (One Gen 8 with Modbus, Display Edition) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(61,"br"),e.\u0275\u0275elementStart(62,"mat-radio-button",61),e.\u0275\u0275text(63,"O-1PP (Open Air Gen 1 with 2x PMS5003T) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(64,"br"),e.\u0275\u0275elementStart(65,"mat-radio-button",61),e.\u0275\u0275text(66,"O-1PS (Open Air Gen 1 with PMS5003T and SenseAir S8) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(67,"br"),e.\u0275\u0275elementStart(68,"mat-radio-button",61),e.\u0275\u0275text(69,"UNKNOWN (Unknown Model) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(70,"br"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(71,"p")(72,"strong"),e.\u0275\u0275text(73,"Select server:"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(74,"mat-radio-group",59),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().serverid=a}),e.\u0275\u0275elementStart(75,"p")(76,"mat-radio-button",62),e.\u0275\u0275text(77,"Singapore"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(78,"p")(79,"mat-radio-button",63),e.\u0275\u0275text(80,"China"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(81,"p")(82,"strong"),e.\u0275\u0275text(83,"Select Made In:"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(84,"mat-radio-group",59),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().madein=a}),e.\u0275\u0275elementStart(85,"p")(86,"mat-radio-button",64),e.\u0275\u0275text(87,"Thailand"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(88,"p")(89,"mat-radio-button",65),e.\u0275\u0275text(90,"China"),e.\u0275\u0275elementEnd()()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",t.modelName),e.\u0275\u0275advance(4),e.\u0275\u0275property("value",t.MonitorModels._P1PSG),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._I9PSLDE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PST),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PP),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._I9PSLDECE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PSTCE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PPTCE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1SCE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._OM1PPSTCE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._OM1PPSTONCE),e.\u0275\u0275advance(12),e.\u0275\u0275property("value",t.MonitorModels._I9PSL),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._8PSL),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._8PSLDE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._8PSLM),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._8PSLMDE),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PP),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._O1PS),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",t.MonitorModels._UNKNOWN),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngModel",t.serveri
1d),e.\u0275\u0275advance(10),e.\u0275\u0275property("ngModel",t.madein)}}function T_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",66),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().download("SAMHE_Info_Version_1.2.pdf")}),e.\u0275\u0275text(1,"Print SAMHE Manual "),e.\u0275\u0275elementEnd()}}function I_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",66),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().download("ag_qs.pdf")}),e.\u0275\u0275text(1,"Print AG Manual"),e.\u0275\u0275elementEnd()}}const Ni=function(n){return{"background-color":n}},P_=function(n){return{color:n}};let k_=(()=>{class n{constructor(t,i,a,r,l,f){this.route=t,this._messageService=i,this.dataServices=a,this.placeServices=r,this.locationServices=l,this.sensorServices=f,this.MonitorModels=Se.c,this.SENSOR_ID_VALIDATION_STRING=Ht.A,this.chipid="211222222222",this.serverid="SGP",this.madein="Thailand",this.font="labelprinter",this.scaleFactor=32,this.modelName=Se.c._I9PSLDE,this.samheLabel=!1,this.feedbackMessage="",this.locations=[],this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(w=>{var T;"sensor_location_added"==w&&(this.feedbackMessage="Monitor "+(null===(T=this.chipid)||void 0===T?void 0:T.toLowerCase())+" added",setInterval(()=>{this.feedbackMessage=""},4e3))})}get productFamilyName(){return(0,Fi.h)(this.modelName)}get isOpenAirFamily(){return rn.n$.includes(this.modelName)||rn.dA.includes(this.modelName)}ngOnInit(){this.dataServices.currentScreen="Labels",this.route.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(t=>{var i;this.chipid=null===(i=t.serialno)||void 0===i?void 0:i.toLowerCase(),this.serverid=bt.N.serverLocation})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}makeSamhe(t){t?(this.serverid="SGP",this.modelName=Se.c._8PSLDE,this.samheLabel=!0):(this.samheLabel=!1,this.modelName=Se.c._8PSL)}makeBatchAddLocation(t,i){i===Se.c._O1PST&&(i=Se.c._O1PS),this.locations=[];const a=t.split("\n");for(let r=0;r<a.length;r++)this.locations[r]=new Gn,this.locations[r].name=a[r].trim(),this.locations[r].maker_id="airgradient",this.locations[r].model_id=i,console.log("model: "+this.locations[r].model_id),this.locations[r].serialno=a[r].trim(),this.locations[r].controlled=!1,this.locations[r].active=!0,"O"==i.substr(0,1)?(this.locations[r].indoor=!1,console.log("outdoor")):(console.log("indoor"),this.locations[r].indoor=!0);this.locationServices.addBatchAddLocation(this.placeServices.currentPlace,JSON.stringify(this.locations))}addSensorAndLocation(){const t=new Bn.f;t.name=this.chipid.toLowerCase()+" - "+this.modelName,t.active=!0,t.indoor=!0,this.sensorServices.addSensorAndLocation(this.placeServices.currentPlace.id,t,this.chipid.toLowerCase().trim(),this.modelName)}printAndAdd(){this.addSensorAndLocation(),console.log("in print function"),window.print()}print(){window.print()}download(t){window.open("/assets/manual/"+t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(De.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-labelprint"]],decls:118,vars:73,consts:[[1,"no-print",2,"margin","10px","padding","10px",3,"ngStyle"],["fxLayoutGap","10px"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button","routerLink","/settings/ebm-mb-label",1,"button-secondary"],["mat-button","","type","button",1,"button-secondary",3,"click"],[2,"font-size","32px",3,"ngStyle"],["fxLayoutAlign","start start","fxLayout","column","fxLayoutGap","0px",1,"no-print",2,"height","100%","padding-top","10px","margin-left","15px","background-color","white"],["id","label","id","content",1,"print-only",2,"background-color","white","padding","-10px 10px","height","100%"],["fxFlex","row",2,"width","450px"],["fxLayout","row","fxLayoutAlign","start center"],["fxLayout","row","fxLayoutAlign","center center",2,"width","220px"],[3,"qrdata","scale","width","errorCorrectionLevel"],[1,"subHeaderQR",2,"margin-left","-40px","font-size","13px"],[2,"width","5px"],["fxLayout","row","fxLayoutAlign","center center","style","width: 200px",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","5px",2,"margin-left","20px","margin-top","-10px"],["src","/assets/modbus.webp","width","100px",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center start"],[1,"mediumLabel",2,"margin-top","9px"],[1,"smallLabel","fs-18"],[1,"mediumLabel"],["fxLayout","row","fxLayoutAlign","start end","fxLayoutGap","30px",2,"margin-top","8px","margin-bottom","8px","margin-left","20px"],["class","mediumLabel",3,"fontFamily",4,"ngIf"],["fxLayoutGap","10px","fxLayoutGap","30px"],["src","/assets/CE.svg","width","35px","height","35px"],["src","/assets/WEEE.svg","width","35px","height","35px"],["id","label","id","content",1,"print-only",2,"background-color","white","padding","-10px 0px","height","100%","margin-left","15px"],["fxLayout","row","fxLayoutAlign","start start",2,"width","450px"],["fxLayout","column","fxLayoutAlign","space-around start","fxLayoutGap","5px",2,"margin","20p
1x 4px 20px 6px","height","100%","padding-top","10px"],[1,"smallLabel",2,"font-size","16px"],[1,"smallLabel"],["fxLayout","column","fxLayoutAlign","center center","style","width: 200px",4,"ngIf"],["id","label","style","background-color: white;margin-top: 35px;margin-right: 25px; padding: 0px 0px","id","content","class","print-only","fxLayout","row","fxLayoutAlign","end center",4,"ngIf"],[1,"no-print",2,"padding","20px",3,"ngStyle"],["appearance","fill",1,"example-full-width","form-field-responsive-s"],["matInput","","placeholder","Serial Number","appRegexInputValidation","","maxlength","12",3,"regexString","isLowerCaseOnly","ngModel","ngModelChange"],["matSuffix","",1,"input-reset-btn",3,"click"],["fxLayout","row",1,"flex-wrap",2,"gap","10px"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"],[1,"inline-icon"],["svgIcon","print_add",1,"inline-icon"],[4,"ngIf"],["thumbLabel","","tickInterval","1","step","1","min","0","max","100","aria-label","%",3,"value","valueChange"],["mat-button","","class","button-secondary","type","button","mat-flat-button","",3,"click",4,"ngIf"],["fxLayout","column","fxLayoutGap","20px",2,"margin-top","50px"],["fxLayout","row","fxLayoutGap","20px"],["appearance","fill",1,"form-field-responsive-s"],["matInput","","placeholder","Serial Numbers","rows","10","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","5",2,"width","400px",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutAlign","center center",2,"width","200px"],[1,"subHeaderQR",2,"margin-left","-60px","font-size","13px","text-align","center"],[1,"subHeaderQR",2,"margin-left","-60px","font-size","13px"],["src","/assets/modbus.webp","width","100px"],["fxLayout","column","fxLayoutAlign","center center",2,"width","200px"],[2,"margin-top","-20px","font-size","13px","text-align","center"],[3,"qrdata","scale","width","errorCorrectionLevel",4,"ngIf"],["id","label","id","content","fxLayout","row","fxLayoutAlign","end center",1,"print-only",2,"background-color","white","margin-top","35px","margin-right","25px","padding","0px 0px"],["id","label","style","background-color: white;padding: 10px 10px; width: 140px","id","content","class","print-only","fxLayout","row","fxLayoutAlign","center center",4,"ngIf"],["fxLayout","column"],["id","label","id","content","fxLayout","row","fxLayoutAlign","center center",1,"print-only",2,"background-color","white","padding","10px 10px","width","140px"],[3,"ngModel","ngModelChange"],[2,"margin-left","5px"],[3,"value"],["value","SGP"],["value","CHN"],["value","Thailand"],["value","China"],["mat-button","","type","button","mat-flat-button","",1,"button-secondary",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"div",0)(2,"h3"),e.\u0275\u0275text(3,"Instructions"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"p"),e.\u0275\u0275text(5,"Please keep the following in mind:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"ul")(7,"li"),e.\u0275\u0275text(8,"Ensure you flash the correct firmware version matching the server location mentioned below"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"li"),e.\u0275\u0275text(10,"Select the correct model below"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"li"),e.\u0275\u0275text(12,"Copy and paste serial number from flashing tool. Immediately put the small sticker on the PCB."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"li"),e.\u0275\u0275text(14,"For all monitors for the UK, Cambridge order ensure you use the SAMHE label version"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(15,"div",1)(16,"button",2),e.\u0275\u0275listener("click",function(){return i.makeSamhe(!0)}),e.\u0275\u0275text(17,"SAMHE Version "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"button",3),e.\u0275\u0275text(19,"ebm-papst Version "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"button",4),e.\u0275\u0275listener("click",function(){return i.makeSamhe(!1)}),e.\u0275\u0275text(21,"Other Versions "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(22,"div",5),e.\u0275\u0275text(23),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(24,"div",6)(25,"div",7)(26,"div",8)(27,"div",9)(28,"div",10),e.\u0275\u0275element(29,"qrcode",11),e.\u0275\u0275elementStart(30,"div",12),e.\u0275\u0275text(31,"Add to Wifi "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(32,"div",13),e.\u0275\u0275template(33,m_,6,7,"div",14),e.\u0275\u0275template(34,d_,4,6,"div",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"div",15),e.\u0275\u0275template(36,u_,1,0,"img",16),e.\u0275\u0275elementStart(37,"div",17)(38,"div",18),e.\u0275\u0275text(39),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"div",19),e.\u0275\u0275text(41),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(42,"div",20),e.\u0275\u0275text(43),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(44,"div",21),e.\u0275\u0275template(45,__,4,2,"div",22),e.\u0275\u0275template(46,f_,4,2,"div",22),e.\u0275\u0275elementStart(47,"div",23),e.\u0275\u0275element(48,"img",24)(49,"img",25),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(50,"div",26)(51,"div",27)(52,"div",28),e.\u0275\u0275template(53,h_,2,3,"div",22),e.\u0275\u0275template(54,g_,2,2,"div",22),e.\u0275\u0275template(55,v_,2,3,"div",22),e.\u0275\u0275elementStart(56,"div",29),e.\u0275\u0275text(57),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(58,"div",20),e.\u0275\u0275text(59),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(60,"div",20),e.\u0275\u0275text(61),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(62,"div",30),e.\u0275\u0275text(63,"AirGradient Ltd."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(64,"div",30),e.\u0275\u0275text(65,"50180 Chiang Mai Thailand"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(66,C_,4,6,"div",31),e.\u0275\u0275template(67,x_,3,3,"div",31),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(68,w_,10,12,"div",32),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(69,"div",33)(70,"p")(71,"strong"),e.\u0275\u0275text(72,"Configuration"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(73,"mat-form-field",34)(74,"mat-label"),e.\u0275\u0275text(75,"Serial Number"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(76,"input",35),e.\u0275\u0275listener("ngModelChange",function(r){return i.chipid=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(77,"mat-icon",36),e.\u0275\u0275listener("click",function(){return i.chipid=""}),e.\u0275\u0275text(78,"clear"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(79,"div",37)(80,"button",38),e.\u0275\u0275listener("click",function(){return i.addSensorAndLocation()}),e.\u0275\u0275elementStart(81,"mat-icon",39),e.\u0275\u0275text(82,"add"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(83," Add to Place "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(84,"button",38),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275elementStart(85,"mat-icon",39),e.\u0275\u0275text(86,"print"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(87," Print Label "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(88,"button",38),e.\u0275\u0275listener("click",function(){return i.printAndAdd()}),e.\u0275\u0275element(89,"mat-icon",40),e.\u0275\u0275text(90," Print Label and Add to Place "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(91,E_,91,21,"div",41),e.\u0275\u0275elementStart(92,"p")(93,"strong"),e.\u0275\u0275text(94),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(95,"p")(96,"strong"),e.\u0275\u0275text(97,"Print Scaling"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(98,"mat-slider",42),e.\u0275\u0275listener("valueChange",function(r){return i.scaleFactor=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(99,"div",37),e.\u0275\u0275template(100,T_,2,0,"button",43),e.\u0275\u0275template(101,I_,2,0,"button",43),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(102,"div",44)(103,"h3"),e.\u0275\u0275text(104,"Location Bulk Adding (Experimental)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10
15,"p"),e.\u0275\u0275text(106,"Paste line separated serial numbers below and locations with same names will be created."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(107,"p"),e.\u0275\u0275text(108,"Currently no error handling. Please check consolde for errors."),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(109,"div",45)(110,"mat-form-field",46)(111,"mat-label"),e.\u0275\u0275text(112,"Serial Numbers"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(113,"textarea",47),e.\u0275\u0275listener("ngModelChange",function(r){return i.serialNumbers=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(114,"mat-icon",36),e.\u0275\u0275listener("click",function(){return i.serialNumbers=""}),e.\u0275\u0275text(115,"clear "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(116,"button",4),e.\u0275\u0275listener("click",function(){return i.makeBatchAddLocation(i.serialNumbers,i.modelName)}),e.\u0275\u0275text(117,"Create Locations "),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(67,Ni,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(21),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(69,P_,
1i.samheLabel?"red":"blue")),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",i.samheLabel?"SAMHE LABEL for UK Order":"OTHER LABEL for all other orders"," "),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("zoom",i.scaleFactor/100),e.\u0275\u0275advance(5),e.\u0275\u0275property("qrdata","WIFI:T:WPA;S:airgradient-"+(null==i.chipid?null:i.chipid.trim())+";P:cleanair;")("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.samheLabel),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.modelName===i.MonitorModels._8PSLM),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" AirGradient ",i.productFamilyName," "),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2("Model:",i.modelName,"-",i.serverid,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","8"==i.modelName.substr(0,1)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","8"!=i.modelName.substr(0,1)),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngIf",!i.isOpenAirFamily),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.isOpenAirFamily),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.isOpenAirFamily),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2("Model:",i.modelName,"-",i.serverid," "),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Made in ",i.madein,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.samheLabel),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isOpenAirFamily),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(71,Ni,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(7),e.\u0275\u0275property("regexString",i.SENSOR_ID_VALIDATION_STRING)("isLowerCaseOnly",!0)("ngModel",i.chipid),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden"),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",12!==(null==i.chipid?null:i.chipid.trim().length)),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("color",12!==(null==i.chipid?null:i.chipid.trim().length)?"currentcolor":"white"),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",12!==(null==i.chipid?null:i.chipid.trim().length)),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("color",12!==(null==i.chipid?null:i.chipid.trim().length)?"currentcolor":"white"),e.\u0275\u0275advance(3),e.\u0275\u0275property("disabled",12!==(null==i.chipid?null:i.chipid.trim().length)),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("color",12!==(null==i.chipid?null:i.chipid.trim().length)?"currentcolor":"white"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("Message: ",i.feedbackMessage,""),e.\u0275\u0275advance(4),e.\u0275\u0275property("value",i.scaleFactor),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.samheLabel),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(12),e.\u0275\u0275property("ngModel",i.serialNumbers),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.serialNumbers?"shown":"hidden"))},directives:[u.NgStyle,ce.Zl,V.SQ,z.lW,y.rH,V.Wh,V.xw,V.yH,Ot.V,u.NgIf,D.KE,D.hX,X.Nt,_.Fj,ft.J,_.nD,_.JJ,_.On,Q.Hw,D.R9,Ri.VQ,Ri.U0,zt.pH,an.IC],styles:["*[_ngcontent-%COMP%]:not(button){color:#000}@media print{@page{margin:0;color:#000!important;size:auto}.no-print[_ngcontent-%COMP%]{display:none}.print-only[_ngcontent-%COMP%]{display:block}}.smallLabel[_ngcontent-%COMP%]{font-size:12px;line-height:14px;color:#000}.mediumLabel[_ngcontent-%COMP%]{font-size:18px;color:#000;line-height:22px}.subHeaderQR[_ngcontent-%COMP%]{font-size:16px;color:#000;position:static;white-space:nowrap;z-index:10000;transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}form[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{text-transform:lowercase}.fs-18[_ngcontent-%COMP%]{font-size:18px;margin:5px 0}[_nghost-%COMP%] .mat-form-field-suffix .mat-icon{transform:scale(1.2)}"],data:{animation:[Ze.j]}}),n})();function M_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",37),e.\u0275\u0275element(1,"qrcode",6),e.\u0275\u0275elementStart(2,"div",38),e.\u0275\u0275text(3,"Quick Start "),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata","https://ebm-papst-neo.com/IAQ/")("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function A_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",39),e.\u0275\u0275element(1,"qrcode",6)(2,"div",40),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata",null==t.chipid?null:t.chipid.trim())("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function D_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",41)(1,"div",26)(2,"div",13),e.\u0275\u0275text(3,"A B + -"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",t.font)}}function O_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",42),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().download("ebm_manual_18NOV22.pdf")}),e.\u0275\u0275text(1,"Print ebm Manual "),e.\u0275\u0275elementEnd()}}const Vi=function(n){return{"background-color":n}};let L_=(()=>{class n{constructor(t,i,a,r,l,f){this.route=t,this.dataServices=i,this._messageService=a,this.placeServices=r,this.locationServices=l,this.sensorServices=f,this.MonitorModels=Se.c,this.chipid="211222222222",this.serialNumbers="123",this.serverid="",this.madein="Thailand",this.font="labelprinter",this.scaleFactor=32,this.modelName=Se.c._8PSLM,this.samheLabel=!1,this.feedbackMessage="",this.locations=[],this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(w=>
1{"sensor_location_added"===w&&(this.feedbackMessage="Monitor "+this.chipid+" added",setInterval(()=>{this.feedbackMessage=""},4e3))})}ngOnInit(){this.dataServices.currentScreen="Labels",this.route.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(t=>{this.chipid=t.serialno,this.serverid=bt.N.serverLocation})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}makeSamhe(t){t?(this.serverid="SGP",this.modelName=Se.c._8PSLDE,this.samheLabel=!0):(this.samheLabel=!1,this.modelName=Se.c._8PSL)}makeBatchAddLocation(t){this.locations=[];const i=t.split("\n");for(let a=0;a<i.length;a++)this.locations[a]=new Gn,this.locations[a].name=i[a].trim(),this.locations[a].maker_id="airgradient",this.locations[a].serialno=i[a].trim(),this.locations[a].controlled=!1,this.locations[a].active=!0,this.locations[a].indoor=!0;console.log(this.locations),this.locationServices.addBatchAddLocation(this.placeServices.currentPlace,JSON.stringify(this.locations))}onInput(t){"http"==this.chipid.substring(0,4)&&(this.chipid=this.chipid.substring(this.chipid.length-12,this.chipid.length)),"WIFI"==this.chipid.substring(0,4)&&(this.chipid=this.chipid.substring(this.chipid.length-24,this.chipid.length-12)),this.chipid=18==this.chipid.length?this.chipid.toLocaleLowerCase().substr(6,12):this.chipid.toLocaleLowerCase()}addSensorAndLocation(){const t=new Bn.f;t.name=this.chipid+" - "+this.modelName,t.active=!0,t.indoor=!0,this.sensorServices.addSensorAndLocation(this.placeServices.currentPlace.id,t,this.chipid.trim(),this.modelName),console.log("in print function")}printAndAdd(){this.addSensorAndLocation(),console.log("in print function"),window.print()}print(){window.print()}download(t){window.open("/assets/manual/"+t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(De.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-ebm-mb-label"]],decls:87,vars:67,consts:[[1,"no-print",2,"margin","10px",3,"ngStyle"],["fxLayoutAlign","start start","fxLayout","column","fxLayoutGap","0px",1,"no-print",2,"height","100%","padding-top","10px","margin-left","15px","background-color","white"],["id","label","id","content",1,"print-only",2,"background-color","white","padding","-10px 10px"],["fxFlex","row",2,"width","450px"],["fxLayout","row","fxLayoutAlign","start center"],["fxLayout","row","fxLayoutAlign","start center",2,"width","220px"],[3,"qrdata","scale","width","errorCorrectionLevel"],[1,"subHeaderQR",2,"margin-left","-60px","font-size","13px"],[2,"width","5px"],["fxLayout","row","fxLayoutAlign","center center","style","width: 200px",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","20px",2,"margin-left","20px","margin-top","-10px"],["src","/assets/modbus.webp","width","100px"],["fxLayout","column","fxLayoutAlign","center end",2,"margin-left","25px","padding-left","30px"],[1,"mediumLabel"],[1,"serialLabel"],["fxLayout","row","fxLayoutAlign","start end","fxLayoutGap","30px",2,"margin-top","10px","margin-bottom","10px","margin-left","25px"],["fxLayoutGap","10px","fxLayoutGap","30px"],["src","/assets/CE.svg","width","35px","height","35px"],["src","/assets/WEEE.svg","width","35px","height","35px"],["id","label","id","content",2,"background-color","white","padding","-10px 0px","margin-left","15px"],["fxLayout","row","fxLayoutAlign","start start",2,"width","450px"],["fxLayout","column","fxLayoutAlign","space-around start","fxLayoutGap","5px",2,"margin","20px","height","100%","padding-top","10px"],[1,"smallLabel"],["fxLayout","column","fxLayoutAlign","center center","style","width: 200px",4,"ngIf"],["id","label","id","content","fxLayout","row","fxLayoutAlign","end center",2,"background-color","white","margin-top","15px","margin-right","25px","padding","0px 0px"],["id","label","style","background-color: white;padding: 10px 10px; width: 140px","id","content","fxLayout","row","fxLayoutAlign","center center",4,"ngIf"],["fxLayout","column"],[1,"n
1o-print",2,"padding","20px",3,"ngStyle"],["appearance","fill",1,"example-full-width","form-field-responsive-s"],["matInput","","placeholder","Serial Number",3,"ngModel","change","ngModelChange"],["matSuffix","",1,"input-reset-btn",3,"click"],["thumbLabel","","tickInterval","1","step","1","min","0","max","100","aria-label","%",3,"value","valueChange"],["fxLayoutGap","10px","fxLayout","column"],["mat-flat-button","","type","button","color","primary",2,"max-width","600px","text-wrap","wrap",3,"disabled","click"],["fxLayout","row",1,"flex-wrap",2,"gap","10px"],["type","button","mat-flat-button","",3,"disabled","click"],["type","button","mat-flat-button","",3,"click",4,"ngIf"],["fxLayout","row","fxLayoutAlign","center center",2,"width","200px"],[1,"subHeaderQR",2,"margin-left","-40px","font-size","13px"],["fxLayout","column","fxLayoutAlign","center center",2,"width","200px"],[2,"margin-top","-20px","font-size","13px","text-align","center"],["id","label","id","content","fxLayout","row","fxLayoutAlign","center center",2,"background-color","white","padding","10px 10px","width","140px"],["type","button","mat-flat-button","",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"div",0)(2,"h3"),e.\u0275\u0275text(3,"EBM Modbus Label"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",1)(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5),e.\u0275\u0275element(9,"qrcode",6),e.\u0275\u0275elementStart(10,"div",7),e.\u0275\u0275text(11,"Add to WiFi/APP "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(12,"div",8),e.\u0275\u0275template(13,M_,4,6,"div",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",10),e.\u0275\u0275element(15,"img",11),e.\u0275\u0275elementStart(16,"div",12)(17,"div",13),e.\u0275\u0275text(18,"ebm-papst IAQ Monitor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",13),e.\u0275\u0275text(20,"Model:EPAQM-1"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",13),e.\u0275\u0275text(22,"MatNr: 8350000148"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",14),e.\u0275\u0275text(24),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(25,"div",15)(26,"div",13),e.\u0275\u0275text(27,"Contains FCC ID: "),e.\u0275\u0275element(28,"br"),e.\u0275\u0275text(29," 2AC7Z-ESP32WROVERE "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"div",16),e.\u0275\u0275element(31,"img",17)(32,"img",18),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(33,"div",19)(34,"div",20)(35,"div",21)(36,"div",13),e.\u0275\u0275text(37,"ebm-papst IAQ Monitor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"div",13),e.\u0275\u0275text(39,"Model:EPAQM-1"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"div",13),e.\u0275\u0275text(41,"MatNr: 8350000148"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(42,"div",13),e.\u0275\u0275text(43),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(44,"div",22),e.\u0275\u0275text(45,"ebm-papst neo GmbH&Co.KG"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"div",22),e.\u0275\u0275text(47,"Emil-Figge-Str. 80"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(48,"div",22),e.\u0275\u0275text(49,"D-44227 Dortmund"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(50,"div",22),e.\u0275\u0275text(51),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(52,A_,3,6,"div",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(53,"div",24),e.\u0275\u0275template(54,D_,4,2,"div",25),e.\u0275\u0275element(55,"qrcode",6),e.\u0275\u0275elementStart(56,"div",26)(57,"div",13),e.\u0275\u0275text(58,"ebm-papst IAQ Monitor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(59,"div",13),e.\u0275\u0275text(60,"Model:EPAQM-1"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(61,"div",13),e.\u0275\u0275text(62),e.\u0275\u0275elementEnd()()()()()()(),e.\u0275\u0275elementStart(63,"div",27)(64,"p")(65,"strong"),e.\u0275\u0275text(66,"Configuration"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(67,"mat-form-field",28)(68,"mat-label"),e.\u0275\u0275text(69,"Serial Number"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(70,"input",29),e.\u0275\u0275listener("change",function(){return i.onInput(i.chipid)})("ngModelChange",function(r){return i.chipid=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(71,"mat-icon",30),e.\u0275\u0275listener("click",function(){return i.chipid=""}),e.\u0275\u0275text(72,"clear "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(73,"p")(74,"strong"),e.\u0275\u0275text(75),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(76,"p")(77,"strong"),e.\u0275\u0275text(78,"Print Scaling"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(79,"mat-slider",31),e.\u0275\u0275listener("valueChange",function(r){return i.scaleFactor=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(80,"div",32)(81,"button",33),e.\u0275\u0275listener("click",function(){return i.printAndAdd()}),e.\u0275\u0275text(82),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(83,"div",34)(84,"button",35),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275text(85,"Print Only Label (no adding of location "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(86,O_,2,0,"button",36),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(63,Vi,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(3),e.\u0275\u0275styleProp("zoom",i.scaleFactor/100),e.\u0275\u0275advance(5),e.\u0275\u0275property("qrdata","WIFI:T:WPA;S:ebm-"+(null==i.chipid?null:i.chipid.trim())+";P:cleanair;")("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",
1i.font),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(4),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(10),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Made in ",i.madein,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.modelName===i.MonitorModels._8PSLM),e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata",null==i.chipid?null:i.chipid.trim())("scale",1)("width",100)("errorCorrectionLevel","M"),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(65,Vi,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.chipid),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden"),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("Message: ",i.feedbackMessage,""),e.\u0275\u0275advance(4),e.\u0275\u0275property("value",i.scaleFactor),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",12!=(null==i.chipid?null:i.chipid.trim().length)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate3(" Print Label and Add Monitor (",null==i.chipid?null:i.chipid.trim()," - ",i.modelName,") to Place ",null==i.placeServices||null==i.placeServices.currentPlace?null:i.placeServices.currentPlace.name," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",12!=(null==i.chipid?null:i.chipid.trim().length)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.samheLabel))},directives:[u.NgStyle,ce.Zl,V.Wh,V.xw,V.SQ,V.yH,Ot.V,u.NgIf,D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.On,Q.Hw,D.R9,zt.pH,z.lW],styles:["@media print{@page{margin:0;color:#000!important;size:auto}.no-print[_ngcontent-%COMP%]{display:none}.print-only[_ngcontent-%COMP%]{display:block}}.smallLabel[_ngcontent-%COMP%]{font-size:12px;line-height:14px;color:#000}.mediumLabel[_ngcontent-%COMP%]{font-size:14px;color:#000;line-height:16px}.serialLabel[_ngcontent-%COMP%]{font-size:18px;color:#000;line-height:20px}.modbusLabel[_ngcontent-%COMP%]{font-size:18px;color:#000;line-height:20px;outline:2px solid black;transform:rotate(45deg);padding:5px}.subHeaderQR[_ngcontent-%COMP%]{font-size:16px;color:#000;position:static;white-space:nowrap;z-index:10000;transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}form[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{text-transform:lowercase}"],data:{animation:[Ze.j]}}),n})();function F_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",31),e.\u0275\u0275element(1,"qrcode",19)(2,"div",32),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata",null==t.chipid?null:t.chipid.trim())("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",t.font)}}function R_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",33)(1,"div",20)(2,"div",6),e.\u0275\u0275text(3,"A B + -"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",t.font)}}function N_(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",34),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().download("outdoor_manual.pdf")}),e.\u0275\u0275text(1,"Print Outdoor Manual "),e.\u0275\u0275elementEnd()}}const Hi=function(n){return{"background-color":n}};let V_=(()=>{class n{constructor(t,i,a,r,l){this.route=t,this._messageService=i,this.placeServices=a,this.locationServices=r,this.sensorServices=l,this.MonitorModels=Se.c,this.chipid="211222222222",this.serialNumbers="123",this.serverid="",this.madein="Thailand",this.font="labelprinter",this.scaleFactor=32,this.modelName=Se.c._O1PP,this.samheLabel=!1,this.feedbackMessage="",this.locations=[],this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(f=>{"sensor_location_added"===f&&(this.feedbackMessage="Monitor "+this.chipid+" added",setInterval(()=>{this.feedbackMessage=""},4e3))})}ngOnInit(){this.route.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(t=>{this.chipid=t.serialno,this.serverid=bt.N.serverLocation})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}makeSamhe(t){t?(this.serverid="SGP",this.modelName=Se.c._8PSLDE,this.samheLabel=!0):(this.samheLabel=!1,this.modelName=Se.c._8PSL)}makeBatchAddLocation(t){this.locations=[];const i=t.split("\n");for(let a=0;a<i.length;a++)this.locations[a]=new Gn,this.locations[a].name=i[a].trim(),this.locations[a].maker_id="airgradient",this.locations[a].serialno=i[a].trim(),this.locations[a].controlled=!1,this.locations[a].active=!0,this.locations[a].indoor=!0;console.log(this.locations),this.locationServices.addBatchAddLocation(this.placeServices.currentPlace,JSON.stringify(this.locations))}onInput(t){"http"==this.chipid.substring(0,4)&&(this.chipid=this.chipid.substring(this.chipid.length-12,this.chipid.length)),"WIFI"==this.chipid.substring(0,4)&&(this.chipid=this.chipid.substring(this.chipid.length-24,this.chipid.length-12)),this.chipid=18==this.chipid.length?this.chipid.toLocaleLowerCase().substr(6,12):this.chipid.toLocaleLowerCase()}addSensorAndLocation(){const t=new Bn.f;t.name=this.chipid+" - "+this.modelName,t.active=!0,t.indoor=!1,this.sensorServices.addSensorAndLocation(this.placeServices.currentPlace.id,t,this.chipid.trim(),this.modelName),console.log("in print function")}printAndAdd(){this.addSensorAndLocation(),console.log("in print function"),window.print()}print(){window.print()}download(t){window.open("/assets/manual/"+t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(De.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-outdoor-label"]],decls:73,vars:53,consts:[[1,"no-print",2,"margin","10px",3,"ngStyle"],["fxLayoutAlign","start start","fxLayout","column","fxLayoutGap","0px",1,"no-print",2,"height","100%","padding-top","10px","margin-left","15px","background-color","white"],["id","label","id","content",1,"print-only",2,"background-color","white","padding","-10px 10px"],["fxFlex","row",2,"width","450px"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","20px",2,"margin-left","20px","margin-top","-10px"],["fxLayout","column","fxLayoutAlign","start start",2,"margin-left","25px","padding-left","30px"],[1,"mediumLabel"],[1,"serialLabel"],["fxLayout","row","fxLayoutAlign","start end","fxLayoutGap","30px",2,"margin-top","10px","margin-bottom","10px","margin-left","25px"],["fxLayoutGap","10px","fxLayoutGap","30px"],["src","/assets/CE.svg","width","35px","height","35px"],["src","/assets/WEEE.svg","width","35px","height","35px"],["id","label","id","content",2,"background-color","white","padding","-10px 0px","margin-left","15px"],["fxLayout","row","fxLayoutAlign","start start",2,"width","450px"],["fxLayout","column","fxLayoutAlign","space-around start","fxLayoutGap","5px",2,"margin","20p
1x","height","100%","padding-top","10px"],[1,"smallLabel"],["fxLayout","column","fxLayoutAlign","center center","style","width: 200px",4,"ngIf"],["id","label","id","content","fxLayout","row","fxLayoutAlign","end center",2,"background-color","white","margin-top","15px","margin-right","25px","padding","0px 0px"],["id","label","style","background-color: white;padding: 10px 10px; width: 140px","id","content","fxLayout","row","fxLayoutAlign","center center",4,"ngIf"],[3,"qrdata","scale","width","errorCorrectionLevel"],["fxLayout","column"],[1,"no-print",2,"padding","20px",3,"ngStyle"],["appearance","fill",1,"example-full-width","form-field-responsive-s"],["matInput","","placeholder","Serial Number",3,"ngModel","change","ngModelChange"],["matSuffix","",1,"input-reset-btn",3,"click"],["thumbLabel","","tickInterval","1","step","1","min","0","max","100","aria-label","%",3,"value","valueChange"],["fxLayoutGap","10px","fxLayout","column"],["mat-flat-button","","type","button","color","primary",2,"max-width","600px","text-wrap","wrap",3,"disabled","click"],["fxLayout","row",1,"flex-wrap",2,"gap","10px"],["type","button","mat-flat-button","",3,"disabled","click"],["type","button","mat-flat-button","",3,"click",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center",2,"width","200px"],[2,"margin-top","-20px","font-size","13px","text-align","center"],["id","label","id","content","fxLayout","row","fxLayoutAlign","center center",2,"background-color","white","padding","10px 10px","width","140px"],["type","button","mat-flat-button","",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"div",0)(2,"h3"),e.\u0275\u0275text(3,"Outdoor Label"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",1)(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6),e.\u0275\u0275text(10,"AirGradient Outdoor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"div",6),e.\u0275\u0275text(12,"Model:O-1PP"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",7),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(15,"div",8)(16,"div",6),e.\u0275\u0275text(17,"Contains FCC ID: "),e.\u0275\u0275element(18,"br"),e.\u0275\u0275text(19," 2AC7Z-ESPC3MINI1 "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"div",9),e.\u0275\u0275element(21,"img",10)(22,"img",11),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(23,"div",12)(24,"div",13)(25,"div",14)(26,"div",6),e.\u0275\u0275text(27,"AirGradient Outdoor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"div",15),e.\u0275\u0275text(29,"Model:O-1PP"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"div",6),e.\u0275\u0275text(31),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"div",6),e.\u0275\u0275text(33,"Made in Thailand"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(34,"div",15),e.\u0275\u0275text(35,"AirGradient Ltd."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(36,"div",15),e.\u0275\u0275text(37,"50180 Chiang Mai Thailand"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(38,F_,3,6,"div",16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(39,"div",17),e.\u0275\u0275template(40,R_,4,2,"div",18),e.\u0275\u0275element(41,"qrcode",19),e.\u0275\u0275elementStart(42,"div",20)(43,"div",6),e.\u0275\u0275text(44,"AirGradient Outdoor"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(45,"div",6),e.\u0275\u0275text(46,"Model:O-1PP"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(47,"div",6),e.\u0275\u0275text(48),e.\u0275\u0275elementEnd()()()()()()(),e.\u0275\u0275elementStart(49,"div",21)(50,"p")(51,"strong"),e.\u0275\u0275text(52,"Configuration"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(53,"mat-form-field",22)(54,"mat-label"),e.\u0275\u0275text(55,"Serial Number"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"input",23),e.\u0275\u0275listener("change",function(){return i.onInput(i.chipid)})("ngModelChange",function(r){return i.chipid=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(57,"mat-icon",24),e.\u0275\u0275listener("click",function(){return i.chipid=""}),e.\u0275\u0275text(58,"clear"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(59,"p")(60,"strong"),e.\u0275\u0275text(61),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(62,"p")(63,"strong"),e.\u0275\u0275text(64,"Print Scaling"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(65,"mat-slider",25),e.\u0275\u0275listener("valueChange",function(r){return i.scaleFactor=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(66,"div",26)(67,"button",27),e.\u0275\u0275listener("click",function(){return i.printAndAdd()}),e.\u0275\u0275text(68),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(69,"div",28)(70,"button",29),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275text(71,"Print Only Label (no adding of location) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(72,N_,2,0,"button",30),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(49,Hi,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(3),e.\u0275\u0275styleProp("zoom",i.scaleFactor/100),e.\u0275\u0275advance(5),e.\u0275\u0275styleProp("font-family",
1i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(10),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.samheLabel),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.modelName===i.MonitorModels._8PSLM),e.\u0275\u0275advance(1),e.\u0275\u0275property("qrdata",null==i.chipid?null:i.chipid.trim())("scale",1)("width",100)("errorCorrectionLevel","M"),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(51,Hi,i.samheLabel?"#ffcccb":"#00c3e3")),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.chipid),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden"),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("Message: ",i.feedbackMessage,""),e.\u0275\u0275advance(4),e.\u0275\u0275property("value",i.scaleFactor),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",(null==i.chipid?null:i.chipid.trim().length)<1),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate3(" Print Label and Add Monitor (",null==i.chipid?null:i.chipid.trim()," - ",i.modelName,") to Place ",null==i.placeServices||null==i.placeServices.currentPlace?null:i.placeServices.currentPlace.name," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",(null==i.chipid?null:i.chipid.trim().length)<1),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.samheLabel))},directives:[u.NgStyle,ce.Zl,V.Wh,V.xw,V.SQ,V.yH,u.NgIf,Ot.V,D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.On,Q.Hw,D.R9,zt.pH,z.lW],styles:["@media print{@page{margin:0;color:#000!important;size:auto}.no-print[_ngcontent-%COMP%]{display:none}.print-only[_ngcontent-%COMP%]{display:block}}.smallLabel[_ngcontent-%COMP%]{font-size:12px;line-height:14px;color:#000}.mediumLabel[_ngcontent-%COMP%]{font-size:14px;color:#000;line-height:16px}.serialLabel[_ngcontent-%COMP%]{font-size:18px;color:#000;line-height:20px}.modbusLabel[_ngcontent-%COMP%]{font-size:18px;color:#000;line-height:20px;outline:2px solid black;transform:rotate(45deg);padding:5px}.subHeaderQR[_ngcontent-%COMP%]{font-size:16px;color:#000;position:static;white-space:nowrap;z-index:10000;transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}form[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{text-transform:lowercase}"],data:{animation:[Ze.j]}}),n})();var $t=d(61245),zn=d(28142),H_=d(30589);const j_=function(n){return{fontFamily:n}};let B_=(()=>{class n{constructor(t,i,a,r,l,f){this.route=t,this.dataServices=i,this.displayServices=a,this.places=r,this._messageService=l,this.translateService=f,this.environment=bt.N,this.typeOfDisplay=$t.x.classic,this.destroy$=new H.xQ}ngOnInit(){var t,i;this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(a=>{"admin_displays_loaded"===a&&this.getDisplayName()}),this.route.snapshot.params.displayType&&(this.typeOfDisplay=this.route.snapshot.params.displayType),this.route.snapshot.params.displayHash&&(this.displayHash=this.route.snapshot.params.displayHash),(null===(t=this.displayServices.filtered_displays)||void 0===t?void 0:t.length)?this.getDisplayName():this.displayServices.getDisplays(null===(i=this.places.currentPlace)||void 0===i?void 0:i.id,!0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.translateService.use("en")}print(){window.print()}back(){window.history.back()}getDisplayName(){var t,i;this.displayName=null===(i=null===(t=this.displayServices)||void 0===t?void 0:t.filtered_displays.find(a=>a.url.substr(13,10)===this.displayHash))||void 0===i?void 0:i.notes}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(zn.sK))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-print-display-qr"]],decls:19,vars:14,consts:[["fxLayoutGap","20px","fxLayout","column","fxLayoutAlign","space-between center","fxLayoutGap","10px",1,"print",2,"padding","20px",3,"ngStyle"],[1,"no-print"],[1,"spacer-top-lg",2,"font-size","64px"],[2,"font-size","24px"],[3,"qrdata","scale","width","errorCorrectionLevel"],[2,"font-size","14px"],["fxLayout","column","fxLayoutAlign","space-between center","fxLayoutGap","10px",1,"no-print"],["mat-button","","type","button",1,"no-print","button-secondary",3,"click"],["mat-button","","type","button",1,"button-secondary","no-print",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275element(1,"app-language-selector",1),e.\u0275\u0275elementStart(2,"div",2)(3,"strong"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(5,"div",3),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"qrcode",4),e.\u0275\u0275elementStart(9,"div",5),e.\u0275\u0275text(10),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div",5),e.\u0275\u0275text(13,"www.airgradient.com"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(14,"div",6)(15,"button",7),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275text(16," Print "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"button",8),e.\u0275\u0275listener("click",function(){return i.back()}),e.\u0275\u0275text(18," Back to Previous Screen "),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(12,j_,"lo"===i.translateService.currentLang?"var(--lao-lang-phetsarath-font)":"inherit")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",i.displayName," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(7,8,"display.SCAN_QR")),e.\u0275\u0275advance(2),e.\u0275\u0275property("qrdata",i.environment.domain+"/display/"+i.displayHash+"/"+i.typeOfDisplay)("scale",1)("width",300)("errorCorrectionLevel","M"),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(11,10,"display.AIRGRADIENT_SOLUTIONS")))},directives:[V.SQ,V.xw,V.Wh,u.NgStyle,ce.Zl,H_.S,Ot.V,z.lW],pipes:[zn.X$],styles:["@media print{.no-print[_ngcontent-%COMP%]{display:none!important}}form[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{text-transform:lowercase}app-language-selector[_ngcontent-%COMP%]{position:absolute;top:80px;right:15px}"]}),n})();var rt=d(80013),We=(()=>{return(n=We||(We={})).pending="pending",n.found="found",n.not_found="not_found",We;var n})();const G_=[Se.c._O1PP,Se.c._O1PPT];var Bi=d(20773);function U_(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",30),e.\u0275\u0275text(1," do_not_disturb_on "),e.\u0275\u0275elementEnd())}function W_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span",28),e.\u0275\u0275template(1,U_,2,0,"mat-icon",29),e.\u0275\u0275text(2," no data "),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.testReportStatus===t.testReportStatusType.found)}}function Q_(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span",31)(1,"mat-icon",32),e.\u0275\u0275text(2,"check"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.currentFwId," ")}}function q_(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," no data "),e.\u0275\u0275elementEnd())}function K_(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",28)(1,"mat-icon",30),e.\u0275\u0275text(2,"do_not_disturb_on"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3," not available "),e.\u0275\u0275elementEnd())}function Y_(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",28)(1,"mat-icon",32),e.\u0275\u0275text(2,"check"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3," available "),e.\u0275\u0275elementEnd())}function X_(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," no data "),e.\u0275\u0275elementEnd())}function Z_(n,o){1&n&&e.\u0275\u0275element(0,"mat-spinner",33)}let J_=(()=>{class n{constructor(t,i,a){this.httpHelper=t,this.dataServices=i,this.sensorServices=a,this.chipid="",this.serverid="",this.font="labelprinter",this.scaleFactor=32,this.testReportStatus=We.pending,this.testReportStatusType=We,this.sensorControl=new _.NI(""),this.loading=!1,this.currentFwId=null,this.SENSOR_ID_VALIDATION_
1STRING=Ht.A,this.destroy$=new H.xQ}get productFamilyName(){return(0,Fi.h)(this.modelName)}ngOnInit(){this.dataServices.currentScreen="Checkout",this.serverid=bt.N.serverLocation,this.subscribeToSensorControl()}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}checkSensorReport(){this.loading=!0,this.currentFwId=null,this.sensorServices.getSensorTestReport(this.chipid).pipe((0,A.R)(this.destroy$)).subscribe(t=>{var i,a;this.sensorTestReport=null==t?void 0:t.test_report,this.modelName=(null===(a=null===(i=null==t?void 0:t.test_report)||void 0===i?void 0:i.testData)||void 0===a?void 0:a.model)||null,this.currentFwId=(null==t?void 0:t.current_fw_id)||null,this.testReportStatus=function $_(n){var o,t,i;const a=null===(t=null===(o=null==n?void 0:n.testData)||void 0===o?void 0:o.overallPass)||void 0===t?void 0:t.trim(),r=null===(i=null==n?void 0:n.testData)||void 0===i?void 0:i.model;return(G_.includes(r)?["Pass","Limited Pass"]:["Pass"]).includes(a)?We.found:We.not_found}(null==t?void 0:t.test_report),this.loading=!1},t=>{this.modelName=null,this.currentFwId=null,404===t.status?this.testReportStatus=We.not_found:(this.httpHelper.handleHttpErrorMessage(t),this.testReportStatus=We.pending),this.loading=!1})}print(){window.print()}clearValue(){this.sensorControl.setValue("")}subscribeToSensorControl(){this.sensorControl.valueChanges.pipe((0,A.R)(this.destroy$),(0,It.U)(t=>null==t?void 0:t.trim()),(0,Cn.b)(t=>{12!==(null==t?void 0:t.length)&&(this.modelName=null,this.testReportStatus=We.pending,this.currentFwId=null)}),(0,rt.b)(400)).subscribe(t=>{this.chipid=t,12===t.length&&this.checkSensorReport()})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(De.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-checkout"]],decls:78,vars:63,consts:[[1,"no-print","blue-bg",2,"margin","10px"],["fxLayoutAlign","start start","fxLayout","column","fxLayoutGap","0px",1,"no-print",2,"height","320px","padding-top","10px","margin-left","15px","background-color","white"],["fxLayout","row","fxLayoutGap","15px","fxLayoutAlign","start center",2,"height","100%"],["id","label","id","content",1,"print-only","single-label"],[1,"mediumLabel",2,"margin-left","20px"],["fxLayout","row"],[1,"text-label-content"],[1,"smallLabel"],[1,"smallLabel",2,"margin-bottom","10px"],[3,"qrdata","scale","width","errorCorrectionLevel"],[1,"no-print","blue-bg",2,"padding","20px"],["appearance","fill",1,"example-full-width","form-field-responsive-s"],["matInput","","placeholder","Serial Number","appRegexInputValidation","","maxlength","12",3,"regexString","isLowerCaseOnly","formControl"],["matSuffix","",1,"input-reset-btn",3,"click"],[2,"margin","30px 0 50px"],[1,"report-feedback"],[1,"model-wrap"],[2,"margin-right","10px"],["class","flex-space-between",4,"ngIf"],["class","flex-space-between","style","margin-right: 30px",4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","flex-space-between",4,"ngSwitchCase"],[4,"ngIf"],[2,"margin-right","30px"],["thumbLabel","","tickInterval","1","step","1","min","1","max","100","aria-label","%",3,"value","valueChange"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"],["class","main-loader fixed small",4,"ngIf"],[1,"flex-space-between"],["class","error-icon",4,"ngIf"],[1,"error-icon"],[1,"flex-space-between",2,"margin-right","30px"],[1,"passed-icon"],[1,"main-loader","fixed","small"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"div",0)(2,"h3"),e.\u0275\u0275text(3,"Monitor Checkout"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",1)(5,"div",2)(6,"div",3)(7,"div",4),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div",5)(10,"div",6)(11,"div",7),e.\u0275\u0275text(12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",8),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"div",7),e.\u0275\u0275text(16,"AirGradient Ltd."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",7),e.\u0275\u0275text(18,"50180 Chiang Mai"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",7),e.\u0275\u0275text(20,"Thailand"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(21,"qrcode",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"div",4),e.\u0275\u0275text(23),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(24,"div",3)(25,"div",4),e.\u0275\u0275text(26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"div",5)(28,"div",6)(29,"div",7),e.\u0275\u0275text(30),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"div",8),e.\u0275\u0275text(32),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(33,"div",7),e.\u0275\u0275text(34,"AirGradient Ltd."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"div",7),e.\u0275\u0275text(36,"50180 Chiang Mai"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(37,"div",7),e.\u0275\u0275text(38,"Thailand"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(39,"qrcode",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"div",4),e.\u0275\u0275text(41),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(42,"div",10)(43,"mat-form-field",11)(44,"mat-label"),e.\u0275\u0275text(45,"Serial Number"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(46,"input",12),e.\u0275\u0275elementStart(47,"mat-icon",13),e.\u0275\u0275listener("click",function(){return i.clearValue()}),e.\u0275\u0275text(48,"clear"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(49,"div",14)(50,"div",15)(51,"div",16)(52,"strong",17),e.\u0275\u0275text(53," Firmware: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(54,W_,3,1,"span",18),e.\u0275\u0275template(55,Q_,4,1,"span",19),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(56,"div",15)(57,"strong"),e.\u0275\u0275text(58,"Factory Test Report:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerStart(59,20),e.\u0275\u0275template(60,q_,2,0,"span",21),e.\u0275\u0275template(61,K_,4,0,"span",22),e.\u0275\u0275template(62,Y_,4,0,"span",22),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(63,"div",15)(64,"div",16)(65,"strong",17),e.\u0275\u0275text(66," Detected Sensor Model: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(67,X_,2,0,"span",23),e.\u0275\u0275elementStart(68,"span",24),e.\u0275\u0275text(69),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(70,"p")(71,"strong"),e.\u0275\u0275text(72,"Print Scaling"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(73,"mat-slider",25),e.\u0275\u0275listener("valueChange",function(r){return i.scaleFactor=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(74,"div")(75,"button",26),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275text(76,"Print Labels "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(77,Z_,1,0,"mat-spinner",27)),2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275styleProp("zoom",i.scaleFactor/100),e.\u0275\u0275advance(3),e.\u0275\u0275styleProp("font-family",
1i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("AirGradient ",i.productFamilyName,""),e.\u0275\u0275advance(3),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Model:",i.modelName,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Firmware: ",i.currentFwId,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden")("qrdata",null==i.chipid?null:i.chipid.trim())("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid," "),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("AirGradient ",i.productFamilyName," "),e.\u0275\u0275advance(3),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Model:",i.modelName,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("Firmware: ",i.currentFwId,""),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(2),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden")("qrdata",null==i.chipid?null:i.chipid.trim())("scale",1)("width",180)("errorCorrectionLevel","M"),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("font-family",i.font),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("S/N:",i.chipid," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("regexString",i.SENSOR_ID_VALIDATION_STRING)("isLowerCaseOnly",!0)("formControl",i.sensorControl),e.\u0275\u0275advance(1),e.\u0275\u0275property("@hideInOut",i.chipid?"shown":"hidden"),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngIf",!i.currentFwId),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.currentFwId),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngSwitch",i.testReportStatus),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngSwitchCase",i.testReportStatusType.pending),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngSwitchCase",i.testReportStatusType.not_found),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngSwitchCase",i.testReportStatusType.found),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",!i.modelName),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(i.modelName),e.\u0275\u0275advance(4),e.\u0275\u0275property("value",i.scaleFactor),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",i.testReportStatus!==i.testReportStatusType.found||!i.currentFwId),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.loading))},directives:[V.Wh,V.xw,V.SQ,Ot.V,D.KE,D.hX,X.Nt,_.Fj,ft.J,_.nD,_.JJ,_.oH,Q.Hw,D.R9,u.NgIf,u.NgSwitch,u.NgSwitchCase,zt.pH,z.lW,Bi.Ou],styles:["@media print{@page{margin:0;color:#000!important;size:auto}.no-print[_ngcontent-%COMP%]{display:none}.print-only[_ngcontent-%COMP%]{display:block}}.smallLabel[_ngcontent-%COMP%]{font-size:18px;line-height:1.15;color:#000}.mediumLabel[_ngcontent-%COMP%]{font-size:24px;color:#000;line-height:1.15}.blue-bg[_ngcontent-%COMP%]{background-color:#00c3e3}form[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{text-transform:lowercase}.report-feedback[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}.model-wrap[_ngcontent-%COMP%]{display:flex;align-items:center}.passed-icon[_ngcontent-%COMP%]{border-radius:50%;color:#fff;background-color:var(--successColor);margin-right:10px}.error-icon[_ngcontent-%COMP%]{color:#d52208;margin-right:10px}.single-label[_ngcontent-%COMP%]{width:450px;height:100%;padding-top:20px;box-sizing:border-box}.text-label-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;margin:15px 15px 10px 20px}*[_ngcontent-%COMP%]{color:#000}"],data:{animation:[Ze.j]}}),n})();var pn=d(63601);let $n=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i}getPickups(){this.httpHelper.get("/logistic/private/pickups").subscribe(i=>{this.listOfPickups=i,this._messageService.sendMessage("pickups_loaded")},i=>{this.httpHelper.handleHttpErrorMessage(i)})}deletePickup(t){this.httpHelper.delete("/logistic/private/pickups/"+t).subscribe(()=>{},i=>{this.httpHelper.handleHttpErrorMessage(i)},()=>{this.getPickups(),this.httpHelper.showSnackbar(`Pickup #${t} successfully deleted!`)})}flagAsPacked(t){this.httpHelper.put("/logistic/private/pickups/"+t+"/packed",{pickupId:t}).subscribe(()=>{},i=>{this.httpHelper.handleHttpErrorMessage(i)},()=>{this.getPickups(),this.httpHelper.showSnackbar("Successfully flagged as Packed!")})}printLabelsData(t){this.httpHelper.get(`/logistic/private/pickups/${t}`).subscribe(a=>{this.currentPrintLabelsInformation=a,this._messageService.sendMessage("pickup_print_info_loaded")},a=>
1{this.httpHelper.handleHttpErrorMessage(a)})}saveTrackingNumbers(t,i,a){this.httpHelper.put(`/logistic/private/pickups/${t}/orders/${i}/tracking`,{tracking_number:a}).subscribe(()=>{},r=>{this.httpHelper.handleHttpErrorMessage(r)},()=>{this._messageService.sendMessage("tracking_numbers_saved")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var xt=(()=>{return(n=xt||(xt={})).other="other",n.flash="flash",n.dhl="dhl",n.ems="ems",xt;var n})(),mn=d(82411);function ef(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",4),2&n&&e.\u0275\u0275property("message","pickups")}function tf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",20),e.\u0275\u0275text(1,"Id"),e.\u0275\u0275elementEnd())}function nf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21)(1,"span",22),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.id)}}function af(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",20),e.\u0275\u0275text(1," Packing Date "),e.\u0275\u0275elementEnd())}function of(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.date_packed,"MMM d, YYY")||"Not packed yet"," ")}}function rf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",20),e.\u0275\u0275text(1,"Creation Date"),e.\u0275\u0275elementEnd())}function lf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(2,1,t.date_created,"MMM d, YYY"))}}function sf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",20),e.\u0275\u0275text(1,"Amount of Orders"),e.\u0275\u0275elementEnd())}function cf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.orders,"")}}function pf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",20),e.\u0275\u0275text(1,"Tracking Status"),e.\u0275\u0275elementEnd())}function mf(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",29),2&n){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275property("statusText","\u0e43\u0e2a\u0e48\u0e40\u0e25\u0e02\u0e41\u0e17\u0e23\u0e04\u0e41\u0e25\u0e49\u0e27")("statusTooltipText","All tracking numbers are entered for this pickup")("statusChipType",t.ChipType.success)}}function df(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",29),2&n){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275property("statusText","\u0e23\u0e2d\u0e40\u0e25\u0e02\u0e41\u0e17\u0e23\u0e04")("statusTooltipText","Awaiting all tracking numbers")("statusChipType",t.ChipType.pending)}}function uf(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,mf,1,3,"app-chip-status",28),e.\u0275\u0275template(2,df,1,3,"app-chip-status",28),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(2).$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.tracking_numbers===t.orders),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.tracking_numbers!==t.orders)}}function _f(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",29),2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("statusText","\u0e41\u0e1e\u0e47\u0e04\u0e41\u0e25\u0e49\u0e27")("statusTooltipText","Packed")("statusChipType",t.ChipType.success)}}function ff(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",25),e.\u0275\u0275template(1,uf,3,2,"ng-container",26),e.\u0275\u0275template(2,_f,1,3,"ng-template",null,27,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275reference(3),i=e.\u0275\u0275nextContext().$implicit,a=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.shipping_provider===a.ShippingProviders.flash||i.shipping_provider===a.ShippingProviders.ems)("ngIfElse",t)}}function hf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275element(1,"app-chip-status",29),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("statusText","\u0e23\u0e2d\u0e41\u0e1e\u0e47\u0e04")("statusTooltipText","Awaiting packing")("statusChipType",t.ChipType.warning)}}function gf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21),e.\u0275\u0275template(1,ff,4,2,"div",23),e.\u0275\u0275template(2,hf,2,3,"div",24),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!t.date_packed),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.date_packed)}}function vf(n,o){1&n&&e.\u0275\u0275element(0,"th",20)}function Cf(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",25)(1,"button",30),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).navigateToTrackingNumbersTable(a.id)}),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275element(3,"mat-icon",31),e.\u0275\u0275text(4," Tracking List "),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",!t.date_packed)("matTooltipShowDelay",800)("matTooltip",t.date_packed?"Go to the list of tracking numbers":"You need to pack the pickup first"),e.\u0275\u0275advance(2),e.\u0275\u0275classMap(t.date_packed?"inline-icon":"auto-colour-inline-icon")}}function bf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",21),e.\u0275\u0275template(1,Cf,5,5,"div",23),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.shipping_provider===i.ShippingProviders.flash||t.shipping_provider===i.ShippingProviders.ems)}}function xf(n,o){1&n&&e.\u0275\u0275element(0,"th",32)}function yf(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",21)(1,"button",33),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).flagAsPacked(r.id)}),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275element(3,"mat-icon",34),e.\u0275\u0275text(4," Packed "),e.\u0275\u0275elementEnd()()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltipShowDelay",800)("matTooltip",t.date_packed?"This pickup is already packed":"Flag pickup as packed")("disabled",t.date_packed),e.\u0275\u0275advance(2),e.\u0275\u0275classMap(t.date_packed?"auto-colour-inline-icon":"inl
1ine-icon"),e.\u0275\u0275property("svgIcon",t.date_packed?"packaged_box":"pack_box")}}function Sf(n,o){1&n&&e.\u0275\u0275element(0,"th",32)}function wf(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",21)(1,"button",35),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).printPickupLabels(r.id)}),e.\u0275\u0275elementStart(2,"mat-icon",36),e.\u0275\u0275text(3,"print"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5," Print "),e.\u0275\u0275elementEnd()()()}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltipShowDelay",800)("matTooltip","Print pickup labels"))}function Ef(n,o){1&n&&e.\u0275\u0275element(0,"th",32)}const Tf=function(){return{"margin-left":"var(--xs-size)"}};function If(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",21)(1,"button",37),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).deletePickupNode(r.id)}),e.\u0275\u0275elementStart(2,"mat-icon"),e.\u0275\u0275text(3,"delete "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4," Delete "),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction0(6,Tf))("disabled",t.date_packed)("matTooltipShowDelay",800)("matTooltip",t.date_packed?"Packed pickup can not be deleted":"Delete Pickup Node"),e.\u0275\u0275advance(1),e.\u0275\u0275classMap(t.date_packed?"auto-colour-inline-icon":"inline-icon")}}function Pf(n,o){1&n&&e.\u0275\u0275element(0,"tr",38)}function kf(n,o){1&n&&e.\u0275\u0275element(0,"tr",39)}function Mf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",5),e.\u0275\u0275elementContainerStart(1,6),e.\u0275\u0275template(2,tf,2,0,"th",7),e.\u0275\u0275template(3,nf,3,1,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,9),e.\u0275\u0275template(5,af,2,0,"th",7),e.\u0275\u0275template(6,of,3,4,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,10),e.\u0275\u0275template(8,rf,2,0,"th",7),e.\u0275\u0275template(9,lf,3,4,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,11),e.\u0275\u0275template(11,sf,2,0,"th",7),e.\u0275\u0275template(12,cf,2,1,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,12),e.\u0275\u0275template(14,pf,2,0,"th",7),e.\u0275\u0275template(15,gf,3,2,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,13),e.\u0275\u0275template(17,vf,1,0,"th",7),e.\u0275\u0275template(18,bf,2,1,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,14),e.\u0275\u0275template(20,xf,1,0,"th",15),e.\u0275\u0275template(21,yf,5,6,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,16),e.\u0275\u0275template(23,Sf,1,0,"th",15),e.\u0275\u0275template(24,wf,6,2,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,17),e.\u0275\u0275template(26,Ef,1,0,"th",15),e.\u0275\u0275template(27,If,5,7,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(28,Pf,1,0,"tr",18),e.\u0275\u0275template(29,kf,1,0,"tr",19),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(28),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let Af=(()=>{class n{constructor(t,i,a,r,l){this.pickupsService=t,this._messageService=i,this.router=a,this.dataServices=r,this.dialog=l,this.ShippingProviders=xt,this.ChipType=mn.x,this.isTableEmpty=!1,this.displayedColumns=["id","date_created","date_packed","orders","pickup_status","tracking_numbers_list","packed_pickup","print_label","delete_pickup_note"],this.destroy$=new H.xQ}ngOnInit(){this.dataServices.currentScreen="Pickups",this.pickupsService.getPickups(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"pickups_loaded"===t&&(this.dataSource=new h.by(this.pickupsService.listOfPickups),this.isTableEmpty=!this.pickupsService.listOfPickups.length,this.dataSource.sort=this.sort)})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}flagAsPacked(t){this.dialog.open(he.$,{width:"350px",data:`Are you sure you want to flag the pickup #${t} as packed?`}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.pickupsService.flagAsPacked(t)})}deletePickupNode(t){this.dialog.open(he.$,{width:"350px",data:`Are you sure you want to delete pickup #${t}?`}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.pickupsService.deletePickup(t)})}printPickupLabels(t){this.router.navigate([`settings/pickups/print/${t}`])}navigateToTrackingNumbersTable(t){this.router.navigate([`settings/pickups/tracking-table/${t}`])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject($n),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-pickups"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:4,vars:2,consts:[[1,"page"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","id","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","date_packed"],["matColumnDef","date_created"],["matColumnDef","orders"],["matColumnDef","pickup_status"],["matColumnDef","tracking_numbers_list"],["matColumnDef","packed_pickup"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","print_label"],["matColumnDef","delete_pickup_note"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"spacer-right-xs"],["class","button-with-status",4,"ngIf"],[4,"ngIf"],[1,"button-with-status"],[4,"ngIf","ngIfElse"],["noFlashOrEMSPacked",""],[3,"statusText","statusTooltipText","statusChipType",4,"ngIf"],[3,"statusText","statusTooltipText","statusChipType"],["mat-button","","type","button","aria-label","Enter Tracking Numbers",1,"button-secondary",3,"disabled","matTooltipShowDelay","matTooltip","click"],["svgIcon","shipping-track"],["mat-header-cell",""],["type","button","mat-button","","aria-label","Pack button","appMatTooltipToggleMechanism","",1,"button-secondary","spacer-right-xxs",3,"matTooltipShowDelay","matTooltip","disabled","click"],[3,"svgIcon"],["type","button","mat-button","","aria-label","Print pickup button",1,"button-secondary",3,"matTooltipShowDelay","matTooltip","click"],[1,"inline-icon"],["type","button","mat-button","","aria-label","Delete button","appMatTooltipToggleMechanism","",1,"button-danger",3,"ngStyle","disabled","matTooltipShowDelay","matTooltip","click"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"div",1),e.\u0275\u0275template(2,ef,1,1,"app-no-data",2),e.\u0275\u0275template(3,Mf,30,3,"table",3),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[u.NgIf,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Bt.W,z.lW,Ue.gM,Q.Hw,Fn.P,u.NgStyle,ce.Zl,h.as,h.XQ,h.nj,h.Gk],pipes:[u.DatePipe],styles:[".mat-icon[_ngcontent-%COMP%]{transform:scale(.9)}.page[_ngcontent-%COMP%]{padding:20px;box-sizing:border-box}.button-with-status[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mat-cell[_ngcontent-%COMP%]{padding:0 var(--xxs-size)}"]}),n})(),nt=(()=>{class n{constructor(t,i,a,r,l){this.router=t,this.dataServices=i,this.logging=a,this.placeService=r,this.userService=l}canActivate(){var t,i;if((null===(t=this.userService.currentUser)||void 0===t?void 0:t.authenticated)&&(null===(i=this.placeService)||void 0===i?void 0:i.currentPlace))return!!this.userService.currentUser.support_staff||(this.router.navigate(["/dashboard"]),!1);const a=new H.xQ;return this.dataServices.combinedUserPlaceData.subscribe(([r,l])=>{if(r){if(this.logging.sendLogEntry("Authenticated","success"),r.support_staff)return a.next(!0),!0;a.next(!1),this.router.navigate(["/dashboard"])}else this.dataServices.appLoader=!0,a.next(!1),this.router.navigate(["/signin"])}),a.asObservable()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(y.F0),e.\u0275\u0275inject(ee.O),e.\u0275\u0275inject(Sn.J),e.\u0275\u0275inject(R.E),e.\u0275\u0275inject(xe.K))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Df(n,o){1&n&&e.\u0275\u0275element(0,"app-progress-bar")}function Of(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",10)(1,"div",11),e.\u0275\u0275element(2,"ngx-barcode6",12),e.\u0275\u0275elementStart(3,"p",13)(4,"strong"),e.\u0275\u0275text(5,"From:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"p",14)(8,"strong"),e.\u0275\u0275text(9,"To:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"p",13)(12,"strong"),e.\u0275\u0275text(13,"PickupID:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(14),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("zoom",t.scaleFactor/100),e.\u0275\u0275advance(1),e.\u0275\u0275property("bc-height",80)("bc-width",1.3)("bc-font-size",12)("bc-value",t.currentPrintLabelsInformation.barcode)("bc-display-value",!0),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.currentPrintLabelsInformation.from," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.currentPrintLabelsInformation.to," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.currentPrintLabelsInformation.id," ")}}function Lf(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"p",13),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit,i=o.last;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.quantity+"x "+t.sku+(i?"":","))}}function Ff(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",11),e.\u0275\u0275element(2,"ngx-barcode6",15),e.\u0275\u0275elementStart(3,"div")(4,"p",13)(5,"strong"),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"p",13)(9,"strong"),e.\u0275\u0275text(10,"Agent:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"p",13)(13,"strong"),e.\u0275\u0275text(14,"EcwidID:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(16,"br"),e.\u0275\u0275elementStart(17,"div")(18,"p",13)(19,"strong"),e.\u0275\u0275text(20,"From:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(2
11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"p",16)(23,"strong"),e.\u0275\u0275text(24,"To:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"p",13)(27,"strong"),e.\u0275\u0275text(28,"Items: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(29),e.\u0275\u0275elementStart(30,"strong"),e.\u0275\u0275text(31," | Total Quantity: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(32),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(33,Lf,3,1,"ng-container",9),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit,i=o.index,a=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("zoom",a.scaleFactor/100),e.\u0275\u0275advance(1),e.\u0275\u0275property("bc-height",80)("bc-font-size",12)("bc-value",t.shipment_id)("bc-display-value",!0),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate2("PickupID(",i+1,"/",a.currentPrintLabelsInformation.orders.length,"):"),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",a.currentPrintLabelsInformation.id," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.agent," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.ecwid_id," "),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" ",a.currentPrintLabelsInformation.from," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.receiver," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("",t.items.length," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("",t.totalQuantity," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.items)}}function Rf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275template(1,Of,15,10,"div",7),e.\u0275\u0275elementStart(2,"div",8),e.\u0275\u0275template(3,Ff,34,16,"ng-container",9),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.shippingProvider!==t.ShippingProviders.flash&&t.shippingProvider!==t.ShippingProviders.ems),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.currentPrintLabelsInformation.orders)}}let Nf=(()=>{class n{constructor(t,i,a,r){this._messageService=t,this.dataServices=i,this.pickupsService=a,this.route=r,this.ShippingProviders=xt,this.destroy$=new H.xQ,this.font="labelprinter",this.scaleFactor=100}ngOnInit(){this.dataServices.currentScreen="Pickups - Print Labels",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(i=>{var a;"pickup_print_info_loaded"===i&&(this.currentPrintLabelsInformation=this.pickupsService.currentPrintLabelsInformation,this.shippingProvider=null===(a=this.currentPrintLabelsInformation.orders.find(r=>r.shipping_provider===xt.flash||r.shipping_provider===xt.ems))||void 0===a?void 0:a.shipping_provider,this.currentPrintLabelsInformation.orders.forEach(r=>(r.totalQuantity=r.items.reduce((l,{quantity:f})=>l+f,0),r)))}),this.pickupsService.printLabelsData(this.route.snapshot.params.pickupId)}print(){window.print()}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject($n),e.\u0275\u0275directiveInject(y.gz))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-print-pickup"]],inputs:{shippingProvider:"shippingProvider"},decls:9,vars:3,consts:[[4,"ngIf"],[1,"spacer-left-md","spacer-right-md","no-print"],[1,"header-menu"],["type","button","mat-button","",1,"no-print","button-primary",3,"click"],["color","primary","thumbLabel","","tickInterval","1","step","1","min","0","max","100","aria-label","%",1,"no-print","spacer-top-sm",3,"value","valueChange"],["class","pickup-print-wrapper",4,"ngIf"],[1,"pickup-print-wrapper"],["class","big-box-label-wrapper",4,"ngIf"],[1,"small-boxes-labels-wrapper","spacer-top-sm"],[4,"ngFor","ngForOf"],[1,"big-box-label-wrapper"],[1,"single-card-wrapper","single-label","print-only"],[3,"bc-height","bc-width","bc-font-size","bc-value","bc-display-value"],[1,"print-content"],[1,"print-content","main-label-print-content-to"],[3,"bc-height","bc-font-size","bc-value","bc-display-value"],[1,"print-content","print-content-to"]],template:function(t,i){1&t&&(e.\u0275\u0275template(0,Df,1,0,"app-progress-bar",0),e.\u0275\u0275elementStart(1,"div",1)(2,"div",2)(3,"h3"),e.\u0275\u0275text(4," Global Print Scaling: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",3),e.\u0275\u0275listener("click",function(){return i.print()}),e.\u0275\u0275text(6," Print Labels "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"mat-slider",4),e.\u0275\u0275listener("valueChange",function(r){return i.scaleFactor=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(8,Rf,4,2,"div",5)),2&t&&(e.\u0275\u0275property("ngIf",!i.currentPrintLabelsInformation),e.\u0275\u0275advance(7),e.\u0275\u0275property("value",i.scaleFactor),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!!i.currentPrintLabelsInformation))},directives:[u.NgIf,ot.R,z.lW,zt.pH,P,u.NgForOf],styles:[".pickup-print-wrapper[_ngcontent-%COMP%]{padding:var(--xs-size) var(--sm-size)}.small-boxes-labels-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-wrap:wrap;gap:var(--xs-size)}.big-box-label-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center}.single-label[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;color:#000;background:var(--main-white-color);box-shadow:10px 10px 24px -1px #00000024;-webkit-box-shadow:10px 10px 24px -1px rgba(0,0,0,.14);-moz-box-shadow:10px 10px 24px -1px rgba(0,0,0,.14)}.print-content[_ngcontent-%COMP%]{display:-webkit-box;max-width:100%;-webkit-line-clamp:10;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;font-size:12px;margin:0;font-family:labelprinter}.print-content-to[_ngcontent-%COMP%], .main-label-print-content-to[_ngcontent-%COMP%]{-webkit-line-clamp:10}.single-card-wrapper[_ngcontent-%COMP%]{width:300px;padding:0 var(--xxs-size)}.header-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mat-slider[_ngcontent-%COMP%]{width:100%}@media print{@page{color:#000!important}.no-print[_ngcontent-%COMP%]{display:none}.print-only[_ngcontent-%COMP%]{margin:0;page-break-after:always;width:100%}.single-label[_ngcontent-%COMP%]{box-shadow:none}.single-card-wrapper[_ngcontent-%COMP%]{width:100%}}"]}),n})();var Vf=d(68878),Ut=d(75778),Wt=d(32322);function Hf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"Location Name"),e.\u0275\u0275elementEnd())}function jf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.location_name," ")}}function Bf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function Gf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,jf,2,1,"span",26),e.\u0275\u0275template(2,Bf,2,2,"ng-template",null,27,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.location_name)("ngIfElse",i)}}function zf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1," Place ID "),e.\u0275\u0275elementEnd())}function $f(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",29),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",null==t?null:t.id)}}function Uf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function Wf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,$f,3,2,"span",26),e.\u0275\u0275template(2,Uf,2,2,"ng-template",null,28,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.id)("ngIfElse",i)}}function Qf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"ICCID"),e.\u0275\u0275elementEnd())}function qf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",31),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.iccid," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",t.iccid)}}function Kf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," N/A "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function Yf(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,qf,3,2,"span",26),e.\u0275\u0275template(2,Kf,2,2,"ng-template",null,30,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.iccid)("ngIfElse",i)}}function Xf(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"Place Name"),e.\u0275\u0275elementEnd())}const Zf=function(){return["/dashboard"]},Jf=function(n){return{goToPlaceId:n}};function eh(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"a",34),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)})("auxclick",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction0(4,Zf))("queryParams",e.\u0275\u0275pureFunction1(5,Jf,null==t?null:t.id))("matTooltip","Place ID: "+t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function th(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function nh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,eh,2,7,"a",32),e.\u0275\u0275template(2,th,2,2,"ng-template",null,33,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.name)("ngIfElse",i)}}function ih(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"Model"),e.\u0275\u0275elementEnd())}function ah(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"monitorModelHandler"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.model)," ")}}function oh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function rh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,ah,3,3,"span",26),e.\u0275\u0275template(2,oh,2,2,"ng-template",null,35,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.model)("ngIfElse",i)}}function lh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"Firmware Version"),e.\u0275\u0275elementEnd())}function sh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.firmware_version," ")}}function ch(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function ph(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,sh,2,1,"span",26),e.\u0275\u0275template(2,ch,2,2,"ng-template",null,36,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.firmware_version)("ngIfElse",i)}}function mh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",24),e.\u0275\u0275text(1,"Maker ID"),e.\u0275\u0275elementEnd())}function dh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.maker_id,"")}}function uh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",37),e.\u0275\u0275text(1,"Commission Date"),e.\u0275\u0275elementEnd())}function _h(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.commissioning_date,"MMM d, YYY")," ")}}function fh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function hh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,_h,3,4,"span",26),e.\u0275\u0275template(2,fh,2,2,"ng-template",null,38,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.commissioning_date)("ngIfElse",i)}}function gh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",37),e.\u0275\u0275text(1,"Last Seen"),e.\u0275\u0275elementEnd())}function vh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.last_date,"MMM d, YYY")," ")}}function Ch(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function bh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",25),e.\u0275\u0275template(1,vh,3,4,"span",26),e.\u0275\u0275template(2,Ch,2,2,"ng-template",null,39,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.last_date)("ngIfElse",i)}}function xh(n,o){1&n&&e.\u0275\u0275element(0,"tr",40)}function yh(n,o){1&n&&e.\u0275\u0275element(0,"tr",41)}function Sh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",9),e.\u0275\u0275elementContainerStart(1,10),e.\u0275\u0275template(2,Hf,2,0,"th",11),e.\u0275\u0275template(3,Gf,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,13),e.\u0275\u0275template(5,zf,2,0,"th",11),e.\u0275\u0275template(6,Wf,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,14),e.\u0275\u0275template(8,Qf,2,0,"th",11),e.\u0275\u0275template(9,Yf,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,15),e.\u0275\u0275template(11,Xf,2,0,"th",11),e.\u0275\u0275template(12,nh,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,16),e.\u0275\u0275template(14,ih,2,0,"th",11),e.\u0275\u0275template(15,rh,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,
117),e.\u0275\u0275template(17,lh,2,0,"th",11),e.\u0275\u0275template(18,ph,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,18),e.\u0275\u0275template(20,mh,2,0,"th",11),e.\u0275\u0275template(21,dh,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,19),e.\u0275\u0275template(23,uh,2,0,"th",20),e.\u0275\u0275template(24,hh,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,21),e.\u0275\u0275template(26,gh,2,0,"th",20),e.\u0275\u0275template(27,bh,4,2,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(28,xh,1,0,"tr",22),e.\u0275\u0275template(29,yh,1,0,"tr",23),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0)("dataSource",t.dataSource),e.\u0275\u0275advance(28),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function wh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," There is no monitor with that S/N or ICCID. "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275property("@slowAppearing",void 0)}function Eh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",45),e.\u0275\u0275text(1," Looking for such a monitor\u{1f440} "),e.\u0275\u0275elementEnd())}function Th(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Please enter the monitor's S/N or ICCID. "),e.\u0275\u0275elementEnd())}function Ih(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",42),e.\u0275\u0275template(1,wh,2,1,"span",43),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,Eh,2,0,"span",44),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275template(5,Th,2,0,"span",43),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isSearchPristine&&!e.\u0275\u0275pipeBind1(2,4,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(4,6,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isSearchPristine&&!e.\u0275\u0275pipeBind1(6,8,t.loading))}}const Ph=function(){return{slategray:!0}};let kh=(()=>{class n{constructor(t,i,a,r){this.places=t,this.supportService=i,this._messageService=a,this.dataServices=r,this.isSearchPristine=!0,this.searchFieldControl=new _.NI(""),this.loading=this.supportService.loading$,this.SENSOR_ID_VALIDATION_STRING=Ht.A,this.destroy$=new H.xQ,this.displayedColumns=["place_id","iccid","location_name","name","model","maker_id","firmware_version","commissioning_date","last_date"]}set sort(t){this.dataSource.sort=t}ngOnInit(){this.dataServices.currentScreen="Search By S/N or ICCID",this.places.staffMode="support_panel",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"support_monitor_by_id_loaded"===t&&(this.dataSource=new h.by(this.supportService.filteredMonitors))}),this.dataSource=new h.by([]),this.searchFieldControl.valueChanges.pipe((0,A.R)(this.destroy$),(0,rt.b)(700),(0,Ut.x)()).subscribe(t=>{this.applyFilter(t)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.places.staffMode=null}applyFilter(t){t?(this.supportService.getMonitorById(t),this.isSearchPristine=!1):this.dataSource=new h.by([])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Wt.a),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-monitors-information"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:12,vars:9,consts:[[1,"search-block"],[1,"f-field-wrapper"],[1,"table-upper-search-control"],["matInput","","appRegexInputValidation","","maxlength","24",3,"placeholder","formControl","regexString","isLowerCaseOnly","keyup.enter","paste"],["filterName",""],["matSuffix","",1,"input-reset-btn",3,"ngClass","click"],[1,"table-wrapper"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","info-table-message",4,"ngIf"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","location_name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","place_id"],["matColumnDef","iccid"],["matColumnDef","name"],["matColumnDef","model"],["matColumnDef","firmware_version"],["matColumnDef","maker_id"],["matColumnDef","commissioning_date"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","last_date"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[4,"ngIf","ngIfElse"],["locationNameNoD
1ata",""],["placeIdNoData",""],["successMessage","Place ID has been copied to clipboard","size","small",3,"copyValue"],["iccidNoData",""],["successMessage","ICCID has been copied to clipboard","size","small",3,"copyValue"],["class","accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick",4,"ngIf","ngIfElse"],["placeNameNoData",""],[1,"accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick"],["modelNoData",""],["firmwareVersionNoData",""],["mat-header-cell",""],["commissioningDateNoData",""],["lastSeenNoData",""],["mat-header-row",""],["mat-row",""],[1,"info-table-message"],[4,"ngIf"],["class","loading-text",4,"ngIf"],[1,"loading-text"]],template:function(t,i){if(1&t){const a=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),e.\u0275\u0275text(4,"Search By S/N or ICCID"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"input",3,4),e.\u0275\u0275listener("keyup.enter",function(){e.\u0275\u0275restoreView(a);const l=e.\u0275\u0275reference(6);return i.applyFilter(l.value)})("paste",function(l){return i.applyFilter(l.clipboardData.getData("text"))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-icon",5),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(a),e.\u0275\u0275reference(6).value="",i.isSearchPristine=!0}),e.\u0275\u0275text(8,"clear "),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(9,"div",6),e.\u0275\u0275template(10,Sh,30,4,"table",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(11,Ih,7,10,"div",8)}if(2&t){const a=e.\u0275\u0275reference(6);e.\u0275\u0275advance(5),e.\u0275\u0275property("placeholder","Type in S/N or ICCID")("formControl",i.searchFieldControl)("regexString",i.SENSOR_ID_VALIDATION_STRING)("isLowerCaseOnly",!0),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction0(8,Ph))("@hideInOut",a.value?"shown":"hidden"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!!i.dataSource.data.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.dataSource.data.length)}},directives:[D.KE,D.hX,X.Nt,_.Fj,ft.J,_.nD,_.JJ,_.oH,Q.Hw,D.R9,u.NgClass,ce.oO,u.NgIf,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,y.yS,Ue.gM,h.as,h.XQ,h.nj,h.Gk],pipes:[ln.n,u.DatePipe,u.AsyncPipe],styles:[".page[_ngcontent-%COMP%]{min-height:calc(100vh - 65px)}[_nghost-%COMP%] {.search-block {display: flex; align-items: baseline; justify-content: center; gap: var(--xs-size); margin: var(--xs-size) var(--sm-size);} .input-reset-btn {cursor: pointer; color: var(--grayColor800);} .table-upper-search-control {font-size: 14px; width: 270px;} .table-wrapper {overflow: auto;}}"],data:{animation:[Ze.j,_t.v]}}),n})();var Gi=d(51476);function Mh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1," Place ID "),e.\u0275\u0275elementEnd())}function Ah(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",23),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",null==t?null:t.id)}}function Dh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.8)}function Oh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20),e.\u0275\u0275template(1,Ah,3,2,"span",21),e.\u0275\u0275template(2,Dh,2,2,"ng-template",null,22,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.id)("ngIfElse",i)}}function Lh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1,"Place Name"),e.\u0275\u0275elementEnd())}const Fh=function(){return["/dashboard"]},Rh=function(n){return{goToPlaceId:n}};function Nh(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"a",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)})("auxclick",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction0(4,Fh))("queryParams",e.\u0275\u0275pureFunction1(5,Rh,null==t?null:t.id))("matTooltip","Place ID: "+(null==t?null:t.id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function Vh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function Hh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20),e.\u0275\u0275template(1,Nh,2,7,"a",24),e.\u0275\u0275template(2,Vh,2,2,"ng-template",null,25,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.name)("ngIfElse",i)}}function jh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1," Country "),e.\u0275\u0275elementEnd())}function Bh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"getCountryName"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.country_id)," ")}}function Gh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function zh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20),e.\u0275\u0275template(1,Bh,3,3,"span",21),e.\u0275\u0275template(2,Gh,2,2,"ng-template",null,27,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.country_id)("ngIfElse",i)}}function $h(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1,"Time Zone"),e.\u0275\u0275elementEnd())}function Uh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.timezone_id," ")}}function Wh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("opacity",.5)}function Qh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20),e.\u0275\u0275template(1,Uh,2,1,"span",21),e.\u0275\u0275template(2,Wh,2,2,"ng-template",null,28,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.timezone_id)("ngIfElse",i)}}function qh(n,o){1&n&&e.\u0275\u0275element(0,"tr",29)}function Kh(n,o){1&n&&e.\u0275\u0275element(0,"tr",30)}function Yh(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",10),e.\u0275\u0275elementContainerStart(1,11),e.\u0275\u0275template(2,Mh,2,0,"th",12),e.\u0275\u0275template(3,Oh,4,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,14),e.\u0275\u0275template(5,Lh,2,0,"th",12),e.\u0275\u0275template(6,Hh,4,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,15),e.\u0275\u0275template(8,jh,2,0,"th",12),e.\u0275\u0275template(9,zh,4,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,16),e.\u0275\u0275template(11,$h,2,0,"th",12),e.\u0275\u0275template(12,Qh,4,2,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(13,qh,1,0,"tr",17),e.\u0275\u0275template(14,Kh,1,0,"tr",18),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0)("dataSource",t.dataSource),e.\u0275\u0275advance(13),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Xh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," There is no user with such email. "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275property("@slowAppearing",void 0)}function Zh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",34),e.\u0275\u0275text(1," Lo
1oking for a user with such email\u{1f440} "),e.\u0275\u0275elementEnd())}function Jh(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Please enter the user's email. "),e.\u0275\u0275elementEnd())}function e1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",31),e.\u0275\u0275template(1,Xh,2,1,"span",32),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,Zh,2,0,"span",33),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275template(5,Jh,2,0,"span",32),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isSearchPristine&&!e.\u0275\u0275pipeBind1(2,4,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(4,6,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isSearchPristine&&!e.\u0275\u0275pipeBind1(6,8,t.loading))}}const t1=function(){return{slategray:!0}};let n1=(()=>{class n{constructor(t,i,a,r,l){this.places=t,this.supportService=i,this._messageService=a,this.dialog=r,this.dataServices=l,this.isSearchPristine=!0,this.searchFieldControl=new _.NI(""),this.loading=this.supportService.loading$,this.destroy$=new H.xQ,this.displayedColumns=["id","name","country_id","timezone_id"]}set sort(t){this.dataSource.sort=t}ngOnInit(){this.dataServices.currentScreen="Search By Email",this.places.staffMode="support_panel",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"support_user_places_loaded"===t&&(this.dataSource=new h.by(this.supportService.filteredUsers))}),this.dataSource=new h.by([]),this.searchFieldControl.valueChanges.pipe((0,A.R)(this.destroy$),(0,rt.b)(700),(0,Ut.x)()).subscribe(t=>{this.applyFilter(t)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.places.staffMode=null}applyFilter(t){var i,a;this.isSearchPristine=!1,null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage(),new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?this.supportService.getPlacesByEmail(t):this.dataSource=new h.by([])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Wt.a),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ee.O))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-users-information"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:13,vars:7,consts:[[1,"spacer-bottom-xs","spacer-top-xs","spacer-left-sm"],[1,"search-block"],[1,"f-field-wrapper"],[1,"table-upper-search-control"],["matInput","",3,"formControl","placeholder","keyup.enter","paste"],["filterName",""],["matSuffix","",1,"input-reset-btn",3,"ngClass","click"],[1,"table-wrapper"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","info-table-message",4,"ngIf"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name","sticky",""],["matColumnDef","country_id"],["matColumnDef","timezone_id"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[4,"ngIf","ngIfElse"],["placeIdNoData",""],["successMessage","Place ID has been copied to clipboard","size","small",3,"copyValue"],["class","accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick",4,"ngIf","ngIfElse"],["placeNameNoData",""],[1,"accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick"],["countryIdNoData",""],["timeZoneNoData",""],["mat-header-row",""],["mat-row",""],[1,"info-table-message"],[4,"ngIf"],["class","loading-text",4,"ngIf"],[1,"loading-text"]],template:function(t,i){if(1&t){const a=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),e.\u0275\u0275text(5,"Search By Email"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"input",4,5),e.\u0275\u0275listener("keyup.enter",function(){e.\u0275\u0275restoreView(a);const l=e.\u0275\u0275reference(7);return i.applyFilter(l.value)})("paste",function(l){return i.applyFilter(l.clipboardData.getData("text"))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-icon",6),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(a),e.\u0275\u0275reference(7).value="",i.isSearchPristine=!0}),e.\u0275\u0275text(9,"clear "),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(10,"div",7),e.\u0275\u0275template(11,Yh,15,4,"table",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,e1,7,10,"div",9)}if(2&t){const a=e.\u0275\u0275reference(7);e.\u0275\u0275advance(6),e.\u0275\u0275property("formControl",i.searchFieldControl)("placeholder","Type in the User Email"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction0(6,t1))("@hideInOut",a.value?"shown":"hidden"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!!i.dataSource.data.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.dataSource.data.length)}},directives:[D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.oH,Q.Hw,D.R9,u.NgClass,ce.oO,u.NgIf,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,y.yS,Ue.gM,h.as,h.XQ,h.nj,h.Gk],pipes:[Gi.g,u.AsyncPipe],styles:[".page[_ngcontent-%COMP%]{min-height:calc(100vh - 65px)}[_nghost-%COMP%] {.search-block {display: flex; align-items: baseline; justify-content: center; gap: var(--xs-size); margin: var(--xs-size) var(--sm-size);} .input-reset-btn {cursor: pointer; color: var(--grayColor800);} .table-upper-search-control {font-size: 14px; width: 270px;} .table-wrapper {overflow: auto;}}"],data:{animation:[Ze.j,_t.v]}}),n})();var zi=d(867),Un=d(41555),Te=(()=>{return(n=Te||(Te={})).PM02="pm02",n.PI02="pi02",n.RCO2="rco2",n.TVOC="tvoc_index",n.RHUM="rhum",n.ATMP="atmp",n.HEAT="heatIndex",n.UPDATE="lastUpdate",Te;var n})(),te=(()=>{return(n=te||(te={})).indoor="indoorLocations",n.outdoor="outdoorLocations",n.all="allLocations",n.location="location",n.locationGroup="locationGroup",te;var n})();class i1{constructor(){this.triggerDelay=15,this.triggerOnlyWhenOpen=!1,this.triggerType="always",this.active=!0}}var Ne=d(55615);const a1=["createAlarmStepper"];function o1(n,o){1&n&&e.\u0275\u0275text(0," Criteria ")}function r1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",39),e.\u0275\u0275element(1,"span",40),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.label,e.\u0275\u0275sanitizeHtml)}}function l1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function s1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function c1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",9)(1,"mat-label"),e.\u0275\u0275text(2,"Operator"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"mat-select",41)(4,"mat-option",42),e.\u0275\u0275text(5,"Less than (<)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-option",43),e.\u0275\u0275text(7,"Equal (=)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-option",44),e.\u0275\u0275text(9,"Greater than (>)"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"mat-error",13),e.\u0275\u0275template(11,s1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(11),e.\u0275\u0275property("ngIf",t.getErrors("criteria","operator"))}}function p1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function m1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",9)(1,"mat-label"),e.\u0275\u0275text(2,"Threshold"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"input",45),e.\u0275\u0275elementStart(4,"mat-error",13),e.\u0275\u0275template(5,p1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(3),e.\u0275\u0275property("regexString","^[0-9]+$"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.getErrors("criteria","threshold"))}}function d1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function u1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}const $i=function(n){return{"spacer-top-md":n}};function _1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",46)(1,"mat-form-field",9)(2,"mat-label"),e.\u0275\u0275text(3,"Duration met (in minutes)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"input",47),e.\u0275\u0275elementStart(5,"mat-error",13),e.\u0275\u0275template(6,d1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"mat-form-field",9)(8,"mat-label"),e.\u0275\u0275text(9,"Triggers"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-select",48)(11,"mat-option",49),e.\u0275\u0275text(12,"Always (24h)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"mat-option",50),e.\u0275\u0275text(14,"Only during opening hours"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-option",51),e.\u0275\u0275text(16,"Only outside opening hours"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(17,"mat-error",13),e.\u0275\u0275template(18,u1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(4,$i,t.isPortrait())),e.\u0275\u0275advance(4),e.\u0275\u0275property("regexString","^[0-9]+$"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.getErrors("criteria","durationMet")),e.\u0275\u0275advance(12),e.\u0275\u0275property("ngIf",t.getErrors("criteria","triggers"))}}function f1(n,o){1&n&&e.\u0275\u0275element(0,"mat-icon",52)}function h1(n,o){1&n&&e.\u0275\u0275text(0," Locations ")}function g1(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",22),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.setAlarmConfig(l.AlarmType.locationGroup,r.id)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("value",i.LOCATION_ID_FOR_LOCATION_GROUP),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" All Locations in Group: ",t.name," ")}}function v1(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",22),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.setAlarmConfig(a.AlarmType.location)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function C1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function b1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon"),e.\u0275\u0275text(1,"menu"),e.\u0275\u0275elementEnd())}function x1(n,o){1&n&&e.\u0275\u0275text(0," Description ")}function y1(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," This field is required. "),e.\u0275\u0275elementContainerEnd())}function S1(n,o){1&n&&e.\u0275\u0275element(0,"mat-icon",53)}function w1(n,o){1&n&&e.\u0275\u0275text(0," Summary ")}function E1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",55)(1,"b",56),e.\u0275\u0275text(2,"Description: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);let i,a;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",null==(i=t.alarmFormGroup.get("description"))||null==(a=i.get("description"))?null:a.value," ")}}function T1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",55)(1,"b",56),e.\u0275\u0275text(2,"Operator: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);let i,a;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.getOperatorLabel(null==(i=t.alarmFormGroup.get("criteria"))||null==(a=i.get("operator"))?null:a.value)," ")}}function I1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p",55)(1,"b",56),e.\u0275\u0275text(2,"Threshold: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);let i,a;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",null==(i=t.alarmFormGroup.get("criteria"))||null==(a=i.get("threshold"))?null:a.value," ")}}function P1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-step",54),e.\u0275\u0275template(1,w1,1,0,"ng-template",6),e.\u0275\u0275elementStart(2,"p",55)(3,"b",56),e.\u0275\u0275text(4,"Title: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,E1,4,1,"p",57),e.\u0275\u0275elementStart(7,"p",55)(8,"b",56),e.\u0275\u0275text(9,"Measure: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"span",40),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(11,T1,4,1,"p",57),e.\u0275\u0275template(12,I1,4,1,"p",57),e.\u0275\u0275elementStart(13,"p",55)(14,"b",56),e.\u0275\u0275text(15,"Duration met: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"p",55)(18,"b",56),e.\u0275\u0275text(19,"Triggers: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(20),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"p",55)(22,"b",56),e.\u0275\u0275text(23,"Target: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(24),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);let i,a,r,l,f,w,T,M,B,j,q,J,ge,fe;e.\u0275\u0275property("stepControl",t.alarmFormGroup),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",null==(i=t.alarmFormGroup.get("description"))||null==(a=i.get("title"))?null:a.value," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==(r=t.alarmFormGroup.get("description"))||null==(l=r.get("description"))?null:l.value),e.\u0275\u0275advance(4),e.\u0275\u0275property("innerHTML",t.getMeasureLabel(null==(f=t.alarmFormGroup.get("criteria"))||null==(w=f.get("measure"))?null:w.value),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==(T=t.alarmFormGroup.get("criteria"))||null==(M=T.get("measure"))?null:M.value)!==t.AlarmMeasures.UPDATE),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==(B=t.alarmFormGroup.get("criteria"))||null==(j=B.get("measure"))?null:j.value)!==t.AlarmMeasures.UPDATE),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",null==(q=t.alarmFormGroup.get("criteria"))||null==(J=q.get("durationMet"))?null:J.value," minutes "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.getTr
1iggerLabel(null==(ge=t.alarmFormGroup.get("criteria"))||null==(fe=ge.get("triggers"))?null:fe.value)," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",t.getLocationSummary()," ")}}function k1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon"),e.\u0275\u0275text(1,"sync"),e.\u0275\u0275elementEnd())}function M1(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"form",2)(1,"mat-horizontal-stepper",3,4),e.\u0275\u0275listener("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().getSubmitButtonText()}),e.\u0275\u0275elementStart(3,"mat-step",5),e.\u0275\u0275template(4,o1,1,0,"ng-template",6),e.\u0275\u0275elementContainerStart(5,7),e.\u0275\u0275elementStart(6,"div",8)(7,"mat-form-field",9)(8,"mat-label",10),e.\u0275\u0275text(9,"Measure"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-select",11),e.\u0275\u0275template(11,r1,2,2,"mat-option",12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"mat-error",13),e.\u0275\u0275template(13,l1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(14,c1,12,1,"mat-form-field",15),e.\u0275\u0275template(15,m1,6,2,"mat-form-field",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(16,_1,19,6,"div",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,f1,1,0,"ng-template",17),e.\u0275\u0275elementStart(18,"mat-step",18),e.\u0275\u0275template(19,h1,1,0,"ng-template",6),e.\u0275\u0275elementContainerStart(20,19),e.\u0275\u0275elementStart(21,"div",20)(22,"mat-form-field",9)(23,"mat-label"),e.\u0275\u0275text(24,"Location(-s)"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"mat-select",21)(26,"mat-option",22),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.setAlarmConfig(a.AlarmType.all)}),e.\u0275\u0275text(27," All Locations (Inside & Outside) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"mat-option",22),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.setAlarmConfig(a.AlarmType.outdoor)}),e.\u0275\u0275text(29," All Outside Locations "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"mat-option",22),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.setAlarmConfig(a.AlarmType.indoor)}),e.\u0275\u0275text(31," All Inside Locations "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(32,"mat-divider"),e.\u0275\u0275template(33,g1,2,2,"mat-option",23),e.\u0275\u0275element(34,"mat-divider"),e.\u0275\u0275elementStart(35,"div",24)(36,"div",25)(37,"mat-icon"),e.\u0275\u0275text(38," search "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(39,"input",26,27),e.\u0275\u0275listener("keyup",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275element(41,"mat-divider"),e.\u0275\u0275template(42,v1,2,2,"mat-option",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"mat-error",13),e.\u0275\u0275template(44,C1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(45,b1,2,0,"ng-template",28),e.\u0275\u0275elementStart(46,"mat-step",29),e.\u0275\u0275template(47,x1,1,0,"ng-template",6),e.\u0275\u0275elementContainerStart(48,30),e.\u0275\u0275elementStart(49,"div",31)(50,"mat-form-field",9)(51,"mat-label"),e.\u0275\u0275text(52,"Title"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(53,"input",32),e.\u0275\u0275elementStart(54,"mat-error",13),e.\u0275\u0275template(55,y1,2,0,"ng-container",14),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(56,"mat-form-field",33)(57,"mat-label"),e.\u0275\u0275text(58,"Description"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(59,"textarea",34),e.\u0275\u0275elementStart(60,"mat-hint",35),e.\u0275\u0275text(61),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(62,S1,1,0,"ng-template",36),e.\u0275\u0275template(63,P1,25,9,"mat-step",37),e.\u0275\u0275template(64,k1,2,0,"ng-template",38),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();let i,a,r,l,f,w;e.\u0275\u0275property("formGroup",t.alarmFormGroup),e.\u0275\u0275advance(1),e.\u0275\u0275property("labelPosition",t.isPortrait()?"bottom":"end"),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",t.alarmFormGroup.get("criteria")),e.\u0275\u0275advance(8),e.\u0275\u0275property("ngForOf",t.measureOptions),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.getErrors("criteria","measure")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==(i=t.alarmFormGroup.get("criteria"))||null==(a=i.get("measure"))?null:a.value)!==t.AlarmMeasures.UPDATE),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==(r=t.alarmFormGroup.get("criteria"))||null==(l=r.get("measure"))?null:l.value)!==t.AlarmMeasures.UPDATE),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.places.currentPlace?null:t.places.currentPlace.advanced_config),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",t.alarmFormGroup.get("location")),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(23,$i,t.flowConfiguration.isEditing)),e.\u0275\u0275advance(5),e.\u0275\u0275property("value",t.stringToAscii(t.AlarmType.all)),e.\u0275\u0275advance(2),e.\u0275\u0275property("value",t.stringToAscii(t.AlarmType.outdoor)),e.\u0275\u0275advance(2),e.\u0275\u0275property("value",t.stringToAscii(t.AlarmType.indoor)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",t.currentAlarmGroup),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngForOf",t.locations.filteredLocations),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.getErrors("location","location")),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",t.alarmFormGroup.get("description")),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngIf",t.getErrors("description","title")),e.\u0275\u0275advance(4),e.\u0275\u0275property("cdkTextareaAutosize",!0)("cdkAutosizeMinRows",3)("cdkAutosizeMaxRows",t.isPortrait()?null:4),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",((null==(f=t.alarmFormGroup.get("description"))||null==(w=f.get("description"))||null==w.value?null:w.value.length)||0)+"/650"," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.flowConfiguration.isEditing)}}let Ui=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B){this.dialogRef=t,this.locations=i,this.groupsServices=a,this.flowConfiguration=r,this.alarmServices=l,this.places=f,this.helpService=w,this._formBuilder=T,this.changeDetection=M,this.dialog=B,this.HelpSection=Z.L,this.TypeOfAlarmsSections=zi.G,this.AlarmType=te,this.AlarmMeasures=Te,this.alarm=new i1,this.currentAlarmGroup=[],this.filterValue="",this.LOCATION_ID_FOR_LOCATION_GROUP=99999999,this.isPortrait=jt.gr,this.measureOptions=[{value:Te.PM02,label:"PM<sub>2.5</sub> (\u03bcg/m\xb3)"},{value:Te.RCO2,label:"CO<sub>2</sub> (ppm)"},{value:Te.TVOC,label:"TVOC (Ind40)"},{value:Te.RHUM,label:"Humidity (%)"},{value:Te.ATMP,label:"Temperature (\xb0C)"},{value:Te.HEAT,label:"Heat (\xb0C)"},{value:Te.UPDATE,label:"Offline"}],this.destroy$=new H.xQ,this.isSubmitDisabled=!0}ngOnInit(){this.currentAlarmGroup=[...this.groupsServices.groups],this.flowConfiguration.isEditing&&this.flowConfiguration.alarm&&this.initializeAlarmFromExisting(this.flowConfiguration.alarm),this.locations.filteredLocations||this.locations.getLocations(this.places.currentPlace.id),this.initAlarmFormGroup(),this.get
1SubmitButtonText()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initAlarmFormGroup(){const t=this.getInitialLocationControlValue();this.alarmFormGroup=this._formBuilder.group({criteria:this._formBuilder.group({measure:[this.alarm.measure||"",_.kI.required],operator:[this.alarm.operator||"",this.alarm.measure!==Te.UPDATE?_.kI.required:[]],threshold:[this.alarm.threshold||"",this.alarm.measure!==Te.UPDATE?_.kI.required:[]],durationMet:[this.alarm.triggerDelay,_.kI.required],triggers:[this.alarm.triggerType,_.kI.required]}),location:this._formBuilder.group({location:[t,_.kI.required]}),description:this._formBuilder.group({title:[this.alarm.title||"",_.kI.required],description:[this.alarm.description||""]}),activated:[this.alarm.active]}),this.syncAlarmWithForm(),this.alarmFormGroup.valueChanges.pipe((0,A.R)(this.destroy$)).subscribe(()=>this.syncAlarmWithForm()),this.alarmFormGroup.statusChanges.pipe((0,A.R)(this.destroy$)).subscribe(()=>this.getSubmitButtonText()),this.alarmFormGroup.get("criteria.measure").valueChanges.pipe((0,A.R)(this.destroy$)).subscribe(i=>{i!==Te.UPDATE?(this.alarmFormGroup.get("criteria.operator").setValidators([_.kI.required]),this.alarmFormGroup.get("criteria.threshold").setValidators([_.kI.required])):(this.alarmFormGroup.get("criteria.operator").clearValidators(),this.alarmFormGroup.get("criteria.threshold").clearValidators()),this.alarmFormGroup.get("criteria.threshold").updateValueAndValidity(),this.alarmFormGroup.get("criteria.operator").updateValueAndValidity()})}applyFilter(t){this.filterValue=t.target.value,this.locations.filteredLocations=this.locations.allLocations.filter(i=>i.name.toLowerCase().includes(this.filterValue.trim().toLowerCase()))}goToNextStep(){if(this.defineIsTheStepLast())return this.submitAlarmForm(),void this.dialogRef.close();this.createAlarmStepper.next(),this.getSubmitButtonText()}submitAlarmForm(){var t;this.syncAlarmWithForm(),this.alarm.measure===Te.UPDATE&&(this.alarm.operator="greater",this.alarm.threshold=(null!==(t=this.alarm.triggerDelay)&&void 0!==t?t:0)-2,this.alarm.triggerDelay=2);const i=Object.assign({},this.alarm);i.alarmType!==te.location&&(i.locationId=null),this.flowConfiguration.isEditing?this.alarmServices.editAdminAlarm(this.places.currentPlace,i):this.alarmServices.postAdminAlarm(this.places.currentPlace,i)}setAlarmConfig(t,i=null){if(this.alarm.alarmType=t,t===te.locationGroup){this.alarm.locationGroupId=i;const a=this.currentAlarmGroup.find(r=>r.id===i);return this.alarm.locationGroupName=(null==a?void 0:a.name)||null,this.alarm.locationId=null,void(this.alarm.locationName=null)}this.alarm.locationGroupId=null,this.alarm.locationGroupName=null,t!==te.location&&(this.alarm.locationId=null,this.alarm.locationName=null)}stringToAscii(t){return Number(t.split("").map(i=>i.charCodeAt(0).toString().padStart(3,"0")).join(""))}getMeasureLabel(t){var i;return t?null===(i=this.measureOptions.find(a=>a.value===t))||void 0===i?void 0:i.label:"Not set yet"}getOperatorLabel(t){const i={smaller:"Less than (<)",equal:"Equal (=)",greater:"Greater than (>)"};return null==i?void 0:i[t]}getTriggerLabel(t){const i={always:"Always (24h)",whenOpen:"Only during opening hours",whenClosed:"Only outside opening hours"};return null==i?void 0:i[t]}getLocationSummary(){switch(this.alarm.alarmType){case te.all:return"All Locations (Inside & Outside)";case te.indoor:return"All Inside Locations";case te.outdoor:return"All Outside Locations";case te.locationGroup:return this.alarm.locationGroupName?`All Locations in Group: ${this.alarm.locationGroupName}`:"Location group selected";case te.location:return this.getLocationNameById(this.alarm.locationId)||"Specific location selected";default:return"Not set yet"}}syncAlarmWithForm(){const t=a=>{var r;return null===(r=this.alarmFormGroup.get(a))||void 0===r?void 0:r.value};this.alarm.title=t("description.title"),this.alarm.description=t("description.description"),this.alarm.triggerType=t("criteria.triggers"),this.alarm.triggerDelay=this.parseNumericValue(t("criteria.durationMet")),this.alarm.measure=t("criteria.measure"),this.alarm.o
1perator=t("criteria.operator"),this.alarm.threshold=this.parseNumericValue(t("criteria.threshold")),this.alarm.active=t("activated");const i=t("location.location");this.alarm.alarmType===te.location?(this.alarm.locationId="number"==typeof i?i:null,this.alarm.locationName=this.getLocationNameById(this.alarm.locationId)):(this.alarm.locationId=null,this.alarm.locationName=null)}parseNumericValue(t){if(null==t||""===t)return null;const i=Number(t);return Number.isFinite(i)?i:null}getLocationNameById(t){var i,a;if(null==t)return"";const r=(null===(i=this.locations.allLocations)||void 0===i?void 0:i.find(l=>l.id===t))||(null===(a=this.locations.filteredLocations)||void 0===a?void 0:a.find(l=>l.id===t));return(null==r?void 0:r.name)||""}getSubmitButtonText(){setTimeout(()=>{var t,i,a;this.submitButtonText=this.defineIsTheStepLast()?"Finish":"Next",this.isSubmitDisabled=!(null===(a=null===(i=null===(t=this.createAlarmStepper)||void 0===t?void 0:t.selected)||void 0===i?void 0:i.stepControl)||void 0===a?void 0:a.valid)},0)}defineIsTheStepLast(){var t,i,a;return this.changeDetection.detectChanges(),(null===(t=this.createAlarmStepper)||void 0===t?void 0:t.selectedIndex)===(null===(a=null===(i=this.createAlarmStepper)||void 0===i?void 0:i.steps)||void 0===a?void 0:a.length)-1}initializeAlarmFromExisting(t){var i;this.alarm=JSON.parse(JSON.stringify(t)),this.locationName=this.getLocationNameForTitle(this.alarm),this.alarm.measure===Te.UPDATE&&(this.alarm.triggerDelay=(null!==(i=this.alarm.threshold)&&void 0!==i?i:0)+2,this.alarm.threshold=0),this.alarm.alarmType===te.locationGroup&&this.alarm.locationGroupName&&(this.currentAlarmGroup=this.currentAlarmGroup.filter(a=>a.name===this.alarm.locationGroupName))}getLocationNameForTitle(t){switch(t.alarmType){case te.all:return"All Locations";case te.indoor:return"All Indoor Locations";case te.outdoor:return"All Outdoor Locations";case te.locationGroup:return t.locationGroupName||"";case te.location:return t.locationName||"";default:return""}}getInitialLocationControlValue(){if(!this.flowConfiguration.isEditing||!this.flowConfiguration.alarm)return null;const t=this.flowConfiguration.alarm;return t.alarmType===te.location?t.locationId:t.alarmType===te.locationGroup?this.LOCATION_ID_FOR_LOCATION_GROUP:[te.all,te.indoor,te.outdoor].includes(t.alarmType)?this.stringToAscii(t.alarmType):null}getErrors(t,i,a="required"){var r,l;return null===(l=null===(r=this.alarmFormGroup.get(t))||void 0===r?void 0:r.controls[i].errors)||void 0===l?void 0:l[a]}delete(){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete alarm "+this.flowConfiguration.alarm.title+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i&&(this.alarmServices.deleteAdminAlarm(this.places.currentPlace,this.flowConfiguration.alarm),this.dialogRef.close())})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(On.H),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-alarm-configuration-stepper"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(a1,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.createAlarmStepper=a.first)}},features:[e.\u0275\u0275ProvidersFeature([{provide:Un.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:2,vars:9,consts:[[3,"title","isAdditionalButton","additionalText","isCancelButtonHidden","submitText","submitDisabled","isCustomBottomCancel","cancelText","cancel","submitting","customCancel","additionalAction"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["linear","",3,"labelPosition","selectionChange"],["createAlarmStepper",""],["state","criteria",3,"stepControl"],["matStepLabel",""],["formGroupName","criteria"],[1,"flex-space-between","gap-1",2,"flex-wrap","wrap"],[1,"form-field-responsive-s"],[1,"label"],["formControlName","measure","placeholder","Select measure","required","","name","measure"],[3,"value",4,"ngFor","ngForOf"],[1,"form-field-error"],[4,"ngIf"],["class","form-field-responsive-s",4,"ngIf"],["class","flex-space-between gap-1","
1style","flex-wrap: wrap",3,"ngClass",4,"ngIf"],["matStepperIcon","criteria"],["state","locations",3,"stepControl"],["formGroupName","location"],[1,"flex-space-between","gap-1",3,"ngClass"],["formControlName","location","placeholder","Select location","required",""],[3,"value","click"],[3,"value","click",4,"ngFor","ngForOf"],[1,"dropdown-filter-search-outer"],[1,"dropdown-filter-search-wrapper"],["matInput","","placeholder","Search location",3,"keyup"],["formInput",""],["matStepperIcon","locations"],["state","description",3,"stepControl"],["formGroupName","description"],[1,"flex-column","gap-1"],["formControlName","title","matInput","","type","text","placeholder","Alarm title","name","title","maxlength","120"],["appearance","fill",1,"full-width","test"],["formControlName","description","matInput","","maxlength","650","placeholder","Alarm Description",2,"max-height","45vh !important",3,"cdkTextareaAutosize","cdkAutosizeMinRows","cdkAutosizeMaxRows"],["align","end"],["matStepperIcon","description"],["state","finish",3,"stepControl",4,"ngIf"],["matStepperIcon","finish"],[3,"value"],[3,"innerHTML"],["formControlName","operator","required","","name","operator","placeholder","Select operator"],["value","smaller"],["value","equal"],["value","greater"],["formControlName","threshold","matInput","","required","","appRegexInputValidation","","placeholder","Threshold","name","threshold","maxlength","5",3,"regexString"],[1,"flex-space-between","gap-1",2,"flex-wrap","wrap",3,"ngClass"],["formControlName","durationMet","required","","matInput","","appRegexInputValidation","","placeholder","Duration","name","triggerDelay","maxlength","5",3,"regexString"],["formControlName","triggers","required","","name","times","placeholder","When should alarm fire"],["value","always"],["value","whenOpen"],["value","whenClosed"],["svgIcon","display_settings",1,"step-icon"],["svgIcon","description",1,"step-icon"],["state","finish",3,"stepControl"],[1,"spacer-bottom-nil","spacer-top-nil"],[1,"summary-label"],["class","spacer-bottom-nil spacer-top-nil",4,"ngIf"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.goToNextStep()})("customCancel",function(){return i.delete()})("additionalAction",function(){return i.helpService.openHelpDialog(i.HelpSection.alarms,"Alarms",i.TypeOfAlarmsSections.window)}),e.\u0275\u0275template(1,M1,65,25,"form",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("title",i.flowConfiguration.isEditing?"Edit Alarm for location(-s): "+i.locationName:"Add New Alarm")("isAdditionalButton",!1)("additionalText","Help")("isCancelButtonHidden",!i.flowConfiguration.isEditing)("submitText",i.submitButtonText)("submitDisabled",i.isSubmitDisabled)("isCustomBottomCancel",!0)("cancelText","Delete"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.alarmFormGroup))},directives:[ve.b,u.NgIf,_._Y,_.JL,_.sg,Ne.Vq,Ne.C0,Ne.VY,_.x0,D.KE,D.hX,_e.gD,_.JJ,_.u,_.Q7,u.NgForOf,de.ey,D.TO,_.Fj,X.Nt,ft.J,_.nD,u.NgClass,ce.oO,Ne.z9,Q.Hw,vt.d,an.IC,D.bx],encapsulation:2}),n})(),A1=(()=>{class n{transform(t){return t.replace(/([A-Z])/g," $1").trim().toLowerCase()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.\u0275\u0275definePipe({name:"getTriggerName",type:n,pure:!0}),n})(),D1=(()=>{class n{transform(t){switch(t){case te.indoor:return"Indoor Locations";case te.outdoor:return"Outdoor Locations";case te.all:return"All Locations";case te.location:return"Location";case te.locationGroup:return"Location Group";default:return t}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.\u0275\u0275definePipe({name:"getReadableAlarmType",type:n,pure:!0}),n})();function O1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",11),e.\u0275\u0275text(1," lock "),e.\u0275\u0275elementEnd())}function L1(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",12),2&n&&e.\u0275\u0275property("message","alarms")}function F1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function R1(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",40),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).editDialog(a)}),e.\u0275\u0275text(1,"Edit"),e.\u0275\u0275elementEnd()}}function N1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36)(1,"mat-menu",null,37),e.\u0275\u0275template(3,R1,2,0,"ng-template",38),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",39)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function V1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Id"),e.\u0275\u0275elementEnd())}function H1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function j1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Active"),e.\u0275\u0275elementEnd())}function B1(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",36)(1,"mat-checkbox",42),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t).$implicit.active=a})("change",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(3).onActiveChange(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",t.active)}}function G1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Measure"),e.\u0275\u0275elementEnd())}function z1(n,o){1&n&&(e.\u0275\u0275element(0,"td",43),e.\u0275\u0275pipe(1,"getMeasureName")),2&n&&e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind2(1,1,o.$implicit.measure,"alarms"),e.\u0275\u0275sanitizeHtml)}function $1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Operator"),e.\u0275\u0275elementEnd())}function U1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate("lastUpdate"==t.measure?"":t.operator)}}function W1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Threshold"),e.\u0275\u0275elementEnd())}function Q1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate("lastUpdate"==t.measure?"":t.threshold)}}function q1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Duration met (minutes)"),e.\u0275\u0275elementEnd())}function K1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("","lastUpdate"==t.measure?t.triggerDelay+t.threshold:t.triggerDelay," ")}}function Y1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Trigger"),e.\u0275\u0275elementEnd())}function X1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"getTriggerName"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,t.triggerType))}}function Z1(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Type"),e.\u0275\u0275elementEnd())}function J1(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"getReadableAlarmType"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(2,1,t.alarmType))}}function eg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Location"),e.\u0275\u0275elementEnd())}function tg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.locationName)}}function ng(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1," Notes"),e.\u0275\u0275elementEnd())}function ig(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.locationNotes)}}function ag(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Group"),e.\u0275\u0275elementEnd())}function og(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.locationGroupName)}}function rg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",41),e.\u0275\u0275text(1,"Title"),e.\u0275\u0275elementEnd())}function lg(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",44)(1,"app-interactive-table-cell",45),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(3).editDialog(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!0)("value",t.title)}}function sg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",35),e.\u0275\u0275text(1,"Description"),e.\u0275\u0275elementEnd())}function cg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",36)(1,"span",46),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function pg(n,o){1&n&&e.\u0275\u0275element(0,"tr",47)}function mg(n,o){1&n&&e.\u0275\u0275element(0,"tr",48)}function dg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",13),e.\u0275\u0275elementContainerStart(1,14),e.\u0275\u0275template(2,F1,2,0,"th",15),e.\u0275\u0275template(3,N1,7,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,17),e.\u0275\u0275template(5,V1,2,0,"th",15),e.\u0275\u0275template(6,H1,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,18),e.\u0275\u0275template(8,j1,2,0,"th",19),e.\u0275\u0275template(9,B1,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,20),e.\u0275\u0275template(11,G1,2,0,"th",19),e.\u0275\u0275template(12,z1,2,4,"td",21),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,22),e.\u0275\u0275template(14,$1,2,0,"th",15),e.\u0275\u0275template(15,U1,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,23),e.\u0275\u0275template(17,W1,2,0,"th",15),e.\u0275\u0275template(18,Q1,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,24),e.\u0275\u0275template(20,q1,2,0,"th",15),e.\u0275\u0275template(21,K1,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,25),e.\u0275\u0275template(23,Y1,2,0,"th",15),e.\u0275\u0275template(24,X1,3,3,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,26),e.\u0275\u0275template(26,Z1,2,0,"th",15),e.\u0275\u0275template(27,J1,3,3,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,27),e.\u0275\u0275template(29,eg,2,0,"th",15),e.\u0275\u0275template(30,tg,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,28),e.\u0275\u0275template(32,ng,2,0,"th",15),e.\u0275\u0275template(33,ig,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(34,29),e.\u0275\u0275template(35,ag,2,0,"th",15),e.\u0275\u0275template(36,og,2,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(37,30),e.\u0275\u0275template(38,rg,2,0,"th",19),e.\u0275\u0275template(39,lg,2,2,"td",31),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(40,32),e.\u0275\u0275template(41,sg,2,0,"th",15),e.\u0275\u0275template(42,cg,3,1,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(43,pg,1,0,"tr",33),e.\u0275\u0275template(44,mg,1,0,"tr",34),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(43),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function ug(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",49),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",null==t.alarmServices?null:t.alarmServices.alarms.length," Alarms")}}function _g(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"section",1)(2,"app-sub-header",2)(3,"div",3)(4,"button",4),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().createNewAlarm()}),e.\u0275\u0275text(5,"Add New "),e.\u0275\u0275template(6,O1,2,0,"mat-icon",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"button",6),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.helpService.openHelpDialog(a.HelpSection.alarms,"Alarms",a.TypeOfAlarmsSections.main)}),e.\u0275\u0275text(8," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(9,"div",7),e.\u0275\u0275template(10,L1,1,1,"app-no-data",8),e.\u0275\u0275template(11,dg,45,3,"table",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(12,ug,2,1,"div",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",!t.SubscriptionPlanService.getPlanAccessByFeature("alarms",t.alarmServices.alarms.length)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",t.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty)}}let fg=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.alarmServices=t,this.dialog=i,this.helpService=a,this.dialogService=r,this.groupsService=l,this.place=f,this.SubscriptionPlanService=w,this._messageService=T,this.HelpSection=Z.L,this.TypeOfAlarmsSections=zi.G,this.isTableEmpty=!1,this.displayedColumns=["active","title","description","location_name","location_notes","group_name","alarm_type","measure","operator","threshold","duration_met","trigger_type","edit"],this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(M=>{"alarms_loaded"===M&&(this.dataSource=new h.by(t.alarms),this.isTableEmpty=0===this.dataSource.data.length)})}set matSort(t){this.dataSource&&(this.dataSource.sort=t)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}createNewAlarm(){this.SubscriptionPlanService.getPlanAccessByFeature("alarms",this.alarmServices.alarms.length)?(this.matDialogRef=this.dialog.open(Ui,{data:{isEditing:!1},disableClose:!0}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})):(this.place.currentPlace.permissions.settings||this.SubscriptionPlanService.isMaximumItemsForFeatureReached("alarms",this.alarmServices.alarms.length))&&this.dialog.open(yn,{data:{feature:"alarms",featureItemsCount:this.alarmServices.alarms.length}})}editDialog(t){this.matDialogRef=this.dialog.open(Ui,{data:{alarm:t,isEditing:!0},disableClose:!0}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})}ngAfterViewInit(){this.alarmServices.getAdminAlarms(this.place.currentPlace.id),0===this.groupsService.groups.length&&this.groupsService.getGroups(this.place.currentPlace.id)}onActiveChange(t){this.alarmServices.updateActiveFlagForAdminAlarm(this.place.currentPlace,t)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(On.H),e.\u0275\u0275directi
1veInject(F.uw),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(on.G),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-alarms"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matSort=a.first)}},decls:2,vars:3,consts:[[4,"ngIf"],[1,"inPage"],["justifyContent","flex-end"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["class","subscription-plan-locked-icon in-btn",4,"ngIf"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main locations zoom-table","matSort","","mat-table","",3,"dataSource",4,"ngIf"],["class","table-counter",4,"ngIf"],[1,"subscription-plan-locked-icon","in-btn"],[3,"message"],["matSort","","mat-table","",1,"ag-table-main","locations","zoom-table",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","active"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","measure"],["mat-cell","",3,"innerHTML",4,"matCellDef"],["matColumnDef","operator"],["matColumnDef","threshold"],["matColumnDef","duration_met"],["matColumnDef","trigger_type"],["matColumnDef","alarm_type"],["matColumnDef","location_name"],["matColumnDef","location_notes"],["matColumnDef","group_name"],["matColumnDef","title"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","description"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-header-cell","","mat-sort-header",""],[3,"ngModel","ngModelChange","change"],["mat-cell","",3,"innerHTML"],["mat-cell","",1,"zoom-td"],[3,"isLocationName","value","cellClick"],[2,"white-space","nowrap"],["mat-header-row",""],["mat-row",""],[1,"table-counter"]],template:function(t,i){1&t&&(e.\u0275\u0275template(0,_g,13,4,"ng-container",0),e.\u0275\u0275pipe(1,"async")),2&t&&e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(1,1,i.alarmServices.alarmsSubject))},directives:[u.NgIf,ae.$,z.lW,Q.Hw,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,U.nU,Je.oG,_.JJ,_.On,Ct.T,h.as,h.XQ,h.nj,h.Gk],pipes:[u.AsyncPipe,Rn.x,A1,D1],styles:["[_nghost-%COMP%] .ag-table-main td.mat-cell.mat-column-description{max-width:300px;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .ag-table-main td.mat-cell.mat-column-title{padding:10px 10px 10px 0}"]}),n})();var Wn=d(30713),hg=d(57261);const gg=["timeSelect"];let vg=(()=>{class n{constructor(t,i,a,r,l){this.placesService=t,this.router=i,this._snackBar=a,this._messageService=r,this.helpService=l,this.HelpSection=Z.L,this.AlarmsAndNotificationsTabs=sn.p,this.destroy$=new H.xQ}ngOnInit(){this.setInitialValues(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{["place_saved","places_loaded"].includes(t)&&this.setInitialValues()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}navigateToTab(t){this.router.navigate([],{queryParams:{tab:String(t)}})}save(){if(this.timeSelectRef.invalidTimeInputs)return void this._snackBar.open("Start Time can not be after End Time!",null,{duration:4e3});const i=`${this.endTime.hours}:${this.endTime.minutes}:00`;this.placesService.currentPlace.notifs_start_time=`${this.startTime.hours}:${this.startTime.minutes}:00`,this.placesService.currentPlace.notifs_end_time=i,this.placesService.saveNotifs(this.placesService.currentPlace)}onTimeChange({startTime:t,endTime:i}){this.startTime=t,this.endTime=i}setInitialValues(){var t,i,a,r;const l=(null===(t=this.placesService.currentPlace.notifs_start_time)||void 0===t?void 0:t.split(":")[0])||"00",f=(null===(i=this.placesService.currentPlace.notifs_start_time)||void 0===i?void 0:i.split(":")[1])||"00";this.startTime={hours:l,minutes:f};const w=(null===(a=this.placesService.currentPlace.notifs_end_time)||void 0===a?void 0:a.split(":")[0])||"00",T=(null===(r=this.placesService.currentPlace.notifs_end_time)||void 0===r?void 0:r.split(":")[1])||"00";this.endTime={hours:w,minutes:T}}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(hg.ux),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Y.s))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-band-change-comp"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(gg,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.timeSelectRef=a.first)}},decls:20,vars:3,consts:[["justifyContent","flex-end"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"inner"],[1,"spacer-top-nil"],["type","button",1,"accent-link",3,"click"],["fxLayout","column"],["f","ngForm"],[3,"startTime","endTime","timeChange"],["timeSelect",""],["mat-button","","type","button",1,"button-primary",3,"disabled","click"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"button",1),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.band_change_notification_times,"Band Change Notification Times")}),e.\u0275\u0275text(2," Help "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(3,"div",2)(4,"p",3),e.\u0275\u0275text(5," Enter the time span that you would like to receive band change notifications. Bands as defined in the tabs "),e.\u0275\u0275elementStart(6,"button",4),e.\u0275\u0275listener("click",function(){return i.navigateToTab(i.AlarmsAndNotificationsTabs.pm_levels)}),e.\u0275\u0275text(7," PM"),e.\u0275\u0275elementStart(8,"sub"),e.\u0275\u0275text(9,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(10," Bands "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11," and "),e.\u0275\u0275elementStart(12,"button",4),e.\u0275\u0275listener("click",function(){return i.navigateToTab(i.AlarmsAndNotificationsTabs.heat_bands)}),e.\u0275\u0275text(13," Heat Bands "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(14,"form",5,6)(16,"app-time-select",7,8),e.\u0275\u0275listener("timeChange",function(r){return i.onTimeChange(r)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(18,"button",9),e.\u0275\u0275listener("click",function(){return i.save()}),e.\u0275\u0275text(19,"Save "),e.\u0275\u0275elementEnd()()),2&t){const a=e.\u0275\u0275reference(15),r=e.\u0275\u0275reference(17);e.\u0275\u0275advance(16),e.\u0275\u0275property("startTime",i.startTime)("endTime",i.endTime),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",!a.valid||r.invalidTimeInputs)}},directives:[ae.$,z.lW,_._Y,_.JL,_.F,V.xw,Wn.I],styles:[".inner[_ngcontent-%COMP%]{padding:20px;position:relative}"]}),n})();class Wi{constructor(){}}function Cg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Value is required"),e.\u0275\u0275elementEnd())}function bg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Value is required"),e.\u0275\u0275elementEnd())}let xg=(()=>{class n{constructor(t,i,a,r){this.dialogRef=t,this._messageService=i,this.openingHoursServices=a,this.places=r,this.hour=new Wi,this.destroy$=new H.xQ,this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(l=>{"hour_added"===l&&this.dialogRef.close(),"hour_close"===l&&this.dialogRef.close()})}ngOnInit(){this.hour.time_min="00:00",this.hour.time_max="00:00"}onTimeChange({startTime:t,endTime:i}){this.hour.time_min=t.hours+":"+t.minutes,this.hour.time_max=i.hours+":"+i.minutes}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSubmit(){this.openingHoursServices.addItem(this.places.currentPlace,this.hour)}onNoClick(){this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Gt),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-opening-hour"]],decls:53,vars:7,consts:[["title","Add New Opening Hours","submitText","Add",3,"submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],["fxLayout","","fxLayoutGap","30px"],[2,"width","142px"],["required","","placeholder","Select from day","name","idow_min",3,"ngModel","ngModelChange"],["idow_min","ngModel"],["value",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["value","6"],["value","7"],[4,"ngIf"],["required","","placeholder","Select to day","name","idow_max",3,"ngModel","ngModelChange"],["idow_max","ngModel"],["fxFlex","1 1 100%","fxLayout","row","fxLayoutGap","10px"],[3,"allow24","timeChange"],["timeSelect",""],[1,"example-full-width"],["matInput","","type","text","name","comment","placeholder","Comment",3,"ngModel","ngModelChange"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"p"),e.\u0275\u0275text(2,"Here you can set the time and date that your organisation is open. To define the opening times, just use 'from day' and 'to day' and the respective time duration."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(5,"div",3)(6,"mat-form-field",4)(7,"mat-label"),e.\u0275\u0275text(8,"from Day"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"mat-select",5,6),e.\u0275\u0275listener("ngModelChange",function(r){return i.hour.idow_min=r}),e.\u0275\u0275element(11,"mat-option",7),e.\u0275\u0275elementStart(12,"mat-option",8),e.\u0275\u0275text(13,"Monday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-option",9),e.\u0275\u0275text(15,"Tuesday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"mat-option",10),e.\u0275\u0275text(17,"Wednesday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-option",11),e.\u0275\u0275text(19,"Thursday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"mat-option",12),e.\u0275\u0275text(21,"Friday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"mat-option",13),e.\u0275\u0275text(23,"Saturday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"mat-option",14),e.\u0275\u0275text(25,"Sunday"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(26,Cg,2,0,"mat-error",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"mat-form-field",4)(28,"mat-label"),e.\u0275\u0275text(29,"to Day"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"mat-select",16,17),e.\u0275\u0275listener("ngModelChange",function(r){return i.hour.idow_max=r}),e.\u0275\u0275element(32,"mat-option",7),e.\u0275\u0275elementStart(33,"mat-option",8),e.\u0275\u0275text(34,"Monday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"mat-option",9),e.\u0275\u0275text(36,"Tuesday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(37,"mat-option",10),e.\u0275\u0275text(38,"Wednesday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(39,"mat-option",11),e.\u0275\u0275text(40,"Thursday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(41,"mat-option",12),e.\u0275\u0275text(42,"Friday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"mat-option",13),e.\u0275\u0275text(44,"Saturday"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(45,"mat-option",14),e.\u0275\u0275text(46,"Sunday"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(47,bg,2,0,"mat-error",15),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(48,"div",18)(49,"app-time-select",19,20),e.\u0275\u0275listener("timeChange",function(r){return i.onTimeChange(r)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(51,"mat-form-field",21)(52,"input",22),e.\u0275\u0275listener("ngModelChange",function(r){return i.hour.comment=r}),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(4),r=e.\u0275\u0275reference(10),l=e.\u0275\u0275reference(31),f=e.\u0275\u0275reference(50);e.\u0275\u0275property("submitDisabled",!a.valid||f.invalidTimeInputs),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngModel",i.hour.idow_min),e.\u0275\u0275advance(17),e.\u0275\u0275property("ngIf",r.invalid&&(r.dirty||r.touched)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngModel",i.hour.idow_max),e.\u0275\u0275advance(17),e.\u0275\u0275property("ngIf",l.invali
1d&&(l.dirty||l.touched)),e.\u0275\u0275advance(2),e.\u0275\u0275property("allow24",!0),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",i.hour.comment)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,V.SQ,D.KE,D.hX,_e.gD,_.Q7,_.JJ,_.On,de.ey,u.NgIf,D.TO,V.yH,Wn.I,X.Nt,_.Fj],encapsulation:2}),n})();function yg(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",8),2&n&&e.\u0275\u0275property("message","opening hours")}function Sg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function wg(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",24)(1,"button",25),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).delete(r)}),e.\u0275\u0275text(2,"Delete"),e.\u0275\u0275elementEnd()()}}function Eg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," ID"),e.\u0275\u0275elementEnd())}function Tg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function Ig(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From day"),e.\u0275\u0275elementEnd())}function Pg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.hoursService.days[t.idow_min-1],"")}}function kg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To day"),e.\u0275\u0275elementEnd())}function Mg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.hoursService.days[t.idow_max-1],"")}}function Ag(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From time"),e.\u0275\u0275elementEnd())}function Dg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.time_min,"")}}function Og(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To time"),e.\u0275\u0275elementEnd())}function Lg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.time_max,"")}}function Fg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From date"),e.\u0275\u0275elementEnd())}function Rg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.date_min,"")}}function Ng(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To date"),e.\u0275\u0275elementEnd())}function Vg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.date_max,"")}}function Hg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," Comment"),e.\u0275\u0275elementEnd())}function jg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.comment,"")}}function Bg(n,o){1&n&&e.\u0275\u0275element(0,"tr",26)}function Gg(n,o){1&n&&e.\u0275\u0275element(0,"tr",27)}function zg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",9),e.\u0275\u0275elementContainerStart(1,10),e.\u0275\u0275template(2,Sg,2,0,"th",11),e.\u0275\u0275template(3,wg,3,0,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,13),e.\u0275\u0275template(5,Eg,2,0,"th",11),e.\u0275\u0275template(6,Tg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,14),e.\u0275\u0275template(8,Ig,2,0,"th",11),e.\u0275\u0275template(9,Pg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,15),e.\u0275\u0275template(11,kg,2,0,"th",11),e.\u0275\u0275template(12,Mg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,16),e.\u0275\u0275template(14,Ag,2,0,"th",11),e.\u0275\u0275template(15,Dg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,
117),e.\u0275\u0275template(17,Og,2,0,"th",11),e.\u0275\u0275template(18,Lg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,18),e.\u0275\u0275template(20,Fg,2,0,"th",11),e.\u0275\u0275template(21,Rg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,19),e.\u0275\u0275template(23,Ng,2,0,"th",11),e.\u0275\u0275template(24,Vg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,20),e.\u0275\u0275template(26,Hg,2,0,"th",11),e.\u0275\u0275template(27,jg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(28,Bg,1,0,"tr",21),e.\u0275\u0275template(29,Gg,1,0,"tr",22),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.hoursService.hours),e.\u0275\u0275advance(28),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let $g=(()=>{class n{constructor(t,i,a,r,l,f){this.hoursService=t,this.dialog=i,this.place=a,this.helpService=r,this.messageService=l,this.dialogService=f,this.isTableEmpty=!1,this.displayedColumns=["idow_min","idow_max","time_min","time_max","comment","edit"],this.destroy$=new H.xQ,this.HelpSection=Z.L,this.hoursService.getData(this.place.currentPlace.id)}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"hours_loaded"===t&&(this.isTableEmpty=0===this.hoursService.hours.length)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}delete(t){this.dialog.open(he.$,{width:"370px",data:{yes:"Delete",no:"Cancel",data:`Are you sure you want to delete ${t.comment?t.comment:"opening hours "} ?`}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.hoursService.deleteItem(this.place.currentPlace,t)})}openDialog(){this.matDialogRef=this.dialog.open(xg),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",desktopHeight:"auto"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Gt),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-opening-hours"]],decls:10,vars:2,consts:[[1,"inPage"],["justifyContent","flex-end"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","idow_min"],["matColumnDef","idow_max"],["matColumnDef","time_min"],["matColumnDef","time_max"],["matColumnDef","date_min"],["matColumnDef","date_max"],["matColumnDef","comment"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-button","",1,"button-danger",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"app-sub-header",1)(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.opening_hours,"Opening Hours")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,yg,1,1,"app-no-data",6),e.\u0275\u0275template(9,zg,30,3,"table",7),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(8),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,h.as,h.XQ,h.nj,h.Gk],encapsulation:2}),n})();var Ug=d(26311);let Wg=(()=>{class n{constructor(t,i,a,r){this.dialogRef=t,this._messageService=i,this.openingHoursServices=a,this.places=r,this.hour=new Wi,this.addModus=!0,this.minAvailableDate=new Date,this.hourValues=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"],this.minValues=["00","05","10","15","20","25","30","35","40","45","50","55"],this.destroy$=new H.xQ,this.hour.time_min="xx",this.messageSubscription=this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(l=>{"hour_added"===l&&this.dialogRef.close(),"hour_close"===l&&this.dialogRef.close()})}ngOnInit(){this.hour.time_min_h="00",this.hour.time_min_m="00",this.hour.time_max_h="00",this.hour.time_max_m="00",this.hour.time_min=this.hour.time_min_h+":"+this.hour.time_min_m,this.hour.time_max=this.hour.time_max_h+":"+this.hour.time_max_m}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setValues(){"24"==this.hour.time_min_h&&(this.hour.time_min_m="00"),this.hour.time_min=this.hour.time_min_h+":"+this.hour.time_min_m,this.hour.time_min=this.hour.time_min_h+":"+this.hour.time_min_m,"24"==this.hour.time_max_h&&(this.hour.time_max_m="00"),this.hour.time_max=this.hour.time_max_h+":"+this.hour.time_max_m,this.hour.time_max=this.hour.time_max_h+":"+this.hour.time_max_m}onSubmit(){this.setValues(),this.openingHoursServices.addItem(this.places.currentPlace,this.hour)}onNoClick(){this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Gt),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-holiday"]],decls:8,vars:3,consts:[["title","Add New Closed Days / Holidays","submitText","Add",3,"submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],[3,"minValidDate","maxDateChange","minDateChange"],[1,"example-full-width"],["matInput","","required","","type","text","name","comment","placeholder","Name of Holiday",3,"ngModel","ngModelChange"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"p"),e.\u0275\u0275text(2,"To set vacations and public holidays please use the 'from date' and 'to date' fields. If its only a one day holiday, put the same day in both fields. Use the comment field to name the holiday."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(5,"app-date-range-picker",3),e.\u0275\u0275listener("maxDateChange",function(r){return i.hour.date_max_date=r})("minDateChange",function(r){return i.hour.date_min_date=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-form-field",4)(7,"input",5),e.\u0275\u0275listener("ngModelChange",function(r){return i.hour.comment=r}),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(4);e.\u0275\u0275property("submitDisabled",!a.valid),e.\u0275\u0275advance(5),e.\u0275\u0275property("minValidDate",i.minAvailableDate),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.hour.comment)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,Ug.C,D.KE,X.Nt,_.Fj,_.Q7,_.JJ,_.On],encapsulation:2}),n})();function Qg(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",8),2&n&&e.\u0275\u0275property("message","holidays or closed days")}function qg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function Kg(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",24)(1,"button",25),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).delete(r)}),e.\u0275\u0275text(2,"Delete"),e.\u0275\u0275elementEnd()()}}function Yg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," ID"),e.\u0275\u0275elementEnd())}function Xg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function Zg(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From day"),e.\u0275\u0275elementEnd())}function Jg(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.hoursService.days[t.idow_min-1],"")}}function ev(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To day"),e.\u0275\u0275elementEnd())}function tv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.hoursService.days[t.idow_max-1],"")}}function nv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From time"),e.\u0275\u0275elementEnd())}function iv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.time_min,"")}}function av(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To time"),e.\u0275\u0275elementEnd())}function ov(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.time_max,"")}}function rv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," From date"),e.\u0275\u0275elementEnd())}function lv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.date_min,"MMM-dd-YYYY"),"")}}function sv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," To date"),e.\u0275\u0275elementEnd())}function cv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.date_max,"MMM-dd-YYYY"),"")}}function pv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," Holiday"),e.\u0275\u0275elementEnd())}function mv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.comment,"")}}function dv(n,o){1&n&&e.\u0275\u0275element(0,"tr",26)}function uv(n,o){1&n&&e.\u0275\u0275element(0,"tr",27)}function _v(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",9),e.\u0275\u0275elementContainerStart(1,10),e.\u0275\u0275template(2,qg,2,0,"th",11),e.\u0275\u0275template(3,Kg,3,0,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,13),e.\u0275\u0275template(5,Yg,2,0,"th",11),e.\u0275\u0275template(6,Xg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,14),e.\u0275\u0275template(8,Zg,2,0,"th",11),e.\u0275\u0275template(9,Jg,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,15),e.\u0275\u0275template(11,ev,2,0,"th",11),e.\u0275\u0275template(12,tv,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,16),e.\u0275\u0275template(14,nv,2,0,"th",11),e.\u0275\u0275template(15,iv,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,
117),e.\u0275\u0275template(17,av,2,0,"th",11),e.\u0275\u0275template(18,ov,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,18),e.\u0275\u0275template(20,rv,2,0,"th",11),e.\u0275\u0275template(21,lv,3,4,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,19),e.\u0275\u0275template(23,sv,2,0,"th",11),e.\u0275\u0275template(24,cv,3,4,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,20),e.\u0275\u0275template(26,pv,2,0,"th",11),e.\u0275\u0275template(27,mv,2,1,"td",12),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(28,dv,1,0,"tr",21),e.\u0275\u0275template(29,uv,1,0,"tr",22),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.hoursService.holidays),e.\u0275\u0275advance(28),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let fv=(()=>{class n{constructor(t,i,a,r,l,f){this.hoursService=t,this.dialog=i,this.helpService=a,this.place=r,this.messageService=l,this.dialogService=f,this.isTableEmpty=!1,this.displayedColumns=["date_min","date_max","comment","edit"],this.destroy$=new H.xQ,this.HelpSection=Z.L,this.hoursService.getData(this.place.currentPlace.id)}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"hours_loaded"===t&&(this.isTableEmpty=0===this.hoursService.holidays.length)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}delete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.hoursService.deleteItem(this.place.currentPlace,t)})}openDialog(){this.matDialogRef=this.dialog.open(Wg),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",desktopHeight:"auto"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Gt),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-holidays"]],decls:10,vars:2,consts:[[1,"inPage"],["justifyContent","flex-end"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","idow_min"],["matColumnDef","idow_max"],["matColumnDef","time_min"],["matColumnDef","time_max"],["matColumnDef","date_min"],["matColumnDef","date_max"],["matColumnDef","comment"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-button","",1,"button-danger",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"app-sub-header",1)(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.holidays,"Closed Days / Holidays")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,Qg,1,1,"app-no-data",6),e.\u0275\u0275template(9,_v,30,3,"table",7),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(8),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,h.as,h.XQ,h.nj,h.Gk],pipes:[u.DatePipe],encapsulation:2}),n})();var Qi=d(23753);class qi{}function hv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Value is required"),e.\u0275\u0275elementEnd())}let Ki=(()=>{class n{constructor(t,i,a,r,l,f){this.dialogRef=t,this._messageService=i,this.fb=a,this.data=r,this.aqiLevelServices=l,this.places=f,this.level=new qi,this.editModus=!1,this.destroy$=new H.xQ,r&&(this.editModus=!0,this.level=r),this.createForm(),this.messageSubscription=this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(w=>{"policy_added"===w&&this.dialogRef.close(),"policy_close"===w&&this.dialogRef.close()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}createForm(){this.aqiForm=this.fb.group(this.level),this.level.measure="pm02",this.level.indoor=!1,this.level.icon="moderate"}onSubmit(){this.editModus?this.aqiLevelServices.editItem(this.places.currentPlace,this.level):this.aqiLevelServices.addItem(this.places.currentPlace,this.level)}onNoClick(){this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(At.H),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-aqi-policy"]],decls:49,vars:11,consts:[[3,"title","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],["fxLayout","row wrap","fxLayoutGap","10px"],["matInput","","type","number","required","","name","min",3,"ngModel","ngModelChange"],["matInput","","type","number","required","","name","max",3,"ngModel","ngModelChange"],["fxLayout","","fxLayoutGap","16px grid"],["required","","placeholder","Select color band","name","color",3,"ngModel","ngModelChange"],["color","ngModel"],["value","green"],["value","yellow"],["value","orange"],["value","red"],["value","purple"],["value","brown"],[4,"ngIf"],["matInput","","type","text","required","","placeholder","Title","name","title",3,"ngModel","ngModelChange"],["matInput","","type","text","required","","placeholder","Description","name","description",3,"ngModel","ngModelChange"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"p"),e.\u0275\u0275text(2,"Here you can add and change PM"),e.\u0275\u0275elementStart(3,"sub"),e.\u0275\u0275text(4,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(5," level. Please enter the PM"),e.\u0275\u0275elementStart(6,"sub"),e.\u0275\u0275text(7,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(11,"div",3)(12,"mat-form-field")(13,"mat-label"),e.\u0275\u0275text(14,"PM"),e.\u0275\u0275elementStart(15,"sub"),e.\u0275\u0275text(16,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"input",4),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.min=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(19,"mat-form-field")(20,"mat-label"),e.\u0275\u0275text(21,"PM"),e.\u0275\u0275elementStart(22,"sub"),e.\u0275\u0275text(23,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(24),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"input",5),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.max=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(26,"div",6)(27,"mat-form-field")(28,"mat-label"),e.\u0275\u0275text(29,"Color"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(30,"mat-select",7,8),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.color=r}),e.\u0275\u0275elementStart(32,"mat-option",9),e.\u0275\u0275text(33,"Green"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(34,"mat-option",10),e.\u0275\u0275text(35,"Yellow"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(36,"mat-option",11),e.\u0275\u0275text(37,"Orange"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"mat-option",12),e.\u0275\u0275text(39,"Red"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"mat-option",13),e.\u0275\u0275text(41,"Purple"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(42,"mat-option",14),e.\u0275\u0275text(43,"Brown"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(44,hv,2,0,"mat-error",15),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(45,"mat-form-field")(46,"input",16),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.title=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(47,"mat-form-field")(48,"input",17),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.description=r}),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(10),r=e.\u0275\u0275reference(31);e.\u0275\u0275property("title",i.editModus?"Edit Guideline Item":"Add New Guideline Item")("submitDisabled",!a.valid),e.\u0275\u0275advance(8),e.\u0275\u0275textInterpolate1(" value in ",i.aqiLevelServices.getGuidelineLabel(i.places.currentPlace.pm_standard),"."),e.\u0275\u0275advance(9),e.\u0275\u0275textInterpolate1(" (",i.aqiLevelServices.getGuidelineLabel(i.places.currentPlace.pm_standard),") min"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.level.min),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" (",i.aqiLevelServices.getGuidelineLabel(i.places.currentPlace.pm_standard),") max"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.level.max),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",i.level.color),e.\u0275\u0275advance(14),e.\u0275\u0275property("ngIf",r.invalid&&(r.dirty||r.touched)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.level.t
1itle),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.level.description)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,V.SQ,D.KE,D.hX,X.Nt,_.wV,_.Fj,_.Q7,_.JJ,_.On,_e.gD,de.ey,u.NgIf,D.TO],encapsulation:2}),n})();function gv(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",10),2&n&&e.\u0275\u0275property("message","PM2.5 bands")}function vv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function Cv(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",30),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,r=e.\u0275\u0275nextContext(2);return r.editDialog(r.placesService.currentPlace,a)}),e.\u0275\u0275text(1,"Edit "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",30),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).deleteItem(a)}),e.\u0275\u0275text(3,"Delete "),e.\u0275\u0275elementEnd()}}function bv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26)(1,"mat-menu",null,27),e.\u0275\u0275template(3,Cv,4,0,"ng-template",28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",29)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function xv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"th",31),e.\u0275\u0275text(1,"PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" (",t.guidelineServices.getGuidelineLabel(t.placesService.currentPlace.pm_standard),") min ")}}function yv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.min,"")}}function Sv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"th",31),e.\u0275\u0275text(1,"PM"),e.\u0275\u0275elementStart(2,"sub"),e.\u0275\u0275text(3,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" (",t.guidelineServices.getGuidelineLabel(t.placesService.currentPlace.pm_standard),") max ")}}function wv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.max,"")}}function Ev(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Color"),e.\u0275\u0275elementEnd())}function Tv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",32),e.\u0275\u0275element(1,"div",33),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("background-color",i.colorsServices.getColorOpen(t.color)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.color," ")}}function Iv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Title"),e.\u0275\u0275elementEnd())}function Pv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.title,"")}}function kv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Description"),e.\u0275\u0275elementEnd())}function Mv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description,"")}}function Av(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Icon"),e.\u0275\u0275elementEnd())}function Dv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275element(1,"mat-icon",34),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275propertyInterpolate("svgIcon",t.icon)}}function Ov(n,o){1&n&&e.\u0275\u0275element(0,"tr",35)}function Lv(n,o){1&n&&e.\u0275\u0275element(0,"tr",36)}function Fv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",11),e.\u0275\u0275elementContainerStart(1,12),e.\u0275\u0275template(2,vv,2,0,"th",13),e.\u0275\u0275template(3,bv,7,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,15),e.\u0275\u0275template(5,xv,5,1,"th",16),e.\u0275\u0275template(6,yv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,17),e.\u0275\u0275template(8,Sv,5,1,"th",16),e.\u0275\u0275template(9,wv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,18),e.\u0275\u0275template(11,Ev,2,0,"th",13),e.\u0275\u0275template(12,Tv,3,3,"td",19),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,20),e.\u0275\u0275template(14,Iv,2,0,"th",13),e.\u0275\u0275template(15,Pv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,21),e.\u0275\u0275template(17,kv,2,0,"th",13),e.\u0275\u0275template(18,Mv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,22),e.\u0275\u0275template(20,Av,2,0,"th",13),e.\u0275\u0275template(21,Dv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(22,Ov,1,0,"tr",23),e.\u0275\u0275template(23,Lv,1,0,"tr",24),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(22),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let Rv=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.guidelineServices=t,this.dialog=i,this.colorsServices=a,this.placesService=r,this.dialogService=l,this.router=f,this.helpService=w,this._messageService=T,this.isTableEmpty=!1,this.displayedColumns=["pm_min","pm_max","color","title","description","edit"],this.AlarmsAndNotificationsTabs=sn.p,this.HelpSection=Z.L,this.destroy$=new H.xQ}ngOnInit(){this.guidelineServices.getGuideline(this.placesService.currentPlace.id),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{switch(t){case"guidelines_loaded":{const i=this.guidelineServices.getPmLevelsForCurrentStandard();this.isTableEmpty=0===i.length,this.dataSource=new h.by(i);break}}}),this.calculateIfMobile(),(0,Qi.R)(window,"resize").pipe((0,Ut.x)(),(0,rt.b)(500),(0,A.R)(this.destroy$)).subscribe(()=>{this.calculateIfMobile()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openDialog(){this.matDialogRef=this.dialog.open(Ki),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",de
1sktopHeight:"auto"})}deleteItem(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete "+t.title+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.guidelineServices.deleteItem(this.placesService.currentPlace,t)})}editDialog(t,i){this.matDialogRef=this.dialog.open(Ki,{data:i}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",desktopHeight:"auto"})}navigateToTab(t){this.router.navigate([],{queryParams:{tab:String(t)}})}calculateIfMobile(){this.mobile=window.screen.width<768}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(At.H),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Hn.h),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-aqi-levels"]],decls:14,vars:3,consts:[[1,"inPage"],[3,"justifyContent"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"important-message","spacer-bottom-lg"],[1,"accent-link",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","pm_min"],["style","min-width: 60px","mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","pm_max"],["matColumnDef","color"],["style","min-width: 70px","mat-cell","",4,"matCellDef"],["matColumnDef","title"],["matColumnDef","description"],["matColumnDef","icon"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","","type","button",3,"matMenuTriggerFor"],["mat-menu-item","","type","button",3,"click"],["mat-header-cell","",2,"min-width","60px"],["mat-cell","",2,"min-width","70px"],[1,"point"],[1,"svgicon",3,"svgIcon"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"app-sub-header",1)(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.aqi_levels,"PM2.5 Bands (US AQI)")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275text(8," You can configure Notification Times in "),e.\u0275\u0275elementStart(9,"a",6),e.\u0275\u0275listener("click",function(){return i.navigateToTab(i.AlarmsAndNotificationsTabs.band_change_notification_times)}),e.\u0275\u0275text(10," Band Change Notification Times "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",7),e.\u0275\u0275template(12,gv,1,1,"app-no-data",8),e.\u0275\u0275template(13,Fv,24,3,"table",9),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent","flex-end"),e.\u0275\u0275advance(11),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,Q.Hw,h.as,h.XQ,h.nj,h.Gk],styles:[".important-message[_ngcontent-%COMP%]{margin:var(--sm-size)}.mat-cell[_ngcontent-%COMP%], .mat-header-cell[_ngcontent-%COMP%]{padding:0 3px;box-sizing:border-box}@media (min-width: 768px){.mat-column-title[_ngcontent-%COMP%]{min-width:75px}}
1.mat-column-description[_ngcontent-%COMP%]{min-width:200px;width:fit-content}@media (max-width: 500px){.table-upper-bar[_ngcontent-%COMP%]{gap:30px;flex-direction:column;padding-bottom:20px}}"]}),n})();function Nv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1,"Value is required"),e.\u0275\u0275elementEnd())}let Yi=(()=>{class n{constructor(t,i,a,r,l,f){this.dialogRef=t,this._messageService=i,this.fb=a,this.data=r,this.aqiLevelServices=l,this.places=f,this.level=new qi,this.editModus=!1,this.destroy$=new H.xQ,r&&(this.editModus=!0,this.level=r),this.createForm(),this.messageSubscription=this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(w=>{"policy_added"===w&&this.dialogRef.close(),"policy_close"===w&&this.dialogRef.close()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}createForm(){this.aqiForm=this.fb.group(this.level),this.level.measure="heatindex",this.level.indoor=!1,this.level.icon="moderate"}onSubmit(){this.editModus?this.aqiLevelServices.editItem(this.places.currentPlace,this.level):this.aqiLevelServices.addItem(this.places.currentPlace,this.level)}onNoClick(){this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(At.H),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-heat-policy"]],decls:33,vars:8,consts:[[3,"title","submitDisabled","cancel","submitting"],["fxLayout","column",3,"ngSubmit"],["f","ngForm"],["fxLayout","row wrap","fxLayoutGap","10px"],["matInput","","type","number","required","","placeholder","HEAT min","name","min",3,"ngModel","ngModelChange"],["matInput","","type","number","required","","placeholder","HEAT max","name","max",3,"ngModel","ngModelChange"],["fxLayout","","fxLayoutGap","16px grid"],["required","","placeholder","Select color band","name","color",3,"ngModel","ngModelChange"],["color","ngModel"],["value","green"],["value","yellow"],["value","orange"],["value","red"],["value","purple"],["value","brown"],[4,"ngIf"],["matInput","","type","text","required","","placeholder","Title","name","title",3,"ngModel","ngModelChange"],["matInput","","type","text","required","","placeholder","Description","name","description",3,"ngModel","ngModelChange"]],template:function(t,i){if(1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"p"),e.\u0275\u0275text(2,"Here you can add and change HEAT level."),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"form",1,2),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(5,"div",3)(6,"mat-form-field")(7,"input",4),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.min=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(8,"mat-form-field")(9,"input",5),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.max=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"div",6)(11,"mat-form-field")(12,"mat-label"),e.\u0275\u0275text(13,"Color"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-select",7,8),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.color=r}),e.\u0275\u0275elementStart(16,"mat-option",9),e.\u0275\u0275text(17,"Green"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"mat-option",10),e.\u0275\u0275text(19,"Yellow"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"mat-option",11),e.\u0275\u0275text(21,"Orange"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(22,"mat-option",12),e.\u0275\u0275text(23,"Red"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"mat-option",13),e.\u0275\u0275text(25,"Purple"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"mat-option",14),e.\u0275\u0275text(27,"Brown"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(28,Nv,2,0,"mat-error",15),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(29,"mat-form-field")(30,"input",16),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.t
1itle=r}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(31,"mat-form-field")(32,"input",17),e.\u0275\u0275listener("ngModelChange",function(r){return i.level.description=r}),e.\u0275\u0275elementEnd()()()()),2&t){const a=e.\u0275\u0275reference(4),r=e.\u0275\u0275reference(15);e.\u0275\u0275property("title",i.editModus?"Edit Heat Level Item":"Add New Heat Level Item")("submitDisabled",!a.valid),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",i.level.min),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.level.max),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",i.level.color),e.\u0275\u0275advance(14),e.\u0275\u0275property("ngIf",r.invalid&&(r.dirty||r.touched)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.level.title),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngModel",i.level.description)}},directives:[ve.b,_._Y,_.JL,_.F,V.xw,V.SQ,D.KE,X.Nt,_.wV,_.Fj,_.Q7,_.JJ,_.On,D.hX,_e.gD,de.ey,u.NgIf,D.TO],encapsulation:2}),n})();function Vv(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",10),2&n&&e.\u0275\u0275property("message","heat bands")}function Hv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function jv(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",30),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit,r=e.\u0275\u0275nextContext(2);return r.editDialog(r.place.currentPlace,a)}),e.\u0275\u0275text(1,"Edit"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",30),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).deleteItem(a)}),e.\u0275\u0275text(3,"Delete"),e.\u0275\u0275elementEnd()}}function Bv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26)(1,"mat-menu",null,27),e.\u0275\u0275template(3,jv,4,0,"ng-template",28),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",29)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275reference(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function Gv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",31),e.\u0275\u0275text(1," HEAT min"),e.\u0275\u0275elementEnd())}function zv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.min,"")}}function $v(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",31),e.\u0275\u0275text(1," HEAT max"),e.\u0275\u0275elementEnd())}function Uv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.max,"")}}function Wv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Color"),e.\u0275\u0275elementEnd())}function Qv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",32),e.\u0275\u0275element(1,"div",33),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("background-color",i.colorsServices.getColorOpen(t.color)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.color," ")}}function qv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Title"),e.\u0275\u0275elementEnd())}function Kv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.title,"")}}function Yv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Description"),e.\u0275\u0275elementEnd())}function Xv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description,"")}}function Zv(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",25),e.\u0275\u0275text(1," Icon"),e.\u0275\u0275elementEnd())}function Jv(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",26),e.\u0275\u0275element(1,"mat-icon",34),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275propertyInterpolate("svgIcon",t.icon)}}function eC(n,o){1&n&&e.\u0275\u0275element(0,"tr",35)}function tC(n,o){1&n&&e.\u0275\u0275element(0,"tr",36)}function nC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",11),e.\u0275\u0275elementContainerStart(1,12),e.\u0275\u0275template(2,Hv,2,0,"th",13),e.\u0275\u0275template(3,Bv,7,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,15),e.\u0275\u0275template(5,Gv,2,0,"th",16),e.\u0275\u0275template(6,zv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,17),e.\u0275\u0275template(8,$v,2,0,"th",16),e.\u0275\u0275template(9,
1Uv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,18),e.\u0275\u0275template(11,Wv,2,0,"th",13),e.\u0275\u0275template(12,Qv,3,3,"td",19),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,20),e.\u0275\u0275template(14,qv,2,0,"th",13),e.\u0275\u0275template(15,Kv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,21),e.\u0275\u0275template(17,Yv,2,0,"th",13),e.\u0275\u0275template(18,Xv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,22),e.\u0275\u0275template(20,Zv,2,0,"th",13),e.\u0275\u0275template(21,Jv,2,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(22,eC,1,0,"tr",23),e.\u0275\u0275template(23,tC,1,0,"tr",24),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",null==t.aqiService?null:t.aqiService.heatLevels),e.\u0275\u0275advance(22),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}let iC=(()=>{class n{constructor(t,i,a,r,l,f,w,T){this.aqiService=t,this.dialog=i,this.router=a,this.colorsServices=r,this.place=l,this.helpService=f,this.messageService=w,this.dialogService=T,this.isTableEmpty=!1,this.displayedColumns=["heat_min","heat_max","color","title","description","edit"],this.destroy$=new H.xQ,this.HelpSection=Z.L,this.AlarmsAndNotificationsTabs=sn.p}ngOnInit(){this.aqiService.getGuideline(this.place.currentPlace.id),this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"guidelines_loaded"===t&&(this.isTableEmpty=0===this.aqiService.heatLevels.length)}),this.calculateIfMobile(),(0,Qi.R)(window,"resize").pipe((0,Ut.x)(),(0,rt.b)(500),(0,A.R)(this.destroy$)).subscribe(()=>{this.calculateIfMobile()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openDialog(){this.matDialogRef=this.dialog.open(Yi),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",desktopHeight:"auto"})}deleteItem(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure you want to delete "+t.title+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.aqiService.deleteItem(this.place.currentPlace,t)})}editDialog(t,i){this.matDialogRef=this.dialog.open(Yi,{data:i}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"80%",desktopHeight:"auto"})}navigateToTab(t){this.router.navigate([],{queryParams:{tab:String(t)}})}calculateIfMobile(){this.mobile=window.screen.width<768}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(At.H),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(Hn.h),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-heat-levels"]],decls:14,vars:3,consts:[[1,"inPage"],[3,"justifyContent"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"important-message","spacer-bottom-lg"],[1,"accent-link",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","heat_min"],["style","min-width: 60px","mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","heat_max"],["matColumnDef","color"],["style","min-width: 70px","mat-cell","",4,"matCellDef"],["matColumnDef","title"],["matColumnDef","description"],["matColumnDef","icon"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-header-cell","",2,"min-width","60px"],["mat-cell","",2,"min-width","70px"],[1,"point"],[1,"svgicon",3,"svgIcon"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"app-sub-header",1)(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.heat_levels,"Heat Bands")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275text(8," You can configure Notification Times in "),e.\u0275\u0275elementStart(9,"button",6),e.\u0275\u0275listener("click",function(){return i.navigateToTab(i.AlarmsAndNotificationsTabs.band_change_notification_times)}),e.\u0275\u0275text(10," Band Change Notification Times "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",7),e.\u0275\u0275template(12,Vv,1,1,"app-no-data",8),e.\u0275\u0275template(13,nC,24,3,"table",9),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent","flex-end"),e.\u0275\u0275advance(11),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,Q.Hw,h.as,h.XQ,h.nj,h.Gk],styles:[".important-message[_ngcontent-%COMP%]{margin:var(--sm-size)}.mat-cell[_ngcontent-%COMP%], .mat-header-cell[_ngcontent-%COMP%]{padding:0 3px;box-sizing:border-box}@media (min-width: 768px){.mat-column-title[_ngcontent-%COMP%]{min-width:75px}}
1.mat-column-description[_ngcontent-%COMP%]{min-width:200px;width:fit-content}@media (max-width: 500px){.table-upper-bar[_ngcontent-%COMP%]{gap:30px;flex-direction:column;padding-bottom:20px}}"]}),n})();class aC{}let oC=(()=>{class n{constructor(t,i,a,r){this.dialogRef=t,this._messageService=i,this.intradayTimesServices=a,this.places=r,this.time=new aC,this.destroy$=new H.xQ,this.messageSubscription=this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(l=>{"time_added"===l&&this.dialogRef.close(),"time_close"===l&&this.dialogRef.close()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onTimeChange({startTime:t}){this.time.time=t.hours+":"+t.minutes}onSubmit(){this.intradayTimesServices.addItem(this.places.currentPlace,this.time)}onNoClick(){this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Ln),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-intraday-time"]],decls:8,vars:4,consts:[[3,"title","submitDisabled","cancel","submitting"],[2,"text-align","center"],[2,"display","inline-block",3,"ngSubmit"],["f","ngForm"],[3,"show24","singleInputMode","timeChange"],["timeSelect",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(1,"div",1)(2,"p"),e.\u0275\u0275text(3,"Here you can add the time to send the scheduled report"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"form",2,3),e.\u0275\u0275listener("ngSubmit",function(){return i.onSubmit()}),e.\u0275\u0275elementStart(6,"app-time-select",4,5),e.\u0275\u0275listener("timeChange",function(r){return i.onTimeChange(r)}),e.\u0275\u0275elementEnd()()()()),2&t&&(e.\u0275\u0275property("title","Add New Scheduled Notification")("submitDisabled",!i.time.time||"00:00"===i.time.time),e.\u0275\u0275advance(6),e.\u0275\u0275property("show24",!1)("singleInputMode",!0))},directives:[ve.b,_._Y,_.JL,_.F,Wn.I],styles:["app-add-intraday-time .dialog-content{padding-bottom:10px!important}"]}),n})();function rC(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",9),2&n&&e.\u0275\u0275property("message","notifications")}function lC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function sC(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",19)(1,"button",20),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).ondelete(r)}),e.\u0275\u0275text(2,"Delete"),e.\u0275\u0275elementEnd()()}}function cC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Id"),e.\u0275\u0275elementEnd())}function pC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",19),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function mC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Time"),e.\u0275\u0275elementEnd())}function dC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",19),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.time,"")}}function uC(n,o){1&n&&e.\u0275\u0275element(0,"tr",21)}function _C(n,o){1&n&&e.\u0275\u0275element(0,"tr",22)}function fC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",10),e.\u0275\u0275elementContainerStart(1,11),e.\u0275\u0275template(2,lC,2,0,"th",12),e.\u0275\u0275template(3,sC,3,0,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,14),e.\u0275\u0275template(5,cC,2,0,"th",12),e.\u0275\u0275template(6,pC,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,15),e.\u0275\u0275template(8,mC,2,0,"th",12),e.\u0275\u0275template(9,dC,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(10,uC,1,0,"tr",16),e.\u0275\u0275template(11,_C,1,0,"tr",17),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",null==t.intradayTimesServices?null:t.intradayTimesServices.intradayTimes),e.\u0275\u0275advance(10),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function hC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",23),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",null==t.intradayTimesServices?null:t.intradayTimesServices.intradayTimes.length," Items")}}let gC=(()=>{class n{constructor(t,i,a,r,l,f){this.intradayTimesServices=t,this.dialog=i,this.helpService=a,this.place=r,this.messageService=l,this.dialogService=f,this.isTableEmpty=!1,this.displayedColumns=["time","edit"],this.HelpSection=Z.L,this.destroy$=new H.xQ,this.intradayTimesServices.getTimes(this.place.currentPlace.id)}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"time_loaded"===t&&(this.isTableEmpty=0===this.intradayTimesServices.intradayTimes.length)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openDialog(){this.matDialogRef=this.dialog.open(oC),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"50%",desktopHeight:"auto"})}ondelete(t){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:"Are you sure to delete "+t.time+"?"}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(a=>{a&&this.intradayTimesServices.deleteItem(this.place.currentPlace,t)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Ln),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-administration-intraday-times"]],decls:11,vars:3,consts:[[1,"inPage"],["justifyContent","flex-end"],[1,"right-buttons-wrapper"],["mat-button","","type","button",1,"button-primary",3,"click"],["mat-button","","type","button",1,"button-secondary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","",3,"dataSource",4,"ngIf"],["class","table-counter",4,"ngIf"],[3,"message"],["mat-table","",1,"ag-table-main",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","time"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-button","",1,"button-danger",3,"click"],["mat-header-row",""],["mat-row",""],[1,"table-counter"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"app-sub-header",1)(2,"div",2)(3,"button",3),e.\u0275\u0275listener("click",function(){return i.openDialog()}),e.\u0275\u0275text(4,"Add New "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",4),e.\u0275\u0275listener("click",function(){return i.helpService.openHelpDialog(i.HelpSection.scheduled_notifications,"Scheduled Notifications")}),e.\u0275\u0275text(6," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,rC,1,1,"app-no-data",6),e.\u0275\u0275template(9,fC,12,3,"table",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,hC,2,1,"div",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(8),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[ae.$,z.lW,u.NgIf,ye.d,h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,h.as,h.XQ,h.nj,h.Gk],encapsulation:2}),n})();const vC=["tabGroup"];function CC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-alarms")}const Lt=function(n){return[n]};function bC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Band Change Notification Times")("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function xC(n,o){1&n&&e.\u0275\u0275element(0,"app-band-change-comp")}function yC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,bC,1,4,"ng-template",7),e.\u0275\u0275template(2,xC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function SC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Opening Hours")("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function wC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-opening-hours")}function EC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,SC,1,4,"ng-template",7),e.\u0275\u0275template(2,wC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function TC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Closed Days / Holidays")("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function IC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-holidays")}function PC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,TC,1,4,"ng-template",7),e.\u0275\u0275template(2,IC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function kC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275propertyInterpolate1("textContent","PM<sub>2.5</sub> Bands (",t.guidelineServices.getGuidelineLabel(t.places.currentPlace.pm_standard),")"),e.\u0275\u0275property("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function MC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-aqi-levels")}function AC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,kC,1,4,"ng-template",7),e.\u0275\u0275template(2,MC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function DC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Heat Bands")("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function OC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-heat-levels")}function LC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,DC,1,4,"ng-template",7),e.\u0275\u0275template(2,OC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function FC(n,o){if(1&n&&e.\u0275\u0275element(0,"app-mark-permissions",8),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("textContent","Scheduled Notifications")("permissions",e.\u0275\u0275pureFunction1(2,Lt,t.UsersPermissions.advanced_config))}}function RC(n,o){1&n&&e.\u0275\u0275element(0,"app-administration-intraday-times")}function NC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab"),e.\u0275\u0275template(1,FC,1,4,"ng-template",7),e.\u0275\u0275template(2,RC,1,0,"ng-template",5),e.\u0275\u0275elementEnd())}function VC(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-tab-group",2,3),e.\u0275\u0275listener("selectedTabChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateRoute()}),e.\u0275\u0275elementStart(2,"mat-tab",4),e.\u0275\u0275template(3,CC,1,0,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,yC,3,0,"mat-tab",6),e.\u0275\u0275template(5,EC,3,0,"mat-tab",6),e.\u0275\u0275template(6,PC,3,0,"mat-tab",6),e.\u0275\u0275template(7,AC,3,0,"mat-tab",6),e.\u0275\u0275template(8,LC,3,0,"mat-tab",6),e.\u0275\u0275template(9,NC,3,0,"mat-tab",6),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.places||null==t.places.currentPlace?null:t.places.currentPlace.advanced_config)||(null==t.user||null==t.user.currentUser?null:t.user.currentUser.admin))}}let HC=(()=>{class n{constructor(t,i,a,r,l,f){this.user=t,this.places=i,this.dataServices=a,this.router=r,this.guidelineServices=l,this.activatedRoute=f,this.UsersPermissions=it.S,this.destroy$=new H.xQ}ngOnInit(){this.dataServices.currentScreen="Alarms & Notifications"}ngAfterViewInit(){this.activatedRoute.queryParams.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.setSelectedTabIndex(this.activatedRoute.snapshot.queryParams.tab||0)})}ngOnDestroy(){this.dataServices.currentScreen=null,this.destroy$.next(),this.destroy$.complete()}updateRoute(){this.router.navigate([],{queryParams:{tab:this.tabGroup.selectedIndex}})}setSelectedTabIndex(t,i=!1){this.tabGroup.selectedIndex=Number(t),i&&setTimeout(()=>{window.scrollTo({top:i,behavior:"smooth"})},200)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(xe.K),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(At.H),e.\u0275\u0275directiveInject(y.gz))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-alarms-and-notifications"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(vC,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.tabGroup=a.first)}},decls:2,vars:1,consts:[[1,"page"],[3,"selectedTabChange",4,"ngIf"],[3,"selectedTabChange"],["tabGroup",""],["label","Alarms"],["matTabContent",""],[4,"ngIf"],["mat-tab-label",""],[3,"textContent","permissions"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0),e.\u0275\u0275template(1,VC,10,
16,"mat-tab-group",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.places.currentPlace))},directives:[u.NgIf,se.SP,se.uX,se.Vc,fg,se.uD,dt.S,vg,$g,fv,Rv,iC,gC],styles:[""]}),n})();function jC(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",10)}function BC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1,"EcwidID"),e.\u0275\u0275elementEnd())}function GC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20)(1,"span",21),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.ecwid_id)}}function zC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1,"To"),e.\u0275\u0275elementEnd())}function $C(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20)(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.receiver)}}function UC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1,"Tracking Number"),e.\u0275\u0275elementEnd())}function WC(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," Tracking Number is required. "),e.\u0275\u0275elementEnd())}function QC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20)(1,"mat-form-field",22),e.\u0275\u0275element(2,"mat-label")(3,"input",23)(4,"mat-icon",24),e.\u0275\u0275template(5,WC,2,0,"mat-error",25),e.\u0275\u0275elementEnd()()),2&n){const t=o.index,i=e.\u0275\u0275nextContext(3);let a;e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroupName",t),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",null==(a=i.trackingNumbersFormArray.controls[t].get("trackingNumber"))?null:a.hasError("required"))}}function qC(n,o){1&n&&e.\u0275\u0275element(0,"tr",26)}function KC(n,o){1&n&&e.\u0275\u0275element(0,"tr",27)}function YC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",11),e.\u0275\u0275elementContainerStart(1,12),e.\u0275\u0275template(2,BC,2,0,"th",13),e.\u0275\u0275template(3,GC,3,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,15),e.\u0275\u0275template(5,zC,2,0,"th",13),e.\u0275\u0275template(6,$C,3,1,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,16),e.\u0275\u0275template(8,UC,2,0,"th",13),e.\u0275\u0275template(9,QC,6,2,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(10,qC,1,0,"tr",17),e.\u0275\u0275template(11,KC,1,0,"tr",18),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(10),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function XC(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"form",6)(1,"div",7),e.\u0275\u0275template(2,jC,1,0,"app-no-data",8),e.\u0275\u0275template(3,YC,12,3,"table",9),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("formGroup",t.trackingNumbersForm),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isTableEmpty)}}let ZC=(()=>{class n{constructor(t,i,a,r,l,f,w){this._messageService=t,this.dataServices=i,this.fb=a,this.pickupsService=r,this.activatedRoute=l,this.httpHelper=f,this.route=w,this.destroy$=new H.xQ,this.displayedColumns=["ecwid_id","receiver","tracking_number"],this.isTableEmpty=!1}set matSort(t){this.dataSource&&(this.dataSource.sort=t)}ngOnInit(){this.dataServices.currentScreen="Pickups - Tracking Numbers List",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(i=>{"pickup_print_info_loaded"===i&&(this.dataSource=new h.by(this.pickupsService.currentPrintLabelsInformation.orders),this.isTableEmpty=0===this.dataSource.data.length,this.trackingNumbersForm=this.fb.group({trackingNumbersList:this.fb.array(this.dataSource.data.map(a=>this.createTrackingNumbersFormGroup(a)))})),"tracking_numbers_saved"===i&&(this.route.navigate(["settings/pickups"]),this.httpHelper.showSnackbar("Successfully saved!"))}),this.pickupsService.printLabelsData(this.activatedRoute.snapshot.params.pickupId)}get trackingNumbersFormArray(){return this.trackingNumbersForm.controls.trackingNumbersList}createTrackingNumbersFormGroup(t){return new _.cw({ecwidID:new _.NI(t.ecwid_id,[_.kI.required]),trackingNumber:new _.NI(t.tracking_number,[_.kI.required])})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}returnToPickups(){this.route.navigate(["settings/pickups"])}saveTrackingNumbers(){this.trackingNumbersFormArray.value.forEach(t=>{this.pickupsService.saveTrackingNumbers(this.pickupsService.currentPrintLabelsInformation.id,t.ecwidID,t.trackingNumber)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject($n),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(y.F0))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-tracking-numbers-table"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matSort=a.first)}},decls:8,vars:3,consts:[[3,"justifyContent"],[1,"right-buttons-wrapper"],["type","button","mat-button","",1,"button-primary",3,"disabled","click"],["type","button","mat-button","",1,"button-secondary",3,"click"],[1,"page"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"ag-table-wrapper","spacer-bottom-extra"],["message","tracking numbers",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","","formArrayName","trackingNumbersList",3,"dataSource",4,"ngIf"],["message","tracking numbers"],["mat-table","","matSort","","formArrayName","trackingNumbersList",1,"ag-table-main",3,"dataSource"],["matColumnDef","ecwid_id","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","receiver"],["matColumnDef","tracking_number"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"spacer-right-xs"],["floatLabel","always",1,"tracking-number-field",3,"formGroupName"],["matInput","","type","text","formControlName","trackingNumber","placeholder","Enter Tracking Number"],["svgIcon","edit-pen","matSuffix","",1,"inline-icon"],[4,"ngIf"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"div",1)(2,"button",2),e.\u0275\u0275listener("click",function(){return i.saveTrackingNumbers()}),e.\u0275\u0275text(3," Save "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",3),e.\u0275\u0275listener("click",function(){return i.returnToPickups()}),e.\u0275\u0275text(5," Return to Pickups "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(6,"section",4),e.\u0275\u0275template(7,XC,4,3,"form",5),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("justifyContent","flex-end"),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",!(null!=i.trackingNumbersForm&&i.trackingNumbersForm.valid)),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",i.trackingNumbersForm))},directives:[ae.$,z.lW,u.NgIf,_._Y,_.JL,_.sg,ye.d,h.BZ,U.YE,_.CE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,D.KE,_.x0,D.hX,X.Nt,_.Fj,_.JJ,_.u,Q.Hw,D.R9,D.TO,h.as,h.XQ,h.nj,h.Gk],styles:[".page[_ngcontent-%COMP%]{padding:20px;box-sizing:border-box}.tracking-number-field[_ngcontent-%COMP%]{width:fit-content;max-width:180px;font-size:var(--smallFontSize)}.mat-column-receiver[_ngcontent-%COMP%]{flex:none;max-width:420px;padding-right:var(--sm-size)}.ag-table-wrapper[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] {.mat-form-field-subscript-wrapper {margin-top: 0;} .tracking-number-field .mat-form-field-suffix {opacity: 0;} .mat-form-field-infix {padding-bottom: 0;} .mat-focused .mat-form-field-suffix {opacity: 1;} .tracking-number-field:hover .mat-form-field-suffix {opacity: 1; transition: all .3s ease-in-out;} .mat-form-field-underline {opacity: 0;} .mat-focused .mat-form-field-underline {opacity: 1; transition: all .3s ease-in-out;}}"]}),n})();const JC=function(){return["name"]},e0=function(n){return{name:n}};let t0=(()=>{class n{constructor(t){this.userService=t,this.AuthFormMode=Ai.G}handleFormSubmit(t){this.userService.changeUsername(t.newName)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-change-username"]],decls:5,vars:7,consts:[["fxLayoutAlign","space-around center",1,"page"],[1,"auth-card"],["fxLayout","column","fxLayoutAlign","center center",1,"wrapper"],["submitButtonText","Submit","title","Change Username",3,"disabledFields","preFillData","mode","showNameField","formSubmit"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section",0)(1,"mat-card",1)(2,"mat-card-content")(3,"div",2)(4,"app-auth-form",3),e.\u0275\u0275listener("formSubmit",function(r){return i.handleFormSubmit(r)}),e.\u0275\u0275elementEnd()()()()()),2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275property("disabledFields",e.\u0275\u0275pureFunction0(4,JC))("preFillData",e.\u0275\u0275pureFunction1(5,e0,i.userService.currentUser.name||"None"))("mode",i.AuthFormMode.changeUsername)("showNameField",!0))},directives:[V.Wh,cn.a8,cn.dn,V.xw,Di.c],styles:["app-auth-form[_ngcontent-%COMP%]{width:100%;max-width:700px}"]}),n})();var n0=d(80216);function i0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Place ID "),e.\u0275\u0275elementEnd())}function a0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275element(2,"app-clipboard-copy",24),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.id," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",null==t?null:t.id)}}function o0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,a0,3,2,"span",23),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275nextContext(2);const i=e.\u0275\u0275reference(13);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.id)("ngIfElse",i)}}function r0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Place Name"),e.\u0275\u0275elementEnd())}const l0=function(){return["/dashboard"]},s0=function(n){return{goToPlaceId:n}};function c0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"a",26),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)})("auxclick",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==a?null:a.id,!1)}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction0(4,l0))("queryParams",e.\u0275\u0275pureFunction1(5,s0,null==t?null:t.id))("matTooltip","Place ID: "+(null==t?null:t.id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function p0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,c0,2,7,"a",25),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275nextContext(2);const i=e.\u0275\u0275reference(13);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.name)("ngIfElse",i)}}function m0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1," Country "),e.\u0275\u0275elementEnd())}function d0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"getCountryName"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.country_id)," ")}}function u0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,d0,3,3,"span",23),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275nextContext(2);const i=e.\u0275\u0275reference(13);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.country_id)("ngIfElse",i)}}function _0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Time Zone"),e.\u0275\u0275elementEnd())}function f0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.timezone_id," ")}}function h0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,f0,2,1,"span",23),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275nextContext(2);const i=e.\u0275\u0275reference(13);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t.timezone_id)("ngIfElse",i)}}function g0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Firmware Version"),e.\u0275\u0275elementEnd())}function v0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.generic_os_sensors_ota_id," ")}}function C0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Default "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("color","#afafaf")}function b0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,v0,2,1,"span",23),e.\u0275\u0275pipe(2,"nonNullablePipe"),e.\u0275\u0275template(3,C0,2,2,"ng-template",null,27,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275reference(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,2,t.generic_os_sensors_ota_id))("ngIfElse",i)}}function x0(n,o){1&n&&e.\u0275\u0275element(0,"tr",28)}function y0(n,o){1&n&&e.\u0275\u0275element(0,"tr",29)}function S0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",11),e.\u0275\u0275elementContainerStart(1,12),e.\u0275\u0275template(2,i0,2,0,"th",13),e.\u0275\u0275template(3,o0,2,2,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,15),e.\u0275\u0275template(5,r0,2,0,"th",13),e.\u0275\u0275template(6,p0,2,2,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,16),e.\u0275\u0275template(8,m0,2,0,"th",13),e.\u0275\u0275template(9,u0,2,2,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,17),e.\u0275\u0275template(11,_0,2,0,"th",13),e.\u0275\u0275template(12,h0,2,2,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,18),e.\u0275\u0275template(14,g0,2,0,"th",13),e.\u0275\u0275template(15,b0,5,4,"td",14),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(16,x0,1,0,"tr",19),e.\u0275\u0275template(17,y0,1,0,"tr",20),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0)("dataSource",t.dataSource),e.\u0275\u0275advance(16),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function w0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," No data "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275styleProp("color","#afafaf")}function E0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," There is no such place. "),e.\u0275\u0275elementEnd()),2&n&&e.\u0275\u0275property("@slowAppearing",void 0)}function T0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",33),e.\u0275\u0275text(1," Lo
1oking for a place\u{1f440} "),e.\u0275\u0275elementEnd())}function I0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Please enter the place name or ID. "),e.\u0275\u0275elementEnd())}function P0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",30),e.\u0275\u0275template(1,E0,2,1,"span",31),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,T0,2,0,"span",32),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275template(5,I0,2,0,"span",31),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isSearchPristine&&!e.\u0275\u0275pipeBind1(2,4,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(4,6,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isSearchPristine&&!e.\u0275\u0275pipeBind1(6,8,t.loading))}}const k0=function(){return{slategray:!0}};let M0=(()=>{class n{constructor(t,i,a,r){this.places=t,this.supportService=i,this.dataServices=a,this._messageService=r,this.isSearchPristine=!0,this.searchFieldControl=new _.NI(""),this.loading=this.supportService.loading$,this.destroy$=new H.xQ,this.displayedColumns=["id","name","timezone_id","country_id","generic_os_sensors_ota_id"]}set sort(t){this.dataSource.sort=t}ngOnInit(){this.dataServices.currentScreen="Search For Place",this.places.staffMode="support_panel",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"support_list_of_places_loaded"===t&&(this.dataSource=new h.by(this.supportService.listOfPlaces))}),this.dataSource=new h.by([]),this.searchFieldControl.valueChanges.pipe((0,A.R)(this.destroy$),(0,rt.b)(700),(0,Ut.x)()).subscribe(t=>{this.applyFilter(t)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.places.staffMode=null}applyFilter(t){t?(this.supportService.getPlacesList(t),this.isSearchPristine=!1):this.dataSource=new h.by([])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Wt.a),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-places-search-table"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:15,vars:7,consts:[[1,"spacer-bottom-xs","spacer-top-xs","spacer-left-sm"],[1,"search-block"],[1,"f-field-wrapper"],[1,"table-upper-search-control"],["matInput","",3,"formControl","placeholder","keyup.enter","paste"],["filterName",""],["matSuffix","",1,"input-reset-btn",3,"ngClass","click"],[1,"table-wrapper"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["noData",""],["class","info-table-message",4,"ngIf"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name","sticky",""],["matColumnDef","country_id"],["matColumnDef","timezone_id"],["matColumnDef","generic_os_sensors_ota_id"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[4,"ngIf","ngIfElse"],["successMessage","Place ID has been copied to clipboard","size","small",3,"copyValue"],["class","accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick",4,"ngIf","ngIfElse"],[1,"accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick"],["genericOsNoData",""],["mat-header-row",""],["mat-row",""],[1,"info-table-message"],[4,"ngIf"],["class","loading-text",4,"ngIf"],[1,"loading-text"]],template:function(t,i){if(1&t){const a=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),e.\u0275\u0275text(5,"Search by ID or Name"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"input",4,5),e.\u0275\u0275listener("keyup.enter",function(){e.\u0275\u0275restoreView(a);const l=e.\u0275\u0275reference(7);return i.applyFilter(l.value)})("paste",function(l){return i.applyFilter(l.clipboardData.getData("text"))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"mat-icon",6),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(a),e.\u0275\u0275reference(7).value="",i.isSearchPristine=!0}),e.\u0275\u0275text(9,"clear "),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(10,"div",7),e.\u0275\u0275template(11,S0,18,4,"table",8),e.\u0275\u0275template(12,w0,2,2,"ng-template",null,9,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(14,P0,7,10,"div",10)}if(2&t){const a=e.\u0275\u0275reference(7);e.\u0275\u0275advance(6),e.\u0275\u0275property("formControl",i.searchFieldControl)("placeholder","Type in the place name or ID"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction0(6,k0))("@hideInOut",a.value?"shown":"hidden"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!(null==i.dataSource.data||!i.dataSource.data.length)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",!(null!=i.dataSource.data&&i.dataSource.data.length))}},directives:[D.KE,D.hX,X.Nt,_.Fj,_.JJ,_.oH,Q.Hw,D.R9,u.NgClass,ce.oO,u.NgIf,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,y.yS,Ue.gM,h.as,h.XQ,h.nj,h.Gk],pipes:[Gi.g,n0.I,u.AsyncPipe],styles:[".page[_ngcontent-%COMP%]{min-height:calc(100vh - 65px)}[_nghost-%COMP%] {.search-block {display: flex; align-items: baseline; justify-content: center; gap: var(--xs-size); margin: var(--xs-size) var(--sm-size);} .input-reset-btn {cursor: pointer; color: var(--grayColor800);} .table-upper-search-control {font-size: 14px; width: 270px;} .info-table-message {display: flex; justify-content: center; align-items: center; height: 50vh;} .info-table-message span {text-align: center;} .table-wrapper {overflow: auto;}}"],data:{animation:[Ze.j,_t.v]}}),n})();var we=d(6757),Xi=d(99917),A0=d(70655);function D0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",2),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext().addLocation(null,r.id,"locationGroup",r.name)}
1),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" Group: ",t.name," ")}}function O0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-option",2),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext().addLocation(r.id,null,"location")}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function L0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-chip",9),e.\u0275\u0275listener("removed",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext().onLocationRemove(r)}),e.\u0275\u0275text(1),e.\u0275\u0275elementStart(2,"mat-icon",10),e.\u0275\u0275text(3,"cancel"),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275property("removable",!0),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.nameToDisplay," ")}}let F0=(()=>{class n{constructor(t,i,a,r,l){this.locationsServices=t,this.displayServices=i,this.places=a,this.groupsServices=r,this._messageService=l,this.isDisplayCreated=!1,this.listOfLocationsChange=new e.EventEmitter,this.listOfChosenLocations=[],this.filterValue="",this.destroy$=new H.xQ}ngOnInit(){this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"admin_displays_locations_loaded"===t&&(this.listOfChosenLocations=this.displayServices.listOfDisplayLocations.map(i=>{switch(i.locationType){case"indoorAverage":i.nameToDisplay="Indoor Average";break;case"outdoorAverage":i.nameToDisplay="Outdoor Average";break;case"locationGroup":i.nameToDisplay="Group: "+i.locationGroupName;break;default:i.nameToDisplay=i.locationName}return i}),this.listOfLocationsChange.emit(this.listOfChosenLocations))}),this.groupsServices.getGroups(this.places.currentPlace.id),this.isDisplayCreated&&this.displayServices.getDisplaysLocations(this.places.currentPlace,this.currentDisplay.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}addLocation(t,i,a,r){var l,f;const w={id:null,displayId:null,locationType:null,locationName:null,locationId:null,locationGroupId:null,locationGroupName:null};w.locationId=t,w.locationGroupId=i,w.locationType=a,"indoorAverage"===a?w.nameToDisplay="Indoor Average":"outdoorAverage"===a?w.nameToDisplay="Outdoor Average":"locationGroup"===a?(w.nameToDisplay=`Group: ${r}`,w.locationGroupName=`Group: ${r}`):(w.nameToDisplay=null===(l=this.locationsServices.filteredLocations.find(M=>M.id===t))||void 0===l?void 0:l.name,w.locationName=null===(f=this.locationsServices.filteredLocations.find(M=>M.id===t))||void 0===f?void 0:f.name),!this.listOfChosenLocations.some(M=>M.locationId===t&&M.locationGroupId===i&&M.locationType===a)&&(this.listOfChosenLocations.push(w),this.listOfLocationsChange.emit(this.listOfChosenLocations.map(M=>(0,A0._T)(M,["nameToDisplay"]))))}onLocationRemove(t){this.listOfChosenLocations.splice(this.listOfChosenLocations.findIndex(i=>i===t),1),this.listOfLocationsChange.emit(this.listOfChosenLocations)}applyFilter(t){this.filterValue=t.target.value,this.locationsServices.filteredLocations=this.locationsServices.allLocations.filter(i=>i.name.toLowerCase().includes(this.filterValue.trim().toLowerCase()))}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ht.M),e.\u0275\u0275directiveInject($.e))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-add-remove-locations"]],inputs:{currentDisplay:"currentDisplay",isDisplayCreated:"isDisplayCreated"},outputs:{listOfLocationsChange:"listOfLocationsChange"},decls:22,vars:6,consts:[["floatLabel","never",1,"form-field-responsive-m","spacer-right-sm"],[3,"placeholder"],[3,"value","click"],[3,"value","click",4,"ngFor","ngForOf"],[1,"dropdown-filter-search-outer"],[1,"dropdown-filter-search-wrapper"],["matInput","","placeholder","Search location",3,"keyup"],["formInput",""],[3,"removable","removed",4,"ngFor","ngForOf"],[3,"removable","removed"],["matChipRemove",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"mat-form-field",0)(2,"mat-select",1)(3,"mat-select-trigger"),e.\u0275\u0275text(4,"Add location"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"mat-option",2),e.\u0275\u0275listener("click",function(){return i.addLocation(null,null,"outdoorAverage")}),e.\u0275\u0275text(6," Outdoor Average "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-option",2),e.\u0275\u0275listener("click",function(){return i.addLocation(null,null,"indoorAverage")}),e.\u0275\u0275text(8," Indoor Average "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(9,"mat-divider"),e.\u0275\u0275template(10,D0,2,2,"mat-option",3),e.\u0275\u0275element(11,"mat-divider"),e.\u0275\u0275elementStart(12,"div",4)(13,"div",5)(14,"mat-icon"),e.\u0275\u0275text(15," search "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"input",6,7),e.\u0275\u0275listener("keyup",function(r){return i.applyFilter(r)}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275element(18,"mat-divider"),e.\u0275\u0275template(19,O0,2,2,"mat-option",3),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(20,"mat-chip-list"),e.\u0275\u0275template(21,L0,4,2,"mat-chip",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("placeholder","Add Location"),e.\u0275\u0275advance(3),e.\u0275\u0275property("value","outdoorAverage"),e.\u0275\u0275advance(2),e.\u0275\u0275property("value","indoorAverage"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",null==i.groupsServices?null:i.groupsServices.groups),e.\u0275\u0275advance(9),e.\u0275\u0275property("ngForOf",i.locationsServices.filteredLocations),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",i.listOfChosenLocations))},directives:[D.KE,_e.gD,_e.$L,de.ey,vt.d,u.NgForOf,Q.Hw,X.Nt,Be.qn,Be.HS,Be.qH],encapsulation:2}),n})();function R0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"mat-checkbox",2),e.\u0275\u0275listener("change",function(a){const l=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext().updateParamsStatus(l.value,a.checked)}),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("checked",t.isChecked),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.label," ")}}let N0=(()=>{class n{constructor(){this.listOfChosenMeasuresChange=new e.EventEmitter,this.measuresList=[{label:"PM2.5 (\u03bcg/m\xb3)",value:we.Z.PM25_UG_M3,isChecked:!0},{label:"PM2.5 (US AQI)",value:we.Z.PM25_US_AQI,isChecked:!0},{label:"CO2",value:we.Z.CO2,isChecked:!0},{label:"Relative Humidity",value:we.Z.RELATIVE_HUMIDITY,isChecked:!0},{label:"Temperature \xb0C",value:we.Z.TEMPERATURE_C,isChecked:!0},{label:"TVOC (ppb)",value:we.Z.TVOC_PPB,isChecked:!0},{label:"TVOC (Ind40)",value:we.Z.TVOC_IND40,isChecked:!0},{label:"NOx (Ind41)",value:we.Z.NOx,isChecked:!0},{label:"Temperature \xb0F",value:we.Z.TEMPERATURE_F,isChecked:!0},{label:"Heat Index \xb0C",value:we.Z.HEAT_INDEX_C,isChecked:!0},{label:"Heat Index \xb0F",value:we.Z.HEAT_INDEX_F,isChecked:!0}]}ngOnInit(){this.measureParams&&this.measuresList.forEach(t=>(t.isChecked=this.measureParams.includes(t.value),t)),this.listOfChosenMeasuresChange.emit(this.measureParams)}updateParamsStatus(t,i){if(i)this.measureParams=[...this.measureParams,t];else{const a=this.measureParams.indexOf(t);a>-1&&this.measureParams.splice(a,1)}this.listOfChosenMeasuresChange.emit(this.measureParams)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-display-measures-step"]],inputs:{measureParams:"measureParams"},outputs:{listOfChosenMeasuresChange:"listOfChosenMeasuresChange"},decls:2,vars:1,consts:[[1,"checkboxes-wrapper"],[4,"ngFor","ngForOf"],[3,"checked","change"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,R0,3,2,"ng-container",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.measuresList))},directives:[u.NgForOf,Je.oG],styles:[".checkboxes-wrapper[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:16px;gap:16px;padding:10px}@media (max-width: 768px){.checkboxes-wrapper[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr);gap:36px}}@media (max-width: 440px){.checkboxes-wrapper[_ngcontent-%COMP%]{grid-template-columns:repeat(1,1fr)}}"]}),n})();var Qe=(()=>{return(n=Qe||(Qe={})).dark="dark",n.light="light",n.custom="custom",Qe;var n})(),V0=d(22313);function H0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",12),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext();e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.displayTypeLabels[t.value]," ")}}function j0(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,H0,2,2,"mat-option",11),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.key!==i.DisplayTypes.mascot)}}function B0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",12)(1,"span",13),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.value),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.value," ")}}function G0(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",12),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t.cssName),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.displayName," ")}}function z0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div")(2,"mat-form-field",14)(3,"mat-label"),e.\u0275\u0275text(4,"Text Color"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"input",15),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.configuration.text_color=a})("colorPickerChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.configuration.text_color=a})("cpSliderDragEnd",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().emitDisplayConfigurationChanges()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(6,"div",16),e.\u0275\u0275elementStart(7,"mat-hint"),e.\u0275\u0275text(8," Enter text color for your display "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(9,"div")(10,"mat-form-field",2)(11,"mat-label"),e.\u0275\u0275text(12,"Backgroun
1d Color"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"input",17),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.configuration.background_color=a})("colorPickerChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.configuration.background_color=a})("cpSliderDragEnd",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().emitDisplayConfigurationChanges()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"div",16),e.\u0275\u0275elementStart(15,"mat-hint"),e.\u0275\u0275text(16," Enter background color for your display "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(17,"div")(18,"mat-form-field",2)(19,"mat-label"),e.\u0275\u0275text(20,"Font Family"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"mat-select",18),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().display.configuration.font_family=a})("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().emitDisplayConfigurationChanges()}),e.\u0275\u0275template(22,G0,2,2,"mat-option",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"mat-hint"),e.\u0275\u0275text(24,"Choose font family for your display"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("ngModel",t.display.configuration.text_color)("colorPicker",t.display.configuration.text_color)("cpColorMode","color")("cpOutputFormat","hex")("cpFallbackColor","#FFFFFF")("cpCmykEnabled",!0),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("background",t.display.configuration.text_color),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngModel",t.display.configuration.background_color)("colorPicker",t.display.configuration.background_color)("cpColorMode","color")("cpOutputFormat","hex")("cpCmykEnabled",!0),e.\u0275\u0275advance(1),e.\u0275\u0275styleProp("background",t.display.configuration.background_color),e.\u0275\u0275advance(7),e.\u0275\u0275property("value",t.display.configuration.font_family),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.fonts)}}function $0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",19),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateLocationsList()}),e.\u0275\u0275text(1," Update Display Locations "),e.\u0275\u0275elementEnd()}}let U0=(()=>{class n{constructor(t,i,a){this.sanitizer=t,this.places=i,this.displayServices=a,this.displayConfigurationChange=new e.EventEmitter,this.fonts=[{displayName:"Catamaran",cssName:"Catamaran, sans-serif"},{displayName:"Arial",cssName:"Arial, sans-serif"},{displayName:"Times New Roman",cssName:"Times, Times New Roman, serif"},{displayName:"Courier",cssName:"Courier, monospace"}],this.typeOfDisplay=$t.x.classic,this.DisplayTypes=$t.x,this.displayTypeLabels={classic:"Classic",guidelines:"Guidelines","guidelines-mascot":"Guidelines Mascot",charts:"Charts",mascot:"Mascot","go-aqs-status":"GO AQS Status","go-aqs-gauge":"GO AQS Gauge"},this.selectedTheme=Qe.dark,this.StylingThemes=Qe}ngOnInit(){this.emitDisplayConfigurationChanges(),this.defineTheme(this.display.configuration)}emitDisplayConfigurationChanges(){var t,i,a,r,l;this.saveIFrameSrc=this.sanitizer.bypassSecurityTrustResourceUrl("/display/"+(null===(i=null===(t=this.display)||void 0===t?void 0:t.url)||void 0===i?void 0:i.substr(13,10))+this.typeOfDisplay);const f=encodeURIComponent(this.display.configuration.font_family),w=null===(a=this.display.configuration.params)||void 0===a?void 0:a.map(encodeURIComponent).join(",");this.saveIFrameSrc=this.sanitizer.bypassSecurityTrustResourceUrl(`/display/${null===(l=null===(r=this.display)||void 0===r?void 0:r.url)||void 0===l?void 0:l.substr(13,10)}/${this.typeOfDisplay}/true/${this.display.configuration.text_color.slice(1)}/${this.display.configuration.background_color.slice(1)}/${f}/${w}/${this.display.configuration.publicContributorName||""}`),this.displayConfigurationChange.emit(this.display.configuration)}onThemeChange(t){t===Qe.dark?(this.display.configuration.text_color="#FFFFFF",this.display.configuration.background_color="#333333"):t===Qe.light&&(this.display.configuration.text_color="#333333",this.display.configuration.background_color="#FFFFFF"),this.display.configuration.font_family="Catamaran, sans-serif",this.emitDisplayConfigurationChanges()}defineTheme(t){this.selectedTheme="#FFFFFF"===t.text_color&&"#333333"===t.background_color?Qe.dark:"#333333"===t.text_color&&"#FFFFFF"===t.background_color?Qe.light:Qe.custom}updateLocationsList(){this.displayServices.saveDisplayConfiguration(this.places.currentPlace,this.display,this.display.configuration),this.displayServices.saveDisplayLocations(this.places.currentPlace,this.display.id,this.display.displayLocations),this.emitDisplayConfigurationChanges()}changeTypeOfDisplay(t){this.typeOfDisplay=t,this.emitDisplayConfigurationChanges()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(V0.H7),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(Ge.A))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-display-customization"]],inputs:{display:"display"},outputs:{displayConfigurationChange:"displayConfigurationChange"},decls:23,vars:15,consts:[[1,"customize-wrapper"],[1,"preview-settings-wrapper"],[1,"form-field-responsive-m"],[3,"value","valueChange","selectionChange"],[4,"ngFor","ngForOf"],["placeholder","Select a font",3,"value","selectionChange","valueChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"iframe-wrapper"],["frameborder","10",1,"air-quality-widget",3,"src"],["class","button-primary","mat-button","",3,"click",4,"ngIf"],[3,"value",4,"ngIf"],[3,"value"],[1,"text-capitalized"],[1,"example-full-width","form-field-responsive-m"],["matInput","","placeholder","Choose Color",3,"ngModel","colorPicker","cpColorMode","cpOutputFormat","cpFallbackColor","cpCmykEnabled","ngModelChange","colorPickerChange","cpSliderDragEnd"],["matSuffix","",1,"color-identification"],["matInput","","placeholder","Choose Backgroun
1d Color",3,"ngModel","colorPicker","cpColorMode","cpOutputFormat","cpCmykEnabled","ngModelChange","colorPickerChange","cpSliderDragEnd"],["placeholder","Select a font",3,"value","valueChange","selectionChange"],["mat-button","",1,"button-primary",3,"click"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div")(3,"mat-form-field",2)(4,"mat-label"),e.\u0275\u0275text(5,"Type of Display"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-select",3),e.\u0275\u0275listener("valueChange",function(r){return i.typeOfDisplay=r})("selectionChange",function(r){return i.changeTypeOfDisplay(r.value)}),e.\u0275\u0275template(7,j0,2,1,"ng-container",4),e.\u0275\u0275pipe(8,"keyvalue"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"mat-form-field",2)(10,"mat-label"),e.\u0275\u0275text(11,"Theme"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"mat-select",5),e.\u0275\u0275listener("selectionChange",function(r){return i.onThemeChange(r.value)})("valueChange",function(r){return i.selectedTheme=r}),e.\u0275\u0275template(13,B0,3,2,"mat-option",6),e.\u0275\u0275pipe(14,"keyvalue"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-hint"),e.\u0275\u0275text(16,"Choose theme for your display"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(17,z0,25,17,"ng-container",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"div",8),e.\u0275\u0275element(19,"iframe",9),e.\u0275\u0275template(20,$0,2,0,"button",10),e.\u0275\u0275pipe(21,"json"),e.\u0275\u0275pipe(22,"json"),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(6),e.\u0275\u0275property("value",i.typeOfDisplay),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pipeBind1(8,7,i.DisplayTypes)),e.\u0275\u0275advance(5),e.\u0275\u0275property("value",i.selectedTheme),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",e.\u0275\u0275pipeBind1(14,9,i.StylingThemes)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",i.selectedTheme===i.StylingThemes.custom),e.\u0275\u0275advance(2),e.\u0275\u0275property("src",i.saveIFrameSrc,e.\u0275\u0275sanitizeResourceUrl),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(21,11,null==i.display?null:i.display.displayLocations)!==e.\u0275\u0275pipeBind1(22,13,null==i.displayServices?null:i.displayServices.listOfDisplayLocations)))},directives:[D.KE,D.hX,_e.gD,u.NgForOf,u.NgIf,de.ey,D.bx,X.Nt,_.Fj,_.JJ,_.On,wa,D.R9,z.lW],pipes:[u.KeyValuePipe,u.JsonPipe],styles:[".customize-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-top:var(--sm-size);gap:var(--md-size)}.preview-settings-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--md-size)}.color-identification[_ngcontent-%COMP%]{width:20px;height:20px}.air-quality-widget[_ngcontent-%COMP%]{width:400px;height:400px}.iframe-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:var(--md-size)}[_nghost-%COMP%] .mat-select-value-text, .text-capitalized[_ngcontent-%COMP%]{text-transform:capitalize}@media (max-width: 768px){.preview-settings-wrapper[_ngcontent-%COMP%]{width:100%}.customize-wrapper[_ngcontent-%COMP%]{flex-wrap:wrap}.air-quality-widget[_ngcontent-%COMP%]{max-width:100%}}"]}),n})();const W0=["mainStepper"];function Q0(n,o){1&n&&e.\u0275\u0275text(0," Title & Locations ")}function q0(n,o){1&n&&e.\u0275\u0275element(0,"mat-icon",20)}function K0(n,o){1&n&&e.\u0275\u0275text(0," Parameters ")}function Y0(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon"),e.\u0275\u0275text(1,"menu"),e.\u0275\u0275elementEnd())}function X0(n,o){1&n&&e.\u0275\u0275text(0," Styling ")}function Z0(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-display-customization",21),e.\u0275\u0275listener("displayConfigurationChange",function(a){let l;return e.\u0275\u0275restoreView(t),null==(l=e.\u0275\u0275nextContext(2).displayFormGroup.get("configuration"))?null:l.setValue(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("display",t.displayFormGroup.value)}}function J0(n,o){1&n&&e.\u0275\u0275element(0,"mat-icon",22)}function eb(n,o){1&n&&e.\u0275\u0275text(0," Done ")}function tb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p",28)(1,"b"),e.\u0275\u0275text(2,"Note:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3," The groups and averages are not available in charts display. "),e.\u0275\u0275elementEnd())}function nb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-step",23),e.\u0275\u0275template(1,eb,1,0,"ng-template",6),e.\u0275\u0275elementStart(2,"p"),e.\u0275\u0275text(3," Congratulations! Your display has been successfully created. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"p"),e.\u0275\u0275text(5," Here is your display links: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"ul")(7,"li")(8,"span",24)(9,"a",25),e.\u0275\u0275pipe(10,"slice"),e.\u0275\u0275text(11," Classic Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(12,"app-clipboard-copy",26),e.\u0275\u0275pipe(13,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"li")(15,"span",24)(16,"a",25),e.\u0275\u0275pipe(17,"slice"),e.\u0275\u0275text(18," Guidelines Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(19,"app-clipboard-copy",26),e.\u0275\u0275pipe(20,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"li")(22,"span",24)(23,"a",25),e.\u0275\u0275pipe(24,"slice"),e.\u0275\u0275text(25," Guidelines Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(26,"app-clipboard-copy",26),e.\u0275\u0275pipe(27,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"li")(29,"span",24)(30,"a",25),e.\u0275\u0275pipe(31,"slice"),e.\u0275\u0275text(32," Guidelines Mascot Display (US AQI) "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(33,"app-clipboard-copy",26),e.\u0275\u0275pipe(34,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"li")(36,"span",24)(37,"a",25),e.\u0275\u0275pipe(38,"slice"),e.\u0275\u0275text(39," Charts Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(40,"app-clipboard-copy",26),e.\u0275\u0275pipe(41,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(42,"li")(43,"span",24)(44,"a",25),e.\u0275\u0275pipe(45,"slice"),e.\u0275\u0275text(46," Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(47,"app-clipboard-copy",26),e.\u0275\u0275pipe(48,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(49,"li")(50,"span",24)(51,"a",25),e.\u0275\u0275pipe(52,"slice"),e.\u0275\u0275text(53," Mascot Display (US AQI) "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(54,"app-clipboard-copy",26),e.\u0275\u0275pipe(55,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"li")(57,"span",24)(58,"a",25),e.\u0275\u0275pipe(59,"slice"),e.\u0275\u0275text(60," GO AQS Status Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(61,"app-clipboard-copy",26),e.\u0275\u0275pipe(62,"slice"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(63,"li")(64,"span",24)(65,"a",25),e.\u0275\u0275pipe(66,"slice"),e.\u0275\u0275text(67," GO AQS Gauge Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(68,"app-clipboard-copy",26),e.\u0275\u0275pipe(69,"slice"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(70,tb,4,0,"p",27),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(9),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(10,19,t.displayFormGroup.get("url").value,13,23)+"/classic",e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(13,23,t.displayFormGroup.get("url").value,13,23)+"/classic"),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(17,27,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelines,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(20,31,t.dis
1playFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelines),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(24,35,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelinesMascot+"?measure="+t.MascotMeasures.pm02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(27,39,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelinesMascot+"?measure="+t.MascotMeasures.pm02),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(31,43,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelinesMascot+"?measure="+t.MascotMeasures.pi02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(34,47,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.guidelinesMascot+"?measure="+t.MascotMeasures.pi02),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(38,51,t.displayFormGroup.get("url").value,13,23)+"/charts",e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(41,55,t.displayFormGroup.get("url").value,13,23)+"/charts"),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(45,59,t.displayFormGroup.get("url").value,13,23)+"/mascot?measure="+t.MascotMeasures.pm02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(48,63,t.displayFormGroup.get("url").value,13,23)+"/mascot?measure="+t.MascotMeasures.pm02),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(52,67,t.displayFormGroup.get("url").value,13,23)+"/mascot?measure="+t.MascotMeasures.pi02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(55,71,t.displayFormGroup.get("url").value,13,23)+"/mascot?measure="+t.MascotMeasures.pi02),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(59,75,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.goiaqsStatus,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(62,79,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.goiaqsStatus),e.\u0275\u0275advance(4),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(66,83,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.goiaqsGauge,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("copyValue",t.environment.domain+"/display/"+e.\u0275\u0275pipeBind3(69,87,t.displayFormGroup.get("url").value,13,23)+"/"+t.DisplayTypes.goiaqsGauge),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isAverageAndGroupsNoteShown)}}function ib(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon"),e.\u0275\u0275text(1,"sync"),e.\u0275\u0275elementEnd())}function ab(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"form",2)(1,"mat-horizontal-stepper",3,4),e.\u0275\u0275listener("selectionChange",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().getSubmitButtonText()}),e.\u0275\u0275elementStart(3,"mat-step",5),e.\u0275\u0275template(4,Q0,1,0,"ng-template",6),e.\u0275\u0275elementStart(5,"div",7)(6,"mat-form-field",8)(7,"mat-label"),e.\u0275\u0275text(8,"Display Name"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(9,"input",9),e.\u0275\u0275elementStart(10,"mat-hint"),e.\u0275\u0275text(11,"Name will be used as identifier for your display"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(12,"app-add-remove-locations",10),e.\u0275\u0275listener("listOfLocationsChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateListOfLocations(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(13,q0,1,0,"ng-template",11),e.\u0275\u0275elementStart(14,"mat-step",12),e.\u0275\u0275template(15,K0,1,0,"ng-template",6),e.\u0275\u0275elementStart(16,"app-display-measures-step",13),e.\u0275\u0275listener("listOfChosenMeasuresChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().setParams(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(17,Y0,2,0,"ng-template",14),e.\u0275\u0275elementStart(18,"mat-step",15),e.\u0275\u0275template(19,X0,1,0,"ng-template",6),e.\u0275\u0275template(20,Z0,1,1,"app-display-customization",16),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(21,J0,1,0,"ng-template",17),e.\u0275\u0275template(22,nb,71,91,"mat-step",18),e.\u0275\u0275template(23,ib,2,0,"ng-template",19),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275reference(2),i=e.\u0275\u0275nextContext();e.\u0275\u0275property("formGroup",i.displayFormGroup),e.\u0275\u0275advance(1),e.\u0275\u0275property("labelPosition",i.isPortrait()?"bottom":"end"),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",i.displayFormGroup),e.\u0275\u0275advance(9),e.\u0275\u0275property("isDisplayCreated",!!i.displayFormGroup.get("url").value)("currentDisplay",i.displayFormGroup.value),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",i.displayFormGroup.get("params")),e.\u0275\u0275advance(2),e.\u0275\u0275property("measureParams",i.displayFormGroup.get("params").value),e.\u0275\u0275advance(2),e.\u0275\u0275property("stepControl",i.displayFormGroup.get("configuration")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",2===(null==t?null:t.selectedIndex)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.flowConfiguration.isEditing)}}let Zi=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M){this.dialogRef=t,this.dataServices=i,this.places=a,this.changeDetection=r,this.displayServices=l,this._messageService=f,this._formBuilder=w,this.flowConfiguration=T,this.dialog=M,this.isAverageAndGroupsNoteShown=!1,this.isPortrait=jt.gr,this.environment=bt.N,this.MascotMeasures=Xi.F,this.DisplayTypes=$t.x,this.destroy$=new H.xQ}
1ngOnInit(){this.initDisplayFormGroup(),this.getSubmitButtonText(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{var i,a;if("admin_displays_loaded"===t){const r=this.displayServices.filtered_displays.find(l=>l.id===this.displayServices.lastAddedDisplayID);this.displayFormGroup.get("id").setValue(r.id),this.displayFormGroup.get("displayId").setValue(r.displayId),this.displayFormGroup.get("url").setValue(r.url),this.displayServices.saveDisplayLocations(this.places.currentPlace,this.displayFormGroup.get("id").value,null===(i=this.displayFormGroup.get("displayLocations"))||void 0===i?void 0:i.value),this.isAverageAndGroupsNoteShown=!!(null===(a=this.displayFormGroup.get("displayLocations"))||void 0===a?void 0:a.value.find(l=>"location"!==l.locationType)),this.saveConfiguration(),this.flowConfiguration.isEditing||this.mainStepper.next()}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getSubmitButtonText(){setTimeout(()=>{var t;this.submitButtonText=0!==(null===(t=this.mainStepper)||void 0===t?void 0:t.selectedIndex)||this.displayFormGroup.get("url").value?this.defineAmountOfSteps()?"Finish":"Next":"Create"},0)}defineAmountOfSteps(){var t,i,a;return this.changeDetection.detectChanges(),(null===(t=this.mainStepper)||void 0===t?void 0:t.selectedIndex)===(null===(a=null===(i=this.mainStepper)||void 0===i?void 0:i.steps)||void 0===a?void 0:a.length)-1}goToNextStep(){var t,i;if(this.defineAmountOfSteps()&&this.dialogRef.close(),0===(null===(t=this.mainStepper)||void 0===t?void 0:t.selectedIndex)&&!this.displayFormGroup.get("url").value)return this.createNewDisplay(),void this.displayFormGroup.get("params").addValidators(_.kI.required);2===(null===(i=this.mainStepper)||void 0===i?void 0:i.selectedIndex)&&(this.saveConfiguration(),this.saveDisplayGeneralConfig()),this.mainStepper.next(),this.getSubmitButtonText()}createNewDisplay(){this.displayServices.addDisplay(this.places.currentPlace,this.displayFormGroup.value,!0)}saveDisplayGeneralConfig(){var t,i;String(null===(t=this.displayFormGroup.get("displayLocations"))||void 0===t?void 0:t.value)!==String(this.displayServices.listOfDisplayLocations)&&this.displayServices.saveDisplayLocations(this.places.currentPlace,this.displayFormGroup.get("id").value,
1null===(i=this.displayFormGroup.get("displayLocations"))||void 0===i?void 0:i.value),this.displayServices.saveDisplay(this.places.currentPlace,this.displayFormGroup.value,!0)}initDisplayFormGroup(){var t,i,a;const r=[we.Z.PM25_UG_M3,we.Z.PM25_US_AQI,we.Z.CO2,we.Z.RELATIVE_HUMIDITY,we.Z.TEMPERATURE_C,we.Z.TEMPERATURE_F,we.Z.HEAT_INDEX_C,we.Z.HEAT_INDEX_F],l={background_color:"#333333",display_hash:null,font_family:"Catamaran, sans-serif",params:r,text_color:"#FFFFFF",publicContributorName:this.places.currentPlace.public_contributor_name};let f;this.flowConfiguration.isEditing&&this.displayServices.getDisplaysLocations(this.places.currentPlace,this.flowConfiguration.display.id),f=this.flowConfiguration.isEditing?{id:[this.flowConfiguration.display.id,_.kI.required],notes:[this.flowConfiguration.display.notes,_.kI.required],displayLocations:[this.flowConfiguration.display.displayLocations,_.kI.required],params:[[...(null===(i=null===(t=this.flowConfiguration.display)||void 0===t?void 0:t.configuration)||void 0===i?void 0:i.params)||r],_.kI.required],url:[this.flowConfiguration.display.url,_.kI.required],displayId:[this.flowConfiguration.display.displayId],configuration:[(null===(a=this.flowConfiguration.display)||void 0===a?void 0:a.configuration)||l,_.kI.required]}:{id:[""],notes:["",_.kI.required],displayLocations:[[],_.kI.required],params:[r],url:["",_.kI.required],displayId:[""],configuration:[l,_.kI.required]},this.displayFormGroup=this._formBuilder.group(f)}updateListOfLocations(t){this.displayFormGroup.get("displayLocations").setValue(t)}setParams(t){const i=Object.assign(Object.assign({},this.displayFormGroup.get("configuration").value),{params:t});this.displayFormGroup.get("configuration").setValue(i),this.displayFormGroup.get("params").setValue(t)}saveConfiguration(){const t=Object.assign(Object.assign({},this.displayFormGroup.get("configuration").value),{params:this.displayFormGroup.get("params").value,publicContributorName:this.places.currentPlace.public_contributor_name});this.displayServices.saveDisplayConfiguration(this.places.currentPlace,this.displayFormGroup.value,t)}delete(){this.dialog.open(he.$,{width:"350px",data:{yes:"Delete",no:"Cancel",data:`Are you sure you want to delete display\n <b>${this.flowConfiguration.display.notes}</b> (#${this.flowConfiguration.display.id}) ?`}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(i=>{i&&this.displayServices.deleteDisplay(this.places.currentPlace,this.flowConfiguration.display,!0)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(_.qu),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-displays-create-flow"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(W0,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.mainStepper=a.first)}},features:[e.\u0275\u0275ProvidersFeature([{provide:Un.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:2,vars:7,consts:[[3,"title","submitText","isCancelButtonHidden","submitDisabled","isCustomBottomCancel","cancelText","customCancel","submitting","cancel"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["linear","",3,"labelPosition","selectionChange"],["mainStepper",""],["state","notes&locations",3,"stepControl"],["matStepLabel",""],[1,"spacer-bottom-sm"],[1,"form-field-responsive-m"],["required","","matInput","","type","text","placeholder","Enter the display name","formControlName","notes"],[3,"isDisplayCreated","currentDisplay","listOfLocationsChange"],["matStepperIcon","notes&locations"],["state","parameters",3,"stepControl"],[3,"measureParams","listOfChosenMeasuresChange"],["matStepperIcon","parameters"],["state","customization",3,"stepControl"],[3,"display","displayConfigurationChange",4,"ngIf"],["matStepperIcon","customization"],["state","finish",4,"ngIf"],["matStepperIcon","finish"],["svgIcon","description",1,"step-icon"],[3,"display","displayConfigurationChange"],["svgIcon","display_settings",1,"step-icon"],["state","finish"],[1,"link-to-source"],["target","_blank",1,"accent-link",3,"href"],["successMessage","Display link has been copied to clipboard","size","small",3,"copyValue"],["class","spacer-bottom-nil",4,"ngIf"],[1,"spacer-bottom-nil"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("customCancel",function(){return i.delete()})("submitting",function(){return i.goToNextStep()})("cancel",function(){return i.dialogRef.close()}),e.\u0275\u0275template(1,ab,24,10,"form",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275property("title",i.flowConfiguration.isEditing?"Edit Display":"Create New Display")("submitText",i.submitButtonText)("isCancelButtonHidden",!i.flowConfiguration.isEditing)("submitDisabled",!(null!=i.displayFormGroup&&i.displayFormGroup.valid||null!=i.displayFormGroup&&i.displayFormGroup.get("notes").valid&&(null==i.displayFormGroup||!i.displayFormGroup.get("url").valid)&&null!=i.displayFormGroup&&i.displayFormGroup.get("displayLocations").valid))("isCustomBottomCancel",!0)("cancelText","Delete"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.displayFormGroup))},directives:[ve.b,u.NgIf,_._Y,_.JL,_.sg,Ne.Vq,Ne.C0,Ne.VY,D.KE,D.hX,X.Nt,_.Fj,_.Q7,_.JJ,_.u,D.bx,F0,Ne.z9,Q.Hw,N0,U0,Ie.Z],pipes:[u.SlicePipe],encapsulation:2}),n})();function ob(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",9)}function rb(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",10),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}2&n&&e.\u0275\u0275property("keepSearchParameterInURL",!0)}function lb(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",11),2&n&&e.\u0275\u0275property("message","public displays or website widgets")}
1function sb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",23),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function cb(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",29),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).edit(a)}),e.\u0275\u0275text(1,"Edit Display"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"button",32),e.\u0275\u0275text(3,"Print QR Code"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",32),e.\u0275\u0275text(5,"Preview"),e.\u0275\u0275elementEnd()}if(2&n){e.\u0275\u0275nextContext();const t=e.\u0275\u0275reference(8),i=e.\u0275\u0275reference(28);e.\u0275\u0275advance(2),e.\u0275\u0275property("matMenuTriggerFor",t),e.\u0275\u0275advance(2),e.\u0275\u0275property("matMenuTriggerFor",i)}}function pb(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",24)(1,"mat-menu",null,25),e.\u0275\u0275template(3,cb,6,2,"ng-template",26),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",27)(5,"mat-icon"),e.\u0275\u0275text(6,"more_vert"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"mat-menu",null,28)(9,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.classic)}),e.\u0275\u0275text(10," Classic Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.guidelines)}),e.\u0275\u0275text(12," Guidelines Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.guidelinesMascot+"?measure="+l.MascotMeasures.pm02)}),e.\u0275\u0275text(14," Guidelines Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.guidelinesMascot+"?measure="+l.MascotMeasures.pi02)}),e.\u0275\u0275text(16," Guidelines Mascot Display (US AQI) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.charts)}),e.\u0275\u0275text(18," Charts Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.mascot+"?measure="+l.MascotMeasures.pm02)}),e.\u0275\u0275text(20," Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.mascot+"?measure="+l.MascotMeasures.pi02)}),e.\u0275\u0275text(22," Mascot Display (US AQI) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.goiaqsStatus)}),e.\u0275\u0275text(24," GO AQS Status Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"span",29),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit,l=e.\u0275\u0275nextContext(2);return l.printQR(r,l.DisplayTypes.goiaqsGauge)}),e.\u0275\u0275text(26," GO AQS Gauge Display "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(27,"mat-menu",null,30)(29,"a",31),e.\u0275\u0275pipe(30,"slice"),e.\u0275\u0275text(31," Classic Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"a",31),e.\u0275\u0275pipe(33,"slice"),e.\u0275\u0275text(34," Guidelines Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"a",31),e.\u0275\u0275pipe(36,"slice"),e.\u0275\u0275text(37," Guidelines Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(38,"a",31),e.\u0275\u0275pipe(39,"slice"),e.\u0275\u0275text(40," Guidelines Mascot Display (US AQI) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(41,"a",31),e.\u0275\u0275pipe(42,"slice"),e.\u0275\u0275text(43," Charts Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(44,"a",31),e.\u0275\u0275pipe(45,"slice"),e.\u0275\u0275text(46," Mascot Display (\u03bcg/m\xb3) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(47,"a",31),e.\u0275\u0275pipe(48,"slice"),e.\u0275\u0275text(49," Mascot Display (US AQI) "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(50,"a",31),e.\u0275\u0275pipe(51,"slice"),e.\u0275\u0275text(52," GO AQS Status Display "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(53,"a",31),e.\u0275\u0275pipe(54,"slice"),e.\u0275\u0275text(55," GO AQS Gauge Display "),e.\u0275\u0275elementEnd()()()}if(2&n){const t=o.$implicit,i=e.\u0275\u0275reference(2),a=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",i),e.\u0275\u0275advance(25),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(30,10,t.url,13,23)+"/classic",e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(33,14,t.url,13,23)+"/"+a.DisplayTypes.guidelines,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(36,18,t.url,13,23)+"/"+a.DisplayTypes.guidelinesMascot+"?measure="+a.MascotMeasures.pm02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(39,22,t.url,13,23)+"/"+a.DisplayTypes.guidelinesMascot+"?measure="+a.MascotMeasures.pi02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(42,26,t.url,13,23)+"/charts",e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(45,30,t.url,13,23)+"/mascot?measure="+a.MascotMeasures.pm02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(48,34,t.url,13,23)+"/mascot?measure="+a.MascotMeasures.pi02,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(51,38,t.url,13,23)+"/"+a.DisplayTypes.goiaqsStatus,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275property("href","/display/"+e.\u0275\u0275pipeBind3(54,42,t.url,13,23)+"/"+a.DisplayTypes.goiaqsGauge,e.\u0275\u0275sanitizeUrl)}}function mb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",33),e.\u0275\u0275text(1,"ID"),e.\u0275\u0275elementEnd())}function db(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.id,"")}}function ub(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",33),e.\u0275\u0275text(1,"Name"),e.\u0275\u0275elementEnd())}function _b(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",34)(1,"app-interactive-table-cell",35),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).edit(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!1)("customWidth","fit-content")("value",t.notes)}}function fb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",33),e.\u0275\u0275text(1,"Display Token"),e.\u0275\u0275elementEnd())}function hb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",24),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"slice"),e.\u0275\u0275element(3,"app-clipboard-copy",36),e.\u0275\u0275pipe(4,"slice"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(2,2,t.url,13,23)," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("copyValue",e.\u0275\u0275pipeBind3(4,6,t.url,13,23))}}function gb(n,o){1&n&&e.\u0275\u0275element(0,"tr",37)}function vb(n,o){1&n&&e.\u0275\u0275element(0,"tr",38)}function Cb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",12),e.\u0275\u0275elementContainerStart(1,13),e.\u0275\u0275template(2,sb,2,0,"th",14),e.\u0275\u0275template(3,pb,56,46,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,16),e.\u0275\u0275template(5,mb,2,0,"th",17),e.\u0275\u0275template(6,db,2,1,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,18),e.\u0275\u0275template(8,ub,2,0,"th",17),e.\u0275\u0275template(9,_b,2,3,"td",19),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,20),e.\u0275\u0275template(11,fb,2,0,"th",17),e.\u0275\u0275template(12,hb,5,10,"td",15),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(13,gb,1,0,"tr",21),e.\u0275\u0275template(14,vb,1,0,"tr",22),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(13),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function bb(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",39),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let xb=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B){this.displayServices=t,this.places=i,this.dialog=a,this.dialogService=r,this.locationsServices=l,this._messageService=f,this.helpService=w,this.localStore=T,this.router=M,this.dataServices=B,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.HelpSection=Z.L,this.DisplayTypes=$t.x,this.MascotMeasures=Xi.F,this.displayedColumns=["id","notes","url","edit"],this.filterValue="",this.destroy$=new H.xQ}set matSort(t){this.dataSource&&(this.dataSource.sort=t)}set matPaginator(t){this.dataSource&&(this.dataSource.paginator=t)}ngOnInit(){this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{var i;"admin_displays_loaded"===t&&(this.dataSource=new h.by(null===(i=this.displayServices)||void 0===i?void 0:i.filtered_displays.filter(a=>a.configuration).sort((a,r)=>r.id-a.id)),this.isTableEmpty=0===this.dataSource.data.length,this.applyFilter()),"admin_display_added"===t&&this.clearFilter(),"admin_display_saved"===t&&this.clearFilter()}),this.dataServices.currentScreen="Public Display",this.displayServices.displays=null,this.displayServices.getDisplays(this.places.currentPlace.id,!0),this.locationsServices.getLocations(this.places.currentPlace.id)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}edit(t){this.matDialogRef=this.dialog.open(Zi,{data:{display:t,isEditing:!0},disableClose:!0}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})}createNewDisplay(){this.matDialogRef=this.dialog.open(Zi,{data:{isEditing:!1},disableClose:!0}),this.dialogService.setFullScreenDialog(this.matDialogRef,{desktopWidth:"900px",desktopHeight:"auto"})}savePagination(t){this.localStore.saveData("paginationDisplays",t.pageSize)}getPagination(){return this.localStore.getData("paginationDisplays")||"500"}applyFilter(t=this.filterValue){var i,a;this.filterValue=t.trim().toLowerCase(),this.dataSource&&(this.dataSource.filter=this.filterValue,null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage())}clearFilter(){this.dataSource&&(this.dataSource.filter="",this.applyFilter())}printQR(t,i){this.router.navigate([`settings/print-widget-qr/${t.url.substr(13,10)}/${i}`])}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Ge.A),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(ee.O))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-displays-table"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(U.YE,5),e.\u0275\u0275viewQuery(Ce.NW,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matSort=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matPaginator=a.first)}},decls:11,vars:6,consts:[["color","primary","mode","indeterminate",4,"ngIf"],[3,"justifyContent"],["label","Search Admin Displays","placeholder","Type in the display id",3,"keepSearchParameterInURL","applyFilter","clearFilter",4,"ngIf"],[1,"right-buttons-wrapper"],["mat-flat-button","",1,"button-primary",3,"click"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main locations zoom-table","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width sticky-paginator",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["color","primary","mode","indeterminate"],["label","Search Admin Displays","placeholder","Type in the display id",3,"keepSearchParameterInURL","applyFilter","clearFilter"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main","locations","zoom-table",3,"dataSource"],["matColumnDef","edit"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","notes"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","url"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["menuQRCode","matMenu"],["mat-menu-item","",3,"click"],["menuPreview","matMenu"],["mat-menu-item","","target","_blank",3,"href"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",1,"zoom-td"],[3,"isLocationName","customWidth","value","cellClick"],["successMessage","Display token has been copied to clipboard","size","small",3,"copyValue"],["mat-header-row",""],["mat-row",""],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section"),e.\u0275\u0275template(1,ob,1,0,"mat-progress-bar",0),e.\u0275\u0275elementStart(2,"app-sub-header",1),e.\u0275\u0275template(3,rb,1,1,"app-table-filter-search",2),e.\u0275\u0275elementStart(4,"div",3)(5,"button",4),e.\u0275\u0275listener("click",function(){return i.createNewDisplay()}),e.\u0275\u0275text(6,"Add New"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(7,"div",5),e.\u0275\u0275template(8,lb,1,1,"app-no-data",6),e.\u0275\u0275template(9,Cb,15,3,"table",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,bb,1,2,"mat-paginator",8),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.displayServices.displays),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty&&(null==i.dataSource||null==i.dataSource.data?null:i.dataSource.data.length)>=5))},directives:[u.NgIf,at.pW,ae.$,$e.n,z.lW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,h.Dz,h.ev,W.VK,W.KA,W.OP,W.p6,Q.Hw,U.nU,Ct.T,Ie.Z,h.as,h.XQ,h.nj,h.Gk,Ce.NW],pipes:[u.SlicePip
1e],encapsulation:2}),n})();var dn=d(35660),yt=d(10410),Ji=d(91143),Qn=d(36053),qn=d(70220),ne=d(87899);const yb=[ne.ee.pm02,ne.ee.atmp,ne.ee.rhum,ne.ee.measure0,ne.ee.measure1,ne.ee.measure2,ne.ee.measure3,ne.ee.measure5,ne.ee.measure6];var Kn=d(84285),ea=d(33956),un=d(4475),Ft=d(77695),Yn=d(66276);const Sb=["searchInput1"],wb=["searchInput2"];function Eb(n,o){1&n&&e.\u0275\u0275element(0,"app-progress-bar")}function Tb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",25),e.\u0275\u0275element(1,"span",10),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.label,e.\u0275\u0275sanitizeHtml)}}function Ib(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1,"Date and Time are required"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleMap(null!=t.configForm.controls.trainingDateFrom&&t.configForm.controls.trainingDateFrom.value||null==t.configForm.controls.trainingDateFrom||!t.configForm.controls.trainingDateFrom.touched?"":"color: var(--errorColor)")}}function Pb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1,"Date and Time are required"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleMap(!t.configForm.controls.trainingDateTo.value&&t.configForm.controls.trainingDateTo.touched?"color: var(--errorColor)":"")}}function kb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1,"Date and Time are required"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275styleMap(!t.configForm.controls.dateTo.value&&t.configForm.controls.dateTo.touched?"color: var(--errorColor)":"")}}function Mb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"b"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=o.index,a=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t+(i+1<a.calibrationToolService.emptyDataLocationNames.length?", ":"")," ")}}function Ab(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",19)(1,"app-warning-message",20),e.\u0275\u0275elementContainerStart(2,21),e.\u0275\u0275elementStart(3,"div",22)(4,"p"),e.\u0275\u0275text(5," No data provided for "),e.\u0275\u0275template(6,Mb,2,1,"b",26),e.\u0275\u0275text(7,". Please consider changing the period dates or selecting different locations. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",t.calibrationToolService.emptyDataLocationNames)}}function Db(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",27)(1,"mat-label")(2,"b"),e.\u0275\u0275text(3,"Reference Data Shift"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",28)(5,"button",29),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().calibrationToolService.shiftReferenceData(-1)}),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275elementStart(7,"mat-icon",30),e.\u0275\u0275text(8," remove "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"div"),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"button",29),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().calibrationToolService.shiftReferenceData(1)}),e.\u0275\u0275pipe(12,"async"),e.\u0275\u0275elementStart(13,"mat-icon",30),e.\u0275\u0275text(14," add "),e.\u0275\u0275elementEnd()()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(6,3,t.calibrationToolService.loading$)),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",t.calibrationToolService.referenceDataShift.label," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(12,5,t.calibrationToolService.loading$))}}let Ob=(()=>{class n{constructor(t,i,a,r){this.calibrationToolService=t,this.locationsService=i,this.urlParam
1sPersistence=a,this.userService=r,this.configForm=new _.cw({}),this.locationFilterValue="",this.filteredLocations=[],this.locationsList=[],this.measureOptions=[],this.locationSelectStateMatcher=(0,qn.$)("id"),this.measureSelectStateMatcher=(0,qn.$)("value"),this.isFireFoxBrowser=!1,this.currentDate=(new Date).toISOString().slice(0,16),this.supportStaffOnlyMeasures=[ne.ee.measure0,ne.ee.measure1,ne.ee.measure2,ne.ee.measure3,ne.ee.measure5,ne.ee.measure6],this.destroy$=new H.xQ,this.isInitializingFromUrl=!1}ngOnInit(){this.isFireFoxBrowser=navigator.userAgent.includes("Firefox"),this.locationsService.allLocations$.pipe((0,A.R)(this.destroy$)).subscribe(t=>{this.locationsList=this.locationsService.filterOutPPSLocations(t,!0),this.filteredLocations=this.locationsList}),this.userService.userSubject.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.setMeasureOptions()}),this.calibrationToolService.loading$.pipe((0,A.R)(this.destroy$)).subscribe(t=>{t?this.configForm.disable({emitEvent:!1}):this.configForm.enable({emitEvent:!1})}),this.setMeasureOptions(),this.setConfigForm(),this.subscribeToConfigForm(),this.subscribeToDateRangeControls(),this.initFromUrlParams()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleLocationSelect(t,i){this.configForm.patchValue("reference"===i?{location1:t}:{location2:t})}setConfigForm(){this.configForm=new _.cw({location1:new _.NI("",_.kI.required),location2:new _.NI("",_.kI.required),measure:new _.NI("",_.kI.required),dateFrom:new _.NI(null,_.kI.required),dateTo:new _.NI(null,_.kI.required),trainingDateFrom:new _.NI(null),trainingDateTo:new _.NI(null)}),this.configForm.controls.dateFrom.disable()}focusFilterSearch(t){this.configForm.value.location1||1!==t?!this.configForm.value.location2&&2===t&&setTimeout(()=>{this.searchInput2Ref.nativeElement.focus()},300):setTimeout(()=>{this.searchInput1Ref.nativeElement.focus()},300)}setMeasureOptions(){var t;this.measureOptions=Object.values(ne.ee).filter(a=>{var r;return!(this.supportStaffOnlyMeasures.includes(a)&&!(null===(r=this.userService.currentUser)||void 0===r?void 0:r.support_staff))&&yb.includes(a)}).map(a=>({value:a,label:a===ne.ee.pm02?"PM<sub>2.5</sub> via PM<sub>2.5</sub> Raw":Kn.CY.get(a)})),this.measureOptions.splice(1,0,{value:ne.ee.pm02+"_via_count",label:Kn.CY.get(ne.ee.pm02)+" via PM Count"});const i=null===(t=this.configForm.get("measure"))||void 0===t?void 0:t.value;i&&!this.measureOptions.some(a=>a.value===i.value)&&this.configForm.patchValue({measure:null},{emitEvent:!1})}subscribeToDateRangeControls(){(0,Qn.aj)([this.configForm.controls.trainingDateFrom.valueChanges,this.configForm.controls.trainingDateTo.valueChanges]).pipe((0,A.R)(this.destroy$)).subscribe(([t,i])=>{const a=wn()(t),r=wn()(i);let l=i,f=i;if(t&&i){const w=r.diff(a,"minutes");if(w){let T=r.add(w,"minutes");const M=wn()(Date.now());T.isAfter(M)&&(T=M),l=T.format("YYYY-MM-DDTHH:mm"),this.configForm.patchValue({dateTo:l,dateFrom:f})}}})}subscribeToConfigForm(){this.configForm.valueChanges.pipe((0,A.R)(this.destroy$),(0,rt.b)(500)).subscribe(t=>{var i;this.configForm.valid&&this.calibrationToolService.getData(t.location1,t.location2,t.dateFrom,t.dateTo,null===(i=t.measure)||void 0===i?void 0:i.value,t.trainingDateFrom,t.trainingDateTo),this.syncToUrl()})}initFromUrlParams(){this.urlParamsPersistence.initializeFromUrl(un.PE,t=>{this.isInitializingFromUrl=!0,this.populateFromUrlParams(t)})}populateFromUrlParams(t){this.locationsService.allLocations$.pipe((0,Et.h)(i=>(null==i?void 0:i.length)>0),(0,Xe.q)(1)).subscribe(i=>{const a=this.locationsService.filterOutPPSLocations(i,!0),r={};if(t.location1){const l=a.find(f=>f.id===t.location1);l&&(r.location1=l)}if(t.location2){const l=a.find(f=>f.id===t.location2);l&&(r.location2=l)}if(t.measure){const l=this.measureOptions.find(f=>f.value===t.measure);l&&(r.measure=l)}t.trainingDateFrom&&(r.trainingDateFrom=(0,Ft.x5)(t.trainingDateFrom)),t.trainingDateTo&&(r.trainingDateTo=(0,Ft.x5)(t.trainingDateTo)),t.dateFrom&&(r.dateFrom=(0,Ft.x5)(t.dateFrom)),t.dateTo&&(r.dateTo=(0,Ft.x5)(t.dateTo)),this.configForm.patchValue(r),this.isInitializingFromUrl=!1})}syncToUrl(){var t,i,a;if(this.isInitializingFromUrl)return;const r=this.configForm.getRawValue(),l={};(null===(t=r.location1)||void 0===t?void 0:t.id)&&(l.location1=r.location1.id),(null===(i=r.location2)||void 0===i?void 0:i.id)&&(l.location2=r.location2.id),(null===(a=r.measure)||void 0===a?void 0:a.value)&&(l.measure=r.measure.value),r.trainingDateFrom&&(l.trainingDateFrom=r.trainingDateFrom),r.trainingDateTo&&(l.trainingDateTo=r.trainingDateTo),r.dateFrom&&(l.dateFrom=r.dateFrom),r.dateTo&&(l.dateTo=r.dateTo),this.urlParam
1sPersistence.writeParams(un.PE,l)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(ea.Q),e.\u0275\u0275directiveInject(xe.K))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-calibration-tool-config-controls"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Sb,5),e.\u0275\u0275viewQuery(wb,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.searchInput1Ref=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.searchInput2Ref=a.first)}},decls:62,vars:28,consts:[[2,"height","5px"],[4,"ngIf"],[1,"dashboard-tile-inner"],[1,"spacer-top-nil"],[1,"flex-column",3,"formGroup"],[1,"flex-start","gap-3","flex-wrap","spacer-bottom-xs"],["label","Monitor 1 (Reference)",1,"form-field-responsive-s",3,"allLocations","selectedLocation","locationSelected"],["label","Monitor 2",1,"form-field-responsive-s",3,"allLocations","selectedLocation","locationSelected"],[1,"form-field-responsive-s","sub-tag-value-ff"],["required","","formControlName","measure",3,"compareWith"],[3,"innerHTML"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-start","gap-3","flex-wrap"],[1,"form-field-responsive-s"],["matInput","","formControlName","trainingDateFrom","type","datetime-local",1,"date-time-input",3,"max"],[3,"style",4,"ngIf"],["matInput","","step","300","formControlName","trainingDateTo","type","datetime-local",1,"date-time-input",3,"min","max"],["matInput","","step","300","formControlName","dateFrom","type","datetime-local",1,"date-time-input",3,"max"],["matInput","","step","300","formControlName","dateTo","type","datetime-local",1,"date-time-input",3,"min"],[1,"spacer-top-sm"],[3,"isAccentWarning"],["warning",""],[1,"content"],["class","spacer-top-sm",4,"ngIf"],["class","spacer-top-lg",4,"ngIf"],[3,"value"],[4,"ngFor","ngForOf"],[1,"spacer-top-lg"],[1,"flex-start","gap-1","spacer-top-xxs"],["mat-icon-button","","type","button",1,"air-icon-btn","large","search-btn",3,"disabled","click"],[1,"inline-icon"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div")(1,"div",0),e.\u0275\u0275template(2,Eb,1,0,"app-progress-bar",1),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",2)(5,"h3",3),e.\u0275\u0275text(6,"Configuration"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"form",4)(8,"div",5)(9,"app-location-select-with-search",6),e.\u0275\u0275listener("locationSelected",function(r){return i.handleLocationSelect(r,"reference")}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"app-location-select-with-search",7),e.\u0275\u0275listener("locationSelected",function(r){return i.handleLocationSelect(r,"target")}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"mat-form-field",8)(12,"mat-label"),e.\u0275\u0275text(13,"Measure"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"mat-select",9)(15,"mat-select-trigger"),e.\u0275\u0275element(16,"span",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,Tb,2,2,"mat-option",11),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(18,"div",12)(19,"div")(20,"mat-label")(21,"b"),e.\u0275\u0275text(22,"Calibration Period"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(23,"div",12)(24,"mat-form-field",13)(25,"mat-label"),e.\u0275\u0275text(26,"Start"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(27,"input",14),e.\u0275\u0275template(28,Ib,2,2,"mat-hint",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"mat-form-field",13)(30,"mat-label"),e.\u0275\u0275text(31,"End"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(32,"input",16),e.\u0275\u0275template(33,Pb,2,2,"mat-hint",15),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(34,"div")(35,"mat-label")(36,"b"),e.\u0275\u0275text(37,"Testing Period"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(38,"div",12)(39,"mat-form-field",13)(40,"mat-label"),e.\u0275\u0275text(41,"Start"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(42,"input",17),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(43,"mat-form-field",13)(44,"mat-label"),e.\u0275\u0275text(45,"End"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(46,"input",18),e.\u0275\u0275template(47,kb,2,2,"mat-hint",15),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(48,"div",19)(49,"app-warning-message",20),e.\u0275\u0275elementContainerStart(50,21),e.\u0275\u0275elementStart(51,"div",22)(52,"p")(53,"b"),e.\u0275\u0275text(54,"Calibration period:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(55," The data set used to derive the calibration parameters. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"p")(57,"b"),e.\u0275\u0275text(58,"Testing period:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(59," The data set used to evaluate the sensor's performance after calibration. Initially, it is automatically set to match the length of the calibration period, but you can adjust it by modifying the end date of the peri
1od. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(60,Ab,8,2,"div",23),e.\u0275\u0275template(61,Db,15,7,"div",24),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(3,26,i.calibrationToolService.loading$)),e.\u0275\u0275advance(5),e.\u0275\u0275property("formGroup",i.configForm),e.\u0275\u0275advance(2),e.\u0275\u0275property("allLocations",i.filteredLocations)("selectedLocation",i.configForm.value.location1),e.\u0275\u0275advance(1),e.\u0275\u0275property("allLocations",i.filteredLocations)("selectedLocation",i.configForm.value.location2),e.\u0275\u0275advance(4),e.\u0275\u0275property("compareWith",i.measureSelectStateMatcher),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",null==i.configForm.value.measure?null:i.configForm.value.measure.label,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.measureOptions),e.\u0275\u0275advance(10),e.\u0275\u0275styleMap(i.configForm.controls.trainingDateFrom.value||i.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("max",i.configForm.value.trainingDateTo),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.isFireFoxBrowser),e.\u0275\u0275advance(4),e.\u0275\u0275styleMap(i.configForm.controls.trainingDateTo.value||i.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("min",i.configForm.value.trainingDateFrom)("max",i.currentDate),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.isFireFoxBrowser),e.\u0275\u0275advance(9),e.\u0275\u0275property("max",i.configForm.value.dateTo),e.\u0275\u0275advance(4),e.\u0275\u0275styleMap(i.configForm.controls.dateTo.value||i.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("min",i.configForm.value.trainingDateTo),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.isFireFoxBrowser),e.\u0275\u0275advance(2),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(11),e.\u0275\u0275property("ngIf",i.calibrationToolService.emptyDataLocationNames.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.calibrationToolService.chartDataGenerated&&!i.calibrationToolService.emptyDataLocationNames.length))},directives:[u.NgIf,ot.R,_._Y,_.JL,_.sg,Yn.Z,D.KE,D.hX,_e.gD,_.Q7,_.JJ,_.u,_e.$L,u.NgForOf,de.ey,X.Nt,_.Fj,D.bx,je.R,z.lW,Q.Hw],pipes:[u.AsyncPipe],styles:[""]}),n})();var Lb=d(62583),ta=d(98845),Fb=d(59043);function Rb(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," (Based on PM Count) "),e.\u0275\u0275elementContainerEnd())}function Nb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1," NO2 calibration factors are preview-only for now and cannot be saved yet. "),e.\u0275\u0275elementEnd())}function Vb(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," Selected Locations Except Reference "),e.\u0275\u0275elementContainerEnd())}function Hb(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.calibrationToolService.targetLocation.name," ")}}function jb(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"button",6),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).applyCorrection()}),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275element(3,"span",7),e.\u0275\u0275template(4,Vb,2,0,"ng-container",0),e.\u0275\u0275template(5,Hb,2,1,"ng-container",0),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(2,5,t.calibrationToolService.loading$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("desktopText","Apply Calibration to")("mobileText","Apply to"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.calibrationToolService.isBGCalibrationEmbeddedViewMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.isBGCalibrationEmbeddedViewMode)}}function Bb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"h3",1),e.\u0275\u0275text(2," Calibration Parameters "),e.\u0275\u0275template(3,Rb,2,0,"ng-container",0),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",2)(5,"div",3),e.\u0275\u0275element(6,"div",4),e.\u0275\u0275elementStart(7,"div")(8,"h4",5),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"span"),e.\u0275\u0275text(11,"Scaling Factor"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(12,"div",3),e.\u0275\u0275element(13,"div",4),e.\u0275\u0275elementStart(14,"div")(15,"h4",5),e.\u0275\u0275text(16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"span"),e.\u0275\u0275text(18,"Offset "),e.\u0275\u0275elementStart(19,"span"),e.\u0275\u0275text(20),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275template(21,Nb,2,0,"p",0),e.\u0275\u0275template(22,jb,6,7,"div",0),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.calibrationToolService.isPmCountBase),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" ",t.calibrationToolService.trainingPerio
1dSlope," "),e.\u0275\u0275advance(7),e.\u0275\u0275textInterpolate1(" ",t.calibrationToolService.trainingPeriodIntercept," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1("(",t.calibrationToolService.genericChartsConfig.mesUnit,")"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.calibrationToolService.measure===t.MeasureNameTypes.measure6),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.calibrationToolService.measure!==t.MeasureNameTypes.measure6)}}let Gb=(()=>{class n{constructor(t,i,a,r){this.calibrationToolService=t,this.sensorServices=i,this.locationsServices=a,this.placesService=r,this.MeasureNameTypes=ne.ee}applyCorrection(){const{id:t,sensor_id:i}=this.calibrationToolService.targetLocation,a=this.calibrationToolService.measure;(a===ne.ee.atmp||a===ne.ee.rhum)&&this.applyCorrectionRhumTemp(a,t,i),a===ne.ee.pm02&&this.applyCorrectionPM02()}applyCorrectionPM02(){const{id:t,sensor_id:i,pm2_slr_scaling_factor:a,pm2_slr_intercept:r}=this.calibrationToolService.targetLocation,{slrConfig:l,plantower_pm2_correction_algo:f}=this.getPM02CorrectionConfig(a,r);this.sensorServices.savePM_SLRCorrectionConfig(this.placesService.currentPlace.id,i,t,l,{plantower_pm2_correction_algo:f},!0,!0)}getPM02CorrectionConfig(t,i){let r,a={pm2_slr_scaling_factor:t,pm2_slr_intercept:i};return this.calibrationToolService.isPmCountBase?(a.pm2_slr_scaling_factor=this.calibrationToolService.trainingPeriodSlope,a.pm2_slr_intercept=this.calibrationToolService.trainingPeriodIntercept,r=Dt.J7.custom):(a.pm2_slr_via_pm25_raw_scaling_factor=this.calibrationToolService.trainingPeriodSlope,a.pm2_slr_via_pm25_raw_intercept=this.calibrationToolService.trainingPeriodIntercept,r=Dt.J7.custom_via_pm25_raw),{slrConfig:a,plantower_pm2_correction_algo:r}}applyCorrectionRhumTemp(t,i,a){this.saveSlrCustomAlgoNameRhumTempByMeasure(t,i);const{atmp_slr_intercept:r,atmp_slr_scaling_factor:l,rhum_slr_intercept:f,rhum_slr_scaling_factor:w}=this.calibrationToolService.targetLocation,T={atmp_slr_intercept:r,atmp_slr_scaling_factor:l,rhum_slr_intercept:f,rhum_slr_scaling_factor:w};t===ne.ee.atmp?(T.atmp_slr_intercept=this.calibrationToolService.getInterceptInCelsius(this.calibrationToolService.trainingPeriodSlope,this.calibrationToolService.trainingPeriodIntercept),T.atmp_slr_scaling_factor=this.calibrationToolService.trainingPeriodSlope):(T.rhum_slr_intercept=this.calibrationToolService.trainingPeriodIntercept,T.rhum_slr_scaling_factor=this.calibrationToolService.trainingPeriodSlope),this.sensorServices.saveTempRHCustomConfig(this.placesService.currentPlace.id,i,a,T,!0)}saveSlrCustomAlgoNameRhumTempByMeasure(t,i){switch(t){case ne.ee.atmp:this.locationsServices.saveTemperatureCorrectionFormula(this.placesService.currentPlace.id,i,{temp_correction_algo:Nn.u.custom});break;case ne.ee.rhum:this.locationsServices.saveRelativeHumidityCorrectionFormula(this.placesService.currentPlace.id,i,{hum_correction_algo:Vn.z.custom})}}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-calibration-metrics"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"spacer-top-nil"],[1,"flex-start","gap-5","spacer-bottom-md","flex-align-end"],[1,"flex-center","gap-1"],[1,"marker"],[1,"spacer-top-xs","spacer-bottom-xs"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"],["appResponsiveText","",3,"desktopText","mobileText"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Bb,23,6,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.calibrationToolService.chartDataGenerated&&!i.calibrationToolService.emptyDataLocationNames.length)},directives:[u.NgIf,z.lW,Fb.n],pipes:[u.AsyncPipe],styles:[".marker[_ngcontent-%COMP%]{background-color:var(--primaryColor500);width:5px;height:60px}"]}),n})();function zb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",1)(1,"app-warning-message",2),e.\u0275\u0275elementContainerStart(2,3),e.\u0275\u0275elementStart(3,"div",4)(4,"p")(5,"b"),e.\u0275\u0275text(6,"Inverse correlation detected"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(7," It appears that the measurements from your reference sensor are inversely correlated with your sensor's readings. Please check the following: "),e.\u0275\u0275elementStart(8,"ul")(9,"li")(10,"b"),e.\u0275\u0275text(11,"Sensor placement"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(12,": Ensure both sensors are positioned close together, with their inlets exp
1osed to the same air conditions. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"li")(14,"b"),e.\u0275\u0275text(15,"Data input"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(16,": Confirm that you're using the correct reference data in the dashboard. Double-check the data channels to avoid any mix-up. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(17,"p"),e.\u0275\u0275text(18," For further assistance, please reach out to our "),e.\u0275\u0275elementStart(19,"a",5),e.\u0275\u0275text(20,"support team "),e.\u0275\u0275elementStart(21,"mat-icon"),e.\u0275\u0275text(22,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(23,". "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}let na=(()=>{class n{constructor(t){this.calibrationToolService=t}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(yt.q))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-inverse-correlation-warning"]],decls:1,vars:1,consts:[["class","dashboard-tile-inner full-width",4,"ngIf"],[1,"dashboard-tile-inner","full-width"],[3,"isAccentWarning"],["warning",""],[1,"content"],["href","https://www.airgradient.com/support/","target","_blank",1,"accent-link"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,zb,24,1,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.calibrationToolService.inverseCorrelationErrorDetected)},directives:[u.NgIf,je.R,Q.Hw],encapsulation:2}),n})();function $b(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"h3",9),e.\u0275\u0275text(2,"Calibrated Data"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"app-comparison-scatter-chart",7),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(3),e.\u0275\u0275property("chartId",t.CalibrationToolChartId.scatterCorrected)}}function Ub(n,o){1&n&&e.\u0275\u0275element(0,"app-calibration-metrics")}function Wb(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",5)(2,"div",6),e.\u0275\u0275element(3,"app-comparison-linear-chart",7),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",8)(5,"div")(6,"h3",9),e.\u0275\u0275text(7,"Raw Data"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(8,"app-comparison-scatter-chart",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(9,$b,4,1,"div",0),e.\u0275\u0275template(10,Ub,1,0,"app-calibration-metrics",0),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(3),e.\u0275\u0275property("chartId",t.CalibrationToolChartId.linearCorrected),e.\u0275\u0275advance(5),e.\u0275\u0275property("chartId",t.CalibrationToolChartId.scatterRaw),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.inverseCorrelationErrorDetected),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.inverseCorrelationErrorDetected)}}function Qb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",15)(1,"app-warning-message",11),e.\u0275\u0275elementContainerStart(2,12),e.\u0275\u0275elementStart(3,"div",13)(4,"p"),e.\u0275\u0275text(5," Please note that for PM"),e.\u0275\u0275elementStart(6,"sub"),e.\u0275\u0275text(7,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(8," calibration, the scaling factor and offset were derived using the PM Count readings from the monitor "),e.\u0275\u0275elementStart(9,"b"),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11," rather than the PM"),e.\u0275\u0275elementStart(12,"sub"),e.\u0275\u0275text(13,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(14," concentration itself. This method provides a more accurate correlation with the reference monitor\u2019s PM"),e.\u0275\u0275elementStart(15,"sub"),e.\u0275\u0275text(16,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(17," readings, improving calibration accuracy. You can learn more "),e.\u0275\u0275elementStart(18,"a",16),e.\u0275\u0275text(19,"here "),e.\u0275\u0275elementStart(20,"mat-icon"),e.\u0275\u0275text(2
11,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(22,". "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(9),e.\u0275\u0275textInterpolate(t.calibrationToolService.targetLocation.name)}}function qb(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," all selected locations except the reference location "),e.\u0275\u0275elementContainerEnd())}function Kb(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"b"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3," displayed on your dashboard "),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.calibrationToolService.targetLocation.name)}}function Yb(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," the specified location. "),e.\u0275\u0275elementContainerEnd())}function Xb(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," this location. "),e.\u0275\u0275elementContainerEnd())}function Zb(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",5),e.\u0275\u0275template(1,Qb,23,2,"div",10),e.\u0275\u0275elementStart(2,"app-warning-message",11),e.\u0275\u0275elementContainerStart(3,12),e.\u0275\u0275elementStart(4,"div",13)(5,"p"),e.\u0275\u0275text(6," Once you apply calibration, all "),e.\u0275\u0275element(7,"b",14),e.\u0275\u0275pipe(8,"getMeasureName"),e.\u0275\u0275text(9," readings for "),e.\u0275\u0275template(10,qb,2,0,"ng-container",0),e.\u0275\u0275template(11,Kb,4,1,"ng-container",0),e.\u0275\u0275text(12," will reflect the calibrated values. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"p"),e.\u0275\u0275text(14," However, the raw data from the monitor will continue to be stored in the database. If you want to change the calibration settings later or switch back to the raw data you can easily do so in the advanced settings for "),e.\u0275\u0275template(15,Yb,2,0,"ng-container",0),e.\u0275\u0275template(16,Xb,2,0,"ng-container",0),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.calibrationToolService.isPmCountBase),e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(5),e.\u0275\u0275property("innerHTML",e.\u0275\u0275pipeBind2(8,7,t.calibrationToolService.measure,"long"),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.calibrationToolService.isBGCalibrationEmbeddedViewMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.isBGCalibrationEmbeddedViewMode),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",t.calibrationToolService.isBGCalibrationEmbeddedViewMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.isBGCalibrationEmbeddedViewMode)}}function Jb(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",17)(1,"app-warning-message",11),e.\u0275\u0275elementContainerStart(2,12),e.\u0275\u0275elementStart(3,"div",13)(4,"p")(5,"b"),e.\u0275\u0275text(6," PM Count data not provided"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"p"),e.\u0275\u0275text(8," It seems that no PM count data has been provided, which is required for PM"),e.\u0275\u0275elementStart(9,"sub"),e.\u0275\u0275text(10,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(11," calibration via PM Count. If you're using an AirGradient monitor, make sure it is running the latest firmware version to receive PM Count readings. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"p"),e.\u0275\u0275text(13," For further assistance, please reach out to our "),e.\u0275\u0275elementStart(14,"a",18),e.\u0275\u0275text(15,"support team "),e.\u0275\u0275elementStart(16,"mat-icon"),e.\u0275\u0275text(17,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(18,". "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}function e2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Wb,11,4,"ng-container",0),e.\u0275\u0275template(2,Zb,17,10,"div",3),e.\u0275\u0275element(3,"app-inverse-correlation-warning",2),e.\u0275\u0275template(4,Jb,19,1,"div",4),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.pmCountDataMissing),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.inverseCorrelationErrorDetected&&t.calibrationToolService.chartDataGenerated&&!t.calibrationToolService.emptyDataLocationNames.length),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.calibrationToolService.pmCountDataMissing&&!t.calibrationToolService.emptyDataLocationNames.length)}}function t2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"section")(1,"div",1),e.\u0275\u0275element(2,"app-calibration-tool-config-control
1s",2),e.\u0275\u0275template(3,e2,5,3,"ng-container",0),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.calibrationToolService.chartDataGenerated&&!(null!=t.calibrationToolService.emptyDataLocationNames&&t.calibrationToolService.emptyDataLocationNames.length))}}let n2=(()=>{class n{constructor(t,i,a,r){this.placesService=t,this.calibrationToolService=i,this.messageService=a,this.dataService=r,this.destroy$=new H.xQ,this.CalibrationToolChartId=Ji.M6}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"place_changed"===t&&this.calibrationToolService.resetData()}),this.calibrationToolService.isBGCalibrationEmbeddedViewMode=!1,this.dataService.currentScreen="Calibration With Reference"}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.calibrationToolService.resetData()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-dashboard-calibration"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"calibration-dashboard-layout"],[1,"full-width"],["class","full-width dashboard-tile-inner",4,"ngIf"],["class","dashboard-tile-inner full-width",4,"ngIf"],[1,"full-width","dashboard-tile-inner"],[1,"padding-right-lg"],[3,"chartId"],[1,"flex-start","flex-align-start","gap-4","flex-wrap","full-width","dashboard-tile-inner"],[1,"spacer-top-nil"],["class","spacer-top-md spacer-bottom-md",4,"ngIf"],[3,"isAccentWarning"],["warning",""],[1,"content"],[3,"innerHTML"],[1,"spacer-top-md","spacer-bottom-md"],["href","https://www.airgradient.com/blog/update-on-pms5003-calibration/","target","_blank",1,"accent-link"],[1,"dashboard-tile-inner","full-width"],["href","https://www.airgradient.com/support/","target","_blank",1,"accent-link"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,t2,4,1,"section",0),2&t&&e.\u0275\u0275property("ngIf",null==i.placesService.currentPlace?null:i.placesService.currentPlace.id)},directives:[u.NgIf,Ob,Lb.Z,ta.U,Gb,je.R,Q.Hw,na],pipes:[Rn.x],styles:[".calibration-dashboard-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:20px}@media (max-width: 768px){.calibration-dashboard-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px}@media (max-width: 768px){.calibration-dashboard-layout[_ngcontent-%COMP%]{gap:5px;padding:5px 0}}}"]}),n})();var i2=d(70796),Xn=d(78551),Me=(()=>{return(n=Me||(Me={})).NETWORK_CALIBRATION="network_calibration",n.BG="bg",Me;var n})(),ia=d(84905),Zn=d(591),a2=d(57138);const o2=[ne.ee.pm02];var r2=d(42315),l2=d(17626),s2=d(18642);const c2=["locationsChipSelect"];function p2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",16),e.\u0275\u0275element(1,"span",5),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.label,e.\u0275\u0275sanitizeHtml)}}function m2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1,"Date and Time are required"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275styleMap(!t.configForm.controls.networkCalibrationDateTo.value&&t.configForm.controls.networkCalibrationDateTo.touched?"color: var(--errorColor)":"")}}function d2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",16),e.\u0275\u0275element(1,"span",5),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.label,e.\u0275\u0275sanitizeHtml)}}const aa=function(n){return{"disabled-control":n}};function u2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",8)(1,"mat-label",17),e.\u0275\u0275text(2,"Bucket Size"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"mat-select",18)(4,"mat-select-trigger"),e.\u0275\u0275element(5,"span",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,d2,2,2,"mat-option",6),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(3,aa,t.configForm.get("bucket").disabled)),e.\u0275\u0275advance(4),e.\u0275\u0275property("innerHTML",null==t.configForm.value.bucket?null:t.configForm.value.bucket.label,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.availableBucketOptions)}}function _2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-locations-chip-list",19),e.\u0275\u0275listener("remove",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).removeLocation(a)})("removeAll",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).removeAllLocations()}),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=o.ngIf,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("locations",t)("chipColorMarkers",i.selectedLocationsColorsHash)("showChipColorMarkers",i.effectiveShowChipColorMarkers)("disabled",e.\u0275\u0275pipeBind1(2,4,i.loading$))}}function f2(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p",20),e.\u0275\u0275text(1," Please note that some of your locations have no data. These locations will be excluded from the further analysis. Locations with
1no data are marked with "),e.\u0275\u0275element(2,"span",21),e.\u0275\u0275text(3," above. "),e.\u0275\u0275elementEnd())}function h2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"form",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),e.\u0275\u0275text(5,"Measure"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-select",4)(7,"mat-select-trigger"),e.\u0275\u0275element(8,"span",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(9,p2,2,2,"mat-option",6),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"div",7)(11,"mat-form-field",8)(12,"mat-label"),e.\u0275\u0275text(13),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(14,"input",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"mat-form-field",8)(16,"mat-label"),e.\u0275\u0275text(17),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(18,"input",10),e.\u0275\u0275template(19,m2,2,2,"mat-hint",11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(20,u2,7,5,"mat-form-field",12),e.\u0275\u0275elementStart(21,"app-locations-chip-select",13,14),e.\u0275\u0275listener("locationChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().selectedLocationsList$.next(a)}),e.\u0275\u0275pipe(23,"async"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(24,_2,3,6,"ng-container",0),e.\u0275\u0275pipe(25,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"div"),e.\u0275\u0275template(27,f2,4,0,"p",15),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroup",t.configForm),e.\u0275\u0275advance(5),e.\u0275\u0275property("compareWith",t.measureSelectStateMatcher),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",t.selectedMeasureLabel||(null==t.configForm.value.measure?null:t.configForm.value.measure.label),e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.measureOptions),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(t.dateRangeStartLabel),e.\u0275\u0275advance(1),e.\u0275\u0275styleMap(t.configForm.controls.networkCalibrationDateFrom.value||t.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.dateRangeEndLabel),e.\u0275\u0275advance(1),e.\u0275\u0275styleMap(t.configForm.controls.networkCalibrationDateTo.value||t.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("min",t.configForm.value.networkCalibrationDateFrom),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isFireFoxBrowser),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.showBucketControl),e.\u0275\u0275advance(1),e.\u0275\u0275property("displayInline",!0)("loading",e.\u0275\u0275pipeBind1(23,23,t.loading$))("externalChipsComponentUsed",!0)("allLocations",t.locationsList)("selectAllButtonShown",!0)("size","l")("chipColorMarkers",t.bgCalibrationService.selectedLocationsColorsHash)("showChipColorMarkers",t.effectiveShowChipColorMarkers),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(25,25,t.selectedLocationsList$)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",t.bgCalibrationService.noDataLocations.length)}}function g2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-hint"),e.\u0275\u0275text(1,"Date and Time are required"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275styleMap(!t.configForm.controls.calibrationDateTo.value&&t.configForm.controls.calibrationDateTo.touched?"color: var(--errorColor)":"")}}function v2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-option",16),e.\u0275\u0275element(1,"span",5),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("innerHTML",t.label,e.\u0275\u0275sanitizeHtml)}}function C2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-form-field",8)(1,"mat-label",17),e.\u0275\u0275text(2,"Bucket Size"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"mat-select",18)(4,"mat-select-trigger"),e.\u0275\u0275element(5,"span",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,v2,2,2,"mat-option",6),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(3,aa,t.configForm.get("bucket").disabled)),e.\u0275\u0275advance(4),e.\u0275\u0275property("innerHTML",null==t.configForm.value.bucket?null:t.configForm.value.bucket.label,e.\u0275\u0275sanitizeHtml),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.availableBucketOptions)}}function b2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"h3",22),e.\u0275\u0275text(2,"Backgroun
1d Calibration"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"form",1)(4,"div",2)(5,"div",7)(6,"mat-form-field",8)(7,"mat-label"),e.\u0275\u0275text(8,"Start"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(9,"input",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"mat-form-field",8)(11,"mat-label"),e.\u0275\u0275text(12,"End"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(13,"input",24),e.\u0275\u0275template(14,g2,2,2,"mat-hint",11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(15,C2,7,5,"mat-form-field",12),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("formGroup",t.configForm),e.\u0275\u0275advance(6),e.\u0275\u0275styleMap(t.configForm.controls.calibrationDateFrom.value||t.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("min",t.bgCalibrationService.networkCalibrationLocalDateTo),e.\u0275\u0275advance(4),e.\u0275\u0275styleMap(t.configForm.controls.calibrationDateTo.value||t.isFireFoxBrowser?"":"color: #9e9e9e"),e.\u0275\u0275property("min",t.configForm.value.calibrationDateFrom),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isFireFoxBrowser),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.showBucketControl)}}let oa=(()=>{class n{constructor(t,i,a,r){this.calibrationToolService=t,this.placeService=i,this.locationsService=a,this.bgCalibrationService=r,this.page=Me.NETWORK_CALIBRATION,this.showBucketControl=!1,this.loading$=new Zn.X(!1),this.showChipColorMarkers=null,this.selectedLocationsColorsHash={},this.configStateChanges=new e.EventEmitter,this.isBGLineSectionShown=!1,this.configForm=new _.cw({}),this.locationsList=[],this.measureOptions=[],this.availableBucketOptions=[],this.selectedLocationsList$=new Zn.X([]),this.dateRangeStartLabel="Start",this.dateRangeEndLabel="End",this.selectedMeasureLabel="",this.measureSelectStateMatcher=(0,qn.$)("value"),this.isFireFoxBrowser=!1,this.destroy$=new H.xQ,this.CalibrationPage=Me}get effectiveShowChipColorMarkers(){var t;return null!==(t=this.showChipColorMarkers)&&void 0!==t?t:this.bgCalibrationService.chartDataGenerated}ngOnInit(){this.dateRangeStartLabel=this.page===Me.NETWORK_CALIBRATION?"Co-Location Start":"Start",this.dateRangeEndLabel=this.page===Me.NETWORK_CALIBRATION?"Co-Location End":"End",this.isFireFoxBrowser=navigator.userAgent.includes("Firefox"),this.subscribeToLoading(),this.setConfigForm(),this.page===Me.NETWORK_CALIBRATION&&(this.subscribeToAllLocations(),this.setMeasureOptions()),this.subscribeDateFromDateToChanges(),this.subscribeToConfigStateChanges()}removeLocation(t){this.locationsChipSelect.removeLocation(t)}removeAllLocations(){this.locationsChipSelect.resetLocationsList(),this.selectedLocationsList$.next([])}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setConfigForm(){this.page===Me.BG?(this.configForm=new _.cw({bucket:new _.NI("",_.kI.required),calibrationDateFrom:new _.NI(null,_.kI.required),calibrationDateTo:new _.NI(null,_.kI.required)}),setTimeout(()=>{this.configForm.get("calibrationDateFrom").setValue(this.bgCalibrationService.networkCalibrationLocalDateTo)},200)):this.configForm=new _.cw({measure:new _.NI("",_.kI.required),bucket:new _.NI("",_.kI.required),networkCalibrationDateFrom:new _.NI(null,_.kI.required),networkCalibrationDateTo:new _.NI(null,_.kI.required)}),this.configForm.get("bucket").disable({emitEvent:!1})}setMeasureOptions(){this.measureOptions=Object.values(ne.ee).filter(t=>o2.includes(t)).map(t=>({value:t,label:Kn.CY.get(t)})),this.configForm.patchValue({measure:this.measureOptions[0]}),this.disableMeasureControl()}subscribeToAllLocations(){this.locationsService.allLocations$.pipe((0,A.R)(this.destroy$)).subscribe(t=>{this.locationsList=this.locationsService.filterOutPPSLocations(t,!0),this.bgCalibrationService.allLocations=this.locationsList})}resetLocationsList(){this.selectedLocationsList$.next([]),this.locationsChipSelect.resetLocationsList()}resetConfigForm(){this.configForm.get("bucket").reset(),this.configForm.get("networkCalibrationDateFrom").reset(),this.configForm.get("networkCalibrationDateTo").reset()}subscribeToLoading(){this.loading$.pipe((0,A.R)(this.destroy$)).subscribe(t=>{t?this.configForm.disable({emitEvent:!1}):Object.keys(this.configForm.controls).filter(i=>
1"measure"!==i).forEach(i=>{var a;null===(a=this.configForm.get(i))||void 0===a||a.enable({emitEvent:!1})})})}subscribeToConfigStateChanges(){(0,Qn.aj)([this.configForm.valueChanges.pipe((0,Jt.O)(this.configForm.value)),this.selectedLocationsList$.asObservable()]).pipe((0,a2.e)(50),(0,A.R)(this.destroy$)).subscribe(([t,i])=>{this.configStateChanges.emit({page:this.page,valid:this.page===Me.NETWORK_CALIBRATION?this.configForm.valid&&i.length>2:this.configForm.valid,formValue:t,locations:i})})}subscribeDateFromDateToChanges(){const t=this.configForm.get(this.page===Me.NETWORK_CALIBRATION?"networkCalibrationDateFrom":"calibrationDateFrom"),i=this.configForm.get(this.page===Me.NETWORK_CALIBRATION?"networkCalibrationDateTo":"calibrationDateTo");(0,Qn.aj)([t.valueChanges,i.valueChanges]).pipe((0,A.R)(this.destroy$)).subscribe(([a,r])=>{this.toggleBucketControl(a,r),this.setAvailableBucketOptions(t.value,i.value)})}setAvailableBucketOptions(t,i){if(t&&i&&(this.availableBucketOptions=(0,r2.y)(t,i,!0,!0).map(a=>Object.assign(Object.assign({},a),{value:a.bucket,label:a.name})),this.availableBucketOptions.length)){const a=this.configForm.get("bucket"),r=a.value,l=this.availableBucketOptions[0],f=!!r&&this.availableBucketOptions.some(T=>T.value===r.value);(!this.showBucketControl||!f)&&(!r||r.value!==l.value)&&a.setValue(l)}}toggleBucketControl(t,i){t&&i?this.configForm.get("bucket").enable({emitEvent:!1}):this.configForm.get("bucket").disable({emitEvent:!1})}disableMeasureControl(){var t;this.selectedMeasureLabel=(null===(t=this.configForm.value.measure)||void 0===t?void 0:t.label)||"",this.configForm.get("measure").disable({emitEvent:!1})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(Xn.F))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-shared-calibration-config-controls"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(c2,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.locationsChipSelect=a.first)}},inputs:{page:"page",showBucketControl:"showBucketControl",loading$:"loading$",showChipColorMarkers:"showChipColorMarkers",selectedLocationsColorsHash:"selectedLocationsColorsHash"},outputs:{configStateChanges:"configStateChanges"},decls:3,vars:2,consts:[[4,"ngIf"],[1,"flex-column",3,"formGroup"],[1,"flex-start","flex-align-end","gap-2","flex-wrap","bg-controls-wrapper"],[1,"form-field-responsive-s","sub-tag-value-ff"],["required","","formControlName","measure",3,"compareWith"],[3,"innerHTML"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-start","gap-2","flex-wrap"],[1,"form-field-responsive-s"],["matInput","","step","300","formControlName","networkCalibrationDateFrom","type","datetime-local",1,"date-time-input"],["matInput","","step","300","formControlName","networkCalibrationDateTo","type","datetime-local",1,"date-time-input",3,"min"],[3,"style",4,"ngIf"],["class","form-field-responsive-s",4,"ngIf"],[3,"displayInline","loading","externalChipsComponentUsed","allLocations","selectAllButtonShown","size","chipColorMarkers","showChipColorMarkers","locationChange"],["locationsChipSelect",""],["class","spacer-top-lg spacer-bottom-nil",4,"ngIf"],[3,"value"],[3,"ngClass"],["required","","formControlName","bucket"],[3,"locations","chipColorMarkers","showChipColorMarkers","disabled","remove","removeAll"],[1,"spacer-top-lg","spacer-bottom-nil"],[1,"no-data-marker"],[1,"spacer-top-nil","spacer-bottom-lg"],["matInput","","step","300","formControlName","calibrationDateFrom","type","datetime-local",1,"date-time-input",3,"min"],["matInput","","step","300","formControlName","calibrationDateTo","type","datetime-local",1,"date-time-input",3,"min"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,h2,28,27,"div",0),e.\u0275\u0275template(2,b2,16,9,"div",0),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.page===i.CalibrationPage.NETWORK_CALIBRATION),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.page===i.CalibrationPage.BG))},directives:[u.NgIf,_._Y,_.JL,_.sg,D.KE,D.hX,_e.gD,_.Q7,_.JJ,_.u,_e.$L,u.NgForOf,de.ey,X.Nt,_.Fj,D.bx,u.NgClass,ce.oO,l2.G,s2.W],pipes:[u.AsyncPipe],styles:[".disabled-control[_ngcontent-%COMP%]{color:#9e9e9e!important}
1.bg-controls-wrapper[_ngcontent-%COMP%]{row-gap:5px!important}.no-data-marker[_ngcontent-%COMP%]{margin:0 5px;width:20px;height:10px;display:inline-block;border:1px solid grey}"]}),n})();const x2=["bgChart"];function y2(n,o){1&n&&e.\u0275\u0275element(0,"app-progress-bar")}function S2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-location-select-with-search",16),e.\u0275\u0275listener("locationSelected",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onReferenceLocationChange(a)}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(1,2,t.bgCalibrationService.loading$)||e.\u0275\u0275pipeBind1(2,4,t.calibrationToolService.loading$)||t.bgCalibrationService.backgroundDataFilteredLocations.locations.length<2)("allLocations",t.bgCalibrationService.allLocations)}}function w2(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",17)(1,"app-warning-message",18),e.\u0275\u0275elementContainerStart(2,19),e.\u0275\u0275elementStart(3,"div",20)(4,"p"),e.\u0275\u0275text(5," The selected reference location is also part of the background line calculation, which may influence the background values. Please consider removing it from the initial location selection. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}function E2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",21),e.\u0275\u0275element(1,"app-comparison-scatter-chart",22),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isEmbedded",!0)("chartId",t.scatterChartId)}}const T2=function(n){return{"bg-chart-container-s":n}};function I2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",2)(1,"mat-expansion-panel",3)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),e.\u0275\u0275text(4," Details "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(5,"div")(6,"div")(7,"b"),e.\u0275\u0275text(8,"Input:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(9," Twice Calibrated PM2.5 data for locations that passed the reproducibility (R\xb2) check: "),e.\u0275\u0275elementStart(10,"ol")(11,"li"),e.\u0275\u0275text(12," Initial calibration: batch correction, custom via count, custom via raw PM2.5. Comes from the backend "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"li"),e.\u0275\u0275text(14," Second calibration: based on the reproducibility step sensor alignment. "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(15,"div")(16,"b"),e.\u0275\u0275text(17,"Logic Description:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"ol")(19,"li"),e.\u0275\u0275text(20,"Calculate the background line"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"li"),e.\u0275\u0275text(22," Compare the background line with the selected reference location (?? Raw data for reference location is used). "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"li"),e.\u0275\u0275text(24," Calculate calibration params for the background line vs reference location. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"li"),e.\u0275\u0275text(26," Combine every individual calibration params set from sensor alignment in reproducibility step with the calibration params for pair background line vs selected reference location. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"li"),e.\u0275\u0275text(28," Apply the calibration params to all locations in the input data "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(29,"p")(30,"b"),e.\u0275\u0275text(31,"Output:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(32," Combined calibration params (reproducibility step sensor alignment + background) for every input location that should be applied over the initial calibrated data. "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(33,"h4",4),e.\u0275\u0275text(34),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(35,"div",5)(36,"div",6)(37,"p",7),e.\u0275\u0275text(38,"Percentile"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(39,"ngx-slider",8),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().percentileChanges(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(40,S2,3,6,"app-location-select-with-search",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(41,w2,6,1,"div",10),e.\u0275\u0275elementStart(42,"div",11)(43,"div",12),e.\u0275\u0275element(44,"ngx-chartjs",13,14),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(46,E2,2,2,"div",15),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(34),e.\u0275\u0275textInterpolate1(" ",!t.bgCalibrationService.missingReferenceData&&t.bgCalibrationService.referenceLocation?"Regional Backgroun
1d vs Reference":"Regional Background"," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("value",t.bgCalibrationService.percentile)("options",t.percentileOptions),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bgCalibrationService.bgChartDataGenerated),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bgCalibrationService.referenceLocationIncludedInBGLineCalculation&&t.bgCalibrationService.bgChartDataGenerated),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(10,T2,!t.bgCalibrationService.missingReferenceData&&t.bgCalibrationService.referenceLocation)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?300:500)("data",t.bgCalibrationService.bgChartData)("options",t.bgCalibrationService.chartOptionsData),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.bgCalibrationService.missingReferenceData&&t.bgCalibrationService.referenceLocation)}}let P2=(()=>{class n{constructor(t,i){this.calibrationToolService=t,this.bgCalibrationService=i,this.isMobile=window.innerWidth<768,this.percentileOptions={floor:0,step:1,ceil:100,translate:a=>a+"%"},this.percentileChange$=new H.xQ,this.destroy$=new H.xQ}ngOnInit(){this.bgCalibrationService.referenceLocationDatasetSubject$.pipe((0,A.R)(this.destroy$),(0,Et.h)(Boolean)).subscribe(t=>{const i=this.chart.chartInstance.data.datasets.findIndex(a=>a.locationId===t.locationId);-1!==i?this.chart.chartInstance.data.datasets[i]=t:this.chart.chartInstance.data.datasets.push(t),this.chart.chartInstance.update()}),this.percentileChange$.pipe((0,A.R)(this.destroy$),(0,rt.b)(400)).subscribe(()=>{this.updatePercentile()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}percentileChanges(t){this.bgCalibrationService.percentile=t,this.percentileChange$.next(t)}updatePercentile(){this.bgCalibrationService.bgChartDataGenerated&&(this.bgCalibrationService.extractBackgroundLine(),this.calibrationToolService.chartDataGenerated&&this.bgCalibrationService.getBGLineVsReferenceData())}onReferenceLocationChange(t){var i;t&&t.id!==(null===(i=this.bgCalibrationService.referenceLocation)||void 0===i?void 0:i.id)&&(this.bgCalibrationService.referenceLocation=t,this.bgCalibrationService.checkReferenceLocationIncludedInBGLineCalculation(),this.bgCalibrationService.getBGLineVsReferenceData())}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject(Xn.F))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-bg-calibration-bg-extraction-chart"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(x2,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.chart=a.first)}},decls:5,vars:6,consts:[[4,"ngIf"],["class","dashboard-tile-inner",4,"ngIf"],[1,"dashboard-tile-inner"],[1,"spacer-bottom-md","spacer-top-md"],[1,"spacer-top-nil"],[1,"flex-start","gap-3","spacer-bottom-md","flex-align-end"],[1,"percentile-control-wrapper","flex","gap-1"],[1,"percentile-label","spacer-bottom-nil"],[3,"value","options","valueChange"],["class","spacer-right-lg bg-calibration-location-search-control","label","Reference Location",3,"disabled","allLocations","locationSelected",4,"ngIf"],["class","spacer-bottom-lg",4,"ngIf"],[1,"flex-space-between","gap-2","bg-charts-container-wrapper"],[1,"bg-chart-container",3,"ngClass"],["type","line",3,"height","data","options"],["bgChart",""],["class","bg-scatter-plot-container",4,"ngIf"],["label","Reference Location",1,"spacer-right-lg","bg-calibration-location-search-control",3,"disabled","allLocations","locationSelected"],[1,"spacer-bottom-lg"],[3,"isAccentWarning"],["warning",""],[1,"content"],[1,"bg-scatter-plot-container"],[1,"full-width",3,"isEmbedded","chartId"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,y2,1,0,"app-progress-bar",0),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275template(4,I2,47,12,"div",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,2,i.calibrationToolService.loading$)||e.\u0275\u0275pipeBind1(3,4,i.bgCalibrationService.loading$)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",i.bgCalibrationService.bgChartDataGenerated))},directives:[u.NgIf,ot.R,ze.ib,ze.yz,ze.yK,ut.w5,Yn.Z,je.R,u.NgClass,ce.oO,mt.d,ta.U],pipes:[u.AsyncPipe],styles:[".percentile-control-wrapper[_ngcontent-%COMP%]{width:300px}.percentile-label[_ngcontent-%COMP%]{font-size:13px}.bg-chart-container[_ngcontent-%COMP%]{width:100%}@media (min-width: 1200px){.bg-chart-container-s[_ngcontent-%COMP%]{width:calc(100% - 500px)}}.bg-calibration-location-search-control[_ngcontent-%COMP%]{margin-bottom:3px}@media (max-width: 1199px){.bg-charts-container-wrapper[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start!important}}.bg-scatter-plot-container[_ngcontent-%COMP%]{width:400px}@media (max-width: 480px){.bg-scatter-plot-container[_ngcontent-%COMP%]{width:320px}
1.bg-chart-container[_ngcontent-%COMP%]{width:calc(100% - 10px)}}"]}),n})();var k2=d(10709),M2=d(50131);function A2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275element(1,"app-shared-calibration-config-controls",7),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("page",t.CalibrationPage.BG)}}function D2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"li"),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function O2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275text(1," Background line was calculated with incomplete data for some time points. For these time points, the percentile was calculated using only available readings, ignoring missing values. Locations with incomplete data are: "),e.\u0275\u0275elementStart(2,"ul"),e.\u0275\u0275template(3,D2,2,1,"li",10),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",t.bgCalibrationService.incompleteDataLocations)}}function L2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",8)(1,"app-warning-message",2),e.\u0275\u0275elementContainerStart(2,3),e.\u0275\u0275elementStart(3,"div",4)(4,"p"),e.\u0275\u0275text(5," Please note that some of your sensor have incomplete data "),e.\u0275\u0275elementStart(6,"app-rotate-icon-button",9),e.\u0275\u0275listener("publicMoreOptionsExpandedChanged",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);return a.incompleteDataWarningExpanded=!a.incompleteDataWarningExpanded}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(7,O2,4,1,"div",0),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(5),e.\u0275\u0275property("buttonColor","none")("publicMoreOptionsExpanded",t.incompleteDataWarningExpanded),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.incompleteDataWarningExpanded)}}function F2(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",14)(1,"button",15),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275text(4," Apply Background Calibration to All Locations "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"button",16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).exportCalibrationParametersCsv()}),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275pipe(7,"async"),e.\u0275\u0275text(8," Download Calibration Parameters CSV "),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext(5);e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(2,2,t.bgCalibrationService.loading$)||e.\u0275\u0275pipeBind1(3,4,t.calibrationToolService.loading$)),e.\u0275\u0275advance(4),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(6,6,t.bgCalibrationService.loading$)||e.\u0275\u0275pipeBind1(7,8,t.calibrationToolService.loading$))}}function R2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275element(1,"app-calibration-comparison",12),e.\u0275\u0275template(2,F2,9,10,"div",13),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",null==t.bgCalibrationService.dataLocationsFilteredEmptyAndFailed||null==t.bgCalibrationService.dataLocationsFilteredEmptyAndFailed.locations?null:t.bgCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.length)}}function N2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",5),e.\u0275\u0275template(1,R2,3,1,"ng-container",0),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.calibrationToolService.inverseCorrelationErrorDetected)}}function V2(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",8)(1,"app-warning-message",2),e.\u0275\u0275elementContainerStart(2,3),e.\u0275\u0275elementStart(3,"div",4)(4,"p"),e.\u0275\u0275text(5," No data provided for the selected reference location. Please consider changing selecting a different location. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}function H2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,N2,2,1,"div",11),e.\u0275\u0275template(2,V2,6,1,"div",6),e.\u0275\u0275element(3,"app-inverse-correlation-warning",5),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.calibrationToolService.chartDataGenerated&&!t.bgCalibrationService.missingReferenceData&&t.bgCalibrationService.backgroundDataFilteredLocations.locations.length>1),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bgCalibrationService.missingReferenceData)}}function j2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"section")(1,"div",1)(2,"app-warning-message",2),e.\u0275\u0275elementContainerStart(3,3),e.\u0275\u0275elementStart(4,"div",4)(5,"p"),e.\u0275\u0275text(6,"Backgroun
1d Calibration Tool Implementation is in progress."),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(7,"app-shared-calibration-config-controls",5)(8,"app-bg-calibration-reproducibility-check",5),e.\u0275\u0275template(9,A2,2,1,"ng-container",0),e.\u0275\u0275element(10,"app-bg-calibration-bg-extraction-chart",5),e.\u0275\u0275template(11,L2,8,4,"div",6),e.\u0275\u0275template(12,H2,4,2,"ng-container",0),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("isAccentWarning",!0),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngIf",t.bgCalibrationService.isBGLineSectionShown),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.bgCalibrationService.incompleteDataLocations.length&&t.bgCalibrationService.bgChartDataGenerated),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.bgCalibrationService.bgChartDataGenerated)}}let B2=(()=>{class n{constructor(t,i,a,r,l,f){this.placesService=t,this.calibrationToolService=i,this.messageService=a,this.dataService=r,this.bgCalibrationService=l,this.csvService=f,this.destroy$=new H.xQ,this.incompleteDataWarningExpanded=!1,this.CalibrationPage=Me}ngOnInit(){this.messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(t=>{"place_changed"===t&&this.calibrationToolService.resetData()}
1),this.dataService.currentScreen="Background Calibration",this.calibrationToolService.setEmbeddedViewMode(Ji.i5.bg_calibration),this.subscribeToBgLineDataCalculated()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.calibrationToolService.resetData(),this.bgCalibrationService.resetData()}exportCalibrationParametersCsv(){const i=this.bgCalibrationService.backgroundDataFilteredLocations.locations.map(r=>{var l,f;return{location_id:r.id,bg_scaling_factor_via_raw:null===(l=this.bgCalibrationService.bgCombinedReproducibilityCalibrationParamsViaPM25Raw[r.id])||void 0===l?void 0:l.scalingFactor,bg_intercept_via_raw:null===(f=this.bgCalibrationService.bgCombinedReproducibilityCalibrationParamsViaPM25Raw[r.id])||void 0===f?void 0:f.intercept}}),a=this.csvService.jsonToCsv(i,["location_id","bg_scaling_factor_via_raw","bg_intercept_via_raw"]);this.csvService.downloadCsv(a,"bg_calibration_params.csv")}subscribeToBgLineDataCalculated(){this.bgCalibrationService.bgLineDataCalculated$.pipe((0,A.R)(this.destroy$)).subscribe(()=>{this.bgCalibrationService.referenceLocation&&this.bgCalibrationService.getBGLineVsReferenceData()})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(yt.q),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Xn.F),e.\u0275\u0275directiveInject(ia.M))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-bg-calibration"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"bg-calibration-dashboard-layout","full-width"],[3,"isAccentWarning"],["warning",""],[1,"content"],[1,"full-width"],["class","full-width dashboard-tile-inner",4,"ngIf"],[1,"full-width",3,"page"],[1,"full-width","dashboard-tile-inner"],[1,"spacer-left-xs",3,"buttonColor","publicMoreOptionsExpanded","publicMoreOptionsExpandedChanged"],[4,"ngFor","ngForOf"],["class","full-width",4,"ngIf"],["section","corrected",1,"full-width"],["class","flex-start gap-3",4,"ngIf"],[1,"flex-start","gap-3"],["mat-button","","type","button",1,"button-primary",3,"disabled"],["mat-button","","type","button",1,"button-secondary",3,"disabled","click"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,j2,13,4,"section",0),2&t&&e.\u0275\u0275property("ngIf",null==i.placesService.currentPlace?null:i.placesService.currentPlace.id)},directives:[u.NgIf,je.R,oa,P2,k2.I,u.NgForOf,M2.M,z.lW,na],pipes:[u.AsyncPipe],styles:[".bg-calibration-dashboard-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px}@media (max-width: 768px){.bg-calibration-dashboard-layout[_ngcontent-%COMP%]{gap:5px;padding:5px 0}}"]}),n})();var St=d(3424),ra=d(40542);function G2(n,o){1&n&&(e.\u0275\u0275elementStart(0,"p"),e.\u0275\u0275text(1," Good agreement between entire sensor network detected. No faulty sensors identified. "),e.\u0275\u0275elementEnd())}function z2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"li"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function $2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title"),e.\u0275\u0275text(3," Locations with Poor Correlation Are Not Included in the Further Analysis "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"ul"),e.\u0275\u0275template(5,z2,3,1,"ng-container",4),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",t.networkCalibrationService.networkCalibrationFailedLocations)}}const U2=function(n){return{height:n}};function W2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div")(1,"div",1),e.\u0275\u0275element(2,"ngx-chartjs",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275template(4,G2,2,0,"p",0),e.\u0275\u0275template(5,$2,6,1,"mat-expansion-panel",0),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(7,U2,t.isMobile?300:500)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?300:500)("data",t.networkCalibrationService.filteredOutliersChartData)("options",t.networkCalibrationService.chartOptionsData),e.\u0275\u0275advance(1),e.\u0275\u0275property("@.disabled",t.disableAnimation),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!(null!=t.networkCalibrationService.networkCalibrationFailedLocations&&t.networkCalibrationService.networkCalibrationFailedLocations.length)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.networkCalibrationService.networkCalibrationFailedLocations?null:t.networkCalibrationService.networkCalibrationFailedLocations.length)}}let Q2=(()=>{class n{constructor(t){this.networkCalibrationService=t,this.isMobile=window.innerWidth<768,this.disableAnimation=!0}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-filtered-locations"]],decls:1,vars:1,consts:[[4,"ngIf"],[3,"ngStyle"],["type","line",3,"height","data","options"],[1,"spacer-top-md"],[4,"ngFor","ngForOf"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,W2,6,9,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.networkCalibrationService.filteredOutliersChartDataGenerated)},directives:[u.NgIf,u.NgStyle,ce.Zl,mt.d,ze.ib,ze.yz,ze.yK,u.NgForOf],styles:[""]}),n})();const q2=function(n,o){return{"background-color":n,"border-color":o}};function K2(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",3),e.\u0275\u0275text(2," * "),e.\u0275\u0275element(3,"span",4),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction2(2,q2,t.color,"transparent"!==t.color?t.color:"#7c7c7c")),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.label)}}function Y2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",1),e.\u0275\u0275template(1,K2,6,5,"ng-container",2),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.legendItems)}}let la=(()=>{class n{constructor(){this.legendItems=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-chart-legend"]],inputs:{legendItems:"legendItems"},decls:1,vars:1,consts:[["class","legend-wrapper",4,"ngIf"],[1,"legend-wrapper"],[4,"ngFor","ngForOf"],[1,"legend-item"],[1,"legend-marker",3,"ngStyle"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Y2,2,1,"div",0),2&t&&e.\u0275\u0275property("ngIf",null==i.legendItems?null:i.legendItems.length)},directives:[u.NgIf,u.NgForOf,u.NgStyle],styles:[".legend-wrapper[_ngcontent-%COMP%]{font-size:14px;gap:5px;
1display:flex;align-items:center;flex-wrap:wrap}.legend-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.legend-marker[_ngcontent-%COMP%]{width:30px;height:10px;margin:0 3px 2px 0;border:1px solid}"]}),n})();const X2=function(n){return{height:n}};function Z2(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",1),e.\u0275\u0275element(1,"app-progress-bar",2),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275element(4,"ngx-chartjs",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(5,"app-chart-legend",5),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("show",e.\u0275\u0275pipeBind1(2,6,t.networkCalibrationService.loading$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(8,X2,t.isMobile?400:500)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?400:500)("data",t.networkCalibrationService.configChartData)("options",t.networkCalibrationService.chartOptionsData),e.\u0275\u0275advance(1),e.\u0275\u0275property("legendItems",t.legendItems)}}let J2=(()=>{class n{constructor(t){this.networkCalibrationService=t,this.isMobile=window.innerWidth<768,this.legendItems=[{color:"transparent",label:"No data"}]}ngOnInit(){}ngOnDestroy(){this.networkCalibrationService.resetData()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-config-chart"]],decls:1,vars:1,consts:[["class","spacer-bottom-sm spacer-top-lg",4,"ngIf"],[1,"spacer-bottom-sm","spacer-top-lg"],[3,"show"],[3,"ngStyle"],["type","line",3,"height","data","options"],[3,"legendItems"]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Z2,6,10,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.networkCalibrationService.configChartDataGenerated)},directives:[u.NgIf,ot.R,u.NgStyle,ce.Zl,mt.d,la],pipes:[u.AsyncPipe],encapsulation:2}),n})();var ex=d(40943);function tx(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",11),e.\u0275\u0275text(1," Location "),e.\u0275\u0275elementEnd())}function nx(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-icon",15),e.\u0275\u0275text(1,"warning"),e.\u0275\u0275elementEnd())}function ix(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",12),e.\u0275\u0275template(1,nx,2,0,"mat-icon",13),e.\u0275\u0275elementStart(2,"span",14),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.average<i.threshold),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.locationName)}}function ax(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"th",19),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("title",t.name),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function ox(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",20)(1,"div",21),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(),a=i.$implicit,r=i.index,l=e.\u0275\u0275nextContext();e.\u0275\u0275classProp("diagonal-cell",t.locationId===a.locationId)("failed-correlation",l.getCellDisplayValue(t,r)<l.threshold),e.\u0275\u0275property("title",l.getCellTooltip(t,a,r)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",l.getCellDisplayValue(t,r)," ")}}function rx(n,o){1&n&&(e.\u0275\u0275elementContainerStart(0,16),e.\u0275\u0275template(1,ax,2,2,"th",17),e.\u0275\u0275template(2,ox,3,6,"td",18),e.\u0275\u0275elementContainerEnd()),2&n&&e.\u0275\u0275property("matColumnDef",o.$implicit.id)}function lx(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",22),e.\u0275\u0275text(1," Average "),e.\u0275\u0275elementEnd())}function sx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",23)(1,"div",24)(2,"b",25),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext();e.\u0275\u0275classProp("failed-correlation",t.average<i.threshold),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(null==t.average?null:t.average.toFixed(2))}}function cx(n,o){1&n&&e.\u0275\u0275element(0,"tr",26)}function px(n,o){1&n&&e.\u0275\u0275element(0,"tr",27)}let mx=(()=>{class n{constructor(){this.ChipType=mn.x,this.dataSource=new h.by,this.displayedColumns=[],this.matrixColumns=[]}ngOnChanges(){this.matrix&&this.locations&&this.averages&&this.updateMatrixData()}updateMatrixData(){const t=this.matrix,i=this.locations,a=this.averages;this.matrixColumns=i.map((l,f)=>({id:`matrix_${f}`,name:l.name,locationId:l.id})),this.displayedColumns=["locationName",...this.matrixColumns.map(l=>l.id),this.averages?"average":void 0];const r=i.map((l,f)=>({locationName:l.name,locationId:l.id,data:this.getRowData(t,f,i.length),average:a[l.id]||0,isAboveThreshold:this.averages?(a[l.id]||0)>=.5:void 0}));this.dataSource.data=r}getRowData(t,i,a){const r=[];for(let l=0;l<a;l++)r.push(i===l?1:l>i?t[i][l]:t[l][i]);return r}getCellDisplayValue(t,i){const a=t.data[i];return null===a?"-":a.toFixed(2)}getCellTooltip(t,i,a){const r=t.data[a];return null===r?"No correlation data":t.locationId===i.locationId?`${t.locationName} vs ${i.name}: Same location (1.00)`:`${t.locationName} vs ${i.name}: ${this.metricsName} = ${r.toFixed(2)}`}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-calibration-metrics-matrix"]],inputs:{metricsName:"metricsName",matrix:"matrix",locations:"locations",averages:"averages",threshold:"threshold"},features:[e.\u0275\u0275NgOnChangesFeature],decls:11,vars:5,consts:[[1,"ag-table-wrapper"],["mat-table","",1,"matrix-table",3,"dataSource"],["matColumnDef","locationName","sticky",""],["mat-header-cell","","class","location-header",4,"matHeaderCellDef"],["mat-cell","","class","location-cell",4,"matCellDef"],[3,"matColumnDef",4,"ngFor","ngForOf"],["matColumnDef","average","sticky",""],["mat-header-cell","","class","average-header matrix-header",4,"matHeaderCellDef"],["mat-cell","","class","average-cell",3,"failed-correlation",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","",1,"location-header"],["mat-cell","",1,"location-cell"],["style","cursor: auto;","class","spacer-right-xxs danger-text inline-icon",4,"ngIf"],[1,"location-name-vertical"],[1,"spacer-right-xxs","danger-text","inline-icon",2,"cursor","auto"],[3,"matColumnDef"],["mat-header-cell","","class","matrix-header",3,"title",4,"matHeaderCellDef"],["mat-cell","","class","matrix-cell",3,"diagonal-cell","failed-correlation","title",4,"matCellDef"],["mat-header-cell","",1,"matrix-header",3,"title"],["mat-cell","",1,"matrix-cell",3,"title"],[1,"cell-content"],["mat-header-cell","",1,"average-header","matrix-header"],["mat-cell","",1,"average-cell"],[1,"average-content"],[1,"average-value"],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"table",1),e.\u0275\u0275elementContainerStart(2,2),e.\u0275\u0275template(3,tx,2,0,"th",3),e.\u0275\u0275template(4,ix,4,2,"td",4),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(5,rx,3,1,"ng-container",5),e.\u0275\u0275elementContainerStart(6,6),e.\u0275\u0275template(7,lx,2,0,"th",7),e.\u0275\u0275template(8,sx,4,3,"td",8),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(9,cx,1,0,"tr",9),e.\u0275\u0275template(10,px,1,0,"tr",10),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("dataSource",i.dataSource),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngForOf",i.matrixColumns),e.\u0275\u0275advance(4),e.\u0275\u0275property("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",i.displayedColumns))},directives:[h.BZ,h.w1,h.fO,h.ge,h.Dz,h.ev,u.NgIf,Q.Hw,u.NgForOf,h.as,h.XQ,h.nj,h.Gk],styles:[".mat-header-cell[_ngcontent-%COMP%]{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-cell[_ngcontent-%COMP%]{color:var(--primaryColor500)}.location-name-vertical[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;display:inline-block}
1.mat-column-locationName[_ngcontent-%COMP%]{color:var(--primaryColor500);font-weight:600}.matrix-header[_ngcontent-%COMP%]{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);white-space:nowrap;max-height:150px;padding:5px!important;border-top:1px solid rgba(0,0,0,.12);border-bottom:none;min-width:48px;box-sizing:border-box}.mat-cell[_ngcontent-%COMP%]:first-of-type{padding-left:5px!important}.average-cell[_ngcontent-%COMP%]{padding:5px!important}.average-cell[_ngcontent-%COMP%], .average-header[_ngcontent-%COMP%]{background-color:#ecf7fd}.diagonal-cell[_ngcontent-%COMP%]{background-color:#d4d2d2;color:var(--main-text-color)}.failed-correlation[_ngcontent-%COMP%]{color:#f13c3c}.cell-content[_ngcontent-%COMP%], .average-content[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}"]}),n})();const dx=["networkCalibrationLowCorrelationDialog"];function ux(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",3)(1,"span",4)(2,"span",5),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" Detected R\xb2 Threshold: ",t.networkCalibrationService.r2ThresholdDisplayed," ")}}function _x(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",16)(1,"app-warning-message",17),e.\u0275\u0275elementContainerStart(2,18),e.\u0275\u0275elementStart(3,"div",19)(4,"p"),e.\u0275\u0275text(5," Unable to proceed with network calibration since there are less than 3 passing locations. Please add more locations to the analysis or change the configuration. "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("isAccentWarning",!0))}const fx=function(n){return{height:n}};function hx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",11)(1,"div",12),e.\u0275\u0275element(2,"ngx-chartjs",13),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"app-chart-legend",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(4,_x,6,1,"div",15)),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(6,fx,t.isMobile?300:400)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?300:400)("data",t.networkCalibrationService.networkCalibrationChartData)("options",t.networkCalibrationService.chartOptionsData),e.\u0275\u0275advance(1),e.\u0275\u0275property("legendItems",t.legendItems),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.networkCalibrationService.dataLocationsFilteredEmptyAndFailed||null==t.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations?null:t.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.length)<3)}}function gx(n,o){if(1&n&&e.\u0275\u0275element(0,"app-calibration-metrics-matrix",20),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("matrix",t.networkCalibrationService.rSquaredMatrix)("metricsName","R\xb2")("threshold",t.networkCalibrationService.r2Threshold)("locations",null==t.networkCalibrationService.dataLocationsFilteredEmpty?null:t.networkCalibrationService.dataLocationsFilteredEmpty.locations)("averages",t.networkCalibrationService.rSquaredAverages)}}function vx(n,o){1&n&&(e.\u0275\u0275elementStart(0,"mat-tab-group",6,7)(2,"mat-tab",8),e.\u0275\u0275template(3,hx,5,8,"ng-template",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-tab",10),e.\u0275\u0275template(5,gx,1,5,"ng-template",9),e.\u0275\u0275elementEnd()())}function Cx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-general-dialog-layout",21),e.\u0275\u0275listener("submitting",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleReset()})("cancel",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleLowCorrelationDialogClose()}),e.\u0275\u0275elementStart(1,"div")(2,"p"),e.\u0275\u0275text(3," No agreement between the sensors in your network found. Please check whether the selected monitors were placed besides each other during the time frame that you selected. Proceeding with this data set will likely not improve the reproducibility of your network. If you need to continue with the selected data set, please "),e.\u0275\u0275elementStart(4,"a",22),e.\u0275\u0275text(5," contact us "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(6," . "),e.\u0275\u0275elementEnd()()()}2&n&&e.\u0275\u0275property("title","Network Calibration Low Correlation Detected")("isCancelButtonHidden",!0)}let bx=(()=>{class n{constructor(t,i){this.networkCalibrationService=t,this.dialog=i,this.resetData=new e.EventEmitter,this.legendItems=[{color:"var(--primaryColor500)",label:"Passing"},{color:"rgb(241, 60, 60)",label:"Failed"}],this.isMobile=window.innerWidth<768,this.strictR2ThresholdCheck=!1,this.lowCorrelationDialogRef=null,this.destroy$=new H.xQ}ngOnInit(){this.networkCalibrationService.r2LowCorrelationDetected$.pipe((0,A.R)(this.destroy$),(0,ex.g)(800)).subscribe(t=>{t&&this.handleLowCorrelationDetected()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleLowCorrelationDialogClose(){var t;null===(t=this.lowCorrelationDialogRef)||void 0===t||t.close(),this.lowCorrelationDialogRef=null}handleLowCorrelationDetected(){this.lowCorrelationDialogRef=this.dialog.open(this.networkCalibrationLowCorrelationDialog,{width:"500px"})}handleReset(){var t;this.resetData.emit(),null===(t=this.lowCorrelationDialogRef)||void 0===t||t.close(),this.lowCorrelationDialogRef=null}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z),e.\u0275\u0275directiveInject(F.uw))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-correlation-check"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(dx,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.networkCalibrationLowCorrelationDialog=a.first)}},outputs:{resetData:"resetData"},decls:5,vars:2,consts:[["class","spacer-bottom-md",4,"ngIf"],["class","tabs-light",4,"ngIf"],["networkCalibrationLowCorrelationDialog",""],[1,"spacer-bottom-md"],[1,"spacer-left-md"],[1,"text-muted"],[1,"tabs-light"],["tabGroup",""],["label","Chart"],["matTabContent",""],["label","R\xb2 Matrix"],[1,"spacer-top-md","
1network-calibration-chart-container-wrapper"],[1,"network-calibration-chart-container",3,"ngStyle"],["type","line",3,"height","data","options"],[3,"legendItems"],["class","spacer-top-md full-width",4,"ngIf"],[1,"spacer-top-md","full-width"],[3,"isAccentWarning"],["warning",""],[1,"content"],[3,"matrix","metricsName","threshold","locations","averages"],["submitText","Reset",3,"title","isCancelButtonHidden","submitting","cancel"],["target","_blank","href","https://www.airgradient.com/support/",1,"accent-link"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,ux,4,1,"div",0),e.\u0275\u0275template(2,vx,6,0,"mat-tab-group",1),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,Cx,7,2,"ng-template",null,2,e.\u0275\u0275templateRefExtractor)),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.networkCalibrationService.r2ThresholdDisplayed),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.networkCalibrationService.chartDataGenerated))},directives:[u.NgIf,se.SP,se.uX,se.Vc,u.NgStyle,ce.Zl,mt.d,la,je.R,mx,ve.b],styles:[".network-calibration-chart-container[_ngcontent-%COMP%]{width:100%}.network-calibration-chart-container-wrapper[_ngcontent-%COMP%]{height:430px;@media (max-width: 768px){height:350px}}.mat-tab-body[_ngcontent-%COMP%]{height:500px;max-height:500px}"]}),n})();var sa=d(44754);const xx=["manualReferenceChart"],yx=function(n){return{height:n}};function Sx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div")(1,"div",1)(2,"div",2)(3,"app-location-select-with-search",3),e.\u0275\u0275listener("locationSelected",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().onManualReferenceLocationChange(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",4),e.\u0275\u0275element(5,"ngx-chartjs",5,6),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("allLocations",t.getAvailableReferenceLocations())("selectedLocation",t.getSelectedReferenceLocation()),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(6,yx,t.isMobile?300:500)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?300:500)("data",t.networkCalibrationService.referenceSelectionChartData)("options",t.networkCalibrationService.chartOptionsData)}}let wx=(()=>{class n{constructor(t){this.networkCalibrationService=t,this.defaultBorderWidth=1.5,this.referenceBorderWidth=3,this.isMobile=window.innerWidth<768,this.isAutomaticReferenceLocationSelected=!1,this.selectedReferenceLocation=null,this.automaticReferenceLocationOption={id:-1,name:"Automatic Detection"},this.destroy$=new H.xQ}ngAfterViewInit(){setTimeout(()=>{this.syncInitialReferenceSelection()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onManualReferenceLocationChange(t){this.selectedReferenceLocation=t,this.isAutomaticReferenceLocationSelected=!1,this.networkCalibrationService.networkCalibrationLocalReference=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.find(i=>i.id===t.id),this.updateChartData(t.id)}updateChartData(t){var i,a,r,l,f,w;t&&([null===(i=this.networkCalibrationService.referenceSelectionChartData)||void 0===i?void 0:i.datasets,null===(l=null===(r=null===(a=this.manualReferenceChart)||void 0===a?void 0:a.chartInstance)||void 0===r?void 0:r.data)||void 0===l?void 0:l.datasets].forEach(B=>{null==B||B.forEach(j=>{const q=j.locationId===t,J=this.getLocationNameById(j.locationId);j.backgroundColor=q?sa.U.reference:sa.U.target,j.borderColor=j.backgroundColor,j.borderWidth=q?this.referenceBorderWidth:this.defaultBorderWidth,j.order=q?1:2,j.label=q?`${J} (Ref)`:J})}),null===(w=null===(f=this.manualReferenceChart)||void 0===f?void 0:f.chartInstance)||void 0===w||w.update())}getSelectedReferenceLocation(){var t;const i=this.getAvailableReferenceLocations(),a=null===(t=this.networkCalibrationService.networkCalibrationLocalReference)||void 0===t?void 0:t.id;return a&&(this.selectedReferenceLocation=i.find(r=>r.id===a)||null),this.selectedReferenceLocation||(this.selectedReferenceLocation=i[0]||null),this.selectedReferenceLocation}getAvailableReferenceLocations(){var t,i;return(null===(i=null===(t=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed)||void 0===t?void 0:t.locations)||void 0===i?void 0:i.map(a=>this.networkCalibrationService.allLocations.find(r=>
1r.id===a.id)).filter(Boolean))||[]}syncInitialReferenceSelection(){const t=this.getSelectedReferenceLocation();!t||(this.networkCalibrationService.networkCalibrationLocalReference=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.find(i=>i.id===t.id)||null,this.updateChartData(t.id))}getLocationNameById(t){var i;return(null===(i=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.find(a=>a.id===t))||void 0===i?void 0:i.name)||""}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-reference-selection"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(xx,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.manualReferenceChart=a.first)}},decls:1,vars:1,consts:[[4,"ngIf"],[1,"spacer-top-md"],[1,"spacer-bottom-md","flex-start","flex-wrap"],["label","Selected Reference Location",1,"spacer-right-lg","bg-calibration-location-search-control",3,"allLocations","selectedLocation","locationSelected"],[3,"ngStyle"],["type","line",3,"height","data","options"],["manualReferenceChart",""]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Sx,7,8,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.networkCalibrationService.referenceSelectionChartDataGenerated)},directives:[u.NgIf,Yn.Z,u.NgStyle,ce.Zl,mt.d],styles:[""]}),n})();const Ex=function(n){return{height:n}};function Tx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",7),e.\u0275\u0275element(1,"ngx-chartjs",8),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(4,Ex,t.isMobile?300:500)),e.\u0275\u0275advance(1),e.\u0275\u0275property("height",t.isMobile?300:500)("data",t.networkCalibrationService.calibratedChartData)("options",t.networkCalibrationService.chartOptionsData)}}function Ix(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Location Name "),e.\u0275\u0275elementEnd())}function Px(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",19),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.locationName)}}function kx(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Scaling Factor "),e.\u0275\u0275elementEnd())}function Mx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",19),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.scalingFactor,"1.0-4")," ")}}function Ax(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",18),e.\u0275\u0275text(1," Offset "),e.\u0275\u0275elementEnd())}function Dx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",19),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind2(2,1,t.offset,"1.0-4")," ")}}function Ox(n,o){1&n&&e.\u0275\u0275element(0,"tr",20)}function Lx(n,o){1&n&&e.\u0275\u0275element(0,"tr",21)}function Fx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",9)(1,"table",10),e.\u0275\u0275elementContainerStart(2,11),e.\u0275\u0275template(3,Ix,2,0,"th",12),e.\u0275\u0275template(4,Px,2,1,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(5,14),e.\u0275\u0275template(6,kx,2,0,"th",12),e.\u0275\u0275template(7,Mx,3,4,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(8,15),e.\u0275\u0275template(9,Ax,2,0,"th",12),e.\u0275\u0275template(10,Dx,3,4,"td",13),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(11,Ox,1,0,"tr",16),e.\u0275\u0275template(12,Lx,1,0,"tr",17),e.\u0275\u0275elementEnd()()),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(10),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function Rx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-tab-group",2,3),e.\u0275\u0275listener("selectedTabChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).onTabChange(a)}),e.\u0275\u0275elementStart(2,"mat-tab",4),e.\u0275\u0275template(3,Tx,2,6,"ng-template",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-tab",6),e.\u0275\u0275template(5,Fx,13,3,"ng-template",5),e.\u0275\u0275elementEnd()()}}function Nx(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div"),e.\u0275\u0275template(1,Rx,6,0,"mat-tab-group",1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.networkCalibrationService.chartDataGenerated)}}let Vx=(()=>{class n{constructor(t){this.networkCalibrationService=t,this.calibrationTableData=[],this.isMobile=window.innerWidth<768,this.displayedColumns=["locationName","scalingFactor","offset"],this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.dataSource=new h.by([])}ngOnChanges(t){var i,a;(null===(a=null===(i=t.calibrationTableData)||void 0===i?void 0:i.currentValue)||void 0===a?void 0:a.length)&&(this.dataSource.data=this.calibrationTableData)}onTabChange(t){1===t.index&&setTimeout(()=>{this.sort&&(this.dataSource.sort=this.sort)},100)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-alignment"]],viewQuery:function(t,i){if(1&t&&e.\u0275\u0275viewQuery(U.YE,5),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},inputs:{calibrationTableData:"calibrationTableData"},features:[e.\u0275\u0275NgOnChangesFeature],decls:1,vars:1,consts:[[4,"ngIf"],["class","tabs-light",3,"selectedTabChange",4,"ngIf"],[1,"tabs-light",3,"selectedTabChange"],["tabGroup",""],["label","Chart"],["matTabContent",""],["label","Calibration Parameters Table"],[1,"padding-top-lg",3,"ngStyle"],["type","line",3,"height","data","options"],[1,"ag-table-wrapper"],["mat-table","","matSort","",1,"ag-table-main","full-width",3,"dataSource"],["matColumnDef","locationName"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","scalingFactor"],["matColumnDef","offset"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(t,i){1&t&&e.\u0275\u0275template(0,Nx,2,1,"div",0),2&t&&e.\u0275\u0275property("ngIf",i.networkCalibrationService.calibratedChartDataGenerated)},directives:[u.NgIf,se.SP,se.uX,se.Vc,u.NgStyle,ce.Zl,mt.d,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,h.as,h.XQ,h.nj,h.Gk],pipes:[u.DecimalPipe],styles:[""]}),n})();function Hx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",6),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().reset.emit()}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275text(2," Reset "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(1,1,t.networkCalibrationService.loading$)||t.configFormBlank)}}function jx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",7),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().back.emit()}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275text(2," Back "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(1,1,t.networkCalibrationService.loading$))}}function Bx(n,o){1&n&&e.\u0275\u0275element(0,"mat-spinner",10)}function Gx(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",8),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().continue.emit()}),e.\u0275\u0275template(1,Bx,1,0,"mat-spinner",9),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("disabled",t.disabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,3,t.networkCalibrationService.loading$)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.label," ")}}const zx=["*"];let $x=(()=>{class n{constructor(t){this.networkCalibrationService=t,this.disabled=!1,this.label="Continue",this.reset_hidden=!1,this.back_hidden=!1,this.configFormBlank=!0,this.continue_hidden=!1,this.continue=new e.EventEmitter,this.reset=new e.EventEmitter,this.back=new e.EventEmitter}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(St.z))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration-stepper-control
1s"]],inputs:{disabled:"disabled",label:"label",reset_hidden:"reset_hidden",back_hidden:"back_hidden",configFormBlank:"configFormBlank",continue_hidden:"continue_hidden"},outputs:{continue:"continue",reset:"reset",back:"back"},ngContentSelectors:zx,decls:8,vars:3,consts:[[1,"stepper-controls-box","flex","flex-space-between","gap-3","flex-wrap"],["class","button-danger","mat-button","","type","button",3,"disabled","click",4,"ngIf"],["class","button-secondary","mat-button","","type","button",3,"disabled","click",4,"ngIf"],[1,"flex-end","flex-wrap","secondary-button-container"],["slot","secondary-button",1,"secondary-button-wrapper"],["class","button-primary","mat-button","","type","button",3,"disabled","click",4,"ngIf"],["mat-button","","type","button",1,"button-danger",3,"disabled","click"],["mat-button","","type","button",1,"button-secondary",3,"disabled","click"],["mat-button","","type","button",1,"button-primary",3,"disabled","click"],["class","continue-button-spinner","diameter","18","strokeWidth","2","aria-label","Loading data",4,"ngIf"],["diameter","18","strokeWidth","2","aria-label","Loading data",1,"continue-button-spinner"]],template:function(t,i){1&t&&(e.\u0275\u0275projectionDef(),e.\u0275\u0275elementStart(0,"div",0)(1,"div"),e.\u0275\u0275template(2,Hx,3,3,"button",1),e.\u0275\u0275template(3,jx,3,3,"button",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",3)(5,"div",4),e.\u0275\u0275projection(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,Gx,4,5,"button",5),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!i.reset_hidden),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.back_hidden),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!i.continue_hidden))},directives:[u.NgIf,z.lW,Bi.Ou],pipes:[u.AsyncPipe],styles:[".continue-button-spinner[_ngcontent-%COMP%]{display:inline-block;flex-shrink:0}[_nghost-%COMP%] .continue-button-spinner.mat-progress-spinner circle{stroke:currentColor}@media (max-width: 768px){.stepper-controls-box[_ngcontent-%COMP%]{margin-top:var(--sm-size);flex-direction:column-reverse;gap:var(--xs-size);align-items:flex-start}.secondary-button-container[_ngcontent-%COMP%]{justify-content:flex-start;flex-direction:column-reverse;align-items:flex-start;.secondary-button-wrapper {margin-top: var(--sm-size);}}}"],changeDetection:0}),n})();const Ux=["mainStepper"],Wx=["filteredLocationsComponent"],Qx=["networkCalibrationInfoDialog"],qx=["configControlsComponent"];function Kx(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(0)," ")}}function Yx(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(1)," ")}}function Xx(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(2)," ")}}function Zx(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(3)," ")}}function Jx(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(4)," ")}}function ey(n,o){if(1&n&&e.\u0275\u0275text(0),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275textInterpolate1(" ",t.getStepName(5)," ")}}function ty(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",26,27),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(2).networkCalibrationService.annotateFailedLocations()}),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275text(3," Annotate Locations with Poor Correlation "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(2,1,t.networkCalibrationService.loading$)||t.networkCalibrationService.lowCorrelationLocationsAnnotated)}}function ny(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"section"),e.\u0275\u0275element(1,"app-progress-bar",1),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementStart(3,"div",2)(4,"mat-horizontal-stepper",3,4),e.\u0275\u0275listener("selectionChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleStepperChange(a)}),e.\u0275\u0275elementStart(6,"mat-step",5),e.\u0275\u0275template(7,Kx,1,1,"ng-template",6),e.\u0275\u0275elementStart(8,"div",7)(9,"div",8),e.\u0275\u0275text(10," Accurate and consistent air quality measurements are essential for meaningful data analysis, especially when working with low-cost sensor networks. Even when sensors are co-located and measure the same air, small differences in factory calibration can lead to variations in their readings. "),e.\u0275\u0275element(11,"br"),e.\u0275\u0275text(12," This tool calculates correction parameters for every individual sensor to align their measurements and reduce inter-sensor differences. It can also help identify potentially malfunctioning sensors. To use the tool effectively, your sensor network should be co-located in the same place for at least a few days. "),e.\u0275\u0275element(13,"br"),e.\u0275\u0275text(14," When a local reference monitor is available, you can also use the tool to align the entire network to that standard, improving measurement accuracy and consistency with regulatory or research-grade data. "),e.\u0275\u0275element(15,"br"),e.\u0275\u0275text(16," The tool uses raw PM"),e.\u0275\u0275elementStart(17,"sub"),e.\u0275\u0275text(18,"2.5"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(19," data as the input for this calibration workflow. Existing corrected values are not used in the analysis. "),e.\u0275\u0275element(2
10,"br")(21,"br"),e.\u0275\u0275text(22," In the first step, select all the monitors you want to align. The preview helps you check that the right data are included. Make sure you choose time periods when all selected monitors were actually located in the same place. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"app-shared-calibration-config-controls",9,10),e.\u0275\u0275listener("configStateChanges",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleNetworkCalibrationConfigStateChanges(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(25,"app-network-calibration-config-chart"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(26,"mat-step",11),e.\u0275\u0275template(27,Yx,1,1,"ng-template",6),e.\u0275\u0275elementStart(28,"div",7)(29,"div",8),e.\u0275\u0275text(30," In this step, the system compares how similar the readings are between all monitors in the network. It calculates how well each monitor \u201cmatches\u201d the others and shows this as a matrix of correlation values (R\xb2). "),e.\u0275\u0275element(31,"br"),e.\u0275\u0275text(32," If a monitor\u2019s data looks very different from the rest, the system will flag it (its time line is shown in red instead of blue). This means the monitor may need maintenance (or is not part of the co-located monitor network). "),e.\u0275\u0275element(33,"br"),e.\u0275\u0275text(34," If all monitors show low similarity, the system will display a warning, as it means the network data may not be reliable enough for calibration. "),e.\u0275\u0275element(35,"br"),e.\u0275\u0275text(36," You can also add notes or comments about any flagged monitors here. To review or edit these notes later, please visit the "),e.\u0275\u0275elementStart(37,"a",12),e.\u0275\u0275text(38," Notes Page "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(39,". "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"app-network-calibration-correlation-check",13),e.\u0275\u0275listener("resetData",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleReset(!0)}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(41,"mat-step",14),e.\u0275\u0275template(42,Xx,1,1,"ng-template",6),e.\u0275\u0275elementStart(43,"div",7)(44,"div",8),e.\u0275\u0275text(45," In this step, the system temporarily removes the monitors that were flagged as low-correlation. This allows calculations to continue using only the high-quality monitors. "),e.\u0275\u0275element(46,"br"),e.\u0275\u0275text(47," The charts and tables update automatically to show results based on this filtered data. This helps you clearly see how the well-performing monitors behave together. "),e.\u0275\u0275element(48,"br"),e.\u0275\u0275text(49," The list of excluded monitors remains visible so you can easily track which ones may need maintenance, and check that enough monitors are still active for a reliable calibration. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(50,"app-network-calibration-filtered-locations",15,16),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(52,"mat-step",17),e.\u0275\u0275template(53,Zx,1,1,"ng-template",6),e.\u0275\u0275elementStart(54,"div",7)(55,"div",8),e.\u0275\u0275text(56," In this step, you can choose the reference monitor that will be used to calibrate the other monitors. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(57,"app-network-calibration-reference-selection",15),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(58,"mat-step",18),e.\u0275\u0275template(59,Jx,1,1,"ng-template",6),e.\u0275\u0275elementStart(60,"div",7)(61,"div",8),e.\u0275\u0275text(62," In this step, the system adjusts each monitor so that all readings match the same scale as the reference. This means all monitors now measure the same values, as they should when placed next to each other. "),e.\u0275\u0275element(63,"br"),e.\u0275\u0275text(64," It does this by finding a simple linear model (slope and offset) that best matches each monitor's data to the reference data. The chart below shows how the calibration improves the readings. "),e.\u0275\u0275element(65,"br"),e.\u0275\u0275text(66,' To apply the calibration, click on the "Apply Calibration" button. This will save the calibration settings to each monitor in the network. After the parameters are saved, the system will also generate a CSV file with a record of the parameters which will be available for download. From this point forward, all new readings will have the correction a
1pplied automatically and can be found as "PM2.5 (\u03bcg/m\xb3) corrected" in exported data. '),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(67,"app-network-calibration-alignment",19),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(68,"mat-step",20),e.\u0275\u0275template(69,ey,1,1,"ng-template",6),e.\u0275\u0275elementStart(70,"div",7)(71,"div",8),e.\u0275\u0275text(72,' The Network Calibration Tool has successfully completed the calibration process. Calibration values (scaling factors and offsets) have been applied individually to each monitor. From now on, all new readings will automatically include these corrections and appear as "PM2.5 (\u03bcg/m\xb3) corrected" in the exported data. '),e.\u0275\u0275element(73,"br"),e.\u0275\u0275text(74," You can also export the calibration parameters as a CSV file for additional review or analysis. "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(75,"div",21)(76,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportCalibrationParametersCsv()}),e.\u0275\u0275pipe(77,"async"),e.\u0275\u0275text(78," Export Calibration Parameters CSV "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(79,"a",23),e.\u0275\u0275text(80," Go to Dashboard"),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(81,"app-network-calibration-stepper-controls",24),e.\u0275\u0275listener("continue",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275reference(5);return e.\u0275\u0275nextContext().handleContinue(a.selectedIndex)})("reset",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleReset()})("back",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().handleBack()}),e.\u0275\u0275pipe(82,"async"),e.\u0275\u0275template(83,ty,4,3,"button",25),e.\u0275\u0275elementEnd()()()}if(2&n){const t=e.\u0275\u0275reference(5),i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("show",e.\u0275\u0275pipeBind1(2,15,i.networkCalibrationService.loading$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("@slowAppearing",void 0),e.\u0275\u0275advance(1),e.\u0275\u0275property("@.disabled",i.disableAnimation),e.\u0275\u0275advance(19),e.\u0275\u0275property("loading$",i.networkCalibrationService.loading$)("selectedLocationsColorsHash",i.networkCalibrationService.selectedLocationsColorsHash)("showChipColorMarkers",i.networkCalibrationService.configChartDataGenerated),e.\u0275\u0275advance(44),e.\u0275\u0275property("calibrationTableData",i.alignmentStepCalibrationTableData),e.\u0275\u0275advance(9),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(77,17,i.networkCalibrationService.loading$)),e.\u0275\u0275advance(5),e.\u0275\u0275property("disabled",e.\u0275\u0275pipeBind1(82,19,i.networkCalibrationService.loading$)||i.getNextStepButtonDisabled())("label",i.stepperControlsState.label)("configFormBlank",i.configFormBlank)("reset_hidden",i.stepperControlsState.reset_hidden)("back_hidden",i.stepperControlsState.back_hidden)("continue_hidden",i.stepperControlsState.continue_hidden),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",1===t.selectedIndex&&i.networkCalibrationService.chartDataGenerated&&(null==i.networkCalibrationService.networkCalibrationFailedLocations?null:i.networkCalibrationService.networkCalibrationFailedLocations.length))}}let iy=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M){this.placesService=t,this.dataService=i,this.networkCalibrationService=a,this.dialog=r,this.csvService=l,this.sensorServices=f,this.locationsServices=w,this.httpHelper=T,this.urlParamsPersistence=M,this.destroy$=new H.xQ,this.infoDialogRef=null,this.incompleteDataWarningExpanded=!1,this.configState=null,this.alignmentStepCalibrationTableData=[],this.currentStepIndex=0,this.disableAnimation=!0,this.configFormBlank=!0,this.configReset=!1,this.stepperControlsState={disabled:!0,label:"Continue Correlation Check",reset_hidden:!1,back_hidden:!0,continue_hidden:!1},this.isPortrait=jt.gr,this.CalibrationPage=Me,this.isInitializingFromUrl=!1}ngOnInit(){this.dataService.currentScreen="Network Calibration",this.networkCalibrationService.loading$.pipe((0,A.R)(this.destroy$)).subscribe(t=>
1{if(this.mainStepper){Array.from(this.mainStepper._elementRef.nativeElement.children[0].children).filter(a=>a.classList.contains("mat-step-header")).forEach(t?a=>{a.classList.add("disabled-step-loading")}:a=>{a.classList.remove("disabled-step-loading")})}}),this.networkCalibrationService.configLoadFailed$.pipe((0,A.R)(this.destroy$)).subscribe(()=>this.handleConfigLoadFailure()),this.initFromUrlParams()}ngAfterViewInit(){setTimeout(()=>this.disableAnimation=!1),this.disableStepsAfterInteracted()}handleConfigLoadFailure(){this.httpHelper.showSnackbar("Unable to load network calibration data. Please select a shorter co-location period and try again."),this.handleReset(!0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.networkCalibrationService.resetData()}getNextStepButtonDisabled(){var t,i;return this.stepperControlsState.disabled||1===this.currentStepIndex&&(null===(i=null===(t=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed)||void 0===t?void 0:t.locations)||void 0===i?void 0:i.length)<3||1===this.currentStepIndex&&this.networkCalibrationService.r2LowCorrelationDetected$.value}getStepName(t){switch(t){case 0:return"Configuration";case 1:return"Correlation Check";case 2:return"Filtering Outliers";case 3:return"Reference Selection";case 4:return"Calibration Factors Calculation";case 5:return"Summary";default:return""}}disableStepsAfterInteracted(){Array.from(this.mainStepper._elementRef.nativeElement.children[0].children).filter(i=>i.classList.contains("mat-step-header")).forEach((i,a)=>{a>this.currentStepIndex||5===this.currentStepIndex?i.classList.add("disabled-step"):i.classList.remove("disabled-step")})}setStepperControlsState(t,i=!1){switch(t){case 0:this.stepperControlsState.label="Continue to Correlation Check",this.stepperControlsState.reset_hidden=!1,this.stepperControlsState.back_hidden=!0,this.stepperControlsState.continue_hidden=!1,this.stepperControlsState.disabled=!i||!this.configState.valid;break;case 1:this.stepperControlsState.label="Continue to Filtering Outliers",this.stepperControlsState.reset_hidden=!0,this.stepperControlsState.back_hidden=!1,this.stepperControlsState.continue_hidden=!1,this.stepperControlsState.disabled=!1;break;case 2:this.stepperControlsState.label="Continue to Network Reference Selection",this.stepperControlsState.reset_hidden=!0,this.stepperControlsState.back_hidden=!1,this.stepperControlsState.continue_hidden=!1,this.stepperControlsState.disabled=!1;break;case 3:this.stepperControlsState.label="Calculate Calibration Factors",this.stepperControlsState.reset_hidden=!0,this.stepperControlsState.back_hidden=!1,this.stepperControlsState.continue_hidden=!1,this.stepperControlsState.disabled=!1;break;case 4:this.stepperControlsState.label="Apply Calibration",this.stepperControlsState.reset_hidden=!0,this.stepperControlsState.back_hidden=!1,this.stepperControlsState.continue_hidden=!1,this.stepperControlsState.disabled=!1;break;case 5:this.stepperControlsState.label="Summary",this.stepperControlsState.reset_hidden=!0,this.stepperControlsState.back_hidden=!0,this.stepperControlsState.continue_hidden=!0,this.stepperControlsState.disabled=!0}this.disableStepsAfterInteracted()}handleReset(t=!1){const i=()=>{this.configReset=!0,this.configControlsComponent.resetLocationsList(),this.configControlsComponent.resetConfigForm(),this.networkCalibrationService.resetData(),this.mainStepper.reset(),this.configFormBlank=!0,this.setStepperControlsState(0,!0)};t?i():this.dialog.open(he.$,{width:"350px",data:{yes:"Reset",no:"Cancel",data:"Are you sure you want to reset the network calibration? This will clear all the data and start over."}}).afterClosed().pipe((0,A.R)(this.destroy$)).subscribe(r=>{r&&i()})}handleNetworkCalibrationConfigStateChanges(t){t.locations.length||(this.networkCalibrationService.configChartData=null,this.networkCalibrationService.configChartDataGenerated=!1,this.networkCalibrationService.selectedLocationsColorsHash={},this.networkCalibrationService.noDataLocations=[]),this.configFormBlank=!t.locations.length&&!Object.values(t.formValue).some(i=>null!==i),this.configState=t,this.configReset=!1,this.generateConfigChart(),this.stepperControlsState.disabled=!t.valid,0===this.currentStepIndex&&this.syncToUrl()}generateConfigChart(){var t;this.configState.valid&&!this.configReset&&(this.networkCalibrationService.setInitialConfiguration(this.configState.locations,(null===(t=this.configState.formValue.measure)||void 0===t?void 0:t.value)||ne.ee.pm02,this.configState.formValue.networkCalibrationDateFrom,this.configState.formValue.networkCalibrationDateTo,this.configState.formValue.bucket),this.networkCalibrationService.generateNetworkCalibrationConfigLineChart())}handleInfoClose(){var t;null===(t=this.infoDialogRef)||void 0===t||t.close(),this.infoDialogRef=null}handleContinue(t){4===t?this.applyNetworkCalibration():this.handleCalibrationStepChange(t)}
1handleCalibrationStepChange(t,i=!1){var a,r,l,f;switch(t){case-1:this.generateConfigChart();break;case 0:this.networkCalibrationService.generateNetworkCalibrationLineChartForAllLocations();break;case 1:setTimeout(()=>{this.filteredLocationsComponent.disableAnimation=!1},1e3),this.networkCalibrationService.prepareLinearChartData(ra.J.FILTER_OUTLIERS);break;case 2:this.networkCalibrationService.networkCalibrationLocalReference=(null===(r=null===(a=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed)||void 0===a?void 0:a.locations)||void 0===r?void 0:r[0])||null,this.networkCalibrationService.prepareLinearChartData(ra.J.REFERENCE_SELECTION);break;case 3:this.networkCalibrationService.calculateCalibratedNetworkCalibrationLocationsData(),this.prepareAlignmentStepCalibrationTableData()}const w=(null===(f=null===(l=this.mainStepper)||void 0===l?void 0:l.steps)||void 0===f?void 0:f.length)>0?this.mainStepper.steps.length-1:5;!i&&this.mainStepper&&t<w&&this.mainStepper.next();const T=Math.min(t+1,w);this.setStepperControlsState(T,i
1)}prepareAlignmentStepCalibrationTableData(){const t=[];Object.keys(this.networkCalibrationService.networkCalibrationParamsViaPM25Raw).forEach(i=>{const a=this.networkCalibrationService.networkCalibrationParamsViaPM25Raw[i],r=this.networkCalibrationService.allLocations.find(l=>l.id.toString()===i);r&&a&&t.push({locationName:r.name||`Location ${i}`,scalingFactor:a.scalingFactor,offset:a.intercept})}),this.alignmentStepCalibrationTableData=t}handleBack(){this.mainStepper.selectedIndex=this.currentStepIndex-1,this.currentStepIndex=this.mainStepper.selectedIndex,this.networkCalibrationService.resetDataBasedOnStep(this.currentStepIndex),this.handleCalibrationStepChange(this.currentStepIndex-1,!0)}handleStepperChange(t){this.currentStepIndex=t.selectedIndex,this.currentStepIndex<t.previouslySelectedIndex&&(this.mainStepper.steps._results.forEach((i,a)=>{a>=this.currentStepIndex&&(i.interacted=!1)}),this.networkCalibrationService.resetDataBasedOnStep(this.currentStepIndex),this.handleCalibrationStepChange(this.currentStepIndex-1,!0))}applyNetworkCalibration(){let t=[];this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.forEach(i=>{var a,r;if(i.id!==this.networkCalibrationService.networkCalibrationLocalReference.id){const l=this.locationsServices.allLocations.find(f=>i.id===f.id);l&&t.push({locationId:i.id,sensorId:l.sensor_id,slrPmCorrectionConfig:{pm2_slr_scaling_factor:l.pm2_slr_scaling_factor,pm2_slr_use_epa_2021:!1,pm2_slr_intercept:l.pm2_slr_intercept,pm2_slr_via_pm25_raw_scaling_factor:null===(a=this.networkCalibrationService.networkCalibrationParamsViaPM25Raw[i.id])||void 0===a?void 0:a.scalingFactor,pm2_slr_via_pm25_raw_intercept:null===(r=this.networkCalibrationService.networkCalibrationParamsViaPM25Raw[i.id])||void 0===r?void 0:r.intercept},plantower_pm2_correction_algo:Dt.J7.custom_via_pm25_raw})}}),this.sensorServices.saveMultiplePM_SLRCorrectionConfigSequentially(this.placesService.currentPlace.id,t,!0,!0,()=>{this.handleCalibrationStepChange(4)})}exportCalibrationParametersCsv(){const i=this.networkCalibrationService.dataLocationsFilteredEmptyAndFailed.locations.filter(r=>r.id!==this.networkCalibrationService.networkCalibrationLocalReference.id).map(r=>{var l,f;return{location_id:r.id,network_calibration_scaling_factor_via_raw:null===(l=this.networkCalibrationService.networkCalibrationParamsViaPM25Raw[r.id])||void 0===l?void 0:l.scalingFactor,network_calibration_intercept_via_raw:null===(f=this.networkCalibrationService.networkCalibrationParamsViaPM25Raw[r.id])||void 0===f?void 0:f.intercept}}),a=this.csvService.jsonToCsv(i,["location_id","network_calibration_scaling_factor_via_raw","network_calibration_intercept_via_raw"]);this.csvService.downloadCsv(a,"network_calibration_calibration_params.csv")}initFromUrlParams(){this.urlParamsPersistence.initializeFromUrl(un.MV,t=>{this.isInitializingFromUrl=!0,this.populateFromUrlParams(t)})}populateFromUrlParams(t){this.locationsServices.allLocations$.pipe((0,Et.h)(i=>(null==i?void 0:i.length)>0),(0,Xe.q)(1)).subscribe(i=>{const a=this.locationsServices.filterOutPPSLocations(i,!0);setTimeout(()=>{var r,l,f;if(this.configControlsComponent){const w={};if(t.measure){const T=null===(r=this.configControlsComponent.measureOptions)||void 0===r?void 0:r.find(M=>M.value===t.measure);T&&(w.measure=T)}if(t.networkCalibrationDateFrom&&(w.networkCalibrationDateFrom=(0,Ft.x5)(t.networkCalibrationDateFrom)),t.networkCalibrationDateTo&&(w.networkCalibrationDateTo=(0,Ft.x5)(t.networkCalibrationDateTo)),t.bucket){const T=null===(l=this.configControlsComponent.availableBucketOptions)||void 0===l?void 0:l.find(M=>M.value===t.bucket);T&&(w.bucket=T)}if(this.configControlsComponent.configForm.patchValue(w),null===(f=t.locations)||void 0===f?void 0:f.length){const T=a.filter(M=>t.locations.includes(M.id));T.length&&this.configControlsComponent.locationsChipSelect&&(this.configControlsComponent.locationsChipSelect.setSelectedLocations(T),this.configControlsComponent.selectedLocationsList$.next(T))}}this.isInitializingFromUrl=!1},100)})}syncToUrl(){var t,i,a,r,l,f,w;if(this.isInitializingFromUrl||!this.configState)return;const T={};(null===(i=null===(t=this.configState.formValue)||void 0===t?void 0:t.measure)||void 0===i?void 0:i.value)&&(T.measure=this.configState.formValue.measure.value),(null===(a=this.configState.formValue)||void 0===a?void 0:a.networkCalibrationDateFrom)&&(T.networkCalibrationDateFrom=this.configState.formValue.networkCalibrationDateFrom),(null===(r=this.configState.formValue)||void 0===r?void 0:r.networkCalibrationDateTo)&&(T.networkCalibrationDateTo=this.configState.formValue.networkCalibrationDateTo),(null===(f=null===(l=this.configState.formValue)||void 0===l?void 0:l.bucket)||void 0===f?void 0:f.value)&&(T.bucket=this.configState.formValue.bucket.value),(null===(w=this.configState.locations)||void 0===w?void 0:w.length)&&(T.locations=this.configState.locations.map(M=>
1M.id)),this.urlParamsPersistence.writeParams(un.MV,T)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(St.z),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(ia.M),e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(ea.Q))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-network-calibration"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ux,5),e.\u0275\u0275viewQuery(Wx,5),e.\u0275\u0275viewQuery(Qx,5),e.\u0275\u0275viewQuery(qx,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.mainStepper=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.filteredLocationsComponent=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.networkCalibrationInfoDialog=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.configControlsComponent=a.first)}},features:[e.\u0275\u0275ProvidersFeature([{provide:Un.gx,useValue:{displayDefaultIndicatorType:!0}}])],decls:1,vars:1,consts:[[4,"ngIf"],[3,"show"],[1,"network-calibration-container"],["linear","",3,"selectionChange"],["mainStepper",""],["state","configuration"],["matStepLabel",""],[1,"main-stepper-content"],[1,"step-info-box"],[1,"full-width",3,"loading$","selectedLocationsColorsHash","showChipColorMarkers","configStateChanges"],["configControlsComponent",""],["state","faulty_sensors_identification"],["target","_blank","href","/dashboard/notes",1,"accent-link"],[1,"full-width",3,"resetData"],["state","filter_outliers"],[1,"full-width"],["filteredLocationsComponent",""],["state","reference_selection"],["state","sensor_alignment"],[1,"full-width",3,"calibrationTableData"],["state","summary"],[1,"full-width","flex-center","gap-2","flex-wrap"],["mat-button","","type","button",1,"button-secondary",3,"disabled","click"],["mat-button","","routerLink","/dashboard",1,"button-primary"],[3,"disabled","label","configFormBlank","reset_hidden","back_hidden","continue_hidden","continue","reset","back"],["secondary-button","","class","button-secondary spacer-right-sm","mat-button","","type","button",3,"disabled","click",4,"ngIf"],["secondary-button","","mat-button","","type","button",1,"button-secondary","spacer-right-sm",3,"disabled","click"],["deactivateFailedLocationsButton",""]],template:function(t,i){1&t&&e.\u0275\u0275template(0,ny,84,21,"section",0),2&t&&e.\u0275\u0275property("ngIf",null==i.placesService.currentPlace?null:i.placesService.currentPlace.id)},directives:[u.NgIf,ot.R,Ne.Vq,Ne.C0,Ne.VY,oa,J2,bx,Q2,wx,Vx,z.lW,z.zs,y.yS,$x],pipes:[u.AsyncPipe],styles:[".main-stepper-content[_ngcontent-%COMP%]{padding-top:var(--sm-size)}.network-calibration-container[_ngcontent-%COMP%]{display:flex;min-height:calc(100vh - 100px);flex-direction:column;justify-content:space-between;padding:0 var(--md-size) var(--md-size) var(--md-size);box-sizing:border-box}@media (max-width: 768px){[_nghost-%COMP%] .mat-horizontal-content-container{padding:0!important}}app-network-calibration-stepper-controls[_ngcontent-%COMP%]{width:100%}.step-info-box[_ngcontent-%COMP%]{margin-bottom:var(--lg-size)} .disabled-step, .disabled-step-loading{opacity:.7;pointer-events:none!important;filter:grayscale(1)}"],data:{animation:[_t.v]}}),n})();var ay=d(87047);function oy(n,o){1&n&&e.\u0275\u0275element(0,"mat-progress-bar",8)}function ry(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-table-filter-search",9),e.\u0275\u0275listener("applyFilter",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().applyFilter(a)})("clearFilter",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().clearFilter()}),e.\u0275\u0275elementEnd()}2&n&&e.\u0275\u0275property("keepSearchParameterInURL",!0)}function ly(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",10)(1,"p"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",11),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.helpService.openHelpDialog(a.HelpSection.monitor_uptime,"Monitor Uptime")}),e.\u0275\u0275text(4," Help "),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate2(" Online: ",t.totalOnline,"/",t.dataSource.data.length," ")}}function sy(n,o){1&n&&e.\u0275\u0275element(0,"app-no-data",12),2&n&&e.\u0275\u0275property("message","monitors")}function cy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Serial No."),e.\u0275\u0275elementEnd())}function py(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",33),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"slice"),e.\u0275\u0275element(3,"app-clipboard-copy",34),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.serialno.length>40?e.\u0275\u0275pipeBind3(2,2,t.serialno,0,40)+".. ":t.serialno," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("copyValue",t.serialno)}}function my(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Location"),e.\u0275\u0275elementEnd())}function dy(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",35)(1,"app-interactive-table-cell",36),e.\u0275\u0275listener("cellClick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).showSensorInfo(r)}),e.\u0275\u0275elementEnd()()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("isLocationName",!0)("value",t.location_name)}}function uy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Status"),e.\u0275\u0275elementEnd())}function _y(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",39),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("statusText","Online")("statusTooltipText","The monitor is online")("statusChipType",t.ChipType.success)("noMobileCollapsedVersion",!0)}}function fy(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",39),2&n){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("statusText","Offline")("statusTooltipText","The monitor is offline")("statusChipType",t.ChipType.error)("noMobileCollapsedVersion",!0)}}function hy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275template(1,_y,1,4,"app-chip-status",38),e.\u0275\u0275template(2,fy,1,4,"app-chip-status",38),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.offline),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.offline)}}function gy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Current Uptime Count"),e.\u0275\u0275elementEnd())}function vy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"number"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(2,1,t.current_boot_c
1ount,"1.0-2",i.browserLocaleService.globalLocale)," ")}}function Cy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"UID"),e.\u0275\u0275elementEnd())}function by(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.uid,"")}}function xy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Commissioning Date"),e.\u0275\u0275elementEnd())}function yy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,t.commissioning_date),"")}}function Sy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",40),e.\u0275\u0275text(1,"Daily Data (Last 30 days)"),e.\u0275\u0275elementEnd())}function wy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"div",44),e.\u0275\u0275element(1,"button",45),e.\u0275\u0275elementEnd()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275classProp("spinner",!0))}const Ey=function(){return{"background-color":"#4CAF50"}};function Ty(n,o){if(1&n&&(e.\u0275\u0275element(0,"div",47),e.\u0275\u0275pipe(1,"date")),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("matTooltip","Date: "+e.\u0275\u0275pipeBind2(1,2,t.date,"MMM d, YYY")+" - Online")("ngStyle",e.\u0275\u0275pureFunction0(5,Ey))}}const Iy=function(){return{"background-color":"#f2b74a"}};function Py(n,o){if(1&n&&(e.\u0275\u0275element(0,"div",47),e.\u0275\u0275pipe(1,"date")),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("matTooltip","Date: "+e.\u0275\u0275pipeBind2(1,2,t.date,"MMM d, YYY")+" - Partial downtime")("ngStyle",e.\u0275\u0275pureFunction0(5,Iy))}}const ky=function(){return{"background-color":"#E57373"}};function My(n,o){if(1&n&&(e.\u0275\u0275element(0,"div",47),e.\u0275\u0275pipe(1,"date")),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("matTooltip","Date: "+e.\u0275\u0275pipeBind2(1,2,t.date,"MMM d, YYY")+" - Offline")("ngStyle",e.\u0275\u0275pureFunction0(5,ky))}}function Ay(n,o){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Ty,2,6,"div",46),e.\u0275\u0275template(2,Py,2,6,"div",46),e.\u0275\u0275template(3,My,2,6,"div",46),e.\u0275\u0275elementContainerEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.missing&&t.buckets===t.max_buckets),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.missing&&t.buckets<t.max_buckets),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.missing)}}function Dy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37)(1,"div",41),e.\u0275\u0275template(2,wy,2,2,"div",42),e.\u0275\u0275template(3,Ay,4,3,"ng-container",43),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.loadingDowntimeStats),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.uptime)}}function Oy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"30 days Average"),e.\u0275\u0275elementEnd())}function Ly(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.thirty_day_average,"%")}}function Fy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"7 days Average"),e.\u0275\u0275elementEnd())}function Ry(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.seven_day_average,"%")}}function Ny(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Yesterday"),e.\u0275\u0275elementEnd())}function Vy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.yesterday,"%")}}function Hy(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",32),e.\u0275\u0275text(1,"Last Seen"),e.\u0275\u0275elementEnd())}function jy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",37),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"date"),e.\u0275\u0275pipe(3,"date"),e.\u0275\u0275pipe(4,"date"),e.\u0275\u0275pipe(5,"date"),e.\u0275\u0275pipe(6,"date"),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.currentTimeStamp-t.last_seen_timestamp<864e5?e.\u0275\u0275pipeBind2(2,1,t.last_seen,"HH:mm:ss"):e.\u0275\u0275pipeBind2(3,4,t.last_seen,"y")!==e.\u0275\u0275pipeBind2(4,7,i.currentTimeStamp,"y")?e.\u0275\u0275pipeBind2(5,10,t.last_seen,"MMM d, y"):e.\u0275\u0275pipeBind2(6,13,t.last_seen,"MMM d")," ")}}function By(n,o){1&n&&e.\u0275\u0275element(0,"tr",48)}function Gy(n,o){1&n&&e.\u0275\u0275element(0,"tr",49)}function zy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"table",13),e.\u0275\u0275elementContainerStart(1,14),e.\u0275\u0275template(2,cy,2,0,"th",15),e.\u0275\u0275template(3,py,4,6,"td",16),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(4,17),e.\u0275\u0275template(5,my,2,0,"th",15),e.\u0275\u0275template(6,dy,2,2,"td",18),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(7,19),e.\u0275\u0275template(8,uy,2,0,"th",15),e.\u0275\u0275template(9,hy,3,2,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(10,21),e.\u0275\u0275template(11,gy,2,0,"th",15),e.\u0275\u0275template(12,vy,3,5,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(13,22),e.\u0275\u0275template(14,Cy,2,0,"th",15),e.\u0275\u0275template(15,by,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(16,23),e.\u0275\u0275template(17,xy,2,0,"th",15),e.\u0275\u0275template(18,yy,3,3,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(19,24),e.\u0275\u0275template(20,Sy,2,0,"th",25),e.\u0275\u0275template(21,Dy,4,2,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(22,26),e.\u0275\u0275template(23,Oy,2,0,"th",15),e.\u0275\u0275template(24,Ly,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(25,27),e.\u0275\u0275template(26,Fy,2,0,"th",15),e.\u0275\u0275template(27,Ry,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(28,28),e.\u0275\u0275template(29,Ny,2,0,"th",15),e.\u0275\u0275template(30,Vy,2,1,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(31,29),e.\u0275\u0275template(32,Hy,2,0,"th",15),e.\u0275\u0275template(33,jy,7,16,"td",20),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(34,By,1,0,"tr",30),e.\u0275\u0275template(35,G
1y,1,0,"tr",31),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(34),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns)}}function $y(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-paginator",50),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}let Uy=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M,B,j){this.sensorServices=t,this.places=i,this.dialog=a,this.helpService=r,this._messageService=l,this.localStore=f,this.dataServices=w,this.browserLocaleService=T,this.locations=M,this.httpHelper=B,this.dialogService=j,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isTableEmpty=!1,this.loadingDowntimeStats=!1,this.loading=null,this.displayedColumns=[],this.filterValue="",this.currentTimeStamp=0,this.HelpSection=Z.L,this.ChipType=mn.x,this.uptimeBucketsPerDay=288,this.destroy$=new H.xQ,this.displayedColumns=["location_name","serialno","offline","uptime","thirty_day_average","seven_day_average","yesterday","current_boot_count","commissioning_date","last_seen"],this.currentTimeStamp=Date.now(),this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(q=>{var J;"sensors_loaded"===q&&(this.prepareTableData(),this.sensorServices.getUptimeDowntime(null===(J=this.places.currentPlace)||void 0===J?void 0:J.id)),"uptime_downtime_stats_loaded"===q&&(this.loadingDowntimeStats=!1,this.prepareTableData())})}ngOnInit(){var t,i;this.dataServices.currentScreen="Monitor Uptime",this.sensorServices.sensors=null,(null===(t=this.places.currentPlace)||void 0===t?void 0:t.id)&&this.sensorServices.getSensors(null===(i=this.places.currentPlace)||void 0===i?void 0:i.id),this.loadingDowntimeStats=!0}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}fillMissingUptimeDays(t){const i=new Date,a=[];for(let r=30;r>0;r--){const l=new Date(i);l.setDate(i.getDate()-r);const f=l.toISOString().split("T")[0],w=t.find(T=>T.date&&new Date(T.date).toISOString().split("T")[0]===f);a.push(w||{date:f,buckets:0,max_buckets:1,missing:!0})}return a}calculateYesterdayAvailability(t){const i=new Date;i.setDate(i.getDate()-1);const a=i.toISOString().split("T")[0],r=t.find(f=>f.date&&new Date(f.date).toISOString().split("T")[0]===a);return Math.floor((r?r.buckets:0)/this.uptimeBucketsPerDay*100)}calculateSevenDayAverageAvailability(t){const i=new Date;let r=0;for(let f=1;f<=7;f++){const w=new Date(i);w.setDate(i.getDate()-f);const T=w.toISOString().split("T")[0],M=t.find(j=>j.date&&new Date(j.date).toISOString().split("T")[0]===T);r+=M?M.buckets:0}return Math.floor(r/(7*this.uptimeBucketsPerDay)*100)}calculate30daysAvailability(t){const i=new Date;let r=0;for(let f=1;f<=30;f++){const w=new Date(i);w.setDate(i.getDate()-f);const T=w.toISOString().split("T")[0],M=t.find(j=>j.date&&new Date(j.date).toISOString().split("T")[0]===T);r+=M?M.buckets:0}return Math.floor(r/(30*this.uptimeBucketsPerDay)*100)}prepareTableData(){var t,i,a;this.totalOnline=0;const r=null===(i=null===(t=this.sensorServices)||void 0===t?void 0:t.sensors_with_locations)||void 0===i?void 0:i.filter(l=>this.locations.activeLocations.find(f=>f.id===l.location_id)).map(l=>(l.offline||this.totalOnline++,Object.assign(Object.assign({},l),{uptime:this.fillMissingUptimeDays(l.uptime||[]),yesterday:this.calculateYesterdayAvailability(l.uptime||[]),seven_day_average:this.calculateSevenDayAverageAvailability(l.uptime||[]),thirty_day_average:this.calculate30daysAvailability(l.uptime||[])})));this.dataSource=new h.by(r),this.dataSource.paginator=this.paginator,this.isTableEmpty=0===(null===(a=this.sensorServices)||void 0===a?void 0:a.sensors_with_locations.length),this.dataSource.sort=this.sort,this.dataSource.filterPredicate=(l,f)=>{const w=JSON.parse(f),M=[],B=(null==w?void 0:w.value).split(","),j=[l.location_name,l.serialno,l.
1id,l.notes,l.model,l.maker_name,gt(l.commissioning_date).format("MMM D, YYYY").toString()];return B.forEach(q=>{const J=[];j.forEach(ge=>{var fe;return J.push(null===(fe=null==ge?void 0:ge.toString())||void 0===fe?void 0:fe.toLowerCase().includes(q))}),M.push(J.some(Boolean))}),M.every(Boolean)},this.applyFilter(),this.dataSource.sortingDataAccessor=(l,f)=>"last_seen"===f?l.last_seen_timestamp:l[f],this.dataSource.paginator&&this.dataSource.paginator.firstPage()}savePagination(t){this.localStore.saveData("paginationSensors",t.pageSize)}getPagination(){return this.localStore.getData("paginationSensors")||"500"}applyFilter(t=this.filterValue){var i,a;this.filterValue=t.trim().toLowerCase(),this.dataSource&&(this.dataSource.filter=JSON.stringify({value:this.filterValue}),null===(a=null===(i=this.dataSource)||void 0===i?void 0:i.paginator)||void 0===a||a.firstPage())}clearFilter(){this.filterValue="",this.applyFilter()}showSensorInfo(t){var i,a;this.loading=t.location_id,this.locations.getEditLocationsRequest(t.location_id,t.id,null===(a=null===(i=this.places)||void 0===i?void 0:i.currentPlace)||void 0===a?void 0:a.id).subscribe(r=>{if(r.sensor){r.sensor.location_name=t.location_name;const l=this.dialog.open(ay.Y,{data:{loc:r.location,sensor:r.sensor}});this.dialogService.setFullScreenDialog(l,{desktopWidth:"1000px",desktopHeight:"auto"}),this.loading=null}else this.httpHelper.showSnackbar("There seems to be no monitor attached to this location."),this.loading=null},r=>{this.httpHelper.handleHttpErrorMessage(r)})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(De.K),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Y.s),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Pn.V),e.\u0275\u0275directiveInject(me.z),e.\u0275\u0275directiveInject(be.r),e.\u0275\u0275directiveInject(ue.x))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-uptime-downtime-stats"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(Ce.NW,5),e.\u0275\u0275viewQuery(U.YE,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.paginator=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.sort=a.first)}},decls:9,vars:7,consts:[["color","primary","mode","indeterminate",4,"ngIf"],[3,"justifyContent"],["label","Search Monitors","placeholder","Enter Monitor",3,"keepSearchParameterInURL","applyFilter","clearFilter",4,"ngIf"],["class","right-buttons-wrapper",4,"ngIf"],[1,"ag-table-wrapper"],[3,"message",4,"ngIf"],["class","ag-table-main","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["class","full-width sticky-paginator",3,"pageSize","pageSizeOptions","page",4,"ngIf"],["color","primary","mode","indeterminate"],["label","Search Monitors","placeholder","Enter Monitor",3,"keepSearchParameterInURL","applyFilter","clearFilter"],[1,"right-buttons-wrapper"],["mat-button","",1,"button-secondary",3,"click"],[3,"message"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","serialno","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["class","no-wrap-cell","style","padding-right: 10px;","mat-cell","",4,"matCellDef"],["matColumnDef","location_name"],["class","zoom-td","mat-cell","",4,"matCellDef"],["matColumnDef","offline"],["mat-cell","",4,"matCellDef"],["matColumnDef","current_boot_count"],["matColumnDef","uid"],["matColumnDef","commissioning_date"],["matColumnDef","uptime"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","thirty_day_average"],["matColumnDef","seven_day_average"],["matColumnDef","yesterday"],["matColumnDef","last_seen"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",1,"no-wrap-cell",2,"padding-right","10px"],["successMessage","Monitor serial number has been copied to clipboard","size","small",3,"copyValue"],["mat-cell","",1,"zoom-td"],[3,"isLocationName","value","cellClick"],["mat-cell",""],[3,"statusText","statusTooltipText","statusChipType","noMobileCollapsedVersion",4,"ngIf"],[3,"statusText","statusTooltipText","statusChipType","noMobileCollapsedVersion"],["mat-header-cell",""],[1,"graph-wrapper"],["class","disable-field",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"disable-field"],["mat-button",""],["class","graph-item",3,"matTooltip","ngStyle",4,"ngIf"],[1,"graph-item",3,"matTooltip","ngStyle"],["mat-header-row",""],["mat-row",""],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"section"),e.\u0275\u0275template(1,oy,1,0,"mat-progress-bar",0),e.\u0275\u0275elementStart(2,"app-sub-header",1),e.\u0275\u0275template(3,ry,1,1,"app-table-filter-search",2),e.\u0275\u0275template(4,ly,5,2,"div",3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",4),e.\u0275\u0275template(6,sy,1,1,"app-no-data",5),e.\u0275\u0275template(7,zy,36,4,"table",6),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(8,$y,1,2,"mat-paginator",7),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.sensorServices.sensors),e.\u0275\u0275advance(1),e.\u0275\u0275property("justifyContent",i.isTableEmpty?"flex-end":"space-between"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==i.dataSource?null:i.dataSource.data),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.isTableEmpty))},directives:[u.NgIf,at.pW,ae.$,$e.n,z.lW,ye.d,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,Ct.T,Bt.W,u.NgForOf,Ue.gM,u.NgStyle,ce.Zl,h.as,h.XQ,h.nj,h.Gk,Ce.NW],pipes:[u.SlicePipe,u.DecimalPipe,u.DatePipe],styles:[".graph-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;width:max-content;height:100%}.graph-item[_ngcontent-%COMP%]{width:8px;height:38px;flex-shrink:0;border-left:1.5px solid transparent;border-right:1.5px solid transparent;background-clip:padding-box}.graph-item[_ngcontent-%COMP%]:hover{transform:translateY(-2px);transition:transform .2s ease}
1.mat-column-uptime[_ngcontent-%COMP%]{position:relative}.disable-field[_ngcontent-%COMP%]{display:flex;justify-content:center;background-color:#7c7c7c66;height:100%;width:100%;position:absolute;z-index:1}"]}),n})();var Wy=d(67591);let Jn=(()=>{class n{constructor(t,i){this.httpHelper=t,this._messageService=i,this._loading$=new Zn.X(!1)}get loading$(){return this._loading$.asObservable()}getAllSubmissions(t){this._loading$.next(!0),this.httpHelper.get(`/${t?"support":"user"}/cleanair/submissions`).subscribe(i=>{this.allActivitySubmissions=i,this._messageService.sendMessage("support-submissions-loaded")},i=>{this.httpHelper.handleHttpErrorMessage(i),this._loading$.next(!1)},()=>{this._loading$.next(!1)})}getPendingSubmissions(t){this._loading$.next(!0),this.httpHelper.get(`/${t?"support":"user"}/cleanair/submissions/pending`).subscribe(i=>{this.pendingActivitySubmissions=i,this._messageService.sendMessage("support-submissions-loaded")},i=>{this.httpHelper.handleHttpErrorMessage(i),this._loading$.next(!1)},()=>{this._loading$.next(!1)})}approveActivity(t,i){this.httpHelper.put(`/support/cleanair/submissions/${t}/approval`,i).subscribe(a=>{var r;this.pendingActivitySubmissions=this.pendingActivitySubmissions.filter(l=>l.id!==a.id),this.allActivitySubmissions=null===(r=this.allActivitySubmissions)||void 0===r?void 0:r.map(l=>l.id===a.id?Object.assign(Object.assign({},l),a):l),this._messageService.sendMessage("activity-submission-approved")},a=>{this.httpHelper.handleHttpErrorMessage(a)},()=>{this.httpHelper.showSnackbar("Successfully saved")})}rejectActivity(t,i){this.httpHelper.put(`/support/cleanair/submissions/${t}/rejection`,{internal_notes:i}).subscribe(a=>{var r;this.pendingActivitySubmissions=this.pendingActivitySubmissions.filter(l=>l.id!==a.id),this.allActivitySubmissions=null===(r=this.allActivitySubmissions)||void 0===r?void 0:r.map(l=>l.id===a.id?Object.assign(Object.assign({},l),a):l),this._messageService.sendMessage("activity-submission-rejected")},a=>{this.httpHelper.handleHttpErrorMessage(a)},()=>{this.httpHelper.showSnackbar("Successfully saved")})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275inject(be.r),e.\u0275\u0275inject($.e))},n.\u0275prov=e.\u0275\u0275defineInjectable({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var Qy=d(74943),Qt=d(61024);let qy=(()=>{class n{constructor(t,i,a){this.dialogRef=t,this.activityRecord=i,this.activitiesSubmissionsReviewService=a}onSubmit(){this.activityRecord.internal_notes=this.comment,this.activityRecord.status===Qt.f.approved?this.activitiesSubmissionsReviewService.approveActivity(this.activityRecord.id,{points:this.activityRecord.points,internal_notes:this.activityRecord.internal_notes}):this.activityRecord.status===Qt.f.rejected&&this.activitiesSubmissionsReviewService.rejectActivity(this.activityRecord.id,this.activityRecord.internal_notes),this.dialogRef.close()}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(Jn))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-review-confirmation-window"]],decls:8,vars:7,consts:[[3,"title","submitText","cancel","submitting"],["appearance","fill",1,"full-width"],["matInput","","appRegexInputValidation","","maxlength","250","name","'Review Note'","placeholder","Enter Your Review Note Here",3,"cdkAutosizeMinRows","cdkTextareaAutosize","ngModel","ngModelChange"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("cancel",function(){return i.dialogRef.close()})("submitting",function(){return i.onSubmit()}),e.\u0275\u0275pipe(1,"titlecase"),e.\u0275\u0275elementStart(2,"mat-form-field",1)(3,"mat-label"),e.\u0275\u0275text(4,"Review Note"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"textarea",2),e.\u0275\u0275listener("ngModelChange",function(r){return i.comment=r}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-hint"),e.\u0275\u0275text(7," If there are no comments - you can leave it blank. "),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275property("title","Review Note | "+e.\u0275\u0275pipeBind1(1,5,i.activityRecord.status))("submitText","Submit"),e.\u0275\u0275advance(5),e.\u0275\u0275property("cdkAutosizeMinRows",2)("cdkTextareaAutosize",!0)("ngModel",i.comment))},directives:[ve.b,D.KE,D.hX,X.Nt,an.IC,_.Fj,ft.J,_.nD,_.JJ,_.On,D.bx],pipes:[u.TitleCasePipe],encapsulation:2}),n})();var _n=d(16408);function Ky(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p")(1,"b"),e.\u0275\u0275text(2,"Description:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.data.description," ")}}function Yy(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"p")(1,"b"),e.\u0275\u0275text(2,"URL: "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"a",7)(4,"button",8),e.\u0275\u0275text(5),e.\u0275\u0275elementStart(6,"mat-icon"),e.\u0275\u0275text(7,"open_in_new"),e.\u0275\u0275elementEnd()()()()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("href",t.data.url,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.data.url," ")}}function Xy(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ngx-slider",9),e.\u0275\u0275listener("valueChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().amountOfPointsUserWillGet=a}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("value",t.amountOfPointsUserWillGet)("options",t.options)}}function Zy(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-form-field",10)(1,"mat-label"),e.\u0275\u0275text(2,"Custom Amount of Points"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"input",11),e.\u0275\u0275listener("ngModelChange",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().amountOfPointsUserWillGet=a}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-hint"),e.\u0275\u0275text(5," Enter amount of points you would like user to get "),e.\u0275\u0275elementEnd()()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275property("ngModel",t.amountOfPointsUserWillGet)}}const Jy=function(){return["/dashboard"]},eS=function(n){return{goToPlaceId:n}},tS=function(n){return{"spacer-top-sm":n}};let nS=(()=>{class n{constructor(t,i,a,r,l){this.dialogRef=t,this.data=i,this.dialogService=a,this.dialog=r,this.supportService=l,this.ActivityRecordStatusViewValue=_n.OV,this.ActivityStatus=Qt.f,this.amountOfPointsUserWillGet=0,this.additionalPoints=!1}ngOnInit(){this.initPointsSliderOptions()}initPointsSliderOptions(){this.amountOfPointsUserWillGet=this.data.points,this.options={floor:_n.Kg[this.data.type].min,step:10,ceil:_n.Kg[this.data.type].max,translate:(t,i)=>{switch(i){case ut.JG.High:case ut.JG.Low:return"<b>User gets:</b> "+t+" points";default:return t+" points"}}}}onClose(t){t&&(this.data.points=this.amountOfPointsUserWillGet),this.data.status=t,this.dialogRef.close(),setTimeout(()=>{const i=this.dialog.open(qy,{data:this.data});this.dialogService.setFullScreenDialog(i,{desktopWidth:"700px",desktopHeight:"auto"})},0)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(F.so
1),e.\u0275\u0275directiveInject(F.WI),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Wt.a))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-activity-review-window"]],decls:38,vars:27,consts:[["title","Review Activity",3,"submitText","cancelText","isCustomBottomCancel","submitting","customCancel","cancel"],["successMessage","User Email has been copied to clipboard!","size","small",3,"copyValue"],["target","_blank",1,"accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick"],[4,"ngIf"],[3,"value","options","valueChange",4,"ngIf"],["class","full-width spacer-top-sm",4,"ngIf"],["color","primary",3,"ngModel","ngClass","ngModelChange"],["target","_blank",1,"link-to-source",3,"href"],["type","button",1,"accent-link"],[3,"value","options","valueChange"],[1,"full-width","spacer-top-sm"],["matInput","","required","","type","number","placeholder","Enter Amount of Points","name","amountOfPoints",3,"ngModel","ngModelChange"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-general-dialog-layout",0),e.\u0275\u0275listener("submitting",function(){return i.onClose(i.ActivityStatus.approved)})("customCancel",function(){return i.onClose(i.ActivityStatus.rejected)})("cancel",function(){return i.dialogRef.close()}),e.\u0275\u0275elementStart(1,"p")(2,"b"),e.\u0275\u0275text(3,"Title:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"p")(6,"b"),e.\u0275\u0275text(7,"Public Name:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"p")(10,"b"),e.\u0275\u0275text(11,"Email:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(12),e.\u0275\u0275element(13,"app-clipboard-copy",1),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"p")(15,"b"),e.\u0275\u0275text(16,"Place Name:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(17),e.\u0275\u0275elementStart(18,"a",2),e.\u0275\u0275listener("click",function(){return i.supportService.goToPlace(null==i.data?null:i.data.place_id,!1)})("auxclick",function(){return i.supportService.goToPlace(null==i.data?null:i.data.place_id,!1)}),e.\u0275\u0275text(19),e.\u0275\u0275elementStart(20,"mat-icon"),e.\u0275\u0275text(21,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(22,") "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"p")(24,"b"),e.\u0275\u0275text(25,"Activity:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(26),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(27,Ky,4,1,"p",3),e.\u0275\u0275elementStart(28,"p")(29,"b"),e.\u0275\u0275text(30,"Date:"),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(31),e.\u0275\u0275pipe(32,"date"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(33,Yy,8,2,"p",3),e.\u0275\u0275template(34,Xy,1,2,"ngx-slider",4),e.\u0275\u0275template(35,Zy,6,1,"mat-form-field",5),e.\u0275\u0275elementStart(36,"mat-checkbox",6),e.\u0275\u0275listener("ngModelChange",function(r){return i.additionalPoints=r}),e.\u0275\u0275text(37," Provide user with additional points "),e.\u0275\u0275elementEnd()()),2&t&&(e.\u0275\u0275property("submitText","Approve")("cancelText","Reject")("isCustomBottomCancel",!0),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",i.data.title," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",i.data.public_name," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",i.data.email," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",i.data.email),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",i.data.place_name," (ID: "),e.\u0275\u0275advance(1),e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction0(22,Jy))("queryParams",e.\u0275\u0275pureFunction1(23,eS,null==i.data?null:i.data.place_id))("matTooltip","Place ID: "+(null==i.data?null:i.data.place_id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.data.place_id," "),e.\u0275\u0275advance(7),e.\u0275\u0275textInterpolate1(" ",i.ActivityRecordStatusViewValue[i.data.type]," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.data.description),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(32,20,i.data.date_created)," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.data.url),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.options&&!i.additionalPoints),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.options&&i.additionalPoints),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngModel",i.additionalPoints)("ngClass",e.\u0275\u0275pureFunction1(25,tS,i.additionalPoints)))},directives:[ve.b,Ie.Z,y.yS,Ue.gM,Q.Hw,u.NgIf,ut.w5,D.KE,D.hX,X.Nt,_.wV,_.Fj,_.Q7,_.JJ,_.On,D.bx,Je.oG,u.NgClass],pipes:[u.DatePipe],encapsulation:2}),n})();function iS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Date"),e.\u0275\u0275elementEnd())}function aS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"span",23),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"date"),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,1,t.date_created))}}function oS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Activity"),e.\u0275\u0275elementEnd())}function rS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(3,"br"),e.\u0275\u0275elementStart(4,"span"),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",i.ActivityRecordStatusViewValue[t.type]," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.activity," ")}}function lS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Email"),e.\u0275\u0275elementEnd())}function sS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"span"),e.\u0275\u0275text(2),e.\u0275\u0275element(3,"app-clipboard-copy",24),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.email," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("copyValue",t.email)}}function cS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Place"),e.\u0275\u0275elementEnd())}const pS=function(){return["/dashboard"]},mS=function(n){return{goToPlaceId:n}};function dS(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementStart(2,"a",25),e.\u0275\u0275listener("click",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==r?null:r.place_id,!1)})("auxclick",function(){const r=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(2).supportService.goToPlace(null==r?null:r.place_id,!1)}),e.\u0275\u0275text(3),e.\u0275\u0275elementStart(4,"mat-icon"),e.\u0275\u0275text(5,"open_in_new"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275text(6,") "),e.\u0275\u0275elementEnd()}if(2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.place_name,"
1(ID: "),e.\u0275\u0275advance(1),e.\u0275\u0275property("routerLink",e.\u0275\u0275pureFunction0(5,pS))("queryParams",e.\u0275\u0275pureFunction1(6,mS,null==t?null:t.place_id))("matTooltip","Place ID: "+(null==t?null:t.place_id)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.place_id," ")}}function uS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Public Name"),e.\u0275\u0275elementEnd())}function _S(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.public_name," ")}}function fS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Points"),e.\u0275\u0275elementEnd())}function hS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1,"+"),e.\u0275\u0275elementEnd())}function gS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275template(1,hS,2,0,"span",3),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",0<t.points),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1("",t.points," ")}}function vS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22),e.\u0275\u0275template(1,gS,3,2,"span",3),e.\u0275\u0275elementEnd()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.status!==i.ActivityStatus.pendingApproval&&t.status!==i.ActivityStatus.rejected)}}function CS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",21),e.\u0275\u0275text(1,"Status"),e.\u0275\u0275elementEnd())}function bS(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",27),2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("statusText",i.ActivityStatusPrettier[t.status])("statusTooltipText",i.ActivityStatusPrettier[t.status])("statusChipType",i.ChipType.success)}}function xS(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",27),2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("statusText",i.ActivityStatusPrettier[t.status])("statusTooltipText",i.ActivityStatusPrettier[t.status])("statusChipType",i.ChipType.warning)}}function yS(n,o){if(1&n&&e.\u0275\u0275element(0,"app-chip-status",27),2&n){const t=e.\u0275\u0275nextContext().$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("statusText",i.ActivityStatusPrettier[t.status])("statusTooltipText",i.ActivityStatusPrettier[t.status])("statusChipType",i.ChipType.error)}}function SS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"div"),e.\u0275\u0275template(2,bS,1,3,"app-chip-status",26),e.\u0275\u0275template(3,xS,1,3,"app-chip-status",26),e.\u0275\u0275template(4,yS,1,3,"app-chip-status",26),e.\u0275\u0275elementEnd()()),2&n){const t=o.$implicit,i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.status===i.ActivityStatus.approved),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.status===i.ActivityStatus.pendingApproval),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.status===i.ActivityStatus.rejected)}}function wS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"th",28),e.\u0275\u0275text(1," Actions "),e.\u0275\u0275elementEnd())}function ES(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",34),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).reviewActivityWindow(a)}),e.\u0275\u0275text(1," Review "),e.\u0275\u0275elementEnd()}}function TS(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",35),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).showMoreInformation(a)}),e.\u0275\u0275text(1," Show More Details "),e.\u0275\u0275elementEnd()}}function IS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"td",22)(1,"div",29),e.\u0275\u0275template(2,ES,2,0,"button",30),e.\u0275\u0275elementStart(3,"mat-menu",null,31),e.\u0275\u0275template(5,TS,2,0,"ng-template",32),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",33)(7,"mat-icon"),e.\u0275\u0275text(8,"more_vert"),e.\u0275\u0275elementEnd()()()()),2&n){const t=e.\u0275\u0275reference(4),i=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",i.isPendingApplicationsOnly),e.\u0275\u0275advance(4),e.\u0275\u0275property("matMenuTriggerFor",t)}}function PS(n,o){1&n&&e.\u0275\u0275element(0,"tr",36)}function kS(n,o){1&n&&e.\u0275\u0275element(0,"tr",37)}function MS(n,o){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",5)(2,"table",6),e.\u0275\u0275elementContainerStart(3,7),e.\u0275\u0275template(4,iS,2,0,"th",8),e.\u0275\u0275template(5,aS,4,3,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(6,10),e.\u0275\u0275template(7,oS,2,0,"th",8),e.\u0275\u0275template(8,rS,6,2,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(9,11),e.\u0275\u0275template(10,lS,2,0,"th",8),e.\u0275\u0275template(11,sS,4,2,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(12,12),e.\u0275\u0275template(13,cS,2,0,"th",8),e.\u0275\u0275template(14,dS,7,8,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(15,13),e.\u0275\u0275template(16,uS,2,0,"th",8),e.\u0275\u0275template(17,_S,2,1,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(18,14),e.\u0275\u0275template(19,fS,2,0,"th",8),e.\u0275\u0275template(20,vS,2,1,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(21,15),e.\u0275\u0275template(22,CS,2,0,"th",8),e.\u0275\u0275template(23,SS,5,3,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerStart(24,16),e.\u0275\u0275template(25,wS,2,0,"th",17),e.\u0275\u0275template(26,IS,9,2,"td",9),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275template(27,PS,1,0,"tr",18),e.\u0275\u0275template(28,kS,1,0,"tr",19),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(29,"mat-paginator",20),e.\u0275\u0275listener("page",function(a){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().savePagination(a)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("dataSource",t.dataSource),e.\u0275\u0275advance(25),e.\u0275\u0275property("matHeaderRowDef",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("matRowDefColumns",t.displayedColumns),e.\u0275\u0275advance(1),e.\u0275\u0275property("pageSize",t.getPagination())("pageSizeOptions",t.PAGINATION_PAGE_SIZE_OPTIONS)}}function AS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span",40),e.\u0275\u0275text(1," Loading activity submissions "),e.\u0275\u0275elementEnd())}function DS(n,o){1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," Well done team! \u{1f4aa} "),e.\u0275\u0275elementEnd())}function OS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1," There is no activities for review. "),e.\u0275\u0275template(2,DS,2,0,"span",3),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isSupportStaff)}}function LS(n,o){if(1&n&&(e.\u0275\u0275elementStart(0,"div",38),e.\u0275\u0275template(1,AS,2,0,"span",39),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,OS,3,1,"span",3),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("@slowAppearing",void 0),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,3,t.loading)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!e.\u0275\u0275pipeBind1(4,5,t.loading))}}let ei=(()=>{class n{constructor(t,i,a,r,l,f,w,T,M){this.localStore=t,this._messageService=i,this.dialogService=a,this.dialog=r,this.activitiesSubmissionsReviewService=l,this.places=f,this.route=w,this.dataServices=T,this.supportService=M,this.isSupportStaff=!0,this.isPendingApplicationsOnly=!0,this.loading=this.activitiesSubmissionsReviewService.loading$,this.PAGINATION_PAGE_SIZE_OPTIONS=Re.L,this.isPortrait=jt.gr,this.ActivityRecordStatusViewValue=_n.OV,this.destroy$=new H.xQ,this.ActivityStatus=Qt.f,this.ActivityStatusPrettier=Qt.t,this.ChipType=mn.x,this.displayedColumns=["date_created","activity","email","place_name","public_name","points","status","action-menu"],this.dataSource=new h.by([])}set matSort(t){this.dataSource.sort=t}set matPaginator(t){this.dataSource.paginator=t}ngOnInit(){const{isSupportStaff:t,isPendingApplicationsOnly:i}
1=this.route.snapshot.data||{};this.isSupportStaff=null!=t?t:this.isSupportStaff,this.isPendingApplicationsOnly=null!=i?i:this.isPendingApplicationsOnly,this.dataServices.currentScreen=this.isPendingApplicationsOnly?"Waiting For Review":"All Submissions",this.places.staffMode=this.isSupportStaff?"support_panel":"caa_admin",this._messageService.listenMessage().pipe((0,A.R)(this.destroy$)).subscribe(a=>{("support-submissions-loaded"===a||"activity-submission-approved"===a||"activity-submission-rejected"===a)&&this.initActivitiesData()}),this.loadSubmissionsData()}loadSubmissionsData(){this.isPendingApplicationsOnly&&!this.activitiesSubmissionsReviewService.pendingActivitySubmissions?this.activitiesSubmissionsReviewService.getPendingSubmissions(this.isSupportStaff):this.isPendingApplicationsOnly||this.activitiesSubmissionsReviewService.allActivitySubmissions?this.initActivitiesData():this.activitiesSubmissionsReviewService.getAllSubmissions(this.isSupportStaff)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),"caa_admin"===this.places.staffMode&&(this.places.staffMode=null)}initActivitiesData(){this.dataSource=new h.by((this.isPendingApplicationsOnly?this.activitiesSubmissionsReviewService.pendingActivitySubmissions:this.activitiesSubmissionsReviewService.allActivitySubmissions).map(t=>{var i;return t.place_name=null===(i=this.places.places.find(a=>a.id===t.place_id))||void 0===i?void 0:i.name,t})),this.dataSource.sortingDataAccessor=(t,i)=>"date_created"===i?new Date(t.date_created).getTime():t[i]}getPagination(){return this.localStore.getData("paginationSensors")||"500"}savePagination(t){this.localStore.saveData("paginationSensors",t.pageSize)}showMoreInformation(t){const i=this.dialog.open(Qy._,{data:t});this.dialogService.setFullScreenDialog(i,{desktopWidth:"450px",desktopHeight:"auto"})}reviewActivityWindow(t){const i=this.dialog.open(nS,{data:Object.assign({},t)});this.dialogService.setFullScreenDialog(i,{desktopWidth:"700px",desktopHeight:"auto"})}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Fe.n),e.\u0275\u0275directiveInject($.e),e.\u0275\u0275directiveInject(ue.x),e.\u0275\u0275directiveInject(F.uw),e.\u0275\u0275directiveInject(Jn),e.\u0275\u0275directiveInject(R.E),e.\u0275\u0275directiveInject(y.gz),e.\u0275\u0275directiveInject(ee.O),e.\u0275\u0275directiveInject(Wt.a))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-applications-table"]],viewQuery:function(t,i){if(1&t&&(e.\u0275\u0275viewQuery(U.YE,5),e.\u0275\u0275viewQuery(Ce.NW,5)),2&t){let a;e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matSort=a.first),e.\u0275\u0275queryRefresh(a=e.\u0275\u0275loadQuery())&&(i.matPaginator=a.first)}},inputs:{isSupportStaff:"isSupportStaff",isPendingApplicationsOnly:"isPendingApplicationsOnly"},decls:6,vars:3,consts:[[3,"justifyContent"],[1,"right-buttons-wrapper"],["mat-button","",1,"button-secondary"],[4,"ngIf"],["class","info-table-message",4,"ngIf"],[1,"table-wrapper"],["mat-table","","matSort","",1,"ag-table-main",3,"dataSource"],["matColumnDef","date_created","sticky",""],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","activity"],["matColumnDef","email"],["matColumnDef","place_name"],["matColumnDef","public_name"],["matColumnDef","points"],["matColumnDef","status"],["matColumnDef","action-menu"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"full-width","sticky-paginator",3,"pageSize","pageSizeOptions","page"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"spacer-right-xs"],["successMessage","User Email has been copied to clipboard!","size","small",3,"copyValue"],["target","_blank",1,"accent-link",3,"routerLink","queryParams","matTooltip","click","auxclick"],[3,"statusText","statusTooltipText","statusChipType",4,"ngIf"],[3,"statusText","statusTooltipText","statusChipType"],["mat-header-cell",""],[1,"row-buttons"],["mat-button","","class","button-primary",3,"click",4,"ngIf"],["menu","matMenu"],["matMenuContent",""],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-button","",1,"button-primary",3,"click"],["mat-menu-item","",3,"click"],["mat-header-row",""],["mat-row",""],[1,"info-table-message"],["class","loading-text",4,"ngIf"],[1,"loading-text"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"app-sub-header",0)(1,"div",1)(2,"button",2),e.\u0275\u0275text(3," Help "),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(4,MS,30,5,"ng-container",3),e.\u0275\u0275template(5,LS,5,7,"div",4)),2&t&&(e.\u0275\u0275property("justifyContent","flex-end"),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",null==i.dataSource?null:i.dataSource.data.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!(null!=i.dataSource&&i.dataSource.data.length)))},directives:[ae.$,z.lW,u.NgIf,h.BZ,U.YE,h.w1,h.fO,h.ge,U.nU,h.Dz,h.ev,Ie.Z,y.yS,Ue.gM,Q.Hw,Bt.W,W.VK,W.KA,W.OP,W.p6,h.as,h.XQ,h.nj,h.Gk,Ce.NW],pipes:[u.DatePipe,u.AsyncPipe],styles:[".row-buttons[_ngcontent-%COMP%]{display:flex;gap:var(--sm-size)}"],data:{animation:[_t.v]}}),n})();function FS(n,o){1&n&&e.\u0275\u0275element(0,"app-applications-table",4),2&n&&e.\u0275\u0275property("isSupportStaff",!0)("isPendingApplicationsOnly",!0)}function RS(n,o){1&n&&e.\u0275\u0275element(0,"app-applications-table",4),2&n&&e.\u0275\u0275property("isSupportStaff",!0)("isPendingApplicationsOnly",!1)}const VS=[{path:"place",component:Nr,canActivate:[et.C]},{path:"permission",component:xm,canActivate:[et.C]},{path:"hardware",component:Jc,canActivate:[et.C]},{path:"locations/:locationId",component:p_},{path:"user",component:Fp,canActivate:[Zt.Z,dn.a]},{path:"change-password",component:xd,canActivate:[Zt.Z,dn.a]},{path:"change-username",component:t0,canActivate:[Zt.Z,dn.a]},{path:"location",component:vd,canActivate:[Zt.Z,dn.a]},{path:"uptime-downtime",component:Uy,canActivate:[et.C]},{path:"labelprint",component:k_,canActivate:[pn.C]},{path:"ebm-mb-label",component:L_,canActivate:[pn.C]},{path:"outdoor-label",component:V_,canActivate:[pn.C]},{path:"print-widget-qr/:displayHash/:displayType",component:B_,canActivate:[et.C]},{path:"checkout",component:J_,canActivate:[pn.C]},{path:"pickups",component:Af,canActivate:[nt]},{path:"search-by-serial-number",component:kh,canActivate:[nt]},{path:"search-by-email",component:n1,canActivate:[nt]},{path:"setup-new-pl-for-user",component:Wy.O,canActivate:[nt],data:{adminAccess:!0}},{path:"search-for-place",component:M0,canActivate:[nt]},{path:"activity-submissions",component:(()=>{class n{constructor(t,i){this.activitiesSubmissionsReviewService=t,this.places=i}ngOnDestroy(){this.activitiesSubmissionsReviewService.allActivitySubmissions=null,this.activitiesSubmissionsReviewService.pendingActivitySubmissions=null,this.places.staffMode=null}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(Jn),e.\u0275\u0275directiveInject(R.E))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["app-activity-applications"]],decls:6,vars:0,consts:[["tabGroup",""],["label","Waiting For Review"],["matTabContent",""],["label","All Submissions"],[3,"isSupportStaff","isPendingApplicationsOnly"]],template:function(t,i){1&t&&(e.\u0275\u0275elementStart(0,"mat-tab-group",null,0)(2,"mat-tab",1),e.\u0275\u0275template(3,FS,1,2,"ng-template",2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"mat-tab",3),e.\u0275\u0275template(5,RS,1,2,"ng-template",2),e.\u0275\u0275elementEnd()())},directives:[se.SP,se.uX,se.Vc,ei],styles:[""],data:{animation:[_t.v]}}),n})(),canActivate:[nt]},{path:"pickups/print/:pickupId",component:Nf,canActivate:[nt]},{path:"pickups/tracking-table/:pickupId",component:ZC,canActivate:[nt]},{path:"alarms-and-notifications",component:HC,canActivate:[et.C]},{path:"calibration",component:n2,canActivate:[et.C]},{path:"background-calibration",component:B2,canActivate:[nt]},{path:"network-calibration",component:iy,canActivate:[et.C]},{path:"waiting-for-review",component:ei,canActivate:[gi],data:{isSupportStaff:!1,isPendingApplicationsOnly:!0}},{path:"all-submissions",component:ei,canActivate:[gi],data:{isSupportStaff:!1,isPendingApplicationsOnly:!1}},{path:"public-displays",component:xb,canActivate:[et.C]}];let HS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=e.\u0275\u0275defineInjector({providers:[At.H,An,kt.J,Ln,En,Mt,Gt,_i],imports:[[y.Bz.forChild(VS),u.CommonModule,_.u5,S.q,ym.m,I.o9,Ot.N,Vf.OnboardingModule,v,Ea,mt.N,i2.CleanAirAdvocatesModule,zn.aw]]}),n})()},6757:(G,C,d)=>{d.d(C,{Z:()=>y});var y=(()=>{return(S=y||(y={})).PM25_UG_M3="pm02",S.PM25_US_AQI="pi02",S.CO2="rco2",S.RELATIVE_HUMIDITY="rhum",S.TEMPERATURE_C="atmp",S.TEMPERATURE_F="atmp_fahrenheit",S.HEAT_INDEX_C="heat_index_celsius",S.HEAT_INDEX_F="heat_index_fahrenheit",S.TVOC_PPB="tvoc",S.TVOC_IND40="tvoc_index",S.NOx="nox_index",y;var S})()},61245:(G,C,d)=>{d.d(C,{x:()=>y});var y=(()=>{return(S=y||(y={})).classic="classic",S.guidelines="guidelines",S.guidelinesMascot="guidelines-mascot",S.charts="charts",S.mascot="mascot",S.goiaqsStatus="go-aqs-status",S.goiaqsGauge="go-aqs-gauge",y;var S})()},30589:(G,C,d)=>{d.d(C,{S:()=>v});var y=d(34502),S=d(5e3),u=d(28142),I=d(47423),e=d(69808),k=d(92181);function E(s,c){if(1&s){const m=S.\u0275\u0275getCurrentView();S.\u0275\u0275elementStart(0,"div")(1,"button",6),S.\u0275\u0275listener("click",function(){const b=S.\u0275\u0275restoreView(m).$implicit;return S.\u0275\u0275nextContext().selectLanguage(b)}),S.\u0275\u0275text(2),S.\u0275\u0275elementEnd()()}if(2&s){const m=c.$implicit,p=S.\u0275\u0275nextContext();S.\u0275\u0275advance(2),S.\u0275\u0275textInterpolate1(" ",p.LanguageLabels[m]," ")}}const P=function(s,c,m,p){return{color:s,fontFamily:c,backgroundColor:m,borderColor:p}};let v=(()=>{class s{constructor(m){this.translateService=m,this.styleConfig={},this.LanguageLabels=y.a,this.currentLanguage=y.l.English,this.languages=Object.values(y.l)}ngOnInit(){const m=navigator.language.split("-")[0];this.currentLanguage=this.languages.find(p=>p===m)}selectLanguage(m){this.currentLanguage=m,this.translateService.use(m)}}return s.\u0275fac=function(m){return new(m||s)(S.\u0275\u0275directiveInject(u.sK))},s.\u0275cmp=S.\u0275\u0275defineComponent({type:s,selectors:[["app-language-selector"]],inputs:{styleConfig:"styleConfig"},decls:8,vars:9,consts:[["type","button","mat-button","",1,"button-secondary",3,"ngStyle","matMenuTriggerFor"],[1,"btn-content"],[1,"text-ellipsis"],[1,"arrow-down"],["listOfLanguagesMenu","matMenu"],[4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"]],template:function(m,p){if(1&m&&(S.\u0275\u0275elementStart(0,"button",0)(1,"span",1)(2,"span",2),S.\u0275\u0275text(3),S.\u0275\u0275elementEnd(),S.\u0275\u0275element(4,"span",3),S.\u0275\u0275elementEnd()(),S.\u0275\u0275elementStart(5,"mat-menu",null,4),S.\u0275\u0275template(7,E,3,1,"div",5),S.\u0275\u0275elementEnd()),2&m){const g=S.\u0275\u0275reference(6);
1S.\u0275\u0275property("ngStyle",S.\u0275\u0275pureFunction4(4,P,null==p.styleConfig?null:p.styleConfig.backgroundColor,null==p.styleConfig?null:p.styleConfig.fontFamily,null==p.styleConfig?null:p.styleConfig.color,(null==p.styleConfig?null:p.styleConfig.backgroundColor)+"!important"))("matMenuTriggerFor",g),S.\u0275\u0275advance(3),S.\u0275\u0275textInterpolate(p.currentLanguage?p.LanguageLabels[p.currentLanguage]:"Select Language"),S.\u0275\u0275advance(4),S.\u0275\u0275property("ngForOf",p.languages)}},directives:[I.lW,e.NgStyle,k.p6,k.VK,e.NgForOf,k.OP],styles:[".button-secondary[_ngcontent-%COMP%]{border:1px solid!important}.button-secondary[_ngcontent-%COMP%]:not(:hover){background:transparent!important;color:inherit!important}"]}),s})()},27243:(G,C,d)=>{var S=L(d(49721)),I=L(d(44070)),k=L(d(76162)),P=L(d(13800)),s=L(d(41731)),m=L(d(40070)),g=L(d(3930)),b=d(87497),O=L(d(97850));function L(K){return K&&K.__esModule?K:{default:K}}var N=function(){},oe=function(re,pe,ie){var le=new N;if(void 0===re)throw Error("No element to render on was provided.");return le._renderProperties=(0,s.default)(re),le._encodings=[],le._options=O.default,le._errorHandler=new g.default(le),void 0!==pe&&((ie=ie||{}).format||(ie.format=Yt()),le.options(ie)[ie.format](pe,ie).render()),le};for(var Ae in oe.getModule=function(K){return S.default[K]},S.default)S.default.hasOwnProperty(Ae)&&Ve(S.default,Ae);function Ve(K,re){N.prototype[re]=N.prototype[re.toUpperCase()]=N.prototype[re.toLowerCase()]=function(pe,ie){var le=this;return le._errorHandler.wrapBarcodeCall(function(){ie.text=void 0===ie.text?void 0:""+ie.text;var ke=(0,I.default)(le._options,ie);ke=(0,m.default)(ke);var gn=ct(pe,K[re],ke);return le._encodings.push(gn),le})}}function ct(K,re,pe){var ie=new re(K=""+K,pe);if(!ie.valid())throw new b.InvalidInputException(ie.constructor.name,K);var le=ie.encode();le=(0,k.default)(le);for(var ke=0;ke<le.length;ke++)le[ke].options=(0,I.default)(pe,le[ke].options);return le}function Yt(){return S.default.CODE128?"CODE128":Object.keys(S.default)[0]}function Nt(K,re,pe){re=(0,k.default)(re);for(var ie=0;ie<re.length;ie++)re[ie].options=(0,I.default)(pe,re[ie].options),(0,P.default)(re[ie].options);(0,P.default)(pe),new(0,K.renderer)(K.element,re,pe).render(),K.afterRender&&K.afterRender()}N.prototype.options=function(K){return this._options=(0,I.default)(this._options,K),this},N.prototype.blank=function(K){var re=new Array(K+1).join("0");return this._encodings.push({data:re}),this},N.prototype.init=function(){var K;if(this._renderProperties)for(var re in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){var pe=(0,I.default)(this._options,(K=this._renderProperties[re]).options);"auto"==pe.format&&(pe.format=Yt()),this._errorHandler.wrapBarcodeCall(function(){var ke=ct(pe.value,S.default[pe.format.toUpperCase()],pe);Nt(K,ke,pe)})}},N.prototype.render=function(){if(!this._renderProperties)throw new b.NoElementException;if(Array.isArray(this._renderProperties))for(var K=0;K<this._renderProperties.length;K++)Nt(this._renderProperties[K],this._encodings,this._options);else Nt(this._renderProperties,this._encodings,this._options);return this},N.prototype._defaults=O.default,"undefined"!=typeof window&&(window.JsBarcode=oe),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(K,re){var pe=[];return jQuery(this).each(function(){pe.push(this)}),oe(pe,K,re)}),G.exports=oe},74648:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.default=function S(u,I){(function d(S,u){if(!(S instanceof u))throw new TypeError("Cannot call a class as a function")})(this,S),this.data=u,this.text=I.text||u,this.options=I}},16106:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),u=function e(s){return s&&s.__esModule?s:{default:s}}(d(74648)),I=d(89068),v=function(s){function c(m,p){!function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c);var g=function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,m.substring(1),p));return g.bytes=m.split("").map(function(b){return b.charCodeAt(0)}),g}
1return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var p=this.bytes,g=p.shift()-105,b=I.SET_BY_CODE[g];if(void 0===b)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&p.unshift(I.FNC1);var x=c.next(p,1,b);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:c.getBar(g)+x.result+c.getBar((x.checksum+g)%I.MODULO)+c.getBar(I.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var p=this.options.ean128||!1;return"string"==typeof p&&(p="true"===p.toLowerCase()),p}}],[{key:"getBar",value:function(p){return I.BARS[p]?I.BARS[p].toString():""}},{key:"correctIndex",value:function(p,g){if(g===I.SET_A){var b=p.shift();return b<32?b+64:b-32}return g===I.SET_B?p.shift()-32:10*(p.shift()-48)+p.shift()-48}},{key:"next",value:function(p,g,b){if(!p.length)return{result:"",checksum:0};var x=void 0,O=void 0;if(p[0]>=200){O=p.shift()-105;var L=I.SWAP[O];void 0!==L?x=c.next(p,g+1,L):((b===I.SET_A||b===I.SET_B)&&O===I.SHIFT&&(p[0]=b===I.SET_A?p[0]>95?p[0]-96:p[0]:p[0]<32?p[0]+96:p[0]),x=c.next(p,g+1,b))}else O=c.correctIndex(p,b),x=c.next(p,g+1,b);return{result:c.getBar(O)+x.result,checksum:O*g+x.checksum}}}]),c}(u.default);C.default=v},8964:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),u=function e(s){return s&&s.__esModule?s:{default:s}}(d(16106)),I=d(89068),v=function(s){function c(m,p){return function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,I.A_START_CHAR+m,p))}return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return new RegExp("^"+I.A_CHARS+"+$").test(this.data)}}]),c}(u.default);C.default=v},73254:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),u=function e(s){return s&&s.__esModule?s:{default:s}}(d(16106)),I=d(89068),v=function(s){function c(m,p){return function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,I.B_START_CHAR+m,p))}return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return new RegExp("^"+I.B_CHARS+"+$").test(this.data)}}]),c}(u.default);C.default=v},35701:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),u=function e(s){return s&&s.__esModule?s:{default:s}}(d(16106)),I=d(89068),v=function(s){function c(m,p){return function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,I.C_START_CHAR+m,p))}
1return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return new RegExp("^"+I.C_CHARS+"+$").test(this.data)}}]),c}(u.default);C.default=v},25626:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=e(d(16106)),I=e(d(84779));function e(s){return s&&s.__esModule?s:{default:s}}function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}var v=function(s){function c(m,p){if(function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),/^[\x00-\x7F\xC8-\xD3]+$/.test(m))var g=E(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,(0,I.default)(m),p));else g=E(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,m,p));return E(g)}return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),c}(S.default);C.default=v},84779:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=d(89068),S=function(P){return P.match(new RegExp("^"+y.A_CHARS+"*"))[0].length},u=function(P){return P.match(new RegExp("^"+y.B_CHARS+"*"))[0].length},I=function(P){return P.match(new RegExp("^"+y.C_CHARS+"*"))[0]};function e(E,P){var v=P?y.A_CHARS:y.B_CHARS,s=E.match(new RegExp("^("+v+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(s)return s[1]+String.fromCharCode(204)+k(E.substring(s[1].length));var c=E.match(new RegExp("^"+v+"+"))[0];return c.length===E.length?E:c+String.fromCharCode(P?205:206)+e(E.substring(c.length),!P)}function k(E){var P=I(E),v=P.length;if(v===E.length)return E;E=E.substring(v);var s=S(E)>=u(E);return P+String.fromCharCode(s?206:205)+e(E,s)}C.default=function(E){var P=void 0;if(I(E).length>=2)P=y.C_START_CHAR+k(E);else{var s=S(E)>u(E);P=(s?y.A_START_CHAR:y.B_START_CHAR)+e(E,s)}return P.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(c,m){return String.fromCharCode(203)+m})}},89068:(G,C)=>{var d;function y(Ae,Ve,ct){return Ve in Ae?Object.defineProperty(Ae,Ve,{value:ct,enumerable:!0,configurable:!0,writable:!0}):Ae[Ve]=ct,Ae}Object.defineProperty(C,"__esModule",{value:!0});var S=C.SET_A=0,u=C.SET_B=1,I=C.SET_C=2,k=(C.SHIFT=98,C.START_A=103),E=C.START_B=104,P=C.START_C=105;C.MODULO=103,C.STOP=106,C.FNC1=207,C.SET_BY_CODE=(y(d={},k,S),y(d,E,u),y(d,P,I),d),C.SWAP={101:S,100:u,99:I},C.A_START_CHAR=String.fromCharCode(208),C.B_START_CHAR=String.fromCharCode(209),C.C_START_CHAR=String.fromCharCode(210),C.A_CHARS="[\0-_\xc8-\xcf]",C.B_CHARS="[ -\x7f\xc8-\xcf]",C.C_CHARS="(\xcf*[0-9]{2}\xcf*)",C.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},56038:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.CODE128C=C.CODE128B=C.CODE128A=C.CODE128=void 0;var S=v(d(25626)),I=v(d(8964)),k=v(d(73254)),P=v(d(35701));function v(s){return s&&s.__esModule?s:{default:s}}C.CODE128=S.default,C.CODE128A=I.default,C.CODE128B=k.default,C.CODE128C=P.default},80528:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.CODE39=void 0;var y=function(){function x(O,L){for(var N=0;N<L.length;N++){var oe=L[N];oe.enumerable=oe.enumerable||!1,oe.configurable=!0,"value"in oe&&(oe.writable=!0),Object.defineProperty(O,oe.ke
1y,oe)}}return function(O,L,N){return L&&x(O.prototype,L),N&&x(O,N),O}}(),P=function(x){function O(L,N){return function e(x,O){if(!(x instanceof O))throw new TypeError("Cannot call a class as a function")}(this,O),L=L.toUpperCase(),N.mod43&&(L+=function p(x){return v[x]}(function b(x){for(var O=0,L=0;L<x.length;L++)O+=g(x[L]);return O%43}(L))),function k(x,O){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!O||"object"!=typeof O&&"function"!=typeof O?x:O}(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,L,N))}return function E(x,O){if("function"!=typeof O&&null!==O)throw new TypeError("Super expression must either be null or a function, not "+typeof O);x.prototype=Object.create(O&&O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(x,O):x.__proto__=O)}(O,x),y(O,[{key:"encode",value:function(){for(var N=c("*"),oe=0;oe<this.data.length;oe++)N+=c(this.data[oe])+"0";return{data:N+=c("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),O}(function I(x){return x&&x.__esModule?x:{default:x}}(d(74648)).default),v=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],s=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function c(x){return function m(x){return s[x].toString(2)}(g(x))}function g(x){return v.indexOf(x)}C.CODE39=P},67417:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function m(p,g){for(var b=0;b<g.length;b++){var x=g[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,g,b){return g&&m(p.prototype,g),b&&m(p,b),p}}(),S=d(53819),I=E(d(29259));function E(m){return m&&m.__esModule?m:{default:m}}var c=function(m){function p(g,b){!function P(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}(this,p);var x=function v(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?m:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,g,b));return x.fontSize=!b.flat&&b.fontSize>10*b.width?10*b.width:b.fontSize,x.guardHeight=b.height+x.fontSize/2+b.textMargin,x}return function s(m,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}(p,m),y(p,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(b,x){return this.text.substr(b,x)}},{key:"leftEncode",value:function(b,x){return(0,I.default)(b,x)}},{key:"rightText",value:function(b,x){return this.text.substr(b,x)}},{key:"rightEncode",value:function(b,x){return(0,I.default)(b,x)}},{key:"encodeGuarded",value:function(){var b={fontSize:this.fontSize},x={height:this.guardHeight};return[{data:S.SIDE_BIN,options:x},{data:this.leftEncode(),text:this.leftText(),options:b},{data:S.MIDDLE_BIN,options:x},{data:this.rightEncode(),text:this.rightText(),options:b},{data:S.SIDE_BIN,options:x}]}},{key:"encodeFlat",value:function(){return{data:[S.SIDE_BIN,this.leftEncode(),S.MIDDLE_BIN,this.rightEncode(),S.SIDE_BIN].join(""),text:this.text}}}]),p}(E(d(74648)).default);C.default=c},16195:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function m(p,g){for(var b=0;b<g.length;b++){var x=g[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,g,b){return g&&m(p.prototype,g),b&&m(p,b),p}}(),S=function m(p,g,b){null===p&&(p=Function.prototype);var x=Object.getOwnPropertyDescriptor(p,g);if(void 0===x){var O=Object.getPrototypeOf(p);return null===O?void 0:m(O,g,b)}if("value"in x)return x.value;var L=x.get;return void 0===L?void 0:L.call(b)}
1,u=d(53819),e=function k(m){return m&&m.__esModule?m:{default:m}}(d(67417)),s=function(p){return(10-p.substr(0,12).split("").map(function(b){return+b}).reduce(function(b,x,O){return O%2?b+3*x:b+x},0)%10)%10},c=function(m){function p(g,b){(function E(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")})(this,p),-1!==g.search(/^[0-9]{12}$/)&&(g+=s(g));var x=function P(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?m:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,g,b));return x.lastChar=b.lastChar,x}return function v(m,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}(p,m),y(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===s(this.data)}},{key:"leftText",value:function(){return S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var b=this.data.substr(1,6),x=u.EAN13_STRUCTURE[this.data[0]];return S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"leftEncode",this).call(this,b,x)}},{key:"rightText",value:function(){return S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var b=this.data.substr(7,6);return S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"rightEncode",this).call(this,b,"RRRRRR")}},{key:"encodeGuarded",value:function(){var b=S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(b.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(b.push({data:"00"}),b.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),b}}]),p}(e.default);C.default=c},54500:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function m(p,g){for(var b=0;b<g.length;b++){var x=g[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,g,b){return g&&m(p.prototype,g),b&&m(p,b),p}}(),S=d(53819),I=E(d(29259));function E(m){return m&&m.__esModule?m:{default:m}}var c=function(m){function p(g,b){return function P(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}(this,p),function v(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?m:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,g,b))}return function s(m,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}(p,m),y(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var b=S.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,I.default)(this.data,b,"01"),text:this.text}}}]),p}(E(d(74648)).default);C.default=c},55174:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function p(g,b){for(var x=0;x<b.length;x++){var O=b[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,b,x){return b&&p(g.prototype,b),x&&p(g,x),g}}(),S=d(53819),I=E(d(29259));function E(p){return p&&p.__esModule?p:{default:p}}var m=function(p){function g(b,x){return function P(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}(this,g),function v(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!g||"object"!=typeof g&&"function"!=typeof g?p:g}(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b,x))}return function s(p,g){if("function"!=typeof g&&null!==g)throw new TypeError("Super expression must either be null or a function, not "+typeof g);p.prototype=Object.create(g&&g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(p,g):p.__proto__=g)}(g,p),y(g,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var x=S.EAN5_STRUCTURE[function(g){return g.split("").map(function(x){return+x}).reduce(function(x,O,L){return L%2?x+9*O:x+3*O},0)%10}(this.data)];return{data:"1011"+(0,I.default)(this.data,x,"01"),text:this.text}}}]),g}(E(d(74648)).default);C.default=m},42523:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function c(m,p){for(var g=0;g<p.length;g++){var b=p[g];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(m,b.key,b)}}
1return function(m,p,g){return p&&c(m.prototype,p),g&&c(m,g),m}}(),S=function c(m,p,g){null===m&&(m=Function.prototype);var b=Object.getOwnPropertyDescriptor(m,p);if(void 0===b){var x=Object.getPrototypeOf(m);return null===x?void 0:c(x,p,g)}if("value"in b)return b.value;var O=b.get;return void 0===O?void 0:O.call(g)},I=function e(c){return c&&c.__esModule?c:{default:c}}(d(67417)),v=function(m){return(10-m.substr(0,7).split("").map(function(g){return+g}).reduce(function(g,b,x){return x%2?g+b:g+3*b},0)%10)%10},s=function(c){function m(p,g){return function k(c,m){if(!(c instanceof m))throw new TypeError("Cannot call a class as a function")}(this,m),-1!==p.search(/^[0-9]{7}$/)&&(p+=v(p)),function E(c,m){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||"object"!=typeof m&&"function"!=typeof m?c:m}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,p,g))}return function P(c,m){if("function"!=typeof m&&null!==m)throw new TypeError("Super expression must either be null or a function, not "+typeof m);c.prototype=Object.create(m&&m.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(c,m):c.__proto__=m)}(m,c),y(m,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===v(this.data)}},{key:"leftText",value:function(){return S(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var g=this.data.substr(0,4);return S(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"leftEncode",this).call(this,g,"LLLL")}},{key:"rightText",value:function(){return S(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var g=this.data.substr(4,4);return S(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"rightEncode",this).call(this,g,"RRRR")}}]),m}(I.default);C.default=s},54102:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function m(p,g){for(var b=0;b<g.length;b++){var x=g[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}return function(p,g,b){return g&&m(p.prototype,g),b&&m(p,b),p}}();C.checksum=c;var u=k(d(29259));function k(m){return m&&m.__esModule?m:{default:m}}var s=function(m){function p(g,b){(function E(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")})(this,p),-1!==g.search(/^[0-9]{11}$/)&&(g+=c(g));var x=function P(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!p||"object"!=typeof p&&"function"!=typeof p?m:p}(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,g,b));return x.displayValue=b.displayValue,x.fontSize=b.fontSize>10*b.width?10*b.width:b.fontSize,x.guardHeight=b.height+x.fontSize/2+b.textMargin,x}return function v(m,p){if("function"!=typeof p&&null!==p)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}(p,m),y(p,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==c(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var b="";return b+="101",b+=(0,u.default)(this.data.substr(0,6),"LLLLLL"),b+="01010",b+=(0,u.default)(this.data.substr(6,6),"RRRRRR"),{data:b+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var b=[];return this.displayValue&&b.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),b.push({data:"101"+(0,u.default)(this.data[0],"L"),options:{height:this.guardHeight}}),b.push({data:(0,u.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),b.push({data:"01010",options:{height:this.guardHeight}}
vendor: 4,189 bytes, line 1
1),b.push({data:(0,u.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),b.push({data:(0,u.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&b.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),b}}]),p}(k(d(74648)).default);function c(m){var g,p=0;for(g=1;g<11;g+=2)p+=parseInt(m[g]);for(g=0;g<11;g+=2)p+=3*parseInt(m[g]);return(10-p%10)%10}C.default=s},91285:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function b(x,O){for(var L=0;L<O.length;L++){var N=O[L];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,N.key,N)}}return function(x,O,L){return O&&b(x.prototype,O),L&&b(x,L),x}}(),u=E(d(29259)),e=E(d(74648)),k=d(54102);function E(b){return b&&b.__esModule?b:{default:b}}function v(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!x||"object"!=typeof x&&"function"!=typeof x?b:x}var c=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],m=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],p=function(b){function x(O,L){!function P(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}(this,x);var N=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,O,L));if(N.isValid=!1,-1!==O.search(/^[0-9]{6}$/))N.middleDigits=O,N.upcA=g(O,"0"),N.text=L.text||""+N.upcA[0]+O+N.upcA[N.upcA.length-1],N.isValid=!0;else{if(-1===O.search(/^[01][0-9]{7}$/))return v(N);if(N.middleDigits=O.substring(1,O.length-1),N.upcA=g(N.middleDigits,O[0]),N.upcA[N.upcA.length-1]!==O[O.length-1])return v(N);N.isValid=!0}return N.displayValue=L.displayValue,N.fontSize=L.fontSize>10*L.width?10*L.width:L.fontSize,N.guardHeight=L.height+N.fontSize/2+L.textMargin,N}return function s(b,x){if("function"!=typeof x&&null!==x)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}(x,b),y(x,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var L="";return L+="101",L+=this.encodeMiddleDigits(),{data:L+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var L=[];return this.displayValue&&L.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),L.push({data:"101",options:{height:this.guardHeight}}),L.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),L.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&L.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),L}},{key:"encodeMiddleDigits",value:function(){var L=this.upcA[0],oe=m[parseInt(this.upcA[this.upcA.length-1])][parseInt(L)];return(0,u.default)(this.middleDigits,oe)}}]),x}(e.default);function g(b,x){for(var O=parseInt(b[b.length-1]),L=c[O],N="",oe=0,Ae=0;Ae<L.length;Ae++){var Ve=L[Ae];N+="X"===Ve?b[oe++]:Ve}return(N=""+x+N)+(0,k.checksum)(N)}C.default=p},53819:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.SIDE_BIN="101",C.MIDDLE_BIN="01010",C.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}
1,C.EAN2_STRUCTURE=["LL","LG","GL","GG"],C.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],C.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},29259:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=d(53819);C.default=function(I,e,k){var E=I.split("").map(function(v,s){return y.BINARIES[e[s]]}).map(function(v,s){return v?v[I[s]]:""});if(k){var P=I.length-1;E=E.map(function(v,s){return s<P?v+k:v})}return E.join("")}},17422:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.UPCE=C.UPC=C.EAN2=C.EAN5=C.EAN8=C.EAN13=void 0;var S=p(d(16195)),I=p(d(42523)),k=p(d(55174)),P=p(d(54500)),s=p(d(54102)),m=p(d(91285));function p(g){return g&&g.__esModule?g:{default:g}}C.EAN13=S.default,C.EAN8=I.default,C.EAN5=k.default,C.EAN2=P.default,C.UPC=s.default,C.UPCE=m.default},791:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.GenericBarcode=void 0;var y=function(){function v(s,c){for(var m=0;m<c.length;m++){var p=c[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(s,p.key,p)}}return function(s,c,m){return c&&v(s.prototype,c),m&&v(s,m),s}}(),P=function(v){function s(c,m){return function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c,m))}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),y(s,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),s}(function I(v){return v&&v.__esModule?v:{default:v}}(d(74648)).default);C.GenericBarcode=P},13435:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),S=d(5306);function k(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}function E(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}var v=function(s){function c(){return k(this,c),E(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function P(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var p=this,g=this.data.match(/.{2}/g).map(function(b){return p.encodePair(b)}).join("");return{data:S.START_BIN+g+S.END_BIN,text:this.text}}},{key:"encodePair",value:function(p){var g=S.BINARIES[p[1]];return S.BINARIES[p[0]].split("").map(function(b,x){return("1"===b?"111":"1")+("1"===g[x]?"000":"0")}).join("")}}]),c}(function e(s){return s&&s.__esModule?s:{default:s}}(d(74648)).default);C.default=v},20580:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),u=function I(s){return s&&s.__esModule?s:{default:s}}(d(13435)),P=function(c){var m=c.substr(0,13).split("").map(function(p){return parseInt(p,10)}).reduce(function(p,g,b){return p+g*(3-b%2*2)},0);return 10*Math.ceil(m/10)-m},v=function(s){function c(m,p){return function e(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),-1!==m.search(/^[0-9]{13}$/)&&(m+=P(m)),function k(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,m,p))}return function E(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===P(this.data)}}]),c}(u.default);C.default=v},5306:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.START_BIN="1010",C.END_BIN="11101",C.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},27191:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.ITF14=C.ITF=void 0;var S=e(d(13435)),I=e(d(20580));function e(k){return k&&k.__esModule?k:{default:k}}C.ITF=S.default,C.ITF14=I.default},66431:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function s(c,m){for(var p=0;p<m.length;p++){var g=m[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}return function(c,m,p){return m&&s(c.prototype,m),p&&s(c,p),c}}(),P=function(s){function c(m,p){return function e(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}(this,c),function k(s,c){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!=typeof c&&"function"!=typeof c?s:c}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,m,p))}return function E(s,c){if("function"!=typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);s.prototype=Object.create(c&&c.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(s,c):s.__proto__=c)}(c,s),y(c,[{key:"encode",value:function(){for(var p="110",g=0;g<this.data.length;g++){var x=parseInt(this.data[g]).toString(2);x=v(x,4-x.length);for(var O=0;O<x.length;O++)p+="0"==x[O]?"100":"110"}return{data:p+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),c}(function I(s){return s&&s.__esModule?s:{default:s}}(d(74648)).default);function v(s,c){for(var m=0;m<c;m++)s="0"+s;return s}C.default=P},7218:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});
1var S=function I(v){return v&&v.__esModule?v:{default:v}}(d(66431)),u=d(96855),P=function(v){function s(c,m){return function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c+(0,u.mod10)(c),m))}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),s}(S.default);C.default=P},49762:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=function I(v){return v&&v.__esModule?v:{default:v}}(d(66431)),u=d(96855),P=function(v){function s(c,m){return function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),c+=(0,u.mod10)(c),c+=(0,u.mod10)(c),function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c,m))}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),s}(S.default);C.default=P},23117:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=function I(v){return v&&v.__esModule?v:{default:v}}(d(66431)),u=d(96855),P=function(v){function s(c,m){return function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c+(0,u.mod11)(c),m))}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),s}(S.default);C.default=P},71878:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=function I(v){return v&&v.__esModule?v:{default:v}}(d(66431)),u=d(96855),P=function(v){function s(c,m){return function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),c+=(0,u.mod11)(c),c+=(0,u.mod10)(c),function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c,m))}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),s}(S.default);C.default=P},96855:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.mod10=function d(S){for(var u=0,I=0;I<S.length;I++){var e=parseInt(S[I]);u+=(I+S.length)%2==0?e:2*e%10+Math.floor(2*e/10)}return(10-u%10)%10},C.mod11=function y(S){for(var u=0,I=[2,3,4,5,6,7],e=0;e<S.length;e++){var k=parseInt(S[S.length-1-e]);u+=I[e%I.length]*k}return(11-u%11)%11}},11247:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.MSI1110=C.MSI1010=C.MSI11=C.MSI10=C.MSI=void 0;var S=c(d(66431)),I=c(d(7218)),k=c(d(23117)),P=c(d(49762)),s=c(d(71878));function c(m){return m&&m.__esModule?m:{default:m}}C.MSI=S.default,C.MSI10=I.default,C.MSI11=k.default,C.MSI1010=P.default,C.MSI1110=s.default},22250:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.codabar=void 0;var y=function(){function v(s,c){for(var m=0;m<c.length;m++){var p=c[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(s,p.key,p)}}return function(s,c,m){return c&&v(s.prototype,c),m&&v(s,m),s}}(),P=function(v){function s(c,m){(function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")})(this,s),0===c.search(/^[0-9\-\$\:\.\+\/]+$/)&&(c="A"+c+"A");var p=function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c.toUpperCase(),m));return p.text=p.options.text||p.text.replace(/[A-D]/g,""),p}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),y(s,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var m=[],p=this.getEncodings(),g=0;g<this.data.length;g++)m.push(p[this.data.charAt(g)]),g!==this.data.length-1&&m.push("0");return{text:this.text,data:m.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),s}
1(function I(v){return v&&v.__esModule?v:{default:v}}(d(74648)).default);C.codabar=P},49721:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=d(80528),S=d(56038),u=d(17422),I=d(27191),e=d(11247),k=d(87624),E=d(22250),P=d(791);C.default={CODE39:y.CODE39,CODE128:S.CODE128,CODE128A:S.CODE128A,CODE128B:S.CODE128B,CODE128C:S.CODE128C,EAN13:u.EAN13,EAN8:u.EAN8,EAN5:u.EAN5,EAN2:u.EAN2,UPC:u.UPC,UPCE:u.UPCE,ITF14:I.ITF14,ITF:I.ITF,MSI:e.MSI,MSI10:e.MSI10,MSI11:e.MSI11,MSI1010:e.MSI1010,MSI1110:e.MSI1110,pharmacode:k.pharmacode,codabar:E.codabar,GenericBarcode:P.GenericBarcode}},87624:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.pharmacode=void 0;var y=function(){function v(s,c){for(var m=0;m<c.length;m++){var p=c[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(s,p.key,p)}}return function(s,c,m){return c&&v(s.prototype,c),m&&v(s,m),s}}(),P=function(v){function s(c,m){!function e(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s);var p=function k(v,s){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!s||"object"!=typeof s&&"function"!=typeof s?v:s}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,c,m));return p.number=parseInt(c,10),p}return function E(v,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function, not "+typeof s);v.prototype=Object.create(s&&s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(v,s):v.__proto__=s)}(s,v),y(s,[{key:"encode",value:function(){for(var m=this.number,p="";!isNaN(m)&&0!=m;)m%2==0?(p="11100"+p,m=(m-2)/2):(p="100"+p,m=(m-1)/2);return{data:p=p.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),s}(function I(v){return v&&v.__esModule?v:{default:v}}(d(74648)).default);C.pharmacode=P},3930:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0});var d=function(){function u(I,e){for(var k=0;k<e.length;k++){var E=e[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(I,E.key,E)}}return function(I,e,k){return e&&u(I.prototype,e),k&&u(I,k),I}}(),S=function(){function u(I){(function y(u,I){if(!(u instanceof I))throw new TypeError("Cannot call a class as a function")})(this,u),this.api=I}return d(u,[{key:"handleCatch",value:function(e){if("InvalidInputException"!==e.name)throw e;if(this.api._options.valid===this.api._defaults.valid)throw e.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(e){try{var k=e.apply(void 0,arguments);return this.api._options.valid(!0),k}catch(E){return this.handleCatch(E),this.api}}}]),u}();C.default=S},87497:(G,C)=>{function d(k,E){if(!(k instanceof E))throw new TypeError("Cannot call a class as a function")}function y(k,E){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!E||"object"!=typeof E&&"function"!=typeof E?k:E}function S(k,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function, not "+typeof E);k.prototype=Object.create(E&&E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(k,E):k.__proto__=E)}Object.defineProperty(C,"__esModule",{value:!0});var u=function(k){function E(P,v){d(this,E);var s=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return s.name="InvalidInputException",s.symbology=P,s.input=v,s.message='"'+s.input+'" is not a valid input for '+s.symbology,s}return S(E,Error),E}(),I=function(k){function E(){d(this,E);var P=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return P.name="InvalidElementException",P.message="Not supported type to render on",P}return S(E,Error),E}(),e=function(k){function E(){d(this,E);var P=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));return P.name="NoElementException",P.message="No element to render on.",P}return S(E,Error),E}();C.InvalidInputException=u,C.InvalidElementException=I,C.NoElementException=e},13800:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.default=function d(y){return y.marginTop=y.marginTop||y.margin,y.marginBottom=y.marginBottom||y.margin,y.marginRight=y.marginRight||y.margin,y.marginLeft=y.marginLeft||y.margin,y}},96428:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=e(d(40070)),I=e(d(97850));function e(E){return E&&E.__esModule?E:{default:E}
1}C.default=function k(E){var P={};for(var v in I.default)I.default.hasOwnProperty(v)&&(E.hasAttribute("jsbarcode-"+v.toLowerCase())&&(P[v]=E.getAttribute("jsbarcode-"+v.toLowerCase())),E.hasAttribute("data-"+v.toLowerCase())&&(P[v]=E.getAttribute("data-"+v.toLowerCase())));return P.value=E.getAttribute("jsbarcode-value")||E.getAttribute("data-value"),(0,S.default)(P)}},41731:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},u=E(d(96428)),e=E(d(82216)),k=d(87497);function E(c){return c&&c.__esModule?c:{default:c}}C.default=function P(c){if("string"==typeof c)return function v(c){var m=document.querySelectorAll(c);if(0!==m.length){for(var p=[],g=0;g<m.length;g++)p.push(P(m[g]));return p}}(c);if(Array.isArray(c)){for(var m=[],p=0;p<c.length;p++)m.push(P(c[p]));return m}if("undefined"!=typeof HTMLCanvasElement&&c instanceof HTMLImageElement)return function s(c){var m=document.createElement("canvas");return{element:m,options:(0,u.default)(c),renderer:e.default.CanvasRenderer,afterRender:function(){c.setAttribute("src",m.toDataURL())}}}(c);if(c&&c.nodeName&&"svg"===c.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&c instanceof SVGElement)return{element:c,options:(0,u.default)(c),renderer:e.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&c instanceof HTMLCanvasElement)return{element:c,options:(0,u.default)(c),renderer:e.default.CanvasRenderer};if(c&&c.getContext)return{element:c,renderer:e.default.CanvasRenderer};if(c&&"object"===(void 0===c?"undefined":y(c))&&!c.nodeName)return{element:c,renderer:e.default.ObjectRenderer};throw new k.InvalidElementException}},76162:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.default=function d(y){var S=[];return function u(I){if(Array.isArray(I))for(var e=0;e<I.length;e++)u(I[e]);else I.text=I.text||"",I.data=I.data||"",S.push(I)}(y),S}},44070:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0});var d=Object.assign||function(y){for(var S=1;S<arguments.length;S++){var u=arguments[S];for(var I in u)Object.prototype.hasOwnProperty.call(u,I)&&(y[I]=u[I])}return y};C.default=function(y,S){return d({},y,S)}},40070:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.default=function d(y){var S=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var u in S)S.hasOwnProperty(u)&&"string"==typeof y[u=S[u]]&&(y[u]=parseInt(y[u],10));return"string"==typeof y.displayValue&&(y.displayValue="false"!=y.displayValue),y}},97850:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}}},70726:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function P(v,s){for(var c=0;c<s.length;c++){var m=s[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(v,m.key,m)}}return function(v,s,c){return s&&P(v.prototype,s),c&&P(v,c),v}}(),u=function e(P){return P&&P.__esModule?P:{default:P}}(d(44070)),I=d(83737),E=function(){function P(v,s,c){(function k(P,v){if(!(P instanceof v))throw new TypeError("Cannot call a class as a function")})(this,P),this.canvas=v,this.encodings=s,this.options=c}return y(P,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var s=0;s<this.encodings.length;s++){var c=(0,u.default)(this.options,this.encodings[s].options);this.drawCanvasBarcode(c,this.encodings[s]),this.drawCanvasText(c,this.encodings[s]),this.moveCanvasDrawing(this.encodings[s])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var s=this.canvas.getContext("2d");s.save(),(0,I.calculateEncodingAttributes)(this.encodings,this.options,s);var c=(0,I.getTotalWidthOfEncodings)(this.encodings),m=(0,I.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=c+this.options.marginLeft+this.options.marginRight,this.canvas.height=m,s.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(s.fillStyle=this.options.background,s.fillRect(0,0,this.canvas.width,this.canvas.height)),s.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(s,c){var g,m=this.canvas.getContext("2d"),p=c.data;g="top"==s.textPosition?s.marginTop+s.fontSize+s.textMargin:s.marginTop,m.fillStyle=s.lineColor;for(var b=0;b<p.length;b++){var x=b*s.width+c.barcodePadding;"1"===p[b]?m.fillRect(x,g,s.width,s.height):p[b]&&m.fillRect(x,g,s.width,s.height*p[b])}}},{key:"drawCanvasText",value:function(s,c){var g,b,m=this.canvas.getContext("2d");s.displayValue&&(b="top"==s.textPosition?s.marginTop+s.fontSize-s.textMargin:s.height+s.textMargin+s.marginTop+s.fontSize,m.font=s.fontOptions+" "+s.fontSize+"px "+s.font,"left"==s.textAlign||c.barcodePadding>0?(g=0,m.textAlign="left"):"right"==s.textAlign?(g=c.width-1,m.textAlign="right"):(g=c.width/2,m.textAlign="center"),m.fillText(c.text,g,b))}},{key:"moveCanvasDrawing",value:function(s){this.canvas.getContext("2d").translate(s.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore(
1)}}]),P}();C.default=E},82216:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var S=E(d(70726)),I=E(d(37902)),k=E(d(8138));function E(P){return P&&P.__esModule?P:{default:P}}C.default={CanvasRenderer:S.default,SVGRenderer:I.default,ObjectRenderer:k.default}},8138:(G,C)=>{Object.defineProperty(C,"__esModule",{value:!0});var d=function(){function u(I,e){for(var k=0;k<e.length;k++){var E=e[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(I,E.key,E)}}return function(I,e,k){return e&&u(I.prototype,e),k&&u(I,k),I}}(),S=function(){function u(I,e,k){(function y(u,I){if(!(u instanceof I))throw new TypeError("Cannot call a class as a function")})(this,u),this.object=I,this.encodings=e,this.options=k}return d(u,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),u}();C.default=S},83737:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.getTotalWidthOfEncodings=C.calculateEncodingAttributes=C.getBarcodePadding=C.getEncodingHeight=C.getMaximumHeightOfEncodings=void 0;var S=function u(s){return s&&s.__esModule?s:{default:s}}(d(44070));function I(s,c){return c.height+(c.displayValue&&s.text.length>0?c.fontSize+c.textMargin:0)+c.marginTop+c.marginBottom}function e(s,c,m){if(m.displayValue&&c<s){if("center"==m.textAlign)return Math.floor((s-c)/2);if("left"==m.textAlign)return 0;if("right"==m.textAlign)return Math.floor(s-c)}return 0}function v(s,c,m){var p;if(m)p=m;else{if("undefined"==typeof document)return 0;p=document.createElement("canvas").getContext("2d")}p.font=c.fontOptions+" "+c.fontSize+"px "+c.font;var g=p.measureText(s);return g?g.width:0}C.getMaximumHeightOfEncodings=function P(s){for(var c=0,m=0;m<s.length;m++)s[m].height>c&&(c=s[m].height);return c},C.getEncodingHeight=I,C.getBarcodePadding=e,C.calculateEncodingAttributes=function k(s,c,m){for(var p=0;p<s.length;p++){var x,g=s[p],b=(0,S.default)(c,g.options);x=b.displayValue?v(g.text,b,m):0;var O=g.data.length*b.width;g.width=Math.ceil(Math.max(x,O)),g.height=I(g,b),g.barcodePadding=e(x,O,b)}},C.getTotalWidthOfEncodings=function E(s){for(var c=0,m=0;m<s.length;m++)c+=s[m].width;return c}},37902:(G,C,d)=>{Object.defineProperty(C,"__esModule",{value:!0});var y=function(){function v(s,c){for(var m=0;m<c.length;m++){var p=c[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(s,p.key,p)}}return function(s,c,m){return c&&v(s.prototype,c),m&&v(s,m),s}}(),u=function e(v){return v&&v.__esModule?v:{default:v}}(d(44070)),I=d(83737),E="http://www.w3.org/2000/svg",P=function(){function v(s,c,m){(function k(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")})(this,v),this.svg=s,this.encodings=c,this.options=m,this.document=m.xmlDocument||document}return y(v,[{key:"render",value:function(){var c=this.options.marginLeft;this.prepareSVG();for(var m=0;m<this.encodings.length;m++){var p=this.encodings[m],g=(0,u.default)(this.options,p.options),b=this.createGroup(c,g.marginTop,this.svg);this.setGroupOptions(b,g),this.drawSvgBarcode(b,g,p),this.drawSVGText(b,g,p),c+=p.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,I.calculateEncodingAttributes)(this.encodings,this.options);var c=(0,I.getTotalWidthOfEncodings)(this.encodings),m=(0,I.getMaximumHeightOfEncodings)(this.encodings),p=c+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(p,m),this.options.background&&this.drawRect(0,0,p,m,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(c,m,p){var b,g=p.data;b="top"==m.textPosition?m.fontSize+m.textMargin:0;for(var x=0,O=0,L=0;L<g.length;L++)O=L*m.width+p.barcodePadding,"1"===g[L]?x++:x>0&&(this.drawRect(O-m.width*x,b,m.width*x,m.height,c),x=0);x>0&&this.drawRect(O-m.width*(x-1),b,m.width*x,m.height,c)}},{key:"drawSVGText",value:function(c,m,p){var b,x,g=this.document.createElementNS(E,"text");m.displayValue&&(g.setAttribute("style","font:"+m.fontOptions+" "+m.fontSize+"px "+m.font),x="top"==m.textPosition?m.fontSize-m.textMargin:m.height+m.textMargin+m.fontSize,"left"==m.textAlign||p.barcodePadding>0?(b=0,g.setAttribute("text-anchor","start")):"right"==m.textAlign?(b=p.width-1,g.setAttribute("text-anchor","end")):(b=p.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",b),g.setAttribute("y",x),g.appendChild(this.document.createTextNode(p.text)),c.appendChild(g))}},{key:"setSvgAttributes",value:function(c,m){var p=this.svg;p.setAttribute("width",c+"px"),p.setAttribute("height",m+"px"),p.setAttribute("x","0px"),p.setAttribute("y","0px"),p.setAttribute("viewBox","0 0 "+c+" "+m),p.setAttribute("xmlns",E),p.setAttribute("version","1.1"),p.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(c,m,p){var g=this.document.createElementNS(E,"g");return g.setAttribute("transform","translate("+c+", "+m+")"),p.appendChild(g),g}},{key:"setGroupOptions",value:function(c,m){c.setAttribute("style","fill:"+m.lineColor+";")}},{key:"drawRect",value:function(c,m,p,g,b){var x=this.document.createElementNS(E,"rect");return x.setAttribute("x",c),x.setAttribute("y",m),x.setAttribute("width",p),x.setAttribute("height",g),b.appendChild(x),x}}]),v}();C.default=P}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.