1 line
44 KiB
JavaScript
1 line
44 KiB
JavaScript
var __runInitializers=this&&this.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0},__esDecorate=this&&this.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(void 0!==f&&"function"!=typeof f)throw new TypeError("Function expected");return f}for(var _,kind=contextIn.kind,key="getter"===kind?"get":"setter"===kind?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),done=!1,i=decorators.length-1;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";import{SwitchUserPopup}from"./SwitchUserPopup.js";import{EditUserPopup}from"./EditUserPopup.js";import{ManageUserPopup}from"./ManageUserPopup.js";let TcHmiUserManagement=(()=>{var _a,_b,_c;let ___onDocumentClick_decorators,___resizeDropDownBox_decorators,___onExpandDropdown_decorators,___onExpandDropdownMouseDown_decorators,___onExpandDropdownMouseLeave_decorators,___onExpandDropdownMouseEnter_decorators,___onMouseUp_decorators,___onLogout_decorators,___onSwitchUser_decorators,___onEditUser_decorators,___onUserManagement_decorators,___onMouseEnter_decorators,___onMouseLeave_decorators,___onTouchstart_decorators,___onUserDataChanged_decorators,___advancedChangedByPopup_decorators,___onPopupClosed_decorators,___onResolverForTextColorWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiUserManagement extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onDocumentClick_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___resizeDropDownBox_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onExpandDropdown_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onExpandDropdownMouseDown_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onExpandDropdownMouseLeave_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onExpandDropdownMouseEnter_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onMouseUp_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onLogout_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onSwitchUser_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onEditUser_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onUserManagement_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onMouseEnter_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onMouseLeave_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onTouchstart_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onUserDataChanged_decorators=[TcHmi.EventHandler()],___advancedChangedByPopup_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],___onPopupClosed_decorators=[TcHmi.EventHandler()],___onResolverForTextColorWatchCallback_decorators=[(_c=TcHmi).CallbackMethod.bind(_c)],__esDecorate(this,null,___onDocumentClick_decorators,{kind:"method",name:"__onDocumentClick",static:!1,private:!1,access:{has:obj=>"__onDocumentClick"in obj,get:obj=>obj.__onDocumentClick},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___resizeDropDownBox_decorators,{kind:"method",name:"__resizeDropDownBox",static:!1,private:!1,access:{has:obj=>"__resizeDropDownBox"in obj,get:obj=>obj.__resizeDropDownBox},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onExpandDropdown_decorators,{kind:"method",name:"__onExpandDropdown",static:!1,private:!1,access:{has:obj=>"__onExpandDropdown"in obj,get:obj=>obj.__onExpandDropdown},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onExpandDropdownMouseDown_decorators,{kind:"method",name:"__onExpandDropdownMouseDown",static:!1,private:!1,access:{has:obj=>"__onExpandDropdownMouseDown"in obj,get:obj=>obj.__onExpandDropdownMouseDown},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onExpandDropdownMouseLeave_decorators,{kind:"method",name:"__onExpandDropdownMouseLeave",static:!1,private:!1,access:{has:obj=>"__onExpandDropdownMouseLeave"in obj,get:obj=>obj.__onExpandDropdownMouseLeave},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onExpandDropdownMouseEnter_decorators,{kind:"method",name:"__onExpandDropdownMouseEnter",static:!1,private:!1,access:{has:obj=>"__onExpandDropdownMouseEnter"in obj,get:obj=>obj.__onExpandDropdownMouseEnter},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseUp_decorators,{kind:"method",name:"__onMouseUp",static:!1,private:!1,access:{has:obj=>"__onMouseUp"in obj,get:obj=>obj.__onMouseUp},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onLogout_decorators,{kind:"method",name:"__onLogout",static:!1,private:!1,access:{has:obj=>"__onLogout"in obj,get:obj=>obj.__onLogout},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onSwitchUser_decorators,{kind:"method",name:"__onSwitchUser",static:!1,private:!1,access:{has:obj=>"__onSwitchUser"in obj,get:obj=>obj.__onSwitchUser},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onEditUser_decorators,{kind:"method",name:"__onEditUser",static:!1,private:!1,access:{has:obj=>"__onEditUser"in obj,get:obj=>obj.__onEditUser},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onUserManagement_decorators,{kind:"method",name:"__onUserManagement",static:!1,private:!1,access:{has:obj=>"__onUserManagement"in obj,get:obj=>obj.__onUserManagement},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseEnter_decorators,{kind:"method",name:"__onMouseEnter",static:!1,private:!1,access:{has:obj=>"__onMouseEnter"in obj,get:obj=>obj.__onMouseEnter},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onMouseLeave_decorators,{kind:"method",name:"__onMouseLeave",static:!1,private:!1,access:{has:obj=>"__onMouseLeave"in obj,get:obj=>obj.__onMouseLeave},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onTouchstart_decorators,{kind:"method",name:"__onTouchstart",static:!1,private:!1,access:{has:obj=>"__onTouchstart"in obj,get:obj=>obj.__onTouchstart},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onUserDataChanged_decorators,{kind:"method",name:"__onUserDataChanged",static:!1,private:!1,access:{has:obj=>"__onUserDataChanged"in obj,get:obj=>obj.__onUserDataChanged},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___advancedChangedByPopup_decorators,{kind:"method",name:"__advancedChangedByPopup",static:!1,private:!1,access:{has:obj=>"__advancedChangedByPopup"in obj,get:obj=>obj.__advancedChangedByPopup},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onPopupClosed_decorators,{kind:"method",name:"__onPopupClosed",static:!1,private:!1,access:{has:obj=>"__onPopupClosed"in obj,get:obj=>obj.__onPopupClosed},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),_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);__elementBase;__elementDropdown;__resizedEventDestroyEvent=null;__movedEventDestroyEvent=null;__dropdownboxOpen=!1;__textFontSize;__textFontSizeUnit;__userNameFontSize;__userNameFontSizeUnit;__headlineFontSize;__headlineFontSizeUnit;__subHeadlineFontSize;__subHeadlineFontSizeUnit;__dropDownFontSize;__dropDownFontSizeUnit;__textColor;__logoutButton;__switchUserButton;__editUserButton;__userManagementButton;__touches=[];__allowLogout;__allowSwitchUser;__mouseDown=!1;__advanced=!1;__switchUserPopup;__editUserPopup;__manageUserPopup;__localizedElements=new Map;__localizationReader=void 0;__showUsermanagementButtons={editUser:!1,userManagement:!1};__previnit(){if(this.__elementTemplateRoot=this.__element[0].getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiUserManagement-Template")[0],!this.__elementTemplateRoot)throw new Error("Invalid Template.html");if(this.__elementBase=this.__element[0].getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiUserManagement-Base")[0],!this.__elementBase)throw new Error("Invalid Template.html");if(this.__elementDropdown=this.__element[0].getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiUserManagement-Dropdown")[0],!this.__elementDropdown)throw new Error("Invalid Template.html");this.__elementTemplateRoot.removeChild(this.__elementDropdown);let localizedElements=this.__element[0].querySelectorAll("[data-tchmi-localized-content-key]");for(let i=0,ii=localizedElements.length;i<ii;i++){let element=localizedElements[i],localizeKey=element.dataset.tchmiLocalizedContentKey;localizeKey&&this.__localizedElements.set(element,{key:localizeKey})}this.__destroyOnDestroy.push(this.__localization.watch(data=>{if(data.error===TcHmi.Errors.NONE&&data.reader){this.__localizationReader=data.reader;for(const[element,info]of this.__localizedElements){let localizedText=data.reader.get(info.key);info.parameters&&(localizedText=tchmi_format_string(localizedText,...info.parameters)),element.textContent=tchmi_decode_control_characters(localizedText)}}})),super.__previnit()}__init(){super.__init()}__attach(){super.__attach();const passiveEventOptions={passive:!0,capture:!1};this.__destroyOnDetach.push(TcHmi.EventProvider.register(this.getId()+".onPressed",this.__onExpandDropdown),TcHmi.EventProvider.register(this.getId()+".onMouseDown",this.__onExpandDropdownMouseDown),TcHmi.EventProvider.register(this.getId()+".onTouchStart",this.__onExpandDropdownMouseDown),TcHmi.EventProvider.register(this.getId()+".onMouseEnter",this.__onExpandDropdownMouseEnter),TcHmi.EventProvider.register(this.getId()+".onMouseLeave",this.__onExpandDropdownMouseLeave),TcHmi.EventProvider.register(this.getId()+".onTouchEnd",this.__onExpandDropdownMouseLeave),TcHmi.EventProvider.register(this.getId()+".onTouchCancel",this.__onExpandDropdownMouseLeave),TcHmi.EventProvider.register("onUserDataChanged",this.__onUserDataChanged),TcHmi.EventProvider.registerDomEvent(document,"mouseup",this.__onMouseUp,passiveEventOptions),TcHmi.EventProvider.registerDomEvent(document,"touchend",this.__onMouseUp,passiveEventOptions));let userName=TcHmi.Server.getCurrentUser();this.__elementBase.textContent=null!==userName?userName:"<unknown>",this.__getApiAccessForDomains()}__detach(){super.__detach(),this.__removeDropDownbutton(this.__logoutButton,this.__onLogout),this.__removeDropDownbutton(this.__switchUserButton,this.__onSwitchUser),this.__removeDropDownbutton(this.__userManagementButton,this.__onUserManagement),this.__removeDropDownbutton(this.__editUserButton,this.__onEditUser)}destroy(){this.__keepAlive||(super.destroy(),this.__switchUserPopup?.onAdvancedChanged.remove(this.__advancedChangedByPopup),this.__switchUserPopup?.onHide.remove(this.__onPopupClosed),this.__switchUserPopup?.destroy(),this.__switchUserPopup=void 0,this.__editUserPopup?.onAdvancedChanged.remove(this.__advancedChangedByPopup),this.__editUserPopup?.onHide.remove(this.__onPopupClosed),this.__editUserPopup?.destroy(),this.__editUserPopup=void 0,this.__manageUserPopup?.onAdvancedChanged.remove(this.__advancedChangedByPopup),this.__manageUserPopup?.onHide.remove(this.__onPopupClosed),this.__manageUserPopup?.destroy(),this.__manageUserPopup=void 0,this.__resizedEventDestroyEvent?.(),this.__resizedEventDestroyEvent=null,this.__movedEventDestroyEvent?.(),this.__movedEventDestroyEvent=null)}__onDocumentClick(event){!this.__dropdownboxOpen||this.__element[0].contains(event.target)||this.__elementDropdown.contains(event.target)||(this.__setDropDownboxOpen(!1),TcHmi.EventProvider.raise(this.__id+".onUserInteractionCanceled"))}__resizeDropDownBox(){const documentBCR=document.documentElement.getBoundingClientRect(),controlBCR=this.__element[0].getBoundingClientRect(),dropdownBCR=this.__elementDropdown.getBoundingClientRect(),style={top:controlBCR.top+controlBCR.height+"px",left:controlBCR.left+"px",right:null,"min-width":controlBCR.width+"px","max-height":documentBCR.height-controlBCR.bottom+"px"};documentBCR.height-controlBCR.bottom<controlBCR.top&&dropdownBCR.height>documentBCR.height-controlBCR.bottom?(style.top=controlBCR.top-dropdownBCR.height+"px",style["max-height"]=controlBCR.top+"px",this.__elementDropdown.classList.add("above-control")):this.__elementDropdown.classList.remove("above-control"),documentBCR.width-controlBCR.left<dropdownBCR.width&&controlBCR.right>=dropdownBCR.width&&(style.left=null,style.right=documentBCR.width-controlBCR.right+"px"),TcHmi.StyleProvider.setSimpleElementStyle(this.__elementDropdown,style)}__setDropDownboxOpen(valueNew){if(void 0===valueNew&&(valueNew=!this.__dropdownboxOpen),valueNew){this.__dropdownboxOpen=!0;let topMostLayerOptions={removeCb:data=>{this.__dropdownboxOpen=!1,this.__elementTemplateRoot.classList.remove("active"),this.__elementDropdown.classList.remove("active"),null!==this.__resizedEventDestroyEvent&&(this.__resizedEventDestroyEvent(),this.__resizedEventDestroyEvent=null),null!==this.__movedEventDestroyEvent&&(this.__movedEventDestroyEvent(),this.__movedEventDestroyEvent=null);document.removeEventListener("click",this.__onDocumentClick,{passive:!0,capture:!1})},dimBackground:!1,modal:!1};this.__resizedEventDestroyEvent=TcHmi.EventProvider.register(this.__id+".onResized",this.__resizeDropDownBox),this.__movedEventDestroyEvent=TcHmi.EventProvider.register(this.__id+".onMoved",this.__resizeDropDownBox);const passiveEventOptions={passive:!0,capture:!1};document.addEventListener("click",this.__onDocumentClick,passiveEventOptions),TcHmi.TopMostLayer.add(this,this.__elementDropdown,topMostLayerOptions),this.__resizeDropDownBox()}else TcHmi.TopMostLayer.remove(this,this.__elementDropdown)}updateDropdown(){this.__getApiAccessForDomains()}__getApiAccessForDomains(){TcHmi.Server.readSymbol("ListDomains",data=>{const domainList=data.response?.commands?.[0].readValue;if(data.error===TcHmi.Errors.NONE&&domainList){const domains=[];for(let[domainName,domain]of Object.entries(domainList))domain?.authExtension&&domains.push(domainName);let showUsermanagementButtons={editUser:!1,userManagement:!1},accessCount=0;domains.forEach(domain=>{TcHmi.Server.UserManagement.getApiAccess({domain},data=>{accessCount++,data.error===TcHmi.Errors.NONE&&data.result&&((data.result.updateUser.changeOwnPassword||data.result.updateUser.addGroups&&data.result.updateUser.removeGroups||data.result.updateUser.locale||data.result.updateUser.timeZone)&&TcHmi.Access.checkAccess(this,"EditUserProperties")&&(showUsermanagementButtons.editUser=!0),(data.result.addUser.general||data.result.removeUser.general||data.result.updateUser.addGroups&&data.result.updateUser.removeGroups)&&TcHmi.Access.checkAccess(this,"UserManagement")&&(showUsermanagementButtons.userManagement=!0)),accessCount>=domains.length&&(this.__showUsermanagementButtons=showUsermanagementButtons,this.__fillDropdown())})})}})}__fillDropdown(){let fragment=document.createDocumentFragment();this.__allowLogout&&(this.__removeDropDownbutton(this.__logoutButton,this.__onLogout),this.__logoutButton=this.__createDropDownButton(this.__onLogout,"DropDown_Logout"),fragment.append(this.__logoutButton)),this.__allowSwitchUser&&(this.__removeDropDownbutton(this.__switchUserButton,this.__onSwitchUser),this.__switchUserButton=this.__createDropDownButton(this.__onSwitchUser,"Popup_SwitchUser"),fragment.append(this.__switchUserButton)),this.__showUsermanagementButtons.editUser&&(this.__removeDropDownbutton(this.__editUserButton,this.__onEditUser),this.__editUserButton=this.__createDropDownButton(this.__onEditUser,"DropDown_EditUser"),fragment.append(this.__editUserButton)),this.__showUsermanagementButtons.userManagement&&(this.__removeDropDownbutton(this.__userManagementButton,this.__onUserManagement),this.__userManagementButton=this.__createDropDownButton(this.__onUserManagement,"DropDown_UserManagement"),fragment.append(this.__userManagementButton)),this.__elementDropdown.textContent="",this.__elementDropdown.append(fragment)}__createDropDownButton(clickEventCallback,localizationKey){const passiveEventOptions={passive:!0,capture:!1};let buttonElement=document.createElement("div");return this.__addLocalizedElement(buttonElement,localizationKey),TcHmi.StyleProvider.processFontSize(buttonElement,this.__dropDownFontSize,this.__dropDownFontSizeUnit),buttonElement.classList.add("TcHmi_Controls_Beckhoff_TcHmiUserManagement-template-Dropdown-Element","tchmi-box"),buttonElement.addEventListener("mouseenter",this.__onMouseEnter,passiveEventOptions),buttonElement.addEventListener("mouseleave",this.__onMouseLeave,passiveEventOptions),buttonElement.addEventListener("touchcancel",this.__onMouseLeave,passiveEventOptions),buttonElement.addEventListener("click",clickEventCallback,passiveEventOptions),buttonElement}__removeDropDownbutton(buttonElement,clickEventHandler){if(buttonElement){this.__removeLocalizedElement(buttonElement);const passiveEventOptions={passive:!0,capture:!1};buttonElement.removeEventListener("mouseenter",this.__onMouseEnter,passiveEventOptions),buttonElement.removeEventListener("mouseleave",this.__onMouseLeave,passiveEventOptions),buttonElement.removeEventListener("touchcancel",this.__onMouseLeave,passiveEventOptions),buttonElement.removeEventListener("click",clickEventHandler,passiveEventOptions)}buttonElement=void 0}showSwitchUserPopup(){this.__switchUserPopup||(this.__switchUserPopup=new SwitchUserPopup(this),this.__switchUserPopup.setAdvanced(this.__advanced),this.__switchUserPopup.onAdvancedChanged.add(this.__advancedChangedByPopup),this.__switchUserPopup.onHide.add(this.__onPopupClosed),this.__switchUserPopup.setTexts({headerText:this.__expandLocalizationSymbol("Popup_SwitchUser"),domainHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Domain"),usernameHeaderText:this.__expandLocalizationSymbol("PopupHeadline_SelectUser"),passwordHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Password"),switchButton:{text:this.__expandLocalizationSymbol("PopupButton_Switch"),tooltip:this.__expandLocalizationSymbol("PopupButton_Switch")},cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},advancedSwitch:{text:this.__expandLocalizationSymbol("PopupToggleSwitch_Advanced"),tooltip:this.__expandLocalizationSymbol("PopupAdvancedToggleSwitchTooltip_SwitchUser")},usernameInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_EnterYourUserName"),passwordInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_Password"),userComboboxPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_SelectAUser"),feedbackPromptHeadlineFailed:this.__expandLocalizationSymbol("PopupNotificationHeadline_Failed"),feedbackPromptHeadlineSuccess:this.__expandLocalizationSymbol("PopupNotificationHeadline_Success"),feedbackPromptUsername:this.__expandLocalizationSymbol("PopupFeedback_Username"),feedbackPromptPassword:this.__expandLocalizationSymbol("PopupFeedback_Password"),feedbackPromptUserSwitched:this.__expandLocalizationSymbol("PopupNotificationInfo_UserSwitched"),feedbackPromptUserNotSwitched:this.__expandLocalizationSymbol("PopupNotificationInfo_UserNotSwitched"),feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK")})),this.__refreshPopupResources(),this.__switchUserPopup.show()}showEditUserPopup(){this.__editUserPopup||(this.__editUserPopup=new EditUserPopup(this),this.__editUserPopup.setAdvanced(this.__advanced),this.__editUserPopup.onAdvancedChanged.add(this.__advancedChangedByPopup),this.__editUserPopup.onHide.add(this.__onPopupClosed),this.__editUserPopup.setTexts({headerText:{symbolExpression:this.__expandLocalizationSymbol("PopupHeadline_HelloName"),formatValues:[TcHmi.Server.getCurrentUser()??""]},passwordHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Password"),localizationHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Localization"),userGroupsHeaderText:this.__expandLocalizationSymbol("PopupHeadline_UserGroups"),saveButton:{text:this.__expandLocalizationSymbol("PopupButton_Save"),tooltip:this.__expandLocalizationSymbol("PopupButton_Save")},cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},advancedSwitch:{text:this.__expandLocalizationSymbol("PopupToggleSwitch_Advanced"),tooltip:this.__expandLocalizationSymbol("PopupAdvancedToggleSwitchTooltip_EditUser")},newPasswordInput2Placeholder:this.__expandLocalizationSymbol("PopupPlaceholder_RepeatNewPassword"),newPasswordInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_NewPassword"),oldPasswordInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_OldPassword"),clientLocaleRadioButtonText:this.__expandLocalizationSymbol("PopupRadioChoice_BrowserDefault"),projectLocaleRadioButtonText:this.__expandLocalizationSymbol("PopupRadioChoice_ProjectDefault"),feedbackPromptBothPasswords:this.__expandLocalizationSymbol("PopupFeedback_BothPasswords"),feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK"),feedbackPromptHeadlineFailed:this.__expandLocalizationSymbol("PopupNotificationHeadline_Failed"),feedbackPromptHeadlineSuccess:this.__expandLocalizationSymbol("PopupNotificationHeadline_Success"),feedbackPromptListUserGroupError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserGroupError"),feedbackPromptPasswordMatch:this.__expandLocalizationSymbol("PopupFeedback_PasswordMatch"),feedbackPromptPasswordOld:this.__expandLocalizationSymbol("PopupFeedback_PasswordOld"),feedbackPromptUserInfoNotUpdated:this.__expandLocalizationSymbol("PopupNotificationInfo_UserInfoNotUpdated"),feedbackPromptUserInformationUpdated:this.__expandLocalizationSymbol("PopupNotificationInfo_UserInformationUpdated"),passwordRequirementsCurrentPassword:this.__expandLocalizationSymbol("PopupPasswordRequirements_CurrentPassword"),passwordRequirementsHeadline:this.__expandLocalizationSymbol("PopupPasswordRequirements_Headline"),passwordRequirementsRepitition:this.__expandLocalizationSymbol("PopupPasswordRequirements_Repitition"),popupFeedbackNoGroupsToAdjust:this.__expandLocalizationSymbol("PopupFeedback_NoGroupsToAdjust")})),this.__refreshPopupResources(),this.__editUserPopup.show()}showManageUserPopup(){this.__manageUserPopup||(this.__manageUserPopup=new ManageUserPopup(this),this.__manageUserPopup.setAdvanced(this.__advanced),this.__manageUserPopup.onAdvancedChanged.add(this.__advancedChangedByPopup),this.__manageUserPopup.onHide.add(this.__onPopupClosed),this.__manageUserPopup.setTexts({headerText:{symbolExpression:this.__expandLocalizationSymbol("PopupHeadline_HelloName"),formatValues:[TcHmi.Server.getCurrentUser()??""]},domainHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Domain"),cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},addUserButton:{text:this.__expandLocalizationSymbol("Popup_AddUser"),tooltip:this.__expandLocalizationSymbol("Popup_AddUser")},deleteUserButton:{text:this.__expandLocalizationSymbol("Popup_DeleteUser"),tooltip:this.__expandLocalizationSymbol("Popup_DeleteUser")},changeUserButton:{text:this.__expandLocalizationSymbol("Popup_ChangeUsers"),tooltip:this.__expandLocalizationSymbol("Popup_ChangeUsers")},feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK"),feedbackPromptNothingToConfigure:this.__expandLocalizationSymbol("PopupFeedback_NothingToConfigure"),addUserLocalizableTexts:{headerText:this.__expandLocalizationSymbol("Popup_AddUser"),usernameHeaderText:this.__expandLocalizationSymbol("PopupHeadline_UserName"),passwordHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Password"),userGroupsHeaderText:this.__expandLocalizationSymbol("PopupHeadline_UserGroups"),localizationHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Localization"),saveButton:{text:this.__expandLocalizationSymbol("PopupButton_Save"),tooltip:this.__expandLocalizationSymbol("PopupButton_Save")},cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},advancedSwitch:{text:this.__expandLocalizationSymbol("PopupToggleSwitch_Advanced"),tooltip:this.__expandLocalizationSymbol("PopupAdvancedToggleSwitchTooltip_AddUser")},usernameInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_EnterUsername"),newPasswordInputPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_NewPassword"),newPasswordInput2Placeholder:this.__expandLocalizationSymbol("PopupPlaceholder_RepeatNewPassword"),forcePasswordChangeCheckboxtext:this.__expandLocalizationSymbol("PopupCheckbox_ForcePasswordChange"),popupFeedbackNoGroupsToAdjust:this.__expandLocalizationSymbol("PopupFeedback_NoGroupsToAdjust"),clientLocaleRadioButtonText:this.__expandLocalizationSymbol("PopupRadioChoice_BrowserDefault"),projectLocaleRadioButtonText:this.__expandLocalizationSymbol("PopupRadioChoice_ProjectDefault"),feedbackPromptHeadlineFailed:this.__expandLocalizationSymbol("PopupNotificationHeadline_Failed"),feedbackPromptHeadlineSuccess:this.__expandLocalizationSymbol("PopupNotificationHeadline_Success"),feedbackPromptBothPasswords:this.__expandLocalizationSymbol("PopupFeedback_BothPasswords"),feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK"),feedbackPromptEnterUsername:this.__expandLocalizationSymbol("PopupFeedback_EnterUsername"),feedbackPromptListUserError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserError"),feedbackPromptListUserGroupError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserGroupError"),feedbackPromptPasswordMatch:this.__expandLocalizationSymbol("PopupFeedback_PasswordMatch"),feedbackPromptUserAdded:this.__expandLocalizationSymbol("PopupNotificationInfo_UserAdded"),feedbackPromptUserAddedError:this.__expandLocalizationSymbol("PopupNotificationInfo_UserAddedError"),feedbackPromptUserGroup:this.__expandLocalizationSymbol("PopupFeedback_Usergroup"),feedbackPromptUsernameExists:this.__expandLocalizationSymbol("PopupFeedback_UsernameExists"),passwordRequirementsHeadline:this.__expandLocalizationSymbol("PopupPasswordRequirements_Headline"),passwordRequirementsRepitition:this.__expandLocalizationSymbol("PopupPasswordRequirements_Repitition")},deleteUserLocalizabletexts:{headerText:this.__expandLocalizationSymbol("Popup_DeleteUser"),userSelectionHeaderText:this.__expandLocalizationSymbol("PopupHeadline_SelectUser"),deleteButton:{text:this.__expandLocalizationSymbol("PopupButton_Delete"),tooltip:this.__expandLocalizationSymbol("PopupButton_Delete")},cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},advancedSwitch:{text:this.__expandLocalizationSymbol("PopupToggleSwitch_Advanced"),tooltip:this.__expandLocalizationSymbol("PopupAdvancedToggleSwitchTooltip_DeleteUser")},userComboboxPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_SelectAUser"),feedbackPromptHeadlineFailed:this.__expandLocalizationSymbol("PopupNotificationHeadline_Failed"),feedbackPromptHeadlineSuccess:this.__expandLocalizationSymbol("PopupNotificationHeadline_Success"),feedbackPromptListUserError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserError"),feedbackPromptUserDeleted:this.__expandLocalizationSymbol("PopupNotificationInfo_UserDeleted"),feedbackPromptUserNotDeleted:this.__expandLocalizationSymbol("PopupNotificationInfo_UserNotDeleted"),deleteConfirmationPromptHeaderText:this.__expandLocalizationSymbol("Popup_DeleteUser"),deleteConfirmationPromptContentText:this.__expandLocalizationSymbol("PopupNotificationInfo_DeleteUserConfirmation"),deleteConfirmationPromptButtonDelete:{text:this.__expandLocalizationSymbol("PopupButton_Delete"),tooltip:this.__expandLocalizationSymbol("PopupButton_Delete")},deleteConfirmationPromptButtonCancel:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK")},changeUserLocalizableTexts:{headerText:this.__expandLocalizationSymbol("Popup_ChangeUsers"),userSelectionHeaderText:this.__expandLocalizationSymbol("PopupHeadline_SelectUser"),passwordHeaderText:this.__expandLocalizationSymbol("PopupHeadline_Password"),userGroupsHeaderText:this.__expandLocalizationSymbol("PopupHeadline_UserGroups"),saveButton:{text:this.__expandLocalizationSymbol("PopupButton_Save"),tooltip:this.__expandLocalizationSymbol("PopupButton_Save")},cancelButton:{text:this.__expandLocalizationSymbol("PopupButton_Cancel"),tooltip:this.__expandLocalizationSymbol("PopupButton_Cancel")},advancedSwitch:{text:this.__expandLocalizationSymbol("PopupToggleSwitch_Advanced"),tooltip:this.__expandLocalizationSymbol("PopupAdvancedToggleSwitchTooltip_ChangeUser")},userComboboxPlaceholder:this.__expandLocalizationSymbol("PopupPlaceholder_SelectAUser"),popupFeedbackNoGroupsToAdjust:this.__expandLocalizationSymbol("PopupNotificationInfo_NoUserGroups"),forcePasswordChangeCheckboxtext:this.__expandLocalizationSymbol("PopupCheckbox_ForcePasswordChange"),feedbackPromptHeadlineFailed:this.__expandLocalizationSymbol("PopupNotificationHeadline_Failed"),feedbackPromptHeadlineSuccess:this.__expandLocalizationSymbol("PopupNotificationHeadline_Success"),feedbackPromptListUserError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserError"),feedbackPromptListUserGroupError:this.__expandLocalizationSymbol("PopupNotificationInfo_ListUserGroupError"),feedbackPromptUserGroupsNotUpdated:this.__expandLocalizationSymbol("PopupNotificationInfo_UserGroupsNotUpdated"),feedbackPromptUserInformationUpdated:this.__expandLocalizationSymbol("PopupNotificationInfo_UserInformationUpdated"),feedbackPromptButtonOk:this.__expandLocalizationSymbol("PopupButton_OK")}})),this.__refreshPopupResources(),this.__manageUserPopup.show()}__refreshPopupResources(){this.__editUserPopup&&(this.__editUserPopup.setTextFontSize(this.__textFontSize??null),this.__editUserPopup.setTextFontSizeUnit(this.__textFontSizeUnit??null),this.__editUserPopup.setDropDownFontSize(this.__dropDownFontSize??null),this.__editUserPopup.setDropDownFontSizeUnit(this.__dropDownFontSizeUnit??null),this.__editUserPopup.setHeadlineFontSize(this.__headlineFontSize??null),this.__editUserPopup.setHeadlineFontSizeUnit(this.__headlineFontSizeUnit??null),this.__editUserPopup.setSubHeadlineFontSize(this.__subHeadlineFontSize??null),this.__editUserPopup.setSubHeadlineFontSizeUnit(this.__subHeadlineFontSizeUnit??null)),this.__switchUserPopup&&(this.__switchUserPopup.setTextFontSize(this.__textFontSize??null),this.__switchUserPopup.setTextFontSizeUnit(this.__textFontSizeUnit??null),this.__switchUserPopup.setDropDownFontSize(this.__dropDownFontSize??null),this.__switchUserPopup.setDropDownFontSizeUnit(this.__dropDownFontSizeUnit??null),this.__switchUserPopup.setHeadlineFontSize(this.__headlineFontSize??null),this.__switchUserPopup.setHeadlineFontSizeUnit(this.__headlineFontSizeUnit??null),this.__switchUserPopup.setSubHeadlineFontSize(this.__subHeadlineFontSize??null),this.__switchUserPopup.setSubHeadlineFontSizeUnit(this.__subHeadlineFontSizeUnit??null)),this.__manageUserPopup&&(this.__manageUserPopup.setTextFontSize(this.__textFontSize??null),this.__manageUserPopup.setTextFontSizeUnit(this.__textFontSizeUnit??null),this.__manageUserPopup.setDropDownFontSize(this.__dropDownFontSize??null),this.__manageUserPopup.setDropDownFontSizeUnit(this.__dropDownFontSizeUnit??null),this.__manageUserPopup.setHeadlineFontSize(this.__headlineFontSize??null),this.__manageUserPopup.setHeadlineFontSizeUnit(this.__headlineFontSizeUnit??null),this.__manageUserPopup.setSubHeadlineFontSize(this.__subHeadlineFontSize??null),this.__manageUserPopup.setSubHeadlineFontSizeUnit(this.__subHeadlineFontSizeUnit??null))}__onExpandDropdown(_event){this.__setDropDownboxOpen()}__onExpandDropdownMouseDown(_event){this.__mouseDown=!0,this.__element[0].classList.add("down")}__onExpandDropdownMouseLeave(_event){this.__dropdownboxOpen||this.__element[0].classList.contains("down")&&this.__element[0].classList.remove("down")}__onExpandDropdownMouseEnter(_event){this.__mouseDown&&this.__element[0].classList.add("down")}__onMouseUp(_event){this.__mouseDown=!1,this.__element[0].classList.contains("down")&&this.__element[0].classList.remove("down")}__onLogout(_event){TcHmi.TopMostLayer.remove(this,this.__elementDropdown),TcHmi.Server.logoutEx2(!0,null)}__onSwitchUser(_event){this.showSwitchUserPopup()}__onEditUser(_event){TcHmi.TopMostLayer.remove(this,this.__elementDropdown),this.showEditUserPopup()}__onUserManagement(_event){TcHmi.TopMostLayer.remove(this,this.__elementDropdown),this.showManageUserPopup()}__onMouseEnter(event){this.__hoverComboboxItem(event.target,!0)}__onMouseLeave(event){this.__hoverComboboxItem(event.target,!1)}__onTouchstart(event){let changedTouches=Array.from(event.changedTouches).filter(touch=>touch.target===event.target);0!==changedTouches.length&&(this.__touches=this.__touches.concat(changedTouches.map(touch=>({id:touch.identifier,originalX:touch.clientX,originalY:touch.clientY,element:touch.target}))),changedTouches.forEach(touch=>this.__hoverComboboxItem(touch.target,!0)))}__onUserDataChanged(){const userName=TcHmi.Server.getCurrentUser();if(null!==userName){if(this.__elementBase.textContent===userName)return;this.__elementBase.textContent=userName}else this.__elementBase.textContent="<unknown>";this.__switchUserPopup?.hide(),this.__switchUserPopup?.destroy(),this.__switchUserPopup=null,this.__editUserPopup?.hide(),this.__editUserPopup?.destroy(),this.__editUserPopup=null,this.__manageUserPopup?.hide(),this.__manageUserPopup?.destroy(),this.__manageUserPopup=null,this.__getApiAccessForDomains()}__hoverComboboxItem(element,hover){element.classList.contains("TcHmi_Controls_Beckhoff_TcHmiUserManagement-template-Dropdown-Element")&&(hover?element.classList.add("hover"):this.__touches.some(touch=>touch.element===element)||element.classList.remove("hover"))}__getNotificationElement(){return null}__getWarningElement(){return null}__getAddUserElement(){return null}__getDeleteUserElement(){return null}__getGroupmanagementElement(){return null}__advancedChangedByPopup(advanced){this.setAdvancedState(advanced)}getAdvancedState(){return this.__advanced}__onPopupClosed(){this.updateDropdown()}setAdvancedState(valueNew){valueNew!==this.__advanced&&(this.__advanced=valueNew,this.__editUserPopup?.setAdvanced(this.__advanced),this.__switchUserPopup?.setAdvanced(this.__advanced),this.__manageUserPopup?.setAdvanced(this.__advanced))}__addLocalizedElement(element,key,...parameters){let info={key};if(0!==parameters.length&&(info.parameters=parameters),this.__localizedElements.set(element,info),this.__localizationReader){let localizedText=this.__localizationReader.get(key);info.parameters&&(localizedText=tchmi_format_string(localizedText,...info.parameters)),element.textContent=tchmi_decode_control_characters(localizedText)}}__removeLocalizedElement(element){this.__localizedElements.delete(element)}getLocalization(){return this.__localization}__expandLocalizationSymbol(key){return`%l%Control::TcHmi.Controls.Beckhoff.TcHmiUserManagement::${key}%/l%`}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.__refreshPopupResources()}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()}setHeadlineFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("HeadlineFontSize")),convertedValue!==this.__headlineFontSize&&(this.__headlineFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"HeadlineFontSize"}),this.__processHeadlineFontSize())}getHeadlineFontSize(){return this.__headlineFontSize}__processHeadlineFontSize(){this.__refreshPopupResources()}setHeadlineFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("HeadlineFontSizeUnit")),convertedValue!==this.__headlineFontSizeUnit&&(this.__headlineFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"HeadlineFontSizeUnit"}),this.__processHeadlineFontSizeUnit())}getHeadlineFontSizeUnit(){return this.__headlineFontSizeUnit}__processHeadlineFontSizeUnit(){this.__processHeadlineFontSize()}setSubHeadlineFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SubHeadlineFontSize")),convertedValue!==this.__subHeadlineFontSize&&(this.__subHeadlineFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SubHeadlineFontSize"}),this.__procesSubHeadlineFontSize())}getSubHeadlineFontSize(){return this.__subHeadlineFontSize}__procesSubHeadlineFontSize(){this.__refreshPopupResources()}setSubHeadlineFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SubHeadlineFontSizeUnit")),convertedValue!==this.__subHeadlineFontSizeUnit&&(this.__subHeadlineFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SubHeadlineFontSizeUnit"}),this.__processSubHeadlineFontSizeUnit())}getSubHeadlineFontSizeUnit(){return this.__subHeadlineFontSizeUnit}__processSubHeadlineFontSizeUnit(){this.__procesSubHeadlineFontSize()}setDropDownFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("DropDownFontSize")),convertedValue!==this.__dropDownFontSize&&(this.__dropDownFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"DropDownFontSize"}),this.__processDropDownFontSize())}getDropDownFontSize(){return this.__dropDownFontSize}__processDropDownFontSize(){this.__logoutButton&&TcHmi.StyleProvider.processFontSize(this.__logoutButton,this.__dropDownFontSize,this.__dropDownFontSizeUnit),this.__switchUserButton&&TcHmi.StyleProvider.processFontSize(this.__switchUserButton,this.__dropDownFontSize,this.__dropDownFontSizeUnit),this.__editUserButton&&TcHmi.StyleProvider.processFontSize(this.__editUserButton,this.__dropDownFontSize,this.__dropDownFontSizeUnit),this.__userManagementButton&&TcHmi.StyleProvider.processFontSize(this.__userManagementButton,this.__dropDownFontSize,this.__dropDownFontSizeUnit),this.__refreshPopupResources()}setDropDownFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("DropDownFontSizeUnit")),convertedValue!==this.__dropDownFontSizeUnit&&(this.__dropDownFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"DropDownFontSizeUnit"}),this.__processDropDownFontSizeUnit())}getDropDownFontSizeUnit(){return this.__dropDownFontSizeUnit}__processDropDownFontSizeUnit(){this.__processDropDownFontSize()}setUserNameFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UserNameFontSize")),convertedValue!==this.__userNameFontSize&&(this.__userNameFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UserNameFontSize"}),this.__processUserNameFontSize())}getUserNameFontSize(){return this.__userNameFontSize}__processUserNameFontSize(){TcHmi.StyleProvider.processFontSize(this.__elementBase,this.__userNameFontSize,this.__userNameFontSizeUnit)}setUserNameFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("UserNameFontSizeUnit")),convertedValue!==this.__userNameFontSizeUnit&&(this.__userNameFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"UserNameFontSizeUnit"}),this.__processUserNameFontSizeUnit())}getUserNameFontSizeUnit(){return this.__userNameFontSizeUnit}__processUserNameFontSizeUnit(){this.__processUserNameFontSize()}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&&data.destroy&&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,TcHmiUserManagement.#tchmiFQN,{Attribute:"TextColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTextColor(){return this.__textColor}__processTextColor(){TcHmi.StyleProvider.processTextColor(this.__elementBase,this.__textColor)}setAllowLogout(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AllowLogout")),convertedValue!==this.__allowLogout&&(this.__allowLogout=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AllowLogout"}),this.__processAllowLogout())}getAllowLogout(){return this.__allowLogout}__processAllowLogout(){this.__getApiAccessForDomains()}setAllowSwitchUser(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AllowSwitchUser")),convertedValue!==this.__allowSwitchUser&&(this.__allowSwitchUser=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AllowSwitchUser"}),this.__processAllowSwitchUser())}getAllowSwitchUser(){return this.__allowSwitchUser}__processAllowSwitchUser(){this.__getApiAccessForDomains()}}})();TcHmi.Controls.registerEx("TcHmiUserManagement","TcHmi.Controls.Beckhoff",TcHmiUserManagement,{injectInGlobalObject:!0});export{TcHmiUserManagement as Control}; |