var __runInitializers=this&&this.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i=0;i--){var context={};for(var p in contextIn)context[p]="access"===p?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])("accessor"===kind?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if("accessor"===kind){if(void 0===result)continue;if(null===result||"object"!=typeof result)throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&("field"===kind?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0};import{TcHmiControl}from"Beckhoff.TwinCAT.HMI.Framework/index.esm.js";let TcHmiMultiState=(()=>{var _a,_b,_c,_d,_e;let ___onResolverForStateListWatchCallback_decorators,___onResolverForFallbackBackgroundColorWatchCallback_decorators,___onResolverForTextColorWatchCallback_decorators,___onResolverForTextPaddingWatchCallback_decorators,___onResolverForIconPaddingWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiMultiState extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onResolverForStateListWatchCallback_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onResolverForFallbackBackgroundColorWatchCallback_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],___onResolverForTextColorWatchCallback_decorators=[(_c=TcHmi).CallbackMethod.bind(_c)],___onResolverForTextPaddingWatchCallback_decorators=[(_d=TcHmi).CallbackMethod.bind(_d)],___onResolverForIconPaddingWatchCallback_decorators=[(_e=TcHmi).CallbackMethod.bind(_e)],__esDecorate(this,null,___onResolverForStateListWatchCallback_decorators,{kind:"method",name:"__onResolverForStateListWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForStateListWatchCallback"in obj,get:obj=>obj.__onResolverForStateListWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForFallbackBackgroundColorWatchCallback_decorators,{kind:"method",name:"__onResolverForFallbackBackgroundColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForFallbackBackgroundColorWatchCallback"in obj,get:obj=>obj.__onResolverForFallbackBackgroundColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForTextColorWatchCallback_decorators,{kind:"method",name:"__onResolverForTextColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForTextColorWatchCallback"in obj,get:obj=>obj.__onResolverForTextColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForTextPaddingWatchCallback_decorators,{kind:"method",name:"__onResolverForTextPaddingWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForTextPaddingWatchCallback"in obj,get:obj=>obj.__onResolverForTextPaddingWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForIconPaddingWatchCallback_decorators,{kind:"method",name:"__onResolverForIconPaddingWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForIconPaddingWatchCallback"in obj,get:obj=>obj.__onResolverForIconPaddingWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),_metadata&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static#tchmiFQN="TcHmi.Controls.Beckhoff."+this.name;constructor(element,pcElement,attrs){super(element,pcElement,attrs)}__elementTemplateRoot=__runInitializers(this,_instanceExtraInitializers);__elementBackgroundColor;__elementIcon;__elementText;__elementTextSpan;__state;__stateList;__ignoreTypeSafety;__fallbackIcon;__fallbackBackgroundColor;__textColor;__fallbackText;__textHorizontalAlignment;__textVerticalAlignment;__wordWrap;__textPadding;__textFontSize;__textFontSizeUnit;__textFontFamily;__textFontStyle;__textFontWeight;__iconWidth;__iconWidthUnit;__iconHeight;__iconHeightUnit;__iconHorizontalAlignment;__iconVerticalAlignment;__iconPadding;__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiMultiState-template")[0],!this.__elementTemplateRoot)throw new Error("Invalid Template.html");this.__elementBackgroundColor=this.__elementTemplateRoot.getElementsByClassName("multi-state-background-color")[0],this.__elementIcon=this.__elementTemplateRoot.getElementsByClassName("multi-state-icon")[0],this.__elementText=this.__elementTemplateRoot.getElementsByClassName("multi-state-text")[0],this.__elementTextSpan=this.__elementText.getElementsByClassName("multi-state-text-span")[0],super.__previnit()}__init(){super.__init()}__attach(){super.__attach(),this.__handleState()}__detach(){if(super.__detach(),TCHMI_DESIGNER){const existingMessage=this.__element[0].querySelector(".tchmi-designer-control-message");existingMessage&&this.__elementTemplateRoot.removeChild(existingMessage)}}destroy(){this.__keepAlive||super.destroy()}__displayCurrentState(state){if(!state)return this.__elementIcon.style.visibility="hidden",this.__elementBackgroundColor.style.visibility="hidden",void(this.__elementText.style.visibility="hidden");if(state.stateBackgroundColor){let cssBackgroundColor="";cssBackgroundColor=TcHmi.isSolidColor(state.stateBackgroundColor)?TcHmi.StyleProvider.resolveSolidColorAsCssValue(state.stateBackgroundColor):TcHmi.StyleProvider.resolveLinearGradientColorAsCssValue(state.stateBackgroundColor),this.__elementBackgroundColor.style.visibility="visible",this.__elementBackgroundColor.style.background=cssBackgroundColor}else this.__elementBackgroundColor.style.visibility="hidden",this.__elementBackgroundColor.style.background="";state.stateIcon?(this.__elementIcon.style.visibility="visible",this.__elementIcon.style.backgroundImage=`url(${tchmi_path(state.stateIcon)})`):(this.__elementIcon.style.visibility="hidden",this.__elementIcon.style.backgroundImage=""),state.stateText?(this.__elementText.style.visibility="visible",this.__elementTextSpan.textContent=tchmi_decode_control_characters(state.stateText)):(this.__elementText.style.visibility="hidden",this.__elementTextSpan.textContent="")}__handleState(){if(this.__stateList){const fallBacksDefined=!!(this.__fallbackIcon||this.__fallbackBackgroundColor||this.__fallbackText);for(let v of this.__stateList)if(tchmi_equal(v.state,this.__state,{convertPrimitives:this.__ignoreTypeSafety})){if(this.__displayCurrentState(v),TCHMI_DESIGNER){const existingMessage=this.__element[0].querySelector(".tchmi-designer-control-message");existingMessage&&this.__elementTemplateRoot.removeChild(existingMessage)}return}if(!fallBacksDefined){if(this.__displayCurrentState(null),TCHMI_DESIGNER){const designerMessage=this.__element.find(".tchmi-designer-control-message")[0]??document.createElement("div");designerMessage.classList.add("tchmi-designer-control-message"),designerMessage.innerHTML="",designerMessage.append("No configured fallbacks.",document.createElement("br"),"Please add at least one fallback icon, background color, and text for the case the current state is not defined in the state list."),this.__elementTemplateRoot.append(designerMessage)}return}if(this.__displayCurrentState({state:this.__state,stateIcon:this.__fallbackIcon,stateBackgroundColor:this.__fallbackBackgroundColor,stateText:this.__fallbackText}),TCHMI_DESIGNER){const existingMessage=this.__element[0].querySelector(".tchmi-designer-control-message");existingMessage&&this.__elementTemplateRoot.removeChild(existingMessage)}}else if(this.__displayCurrentState(null),TCHMI_DESIGNER){const designerMessage=this.__element.find(".tchmi-designer-control-message")[0]??document.createElement("div");designerMessage.classList.add("tchmi-designer-control-message"),designerMessage.innerHTML="",designerMessage.append("No configured StateList.",document.createElement("br"),"Please add definitions for states."),this.__elementTemplateRoot.append(designerMessage)}}setState(valueNew){null===valueNew&&(valueNew=this.getAttributeDefaultValueInternal("State")),valueNew!==this.__state&&(this.__state=valueNew,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"State"}),this.__processState())}getState(){return this.__state}__processState(){this.__isAttached&&this.__handleState()}setStateList(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("StateList"));let resolverInfo=this.__objectResolvers.get("stateList");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("StateList")?.type});this.__objectResolvers.set("stateList",{resolver,watchCallback:this.__onResolverForStateListWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForStateListWatchCallback)})}__onResolverForStateListWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("stateList"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__stateList)||(this.__stateList=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"StateList"}),this.__processStateList()):TcHmi.Log.Controls.error(this,TcHmiMultiState.#tchmiFQN,{Attribute:"StateList"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getStateList(){return this.__stateList}__processStateList(){this.__isAttached&&this.__handleState()}setIgnoreTypeSafety(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IgnoreTypeSafety")),convertedValue!==this.__ignoreTypeSafety&&(this.__ignoreTypeSafety=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IgnoreTypeSafety"}),this.__processIgnoreTypeSafety())}getIgnoreTypeSafety(){return this.__ignoreTypeSafety}__processIgnoreTypeSafety(){this.__isAttached&&this.__handleState()}setFallbackIcon(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("FallbackIcon")),convertedValue!==this.__fallbackIcon&&(this.__fallbackIcon=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"FallbackIcon"}),this.__processFallbackIcon())}getFallbackIcon(){return this.__fallbackIcon}__processFallbackIcon(){this.__isAttached&&this.__handleState()}setFallbackBackgroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("FallbackBackgroundColor"));let resolverInfo=this.__objectResolvers.get("fallbackBackgroundColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("FallbackBackgroundColor")?.type});this.__objectResolvers.set("fallbackBackgroundColor",{resolver,watchCallback:this.__onResolverForFallbackBackgroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForFallbackBackgroundColorWatchCallback)})}__onResolverForFallbackBackgroundColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("fallbackBackgroundColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__fallbackBackgroundColor)||(this.__fallbackBackgroundColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"FallbackBackgroundColor"}),this.__processFallbackBackgroundColor()):TcHmi.Log.Controls.error(this,TcHmiMultiState.#tchmiFQN,{Attribute:"FallbackBackgroundColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getFallbackBackgroundColor(){return this.__fallbackBackgroundColor}__processFallbackBackgroundColor(){this.__isAttached&&this.__handleState()}setTextColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextColor"));let resolverInfo=this.__objectResolvers.get("textColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("TextColor")?.type});this.__objectResolvers.set("textColor",{resolver,watchCallback:this.__onResolverForTextColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTextColorWatchCallback)})}__onResolverForTextColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("textColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__textColor)||(this.__textColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextColor"}),this.__processTextColor()):TcHmi.Log.Controls.error(this,TcHmiMultiState.#tchmiFQN,{Attribute:"TextColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTextColor(){return this.__textColor}__processTextColor(){TcHmi.StyleProvider.processTextColor(this.__elementText,this.__textColor)}setFallbackText(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("FallbackText")),convertedValue!==this.__fallbackText&&(this.__fallbackText=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"FallbackText"}),this.__processFallbackText())}getFallbackText(){return this.__fallbackText}__processFallbackText(){this.__isAttached&&this.__handleState()}setTextHorizontalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toHorizontalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextHorizontalAlignment")),convertedValue!==this.__textHorizontalAlignment&&(this.__textHorizontalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextHorizontalAlignment"}),this.__processTextHorizontalAlignment())}getTextHorizontalAlignment(){return this.__textHorizontalAlignment}__processTextHorizontalAlignment(){switch(this.__textHorizontalAlignment){case"Center":this.__elementText.style.justifyContent="center",this.__elementTextSpan.style.textAlign="center";break;case"Right":this.__elementText.style.justifyContent="right",this.__elementTextSpan.style.textAlign="right";break;case"Left":this.__elementText.style.justifyContent="left",this.__elementTextSpan.style.textAlign="left";break;default:this.__elementText.style.justifyContent="",this.__elementTextSpan.style.textAlign=""}}setTextVerticalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toVerticalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextVerticalAlignment")),convertedValue!==this.__textVerticalAlignment&&(this.__textVerticalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextVerticalAlignment"}),this.__processTextVerticalAlignment())}getTextVerticalAlignment(){return this.__textVerticalAlignment}__processTextVerticalAlignment(){switch(this.__textVerticalAlignment){case"Center":this.__elementText.style.alignItems="center";break;case"Bottom":this.__elementText.style.alignItems="end";break;case"Top":this.__elementText.style.alignItems="start";break;default:this.__elementText.style.alignItems=""}}setWordWrap(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("WordWrap")),convertedValue!==this.__wordWrap&&(this.__wordWrap=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"WordWrap"}),this.__processWordWrap())}getWordWrap(){return this.__wordWrap}__processWordWrap(){this.__wordWrap?this.__elementTextSpan.style.whiteSpace="pre-wrap":this.__elementTextSpan.style.whiteSpace="pre"}setTextPadding(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextPadding"));let resolverInfo=this.__objectResolvers.get("textPadding");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("TextPadding")?.type});this.__objectResolvers.set("textPadding",{resolver,watchCallback:this.__onResolverForTextPaddingWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTextPaddingWatchCallback)})}__onResolverForTextPaddingWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("textPadding"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__textPadding)||(this.__textPadding=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextPadding"}),this.__processTextPadding()):TcHmi.Log.Controls.error(this,TcHmiMultiState.#tchmiFQN,{Attribute:"TextPadding"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTextPadding(){return this.__textPadding}__processTextPadding(){TcHmi.StyleProvider.processContentPadding(this.__elementText,this.__textPadding)}setTextFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSize")),convertedValue!==this.__textFontSize&&(this.__textFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSize"}),this.__processTextFontSize())}getTextFontSize(){return this.__textFontSize}__processTextFontSize(){this.__textFontSize?this.__elementTextSpan.style.fontSize=this.__textFontSize+(this.__textFontSizeUnit??"px"):this.__elementTextSpan.style.fontSize=""}setTextFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSizeUnit")),convertedValue!==this.__textFontSizeUnit&&(this.__textFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSizeUnit"}),this.__processTextFontSizeUnit())}getTextFontSizeUnit(){return this.__textFontSizeUnit}__processTextFontSizeUnit(){this.__processTextFontSize()}setTextFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontFamily")),convertedValue!==this.__textFontFamily&&(this.__textFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontFamily"}),this.__processTextFontFamily())}getTextFontFamily(){return this.__textFontFamily}__processTextFontFamily(){this.__elementTextSpan.style.fontFamily=this.__textFontFamily??""}setTextFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontStyle")),convertedValue!==this.__textFontStyle&&(this.__textFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontStyle"}),this.__processTextFontStyle())}getTextFontStyle(){return this.__textFontStyle}__processTextFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__elementText,this.__textFontStyle)}setTextFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontWeight")),convertedValue!==this.__textFontWeight&&(this.__textFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontWeight"}),this.__processTextFontWeight())}getTextFontWeight(){return this.__textFontWeight}__processTextFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__elementText,this.__textFontWeight)}setIconWidth(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconWidth")),convertedValue!==this.__iconWidth&&(this.__iconWidth=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconWidth"}),this.__processIconWidth())}getIconWidth(){return this.__iconWidth}__processIconWidth(){this.__iconWidth?this.__elementIcon.style.width=this.__iconWidth+(this.__iconWidthUnit??"px"):this.__elementIcon.style.width=""}setIconWidthUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toDimensionUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconWidthUnit")),convertedValue!==this.__iconWidthUnit&&(this.__iconWidthUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconWidthUnit"}),this.__processIconWidthUnit())}getIconWidthUnit(){return this.__iconWidthUnit}__processIconWidthUnit(){this.__processIconWidth()}setIconHeight(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconHeight")),convertedValue!==this.__iconHeight&&(this.__iconHeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconHeight"}),this.__processIconHeight())}getIconHeight(){return this.__iconHeight}__processIconHeight(){this.__iconHeight?this.__elementIcon.style.height=this.__iconHeight+(this.__iconHeightUnit??"px"):this.__elementIcon.style.height=""}setIconHeightUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toDimensionUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconHeightUnit")),convertedValue!==this.__iconHeightUnit&&(this.__iconHeightUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconHeightUnit"}),this.__processIconHeightUnit())}getIconHeightUnit(){return this.__iconHeightUnit}__processIconHeightUnit(){this.__processIconHeight()}setIconHorizontalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toHorizontalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconHorizontalAlignment")),convertedValue!==this.__iconHorizontalAlignment&&(this.__iconHorizontalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconHorizontalAlignment"}),this.__processIconHorizontalAlignment())}getIconHorizontalAlignment(){return this.__iconHorizontalAlignment}__processIconHorizontalAlignment(){switch(this.__iconHorizontalAlignment){case"Center":this.__elementIcon.style.justifySelf="center",this.__elementIcon.style.backgroundPositionX="center";break;case"Right":this.__elementIcon.style.justifySelf="right",this.__elementIcon.style.backgroundPositionX="right";break;case"Left":this.__elementIcon.style.justifySelf="left",this.__elementIcon.style.backgroundPositionX="left";break;default:this.__elementIcon.style.justifySelf="",this.__elementIcon.style.backgroundPositionX=""}}setIconVerticalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toVerticalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconVerticalAlignment")),convertedValue!==this.__iconVerticalAlignment&&(this.__iconVerticalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconVerticalAlignment"}),this.__processIconVerticalAlignment())}getIconVerticalAlignment(){return this.__iconVerticalAlignment}__processIconVerticalAlignment(){switch(this.__iconVerticalAlignment){case"Center":this.__elementIcon.style.alignSelf="center",this.__elementIcon.style.backgroundPositionY="center";break;case"Bottom":this.__elementIcon.style.alignSelf="end",this.__elementIcon.style.backgroundPositionY="bottom";break;case"Top":this.__elementIcon.style.alignSelf="start",this.__elementIcon.style.backgroundPositionY="top";break;default:this.__elementIcon.style.alignSelf="",this.__elementIcon.style.backgroundPositionY=""}}setIconPadding(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IconPadding"));let resolverInfo=this.__objectResolvers.get("iconPadding");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("IconPadding")?.type});this.__objectResolvers.set("iconPadding",{resolver,watchCallback:this.__onResolverForIconPaddingWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForIconPaddingWatchCallback)})}__onResolverForIconPaddingWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("iconPadding"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__iconPadding)||(this.__iconPadding=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IconPadding"}),this.__processIconPadding()):TcHmi.Log.Controls.error(this,TcHmiMultiState.#tchmiFQN,{Attribute:"IconPadding"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getIconPadding(){return this.__iconPadding}__processIconPadding(){TcHmi.StyleProvider.processContentPadding(this.__elementIcon,this.__iconPadding)}}})();TcHmi.Controls.registerEx("TcHmiMultiState","TcHmi.Controls.Beckhoff",TcHmiMultiState,{injectInGlobalObject:!0});export{TcHmiMultiState as Control};