/* COPYRIGHT by SARTORIUS (Sartorius Lab Instruments GmbH & Co. KG) */
!function(e){var t={};function a(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=88)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.PARAM_GROUP="GROUP",e.PARAM_DATE_TIME="DATE_TIME",e.PARAM_MULTIPLE_SELECTION="MULTIPLE_SELECTION",e.PARAM_SELECTION="SELECTION",e.PARAM_QUANTITY="QUANTITY",e.PARAM_MEASURE="MEASURE",e.PARAM_STRING="STRING",e.ALIBI_IDENTIFIER="ALIBI_IDENTIFIER",e.PARAM_TEXT="TEXT",e.PARAM_FORMULA="FORMULA",e.PARAM_PASSWORD="PASSWORD",e.PARAM_BARCODE="BARCODE"}(t.EnumParameterTypes||(t.EnumParameterTypes={})),function(e){e.HIDDEN="HIDDEN",e.DISABLED="DISABLED",
e.ENABLED_PRIMARY="ENABLED_PRIMARY",e.ENABLED_SECONDARY="ENABLED_SECONDARY",e.ENABLED="ENABLED",e.ENABLED_EDITABLE="ENABLED_EDITABLE",e.ENABLED_INVALID="ENABLED_INVALID",e.ENABLED_INVALID_CFG="ENABLED_INVALID_CFG"}(t.EnumAppearance||(t.EnumAppearance={})),function(e){e.CODE128="CODE128",e.QR="QR",e.EAN13="EAN13",e.EAN8="EAN8",e.UPC="UPC",e.CODE39="CODE39",e.ITF14="ITF14",e.ITF="ITF",e.MSI="MSI",e.MSI10="MSI10",e.MSI11="MSI11",e.MSI1010="MSI1010",e.MSI1110="MSI1110",e.Pharmacode="Pharmacode"}(t.EnumBarcodeFormats||(t.EnumBarcodeFormats={})),t.EnumButtonType||(t.EnumButtonType={}),function(e){e.OPEN="OPEN",e.CLOSED="CLOSED",e.MOVE="MOVE"}(t.EnumDraftShieldPosition||(t.EnumDraftShieldPosition={})),function(e){e.NONE="NONE",e.UNLICENSED="UNLICENSED",e.ROWI="ROWI",e.LIWI="LIWI",e.LIRO="LIRO"}(t.EnumDraftShieldType||(t.EnumDraftShieldType={})),function(e){e.TOUCH="TOUCH"}(t.EnumUserEvent||(t.EnumUserEvent={})),function(e){e[e.OPEN=1]="OPEN",e[e.RUNNING=2]="RUNNING",
e[e.CLOSED_SUCCESS=3]="CLOSED_SUCCESS",e[e.CLOSED_FAILED=4]="CLOSED_FAILED"}(t.EnumJobStatus||(t.EnumJobStatus={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MQTT_TOPIC_WILDCARD_UNIQUE_ID="_replaceWithUniqueID_",t.MQTT_TOPIC_WILDCARD_GENERATED_TOKEN="_generatedToken_",t.MQTT_TOPIC_WILDCARD_SCREEN_ID="_replaceWithScreenID_",t.MQTT_TOPIC_WILDCARD_BUTTON_ID="_replaceWithButtonID_",t.MQTT_TOPIC_WILDCARD_TAB_ID="_replaceWithTabID_",function(e){e.DEVELOPER_MODE="/DEVELOPER_MODE",e.QAPP_CLEANUP="/QAPP/CLEANUP",e.QAPP_NAMESPACE="/QAPP",e.QAPP_DEBUG_TOPIC_PREAMBLE="/QAPP/DEBUG",e.QAPP_DEBUG_STOP_HEARTBEAT="/QAPP/DEBUG/stopHeartbeat",e.QAPP_LOGOUT_REQUEST="/QAPP/LOGOUT_REQUEST",e.QAPP_STARTED="/QAPP/STATE/STARTED",e.QAPP_STOPPED="/QAPP/STATE/STOPPED",e.QAPP_ERROR="/QAPP/STATE/ERROR",e.QAPP_HEARTBEAT="/QAPP/HEARTBEAT",e.QAPP_DATABASE_ACTION_DONE="/QAPP/DATABASE_ACTION_DONE",e.DEVICE_MODEL_NAME="/DEVICEINFORMATION/IDENTIFICATION/MODEL_NAME",
e.DEVICE_IS_FUSION="/FIRMWARELOADER/VERSION/IS_FUSION",e.NETWORK_MAC_ADDRESS="/DEVICEINFORMATION/NETWORK/MACADDRESS",e.NETWORK_HOSTNAME="/DEVICEINFORMATION/NETWORK/HOSTNAME",e.SENSOR_ACTOR_INFO="SENSOR_ACTOR/BALANCE/BALANCE_INFO",e.SENSOR_ACTOR_WEIGHT="SENSOR_ACTOR/BALANCE/WEIGHT",e.LEVELING_STATUS="/LEVELING/STATUS",e.LEVELING_CLOSE="/HMI_LEVELING/CLOSE",e.CALADJ_ISOCAL_STATUS="/CALIBRATION_ADJUSTMENT/ISOCAL",e.CALADJ_INTERNAL_RESULT="/CALIBRATION_ADJUSTMENT/RESULT",e.CLIMATE_INT_VALUE="/CLIMA_CONTROL/INT/VALUE",e.CLIMATE_EXT_VALUE="/CLIMA_CONTROL/EXT/VALUE",e.CLIMATE_INT_ID_SERIAL="CLIMA_CONTROL_INT_ID_SERIAL",e.CLIMATE_EXT_ID_SERIAL="CLIMA_CONTROL_EXT_ID_SERIAL",e.CLIMATE_STATUS="/CLIMA_CONTROL/STATUS",e.DRAFTSHIELD_TYPE="/DRAFTSHIELD/TYPE",e.DRAFTSHIELD_POSITION="/DRAFTSHIELD/IONIZER_INFO",e.QAPP_PARAMETERS_TOPIC_PREAMBLE="/QAPP/PARAMS",e.USERMANAGEMENT_AUTO_LOGOUT_EVENT="/USERMANAGEMENT/AUTO_LOG_OFF",
e.USERMANAGEMENT_AUTO_LOGOUT_PREWARNING_EVENT="/USERMANAGEMENT/AUTO_LOG_OFF_PREWARNING",e.REPORTING_SICS_PROTOCOL_HELPER="/SICS/ADD_TO_PROTOCOL",e.REPORTING_SBI_PROTOCOL_HELPER="/REPORTING/SBI/SINGLE_PRINT",e.COMM_SBI_PRINT_AT_STABILITY="SBI_PROTOCOL/STABILITY",e.JOBMGMT_TASK_WORKFLOWDATA="/TASK/WORKFLOWDATA",e.HMI_QAPP_WIZARD_SCREEN_TITLE="/QAPP/SCREENS/WIZARDSCREEN/HEADING_TITLE",e.HMI_VISUAL_SCREEN="/VISUAL_SCREEN",e.HMI_VISUAL_SCREEN_CLOSED="/HMI/VISUAL_SCREEN/CLOSED",e.HMI_OVERLAY_TOP="/HMI/OVERLAY_TOP",e.HMI_EVENT="/HMI/USER/EVENT",e.HMI_LOCK_SCREEN_STATE="HMI/LOCKSCREEN/STATE",e.HMI_ACTIVE_QAPP_SCREEN="/QAPP/SCREEN",e.HMI_ABSTRACT_SCREEN_BARBUTTONS="/QAPP/SCREENS/_replaceWithScreenID_/BARBUTTONS",e.HMI_ABSTRACT_SCREEN_BUTTONS="/QAPP/SCREENS/_replaceWithScreenID_/_replaceWithButtonID_",e.HMI_ABSTRACT_SCREEN_TAB_SINGLE="/QAPP/SCREENS/_replaceWithScreenID_/TAB",e.HMI_ABSTRACT_SCREEN_TABS="/QAPP/SCREENS/_replaceWithScreenID_/TABS/_replaceWithTabID_",
e.HMI_TABBED_SCREEN="/QAPP/SCREENS/TABBEDSCREEN",e.HMI_WEIGHING_SCREEN_BARBUTTONS="/QAPP/SCREENS/WEIGHING/BARBUTTONS",e.HMI_WEIGHING_SCREEN_INSTRUCTION1="/QAPP/SCREENS/WEIGHING/TEXT1",e.HMI_WEIGHING_SCREEN_INSTRUCTION2="/QAPP/SCREENS/WEIGHING/TEXT2",e.HMI_WEIGHING_SCREEN_TITLE="/QAPP/SCREENS/WEIGHING/NAVIGATION/TEXT",e.HMI_WEIGHING_SCREEN_PARAM1_TOPIC="/QAPP/SCREENS/WEIGHING/PARAM1",e.HMI_WEIGHING_SCREEN_PARAM2_TOPIC="/QAPP/SCREENS/WEIGHING/PARAM2",e.HMI_WEIGHINGSPLIT_SCREEN_BARBUTTONS="/QAPP/SCREENS/WEIGHINGSPLIT/BARBUTTONS",e.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION1="/QAPP/SCREENS/WEIGHINGSPLIT/TEXT1",e.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION2="/QAPP/SCREENS/WEIGHINGSPLIT/TEXT2",e.HMI_WEIGHINGSPLIT_SCREEN_TITLE="/QAPP/SCREENS/WEIGHINGSPLIT/NAVIGATION/TEXT",e.HMI_WEIGHINGSPLIT_SCREEN_PARAM1_TOPIC="/QAPP/SCREENS/WEIGHINGSPLIT/PARAM1",e.HMI_WEIGHINGSPLIT_SCREEN_PARAM2_TOPIC="/QAPP/SCREENS/WEIGHINGSPLIT/PARAM2",e.HMI_CHECKBARGRAPH_STATUS="/QAPP/CHECKBARGRAPH/STATUS",
e.HMI_CHECKBARGRAPH_VALUE="/QAPP/CHECKBARGRAPH/VALUE",e.HMI_QAPP_PARAMETER_INPUT="/QAPP/PARAMETER_INPUT",e.HMI_LOCK_SCREEN="/QAPP/SCREENS/LOCK",e.HMI_LOCK_LOADING_MODAL="/QAPP/SCREENS/LOCK/LOADING_MODAL",e.HMI_SINGLETABBUTTONBAR_SCREEN="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN",e.HMI_SINGLETABBUTTONBAR_SCREEN_BARBUTTONS="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN/BARBUTTONS",e.HMI_SINGLETABBUTTONBAR_SCREEN_TOPLEFTBUTTON="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN/TOPLEFTBUTTON",e.HMI_LOCK_LOADING_MODAL_TEXT="/QAPP/SCREENS/LOCK/LOADING_MODAL/TEXT",e.HMI_LOCK_LOADING_MODAL_APPEARANCE="/QAPP/SCREENS/LOCK/LOADING_MODAL/APPEARANCE",e.HMI_LOCK_MESSAGEBOX="/QAPP/SCREENS/LOCK/MESSAGEBOX",e.HMI_LOCK_RESET="/QAPP/SCREENS/LOCK/RESET",e.HMI_LOCK_UNLOCK="/QAPP/SCREENS/LOCK/UNLOCK",e.HMI_LOADING_MODAL="HMI/LOADING_MODAL",e.HMI_LOADING_MODAL_TEXT="HMI/LOADING_MODAL/TEXT",e.HMI_LOADING_MODAL_APPEARANCE="HMI/LOADING_MODAL/APPEARANCE",e.HMI_MESSAGEBOX="/QAPP/MESSAGEBOX",
e.HMI_PARAMDETAILSOVERLAY="/QAPP/PARAMDETAILSOVERLAY",e.HMI_PRINT_HEADER="/HMI/PRINT_HEADER",e.MESSAGE_HANDLER_MESSAGE="/MESSAGE_HANDLER/MESSAGE",e.WEIGHING_VALUE_NET="WEIGHING/WEIGHT/NET",e.WEIGHING_VALUE_NET_HIGH_RES="WEIGHING/WEIGHT/NET_HIGH_RES",e.WEIGHING_VALUE_TARE="WEIGHING/WEIGHT/TARE",e.WEIGHING_VALUE_TARE1="WEIGHING/WEIGHT/TARE1",e.WEIGHING_VALUE_TARE2="WEIGHING/WEIGHT/TARE2",e.WEIGHING_VALUE_GROSS="WEIGHING/WEIGHT/GROSS_CALC",e.WEIGHING_VALUE_DISPLAY="WEIGHING/WEIGHT/DISPLAY",e.WEIGHING_SELECTED_DISPLAY_VALUE="WEIGHING/WEIGHT/DISPLAY/SELECTED",e.WEIGHING_WEIGHT_BLOCK="WEIGHING/WEIGHT/BLOCK",e.WEIGHING_WAITING_FOR_STABILITY="WEIGHING/WAITING_FOR_STABILITY",e.WEIGHING_STATUS_ERROR="WEIGHING/STATUS/ERROR ",e.WEIGHING_TARE_BLOCK="WEIGHING/DOING_ZERO_TARE",e.WEIGHING_STATE="WEIGHING/STATE",e.SURE_ACTIVE="/WEIGHING/SURE/ACTIVE",e.SURE_RANGE_1_A="/WEIGHING/SURE/PARAM_SURE_RANGE_1_A",e.SURE_RANGE_1_B="/WEIGHING/SURE/PARAM_SURE_RANGE_1_B",
e.SURE_RANGE_1_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_1_B_EXP",e.SURE_RANGE_2_A="/WEIGHING/SURE/PARAM_SURE_RANGE_2_A",e.SURE_RANGE_2_B="/WEIGHING/SURE/PARAM_SURE_RANGE_2_B",e.SURE_RANGE_2_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_2_B_EXP",e.SURE_RANGE_3_A="/WEIGHING/SURE/PARAM_SURE_RANGE_3_A",e.SURE_RANGE_3_B="/WEIGHING/SURE/PARAM_SURE_RANGE_3_B",e.SURE_RANGE_3_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_3_B_EXP",e.METROLOGY_MAX_DIGITS="WEIGHING/METROLOGY/MAXIMUM_DIGITS",e.METROLOGY_MAX_DIGITS_DEBUG="/QAPP/DEBUG/WEIGHING/METROLOGY/MAXIMUM_DIGITS",e.METROLOGY_RANGES="WEIGHING/METROLOGY/RANGES",e.METROLOGY_APPROVED_FOR_VERIFICATION="WEIGHING/METROLOGY/APPROVED_FOR_VERIFICATION",e.ESIGNATURE_PERFORM="/HMI/PERFORM_SIGNATURE",e.ESIGNATURE_RESULT="/HMI/ELECTRONIC_SIGNATURE_RESULT",e.REPORTING_PRINTABLE_VALUE="/REPORTING/PRINTABLE_VALUE",e.REPORTING_PRINTQUEUE_DISPLAYED="/HMI/PRINT_QUEUE",e.REPORTING_PRINT_PROCESS_RESULT="/REPORTING/PRINT_PROCESS",
e.CUSTOMIZED_WEIGHT_DISPLAY_VALUE="/QAPP/WEIGHING/WEIGHT/APPLICATION/_replaceWithUniqueID_/VALUE",e.CUSTOMIZED_REST_HANDLER_CONFIGURATION="/QAPP/REST/CFG",e.COMM_QAPP_DIRECT_INTERFACE="/QAPP/QAPP_DIRECT_INTERFACE",e.COMM_FILE_OPERATIONS_ASYNC_TOKEN="/CONNECTORMANAGEMENT/PROGRESS/_generatedToken_"}(t.MqttTopics||(t.MqttTopics={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneJSON=function(e){return JSON.parse(JSON.stringify(e))}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2),i=a(13),n=a(0);t.isTypeOfIDateTimeParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_DATE_TIME},t.isTypeOfIMultipleSelectionParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_MULTIPLE_SELECTION},t.isTypeOfISelectionParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_SELECTION},t.isTypeOfIQuantityParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_QUANTITY},
t.isTypeOfIMeasureParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_MEASURE},t.isTypeOfIStringParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_STRING},t.isTypeOfIAlibiIdentifierParameter=function(e){return e.type===n.EnumParameterTypes.ALIBI_IDENTIFIER},t.isTypeOfITextParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_TEXT},t.isTypeOfIFormulaParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_FORMULA},t.isTypeOfIPasswordParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_PASSWORD},t.isITextStructure=function(e){return"string"==typeof e.id&&"object"==typeof e.args&&e.args instanceof Array};const r={id:"",args:[]};function o(e){const t=s.cloneJSON(r);return i.isString(e)&&(t.id=e),t}t.createEmptyTextStructure=o;const _={id:"",type:n.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:n.EnumAppearance.HIDDEN,parameters:[]};function E(e){const t=s.cloneJSON(_);return i.isString(e)&&(t.id=e),t}
t.createEmptyParameterGroup=E;const l={id:"",type:n.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:n.EnumAppearance.HIDDEN,parameters:[E()]};t.createEmptyParameterGroupOfGroups=function(){return s.cloneJSON(l)};const A={appearance:n.EnumAppearance.HIDDEN,id:"",text:o()};t.createEmptySelectionParameterOption=function(){return s.cloneJSON(A)};const u={id:"",type:n.EnumParameterTypes.PARAM_SELECTION,value:{selection:{id:""}},header:o(),title:o(),info:{options:[A]},appearance:n.EnumAppearance.HIDDEN};t.createEmptySelectionParameter=function(e){const t=s.cloneJSON(u);return i.isString(e)&&(t.id=e),t};const c={id:"",type:n.EnumParameterTypes.PARAM_MULTIPLE_SELECTION,value:{selections:[]},header:o(),title:o(),info:{options:[A]},appearance:n.EnumAppearance.HIDDEN};t.createEmptyMultipleSelectionParameter=function(e){const t=s.cloneJSON(c);return i.isString(e)&&(t.id=e),t},t.setValueOfSelectionParameter=function(e,t){if(e.type!==n.EnumParameterTypes.PARAM_SELECTION)return!1
;if(i.isString(t)){const a=i.getObjectByID(e.info.options,t);if(i.isObject(a)&&i.isString(a.id)&&a.id===t)return e.value.selection=s.cloneJSON(a),!0}else if(e.info.options.length>0)return e.value.selection=s.cloneJSON(e.info.options[0]),!0;return!1},t.setValueOfMulitpleSelectionParameter=function(e,t){if(e.type!==n.EnumParameterTypes.PARAM_MULTIPLE_SELECTION)return!1;if(i.isObject(t)&&Array.isArray(t)){e.value.selections=[];for(let a=0;a<t.length;a++){const n=i.getObjectByID(e.info.options,t[a]);i.isObject(n)&&i.isString(n.id)&&n.id===t[a]&&e.value.selections.push(s.cloneJSON(n))}return!0}return e.info.options.length>0&&(e.value.selections=s.cloneJSON(e.info.options),!0)},t.SAMPLE_DATE_TIME_ID="SAMPLE_DATE_TIME_ID";const I={id:t.SAMPLE_DATE_TIME_ID,type:n.EnumParameterTypes.PARAM_DATE_TIME,value:{timestamp:0},title:{id:"_QAPP_LIB_PARAM_TITLE_SAMPLE_DATETIME",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_SAMPLE_DATETIME",args:[]},info:{isDate:!0,isTime:!0},
appearance:n.EnumAppearance.HIDDEN};t.createEmptyDateTimeParameter=function(e){const t=s.cloneJSON(I);return i.isString(e)&&(t.id=e),t};const T={id:"",type:n.EnumParameterTypes.PARAM_STRING,value:{string:""},header:o(),title:o(),info:{minimum:{length:0},maximum:{length:0}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyStringParameter=function(e){const t=s.cloneJSON(T);return i.isString(e)&&(t.id=e),t};const d={id:"",type:n.EnumParameterTypes.PARAM_BARCODE,value:{string:"",format:n.EnumBarcodeFormats.CODE128,width:120},header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN};t.createEmptyBarcodeParameter=function(e){const t=s.cloneJSON(d);return i.isString(e)&&(t.id=e),t};const N={id:"",type:n.EnumParameterTypes.PARAM_PASSWORD,value:{string:""},header:o(),title:o(),info:{passwordLength:0,minimum:{length:0},maximum:{length:0}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyPasswordParameter=function(e){const t=s.cloneJSON(N);return i.isString(e)&&(t.id=e),t};const p={id:"",
type:n.EnumParameterTypes.PARAM_TEXT,value:{text:o()},header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN,info:{suppressTitle:!1}};t.createEmptyTextParameter=function(e){const t=s.cloneJSON(p);return i.isString(e)&&(t.id=e),t},t.createEmptyTextParameterValueOnly=function(){let e=s.cloneJSON(p);return e.info.suppressTitle=!0,e};const S={visual:"",eval:""};t.createEmptyFormulaParameterValue=function(){return s.cloneJSON(S)};const m={id:"",type:n.EnumParameterTypes.PARAM_FORMULA,value:[],header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN,info:{maximum:{length:0}}};t.createEmptyFormulaParameter=function(e){const t=s.cloneJSON(m);return i.isString(e)&&(t.id=e),t};const R={mark:"",sign:"",number:"0",decimals:0,auxiliaryDigits:0,unit:"",interval:1,isStable:!1,isSpecial:!1,isWarning:!1,isInvalid:!0};t.createEmptyMeasureParameterValue=function(){return s.cloneJSON(R)};const P={id:"",type:n.EnumParameterTypes.PARAM_MEASURE,value:R,header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN}
;t.createEmptyMeasureParameter=function(e){const t=s.cloneJSON(P);return i.isString(e)&&(t.id=e),t};const D={decimals:0,preferredDecimals:0,numbers:[],unit:""};t.createEmptyQuantityParameterValue=function(){return s.cloneJSON(D)},t.QUANTITY_PARAM_MIN_MAX_NAN="nan",t.QUANTITY_PARAM_NUMBERS_MAX=3;const C={id:"",type:n.EnumParameterTypes.PARAM_QUANTITY,value:D,header:o(),title:o(),info:{minimum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN},maximum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyQuantityParameter=function(e){const t=s.cloneJSON(C);return i.isString(e)&&(t.id=e),t};const h={id:"",type:n.EnumParameterTypes.ALIBI_IDENTIFIER,value:{alibiIdentifier:NaN},header:o(),title:o(),appearance:n.EnumAppearance.ENABLED};t.createEmptyAlibiIdentifier=function(){return s.cloneJSON(h)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(1);var n;!function(e){e[e.SHOW_SCREEN=0]="SHOW_SCREEN",
e[e.HIDE_SCREEN=1]="HIDE_SCREEN",e[e.SHOW_OVERLAY=2]="SHOW_OVERLAY",e[e.HIDE_OVERLAY=3]="HIDE_OVERLAY",e[e.SHOW_LOADINGSCREEN=4]="SHOW_LOADINGSCREEN",e[e.HIDE_LOADINGSCREEN=5]="HIDE_LOADINGSCREEN",e[e.SHOW_MESSAGEBOX=6]="SHOW_MESSAGEBOX",e[e.HIDE_MESSAGEBOX=7]="HIDE_MESSAGEBOX",e[e.SHOW_LOCKSCREEN=8]="SHOW_LOCKSCREEN",e[e.HIDE_LOCKSCREEN=9]="HIDE_LOCKSCREEN",e[e.SHOW_LOCKLOADINGSCREEN=10]="SHOW_LOCKLOADINGSCREEN",e[e.HIDE_LOCKLOADINGSCREEN=11]="HIDE_LOCKLOADINGSCREEN",e[e.SHOW_LOCKMESSAGEBOX=12]="SHOW_LOCKMESSAGEBOX",e[e.HIDE_LOCKMESSAGEBOX=13]="HIDE_LOCKMESSAGEBOX"}(n=t.ScreenEventType||(t.ScreenEventType={}));t.AbstractScreen=class{constructor(e){this.events$=new s.Subject,this.mqttHandler=e}show(){console.log("AbstractScreen: show "+this.getId()+" @ "+i.MqttTopics.HMI_ACTIVE_QAPP_SCREEN),this.mqttHandler.publish(i.MqttTopics.HMI_ACTIVE_QAPP_SCREEN,'{ "screen":"'+this.getId()+'" }'),this.events$.next({type:n.SHOW_SCREEN,id:this.getId()})}hide(){}publishContent(e,t,a=!0){
let s=e?this.getMqttTopicBaseExtensible()+e:this.getMqttTopicBase();console.log("AbstractScreen: publishContent @ "+s),this.mqttHandler.publish(s,t,{retain:a})}getMqttTopicBase(){return"SCREENS/"+this.getId()}getMqttTopicBaseExtensible(){return this.getMqttTopicBase()+"/"}getButton(e){}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.printParameters="printParameters",e.printPrintQueueWithElectronicSignature="printPrintQueueWithElectronicSignature",e.printParametersDirect="printParametersDirect",e.getPrintQueue="getPrintQueue",e.isPrintQueueEmpty="isPrintQueueEmpty",e.clearPrintQueue="clearPrintQueue",e.requestPrintableValueComment="requestPrintableValueComment",e.setRedactionStatus="setRedactionStatus",e.getAlibiRecord="getAlibiRecord",e.getAlibiRecordList="getAlibiRecordList",e.setPathAndFilenameForNextReport="setPathAndFilenameForNextReport",e.setMetaDataInCurrentReport="setMetaDataInCurrentReport",e.applyProfiles="applyProfiles",
e.printParametersWithProfile="printParametersWithProfile"}(t.RestMethodsREPORTING||(t.RestMethodsREPORTING={})),function(e){e.getTemperature="getTemperature",e.getHumidity="getHumidity",e.getAirPressure="getAirPressure",e.getAirDensity="getAirDensity",e.getTemperatureUncertainty="getTemperatureUncertainty",e.getHumidityUncertainty="getHumidityUncertainty",e.getAirPressureUncertainty="getAirPressureUncertainty",e.getConfigurationData="getConfigurationData"}(t.RestMethodsCLIMATECONTROL||(t.RestMethodsCLIMATECONTROL={})),function(e){e.getWorkstate="getWorkstate",e.getTaskTemplate="getTaskTemplate",e.createTask="createTask",e.readTask="readTask",e.updateTask="updateTask",e.validate="validate",e.saveWorkstate="saveWorkstate",e.deleteWorkstate="deleteWorkstate",e.getTaskNames="getTaskNames",e.getTaskNamesByOrderNumber="getTaskNamesByOrderNumber",e.setTaskEvent="setTaskEvent"}(t.RestMethodsTASK_MANAGEMENT||(t.RestMethodsTASK_MANAGEMENT={})),function(e){e.getCurrentUser="getCurrentUser",
e.checkRightsOfCurrentUser="checkRightsOfCurrentUser"}(t.RestMethodsACCESS_MANAGEMENT||(t.RestMethodsACCESS_MANAGEMENT={})),function(e){e.addEventExt="addEventExt",e.getRecords="getRecords"}(t.RestMethodsAUDITTRAIL||(t.RestMethodsAUDITTRAIL={})),function(e){e.startInternCal="startInternCal",e.disableAutoIsoCal="disableAutoIsoCal"}(t.RestMethodsCALIBRATION||(t.RestMethodsCALIBRATION={})),function(e){e.getFormatConfiguration="getFormatConfiguration",e.getFormatConfigurationI18n="getFormatConfigurationI18n"}(t.RestMethodsCLOCK_HANDLER||(t.RestMethodsCLOCK_HANDLER={})),function(e){e.getConfigurations="getConfigurations",e.putFileAsync="putFileAsync",e.putFileAsyncWithoutMD5="putFileAsyncWithoutMD5",e.getFileAsyncWithoutMD5="getFileAsyncWithoutMD5",e.listDirectory="listDirectory"}(t.RestMethodsCONNECTOR_MANAGEMENT||(t.RestMethodsCONNECTOR_MANAGEMENT={})),function(e){e.getSerialNoBalance="getSerialNoBalance",e.getModelName="getModelName",e.getVersionBalance="getVersionBalance",
e.getVersionPackage="getVersionPackage",e.getParameter="getParameter",e.sendUDPBroadcast="sendUDPBroadcast",e.cancelUDP="cancelUDP",e.listenUDP="listenUDP",e.addRunningActivity="addRunningActivity",e.removeRunningActivity="removeRunningActivity",e.setActuatorsActive="setActuatorsActive",e.setDeviceCleaned="setDeviceCleaned"}(t.RestMethodsDEVICE_INFORMATION||(t.RestMethodsDEVICE_INFORMATION={})),function(e){e.getQappProtocolPortNumber="getQappProtocolPortNumber",e.getQappProtocolInterfaces="getQappProtocolInterfaces",e.isInterfaceActive="isInterfaceActive",e.setGPIOPorts="setGPIOPorts"}(t.RestMethodsINTERFACE_MANAGEMENT||(t.RestMethodsINTERFACE_MANAGEMENT={})),function(e){e.getLanguage="getLanguage",e.getText="getText",e.getTexts="getTexts"}(t.RestMethodsLOCALIZER||(t.RestMethodsLOCALIZER={})),function(e){e.addMessage="addMessage",e.deleteMessageByCategory="deleteMessageByCategory",e.getAllMessagesByCategory="getAllMessagesByCategory",
e.deleteMessagesByCategory="deleteMessagesByCategory",e.removeMessage="removeMessage"}(t.RestMethodsMESSAGE_HANDLER||(t.RestMethodsMESSAGE_HANDLER={})),function(e){e.loadProfile="loadProfile",e.getProfiles="getProfiles"}(t.RestMethodsPROFILE_MANAGEMENT||(t.RestMethodsPROFILE_MANAGEMENT={})),function(e){e.playEndOfActionSound="playEndOfActionSound",e.playMessageSound="playMessageSound"}(t.RestMethodsSOUND_MANAGEMENT||(t.RestMethodsSOUND_MANAGEMENT={})),function(e){e.isAutoLogout="isAutoLogout",e.getListRoles="getListRoles"}(t.RestMethodsUSER_MANAGEMENT||(t.RestMethodsUSER_MANAGEMENT={})),function(e){e.createWeightApplication="createWeightApplication",e.enableWeightApplication="enableWeightApplication",e.selectWeightApplication="selectWeightApplication",e.destroyWeightApplication="destroyWeightApplication",e.setButton="setButton",e.triggerStableWeightBlock="triggerStableWeightBlock",e.cancelStableWeightBlock="cancelStableWeightBlock",e.doZero="doZero",e.clearTare="clearTare",
e.clearTare1="clearTare1",e.clearTare2="clearTare2",e.clearTareAll="clearTareAll",e.doTare="doTare",e.doTare1="doTare1",e.doTare2="doTare2",e.doTareAuto="doTareAuto",e.doZeroTare="doZeroTare",e.doZeroTareAuto="doZeroTareAuto",e.setTare1="setTare1",e.cancelDoing="cancelDoing",e.setTare2="setTare2",e.setUnit="setUnit",e.getParameter="getParameter",e.getParameterIds="getParameterIds",e.getRangeParameters="getRangeParameters",e.setMinUsp="setMinUsp",e.setMinWeight="setMinWeight",e.insertWeightInvalidation="insertWeightInvalidation",e.removeWeightInvalidation="removeWeightInvalidation",e.setAmbientCondition="setAmbientCondition",e.setSafetyFactor="setSafetyFactor"}(t.RestMethodsWEIGHING||(t.RestMethodsWEIGHING={})),function(e){e.openLast="openLast",e.closeAll="closeAll",e.openLeft="openLeft",e.openRight="openRight",e.openTop="openTop"}(t.RestMethodsDRAFTSHIELD||(t.RestMethodsDRAFTSHIELD={})),function(e){e.setJobStatusAndReason="setJobStatusAndReason"
}(t.RestMethodsJOB_MANAGEMENT||(t.RestMethodsJOB_MANAGEMENT={})),function(e){e.disableChecker="disableChecker",e.enableChecker="enableChecker"}(t.RestMethodsSELF_MONITOR||(t.RestMethodsSELF_MONITOR={})),function(e){e.start="start"}(t.RestMethodsLEVELING||(t.RestMethodsLEVELING={})),function(e){e.getConfigData="getConfigData",e.getParameterData="getParameterData"}(t.RestMethodsMENU_HANDLER||(t.RestMethodsMENU_HANDLER={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(38),i="SUCCESS",n="FAILED";t.CubisRestResponse=class{constructor(e){if(this.restResponse=void 0,"boolean"==typeof e)this.result=e?i:n,this.rawReturns={};else{let t;this.restResponse=e;try{t=JSON.parse(this.restResponse.stdout.toString())}catch(e){throw e.message+="\nreceived: "+this.restResponse.stdout.toString(),e}this.rawReturns=t.returns,this.result=t.result}}isSuccess(){return this.result===i}};t.BaseProxy=class{constructor(){this.body={method:"",params:{}}}syncRequest(){
let e,t=JSON.stringify(this.body),a=`http://127.0.0.1:8080/rest/${this.restEndpoint}`;const i=process.hrtime();let n=[a,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"];e=s.spawnSync("curl",n,{input:t});const r=process.hrtime(i);return console.log(`${this.body.method} (hr): ${r[0]}s ${r[1]/1e6}ms`),e}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ZERO="_FONT_ICON_ZERO",e.TARE="_FONT_ICON_TARE",e.TARE_1="_FONT_ICON_TARE1",e.CLR_TARE1="_FONT_ICON_CLR_TARE1",e.SHOW_TARE1="_FONT_ICON_SHOW_TARE1",e.HIDE_TARE1="_FONT_ICON_HIDE_TARE1",e.DELETE="_FONT_ICON_DELETE",e.EDIT="_FONT_ICON_EDIT",e.PRINT="_FONT_ICON_PRINT",e.OK="_FONT_ICON_OK",e.CANCEL="_FONT_ICON_CANCEL",e.ERROR="_FONT_ICON_ERROR",e.WARNING="_FONT_ICON_WARNING",e.INFO="_FONT_ICON_INFO",e.NEXT="_FONT_ICON_NEXT",e.PREV="_FONT_ICON_PREV",e.RESULT="_FONT_ICON_RESULT",e.IONIZER="_FONT_ICON_IONIZER",e.PRINT_ADD="_FONT_ICON_PRINT_ADD",
e.X_ACROSS="_FONT_ICON_X_ACROSS",e.RESULT_ADD="_FONT_ICON_RESULT_ADD",e.RHO="_FONT_ICON_RHO",e.BACK="_FONT_ICON_BACK",e.MIN_USP="_FONT_ICON_MIN_USP",e.START="_FONT_ICON_START",e.END="_FONT_ICON_END",e.DOCU="_FONT_ICON_DOCU",e.INVALIDATE_SAMPLE="_FONT_ICON_INVALID_SAMPLE",e.SEARCH="_FONT_ICON_SEARCH",e.SEARCH_ACTIVE="_FONT_ICON_SEARCH_ACTIVE",e.FILTER="_FONT_ICON_FILTER",e.FILTER_ACTIVE="_FONT_ICON_FILTER_ACTIVE",e.ADD="_FONT_ICON_ADD",e.LOGOUT="_FONT_ICON_LOGOUT",e.RELOAD="_FONT_ICON_RELOAD",e.WEIGHING="_FONT_ICON_WEIGHING",e.QUESTION="_FONT_ICON_QUESTION",e.SKIP="_FONT_ICON_SKIP"}(t.EnumFontLabels||(t.EnumFontLabels={}))},function(e,t){e.exports=require("lodash")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(2);function n(e){return i.cloneJSON({module:"qappHandler",method:"buttonClickEvent",params:{buttonId:e||""}})}function r(e){let t={nameId:"",appearance:"HIDDEN",type:"",label:{id:"",args:[]},effect:n()}
;return void 0!==e.nameId&&(t.nameId=e.nameId),void 0!==e.labelCenter&&(t.labelCenter=e.labelCenter),void 0!==e.labelRight&&(t.labelRight=e.labelRight),void 0!==e.icon&&(t.icon=e.icon),void 0!==e.lastSelected&&(t.lastSelected=e.lastSelected),t.label=e.label,t.appearance=e.appearance,t.effect.params.buttonId=e.buttonId,e.longPressButtonId&&(t.longPressEffect=n(),t.longPressEffect.params.buttonId=e.longPressButtonId),void 0!==e.labelAlign&&(t.labelAlign=e.labelAlign),void 0!==e.labelCenterAlign&&(t.labelCenterAlign=e.labelCenterAlign),void 0!==e.labelRightAlign&&(t.labelRightAlign=e.labelRightAlign),t}t.createButtonEmptyEffect=n,t.IButtonParameterInterface2IButtonJsonInterface=r,t.IButtonJsonInterface2IButtonParameterInterface=function(e){let t={buttonId:e.effect.params.buttonId,appearance:e.appearance,label:e.label};return e.nameId&&(t.nameId=e.nameId),e.labelCenter&&(t.labelCenter=e.labelCenter),e.labelRight&&(t.labelRight=e.labelRight),
e.longPressEffect&&(t.longPressButtonId=e.longPressEffect.params.buttonId),void 0!==e.icon&&(t.icon=e.icon),void 0!==e.lastSelected&&(t.lastSelected=e.lastSelected),void 0!==e.labelAlign&&(t.labelAlign=e.labelAlign),void 0!==e.labelCenterAlign&&(t.labelCenterAlign=e.labelCenterAlign),void 0!==e.labelRightAlign&&(t.labelRightAlign=e.labelRightAlign),t};class o{constructor(e,t,a){this.lastPublishedTabContent="",this.mqttHandler=e,this.buttonTopic="SCREENS/"+t.getId()+"/"+a.buttonId,this.buttonJson=r(a)}setButtonId(e,t=!0){this.buttonJson.effect.params.buttonId=e,t&&this.publish()}setLongPressButtonId(e,t=!0){e?(this.buttonJson.longPressEffect||(this.buttonJson.longPressEffect=n()),this.buttonJson.longPressEffect.params.buttonId=e):delete this.buttonJson.longPressEffect,t&&this.publish()}setJson(e){this.buttonJson=JSON.parse(e),this.publish()}setNameId(e,t=!0){this.buttonJson.nameId=e,t&&this.publish()}getNameId(){return this.buttonJson.nameId}setAppearance(e,t=!0){
this.buttonJson.appearance=e,t&&this.publish()}setType(e,t=!0){this.buttonJson.type=e,t&&this.publish()}getType(){return this.buttonJson.type}getLabel(){return this.buttonJson.label}setLabel(e,t=!0){this.buttonJson.label=e,t&&this.publish()}getIcon(){return this.buttonJson.icon}setIcon(e,t=!0){void 0!==e&&e.length>0?this.buttonJson.icon=e:delete this.buttonJson.icon,t&&this.publish()}getLabelCenter(){return this.buttonJson.labelCenter}setLabelCenter(e,t=!0){this.buttonJson.labelCenter=e,t&&this.publish()}getLabelRight(){return this.buttonJson.labelRight}setLabelRight(e,t=!0){this.buttonJson.labelRight=e,t&&this.publish()}getAppearance(){let e=s.EnumAppearance.HIDDEN;return this.buttonJson.appearance&&"string"==typeof this.buttonJson.appearance&&Object.keys(s.EnumAppearance).indexOf(this.buttonJson.appearance)?this.buttonJson.appearance:e}getJson(){return this.buttonJson}getTopic(){return this.buttonTopic}getButtonId(){return this.buttonJson.effect.params.buttonId}
getLongPressButtonId(){return this.buttonJson.longPressEffect?this.buttonJson.longPressEffect.params.buttonId:null}publish(){let e=JSON.stringify(this.buttonJson);e!==this.lastPublishedTabContent&&(this.mqttHandler.publish(this.buttonTopic,e),this.lastPublishedTabContent=e)}show(){this.publish()}}t.Button=o,t.default=o},function(e,t){e.exports=require("rxjs/Subject")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.INFO="INFO",e.ERROR="ERROR",e.WARNING="WARNING",e.QUESTION="QUESTION"}(t.EnumMessageboxType||(t.EnumMessageboxType={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QAPP_TIMER_EVENT="QAPP_TIMER_EVENT";t.QAppTimerEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_TIMER_EVENT}},t.QAPP_INTERVAL_EVENT="QAPP_INTERVAL_EVENT";t.QAppIntervalEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_INTERVAL_EVENT}},t.IMMEDIATE_EVENT="IMMEDIATE_EVENT";t.ImmediateEvent=class{constructor(e){
this.payload=e,this.type=t.IMMEDIATE_EVENT}},t.SIMPLE_EVENT="SIMPLE_EVENT";t.SimpleEvent=class{constructor(e){this.payload=e,this.type=t.SIMPLE_EVENT}},t.QAPP_SYNC_CALL_DONE_EVENT="QAPP_SYNC_CALL_DONE_EVENT",function(e){e.SYNC_CALL_SAVE_WORKSTATE="SYNC_CALL_SAVE_WORKSTATE"}(t.QAPP_SYNC_CALL_DONE_EVENT_TYPE||(t.QAPP_SYNC_CALL_DONE_EVENT_TYPE={}));t.QAppSyncCallDoneEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_SYNC_CALL_DONE_EVENT}},t.QAPP_ASYNC_CALL_DONE_EVENT="QAPP_ASYNC_CALL_DONE_EVENT",t.QAPP_ASYNC_CALL_FAIL_EVENT="QAPP_ASYNC_CALL_FAIL_EVENT";t.QAppAsyncCallDoneEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_ASYNC_CALL_DONE_EVENT}};t.QAppAsyncCallFailEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_ASYNC_CALL_FAIL_EVENT}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2);function i(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&("number"==typeof e&&!isNaN(e))}function n(e){
return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"string"==typeof e}function r(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"object"==typeof e}function o(e,t,a){if(r(e)){n(a)||(a="id"),a=a;for(let s=0;s<e.length;s++)if(e[s].hasOwnProperty(a)&&n(e[s][a])&&e[s][a]===t)return s}}t.isNumber=i,t.isString=n,t.isObject=r,t.isBoolean=function(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"boolean"==typeof e},t.getObjectByID=function(e,t,a){let s=o(e,t,a);if(i(s))return e[s]},t.getIndexByID=o,t.overwriteExistingAttributes=function(e,t){if(r(e)&&r(t)){let a=Object.keys(t);for(let i=0;i<a.length;i++)"function"!=typeof t[a[i]]&&e.hasOwnProperty(a[i])&&typeof t[a[i]]==typeof e[a[i]]&&(t[a[i]]=s.cloneJSON(e[a[i]]))}},t.setEnumSafely=function(e,t,a){const s=Object.keys(t);for(const a of s)if(t[a]===e)return t[a];return n(a)?a:s.length>0?t[s[0]]:void 0}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(21),n=a(15),r=a(18),o=a(0)
;t.QUANTITY_PARAM_MAX_DIGITS_GENERAL=9;class _{static setValue(e,a,s=0,i=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return _.setValueValueWithDecimals(e.value,a,e.value.preferredDecimals,s,i)}static setValueValue(e,a,s=0,i=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return _.setValueValueWithDecimals(e,a,e.preferredDecimals,s,i)}static setValueWithDecimals(e,a,s,i=0,n=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return _.setValueValueWithDecimals(e.value,a,s,i,n)}static setValueValueWithDecimals(e,a,r,o=0,_=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,E=!1){let l="number"==typeof a?a:a.value,A=_-Math.floor(Math.abs(l)).toString().length,u=Math.min(A,r);u=Math.max(u,0),0===o&&e&&(e.decimals=u);let c=i.SartoMath.roundExactToDecimals(l,u).toFixed(u);if(e){if(E||0!==o)"number"!=typeof a&&(n.isArray(e.unit)?e.unit[0]=a.unit:e.unit=a.unit);else{for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.numbers[t]&&(e.numbers[t+1]=e.numbers[t]);if("number"==typeof a){
if(n.isArray(e.unit))for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t])}else if(n.isArray(e.unit)){for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t]);e.unit[0]=a.unit}else e.unit=a.unit}e.numbers[o]=c}return c}static roundToDecimalPlaces(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return _.roundToDecimalPlacesValue(e.value,a)}static roundToDecimalPlacesAllNumbers(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return _.roundToDecimalPlacesValue(e.value,a,!0)}static roundToDecimalPlacesValue(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,s=!1){return e.numbers.forEach((t,i)=>{(0===i||s)&&-1!==e.preferredDecimals&&_.setValueValueWithDecimals(e,parseFloat(t),e.preferredDecimals,i,a,!0)}),e.numbers.map(e=>parseFloat(e))}static getValue(e,t=0){let a,s=(a=void 0!==e.value?e.value:e).numbers[t];return void 0!==s?parseFloat(s):Number.NaN}static getIntValue(e,t=0){let a,s=(a=void 0!==e.value?e.value:e).numbers[t]
;return void 0!==s?parseInt(s,10):Number.NaN}static changeUnit(e,a){let s;s=void 0!==e.value?e.value:e;const i=r.unitStringToLong(s.unit);s.numbers.forEach((e,n)=>{const o=r.convertWgtUnit(parseFloat(e),i,a);_.setValueValueWithDecimals(s,o,s.preferredDecimals,n,t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,!0)}),s.unit=r.unitStringToShort(a)}}t.QuantityParameter=_;t.WeightBlockHelper=class{static getMeasureParameter(e,t){for(const a of e.parameters)for(const e of a.parameters)if(e.id===t&&e.type===o.EnumParameterTypes.PARAM_MEASURE)return e}}},function(e,t){e.exports=require("util")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("mathjs")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(21),i=a(17);var n=a(17);t.bignumber=n.bignumber,t.abs=n.abs;const r=a(22);function o(e){let t=void 0;return r.unitsMap.hasOwnProperty(e)&&(t=r.unitsMap[e].conversionDecimalPlacesShift),void 0===t&&(t=1),t}var _;t.calcInterval=function(e,t,a){
return i.bignumber(a).times(s.SartoMath.decPowers(o(e))).times(s.SartoMath.decPowers(-1*o(t))).toNumber()},t.calcDecimals=function(e){return e>=1?0:Math.ceil(-1*Math.log10(e))},t.unitStringToShort=function(e){return r.unitsMap.hasOwnProperty(e)?r.unitsMap[e].mark:r.unitsMap[r.EnumUnit.INVALID].mark},t.getUnitFactor=function(e){let t=void 0;return r.unitsMap.hasOwnProperty(e)&&(t=r.unitsMap[e].conversionFactor),void 0===t&&(t=1),t},t.getUnitShift=o,function(e){e.none="NONE",e.o="UNIVERSAL",e["µg"]="MICROGRAM",e.mg="MILLIGRAM",e.g="GRAM",e.kg="KILOGRAM",e.t="TONNE",e.mct="MILLICARAT",e.ct="CARAT",e.kct="KILOCARAT",e.K="KARAT",e.lb="POUND",e.oz="OUNCE",e.lb_oz="POUND_OUNCE",e.ozt="TROYOUNCE",e.dwt="PENNYWEIGHT",e.GN="GRAIN",e.per_lb="PARTS_PER_POUND",e.tlh="TAEL_HONGKONG",e.tls="TAEL_SINGAPORE",e.tlt="TAEL_TAIWAN",e.tlc="TAEL_CHINA",e.mom="MOMME",e.tol="TOLA",e.bat="BATH",e.MS="MESGHAL",e.N="NEWTON",e.war="WARNING",e.pcs="PIECES",e.per="PERCENT",e.mm="MILLIMETER",e.cm="CENTIMETER",
e.m="METER",e.km="KILOMETER",e.g_ml="GRAM_PER_MILLILITER",e.Mcls_ml="MILLION_CELLS_PER_MILLILITER",e["µg_ml"]="MICROGRAM_PER_MILLILITER",e["µg_l"]="MICROGRAM_PER_LITER",e.mg_ml="MILLIGRAM_PER_MILLILITER",e.mg_l="MILLIGRAM_PER_LITER",e.mmol_ml="MILLIMOL_PER_MILLILITER",e.g_cm3="DENSITY",e.cm3="VOLUME",e.cm2="SQUARECENTIMETRE",e.m2="SQUAREMETRE",e.g_cm2="GRAM_PER_SQUARE_CENTIMETER",e.g_m2="GRAMMAGE",e.g_m="GRAM_PER_METER",e["µl"]="MICROLITER",e.ml="MILLILITER",e.cl="CENTILITER",e.l="LITER",e.mmol="MILLIMOL",e.C="GRAD_CELSIUS",e.F="GRAD_FAHRENHEIT",e.sec="SECOND",e.min="MINUTE",e.h="HOUR",e.am="TIME_AM",e.pm="TIME_PM",e.V="VOLT",e.mA="MILLIAMPER",e.hPa="HECTOPASCAL",e.kPa="KILOPASCAL",e.g_mol="GRAM_PER_MOL",e.kg_m3="KG_M3",e.mmHg="MMHG",e.invalid="!invalid!",e.rpm="RPM"}(_=t.EnumUnitStrings||(t.EnumUnitStrings={}));const E={[_.none]:"none",[_.o]:"o",[_.µg]:"µg",[_.mg]:"mg",[_.g]:"g",[_.kg]:"kg",[_.t]:"t",[_.mct]:"mct",[_.ct]:"ct",[_.kct]:"kct",[_.K]:"K",[_.lb]:"lb",[_.oz]:"oz",
[_.lb_oz]:"lb_oz",[_.ozt]:"ozt",[_.dwt]:"dwt",[_.GN]:"GN",[_.per_lb]:"per_lb",[_.tlh]:"tlh",[_.tls]:"tls",[_.tlt]:"tlt",[_.tlc]:"tlc",[_.mom]:"mom",[_.tol]:"tol",[_.bat]:"bat",[_.MS]:"MS",[_.N]:"N",[_.war]:"war",[_.pcs]:"pcs",[_.per]:"per",[_.mm]:"mm",[_.cm]:"cm",[_.m]:"m",[_.km]:"km",[_.g_ml]:"g_ml",[_.Mcls_ml]:"Mcls_ml",[_.µg_ml]:"µg_ml",[_.µg_l]:"µg_l",[_.mg_ml]:"mg_ml",[_.mg_l]:"mg_l",[_.mmol_ml]:"mmol_ml",[_.g_cm3]:"g_cm3",[_.cm3]:"cm3",[_.cm2]:"cm2",[_.m2]:"m2",[_.g_cm2]:"g_cm2",[_.g_m2]:"g_m2",[_.g_m]:"g_m",[_.µl]:"µl",[_.ml]:"ml",[_.cl]:"cl",[_.l]:"l",[_.mmol]:"mmol",[_.C]:"C",[_.F]:"F",[_.sec]:"sec",[_.min]:"min",[_.h]:"h",[_.am]:"am",[_.pm]:"pm",[_.V]:"V",[_.mA]:"mA",[_.hPa]:"hPa",[_.kPa]:"kPa",[_.g_mol]:"g_mol",[_.kg_m3]:"kg_m3",[_.mmHg]:"mmHg",[_.invalid]:"invalid",[_.rpm]:"rpm"};t.unitStringToLong=function(e){const t=Array.isArray(e)?e[0]:e;if(0===t.length)return _.none;for(const[e,a]of Object.entries(E))if(a===t)return e;return _.invalid},t.convertWgtUnit=function(e,t,a){
return r.convertValueToTargetUnit(e,t,a)},t.convertWgtUnitBigNumber=function(e,t,a){return r.convertValueToTargetUnitBigNumber(e,t,a)},t.convertTempUnit=function(e,t,a){const s=[r.EnumUnit.GRAD_CELSIUS,r.EnumUnit.GRAD_FAHRENHEIT,_.C,_.F];return s.includes(t)&&s.includes(a)?r.convertValueToTargetUnit(e,t,a):e},t.convertPressureUnit=function(e,t,a){const s=[r.EnumUnit.HECTOPASCAL,r.EnumUnit.KILOPASCAL,_.hPa,_.kPa];return s.includes(t)&&s.includes(a)?r.convertValueToTargetUnit(e,t,a):e},t.UnitEnum_Api2Lib=function(e){let t=_;for(let a in t)if(t[a].toString()===e.toString())return a;return null},t.UnitEnum_Lib2Api=function(e){return r.getUnitEnum(e)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(11),i=a(0),n=a(7);t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID="BTN_OK",t.ParamUpdateUserActionSimpleAccept={type:s.EnumMessageboxType.ERROR,title:{id:"_QAPP_LIB_MSG_BOX_WARNING_UPDATE_TASK_PARAM",args:[]},textList:[],buttons:[{
appearance:i.EnumAppearance.ENABLED_SECONDARY,label:{id:n.EnumFontLabels.OK,args:[]},id:t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID}]}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2);t.AbstractQAppAspect=class{configure(e){this.cfg=Object.assign(void 0!==this.cfg?this.cfg:{},e)}getConfig(){return s.cloneJSON(this.cfg)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(17);class i{static roundExactToDecimals(e,t){return this.nTimesTen(this.roundExact(this.nTimesTen(e,t)),-1*t)}static roundExact(e){return e=e>=0?Math.floor(e+.5+Number.EPSILON):Math.ceil(e-.5-Number.EPSILON)}static nTimesTen(e,t){return s.bignumber(e).times(i.decPowers(t)).toNumber()}static countDecimals(e){return s.bignumber(e).decimalPlaces()}static decPowers(e){switch(e){case-15:return 1e-15;case-14:return 1e-14;case-13:return 1e-13;case-12:return 1e-12;case-11:return 1e-11;case-10:return 1e-10;case-9:return 1e-9;case-8:return 1e-8
;case-7:return 1e-7;case-6:return 1e-6;case-5:return 1e-5;case-4:return 1e-4;case-3:return.001;case-2:return.01;case-1:return.1;case 0:return 1;case 1:return 10;case 2:return 100;case 3:return 1e3;case 4:return 1e4;case 5:return 1e5;case 6:return 1e6;case 7:return 1e7;case 8:return 1e8;case 9:return 1e9;case 10:return 1e10;case 11:return 1e11;case 12:return 1e12;case 13:return 1e13;case 14:return 1e14;case 15:return 1e15;default:return Math.pow(10,e)}}}t.SartoMath=i},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(17),i=a(18),n=a(13),r=a(2);var o,_;function E(e,a,i){let n=t.unitsMap[_.NONE],r=t.unitsMap[_.NONE];if(null==e)return s.bignumber(NaN);if(!t.unitsMap.hasOwnProperty(a))return e;if(!t.unitsMap.hasOwnProperty(i))return e;if(n=t.unitsMap[a],r=t.unitsMap[i],n.id===r.id)return e;if(n.unitConversionBase===o.UNDEFINED||r.unitConversionBase===o.UNDEFINED||void 0==n.conversionFactor||void 0==r.conversionFactor)return e;const E=[o.MASS,o.VOLUME]
;if(!(n.unitConversionBase===r.unitConversionBase||E.includes(n.unitConversionBase)&&E.includes(r.unitConversionBase)))return e;switch(n.unitConversionBase){case o.MASS:case o.VOLUME:case o.PRESSURE:return e.times(r.conversionFactor).dividedBy(n.conversionFactor);case o.TEMPERATURE:{let t=e;switch(n.id){case _.GRAD_CELSIUS:t=e.add(273.15);break;case _.GRAD_FAHRENHEIT:t=e.sub(32).dividedBy(n.conversionFactor).add(273.15)}switch(r.id){case _.GRAD_CELSIUS:return t.sub(273.15);case _.GRAD_FAHRENHEIT:return t.sub(273.15).times(r.conversionFactor).add(32);case _.KELVIN:return t}return e}default:return e}}function l(e,t,a){let i=E(n.isNumber(e)?s.bignumber(e):e,t,a);return null==i?NaN:i.toNumber()}function A(e,t){return N(e,t).toFixed(Math.max(0,t))}function u(e,a){let s=r.cloneJSON(e);s.alibi=void 0,s.alibiId=void 0;let n=t.unitsMap[e.unit],_=t.unitsMap[a];if(n.id===_.id)return s;if(n.unitConversionBase===o.UNDEFINED||_.unitConversionBase===o.UNDEFINED)return s;const E=[o.MASS,o.VOLUME]
;return n.unitConversionBase===_.unitConversionBase||E.includes(n.unitConversionBase)&&E.includes(_.unitConversionBase)?(s.value=l(s.value,e.unit,a),s.unit=a,s.decimals=s.decimals-i.getUnitShift(e.unit)+i.getUnitShift(a),s.decimals<0&&(s.decimals=0),delete s.alibiId,s):s}function c(e){return e?t.unitsMap.hasOwnProperty(e.toString())?t.unitsMap[e].mark:e.toString():""}function I(e){const a=n.getObjectByID(Object.values(t.unitsMap),e,"mark");return null!=a?a.id:_.NONE}function T(e){let t=[];if(null==e||void 0===e)return t;if(0==e.length)return t;let a=_.NONE;for(let s=0;s<e.length;s++)n.isNumber(e[s])?t.push(e[s]):n.isObject(e[s])&&e[s].hasOwnProperty("value")&&n.isNumber(e[s].value)&&e[s].hasOwnProperty("unit")&&(a!==_.NONE?t.push(u(e[s],a).value):(t.push(e[s].value),a=e[s].unit));return t}function d(e){let t=0;if(null==e||void 0===e)return t;if(0==e.length)return t;for(let a=0;a<e.length;a++)"object"==typeof e[a]&&e[a].hasOwnProperty("decimals")&&(t=e[a].decimals>t?e[a].decimals:t)
;return t}function N(e,t){let a=s.bignumber(e),i=s.bignumber(10).pow(t);return a.times(i).round().dividedBy(i).toNumber()}function p(e){let t=T(e);return n.isObject(t)&&0!==t.length?s.sum(t):NaN}function S(e){let t=T(e);return n.isObject(e)&&0!==e.length?s.mean(t):NaN}function m(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=u(e[s],t));return{value:S(a),unit:t,decimals:d(a)}}function R(e,t){return n.isObject(e)?s.bignumber(e.value).dividedBy(t).toNumber():s.bignumber(e).dividedBy(t).toNumber()}function P(e){let t=T(e);return n.isObject(t)&&0!==t.length?s.std(t,"unbiased"):NaN}function D(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=u(e[s],t));return{value:P(a),unit:t,decimals:d(a)}}function C(e,t,a){if(e<2||!n.isNumber(t)||!n.isNumber(a))return NaN;const i=s.bignumber(1).dividedBy(s.bignumber(e).minus(1)),r=s.bignumber(a).minus(s.bignumber(t).pow(2).dividedBy(s.bignumber(e)))
;return i.isNaN()||r.isNaN()?NaN:s.sqrt(i.times(r.abs())).toNumber()}function h(e){let t=T(e);return n.isObject(t)&&0!==t.length?s.min(t):NaN}function g(e){let t=T(e);return n.isObject(t)&&0!==t.length?s.max(t):NaN}function M(e){let t=T(e);return n.isObject(t)&&0!==t.length?O(P(t),S(t)):NaN}function O(e,t){let a=0,i=0;return a=n.isObject(e)?e.value:e,i=n.isObject(t)?t.value:t,n.isObject(e)&&n.isObject(t)&&(a=u(e,t.unit).value),s.bignumber(a).dividedBy(i).times(100).toNumber()}function v(e,t,a){let i=NaN,r=NaN,o=NaN,E=_.NONE;return n.isObject(e)?(i=e.value,E=e.unit):i=e,n.isObject(t)?E!==_.NONE?r=u(t,E).value:(r=t.value,E=t.unit):r=t,n.isObject(a)?E!==_.NONE?o=u(a,E).value:(o=a.value,E=a.unit):o=a,s.bignumber(o).minus(r).dividedBy(s.bignumber(i).times(6)).toNumber()}function L(e,t,a){return{value:v(e,t,a),unit:_.NONE,decimals:3}}function f(e,t,a,i){let r=NaN,o=NaN,E=NaN,l=NaN,A=_.NONE;return n.isObject(e)?(r=e.value,A=e.unit):r=e,n.isObject(t)?A!==_.NONE?o=u(t,A).value:(o=t.value,
A=t.unit):o=t,n.isObject(a)?A!==_.NONE?E=u(a,A).value:(E=a.value,A=a.unit):E=a,n.isObject(i)?A!==_.NONE?l=u(i,A).value:(l=i.value,A=i.unit):l=i,s.min(s.bignumber(o).minus(E).dividedBy(s.bignumber(r).times(3)),s.bignumber(l).minus(o).dividedBy(s.bignumber(r).times(3))).toNumber()}function U(e,t,a,s){return{value:f(e,t,a,s),unit:_.NONE,decimals:3}}!function(e){e.UNDEFINED="UNDEFINED",e.MASS="MASS",e.TEMPERATURE="TEMPERATURE",e.PRESSURE="PRESSURE",e.VOLUME="VOLUME"}(o=t.EnumUnitType||(t.EnumUnitType={})),function(e){e.NONE="NONE",e.DIGIT="DIGIT",e.UNIVERSAL="UNIVERSAL",e.MICROGRAM="MICROGRAM",e.MILLIGRAM="MILLIGRAM",e.GRAM="GRAM",e.KILOGRAM="KILOGRAM",e.TONNE="TONNE",e.MILLICARAT="MILLICARAT",e.CARAT="CARAT",e.KILOCARAT="KILOCARAT",e.KARAT="KARAT",e.POUND="POUND",e.OUNCE="OUNCE",e.POUND_OUNCE="POUND_OUNCE",e.TROYOUNCE="TROYOUNCE",e.PENNYWEIGHT="PENNYWEIGHT",e.GRAIN="GRAIN",e.PARTS_PER_POUND="PARTS_PER_POUND",e.TAEL_HONGKONG="TAEL_HONGKONG",e.TAEL_SINGAPORE="TAEL_SINGAPORE",
e.TAEL_TAIWAN="TAEL_TAIWAN",e.TAEL_CHINA="TAEL_CHINA",e.MOMME="MOMME",e.TOLA="TOLA",e.BATH="BATH",e.MESGHAL="MESGHAL",e.NEWTON="NEWTON",e.WARNING="WARNING",e.PIECES="PIECES",e.PERCENT="PERCENT",e.MILLIMETER="MILLIMETER",e.CENTIMETER="CENTIMETER",e.METER="METER",e.KILOMETER="KILOMETER",e.GRAM_PER_MILLILITER="GRAM_PER_MILLILITER",e.MILLION_CELLS_PER_MILLILITER="MILLION_CELLS_PER_MILLILITER",e.MICROGRAM_PER_MILLILITER="MICROGRAM_PER_MILLILITER",e.MICROGRAM_PER_LITER="MICROGRAM_PER_LITER",e.MILLIGRAM_PER_MILLILITER="MILLIGRAM_PER_MILLILITER",e.MILLIGRAM_PER_LITER="MILLIGRAM_PER_LITER",e.MILLIMOL_PER_MILLILITER="MILLIMOL_PER_MILLILITER",e.GRAM_PER_CUBICCENTIMETRE="GRAM_PER_CUBICCENTIMETRE",e.CUBICCENTIMETRE="CUBICCENTIMETRE",e.SQUARECENTIMETRE="SQUARECENTIMETRE",e.SQUAREMETRE="SQUAREMETRE",e.GRAMMAGE="GRAMMAGE",e.MICROLITER="MICROLITER",e.MILLILITER="MILLILITER",e.MILLILITER_PER_SECOND="MILLILITER_PER_SECOND",e.MILLILITER_PER_MINUTE="MILLILITER_PER_MINUTE",
e.MILLILITER_PER_HOUR="MILLILITER_PER_HOUR",e.LITER="LITER",e.MILLIMOL="MILLIMOL",e.GRAD_CELSIUS="GRAD_CELSIUS",e.GRAD_FAHRENHEIT="GRAD_FAHRENHEIT",e.SECOND="SECOND",e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.TIME_AM="TIME_AM",e.TIME_PM="TIME_PM",e.VOLT="VOLT",e.MILLIAMPER="MILLIAMPER",e.HECTOPASCAL="HECTOPASCAL",e.KILOPASCAL="KILOPASCAL",e.GRAM_PER_MOL="GRAM_PER_MOL",e.INVALID="INVALID",e.RPM="RPM",e.MILLIVOLT="MILLIVOLT",e.MILLIVOLT_PER_PH="MILLIVOLT_PER_PH",e.MICROSIEMENS_PER_CENTIMETER="MICROSIEMENS_PER_CENTIMETER",e.GRAM_PER_SQUARE_CENTIMETER="GRAM_PER_SQUARE_CENTIMETER",e.GRAM_PER_METER="GRAM_PER_METER",e.CENTILITER="CENTILITER",e.DENSITY="DENSITY",e.VOLUME="VOLUME",e.KG_M3="KG_M3",e.MMHG="MMHG",e.KELVIN="KELVIN",e.PASCAL="PASCAL"}(_=t.EnumUnit||(t.EnumUnit={})),t.unitsMap={NONE:{id:_.NONE,mark:"",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},DIGIT:{id:_.DIGIT,mark:"d",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,
conversionDecimalPlacesShift:void 0},UNIVERSAL:{id:_.UNIVERSAL,mark:"o",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM:{id:_.MICROGRAM,mark:"µg",unitConversionBase:o.MASS,conversionFactor:1e6,conversionDecimalPlacesShift:-6},MILLIGRAM:{id:_.MILLIGRAM,mark:"mg",unitConversionBase:o.MASS,conversionFactor:1e3,conversionDecimalPlacesShift:-3},GRAM:{id:_.GRAM,mark:"g",unitConversionBase:o.MASS,conversionFactor:1,conversionDecimalPlacesShift:0},KILOGRAM:{id:_.KILOGRAM,mark:"kg",unitConversionBase:o.MASS,conversionFactor:.001,conversionDecimalPlacesShift:3},TONNE:{id:_.TONNE,mark:"t",unitConversionBase:o.MASS,conversionFactor:1e-6,conversionDecimalPlacesShift:6},MILLICARAT:{id:_.MILLICARAT,mark:"mct",unitConversionBase:o.MASS,conversionFactor:5e3,conversionDecimalPlacesShift:-3},CARAT:{id:_.CARAT,mark:"ct",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},KILOCARAT:{id:_.KILOCARAT,mark:"kct",
unitConversionBase:o.MASS,conversionFactor:.005,conversionDecimalPlacesShift:3},KARAT:{id:_.KARAT,mark:"K",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},POUND:{id:_.POUND,mark:"lb",unitConversionBase:o.MASS,conversionFactor:.00220462262184878,conversionDecimalPlacesShift:3},OUNCE:{id:_.OUNCE,mark:"oz",unitConversionBase:o.MASS,conversionFactor:.0352739619495804,conversionDecimalPlacesShift:2},POUND_OUNCE:{id:_.POUND_OUNCE,mark:"lb:oz",unitConversionBase:o.MASS,conversionFactor:.035273962,conversionDecimalPlacesShift:2},TROYOUNCE:{id:_.TROYOUNCE,mark:"ozt",unitConversionBase:o.MASS,conversionFactor:.032150747,conversionDecimalPlacesShift:2},PENNYWEIGHT:{id:_.PENNYWEIGHT,mark:"dwt",unitConversionBase:o.MASS,conversionFactor:.643014931,conversionDecimalPlacesShift:1},GRAIN:{id:_.GRAIN,mark:"GN",unitConversionBase:o.MASS,conversionFactor:15.43235835,conversionDecimalPlacesShift:-1},PARTS_PER_POUND:{id:_.PARTS_PER_POUND,mark:"/lb",unitConversionBase:o.MASS,
conversionFactor:1.1287667712,conversionDecimalPlacesShift:0},TAEL_HONGKONG:{id:_.TAEL_HONGKONG,mark:"tlh",unitConversionBase:o.MASS,conversionFactor:.02671725,conversionDecimalPlacesShift:2},TAEL_SINGAPORE:{id:_.TAEL_SINGAPORE,mark:"tls",unitConversionBase:o.MASS,conversionFactor:.02645544638,conversionDecimalPlacesShift:2},TAEL_TAIWAN:{id:_.TAEL_TAIWAN,mark:"tlt",unitConversionBase:o.MASS,conversionFactor:.02666666,conversionDecimalPlacesShift:2},TAEL_CHINA:{id:_.TAEL_CHINA,mark:"tlc",unitConversionBase:o.MASS,conversionFactor:.02645547175,conversionDecimalPlacesShift:2},MOMME:{id:_.MOMME,mark:"mom",unitConversionBase:o.MASS,conversionFactor:.26666666666666666,conversionDecimalPlacesShift:1},TOLA:{id:_.TOLA,mark:"tol",unitConversionBase:o.MASS,conversionFactor:.0857333381,conversionDecimalPlacesShift:1},BATH:{id:_.BATH,mark:"bat",unitConversionBase:o.MASS,conversionFactor:.06578947436,conversionDecimalPlacesShift:2},MESGHAL:{id:_.MESGHAL,mark:"MS",unitConversionBase:o.MASS,
conversionFactor:.217,conversionDecimalPlacesShift:1},NEWTON:{id:_.NEWTON,mark:"N",unitConversionBase:o.MASS,conversionFactor:.00980665,conversionDecimalPlacesShift:2},WARNING:{id:_.WARNING,mark:"!",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PIECES:{id:_.PIECES,mark:"pcs",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PERCENT:{id:_.PERCENT,mark:"%",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIMETER:{id:_.MILLIMETER,mark:"mm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTIMETER:{id:_.CENTIMETER,mark:"cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},METER:{id:_.METER,mark:"m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KILOMETER:{id:_.KILOMETER,mark:"km",unitConversionBase:o.UNDEFINED,
conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_MILLILITER:{id:_.GRAM_PER_MILLILITER,mark:"g/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLION_CELLS_PER_MILLILITER:{id:_.MILLION_CELLS_PER_MILLILITER,mark:"10^6 cls/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_MILLILITER:{id:_.MICROGRAM_PER_MILLILITER,mark:"µg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_LITER:{id:_.MICROGRAM_PER_LITER,mark:"µg/l",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_MILLILITER:{id:_.MILLIGRAM_PER_MILLILITER,mark:"mg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_LITER:{id:_.MILLIGRAM_PER_LITER,mark:"mg/l",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,
conversionDecimalPlacesShift:void 0},MILLIMOL_PER_MILLILITER:{id:_.MILLIMOL_PER_MILLILITER,mark:"mmol/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_CUBICCENTIMETRE:{id:_.GRAM_PER_CUBICCENTIMETRE,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CUBICCENTIMETRE:{id:_.CUBICCENTIMETRE,mark:"cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},SQUARECENTIMETRE:{id:_.SQUARECENTIMETRE,mark:"cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},SQUAREMETRE:{id:_.SQUAREMETRE,mark:"m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAMMAGE:{id:_.GRAMMAGE,mark:"g/m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROLITER:{id:_.MICROLITER,mark:"µl",unitConversionBase:o.VOLUME,conversionFactor:1e3,
conversionDecimalPlacesShift:-3},MILLILITER:{id:_.MILLILITER,mark:"ml",unitConversionBase:o.VOLUME,conversionFactor:1,conversionDecimalPlacesShift:0},MILLILITER_PER_SECOND:{id:_.MILLILITER_PER_SECOND,mark:"ml/s",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLILITER_PER_MINUTE:{id:_.MILLILITER_PER_MINUTE,mark:"ml/min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLILITER_PER_HOUR:{id:_.MILLILITER_PER_HOUR,mark:"ml/h",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},LITER:{id:_.LITER,mark:"l",unitConversionBase:o.VOLUME,conversionFactor:.001,conversionDecimalPlacesShift:3},MILLIMOL:{id:_.MILLIMOL,mark:"mmol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAD_CELSIUS:{id:_.GRAD_CELSIUS,mark:"°C",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},GRAD_FAHRENHEIT:{
id:_.GRAD_FAHRENHEIT,mark:"°F",unitConversionBase:o.TEMPERATURE,conversionFactor:1.8,conversionDecimalPlacesShift:0},SECOND:{id:_.SECOND,mark:"sec",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MINUTE:{id:_.MINUTE,mark:"min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HOUR:{id:_.HOUR,mark:"h",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},DAY:{id:_.DAY,mark:"d",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_AM:{id:_.TIME_AM,mark:"am",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_PM:{id:_.TIME_PM,mark:"pm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLT:{id:_.VOLT,mark:"V",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIAMPER:{id:_.MILLIAMPER,mark:"mA",
unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HECTOPASCAL:{id:_.HECTOPASCAL,mark:"hPa",unitConversionBase:o.PRESSURE,conversionFactor:.01,conversionDecimalPlacesShift:2},KILOPASCAL:{id:_.KILOPASCAL,mark:"kPa",unitConversionBase:o.PRESSURE,conversionFactor:.001,conversionDecimalPlacesShift:3},GRAM_PER_MOL:{id:_.GRAM_PER_MOL,mark:"g/mol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},INVALID:{id:_.INVALID,mark:"!invalid!",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},RPM:{id:_.RPM,mark:"rpm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIVOLT:{id:_.MILLIVOLT,mark:"mV",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIVOLT_PER_PH:{id:_.MILLIVOLT_PER_PH,mark:"mV/pH",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},
MICROSIEMENS_PER_CENTIMETER:{id:_.MICROSIEMENS_PER_CENTIMETER,mark:"µS/cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_SQUARE_CENTIMETER:{id:_.GRAM_PER_SQUARE_CENTIMETER,mark:"g/cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_METER:{id:_.GRAM_PER_METER,mark:"g/m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTILITER:{id:_.CENTILITER,mark:"cl",unitConversionBase:o.VOLUME,conversionFactor:.1,conversionDecimalPlacesShift:1},DENSITY:{id:_.DENSITY,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLUME:{id:_.VOLUME,mark:"cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KG_M3:{id:_.KG_M3,mark:"kg/m³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MMHG:{id:_.MMHG,mark:"mmHg",
unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KELVIN:{id:_.KELVIN,mark:"K",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},PASCAL:{id:_.PASCAL,mark:"Pa",unitConversionBase:o.PRESSURE,conversionFactor:1,conversionDecimalPlacesShift:0}},t.convertValueToTargetUnitBigNumber=E,t.convertValueToTargetUnit=l,t.createQuantity=function(e,t,a){let s={value:NaN,unit:_.NONE,decimals:0};if(n.isObject(e)){s=Object.assign(s,e);for(const e of Object.keys(s))["value","unit","decimals","auxiliaryDigits","alibiId","alibi","deviceserial","stable","timestamp","info"].includes(e)||delete s[e]}else if(n.isObject(t))(t=t).value.numbers.length>0&&(s.value=parseFloat(t.value.numbers[0])),s.unit=I(t.value.unit),s.decimals=t.value.decimals;else if(n.isObject(a)){const e=(a=a).value;s.value=parseFloat(e.number),n.isNumber(s.value)||(s.info=e.number),n.isNumber(s.value)&&"-"===e.sign&&(s.value*=-1),s.decimals=e.decimals,
s.unit=I(e.unit),s.stable=e.isStable,n.isNumber(e.auxiliaryDigits)&&e.auxiliaryDigits>0&&(s.auxiliaryDigits=e.auxiliaryDigits)}return s.unit=n.setEnumSafely(s.unit,_,_.NONE),s},t._formatQuantityParam_numberOnly=A,t.formatQuantityParam_numberOnly=function(e){return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("decimals")?n.isNumber(e.value)?A(e.value,e.decimals):"NaN":"N.A."},t.formatQuantityParam=function(e){return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("unit")&&e.hasOwnProperty("decimals")?n.isNumber(e.value)?A(e.value,e.decimals)+" "+c(e.unit):"NaN":"N.A."},t.convertToTargetUnit=u,t.getUnitString=c,t.getUnitEnum=I,t.math_getSimple_numberArray=T,t.math_count=function(e){return T(e).length},t.math_getMaximumDecimals=d,t.math_roundUp=function(e,t){let a=s.bignumber(e),i=a.minus(a.floor()),n=(i=i.times(s.bignumber(10).pow(t))).minus(i.floor());return s.larger(n,0)&&(i=i.minus(n).add(1)),i=i.dividedBy(s.bignumber(10).pow(t)),a.floor().add(i).toNumber()},
t.math_roundAuto=N,t.math_detectLeastSignificantDigit=function(e){let t=0,a=1,i=s.bignumber(e).abs(),n=i.floor(),r=i.minus(n);for(;r.greaterThan(0);)t++,n=(r=r.times(10)).floor(),r=r.minus(n);return t>0&&(a=n.dividedBy(s.bignumber(10).pow(t)).toNumber()),a},t.math_sum=p,t.math_Sum=function(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=u(e[s],t));return{value:p(a),unit:t,decimals:d(a)}},t.math_mean=S,t.math_Mean=m,t.math_mean_longterm=R,t.math_Mean_Longterm=function(e,t,a){const s=u(e,a);return s.value=R(s,t),s},t.math_standard_deviation=P,t.math_Standard_Deviation=D,t.math_standard_deviation_longterm=C,t.math_Standard_Deviation_Longterm=function(e,t,a,s){return u({value:C(e,(t=u(t,a.unit)).value,a.value),unit:a.unit,decimals:a.decimals},s)},t.math_minimum=h,t.math_Minimum=function(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=u(e[s],t));return{value:h(a),unit:t,decimals:d(a)}},t.math_maximum=g,t.math_Maximum=function(e,t){let a=[]
;for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=u(e[s],t));return{value:g(a),unit:t,decimals:d(a)}},t.math_variation_coefficient=M,t.math_Variation_Coefficient=function(e){let t=[];for(let a=0;a<e.length;a++)n.isNumber(e[a].value)&&(t[a]=u(e[a],_.GRAM));return{value:M(t),unit:_.PERCENT,decimals:2}},t.math_variation_coefficient_longterm=O,t.math_Variation_Coefficient_Longterm=function(e,t){return{value:O(u(e,t.unit),t),unit:_.PERCENT,decimals:2}},t.math_cp=function(e,t,a){let s=T(e);return n.isObject(e)&&0!==e.length?v(P(s),t,a):NaN},t.math_Cp=function(e,t,a){return L(D(e,t.unit),t,a)},t.math_cp_longterm=v,t.math_Cp_Longterm=L,t.math_cpk=function(e,t,a){return f(P(e),S(e),t,a)},t.math_Cpk=function(e,t,a){return U(D(e,t.unit),m(e,t.unit),t,a)},t.math_cpk_longterm=f,t.math_Cpk_Longterm=U},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const s=a(55),i=a(56),n=a(57),r=a(46),o=a(59),_=a(12),E=a(28),l=a(60),A=a(30),u=a(63),c=a(64),I=a(39),T=a(40),d=a(47),N=a(71),p=a(48),S=a(33),m=a(11),R=a(49),P=a(3),D=a(73),C=a(4),h=a(29),g=a(74),M=a(43),O=a(16),v=a(8),L=a(15),f=a(75),U=a(27),b=a(41),B=a(76),y=a(2),G=a(7),H=a(77),F=a(78),V=a(79),Y=a(36),Q=a(80),x=a(24),k=a(1),W=a(0),K=a(13);a(44),t.HEARTBEAT_INTERVAL_MS=2e3;const w=100,q=500;t.STORAGE_LOCATION_BASE="/data/installedQApps/qapps/data";const j="STATE_SUSPENDING_INTERNAL",X="STATE_RESTARTING_INTERNAL",J="_START_FSM_",$="_INTERNAL_DEVEL_VERSION_INFO_STATE_",Z="BTN_INTERNAL_DEVEL_VERSION_INFO";t.FORCED_SUSPEND_HOME_BUTTON_ID="BTN_HOME",t.LOGOUT_BUTTON_ID="BTN_LOGOUT",t.PRINT_RESTART_BUTTON_ID="BTN_PRINT_RESTART";const z="BTN_SUSPEND_QUESTION_YES",ee="BTN_SUSPEND_QUESTION_NO",te="BTN_LOGOUT_QUESTION_YES",ae="BTN_LOGOUT_QUESTION_NO",se="BTN_RESTART_QUESTION_YES",ie="BTN_RESTART_QUESTION_NO",ne="CANCEL_LOGOUT",re="REMEMBER_LOGOUT"
;t.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE="_TASK_NAME_NOT_UNIQUE",t.TASK_ERROR_STR_TASK_NAME_EMPTY="_TASK_NAME_EMPTY";const oe="TASK/IDENTIFICATION",_e="TASK/PROFILE";var Ee,le;t.TASK_PROFILE_REPORTING_ID_PREFIX=_e+"/REPORTING_PROFILES",t.TASK_PROFILE_WEIGHING_ID=_e+"/WEIGHING",t.ASYNC_CALL_DB_CONNECTION_CREATE="ASYNC_CALL_DB_CONNECTION_CREATE",function(e){e.FUNC_BTN_TAKEOVER="FUNC_BTN_TAKEOVER",e.FUNC_BTN_DOCU="FUNC_BTN_DOCU",e.FUNC_BTN_OTHER="FUNC_BTN_OTHER"}(Ee=t.EnumFunctionalButtonType||(t.EnumFunctionalButtonType={})),function(e){e.SUSPEND_NO_SUSPEND="SUSPEND_NO_SUSPEND",e.SUSPEND_HOME="SUSPEND_HOME",e.SUSPEND_LOGOUT="SUSPEND_LOGOUT",e.SUSPEND_APP="SUSPEND_APP"}(le=t.EnumSuspendReason||(t.EnumSuspendReason={})),t.dbg=function(e){null===e?console.log(" ## DEBUG ## null"):void 0===e?console.log(" ## DEBUG ## undefined"):"string"==typeof e||"number"==typeof e||"boolean"==typeof e?console.log(" ## DEBUG ## "+L.inspect(e).toString()):(console.log(" ## DEBUG ##"),
console.log(L.inspect(e,!1,20)),console.log(" ##########"))};class Ae{constructor(e){this.suppressGlobalHomeBtnHandling=!1,this.suppressGlobalLogoutBtnHandling=!1,this.suppressGlobalRestartBtnHandling=!1,this.isDevelVersion=!1,this.screens={},this.hideLoadingScreenOnShowScreens=!0,this.buttons={takeoverBtn:void 0,docuButton:void 0,others:[]},this.lastRequestedTakeoverBtnAppearance=W.EnumAppearance.HIDDEN,this.aspects={},this.scriptPath=void 0,this.qAppOrderNumber=void 0,this.qAppVersion=void 0,this.taskId=void 0,this.isErrorStatePublished=!1,this.exitTimeOutPending=!1,this.suspendReason=le.SUSPEND_NO_SUSPEND,this.heartbeatCount=0,this.eventQueue=[],this.eventQueuePending=!1,this.subscriptions=[],this.outstandingAsyncCalls=[],this.debugCfg={doConsoleLog:!0,enableHeartbeatLog:!1,url:null},this.pendingMsgBox=void 0,this.currentMsgBox=void 0,this.isCurrentMsgPrio=!1,this.debugCfg.doConsoleLog=e,console.error=((...e)=>{console.log("ERR: ",e)});let i=a(16)
;if(console.log("try reading debug config from file"),i.existsSync("/data/installedQApps/qapps/data/qapplog.conf"))try{console.log("...found config file");let e=JSON.parse(i.readFileSync("/data/installedQApps/qapps/data/qapplog.conf","utf8").toString());console.log("...got it"),Object.assign(this.debugCfg,e),console.log("...debug config (with defaults): "+L.inspect(this.debugCfg))}catch(e){console.log("...invalid JSON content in qapplog.conf: "+e),console.log("...disable logging at all"),console.log=((...e)=>{})}else console.log("No qapplog file found.");let n=console.log;console.log("...saved original stdout");let r=null;if(null!==this.debugCfg.url){console.log("...there seems to be an url for remote logging configured");try{r=new Y.URL(this.debugCfg.url),console.log("...valid url for remote logging")}catch(e){r=null,console.log('...invalid URL like "ws://hostname.port" in qapplog.conf')}}if(this.debugCfg.doConsoleLog||(console.log("...disable local output"),console.log=((...e)=>{})),
null!==r){console.log("...valid url for remote logging");let e=new Q.Socket;e.on("error",()=>{try{console.log("...no logging redirected - error"),e.end()}catch(e){}}),e.connect(Number.parseInt(r.port),r.hostname,()=>{try{console.log(`...logging remote redirected to external client (local: ${this.debugCfg.doConsoleLog})`),console.log=((...t)=>{let a="";if(t.forEach(e=>{a+=e}),this.debugCfg.doConsoleLog)try{n(a)}catch(e){}a+="\n";try{e.write(a)}catch(e){}}),e.setNoDelay(!0),e.write("Hello, server! Love, Client.")}catch(e){}})}console.log("QAppBase: constr"),Ae.clientSingleton=this,this.restHandler=new u.RestHandler,this.mqttHandler=new l.MqttHandler,this.taskMngProxy=new I.TaskProxy,this.localizerProxy=new c.LocalizerProxy,this.weighingProxy=new T.WeighingProxy,this.accessControlProxy=new N.AccessControlProxy,this.reportingProxy=new S.ReportingProxy,this.devicInformationProxy=new f.DeviceInformationProxy,this.messageHandlerProxy=new U.MessageHandlerProxy,
this.messageHandlerHelper=new b.MessageHandlerHelper(this.messageHandlerProxy),this.taskHandler=new d.TaskHandler,this.heartbeatInterval$=s.interval(t.HEARTBEAT_INTERVAL_MS)}getQAppOrderNumber(){return this.qAppOrderNumber}getQAppVersion(){return this.qAppVersion}getTaskId(){return this.taskId}getSerialNumber(){return this.devicInformationProxy.getSerialNo()}getWeighingProfileId(){let e=this.taskHandler.getParameter(t.TASK_PROFILE_WEIGHING_ID);return void 0!==e&&P.isTypeOfISelectionParameter(e)?e.value.selection.id:void 0}registerAspect(e){this.aspects[e.getId()]=e}init(){let e=new D.LoadingOverlay(this.mqttHandler);this.registerScreen(e)}postInit(){}loadTask(){if(this.taskId){console.log("QAppBase: read task for: ",this.taskId);try{this.taskHandler.setTask(this.taskMngProxy.readTask(this.taskId)),console.log("QAppBase: read task ...done");let e=this.taskHandler.getTask();e&&(this.qAppOrderNumber=e.qappOrderNumber,this.qAppVersion=e.qappVersion),
console.log("QAppBase: got qAppOrderNumber from Task-Info: "+this.qAppOrderNumber+"@"+this.qAppVersion)}catch(e){this.exitError("QAppBase::loadTask - error reading: "+(e?e.toString():""))}}else this.exitError("QAppBase::loadTask - Workflow script called without taskId")}getTaskName(){let e=void 0;if(void 0!==this.taskHandler){let t=this.taskHandler.getParameter("TASK/IDENTIFICATION/NAME");void 0!==t&&(e=t.value.string)}return e}registerScreen(e){console.log("QAppBase: register screen with id: "+e.getId()),this.screens[e.getId()]=e;try{e.events$.subscribe(e=>{e.type===C.ScreenEventType.SHOW_SCREEN&&this.hideLoadingScreenOnShowScreens&&this.hideLoadingScreen(),e.type,C.ScreenEventType.SHOW_LOADINGSCREEN,e.type,C.ScreenEventType.SHOW_MESSAGEBOX})}catch(e){}}showScreen(e){if(!this.exitTimeOutPending)switch(e.getId()){case D.LOADING_OVERLAY_ID:case p.MESSAGEBOX_ID:this.exitError("QAppBase::showScreen() was called for messagebox or loading screen - not allowed");break;default:
let t=this.hideLoadingScreenOnShowScreens;this.hideLoadingScreenOnShowScreens=!1,e.show(),this.closeAllScreensExcept(e),this.hideLoadingScreenOnShowScreens=t}}closeAllScreensExcept(e){switch(e.getId()){case D.LOADING_OVERLAY_ID:case p.MESSAGEBOX_ID:this.exitError("QAppBase::closeAllScreensExcept() was called for messagebox or loading screen - not allowed");break;default:for(let t in this.screens){let a=this.screens[t];a.getId()!==e.getId()&&a.getId()!==D.LOADING_OVERLAY_ID&&a.getId()!==V.LOCK_LOADING_OVERLAY_ID&&a.getId()!==F.LOCKMESSAGEBOX_ID&&(a.getId()===p.MESSAGEBOX_ID?this.hideMsgBox():a.hide())}this.hidePrintQueue()}}getLoadingScreen(){let e=this.screens[D.LOADING_OVERLAY_ID];return void 0===e&&(e=new D.LoadingOverlay(this.mqttHandler),this.registerScreen(e)),e}showLoadingScreen(e){if(!this.exitTimeOutPending){console.log("QAppBase::showLoadingScreen()");let t=this.getLoadingScreen();e?t.setText(e):t.setText({id:"",args:[]}),t.show()}}hideLoadingScreen(){
console.log("QAppBase::hideLoadingScreen()");try{this.getLoadingScreen().hide()}catch(e){}}checkForLoadingScreenEnableEvent(e){try{return e.payload.event===h.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===k.MqttTopics.HMI_LOADING_MODAL_APPEARANCE&&JSON.parse(e.payload.packet.payload.toString()).appearance===W.EnumAppearance.ENABLED}catch(e){return!1}}checkForLoadingScreenDisabledEvent(e){try{return e.payload.event===h.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===k.MqttTopics.HMI_LOADING_MODAL_APPEARANCE&&JSON.parse(e.payload.packet.payload.toString()).appearance===W.EnumAppearance.HIDDEN}catch(e){return!1}}showMessageBox(e){this.exitTimeOutPending||(void 0===this.currentMsgBox?(console.log("QAppBase::showMessageBox(): check no current active one -> prep and show"),this.currentMsgBox=e,this.prepAndShowMsgBox(this.currentMsgBox),this.isCurrentMsgPrio=!1,this.pendingMsgBox=void 0):(console.log("QAppBase::showMessageBox(): queue msgbox"),this.pendingMsgBox=e))}
hideMsgBox(){console.log("QAppBase::hideMsgBox()"),this.pendingMsgBox=void 0,void 0===this.currentMsgBox||this.isCurrentMsgPrio||(console.log("QAppBase::hideMsgBox(): check non-prio -> hide"),this.currentMsgBox=void 0,this.hideMsgBoxInternal())}showPriorMsgBox(e){this.exitTimeOutPending||(void 0!==this.currentMsgBox&&(this.isCurrentMsgPrio||(console.log("QAppBase::showPriorMsgBox(): queue the current non prio msgbox"),this.pendingMsgBox=this.currentMsgBox)),console.log("QAppBase::showPriorMsgBox(): prep and how prio msgbox"),this.currentMsgBox=e,this.prepAndShowMsgBox(this.currentMsgBox),this.isCurrentMsgPrio=!0)}hidePriorMsgBox(){void 0!==this.pendingMsgBox?(this.currentMsgBox=this.pendingMsgBox,this.pendingMsgBox=void 0,this.prepAndShowMsgBox(this.currentMsgBox)):(this.currentMsgBox=void 0,this.hideMsgBoxInternal()),this.isCurrentMsgPrio=!1}hideAllMsgBox(){this.pendingMsgBox=void 0,this.currentMsgBox=void 0,this.isCurrentMsgPrio=!1,this.hideMsgBoxInternal()}getMsgbox(){
let e=this.screens[p.MESSAGEBOX_ID];return void 0===e&&(e=new p.MessageBox(this.mqttHandler),this.registerScreen(e)),e}prepAndShowMsgBox(e){if(!this.exitTimeOutPending){let t=this.getMsgbox();t.setMessageBoxData(e),console.log("QAppBase::prepAndShowMsgBox(): show"),t.show(),console.log("QAppBase::prepAndShowMsgBox(): done")}}hideMsgBoxInternal(){console.log("QAppBase::hideMsgBoxInternal()"),this.getMsgbox().hide()}showPrintQueue(){if(!this.exitTimeOutPending){console.log("QAppBase::showPrintQueue()");let e={enabled:!0};this.mqttHandler.publish(k.MqttTopics.REPORTING_PRINTQUEUE_DISPLAYED,JSON.stringify(e),{retain:!1})}}hidePrintQueue(){console.log("QAppBase::hidePrintQueue()");this.mqttHandler.publish(k.MqttTopics.REPORTING_PRINTQUEUE_DISPLAYED,JSON.stringify({enabled:!1}),{retain:!1})}clearPrintQueue(){void 0!==this.buttons.docuButton&&this.buttons.docuButton.setAppearance(W.EnumAppearance.DISABLED),this.reportingProxy.clearPrintQueue()}registerButton(e,t){switch(e){
case Ee.FUNC_BTN_TAKEOVER:this.buttons.takeoverBtn=t,this.lastRequestedTakeoverBtnAppearance=t.getAppearance();break;case Ee.FUNC_BTN_DOCU:this.buttons.docuButton=t,this.buttons.docuButton.setAppearance(W.EnumAppearance.DISABLED);break;default:this.buttons.others.push(t)}}addTimer(e,t){const a=n.setTimeout(()=>{this.addToEventQueue(new _.QAppTimerEvent(t))},e);return a.unref(),a}cancelTimer(e){void 0!==e&&n.clearTimeout(e)}addInterval(e,t){return n.setInterval(()=>{this.addToEventQueue(new _.QAppIntervalEvent(t))},e)}cancelInterval(e){void 0!==e&&n.clearInterval(e)}generateAsyncCallidentifier(){let e=Math.random();for(;this.outstandingAsyncCalls.find(t=>t===e);)e=Math.random();return e}enqueAsyncCall(e,a,s=5*t.HEARTBEAT_INTERVAL_MS,i=!1){let r=this.getCurrentState();console.log("QAppBase::enqueAsyncCall in state: "+r+" (timeout: "+s+"/fetchAfter: "+i+") with metadata: "+L.inspect(a));let _=this.generateAsyncCallidentifier();this.outstandingAsyncCalls.push(_)
;let E=new B.QAppAsyncCallTimeoutError(r,a),l=n.setTimeout(()=>{console.log("QAppBase async call timeout - add timeout to event queue");let e=new o.InternalAsyncCallEvent({type:i?o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT,data:{sourceState:r,reason:E,metadata:a},id:_});this.addToEventQueue(e)},s);e.then(e=>{console.log("QAppBase async call passed - add result to event queue");let t=new o.InternalAsyncCallEvent({type:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS,data:{sourceState:r,result:e,metadata:a},id:_,timerId:l});this.addToEventQueue(t)}).catch(e=>{console.log("QAppBase async call failed - add reason to event queue"),console.log(L.inspect(e));let t=new o.InternalAsyncCallEvent({type:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL,data:{sourceState:r,reason:e,metadata:a},id:_,timerId:l});this.addToEventQueue(t)}),
console.log("QAppBase::enqueAsyncCall done...")}addToEventQueue(e){e.type===_.IMMEDIATE_EVENT||e.type===o.INTERNAL_SUSPEND_EVENT||e.type===o.INTERNAL_RESTART_EVENT||e.type===o.HEARTBEAT_EVENT?this.eventQueue.push(e):this.eventQueue.unshift(e),this.eventQueuePending||(setImmediate(()=>{this.processEventQueue(this)}),this.eventQueuePending=!0)}processEventQueue(e){if(this.exitTimeOutPending)return;e.eventQueuePending=!1;let t=e.eventQueue.length,a=e.eventQueue.pop();for(;a&&t>0&&!this.exitTimeOutPending;)t--,e.handleEvent(a),t>0&&(a=e.eventQueue.pop())}run(){if(!this.isErrorStatePublished){console.log("QAppBase: run"),this.processCLParameters(process.argv),this.heartbeat({message:":-)",value:this.heartbeatCount++});let e=this.provideStartFsmState();this.qappStates=this.prepareAndExtendFsmStates(e),console.log("QAppBase: register internal event handler"),
this.subscriptions.push(i.merge(this.mqttHandler.mqttUpdateEvent$,this.mqttHandler.mqttAdminEvent$,this.restHandler.buttonClickEvent$,this.restHandler.paramChangedEvent$,this.restHandler.paramDetailEvent$,this.restHandler.restRequestEvent$).subscribe(e=>{this.addToEventQueue(e)})),this.subscriptions.push(this.mqttHandler.mqttUpdateEvent$.subscribe(e=>{try{switch(e.payload.topic){case k.MqttTopics.METROLOGY_MAX_DIGITS:case k.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG:this.weighingProxy.updateWeighValueMaxDigits(parseInt(e.payload.value.toString(),10));break;case k.MqttTopics.METROLOGY_RANGES:this.weighingProxy.updateMetrologyRanges(JSON.parse(e.payload.value.toString()));break;case k.MqttTopics.WEIGHING_SELECTED_DISPLAY_VALUE:this.weighingProxy.updateLastSelectedDisplayValue(JSON.parse(e.payload.value.toString()))}}catch(t){this.exitError("unexpected value content for incoming MQTT event: "+e.payload.topic)}})),console.log("QAppBase: create the FSM with all custom states"),
this.qappFsm=r.createFsm(this.qappStates),delete this.__machina__,this.eventQueue.splice(0),this.qappFsm.on("transition",this.onFsmTransitionInternal),this.mqttHandler.subscribe(k.MqttTopics.QAPP_DEBUG_TOPIC_PREAMBLE+"/#"),this.onRunning(),console.log("QAppBase: schedule transition to custom start state"),setTimeout(()=>{console.log("QAppBase: start heartbeating"),this.heartbeatIntervalSubscription=this.heartbeatInterval$.subscribe(()=>{this.addHeartbeatEvent(":-)")}),console.log("QAppBase: initiate transition to custom start state"),this.qappFsm.handle(this,J,this.isDevelVersion?$:e),console.log("QAppBase: initiated transition to custom start state")},w),console.log("QAppBase: run finished")}}canSuspend(){if(console.log("QAppBase: Can suspend?"),this.suspendReason===le.SUSPEND_APP)return!0;if(console.log("QAppBase: Check printQueue"),this.reportingProxy.isPrintQueueEmpty())return console.log("QAppBase: printQueue is empty, exiting the QApp."),!0
;if(this.suspendReason===le.SUSPEND_LOGOUT)this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TITLE",args:[]},buttons:[{id:te,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:ae,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_top",args:[]},{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_mid",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_bottom",args:[]}]});else{if(this.suspendReason!==le.SUSPEND_HOME)return!1;this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_HOME_WARNING_TITLE",args:[]},buttons:[{id:z,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:ee,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_top",args:[]},{
id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_mid",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_bottom",args:[]}]})}return console.log("QAppBase: printQueue is not empty, asking for permission to exist task."),!1}continueSuspend(){this.suspendReason!==le.SUSPEND_NO_SUSPEND?(console.log("QAppBase: Continue last suspend request"),this.clearPrintQueue(),this.handleEvent(new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY))):console.log("QAppBase: No suspend pending continue")}cancelSuspend(){console.log("QAppBase: Cancel last suspend request"),this.suspendReason=le.SUSPEND_NO_SUSPEND}cancelLogout(){console.log("QAppBase: Cancel last logout request"),this.cancelSuspend(),this.forgetLogout()}rememberLogout(){this.mqttHandler.publish(k.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:re}))}forgetLogout(){this.mqttHandler.publish(k.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:ne}))}suspend(){
console.log("QAppBase: QApp suspend request"),this.suspendReason=le.SUSPEND_APP,this.handleEvent(new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY))}doSuspend(){this.isErrorStatePublished||(console.log("QAppBase: suspend"),this.onSuspending(),this.doCloseAllOverlays(),console.log("QAppBase: publish STOPPED event of qapp"),this.mqttHandler.publish(k.MqttTopics.QAPP_STOPPED,this.taskId?""+this.taskId:"",{retain:!1}),setTimeout(()=>{console.log("process.exit"),process.exit(0)},q),this.exitTimeOutPending=!0)}canRestart(){return console.log("QAppBase: can restart? - check printQueue"),this.reportingProxy.isPrintQueueEmpty()?(console.log("QAppBase: printQueue is empty, restart the QApp."),!0):(this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TITLE",args:[]},buttons:[{id:se,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:ie,label:{id:"_QAPP_LIB_MBOX_BTN_NO",
args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_top",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_bottom",args:[]}]}),console.log("QAppBase: printQueue is not empty, asking for permission to restart task."),!1)}continueRestart(){console.log("QAppBase: Continue last restart request"),this.handleEvent(new o.InternalRestartEvent(o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_EXECFINALLY))}doCloseAllOverlays(){this.hidePrintQueue();for(let e in this.screens){let t=this.screens[e].getButton(R.CANCEL_BARBUTTON_ID);if(t&&t.setAppearance(W.EnumAppearance.HIDDEN),e!==D.LOADING_OVERLAY_ID)try{this.screens[e].hide()}catch(e){}}this.hideAllMsgBox()}exitError(e){this.isErrorStatePublished=!0;let t=(new Error).stack;console.log("QAppBase: exit with error: "+e),console.log("exitError: "),console.log(t),this.doCloseAllOverlays(),
this.messageHandlerHelper.addMessage(b.EMsgHandlerMsgs.ERR_799_GENERIC_INTERNAL_ERROR,e,void 0,[U.createMessageHandlerButton(void 0,void 0,U.MessageHandlerCallTarget.REMOVE_MESSAGE)]),this.onErrorExiting(e),this.mqttHandler.publish(k.MqttTopics.QAPP_ERROR,(this.taskId?""+this.taskId:"")+"error: "+e,{retain:!1}),setTimeout(()=>{console.error("QAppBase: exit with error: "+e),process.exit(-1)},q),this.exitTimeOutPending=!0}heartbeat(e){this.isErrorStatePublished||(this.debugCfg.enableHeartbeatLog&&console.log("."),this.mqttHandler.publish(k.MqttTopics.QAPP_HEARTBEAT,JSON.stringify(e),{retain:!1}))}addHeartbeatEvent(e){this.addToEventQueue(new o.HeartbeatEvent({message:e,value:this.heartbeatCount++}))}checkForCustomHeartbeatEvent(e,t){try{return e.payload.event===h.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===k.MqttTopics.QAPP_HEARTBEAT&&JSON.parse(e.payload.packet.payload.toString()).message===t}catch(e){return!1}}adaptFsmStates(e){}prepareAndExtendFsmStates(e){let t
;if(console.log("QAppBase::prepareAndExtendFsmStates: create state machine with QApp specific states"),void 0===this.qappStates){t=this.provideFsmStates();for(let e in this.aspects)Object.assign(t,this.aspects[e].getAspectStates());t[$]={_onEnter:function(e){e.showMessageBox({type:m.EnumMessageboxType.INFO,title:{id:"_QAPP_LIB_MBOX_DEMO_INFO_TITLE",args:[]},buttons:[{id:Z,label:{id:G.EnumFontLabels.OK,args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_DEMO_INFO_TEXT",args:[]}]})},_onExit:function(e){},EV_HMI_BTN_CLICKED:function(t,a){return a.payload.buttonId===Z&&(t.hideMsgBox(),this.transition(t,e)),""}},this.adaptFsmStates(t);for(let e in this.aspects)if(this.aspects[e].getId()===H.LOCKING_ASPECT){this.aspects[e].adaptFsmStates(t);break}let a=function(e,t){e.heartbeat(t.payload)};for(let e in t)t.hasOwnProperty(e)&&(t[e]._FSM_HEARTBEAT_EVENT_=a,t[e]._INTERNAL_SUSPEND_EVENT_=function(e,t){switch(t.payload){
case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME:case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_LOGOUT:console.log("QAppBase: HOME/LOGOUT button suspend request"),t.payload===o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME?e.suspendReason=le.SUSPEND_HOME:e.suspendReason=le.SUSPEND_LOGOUT,e.canSuspend()?this.transition(e,j):console.log("QAppBase: HOME/LOGOUT suspend interrupted by QApp");break;case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT:console.log("QAppBase: auto logout suspend request"),e.suspendReason=le.SUSPEND_HOME,this.transition(e,j);break;case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY:this.transition(e,j)}},t[e]._INTERNAL_RESTART_EVENT_=function(e,t){switch(t.payload){case o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_REQUEST:e.canRestart()?this.transition(e,X):console.log("QAppBase: restart interrupted by QApp");break;case o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_EXECFINALLY:
this.transition(e,X)}});t[j]={_onEnter:function(e){e.showLoadingScreen({id:"",args:[]})},_onExit:function(e){},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)&&e.doSuspend()},_FSM_HEARTBEAT_EVENT_:a},t[X]={_onEnter:function(e){e.showLoadingScreen({id:"_QAPP_LIB_LOADING_OVERLAY_TEXT_RESTARTING_APP",args:[e.getTaskName()]})},_onExit:function(e){},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)&&(e.clearPrintQueue(),this.transition(e,r.STATE_UNINITIALIZED_INTERNAL),e.restart(),e.run())},_FSM_HEARTBEAT_EVENT_:a}}else t=this.qappStates;return t}handleEvent(e){if(this.qappFsm){if(e instanceof E.MqttUpdateDebugEvent&&e.payload.topic===k.MqttTopics.QAPP_DEBUG_STOP_HEARTBEAT&&(console.log("DEBUG: stop heartbeat received"),this.heartbeatIntervalSubscription&&(console.log("DEBUG: stop heartbeat > unsubscribe on heartbeatInterval"),this.heartbeatIntervalSubscription.unsubscribe())),
e instanceof A.HmiButtonClickedEvent)if(e.payload.buttonId!==x.BTN_HOME_ID||this.suppressGlobalHomeBtnHandling)if(e.payload.buttonId!==x.BTN_LOGOUT_ID||this.suppressGlobalLogoutBtnHandling){if(e.payload.buttonId===z)return void this.continueSuspend();if(e.payload.buttonId===te)return void this.continueSuspend();if(e.payload.buttonId===ee)return this.cancelSuspend(),this.hidePriorMsgBox(),void this.hideLoadingScreen();if(e.payload.buttonId===ae)return this.cancelLogout(),this.hidePriorMsgBox(),void this.hideLoadingScreen();if(e.payload.buttonId!==t.PRINT_RESTART_BUTTON_ID||this.suppressGlobalRestartBtnHandling){if(e.payload.buttonId===se)return void this.continueRestart();if(e.payload.buttonId===ie)return this.hidePriorMsgBox(),void this.hideLoadingScreen();if(void 0!==this.buttons.docuButton&&e.payload.buttonId===this.buttons.docuButton.getButtonId())return void this.handleDocuButton()}else e=new o.InternalRestartEvent(o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_REQUEST)
}else e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_LOGOUT);else e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME);if(e instanceof E.MqttUpdateEvent&&e.payload.topic===k.MqttTopics.USERMANAGEMENT_AUTO_LOGOUT_EVENT)try{JSON.parse(e.payload.value.toString()).logOff&&(e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT))}catch(e){}if(e instanceof o.InternalAsyncCallEvent){let t=this.outstandingAsyncCalls.findIndex(t=>t===e.payload.id);if(-1===t)return void console.log(`QAppBase::handleEvent: async event already handled - discard result (${e.payload.type}) for metadata: ${e.payload.data.metadata}`);switch(e.payload.type){case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS:e.payload.timerId&&n.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new _.QAppAsyncCallDoneEvent(e.payload.data);break
;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL:e.payload.timerId&&n.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new _.QAppAsyncCallFailEvent(e.payload.data);break;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT:this.outstandingAsyncCalls.splice(t,1),e=new _.QAppAsyncCallFailEvent(e.payload.data);break;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP:e=new _.QAppAsyncCallFailEvent(e.payload.data)}}this.qappFsm.handle(this,e.type,e)}else this.exitError("QAppBase::handleEvent - no fsm instance set, unexpectedly")}onFsmTransitionInternal(e){if(console.log("QAppBase: transition from <",e.fromState,"> to <",e.toState,"> (machina ev: <",e.action,">)"),e.fromState){let t=e.client.qappFsm.states[e.fromState]._transTo;if(t){let a=t[e.toState];a?a(e.client,e):(a=t["~"])&&a(e.client,e),(a=t["*"])&&a(e.client,e)}if(e.fromState===r.STATE_UNINITIALIZED_INTERNAL){
e.client.mqttHandler.subscribe(k.MqttTopics.METROLOGY_MAX_DIGITS),e.client.mqttHandler.subscribe(k.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG),e.client.mqttHandler.subscribe(k.MqttTopics.METROLOGY_RANGES),e.client.mqttHandler.subscribe(k.MqttTopics.WEIGHING_SELECTED_DISPLAY_VALUE),e.client.mqttHandler.subscribe(k.MqttTopics.USERMANAGEMENT_AUTO_LOGOUT_EVENT),console.log("QAppBase: handle transition to custom initial state: initTaskHandler"),e.client.initTaskHandler(),console.log("QAppBase: handle transition to custom initial state: adaptTaskHandler"),e.client.adaptTaskHandler(),console.log("QAppBase: clear all task and QApp errors from messageHandler");let t=[],a=e.client.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.QAPP);a&&t.push({categoryAsString:U.MessageHandlerCategory.QAPP,secret:a});let s=e.client.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);s&&t.push({categoryAsString:U.MessageHandlerCategory.QAPP,secret:s})
;let i=e.client.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_COMM_ERROR);i&&t.push({categoryAsString:U.MessageHandlerCategory.QAPP,secret:i});let n=e.client.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_EXIT_ERROR);n&&t.push({categoryAsString:U.MessageHandlerCategory.QAPP,secret:n});let r=void 0;void 0!==e.client.taskId&&(r=e.client.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.TASKID))&&t.push({categoryAsString:U.MessageHandlerCategory.QAPP,secret:r});let o=!1;try{o=!e.client.messageHandlerProxy.deleteMessagesByCategory(t).isSuccess()}catch(e){o=!0}o&&(console.log("QAppBase: bulk call failed/not supported - use multiple messageHandler calls instead"),a&&e.client.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,a),s&&e.client.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,s),
i&&e.client.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,i),n&&e.client.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,n),r&&e.client.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,r)),console.log("QAppBase: handle transition to custom initial state: init"),e.client.init(),console.log("QAppBase: handle transition to custom initial state: init all aspects");for(let t in e.client.aspects)console.log("init aspect: ",t),e.client.aspects[t].init(e.client);console.log("QAppBase: handle transition to custom initial state: postInit"),e.client.postInit(),console.log("QAppBase: handle transition to custom initial state: ...done")}}if(e.client.onFsmTransition(e),e.fromState===r.STATE_UNINITIALIZED_INTERNAL&&(console.log("QAppBase: publish running state of qapp"),e.client.mqttHandler.publish(k.MqttTopics.QAPP_STARTED,e.client.taskId?""+e.client.taskId:"create Task",{retain:!1})),e.toState){
let t=e.client.qappFsm.states[e.toState]._transFrom;if(t){let a=t[e.fromState];a?a(e.client,e):(a=t["~"])&&a(e.client,e),(a=t["*"])&&a(e.client,e)}}}getCurrentState(){let e=this.__machina__._qappStm_.state;return console.log("QAppBase::getCurrentState: ",e),e}onRunning(){console.log("QAppBase: default callback after QApp published RUNNING event")}restart(){this.announceRestart(),this.specificRestart(),this.onSuspending(),this.doCloseAllOverlays();for(let e of this.subscriptions)e.unsubscribe();this.heartbeatIntervalSubscription&&this.heartbeatIntervalSubscription.unsubscribe(),this.mqttHandler.unsubscribeTopics(),this.weighingProxy.clearTare1AndTare2()}announceRestart(){console.log("QAppBase: announce restart to system"),this.taskMngProxy.setTaskEvent(this.taskId?this.taskId:"---",I.EnumTaskManagementEvent.EVENT_RESTART)}specificRestart(){console.log("QAppBase: default callback before QApp restarts")}onSuspending(){
console.log("QAppBase: default callback before QApp publishes STOPPED event and exits")}onErrorExiting(e){console.log("QAppBase: default callback before QApp publishes ERROR event and aborts")}onFsmTransition(e){console.log("QAppBase: default callback for transitions")}getStorageLocation(e){let a=void 0,s=this.taskHandler.getTask();switch(e){case g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT:a=t.STORAGE_LOCATION_BASE;break;case g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC:s&&(a=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT)+M.sep+s.qappOrderNumber);break;case g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION:s&&(a=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC)+M.sep+s.qappVersion);break;case g.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC:s&&this.taskId&&(a=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION)+M.sep+this.taskId)}return a}
createStorageLocation(e){let t=a(16),s=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT);if(void 0!==s){if(!t.existsSync(s))return!1;if(e!==g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT){let a=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC);if(void 0!==a){if(t.existsSync(a)||t.mkdirSync(a),e!==g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC){let a=this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION);if(void 0!==a){if(t.existsSync(a)||t.mkdirSync(a),e!==g.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION){return void 0!==this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC)&&(t.existsSync(this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC))||t.mkdirSync(this.getStorageLocation(g.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC)),!0)}return!0}return!1}return!0}return!1}return!0}return!1}
readQAppDescQTFAsJSON(e,t){let a=void 0,s=void 0,i="";if(K.isString(t)&&t.length>0)i=t;else{if(!this.scriptPath)return void console.log("QAppConfigBase::readQAppDescAsJSON - internal error - no scriptPath is set.");i=M.dirname(this.scriptPath)+"/../"}let n="";try{n=i+"qapp.desc_"+e+".json",s=O.readFileSync(n)}catch(e){console.log("QAppConfigBase: - no "+n+" found - try DEFAULT");try{n=i+"qapp.desc_DEFAULT.json",s=O.readFileSync(n)}catch(e){return void console.log("QAppConfigBase::readQAppDescAsJSON - "+n+" (fallback) missing")}}try{s&&(a=JSON.parse(s.toString("utf-8")))}catch(e){return void console.log("QAppConfigBase::readQAppDescAsJSON - "+n+" not valid JSON")}return a.name=a.hasOwnProperty("name")?a.name:"ERROR",a.shortDescription=a.hasOwnProperty("shortDescription")?a.shortDescription:"ERROR",a.longDescription=a.hasOwnProperty("longDescription")?a.longDescription:"ERROR",a}relevantParamsAreEqual(e,a){let s=y.cloneJSON(e),i=y.cloneJSON(a);return s.forEach((e,a)=>{
e.id===oe?delete s[a]:e.id===_e&&e.parameters.forEach((e,i)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete s[a].parameters[i]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),i.forEach((e,a)=>{e.id===oe?delete i[a]:e.id===_e&&e.parameters.forEach((e,s)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete i[a].parameters[s]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),v.isEqual(s,i)}deleteDBError(){let e=this.messageHandlerHelper.buildSecret(b.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);e&&this.messageHandlerProxy.deleteMessageByCategory(U.MessageHandlerCategory.QAPP,e)}}t.QAppBase=Ae},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(7),n=a(2),r={BTN_INVALIDATE_SAMPLE:10,BTN_DOCU:20,BTN_EVAL:30,BTN_PRINT_LABEL:40,BTN_ADD:50,BTN_START:60,BTN_PRINTADD:60,BTN_NEXT:60};t.getButtonPriority=function(e){return void 0!==r[e]?r[e]:0},t.BTN_EVAL_ID="BTN_EVAL";const o={buttonId:t.BTN_EVAL_ID,label:{
id:i.EnumFontLabels.RESULT,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createEvalButtonData=function(){return n.cloneJSON(o)},t.BTN_NEXT_ID="BTN_NEXT";const _={buttonId:t.BTN_NEXT_ID,label:{id:i.EnumFontLabels.NEXT,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createNextButtonData=function(){return n.cloneJSON(_)},t.BTN_PREV_ID="BTN_PREV";const E={buttonId:t.BTN_PREV_ID,label:{id:i.EnumFontLabels.PREV,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrevButtonData=function(){return n.cloneJSON(E)},t.BTN_BACK_ID="BTN_BACK",t.BTN_LONG_BACK_ID="BTN_LONG_BACK";const l={buttonId:t.BTN_BACK_ID,label:{id:i.EnumFontLabels.BACK,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createBackButtonData=function(e=!1){let a=n.cloneJSON(l);return e&&(a.longPressButtonId=t.BTN_LONG_BACK_ID),a},t.BTN_DOCU_ID="BTN_DOCU";const A={buttonId:t.BTN_DOCU_ID,label:{id:i.EnumFontLabels.DOCU,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createDocuButtonData=function(){return n.cloneJSON(A)},
t.BTN_SEND_ID="BTN_SEND";const u={buttonId:t.BTN_SEND_ID,label:{id:i.EnumFontLabels.DOCU,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createSendButtonData=function(){return n.cloneJSON(u)},t.BTN_INVALIDATE_SAMPLE_ID="BTN_INVALIDATE_SAMPLE";const c={buttonId:t.BTN_INVALIDATE_SAMPLE_ID,label:{id:i.EnumFontLabels.INVALIDATE_SAMPLE,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createInvalidateSampleButtonData=function(){return n.cloneJSON(c)},t.BTN_PRINT_LABEL_ID="BTN_PRINT_LABEL";const I={buttonId:t.BTN_PRINT_LABEL_ID,label:{id:"_QAPP_LIB_PRINT_LABEL_BTN_TITLE",args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrintLabelButtonData=function(){return n.cloneJSON(I)},t.BTN_START_ID="BTN_START";const T={buttonId:t.BTN_START_ID,label:{id:i.EnumFontLabels.START,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createStartButtonData=function(){return n.cloneJSON(T)},t.BTN_END_ID="BTN_END";const d={buttonId:t.BTN_END_ID,label:{id:i.EnumFontLabels.END,args:[]},appearance:s.EnumAppearance.HIDDEN
};t.createEndButtonData=function(){return n.cloneJSON(d)},t.BTN_PRINTADD_ID="BTN_PRINTADD";const N={buttonId:t.BTN_PRINTADD_ID,label:{id:i.EnumFontLabels.PRINT_ADD,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrintAddButtonData=function(){return n.cloneJSON(N)},t.BTN_CANCEL_ID="BTN_CANCEL";const p={buttonId:t.BTN_CANCEL_ID,label:{id:i.EnumFontLabels.CANCEL,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createCancelButtonData=function(){return n.cloneJSON(p)},t.BTN_SEARCH_ID="BTN_SEARCH";const S={buttonId:t.BTN_SEARCH_ID,label:{id:i.EnumFontLabels.SEARCH,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createSearchButtonData=function(){return n.cloneJSON(S)},t.setNoSearchActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.SEARCH,args:[]},t)},t.setSearchActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.SEARCH_ACTIVE,args:[]},t)},t.BTN_FILTER_ID="BTN_FILTER";const m={buttonId:t.BTN_FILTER_ID,label:{id:i.EnumFontLabels.FILTER,args:[]},appearance:s.EnumAppearance.HIDDEN}
;t.createFilterButtonData=function(){return n.cloneJSON(m)},t.setNoFilterActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.FILTER,args:[]},t)},t.setFilterActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.FILTER_ACTIVE,args:[]},t)},t.BTN_ADD_ID="BTN_ADD";const R={buttonId:t.BTN_ADD_ID,label:{id:i.EnumFontLabels.ADD,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createAddButtonData=function(){return n.cloneJSON(R)},t.BTN_DELETE_ID="BTN_DELETE";const P={buttonId:t.BTN_DELETE_ID,label:{id:i.EnumFontLabels.DELETE,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createDeleteButtonData=function(){return n.cloneJSON(P)},t.BTN_HOME_ID="BTN_HOME",t.HOME_BUTTON_ICON="./02_menu";const D={buttonId:t.BTN_HOME_ID,label:{id:i.EnumFontLabels.CANCEL,args:[]},icon:t.HOME_BUTTON_ICON,appearance:s.EnumAppearance.HIDDEN};t.createHomeButtonData=function(){return n.cloneJSON(D)},t.BTN_LOGOUT_ID="BTN_LOGOUT";const C={buttonId:t.BTN_LOGOUT_ID,label:{id:i.EnumFontLabels.LOGOUT,args:[]},
appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createLogoutButtonData=function(){return n.cloneJSON(C)},t.BTN_RELOAD_ID="BTN_RELOAD";const h={buttonId:t.BTN_RELOAD_ID,label:{id:i.EnumFontLabels.RELOAD,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createReloadButtonData=function(){return n.cloneJSON(h)},t.BTN_OPEN_WEIGHING_ID="BTN_OPEN_WEIGHING";const g={buttonId:t.BTN_OPEN_WEIGHING_ID,label:{id:i.EnumFontLabels.WEIGHING,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createOpenWeighingButtonData=function(){return n.cloneJSON(g)},t.BTN_OK_ID="BTN_OK";const M={buttonId:t.BTN_OK_ID,label:{id:i.EnumFontLabels.OK,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createOKButtonData=function(){return n.cloneJSON(M)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(26),n=a(4),r=a(1);t.CANCEL_BUTTON_ID="BTN_CANCEL",t.CANCEL_BUTTON_NAME="_CANCEL";class o extends n.AbstractScreen{constructor(e){super(e),
this.paramList=[],this.parameterCategoryList=[],this.isLastCategoryVisible=!1,this.mqttHandler=e}setShowLastVisibleCategory(e,t=!0){this.isLastCategoryVisible=e,t&&this.createAndPublishParamsAndPage()}readFromTaskhandler(e){let t=e.getTaskGroupsAndParameters();this.readFromParameterGroupArray(t)}readFromParameterGroupArray(e){this.paramList.splice(0,this.paramList.length),this.parameterCategoryList.splice(0,this.parameterCategoryList.length);for(let t of e){let e={},a={},n=s.createEmptyTextStructure();n=t.title,a.title=n,e.category=a,e.category.id=t.id,e.params=[];for(let a of t.parameters){let t=new i.default(this.mqttHandler,a);this.paramList.push(t),e.params.push(t.getPublishedId())}this.parameterCategoryList.push(e)}}createAndPublishParamsAndPage(){let e={params:{}};e.params=this.parameterCategoryList,e.showLastVisibleCategory=this.isLastCategoryVisible;const t=r.MqttTopics.QAPP_NAMESPACE+"/SCREENS/"+this.getId()+"/PARAMSANDPAGE";console.log("ParamListBase: publishContent @ "+t),
this.mqttHandler.publish(t,JSON.stringify(e),{retain:!0})}updateParameter(e){for(let t of this.paramList)if(t.getId()===e.id)return void t.setValue(e)}}t.ParamListBase=o,t.default=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(2),n=a(1);class r{constructor(e,t){this.publishedId="",this.publishPending=!0,this.parameter=t,this.publishedId=n.MqttTopics.QAPP_PARAMETERS_TOPIC_PREAMBLE+"/"+this.parameter.id,this.mqttHandler=e,this.publish()}getId(){return this.parameter.id}getPublishedId(){return this.publishedId}setValue(e){this.parameter=e,this.publish()}getValue(){return this.parameter}setParamId(e,t=!0){(this.parameter.id!==e||this.publishPending)&&(this.parameter.id=e,t?this.publish():this.publishPending=!0)}setParamAppearance(e,t=!0){(this.parameter.appearance!==e||this.publishPending)&&(this.parameter.appearance=e,t?this.publish():this.publishPending=!0)}setParamType(e,t=!0){
(this.parameter.type!==e||this.publishPending)&&(this.parameter.type=e,t?this.publish():this.publishPending=!0)}setParamTitle(e,t=!0){(this.parameter.title.id!==e.id||this.parameter.title.args.join("")!==e.args.join("")||this.publishPending)&&(this.parameter.title=e,t?this.publish():this.publishPending=!0)}setParamHeader(e,t=!0){(this.parameter.header.id!==e.id||this.parameter.header.args.join("")!==e.args.join("")||this.publishPending)&&(this.parameter.header=e,t?this.publish():this.publishPending=!0)}publish(){if(this.publishPending=!1,s.isTypeOfIPasswordParameter(this.parameter)){let e=i.cloneJSON(this.parameter);e.info.passwordLength=e.value.string.length,e.value.string="",this.mqttHandler.publish(this.publishedId,JSON.stringify(e))}else this.mqttHandler.publish(this.publishedId,JSON.stringify(this.parameter))}}t.Param=r,t.default=r},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(0),n=a(15),r=a(7),o=a(5);var _,E,l;function A(e,a,s){
return{appearance:i.EnumAppearance.ENABLED_SECONDARY,type:E.CALLBACK,name:a||r.EnumFontLabels.OK,effect:{method:"buttonClickEvent",module:"qappHandler",params:{buttonId:e||t.MESSAGEHANDLER_OK_BTN_ID},calltarget:s||l.ReST}}}!function(e){e.FATAL="FATAL",e.ERROR="ERROR",e.WARNING="WARNING",e.INFORMATION="INFORMATION"}(_=t.MESSAGE_HANDLER_MESSAGE_TYPE||(t.MESSAGE_HANDLER_MESSAGE_TYPE={})),function(e){e.UNTIL_EXPLICIT_DELETION="UNTIL_EXPLICIT_DELETION",e.UNTIL_EXPLICIT_DELETION_OR_REBOOT="UNTIL_EXPLICIT_DELETION_OR_REBOOT",e.UNTIL_USER_ACKNOWLEDGE_WITH_REBOOT_PERSISTENCE="UNTIL_USER_ACKNOWLEDGE_WITH_REBOOT_PERSISTENCE",e.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE="UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE"}(t.MESSAGE_HANDLER_LIFETIME||(t.MESSAGE_HANDLER_LIFETIME={})),function(e){e.NAVIGATETO="NavigateTo",e.CALLBACK="Callback"}(E=t.MESSAGE_HANDLER_BUTTON_TYPE||(t.MESSAGE_HANDLER_BUTTON_TYPE={})),function(e){e.MQTT="MQTT",e.ReST="ReST",e.REMOVE_MESSAGE="REMOVE_MESSAGE"
}(l=t.MessageHandlerCallTarget||(t.MessageHandlerCallTarget={})),function(e){e.NONE="NONE",e.USER_CAL="USER_CAL",e.QAPP="QAPP"}(t.MessageHandlerCategory||(t.MessageHandlerCategory={})),t.MESSAGEHANDLER_OK_BTN_ID="BTN_OK_MESSAGEHANDLER",t.MESSAGEHANDLER_CLOSE_QAPP_BTN_I18N="_QAPP_LIB_CONNECTION_ERROR_CLOSE_QAPP_BTN",t.createMessageHandlerButton=A;t.MessageHandlerProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="messagehandler"}addMessage(e,t,a,i,r,_,E,l,u,c){return this.body.method=o.RestMethodsMESSAGE_HANDLER.addMessage,this.body.params={message:{errorCode:e,type:t,lifetime:i,title:r,reason:_,solution:E,buttons:u||[A()],category:a,categorysecret:l},showMessageInFutureMillis:c||0,uniqueMessageId:0},console.log("addMessageHandler: "+n.inspect(this.body.params.message)),new s.CubisRestResponse(this.syncRequest()).rawReturns.uniqueMessageId}deleteMessageByCategory(e,t){return this.body.method=o.RestMethodsMESSAGE_HANDLER.deleteMessageByCategory,
this.body.params={categoryAsString:e,secret:t},console.log("deleteMessageByCategory: "+n.inspect(this.body.params)),new s.CubisRestResponse(this.syncRequest())}deleteMessagesByCategory(e){return this.body.method=o.RestMethodsMESSAGE_HANDLER.deleteMessagesByCategory,this.body.params={categorySecretArray:JSON.stringify({arraySize:e.length,data:e})},console.log("deleteMessagesByCategory: "+n.inspect(this.body.params)),new s.CubisRestResponse(this.syncRequest())}getAllMessagesByCategory(e){this.body.method=o.RestMethodsMESSAGE_HANDLER.getAllMessagesByCategory,this.body.params={categoryAsString:e,messages:{}};let t=new s.CubisRestResponse(this.syncRequest());return JSON.parse(t.rawReturns.messages).data}getAllErrorMessagesByCategory(e){let t=this.getAllMessagesByCategory(e),a=[];for(let e of t)e.type===_.ERROR&&a.push(e);return a}removeMessage(e){return this.body.method=o.RestMethodsMESSAGE_HANDLER.removeMessage,this.body.params={uniqueMessageId:e},
new s.CubisRestResponse(this.syncRequest())}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EV_MQTT_UPDATE="EV_MQTT_UPDATE";class s{constructor(e){this.payload=e,this.type=t.EV_MQTT_UPDATE}}t.MqttUpdateEvent=s,t.EV_MQTT_UPDATE_DEBUG="EV_MQTT_UPDATE_DEBUG";t.MqttUpdateDebugEvent=class extends s{constructor(){super(...arguments),this.type=t.EV_MQTT_UPDATE_DEBUG}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MQTT_ADMIN_EVENT="MQTT_ADMIN_EVENT",t.MQTT_ADMIN_EVENT_PACKET_SENT="packetsend";t.MqttAdminEvent=class{constructor(e){this.payload=e,this.type=t.MQTT_ADMIN_EVENT}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EV_HMI_BTN_CLICKED="EV_HMI_BTN_CLICKED",t.EV_HMI_PARAM_CHANGED="EV_HMI_PARAM_CHANGED",t.EV_HMI_PARAM_DETAIL="EV_HMI_PARAM_DETAIL",t.EV_REST_REQUEST="EV_REST_REQUEST";const s=a(36);t.HmiButtonClickedEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_BTN_CLICKED}}
;t.HmiParamChangedEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_PARAM_CHANGED}};t.HmiParamDetailEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_PARAM_DETAIL}};t.RestRequestEvent=class{constructor(e){this.payload=e,this.type=t.EV_REST_REQUEST}},t.getParamsForRestRequestEvent=function(e){return new s.URL("http://127.0.0.1/"+e.payload.subUrl).searchParams}},function(e,t){e.exports=require("rxjs")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TASK_DYNAMIC_ID_GROUPS_PREFIX="TASK/DYNAMIC_ID",t.TASK_DYNAMIC_ID_CNT_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_CNT",t.TASK_DYNAMIC_ID_LID_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_LID",t.TASK_DYNAMIC_ID_SID_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_SID",t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_DB_CONN_CONFIG",t.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID=t.TASK_DYNAMIC_ID_CNT_GROUP_ID+"/LID_CNT",
t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_PREFIX=t.TASK_DYNAMIC_ID_LID_GROUP_ID+"/LID_",t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER="H_",t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE="T_",t.TASK_DYNAMIC_ID_LID_CNT_MIN=0,t.TASK_DYNAMIC_ID_LID_CNT_MAX=5,t.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID=t.TASK_DYNAMIC_ID_CNT_GROUP_ID+"/SID_CNT",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_PREFIX=t.TASK_DYNAMIC_ID_SID_GROUP_ID+"/SID_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER="H_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE="T_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE="M_",t.TASK_DYNAMIC_ID_SID_CNT_MIN=0,t.TASK_DYNAMIC_ID_SID_CNT_MAX=5,t.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/TYPES",t.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/USERNAME",t.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/PASSWORD",t.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/DATABASE",
t.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/SCHEMA",t.TASK_DYNAMIC_ID_DB_IP_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/IP",t.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/PORT",t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX="CNT_",function(e){e.POSTGRES="postgres",e.MYSQL="mysql",e.MSSQL="mssql",e.SQLITE="sqlite"}(t.EnumDatabaseTypesOptions||(t.EnumDatabaseTypesOptions={})),function(e){e.OFF="OFF",e.ON="ON"}(t.EnumLotIdentifierOptions||(t.EnumLotIdentifierOptions={})),function(e){e.OFF="OFF",e.ON="ON",e.ON_AUTO_INC="ON_AUTO_INC",e.ON_AUTO_DEC="ON_AUTO_DEC"}(t.EnumSampleIdentifierOptions||(t.EnumSampleIdentifierOptions={})),t.createIDCntOption=function(e){return t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX+e.toFixed(0)},t.getConfiguredIds=function(e){return parseInt(e.value.selection.id.replace(t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX,""),10)},t.createLIDParamId=function(e,a){
return t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_PREFIX+a+e.toFixed(0)},t.createSIDParamId=function(e,a){return t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_PREFIX+a+e.toFixed(0)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(3),n=a(14),r=a(1),o=a(5);var _;!function(e){e.STABLE="STABLE",e.CANCELED="CANCELED"}(t.ReportingPrintableValueStateEnum||(t.ReportingPrintableValueStateEnum={})),function(e){e.wrongAlibiId="No alibi entry exists for this alibi id.",e.wrongTopic="Weighing topic not found for this alibi entry.",e.getAlibiListFailed="The rest call to get the Alibilist has failed!"}(_=t.AlibiEntryError||(t.AlibiEntryError={})),t.isAlibiEntryError=function(e){return e===_.wrongAlibiId||e===_.wrongTopic||e===_.getAlibiListFailed},t.REPORTING_CATEGORY_NONE="",t.REPORTING_CATEGORY_INIT="_QAPP_LIB_REPORTING_CATERGORY_INIT",t.REPORTING_CATEGORY_COMPONENTS="_QAPP_LIB_REPORTING_CATERGORY_COMPONENTS",
t.REPORTING_CATEGORY_RESULT="_QAPP_LIB_REPORTING_CATERGORY_RESULT",t.REPORTING_CATEGORY_STATISTIC="_QAPP_LIB_REPORTING_CATERGORY_STATISTIC";class E extends s.CubisRestResponse{constructor(e){super(e)}getPrintItemIdentifier(){return this.rawReturns.printItemIdentifier}}t.ReportingPrintParamResponse=E;t.ReportingProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="reporting",this._isPrintQueueEmpty=!0}printParameters(e,t,a,s=-1){this.body.method=o.RestMethodsREPORTING.printParameters,this.body.params={parameters:JSON.stringify(e),category:t,redactable:a,printItemIdentifier:s};let i=new E(this.syncRequest());return i.isSuccess()&&(this._isPrintQueueEmpty=!1),i}printPrintQueue(){return this.body.method=o.RestMethodsREPORTING.printPrintQueueWithElectronicSignature,this.body.params={},new s.CubisRestResponse(this.syncRequest())}printParametersDirect(e,t,a){return this.body.method=o.RestMethodsREPORTING.printParametersDirect,this.body.params={
parameters:JSON.stringify(e),category:t,silent:a},new s.CubisRestResponse(this.syncRequest())}getPrintQueue(){return this.body.method=o.RestMethodsREPORTING.getPrintQueue,this.body.params={printQueue:{}},new s.CubisRestResponse(this.syncRequest())}isPrintQueueEmpty(){let e;this.body.method=o.RestMethodsREPORTING.isPrintQueueEmpty,this.body.params={rResult:!1};try{return!!(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()&&e.rawReturns.rResult}catch(e){return console.log("Something went wrong when calling isPrintQueueEmpty"),console.log(e),this._isPrintQueueEmpty}}clearPrintQueue(){this.body.method=o.RestMethodsREPORTING.clearPrintQueue,this.body.params={};let e=new s.CubisRestResponse(this.syncRequest());return e.isSuccess()&&(this._isPrintQueueEmpty=!0),console.log("clearPrintQueue() result: "+e.isSuccess()),e}requestPrintableValue(e){return this.body.method=o.RestMethodsREPORTING.requestPrintableValueComment,this.body.params={comment:e},
new s.CubisRestResponse(this.syncRequest())}setRedactionStatus(e,t,a){return this.body.method=o.RestMethodsREPORTING.setRedactionStatus,this.body.params={printItemIdentifier:e,redacted:t,reason:a},new s.CubisRestResponse(this.syncRequest())}getAlibiRecord(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecord,this.body.params={identifier:e,record:""},new s.CubisRestResponse(this.syncRequest())}getAlibiRecordList(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecordList,this.body.params={identifiers:e,records:[]},new s.CubisRestResponse(this.syncRequest())}getDateFromAlibi(e){let t;if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return _.getAlibiListFailed;t=JSON.parse(e.rawReturns.record)}else{if("number"==typeof e){let t=this.getAlibiRecord(e);return t.isSuccess()?JSON.parse(t.rawReturns.record).timestamp:_.wrongAlibiId}t=e}return t.timestamp}getWeightFromAlibi(e,t){let a;if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return _.getAlibiListFailed
;a=JSON.parse(e.rawReturns.record)}else if("number"==typeof e){let t=this.getAlibiRecord(e);if(!t.isSuccess())return _.wrongAlibiId;a=JSON.parse(t.rawReturns.record)}else a=e;return this.parseMeasureParameterFromAlibiResponse(a,t)}getWeightFromAlibiList(e,t){let a=[],i=[];if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return _.getAlibiListFailed;i=JSON.parse(e.rawReturns.records)}else if(0!==(n=e).length&&"number"!=typeof n[0])i=e;else{let t=this.getAlibiRecordList(e);if(!t.isSuccess())return _.getAlibiListFailed;i=JSON.parse(t.rawReturns.records)}var n;return i.forEach(e=>{a=[...a,this.parseMeasureParameterFromAlibiResponse(e,t)]}),a}parseMeasureParameterFromAlibiResponse(e,t){let a=i.createEmptyParameterGroupOfGroups();if(null===e)return _.wrongAlibiId;{a.parameters[0].parameters=JSON.parse(e.weighingblock);let s=n.WeightBlockHelper.getMeasureParameter(a,t||r.MqttTopics.WEIGHING_VALUE_NET);return void 0===s?_.wrongTopic:s}}}},function(e,t,a){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(4);t.AbstractOverlay=class extends i.AbstractScreen{show(){this.publishContent("",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:i.ScreenEventType.SHOW_OVERLAY,id:this.getId()})}hide(){this.publishContent("",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:i.ScreenEventType.HIDE_OVERLAY,id:this.getId()})}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(14),n=a(19),r=a(2);t.checkGeneralParamRules=function(e){let t=void 0;if(s.isTypeOfIQuantityParameter(e)){let a=i.QuantityParameter.getValue(e);if(Number.isNaN(a)){if(!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{
id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EMPTY_NOT_ALLOWED",args:[]}],t={updatedParameter:e,message:a}}}else try{if(a<parseFloat(e.info.minimum.value)){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EXCEED_MIN",args:[]}],t={updatedParameter:e,message:a}}else if(a>parseFloat(e.info.maximum.value)){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EXCEED_MAX",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}else if(s.isTypeOfIStringParameter(e)){let a=e.value.string;try{if(void 0===a){if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]
}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else if(a.length<e.info.minimum.length)if(0===a.length){if(console.log("StringParam: empty"),!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else{console.log("StringParam: min exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_SHORT",args:[]}],t={updatedParameter:e,message:a}}else if(a.length>e.info.maximum.length)if(console.log("StringParam: max exceed"),
!0===e.info.maximum.autoCut)console.log("StringParam: autocut"),e.value.string=a.substr(0,e.info.maximum.length);else{let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_LONG",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}else if(s.isTypeOfIPasswordParameter(e)){let a=e.value.string;try{if(void 0===a){if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else if(a.length<e.info.minimum.length)if(0===a.length){if(console.log("PasswordParam: empty"),!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept)
;void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else{console.log("PasswordParam: min exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_SHORT",args:[]}],t={updatedParameter:e,message:a}}else if(a.length>e.info.maximum.length){console.log("PasswordParam: max exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_LONG",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}return t}},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("child_process")},function(e,t,a){
"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(5);!function(e){e.EVENT_RESTART="restart"}(t.EnumTaskManagementEvent||(t.EnumTaskManagementEvent={}));class n extends s.CubisRestResponse{constructor(e){super(e)}getErrorList(){return JSON.parse(this.rawReturns.errorList)}getStoredTask(){return JSON.parse(this.rawReturns.task)}}t.TaskValCreaUpdResponse=n;t.TaskProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="task/management"}getTaskTemplate(){let e,t;return this.body.method=i.RestMethodsTASK_MANAGEMENT.getTaskTemplate,this.body.params={taskTemplate:{}},e=new s.CubisRestResponse(this.syncRequest()),t=JSON.parse(e.rawReturns.taskTemplate)}readTask(e,t=!0){let a,n;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.readTask,this.body.params={document:{},dbId:e,updateOptions:t},!(a=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'")
;return n=JSON.parse(a.rawReturns.document)}getTaskName(e){try{let t=this.readTask(e).params.find(e=>"TASK/IDENTIFICATION"===e.id);if(void 0!==t){let e=t.parameters.find(e=>"TASK/IDENTIFICATION/NAME"===e.id);if(void 0!==e)return e.value.string}return}catch(e){return}}createTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.createTask,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}updateTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.updateTask,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}validateTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.validate,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}saveWorkstate(e,t){let a;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.saveWorkstate,this.body.params={id:t,workstate:e},!(a=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error saving workstate with id '"+t+"'");return a}
deleteWorkstate(e){let t;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.deleteWorkstate,this.body.params={id:e},!(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error deleting workstate with id '"+e+"'");return t}getWorkstate(e){let t,a;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.getWorkstate,this.body.params={id:e,workstate:{}},!(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'");return a=JSON.parse(t.rawReturns.workstate).workstate}getTaskNamesByOrderNumber(e){let t;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.getTaskNamesByOrderNumber,this.body.params={orderNumber:e,taskNames:[]},(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())return JSON.parse(t.rawReturns.taskNames);throw new Error("Error getting used taskNames for '"+e+"'")}setTaskEvent(e,t){let a;console.log(`TaskManagementProxy: send event: '${t}'`),this.body.method=i.RestMethodsTASK_MANAGEMENT.setTaskEvent,
this.body.params={taskId:e,event:t};try{return(a=new s.CubisRestResponse(this.syncRequest())).isSuccess()}catch(e){return console.log("Something went wrong when calling sendTaskEvent"),console.log(e),!1}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(8),i=a(31),n=a(6),r=a(14),o=a(27),_=a(41),E=a(23),l=a(67),A=a(5),u=a(22),c=a(68);var I,T=a(31);t.Subscription=T.Subscription,t.Observable=T.Observable,t.WEIGHING_BUTTON_UNIT="UNIT",t.WEIGHING_BUTTON_DO_ZERO="DO_ZERO",t.WEIGHING_BUTTON_DO_TARE="DO_TARE",t.WEIGHING_BUTTON_DO_TARE1="DO_TARE1",t.WEIGHING_BUTTON_CLR_TARE1="CLR_TARE1",t.WEIGHING_BUTTON_SET_TARE1="SET_TARE1",t.WEIGHING_BUTTON_SHOW_TARE1="SHOW_TARE1",t.WEIGHING_BUTTON_HIDE_TARE1="HIDE_TARE1",t.WEIGHING_BUTTON_DISPLAY="DISPLAY",function(e){e.WEIGHING_DOZEROTARE_BEHAVIOR_AS_CONFIGURED="AS_CONFIGURED",e.WEIGHING_DOZEROTARE_BEHAVIOR_WITHOUT_STABILITY="WITHOUT_STABILITY",e.WEIGHING_DOZEROTARE_BEHAVIOR_AFTER_STABILITY="AFTER_STABILITY"
}(t.WEIGHING_DOZEROTARE_BEHAVIOR||(t.WEIGHING_DOZEROTARE_BEHAVIOR={})),function(e){e.SELECTED_DOMAIN_UNDEFINED="",e.SELECTED_DOMAIN_WEIGHING="ORIGINAL",e.SELECTED_DOMAIN_APP="APPLICATION"}(I=t.ISelectedWeightDisplayValueDomains||(t.ISelectedWeightDisplayValueDomains={}));const d="WEIGHING_ERROR_UNKNOWN_UNIT_ID";t.WeighingProxy=class extends n.BaseProxy{constructor(){super(...arguments),this.restEndpoint="weighing",this.weighValueMaxDigits=7,this.registeredApplications=[],this.weighingButtonAppearances={[c.WEIGHING_BUTTON_ID.UNIT]:"undefined",[c.WEIGHING_BUTTON_ID.DO_ZERO]:"undefined",[c.WEIGHING_BUTTON_ID.DO_TARE]:"undefined",[c.WEIGHING_BUTTON_ID.DO_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.CLR_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.SET_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.SHOW_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.HIDE_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.DISPLAY]:"undefined"},this.metrologyMaximum$=new i.ReplaySubject(1),this.metrologyMinimum$=new i.ReplaySubject(1),
this.highestRangeInterval$=new i.ReplaySubject(1),this.lowestRangeInterval$=new i.ReplaySubject(1),this.highestRangePrecision$=new i.ReplaySubject(1),this.lowestRangePrecision$=new i.ReplaySubject(1),this.metrologyRanges$=new i.ReplaySubject(1),this.selectedDisplayValue$=new i.ReplaySubject(1),this.lastSelectedDisplayValueInfo={currentSelectedDomain:I.SELECTED_DOMAIN_UNDEFINED,currentSelectedId:"",lastSelectedApplicationId:""}}createWeightApplication(e,t,a,s,i=!1){if(this.registeredApplications.find(t=>t===e))return this.enableWeightApplication(e,i);{this.body.method=A.RestMethodsWEIGHING.createWeightApplication,this.body.params={id:e,title:t,header:a,isDynamic:s};let r=new n.CubisRestResponse(this.syncRequest());if(r.isSuccess()){try{this.enableWeightApplication(e,i)}catch(e){}this.registeredApplications.push(e)}return r}}enableWeightApplication(e,t){return this.body.method=A.RestMethodsWEIGHING.enableWeightApplication,this.body.params={id:e,isEnabled:t},
new n.CubisRestResponse(this.syncRequest())}enableWeightApplicationBulk(e,t){if(!t){let t=this.getSelectedDisplayValue();if(t){let a=t.lastSelectedApplicationId;if(a){let t=!1;return e.forEach(e=>{e!==a?this.enableWeightApplication(e,!1):t=!0}),void(t&&this.enableWeightApplication(a,!1))}}}e.forEach(e=>{this.enableWeightApplication(e,t)})}selectWeightApplication(e){return this.body.method=A.RestMethodsWEIGHING.selectWeightApplication,this.body.params={id:e},new n.CubisRestResponse(this.syncRequest())}destroyWeightApplication(e){this.body.method=A.RestMethodsWEIGHING.destroyWeightApplication,this.body.params={id:e};let t=new n.CubisRestResponse(this.syncRequest());if(t.isSuccess()){let t=this.registeredApplications.findIndex(t=>t===e);t>=0&&this.registeredApplications.splice(t,1)}return t}setButton(e,t){return this.weighingButtonAppearances[e]===t?new n.CubisRestResponse(!0):(this.weighingButtonAppearances[e]=t,this.body.method=A.RestMethodsWEIGHING.setButton,this.body.params={name:e,
appearance:t},new n.CubisRestResponse(this.syncRequest()))}triggerStableWeightBlock(){return this.body.method=A.RestMethodsWEIGHING.triggerStableWeightBlock,this.body.params={},new n.CubisRestResponse(this.syncRequest())}cancelStableWeightBlock(){return this.body.method=A.RestMethodsWEIGHING.cancelStableWeightBlock,this.body.params={},new n.CubisRestResponse(this.syncRequest())}doZero(e){return this.body.method=A.RestMethodsWEIGHING.doZero,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}clearTare1(){return this.body.method=A.RestMethodsWEIGHING.clearTare1,this.body.params={},new n.CubisRestResponse(this.syncRequest())}clearTare2(){return this.body.method=A.RestMethodsWEIGHING.clearTare2,this.body.params={},new n.CubisRestResponse(this.syncRequest())}clearTare1AndTare2(){return{clearTare1Response:this.clearTare1(),clearTare2Response:this.clearTare2()}}clearTareAll(){return this.body.method=A.RestMethodsWEIGHING.clearTareAll,this.body.params={},
new n.CubisRestResponse(this.syncRequest())}doTare(e){return this.body.method=A.RestMethodsWEIGHING.doTare,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doTare1(e){return this.body.method=A.RestMethodsWEIGHING.doTare1,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doTareAuto(e){return this.body.method=A.RestMethodsWEIGHING.doTareAuto,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doZeroTareAuto(e){return this.body.method=A.RestMethodsWEIGHING.doZeroTareAuto,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}setTare1(e){return this.body.method=A.RestMethodsWEIGHING.setTare1,this.body.params={value:e},new n.CubisRestResponse(this.syncRequest())}cancelDoing(){return this.body.method=A.RestMethodsWEIGHING.cancelDoing,this.body.params={},new n.CubisRestResponse(this.syncRequest())}setTare2(e){return this.body.method=A.RestMethodsWEIGHING.setTare2,this.body.params={value:e},
new n.CubisRestResponse(this.syncRequest())}setUnit(e,t=!0){this.body.method=A.RestMethodsWEIGHING.setUnit,this.body.params={unitId:e};let a=new n.CubisRestResponse(this.syncRequest());if(a.isSuccess())return!0;if(a.result===d){if(t){let t=new _.MessageHandlerHelper(new o.MessageHandlerProxy),a=new l.ProfileManagementProxy,s=E.QAppBase.clientSingleton.getWeighingProfileId();t.addMessage(_.EMsgHandlerMsgs.ERR_704_UNIT_UNAVAILABLE,[E.QAppBase.clientSingleton.getTaskName()||"",u.getUnitString(e),s?a.getWeighingProfileName(s):""],void 0,[o.createMessageHandlerButton(void 0,void 0,o.MessageHandlerCallTarget.REMOVE_MESSAGE)]),E.QAppBase.clientSingleton.doSuspend()}return!1}return!1}getParameter(e){return this.body.method=A.RestMethodsWEIGHING.getParameter,this.body.params={rObject:{},id:e},new n.CubisRestResponse(this.syncRequest())}getParameterIds(){return this.body.method=A.RestMethodsWEIGHING.getParameterIds,this.body.params={rIds:{}},new n.CubisRestResponse(this.syncRequest())}
setMinUsp(e){return this.body.method=A.RestMethodsWEIGHING.setMinUsp,this.body.params={isEnabled:!0,value:r.QuantityParameter.getValue(e),unit:e.unit},new n.CubisRestResponse(this.syncRequest())}setMinWeight(e){return this.body.method=A.RestMethodsWEIGHING.setMinWeight,this.body.params=Object.assign({},e),new n.CubisRestResponse(this.syncRequest())}setSafetyFactor(e){return this.body.method=A.RestMethodsWEIGHING.setSafetyFactor,this.body.params=Object.assign({},e),new n.CubisRestResponse(this.syncRequest())}getWeighValueMaxDigits(){return this.weighValueMaxDigits}updateWeighValueMaxDigits(e){console.log("Weighing proxy: set new max weight value digit count: "+e),this.weighValueMaxDigits=e}updateMetrologyRanges(e){let t=s.last(e.parameters),a=s.head(e.parameters);if(this.metrologyRanges$.next(e),void 0!==t){
let e=t.parameters.find(e=>"MAXIMUM"===s.last(e.id.split("/"))),a=t.parameters.find(e=>"INTERVAL"===s.last(e.id.split("/"))),i=t.parameters.find(e=>"PRECISION"===s.last(e.id.split("/")));void 0!==e&&this.metrologyMaximum$.next({maxUnit:e.value.unit,maxValue:r.QuantityParameter.getValue(e),maxDecimals:e.value.decimals}),void 0!==a&&this.highestRangeInterval$.next({intervalUnit:a.value.unit,intervalValue:r.QuantityParameter.getValue(a),intervalDecimals:a.value.decimals}),void 0!==i&&this.highestRangePrecision$.next({precisionUnit:i.value.unit,precisionValue:r.QuantityParameter.getValue(i),precisionDecimals:i.value.decimals})}if(void 0!==a){let e=a.parameters.find(e=>"MINIMUM"===s.last(e.id.split("/"))),t=a.parameters.find(e=>"INTERVAL"===s.last(e.id.split("/"))),i=a.parameters.find(e=>"PRECISION"===s.last(e.id.split("/")));void 0!==e&&this.metrologyMinimum$.next({minUnit:e.value.unit,minValue:r.QuantityParameter.getValue(e),minDecimals:e.value.decimals}),
void 0!==t&&this.lowestRangeInterval$.next({intervalUnit:t.value.unit,intervalValue:r.QuantityParameter.getValue(t),intervalDecimals:t.value.decimals}),void 0!==i&&this.lowestRangePrecision$.next({precisionUnit:i.value.unit,precisionValue:r.QuantityParameter.getValue(i),precisionDecimals:i.value.decimals})}}getSelectedDisplayValue(){return this.lastSelectedDisplayValueInfo}restoreLastSelectedDisplayValue(e){void 0!==this.lastSelectedDisplayValueInfo&&(this.lastSelectedDisplayValueInfo.lastSelectedApplicationId=e,this.selectedDisplayValue$.next(this.lastSelectedDisplayValueInfo))}updateLastSelectedDisplayValue(e){try{console.log("WeighingProxy::updateLastSelectedDisplayValue: "+JSON.stringify(e));let t={currentSelectedDomain:e.show,currentSelectedId:e.id,lastSelectedApplicationId:""}
;t.currentSelectedDomain===I.SELECTED_DOMAIN_APP?t.lastSelectedApplicationId=e.id:void 0!==this.lastSelectedDisplayValueInfo&&(t.lastSelectedApplicationId=this.lastSelectedDisplayValueInfo.lastSelectedApplicationId),this.lastSelectedDisplayValueInfo=t,console.log("WeighingProxy::updateLastSelectedDisplayValue: new: "+JSON.stringify(this.lastSelectedDisplayValueInfo)),this.selectedDisplayValue$.next(this.lastSelectedDisplayValueInfo)}finally{}}insertWeightInvalidation(e,t){return this.body.method=A.RestMethodsWEIGHING.insertWeightInvalidation,this.body.params={group:e,topic:t},new n.CubisRestResponse(this.syncRequest())}removeWeightInvalidation(e,t){return this.body.method=A.RestMethodsWEIGHING.removeWeightInvalidation,this.body.params={group:e,topic:t},new n.CubisRestResponse(this.syncRequest())}setAmbientCondition(e){return this.body.method=A.RestMethodsWEIGHING.setAmbientCondition,this.body.params={ambientConditionId:e},new n.CubisRestResponse(this.syncRequest())}}},function(e,t,a){
"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(27),i=a(3),n=a(65),r=a(23),o=a(66),_="_QAPP_MSG_HANDLER_",E="_TITLE",l="_REASON",A="_SOLUTION";var u;function c(e){return e+"_"+s.MESSAGEHANDLER_OK_BTN_ID}!function(e){e.TASKID="TASKID",e.QAPP="QAPP",e.QAPP_DB_ERROR="QAPP_DB_ERROR",e.QAPP_RUNTIME_COMM_ERROR="QAPP_RUNTIME_COMM_ERROR",e.QAPP_RUNTIME_EXIT_ERROR="QAPP_RUNTIME_EXIT_ERROR",e.MANUAL="MANUAL"}(u=t.MESSAGE_HANDLER_SECRET_TYPE||(t.MESSAGE_HANDLER_SECRET_TYPE={})),function(e){e.ERR_702_ACTION_LIMIT="ERR_702",e.ERR_703_ACTION_LIMIT="ERR_703",e.INFO_USERCAL_CAL_OVERALL_PASSED="INFO_USERCAL_CAL_OVERALL_PASSED",e.INFO_USERCAL_ERROR_NO_INVALIDATION="INFO_USERCAL_ERROR_NO_INVALIDATION",e.ERR_704_UNIT_UNAVAILABLE="ERR_704",e.ERR_710_STARLIMS_WARN_LIMIT="ERR_710",e.INFO_STARLIMS_CAL_OVERALL_PASSED="INFO_STARLIMS_CAL_OVERALL_PASSED",e.ERR_711_STARLIMS_WEIGHING_SERIAL="ERR_711",e.ERR_712_STARLIMS_CAL_SERIAL="ERR_712",e.ERR_713_STARLIMS_WEIGHING_PARAM="ERR_713",
e.ERR_714_STARLIMS_CAL_PARAM="ERR_714",e.ERR_715_STARLIMS_ERROR_RESPONSE="ERR_715",e.ERR_716_STARLIMS_NO_CONNECTION="ERR_716",e.ERR_717_STARLIMS_USER_AUTORIZED="ERR_717",e.ERR_718_STARLIMS_NOT_IN_SERVICE="ERR_718",e.ERR_790_GENERIC_DB_ERROR="ERR_790",e.ERR_791_DB_MIGRATION_RUNTIME_ERROR="ERR_791",e.ERR_792_DB_CONN_WORKFLOW_ERROR="ERR_792",e.ERR_793_DB_OPERATION_TIMEOUT_ERROR="ERR_793",e.ERR_794_DB_MIGRATION_UNSUPPORTED_ERROR="ERR_794",e.ERR_795_DB_MIGRATION_FAILED_ERROR="ERR_795",e.ERR_796_DB_CONN_LOST_ERROR="ERR_796",e.ERR_797_DB_CONN_CONFWORKFLOW_ERROR="ERR_797",e.ERR_798_GENERIC_EXTERNAL_COMM_ERROR="ERR_798",e.ERR_799_GENERIC_INTERNAL_ERROR="ERR_799"}(t.EMsgHandlerMsgs||(t.EMsgHandlerMsgs={})),t.getMessageHandlerOkButtonId=c,t.isMessageHandlerOkButton=function(e){return e.endsWith(s.MESSAGEHANDLER_OK_BTN_ID)};const I={ERR_702:{errorCode:702,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.USER_CAL,
lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_EXPLICIT_DELETION,secretType:u.MANUAL},ERR_703:{errorCode:703,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_USERCAL_CAL_OVERALL_PASSED:{errorCode:0,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_USERCAL_ERROR_NO_INVALIDATION:{errorCode:0,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_704:{errorCode:704,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.TASKID},
ERR_710:{errorCode:710,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_STARLIMS_CAL_OVERALL_PASSED:{errorCode:0,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_711:{errorCode:711,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_712:{errorCode:712,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_713:{errorCode:713,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,
lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_714:{errorCode:714,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_715:{errorCode:715,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_716:{errorCode:716,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_717:{errorCode:717,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_718:{errorCode:718,
type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_790:{errorCode:790,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(790))]},ERR_791:{errorCode:791,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(791))]},ERR_792:{errorCode:792,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(792))]},ERR_793:{
errorCode:793,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(793))]},ERR_794:{errorCode:794,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(794))]},ERR_795:{errorCode:795,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(795))]},ERR_796:{errorCode:796,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,
secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(796))]},ERR_797:{errorCode:797,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(c(797))]},ERR_798:{errorCode:798,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_RUNTIME_COMM_ERROR},ERR_799:{errorCode:799,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_RUNTIME_EXIT_ERROR}};t.MessageHandlerHelper=class{constructor(e){this.messageHandlerProxy=e}buildSecret(e){switch(e){case u.TASKID:return r.QAppBase.clientSingleton.getTaskId();case u.QAPP:
return r.QAppBase.clientSingleton.getQAppOrderNumber();case u.QAPP_DB_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_DB_ERROR;case u.QAPP_RUNTIME_COMM_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_RUNTIME_COMM_ERROR;case u.QAPP_RUNTIME_EXIT_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_RUNTIME_EXIT_ERROR;case u.MANUAL:default:return}}addMessage(e,t,a,s){console.log(`messageHandlerHelper::addMessage: ${e}`);let u=i.createEmptyTextStructure(),c=i.createEmptyTextStructure(),T=i.createEmptyTextStructure(),d=0;0===I[e].errorCode?(u.id=_+e+E,c.id=_+e+l,T.id=_+e+A):d=I[e].errorCode;let N=[];for(799!==I[e].errorCode&&798!==I[e].errorCode||N.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),790!==I[e].errorCode&&791!==I[e].errorCode&&792!==I[e].errorCode&&793!==I[e].errorCode&&794!==I[e].errorCode&&795!==I[e].errorCode&&796!==I[e].errorCode&&797!==I[e].errorCode||(N.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),
N.push(r.QAppBase.clientSingleton.getQAppVersion())),void 0!==t&&("string"==typeof t?(N.push("Error"),N.push(t)):n.isError(t)?o.isHttpRestError(t)?(N.push(`${t.name} (HTTP(s)/${t.statusCode})`),N.push(t.message)):(N.push(t.name),N.push(t.message)):N.push(...t));N.length<4;)N.push("");c.args=N;let p=this.buildSecret(I[e].secretType);return void 0!==p&&(a=p),console.log(`messageHandlerHelper::addMessage: add msg handler msg ${d} with secret ${a}`),this.messageHandlerProxy.addMessage(d,I[e].type,I[e].category,I[e].lifetime,u,c,T,a||"",s||(I[e].buttons?I[e].buttons:void 0),I[e].showMessageInFutureSeconds?I[e].showMessageInFutureSeconds:void 0)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(69),i=a(39),n=a(2),r=a(6),o=a(13),_=a(0),E=a(38),l=a(70),A=a(37),u=a(5),c=a(22);function I(e){return o.isNumber(e)&&(e=e.toFixed(0)),t.DYNAMIC_PARAMID_PREQUEL+"CONFIG_SCREEN"+e}function T(e,t){o.isString(t)||(t="_"),t=t,!1!==o.isString(e)&&0!==e.length||(e=t)
;let a=new RegExp(/[^0-9A-Za-z._-]+/g),s=new RegExp(/[\/\?<>\\:\*\|"]/g),i=new RegExp(/[\x00-\x1f\x80-\x9f]/g),n=new RegExp(/^\.+$/),r=new RegExp(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i),_=new RegExp(/[\. ]+$/);return(e=(e=(e=(e=(e=(e=e.replace(a,t)).replace(s,t)).replace(i,t)).replace(n,t)).replace(r,t)).replace(_,t)).length>255&&(e=e.substring(0,255)),e}function d(e){if(t.fs.existsSync(e))if(t.fs.lstatSync(e).isDirectory()){let s=t.fs.readdirSync(e,{encoding:"utf8",withFileTypes:!1});for(var a=0;a<s.length;a++)d(t.path.join(e,s[a]));t.fs.rmdirSync(e)}else t.fs.unlinkSync(e)}var N;function p(e){let t={title:"",header:"",value:"",automaticManipulation:N.NONE};return o.isObject(e)&&(t=Object.assign(t,e)),t}function S(e,t,a){let s={method:t,params:a},i=JSON.stringify(s),n=["http://127.0.0.1:8080/rest/"+e,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"],o=E.spawnSync("curl",n,{input:i}),_=new r.CubisRestResponse(!1);try{
_=new r.CubisRestResponse(o)}catch(e){_.rawReturns=e}return _}function m(e,t,a){return s.__awaiter(this,void 0,void 0,function*(){let s=A;return"https"===e&&(s=l),new Promise(function(e,i){let n=s.request(t,function(t){let a=[];t.on("data",function(e){a.push(e)}),t.on("end",function(){try{e({headers:t.headers,url:t.url,statusCode:t.statusCode,body:Buffer.concat(a)})}catch(e){i(e)}})});n.on("error",function(e){i(e)}),n.on("timeout",function(){n.abort(),i("Request timeout")}),a&&n.write(a),n.end()})})}function R(e){let t={unit:c.EnumUnit.NONE,decimals:0,d:0,e:0,max:0,min:0,extended:{d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()},ranges:{1:{d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()}},activeRangeIndex:"1"};return o.isObject(e)&&o.overwriteExistingAttributes(e,t),t}t.fs=a(16),t.path=a(43),t.DYNAMIC_PARAMID_PREQUEL="TASK/DYNAMIC_",t.sortKeys=function(e){if(!1===o.isObject(e))return[];let t=[]
;t=Array.isArray(e)?e:Object.keys(e);let a=[],s=[],i=[];for(let e=0;e<t.length;e++)o.isNumber(Number(t[e]))?a.push(t[e]):o.isString(t[e])?s.push(t[e]):i.push(t[e]);return s=s.sort(),i=i.sort(),(a=(a=a.sort(function(e,t){return Number(e)-Number(t)})).concat(s)).concat(i)},t.determineNearestNumberInArray=function(e,t){for(let a=0;a<t.length;a++)if(e<t[a])return a<=0?a:e<=t[a]-(t[a]-t[a-1])/2?a-1:a;return t.length-1},t.loadWorkstate_DATA_CONTAINER=function(e){let t=void 0;if(!o.isString(e))return t;let a=S("task/management",u.RestMethodsTASK_MANAGEMENT.getWorkstate,{id:e,workstate:{}});try{t=(t=JSON.parse(a.rawReturns.workstate).workstate).DATA_CONTAINER}catch(e){t=void 0}return t},t.storeWorkstate_DATA_CONTAINER=function(e,t){if(!o.isString(e))return new r.CubisRestResponse(!1);let a={DATA_CONTAINER:t};return S("task/management",u.RestMethodsTASK_MANAGEMENT.saveWorkstate,{id:e,workstate:a})},t.loadTaskConfig_DATA_CONTAINER=function(e){let a=e.getGroup(I(54321));if(void 0===a)return
;let s=[],i=I(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_";for(let e=0;e<a.parameters.length;e++)if(a.parameters[e].type===_.EnumParameterTypes.PARAM_STRING&&a.parameters[e].id.startsWith(i)){let t=parseInt(a.parameters[e].id.substring(i.length));o.isNumber(t)&&(s[t]=a.parameters[e].value.string)}try{return JSON.parse(s.join())}catch(e){return}},t.storeTaskConfig_DATA_CONTAINER=function(e,a,s){let i=e.getGroup(I(54321));if(s=!!o.isBoolean(s)&&s,void 0===i&&(e.addDynamicGroup({id:I(54321),type:_.EnumParameterTypes.PARAM_GROUP,appearance:_.EnumAppearance.HIDDEN,title:{id:"",args:[]},parameters:[]}),i=e.getGroup(I(54321))),void 0===i)return new r.CubisRestResponse(!1);i.parameters=[];let n=JSON.stringify(a),E=0,l=0;for(;E<n.length;){(l=E+1e5)>n.length&&(l=n.length);let a={id:I(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_"+i.parameters.length.toFixed(0),type:_.EnumParameterTypes.PARAM_STRING,appearance:_.EnumAppearance.HIDDEN,title:{id:"",args:[]},header:{id:"",args:[]},
value:{string:n.substring(E,l)},info:{minimum:{length:0},maximum:{length:1e5}}};E=l,i.parameters.push(a),e.updateParameter(a)}return!1===s?S("task/management",u.RestMethodsTASK_MANAGEMENT.updateTask,{task:JSON.stringify(e.getTask()),errorList:[]}):new r.CubisRestResponse(!0)},t.get_taskConfig_paramGroupID=I,t.getCompliantFilename=T,t.checkFileNameCompliancy=function(e,t){if(T(e)!==e)return!1;t=void 0!==t?t:[];for(let a=0;a<t.length;a++)if(e.includes(t[a]))return!1;return!0},t.getCreateTaskSpecificFolder=function(e,a){let s="",n=e.getTask(),r=e.getParameter("TASK/IDENTIFICATION/NAME"),o=t.fs.readdirSync(a,{encoding:"utf8",withFileTypes:!1}),_=new i.TaskProxy,E=[];try{E=_.getTaskNamesByOrderNumber(n.qappOrderNumber)}catch(e){}for(var l=0;l<o.length;l++)if(o[l].toString().startsWith("_RENAME_TASK_ID_")&&o[l].toString().endsWith(".json")){var A=t.fs.readFileSync(t.path.join(a,o[l]),"utf8")
;(u=JSON.parse(A))&&u.taskname&&u.foldername&&!E.includes(u.taskname)&&(d(t.path.join(a,u.foldername)),d(t.path.join(a,o[l])))}else if(o[l].toString().startsWith("_TASK_"))try{_.readTask(o[l].toString().substring("_TASK_".length))}catch(e){d(t.path.join(a,o[l]))}if(null==n._id||""==n._id){let e=Date.now(),i={taskname:r.value.string,foldername:"_RENAME_TASK_ID_"+e};t.fs.writeFileSync(t.path.join(a,"_RENAME_TASK_ID_"+e+".json"),JSON.stringify(i)),s=t.path.join(a,"_RENAME_TASK_ID_"+e)}else for(s=t.path.join(a,"_TASK_"+n._id),l=0;l<o.length;l++)if(o[l].toString().startsWith("_RENAME_TASK_ID_")&&o[l].toString().endsWith(".json")){var u;A=t.fs.readFileSync(t.path.join(a,o[l]),"utf8"),(u=JSON.parse(A))&&u.taskname&&u.foldername&&u.taskname==r.value.string&&(t.fs.existsSync(t.path.join(a,u.foldername))?t.fs.existsSync(s)?(d(t.path.join(a,u.foldername)),d(t.path.join(a,o[l]))):(t.fs.renameSync(t.path.join(a,u.foldername),s),d(t.path.join(a,o[l]))):d(t.path.join(a,o[l])))}
return t.fs.existsSync(s)||t.fs.mkdirSync(s),s},t.deleteFileFolderRecursive=d,t.createFolder=function(e){t.fs.existsSync(e)||t.fs.mkdirSync(e)},function(e){e.NONE="NONE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT"}(N=t.EnumIdentifierAutoManipulation||(t.EnumIdentifierAutoManipulation={})),t.EnumMapIdentifierAutoManipulation={[N.NONE]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON",[N.INCREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_INC",[N.DECREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_DEC"},t.getLotIDsParameterID=function(e){o.isNumber(e)||(e=1),e=e;const a=I("_RESERVED_LOT_ID_SETTINGS");return{paramGroupID:a,settingsLockedInfo:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_settingsLocked",mainCounter:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_counter",header:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_header",title:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_title"}},t.getSampleIDsParameterID=function(e){o.isNumber(e)||(e=1),
e=e;const a=I("_RESERVED_SAMPLE_ID_SETTINGS");return{paramGroupID:a,settingsLockedInfo:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_settingsLocked",mainCounter:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_counter",header:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_header",title:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_title",manipulator:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_manipulator"}},t.createStandardIdentifier=p,t.preManipulateIdentifier=function(e){let t=p();void 0!==e&&(t=n.cloneJSON(e));let a=void 0,s=0;const i=/\d*$/,r=t.value.match(i);switch(null!=r&&r.length>0&&o.isString(r[0])&&(s=r[0].length,a=parseInt(r[0])),t.automaticManipulation){case N.INCREMENT:""===t.value?t.value="001":""===t.value||o.isNumber(a)?""!==t.value&&o.isNumber(a)&&(a++,t.value=t.value.replace(i,a.toFixed(0).padStart(s,"0"))):t.value+="-2";break;case N.DECREMENT:""!==t.value&&o.isNumber(a)&&a>0&&(a--,
t.value=t.value.replace(i,a.toFixed(0).padStart(s,"0")))}return t},t.perform_InternalWebserviceRequest=S,t.perform_WebserviceRequest=function(e,t,a,i,n,r,_,E,u,c,I){return s.__awaiter(this,void 0,void 0,function*(){o.isNumber(t)||(t="http"===a?80:443),o.isNumber(I)||(I=1e4);let s,T={hostname:e,port:t,path:n,method:i,followRedirects:!1,headers:r,timeout:I};u&&c&&(T.auth=u+":"+c),T.agent="https"===a?new l.Agent({host:e,keepAlive:!0,rejectUnauthorized:!1,port:t}):new A.Agent({keepAlive:!0}),_&&void 0!==_&&(E=JSON.stringify(_)),E&&(T.headers["content-length"]=Buffer.byteLength(E));try{s=yield m(a,T,E).then(e=>({isSuccess:!0,error:"",statusCode:e.statusCode,headers:e.headers,body:e.body,url:e.url,metadata:n}))}catch(e){return{isSuccess:!1,error:e?e.toString():"",statusCode:0,headers:{},body:void 0,url:T.hostname+T.path,metadata:n}}return s})},t.httpRequest=m,t.getConfiguredPrintProfiles=function(){let e=[];const t=S("profilemanagement",u.RestMethodsPROFILE_MANAGEMENT.getProfiles,{
filter:'[{"type":{"ne":"WEIGHING_PROFILE_NAME"}}]',rProfiles:{}});if(t.isSuccess()&&o.isString(t.rawReturns.rProfiles)){const a=JSON.parse(t.rawReturns.rProfiles.toString());for(let t=0;t<a.data.length;t++){const s=o.getObjectByID(a.data[t].params,"PROFILE/IDENTIFICATION","id");if(o.isObject(s)&&o.isObject(s.parameters)){const i=o.getObjectByID(s.parameters,"PROFILE/IDENTIFICATION/NAME","id");o.isObject(i)&&o.isObject(i.value)&&e.push({id:a.data[t]._id,type:a.data[t].type,title:i.value.string})}}}return e},t.createMetrology=R,t.getMetrology=function(e){let t=R(),a=S("weighing",u.RestMethodsWEIGHING.getParameter,{id:"WEIGHING/METROLOGY/RANGE",rObject:{}}),s="";if(a.isSuccess()&&a.hasOwnProperty("rawReturns")&&a.rawReturns.hasOwnProperty("rObject")&&(a=JSON.parse(a.rawReturns.rObject))&&a.hasOwnProperty("id")&&a.hasOwnProperty("parameters")){let e=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGE/MAXIMUM");e&&(s=e.value.numbers[0])}
const i=S("weighing",u.RestMethodsWEIGHING.getRangeParameters,{parameters:{}});if(!(i.isSuccess()&&i.hasOwnProperty("rawReturns")&&i.rawReturns.hasOwnProperty("parameters")))return t;const n=JSON.parse(i.rawReturns.parameters);if(!(n.hasOwnProperty("list")&&Array.isArray(n.list)&&n.list.length>0))return t;const r=o.getObjectByID(n.list,"WEIGHING/METROLOGY/RANGES");if(!o.isObject(r))return t;t.ranges={};for(let a of Object.values(r.parameters)){if(!o.isString(a.id)||!o.isObject(a.parameters))continue;let i="";const n=a.id.split("/");if(0===(i=n[n.length-1]).length)continue;const r={d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()};let _=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/INTERVAL");_&&(r.d.value=parseFloat(_.value.numbers[0]),r.d.decimals=_.value.decimals,r.d.unit=c.getUnitEnum(_.value.unit.toString())),
(_=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/PRECISION"))&&(r.e.value=parseFloat(_.value.numbers[0]),r.e.decimals=_.value.decimals,r.e.unit=c.getUnitEnum(_.value.unit.toString())),(_=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/MINIMUM"))&&(r.min.value=parseFloat(_.value.numbers[0]),r.min.decimals=_.value.decimals,r.min.unit=c.getUnitEnum(_.value.unit.toString())),(_=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/MAXIMUM"))&&(r.max.value=parseFloat(_.value.numbers[0]),r.max.decimals=_.value.decimals,r.max.unit=c.getUnitEnum(_.value.unit.toString()),s===_.value.numbers[0]&&(t.activeRangeIndex=i)),void 0===e&&(e=r.d.unit),r.d=c.convertToTargetUnit(r.d,e),r.e=c.convertToTargetUnit(r.e,e),r.e.decimals=r.d.decimals,r.min=c.convertToTargetUnit(r.min,e),r.min.decimals=r.d.decimals,r.max=c.convertToTargetUnit(r.max,e),r.max.decimals=r.d.decimals,t.ranges[i]=r}t.extended.d.value=1/0,t.extended.e.value=1/0,t.extended.min.value=1/0,
t.extended.max.value=-1/0;for(let e of Object.values(t.ranges))e.d.value<t.extended.d.value&&(t.extended.d=e.d),e.e.value<t.extended.e.value&&(t.extended.e=e.e),e.min.value<t.extended.min.value&&(t.extended.min=e.min),e.max.value>t.extended.max.value&&(t.extended.max=e.max);return t.unit=t.extended.d.unit,t.decimals=t.extended.d.decimals,t.d=t.extended.d.value,t.e=t.extended.e.value,t.min=t.extended.min.value,t.max=t.extended.max.value,t},t.get_device_roles=function(){let e=S("user",u.RestMethodsUSER_MANAGEMENT.getListRoles,{list:{},start:0,end:-1}),t=[];try{let a=JSON.parse(e.rawReturns.list).data;for(let e=0;e<a.length;e++)t.push({id:a[e]._id,name:o.getObjectByID(a[e].params,"ROLE/NAME").value.string,editable:a[e].editable,locked:a[e].locked})}catch(e){}return t},t.get_device_user=function(){let e={id:"",name:"",display_name:"",description:"",role_id:"",role_name:""},t=S("access",u.RestMethodsACCESS_MANAGEMENT.getCurrentUser,{user:""});try{let a=JSON.parse(t.rawReturns.user)
;e.id=a._id;let s=o.getObjectByID(a.params,"USER/SETTINGS");e.name=o.getObjectByID(s.parameters,"USER/SETTINGS/LOGINNAME").value.string,e.display_name=o.getObjectByID(s.parameters,"USER/SETTINGS/NAME").value.string,e.description=o.getObjectByID(s.parameters,"USER/SETTINGS/DESCRIPTION").value.string,e.role_id=o.getObjectByID(s.parameters,"USER/SETTINGS/ROLES").value.selection.id,e.role_name=o.getObjectByID(s.parameters,"USER/SETTINGS/ROLES").value.selection.text.id}catch(e){}return e},t.EnumMapUnit=null,t.harmonizeWeightParam=function(e){},t.tryAssign_taskParameter_to_IQuantity=function(e,t,a){},t.tryAssign_IQuantity_to_taskParameter=function(e,t,a){}},function(e,t){e.exports=require("path")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTime=function(){return Math.trunc(Date.now()/1e3)}},,function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=a(58);t.STATE_UNINITIALIZED_INTERNAL="STATE_UNINITIALIZED_INTERNAL",
t.createFsm=function(e){return new s.BehavioralFsm({namespace:"_qappStm_",states:{STATE_UNINITIALIZED_INTERNAL:{_onEnter:function(e){console.log("FSM: enter STATE_UNINITIALIZED_INTERNAL state")},_onExit:function(e){console.log("FSM: exit STATE_UNINITIALIZED_INTERNAL state")},_transTo:{},_transFom:{},_START_FSM_:function(e,t){this.transition(e,t)},"*":function(e){this.deferUntilTransition(e)}}},initialize:function(t){Object.assign(t.states,t.states,e)},initialState:t.STATE_UNINITIALIZED_INTERNAL,myHandler:function(e,t,a){let s;t.some(function(t){return s=t.nextState,t.guardFn(e,a)})&&s&&this.transition(e,s)}})}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(32),n=a(2),r=a(42);class o{constructor(e){this.task=e||void 0}splitParamId(e){let t=e.split("/");return t.length>1&&(t[0]=`${t[0]}/${t[1]}`,t.splice(1,1)),t}setTask(e){this.task=e}getTaskGroupsAndParameters(){return this.task?this.task.params:[]}getTask(){return this.task}
updateGroup(e){if(!this.task)return!1;return!!this.task.params.some((t,a)=>!!this.task&&(t.id===e.id&&(this.task.params[a]=e,!0)))&&(console.log(`Group ${e.id} updated!`),!0)}updateParameter(e){let t=this.splitParamId(e.id)[0];return!!this.task&&(!!this.task.params.some((a,s)=>{if(a.id===t)return a.parameters.some((t,a)=>!(t.id!==e.id||!this.task)&&(this.task.params[s].parameters[a]=e,!0))})&&(console.log(`Parameter ${e.id} updated!`),!0))}getGroup(e){let t;if(this.task)return(t=this.task.params.find(t=>t.id===e))||void console.log(`Group ${e} not found!`)}getParameter(e){let t,a=this.splitParamId(e)[0];if(this.task)return this.task.params.find(s=>s.id===a&&(t=s.parameters.find(t=>t.id===e),!0)),t||void console.log(`Parameter ${e} not found!`)}addDynamicGroup(e){if(!this.task)return!1;if(!e.id.startsWith(r.DYNAMIC_PARAMID_PREQUEL))return console.log(`GroupId does not start with '${r.DYNAMIC_PARAMID_PREQUEL}'`),!1
;if(e.id.includes("/",r.DYNAMIC_PARAMID_PREQUEL.length))return console.log('No additional "/" allowed in the name of a dynamic group!',e.id),!1;if(this.task.params.some(t=>t.id===e.id))return console.log("The DynamicGroup already exists!",e.id),!1;e.parameters.forEach(t=>{t.id.startsWith(e.id)||(console.log(`parameterId starts with parameterName only. Extend parameterId with own groupId '${e.id}'.`),t.id=e.id+"/"+t.id)});let t=!1;for(let a=0;a<this.task.params.length;a++)if(this.task.params[a].id.startsWith(i.TASK_DYNAMIC_ID_GROUPS_PREFIX)||!this.task.params[a].id.startsWith(r.DYNAMIC_PARAMID_PREQUEL)){this.task.params.splice(a,0,e),t=!0;break}return t||this.task.params.push(e),!0}addDynamicParameter(e){let t="";if(this.getParameter(e.id))return this.updateParameter(e),!0;{t=this.splitParamId(e.id)[0];let a=this.getGroup(t);if(a)return a.parameters.push(e),!0}return!1}addDynamicParameterToFront(e){let t="";if(this.getParameter(e.id))return this.updateParameter(e),!0;{
t=this.splitParamId(e.id)[0];let a=this.getGroup(t);if(a)return a.parameters.unshift(e),!0}return!1}addDynamicParameterInFrontOf(e,t){let a=this.splitParamId(e.id)[0],s=this.splitParamId(t)[0];if(a===s){let s=this.getGroup(a);if(void 0!==s){let a=s.parameters.findIndex(e=>e.id===t);if(-1!==a)return s.parameters.splice(a,0,e),!0}}return console.log("addDynamicParameterInFrontOf - groups of new and existing parameter do not match: "+a+" vs. "+s),!1}static sortGroup(e){let t=e.parameters.map(function(e,t){return{idx:t,data:e}});t.sort((e,t)=>{if((void 0===e.data.fixed||!0===e.data.fixed)>(void 0===t.data.fixed||!0===t.data.fixed))return 1;if((void 0===e.data.fixed||!0===e.data.fixed)<(void 0===t.data.fixed||!0===t.data.fixed))return-1;if(!(void 0!==e.data.fixed&&!0!==e.data.fixed||void 0!==t.data.fixed&&!0!==t.data.fixed)){
if((e.data.appearance===s.EnumAppearance.ENABLED||e.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG)<(t.data.appearance===s.EnumAppearance.ENABLED||t.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG))return 1;if((e.data.appearance===s.EnumAppearance.ENABLED||e.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG)>(t.data.appearance===s.EnumAppearance.ENABLED||t.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG))return-1}return e.idx-t.idx}),e.parameters=t.map(function(e){return e.data})}getFilteredTask(){let e,t;return this.task&&((t=(e=n.cloneJSON(this.task)).params.filter(e=>e.id.startsWith(r.DYNAMIC_PARAMID_PREQUEL))).forEach(e=>{e.id.startsWith(i.TASK_DYNAMIC_ID_GROUPS_PREFIX)?e.parameters.forEach((e,t)=>{e.appearance=s.EnumAppearance.HIDDEN}):(e.parameters.forEach((e,t)=>{void 0!==e.fixed&&!0!==e.fixed||e.appearance===s.EnumAppearance.HIDDEN||(e.appearance=s.EnumAppearance.DISABLED)}),o.sortGroup(e),e.parameters.forEach((e,t)=>{void 0!==e.fixed&&delete e.fixed
}))}),e.params=t),e}}t.TaskHandler=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(0),n=a(11),r=a(4),o=a(10),_=a(1);t.MESSAGEBOX_ID="MESSAGEBOX";class E{constructor(e){this.appearance=i.EnumAppearance.HIDDEN,this.lastPublishedTabContent={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.events$=new o.Subject,this.mqttHandler=e,this.buttonList=[]}setMessageBoxData(e,t=!0){this.setBackgroundColor(e.backgroundColor,!1),this.setIconColor(e.iconColor,!1),this.setType(e.type,!1),this.setTitle(e.title,!1),this.setTextsList(e.textList,!1),this.createButtons(e.buttons.map(e=>({buttonId:e.id,label:e.label,appearance:e.appearance}))),this.publish(t)}createButtons(e){
this.buttonList.splice(0,this.buttonList.length),this.messageBoxObject.buttons.splice(0,this.messageBoxObject.buttons.length),console.log("MessageBox: createButtons buttonlist cleared: "+this.buttonList.length),console.log("MessageBox: createButtons buttonlist json cleared: "+this.messageBoxObject.buttons.length);for(let t of e)if(void 0===this.getButton(t.buttonId)){let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),this.messageBoxObject.buttons.push(e.getJson())}else console.error("MessageBox: Duplicate Button: "+t.buttonId);console.log("MessageBox: createButtons number of buttons: "+this.buttonList.length),console.log("MessageBox: createButtons json result: "+JSON.stringify(this.messageBoxObject))}removeButtons(e){console.log("MessageBox: removeButtons ");for(let t of e){for(let e=0;e<this.buttonList.length;e++)this.buttonList[e].getButtonId()===t&&(console.log("MessageBox: splice for index: "+e),this.buttonList.splice(e,1),
console.log("MessageBox: Buttonlist buttons left: "+this.buttonList.length),e=0);console.log("MessageBox: Clearing json buttons");for(let e=0;e<this.messageBoxObject.buttons.length;e++){let a=this.messageBoxObject.buttons[e];if(console.log("MessageBox: buttonId "+a.effect.params.buttonId),a.effect.params.buttonId===t){let t=this.messageBoxObject.buttons.splice(e,1);console.log("MessageBox: Removed JSON Button: "+t[0]),console.log("MessageBox: ButtonJSON buttons left: "+this.messageBoxObject.buttons.length),e=0}}}console.log("MessageBox: Messagebox json: "+JSON.stringify(this.messageBoxObject))}publish(e=!0){let t=JSON.stringify(this.messageBoxObject),a=JSON.stringify(this.lastPublishedTabContent);e&&(t!==a&&this.messageBoxObject.appearance===i.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===i.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===i.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(_.MqttTopics.HMI_MESSAGEBOX,t),
this.lastPublishedTabContent=JSON.parse(t))}getButtonByTopic(e){for(let t of this.buttonList){if(t.getTopic().substring(t.getTopic().lastIndexOf("/")+1)===e)return t}}getButton(e){for(let t of this.buttonList)if(t.getButtonId()===e)return t}setAppearance(e,t=!0){"HIDDEN"!==e&&"ENABLED"!==e||(this.appearance=e,this.messageBoxObject.appearance=e,this.publish(t))}getAppearance(){return this.appearance}setBackgroundColor(e,t=!0){this.messageBoxObject.backgroundColor=e,this.publish(t)}getBackgroundColor(){return this.messageBoxObject.backgroundColor}setIconColor(e,t=!0){this.messageBoxObject.iconColor=e,this.publish(t)}getIconColor(){return this.messageBoxObject.iconColor}setType(e,t=!0){this.messageBoxObject.type=e,this.publish(t)}getType(){return this.messageBoxObject.type}setTitle(e,t=!0){this.messageBoxObject.title=e,this.publish(t)}getTitle(){return this.messageBoxObject.title}setTextsList(e,t=!0){this.messageBoxObject.textsList=e,this.publish(t)}getTextsList(){
return this.messageBoxObject.textsList}getText(){return this.messageBoxObject.textsList[0]}getId(){return t.MESSAGEBOX_ID}hide(){this.appearance===i.EnumAppearance.ENABLED&&(this.setAppearance(i.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_MESSAGEBOX,id:this.getId()}))}show(){this.appearance===i.EnumAppearance.HIDDEN&&(this.setAppearance(i.EnumAppearance.ENABLED),this.events$.next({type:r.ScreenEventType.SHOW_MESSAGEBOX,id:this.getId()}))}}t.MessageBox=E,t.default=E},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(50),n=a(0),r=a(4),o=a(24),_=a(1);t.WEIGHING_SCREEN_ID="WEIGHING",t.CANCEL_BARBUTTON_ID="BTN_BAR_CANCEL";const E={buttonId:"BARBUTTON/CANCEL",label:{id:"",args:[]},appearance:n.EnumAppearance.HIDDEN};t.WeighingScreen=class extends r.AbstractScreen{constructor(e,t){super(e),this.buttonList=[],this.text1={value:"",wildcards:[]},this.text2={value:"",wildcards:[]},this.param1="",this.param2="",
this.title=void 0,this.createBarButtons(t),this.publishBarButtons(),this.checkBarGraph=new i.CheckBarGraph(e),this.cancelBarButton=new s.default(this.mqttHandler,this,E)}getId(){return t.WEIGHING_SCREEN_ID}getBarButtonId(){return _.MqttTopics.HMI_WEIGHING_SCREEN_BARBUTTONS}createBarButtons(e){e.sort(this.compareButtonBarButtons);for(let t of e){let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),e.publish()}}publishBarButtons(){let e=[];for(let t of this.buttonList)e.push(_.MqttTopics.QAPP_NAMESPACE+"/"+t.getTopic());this.mqttHandler.publish(this.getBarButtonId(),JSON.stringify(e))}setText1(e,t){let a=!1;this.text1.value!==e&&(this.text1.value=e,a=!0),t&&this.text1.wildcards.join()!==t.join()&&(this.text1.wildcards=t,a=!0),a&&this.publishText1()}compareButtonBarButtons(e,t){return o.getButtonPriority(e.buttonId)-o.getButtonPriority(t.buttonId)}publishText1(){this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION1,JSON.stringify(this.text1),{retain:!0})}
publishText2(){this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION2,JSON.stringify(this.text2),{retain:!0})}setText2(e,t){let a=!1;this.text2.value!==e&&(this.text2.value=e,a=!0),t&&this.text2.wildcards.join()!==t.join()&&(this.text2.wildcards=t,a=!0),a&&this.publishText2()}publishTitle(){this.title?this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_TITLE,JSON.stringify(this.title),{retain:!0}):this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_TITLE,"",{retain:!0})}setTitle(e){let t=void 0;this.title&&(t=JSON.stringify(this.title)),this.title=e,this.title!==t&&this.publishTitle()}getText1(){return this.text1}getText2(){return this.text2}publishParam1(){this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_PARAM1_TOPIC,JSON.stringify(this.param1),{retain:!0})}publishParam2(){this.mqttHandler.publish(_.MqttTopics.HMI_WEIGHING_SCREEN_PARAM2_TOPIC,JSON.stringify(this.param2),{retain:!0})}setParam1(e){this.param1!==e&&(this.param1=e,this.publishParam1())
}setParam2(e){this.param2!==e&&(this.param2=e,this.publishParam2())}getParam1(){return this.param1}getParam2(){return this.param2}getButton(e){if(e===t.CANCEL_BARBUTTON_ID)return this.cancelBarButton;for(let t of this.buttonList)if(t.getButtonId()===e)return t}show(){this.publishText1(),this.publishText2(),this.publishTitle(),this.publishParam1(),this.publishParam2();for(let e of this.buttonList)e.publish();super.show()}getCheckBarGraph(){return this.checkBarGraph}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(72),n=a(1),r=1;t.CheckBarGraph=class{constructor(e){this.barGraphStatusObject={appearance:s.EnumAppearance.HIDDEN,areas:i.EnumAreaCount.FOUR_AREAS},this.barGraphValueObject={area:1,perc:0},this.mqttHandler=e}publishValue(){this.mqttHandler.publish(n.MqttTopics.HMI_CHECKBARGRAPH_VALUE,JSON.stringify(this.barGraphValueObject))}publishStatus(){
this.mqttHandler.publish(n.MqttTopics.HMI_CHECKBARGRAPH_STATUS,JSON.stringify(this.barGraphStatusObject))}setAppearance(e,t=!0){this.barGraphStatusObject.appearance!==e&&(e!==s.EnumAppearance.ENABLED&&e!==s.EnumAppearance.HIDDEN||(this.barGraphStatusObject.appearance=e,t&&(this.publishStatus(),this.publishValue())))}getAppearance(){return this.barGraphStatusObject.appearance}setAreas(e,t=!0){this.barGraphStatusObject.areas!==e&&(e!==i.EnumAreaCount.FOUR_AREAS&&e!==i.EnumAreaCount.SIX_AREAS||(this.barGraphStatusObject.areas=e,t&&this.publishStatus()))}getAreas(){return this.barGraphStatusObject.areas}setAreaPerc(e,t=!0){this.barGraphValueObject.area===e.area&&this.barGraphValueObject.perc===e.perc||e.area>=r&&e.area<=(this.barGraphStatusObject.areas===i.EnumAreaCount.FOUR_AREAS?4:6)&&(this.barGraphValueObject=e,t&&this.publishValue())}calc4AreaPerc(e,t,a,s,i,n=!0){let r=1,o=0;return e>0&&(0<e&&e<t?(r=1,o=e/t*100):t<=e&&e<=i?(r=2,o=(e-t)/(i-t)*100):i<e&&e<=a?(r=3,
o=(e-i)/(a-i)*100):a<e&&e<=s&&(r=4,o=(e-a)/(s-a)*100)),n&&this.setAreaPerc({area:r,perc:o}),{area:r,perc:o}}calc6AreaPerc(e,t,a,s,i,n,r,o=!0){let _=1,E=0;return e>0&&(0<e&&e<t?(_=1,E=e/t*100):t<=e&&e<a?(_=2,E=(e-t)/(a-t)*100):a<=e&&e<=r?(_=3,E=(e-a)/(r-a)*100):r<e&&e<=s?(_=4,E=(e-r)/(s-r)*100):s<e&&e<=i?(_=5,E=(e-s)/(i-s)*100):i<e&&e<=n&&(_=6,E=(e-i)/(n-i)*100)),this.setAreaPerc({area:_,perc:E},o),{area:_,perc:E}}}},,function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(53),n=a(19),r=a(12),o=a(20),_=a(54),E=a(26),l=a(35),A=a(13),u=a(25);t.CFG_PARAMS_ASPECT="CFG_PARAMS_ASPECT",t.STATE_ASPECT_CFG_PARAM_EDIT_ENTER="STATE_ASPECT_CFG_PARAM_EDIT_ENTER",t.STATE_ASPECT_CFG_PARAM_EDIT_REENTER="STATE_ASPECT_CFG_PARAM_EDIT_REENTER";const c="STATE_ASPECT_CFG_PARAM_EDIT",I="STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION",T="STATE_ASPECT_CFG_PARAM_INSPECT",d="TASK_HANDLER_NO_PARAMETERS";t.ConfigParamsAspect=class extends o.AbstractQAppAspect{constructor(){
super(...arguments),this.states={STATE_ASPECT_CFG_PARAM_EDIT_ENTER:{_onEnter:function(e){e.aspects[t.CFG_PARAMS_ASPECT].parametersEmpty()?e.addToEventQueue(new r.ImmediateEvent(d)):e.addToEventQueue(new r.ImmediateEvent(c))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload===c&&this.transition(e,c),a.payload===d&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState)},"*":function(e){this.deferUntilTransition(e)}},STATE_ASPECT_CFG_PARAM_EDIT_REENTER:{_onEnter:function(e){e.aspects[t.CFG_PARAMS_ASPECT].parametersEmpty()?e.addToEventQueue(new r.ImmediateEvent(d)):e.addToEventQueue(new r.ImmediateEvent(c))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload===c&&this.transition(e,c),a.payload===d&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState)},"*":function(e){this.deferUntilTransition(e)}},STATE_ASPECT_CFG_PARAM_EDIT:{_onEnter:function(e){
let a=e.screens[i.PARAM_LIST_SCREENID].getButton(i.FINISH_BUTTON_ID);if(void 0!==a){let i=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();a.setAppearance(i?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}},_onExit:function(e){},_transTo:{},_transFrom:{STATE_ASPECT_CFG_PARAM_EDIT_ENTER:function(e,a){let n=e.screens[i.PARAM_LIST_SCREENID];n.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),n.setShowLastVisibleCategory(!1);let r=n.getButton(i.FINISH_BUTTON_ID);if(void 0!==r){let a=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();r.setAppearance(a?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}n.show()},STATE_ASPECT_CFG_PARAM_EDIT_REENTER:function(e,a){let n=e.screens[i.PARAM_LIST_SCREENID];n.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),n.setShowLastVisibleCategory(!0);let r=n.getButton(i.FINISH_BUTTON_ID);if(void 0!==r){let a=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn()
;r.setAppearance(a?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}n.show()}},EV_HMI_BTN_CLICKED:function(e,a){if(a.payload.buttonId===i.FINISH_BUTTON_ID&&e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn()&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState),a.payload.buttonId===u.CANCEL_BUTTON_ID){const a=e.aspects[t.CFG_PARAMS_ASPECT].cfg.cancelState;A.isString(a)?this.transition(e,a):e.suspend()}},EV_HMI_PARAM_CHANGED:function(e,a){let s=e.aspects[t.CFG_PARAMS_ASPECT].updateTaskParameterGeneric(a.payload.parameter),i=[{guardFn:function(e,t){return void 0===s},nextState:""},{guardFn:function(e,t){return void 0!==s},nextState:I}];this.myHandler(e,i,a)},EV_HMI_PARAM_DETAIL:function(e,a){e.aspects[t.CFG_PARAMS_ASPECT].inspectTaskParameter(a.payload.parameter),this.transition(e,T)}},STATE_ASPECT_CFG_PARAM_INSPECT:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){
t.payload.buttonId===u.CANCEL_BUTTON_ID&&this.transition(e,c)}},STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,a){if(a.payload.buttonId===u.CANCEL_BUTTON_ID)e.suspend();else{let s=e.aspects[t.CFG_PARAMS_ASPECT].handleParamUpdateUserActionGeneric(a);"boolean"==typeof s&&s&&this.transition(e,c)}}}},this.currentParamUpdateUserAction=void 0,this.isLastUserActionGenericError=!1}getId(){return t.CFG_PARAMS_ASPECT}getAspectStates(){return this.states}init(e){if(this.client=e,this.client){console.log("ConfigParamAspect::init");let e=new i.ParameterListScreen(this.client.mqttHandler);this.client.registerScreen(e)}else console.log("ConfigParamAspect::init - aspect not correctly initialized (no client set) - skip init")}publishParameter(e){void 0!==this.client&&this.client.screens[i.PARAM_LIST_SCREENID]&&this.client.screens[i.PARAM_LIST_SCREENID].updateParameter(e)}setCurrentParamUpdateUserAction(e){
e?this.updateMessageBoxFromActionMessageAndShow(e.message):this.currentParamUpdateUserAction&&this.client.hideMsgBox(),this.currentParamUpdateUserAction=e}getCurrentParamUpdateUserAction(){return this.currentParamUpdateUserAction}updateTaskParameterGeneric(e){console.log("ConfigParamAspect: updateTaskParameterGeneric");let t=void 0;!0!==e.suppressLibRuleChecks&&(t=l.checkGeneralParamRules(e)),void 0!==t?this.isLastUserActionGenericError=!0:(this.isLastUserActionGenericError=!1,t=this.cfg.updateTaskParameterFn(e)),this.setCurrentParamUpdateUserAction(t);let a=this.client.screens[i.PARAM_LIST_SCREENID].getButton(i.FINISH_BUTTON_ID);return void 0!==a&&a.setAppearance(this.cfg.isValidFn()?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED),t}handleParamUpdateUserActionGeneric(e){console.log("ConfigParamsAspect: handleParamUpdateUserActionGeneric");let t=!1,a=this.getCurrentParamUpdateUserAction()
;return a?(this.isLastUserActionGenericError&&e.payload.buttonId===n.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID?(this.isLastUserActionGenericError=!1,t=!0):t=this.cfg.handleParamUpdateUserActionFn(a,e),("boolean"==typeof t&&t||"object"==typeof t)&&(console.log("action handled"),this.setCurrentParamUpdateUserAction(void 0)),"object"==typeof t&&(console.log("new action present"),this.setCurrentParamUpdateUserAction(t))):this.client.exitError("ConfigParamsAspect: handleParamUpdateUserActionGeneric - called in state, although no action set"),t}updateMessageBoxFromActionMessageAndShow(e){this.client.showMessageBox(e)}inspectTaskParameter(e){if(this.cfg.getDetailForTaskParameterFn){let t=this.cfg.getDetailForTaskParameterFn(e);this.showDetailTaskParameter(t)}else console.log("Error: Inspect parameter was clicked, but no getDetailForTaskParameterFn was configured in ConfigParamsAspect")}showDetailTaskParameter(e){let t=new _.default(this.client.mqttHandler)
;t.setTitle(e.title.id,e.title.args),t.setAppearance(s.EnumAppearance.HIDDEN);let a=[];for(const t of e.params){let e=new E.default(this.client.mqttHandler,t);e.publish(),a.push(e.getPublishedId())}t.setParams(a),t.show()}parametersEmpty(){let e=this.cfg.taskHandler.getTaskGroupsAndParameters(),t=!0;for(let a of e)for(let e of a.parameters)e.appearance!==s.EnumAppearance.HIDDEN&&(t=!1);return t}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(0),n=a(25);t.PARAM_LIST_SCREENID="PARAMLIST",t.FINISH_BUTTON_ID="BTN_FIN";t.ParameterListScreen=class extends n.ParamListBase{constructor(e){super(e);let a={};a.label={id:n.CANCEL_BUTTON_NAME,args:[]},a.appearance=i.EnumAppearance.ENABLED_PRIMARY,a.buttonId=n.CANCEL_BUTTON_ID,this.cancelButton=new s.default(e,this,a),a.appearance=i.EnumAppearance.HIDDEN,a.label.id="_FINISH",a.buttonId=t.FINISH_BUTTON_ID,this.finishButton=new s.default(e,this,a)}getId(){return"PARAMLIST"}getButton(e){let a
;return a=e===n.CANCEL_BUTTON_ID?this.cancelButton:e===t.FINISH_BUTTON_ID?this.finishButton:void 0}setFinishButtonLabel(e){this.finishButton.setLabel(e,!1)}show(){this.finishButton.publish(),this.createAndPublishParamsAndPage(),super.show()}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(4),n=a(10),r=a(1);class o{constructor(e){this.paramDetailsOverlayObject={appearance:s.EnumAppearance.HIDDEN,title:{id:"",args:[]},params:[]},this.events$=new n.Subject,this.mqttHandler=e}setAppearance(e){this.paramDetailsOverlayObject.appearance!==e&&(e!==s.EnumAppearance.HIDDEN&&e!==s.EnumAppearance.ENABLED||(this.paramDetailsOverlayObject.appearance=e,this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject))))}getAppearance(){return this.paramDetailsOverlayObject.appearance}setTitle(e,t){
this.paramDetailsOverlayObject.title.id===e&&this.paramDetailsOverlayObject.title.args.join("")===t.join("")||(this.paramDetailsOverlayObject.title.id=e,this.paramDetailsOverlayObject.title.args=t,this.paramDetailsOverlayObject.appearance!==s.EnumAppearance.HIDDEN&&this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject)))}getTitle(){return this.paramDetailsOverlayObject.title}setParams(e){this.paramDetailsOverlayObject.params.join("")!==e.join("")&&(this.paramDetailsOverlayObject.params=e,this.paramDetailsOverlayObject.appearance!==s.EnumAppearance.HIDDEN&&this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject)))}getParams(){return this.paramDetailsOverlayObject.params}getId(){return"PARAMDETAILSOVERLAY"}getButton(e){}hide(){this.paramDetailsOverlayObject.appearance===s.EnumAppearance.ENABLED&&(this.setAppearance(s.EnumAppearance.HIDDEN),this.events$.next({
type:i.ScreenEventType.HIDE_OVERLAY,id:this.getId()}))}show(){this.paramDetailsOverlayObject.appearance===s.EnumAppearance.HIDDEN&&(this.setAppearance(s.EnumAppearance.ENABLED),this.events$.next({type:i.ScreenEventType.SHOW_OVERLAY,id:this.getId()}))}}t.ParamDetailsOverlay=o,t.default=o},function(e,t){e.exports=require("rxjs/observable/interval")},function(e,t){e.exports=require("rxjs/observable/merge")},function(e,t){e.exports=require("timers")},function(e,t){e.exports=require("machina")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INTERNAL_SUSPEND_EVENT="_INTERNAL_SUSPEND_EVENT_",function(e){e.SUSPEND_EVENT_TYPE_FORCED_HOME="SUSPEND_EVENT_TYPE_FORCED_HOME",e.SUSPEND_EVENT_TYPE_FORCED_LOGOUT="SUSPEND_EVENT_TYPE_FORCED_LOGOUT",e.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT="SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT",e.SUSPEND_EVENT_TYPE_EXECFINALLY="SUSPEND_EVENT_TYPE_EXECFINALLY"}(t.INTERNAL_SUSPEND_EVENT_TYPE||(t.INTERNAL_SUSPEND_EVENT_TYPE={}))
;t.InternalSuspendEvent=class{constructor(e){this.payload=e,this.type=t.INTERNAL_SUSPEND_EVENT}},t.INTERNAL_RESTART_EVENT="_INTERNAL_RESTART_EVENT_",function(e){e.RESTART_EVENT_TYPE_REQUEST="RESTART_EVENT_TYPE_REQUEST",e.RESTART_EVENT_TYPE_EXECFINALLY="RESTART_EVENT_TYPE_EXECFINALLY"}(t.INTERNAL_RESTART_EVENT_TYPE||(t.INTERNAL_RESTART_EVENT_TYPE={}));t.InternalRestartEvent=class{constructor(e){this.payload=e,this.type=t.INTERNAL_RESTART_EVENT}},t.HEARTBEAT_EVENT="_FSM_HEARTBEAT_EVENT_";t.HeartbeatEvent=class{constructor(e){this.payload=e,this.type=t.HEARTBEAT_EVENT}},function(e){e.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS="SUCCESS",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL="FAIL",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT="TIMEOUT",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP="TIMEOUT_FETCH_RESP"}(t.INTERNAL_ASYNC_CALL_EVENT_TYPE||(t.INTERNAL_ASYNC_CALL_EVENT_TYPE={})),t.INTERNAL_ASYNC_CALL_EVENT="_INTERNAL_ASYNC_CALL_EVENT_";t.InternalAsyncCallEvent=class{constructor(e){
this.payload=e,this.type=t.INTERNAL_ASYNC_CALL_EVENT}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(61),i=a(10),n=a(62),r=a(29),o=a(28),_=a(1);t.MqttHandler=class{constructor(){this.mqttOptions={host:"127.0.0.1",port:1883,clientId:`qapp_${Math.random().toString(16).substring(2,8)}`,will:{topic:_.MqttTopics.QAPP_CLEANUP,payload:"",qos:1,retain:0}},this.listeningForUpdateEvent=!1,this.listeningForAdminEvent=!1,this.mqttUpdateEvent$=new i.Subject,this.mqttAdminEvent$=new i.Subject,this.weighingNet={str:_.MqttTopics.WEIGHING_VALUE_NET,subscribe:()=>this.subscribe(_.MqttTopics.WEIGHING_VALUE_NET),unsubscribe:()=>this.unsubscribe(_.MqttTopics.WEIGHING_VALUE_NET)},this.client=s.connect(this.mqttOptions),this.startListeningForUpdateEvent(),this.startListeningForAdminEvent(),this.listOfPublishedTopics=[],this.listOfSubscribedTopics=[]}startListeningForUpdateEvent(){this.listeningForUpdateEvent||(this.client.on("message",(e,t,a)=>{let s={topic:e,
value:t,packet:a};s.topic.startsWith(_.MqttTopics.QAPP_DEBUG_TOPIC_PREAMBLE)?this.mqttUpdateEvent$.next(new o.MqttUpdateDebugEvent(s)):this.mqttUpdateEvent$.next(new o.MqttUpdateEvent(s))}),this.listeningForUpdateEvent=!0)}startListeningForAdminEvent(){this.listeningForAdminEvent||(this.client.on("offline",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"offline",message:"client is offline!"}))}),this.client.on("close",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"close",message:"client has disconnected!"}))}),this.client.on("reconnect",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"reconnect",message:"client is reconnecting!"}))}),this.client.on("error",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"error",message:"client cannot connect or a parsing error occured!",error:e}))}),this.client.on("packetsend",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"packetsend",message:"client send packet!",packet:e}))}),
this.client.on("packetreceive",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"packetreceive",message:"client recieved packet!",packet:e}))}),this.client.on("connect",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"connect",message:"client has successfully connected!",connack:e}))}),this.listeningForAdminEvent=!0)}publish(e,t,a,s){let i,r;"function"==typeof a?(r=a,i=void 0):(i=a,r=s);let o={qos:n.EnumMqttQos.AtMostOnce,retain:!0,dup:!1};Object.assign(o,i),"/"!==e.substring(0,1)&&(e="~"===e.substring(0,1)?e.substring(1):`${_.MqttTopics.QAPP_NAMESPACE}/${e}`),e.startsWith(_.MqttTopics.QAPP_NAMESPACE)&&(this.listOfPublishedTopics.includes(e)||this.listOfPublishedTopics.push(e)),this.client.publish(e,t,o,e=>{r&&r(e)})}subscribe(e,t,a){if("object"==typeof e)this.subscribe(e,(e,t)=>{a&&a(e,t)});else{"function"==typeof t&&(a=t,t=void 0);let s={qos:0};Object.assign(s,t),-1===this.listOfSubscribedTopics.indexOf(e)&&this.listOfSubscribedTopics.push(e),
this.client.subscribe(e,s,(e,t)=>{a&&a(e,t)})}}unsubscribe(e,t){this.client.unsubscribe(e,e=>{t&&t(e)})}end(e,t){let a=!1,s=void 0;"function"==typeof e?(a=!1,s=e):"boolean"==typeof e&&(a=e,s=t),this.client.end(a,()=>{s&&s()})}removeOutgoingMessage(e){this.client.removeOutgoingMessage(e)}reconnect(e){this.client.reconnect(e)}getLastMessageId(){return this.client.getLastMessageId()}handleMessage(e,t){this.client.handleMessage(e,(e,a)=>{t(e,a)})}reconnecting(){return this.client.reconnecting}connected(){return this.client.connected}clearPublishedTopics(){this.publish(_.MqttTopics.QAPP_CLEANUP,"");for(let e of this.listOfPublishedTopics)this.publish(e,"");this.publish(_.MqttTopics.QAPP_CLEANUP,"")}unsubscribeTopics(){this.unsubscribe(this.listOfSubscribedTopics)}}},function(e,t){e.exports=require("mqtt")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.AtMostOnce=0]="AtMostOnce",e[e.AtLeastOnce=1]="AtLeastOnce",e[e.ExactlyOnce=2]="ExactlyOnce"
}(t.EnumMqttQos||(t.EnumMqttQos={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(37),i=a(10),n=a(30),r=a(15),o=a(1),_="/rest/qapp/paramDetail",E="/rest/qapp/paramChanged",l="/rest/qapp/buttonClick",A="/rest/qapp/extern",u=5e3;function c(e,t,a,s,i){e.statusCode=t,void 0!==a&&(e.statusMessage=a),console.log(`RestHandler::finalizeResponse: send ${t} (${a}) response: ${r.inspect(s)}`),void 0===s?e.end():"object"==typeof s?(e.setHeader("Content-Type","application/json"),e.end(JSON.stringify(s,i))):(e.setHeader("Content-Type","plain/text"),e.end(s))}t.RestHandler=class{constructor(e){this.buttonClickEvent$=new i.Subject,this.paramChangedEvent$=new i.Subject,this.paramDetailEvent$=new i.Subject,this.restRequestEvent$=new i.Subject,this.restController=((e,t)=>{if(e.url)if(e.url.startsWith(A)){let a=e.url.replace(A,"");console.log(`RestHandler: rx extern REST request (${e.method})for URL ${a}`),this.handleRequest(e,s=>{
console.log("RestHandler: rx all data for REST request - create and enqueue event"),t.setTimeout(u);let i={subUrl:a,request:e,body:s,response:t};this.restRequestEvent$.next(new n.RestRequestEvent(i))})}else switch(console.log(`RestHandler: rx internal REST request: ${e.url}`),e.url){case l:"POST"===e.method?this.handleRequest(e,e=>{e.buttonId&&(console.log(`RestHandler::restController received buttonID: ${e.buttonId}`),this.buttonClickEvent$.next(new n.HmiButtonClickedEvent(e)),c(t,200,"Event Accepted and Forwarded","ok"))}):c(t,405,"Method Not Allowed","failure");break;case E:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramChangedEvent$.next(new n.HmiParamChangedEvent({parameter:e})),c(t,200,"Event Accepted and Forwarded","ok"))}):c(t,405,"Method Not Allowed","failure");break;case _:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramDetailEvent$.next(new n.HmiParamDetailEvent({parameter:e})),c(t,200,"Event Accepted and Forwarded","ok"))
}):c(t,405,"Method Not Allowed","failure");break;default:c(t,404,"Not Found","failure")}else c(t,404,"Not Found","failure")}),this.port=e||8081,this.server=s.createServer(this.restController),this.server.listen(this.port,e=>{e&&console.log(e),console.log(`listening on port ${this.port}`)}),this.server.on("clientError",(e,t)=>{console.log("clientError"),console.log(e),console.log(e.stack),t.end("HTTP/1.1 400 Bad Request\r\n\r\n")})}stopServer(){this.server.close(()=>{console.log("HttpServer closed")})}handleRequest(e,t){let a,s=[""];e.on("error",t=>{console.log("RestHandler::handleRequest: "+t),e.socket.end()}).on("data",e=>{console.log("RestHandler::handleRequest: data"),"string"!=typeof e?s.push(e.toString()):s.push(e)}).on("end",()=>{if(console.log("RestHandler::handleRequest: end"),a=s.reduce((e,t)=>e+t),"application/json"===e.headers["content-type"])try{t(JSON.parse(a))}catch(e){t(a)}else t(a)})}registerRestEndpoints(e,t){
e.publish(o.MqttTopics.CUSTOMIZED_REST_HANDLER_CONFIGURATION,JSON.stringify(t))}},t.finalizeResponse=c},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(5);t.LocalizerProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="localizer"}getLanguage(){let e;return this.body.method=i.RestMethodsLOCALIZER.getLanguage,this.body.params={rLanguageId:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rLanguageId:""}getText(e,t=[]){let a;return this.body.method=i.RestMethodsLOCALIZER.getText,this.body.params={id:e,rText:"",args:t},(a=new s.CubisRestResponse(this.syncRequest())).isSuccess()?a.rawReturns.rText:e}getTexts(e){let t;return this.body.method=i.RestMethodsLOCALIZER.getTexts,this.body.params={textObjects:e,rTexts:""},(t=new s.CubisRestResponse(this.syncRequest())).isSuccess()?JSON.parse(t.rawReturns.rTexts):[]}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const s=a(3),i=a(7),n=a(0);function r(e){return"string"==typeof e.name&&"string"==typeof e.message}t.ERRORMSGBOX_OK_BTN_ID="BTN_OK_ERRORMSGBOX",t.isError=r,t.createMsgBoxData=function(e,a,o,_,E){let l=[];return r(o)?l.push({id:o.name+":"+o.message,args:[]}):s.isITextStructure(o)?l.push(o):l.push({id:o.error.name+":"+o.error.message,args:o.msgargs}),void 0!==_&&l.push(_),{type:e,title:a,textList:l,buttons:[{id:E||t.ERRORMSGBOX_OK_BTN_ID,label:{id:i.EnumFontLabels.OK,args:[]},appearance:n.EnumAppearance.ENABLED_SECONDARY}]}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRestErrorName="HttpRestError";class s extends Error{constructor(e,a,i,n){super(),this.statusCode=a,this.headers=i,this.body=n,this.name=t.HttpRestErrorName,Object.setPrototypeOf(this,s.prototype),this.message=e}}t.HttpRestError=s,t.isHttpRestError=function(e){return"object"==typeof e&&e.hasOwnProperty("statusCode")&&e.hasOwnProperty("headers")&&e.hasOwnProperty("body")}
},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(0),n=a(5),r="WEIGHING/CONFIGURATION/PROFILE/ZERO_TARE",o=r+"/TARE1",_="ON",E="PROFILE/IDENTIFICATION",l="PROFILE/IDENTIFICATION/NAME";t.ProfileManagementProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="profilemanagement"}loadProfile(e){return this.body.method=n.RestMethodsPROFILE_MANAGEMENT.loadProfile,this.body.params={rProfile:"",id:e},new s.CubisRestResponse(this.syncRequest())}isPresetTareEnabled(e){let t;if(e instanceof s.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){let a=this.loadProfile(e);t=JSON.parse(a.rawReturns.rProfile).params}else t=e.params;for(let e of t)if(e.id===r)for(let t of e.parameters)if(t.id===o)return t.value.selection.id===_;return!1}getWeighingProfileName(e){let t;if(e instanceof s.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){
let a=this.loadProfile(e);t=JSON.parse(a.rawReturns.rProfile).params}else t=e.params;for(let e of t)if(e.id===E)for(let t of e.parameters)if(t.id===l)return t.value.string;return""}getAvailableWeighingUnitsInWeighingProfile(e){let t=e.params.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY"===e.id);if(void 0!==t){let e=t.parameters.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY/UNITS"===e.id);return void 0===e?void 0:e.value.selections.map(e=>e.id)}}getUnitsAvailableOnBalance(e){let t=e.params.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY"===e.id);if(void 0!==t){let e=t.parameters.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY/UNITS"===e.id);if(void 0===e)return;{let t=[];return e.info.options.forEach(e=>{e.appearance===i.EnumAppearance.ENABLED&&(t=[...t,e.id])}),0===t.length?void 0:t}}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.UNIT="UNIT",e.DO_ZERO="DO_ZERO",e.DO_TARE="DO_TARE",e.DO_TARE1="DO_TARE1",
e.CLR_TARE1="CLR_TARE1",e.SET_TARE1="SET_TARE1",e.SHOW_TARE1="SHOW_TARE1",e.HIDE_TARE1="HIDE_TARE1",e.DISPLAY="DISPLAY"}(t.WEIGHING_BUTTON_ID||(t.WEIGHING_BUTTON_ID={})),function(e){e.AS_CONFIGURED="AS_CONFIGURED",e.WITHOUT_STABILITY="WITHOUT_STABILITY",e.AFTER_STABILITY="AFTER_STABILITY"}(t.WEIGHING_ZEROTARE_BEHAVIOR||(t.WEIGHING_ZEROTARE_BEHAVIOR={})),function(e){e.VERY_STABLE="VERY_STABLE",e.STABLE="STABLE",e.UNSTABLE="UNSTABLE",e.VERY_UNSTABLE="VERY_UNSTABLE"}(t.WEIGHING_AMBIENT_CONDITION||(t.WEIGHING_AMBIENT_CONDITION={})),function(e){e.ADMIN_ROLE_ID="adminRoleDbId",e.SERVICE_ROLE_ID="serviceRoleDbId",e.OPERATOR_ROLE_ID="operatorRoleDbId",e.GUEST_ROLE_ID="guestRoleDbId"}(t.ACCESS_CONTROL_ROLE_DB_IDS||(t.ACCESS_CONTROL_ROLE_DB_IDS={})),function(e){e.MANAGE_PROFILES="ACCESS_MANAGE_PROFILES",e.MANAGE_DEVICE_SETTINGS="ACCESS_MANAGE_DEVICE_SETTINGS",e.MANAGE_ROLES="ACCESS_MANAGE_ROLES",e.MANAGE_ACCESS_MANAGEMENT="ACCESS_MANAGE_ACCESS_MANAGEMENT",
e.MANAGE_LDAP_SETTINGS="ACCESS_MANAGE_LDAP_SETTINGS",e.MANAGE_TIMER_CONTROLLED_ACTIONS="ACCESS_MANAGE_TIMER_CONTROLLED_ACTIONS",e.MANAGE_CONNECTIONS="ACCESS_MANAGE_CONNECTIONS",e.REDIRECT_FAILED_TRANSFERS="ACCESS_REDIRECT_FAILED_TRANSFERS",e.DELETE_FAILED_TRANSFERS="ACCESS_DELETE_FAILED_TRANSFERS",e.MAINTENANCE_FIRMWARE_UPDATE="ACCESS_MAINTENANCE_FIRMWARE_UPDATE",e.MAINTENANCE_MANAGE_QAPPS="ACCESS_MAINTENANCE_MANAGE_QAPPS",e.MAINTENANCE_BACKUP_RESTORE="ACCESS_MAINTENANCE_BACKUP_RESTORE",e.MAINTENANCE_EXPORT_IMPORT="ACCESS_MAINTENANCE_EXPORT_IMPORT",e.MAINTENANCE_FACTORY_RESET="ACCESS_MAINTENANCE_FACTORY_RESET",e.UNLOCK_DEVICE="ACCESS_UNLOCK_DEVICE",e.REMOTE_VIEW="ACCESS_REMOTE_VIEW",e.REMOTE_CONTROL="ACCESS_REMOTE_CONTROL",e.MANAGE_JOBS="ACCESS_MANAGE_JOBS",e.ACCESS_AUDIT_TRAIL="ACCESS_AUDIT_TRAIL",e.ACCESS_ALIBI="ACCESS_ALIBI",e.EXECUTE_TASKS="EXECUTE_TASKS",e.ACCESS_CALIBRATION_REPORTS="ACCESS_CALIBRATION_REPORTS",e.ACCESS_LAST_REPORTS="ACCESS_LAST_REPORTS",
e.ACCESS_MASS_STORAGES="ACCESS_MASS_STORAGES",e.REMOVE_USERCAL_INVALIDATION="REMOVE_USERCAL_INVALIDATION",e.CREATE_UPDATE_DELETE_USER="CREATE_UPDATE_DELETE_USER",e.CREATE_UPDATE_DELETE_TASK="CREATE_UPDATE_DELETE_TASK",e.ACCESS_QAPP_CENTER="ACCESS_QAPP_CENTER",e.SETUP_MENU_ACCESS="SETUP_MENU_ACCESS"}(t.EnumUserRights||(t.EnumUserRights={}))},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("https")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(3),n=a(5);t.AccessControlProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="access"}getCurrentUser(){let e,t;return this.body.method=n.RestMethodsACCESS_MANAGEMENT.getCurrentUser,this.body.params={user:""},e=new s.CubisRestResponse(this.syncRequest()),t=JSON.parse(e.rawReturns.user)}getCurrentUserName(e){let t,a=""
;return(t=void 0!==e?e:this.getCurrentUser()).params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/NAME"===e.id&&(a=e.value.string,!0))),a}getCurrentUserRoles(e){let t;t=void 0!==e?e:this.getCurrentUser();let a=i.createEmptySelectionParameter();return t.params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/ROLES"===e.id&&(a=e,!0))),a}checkRightsOfCurrentUser(e){let t;return this.body.method=n.RestMethodsACCESS_MANAGEMENT.checkRightsOfCurrentUser,this.body.params={permissionGranted:!1,arrayOfRightsToCheck:e},(t=new s.CubisRestResponse(this.syncRequest())).rawReturns.permissionGranted}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FOUR_AREAS="4",e.SIX_AREAS="6"}(t.EnumAreaCount||(t.EnumAreaCount={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(34),n=a(4),r=a(1);t.LOADING_OVERLAY_ID="LOADING_MODAL";t.LoadingOverlay=class extends i.AbstractOverlay{
setText(e){this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:n.ScreenEventType.SHOW_LOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:n.ScreenEventType.HIDE_LOADINGSCREEN,id:this.getId()})}getMqttTopicBase(){return"~"+r.MqttTopics.HMI_LOADING_MODAL}getId(){return t.LOADING_OVERLAY_ID}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.PERSISTENCY_SCOPE_QAPP_INDEPENDENT="PERSISTENCY_SCOPE_QAPP_INDEPENDENT",e.PERSISTENCY_SCOPE_QAPP_SPECIFIC="PERSISTENCY_SCOPE_QAPP_SPECIFIC",e.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION="PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION",e.PERSISTENCY_SCOPE_TASk_SPECIFIC="PERSISTENCY_SCOPE_TASk_SPECIFIC"}(t.EnumPersistencyScope||(t.EnumPersistencyScope={}))},function(e,t,a){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});const s=a(6),i=a(5);t.DeviceInformationProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="deviceinformation"}getSerialNo(){let e;return this.body.method=i.RestMethodsDEVICE_INFORMATION.getSerialNoBalance,this.body.params={rString:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}getModelName(){let e;return this.body.method=i.RestMethodsDEVICE_INFORMATION.getModelName,this.body.params={rString:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QAppAsyncCallTimeoutErrorName="QAppAsyncCallTimeoutError";class s extends Error{constructor(e,a,i){super(),this.originalState=e,this.metadata=a,this.name=t.QAppAsyncCallTimeoutErrorName,i&&(this.stack=i),Object.setPrototypeOf(this,s.prototype),this.message="Async call timeout."+(a?` metadata: ${a}`:"")}}
t.QAppAsyncCallTimeoutError=s},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOCKING_ASPECT="LOCKING_ASPECT"},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(0),n=a(11),r=a(4),o=a(10),_=a(1);t.LOCKMESSAGEBOX_ID="LOCKMESSAGEBOX";class E{constructor(e){this.appearance=i.EnumAppearance.HIDDEN,this.lastPublishedTabContent={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.events$=new o.Subject,this.mqttHandler=e,this.buttonList=[]}setMessageBoxData(e,t=!0){this.setBackgroundColor(e.backgroundColor,!1),this.setIconColor(e.iconColor,!1),this.setType(e.type,!1),this.setTitle(e.title,!1),this.setTextsList(e.textList,!1),this.createButtons(e.buttons.map(e=>({buttonId:e.id,
label:e.label,appearance:e.appearance}))),this.publish(t)}createButtons(e){this.buttonList.splice(0,this.buttonList.length),this.messageBoxObject.buttons.splice(0,this.messageBoxObject.buttons.length),console.log("LockMessageBox: createButtons buttonlist cleared: "+this.buttonList.length),console.log("LockMessageBox: createButtons buttonlist json cleared: "+this.messageBoxObject.buttons.length);for(let t of e)if(void 0===this.getButton(t.buttonId)){let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),this.messageBoxObject.buttons.push(e.getJson())}else console.error("LockMessageBox: Duplicate Button: "+t.buttonId);console.log("LockMessageBox: createButtons number of buttons: "+this.buttonList.length),console.log("LockMessageBox: createButtons json result: "+JSON.stringify(this.messageBoxObject))}removeButtons(e){console.log("LockMessageBox: removeButtons ");for(let t of e){
for(let e=0;e<this.buttonList.length;e++)this.buttonList[e].getButtonId()===t&&(console.log("LockMessageBox: splice for index: "+e),this.buttonList.splice(e,1),console.log("LockMessageBox: Buttonlist buttons left: "+this.buttonList.length),e=0);console.log("LockMessageBox: Clearing json buttons");for(let e=0;e<this.messageBoxObject.buttons.length;e++){let a=this.messageBoxObject.buttons[e];if(console.log("LockMessageBox: buttonId "+a.effect.params.buttonId),a.effect.params.buttonId===t){let t=this.messageBoxObject.buttons.splice(e,1);console.log("LockMessageBox: Removed JSON Button: "+t[0]),console.log("LockMessageBox: ButtonJSON buttons left: "+this.messageBoxObject.buttons.length),e=0}}}}publish(e=!0){let t=JSON.stringify(this.messageBoxObject),a=JSON.stringify(this.lastPublishedTabContent)
;e&&(t!==a&&this.messageBoxObject.appearance===i.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===i.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===i.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(_.MqttTopics.HMI_LOCK_MESSAGEBOX,t),this.lastPublishedTabContent=JSON.parse(t))}getButtonByTopic(e){for(let t of this.buttonList){if(t.getTopic().substring(t.getTopic().lastIndexOf("/")+1)===e)return t}}getButton(e){for(let t of this.buttonList)if(t.getButtonId()===e)return t}setAppearance(e,t=!0){"HIDDEN"!==e&&"ENABLED"!==e||(this.appearance=e,this.messageBoxObject.appearance=e,this.publish(t))}getAppearance(){return this.appearance}setBackgroundColor(e,t=!0){this.messageBoxObject.backgroundColor=e,this.publish(t)}getBackgroundColor(){return this.messageBoxObject.backgroundColor}setIconColor(e,t=!0){this.messageBoxObject.iconColor=e,this.publish(t)}getIconColor(){return this.messageBoxObject.iconColor}setType(e,t=!0){this.messageBoxObject.type=e,this.publish(t)
}getType(){return this.messageBoxObject.type}setTitle(e,t=!0){this.messageBoxObject.title=e,this.publish(t)}getTitle(){return this.messageBoxObject.title}setTextsList(e,t=!0){this.messageBoxObject.textsList=e,this.publish(t)}getTextsList(){return this.messageBoxObject.textsList}getText(){return this.messageBoxObject.textsList[0]}getId(){return t.LOCKMESSAGEBOX_ID}hide(){this.appearance===i.EnumAppearance.ENABLED&&(this.setAppearance(i.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_LOCKMESSAGEBOX,id:this.getId()}))}show(){this.appearance===i.EnumAppearance.HIDDEN&&(this.setAppearance(i.EnumAppearance.ENABLED),this.events$.next({type:r.ScreenEventType.SHOW_LOCKMESSAGEBOX,id:this.getId()}))}}t.LockMessageBox=E,t.default=E},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(34),n=a(4),r=a(1);t.LOCK_LOADING_OVERLAY_ID="LOCK_LOADING_MODAL";t.LockLoadingOverlay=class extends i.AbstractOverlay{setText(e){
this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:n.ScreenEventType.SHOW_LOCKLOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:n.ScreenEventType.HIDE_LOCKLOADINGSCREEN,id:this.getId()})}getMqttTopicBase(){return r.MqttTopics.HMI_LOCK_LOADING_MODAL}getId(){return t.LOCK_LOADING_OVERLAY_ID}}},function(e,t){e.exports=require("net")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PARAM_TITLE=40,t.PARAM_HEADER=8,t.USER_GUIDANCE=45,t.BUTTON_DISPLAY=8,t.BUTTON_APPL=8,t.PARAMLIST_TITLE=40,t.MSG_TITLE=25,t.MSG_DESCRIPTION=200,t.BUTTON_MSG=20,t.GROUP_PARAM_TITLE=25,t.PARAM_SELECTION=25,t.DETAIL_TITLE=25,t.MAXIMUM_LENGTH_TASK_NAME=50,t.MAXIMUM_LENGTH_TASK_DESCRIPTION=60,t.USER_INPUT_STRING_NAMES=50,
t.LID_SID_USER_INPUT_STRING_VALUES=60},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID="TASK/DYNAMIC_USP",t.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/NORM`,function(e){e.USP="USP",e.PHEUR="PHEUR",e.JAPANPHARMACOPOEIA="JAPANPHARMACOPOEIA",e.CHINESEPHARMACOPOEIA="CHINESEPHARMACOPOEIA"}(t.NormSelectionOption||(t.NormSelectionOption={})),t.TASK_DYNAMIC_USP_ADVANCED_NUMBER_WEIGHTS_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/NUMBER_WEIGHTS`,function(e){e.OPTION1="1",e.OPTION2="2"}(t.NumberWeightsSelectionOption||(t.NumberWeightsSelectionOption={})),t.TASK_DYNAMIC_USP_ADVANCED_SMALLEST_WEIGHT_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/SMALLEST_WEIGHT`,t.TASK_DYNAMIC_AUTOMATIC_TAKEOVER_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/AUTOMATIC_TAKEOVER`,function(e){e.MANUAL="MANUAL",e.AUTOMATIC="AUTOMATIC"
}(t.EnumAutoTakeoverSelectionOptions||(t.EnumAutoTakeoverSelectionOptions={})),t.TASK_DYNAMIC_USP_ADVANCED_SAFETY_FACTOR_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/SAFETY_FACTOR`,t.TASK_DYNAMIC_USP_ADVANCED_VALUE_TO_MONITOR_PARAM_ID=`${t.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID}/VALUE_TO_MONITOR`,function(e){e.SF="SF",e.SFMMIN="SFMMIN"}(t.ValueToMonitorSelectionOption||(t.ValueToMonitorSelectionOption={})),t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID="TASK/DYNAMIC_REPEATABILITY",t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/WEIGHT_ID`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/CLASS`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/NOMINAL_VALUE`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/CERTIFICATE_NO`,
t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/DEVIATION`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/UNCERTAINTY`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/CERTIFICATE_DATE`,t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_SET_ID=`${t.TASK_DYNAMIC_REPEATABILITY_GROUP_ID}/SET_ID`,t.TASK_DYNAMIC_ACCURACY_GROUP_ID="TASK/DYNAMIC_ACCURACY",t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_WEIGHT_ID=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/WEIGHT_ID`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/CLASS`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/NOMINAL_VALUE`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/CERTIFICATE_NO`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/DEVIATION`,
t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/UNCERTAINTY`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_DATE=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/CERTIFICATE_DATE`,t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_SET_ID=`${t.TASK_DYNAMIC_ACCURACY_GROUP_ID}/SET_ID`,t.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MIN=1,t.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MAX=25,t.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE="FREEINPUT",t.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MIN=0,t.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MAX=500,t.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MIN=-8e4,t.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MAX=8e4,t.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MIN=0,t.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G=6e6,t.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_MG=1e3*t.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G,t.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MIN=0,t.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MAX=25,t.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS=6,
t.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID_WORKFLOW="TASK/DYNAMIC_USP/REPEATABLITY_WEIGHT_ID",t.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_WEIGHT_ID_WORKFLOW="TASK/DYNAMIC_USP/ACCURACY_WEIGHT_ID",t.OK_BTN_ID="BTN_OK"},,,,,,function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(89),i=a(19),n=a(82),r=a(18),o=a(93),_=a(21),E=a(14),l=a(11),A=a(44),u=a(8),c=a(31),I=a(17),T=a(0),d=a(3),N=a(42),p=a(5),S=a(48),m=a(7);let R,P={appearance:T.EnumAppearance.ENABLED,label:{id:m.EnumFontLabels.OK,args:[]},buttonId:"msgBtnOk"};class D extends s.QAppConfigBase{adaptFsmStates(e){super.adaptFsmStates(e);let t=e.STATE_ASPECT_CFG_PARAM_EDIT.EV_HMI_BTN_CLICKED;e.STATE_ASPECT_CFG_PARAM_EDIT.EV_HMI_BTN_CLICKED=function(e,a){a.payload.buttonId===P.buttonId&&(R.hide(),e.suspend()),void 0!==t&&t.call(this,e,a)}}constructor(){super(!0),this.maxConfigurableLID=0,this.maxConfigurableSID=0,this.suppressModifyWarning=!0,this.prevAppearance={},
this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID]=T.EnumAppearance.ENABLED_INVALID_CFG,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS]=T.EnumAppearance.ENABLED,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE]=T.EnumAppearance.ENABLED_INVALID_CFG,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO]=T.EnumAppearance.ENABLED,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION]=T.EnumAppearance.ENABLED,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY]=T.EnumAppearance.ENABLED,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE]=T.EnumAppearance.DISABLED,this.prevAppearance[n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_SET_ID]=T.EnumAppearance.ENABLED}updateTaskParameterRec(e,t){t?console.log("AdvUSPAdvanced: update task parameter"):console.log("AdvUSPAdvanced: update dependent task parameter");let a=void 0,s=!1,i=[],o=!0
;if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE){let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS),_=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY),E=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);t&&this.calculateUncertainty(_,r,e,E),s=!this.nominalValueValid(e);let l=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION);if(void 0===(a=this.checkNominalValue(r,e))&&(a=this.checkDeviation(r,l,e)),void 0===a&&(a=this.checkWeight(e,l)),void 0===a){const t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID).value.selection.id;(a=this.repeatabilityWeightIdInfo2(t,e))&&(o=!1)}t&&(i=[r,l])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);a=this.checkDeviationZero(e,s)
;let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS);void 0===a&&(a=this.checkDeviation(o,e,r)),void 0===a&&(a=this.checkWeight(r,e)),t&&(i=[o,r,s])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE){let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY);if(t){let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);this.calculateUncertainty(o,r,e,t)}s=!this.nominalValueValid(e);let _=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION);void 0===(a=this.checkNominalValue(r,e))&&(a=this.checkDeviation(r,_,e)),void 0===a&&(a=this.checkAccuracyWeight(e,_,o)),void 0===a&&(a=this.checkWeight(e,_)),t&&(i=[r,_,o])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION){
let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);a=this.checkDeviationZero(e,s);let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS),_=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY);void 0===a&&(a=this.checkDeviation(o,e,r)),void 0===a&&(a=this.checkAccuracyWeight(r,e,_)),void 0===a&&(a=this.checkWeight(r,e)),t&&(i=[o,r,s,_])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO),r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS);a=this.checkUncertaintyZero(e,s,r);let o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE),_=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION);void 0===a&&(a=this.checkAccuracyWeight(o,_,e)),
t&&(i=[s,o,_,r])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO&&d.isTypeOfIStringParameter(e)){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY),r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS);if(t){let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE);this.calculateUncertainty(s,r,t,e)}let o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_DATE),_=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION);t&&(e.value.string.length>0?o.appearance=T.EnumAppearance.ENABLED:o.appearance=T.EnumAppearance.DISABLED,this.updateTaskHandlerAndPublish(o)),void 0===(a=this.checkAccuracyCertificate(e,r))&&(isNaN(E.QuantityParameter.getValue(_))||(a=this.checkDeviationZero(_,e))),void 0===a&&(a=this.checkUncertaintyZero(s,e,r)),t&&(i=[r,_,s,o])
}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS&&d.isTypeOfISelectionParameter(e)){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE);if(t){if(e.value.selection.id===n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE)s.appearance=T.EnumAppearance.ENABLED,s.value.decimals=n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,s.value.preferredDecimals=n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,s.value.unit===r.unitStringToShort(r.EnumUnitStrings.mg)&&(s.value.unit=r.unitStringToShort(r.EnumUnitStrings.g),E.QuantityParameter.setValue(s,r.convertWgtUnit(E.QuantityParameter.getValue(s),r.EnumUnitStrings.mg,r.EnumUnitStrings.g))),s.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G,0);else{s.appearance=T.EnumAppearance.ENABLED
;let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);this.calculateUncertainty(s,e,o,t)}this.updateTaskHandlerAndPublish(s)}a=this.checkNominalValue(e,o);let _=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION),l=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);void 0===a&&(a=this.checkDeviation(e,_,o)),void 0===a&&(a=this.checkAccuracyCertificate(l,e)),void 0===a&&(a=this.checkUncertaintyZero(s,l,e)),t&&(i=[o,_,l,s])}else{if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_WEIGHT_ID)return a=this.accuracyWeightIdInfo(),this.weightIdValid(e)&&(e.appearance=T.EnumAppearance.ENABLED),this.updateTaskHandlerAndPublish(e),{message:a,updatedParameter:e};if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID){const t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID).value.selection.id;return a=this.repeatabilityWeightIdInfo(t),
this.weightIdValid(e)&&(e.appearance=T.EnumAppearance.ENABLED),this.updateTaskHandlerAndPublish(e),a?{message:a,updatedParameter:e}:void 0}if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS&&d.isTypeOfISelectionParameter(e)){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE);if(t){if(e.value.selection.id===n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE)s.appearance=T.EnumAppearance.ENABLED,s.value.decimals=n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,s.value.preferredDecimals=n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,s.value.unit===r.unitStringToShort(r.EnumUnitStrings.mg)&&(s.value.unit=r.unitStringToShort(r.EnumUnitStrings.g),E.QuantityParameter.setValue(s,r.convertWgtUnit(E.QuantityParameter.getValue(s),r.EnumUnitStrings.mg,r.EnumUnitStrings.g))),
s.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G,0);else{s.appearance=T.EnumAppearance.ENABLED;let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);this.calculateUncertainty(s,e,o,t)}this.updateTaskHandlerAndPublish(s)}a=this.checkNominalValue(e,o);let _=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION);void 0===a&&(a=this.checkDeviation(e,_,o));let l=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);void 0===a&&(a=this.checkUncertaintyZero(s,l,e)),t&&(i=[o,_,s,l])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO&&d.isTypeOfIStringParameter(e)){
let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY),r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION),o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS);if(t){let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE);this.calculateUncertainty(s,o,t,e)}let _=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE);t&&(e.value.string.length>0?_.appearance=T.EnumAppearance.ENABLED:_.appearance=T.EnumAppearance.DISABLED,this.updateTaskHandlerAndPublish(_)),isNaN(E.QuantityParameter.getValue(r))||(a=this.checkDeviationZero(r,e)),void 0===a&&(a=this.checkUncertaintyZero(s,e,o)),t&&(i=[r,s,_,o])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);a=this.checkCertificateDate(e,s),t&&(i=[s])
}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_DATE){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);a=this.checkCertificateDate(e,s),t&&(i=[s])}else if(e.id===n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY){let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO),r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS);a=this.checkUncertaintyZero(e,s,r),t&&(i=[s,r])}}void 0!==a&&o&&(s=!0),e.appearance!==T.EnumAppearance.DISABLED&&e.appearance!==T.EnumAppearance.HIDDEN&&(e.appearance=s?T.EnumAppearance.ENABLED_INVALID_CFG:T.EnumAppearance.ENABLED),this.updateTaskHandlerAndPublish(e);for(let e of i)this.updateTaskParameterRec(e,!1);if(void 0!==a)return{message:a,updatedParameter:e}}updateTaskParameter(e){return this.updateTaskParameterRec(e,!0)}checkWeight(e,t){if(void 0!==this.metrMax){E.QuantityParameter.roundToDecimalPlaces(e)
;let a=E.QuantityParameter.getValue(e);if(isNaN(a))return;{a=r.convertWgtUnit(a,r.unitStringToLong(e.value.unit),r.unitStringToLong(this.metrMax.maxUnit)),E.QuantityParameter.roundToDecimalPlaces(t);let s=E.QuantityParameter.getValue(t);if(isNaN(s)&&(s=0),a+(s=r.convertWgtUnit(s,r.unitStringToLong(t.value.unit),r.unitStringToLong(this.metrMax.maxUnit)))>this.metrMax.maxValue){let e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.textList=[{id:"_QAPP_CFG_PARAM_CHECK_CONV_VALUE_MAX",args:[(a+s).toString(),this.metrMax.maxUnit,this.metrMax.maxValue.toFixed(this.metrMax.maxDecimals),this.metrMax.maxUnit]}],e}}}}checkAccuracyWeight(e,t,a){E.QuantityParameter.roundToDecimalPlaces(e);let s=E.QuantityParameter.getValue(e);if(isNaN(s));else{s=r.convertWgtUnit(s,r.unitStringToLong(e.value.unit),r.unitStringToLong(a.value.unit)),E.QuantityParameter.roundToDecimalPlaces(t);let n=E.QuantityParameter.getValue(t);isNaN(n)&&(n=0),
n=r.convertWgtUnit(n,r.unitStringToLong(t.value.unit),r.unitStringToLong(a.value.unit)),E.QuantityParameter.roundToDecimalPlaces(a);let o=E.QuantityParameter.getValue(a),_=I.bignumber(s).add(I.bignumber(n)).times(.001).dividedBy(3).toNumber();if(o>_){let e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.textList=[{id:"_QAPP_CFG_PARAM_CHECK_UNCERTAINTY_VALUE_MAX",args:[a.value.numbers[0],a.value.unit,_.toPrecision(6).toString(),a.value.unit]}],e}}}checkAccuracyCertificate(e,t){if(""===e.value.string&&t.value.selection.id===n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE){let e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.textList=[{id:"_QAPP_CFG_PARAM_CHECK_CERTIFICATE",args:[]}],e}}checkNominalValue(e,t){E.QuantityParameter.roundToDecimalPlaces(t);let a=E.QuantityParameter.getValue(t);if(!isNaN(a)){let s=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept),n=r.convertWgtUnit(a,r.unitStringToLong(t.value.unit),r.EnumUnitStrings.g)
;return e.value.selection.id.startsWith("ASTM")&&void 0===o.ansiClassList[e.value.selection.id].tolerance[n]?(s.textList=[{id:"_QAPP_CFG_PARAM_CHECK_NOMINAL_VALUE",args:[t.value.numbers[0],t.value.unit,o.ansiClassList[e.value.selection.id].name]}],s):e.value.selection.id.startsWith("OIML")&&void 0===o.oimlClassList[e.value.selection.id].tolerance[n]?(s.textList=[{id:"_QAPP_CFG_PARAM_CHECK_NOMINAL_VALUE",args:[t.value.numbers[0],t.value.unit,o.oimlClassList[e.value.selection.id].name]}],s):void 0}}repeatabilityWeightIdInfo(e){if(e===n.NormSelectionOption.PHEUR||e===n.NormSelectionOption.USP||e===n.NormSelectionOption.JAPANPHARMACOPOEIA||e===n.NormSelectionOption.CHINESEPHARMACOPOEIA){const e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.type=l.EnumMessageboxType.INFO,e.title.id="_QAPP_MESSAGEBOX_INFO_TITLE",e.textList=[{id:"_QAPP_MESSAGEBOX_REPEATABILITY_INFO_TEXT",args:[]}],e}}repeatabilityWeightIdInfo2(e,t){
if(e===n.NormSelectionOption.PHEUR||e===n.NormSelectionOption.USP||e===n.NormSelectionOption.JAPANPHARMACOPOEIA||e===n.NormSelectionOption.CHINESEPHARMACOPOEIA){let e=JSON.parse(t.value.numbers[0]);const a=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE);let s=JSON.parse(a.info.maximum.value);if(console.log("repValue= "+e+", metrMax = "+s+", (metrMax * 0.05)"+.05*s+", (repValue < 0.1) "+(e<.1?"true":"false")+", (repValue >  (metrMax * 0.05))"+(e>.05*s?"true":"false")),e<.1||e>.05*s){const e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.type=l.EnumMessageboxType.INFO,e.title.id="_QAPP_MESSAGEBOX_INFO_TITLE",e.textList=[{id:"_QAPP_MESSAGEBOX_REPEATABILITY_INFO_TEXT",args:[]}],e}}}accuracyWeightIdInfo(){const e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.type=l.EnumMessageboxType.INFO,e.title.id="_QAPP_MESSAGEBOX_INFO_TITLE",e.textList=[{id:"_QAPP_MESSAGEBOX_ACCURACY_INFO_TEXT",args:[]}],e}checkCertificateDate(e,t){
if(t.value.string.length>0){let t=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);if(0===e.value.timestamp||null===e.value.timestamp)return t.textList=[{id:"_QAPP_CFG_PARAM_CHECK_CERTIFICATE_DATE",args:[]}],t;if(e.value.timestamp>A.getTime())return t.textList=[{id:"_QAPP_CFG_PARAM_CHECK_CERTIFICATE_DATE_MAX",args:[]}],t}}checkDeviationZero(e,t){E.QuantityParameter.roundToDecimalPlaces(e);let a=E.QuantityParameter.getValue(e);if(isNaN(a)&&(a=0),t.value.string.length>0&&0===a){let e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.textList=[{id:"_QAPP_CFG_PARAM_CHECK_DEVIATION_ZERO",args:[]}],e}}checkDeviation(e,t,a){E.QuantityParameter.roundToDecimalPlaces(t);let s=E.QuantityParameter.getValue(t);if(!isNaN(s)){E.QuantityParameter.roundToDecimalPlaces(a);let n=E.QuantityParameter.getValue(a);if(isNaN(n))return;{let _=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);if(e.value.selection.id.startsWith("ASTM")){
let i=r.convertWgtUnit(n,r.unitStringToLong(a.value.unit),r.EnumUnitStrings.g),E=o.ansiClassList[e.value.selection.id].tolerance[i];if(void 0!==E&&(-1*E.value>s||s>E.value))return _.textList=[{id:"_QAPP_CFG_PARAM_CHECK_DEVIATION",args:[t.value.numbers[0],t.value.unit,E.value.toFixed(E.decimals),E.value.toFixed(E.decimals),a.value.numbers[0],a.value.unit,o.ansiClassList[e.value.selection.id].name]}],_}if(e.value.selection.id.startsWith("OIML")){let i=r.convertWgtUnit(n,r.unitStringToLong(a.value.unit),r.EnumUnitStrings.g),E=o.oimlClassList[e.value.selection.id].tolerance[i];if(void 0!==E&&(-1*E.value>s||s>E.value))return _.textList=[{id:"_QAPP_CFG_PARAM_CHECK_DEVIATION",args:[t.value.numbers[0],t.value.unit,E.value.toFixed(E.decimals),E.value.toFixed(E.decimals),a.value.numbers[0],a.value.unit,o.oimlClassList[e.value.selection.id].name]}],_}}}}checkUncertaintyZero(e,t,a){E.QuantityParameter.roundToDecimalPlaces(e);let s=E.QuantityParameter.getValue(e)
;if(a.value.selection.id===n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE&&t.value.string.length>0&&0===s){let e=u.cloneDeep(i.ParamUpdateUserActionSimpleAccept);return e.textList=[{id:"_QAPP_CFG_PARAM_CHECK_UNCERTAINTY_ZERO",args:[]}],e}}calculateUncertainty(e,t,a,s){if(t.value.selection.id!==n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE){let i=E.QuantityParameter.getValue(a);if(!isNaN(i)){let _=void 0,l=r.convertWgtUnit(i,r.unitStringToLong(a.value.unit),r.EnumUnitStrings.g);t.value.selection.id.startsWith("ASTM")&&(_=o.ansiClassList[t.value.selection.id].tolerance[l]),t.value.selection.id.startsWith("OIML")&&(_=o.oimlClassList[t.value.selection.id].tolerance[l]),void 0!==_&&(e.value.decimals=_.decimals,e.value.preferredDecimals=_.decimals,s.value.string.length>0?E.QuantityParameter.setValue(e,_.value1_3):E.QuantityParameter.setValue(e,_.value),e.value.unit=r.unitStringToShort(r.EnumUnitStrings.mg),
e.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_MG,0),this.updateTaskHandlerAndPublish(e))}}}weightIdValid(e){return""!==e.value.string}nominalValueValid(e){let t=E.QuantityParameter.getValue(e);return!isNaN(t)}handleParamUpdateUserAction(e,t){return console.log("AdvUSPAdvanced: handleParamUpdateUserAction"),t.payload.buttonId===n.OK_BTN_ID&&(this.hideMsgBox(),!0)}isConfigValid(){if(console.log("AdvUSPAdvanced: isConfigValid"),this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_NUMBER_WEIGHTS_PARAM_ID).value.selection.id===n.NumberWeightsSelectionOption.OPTION2){let e=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE);if(!1===this.nominalValueValid(e))return!1;let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS);if(void 0!==this.checkNominalValue(t,e))return!1
;let a=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION);if(void 0!==this.checkDeviation(t,a,e))return!1;if(void 0!==this.checkWeight(e,a))return!1;let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO);if(void 0!==this.checkDeviationZero(a,s))return!1;let i=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID);if(!1===this.weightIdValid(i))return!1;let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE);if((r.appearance===T.EnumAppearance.ENABLED||r.appearance===T.EnumAppearance.ENABLED_INVALID_CFG)&&void 0!==this.checkCertificateDate(r,s))return!1;let o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY);if(void 0!==this.checkUncertaintyZero(o,s,t))return!1}let e=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE);if(!1===this.nominalValueValid(e))return!1
;let t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS);if(void 0!==this.checkNominalValue(t,e))return!1;let a=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION);if(void 0!==this.checkDeviation(t,a,e))return!1;let s=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY);if(void 0!==this.checkAccuracyWeight(e,a,s))return!1;let i=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO);if(void 0!==this.checkDeviationZero(a,i))return!1;if(void 0!==this.checkUncertaintyZero(s,i,t))return!1;if(void 0!==this.checkAccuracyCertificate(i,t))return!1;let r=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_WEIGHT_ID);if(!1===this.weightIdValid(r))return!1;let o=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_DATE)
;if((o.appearance===T.EnumAppearance.ENABLED||o.appearance===T.EnumAppearance.ENABLED_INVALID_CFG)&&void 0!==this.checkCertificateDate(o,i))return!1;if(void 0!==this.checkWeight(e,a))return!1;return this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID).appearance!==T.EnumAppearance.ENABLED_INVALID_CFG}adaptTaskHandler(){if(console.log("AdvUSPAdvanced: adaptTaskHandler"),this.taskHandler.getTask())if(this.isCreatePath()){console.log("AdvUSPAdvanced: adapt for create");const e={id:n.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.DISABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_NORM",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_NORM",args:[]},value:{selection:{id:""}},info:{options:[{id:n.NormSelectionOption.USP,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NORM_OPTION_USP",args:[]}},{id:n.NormSelectionOption.PHEUR,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NORM_OPTION_PH_EUR",
args:[]}},{id:n.NormSelectionOption.JAPANPHARMACOPOEIA,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NORM_OPTION_PH_JAP",args:[]}},{id:n.NormSelectionOption.CHINESEPHARMACOPOEIA,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NORM_OPTION_PH_CHINESE",args:[]}}]}},t={id:n.TASK_DYNAMIC_USP_ADVANCED_NUMBER_WEIGHTS_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_CFG_PARAM_TITLE_NUMBER_WEIGHTS",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_NUMBER_WEIGHTS",args:[]},value:{selection:{id:n.NumberWeightsSelectionOption.OPTION2}},info:{options:[{id:n.NumberWeightsSelectionOption.OPTION1,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NUMBER_WEIGHTS_OPTION",args:["1"]}},{id:n.NumberWeightsSelectionOption.OPTION2,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_NUMBER_WEIGHTS_OPTION",args:["2"]}}]}},a={id:n.TASK_DYNAMIC_USP_ADVANCED_SMALLEST_WEIGHT_PARAM_ID,
type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.DISABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_SMALLEST_WEIGHT",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_SMALLEST_WEIGHT",args:[]},value:{numbers:[],decimals:0,preferredDecimals:0,unit:r.unitStringToShort(r.EnumUnitStrings.g)},info:{minimum:{value:""},maximum:{value:""}}},s={id:n.TASK_DYNAMIC_USP_ADVANCED_SAFETY_FACTOR_PARAM_ID,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.DISABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_SAFETY_FACTOR",args:[]},header:{id:"_QAPP_CFG_PARAM_NUMBER_WEIGHTS_OPTION",args:["SF"]},value:{numbers:["1.00"],decimals:2,preferredDecimals:2,unit:r.unitStringToShort(r.EnumUnitStrings.none)},info:{minimum:{value:"1.00"},maximum:{value:"10.00"}}},i={id:n.TASK_DYNAMIC_USP_ADVANCED_VALUE_TO_MONITOR_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_VALUE_TO_MONITOR",args:[]},header:{
id:"_QAPP_CFG_PARAM_NUMBER_WEIGHTS_OPTION",args:["VTM"]},value:{selection:{id:n.ValueToMonitorSelectionOption.SF}},info:{options:[{id:n.ValueToMonitorSelectionOption.SF,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_TITLE_SAFETY_FACTOR",args:[]}},{id:n.ValueToMonitorSelectionOption.SFMMIN,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_TITLE_SMALLEST_WEIGHT",args:[]}}]}},l={id:n.TASK_DYNAMIC_AUTOMATIC_TAKEOVER_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_AUTO_TAKEOVER_TITLE",args:[]},header:{id:"_QAPP_CFG_PARAM_AUTO_TAKEOVER_HEADER",args:[]},value:{selection:{id:n.EnumAutoTakeoverSelectionOptions.AUTOMATIC}},info:{options:[{id:n.EnumAutoTakeoverSelectionOptions.AUTOMATIC,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_AUTO_TAKEOVER_OPTION_AUTOMATIC",args:[]}},{id:n.EnumAutoTakeoverSelectionOptions.MANUAL,appearance:T.EnumAppearance.ENABLED,text:{
id:"_QAPP_CFG_PARAM_AUTO_TAKEOVER_OPTION_MANUAL",args:[]}}]}},A={id:n.TASK_DYNAMIC_USP_ADVANCED_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_GROUP_TITLE_USP_ADVANCED_PARAMS",args:[]},parameters:[e,t,a,s,i,l]},u={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_WEIGHT_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_REPEATABILITY_WEIGHT_ID",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_WEIGHT_ID",args:[]},value:{string:""},info:{isNoValueAllowed:!1,noValueErrorMsg:"_QAPP_CFG_PARAM_CHECK_WEIGHT_ID_MIN",minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MAX,autoCut:!0}}},c={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CLASS,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_CLASS",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CLASS",args:[]},
value:{selection:{id:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE}},info:{options:[{id:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_CLASS_OPTION_FREE_INPUT",args:[]}}]}};for(let e in o.oimlClassList)c.info.options.push({id:e,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_CLASS_OPTION_CLASS",args:[o.oimlClassList[e].name]}});for(let e in o.ansiClassList)c.info.options.push({id:e,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_CLASS_OPTION_CLASS",args:[o.ansiClassList[e].name]}});const I={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_NOMINAL_VALUE",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_REPEATABILITY_NOMINAL_VALUE",args:[]},value:{numbers:[],decimals:6,preferredDecimals:6,unit:r.unitStringToShort(r.EnumUnitStrings.g)},info:{isNoValueAllowed:!1,
noValueErrorMsg:"_QAPP_CFG_PARAM_CHECK_NOMINAL_VALUE_MIN",minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,_.SartoMath.decPowers(-6),6)},maximum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,0,6)}}},d={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_NO,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_CERTIFICATE_NO",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CERTIFICATE_NO",args:[]},value:{string:""},info:{minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MAX,autoCut:!0}}},N={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_DEVIATION,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_DEVIATION",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_DEVIATION",args:[]},value:{numbers:[],decimals:6,preferredDecimals:6,unit:r.unitStringToShort(r.EnumUnitStrings.mg)},info:{
minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MIN,6)},maximum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MAX,6)},isNoValueAllowed:!0}},p={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_UNCERTAINTY,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_UNCERTAINTY",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_UNCERTAINTY",args:[]},value:{numbers:["0.000000"],decimals:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,preferredDecimals:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,unit:r.unitStringToShort(r.EnumUnitStrings.g)},info:{minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MIN,n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS)},maximum:{
value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G,n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS)}}},S={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_CERTIFICATE_DATE,type:T.EnumParameterTypes.PARAM_DATE_TIME,appearance:T.EnumAppearance.DISABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_CERTIFICATE_DATE",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CERTIFICATE_DATE",args:[]},value:{timestamp:0},info:{isDate:!0,isTime:!1}},m={id:n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_SET_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_SET_ID",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_SET_ID",args:[]},value:{string:""},info:{minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MAX,autoCut:!0}}},R={id:n.TASK_DYNAMIC_REPEATABILITY_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{
id:"_QAPP_CFG_GROUP_TITLE_REPEATABILITY_WEIGHT",args:[]},parameters:[u,c,I,d,N,p,S,m]},P={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_WEIGHT_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_ACCURACY_WEIGHT_ID",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_WEIGHT_ID",args:[]},value:{string:""},info:{isNoValueAllowed:!1,noValueErrorMsg:"_QAPP_CFG_PARAM_CHECK_WEIGHT_ID_MIN",minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_WEIGHT_ID_MAX,autoCut:!0}}},D={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CLASS,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_CLASS",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CLASS",args:[]},value:{selection:{id:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE}},info:{options:[{id:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE,appearance:T.EnumAppearance.ENABLED,text:{
id:"_QAPP_CFG_PARAM_CLASS_OPTION_FREE_INPUT",args:[]}}]}};for(let e in o.oimlClassList)D.info.options.push({id:e,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_CLASS_OPTION_CLASS",args:[o.oimlClassList[e].name]}});for(let e in o.ansiClassList)D.info.options.push({id:e,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_CFG_PARAM_CLASS_OPTION_CLASS",args:[o.ansiClassList[e].name]}});const C={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_NOMINAL_VALUE",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_ACCURACY_NOMINAL_VALUE",args:[]},value:{numbers:[],decimals:6,preferredDecimals:6,unit:r.unitStringToShort(r.EnumUnitStrings.g)},info:{isNoValueAllowed:!1,noValueErrorMsg:"_QAPP_CFG_PARAM_CHECK_NOMINAL_VALUE_MIN",minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,_.SartoMath.decPowers(-6),6)},maximum:{
value:E.QuantityParameter.setValueValueWithDecimals(void 0,0,6)}}},h={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_NO,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED_INVALID_CFG,title:{id:"_QAPP_CFG_PARAM_TITLE_CERTIFICATE_NO",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CERTIFICATE_NO",args:[]},value:{string:""},info:{minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_CERTIFICATE_NO_MAX,autoCut:!0}}},g={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_DEVIATION,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_DEVIATION",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_DEVIATION",args:[]},value:{numbers:[],decimals:6,preferredDecimals:6,unit:r.unitStringToShort(r.EnumUnitStrings.mg)},info:{minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MIN,6)},maximum:{
value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_DEVIATION_MAX,6)},isNoValueAllowed:!0}},M={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_UNCERTAINTY,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_UNCERTAINTY",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_UNCERTAINTY",args:[]},value:{numbers:["0.000000"],decimals:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,preferredDecimals:n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS,unit:r.unitStringToShort(r.EnumUnitStrings.g)},info:{minimum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MIN,n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS)},maximum:{value:E.QuantityParameter.setValueValueWithDecimals(void 0,n.TASK_DYNAMIC_USP_ADVANCED_UNCERTAINTY_MAX_G,n.TASK_DYNAMIC_USP_ADVANCED_CLASS_FREE_UNCERTAINTY_DECIMALS)}}},O={
id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_CERTIFICATE_DATE,type:T.EnumParameterTypes.PARAM_DATE_TIME,appearance:T.EnumAppearance.DISABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_CERTIFICATE_DATE",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_CERTIFICATE_DATE",args:[]},value:{timestamp:0},info:{isDate:!0,isTime:!1}},v={id:n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_SET_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_PARAM_TITLE_SET_ID",args:[]},header:{id:"_QAPP_CFG_PARAM_HEADER_SET_ID",args:[]},value:{string:""},info:{minimum:{length:n.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MIN},maximum:{length:n.TASK_DYNAMIC_USP_ADVANCED_SET_ID_MAX,autoCut:!0}}},L={id:n.TASK_DYNAMIC_ACCURACY_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_CFG_GROUP_TITLE_ACCURACY_WEIGHT",args:[]},parameters:[P,D,C,h,g,M,O,v]};this.taskHandler.addDynamicGroup(A),this.taskHandler.addDynamicGroup(R),this.taskHandler.addDynamicGroup(L),
this.getMinimumWeightParametersFromSettings(),this.getSmallestDesiredNetWeightParametersFromSettings(),this.getSafetyLevelParameterFromSettings(),this.subToMetrRanges(),console.log("AdvUSPAdvanced: adapt for create ...done")}else console.log("AdvUSPAdvanced: adapt for modify"),this.getMinimumWeightParametersFromSettings(),this.getSmallestDesiredNetWeightParametersFromSettings(),this.getSafetyLevelParameterFromSettings(),this.subToMetrRanges(!1),console.log("AdvUSPAdvanced: adapt for modify ...done");else this.exitError("AdvUSPAdvanced::adaptTaskHandler - task undefined, unexpectedly")}getMinimumWeightParametersFromSettings(){let e=N.perform_InternalWebserviceRequest("menuhandler",p.RestMethodsMENU_HANDLER.getParameterData,{key:"WEIGHING/CONFIGURATION/SETTINGS/MIN_WEIGHT/STANDARD",dataout:{}});if(e.isSuccess())try{let t=JSON.parse(e.rawReturns.dataout).value.selection.id.toString()
;if(t!==n.NormSelectionOption.USP&&t!==n.NormSelectionOption.PHEUR&&t!==n.NormSelectionOption.JAPANPHARMACOPOEIA&&t!==n.NormSelectionOption.CHINESEPHARMACOPOEIA){let e={type:l.EnumMessageboxType.INFO,title:{id:"_QAPP_CFG_PARAM_TITLE_NORM",args:[]},textList:[{id:"_QAPP_USP_NORM_WRONG_MESSAGE",args:[]}],buttons:[]};return(R=new S.default(this.mqttHandler)).setMessageBoxData(e),R.createButtons([P]),R.show(),!1}{const t=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_NORM_PARAM_ID);t.value.selection.id=JSON.parse(e.rawReturns.dataout).value.selection.id.toString(),this.updateTaskHandlerAndPublish(t)}}catch(e){return console.log("WebserviceProxy: response failed - wrong minimum weight procedure"),!1}return!0}getSmallestDesiredNetWeightParametersFromSettings(){let e=N.perform_InternalWebserviceRequest("menuhandler",p.RestMethodsMENU_HANDLER.getParameterData,{key:"WEIGHING/CONFIGURATION/SETTINGS/MIN_WEIGHT/VALUE",dataout:{}});if(e.isSuccess()){let t=JSON.parse(e.rawReturns.dataout)
;const a=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_SMALLEST_WEIGHT_PARAM_ID);a.value.numbers[0]=t.value.numbers[0],a.value.decimals=t.value.decimals,a.value.preferredDecimals=t.value.decimals,a.value.unit=t.value.unit,this.updateTaskHandlerAndPublish(a)}}getSafetyLevelParameterFromSettings(){let e=N.perform_InternalWebserviceRequest("menuhandler",p.RestMethodsMENU_HANDLER.getParameterData,{key:"WEIGHING/CONFIGURATION/SETTINGS/MIN_WEIGHT/SAFETY_FACTOR",dataout:{}});if(e.isSuccess()){let t=JSON.parse(e.rawReturns.dataout);const a=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_SAFETY_FACTOR_PARAM_ID);a.value.numbers[0]=t.value.numbers[0],a.value.decimals=t.value.decimals,a.value.preferredDecimals=t.value.decimals,a.value.unit=t.value.unit,this.updateTaskHandlerAndPublish(a)}}subToMetrRanges(e=!0){c.Observable.zip(this.weighingProxy.metrologyMaximum$,this.weighingProxy.lowestRangeInterval$,this.weighingProxy.highestRangeInterval$).subscribe(([t,a,s])=>{
if(this.metrMax=t,e){const e=r.convertWgtUnit(820*a.intervalValue,r.unitStringToLong(a.intervalUnit),r.EnumUnitStrings.g),i=r.convertWgtUnit(t.maxValue,r.unitStringToLong(t.maxUnit),r.EnumUnitStrings.g),o=r.calcDecimals(r.calcInterval(r.unitStringToLong(a.intervalUnit),r.EnumUnitStrings.g,a.intervalValue)),_=r.calcDecimals(r.calcInterval(r.unitStringToLong(s.intervalUnit),r.EnumUnitStrings.g,s.intervalValue)),l=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_SMALLEST_WEIGHT_PARAM_ID);l.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,i,_),l.info.minimum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,e,o),l.value.preferredDecimals=o,E.QuantityParameter.roundToDecimalPlacesAllNumbers(l),this.updateTaskHandlerAndPublish(l);const A=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_REPEATABILITY_NOMINAL_VALUE)
;A.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,r.convertWgtUnit(t.maxValue,r.unitStringToLong(t.maxUnit),r.unitStringToLong(A.value.unit)),6),this.updateTaskHandlerAndPublish(A);const u=this.taskHandler.getParameter(n.TASK_DYNAMIC_USP_ADVANCED_ACCURACY_NOMINAL_VALUE);u.info.maximum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,r.convertWgtUnit(t.maxValue,r.unitStringToLong(t.maxUnit),r.unitStringToLong(u.value.unit)),6),u.info.minimum.value=E.QuantityParameter.setValueValueWithDecimals(void 0,.05*r.convertWgtUnit(t.maxValue,r.unitStringToLong(t.maxUnit),r.unitStringToLong(u.value.unit)),6),this.updateTaskHandlerAndPublish(u)}})}}t.AdvUSPAdvancedCfgQApp=D,(new D).run(),console.log("it's time for node event loop")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const s=a(52),i=a(19),n=a(7),r=a(11),o=a(90),_=a(23),E=a(32),l=a(81),A=a(14),u=a(35),c=a(2),I=a(91),T=a(92),d=a(12),N=a(0),p=a(25),S="STATE_OVERVIEW_RESULT",m="STATE_CHECK_DATABASE",R="STATE_DATABASE_CONN_SUCCESS",P="STATE_DATABASE_CONN_FAILED",D="STATE_DATABASE_DISCONNECT",C="STATE_DATABASE_DISC_FAILED",h="BTN_OK",g="BTN_PARAM_CHANGED_YES",M="BTN_PARAM_CHANGED_NO",O="TASK/IDENTIFICATION/NAME",v="TASK/IDENTIFICATION/DESCRIPTION",L=21;let f={STATE_OVERVIEW_RESULT:{_onEnter:function(e){e.screens[o.PARAM_OVER_SCREENID].getButton(o.SAVE_BUTTON_ID).setAppearance(e.isTotalConfigValid()?N.EnumAppearance.ENABLED_PRIMARY:N.EnumAppearance.DISABLED)},_onExit:function(e){},_transTo:{},_transFrom:{STATE_ASPECT_CFG_PARAM_EDIT:U,STATE_DATABASE_DISC_FAILED:U,STATE_DISCONNECT_ASPECT_DISCONNECT:U},EV_HMI_BTN_CLICKED:function(e,t){console.log("QAppConfigBase: Button pressed: ",t.payload.buttonId),
t.payload.buttonId===o.SAVE_BUTTON_ID&&e.isTotalConfigValid()?e.paramsModified()?this.transition(e,"STATE_OVERVIEW_RESULT_PARAMS_MODIFIED"):e.storeTask()?e.suspend():this.transition(e,"STATE_OVERVIEW_RESULT_USER_ACTION"):t.payload.buttonId===o.BACK_BUTTON_ID?this.transition(e,s.STATE_ASPECT_CFG_PARAM_EDIT_REENTER):t.payload.buttonId===p.CANCEL_BUTTON_ID&&e.suspend()}},STATE_OVERVIEW_RESULT_USER_ACTION:{_onEnter:function(e){},_onExit:function(e){},_transFrom:{},_transTo:{},EV_HMI_BTN_CLICKED:function(e,t){let a=[{guardFn:function(e,t){return t.payload.buttonId===h&&(e.hideMsgBox(),e.hideLoadingScreen(),!0)},nextState:S},{guardFn:function(e,t){return t.payload.buttonId===p.CANCEL_BUTTON_ID&&(e.suspend(),!0)},nextState:""}];this.myHandler(e,a,t)}},STATE_OVERVIEW_RESULT_PARAMS_MODIFIED:{_onEnter:function(e){},_onExit:function(e){},_transFrom:{},_transTo:{},EV_HMI_BTN_CLICKED:function(e,t){t.payload.buttonId===g?(e.hideMsgBox(),
e.storeTask()?e.suspend():this.transition(e,"STATE_OVERVIEW_RESULT_USER_ACTION")):t.payload.buttonId===M&&e.suspend()}},STATE_CHECK_DATABASE:{_onEnter:function(e){e.onEnter_STATE_CHECK_DATABASE()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===m&&this.transition(e,t.payload.to)}},STATE_DATABASE_CONN_SUCCESS:{_onEnter:function(e){e.onEnter_STATE_DATABASE_CONN_SUCCESS()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===R&&this.transition(e,t.payload.to)}},STATE_DATABASE_CONN_FAILED:{_onEnter:function(e){e.onEnter_STATE_DATABASE_CONN_FAILED()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===P&&this.transition(e,t.payload.to)}},STATE_DATABASE_DISCONNECT:{_onEnter:function(e){e.addToEventQueue(new d.ImmediateEvent({from:D,to:T.STATE_DISCONNECT_ASPECT_DISCONNECT}))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){
t.payload.from===D&&this.transition(e,t.payload.to)}},STATE_DATABASE_DISC_FAILED:{_onEnter:function(e){e.onEnter_STATE_DATABASE_DISC_FAILED()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===D&&this.transition(e,t.payload.to)}}};function U(e,t){let a=e.screens[o.PARAM_OVER_SCREENID];a.readFromTaskhandler(e.taskHandler),a.getButton(o.SAVE_BUTTON_ID).setAppearance(e.isTotalConfigValid()?N.EnumAppearance.ENABLED_PRIMARY:N.EnumAppearance.DISABLED),a.getButton(o.BACK_BUTTON_ID).setAppearance(N.EnumAppearance.ENABLED_SECONDARY);let s=e.getParamOverviewTitle1(),i=e.getParamOverviewTitle2();a.setTitle1(s.id,s.args),a.setTitle2(i.id,i.args),a.show()}t.QAppConfigBase=class extends _.QAppBase{constructor(e){super(e),this.minConfigurableLID=E.TASK_DYNAMIC_ID_LID_CNT_MIN,this.maxConfigurableLID=E.TASK_DYNAMIC_ID_LID_CNT_MAX,this.minConfigurableSID=E.TASK_DYNAMIC_ID_SID_CNT_MIN,this.maxConfigurableSID=E.TASK_DYNAMIC_ID_SID_CNT_MAX,
this.hidePrintProfiles=!1,this.isTaskNameValid=!0,this.initialSettings=void 0,this.suppressModifyWarning=!1,this.dbConnectionConfig=void 0,this.cfgParamAspect=new s.ConfigParamsAspect,this.registerAspect(this.cfgParamAspect)}getSupportedDatabases(){return[]}processCLParameters(e){e.length>=4?(this.scriptPath=e[1],this.qAppOrderNumber=e[2],this.qAppVersion=e[3]):(this.qAppOrderNumber=void 0,this.qAppVersion=void 0,this.exitError("QAppConfigBase::processCLParameters - configWorkflow-Script called without QAppOrderNumber or qAppVersion parameter")),e.length>=5?(console.log("QAppConfigBase::processCLParameters - configWorkflow-Script called with taskId parameter -> modify task"),this.taskId=e[4]):(console.log("QAppConfigBase::processCLParameters - configWorkflow-Script called without taskId parameter -> create task"),this.taskId=void 0),console.log("QAppConfigBase: got qAppOrderNumber: "+this.qAppOrderNumber+"; qAppVersion : "+this.qAppVersion+"; taskId:"+this.taskId)}init(){
console.log("QAppConfigBase: init"),super.init();let e=new o.ParameterOverviewScreen(this.mqttHandler);this.registerScreen(e),console.log("QAppConfigBase: init: ...done")}postInit(){console.log("QAppConfigBase: postInit"),super.postInit(),this.cfgParamAspect.configure({isValidFn:()=>this.isTotalConfigValid(),updateTaskParameterFn:e=>this.updateTaskParameterGeneric(e),getDetailForTaskParameterFn:e=>this.getDetailForTaskParameter(e),handleParamUpdateUserActionFn:(e,t)=>this.handleParamUpdateUserActionGeneric(e,t),returnState:void 0===this.dbConnectionConfig?S:m,taskHandler:this.taskHandler})}initTaskHandler(){if(this.isCreatePath())console.log("QAppConfigBase: load task template"),this.taskHandler.setTask(this.taskMngProxy.getTaskTemplate()),this.taskHandler.getParameter(O).info.maximum.autoCut=!0,this.taskHandler.getParameter(O).info.isNoValueAllowed=!1,this.taskHandler.getParameter(v).info.maximum.autoCut=!0,this.taskHandler.getParameter(v).info.isNoValueAllowed=!1,
this.setNewTaskValues(),this.addLIDSIDParameter(),void 0!==this.dbConnectionConfig&&(this.getSupportedDatabases().length>0?this.addDatabaseConnectionParameter():this.exitError("dbConnection has been configured, but the number of supported databases is still empty (getSupportedDatabases)")),this.initialSettings=void 0;else{this.loadTask();let e=this.taskHandler.getTask();this.initialSettings=void 0!==e?c.cloneJSON(e.params):void 0}if(this.hidePrintProfiles)for(let e=1;e<=2;e++){let t=this.taskHandler.getParameter(_.TASK_PROFILE_REPORTING_ID_PREFIX+"_"+e);void 0!==t&&(t.appearance=N.EnumAppearance.HIDDEN,this.taskHandler.updateParameter(t))}this.updateLIDParams(),this.updateSIDParams()}setNewTaskValues(){console.log("QAppConfigBase: adapt basics of task parameter for create"),console.log("QAppConfigBase: set qAppId-Info for QApp in Taskinformation: "+this.qAppOrderNumber+"@"+this.qAppVersion);let e=this.taskHandler.getTask()
;e?this.qAppOrderNumber&&this.qAppVersion?(e.qappOrderNumber=this.qAppOrderNumber,e.qappVersion=this.qAppVersion):this.exitError("QAppConfigBase::setNewTaskValues - qAppOrderNumber or qAppVersion undefined in creation workflow"):this.exitError("QAppConfigBase::setNewTaskValues - task undefined, unexpectedly");let t=this.localizerProxy.getLanguage();t||(t="DEFAULT",console.log("QAppConfigBase: localizer::getLanguage() failed - fallback to "+t));let a=this.readQAppDescQTFAsJSON(t);a?(this.setDefaultTaskName(a.name),this.setDefaultTaskDescription(a.shortDescription)):(this.setDefaultTaskName("Input a name for the task."),this.setDefaultTaskDescription("Input a short description for the task."))}setDefaultTaskName(e){console.log("QAppConfigBase::setDefaultTaskName");let t=this.taskHandler.getParameter(O),a=this.taskMngProxy.getTaskNamesByOrderNumber(this.qAppOrderNumber);e=e.slice(0,t.info.maximum.length),
console.log("autocut QApp title for taskname to max "+t.info.maximum.length+" chars"),t.value.string=e,t.appearance=N.EnumAppearance.ENABLED;let s=0,i=!1;for(a=a.filter(e=>e.startsWith(t.value.string));s<L;){if(void 0===a.find(e=>e===t.value.string)){i=!0;break}if(t.value.string=`${e} (${++s})`,console.log("new task name generated: "+t.value.string),t.value.string.length>t.info.maximum.length){console.log("taskname too long while autonaming"),i=!1;break}}i?(console.log("task name finally unique"),this.isTaskNameValid=!0):(console.log("taskname finally not unique"),this.isTaskNameValid=!1,t.value.string=e,t.appearance=N.EnumAppearance.ENABLED_INVALID_CFG),this.updateTaskHandlerAndPublish(t)}setDefaultTaskDescription(e){console.log("QAppConfigBase::setDefaultTaskDescription");let t=this.taskHandler.getParameter(v);e=e.slice(0,t.info.maximum.length),t.value.string=e.slice(0,t.info.maximum.length)}provideStartFsmState(){return s.STATE_ASPECT_CFG_PARAM_EDIT_ENTER}provideFsmStates(){return f
}isCreatePath(){return!this.taskId}getParamOverviewTitle1(){return{id:this.taskHandler.getParameter(O).value.string,args:[]}}getParamOverviewTitle2(){return{id:this.taskHandler.getParameter(v).value.string,args:[]}}checkTaskNameBeforePublish(e=!1){let t=this.taskMngProxy.validateTask(this.taskHandler.getTask()).getErrorList(),a=this.taskHandler.getParameter(O);return t.some(e=>e===_.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE||e===_.TASK_ERROR_STR_TASK_NAME_EMPTY)?(e&&(a.appearance=N.EnumAppearance.ENABLED_INVALID_CFG),!1):(e&&(a.appearance=N.EnumAppearance.ENABLED),!0)}updateTaskParameterGeneric(e){console.log("QAppConfigBase: updateTaskParameterGeneric");let t=void 0;if(e.id===O)if(this.taskHandler.updateParameter(e),console.log("call taskMng - validate"),this.checkTaskNameBeforePublish())e.appearance=N.EnumAppearance.ENABLED,this.updateTaskHandlerAndPublish(e),this.isTaskNameValid=!0,t=void 0;else{e.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,this.updateTaskHandlerAndPublish(e),
this.isTaskNameValid=!1;let a=c.cloneJSON(i.ParamUpdateUserActionSimpleAccept);a.textList=[{id:_.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE,args:[]}],t={updatedParameter:e,message:a}}else if(e.id===E.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID){let a=this.updateTaskParameter(e);void 0===a||!1===a?(this.updateTaskHandlerAndPublish(e),this.updateLIDParams()):!0===a?this.updateLIDParams():t=a}else if(e.id===E.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID){let a=this.updateTaskParameter(e);void 0===a||!1===a?(this.updateTaskHandlerAndPublish(e),this.updateSIDParams()):!0===a?this.updateSIDParams():t=a}else if(e.id===E.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID)this.updateTaskHandlerAndPublish(e),this.updateDatabaseConfigParameters(e.value.selection.id),t=void 0;else if(e.id.startsWith(E.TASK_DYNAMIC_ID_GROUPS_PREFIX))this.updateTaskHandlerAndPublish(e),t=void 0;else{let a=this.updateTaskParameter(e);t=void 0===a||"boolean"==typeof a?void 0:a}return t}getDetailForTaskParameter(e){return{title:{id:"not implemented",args:[]},
params:[]}}handleParamUpdateUserActionGeneric(e,t){console.log("QAppConfigBase: handleParamUpdateUserActionGeneric");let a=!1;return a=e.updatedParameter.id===O&&t.payload.buttonId===i.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID||this.handleParamUpdateUserAction(e,t)}isTotalConfigValid(){return this.isTaskNameValid&&this.isConfigValid()}updateTaskHandlerAndPublish(e){return console.log("QAppConfigBase: updateTaskHandlerAndPublish"),e.type===N.EnumParameterTypes.PARAM_QUANTITY&&A.QuantityParameter.roundToDecimalPlaces(e),!!this.taskHandler.updateParameter(e)&&(this.cfgParamAspect.publishParameter(e),!0)}paramsModified(){if(this.suppressModifyWarning)return!1;if(void 0===this.initialSettings)return!1;{let e=this.taskHandler.getTask();return void 0!==e&&(!this.relevantParamsAreEqual(this.initialSettings,e.params)&&(this.showMessageBox({type:r.EnumMessageboxType.WARNING,title:{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_TITLE",args:[]},textList:[{
id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED",args:[]},{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_II",args:[]},{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_III",args:[]}],buttons:[{id:g,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:N.EnumAppearance.ENABLED_SECONDARY},{id:M,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:N.EnumAppearance.ENABLED_SECONDARY}]}),!0))}}storeTask(){console.log("QAppConfigBase: storeTask (create/update)");let e=this.taskHandler.getTask(),t=void 0;if(this.isCreatePath()){if(e){t=this.taskMngProxy.createTask(e);try{let e=JSON.parse(t.rawReturns.task);this.taskId=e._id}catch(e){this.taskId=void 0}}}else e&&(t=this.taskMngProxy.updateTask(e));if(t){if(t.isSuccess()){let e=t.getErrorList(),a=[];for(let t of e)console.log("QAppConfigBase::storeTask - found create/update error: "+t),a.push({id:t,args:[]});if(e.length>0){if(this.showMessageBox({type:r.EnumMessageboxType.ERROR,title:{id:"_QAPP_LIB_MSG_BOX_ERROR_STORE_UPDATE_TASK",args:[]
},textList:a,buttons:[{id:h,label:{id:n.EnumFontLabels.OK,args:[]},appearance:N.EnumAppearance.ENABLED_SECONDARY}]}),e.some(e=>e===_.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE)){this.isTaskNameValid=!1;let e=this.taskHandler.getParameter(O);e&&(e.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,this.updateTaskHandlerAndPublish(e))}else this.isTaskNameValid=!0;return!1}return!(!this.taskId||0===this.taskId.length)||(this.taskId=void 0,this.exitError("QAppConfigBase::storeTask - error creating task data (missing _id)"),!1)}return this.exitError("QAppConfigBase::storeTask - error creating/updating task data"),!1}return this.exitError("QAppConfigBase::storeTask - no result returned for store/update task - program error"),!1}hasConfigurableLIDs(){return this.maxConfigurableLID>0}hasConfigurableSIDs(){return this.maxConfigurableSID>0}hasConfigurableIDs(){return this.hasConfigurableLIDs()&&this.hasConfigurableSIDs()}addLIDSIDParameter(){
this.minConfigurableLID>this.maxConfigurableLID&&(this.minConfigurableLID=this.maxConfigurableLID),this.minConfigurableSID>this.maxConfigurableSID&&(this.minConfigurableSID=this.maxConfigurableSID);let e={id:E.TASK_DYNAMIC_ID_CNT_GROUP_ID,type:N.EnumParameterTypes.PARAM_GROUP,appearance:this.hasConfigurableIDs()?N.EnumAppearance.ENABLED:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_CNT",args:[]},parameters:[{id:E.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID,type:N.EnumParameterTypes.PARAM_SELECTION,appearance:this.hasConfigurableLIDs()?N.EnumAppearance.ENABLED:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_NUMBER_LIDS",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_NUMBER_LIDS",args:[]},value:{selection:{id:E.createIDCntOption(this.minConfigurableLID)}},info:{options:[]}},{id:E.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID,type:N.EnumParameterTypes.PARAM_SELECTION,appearance:this.hasConfigurableSIDs()?N.EnumAppearance.ENABLED:N.EnumAppearance.HIDDEN,title:{
id:"_QAPP_LIB_PARAM_TITLE_NUMBER_SIDS",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_NUMBER_SIDS",args:[]},value:{selection:{id:E.createIDCntOption(this.minConfigurableSID)}},info:{options:[]}}]};E.getConfiguredIds(e.parameters[0])>this.maxConfigurableLID&&(e.parameters[0].value.selection.id=E.createIDCntOption(this.maxConfigurableLID)),E.getConfiguredIds(e.parameters[1])>this.maxConfigurableSID&&(e.parameters[1].value.selection.id=E.createIDCntOption(this.maxConfigurableSID));for(let t=this.minConfigurableLID;t<=this.maxConfigurableLID;t++)e.parameters[0].info.options.push({id:E.createIDCntOption(t),appearance:N.EnumAppearance.ENABLED,text:{id:""+t.toFixed(0),args:[]}});for(let t=this.minConfigurableSID;t<=this.maxConfigurableSID;t++)e.parameters[1].info.options.push({id:E.createIDCntOption(t),appearance:N.EnumAppearance.ENABLED,text:{id:""+t.toFixed(0),args:[]}});let t={id:E.TASK_DYNAMIC_ID_LID_GROUP_ID,type:N.EnumParameterTypes.PARAM_GROUP,appearance:N.EnumAppearance.ENABLED,title:{
id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_LID",args:[]},parameters:[]},a=[];for(let e=1;e<=this.maxConfigurableLID;e++)a.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_LID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableLID;e++)a.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_LID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableSID;e++)a.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_SID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableSID;e++)a.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_SID",args:[e.toString()]});const s=this.localizerProxy.getTexts(a);let i=s.splice(0,this.maxConfigurableLID),n=s.splice(0,this.maxConfigurableLID),r=s.splice(0,this.maxConfigurableSID),o=s.splice(0,this.maxConfigurableSID);for(let e=1;e<=this.maxConfigurableLID;e++)t.parameters.push({id:E.createLIDParamId(e,E.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER),type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_LID_HEADER",
args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_LID_HEADER",args:[e.toFixed(0)]},value:{string:i[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_HEADER}}}),t.parameters.push({id:E.createLIDParamId(e,E.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE),type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_LID_TITLE",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_LID_TITLE",args:[e.toFixed(0)]},value:{string:n[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_TITLE}}});let _={id:E.TASK_DYNAMIC_ID_SID_GROUP_ID,type:N.EnumParameterTypes.PARAM_GROUP,appearance:N.EnumAppearance.ENABLED,title:{id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_SID",args:[]},parameters:[]};for(let e=1;e<=this.maxConfigurableSID;e++)_.parameters.push({id:E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER),type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{
id:"_QAPP_LIB_PARAM_TITLE_SID_HEADER",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_HEADER",args:[e.toFixed(0)]},value:{string:r[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_HEADER}}}),_.parameters.push({id:E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE),type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_TITLE",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_TITLE",args:[e.toFixed(0)]},value:{string:o[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_TITLE}}}),_.parameters.push({id:E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE),type:N.EnumParameterTypes.PARAM_SELECTION,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_MODE",args:[""+e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_MODE",args:[""+e.toFixed(0)]},value:{selection:{id:E.EnumSampleIdentifierOptions.ON}},info:{options:[{
id:E.EnumSampleIdentifierOptions.ON,appearance:N.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON",args:[]}},{id:E.EnumSampleIdentifierOptions.ON_AUTO_INC,appearance:N.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_INC",args:[]}},{id:E.EnumSampleIdentifierOptions.ON_AUTO_DEC,appearance:N.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_DEC",args:[]}}]}});this.taskHandler.addDynamicGroup(_),this.taskHandler.addDynamicGroup(t),this.taskHandler.addDynamicGroup(e)}updateLIDSIDParamAppearance(e,t,a){void 0!==e&&(t<=a?(console.log("QAppConfigBase::updateLIDSIDParamAppearance: configured:"+e.id),void 0!==u.checkGeneralParamRules(e)?(console.log("... invalid"),e.appearance=N.EnumAppearance.ENABLED_INVALID_CFG):(console.log("... valid"),e.appearance=N.EnumAppearance.ENABLED)):(console.log("QAppConfigBase::updateLIDSIDParamAppearance: not configured:"+e.id),e.appearance=N.EnumAppearance.HIDDEN),
this.updateTaskHandlerAndPublish(e))}updateLIDParams(){let e=this.taskHandler.getParameter(E.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID),t=E.getConfiguredIds(e);console.log("QAppConfigBase::updateLIDParams: configured LIDs: "+t);for(let e=1;e<=E.TASK_DYNAMIC_ID_LID_CNT_MAX;e++){let a=this.taskHandler.getParameter(E.createLIDParamId(e,E.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER));this.updateLIDSIDParamAppearance(a,e,t),a=this.taskHandler.getParameter(E.createLIDParamId(e,E.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE)),this.updateLIDSIDParamAppearance(a,e,t)}}updateSIDParams(){let e=this.taskHandler.getParameter(E.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID),t=E.getConfiguredIds(e);console.log("QAppConfigBase::updateLIDSIDParams: configured SIDs: "+t);for(let e=1;e<=E.TASK_DYNAMIC_ID_SID_CNT_MAX;e++){let a=this.taskHandler.getParameter(E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER));this.updateLIDSIDParamAppearance(a,e,t),
a=this.taskHandler.getParameter(E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE)),this.updateLIDSIDParamAppearance(a,e,t),a=this.taskHandler.getParameter(E.createSIDParamId(e,E.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE)),this.updateLIDSIDParamAppearance(a,e,t)}}addDatabaseConnectionParameter(){let e={id:E.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID,type:N.EnumParameterTypes.PARAM_SELECTION,appearance:this.getSupportedDatabases().length>1?N.EnumAppearance.ENABLED:N.EnumAppearance.DISABLED,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_TYPE",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_TYPE",args:[]},value:{selection:{id:this.getSupportedDatabases()[0]}},info:{options:this.getSupportedDatabases().map(e=>{let t={appearance:N.EnumAppearance.ENABLED,id:e,text:{id:"",args:[]}};switch(e){case E.EnumDatabaseTypesOptions.MSSQL:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_MSSQL";break;case E.EnumDatabaseTypesOptions.SQLITE:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_SQLITE";break
;case E.EnumDatabaseTypesOptions.POSTGRES:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_PSOTGRESQL";break;case E.EnumDatabaseTypesOptions.MYSQL:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_MYSQL";break;default:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_SQLITE"}return t})}},t={id:E.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID,type:N.EnumParameterTypes.PARAM_GROUP,appearance:N.EnumAppearance.ENABLED,title:{id:"_QAPP_LIB_GROUP_TITLE_DB_CONN_CONFIG",args:[]},parameters:[e,...this.createConfigParametersForSupportedDatabases()]};this.taskHandler.addDynamicGroup(t)}createConfigParametersForSupportedDatabases(){let e=[],t={id:E.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID,type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_USERNAME",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_USERNAME",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},a={id:E.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID,
type:N.EnumParameterTypes.PARAM_PASSWORD,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_PASSWORD",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_PASSWORD",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3},passwordLength:6},valid:!1},s={id:E.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID,type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_DATABASE",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_DATABASE",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},i={id:E.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID,type:N.EnumParameterTypes.PARAM_STRING,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_SCHEMA",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_SCHEMA",args:[]},value:{string:"public"},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},n={id:E.TASK_DYNAMIC_ID_DB_IP_PARAM_ID,type:N.EnumParameterTypes.PARAM_STRING,
appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_IP",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_IP",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},r={id:E.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID,type:N.EnumParameterTypes.PARAM_QUANTITY,appearance:N.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_PORT",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_PORT",args:[]},value:{decimals:0,numbers:[],preferredDecimals:0,unit:""},info:{isNoValueAllowed:!1,maximum:{value:"65535"},minimum:{value:"0"}},valid:!1};return this.getSupportedDatabases().forEach((o,_)=>{let E=c.cloneJSON(t),l=c.cloneJSON(a),A=c.cloneJSON(s),u=c.cloneJSON(i),I=c.cloneJSON(n),T=c.cloneJSON(r);if("sqlite"!==o){switch(E.id=`${E.id}/${o.toUpperCase()}`,l.id=`${l.id}/${o.toUpperCase()}`,A.id=`${A.id}/${o.toUpperCase()}`,u.id=`${u.id}/${o.toUpperCase()}`,I.id=`${I.id}/${o.toUpperCase()}`,T.id=`${T.id}/${o.toUpperCase()}`,o){case"postgres":T.value.numbers=["5432"]
;break;case"mssql":T.value.numbers=["1433"];break;case"mysql":T.value.numbers=["3306"]}0===_&&(E.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,l.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,A.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,u.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,I.appearance=N.EnumAppearance.ENABLED_INVALID_CFG,T.appearance=N.EnumAppearance.ENABLED_INVALID_CFG),e.push(E,l,A,u,I,T)}}),e}updateDatabaseConfigParameters(e){this.getSupportedDatabases().forEach(t=>{"sqlite"!==t&&(t===e?this.setDBTypeConfigParamsAppearance(e,N.EnumAppearance.ENABLED):this.setDBTypeConfigParamsAppearance(t,N.EnumAppearance.HIDDEN))})}setDBTypeConfigParamsAppearance(e,t,a){let s=[]
;"sqlite"===e||("postgres"===e?s=[this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_IP_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID}/${e.toUpperCase()}`)]:"mssql"===e&&(s=[this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_IP_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${E.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID}/${e.toUpperCase()}`)])),
s.forEach(e=>{void 0!==a&&(e.valid=a),t===N.EnumAppearance.HIDDEN?e.appearance!==t&&(e.appearance=t,this.updateTaskHandlerAndPublish(e)):(!1===e.valid&&(t=N.EnumAppearance.ENABLED_INVALID_CFG),e.appearance!==t&&(e.appearance=t,this.updateTaskHandlerAndPublish(e)))})}setDbConnectionConfig(e){this.dbConnectionConfig=e}onEnter_STATE_CHECK_DATABASE(){console.log("QAppConfigBase::onEnter_STATE_CHECK_DATABASE");const e=this.dbConnectionConfig;try{this.aspects[I.CONNECTION_ASPECT].configure({nextState:R,cancelState:P,qappEntities:e.qappEntities,workflow:!1,checkMigration:e.checkMigration,doMigration:e.doMigration,taskHandler:this.taskHandler,qappSpecificSqliteDatabaseLocation:void 0===e.qappSpecificSqliteDatabaseLocation||e.qappSpecificSqliteDatabaseLocation,useLogTable:void 0===e.useLogTable||e.useLogTable,syncByTypeorm:void 0!==e.syncByTypeorm&&e.syncByTypeorm})}catch(e){this.exitError("Connection Aspect not registered! Do so in the configWorkflow.")}
this.addToEventQueue(new d.ImmediateEvent({from:m,to:I.STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE}))}onEnter_STATE_DATABASE_CONN_SUCCESS(){console.log("qappConfigBase::onEnter_STATE_DATABASE_CONN_SUCCESS");try{this.aspects[T.DISCONNECT_ASPECT].configure({nextState:S,cancelState:C,connection:this.aspects[I.CONNECTION_ASPECT].getConnection()})}catch(e){this.exitError("Disconnect Aspect not registered! Do so in the configWorkflow.")}let e=this.taskHandler.getParameter(E.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,N.EnumAppearance.ENABLED,!0),this.addToEventQueue(new d.ImmediateEvent({from:R,to:D}))}onEnter_STATE_DATABASE_CONN_FAILED(){console.log("qappConfigBase::onEnter_STATE_DATABASE_CONN_FAILED");try{this.aspects[T.DISCONNECT_ASPECT].configure({nextState:S,cancelState:C,connection:this.aspects[I.CONNECTION_ASPECT].getConnection()})}catch(e){
this.exitError("Disconnect Aspect not registered! Do so in the configWorkflow.")}let e=this.taskHandler.getParameter(E.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,N.EnumAppearance.ENABLED_INVALID_CFG,!1),this.addToEventQueue(new d.ImmediateEvent({from:P,to:D}))}onEnter_STATE_DATABASE_DISC_FAILED(){let e=this.taskHandler.getParameter(E.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,N.EnumAppearance.ENABLED_INVALID_CFG,!1),this.addToEventQueue(new d.ImmediateEvent({from:D,to:S}))}handleDocuButton(){}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(0),n=a(25),r=a(2);t.PARAM_OVER_SCREENID="PARAMOVERVIEW",t.EDIT_BUTTON_ID="BTN_EDIT",t.DELETE_BUTTON_ID="BTN_DELETE",t.SAVE_BUTTON_ID="BTN_SAVE",
t.BACK_BUTTON_ID="BTN_BACK";class o extends n.ParamListBase{constructor(e){super(e),this.buttonList=[],this.title1=Object.assign({},{id:"",args:[]}),this.title2=Object.assign({},{id:"",args:[]});let a=[],s={nameId:"",label:{id:"",args:[]},appearance:i.EnumAppearance.HIDDEN,buttonId:""},o=r.cloneJSON(s);o.label.id=n.CANCEL_BUTTON_NAME,o.appearance=i.EnumAppearance.ENABLED_PRIMARY,o.buttonId=n.CANCEL_BUTTON_ID,a.push(o);let _=r.cloneJSON(s);_.label.id="_SAVE",_.buttonId=t.SAVE_BUTTON_ID,_.appearance=i.EnumAppearance.HIDDEN,a.push(_);let E=r.cloneJSON(s);E.label.id="_PREVIOUS",E.buttonId=t.BACK_BUTTON_ID,E.appearance=i.EnumAppearance.HIDDEN,a.push(E),this.createButtons(a)}createButtons(e){for(let t of e){let e=new s.Button(this.mqttHandler,this,t);this.buttonList.push(e)}}getButton(e){for(let t of this.buttonList){if(t.getButtonId()===e)return t}}setTitle1(e,t){this.title1.id===e&&this.title1.args.join()===t.join()||(this.title1.id=e,this.title1.args=t,this.publishTitle1())}
setTitle2(e,t){this.title2.id===e&&this.title2.args.join()===t.join()||(this.title2.id=e,this.title2.args=t,this.publishTitle2())}publishTitle1(){this.publishContent("TITLE1",JSON.stringify(this.title1))}publishTitle2(){this.publishContent("TITLE2",JSON.stringify(this.title2))}getTitle1(){return this.title1}getTitle2(){return this.title2}getId(){return t.PARAM_OVER_SCREENID}show(){this.createAndPublishParamsAndPage();for(let e of this.buttonList)e.getButtonId()!==n.CANCEL_BUTTON_ID&&e.show();""!==this.title1.id&&this.publishTitle1(),""!==this.title2.id&&this.publishTitle2(),super.show()}}t.ParameterOverviewScreen=o,t.default=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECTION_ASPECT="CONNECTION_ASPECT",t.STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE="STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE",function(e){e[e.MIGRATION_NEEDED=0]="MIGRATION_NEEDED",e[e.MIGRATION_NOT_NEEDED=1]="MIGRATION_NOT_NEEDED",
e[e.MIGRATION_NOT_POSSIBLE=2]="MIGRATION_NOT_POSSIBLE",e[e.MIGRATION_DONE=3]="MIGRATION_DONE",e[e.MIGRATION_FAILED=4]="MIGRATION_FAILED"}(t.EMigrationResult||(t.EMigrationResult={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISCONNECT_ASPECT="DISCONNECT_ASPECT",t.STATE_DISCONNECT_ASPECT_DISCONNECT="STATE_DISCONNECT_ASPECT_DISCONNECT"},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ansiClassList={ASTM0:{name:"ASTM 0",tolerance:{.001:{value:.005,decimals:3,value1_3:.001},.002:{value:.005,decimals:3,value1_3:.001},.003:{value:.005,decimals:3,value1_3:.001},.005:{value:.005,decimals:3,value1_3:.001},.01:{value:.005,decimals:3,value1_3:.001},.02:{value:.005,decimals:3,value1_3:.001},.03:{value:.005,decimals:3,value1_3:.001},.05:{value:.005,decimals:3,value1_3:.001},.1:{value:.005,decimals:3,value1_3:.001},.2:{value:.005,decimals:3,value1_3:.001},.3:{value:.005,decimals:3,value1_3:.001},.5:{value:.005,decimals:3,
value1_3:.001},1:{value:.017,decimals:3,value1_3:.005},2:{value:.017,decimals:3,value1_3:.005},3:{value:.017,decimals:3,value1_3:.005},5:{value:.017,decimals:3,value1_3:.005},10:{value:.025,decimals:3,value1_3:.008},20:{value:.037,decimals:3,value1_3:.012},30:{value:.037,decimals:3,value1_3:.012},50:{value:.06,decimals:3,value1_3:.02},100:{value:.13,decimals:2,value1_3:.04},200:{value:.25,decimals:2,value1_3:.08},300:{value:.38,decimals:2,value1_3:.12},500:{value:.6,decimals:2,value1_3:.2},1000:{value:1.3,decimals:1,value1_3:.4},2000:{value:2.5,decimals:1,value1_3:.8},3000:{value:3.8,decimals:1,value1_3:1.2},5000:{value:6,decimals:0,value1_3:2},10000:{value:13,decimals:0,value1_3:4},20000:{value:25,decimals:0,value1_3:8},25000:{value:31,decimals:0,value1_3:10},30000:{value:38,decimals:0,value1_3:12},50000:{value:63,decimals:0,value1_3:21},100000:void 0,200000:void 0,300000:void 0,500000:void 0,1000000:void 0,2000000:void 0,3000000:void 0,5000000:void 0}},ASTM1:{name:"ASTM 1",
tolerance:{.001:{value:.01,decimals:3,value1_3:.003},.002:{value:.01,decimals:3,value1_3:.003},.003:{value:.01,decimals:3,value1_3:.003},.005:{value:.01,decimals:3,value1_3:.003},.01:{value:.01,decimals:3,value1_3:.003},.02:{value:.01,decimals:3,value1_3:.003},.03:{value:.01,decimals:3,value1_3:.003},.05:{value:.01,decimals:3,value1_3:.003},.1:{value:.01,decimals:3,value1_3:.003},.2:{value:.01,decimals:3,value1_3:.003},.3:{value:.01,decimals:3,value1_3:.003},.5:{value:.01,decimals:3,value1_3:.003},1:{value:.034,decimals:3,value1_3:.011},2:{value:.034,decimals:3,value1_3:.011},3:{value:.034,decimals:3,value1_3:.011},5:{value:.034,decimals:3,value1_3:.011},10:{value:.05,decimals:3,value1_3:.016},20:{value:.074,decimals:3,value1_3:.024},30:{value:.074,decimals:3,value1_3:.024},50:{value:.12,decimals:2,value1_3:.04},100:{value:.25,decimals:2,value1_3:.08},200:{value:.5,decimals:2,value1_3:.16},300:{value:.75,decimals:2,value1_3:.25},500:{value:1.2,decimals:1,value1_3:.4},1000:{value:2.5,
decimals:1,value1_3:.8},2000:{value:5,decimals:1,value1_3:1.6},3000:{value:7.5,decimals:1,value1_3:2.5},5000:{value:12,decimals:0,value1_3:4},10000:{value:25,decimals:0,value1_3:8},20000:{value:50,decimals:0,value1_3:16},25000:{value:62,decimals:0,value1_3:20},30000:{value:75,decimals:0,value1_3:25},50000:{value:125,decimals:0,value1_3:41},100000:void 0,200000:void 0,300000:void 0,500000:void 0,1000000:void 0,2000000:void 0,3000000:void 0,5000000:void 0}},ASTM2:{name:"ASTM 2",tolerance:{.001:{value:.014,decimals:3,value1_3:.004},.002:{value:.014,decimals:3,value1_3:.004},.003:{value:.014,decimals:3,value1_3:.004},.005:{value:.014,decimals:3,value1_3:.004},.01:{value:.014,decimals:3,value1_3:.004},.02:{value:.014,decimals:3,value1_3:.004},.03:{value:.014,decimals:3,value1_3:.004},.05:{value:.014,decimals:3,value1_3:.004},.1:{value:.025,decimals:3,value1_3:.008},.2:{value:.025,decimals:3,value1_3:.008},.3:{value:.025,decimals:3,value1_3:.008},.5:{value:.025,decimals:3,value1_3:.008},1:{
value:.054,decimals:3,value1_3:.018},2:{value:.054,decimals:3,value1_3:.018},3:{value:.054,decimals:3,value1_3:.018},5:{value:.054,decimals:3,value1_3:.018},10:{value:.074,decimals:3,value1_3:.024},20:{value:.1,decimals:2,value1_3:.03},30:{value:.15,decimals:2,value1_3:.05},50:{value:.25,decimals:2,value1_3:.08},100:{value:.5,decimals:2,value1_3:.16},200:{value:1,decimals:1,value1_3:.3},300:{value:1.5,decimals:1,value1_3:.5},500:{value:2.5,decimals:1,value1_3:.8},1000:{value:5,decimals:1,value1_3:1.6},2000:{value:10,decimals:0,value1_3:3},3000:{value:15,decimals:0,value1_3:5},5000:{value:25,decimals:0,value1_3:8},10000:{value:50,decimals:0,value1_3:16},20000:{value:100,decimals:0,value1_3:33},25000:{value:125,decimals:0,value1_3:41},30000:{value:150,decimals:0,value1_3:50},50000:{value:250,decimals:0,value1_3:83},100000:void 0,200000:void 0,300000:void 0,500000:void 0,1000000:void 0,2000000:void 0,3000000:void 0,5000000:void 0}},ASTM3:{name:"ASTM 3",tolerance:{.001:{value:.025,
decimals:3,value1_3:.008},.002:{value:.025,decimals:3,value1_3:.008},.003:{value:.026,decimals:3,value1_3:.008},.005:{value:.028,decimals:3,value1_3:.009},.01:{value:.03,decimals:3,value1_3:.01},.02:{value:.035,decimals:3,value1_3:.011},.03:{value:.038,decimals:3,value1_3:.012},.05:{value:.042,decimals:3,value1_3:.014},.1:{value:.05,decimals:3,value1_3:.016},.2:{value:.06,decimals:3,value1_3:.02},.3:{value:.07,decimals:3,value1_3:.023},.5:{value:.08,decimals:3,value1_3:.026},1:{value:.1,decimals:2,value1_3:.03},2:{value:.13,decimals:2,value1_3:.04},3:{value:.15,decimals:2,value1_3:.05},5:{value:.18,decimals:2,value1_3:.06},10:{value:.25,decimals:2,value1_3:.08},20:{value:.35,decimals:2,value1_3:.11},30:{value:.45,decimals:2,value1_3:.15},50:{value:.6,decimals:2,value1_3:.2},100:{value:1,decimals:1,value1_3:.3},200:{value:2,decimals:1,value1_3:.6},300:{value:3,decimals:1,value1_3:1},500:{value:5,decimals:1,value1_3:1.6},1000:{value:10,decimals:0,value1_3:3},2000:{value:20,decimals:0,
value1_3:6},3000:{value:30,decimals:0,value1_3:10},5000:{value:50,decimals:0,value1_3:16},10000:{value:100,decimals:0,value1_3:33},20000:{value:200,decimals:0,value1_3:66},25000:{value:250,decimals:0,value1_3:83},30000:{value:300,decimals:0,value1_3:100},50000:{value:500,decimals:0,value1_3:166},100000:void 0,200000:void 0,300000:void 0,500000:void 0,1000000:void 0,2000000:void 0,3000000:void 0,5000000:void 0}},ASTM4:{name:"ASTM 4",tolerance:{.001:{value:.05,decimals:3,value1_3:.016},.002:{value:.05,decimals:3,value1_3:.016},.003:{value:.052,decimals:3,value1_3:.017},.005:{value:.055,decimals:3,value1_3:.018},.01:{value:.06,decimals:3,value1_3:.02},.02:{value:.07,decimals:3,value1_3:.023},.03:{value:.075,decimals:3,value1_3:.025},.05:{value:.085,decimals:3,value1_3:.028},.1:{value:.1,decimals:2,value1_3:.03},.2:{value:.12,decimals:2,value1_3:.04},.3:{value:.14,decimals:2,value1_3:.04},.5:{value:.16,decimals:2,value1_3:.05},1:{value:.2,decimals:2,value1_3:.06},2:{value:.26,decimals:2,
value1_3:.08},3:{value:.3,decimals:2,value1_3:.1},5:{value:.36,decimals:2,value1_3:.12},10:{value:.5,decimals:2,value1_3:.16},20:{value:.7,decimals:2,value1_3:.23},30:{value:.9,decimals:2,value1_3:.3},50:{value:1.2,decimals:1,value1_3:.4},100:{value:2,decimals:1,value1_3:.6},200:{value:4,decimals:1,value1_3:1.3},300:{value:6,decimals:1,value1_3:2},500:{value:10,decimals:0,value1_3:3},1000:{value:20,decimals:0,value1_3:6},2000:{value:40,decimals:0,value1_3:13},3000:{value:60,decimals:0,value1_3:20},5000:{value:100,decimals:0,value1_3:33},10000:{value:200,decimals:0,value1_3:66},20000:{value:400,decimals:0,value1_3:133},25000:{value:500,decimals:0,value1_3:166},30000:{value:600,decimals:0,value1_3:200},50000:{value:1e3,decimals:0,value1_3:333},100000:{value:2e3,decimals:0,value1_3:666},200000:{value:4e3,decimals:0,value1_3:1333},300000:{value:6e3,decimals:0,value1_3:2e3},500000:{value:1e4,decimals:0,value1_3:3333},1000000:{value:2e4,decimals:0,value1_3:6666},2000000:{value:4e4,
decimals:0,value1_3:13333},3000000:{value:6e4,decimals:0,value1_3:2e4},5000000:{value:1e5,decimals:0,value1_3:33333}}},ASTM5:{name:"ASTM 5",tolerance:{.001:{value:.05,decimals:3,value1_3:.016},.002:{value:.06,decimals:3,value1_3:.02},.003:{value:.07,decimals:3,value1_3:.023},.005:{value:.08,decimals:3,value1_3:.026},.01:{value:.1,decimals:2,value1_3:.03},.02:{value:.12,decimals:2,value1_3:.04},.03:{value:.14,decimals:2,value1_3:.04},.05:{value:.16,decimals:2,value1_3:.05},.1:{value:.2,decimals:2,value1_3:.06},.2:{value:.26,decimals:2,value1_3:.08},.3:{value:.3,decimals:2,value1_3:.1},.5:{value:.38,decimals:2,value1_3:.12},1:{value:.5,decimals:2,value1_3:.16},2:{value:.75,decimals:2,value1_3:.25},3:{value:.95,decimals:2,value1_3:.31},5:{value:1.3,decimals:1,value1_3:.4},10:{value:2,decimals:1,value1_3:.6},20:{value:3,decimals:1,value1_3:1},30:{value:4,decimals:1,value1_3:1.3},50:{value:5.6,decimals:1,value1_3:1.8},100:{value:9,decimals:0,value1_3:3},200:{value:15,decimals:0,value1_3:5},
300:{value:20,decimals:0,value1_3:6},500:{value:30,decimals:0,value1_3:10},1000:{value:50,decimals:0,value1_3:16},2000:{value:100,decimals:0,value1_3:33},3000:{value:150,decimals:0,value1_3:50},5000:{value:250,decimals:0,value1_3:83},10000:{value:500,decimals:0,value1_3:166},20000:{value:1e3,decimals:0,value1_3:333},25000:{value:1200,decimals:0,value1_3:400},30000:{value:1500,decimals:0,value1_3:500},50000:{value:2500,decimals:0,value1_3:833},100000:{value:5e3,decimals:0,value1_3:1666},200000:{value:1e4,decimals:0,value1_3:3333},300000:{value:15e3,decimals:0,value1_3:5e3},500000:{value:25e3,decimals:0,value1_3:8333},1000000:{value:5e4,decimals:0,value1_3:16666},2000000:{value:1e5,decimals:0,value1_3:33333},3000000:{value:15e4,decimals:0,value1_3:5e4},5000000:{value:25e4,decimals:0,value1_3:83333}}},ASTM6:{name:"ASTM 6",tolerance:{.001:{value:.1,decimals:2,value1_3:.03},.002:{value:.2,decimals:2,value1_3:.06},.003:{value:.2,decimals:2,value1_3:.06},.005:{value:.2,decimals:2,value1_3:.06
},.01:{value:.5,decimals:2,value1_3:.16},.02:{value:.5,decimals:2,value1_3:.16},.03:{value:.5,decimals:2,value1_3:.16},.05:{value:.5,decimals:2,value1_3:.16},.1:{value:1,decimals:1,value1_3:.3},.2:{value:1,decimals:1,value1_3:.3},.3:{value:1,decimals:1,value1_3:.3},.5:{value:1,decimals:1,value1_3:.3},1:{value:2,decimals:1,value1_3:.6},2:{value:2,decimals:1,value1_3:.6},3:{value:2,decimals:1,value1_3:.6},5:{value:2,decimals:0,value1_3:0},10:{value:2,decimals:0,value1_3:0},20:{value:3,decimals:0,value1_3:1},30:{value:5,decimals:0,value1_3:1},50:{value:7,decimals:0,value1_3:2},100:{value:10,decimals:0,value1_3:3},200:{value:20,decimals:0,value1_3:6},300:{value:30,decimals:0,value1_3:10},500:{value:50,decimals:0,value1_3:16},1000:{value:100,decimals:0,value1_3:33},2000:{value:200,decimals:0,value1_3:66},3000:{value:300,decimals:0,value1_3:100},5000:{value:500,decimals:0,value1_3:166},10000:{value:1e3,decimals:0,value1_3:333},20000:{value:2e3,decimals:0,value1_3:666},25000:{value:2500,
decimals:0,value1_3:833},30000:{value:3e3,decimals:0,value1_3:1e3},50000:{value:5e3,decimals:0,value1_3:1666},100000:{value:1e4,decimals:0,value1_3:3333},200000:{value:2e4,decimals:0,value1_3:6666},300000:{value:3e4,decimals:0,value1_3:1e4},500000:{value:5e4,decimals:0,value1_3:16666},1000000:{value:1e5,decimals:0,value1_3:33333},2000000:{value:2e5,decimals:0,value1_3:66666},3000000:{value:3e5,decimals:0,value1_3:1e5},5000000:{value:5e5,decimals:0,value1_3:166666}}},ASTM7:{name:"ASTM 7",tolerance:{.001:void 0,.002:void 0,.003:void 0,.005:void 0,.01:{value:.4,decimals:1,value1_3:.1},.02:{value:.56,decimals:2,value1_3:.18},.03:{value:.68,decimals:2,value1_3:.22},.05:{value:.88,decimals:2,value1_3:.29},.1:{value:1.2,decimals:1,value1_3:.4},.2:{value:1.8,decimals:1,value1_3:.6},.3:{value:2.2,decimals:1,value1_3:.7},.5:{value:3,decimals:1,value1_3:1},1:{value:4.5,decimals:1,value1_3:1.5},2:{value:7,decimals:1,value1_3:2.3},3:{value:9.4,decimals:1,value1_3:3.1},5:{value:13,decimals:0,
value1_3:4},10:{value:21,decimals:0,value1_3:7},20:{value:33,decimals:0,value1_3:11},30:{value:44,decimals:0,value1_3:14},50:{value:62,decimals:0,value1_3:20},100:{value:100,decimals:0,value1_3:33},200:{value:160,decimals:0,value1_3:53},300:{value:210,decimals:0,value1_3:70},500:{value:300,decimals:0,value1_3:100},1000:{value:470,decimals:0,value1_3:156},2000:{value:750,decimals:0,value1_3:250},3000:{value:1e3,decimals:0,value1_3:333},5000:{value:1400,decimals:0,value1_3:466},10000:{value:2200,decimals:0,value1_3:733},20000:{value:3800,decimals:0,value1_3:1266},25000:{value:4500,decimals:0,value1_3:1500},30000:{value:4500,decimals:0,value1_3:1500},50000:{value:7500,decimals:0,value1_3:2500},100000:{value:15e3,decimals:0,value1_3:5e3},200000:{value:3e4,decimals:0,value1_3:1e4},300000:{value:45e3,decimals:0,value1_3:15e3},500000:{value:75e3,decimals:0,value1_3:25e3},1000000:{value:15e4,decimals:0,value1_3:5e4},2000000:{value:3e5,decimals:0,value1_3:1e5},3000000:{value:45e4,decimals:0,
value1_3:15e4},5000000:{value:75e4,decimals:0,value1_3:25e4}}}},t.oimlClassList={OIMLE1:{name:"OIML E1",tolerance:{.001:{value:.003,decimals:3,value1_3:.001},.002:{value:.003,decimals:3,value1_3:.001},.005:{value:.003,decimals:3,value1_3:.001},.01:{value:.003,decimals:3,value1_3:.001},.02:{value:.003,decimals:3,value1_3:.001},.05:{value:.004,decimals:3,value1_3:.001},.1:{value:.005,decimals:3,value1_3:.001},.2:{value:.006,decimals:3,value1_3:.002},.5:{value:.008,decimals:3,value1_3:.002},1:{value:.01,decimals:3,value1_3:.003},2:{value:.012,decimals:3,value1_3:.004},5:{value:.016,decimals:3,value1_3:.005},10:{value:.02,decimals:3,value1_3:.006},20:{value:.025,decimals:3,value1_3:.008},50:{value:.03,decimals:3,value1_3:.01},100:{value:.05,decimals:2,value1_3:.01},200:{value:.1,decimals:2,value1_3:.03},500:{value:.25,decimals:2,value1_3:.08},1000:{value:.5,decimals:1,value1_3:.1},2000:{value:1,decimals:1,value1_3:.3},5000:{value:2.5,decimals:1,value1_3:.8},10000:{value:5,decimals:0,
value1_3:1},20000:{value:10,decimals:0,value1_3:3},50000:{value:25,decimals:0,value1_3:8},100000:void 0,200000:void 0,500000:void 0,1000000:void 0,2000000:void 0,5000000:void 0}},OIMLE2:{name:"OIML E2",tolerance:{.001:{value:.006,decimals:3,value1_3:.002},.002:{value:.006,decimals:3,value1_3:.002},.005:{value:.006,decimals:3,value1_3:.002},.01:{value:.008,decimals:3,value1_3:.002},.02:{value:.01,decimals:3,value1_3:.003},.05:{value:.012,decimals:3,value1_3:.004},.1:{value:.016,decimals:3,value1_3:.005},.2:{value:.02,decimals:3,value1_3:.006},.5:{value:.025,decimals:3,value1_3:.008},1:{value:.03,decimals:3,value1_3:.01},2:{value:.04,decimals:3,value1_3:.013},5:{value:.05,decimals:3,value1_3:.016},10:{value:.06,decimals:3,value1_3:.02},20:{value:.08,decimals:3,value1_3:.026},50:{value:.1,decimals:2,value1_3:.03},100:{value:.16,decimals:2,value1_3:.05},200:{value:.3,decimals:2,value1_3:.1},500:{value:.8,decimals:1,value1_3:.2},1000:{value:1.6,decimals:1,value1_3:.5},2000:{value:3,
decimals:1,value1_3:1},5000:{value:8,decimals:1,value1_3:2.6},10000:{value:16,decimals:0,value1_3:5},20000:{value:30,decimals:0,value1_3:10},50000:{value:80,decimals:0,value1_3:26},100000:{value:160,decimals:0,value1_3:53},200000:{value:300,decimals:0,value1_3:100},500000:{value:800,decimals:0,value1_3:266},1000000:{value:1600,decimals:0,value1_3:533},2000000:void 0,5000000:void 0}},OIMLF1:{name:"OIML F1",tolerance:{.001:{value:.02,decimals:2,value1_3:0},.002:{value:.02,decimals:2,value1_3:0},.005:{value:.02,decimals:2,value1_3:0},.01:{value:.025,decimals:3,value1_3:.008},.02:{value:.03,decimals:2,value1_3:.01},.05:{value:.04,decimals:2,value1_3:.01},.1:{value:.05,decimals:2,value1_3:.01},.2:{value:.06,decimals:2,value1_3:.02},.5:{value:.08,decimals:2,value1_3:.02},1:{value:.1,decimals:2,value1_3:.03},2:{value:.12,decimals:2,value1_3:.04},5:{value:.16,decimals:2,value1_3:.05},10:{value:.2,decimals:2,value1_3:.06},20:{value:.25,decimals:2,value1_3:.08},50:{value:.3,decimals:2,
value1_3:.1},100:{value:.5,decimals:1,value1_3:.1},200:{value:1,decimals:1,value1_3:.3},500:{value:2.5,decimals:1,value1_3:.8},1000:{value:5,decimals:0,value1_3:1},2000:{value:10,decimals:0,value1_3:3},5000:{value:25,decimals:0,value1_3:8},10000:{value:50,decimals:0,value1_3:16},20000:{value:100,decimals:0,value1_3:33},50000:{value:250,decimals:0,value1_3:83},100000:{value:500,decimals:0,value1_3:166},200000:{value:1e3,decimals:0,value1_3:333},500000:{value:2500,decimals:0,value1_3:833},1000000:{value:5e3,decimals:0,value1_3:1666},2000000:{value:1e4,decimals:0,value1_3:3333},5000000:{value:25e3,decimals:0,value1_3:8333}}},OIMLF2:{name:"OIML F2",tolerance:{.001:{value:.06,decimals:2,value1_3:.02},.002:{value:.06,decimals:2,value1_3:.02},.005:{value:.06,decimals:2,value1_3:.02},.01:{value:.08,decimals:2,value1_3:.02},.02:{value:.1,decimals:2,value1_3:.03},.05:{value:.12,decimals:2,value1_3:.04},.1:{value:.16,decimals:2,value1_3:.05},.2:{value:.2,decimals:2,value1_3:.06},.5:{value:.25,
decimals:2,value1_3:.08},1:{value:.3,decimals:1,value1_3:.1},2:{value:.4,decimals:1,value1_3:.1},5:{value:.5,decimals:1,value1_3:.1},10:{value:.6,decimals:1,value1_3:.2},20:{value:.8,decimals:1,value1_3:.2},50:{value:1,decimals:1,value1_3:.3},100:{value:1.6,decimals:1,value1_3:.5},200:{value:3,decimals:1,value1_3:1},500:{value:8,decimals:1,value1_3:2.6},1000:{value:16,decimals:0,value1_3:5},2000:{value:30,decimals:0,value1_3:10},5000:{value:80,decimals:0,value1_3:26},10000:{value:160,decimals:0,value1_3:53},20000:{value:300,decimals:0,value1_3:100},50000:{value:800,decimals:0,value1_3:266},100000:{value:1600,decimals:0,value1_3:533},200000:{value:3e3,decimals:0,value1_3:1e3},500000:{value:8e3,decimals:0,value1_3:2666},1000000:{value:16e3,decimals:0,value1_3:5333},2000000:{value:3e4,decimals:0,value1_3:1e4},5000000:{value:8e4,decimals:0,value1_3:26666}}},OIMLM1:{name:"OIML M1",tolerance:{.001:{value:.2,decimals:1,value1_3:0},.002:{value:.2,decimals:1,value1_3:0},.005:{value:.2,
decimals:1,value1_3:0},.01:{value:.25,decimals:2,value1_3:.08},.02:{value:.3,decimals:1,value1_3:.1},.05:{value:.4,decimals:1,value1_3:.1},.1:{value:.5,decimals:1,value1_3:.1},.2:{value:.6,decimals:1,value1_3:.2},.5:{value:.8,decimals:1,value1_3:.2},1:{value:1,decimals:1,value1_3:.3},2:{value:1.2,decimals:1,value1_3:.4},5:{value:1.6,decimals:1,value1_3:.5},10:{value:2,decimals:1,value1_3:.6},20:{value:2.5,decimals:1,value1_3:.8},50:{value:3,decimals:1,value1_3:1},100:{value:5,decimals:0,value1_3:1},200:{value:10,decimals:0,value1_3:3},500:{value:25,decimals:0,value1_3:8},1000:{value:50,decimals:0,value1_3:16},2000:{value:100,decimals:0,value1_3:33},5000:{value:250,decimals:0,value1_3:83},10000:{value:500,decimals:0,value1_3:166},20000:{value:1e3,decimals:0,value1_3:333},50000:{value:2500,decimals:0,value1_3:833},100000:{value:5e3,decimals:0,value1_3:1666},200000:{value:1e4,decimals:0,value1_3:3333},500000:{value:25e3,decimals:0,value1_3:8333},1000000:{value:5e4,decimals:0,
value1_3:16666},2000000:{value:1e5,decimals:0,value1_3:33333},5000000:{value:25e4,decimals:0,value1_3:83333}}},OIMLM1_2:{name:"OIML M1-2",tolerance:{.001:void 0,.002:void 0,.005:void 0,.01:void 0,.02:void 0,.05:void 0,.1:void 0,.2:void 0,.5:void 0,1:void 0,2:void 0,5:void 0,10:void 0,20:void 0,50:void 0,100:void 0,200:void 0,500:void 0,1000:void 0,2000:void 0,5000:void 0,10000:void 0,20000:void 0,50000:{value:5e3,decimals:0,value1_3:1666},100000:{value:1e4,decimals:0,value1_3:3333},200000:{value:2e4,decimals:0,value1_3:6666},500000:{value:5e4,decimals:0,value1_3:16666},1000000:{value:1e5,decimals:0,value1_3:33333},2000000:{value:2e5,decimals:0,value1_3:66666},5000000:{value:5e5,decimals:0,value1_3:166666}}},OIMLM2:{name:"OIML M2",tolerance:{.001:void 0,.002:void 0,.005:void 0,.01:void 0,.02:void 0,.05:void 0,.1:{value:1.6,decimals:1,value1_3:.5},.2:{value:2,decimals:1,value1_3:.6},.5:{value:2.5,decimals:1,value1_3:.8},1:{value:3,decimals:0,value1_3:1},2:{value:4,decimals:0,value1_3:1},
5:{value:5,decimals:0,value1_3:1},10:{value:6,decimals:0,value1_3:2},20:{value:8,decimals:0,value1_3:2},50:{value:10,decimals:0,value1_3:3},100:{value:16,decimals:0,value1_3:5},200:{value:30,decimals:0,value1_3:10},500:{value:80,decimals:0,value1_3:26},1000:{value:160,decimals:0,value1_3:53},2000:{value:300,decimals:0,value1_3:100},5000:{value:800,decimals:0,value1_3:266},10000:{value:1600,decimals:0,value1_3:533},20000:{value:3e3,decimals:0,value1_3:1e3},50000:{value:8e3,decimals:0,value1_3:2666},100000:{value:16e3,decimals:0,value1_3:5333},200000:{value:3e4,decimals:0,value1_3:1e4},500000:{value:8e4,decimals:0,value1_3:26666},1000000:{value:16e4,decimals:0,value1_3:53333},2000000:{value:3e5,decimals:0,value1_3:1e5},5000000:{value:8e5,decimals:0,value1_3:266666}}},OIMLM2_3:{name:"OIML M2-3",tolerance:{.001:void 0,.002:void 0,.005:void 0,.01:void 0,.02:void 0,.05:void 0,.1:void 0,.2:void 0,.5:void 0,1:void 0,2:void 0,5:void 0,10:void 0,20:void 0,50:void 0,100:void 0,200:void 0,
500:void 0,1000:void 0,2000:void 0,5000:void 0,10000:void 0,20000:void 0,50000:{value:16e3,decimals:0,value1_3:5333},100000:{value:3e4,decimals:0,value1_3:1e4},200000:{value:6e4,decimals:0,value1_3:2e4},500000:{value:16e4,decimals:0,value1_3:53333},1000000:{value:3e5,decimals:0,value1_3:1e5},2000000:{value:6e5,decimals:0,value1_3:2e5},5000000:{value:16e5,decimals:0,value1_3:533333}}},OIMLM3:{name:"OIML M3",tolerance:{.001:void 0,.002:void 0,.005:void 0,.01:void 0,.02:void 0,.05:void 0,.1:void 0,.2:void 0,.5:void 0,1:{value:10,decimals:0,value1_3:3},2:{value:12,decimals:0,value1_3:4},5:{value:16,decimals:0,value1_3:5},10:{value:20,decimals:0,value1_3:6},20:{value:25,decimals:0,value1_3:8},50:{value:30,decimals:0,value1_3:10},100:{value:50,decimals:0,value1_3:16},200:{value:100,decimals:0,value1_3:33},500:{value:250,decimals:0,value1_3:83},1000:{value:500,decimals:0,value1_3:166},2000:{value:1e3,decimals:0,value1_3:333},5000:{value:2500,decimals:0,value1_3:833},10000:{value:5e3,
decimals:0,value1_3:1666},20000:{value:1e4,decimals:0,value1_3:3333},50000:{value:25e3,decimals:0,value1_3:8333},100000:{value:5e4,decimals:0,value1_3:16666},200000:{value:1e5,decimals:0,value1_3:33333},500000:{value:25e4,decimals:0,value1_3:83333},1000000:{value:5e5,decimals:0,value1_3:166666},2000000:{value:1e6,decimals:0,value1_3:333333},5000000:{value:25e5,decimals:0,value1_3:833333}}}}}]);