diff --git a/application/src/main/data/json/system/widget_bundles/gateway_widgets.json b/application/src/main/data/json/system/widget_bundles/gateway_widgets.json index 5cf929e3ce..f24afb231d 100644 --- a/application/src/main/data/json/system/widget_bundles/gateway_widgets.json +++ b/application/src/main/data/json/system/widget_bundles/gateway_widgets.json @@ -17,6 +17,7 @@ "gateway_widgets.gateway_custom_statistics", "gateway_widgets.gateway_general_chart_statistics", "gateway_widgets.service_rpc", - "gateway_widgets.gateway_status" + "gateway_widgets.gateway_status", + "gateway_widgets.markdown_card" ] } diff --git a/application/src/main/data/json/system/widget_types/gateway_configuration.json b/application/src/main/data/json/system/widget_types/gateway_configuration.json index ab86b75a6b..b87ce49d05 100644 --- a/application/src/main/data/json/system/widget_types/gateway_configuration.json +++ b/application/src/main/data/json/system/widget_types/gateway_configuration.json @@ -17,9 +17,10 @@ "templateHtml": "\n\n", "templateCss": "", "controllerScript": "self.onInit = function() {\n}\n", + "settingsSchema": "", "dataKeySettingsSchema": "{}\n", "settingsDirective": "tb-gateway-config-widget-settings", - "defaultConfig": "{\"datasources\":[{\"type\":\"static\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"widgetTitle\":\"Gateway Configuration\",\"archiveFileName\":\"configurationGateway\"},\"title\":\"Gateway Configuration\",\"dropShadow\":true,\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"showLegend\":false,\"actions\":{}}" + "defaultConfig": "{\"datasources\":[{\"type\":\"static\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"widgetTitle\":\"Gateway Configuration\",\"archiveFileName\":\"configurationGateway\"},\"title\":\"Gateway Configuration\",\"dropShadow\":true,\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"showLegend\":false,\"actions\":{}}" }, "externalId": null, "tags": [ @@ -41,4 +42,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_configuration__single_device_.json b/application/src/main/data/json/system/widget_types/gateway_configuration__single_device_.json index f292712d85..29440d4c64 100644 --- a/application/src/main/data/json/system/widget_types/gateway_configuration__single_device_.json +++ b/application/src/main/data/json/system/widget_types/gateway_configuration__single_device_.json @@ -17,9 +17,10 @@ "templateHtml": "\n", "templateCss": "#container {\n overflow: auto;\n}\n\n.tbDatasource-container {\n margin: 5px;\n padding: 8px;\n}\n\n.tbDatasource-title {\n font-size: 1.200rem;\n font-weight: 500;\n padding-bottom: 10px;\n}\n\n.tbDatasource-table {\n width: 100%;\n box-shadow: 0 0 10px #ccc;\n border-collapse: collapse;\n white-space: nowrap;\n font-size: 1.000rem;\n color: #757575;\n}\n\n.tbDatasource-table td {\n position: relative;\n border-top: 1px solid rgba(0, 0, 0, 0.12);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n padding: 0px 18px;\n box-sizing: border-box;\n}", "controllerScript": "self.onInit = function() {\n}\n\n\nself.onDestroy = function() {\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\t\t\t\n dataKeysOptional: true,\n singleEntity: true\n };\n}\n\n", + "settingsSchema": "", "dataKeySettingsSchema": "{}\n", "settingsDirective": "tb-gateway-config-single-device-widget-settings", - "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"gatewayTitle\":\"Gateway configuration (Single device)\"},\"title\":\"Gateway configuration (Single device)\"}" + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"gatewayTitle\":\"Gateway configuration (Single device)\"},\"title\":\"Gateway configuration (Single device)\"}" }, "externalId": null, "tags": [ @@ -41,4 +42,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_connectors.json b/application/src/main/data/json/system/widget_types/gateway_connectors.json index 31570d9bc5..b295b1341f 100644 --- a/application/src/main/data/json/system/widget_types/gateway_connectors.json +++ b/application/src/main/data/json/system/widget_types/gateway_connectors.json @@ -19,7 +19,7 @@ "controllerScript": "self.onInit = function() {\n if (self.ctx.datasources && self.ctx.datasources.length) {\n self.ctx.$scope.entityId = self.ctx.datasources[0].entity.id;\n }\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.gatewayConnectors?.onDataUpdated();\n};\n\nself.typeParameters = function() {\n return {\n dataKeysOptional: true,\n singleEntity: true\n };\n}", "settingsSchema": "{}", "dataKeySettingsSchema": "{}\n", - "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway connectors\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":false,\"enableDataExport\":false,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":500},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false}" + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway connectors\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":false,\"enableDataExport\":false,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":500},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false}" }, "tags": [ "router", @@ -40,4 +40,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_custom_statistics.json b/application/src/main/data/json/system/widget_types/gateway_custom_statistics.json index dd1a8ea3ee..1781c15e90 100644 --- a/application/src/main/data/json/system/widget_types/gateway_custom_statistics.json +++ b/application/src/main/data/json/system/widget_types/gateway_custom_statistics.json @@ -44,4 +44,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_general_chart_statistics.json b/application/src/main/data/json/system/widget_types/gateway_general_chart_statistics.json index 1c89f7ae77..e6fb8c0f54 100644 --- a/application/src/main/data/json/system/widget_types/gateway_general_chart_statistics.json +++ b/application/src/main/data/json/system/widget_types/gateway_general_chart_statistics.json @@ -44,4 +44,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_general_configuration.json b/application/src/main/data/json/system/widget_types/gateway_general_configuration.json index 7449783f36..bffeedac36 100644 --- a/application/src/main/data/json/system/widget_types/gateway_general_configuration.json +++ b/application/src/main/data/json/system/widget_types/gateway_general_configuration.json @@ -18,7 +18,7 @@ "templateCss": "", "controllerScript": "self.onInit = function() {\n if (self.ctx.datasources && self.ctx.datasources.length) {\n self.ctx.$scope.entityId = self.ctx.datasources[0].entity.id;\n self.ctx.$scope.defaultTab = self.ctx.stateController?.getStateParams()?.defaultTab;\n }\n};\n\nself.typeParameters = function() {\n return {\n dataKeysOptional: true,\n singleEntity: true\n };\n}", "dataKeySettingsSchema": "{}\n", - "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway configuration\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":false,\"enableDataExport\":false,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":500},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false}" + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway configuration\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":false,\"enableDataExport\":false,\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":500},\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false}" }, "tags": [ "router", @@ -39,4 +39,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_logs.json b/application/src/main/data/json/system/widget_types/gateway_logs.json index 26eb310c7d..21675e550a 100644 --- a/application/src/main/data/json/system/widget_types/gateway_logs.json +++ b/application/src/main/data/json/system/widget_types/gateway_logs.json @@ -20,7 +20,7 @@ "settingsSchema": "{}", "dataKeySettingsSchema": "{}\n", "settingsDirective": "tb-gateway-logs-settings", - "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"selectedTab\":0,\"realtime\":{\"realtimeType\":0,\"timewindowMs\":86400000},\"aggregation\":{\"type\":\"NONE\",\"limit\":25000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway logs\",\"showTitleIcon\":false,\"dropShadow\":false,\"enableFullscreen\":true,\"widgetStyle\":{},\"widgetCss\":\"\",\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false,\"useDashboardTimewindow\":false,\"displayTimewindow\":true}" + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"hideInterval\":false,\"hideLastInterval\":false,\"hideQuickInterval\":false,\"hideAggregation\":false,\"hideAggInterval\":false,\"hideTimezone\":false,\"selectedTab\":0,\"realtime\":{\"realtimeType\":0,\"timewindowMs\":86400000,\"quickInterval\":\"CURRENT_DAY\",\"interval\":300000},\"aggregation\":{\"type\":\"AVG\",\"limit\":25000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Gateway logs\",\"showTitleIcon\":false,\"dropShadow\":false,\"enableFullscreen\":true,\"widgetStyle\":{},\"widgetCss\":\"\",\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showLegend\":false,\"useDashboardTimewindow\":false,\"displayTimewindow\":true}" }, "tags": [ "router", @@ -41,4 +41,4 @@ "ble", "bluetooth" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/json/system/widget_types/gateway_markdown_html_card.json b/application/src/main/data/json/system/widget_types/gateway_markdown_html_card.json new file mode 100644 index 0000000000..bb69b66b94 --- /dev/null +++ b/application/src/main/data/json/system/widget_types/gateway_markdown_html_card.json @@ -0,0 +1,29 @@ +{ + "fqn": "gateway_widgets.markdown_card", + "name": "Gateway Markdown/HTML Card", + "deprecated": false, + "image": "tb-image;/api/images/system/markdown_html_card_system_widget_image.png", + "description": "Renders markdown/HTML using the configurable pattern or function with applied attributes or time series values.", + "descriptor": { + "type": "latest", + "sizeX": 5, + "sizeY": 3.5, + "resources": [ + { + "url": "tb-resource;/api/resource/js_module/system/gateway-management-extension.js", + "isModule": true + } + ], + "templateHtml": "\n", + "templateCss": "#container tb-markdown-widget {\n height: 100%;\n display: block;\n}\n\n#container tb-markdown-widget .tb-markdown-view {\n height: 100%;\n overflow: auto;\n}\n", + "controllerScript": "self.onInit = function() {\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.markdownWidget.onDataUpdated();\n}\n\nself.actionSources = function() {\n return {\n 'elementClick': {\n name: 'widget-action.element-click',\n multiple: true\n }\n };\n}\n\nself.typeParameters = function() {\n return {\n dataKeysOptional: true,\n datasourcesOptional: true,\n hasDataPageLink: true\n };\n}\n\nself.onDestroy = function() {\n}\n\n", + "settingsDirective": "tb-markdown-widget-settings", + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"markdownTextPattern\":\"### Markdown/HTML card\\n - **Current entity**: ${entityName}.\\n - **Current value**: ${Random}.\",\"markdownTextFunction\":\"return '# Some title\\\\n - Entity name: ' + data[0]['entityName'];\",\"useMarkdownTextFunction\":false},\"title\":\"Markdown/HTML Card\",\"showTitleIcon\":false,\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"showLegend\":false}" + }, + "resources": null, + "scada": false, + "tags": [ + "web", + "markup" + ] +} diff --git a/application/src/main/data/json/system/widget_types/gateway_status.json b/application/src/main/data/json/system/widget_types/gateway_status.json index f7a45b2cd7..b695d5bbfd 100644 --- a/application/src/main/data/json/system/widget_types/gateway_status.json +++ b/application/src/main/data/json/system/widget_types/gateway_status.json @@ -18,7 +18,8 @@ "templateCss": "", "controllerScript": "self.onInit = function() {\n if (self.ctx.datasources && self.ctx.datasources.length) {\n self.ctx.$scope.entityId = self.ctx.datasources[0].entity.id;\n }\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.gatewayStatus?.onDataUpdated();\n};", "settingsSchema": "", - "defaultConfig": "{\"datasources\":[{\"type\":\"static\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"showTitle\":false,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"cardHtml\":\"
HTML code here
\",\"cardCss\":\".card {\\n font-weight: bold;\\n font-size: 32px;\\n color: #999;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\"},\"title\":\"HTML Card\",\"dropShadow\":true}" + "dataKeySettingsSchema": "", + "defaultConfig": "{\"datasources\":[{\"type\":\"static\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"cardHtml\":\"
HTML code here
\",\"cardCss\":\".card {\\n font-weight: bold;\\n font-size: 32px;\\n color: #999;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\"},\"title\":\"HTML Card\",\"dropShadow\":true}" }, "tags": [ "router", diff --git a/application/src/main/data/json/system/widget_types/service_rpc.json b/application/src/main/data/json/system/widget_types/service_rpc.json index eab1bccf0a..3eb8aefa34 100644 --- a/application/src/main/data/json/system/widget_types/service_rpc.json +++ b/application/src/main/data/json/system/widget_types/service_rpc.json @@ -35,4 +35,4 @@ "inter-process communication", "server request" ] -} \ No newline at end of file +} diff --git a/application/src/main/data/resources/dashboards/gateways_dashboard.json b/application/src/main/data/resources/dashboards/gateways_dashboard.json index 078f913570..4fe9e180e1 100644 --- a/application/src/main/data/resources/dashboards/gateways_dashboard.json +++ b/application/src/main/data/resources/dashboards/gateways_dashboard.json @@ -11,37 +11,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1680624762213, - "endTimeMs": 1680711162213 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -70,7 +39,6 @@ "fontWeight": 600, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -184,7 +152,6 @@ ] } ], - "displayTimewindow": true, "actions": { "actionCellButton": [ { @@ -275,9 +242,9 @@ "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", "type": "customPretty", - "customHtml": "
\r\n \r\n

Add gateway

\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Name\r\n \r\n \r\n Gateway name is required.\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n", + "customHtml": "
\r\n \r\n

Add gateway

\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Name\r\n \r\n \r\n Gateway name is required.\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n", "customCss": ".add-entity-form {\r\n min-width: 400px !important;\r\n}\r\n\r\n.add-entity-form .boolean-value-input {\r\n padding-left: 5px;\r\n}\r\n\r\n.add-entity-form .boolean-value-input .checkbox-label {\r\n margin-bottom: 8px;\r\n color: rgba(0,0,0,0.54);\r\n font-size: 12px;\r\n}\r\n\r\n.relations-list .header {\r\n padding-right: 5px;\r\n padding-bottom: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .header .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n font-size: 12px;\r\n font-weight: 700;\r\n color: rgba(0, 0, 0, .54);\r\n white-space: nowrap;\r\n}\r\n\r\n.relations-list .mat-form-field-infix {\r\n width: auto !important;\r\n}\r\n\r\n.relations-list .body {\r\n padding-right: 5px;\r\n padding-bottom: 15px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .row {\r\n padding-top: 5px;\r\n}\r\n\r\n.relations-list .body .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .md-button {\r\n margin: 0;\r\n}\r\n\r\n", - "customFunction": "let $injector = widgetContext.$scope.$injector;\r\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\r\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\r\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\r\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\r\nlet entityRelationService = $injector.get(widgetContext.servicesMap.get('entityRelationService'));\r\nlet userSettingsService = $injector.get(widgetContext.servicesMap.get('userSettingsService'));\r\n\r\nopenAddEntityDialog();\r\n\r\nfunction openAddEntityDialog() {\r\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\r\n}\r\n\r\nfunction AddEntityDialogController(instance) {\r\n let vm = instance;\r\n let userSettings;\r\n userSettingsService.loadUserSettings().subscribe(settings=> {\r\n userSettings = settings;\r\n if (!userSettings.createdGatewaysCount) userSettings.createdGatewaysCount = 0;\r\n });\r\n \r\n\r\n vm.addEntityFormGroup = vm.fb.group({\r\n entityName: ['', [vm.validators.required]],\r\n entityType: ['DEVICE'],\r\n entityLabel: [''],\r\n type: ['', [vm.validators.required]],\r\n });\r\n\r\n vm.cancel = function() {\r\n vm.dialogRef.close(null);\r\n };\r\n\r\n\r\n vm.save = function($event) {\r\n vm.addEntityFormGroup.markAsPristine();\r\n saveEntityObservable().subscribe(\r\n function (device) {\r\n widgetContext.updateAliases();\r\n userSettingsService.putUserSettings({ createdGatewaysCount: ++userSettings.createdGatewaysCount }).subscribe(_=>{\r\n });\r\n vm.dialogRef.close(null);\r\n openCommandDialog(device, $event);\r\n }\r\n );\r\n };\r\n \r\n function openCommandDialog(device, $event) {\r\n vm.device = device;\r\n let openCommandAction = widgetContext.actionsApi.getActionDescriptors(\"actionCellButton\").find(action => action.name == \"Launch command\");\r\n setTimeout(() => {\r\n widgetContext.actionsApi.handleWidgetAction($event, openCommandAction, device.id, device.name, {newDevice: true});\r\n });\r\n goToConfigState();\r\n }\r\n\r\n \r\n function goToConfigState() {\r\n const stateParams = {};\r\n stateParams.entityId = vm.device.id;\r\n stateParams.entityName = vm.device.name;\r\n const newStateParams = {\r\n targetEntityParamName: 'default',\r\n new_gateway: {\r\n entityId: vm.device.id,\r\n entityName: vm.device.name\r\n }\r\n }\r\n const params = {...stateParams, ...newStateParams};\r\n widgetContext.stateController.openState('gateway_details', params, false);\r\n }\r\n\r\n function saveEntityObservable() {\r\n const formValues = vm.addEntityFormGroup.value;\r\n let entity = {\r\n name: formValues.entityName,\r\n type: formValues.type,\r\n label: formValues.entityLabel,\r\n additionalInfo: {\r\n gateway: true\r\n }\r\n };\r\n return deviceService.saveDevice(entity);\r\n }\r\n}\r\n", + "customFunction": "let $injector = widgetContext.$scope.$injector;\r\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\r\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\r\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\r\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\r\nlet entityRelationService = $injector.get(widgetContext.servicesMap.get('entityRelationService'));\r\nlet userSettingsService = $injector.get(widgetContext.servicesMap.get('userSettingsService'));\r\n\r\nopenAddEntityDialog();\r\n\r\nfunction openAddEntityDialog() {\r\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\r\n}\r\n\r\nfunction AddEntityDialogController(instance) {\r\n let vm = instance;\r\n let userSettings;\r\n userSettingsService.loadUserSettings().subscribe(settings=> {\r\n userSettings = settings;\r\n if (!userSettings.createdGatewaysCount) userSettings.createdGatewaysCount = 0;\r\n });\r\n \r\n\r\n vm.addEntityFormGroup = vm.fb.group({\r\n entityName: ['', [vm.validators.required, vm.validators.pattern(/.*\\S.*/)]],\r\n entityType: ['DEVICE'],\r\n entityLabel: [''],\r\n type: ['', [vm.validators.required]],\r\n });\r\n\r\n vm.cancel = function() {\r\n vm.dialogRef.close(null);\r\n };\r\n\r\n\r\n vm.save = function($event) {\r\n vm.addEntityFormGroup.markAsPristine();\r\n saveEntityObservable().subscribe(\r\n function (device) {\r\n widgetContext.updateAliases();\r\n userSettingsService.putUserSettings({ createdGatewaysCount: ++userSettings.createdGatewaysCount }).subscribe(_=>{\r\n });\r\n vm.dialogRef.close(null);\r\n openCommandDialog(device, $event);\r\n }\r\n );\r\n };\r\n \r\n function openCommandDialog(device, $event) {\r\n vm.device = device;\r\n let openCommandAction = widgetContext.actionsApi.getActionDescriptors(\"actionCellButton\").find(action => action.name == \"Launch command\");\r\n setTimeout(() => {\r\n widgetContext.actionsApi.handleWidgetAction($event, openCommandAction, device.id, device.name, {newDevice: true});\r\n });\r\n goToConfigState();\r\n }\r\n\r\n \r\n function goToConfigState() {\r\n const stateParams = {};\r\n stateParams.entityId = vm.device.id;\r\n stateParams.entityName = vm.device.name;\r\n const newStateParams = {\r\n targetEntityParamName: 'default',\r\n new_gateway: {\r\n entityId: vm.device.id,\r\n entityName: vm.device.name\r\n }\r\n }\r\n const params = {...stateParams, ...newStateParams};\r\n widgetContext.stateController.openState('gateway_details', params, false);\r\n }\r\n\r\n function saveEntityObservable() {\r\n const formValues = vm.addEntityFormGroup.value;\r\n let entity = {\r\n name: formValues.entityName.trim(),\r\n type: formValues.type,\r\n label: formValues.entityLabel,\r\n additionalInfo: {\r\n gateway: true\r\n }\r\n };\r\n return deviceService.saveDevice(entity);\r\n }\r\n}\r\n", "customResources": [], "openInSeparateDialog": false, "openInPopover": false, @@ -318,37 +285,6 @@ "dataKeys": [] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1680685647526, - "endTimeMs": 1680772047526 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -369,7 +305,6 @@ "pageSize": 1024, "noDataDisplayMessage": "", "showLegend": false, - "useDashboardTimewindow": true, "borderRadius": "4px" }, "row": 0, @@ -424,37 +359,6 @@ ] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1680769601167, - "endTimeMs": 1680856001167 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#FFFFFF01", "color": "rgba(0, 0, 0, 0.87)", @@ -474,8 +378,7 @@ }, "pageSize": 1024, "noDataDisplayMessage": "", - "showLegend": false, - "useDashboardTimewindow": true + "showLegend": false }, "row": 0, "col": 0, @@ -553,8 +456,8 @@ "units": null, "decimals": null, "funcBody": null, - "usePostProcessing": true, - "postFuncBody": "var newValue = value == 'true' ? \"Active\" : \"Inactive\";\nreturn newValue;" + "usePostProcessing": false, + "postFuncBody": null }, { "name": "ALL_ERRORS_COUNT", @@ -571,6 +474,20 @@ "color": "#03a9f4", "settings": {}, "_hash": 0.007837366355011532 + }, + { + "name": "lastConnectTime", + "type": "attribute", + "label": "lastConnectTime", + "color": "#ff9800", + "settings": {} + }, + { + "name": "lastDisconnectTime", + "type": "attribute", + "label": "lastDisconnectTime", + "color": "#673ab7", + "settings": {} } ], "alarmFilterConfig": { @@ -612,37 +529,6 @@ ] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1683116949383, - "endTimeMs": 1683203349383 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -650,9 +536,9 @@ "settings": { "useMarkdownTextFunction": true, "markdownTextPattern": "# Markdown/HTML card \\n - **Current entity**: **${entityName}**. \\n - **Current value**: **${Random}**.", - "markdownTextFunction": "var blockData = '';\nvar connectorsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action => action.name == \"Connectors\");\nvar logsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action => action.name == \"Logs\");\nfunction generateMatHeader(index) {\n if (index !== undefined && index > -1) {\n return ``\n } else {\n return \"\"\n }\n}\nfunction createDataBlock(value, label, dividerStyle, mobile, index) {\n blockData += `\n \n
\n \n ${generateMatHeader(index)}\n ${label}\n
\n ${ctx.sanitizer.sanitize(1, value)}\n `;\n}\ncreateDataBlock(data[0].Status, \"Status\", data[0].Status === \"Active\" ? 'divider-green' : 'divider-red');\ncreateDataBlock(data[0].Name, \"Gateway Name\", '', ctx.isMobile);\nif (data[0].Version) {\n createDataBlock(data[0].Version, \"Gateway Version\", '');\n}\ncreateDataBlock(data[0].Type, \"Gateway Type\", '');\ncreateDataBlock(\n `${(data[1] ? data[1].count : 0)} `\n + \" | \" +\n `${(data[2] ? data[2][\"count 2\"] : 0)} `\n , \"Devices (Active | Inactive)\", '');\ncreateDataBlock(\n `${(data[0].active_connectors ? JSON.parse(data[0].active_connectors).length : 0)} `\n + \" | \" +\n `${(data[0].inactive_connectors ? JSON.parse(data[0].inactive_connectors).length : 0)} `\n , \"Connectors (Enabled | Disabled)\", '', '', connectorsIndex);\ncreateDataBlock(data[0].ALL_ERRORS_COUNT || 0, \"Errors\", (data[0].ALL_ERRORS_COUNT || 0) === 0 ? 'divider-green' : 'divider-red', '', logsIndex);\nreturn `
${blockData}
`;", + "markdownTextFunction": "var blockData = '';\n\nfunction createDataBlock(value, label, dividerStyle, mobile, id) {\n blockData += `\n \n
\n \n ${id ? `` : ``}\n ${label}\n \n ${ctx.sanitizer.sanitize(1, value)}\n
`;\n}\nconst lastConnectTime = Number(data[0].lastConnectTime);\nconst lastDisconnectTime = Number(data[0].lastDisconnectTime);\nconst isActive =\n data[0].Status === 'true' &&\n (!lastDisconnectTime || lastConnectTime > lastDisconnectTime);\ncreateDataBlock(isActive ? \"{{'gateway.active' | translate }}\" : \"{{'gateway.inactive' | translate}}\", \"{{ 'gateway.status-widget.status' | translate }}\", isActive ? \"divider-green\" : \"divider-red\");\ncreateDataBlock(data[0].Name, \"{{ 'gateway.status-widget.gateway-name' | translate }}\", '', ctx.isMobile);\n\nif (data[0].Version) {\n createDataBlock(data[0].Version, \"{{ 'gateway.status-widget.gateway-version' | translate }}\", '');\n}\n\ncreateDataBlock(data[0].Type, \"{{ 'gateway.status-widget.gateway-type' | translate }}\", '');\n\ncreateDataBlock(\n `${(data[1] ? data[1].count : 0)} `\n + \" | \" +\n `${(data[2] ? data[2][\"count 2\"] : 0)} `\n , \"{{ 'gateway.status-widget.devices' | translate }} {{ 'gateway.status-widget.active-inactive' | translate }}\", '');\n \ncreateDataBlock(\n `${(data[0].active_connectors ? JSON.parse(data[0].active_connectors).length : 0)} `\n + \" | \" +\n `${(data[0].inactive_connectors ? JSON.parse(data[0].inactive_connectors).length : 0)} `\n , \"{{ 'gateway.status-widget.connectors' | translate }} {{ 'gateway.status-widget.enabled-disabled' | translate }}\", '', '', 'connectors');\n \ncreateDataBlock(data[0].ALL_ERRORS_COUNT || 0, \"{{ 'gateway.status-widget.errors' | translate }}\", (data[0].ALL_ERRORS_COUNT || 0) === 0 ? 'divider-green' : 'divider-red', '', 'logs');\n\nreturn `
${blockData}
`;", "applyDefaultMarkdownStyle": false, - "markdownCss": ".divider {\n position: absolute;\n width: 3px;\n top: 8px;\n border-radius: 2px;\n bottom: 8px;\n border: 1px solid rgba(31, 70, 144, 1);\n background-color: rgba(31, 70, 144, 1);\n left: 10px;\n}\n.divider-green .divider {\n border: 1px solid rgb(25,128,56);\n background-color: rgb(25,128,56);\n}\n\n.divider-green .mat-mdc-card-content {\n color: rgb(25,128,56);\n}\n\n.divider-red .divider {\n border: 1px solid rgb(203,37,48);\n background-color: rgb(203,37,48);\n}\n\n.divider-red .mat-mdc-card-content {\n color: rgb(203,37,48);\n}\n\n.mdc-card {\n position: relative;\n padding-left: 10px;\n margin-bottom: 1px;\n}\n\n.mat-mdc-card-subtitle {\n font-weight: 400;\n font-size: 12px;\n}\n\n.mat-mdc-card-header {\n padding: 8px 16px 0;\n}\n\n.mat-mdc-card-content:last-child {\n padding-bottom: 8px;\n font-size: 16px;\n}\n\n.cards-container {\n height: calc(100% - 1px);\n justify-content: stretch;\n align-items: center;\n margin-bottom: 1px;\n}\n\n::ng-deep.tb-home-widget-link > div {\n flex-grow: 1;\n cursor: pointer;\n}\n\n .tb-home-widget-link {\n width: 100%;\n }\n\n .tb-home-widget-link:hover::after{\n color: inherit;\n }\n \n .tb-home-widget-link::after{\n content: 'arrow_forward';\n display: inline-block;\n transform: rotate(315deg);\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 18px;\n color: rgba(0, 0, 0, 0.12);\n vertical-align: bottom;\n margin-left: 6px;\n}" + "markdownCss": ".divider {\n position: absolute;\n width: 3px;\n top: 8px;\n border-radius: 2px;\n bottom: 8px;\n border: 1px solid rgba(31, 70, 144, 1);\n background-color: rgba(31, 70, 144, 1);\n left: 10px;\n}\n.divider-green .divider {\n border: 1px solid rgb(25,128,56);\n background-color: rgb(25,128,56);\n}\n\n.divider-green .mat-mdc-card-content {\n color: rgb(25,128,56);\n}\n\n.divider-red .divider {\n border: 1px solid rgb(203,37,48);\n background-color: rgb(203,37,48);\n}\n\n.divider-red .mat-mdc-card-content {\n color: rgb(203,37,48);\n}\n\n.mdc-card {\n position: relative;\n padding-left: 10px;\n margin-bottom: 1px;\n}\n\n.mat-mdc-card-subtitle {\n font-weight: 400;\n font-size: 12px;\n}\n\n.mat-mdc-card-header {\n padding: 8px 16px 0;\n}\n\n.mat-mdc-card-content:last-child {\n padding-bottom: 8px;\n font-size: 16px;\n}\n\n.cards-container {\n height: calc(100% - 1px);\n justify-content: stretch;\n align-items: center;\n margin-bottom: 1px;\n}\n\n::ng-deep.tb-home-widget-link > div {\n flex-grow: 1;\n}\n\n.tb-home-widget-link {\n cursor: pointer;\n width: 100%;\n}\n\n.tb-home-widget-link:hover::after{\n color: inherit;\n}\n \n.tb-home-widget-link::after{\n content: 'arrow_forward';\n display: inline-block;\n transform: rotate(315deg);\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 18px;\n color: rgba(0, 0, 0, 0.12);\n vertical-align: bottom;\n margin-left: 6px;\n}" }, "title": "Connectors", "showTitleIcon": false, @@ -667,18 +553,16 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, "margin": "0", "widgetCss": "", "pageSize": 1024, "noDataDisplayMessage": "", "enableDataExport": false, - "displayTimewindow": true, "borderRadius": "4px", "actions": { "elementClick": [ { - "name": "Connectors", + "name": "connectors", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -692,7 +576,7 @@ "id": "ee7216d8-ad7a-20db-1abc-2531e221f24c" }, { - "name": "Logs", + "name": "logs", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -711,7 +595,7 @@ "row": 0, "col": 0, "id": "79f59106-758f-c428-8b93-4341faea705d", - "typeFullFqn": "system.cards.markdown_card" + "typeFullFqn": "system.gateway_widgets.markdown_card" }, "60dcf518-8fc3-3539-8ff8-ce94bda39f3a": { "type": "alarm", @@ -872,9 +756,6 @@ } ], "timewindow": { - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false, "hideAggregation": false, "hideAggInterval": false, "hideTimezone": false, @@ -1042,7 +923,6 @@ "fontSize": "16px", "fontWeight": 400 }, - "useDashboardTimewindow": true, "showLegend": false, "actions": {}, "datasources": [], @@ -1239,7 +1119,6 @@ "fontSize": "16px", "fontWeight": 400 }, - "useDashboardTimewindow": true, "showLegend": false, "actions": {}, "datasources": [], @@ -1550,7 +1429,6 @@ "fontSize": "16px", "fontWeight": 400 }, - "useDashboardTimewindow": true, "showLegend": false, "actions": {}, "datasources": [], @@ -1584,44 +1462,13 @@ "dataKeys": [] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1685437116892, - "endTimeMs": 1685523516892 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", "padding": "8px", "settings": { "useMarkdownTextFunction": false, - "markdownTextPattern": "
\r\n \r\n
", + "markdownTextPattern": "
\r\n \r\n
", "applyDefaultMarkdownStyle": false, "markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: center;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n line-height: 36px;\n}" }, @@ -1638,11 +1485,10 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, "actions": { "elementClick": [ { - "name": "Launch command", + "name": "launchCommand", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1671,7 +1517,7 @@ "row": 0, "col": 0, "id": "fb9df382-6ef3-4aa6-bc13-8bf8e300ba19", - "typeFullFqn": "system.cards.markdown_card" + "typeFullFqn": "system.gateway_widgets.markdown_card" }, "61d149e8-b249-5526-e5d7-6ad58413982e": { "type": "latest", @@ -1704,37 +1550,6 @@ ] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1685437116892, - "endTimeMs": 1685523516892 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -1742,7 +1557,7 @@ "settings": { "useMarkdownTextFunction": true, "markdownTextPattern": "# Markdown/HTML card \\n - **Current entity**: **${entityName}**. \\n - **Current value**: **${Random}**.", - "markdownTextFunction": "let buttonsHtml = \"\" \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n let disabled = false;\n if (index == 2) {\n disabled = data[0] && data[0].RemoteLoggingLevel ? data[0].RemoteLoggingLevel == \"NONE\" : true;\n } else if (index == 3) {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = typeof conf.statistics?.enable === 'boolean' && !conf.statistics.enable;\n } else if (index == 4) {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.remoteShell;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", + "markdownTextFunction": "const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\nconst disabledLogsBtn = data[0] && data[0].RemoteLoggingLevel ? data[0].RemoteLoggingLevel == \"NONE\" : true;\nconst disabledStatisticsBtn = typeof conf.statistics?.enable === 'boolean' && !conf.statistics.enable;\nconst disabledRemoteShellBtn = !conf.remoteShell;\nreturn `
\n \n \n \n \n \n \n
`;\n", "applyDefaultMarkdownStyle": false, "markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: start;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n line-height: 36px;\n}" }, @@ -1759,11 +1574,10 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, "actions": { "elementClick": [ { - "name": "General configuration", + "name": "generalConfiguration", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1777,7 +1591,7 @@ "id": "337c767b-3217-d3d3-b955-7b0bd0858a1d" }, { - "name": "Connectors configuration", + "name": "connectorsConfiguration", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1791,7 +1605,7 @@ "id": "00469ea7-f4c4-e39d-a735-c74b6ba6a026" }, { - "name": "Logs", + "name": "logs", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1805,7 +1619,7 @@ "id": "d8607421-28b4-7c3b-949b-f69c3a46b461" }, { - "name": "Statistics", + "name": "statistics", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1824,7 +1638,7 @@ "id": "425ba0d8-8e26-18a5-881d-bebe27fb2a7a" }, { - "name": "Remote Shell", + "name": "remoteShell", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1838,7 +1652,7 @@ "id": "2c4c7dcc-009f-64eb-5f1b-a991df6d25a2" }, { - "name": "RPC", + "name": "rpc", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", @@ -1862,7 +1676,7 @@ "row": 0, "col": 0, "id": "61d149e8-b249-5526-e5d7-6ad58413982e", - "typeFullFqn": "system.cards.markdown_card" + "typeFullFqn": "system.gateway_widgets.markdown_card" }, "3d661190-7463-ba61-6793-503c85af67ec": { "type": "latest", @@ -1891,37 +1705,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1686652103417, - "endTimeMs": 1686738503417 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -1946,8 +1729,6 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, "widgetCss": "", "pageSize": 1024, "noDataDisplayMessage": "", @@ -1957,44 +1738,13 @@ "row": 0, "col": 0, "id": "3d661190-7463-ba61-6793-503c85af67ec", - "typeFullFqn": "system.cards.markdown_card" + "typeFullFqn": "system.gateway_widgets.markdown_card" }, "1615bd4e-c0a4-c32c-3706-3c83214cb8d7": { "type": "latest", "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2023,7 +1773,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2103,7 +1852,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -2138,37 +1886,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2197,7 +1914,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2277,7 +1993,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -2312,37 +2027,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2371,7 +2055,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2451,7 +2134,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -2485,37 +2167,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2544,7 +2195,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2624,7 +2274,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -2658,37 +2307,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2717,7 +2335,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2797,7 +2414,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -2831,37 +2447,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -2890,7 +2475,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -2970,7 +2554,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3004,37 +2587,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3063,7 +2615,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -3143,7 +2694,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3177,37 +2727,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3236,7 +2755,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -3316,7 +2834,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3350,37 +2867,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3409,7 +2895,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -3489,7 +2974,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3523,37 +3007,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3582,7 +3035,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -3662,7 +3114,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3696,37 +3147,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3755,7 +3175,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -3835,7 +3254,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -3869,37 +3287,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -3928,7 +3315,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4008,7 +3394,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4042,37 +3427,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -4101,7 +3455,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4181,7 +3534,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4215,37 +3567,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -4274,7 +3595,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4354,7 +3674,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4388,37 +3707,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -4447,7 +3735,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4527,7 +3814,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4561,37 +3847,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -4620,7 +3875,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4700,7 +3954,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4734,37 +3987,6 @@ "sizeX": 7.5, "sizeY": 6.5, "config": { - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1684327643501, - "endTimeMs": 1684414043501 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 200 - } - }, "showTitle": true, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -4793,7 +4015,6 @@ "fontWeight": 400, "padding": "5px 10px 5px 10px" }, - "useDashboardTimewindow": false, "showLegend": false, "datasources": [ { @@ -4873,7 +4094,6 @@ } } ], - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "widgetStyle": {}, @@ -4903,7 +4123,7 @@ "typeFullFqn": "system.cards.entities_table" }, "b4194e1e-97af-ed0b-a6a4-70011c71c579": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -4930,37 +4150,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1732109250067, - "endTimeMs": 1732195650067 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -4968,7 +4157,7 @@ "settings": { "useMarkdownTextFunction": true, "markdownTextPattern": "let buttonsHtml = \"\" \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n let disabled = false;\n if (index == 2) {\n disabled = data[0] && data[0].RemoteLoggingLevel ? data[0].RemoteLoggingLevel == \"NONE\" : true;\n } else if (index == 4) {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.remoteShell;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", - "markdownTextFunction": "const states = ['storage_statistics', 'machine_statistics', 'custom_statistics'];\nconst currentState = ctx.stateController.getStateId();\nlet buttonsHtml = \"\";\nlet disabled = false;\nconst buttonName = \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n if (states[index] === 'custom_statistics') {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.statistics?.enableCustom;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", + "markdownTextFunction": "const currentState = ctx.stateController.getStateId();\nconst conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\nconst disabled = !conf.statistics?.enableCustom;\nreturn `
\n\n\n\n
`;", "applyDefaultMarkdownStyle": false, "markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: start;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n line-height: 36px;\r\n}" }, @@ -4985,51 +4174,40 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, "actions": { "elementClick": [ { - "name": "Storage", + "name": "storage_statistics", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "storage_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, + "type": "custom", + "customFunction": "widgetContext.stateController.updateState('storage_statistics', widgetContext.stateController.getStateParams(), false);\nwidgetContext.$scope.markdownWidget.onDataUpdated();", "openInSeparateDialog": false, "openInPopover": false, - "id": "fc4c338d-5799-f7dc-9ecb-448e65f8045d" + "id": "56342fb4-e698-1db3-a8f1-34a3b44735c5" }, { - "name": "Machine", + "name": "machine_statistics", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "machine_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, + "type": "custom", + "customFunction": "widgetContext.stateController.updateState('machine_statistics', widgetContext.stateController.getStateParams(), false);\nwidgetContext.$scope.markdownWidget.onDataUpdated();", "openInSeparateDialog": false, "openInPopover": false, - "id": "b35fc758-b21a-f5d3-e968-3572f1bb9ad4" + "id": "dffa7e63-2382-12fa-ef1c-13e162b1acaf" }, { - "name": "Custom", + "name": "custom_statistics", "icon": "more_horiz", "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "custom_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, + "type": "custom", + "customFunction": "widgetContext.stateController.updateState('custom_statistics', widgetContext.stateController.getStateParams(), false);\nwidgetContext.$scope.markdownWidget.onDataUpdated();", "openInSeparateDialog": false, "openInPopover": false, - "id": "fcff099d-8164-08fd-7ffa-e1565772f368" + "id": "f6d267d0-3e3e-d519-bf7f-836fd59fd10f" } ] }, @@ -5045,7 +4223,7 @@ "id": "b4194e1e-97af-ed0b-a6a4-70011c71c579" }, "3a005e49-327c-beaa-8d19-c36b833001f0": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -5057,37 +4235,6 @@ "dataKeys": [] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733234218432, - "endTimeMs": 1733320618432 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -5191,39 +4338,6 @@ ] } ], - "timewindow": { - "hideAggregation": false, - "hideAggInterval": false, - "hideTimezone": false, - "selectedTab": 0, - "realtime": { - "realtimeType": 0, - "interval": 300000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_MONTH_SO_FAR", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 300000, - "timewindowMs": 86400000, - "fixedTimewindow": { - "startTimeMs": 1733156328824, - "endTimeMs": 1733242728824 - }, - "quickInterval": "CURRENT_MONTH_SO_FAR", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 5000 - } - }, "showTitle": true, "backgroundColor": "rgba(0, 0, 0, 0)", "color": null, @@ -5347,24 +4461,7 @@ "pageSize": 1024, "noDataDisplayMessage": "", "useDashboardTimewindow": true, - "displayTimewindow": false, "decimals": 0, - "timewindowStyle": { - "showIcon": true, - "iconSize": "24px", - "icon": null, - "iconPosition": "left", - "font": { - "size": 12, - "sizeUnit": "px", - "family": "Roboto", - "weight": "400", - "style": "normal", - "lineHeight": "16px" - }, - "color": "rgba(0, 0, 0, 0.38)", - "displayTypePrefix": false - }, "titleColor": "rgba(0, 0, 0, 0.87)", "borderRadius": "5px", "enableDataExport": false @@ -5443,39 +4540,6 @@ ] } ], - "timewindow": { - "hideAggregation": false, - "hideAggInterval": false, - "hideTimezone": false, - "selectedTab": 0, - "realtime": { - "realtimeType": 0, - "interval": 300000, - "timewindowMs": 86400000, - "quickInterval": "CURRENT_MONTH_SO_FAR", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 2, - "interval": 7200000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733156705839, - "endTimeMs": 1733243105839 - }, - "quickInterval": "CURRENT_MONTH_SO_FAR", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "NONE", - "limit": 5000 - } - }, "showTitle": true, "backgroundColor": "rgba(0, 0, 0, 0)", "color": null, @@ -5599,24 +4663,7 @@ "pageSize": 1024, "noDataDisplayMessage": "", "useDashboardTimewindow": true, - "displayTimewindow": false, "decimals": 0, - "timewindowStyle": { - "showIcon": true, - "iconSize": "24px", - "icon": null, - "iconPosition": "left", - "font": { - "size": 12, - "sizeUnit": "px", - "family": "Roboto", - "weight": "400", - "style": "normal", - "lineHeight": "16px" - }, - "color": "rgba(0, 0, 0, 0.38)", - "displayTypePrefix": false - }, "titleColor": "rgba(0, 0, 0, 0.87)", "borderRadius": "5px", "enableDataExport": false @@ -6811,37 +5858,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733240126084, - "endTimeMs": 1733326526084 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "rgb(255, 255, 255)", "color": "rgba(0, 0, 0, 0.87)", @@ -6852,8 +5868,6 @@ }, "title": "HTML Card", "dropShadow": true, - "useDashboardTimewindow": true, - "displayTimewindow": true, "enableFullscreen": false, "margin": "16px 16px 16px 0", "borderRadius": "5px", @@ -7451,7 +6465,7 @@ "id": "7543e668-35b7-bb97-2f14-163399f8d038" }, "7f3ebf9f-d967-44fe-fbe4-4667a2abcf88": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -7512,37 +6526,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733155841882, - "endTimeMs": 1733242241882 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -7567,8 +6550,6 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, "borderRadius": "5px", "widgetCss": "", "pageSize": 1024, @@ -7580,7 +6561,7 @@ "id": "7f3ebf9f-d967-44fe-fbe4-4667a2abcf88" }, "ea75a492-d149-9a53-b45f-840a0ce42a40": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -7655,37 +6636,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733155841882, - "endTimeMs": 1733242241882 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -7710,8 +6660,6 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, "borderRadius": "5px", "widgetCss": "", "pageSize": 1024, @@ -7723,7 +6671,7 @@ "id": "ea75a492-d149-9a53-b45f-840a0ce42a40" }, "13b57ab5-e5ed-701c-4c67-5bb1198e9a53": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -7798,37 +6746,6 @@ } } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733155841882, - "endTimeMs": 1733242241882 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -7853,8 +6770,6 @@ "fontWeight": 400 }, "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, "borderRadius": "5px", "widgetCss": "", "pageSize": 1024, @@ -7866,7 +6781,7 @@ "id": "13b57ab5-e5ed-701c-4c67-5bb1198e9a53" }, "867613d5-9440-fac1-9156-cd8773df5c97": { - "typeFullFqn": "system.cards.markdown_card", + "typeFullFqn": "system.gateway_widgets.markdown_card", "type": "latest", "sizeX": 5, "sizeY": 3.5, @@ -7878,37 +6793,6 @@ "dataKeys": [] } ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733234218432, - "endTimeMs": 1733320618432 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -7927,495 +6811,20 @@ "titleTooltip": "", "dropShadow": false, "enableFullscreen": false, - "widgetStyle": {}, - "titleStyle": { - "fontSize": "16px", - "fontWeight": 400 - }, - "showLegend": false, - "widgetCss": "", - "pageSize": 1024, - "noDataDisplayMessage": "", - "enableDataExport": false - }, - "row": 0, - "col": 0, - "id": "867613d5-9440-fac1-9156-cd8773df5c97" - }, - "56274c38-33fc-fe9d-aa39-ff3e1215276b": { - "typeFullFqn": "system.cards.markdown_card", - "type": "latest", - "sizeX": 5, - "sizeY": 3.5, - "config": { - "datasources": [ - { - "type": "entity", - "name": "", - "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8", - "dataKeys": [ - { - "name": "general_configuration", - "type": "attribute", - "label": "general_configuration", - "color": "#2196f3", - "settings": {}, - "_hash": 0.5374662835906896 - } - ], - "alarmFilterConfig": { - "statusList": [ - "ACTIVE" - ] - } - } - ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1732109250067, - "endTimeMs": 1732195650067 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, - "showTitle": false, - "backgroundColor": "#fff", - "color": "rgba(0, 0, 0, 0.87)", - "padding": "8px", - "settings": { - "useMarkdownTextFunction": true, - "markdownTextPattern": "let buttonsHtml = \"\" \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n let disabled = false;\n if (index == 2) {\n disabled = data[0] && data[0].RemoteLoggingLevel ? data[0].RemoteLoggingLevel == \"NONE\" : true;\n } else if (index == 4) {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.remoteShell;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", - "markdownTextFunction": "const states = ['storage_statistics', 'machine_statistics', 'custom_statistics'];\nconst currentState = ctx.stateController.getStateId();\nlet buttonsHtml = \"\";\nlet disabled = false;\nconst buttonName = \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n if (states[index] === 'custom_statistics') {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.statistics?.enableCustom;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", - "applyDefaultMarkdownStyle": false, - "markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: start;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n line-height: 36px;\r\n}" - }, - "title": "Markdown/HTML Card", - "showTitleIcon": false, - "iconColor": "rgba(0, 0, 0, 0.87)", - "iconSize": "24px", - "titleTooltip": "", - "dropShadow": true, - "enableFullscreen": false, - "widgetStyle": {}, - "titleStyle": { - "fontSize": "16px", - "fontWeight": 400 - }, - "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, - "actions": { - "elementClick": [ - { - "name": "Storage", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "storage_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "fc4c338d-5799-f7dc-9ecb-448e65f8045d" - }, - { - "name": "Machine", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "machine_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "b35fc758-b21a-f5d3-e968-3572f1bb9ad4" - }, - { - "name": "Custom", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "custom_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "10a5a4b6-71fb-f51c-2836-bb360938127f" - } - ] - }, - "borderRadius": "5px", - "widgetCss": "", - "pageSize": 1024, - "noDataDisplayMessage": "", - "margin": "16px 16px 0 0", - "enableDataExport": false - }, - "row": 0, - "col": 0, - "id": "56274c38-33fc-fe9d-aa39-ff3e1215276b" - }, - "38063fe5-1bd8-695b-a40b-92c1aed19831": { - "typeFullFqn": "system.gateway_widgets.gateway_status", - "type": "latest", - "sizeX": 7.5, - "sizeY": 3, - "config": { - "datasources": [ - { - "type": "entity", - "name": "function", - "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8", - "dataKeys": [ - { - "name": "active", - "type": "attribute", - "label": "active", - "color": "#2196f3", - "settings": {}, - "_hash": 0.07932656697286933 - }, - { - "name": "lastDisconnectTime", - "type": "attribute", - "label": "lastDisconnectTime", - "color": "#4caf50", - "settings": {}, - "_hash": 0.06662431625551446 - }, - { - "name": "lastConnectTime", - "type": "attribute", - "label": "lastConnectTime", - "color": "#f44336", - "settings": {}, - "_hash": 0.28485659401606434 - } - ], - "alarmFilterConfig": { - "statusList": [ - "ACTIVE" - ] - } - } - ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733240126084, - "endTimeMs": 1733326526084 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, - "showTitle": false, - "backgroundColor": "rgb(255, 255, 255)", - "color": "rgba(0, 0, 0, 0.87)", - "padding": "", - "settings": { - "cardHtml": "
HTML code here
", - "cardCss": ".card {\n font-weight: bold;\n font-size: 32px;\n color: #999;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}" - }, - "title": "HTML Card", - "dropShadow": true, - "useDashboardTimewindow": true, - "displayTimewindow": true, - "enableFullscreen": false, - "margin": "16px 16px 16px 0", - "borderRadius": "5px", - "widgetStyle": {}, - "widgetCss": "", - "pageSize": 1024, - "noDataDisplayMessage": "", - "enableDataExport": false - }, - "row": 0, - "col": 0, - "id": "38063fe5-1bd8-695b-a40b-92c1aed19831" - }, - "e48e7a66-a30e-2494-b0c0-dd3249944286": { - "typeFullFqn": "system.gateway_widgets.gateway_status", - "type": "latest", - "sizeX": 7.5, - "sizeY": 3, - "config": { - "datasources": [ - { - "type": "entity", - "name": "function", - "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8", - "dataKeys": [ - { - "name": "active", - "type": "attribute", - "label": "active", - "color": "#2196f3", - "settings": {}, - "_hash": 0.07932656697286933 - }, - { - "name": "lastDisconnectTime", - "type": "attribute", - "label": "lastDisconnectTime", - "color": "#4caf50", - "settings": {}, - "_hash": 0.06662431625551446 - }, - { - "name": "lastConnectTime", - "type": "attribute", - "label": "lastConnectTime", - "color": "#f44336", - "settings": {}, - "_hash": 0.28485659401606434 - } - ], - "alarmFilterConfig": { - "statusList": [ - "ACTIVE" - ] - } - } - ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1733240126084, - "endTimeMs": 1733326526084 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, - "showTitle": false, - "backgroundColor": "rgb(255, 255, 255)", - "color": "rgba(0, 0, 0, 0.87)", - "padding": "", - "settings": { - "cardHtml": "
HTML code here
", - "cardCss": ".card {\n font-weight: bold;\n font-size: 32px;\n color: #999;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}" - }, - "title": "HTML Card", - "dropShadow": true, - "useDashboardTimewindow": true, - "displayTimewindow": true, - "enableFullscreen": false, - "margin": "16px 16px 16px 0", - "borderRadius": "5px", - "widgetStyle": {}, - "widgetCss": "", - "pageSize": 1024, - "noDataDisplayMessage": "", - "enableDataExport": false - }, - "row": 0, - "col": 0, - "id": "e48e7a66-a30e-2494-b0c0-dd3249944286" - }, - "3a1f2fe6-7da9-15aa-777d-383e0ac01520": { - "typeFullFqn": "system.cards.markdown_card", - "type": "latest", - "sizeX": 5, - "sizeY": 3.5, - "config": { - "datasources": [ - { - "type": "entity", - "name": "", - "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8", - "dataKeys": [], - "alarmFilterConfig": { - "statusList": [ - "ACTIVE" - ] - } - } - ], - "timewindow": { - "displayValue": "", - "selectedTab": 0, - "realtime": { - "realtimeType": 1, - "interval": 1000, - "timewindowMs": 60000, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideQuickInterval": false - }, - "history": { - "historyType": 0, - "interval": 1000, - "timewindowMs": 60000, - "fixedTimewindow": { - "startTimeMs": 1732109250067, - "endTimeMs": 1732195650067 - }, - "quickInterval": "CURRENT_DAY", - "hideInterval": false, - "hideLastInterval": false, - "hideFixedInterval": false, - "hideQuickInterval": false - }, - "aggregation": { - "type": "AVG", - "limit": 25000 - } - }, - "showTitle": false, - "backgroundColor": "#fff", - "color": "rgba(0, 0, 0, 0.87)", - "padding": "8px", - "settings": { - "useMarkdownTextFunction": true, - "markdownTextPattern": "let buttonsHtml = \"\" \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n let disabled = false;\n if (index == 2) {\n disabled = data[0] && data[0].RemoteLoggingLevel ? data[0].RemoteLoggingLevel == \"NONE\" : true;\n } else if (index == 4) {\n const conf = data[0].general_configuration ? JSON.parse(data[0].general_configuration) : {};\n disabled = !conf.remoteShell;\n }\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", - "markdownTextFunction": "const states = ['storage_statistics', 'machine_statistics', 'custom_statistics'];\nconst currentState = ctx.stateController.getStateId();\nlet buttonsHtml = \"\";\nconst buttonName = \nctx.actionsApi.getActionDescriptors('elementClick').forEach((btn, index)=>{\n buttonsHtml += ``\n});\n\nreturn `
${buttonsHtml}
`;", - "applyDefaultMarkdownStyle": false, - "markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: start;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n line-height: 36px;\r\n}" - }, - "title": "Markdown/HTML Card", - "showTitleIcon": false, - "iconColor": "rgba(0, 0, 0, 0.87)", - "iconSize": "24px", - "titleTooltip": "", - "dropShadow": true, - "enableFullscreen": false, - "widgetStyle": {}, - "titleStyle": { - "fontSize": "16px", - "fontWeight": 400 - }, - "showLegend": false, - "useDashboardTimewindow": true, - "displayTimewindow": true, - "actions": { - "elementClick": [ - { - "name": "Storage", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "storage_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "fc4c338d-5799-f7dc-9ecb-448e65f8045d" - }, - { - "name": "Machine", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "machine_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "b35fc758-b21a-f5d3-e968-3572f1bb9ad4" - }, - { - "name": "Custom", - "icon": "more_horiz", - "useShowWidgetActionFunction": null, - "showWidgetActionFunction": "return true;", - "type": "updateDashboardState", - "targetDashboardStateId": "custom_statistics", - "setEntityId": true, - "stateEntityParamName": null, - "openRightLayout": false, - "openInSeparateDialog": false, - "openInPopover": false, - "id": "fcff099d-8164-08fd-7ffa-e1565772f368" - } - ] + "widgetStyle": {}, + "titleStyle": { + "fontSize": "16px", + "fontWeight": 400 }, - "borderRadius": "5px", + "showLegend": false, "widgetCss": "", "pageSize": 1024, "noDataDisplayMessage": "", - "margin": "16px 16px 0 0", "enableDataExport": false }, "row": 0, "col": 0, - "id": "3a1f2fe6-7da9-15aa-777d-383e0ac01520" + "id": "867613d5-9440-fac1-9156-cd8773df5c97" }, "7a34986a-ec7f-4c64-84f9-338cf1626722": { "typeFullFqn": "system.gateway_widgets.gateway_custom_statistics", @@ -8436,11 +6845,6 @@ } } ], - "timewindow": { - "realtime": { - "timewindowMs": 60000 - } - }, "showTitle": false, "backgroundColor": "#fff", "color": "rgba(0, 0, 0, 0.87)", @@ -8485,7 +6889,6 @@ }, "mobileHeight": null, "useDashboardTimewindow": true, - "displayTimewindow": true, "showTitleIcon": false, "titleTooltip": "", "margin": "16px", @@ -8499,6 +6902,146 @@ "row": 0, "col": 0, "id": "7a34986a-ec7f-4c64-84f9-338cf1626722" + }, + "699b8980-7180-3600-ec29-6af50325a2e1": { + "type": "latest", + "sizeX": 7.5, + "sizeY": 6.5, + "config": { + "showTitle": true, + "backgroundColor": "rgb(255, 255, 255)", + "color": "rgba(0, 0, 0, 0.87)", + "padding": "4px", + "settings": { + "entitiesTitle": "Devices", + "enableSearch": true, + "enableSelectColumnDisplay": true, + "enableStickyHeader": true, + "enableStickyAction": true, + "reserveSpaceForHiddenAction": "true", + "displayEntityName": true, + "entityNameColumnTitle": "Device Name", + "displayEntityLabel": false, + "displayEntityType": false, + "displayPagination": true, + "defaultPageSize": 10, + "defaultSortOrder": "entityName", + "useRowStyleFunction": false + }, + "title": "Devices", + "dropShadow": true, + "enableFullscreen": true, + "titleStyle": { + "fontSize": "16px", + "fontWeight": 400, + "padding": "5px 10px 5px 10px" + }, + "showLegend": false, + "datasources": [ + { + "type": "entity", + "name": null, + "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4", + "filterId": "774c2598-a4fe-e813-87aa-bf00b78043a3", + "dataKeys": [ + { + "name": "type", + "type": "entityField", + "label": "Device Type", + "color": "#2196f3", + "settings": {}, + "_hash": 0.3129929097366162, + "aggregationType": null, + "units": null, + "decimals": null, + "funcBody": null, + "usePostProcessing": null, + "postFuncBody": null + }, + { + "name": "active", + "type": "attribute", + "label": "Status", + "color": "#4caf50", + "settings": { + "columnWidth": "0px", + "useCellStyleFunction": false, + "useCellContentFunction": true, + "cellContentFunction": "let cssClass;\r\nswitch (value) {\r\n case \"Active\":\r\n cssClass = \"status status-active\";\r\n break;\r\n case \"Inactive\":\r\n default:\r\n cssClass = \"status status-inactive\";\r\n break;\r\n }\r\n \r\n return `${value}`;", + "defaultColumnVisibility": "visible", + "columnSelectionToDisplay": "enabled" + }, + "_hash": 0.5969880627410065, + "aggregationType": null, + "units": null, + "decimals": null, + "funcBody": null, + "usePostProcessing": true, + "postFuncBody": "return value == 'true' ? \"Active\": \"Inactive\";" + }, + { + "name": "connectorName", + "type": "attribute", + "label": "Connector Name", + "color": "#f44336", + "settings": {}, + "_hash": 0.012483045440007778, + "aggregationType": null, + "units": null, + "decimals": null, + "funcBody": null, + "usePostProcessing": null, + "postFuncBody": null + }, + { + "name": "connectorType", + "type": "attribute", + "label": "Connector Type", + "color": "#ffc107", + "settings": {}, + "_hash": 0.6004192233378134, + "aggregationType": null, + "units": null, + "decimals": null, + "funcBody": null, + "usePostProcessing": null, + "postFuncBody": null + } + ], + "alarmFilterConfig": { + "statusList": [ + "ACTIVE" + ] + } + } + ], + "showTitleIcon": false, + "titleTooltip": "", + "widgetStyle": {}, + "widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n", + "pageSize": 1024, + "noDataDisplayMessage": "", + "enableDataExport": false, + "actions": { + "actionCellButton": [ + { + "name": "Show Device Info", + "icon": "info", + "useShowWidgetActionFunction": null, + "showWidgetActionFunction": "return true;", + "type": "custom", + "customFunction": "const url = `${window.location.origin + widgetContext.utils.getEntityDetailsPageURL(entityId.id, entityId.entityType)}`;\nwindow.open(url, '_blank');", + "openInSeparateDialog": false, + "openInPopover": false, + "id": "89e0155f-c2c5-8d17-324c-280f8e11ffab" + } + ] + } + }, + "row": 0, + "col": 0, + "id": "699b8980-7180-3600-ec29-6af50325a2e1", + "typeFullFqn": "system.cards.entities_table" } }, "states": { @@ -8886,7 +7429,7 @@ "mobileOrder": 2, "mobileHeight": null }, - "56274c38-33fc-fe9d-aa39-ff3e1215276b": { + "b4194e1e-97af-ed0b-a6a4-70011c71c579": { "sizeX": 5, "sizeY": 12, "resizable": true, @@ -8895,7 +7438,7 @@ "mobileOrder": 1, "mobileHeight": 3 }, - "38063fe5-1bd8-695b-a40b-92c1aed19831": { + "bc199c75-00da-ca8a-dd0d-16da97a9fa53": { "sizeX": 5, "sizeY": 2, "row": 12, @@ -9521,31 +8064,40 @@ } } }, + "gateway_devices_knx": { + "name": "gateway_devices_knx", + "root": false, + "layouts": { + "main": { + "widgets": { + "699b8980-7180-3600-ec29-6af50325a2e1": { + "sizeX": 24, + "sizeY": 11, + "row": 0, + "col": 0 + } + }, + "gridSettings": { + "backgroundColor": "#eeeeee", + "columns": 24, + "margin": 0, + "outerMargin": true, + "backgroundSizeMode": "100%", + "autoFillHeight": false, + "backgroundImageUrl": null, + "mobileAutoFillHeight": false, + "mobileRowHeight": 70, + "layoutType": "default" + } + } + } + }, "custom_statistics": { "name": "Custom statistics", "root": false, "layouts": { "main": { "widgets": { - "e48e7a66-a30e-2494-b0c0-dd3249944286": { - "sizeX": 4, - "sizeY": 2, - "preserveAspectRatio": false, - "resizable": true, - "row": 12, - "col": 20, - "mobileOrder": 3, - "mobileHeight": 2 - }, - "3a1f2fe6-7da9-15aa-777d-383e0ac01520": { - "sizeX": 4, - "sizeY": 12, - "resizable": true, - "row": 0, - "col": 20, - "mobileOrder": 1, - "mobileHeight": 3 - }, "7a34986a-ec7f-4c64-84f9-338cf1626722": { "sizeX": 20, "sizeY": 14, @@ -9554,6 +8106,21 @@ "col": 0, "resizable": true, "mobileOrder": 2 + }, + "b4194e1e-97af-ed0b-a6a4-70011c71c579": { + "sizeX": 4, + "sizeY": 12, + "resizable": true, + "row": 0, + "col": 20 + }, + "bc199c75-00da-ca8a-dd0d-16da97a9fa53": { + "sizeX": 4, + "sizeY": 2, + "preserveAspectRatio": false, + "resizable": true, + "row": 12, + "col": 20 } }, "gridSettings": { @@ -9573,6 +8140,32 @@ } } } + }, + "gateway_status": { + "name": "gateway_status", + "root": false, + "layouts": { + "main": { + "widgets": { + "bc199c75-00da-ca8a-dd0d-16da97a9fa53": { + "sizeX": 5, + "sizeY": 3, + "preserveAspectRatio": false, + "resizable": true, + "row": 0, + "col": 0 + } + }, + "gridSettings": { + "layoutType": "default", + "backgroundColor": "#eeeeee", + "columns": 24, + "margin": 10, + "outerMargin": true, + "backgroundSizeMode": "100%" + } + } + } } }, "entityAliases": { @@ -9992,6 +8585,39 @@ ], "editable": true }, + "774c2598-a4fe-e813-87aa-bf00b78043a3": { + "id": "774c2598-a4fe-e813-87aa-bf00b78043a3", + "filter": "gateway_devices_knx", + "keyFilters": [ + { + "key": { + "type": "ATTRIBUTE", + "key": "connectorType" + }, + "valueType": "STRING", + "predicates": [ + { + "keyFilterPredicate": { + "operation": "EQUAL", + "value": { + "defaultValue": "knx", + "dynamicValue": null + }, + "ignoreCase": false, + "type": "STRING" + }, + "userInfo": { + "editable": true, + "label": "", + "autogeneratedLabel": true, + "order": 0 + } + } + ] + } + ], + "editable": true + }, "92a7d208-c143-ea20-5162-1da584532830": { "id": "92a7d208-c143-ea20-5162-1da584532830", "filter": "gateway_devices_bacnet", diff --git a/application/src/main/data/resources/js_extensions/gateway-management-extension.js b/application/src/main/data/resources/js_extensions/gateway-management-extension.js index 183f475e63..1c76094959 100644 --- a/application/src/main/data/resources/js_extensions/gateway-management-extension.js +++ b/application/src/main/data/resources/js_extensions/gateway-management-extension.js @@ -1,17 +1,17 @@ -System.register(["@angular/core","@angular/material/sort","@angular/material/table","@angular/material/paginator","@shared/public-api","@angular/common","@angular/forms","rxjs","rxjs/operators","@core/public-api","@angular/material/dialog","tslib","@angular/material/tooltip","@ngx-translate/core","@angular/cdk/collections","@ngrx/store","@angular/router","@home/components/public-api","@angular/platform-browser","@home/components/widget/widget.component","@shared/components/dialog/json-object-edit-dialog.component","@shared/import-export/import-export.service","@shared/components/popover.component","@shared/components/popover.service","@shared/decorators/coercion","@angular/material/core"],(function(e){"use strict";var t,n,i,a,r,o,s,l,p,c,d,u,m,h,g,f,y,v,x,b,w,S,C,_,T,I,E,M,k,P,D,O,A,F,R,B,N,L,V,q,G,z,U,j,H,W,$,K,Y,X,Z,Q,J,ee,te,ne,ie,ae,re,oe,se,le,pe,ce,de,ue,me,he,ge,fe,ye,ve,xe,be,we,Se,Ce,_e,Te,Ie,Ee,Me,ke,Pe,De,Oe,Ae,Fe,Re,Be,Ne,Le,Ve,qe,Ge,ze,Ue,je,He,We,$e,Ke,Ye,Xe,Ze,Qe,Je,et,tt,nt,it,at,rt,ot;return{setters:[function(e){t=e,n=e.assertInInjectionContext,i=e.inject,a=e.DestroyRef,e.ɵRuntimeError,e.ɵgetOutputDestroyRef,r=e.Injector,o=e.effect,s=e.untracked,e.assertNotInReactiveContext,e.signal,e.computed,l=e.input,p=e.output,c=e.forwardRef,d=e.ChangeDetectionStrategy,u=e.EventEmitter,m=e.booleanAttribute,h=e.ChangeDetectorRef,g=e.SecurityContext,f=e.KeyValueDiffers,y=e.ɵNG_COMP_DEF},function(e){v=e.MatSort},function(e){x=e.MatTableDataSource},function(e){b=e.MatPaginator},function(e){w=e.Direction,S=e.PageLink,C=e.DataKeyType,_=e.SharedModule,T=e,I=e.coerceBoolean,E=e.emptyPageData,M=e.isClientSideTelemetryType,k=e.TelemetrySubscriber,P=e.coerceNumber,D=e.AttributeScope,O=e.helpBaseUrl,A=e.DialogComponent,F=e.defaultLegendConfig,R=e.widgetType,B=e.NULL_UUID,N=e.DatasourceType,L=e.EntityType,V=e.ContentType,q=e.PageComponent,G=e.TbTableDatasource,z=e.HOUR,U=e.DeviceCredentialsType},function(e){j=e.CommonModule},function(e){H=e,W=e.NG_VALUE_ACCESSOR,$=e.Validators,K=e.NG_VALIDATORS,Y=e.FormBuilder,X=e.FormControl},function(e){Z=e.Observable,Q=e.ReplaySubject,J=e.shareReplay,ee=e.combineLatest,te=e.Subject,ne=e.fromEvent,ie=e.BehaviorSubject,ae=e.of,re=e.zip,oe=e.forkJoin,se=e.merge},function(e){le=e.takeUntil,pe=e.map,ce=e.distinctUntilChanged,de=e.debounceTime,ue=e.filter,me=e.tap,he=e.catchError,ge=e.publishReplay,fe=e.refCount,ye=e.take,ve=e.takeWhile,xe=e.switchMap,be=e.startWith,we=e.mergeMap},function(e){Se=e.isEqual,Ce=e.WINDOW,_e=e,Te=e.deleteNullProperties,Ie=e.DialogService,Ee=e.isNumber,Me=e.isString,ke=e.isDefinedAndNotNull,Pe=e.formatValue,De=e.isLiteralObject,Oe=e.deepClone,Ae=e.isUndefinedOrNull,Fe=e.isObject,Re=e.generateSecret,Be=e.camelCase,Ne=e.deepTrim},function(e){Le=e.MatDialog,Ve=e.MAT_DIALOG_DATA,qe=e},function(e){Ge=e.__decorate,ze=e.__extends},function(e){Ue=e,je=e.MatTooltip},function(e){He=e,We=e.TranslateService,$e=e.TranslateModule},function(e){Ke=e.SelectionModel},function(e){Ye=e},function(e){Xe=e},function(e){Ze=e.calculateAxisSize,Qe=e.measureAxisNameSize},function(e){Je=e},function(e){et=e},function(e){tt=e.JsonObjectEditDialogComponent},function(e){nt=e},function(e){it=e},function(e){at=e},function(e){rt=e.coerceBoolean},function(e){ot=e.ErrorStateMatcher}],execute:function(){e("getDefaultConfig",Ht);const st=e("jsonRequired",(e=>e.value?null:{required:!0}));var lt,pt,ct;e("GatewayLogLevel",lt),function(e){e.NONE="NONE",e.CRITICAL="CRITICAL",e.ERROR="ERROR",e.WARNING="WARNING",e.INFO="INFO",e.DEBUG="DEBUG",e.TRACE="TRACE"}(lt||e("GatewayLogLevel",lt={})),e("GatewayVersion",pt),function(e){e.v3_7_3="3.7.3",e.v3_7_2="3.7.2",e.v3_7_0="3.7",e.v3_6_3="3.6.3",e.v3_6_2="3.6.2",e.v3_6_0="3.6",e.v3_5_2="3.5.2",e.Legacy="legacy"}(pt||e("GatewayVersion",pt={})),e("ConnectorType",ct),function(e){e.MQTT="mqtt",e.MODBUS="modbus",e.GRPC="grpc",e.OPCUA="opcua",e.BLE="ble",e.REQUEST="request",e.CAN="can",e.BACNET="bacnet",e.ODBC="odbc",e.REST="rest",e.SNMP="snmp",e.FTP="ftp",e.SOCKET="socket",e.XMPP="xmpp",e.OCPP="ocpp",e.CUSTOM="custom",e.KNX="knx"}(ct||e("ConnectorType",ct={}));const dt=e("GatewayConnectorDefaultTypesTranslatesMap",new Map([[ct.MQTT,"MQTT"],[ct.MODBUS,"MODBUS"],[ct.GRPC,"GRPC"],[ct.OPCUA,"OPCUA"],[ct.BLE,"BLE"],[ct.REQUEST,"REQUEST"],[ct.CAN,"CAN"],[ct.BACNET,"BACNET"],[ct.ODBC,"ODBC"],[ct.REST,"REST"],[ct.SNMP,"SNMP"],[ct.FTP,"FTP"],[ct.SOCKET,"SOCKET"],[ct.XMPP,"XMPP"],[ct.OCPP,"OCPP"],[ct.CUSTOM,"CUSTOM"],[ct.KNX,"KNX"]])),ut=e("ConnectorsTypesByVersion",new Map([[pt.v3_7_0,Object.values(ct)],[pt.Legacy,Object.values(ct).filter((e=>e!==ct.KNX))]]));var mt,ht;e("SocketEncoding",mt),function(e){e.UTF8="utf-8",e.HEX="hex",e.UTF16="utf-16",e.UTF32="utf-32",e.UTF16BE="utf-16-be",e.UTF16LE="utf-16-le",e.UTF32BE="utf-32-be",e.UTF32LE="utf-32-le"}(mt||e("SocketEncoding",mt={})),e("HTTPMethods",ht),function(e){e.DELETE="DELETE",e.GET="GET",e.HEAD="HEAD",e.OPTIONS="OPTIONS",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT"}(ht||e("HTTPMethods",ht={}));var gt={gateway:{active:"Active",address:"Address","address-required":"Address required","add-entry":"Add configuration","add-attribute":"Add attribute","add-attribute-update":"Add attribute update","add-attribute-request":"Add attribute request","add-key":"Add key","add-timeseries":"Add time series","add-mapping":"Add mapping","add-slave":"Add Slave",arguments:"Arguments","add-rpc-method":"Add method","add-rpc-request":"Add request","add-value":"Add argument","advanced-settings":"Advanced settings",application:"Application",bacnet:{"device-timeout":"Discovery timeout","network-number":"Network number","alt-responses-address":"Alternative responses address","apdu-length":"APDU Length","object-name":"Object Name","object-type":{"analog-input":"Analog Input","analog-output":"Analog Output","analog-value":"Analog Value","binary-input":"Binary Input","binary-output":"Binary Output","binary-value":"Binary Value"},"request-type":{label:"Request Type",write:"Write Property",read:"Read Property"},"property-id":{"present-value":"Present Value","status-flags":"Status Flags","cov-increment":"COV Increment","event-state":"Event State","out-of-service":"Out of Service",polarity:"Polarity","priority-array":"Priority Array","relinquish-default":"Relinquish Default","current-command-priority":"Current Command Priority","event-message-texts":"Event Message Texts","event-message-texts-config":"Event Message Texts Config","event-algorithm-inhibit-reference":"Event Algorithm Inhibit Reference","time-delay-normal":"Time Delay Normal"},segmentation:{label:"Segmentation",no:"None",both:"Both",transmit:"Transmit",receive:"Receive"}},baudrate:"Baudrate","buffer-size":"Buffer size","buffer-size-required":"Buffer size is required","buffer-size-range":"Buffer size should be greater than 0",bytesize:"Bytesize",boolean:"Boolean",bit:"Bit","bit-target-type":"Bit target type","delete-value":"Delete value","delete-argument":"Delete argument","delete-rpc-method":"Delete method","delete-rpc-request":"Delete request","delete-attribute-update":"Delete attribute update","delete-attribute-request":"Delete attribute request",advanced:"Advanced","add-device":"Add device","address-filter":"Address filter","address-filter-required":"Address filter is required","advanced-connection-settings":"Advanced connection settings","advanced-configuration-settings":"Advanced configuration settings",attributes:"Attributes","attribute-updates":"Attribute updates","attribute-on-platform":"Attribute on platform","attribute-requests":"Attribute requests","attribute-filter":"Attribute filter","attribute-filter-hint":"Filter for incoming attribute name from platform, supports regular expression.","attribute-filter-required":"Attribute filter required.","attribute-name-expression":"Attribute name expression","attribute-name-expression-required":"Attribute name expression required.","attribute-name-expression-hint":"Hint for Attribute name expression",basic:"Basic","byte-order":"Byte order","word-order":"Word order",broker:{connection:"Connection to broker",name:"Broker name","name-required":"Broker name required.","security-types":{anonymous:"Anonymous",basic:"Basic",certificates:"Certificates"}},certificate:"Certificate","CA-certificate-path":"Path to CA certificate file","path-to-CA-cert-required":"Path to CA certificate file is required.","change-connector-title":"Confirm connector change","change-connector-text":"Switching connectors will discard any unsaved changes. Continue?","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","add-connector":"Add connector","connector-add":"Add new connector","connector-enabled":"Enable connector","connector-name":"Connector name","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","connection-timeout":"Connection timeout (s)","connect-attempt-time":"Connect attempt time (ms)","connect-attempt-count":"Connect attempt count","copy-username":"Copy username","copy-password":"Copy password","copy-client-id":"Copy client ID","connector-created":"Connector created","connector-updated":"Connector updated","create-new-one":"Create new one!","rpc-command-save-template":"Save Template","rpc-command-send":"Send","rpc-command-result":"Response","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"Use the following instruction to run IoT Gateway in Docker compose with credentials for selected device","install-docker-compose":"Use the instructions to download, install and setup docker compose",integer:"Integer",inactive:"Inactive",device:"Device",devices:"Devices","device-profile":"Device profile","device-info-settings":"Device info settings","device-info":{"entity-field":"Entity field",source:"Source",expression:"Value / Expression","expression-hint":"Show help",name:"Name","profile-name":"Profile name","device-name-expression":"Device name expression","device-name-expression-required":"Device name expression is required.","device-profile-expression-required":"Device profile expression is required."},"device-name-filter":"Device name filter","device-name-filter-hint":"This field supports regular expressions to filter incoming data by device name.","device-name-filter-required":"Device name filter is required.",details:"Details","delete-mapping-title":"Are you sure you want to delete the mapping related with '{{name}}'?","delete-mapping-description":"Be careful, after the confirmation mapping configuration and all related data will become unrecoverable.","delete-slave-title":"Are you sure you want to delete the server '{{name}}'?","delete-slave-description":"Be careful, after the confirmation server configuration and all related data will become unrecoverable.","delete-device-title":"Are you sure you want to delete the device '{{name}}'?","delete-device-description":"Be careful, after the confirmation the device configuration and all related data will become unrecoverable.",divider:"Divider","download-configuration-file":"Download configuration file","download-docker-compose":"Download docker-compose.yml for your gateway","enable-remote-logging":"Enable remote logging","ellipsis-chips-text":"+ {{count}} more","launch-gateway":"Launch gateway","launch-docker-compose":"Start the gateway using the following command in the terminal from folder with docker-compose.yml file","logs-configuration":"Logs configuration","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off","connector-duplicate-name":"Connector with such name already exists.","connection-type":"Connection type","connector-side":"Connector side","payload-type":"Payload type","platform-side":"Platform side",JSON:"JSON","JSON-hint":"Converter for this payload type processes MQTT messages in JSON format. It uses JSON Path expressions to extract vital details such as device names, device profile names, attributes, and time series from the message. And regular expressions to get device details from topics.",byte:"Byte",bytes:"Bytes","bytes-hint":"Converter for this payload type designed for binary MQTT payloads, this converter directly interprets binary data to retrieve device names and device profile names, along with attributes and time series, using specific byte positions for data extraction.",custom:"Custom","custom-hint":"This option allows you to use a custom converter for specific data tasks. You need to add your custom converter to the extension folder and enter its class name in the UI settings. Any keys you provide will be sent as configuration to your custom converter.","client-cert-path":"Path to client certificate file","path-to-client-cert-required":"Path to client certificate file is required.","client-id":"Client ID","data-conversion":"Data conversion","data-mapping":"Data mapping","data-mapping-hint":"Data mapping provides the capability to parse and convert the data received from a MQTT client in incoming messages into specific attributes and time series data keys.","opcua-data-mapping-hint":"Data mapping provides the capability to parse and convert the data received from a OPCUA server into specific data keys.",delete:"Delete configuration","delete-attribute":"Delete attribute","delete-key":"Delete key","delete-timeseries":"Delete time series",default:"Default","device-node":"Device node","device-node-required":"Device node required.","device-node-hint":"Path or identifier for device node on OPC UA server. Relative paths from it for attributes and time series can be used.","device-name":"Device name","device-profile-label":"Device profile","device-name-required":"Device name required","device-profile-required":"Device profile required","download-tip":"Download configuration file","drop-file":"Drop file here or",enable:"Enable",encoding:"Encoding","enable-subscription":"Enable subscription",extension:"Extension","extension-hint":"Put your converter classname in the field. Custom converter with such class should be in extension/mqtt folder.","extension-required":"Extension is required.","extension-configuration":"Extension configuration","extension-configuration-hint":"Configuration for converter. These arguments will be passed as a config to convert function.","fill-connector-defaults":"Fill configuration with default values","fill-connector-defaults-hint":"This property allows to fill connector configuration with default values on it's creation.","from-device-request-settings":"Input request parsing","from-device-request-settings-hint":"These fields support JSONPath expressions to extract a name from incoming message.","function-code":"Function code","function-codes":{"read-coils":"01 - Read Coils","read-discrete-inputs":"02 - Read Discrete Inputs","read-multiple-holding-registers":"03 - Read Multiple Holding Registers","read-input-registers":"04 - Read Input Registers","write-single-coil":"05 - Write Single Coil","write-single-holding-register":"06 - Write Single Holding Register","write-multiple-coils":"15 - Write Multiple Coils","write-multiple-holding-registers":"16 - Write Multiple Holding Registers"},"to-device-response-settings":"Output request processing","to-device-response-settings-hint":"For these fields you can use the following variables and they will be replaced with actual values: ${deviceName}, ${attributeKey}, ${attributeValue}",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-status":"Gateway status","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.","generate-client-id":"Generate Client ID",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid",info:"Info",identity:"Identity","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","unit-id":"Unit ID",host:"Host","host-required":"Host is required.",holding_registers:"Holding registers",coils_initializer:"Coils initializer",input_registers:"Input registers",discrete_inputs:"Discrete inputs","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.","JSONPath-hint":"Supports constants and JSONPath expressions to extract data.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"max-number-of-workers":"Max number of workers","max-number-of-workers-hint":"Maximal number of workers threads for converters \n(The amount of workers changes dynamically, depending on load) \nRecommended amount 50-150.","max-number-of-workers-required":"Max number of workers is required.","max-messages-queue-for-worker":"Max messages queue per worker","max-messages-queue-for-worker-hint":"Maximal messages count that will be in the queue \nfor each converter worker.","max-messages-queue-for-worker-required":"Max messages queue per worker is required.",method:"Method","method-name":"Method name","method-required":"Method name is required.","min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 10","min-pack-send-delay-pattern":"Min pack send delay is not valid",multiplier:"Multiplier",mode:"Mode","model-name":"Model name",modifier:"Modifier","modifier-invalid":"Modifier is not valid","mqtt-version":"MQTT version",name:"Name","name-required":"Name is required.","network-mask":"Network mask","no-attributes":"No attributes","no-attribute-updates":"No attribute updates","no-attribute-requests":"No attribute requests","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","no-timeseries":"No time series","no-keys":"No keys","no-value":"No arguments","no-rpc-methods":"No RPC methods","no-rpc-requests":"No RPC requests","path-hint":"The path is local to the gateway file system","path-logs":"Path to log files","path-logs-required":"Path is required.",password:"Password","password-required":"Password is required.","permit-without-calls":"Keep alive permit without calls","property-id":"Property ID","poll-period":"Poll period (ms)","poll-period-error":"Poll period should be at least {{min}} (ms).",port:"Port","port-required":"Port is required.","port-limits-error":"Port should be number from {{min}} to {{max}}.","private-key-path":"Path to private key file","path-to-private-key-required":"Path to private key file is required.",parity:"Parity","product-code":"Product code","product-name":"Product name",raw:"Raw",retain:"Retain","retain-hint":"This flag tells the broker to store the message for a topic\nand ensures any new client subscribing to that topic\nwill receive the stored message.",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","remote-shell":"Remote shell","remote-configuration":"Remote Configuration","request-expression":"Request expression","request-expression-required":"Request expression is required",retries:"Retries","retries-on-empty":"Retries on empty","retries-on-invalid":"Retries on invalid",response:"Response",rest:{"add-http-header":"Add HTTP header","no-http-headers":"No HTTP headers","delete-http-header":"Delete HTTP header","ssl-verify":"SSL verify",endpoint:"Endpoint","http-methods":"HTTP methods","http-method":"HTTP method","on-error":"On error","on-success":"On success",tries:"Tries","http-headers":"HTTP headers","allow-redirects":"Allow redirects","request-url-expression":"Request URL expression","response-attribute":"Response attribute","response-expected":"Expected","response-type":{default:"Default",const:"Constant",advanced:"Advanced"}},rpc:{title:"{{type}} Connector RPC parameters","templates-title":"Connector RPC Templates",methodFilter:"Method filter","method-name":"Method name",requestTopicExpression:"Request topic expression",responseTopicExpression:"Response topic expression",responseTimeout:"Response timeout",valueExpression:"Value expression",tag:"Tag",type:"Type",functionCode:"Function Code",objectsCount:"Objects Count",address:"Address",method:"Method",requestType:"Request Type",requestTimeout:"Request Timeout",objectType:"Object type",identifier:"Identifier",propertyId:"Property ID",methodRPC:"Method RPC name",withResponse:"With Response",characteristicUUID:"Characteristic UUID",methodProcessing:"Method Processing",nodeID:"Node ID",isExtendedID:"Is Extended ID",isFD:"Is FD",bitrateSwitch:"Bitrate Switch",dataInHEX:"Data In HEX",dataLength:"Data Length",dataByteorder:"Data Byte Order",dataBefore:"Data Before",dataAfter:"Data After",dataExpression:"Data Expression",oid:"OID","add-oid":"Add OID","add-header":"Add header","add-security":"Add security",remove:"Remove",requestFilter:"Request Filter",requestUrlExpression:"Request URL Expression",httpMethod:"HTTP Method",timeout:"Timeout",tries:"Tries",httpHeaders:"HTTP Headers","header-name":"Header name",hint:{"modbus-response-reading":"RPC response will return all subtracted values from all connected devices when the reading functions are selected.","modbus-writing-functions":"RPC will write a filled value to all connected devices when the writing functions are selected.","opc-method":"A filled method name is the OPC-UA method that will processed on the server side (make sure your node has the requested method)."},"security-name":"Security name",value:"Value",security:"Security",responseValueExpression:"Response Value Expression",requestValueExpression:"Request Value Expression",arguments:"Arguments","add-argument":"Add argument","write-property":"Write property","read-property":"Read property","analog-output":"Analog output","analog-input":"Analog input","binary-output":"Binary output","binary-input":"Binary input","binary-value":"Binary value","analog-value":"Analog value",write:"Write",read:"Read",scan:"Scan",oids:"OIDS",set:"Set",multiset:"Multiset",get:"Get","bulk-walk":"Bulk walk",table:"Table","multi-get":"Multiget","get-next":"Get next","bulk-get":"Bulk get",walk:"Walk","save-template":"Save template","template-name":"Template name","template-name-required":"Template name is required.","template-name-duplicate":"Template with such name already exists, it will be updated.",command:"Command",params:"Params","json-value-invalid":"JSON value has an invalid format"},"rpc-methods":"RPC methods","rpc-requests":"RPC requests",request:{"connect-request":"Connect request","disconnect-request":"Disconnect request","attribute-request":"Attribute request","attribute-update":"Attribute update","rpc-connection":"RPC command"},"request-type":"Request type","request-timeout":"Request timeout (ms)","requests-mapping":"Requests mapping","requests-mapping-hint":"MQTT Connector requests allows you to connect, disconnect, process attribute requests from the device, handle attribute updates on the server and RPC processing configuration.","request-topic-expression":"Request topic expression","request-client-certificate":"Request client certificate","request-topic-expression-required":"Request topic expression is required.","response-timeout":"Response timeout","response-timeout-required":"Response timeout is required.","response-timeout-limits-error":"Timeout must be more then {{min}} ms.","response-topic-Qos":"Response topic QoS","response-topic-Qos-hint":"MQTT Quality of Service (QoS) is an agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message.","response-topic-expression":"Response topic expression","response-topic-expression-required":"Response topic expression is required.","response-value-expression":"Response value expression","response-value-expression-required":"Response value expression is required.","vendor-name":"Vendor name","vendor-url":"Vendor URL",value:"Value",values:"Values","value-required":"Value is required.","value-expression":"Value expression","value-expression-required":"Value expression is required.","with-response":"With response","without-response":"Without response",other:"Other",socket:"Socket","save-tip":"Save configuration file","scan-period":"Scan period (ms)","scan-period-error":"Scan period should be at least {{min}} (ms).","sub-check-period":"Subscription check period (ms)","sub-check-period-error":"Subscription check period should be at least {{min}} (ms).",security:"Security","security-policy":"Security policy","security-type":"Security type","security-types":{"access-token":"Access Token","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"select-connector":"Select connector to display config","send-change-data":"Send data only on change","send-data-to-platform":"Send data to platform","send-data-on-change":"Send data only on change","send-change-data-hint":"The values will be saved to the database only if they are different from the corresponding values in the previous converted message. This functionality applies to both attributes and time series in the converter output.",server:"Server","server-hostname":"Server hostname","server-slave":"Server (Slave)","servers-slaves":"Servers (Slaves)","server-port":"Server port","server-url":"Server endpoint url","server-connection":"Server Connection","server-config":"Server configuration","server-slave-config":"Server (Slave) configuration","server-url-required":"Server endpoint url is required.",stopbits:"Stopbits",strict:"Strict",set:"Set","show-map":"Show map",statistics:{entry:"Statistic entry","custom-send-period":"Custom send period (in sec)","custom-send-period-pattern":"Custom send period is not valid","custom-send-period-min":"Custom send period can not be less then 60","custom-send-period-required":"Custom send period is required","create-command":"Create command",attributes:"Attributes","name-already-exists":"Attribute name already exists.",telemetry:"Telemetry","storage-message-count":"Storage message count","messages-from-platform":"Messages from platform","pushed-datapoints":"Pushed datapoints","messages-pulled-from-storage":"Messages pulled from storage","messages-pushed-to-platform":"Messages pushed to platform","messages-sent-to-platform":"Messages sent to platform","process-cpu-usage":"Gateway process CPU usage",memory:"Gateway process memory usage","machine-resources":"Machine resources","free-disk":"Free disk",statistic:"Statistic",statistics:"Statistics","general-statistics":"General statistics","custom-statistics":"Custom statistics","copy-message":"Copy message","statistic-commands-empty":'No configured statistic keys found. You can configure them in "Statistics" tab in general configuration.',"statistics-button":"Go to configuration",commands:"Commands",name:"Time series name","time-series-name-already-exists":"Time series name already exists.","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)",messages:"Messages","max-payload-size-bytes":"Max payload size in bytes","max-payload-size-bytes-required":"Max payload size in bytes is required","max-payload-size-bytes-min":"Max payload size in bytes can not be less then 100","max-payload-size-bytes-pattern":"Max payload size in bytes is not valid","min-pack-size-to-send":"Min packet size to send","min-pack-size-to-send-required":"Min packet size to send is required","min-pack-size-to-send-min":"Min packet size to send can not be less then 100","min-pack-size-to-send-pattern":"Min packet size to send is not valid","no-config-commands-found":"No configuration commands found","delete-command":"Delete command '{{command}}'?","delete-command-data":"All command data will be deleted.","edit-command":"Edit command","change-command-title":"Discard command change","change-command-text":"Cancelling command edit will discard any unsaved changes. Continue?","no-command-found":"No command found","no-commands-matching":"No command matching '{{command}}' were found.","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid","install-cmd":"Install command",add:"Add command",timeout:"Timeout (in sec)","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","time-series-name-required":"Time series name is required","time-series-name-pattern":"Time series name is not valid",command:"Command","command-required":"Command is required","command-pattern":"Command is not valid",remove:"Remove command"},storage:"Storage","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count":"Max read record count in storage","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max Read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage",sqlite:"SQLITE"},suffix:{s:"s",ms:"ms"},"report-strategy":{label:"Report strategy","on-change":"On value change","on-report-period":"On report period","on-change-or-report-period":"On value change or report period","report-period":"Report period","on-received":"On received"},"source-type":{msg:"Message",topic:"Topic",const:"Constant",identifier:"Identifier",path:"Path",expression:"Expression",request:"From request"},"workers-settings":"Workers settings",thingsboard:"ThingsBoard",general:"General",timeseries:"Time series",key:"Key",keys:"Keys","key-required":"Key is required.","thingsboard-host":"Platform host","thingsboard-host-required":"Host is required.","thingsboard-port":"Platform port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON",timeout:"Timeout","timeout-error":"Timeout should be at least {{min}} (ms).","title-connectors-json":"Connector {{typeName}} configuration",type:"Type","topic-filter":"Topic filter","topic-required":"Topic filter is required.","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-connection":"TLS Connection","master-connections":"Master Connections","method-filter":"Method filter","method-filter-hint":"Regular expression to filter incoming RPC method from platform.","method-filter-required":"Method filter is required.","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1",qos:{"at-most-once":"0 - At most once","at-least-once":"1 - At least once","exactly-once":"2 - Exactly once"},"objects-count":"Objects count","object-id":"Object ID","objects-count-required":"Objects count is required","wait-after-failed-attempts":"Wait after failed attempts (ms)","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON",username:"Username","username-required":"Username is required.","unit-id-required":"Unit ID is required.","vendor-id":"Vendor ID","write-coil":"Write Coil","write-coils":"Write Coils","write-register":"Write Register","write-registers":"Write Registers",hints:{"enable-general-statistics":"Enables gateway statistics (machine, storage, connectors).","enable-custom-statistics":"Enables collecting statistics using custom commands.","buffer-size":"Buffer size for received data blocks.",encoding:"Encoding used for writing received string data to storage.",method:"Name for method on a platform.","modbus-master":"Configuration sections for connecting to Modbus servers and reading data from them.","modbus-server":"Configuration section for the Modbus server, storing data and sending updates to the platform when changes occur or at fixed intervals.","remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of platform server",port:"Port of MQTT service on platform server",token:"Access token for the gateway from platform server","client-id":"MQTT client id for the gateway form platform server",username:"MQTT username for the gateway form platform server",password:"MQTT password for the gateway form platform server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","object-id-required":"Object ID is required","vendor-id-required":"Vendor ID is required","data-folder":"Path to the folder that will contain data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum number of files that will be created","max-read-count":"Number of messages to retrieve from the storage and send to platform","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Number of messages to retrieve from the storage and send to platform","max-records-count":"Maximum number of data entries in storage before sending to platform","ttl-check-hour":"How often will the Gateway check data for obsolescence","ttl-messages-day":"Maximum number of days that the storage will retain data","username-required-with-password":"Username required if password is specified",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls.","path-in-os":"Path in gateway os.",memory:"Your data will be stored in the in-memory queue, it is a fastest but no persistence guarantee.",file:"Your data will be stored in separated files and will be saved even after the gateway restart.",sqlite:"Your data will be stored in file based database. And will be saved even after the gateway restart.","opc-timeout":"Timeout in milliseconds for connecting to OPC-UA server.","security-policy":"Security Policy defines the security mechanisms to be applied.","install-cmd":"Packages that will be installed for command executing.","scan-period":"Period in milliseconds to rescan the server.","sub-check-period":"Period to check the subscriptions in the OPC-UA server.","enable-subscription":"If true - the gateway will subscribe to interesting nodes and wait for data update and if false - the gateway will rescan OPC-UA server every scanPeriodInMillis.","show-map":"Show nodes on scanning.","method-name":"Name of method on OPC-UA server.",arguments:"Arguments for the method (will be overwritten by arguments from the RPC request).","min-pack-size-to-send":"Minimum package size for sending.","max-payload-size-bytes":"Maximum package size in bytes","poll-period":"Period in milliseconds to read data from nodes.","poll-period-required":"Poll period is required.","report-period-required":"Report period is required.","report-period-range":"Report period must be greater than 100.","timeout-pattern":"Timeout is not valid",rest:{"endpoint-required":"Endpoint is required.","endpoint-pattern":"Endpoint is not valid.","device-name-filter-required":"Device name filter is required.","device-name-filter-pattern":"Device name filter is not valid.","request-url-expression-required":"Request URL expression is required.","request-url-expression-pattern":"Request URL expression is not valid.","value-expression-required":"Value expression is required.","value-expression-pattern":"Value expression is not valid.","method-filter-required":"Method filter is required.","method-filter-pattern":"Method filter is not valid.","scope-type":"Attribute scope on platform.","tries-min":"Request tries number should be greater than 0.","tries-pattern":"Request tries is invalid.","http-methods-required":"HTTP methods are required.",host:"Domain or IP address of the server.",port:"Port on the server for listening clients connection.","ssl-verify":"Enable SSL certificate verification.",cert:"Path to the certificate file.",key:"Path to the private key file",endpoint:"Endpoint path on the server.","http-methods":"HTTP methods allowed for endpoint.","http-method":"Request to external URL HTTP method.",JSON:"Converter for this payload type processes REST messages in JSON format. It uses JSON Path expressions to extract vital details such as device names, device profile names, attributes, and time series from the request body.",extension:"Custom converter classname. File with this class should be in extension/rest folder.","response-attribute-required":"Response attribute is required.","response-attribute-pattern":"Response attribute is not valid.","update-ssl":"Verify SSL certificate on the external server.","attribute-filter":"Filter for incoming attribute name from platform, support regular expression.","value-expression":"Used to create request body for request to external server. Supports ${deviceName}, ${deviceType}, ${attributeName}, ${attributeValue} variables.","attribute-url-expression":"Used to create request URL for request to external server. Supports ${deviceName}, ${deviceType}, ${attributeName}, ${attributeValue} variables.","method-filter":"Filter for RPC requests from the platform based on the method name. Supports regular expressions.","attribute-name-expression-required":"Attribute name expression is required.","attribute-name-expression-pattern":"Attribute name expression is not valid.","attribute-filter-required":"Attribute filter is required.","attribute-filter-pattern":"Attribute filter is not valid."},socket:{"attribute-on-platform-required":"Attribute on platform is required","attribute-requests-type":"The type of requested attribute can be “shared” or “client.“","with-response":"Boolean flag that specifies whether to send a response back to platform.","key-telemetry":"Name for telemetry on platform.","key-attribute":"Name for attribute on platform."},modbus:{"bit-target-type":"The response type can be either an integer (1/0) or a boolean (True/False).",bit:"Specify the index of the bit to read from the array, or leave it blank to read the entire array.","max-bit":"The bit value must not exceed the objects count.","framer-type":"Type of a framer (Socket, RTU, or ASCII), if needed.",host:"Hostname or IP address of Modbus server.",port:"Modbus server port for connection.","unit-id":"Modbus slave ID.","connection-timeout":"Connection timeout (in seconds) for the Modbus server.","byte-order":"Byte order for reading data.","word-order":"Word order when reading multiple registers.",retries:"Retrying data transmission to the master. Acceptable values: true or false.","retries-on-empty":"Retry sending data to the master if the data is empty.","retries-on-invalid":"Retry sending data to the master if it fails.","poll-period":"Period in milliseconds to check attributes and telemetry on the slave.","connect-attempt-time":"A waiting period in milliseconds before establishing a connection to the master.","connect-attempt-count":"The number of connection attempts made through the gateway.","wait-after-failed-attempts":"A waiting period in milliseconds before attempting to send data to the master.","serial-port":"Serial port for connection.",baudrate:"Baud rate for the serial device.",stopbits:"The number of stop bits sent after each character in a message to indicate the end of the byte.",bytesize:"The number of bits in a byte of serial data. This can be one of 5, 6, 7, or 8.",parity:"The type of checksum used to verify data integrity. Options: (E)ven, (O)dd, (N)one.",strict:"Use inter-character timeout for baudrates ≤ 19200.","objects-count":"Depends on the selected type.",address:"Register address to verify.",key:"Key to be used as the attribute key for the platform instance.",method:"Method name to be used for the platform instance.","data-keys":"For more information about function codes and data types click on help icon",modifier:"The retrieved value will be adjusted (by multiplying or dividing it) based on the specified modifier value."},bacnet:{"object-id":"The gateway object identifier in the BACnet network.","vendor-id":"The gateway vendor identifier in the BACnet network","apdu-length":"Maximal length of the APDU.",segmentation:"Segmentation type for transmitting large BACnet messages.","key-object-id":"Object id in the BACnet device.","property-id":"Property id in the BACnet device.","request-type":"“writeProperty” to write data and “readProperty” to read data.","request-timeout":"Timeout to wait the response from the BACnet device, milliseconds.","device-timeout":"Period of time when the connector will try to discover BACnet devices.","network-number":"Identifier of the network segment."}}}},ft={"add-entry":"إضافة تكوين",advanced:"متقدم","checking-device-activity":"فحص نشاط الجهاز",command:"أوامر Docker","command-copied-message":"تم نسخ أمر Docker إلى الحافظة",configuration:"التكوين","connector-add":"إضافة موصل جديد","connector-enabled":"تمكين الموصل","connector-name":"اسم الموصل","connector-name-required":"اسم الموصل مطلوب.","connector-type":"نوع الموصل","connector-type-required":"نوع الموصل مطلوب.",connectors:"الموصلات","connectors-config":"تكوينات الموصلات","connectors-table-enabled":"ممكّن","connectors-table-name":"الاسم","connectors-table-type":"النوع","connectors-table-status":"الحالة","connectors-table-actions":"الإجراءات","connectors-table-key":"المفتاح","connectors-table-class":"الفئة","rpc-command-send":"إرسال","rpc-command-result":"الاستجابة","rpc-command-edit-params":"تحرير المعلمات","gateway-configuration":"تكوين عام","docker-label":"استخدم التعليمات التالية لتشغيل IoT Gateway في Docker compose مع بيانات اعتماد للجهاز المحدد","install-docker-compose":"استخدم التعليمات لتنزيل وتثبيت وإعداد docker compose","download-configuration-file":"تنزيل ملف التكوين","download-docker-compose":"تنزيل docker-compose.yml لبوابتك","launch-gateway":"تشغيل البوابة","launch-docker-compose":"بدء تشغيل البوابة باستخدام الأمر التالي في الطرفية من المجلد الذي يحتوي على ملف docker-compose.yml","create-new-gateway":"إنشاء بوابة جديدة","create-new-gateway-text":"هل أنت متأكد أنك تريد إنشاء بوابة جديدة باسم: '{{gatewayName}}'؟","created-time":"وقت الإنشاء","configuration-delete-dialog-header":"سيتم حذف التكوينات","configuration-delete-dialog-body":"يمكن تعطيل التكوين عن بُعد فقط إذا كان هناك وصول جسدي إلى البوابة. ستتم حذف جميع التكوينات السابقة.

\n لتعطيل التكوين، أدخل اسم البوابة أدناه","configuration-delete-dialog-input":"اسم البوابة","configuration-delete-dialog-input-required":"اسم البوابة إلزامي","configuration-delete-dialog-confirm":"إيقاف التشغيل",delete:"حذف التكوين","download-tip":"تنزيل ملف التكوين","drop-file":"أفلق الملف هنا أو",gateway:"البوابة","gateway-exists":"الجهاز بنفس الاسم موجود بالفعل.","gateway-name":"اسم البوابة","gateway-name-required":"اسم البوابة مطلوب.","gateway-saved":"تم حفظ تكوين البوابة بنجاح.",grpc:"GRPC","grpc-keep-alive-timeout":"مهلة البقاء على قيد الحياة (بالمللي ثانية)","grpc-keep-alive-timeout-required":"مهلة البقاء على قيد الحياة مطلوبة","grpc-keep-alive-timeout-min":"مهلة البقاء على قيد الحياة لا يمكن أن تكون أقل من 1","grpc-keep-alive-timeout-pattern":"مهلة البقاء على قيد الحياة غير صالحة","grpc-keep-alive":"البقاء على قيد الحياة (بالمللي ثانية)","grpc-keep-alive-required":"البقاء على قيد الحياة مطلوب","grpc-keep-alive-min":"البقاء على قيد الحياة لا يمكن أن يكون أقل من 1","grpc-keep-alive-pattern":"البقاء على قيد الحياة غير صالح","grpc-min-time-between-pings":"الحد الأدنى للوقت بين البينغات (بالمللي ثانية)","grpc-min-time-between-pings-required":"الحد الأدنى للوقت بين البينغات مطلوب","grpc-min-time-between-pings-min":"الحد الأدنى للوقت بين البينغات لا يمكن أن يكون أقل من 1","grpc-min-time-between-pings-pattern":"الحد الأدنى للوقت بين البينغات غير صالح","grpc-min-ping-interval-without-data":"الحد الأدنى لفاصل البينغ بدون بيانات (بالمللي ثانية)","grpc-min-ping-interval-without-data-required":"الحد الأدنى لفاصل البينغ بدون بيانات مطلوب","grpc-min-ping-interval-without-data-min":"الحد الأدنى لفاصل البينغ بدون بيانات لا يمكن أن يكون أقل من 1","grpc-min-ping-interval-without-data-pattern":"الحد الأدنى لفاصل البينغ بدون بيانات غير صالح","grpc-max-pings-without-data":"الحد الأقصى لعدد البينغات بدون بيانات","grpc-max-pings-without-data-required":"الحد الأقصى لعدد البينغات بدون بيانات مطلوب","grpc-max-pings-without-data-min":"الحد الأقصى لعدد البينغات بدون بيانات لا يمكن أن يكون أقل من 1","grpc-max-pings-without-data-pattern":"الحد الأقصى لعدد البينغات بدون بيانات غير صالح","inactivity-check-period-seconds":"فترة فحص الخمول (بالثواني)","inactivity-check-period-seconds-required":"فترة فحص الخمول مطلوبة","inactivity-check-period-seconds-min":"فترة فحص الخمول لا يمكن أن تكون أقل من 1","inactivity-check-period-seconds-pattern":"فترة فحص الخمول غير صالحة","inactivity-timeout-seconds":"فترة الخمول (بالثواني)","inactivity-timeout-seconds-required":"فترة الخمول مطلوبة","inactivity-timeout-seconds-min":"فترة الخمول لا يمكن أن تكون أقل من 1","inactivity-timeout-seconds-pattern":"فترة الخمول غير صالحة","json-parse":"JSON غير صالح.","json-required":"الحقل لا يمكن أن يكون فارغًا.",logs:{logs:"السجلات",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني","date-format":"تنسيق التاريخ","date-format-required":"تنسيق التاريخ مطلوب","log-format":"تنسيق السجل","log-type":"نوع السجل","log-format-required":"تنسيق السجل مطلوب",remote:"التسجيل عن بُعد","remote-logs":"السجلات عن بُعد",local:"التسجيل المحلي",level:"مستوى السجل","file-path":"مسار الملف","file-path-required":"مسار الملف مطلوب","saving-period":"فترة حفظ السجل","saving-period-min":"فترة حفظ السجل لا يمكن أن تكون أقل من 1","saving-period-required":"فترة حفظ السجل مطلوبة","backup-count":"عدد النسخ الاحتياطية","backup-count-min":"عدد النسخ الاحتياطية لا يمكن أن يكون أقل من 1","backup-count-required":"عدد النسخ الاحتياطية مطلوب"},"min-pack-send-delay":"الحد الأدنى لتأخير إرسال الحزمة (بالمللي ثانية)","min-pack-send-delay-required":"الحد الأدنى لتأخير إرسال الحزمة مطلوب","min-pack-send-delay-min":"لا يمكن أن يكون الحد الأدنى لتأخير إرسال الحزمة أقل من 0","no-connectors":"لا توجد موصلات","no-data":"لا توجد تكوينات","no-gateway-found":"لم يتم العثور على بوابة.","no-gateway-matching":"'{{item}}' غير موجود.","path-logs":"مسار إلى ملفات السجل","path-logs-required":"المسار مطلوب.","permit-without-calls":"البقاء على الحياة يسمح بدون مكالمات",remote:"التكوين عن بُعد","remote-logging-level":"مستوى التسجيل","remove-entry":"إزالة التكوين","remote-shell":"قشرة عن بُعد","remote-configuration":"التكوين عن بُعد",other:"آخر","save-tip":"حفظ ملف التكوين","security-type":"نوع الأمان","security-types":{"access-token":"رمز الوصول","username-password":"اسم المستخدم وكلمة المرور",tls:"TLS","tls-access-token":"TLS + رمز الوصول","tls-private-key":"TLS + المفتاح الخاص"},"server-port":"منفذ الخادم",statistics:{statistic:"إحصائية",statistics:"الإحصائيات","statistic-commands-empty":"لا تتوفر إحصائيات",commands:"الأوامر","send-period":"فترة إرسال الإحصائيات (بالثواني)","send-period-required":"فترة إرسال الإحصائيات مطلوبة","send-period-min":"لا يمكن أن تكون فترة إرسال الإحصائيات أقل من 60","send-period-pattern":"فترة إرسال الإحصائيات غير صالحة","check-connectors-configuration":"فترة فحص تكوين الموصلات (بالثواني)","check-connectors-configuration-required":"فترة فحص تكوين الموصلات مطلوبة","check-connectors-configuration-min":"لا يمكن أن تكون فترة فحص تكوين الموصلات أقل من 1","check-connectors-configuration-pattern":"فترة فحص تكوين الموصلات غير صالحة",add:"إضافة أمر",timeout:"المهلة","timeout-required":"المهلة مطلوبة","timeout-min":"لا يمكن أن تكون المهلة أقل من 1","timeout-pattern":"المهلة غير صالحة","attribute-name":"اسم السمة","attribute-name-required":"اسم السمة مطلوب",command:"الأمر","command-required":"الأمر مطلوب","command-pattern":"الأمر غير صالح",remove:"إزالة الأمر"},storage:"التخزين","storage-max-file-records":"السجلات القصوى في الملف","storage-max-files":"الحد الأقصى لعدد الملفات","storage-max-files-min":"الحد الأدنى هو 1.","storage-max-files-pattern":"العدد غير صالح.","storage-max-files-required":"العدد مطلوب.","storage-max-records":"السجلات القصوى في التخزين","storage-max-records-min":"الحد الأدنى لعدد السجلات هو 1.","storage-max-records-pattern":"العدد غير صالح.","storage-max-records-required":"السجلات القصوى مطلوبة.","storage-read-record-count":"عدد قراءة السجلات في التخزين","storage-read-record-count-min":"الحد الأدنى لعدد السجلات هو 1.","storage-read-record-count-pattern":"العدد غير صالح.","storage-read-record-count-required":"عدد قراءة السجلات مطلوب.","storage-max-read-record-count":"الحد الأقصى لعدد قراءة السجلات في التخزين","storage-max-read-record-count-min":"الحد الأدنى لعدد السجلات هو 1.","storage-max-read-record-count-pattern":"العدد غير صالح.","storage-max-read-record-count-required":"عدد القراءة القصوى مطلوب.","storage-data-folder-path":"مسار مجلد البيانات","storage-data-folder-path-required":"مسار مجلد البيانات مطلوب.","storage-pack-size":"الحد الأقصى لحجم حزمة الحدث","storage-pack-size-min":"الحد الأدنى هو 1.","storage-pack-size-pattern":"العدد غير صالح.","storage-pack-size-required":"الحجم الأقصى لحزمة الحدث مطلوب.","storage-path":"مسار التخزين","storage-path-required":"مسار التخزين مطلوب.","storage-type":"نوع التخزين","storage-types":{"file-storage":"تخزين الملفات","memory-storage":"تخزين الذاكرة",sqlite:"SQLITE"},thingsboard:"ثينغزبورد",general:"عام","thingsboard-host":"مضيف ثينغزبورد","thingsboard-host-required":"المضيف مطلوب.","thingsboard-port":"منفذ ثينغزبورد","thingsboard-port-max":"الحد الأقصى لرقم المنفذ هو 65535.","thingsboard-port-min":"الحد الأدنى لرقم المنفذ هو 1.","thingsboard-port-pattern":"المنفذ غير صالح.","thingsboard-port-required":"المنفذ مطلوب.",tidy:"ترتيب","tidy-tip":"ترتيب تكوين JSON","title-connectors-json":"تكوين موصل {{typeName}}","tls-path-ca-certificate":"المسار إلى شهادة CA على البوابة","tls-path-client-certificate":"المسار إلى شهادة العميل على البوابة","messages-ttl-check-in-hours":"فحص TTL الرسائل بالساعات","messages-ttl-check-in-hours-required":"يجب تحديد فحص TTL الرسائل بالساعات.","messages-ttl-check-in-hours-min":"الحد الأدنى هو 1.","messages-ttl-check-in-hours-pattern":"الرقم غير صالح.","messages-ttl-in-days":"TTL الرسائل بالأيام","messages-ttl-in-days-required":"يجب تحديد TTL الرسائل بالأيام.","messages-ttl-in-days-min":"الحد الأدنى هو 1.","messages-ttl-in-days-pattern":"الرقم غير صالح.","mqtt-qos":"جودة الخدمة (QoS)","mqtt-qos-required":"جودة الخدمة (QoS) مطلوبة","mqtt-qos-range":"تتراوح قيم جودة الخدمة (QoS) من 0 إلى 1","tls-path-private-key":"المسار إلى المفتاح الخاص على البوابة","toggle-fullscreen":"تبديل وضع ملء الشاشة","transformer-json-config":"تكوين JSON*","update-config":"إضافة/تحديث تكوين JSON",hints:{"remote-configuration":"يمكنك تمكين التكوين وإدارة البوابة عن بُعد","remote-shell":"يمكنك تمكين التحكم البعيد في نظام التشغيل مع البوابة من عنصر واجهة المستخدم قشرة عن بُعد",host:"اسم المضيف أو عنوان IP لخادم ثينغزبورد",port:"منفذ خدمة MQTT على خادم ثينغزبورد",token:"رمز الوصول للبوابة من خادم ثينغزبورد","client-id":"معرف عميل MQTT للبوابة من خادم ثينغزبورد",username:"اسم المستخدم MQTT للبوابة من خادم ثينغزبورد",password:"كلمة المرور MQTT للبوابة من خادم ثينغزبورد","ca-cert":"المسار إلى ملف شهادة CA","date-form":"تنسيق التاريخ في رسالة السجل","data-folder":"المسار إلى المجلد الذي سيحتوي على البيانات (نسبي أو مطلق)","log-format":"تنسيق رسالة السجل","remote-log":"يمكنك تمكين التسجيل البعيد وقراءة السجلات من البوابة","backup-count":"إذا كان عدد النسخ الاحتياطية > 0، عند عملية تدوير، لا يتم الاحتفاظ بأكثر من عدد النسخ الاحتياطية المحددة - يتم حذف الأقدم",storage:"يوفر تكوينًا لحفظ البيانات الواردة قبل إرسالها إلى المنصة","max-file-count":"العدد الأقصى لعدد الملفات التي سيتم إنشاؤها","max-read-count":"عدد الرسائل للحصول عليها من التخزين وإرسالها إلى ثينغزبورد","max-records":"العدد الأقصى للسجلات التي ستخزن في ملف واحد","read-record-count":"عدد الرسائل للحصول عليها من التخزين وإرسالها إلى ثينغزبورد","max-records-count":"العدد الأقصى للبيانات في التخزين قبل إرسالها إلى ثينغزبورد","ttl-check-hour":"كم مرة سيتحقق البوابة من البيانات القديمة","ttl-messages-day":"الحد الأقصى لعدد الأيام التي ستحتفظ فيها التخزين بالبيانات",commands:"الأوامر لجمع الإحصائيات الإضافية",attribute:"مفتاح تلقي الإحصائيات",timeout:"مهلة زمنية لتنفيذ الأمر",command:"سيتم استخدام نتيجة تنفيذ الأمر كقيمة لتلقي الإحصائيات","check-device-activity":"يمكنك تمكين مراقبة نشاط كل جهاز متصل","inactivity-timeout":"الوقت بعد الذي ستفصل البوابة الجهاز","inactivity-period":"تكرار فحص نشاط الجهاز","minimal-pack-delay":"التأخير بين إرسال حزم الرسائل (يؤدي تقليل هذا الإعداد إلى زيادة استخدام وحدة المعالجة المركزية)",qos:"جودة الخدمة في رسائل MQTT (0 - على الأكثر مرة واحدة، 1 - على الأقل مرة واحدة)","server-port":"منفذ الشبكة الذي سيستمع فيه خادم GRPC للاستفسارات الواردة.","grpc-keep-alive-timeout":"الحد الأقصى للوقت الذي يجب أن ينتظره الخادم لاستجابة رسالة الحفاظ على الاتصال قبل اعتبار الاتصال ميتًا.","grpc-keep-alive":"المدة بين رسائل حفظ الاتصال المتعاقبة عند عدم وجود استدعاء RPC نشط.","grpc-min-time-between-pings":"الحد الأدنى للوقت الذي يجب فيه أن ينتظر الخادم بين إرسال رسائل حفظ الاتصال","grpc-max-pings-without-data":"الحد الأقصى لعدد رسائل حفظ الاتصال التي يمكن للخادم إرسالها دون تلقي أي بيانات قبل اعتبار الاتصال ميتًا.","grpc-min-ping-interval-without-data":"الحد الأدنى للوقت الذي يجب فيه أن ينتظر الخادم بين إرسال رسائل حفظ الاتصال عند عدم إرسال أو استلام بيانات.","permit-without-calls":"السماح للخادم بإبقاء اتصال GRPC حيًا حتى عندما لا تكون هناك استدعاءات RPC نشطة."}},yt={"add-entry":"Afegir configuració","connector-add":"Afegir conector","connector-enabled":"Activar conector","connector-name":"Nom conector","connector-name-required":"Cal nom conector.","connector-type":"Tipus conector","connector-type-required":"Cal tipus conector.",connectors:"Configuració de conectors","create-new-gateway":"Crear un gateway nou","create-new-gateway-text":"Crear un nou gateway amb el nom: '{{gatewayName}}'?",delete:"Esborrar configuració","download-tip":"Descarregar fitxer de configuració",gateway:"Gateway","gateway-exists":"Ja existeix un dispositiu amb el mateix nom.","gateway-name":"Nom de Gateway","gateway-name-required":"Cal un nom de gateway.","gateway-saved":"Configuració de gateway gravada satisfactòriament.","json-parse":"JSON no vàlid.","json-required":"El camp no pot ser buit.","no-connectors":"No hi ha conectors","no-data":"No hi ha configuracions","no-gateway-found":"No s'ha trobat cap gateway.","no-gateway-matching":" '{{item}}' no trobat.","path-logs":"Ruta als fitxers de log","path-logs-required":"Cal ruta.",remote:"Configuració remota","remote-logging-level":"Nivel de logging","remove-entry":"Esborrar configuració","save-tip":"Gravar fitxer de configuració","security-type":"Tipus de seguretat","security-types":{"access-token":"Token d'accés",tls:"TLS"},storage:"Grabació","storage-max-file-records":"Número màxim de registres en fitxer","storage-max-files":"Número màxim de fitxers","storage-max-files-min":"El número mínim és 1.","storage-max-files-pattern":"Número no vàlid.","storage-max-files-required":"Cal número.","storage-max-records":"Màxim de registres en el magatzem","storage-max-records-min":"El número mínim és 1.","storage-max-records-pattern":"Número no vàlid.","storage-max-records-required":"Cal número.","storage-pack-size":"Mida màxim de esdeveniments","storage-pack-size-min":"El número mínim és 1.","storage-pack-size-pattern":"Número no vàlid.","storage-pack-size-required":"Cal número.","storage-path":"Ruta de magatzem","storage-path-required":"Cal ruta de magatzem.","storage-type":"Tipus de magatzem","storage-types":{"file-storage":"Magatzem fitxer","memory-storage":"Magatzem en memoria"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Cal Host.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"El port màxim és 65535.","thingsboard-port-min":"El port mínim és 1.","thingsboard-port-pattern":"Port no vàlid.","thingsboard-port-required":"Cal port.",tidy:"Endreçat","tidy-tip":"Endreçat JSON","title-connectors-json":"Configuració conector {{typeName}}","tls-path-ca-certificate":"Ruta al certificat CA al gateway","tls-path-client-certificate":"Ruta al certificat client al gateway","tls-path-private-key":"Ruta a la clau privada al gateway","toggle-fullscreen":"Pantalla completa fullscreen","transformer-json-config":"Configuració JSON*","update-config":"Afegir/actualizar configuració JSON"},vt={"add-entry":"Přidat konfiguraci","connector-add":"Přidat nový konektor","connector-enabled":"Povolit konektor","connector-name":"Název konektoru","connector-name-required":"Název konektoru je povinný.","connector-type":"Typ konektoru","connector-type-required":"Typ konektoru je povinný.",connectors:"Konfigurace konektoru","create-new-gateway":"Vytvořit novou bránu","create-new-gateway-text":"Jste si jisti, že chcete vytvořit novou bránu s názvem: '{{gatewayName}}'?",delete:"Smazat konfiguraci","download-tip":"Stáhnout soubor konfigurace",gateway:"Brána","gateway-exists":"Zařízení se shodným názvem již existuje.","gateway-name":"Název brány","gateway-name-required":"Název brány je povinný.","gateway-saved":"Konfigurace brány byla úspěšně uložena.","json-parse":"Neplatný JSON.","json-required":"Pole nemůže být prázdné.","no-connectors":"Žádné konektory","no-data":"Žádné konfigurace","no-gateway-found":"Žádné brány nebyly nalezeny.","no-gateway-matching":" '{{item}}' nenalezena.","path-logs":"Cesta k souborům logu","path-logs-required":"Cesta je povinná.",remote:"Vzdálená konfigurace","remote-logging-level":"Úroveň logování","remove-entry":"Odstranit konfiguraci","save-tip":"Uložit soubor konfigurace","security-type":"Typ zabezpečení","security-types":{"access-token":"Přístupový token",tls:"TLS"},storage:"Úložiště","storage-max-file-records":"Maximální počet záznamů v souboru","storage-max-files":"Maximální počet souborů","storage-max-files-min":"Minimální počet je 1.","storage-max-files-pattern":"Počet není platný.","storage-max-files-required":"Počet je povinný.","storage-max-records":"Maximální počet záznamů v úložišti","storage-max-records-min":"Minimální počet záznamů je 1.","storage-max-records-pattern":"Počet není platný.","storage-max-records-required":"Maximální počet záznamů je povinný.","storage-pack-size":"Maximální velikost souboru událostí","storage-pack-size-min":"Minimální počet je 1.","storage-pack-size-pattern":"Počet není platný.","storage-pack-size-required":"Maximální velikost souboru událostí je povinná.","storage-path":"Cesta k úložišti","storage-path-required":"Cesta k úložišti je povinná.","storage-type":"Typ úložiště","storage-types":{"file-storage":"Soubor","memory-storage":"Paměť"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Host je povinný.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"Maximální číslo portu je 65535.","thingsboard-port-min":"Minimální číslo portu je 1.","thingsboard-port-pattern":"Port není platný.","thingsboard-port-required":"Port je povinný.",tidy:"Uspořádat","tidy-tip":"Uspořádat JSON konfiguraci","title-connectors-json":"Konfigurace {{typeName}} konektoru","tls-path-ca-certificate":"Cesta k certifikátu CA brány","tls-path-client-certificate":"Cesta k certifikátu klienta brány","tls-path-private-key":"Cesta k privátnímu klíči brány","toggle-fullscreen":"Přepnout do režimu celé obrazovky","transformer-json-config":"JSON* konfigurace","update-config":"Přidat/editovat JSON konfiguraci"},xt={"add-entry":"Tilføj konfiguration","connector-add":"Tilføj ny stikforbindelse","connector-enabled":"Aktivér stikforbindelse","connector-name":"Navn på stikforbindelse","connector-name-required":"Navn på stikforbindelse er påkrævet.","connector-type":"Stikforbindelsestype","connector-type-required":"Stikforbindelsestype er påkrævet.",connectors:"Konfiguration af stikforbindelser","create-new-gateway":"Opret en ny gateway","create-new-gateway-text":"",delete:"Slet konfiguration","download-tip":"Download konfigurationsfil",gateway:"Gateway","gateway-exists":"Enhed med samme navn findes allerede.","gateway-name":"Gateway-navn","gateway-name-required":"Gateway-navn er påkrævet.","gateway-saved":"Gateway-konfigurationen blev gemt.","json-parse":"Ikke gyldig JSON.","json-required":"Feltet må ikke være tomt.","no-connectors":"Ingen stikforbindelser","no-data":"Ingen konfigurationer","no-gateway-found":"Ingen gateway fundet.","no-gateway-matching":"","path-logs":"Sti til logfiler","path-logs-required":"Sti er påkrævet.",remote:"Fjernkonfiguration","remote-logging-level":"Logføringsniveau","remove-entry":"Fjern konfiguration","save-tip":"Gem konfigurationsfil","security-type":"Sikkerhedstype","security-types":{"access-token":"Adgangstoken",tls:"TLS"},storage:"Lagring","storage-max-file-records":"Maks. antal poster i fil","storage-max-files":"Maks. antal filer","storage-max-files-min":"Min. antal er 1.","storage-max-files-pattern":"Antal er ikke gyldigt.","storage-max-files-required":"Antal er påkrævet.","storage-max-records":"Maks. antal poster i lagring","storage-max-records-min":"Min. antal poster er 1.","storage-max-records-pattern":"Antal er ikke gyldigt.","storage-max-records-required":"Maks. antal poster er påkrævet.","storage-pack-size":"Maks. antal pakkestørrelse for begivenhed","storage-pack-size-min":"Min. antal er 1.","storage-pack-size-pattern":"Antal er ikke gyldigt.","storage-pack-size-required":"Maks. antal pakkestørrelse for begivenhed er påkrævet.","storage-path":"Lagringssti","storage-path-required":"Lagringssti er påkrævet.","storage-type":"Lagringstype","storage-types":{"file-storage":"Lagring af filter","memory-storage":"Lagring af hukommelse"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard-vært","thingsboard-host-required":"Vært er påkrævet.","thingsboard-port":"ThingsBoard-port","thingsboard-port-max":"Maks. portnummer er 65535.","thingsboard-port-min":"Min. portnummer er 1.","thingsboard-port-pattern":"Port er ikke gyldig.","thingsboard-port-required":"Port er påkrævet.",tidy:"Tidy","tidy-tip":"Tidy konfig. JSON","title-connectors-json":"","tls-path-ca-certificate":"Sti til CA-certifikat på gateway","tls-path-client-certificate":"Sti til klientcertifikat på gateway","tls-path-private-key":"Sti til privat nøgle på gateway","toggle-fullscreen":"Skift til fuld skærm","transformer-json-config":"Konfiguration JSON*","update-config":"Tilføj/opdater konfiguration JSON"},bt={"add-entry":"Añadir configuración",advanced:"Avanzado","checking-device-activity":"Probando actividad de dispositivo",command:"Comandos Docker","command-copied-message":"Se han copiado los comandos al portapapeles",configuration:"Configuración","connector-add":"Añadir conector","connector-enabled":"Activar conector","connector-name":"Nombre conector","connector-name-required":"Se requiere nombre conector.","connector-type":"Tipo conector","connector-type-required":"Se requiere tipo conector.",connectors:"Conectores","connectors-config":"Configuración de conectores","connectors-table-enabled":"Enabled","connectors-table-name":"Nombre","connectors-table-type":"Tipo","connectors-table-status":"Estado","connectors-table-actions":"Acciones","connectors-table-key":"Clave","connectors-table-class":"Clase","rpc-command-send":"Enviar","rpc-command-result":"Resultado","rpc-command-edit-params":"Editar parametros","gateway-configuration":"Configuración General","create-new-gateway":"Crear un gateway nuevo","create-new-gateway-text":"Crear un nuevo gateway con el nombre: '{{gatewayName}}'?","created-time":"Hora de creación","configuration-delete-dialog-header":"Las configuraciones se borrarán","configuration-delete-dialog-body":"Sólo es posible desactivar la configuración remota, si hay acceso físico al gateway. Se borrarán todas las configuraciones previas.

\nPara desactivar la configuración, introduce el nombre del gateway aquí","configuration-delete-dialog-input":"Nombre Gateway","configuration-delete-dialog-input-required":"Se requiere nombre de gateway","configuration-delete-dialog-confirm":"Desactivar",delete:"Borrar configuración","download-tip":"Descargar fichero de configuración","drop-file":"Arrastra un fichero o",gateway:"Gateway","gateway-exists":"Ya existe un dispositivo con el mismo nombre.","gateway-name":"Nombre de Gateway","gateway-name-required":"Se requiere un nombre de gateway.","gateway-saved":"Configuración de gateway grabada satisfactoriamente.",grpc:"GRPC","grpc-keep-alive-timeout":"Timeout Keep alive (en ms)","grpc-keep-alive-timeout-required":"Se requiere Timeout Keep alive","grpc-keep-alive-timeout-min":"El valor no puede ser menor de 1","grpc-keep-alive-timeout-pattern":"El valor no es válido","grpc-keep-alive":"Keep alive (en ms)","grpc-keep-alive-required":"Se requiere keep alive","grpc-keep-alive-min":"El valor no puede ser menor de 1","grpc-keep-alive-pattern":"El valor keep alive no es válido","grpc-min-time-between-pings":"Tiempo mínimo entre pings (en ms)","grpc-min-time-between-pings-required":"Se requiere tiempo mínimo entre pings","grpc-min-time-between-pings-min":"El valor no puede ser menor de 1","grpc-min-time-between-pings-pattern":"El valor de tiempo mínimo entre pings no es válido","grpc-min-ping-interval-without-data":"Intervalo mínimo sin datos (en ms)","grpc-min-ping-interval-without-data-required":"Se requiere intervalo","grpc-min-ping-interval-without-data-min":"El valor no puede ser menor de 1","grpc-min-ping-interval-without-data-pattern":"El valor de intervalo no es válido","grpc-max-pings-without-data":"Intervalo máximo sin datos","grpc-max-pings-without-data-required":"Se requiere intervalo","grpc-max-pings-without-data-min":"El valor no puede ser menor de 1","grpc-max-pings-without-data-pattern":"El valor de intervalo no es válido","inactivity-check-period-seconds":"Periodo de control de inactividad (en segundos)","inactivity-check-period-seconds-required":"Se requiere periodo","inactivity-check-period-seconds-min":"El valor no puede ser menor de 1","inactivity-check-period-seconds-pattern":"El valor del periodo no es válido","inactivity-timeout-seconds":"Timeout de inactividad (en segundos)","inactivity-timeout-seconds-required":"Se requiere timeout de inactividad","inactivity-timeout-seconds-min":"El valor no puede ser menor de 1","inactivity-timeout-seconds-pattern":"El valor de inactividad no es válido","json-parse":"JSON no válido.","json-required":"El campo no puede estar vacío.",logs:{logs:"Registros",days:"días",hours:"horas",minutes:"minutos",seconds:"segundos","date-format":"Formato de fecha","date-format-required":"Se requiere formato de fecha","log-format":"Formato de registro","log-type":"Tipo de registro","log-format-required":"Se requiere tipo de registro",remote:"Registro remoto","remote-logs":"Registro remoto",local:"Registro local",level:"Nivel de registro","file-path":"Ruta de fichero","file-path-required":"Se requiere ruta de fichero","saving-period":"Periodo de guardado de registros","saving-period-min":"El periodo no puede ser menor que 1","saving-period-required":"Se requiere periodo de guardado","backup-count":"Número de backups","backup-count-min":"El número de backups no puede ser menor que 1","backup-count-required":"Se requiere número de backups"},"min-pack-send-delay":"Tiempo de espera, envío de paquetes (en ms)","min-pack-send-delay-required":"Se requiere tiempo de espera","min-pack-send-delay-min":"El tiempo de espera no puede ser menor que 0","no-connectors":"No hay conectores","no-data":"No hay configuraciones","no-gateway-found":"No se ha encontrado ningún gateway.","no-gateway-matching":" '{{item}}' no encontrado.","path-logs":"Ruta a los archivos de log","path-logs-required":"Ruta requerida.","permit-without-calls":"Permitir Keep alive si llamadas",remote:"Configuración remota","remote-logging-level":"Nivel de logging","remove-entry":"Borrar configuración","remote-shell":"Consola remota","remote-configuration":"Configuración remota",other:"otros","save-tip":"Grabar fichero de configuración","security-type":"Tipo de seguridad","security-types":{"access-token":"Tóken de acceso","username-password":"Usuario y contraseña",tls:"TLS","tls-access-token":"TLS + Tóken de acceso","tls-private-key":"TLS + Clave privada"},"server-port":"Puerto del servidor",statistics:{statistic:"Estadística",statistics:"Estadísticas","statistic-commands-empty":"No hay estadísticas",commands:"Comandos","send-period":"Periodo de envío de estadísticas (en segundos)","send-period-required":"Se requiere periodo de envío","send-period-min":"El periodo de envío no puede ser menor de 60","send-period-pattern":"El periodo de envío no es válido","check-connectors-configuration":"Revisar configuración de conectores (en segundos)","check-connectors-configuration-required":"Se requiere un valor","check-connectors-configuration-min":"El valor no puede ser menor de 1","check-connectors-configuration-pattern":"La configuración no es válida",add:"Añadir comando",timeout:"Timeout","timeout-required":"Se requiere timeout","timeout-min":"El timeout no puede ser menor de 1","timeout-pattern":"El timeout no es válido","attribute-name":"Nombre de atributo","attribute-name-required":"Se requiere nombre de atributo",command:"Comando","command-required":"Se requiere comando",remove:"Borrar comando"},storage:"Grabación","storage-max-file-records":"Número máximo de registros en fichero","storage-max-files":"Número máximo de ficheros","storage-max-files-min":"El número mínimo es 1.","storage-max-files-pattern":"Número no válido.","storage-max-files-required":"Se requiere número.","storage-max-records":"Máximo de registros en el almacén","storage-max-records-min":"El número mínimo es 1.","storage-max-records-pattern":"Número no válido.","storage-max-records-required":"Se requiere número.","storage-read-record-count":"Leer número de entradas en almacén","storage-read-record-count-min":"El número mínimo de entradas es 1.","storage-read-record-count-pattern":"El número no es válido.","storage-read-record-count-required":"Se requiere número de entradas.","storage-max-read-record-count":"Número máximo de entradas en el almacén","storage-max-read-record-count-min":"El número mínimo es 1.","storage-max-read-record-count-pattern":"El número no es válido","storage-max-read-record-count-required":"Se requiere número máximo de entradas.","storage-data-folder-path":"Ruta de carpeta de datos","storage-data-folder-path-required":"Se requiere ruta.","storage-pack-size":"Tamaño máximo de eventos","storage-pack-size-min":"El número mínimo es 1.","storage-pack-size-pattern":"Número no válido.","storage-pack-size-required":"Se requiere número.","storage-path":"Ruta de almacén","storage-path-required":"Se requiere ruta de almacén.","storage-type":"Tipo de almacén","storage-types":{"file-storage":"Almacén en fichero","memory-storage":"Almacén en memoria",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Se requiere Host.","thingsboard-port":"Puerto ThingsBoard","thingsboard-port-max":"El puerto máximo es 65535.","thingsboard-port-min":"El puerto mínimo es 1.","thingsboard-port-pattern":"Puerto no válido.","thingsboard-port-required":"Se requiere puerto.",tidy:"Tidy","tidy-tip":"Tidy JSON","title-connectors-json":"Configuración conector {{typeName}}","tls-path-ca-certificate":"Ruta al certificado CA en el gateway","tls-path-client-certificate":"Ruta al certificado cliente en el gateway","messages-ttl-check-in-hours":"Comprobación de TTL de mensajes en horas","messages-ttl-check-in-hours-required":"Campo requerido.","messages-ttl-check-in-hours-min":"El mínimo es 1.","messages-ttl-check-in-hours-pattern":"El número no es válido.","messages-ttl-in-days":"TTL (Time to live) de mensages en días","messages-ttl-in-days-required":"Se requiere TTL de mensajes.","messages-ttl-in-days-min":"El número mínimo es 1.","messages-ttl-in-days-pattern":"El número no es válido.","mqtt-qos":"QoS","mqtt-qos-required":"Se requiere QoS","mqtt-qos-range":"El rango de valores es desde 0 a 1","tls-path-private-key":"Ruta a la clave privada en el gateway","toggle-fullscreen":"Pantalla completa fullscreen","transformer-json-config":"Configuración JSON*","update-config":"Añadir/actualizar configuración JSON",hints:{"remote-configuration":"Habilita la administración y configuración remota del gateway","remote-shell":"Habilita el control remoto del sistema operativo del gateway desde el widget terminal remoto",host:"Hostname o dirección IP del servidor Thingsboard",port:"Puerto del servicio MQTT en el servidor Thingsboard",token:"Access token para el gateway","client-id":"ID de cliente MQTT para el gateway",username:"Usuario MQTT para el gateway",password:"Contraseña MQTT para el gateway","ca-cert":"Ruta al fichero del certificado CA","date-form":"Formato de fecha en los mensajes de registro","data-folder":"Ruta a la carpeta que contendrá los datos (Relativa o absoluta)","log-format":"Formato de mensajes en registro","remote-log":"Habilita el registro remoto y la posterior lectura desde el gateway","backup-count":"Si el contaje de copias de seguridad es mayor que 0, cuando se realice una renovación, no se conservan más que los archivos de recuento de copias de seguridad, los más antíguos se eliminarán",storage:"Provee la configuración para el grabado de datos entrantes antes de que se envíen a la plataforma","max-file-count":"Número máximo de ficheros que se crearán","max-read-count":"Númeo máximo de mensajes a obtener desde el disco y enviados a la plataforma","max-records":"Número máximo de registros que se guardarán en un solo fichero","read-record-count":"Número de mensages a obtener desde el almacenamiento y enviados a la plataforma","max-records-count":"Número máximo de datos en almacenamiento antes de enviar a la plataforma","ttl-check-hour":"Con qué frecuencia el gateway comprobará si los datos están obsoletos","ttl-messages-day":"Número máximo de días para la retención de datos en el almacén",commands:"Comandos para recoger estadísticas adicionales",attribute:"Clave de telemetría para estadísticas",timeout:"Timeout para la ejecución de comandos",command:"El resultado de la ejecución del comando, se usará como valor para la telemetría","check-device-activity":"Habilita la monitorización de cada uno de los dispositivos conectados","inactivity-timeout":"Tiempo tras que el gateway desconectará el dispositivo","inactivity-period":"Periodo de monitorización de actividad en el dispositivo","minimal-pack-delay":"Tiempo de espera entre envío de paquetes de mensajes (Un valor muy bajo, resultará en un aumento de uso de la CPU en el gateway)",qos:"Quality of Service en los mensajes MQTT (0 - at most once, 1 - at least once)","server-port":"Puerto de red en el cual el servidor GRPC escuchará conexiones entrantes.","grpc-keep-alive-timeout":"Tiempo máximo, el cual el servidor esperara un ping keepalive antes de considerar la conexión terminada.","grpc-keep-alive":"Duración entre dos pings keepalive cuando no haya llamada RPC activa.","grpc-min-time-between-pings":"Mínimo tiempo que el servidor debe esperar entre envíos de mensajes de ping","grpc-max-pings-without-data":"Número máximo de pings keepalive que el servidor puede enviar sin recibir ningún dato antes de considerar la conexión terminada.","grpc-min-ping-interval-without-data":"Mínimo tiempo que el servidor debe esperar entre envíos de ping keepalive cuando no haya ningún dato en envío o recepción.","permit-without-calls":"Permitir al servidor mantener la conexión GRPC abierta, cuando no haya llamadas RPC activas."}},wt={"add-entry":"설정 추가","connector-add":"새로운 연결자 추가","connector-enabled":"Enable connector","connector-name":"Connector name","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors configuration","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?",delete:"Delete configuration","download-tip":"Download configuration file",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","path-logs":"Path to log files","path-logs-required":"Path is required.",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","save-tip":"Save configuration file","security-type":"Security type","security-types":{"access-token":"Access Token",tls:"TLS"},storage:"Storage","storage-max-file-records":"Maximum records in file","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host is required.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON"},St={"add-entry":"Add configuration",advanced:"Advanced","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","connector-add":"Add new connector","connector-enabled":"Enable connector","connector-name":"Connector name","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","rpc-command-send":"Send","rpc-command-result":"Result","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"In order to run ThingsBoard IoT gateway in docker with credentials for this device you can use the following commands.","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off",delete:"Delete configuration","download-tip":"Download configuration file","drop-file":"Drop file here or",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 0","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","path-logs":"Path to log files","path-logs-required":"Path is required.","permit-without-calls":"Keep alive permit without calls",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","remote-shell":"Remote shell","remote-configuration":"Remote Configuration",other:"Other","save-tip":"Save configuration file","security-type":"Security type","security-types":{"access-token":"Access Token","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"server-port":"Server port",statistics:{statistic:"Statistic",statistics:"Statistics","statistic-commands-empty":"No statistics available",commands:"Commands","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid",add:"Add command",timeout:"Timeout","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","attribute-name":"Attribute name","attribute-name-required":"Attribute name is required",command:"Command","command-required":"Command is required",remove:"Remove command"},storage:"Storage","storage-max-file-records":"Maximum records in file","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count":"Max read record count in storage","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max Read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host is required.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON",hints:{"remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of ThingsBoard server",port:"Port of MQTT service on ThingsBoard server",token:"Access token for the gateway from ThingsBoard server","client-id":"MQTT client id for the gateway form ThingsBoard server",username:"MQTT username for the gateway form ThingsBoard server",password:"MQTT password for the gateway form ThingsBoard server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","data-folder":"Path to folder, that will contains data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum count of file that will be created","max-read-count":"Count of messages to get from storage and send to ThingsBoard","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Count of messages to get from storage and send to ThingsBoard","max-records-count":"Maximum count of data in storage before send to ThingsBoard","ttl-check-hour":"How often will Gateway check data for obsolescence","ttl-messages-day":"Maximum days that storage will save data",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls."}},Ct={"add-entry":"Configuratie toevoegen","connector-add":"Nieuwe connector toevoegen","connector-enabled":"Connector inschakelen","connector-name":"Naam van de connector","connector-name-required":"De naam van de connector is vereist.","connector-type":"Type aansluiting","connector-type-required":"Het type connector is vereist.",connectors:"Configuratie van connectoren","create-new-gateway":"Een nieuwe gateway maken","create-new-gateway-text":"Weet u zeker dat u een nieuwe gateway wilt maken met de naam: '{{gatewayName}}'?",delete:"Configuratie verwijderen","download-tip":"Configuratiebestand downloaden",gateway:"Gateway","gateway-exists":"Device met dezelfde naam bestaat al.","gateway-name":"Naam van de gateway","gateway-name-required":"De naam van de gateway is vereist.","gateway-saved":"Gatewayconfiguratie succesvol opgeslagen.","json-parse":"Ongeldige JSON.","json-required":"Het veld mag niet leeg zijn.","no-connectors":"Geen connectoren","no-data":"Geen configuraties","no-gateway-found":"Geen gateway gevonden.","no-gateway-matching":"'{{item}}' niet gevonden.","path-logs":"Pad naar logbestanden","path-logs-required":"Pad is vereist.",remote:"Configuratie op afstand","remote-logging-level":"Registratie niveau","remove-entry":"Configuratie verwijderen","save-tip":"Configuratiebestand opslaan","security-type":"Soort beveiliging","security-types":{"access-token":"Toegang tot token",tls:"TLS (TLS)"},storage:"Opslag","storage-max-file-records":"Maximum aantal records in bestand","storage-max-files":"Maximaal aantal bestanden","storage-max-files-min":"Minimum aantal is 1.","storage-max-files-pattern":"Nummer is niet geldig.","storage-max-files-required":"Nummer is vereist.","storage-max-records":"Maximum aantal records in opslag","storage-max-records-min":"Minimum aantal records is 1.","storage-max-records-pattern":"Nummer is niet geldig.","storage-max-records-required":"Maximale records zijn vereist.","storage-pack-size":"Maximale pakketgrootte voor events","storage-pack-size-min":"Minimum aantal is 1.","storage-pack-size-pattern":"Nummer is niet geldig.","storage-pack-size-required":"De maximale pakketgrootte van het event is vereist.","storage-path":"Opslag pad","storage-path-required":"Opslagpad is vereist.","storage-type":"Type opslag","storage-types":{"file-storage":"Opslag van bestanden","memory-storage":"Geheugen opslag"},thingsboard:"Dingen Bord","thingsboard-host":"ThingsBoard-gastheer","thingsboard-host-required":"Server host is vereist.","thingsboard-port":"ThingsBoard-poort","thingsboard-port-max":"Het maximale poortnummer is 65535.","thingsboard-port-min":"Het minimale poortnummer is 1.","thingsboard-port-pattern":"Poort is niet geldig.","thingsboard-port-required":"Poort is vereist.",tidy:"Ordelijk","tidy-tip":"Opgeruimde configuratie JSON","title-connectors-json":"Configuratie van connector {{typeName}}","tls-path-ca-certificate":"Pad naar CA-certificaat op gateway","tls-path-client-certificate":"Pad naar clientcertificaat op gateway","tls-path-private-key":"Pad naar privésleutel op gateway","toggle-fullscreen":"Volledig scherm in- en uitschakelen","transformer-json-config":"Configuratie JSON*","update-config":"Configuratie JSON toevoegen/bijwerken"},_t={"add-entry":"Dodaj konfigurację",advanced:"Advanced","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","connector-add":"Dodaj nowe złącze","connector-enabled":"Włącz złącze","connector-name":"Nazwa złącza","connector-name-required":"Nazwa złącza jest wymagana.","connector-type":"Typ złącza","connector-type-required":"Typ złącza jest wymagany.",connectors:"Konfiguracja złączy","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","rpc-command-send":"Send","rpc-command-result":"Result","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"In order to run ThingsBoard IoT gateway in docker with credentials for this device you can use the following commands.","create-new-gateway":"Utwórz nowy gateway","create-new-gateway-text":"Czy na pewno chcesz utworzyć nowy gateway o nazwie: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off",delete:"Usuń konfigurację","download-tip":"Pobierz plik konfiguracyjny","drop-file":"Drop file here or",gateway:"Wejście","gateway-exists":"Urządzenie o tej samej nazwie już istnieje.","gateway-name":"Nazwa Gateway","gateway-name-required":"Nazwa Gateway'a jest wymagana.","gateway-saved":"Konfiguracja Gatewey'a została pomyślnie zapisana.",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","json-parse":"Nieprawidłowy JSON.","json-required":"Pole nie może być puste.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 0","no-connectors":"Brak złączy","no-data":"Brak konfiguracji","no-gateway-found":"Nie znaleziono gateway'a.","no-gateway-matching":" '{{item}}' nie znaleziono.","path-logs":"Ścieżka do plików dziennika","path-logs-required":"Ścieżka jest wymagana.","permit-without-calls":"Keep alive permit without calls",remote:"Zdalna konfiguracja","remote-logging-level":"Poziom logowania","remove-entry":"Usuń konfigurację","remote-shell":"Remote shell","remote-configuration":"Remote Configuration",other:"Other","save-tip":"Zapisz plik konfiguracyjny","security-type":"Rodzaj zabezpieczenia","security-types":{"access-token":"Token dostępu","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"server-port":"Server port",statistics:{statistic:"Statistic",statistics:"Statistics","statistic-commands-empty":"No statistics available",commands:"Commands","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid",add:"Add command",timeout:"Timeout","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","attribute-name":"Attribute name","attribute-name-required":"Attribute name is required",command:"Command","command-required":"Command is required",remove:"Remove command"},storage:"Składowanie","storage-max-file-records":"Maksymalna liczba rekordów w pliku","storage-max-files":"Maksymalna liczba plików","storage-max-files-min":"Minimalna liczba to 1.","storage-max-files-pattern":"Numer jest nieprawidłowy.","storage-max-files-required":"Numer jest wymagany.","storage-max-records":"Maksymalna liczba rekordów w pamięci","storage-max-records-min":"Minimalna liczba rekordów to 1.","storage-max-records-pattern":"Numer jest nieprawidłowy.","storage-max-records-required":"Maksymalna liczba rekordów jest wymagana.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count":"Max read record count in storage","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max Read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-pack-size":"Maksymalny rozmiar pakietu wydarzeń","storage-pack-size-min":"Minimalna liczba to 1.","storage-pack-size-pattern":"Numer jest nieprawidłowy.","storage-pack-size-required":"Maksymalny rozmiar pakietu wydarzeń jest wymagany.","storage-path":"Ścieżka przechowywania","storage-path-required":"Ścieżka do przechowywania jest wymagana.","storage-type":"Typ składowania","storage-types":{"file-storage":"Nośnik danych","memory-storage":"Przechowywanie pamięci",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"Gospodarz ThingsBoard","thingsboard-host-required":"Host jest wymagany.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"Maksymalny numer portu to 65535.","thingsboard-port-min":"Minimalny numer portu to 1.","thingsboard-port-pattern":"Port jest nieprawidłowy.","thingsboard-port-required":"Port jest wymagany.",tidy:"Uporządkuj","tidy-tip":"Uporządkowana konfiguracja JSON","title-connectors-json":"Złącze {{typeName}} konfiguracja","tls-path-ca-certificate":"Ścieżka do certyfikatu CA na gateway","tls-path-client-certificate":"Ścieżka do certyfikatu klienta na gateway","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1","tls-path-private-key":"Ścieżka do klucza prywatnego na bramce","toggle-fullscreen":"Przełącz tryb pełnoekranowy","transformer-json-config":"Konfiguracja JSON*","update-config":"Dodaj/zaktualizuj konfigurację JSON",hints:{"remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of ThingsBoard server",port:"Port of MQTT service on ThingsBoard server",token:"Access token for the gateway from ThingsBoard server","client-id":"MQTT client id for the gateway form ThingsBoard server",username:"MQTT username for the gateway form ThingsBoard server",password:"MQTT password for the gateway form ThingsBoard server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","data-folder":"Path to folder, that will contains data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum count of file that will be created","max-read-count":"Count of messages to get from storage and send to ThingsBoard","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Count of messages to get from storage and send to ThingsBoard","max-records-count":"Maximum count of data in storage before send to ThingsBoard","ttl-check-hour":"How often will Gateway check data for obsolescence","ttl-messages-day":"Maximum days that storage will save data",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls."}},Tt={"add-entry":"Adicionar configuração","connector-add":"Adicionar novo conector","connector-enabled":"Habilitar conector","connector-name":"Nome do conector","connector-name-required":"O nome do conector é obrigatório.","connector-type":"Tipo de conector","connector-type-required":"O tipo de conector é obrigatório.",connectors:"Configuração de conectores","create-new-gateway":"Criar um novo gateway","create-new-gateway-text":"Tem certeza de que deseja criar um novo gateway com o nome: '{{gatewayName}}'?",delete:"Excluir configuração","download-tip":"Download de arquivo de configuração",gateway:"Gateway","gateway-exists":"Já existe um dispositivo com o mesmo nome.","gateway-name":"Nome do gateway","gateway-name-required":"O nome do gateway é obrigatório.","gateway-saved":"A configuração do gateway foi salva corretamente.","json-parse":"JSON inválido.","json-required":"O campo não pode estar em branco.","no-connectors":"Sem conectores","no-data":"Sem configurações","no-gateway-found":"Nenhum gateway encontrado.","no-gateway-matching":" '{{item}}' não encontrado.","path-logs":"Caminho para arquivos de log","path-logs-required":"O caminho é obrigatório",remote:"Configuração remota","remote-logging-level":"Nível de registro em log","remove-entry":"Remover configuração","save-tip":"Salvar arquivo de configuração","security-type":"Tipo de segurança","security-types":{"access-token":"Token de Acesso",tls:"TLS"},storage:"Armazenamento","storage-max-file-records":"Número máximo de registros em arquivo","storage-max-files":"Número máximo de arquivos","storage-max-files-min":"O número mínimo é 1.","storage-max-files-pattern":"O número não é válido.","storage-max-files-required":"O número é obrigatório.","storage-max-records":"Número máximo de registros em armazenamento","storage-max-records-min":"O número mínimo de registros é 1.","storage-max-records-pattern":"O número não é válido.","storage-max-records-required":"O número máximo de registros é obrigatório.","storage-pack-size":"Tamanho máximo de pacote de eventos","storage-pack-size-min":"O número mínimo é 1.","storage-pack-size-pattern":"O número não é válido.","storage-pack-size-required":"O tamanho máximo de pacote de eventos é obrigatório.","storage-path":"Caminho de armazenamento","storage-path-required":"O caminho de armazenamento é obrigatório.","storage-type":"Tipo de armazenamento","storage-types":{"file-storage":"Armazenamento de arquivo","memory-storage":"Armazenamento de memória"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"O host é obrigatório.","thingsboard-port":"Porta ThingsBoard","thingsboard-port-max":"O número máximo de portas é 65535.","thingsboard-port-min":"O número mínimo de portas é 1.","thingsboard-port-pattern":"A porta não é válida.","thingsboard-port-required":"A porta é obrigatória.",tidy:"Tidy","tidy-tip":"Config Tidy JSON","title-connectors-json":"Configuração do conector {{typeName}}","tls-path-ca-certificate":"Caminho para certificado de Autoridade de Certificação no gateway","tls-path-client-certificate":"Caminho para certificado de cliente no gateway","tls-path-private-key":"Caminho para chave privada no gateway","toggle-fullscreen":"Alternar tela inteira","transformer-json-config":"Configuração JSON*","update-config":"Adicionar/atualizar configuração de JSON"},It={"add-entry":"Dodaj konfiguracijo","connector-add":"Dodaj nov priključek","connector-enabled":"Omogoči priključek","connector-name":"Ime priključka","connector-name-required":"Ime priključka je obvezno.","connector-type":"Vrsta priključka","connector-type-required":"Zahteva se vrsta priključka.",connectors:"Konfiguracija priključkov","create-new-gateway":"Ustvari nov prehod","create-new-gateway-text":"Ali ste prepričani, da želite ustvariti nov prehod z imenom: '{{gatewayName}}'?",delete:"Izbriši konfiguracijo","download-tip":"Prenos konfiguracijske datoteke",gateway:"Prehod","gateway-exists":"Naprava z istim imenom že obstaja.","gateway-name":"Ime prehoda","gateway-name-required":"Ime prehoda je obvezno.","gateway-saved":"Konfiguracija prehoda je uspešno shranjena.","json-parse":"Neveljaven JSON.","json-required":"Polje ne sme biti prazno.","no-connectors":"Ni priključkov","no-data":"Brez konfiguracij","no-gateway-found":"Prehod ni najden.","no-gateway-matching":" '{{item}}' ni mogoče najti.","path-logs":"Pot do dnevniških datotek","path-logs-required":"Pot je obvezna.",remote:"Oddaljena konfiguracija","remote-logging-level":"Raven beleženja","remove-entry":"Odstrani konfiguracijo","save-tip":"Shrani konfiguracijsko datoteko","security-type":"Vrsta zaščite","security-types":{"access-token":"Dostopni žeton",tls:"TLS"},storage:"Shramba","storage-max-file-records":"Največ zapisov v datoteki","storage-max-files":"Največje število datotek","storage-max-files-min":"Najmanjše število je 1.","storage-max-files-pattern":"Številka ni veljavna.","storage-max-files-required":"Številka je obvezna.","storage-max-records":"Največ zapisov v pomnilniku","storage-max-records-min":"Najmanjše število zapisov je 1.","storage-max-records-pattern":"Številka ni veljavna.","storage-max-records-required":"Zahtevan je največ zapisov.","storage-pack-size":"Največja velikost paketa dogodkov","storage-pack-size-min":"Najmanjše število je 1.","storage-pack-size-pattern":"Številka ni veljavna.","storage-pack-size-required":"Zahtevana je največja velikost paketa dogodkov.","storage-path":"Pot pomnilnika","storage-path-required":"Zahtevana je pot do pomnilnika.","storage-type":"Vrsta pomnilnika","storage-types":{"file-storage":"Shramba datotek","memory-storage":"Spomin pomnilnika"},thingsboard:"ThingsBoard","thingsboard-host":"Gostitelj ThingsBoard","thingsboard-host-required":"Potreben je gostitelj.","thingsboard-port":"Vrata ThingsBoard","thingsboard-port-max":"Največja številka vrat je 65535.","thingsboard-port-min":"Najmanjša številka vrat je 1.","thingsboard-port-pattern":"Vrata niso veljavna.","thingsboard-port-required":"Potrebna so vrata.",tidy:"Urejeno","tidy-tip":"Urejena konfiguracija JSON","title-connectors-json":"Konfiguracija konektorja {{typeName}}","tls-path-ca-certificate":"Pot do potrdila CA na prehodu","tls-path-client-certificate":"Pot do potrdila stranke na prehodu","tls-path-private-key":"Pot do zasebnega ključa na prehodu","toggle-fullscreen":"Preklop na celozaslonski način","transformer-json-config":"Konfiguracija JSON *","update-config":"Dodaj / posodobi konfiguracijo JSON"},Et={"add-entry":"Yapılandırma ekle","connector-add":"Yeni bağlayıcı ekle","connector-enabled":"Bağlayıcıyı etkinleştir","connector-name":"Bağlayıcı adı","connector-name-required":"Bağlayıcı adı gerekli.","connector-type":"Bağlayıcı tipi","connector-type-required":"Bağlayıcı türü gerekli.",connectors:"Bağlayıcıların yapılandırması","create-new-gateway":"Yeni bir ağ geçidi oluştur","create-new-gateway-text":"'{{gatewayName}}' adında yeni bir ağ geçidi oluşturmak istediğinizden emin misiniz?",delete:"Yapılandırmayı sil","download-tip":"Yapılandırma dosyasını indirin",gateway:"Ağ geçidi","gateway-exists":"Aynı ada sahip cihaz zaten var.","gateway-name":"Ağ geçidi adı","gateway-name-required":"Ağ geçidi adı gerekli.","gateway-saved":"Ağ geçidi yapılandırması başarıyla kaydedildi.","json-parse":"Geçerli bir JSON değil.","json-required":"Alan boş olamaz.","no-connectors":"Bağlayıcı yok","no-data":"Yapılandırma yok","no-gateway-found":"Ağ geçidi bulunamadı.","no-gateway-matching":" '{{item}}' bulunamadı.","path-logs":"Log dosyaları yolu","path-logs-required":"Log dosyaları dizini gerekli.",remote:"Uzaktan yapılandırma","remote-logging-level":"Loglama seviyesi","remove-entry":"Yapılandırmayı kaldır","save-tip":"Yapılandırma dosyasını kaydet","security-type":"Güvenlik türü","security-types":{"access-token":"Access Token",tls:"TLS"},storage:"Depolama","storage-max-file-records":"Dosyadaki maksimum kayıt","storage-max-files":"Maksimum dosya sayısı","storage-max-files-min":"Minimum sayı 1'dir.","storage-max-files-pattern":"Sayı geçerli değil.","storage-max-files-required":"Sayı gerekli.","storage-max-records":"Depodaki maksimum kayıt","storage-max-records-min":"Minimum kayıt sayısı 1'dir.","storage-max-records-pattern":"Sayı geçerli değil.","storage-max-records-required":"Maksimum kayıt gerekli.","storage-pack-size":"Maksimum etkinlik paketi boyutu","storage-pack-size-min":"Minimum sayı 1'dir.","storage-pack-size-pattern":"Sayı geçerli değil.","storage-pack-size-required":"Maksimum etkinlik paketi boyutu gerekli.","storage-path":"Depolama yolu","storage-path-required":"Depolama yolu gerekli.","storage-type":"Depolama türü","storage-types":{"file-storage":"Dosya depolama","memory-storage":"Bellek depolama"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host gerekli.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maksimum port numarası 65535.","thingsboard-port-min":"Minimum port numarası 1'dir.","thingsboard-port-pattern":"Port geçerli değil.","thingsboard-port-required":"Port gerekli.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON"},Mt={"add-entry":"添加配置",advanced:"高级","checking-device-activity":"检查设备活动",command:"Docker命令","command-copied-message":"Docker命令已复制到剪贴板",configuration:"配置","connector-add":"添加连接器","connector-enabled":"启用连接器","connector-name":"连接器名称","connector-name-required":"连接器名称必填。","connector-type":"连接器类型","connector-type-required":"连接器类型必填。",connectors:"连接器配置","connectors-config":"连接器配置","connectors-table-enabled":"已启用","connectors-table-name":"名称","connectors-table-type":"类型","connectors-table-status":"状态","connectors-table-actions":"操作","connectors-table-key":"键","connectors-table-class":"类","rpc-command-send":"发送","rpc-command-result":"结果","rpc-command-edit-params":"编辑参数","gateway-configuration":"通用配置","create-new-gateway":"创建网关","create-new-gateway-text":"确定要创建名为 '{{gatewayName}}' 的新网关?","created-time":"创建时间","configuration-delete-dialog-header":"配置将被删除","configuration-delete-dialog-body":"只有对网关进行物理访问时,才有可能关闭远程配置。所有先前的配置都将被删除。

\n要关闭配置,请在下面输入网关名称","configuration-delete-dialog-input":"网关名称","configuration-delete-dialog-input-required":"网关名称是必需的","configuration-delete-dialog-confirm":"关闭",delete:"删除配置","download-tip":"下载配置","drop-file":"将文件拖放到此处或",gateway:"网关","gateway-exists":"同名设备已存在。","gateway-name":"网关名称","gateway-name-required":"网关名称必填。","gateway-saved":"已成功保存网关配置。",grpc:"GRPC","grpc-keep-alive-timeout":"保持连接超时(毫秒)","grpc-keep-alive-timeout-required":"需要保持连接超时","grpc-keep-alive-timeout-min":"保持连接超时不能小于1","grpc-keep-alive-timeout-pattern":"保持连接超时无效","grpc-keep-alive":"保持连接(毫秒)","grpc-keep-alive-required":"需要保持连接","grpc-keep-alive-min":"保持连接不能小于1","grpc-keep-alive-pattern":"保持连接无效","grpc-min-time-between-pings":"最小Ping间隔(毫秒)","grpc-min-time-between-pings-required":"需要最小Ping间隔","grpc-min-time-between-pings-min":"最小Ping间隔不能小于1","grpc-min-time-between-pings-pattern":"最小Ping间隔无效","grpc-min-ping-interval-without-data":"无数据时的最小Ping间隔(毫秒)","grpc-min-ping-interval-without-data-required":"需要无数据时的最小Ping间隔","grpc-min-ping-interval-without-data-min":"无数据时的最小Ping间隔不能小于1","grpc-min-ping-interval-without-data-pattern":"无数据时的最小Ping间隔无效","grpc-max-pings-without-data":"无数据时的最大Ping数","grpc-max-pings-without-data-required":"需要无数据时的最大Ping数","grpc-max-pings-without-data-min":"无数据时的最大Ping数不能小于1","grpc-max-pings-without-data-pattern":"无数据时的最大Ping数无效","inactivity-check-period-seconds":"不活跃检查期(秒)","inactivity-check-period-seconds-required":"需要不活跃检查期","inactivity-check-period-seconds-min":"不活跃检查期不能小于1","inactivity-check-period-seconds-pattern":"不活跃检查期无效","inactivity-timeout-seconds":"不活跃超时(秒)","inactivity-timeout-seconds-required":"需要不活跃超时","inactivity-timeout-seconds-min":"不活跃超时不能小于1","inactivity-timeout-seconds-pattern":"不活跃超时无效","json-parse":"无效的JSON。","json-required":"字段不能为空。",logs:{logs:"日志",days:"天",hours:"小时",minutes:"分钟",seconds:"秒","date-format":"日期格式","date-format-required":"需要日期格式","log-format":"日志格式","log-type":"日志类型","log-format-required":"需要日志格式",remote:"远程日志记录","remote-logs":"远程日志",local:"本地日志记录",level:"日志级别","file-path":"文件路径","file-path-required":"需要文件路径","saving-period":"日志保存期限","saving-period-min":"日志保存期限不能小于1","saving-period-required":"需要日志保存期限","backup-count":"备份数量","backup-count-min":"备份数量不能小于1","backup-count-required":"需要备份数量"},"min-pack-send-delay":"最小包发送延迟(毫秒)","min-pack-send-delay-required":"最小包发送延迟是必需的","min-pack-send-delay-min":"最小包发送延迟不能小于0","no-connectors":"无连接器","no-data":"没有配置","no-gateway-found":"未找到网关。","no-gateway-matching":"未找到 '{{item}}' 。","path-logs":"日志文件的路径","path-logs-required":"路径是必需的。","permit-without-calls":"保持连接许可,无需响应",remote:"远程配置","remote-logging-level":"日志记录级别","remove-entry":"删除配置","remote-shell":"远程Shell","remote-configuration":"远程配置",other:"其他","save-tip":"保存配置","security-type":"安全类型","security-types":{"access-token":"访问令牌","username-password":"用户名和密码",tls:"TLS","tls-access-token":"TLS + 访问令牌","tls-private-key":"TLS + 私钥"},"server-port":"服务器端口",statistics:{statistic:"统计信息",statistics:"统计信息","statistic-commands-empty":"无可用统计信息",commands:"命令","send-period":"统计信息发送周期(秒)","send-period-required":"统计信息发送周期是必需的","send-period-min":"统计信息发送周期不能小于60","send-period-pattern":"统计信息发送周期无效","check-connectors-configuration":"检查连接器配置(秒)","check-connectors-configuration-required":"检查连接器配置是必需的","check-connectors-configuration-min":"检查连接器配置不能小于1","check-connectors-configuration-pattern":"检查连接器配置无效",add:"添加命令",timeout:"超时时间","timeout-required":"超时时间是必需的","timeout-min":"超时时间不能小于1","timeout-pattern":"超时时间无效","attribute-name":"属性名称","attribute-name-required":"属性名称是必需的",command:"命令","command-required":"命令是必需的","command-pattern":"命令无效",remove:"删除命令"},storage:"存储","storage-max-file-records":"文件中的最大记录数","storage-max-files":"最大文件数","storage-max-files-min":"最小值为1。","storage-max-files-pattern":"数字无效。","storage-max-files-required":"数字是必需的。","storage-max-records":"存储中的最大记录数","storage-max-records-min":"最小记录数为1。","storage-max-records-pattern":"数字无效。","storage-max-records-required":"最大记录项必填。","storage-read-record-count":"存储中的读取记录数","storage-read-record-count-min":"最小记录数为1。","storage-read-record-count-pattern":"数字不合法。","storage-read-record-count-required":"需要读取记录数。","storage-max-read-record-count":"存储中的最大读取记录数","storage-max-read-record-count-min":"最小记录数为1。","storage-max-read-record-count-pattern":"数字不合法。","storage-max-read-record-count-required":"最大读取记录数必需。","storage-data-folder-path":"数据文件夹路径","storage-data-folder-path-required":"需要数据文件夹路径。","storage-pack-size":"最大事件包大小","storage-pack-size-min":"最小值为1。","storage-pack-size-pattern":"数字无效。","storage-pack-size-required":"最大事件包大小必填。","storage-path":"存储路径","storage-path-required":"存储路径必填。","storage-type":"存储类型","storage-types":{"file-storage":"文件存储","memory-storage":"内存存储",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"常规","thingsboard-host":"ThingsBoard主机","thingsboard-host-required":"主机必填。","thingsboard-port":"ThingsBoard端口","thingsboard-port-max":"最大端口号为65535。","thingsboard-port-min":"最小端口号为1。","thingsboard-port-pattern":"端口无效。","thingsboard-port-required":"端口必填。",tidy:"整理","tidy-tip":"整理配置JSON","title-connectors-json":"连接器 {{typeName}} 配置","tls-path-ca-certificate":"网关上CA证书的路径","tls-path-client-certificate":"网关上客户端证书的路径","messages-ttl-check-in-hours":"消息TTL检查小时数","messages-ttl-check-in-hours-required":"需要提供消息TTL检查小时数。","messages-ttl-check-in-hours-min":"最小值为1。","messages-ttl-check-in-hours-pattern":"数字无效。","messages-ttl-in-days":"消息TTL天数","messages-ttl-in-days-required":"需要提供消息TTL天数。","messages-ttl-in-days-min":"最小值为1。","messages-ttl-in-days-pattern":"数字无效。","mqtt-qos":"QoS","mqtt-qos-required":"需要提供QoS","mqtt-qos-range":"QoS值的范围是从0到1","tls-path-private-key":"网关上私钥的路径","toggle-fullscreen":"切换全屏","transformer-json-config":"配置JSON*","update-config":"添加/更新配置JSON",hints:{"remote-configuration":"启用对网关的远程配置和管理","remote-shell":"通过远程Shell小部件启用对网关操作系统的远程控制",host:"ThingsBoard 主机名或IP地址",port:"ThingsBoard MQTT服务端口",token:"ThingsBoard 网关访问令牌","client-id":"ThingsBoard 网关MQTT客户端ID",username:"ThingsBoard 网关MQTT用户名",password:"ThingsBoard 网关MQTT密码","ca-cert":"CA证书文件的路径","date-form":"日志消息中的日期格式","data-folder":"包含数据的文件夹的路径(相对或绝对路径)","log-format":"日志消息格式","remote-log":"启用对网关的远程日志记录和日志读取","backup-count":"如果备份计数大于0,则在执行轮换时,最多保留备份计数个文件-最旧的文件将被删除",storage:"提供将数据发送到平台之前保存传入数据的配置","max-file-count":"将创建的文件的最大数量","max-read-count":"从存储中获取的消息计数并发送到ThingsBoard","max-records":"一个文件中存储的最大记录数","read-record-count":"从存储中获取的消息计数并发送到ThingsBoard","max-records-count":"在将数据发送到ThingsBoard之前,存储中的最大数据计数","ttl-check-hour":"网关多久检查一次数据是否过时","ttl-messages-day":"存储将保存数据的最大天数",commands:"用于收集附加统计信息的命令",attribute:"统计遥测键",timeout:"命令执行的超时时间",command:"命令执行的结果,将用作遥测的值","check-device-activity":"启用监视每个连接设备的活动","inactivity-timeout":"在此时间后,网关将断开设备的连接","inactivity-period":"设备活动检查的周期","minimal-pack-delay":"发送消息包之间的延迟(减小此设置会导致增加CPU使用率)",qos:"MQTT消息传递的服务质量(0-至多一次,1-至少一次)","server-port":"GRPC服务器侦听传入连接的网络端口","grpc-keep-alive-timeout":"在考虑连接死亡之前,服务器等待keepalive ping响应的最长时间","grpc-keep-alive":"没有活动RPC调用时两个连续keepalive ping消息之间的持续时间","grpc-min-time-between-pings":"服务器在发送keepalive ping消息之间应等待的最小时间量","grpc-max-pings-without-data":"在没有接收到任何数据之前,服务器可以发送的keepalive ping消息的最大数量,然后将连接视为死亡","grpc-min-ping-interval-without-data":"在没有发送或接收数据时,服务器在发送keepalive ping消息之间应等待的最小时间量","permit-without-calls":"允许服务器在没有活动RPC调用时保持GRPC连接活动"},"docker-label":"使用以下指令在 Docker compose 中运行 IoT 网关,并为选定的设备提供凭据","install-docker-compose":"使用以下说明下载、安装和设置 Docker Compose","download-configuration-file":"下载配置文件","download-docker-compose":"下载您的网关的 docker-compose.yml 文件","launch-gateway":"启动网关","launch-docker-compose":"在包含 docker-compose.yml 文件的文件夹中,使用以下命令在终端中启动网关"},kt={"add-entry":"增加配置","connector-add":"增加新連接器","connector-enabled":"啟用連接器","connector-name":"連接器名稱","connector-name-required":"需要連接器名稱。","connector-type":"連接器類型","connector-type-required":"需要連接器類型。",connectors:"連接器配置","create-new-gateway":"建立新閘道","create-new-gateway-text":"您確定要建立一個名稱為:'{{gatewayName}}'的新閘道嗎?",delete:"刪除配置","download-tip":"下載配置文件",gateway:"閘道","gateway-exists":"同名設備已存在。","gateway-name":"閘道名稱","gateway-name-required":"需要閘道名稱。","gateway-saved":"閘道配置已成功保存。","json-parse":"無效的JSON","json-required":"欄位不能為空。","no-connectors":"無連接器","no-data":"無配置","no-gateway-found":"未找到閘道。","no-gateway-matching":" 未找到'{{item}}'。","path-logs":"日誌文件的路徑","path-logs-required":"需要路徑。",remote:"移除配置","remote-logging-level":"日誌記錄級別","remove-entry":"移除配置","save-tip":"保存配置文件","security-type":"安全類型","security-types":{"access-token":"訪問Token",tls:"TLS"},storage:"貯存","storage-max-file-records":"文件中的最大紀錄","storage-max-files":"最大文件數","storage-max-files-min":"最小數量為1。","storage-max-files-pattern":"號碼無效。","storage-max-files-required":"需要號碼。","storage-max-records":"存儲中的最大紀錄","storage-max-records-min":"最小紀錄數為1。","storage-max-records-pattern":"號碼無效。","storage-max-records-required":"需要最大紀錄數","storage-pack-size":"最大事件包大小","storage-pack-size-min":"最小數量為1。","storage-pack-size-pattern":"號碼無效.","storage-pack-size-required":"需要最大事件包大小","storage-path":"存儲路徑","storage-path-required":"需要存儲路徑。","storage-type":"存儲類型","storage-types":{"file-storage":"文件存儲","memory-storage":"記憶體存儲"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard主機","thingsboard-host-required":"需要主機。","thingsboard-port":"ThingsBoard連接埠","thingsboard-port-max":"最大埠號為 65535。","thingsboard-port-min":"最小埠號為1。","thingsboard-port-pattern":"連接埠無效。","thingsboard-port-required":"需要連接埠。",tidy:"整理","tidy-tip":"整理配置JSON","title-connectors-json":"連接器{{typeName}}配置","tls-path-ca-certificate":"閘道上CA證書的路徑","tls-path-client-certificate":"閘道上用戶端憑據的路徑","tls-path-private-key":"閘道上的私鑰路徑","toggle-fullscreen":"切換全螢幕","transformer-json-config":"配置JSON*","update-config":"增加/更新配置JSON"};var Pt={3.6:{socket:{type:"TCP",address:"127.0.0.1",port:5e4,bufferSize:1024},devices:[{address:"*:*",deviceName:"Device Example",deviceType:"default",encoding:"utf-8",telemetry:[{key:"temp",byteFrom:0,byteTo:-1},{key:"hum",byteFrom:0,byteTo:2}],attributes:[{key:"name",byteFrom:0,byteTo:-1},{key:"num",byteFrom:2,byteTo:4}],attributeRequests:[{type:"shared",requestExpressionSource:"constant",attributeNameExpressionSource:"constant",requestExpression:"${[0:3]==atr}",attributeNameExpression:"[3:]"}],attributeUpdates:[{encoding:"utf-16",attributeOnThingsBoard:"sharedName"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,encoding:"utf-8"}]}]},legacy:{type:"TCP",address:"127.0.0.1",port:5e4,bufferSize:1024,devices:[{address:"*:*",deviceName:"Device Example",deviceType:"default",encoding:"utf-8",telemetry:[{key:"temp",byteFrom:0,byteTo:-1},{key:"hum",byteFrom:0,byteTo:2}],attributes:[{key:"name",byteFrom:0,byteTo:-1},{key:"num",byteFrom:2,byteTo:4}],attributeRequests:[{type:"shared",requestExpression:"${[0:3]==atr}",attributeNameExpression:"[3:]"}],attributeUpdates:[{encoding:"utf-16",attributeOnThingsBoard:"sharedName"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,methodProcessing:"write",encoding:"utf-8"}]}]}},Dt={"3.5.2":{broker:{host:"127.0.0.1",port:1883,clientId:"ThingsBoard_gateway",version:5,maxMessageNumberPerWorker:10,maxNumberOfWorkers:100,sendDataOnlyOnChange:!1,security:{type:"anonymous"}},mapping:[{topicFilter:"sensor/data",subscriptionQos:1,converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}",deviceProfileExpressionSource:"message",deviceProfileExpression:"${sensorType}"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"${sensorModel}",value:"on"}],timeseries:[{type:"string",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"},{type:"string",key:"combine",value:"${hum}:${temp}"}]}},{topicFilter:"sensor/+/data",subscriptionQos:1,converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/data)",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"string",key:"humidity",value:"${hum}"}]}},{topicFilter:"sensor/raw_data",subscriptionQos:1,converter:{type:"bytes",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"[0:4]",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"raw",key:"rawData",value:"[:]"}],timeseries:[{type:"raw",key:"temp",value:"[4:]"}]}},{topicFilter:"custom/sensors/+",subscriptionQos:1,converter:{type:"custom",extension:"CustomMqttUplinkConverter",cached:!0,extensionConfig:{temperature:2,humidity:2,batteryLevel:1}}}],requestsMapping:{connectRequests:[{topicFilter:"sensor/connect",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"}},{topicFilter:"sensor/+/connect",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/connect)",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"}}],disconnectRequests:[{topicFilter:"sensor/disconnect",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}"}},{topicFilter:"sensor/+/disconnect",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/connect)"}}],attributeRequests:[{retain:!1,topicFilter:"v1/devices/me/attributes/request",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}"},attributeNameExpressionSource:"message",attributeNameExpression:"${versionAttribute}, ${pduAttribute}",topicExpression:"devices/${deviceName}/attrs",valueExpression:"${attributeKey}: ${attributeValue}"}],attributeUpdates:[{retain:!0,deviceNameFilter:".*",attributeFilter:"firmwareVersion",topicExpression:"sensor/${deviceName}/${attributeKey}",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{type:"twoWay",deviceNameFilter:".*",methodFilter:"echo",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTopicExpression:"sensor/${deviceName}/response/${methodName}/${requestId}",responseTopicQoS:1,responseTimeout:1e4,valueExpression:"${params}"},{type:"oneWay",deviceNameFilter:".*",methodFilter:"no-reply",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",valueExpression:"${params}"}]}},legacy:{broker:{name:"Default Local Broker",host:"127.0.0.1",port:1883,clientId:"ThingsBoard_gateway",version:5,maxMessageNumberPerWorker:10,maxNumberOfWorkers:100,sendDataOnlyOnChange:!1,security:{type:"basic",username:"user",password:"password"}},mapping:[{topicFilter:"sensor/data",converter:{type:"json",deviceNameJsonExpression:"${serialNumber}",deviceTypeJsonExpression:"${sensorType}",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"${sensorModel}",value:"on"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"},{type:"string",key:"combine",value:"${hum}:${temp}"}]}},{topicFilter:"sensor/+/data",converter:{type:"json",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/data)",deviceTypeTopicExpression:"Thermometer",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{topicFilter:"sensor/raw_data",converter:{type:"bytes",deviceNameExpression:"[0:4]",deviceTypeExpression:"default",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"raw",key:"rawData",value:"[:]"}],timeseries:[{type:"raw",key:"temp",value:"[4:]"}]}},{topicFilter:"custom/sensors/+",converter:{type:"custom",extension:"CustomMqttUplinkConverter",cached:!0,"extension-config":{temperatureBytes:2,humidityBytes:2,batteryLevelBytes:1}}}],connectRequests:[{topicFilter:"sensor/connect",deviceNameJsonExpression:"${serialNumber}"},{topicFilter:"sensor/+/connect",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/connect)"}],disconnectRequests:[{topicFilter:"sensor/disconnect",deviceNameJsonExpression:"${serialNumber}"},{topicFilter:"sensor/+/disconnect",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/disconnect)"}],attributeRequests:[{retain:!1,topicFilter:"v1/devices/me/attributes/request",deviceNameJsonExpression:"${serialNumber}",attributeNameJsonExpression:"${versionAttribute}, ${pduAttribute}",topicExpression:"devices/${deviceName}/attrs",valueExpression:"${attributeKey}: ${attributeValue}"}],attributeUpdates:[{retain:!0,deviceNameFilter:".*",attributeFilter:"firmwareVersion",topicExpression:"sensor/${deviceName}/${attributeKey}",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTopicExpression:"sensor/${deviceName}/response/${methodName}/${requestId}",responseTimeout:1e4,valueExpression:"${params}"},{deviceNameFilter:".*",methodFilter:"no-reply",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",valueExpression:"${params}"}]}},Ot={"3.5.2":{master:{slaves:[{host:"127.0.0.1",port:5021,type:"tcp",method:"socket",timeout:35,byteOrder:"LITTLE",wordOrder:"LITTLE",retries:!0,retryOnEmpty:!0,retryOnInvalid:!0,pollPeriod:5e3,unitId:1,deviceName:"Temp Sensor",deviceType:"default",connectAttemptTimeMs:5e3,connectAttemptCount:5,waitAfterFailedAttemptsMs:3e5,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:3e4},attributes:[{tag:"string_read",type:"string",functionCode:4,objectsCount:4,address:1,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:15e3}},{tag:"bits_read",type:"bits",functionCode:4,objectsCount:1,address:5},{tag:"8int_read",type:"8int",functionCode:4,objectsCount:1,address:6},{tag:"16int_read",type:"16int",functionCode:4,objectsCount:1,address:7},{tag:"32int_read_divider",type:"32int",functionCode:4,objectsCount:2,address:8,divider:10},{tag:"8int_read_multiplier",type:"8int",functionCode:4,objectsCount:1,address:10,multiplier:10},{tag:"32int_read",type:"32int",functionCode:4,objectsCount:2,address:11},{tag:"64int_read",type:"64int",functionCode:4,objectsCount:4,address:13}],timeseries:[{tag:"8uint_read",type:"8uint",functionCode:4,objectsCount:1,address:17,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:15e3}},{tag:"16uint_read",type:"16uint",functionCode:4,objectsCount:2,address:18},{tag:"32uint_read",type:"32uint",functionCode:4,objectsCount:4,address:20},{tag:"64uint_read",type:"64uint",functionCode:4,objectsCount:1,address:24},{tag:"16float_read",type:"16float",functionCode:4,objectsCount:1,address:25},{tag:"32float_read",type:"32float",functionCode:4,objectsCount:2,address:26},{tag:"64float_read",type:"64float",functionCode:4,objectsCount:4,address:28}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31},{tag:"getValue",type:"bits",functionCode:1,objectsCount:1,address:31},{tag:"setCPUFanSpeed",type:"32int",functionCode:16,objectsCount:2,address:33},{tag:"getCPULoad",type:"32int",functionCode:4,objectsCount:2,address:35}]}]},slave:{type:"tcp",host:"127.0.0.1",port:5026,method:"socket",deviceName:"Modbus Slave Example",deviceType:"default",pollPeriod:5e3,sendDataToThingsBoard:!1,byteOrder:"LITTLE",wordOrder:"LITTLE",unitId:0,values:{holding_registers:{attributes:[{address:1,type:"string",tag:"sm",objectsCount:1,value:"ON"}],timeseries:[{address:2,type:"8int",tag:"smm",objectsCount:1,value:"12334"}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29,value:1243}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31,value:1}]},coils_initializer:{attributes:[{address:5,type:"8int",tag:"coil",objectsCount:1,value:0}],timeseries:[],attributeUpdates:[],rpc:[]}}}},legacy:{master:{slaves:[{host:"127.0.0.1",port:5021,type:"tcp",method:"socket",timeout:35,byteOrder:"LITTLE",wordOrder:"LITTLE",retries:!0,retryOnEmpty:!0,retryOnInvalid:!0,pollPeriod:5e3,unitId:1,deviceName:"Temp Sensor",deviceType:"default",sendDataOnlyOnChange:!0,connectAttemptTimeMs:5e3,connectAttemptCount:5,waitAfterFailedAttemptsMs:3e5,attributes:[{tag:"string_read",type:"string",functionCode:4,objectsCount:4,address:1},{tag:"bits_read",type:"bits",functionCode:4,objectsCount:1,address:5},{tag:"16int_read",type:"16int",functionCode:4,objectsCount:1,address:7},{tag:"32int_read_divider",type:"32int",functionCode:4,objectsCount:2,address:8,divider:10},{tag:"32int_read",type:"32int",functionCode:4,objectsCount:2,address:11},{tag:"64int_read",type:"64int",functionCode:4,objectsCount:4,address:13}],timeseries:[{tag:"16uint_read",type:"16uint",functionCode:4,objectsCount:2,address:18},{tag:"32uint_read",type:"32uint",functionCode:4,objectsCount:4,address:20},{tag:"64uint_read",type:"64uint",functionCode:4,objectsCount:1,address:24},{tag:"16float_read",type:"16float",functionCode:4,objectsCount:1,address:25},{tag:"32float_read",type:"32float",functionCode:4,objectsCount:2,address:26},{tag:"64float_read",type:"64float",functionCode:4,objectsCount:4,address:28}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31},{tag:"getValue",type:"bits",functionCode:1,objectsCount:1,address:31},{tag:"setCPUFanSpeed",type:"32int",functionCode:16,objectsCount:2,address:33},{tag:"getCPULoad",type:"32int",functionCode:4,objectsCount:2,address:35}]}]},slave:{type:"tcp",host:"127.0.0.1",port:5026,method:"socket",deviceName:"Modbus Slave Example",deviceType:"default",pollPeriod:5e3,sendDataToThingsBoard:!1,byteOrder:"LITTLE",wordOrder:"LITTLE",unitId:0,values:{holding_registers:[{attributes:[{address:1,type:"string",tag:"sm",objectsCount:1,value:"ON"}],timeseries:[{address:2,type:"int",tag:"smm",objectsCount:1,value:"12334"}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29,value:1243}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31,value:1}]}],coils_initializer:[{attributes:[{address:5,type:"string",tag:"sm",objectsCount:1,value:"12"}],timeseries:[],attributeUpdates:[],rpc:[]}]}}}},At={"3.5.2":{server:{url:"localhost:4840/freeopcua/server/",timeoutInMillis:5e3,scanPeriodInMillis:36e5,pollPeriodInMillis:5e3,enableSubscriptions:!0,subCheckPeriodInMillis:100,showMap:!1,security:"Basic128Rsa15",identity:{type:"anonymous"}},mapping:[{deviceNodePattern:"Root\\.Objects\\.Device1",deviceNodeSource:"path",deviceInfo:{deviceNameExpression:"Device ${Root\\.Objects\\.Device1\\.serialNumber}",deviceNameExpressionSource:"path",deviceProfileExpression:"Device",deviceProfileExpressionSource:"constant"},attributes:[{key:"temperature °C",type:"path",value:"${ns=2;i=5}"}],timeseries:[{key:"humidity",type:"path",value:"${Root\\.Objects\\.Device1\\.TemperatureAndHumiditySensor\\.Humidity}"},{key:"batteryLevel",type:"path",value:"${Battery\\.batteryLevel}"}],rpc_methods:[{method:"multiply",arguments:[{type:"integer",value:2},{type:"integer",value:4}]}],attributes_updates:[{key:"deviceName",type:"path",value:"Root\\.Objects\\.Device1\\.serialNumber"}]}]},legacy:{server:{name:"OPC-UA Default Server",url:"localhost:4840/freeopcua/server/",timeoutInMillis:5e3,scanPeriodInMillis:5e3,disableSubscriptions:!1,subCheckPeriodInMillis:100,showMap:!1,security:"Basic128Rsa15",identity:{type:"anonymous"},mapping:[{deviceNodePattern:"Root\\.Objects\\.Device1",deviceNamePattern:"Device ${Root\\.Objects\\.Device1\\.serialNumber}",attributes:[{key:"temperature °C",path:"${ns=2;i=5}"}],timeseries:[{key:"humidity",path:"${Root\\.Objects\\.Device1\\.TemperatureAndHumiditySensor\\.Humidity}"},{key:"batteryLevel",path:"${Battery\\.batteryLevel}"}],rpc_methods:[{method:"multiply",arguments:[2,4]}],attributes_updates:[{attributeOnThingsBoard:"deviceName",attributeOnDevice:"Root\\.Objects\\.Device1\\.serialNumber"}]}]}}},Ft={passiveScanMode:!0,showMap:!1,scanner:{timeout:1e4,deviceName:"Device name"},devices:[{name:"Temperature and humidity sensor",MACAddress:"4C:65:A8:DF:85:C0",pollPeriod:5e5,showMap:!1,timeout:1e4,connectRetry:5,connectRetryInSeconds:0,waitAfterConnectRetries:10,telemetry:[{key:"temperature",method:"notify",characteristicUUID:"226CAA55-6476-4566-7562-66734470666D",valueExpression:"[2]"},{key:"humidity",method:"notify",characteristicUUID:"226CAA55-6476-4566-7562-66734470666D",valueExpression:"[0]"}],attributes:[{key:"name",method:"read",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",valueExpression:"[0:2]cm [2:]A"},{key:"values",method:"read",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",valueExpression:"All values: [:]"}],attributeUpdates:[{attributeOnThingsBoard:"sharedName",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",methodProcessing:"read"},{methodRPC:"rpcMethod2",withResponse:!0,characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",methodProcessing:"write"},{methodRPC:"rpcMethod3",withResponse:!0,methodProcessing:"scan"}]}]},Rt={host:"http://127.0.0.1:5000",SSLVerify:!0,security:{type:"basic",username:"user",password:"password"},mapping:[{url:"getdata",httpMethod:"GET",httpHeaders:{ACCEPT:"application/json"},content:{name:"morpheus",job:"leader"},allowRedirects:!0,timeout:.5,scanPeriod:5,converter:{type:"json",deviceNameJsonExpression:"SD8500",deviceTypeJsonExpression:"SD",attributes:[{key:"serialNumber",type:"string",value:"${serial}"}],telemetry:[{key:"Maintainer",type:"string",value:"${Developer}"},{key:"combine",type:"string",value:"${Developer}:${hum}"}]}},{url:"get_info",httpMethod:"GET",httpHeaders:{ACCEPT:"application/json"},allowRedirects:!0,timeout:.5,scanPeriod:100,converter:{type:"custom",deviceNameJsonExpression:"SD8500",deviceTypeJsonExpression:"SD",extension:"CustomRequestUplinkConverter","extension-config":[{key:"Totaliser",type:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1},{key:"Flow",type:"int",fromByte:4,toByte:6,byteorder:"big",signed:!0,multiplier:.01},{key:"Temperature",type:"int",fromByte:8,toByte:10,byteorder:"big",signed:!0,multiplier:.01},{key:"Pressure",type:"int",fromByte:12,toByte:14,byteorder:"big",signed:!0,multiplier:.01},{key:"deviceStatus",type:"int",byteAddress:15,fromBit:4,toBit:8,byteorder:"big",signed:!1},{key:"OUT2",type:"int",byteAddress:15,fromBit:1,toBit:2,byteorder:"big"},{key:"OUT1",type:"int",byteAddress:15,fromBit:0,toBit:1,byteorder:"big"}]}}],attributeUpdates:[{httpMethod:"POST",httpHeaders:{"CONTENT-TYPE":"application/json"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SD.*",attributeFilter:"send_data",requestUrlExpression:"sensor/${deviceName}/${attributeKey}",requestValueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTimeout:1,httpMethod:"GET",requestValueExpression:"${params}",responseValueExpression:"${temp}",timeout:.5,tries:3,httpHeaders:{"Content-Type":"application/json"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",httpMethod:"POST",requestValueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"}}]},Bt={interface:"socketcan",channel:"vcan0",backend:{fd:!0},reconnectPeriod:5,devices:[{name:"Car",sendDataOnlyOnChange:!1,enableUnknownRpc:!0,strictEval:!1,attributes:[{key:"isDriverDoorOpened",nodeId:41,command:"2:2:big:8717",value:"4:1:int",expression:"bool(value & 0b00000100)",polling:{type:"once",dataInHex:"AB CD AB CD"}}],timeseries:[{key:"rpm",nodeId:1918,isExtendedId:!0,command:"2:2:big:48059",value:"4:2:big:int",expression:"value / 4",polling:{type:"always",period:5,dataInHex:"aaaa bbbb aaaa bbbb"}},{key:"milliage",nodeId:1918,isExtendedId:!0,value:"4:2:little:int",expression:"value * 10",polling:{type:"always",period:30,dataInHex:"aa bb cc dd ee ff aa bb"}}],attributeUpdates:[{attributeOnThingsBoard:"softwareVersion",nodeId:64,isExtendedId:!0,dataLength:4,dataExpression:"value + 5",dataByteorder:"little"}],serverSideRpc:[{method:"sendSameData",nodeId:4,isExtendedId:!0,isFd:!0,bitrateSwitch:!0,dataInHex:"aa bb cc dd ee ff aa bb aa bb cc d ee ff"},{method:"setLightLevel",nodeId:5,dataLength:2,dataByteorder:"little",dataBefore:"00AA"},{method:"setSpeed",nodeId:16,dataAfter:"0102",dataExpression:"userSpeed if maxAllowedSpeed > userSpeed else maxAllowedSpeed"}]}]},Nt={"3.6.2":{application:{objectName:"TB_gateway",host:"0.0.0.0",port:"47808",objectIdentifier:599,maxApduLengthAccepted:1476,segmentationSupported:"segmentedBoth",vendorIdentifier:15},devices:[{deviceInfo:{deviceNameExpression:"BACnet Device ${objectName}",deviceProfileExpression:"default",deviceNameExpressionSource:"expression",deviceProfileExpressionSource:"constant"},host:"192.168.2.110",port:"47808",pollPeriod:1e4,attributes:[{key:"temperature",objectType:"analogOutput",objectId:"1",propertyId:"presentValue"}],timeseries:[{key:"state",objectType:"binaryValue",objectId:"1",propertyId:"presentValue"}],attributeUpdates:[{key:"brightness",objectType:"analogOutput",objectId:"1",propertyId:"presentValue"}],serverSideRpc:[{method:"set_state",requestType:"writeProperty",requestTimeout:1e4,objectType:"binaryOutput",objectId:"1",propertyId:"presentValue"},{method:"get_state",requestType:"readProperty",requestTimeout:1e4,objectType:"binaryOutput",objectId:"1",propertyId:"presentValue"}]}]},legacy:{general:{objectName:"TB_gateway",address:"0.0.0.0:47808",objectIdentifier:599,maxApduLengthAccepted:1476,segmentationSupported:"segmentedBoth",vendorIdentifier:15},devices:[{deviceName:"BACnet Device ${objectName}",deviceType:"default",address:"192.168.2.110:47808",pollPeriod:1e4,attributes:[{key:"temperature",type:"string",objectId:"analogOutput:1",propertyId:"presentValue"}],timeseries:[{key:"state",type:"bool",objectId:"binaryValue:1",propertyId:"presentValue"}],attributeUpdates:[{key:"brightness",requestType:"writeProperty",objectId:"analogOutput:1",propertyId:"presentValue"}],serverSideRpc:[{method:"set_state",requestType:"writeProperty",requestTimeout:1e4,objectId:"binaryOutput:1",propertyId:"presentValue"},{method:"get_state",requestType:"readProperty",requestTimeout:1e4,objectId:"binaryOutput:1",propertyId:"presentValue"}]}]}},Lt={connection:{str:"Driver={PostgreSQL};Server=localhost;Port=5432;Database=thingsboard;Uid=postgres;Pwd=postgres;",attributes:{autocommit:!0,timeout:0},encoding:"utf-8",decoding:{char:"utf-8",wchar:"utf-8",metadata:"utf-16le"},reconnect:!0,reconnectPeriod:60},pyodbc:{pooling:!1},polling:{query:"SELECT bool_v, str_v, dbl_v, long_v, entity_id, ts FROM ts_kv WHERE ts > ? ORDER BY ts ASC LIMIT 10",period:10,iterator:{column:"ts",query:"SELECT MIN(ts) - 1 FROM ts_kv",persistent:!1}},mapping:{device:{type:"postgres",name:"'ODBC ' + entity_id"},sendDataOnlyOnChange:!1,attributes:"*",timeseries:[{name:"value",value:"[i for i in [str_v, long_v, dbl_v,bool_v] if i is not None][0]"}]},serverSideRpc:{enableUnknownRpc:!1,overrideRpcConfig:!0,methods:["procedureOne",{name:"procedureTwo",args:["One",2,3]}]}},Vt={"3.7.2":{server:{host:"127.0.0.1",port:"5000",SSL:!1,security:{cert:"~/ssl/cert.pem",key:"~/ssl/key.pem"}},mapping:[{endpoint:"/my_devices",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"request",deviceNameExpression:"${sensorName}",deviceProfileExpressionSource:"request",deviceProfileExpression:"${sensorType}"},attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"certificateNumber",value:"${certificateNumber}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon1",HTTPMethods:["GET","POST"],security:{type:"anonymous"},converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"constant",deviceNameExpression:"Device 2",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},attributes:[{type:"string",key:"model",value:"Model2"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon2",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"custom",deviceInfo:{deviceNameExpressionSource:"constant",deviceNameExpression:"SuperAnonDevice",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},extension:"CustomRestUplinkConverter",extensionConfig:{key:"Totaliser",datatype:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1}}}],requestsMapping:{attributeRequests:[{endpoint:"/sharedAttributes",type:"shared",HTTPMethods:["POST"],security:{type:"anonymous"},timeout:10,deviceNameExpression:"${deviceName}",attributeNameExpression:"${attribute}${attribute1}"}],attributeUpdates:[{HTTPMethod:"POST",SSLVerify:!1,httpHeaders:{"CONTENT-TYPE":"application/json"},security:{type:"anonymous"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SN.*",attributeFilter:".*",requestUrlExpression:"http://127.0.0.1:5001/",valueExpression:'{"deviceName":"${deviceName}","${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"http://127.0.0.1:5001/${deviceName}",responseTimeout:1,HTTPMethod:"GET",valueExpression:"${params}",timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:"SN.*",methodFilter:"post_attributes",requestUrlExpression:"http://127.0.0.1:5000/my_devices",responseTimeout:1,HTTPMethod:"POST",valueExpression:'{"sensorName":"${deviceName}", "sensorModel":"${params.sensorModel}", "certificateNumber":"${params.certificateNumber}", "temp":"${params.temp}", "hum":"${params.hum}"}',timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",HTTPMethod:"POST",valueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}}]}},legacy:{host:"127.0.0.1",port:"5000",SSL:!1,security:{cert:"~/ssl/cert.pem",key:"~/ssl/key.pem"},mapping:[{endpoint:"/my_devices",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"json",deviceNameExpression:"${sensorName}",deviceTypeExpression:"${sensorType}",attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"certificateNumber",value:"${certificateNumber}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon1",HTTPMethods:["GET","POST"],security:{type:"anonymous"},converter:{type:"json",deviceNameExpression:"Device 2",deviceTypeExpression:"default",attributes:[{type:"string",key:"model",value:"Model2"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon2",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"custom",deviceNameExpression:"SuperAnonDevice",deviceTypeExpression:"default",extension:"CustomRestUplinkConverter","extension-config":{key:"Totaliser",datatype:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1}}}],attributeRequests:[{endpoint:"/sharedAttributes",type:"shared",HTTPMethods:["POST"],security:{type:"anonymous"},timeout:10,deviceNameExpression:"${deviceName}",attributeNameExpression:"${attribute}${attribute1}"}],attributeUpdates:[{HTTPMethod:"POST",SSLVerify:!1,httpHeaders:{"CONTENT-TYPE":"application/json"},security:{type:"anonymous"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SN.*",attributeFilter:".*",requestUrlExpression:"http://127.0.0.1:5001/",valueExpression:'{"deviceName":"${deviceName}","${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"http://127.0.0.1:5001/${deviceName}",responseTimeout:1,HTTPMethod:"GET",valueExpression:"${params}",timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:"SN.*",methodFilter:"post_attributes",requestUrlExpression:"http://127.0.0.1:5000/my_devices",responseTimeout:1,HTTPMethod:"POST",valueExpression:'{"sensorName":"${deviceName}", "sensorModel":"${params.sensorModel}", "certificateNumber":"${params.certificateNumber}", "temp":"${params.temp}", "hum":"${params.hum}"}',timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",HTTPMethod:"POST",valueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}}]}},qt={devices:[{deviceName:"SNMP router",deviceType:"snmp",ip:"snmp.live.gambitcommunications.com",port:161,pollPeriod:5e3,community:"public",attributes:[{key:"ReceivedFromGet",method:"get",oid:"1.3.6.1.2.1.1.1.0",timeout:6},{key:"ReceivedFromMultiGet",method:"multiget",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],timeout:6},{key:"ReceivedFromGetNext",method:"getnext",oid:"1.3.6.1.2.1.1.1.0",timeout:6},{key:"ReceivedFromMultiWalk",method:"multiwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.0.1.2.1"]},{key:"ReceivedFromBulkWalk",method:"bulkwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"]},{key:"ReceivedFromBulkGet",method:"bulkget",scalarOid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],repeatingOid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],maxListSize:10}],telemetry:[{key:"ReceivedFromWalk",community:"private",method:"walk",oid:"1.3.6.1.2.1.1.1.0"},{key:"ReceivedFromTable",method:"table",oid:"1.3.6.1.2.1.1"}],attributeUpdateRequests:[{attributeFilter:"dataToSet",method:"set",oid:"1.3.6.1.2.1.1.1.0"},{attributeFilter:"dataToMultiSet",method:"multiset",mappings:{"1.2.3":"10","2.3.4":"${attribute}"}}],serverSideRpcRequests:[{requestFilter:"setData",method:"set",oid:"1.3.6.1.2.1.1.1.0"},{requestFilter:"multiSetData",method:"multiset"},{requestFilter:"getData",method:"get",oid:"1.3.6.1.2.1.1.1.0"},{requestFilter:"runBulkWalk",method:"bulkwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"]}]},{deviceName:"SNMP router",deviceType:"snmp",ip:"127.0.0.1",pollPeriod:5e3,community:"public",converter:"CustomSNMPConverter",attributes:[{key:"ReceivedFromGetWithCustomConverter",method:"get",oid:"1.3.6.1.2.1.1.1.0"}],telemetry:[{key:"ReceivedFromTableWithCustomConverter",method:"table",oid:"1.3.6.1.2.1.1.1.0"}]}]},Gt={host:"0.0.0.0",port:21,TLSSupport:!1,security:{type:"basic",username:"admin",password:"admin"},paths:[{devicePatternName:"asd",devicePatternType:"Device",delimiter:",",path:"fol/*_hello*.txt",readMode:"FULL",maxFileSize:5,pollPeriod:500,txtFileDataView:"SLICED",withSortingFiles:!0,attributes:[{key:"temp",value:"[1:]"},{key:"tmp",value:"[0:1]"}],timeseries:[{type:"int",key:"[0:1]",value:"[0:1]"},{type:"int",key:"temp",value:"[1:]"}]}],attributeUpdates:[{path:"fol/hello.json",deviceNameFilter:".*",writingMode:"WRITE",valueExpression:"{'${attributeKey}':'${attributeValue}'}"}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"read",valueExpression:"${params}"},{deviceNameFilter:".*",methodFilter:"write",valueExpression:"${params}"}]},zt={server:{jid:"gateway@localhost",password:"password",host:"localhost",port:5222,use_ssl:!1,disable_starttls:!1,force_starttls:!0,timeout:1e4,plugins:["xep_0030","xep_0323","xep_0325"]},devices:[{jid:"device@localhost/TMP_1101",deviceNameExpression:"${serialNumber}",deviceTypeExpression:"default",attributes:[{key:"temperature",value:"${temp}"}],timeseries:[{key:"humidity",value:"${hum}"},{key:"combination",value:"${temp}:${hum}"}],attributeUpdates:[{attributeOnThingsBoard:"shared",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{methodRPC:"rpc1",withResponse:!0,valueExpression:"${params}"}]}]},Ut={centralSystem:{name:"Central System",host:"127.0.0.1",port:9e3,connection:{type:"insecure"},security:[{type:"token",tokens:["Bearer ACCESS_TOKEN"]},{type:"basic",credentials:[{username:"admin",password:"admin"}]}]},chargePoints:[{idRegexpPattern:"bidon/hello/CP_1",deviceNameExpression:"${Vendor} ${Model}",deviceTypeExpression:"default",attributes:[{messageTypeFilter:"MeterValues,",key:"temp1",value:"${meter_value[:].sampled_value[:].value}"},{messageTypeFilter:"MeterValues,",key:"vendorId",value:"${connector_id}"}],timeseries:[{messageTypeFilter:"DataTransfer,",key:"temp",value:"${data.temp}"}],attributeUpdates:[{attributeOnThingsBoard:"shared",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{methodRPC:"rpc1",withResponse:!0,valueExpression:"${params}"}]}]};const jt=e("connectorConfigs",{[ct.MQTT]:Dt,[ct.MODBUS]:Ot,[ct.OPCUA]:At,[ct.BLE]:Ft,[ct.REQUEST]:Rt,[ct.CAN]:Bt,[ct.BACNET]:Nt,[ct.ODBC]:Lt,[ct.REST]:Vt,[ct.SNMP]:qt,[ct.FTP]:Gt,[ct.SOCKET]:Pt,[ct.XMPP]:zt,[ct.OCPP]:Ut,[ct.KNX]:{3.7:{logLevel:"INFO",client:{type:"AUTOMATIC",addressFormat:"LONG",gatewayIP:"127.0.0.1",gatewayPort:3671,autoReconnect:!0,autoReconnectWait:3,gatewaysScanner:{enabled:!0,scanPeriod:3,stopOnFound:!1}},devices:[{deviceInfo:{deviceNameDataType:"string",deviceNameExpressionSource:"expression",deviceNameExpression:"Device ${1/0/5}",deviceProfileDataType:"none",deviceProfileExpressionSource:"constant",deviceProfileNameExpression:"default"},pollPeriod:5e3,attributes:[{type:"temperature",key:"temperature",groupAddress:"1/0/6"}],timeseries:[{type:"humidity",key:"humidity",groupAddress:"1/0/7"}]}],attributeUpdates:[{deviceNameFilter:".*",dataType:"precent_U8",groupAddress:"1/0/9",key:"brightness"}],serverSideRpc:[{requestType:"read",deviceNameFilter:".*",method:"get_name",dataType:"string",groupAddress:"1/0/5"},{requestType:"write",deviceNameFilter:".*",method:"set_name",dataType:"string",groupAddress:"1/0/5"}]}}});function Ht(e){const t=jt[e];if(!t)throw new Error("No default config found");return t}var Wt;e("ModbusDataType",Wt),function(e){e.STRING="string",e.BYTES="bytes",e.BITS="bits",e.INT8="8int",e.UINT8="8uint",e.INT16="16int",e.UINT16="16uint",e.FLOAT16="16float",e.INT32="32int",e.UINT32="32uint",e.FLOAT32="32float",e.INT64="64int",e.UINT64="64uint",e.FLOAT64="64float"}(Wt||e("ModbusDataType",Wt={}));const $t=e("ModbusEditableDataTypes",[Wt.BYTES,Wt.BITS,Wt.STRING]);var Kt,Yt;e("ModbusObjectCountByDataType",Kt),function(e){e[e["8int"]=1]="8int",e[e["8uint"]=1]="8uint",e[e["16int"]=1]="16int",e[e["16uint"]=1]="16uint",e[e["16float"]=1]="16float",e[e["32int"]=2]="32int",e[e["32uint"]=2]="32uint",e[e["32float"]=2]="32float",e[e["64int"]=4]="64int",e[e["64uint"]=4]="64uint",e[e["64float"]=4]="64float"}(Kt||e("ModbusObjectCountByDataType",Kt={})),e("MappingValueType",Yt),function(e){e.STRING="string",e.INTEGER="integer",e.DOUBLE="double",e.BOOLEAN="boolean"}(Yt||e("MappingValueType",Yt={}));const Xt=e("mappingValueTypesMap",new Map([[Yt.STRING,{name:"value.string",icon:"mdi:format-text"}],[Yt.INTEGER,{name:"value.integer",icon:"mdi:numeric"}],[Yt.DOUBLE,{name:"value.double",icon:"mdi:numeric"}],[Yt.BOOLEAN,{name:"value.boolean",icon:"mdi:checkbox-marked-outline"}]])),Zt=e("ModbusFunctionCodeTranslationsMap",new Map([[1,"gateway.function-codes.read-coils"],[2,"gateway.function-codes.read-discrete-inputs"],[3,"gateway.function-codes.read-multiple-holding-registers"],[4,"gateway.function-codes.read-input-registers"],[5,"gateway.function-codes.write-single-coil"],[6,"gateway.function-codes.write-single-holding-register"],[15,"gateway.function-codes.write-multiple-coils"],[16,"gateway.function-codes.write-multiple-holding-registers"]]));var Qt,Jt,en;e("ConfigurationModes",Qt),function(e){e.BASIC="basic",e.ADVANCED="advanced"}(Qt||e("ConfigurationModes",Qt={})),e("ReportStrategyType",Jt),function(e){e.OnChange="ON_CHANGE",e.OnReportPeriod="ON_REPORT_PERIOD",e.OnChangeOrReportPeriod="ON_CHANGE_OR_REPORT_PERIOD",e.OnReceived="ON_RECEIVED"}(Jt||e("ReportStrategyType",Jt={})),e("ReportStrategyDefaultValue",en),function(e){e[e.Gateway=6e4]="Gateway",e[e.Connector=6e4]="Connector",e[e.Device=3e4]="Device",e[e.Key=15e3]="Key"}(en||e("ReportStrategyDefaultValue",en={}));const tn=e("ReportStrategyTypeTranslationsMap",new Map([[Jt.OnChange,"gateway.report-strategy.on-change"],[Jt.OnReportPeriod,"gateway.report-strategy.on-report-period"],[Jt.OnChangeOrReportPeriod,"gateway.report-strategy.on-change-or-report-period"],[Jt.OnReceived,"gateway.report-strategy.on-received"]])),nn=e("numberInputPattern",new RegExp(/^\d{1,15}(\.\d{1,15})?$/)),an=e("noLeadTrailSpacesRegex",/^\S+(?: \S+)*$/),rn=e("integerRegex",/^[-+]?\d+$/),on=e("nonZeroFloat",/^-?(?!0(\.0+)?$)\d+(\.\d+)?$/);var sn;!function(e){e.EXCEPTION="EXCEPTION"}(sn||(sn={}));const ln={...lt,...sn},pn=()=>[10,20,30];function cn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"a",19),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).$implicit,i=t.ɵɵnextContext();return t.ɵɵresetView(i.onTabChanged(n))})),t.ɵɵtext(1),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("active",i.activeLink.name===e.name),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.name," ")}}function dn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",20),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.created-time")))}function un(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵpipe(2,"date"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind2(2,1,e.ts,"yyyy-MM-dd HH:mm:ss")," ")}}function mn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.level")))}function hn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell")(1,"span"),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(i.statusClass(e.status)),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.status)}}function gn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",22),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.message")))}function fn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵclassMap(i.statusClassMsg(e.status)),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.message," ")}}function yn(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",23)}function vn(e,n){1&e&&t.ɵɵelement(0,"mat-row",23)}class xn{constructor(){this.displayedColumns=["ts","status","message"],this.gatewayLogLinks=[{name:"General",key:"LOGS"},{name:"Service",key:"SERVICE_LOGS"},{name:"Connection",key:"CONNECTION_LOGS"},{name:"Storage",key:"STORAGE_LOGS"},{key:"EXTENSIONS_LOGS",name:"Extension"}];const e={property:"ts",direction:w.DESC};this.pageLink=new S(10,0,null,e),this.dataSource=new x([])}ngOnInit(){this.updateWidgetTitle()}ngAfterViewInit(){if(this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.ctx.defaultSubscription.onTimewindowChangeFunction=e=>(this.ctx.defaultSubscription.options.timeWindowConfig=e,this.ctx.defaultSubscription.updateDataSubscriptions(),e),this.ctx.settings.isConnectorLog&&this.ctx.settings.connectorLogState){const e=this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];this.logLinks=[{key:`${e.key}_LOGS`,name:"Connector",filterFn:e=>!e.message.includes("_converter.py")},{key:`${e.key}_converter_LOGS`,name:"Converter",filterFn:e=>e.message.includes("_converter.py")}]}else this.logLinks=this.gatewayLogLinks;this.activeLink=this.logLinks[0],this.changeSubscription()}updateWidgetTitle(){if(this.ctx.settings.isConnectorLog&&this.ctx.settings.connectorLogState){const e=this.ctx.widgetConfig.title,t="${connectorName}";if(e.includes(t)){const n=this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];this.ctx.widgetTitle=e.replace(t,n.key)}}}updateData(){if(this.ctx.defaultSubscription.data.length&&this.ctx.defaultSubscription.data[0]){let e=this.ctx.defaultSubscription.data[0].data.map((e=>{const t={ts:e[0],key:this.activeLink.key,message:e[1],status:"INVALID LOG FORMAT"};try{t.message=/\[(.*)/.exec(e[1])[0]}catch(n){t.message=e[1]}try{t.status=e[1].match(/\|(\w+)\|/)[1]}catch(e){t.status="INVALID LOG FORMAT"}return t}));this.activeLink.filterFn&&(e=e.filter((e=>this.activeLink.filterFn(e)))),this.dataSource.data=e}}onTabChanged(e){this.activeLink=e,this.changeSubscription()}statusClass(e){switch(e){case ln.DEBUG:return"status status-debug";case ln.WARNING:return"status status-warning";case ln.ERROR:case ln.EXCEPTION:return"status status-error";default:return"status status-info"}}statusClassMsg(e){if(e===ln.EXCEPTION)return"msg-status-exception"}trackByLogTs(e,t){return t.ts}changeSubscription(){this.ctx.datasources&&this.ctx.datasources[0].entity&&this.ctx.defaultSubscription.options.datasources&&(this.ctx.defaultSubscription.options.datasources[0].dataKeys=[{name:this.activeLink.key,type:C.timeseries,settings:{}}],this.ctx.defaultSubscription.unsubscribe(),this.ctx.defaultSubscription.updateDataSubscriptions(),this.ctx.defaultSubscription.callbacks.onDataUpdated=()=>{this.updateData()})}static{this.ɵfac=function(e){return new(e||xn)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:xn,selectors:[["tb-gateway-logs"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(v,5),t.ɵɵviewQuery(b,5)),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first),t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.paginator=e.first)}},inputs:{ctx:"ctx",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:23,vars:21,consts:[["tabPanel",""],[1,"flex","h-full","flex-col"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","",3,"active","click",4,"ngFor","ngForOf"],[1,"flex-1","overflow-auto"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","trackBy","matSortActive","matSortDirection"],["matColumnDef","ts"],["mat-sort-header","","style","width: 20%",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","status"],["mat-sort-header","","style","width: 10%",4,"matHeaderCellDef"],["matColumnDef","message"],["mat-sort-header","","style","width: 70%",4,"matHeaderCellDef"],[3,"class",4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",4,"matRowDef","matRowDefColumns"],[1,"no-data-found","flex-1","items-center","justify-center"],[1,"flex-1"],["showFirstLastButtons","",3,"length","pageIndex","pageSize","pageSizeOptions"],["mat-tab-link","",3,"click","active"],["mat-sort-header","",2,"width","20%"],["mat-sort-header","",2,"width","10%"],["mat-sort-header","",2,"width","70%"],[1,"mat-row-select"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"nav",2),t.ɵɵtemplate(2,cn,2,2,"a",3),t.ɵɵelementEnd(),t.ɵɵelement(3,"mat-tab-nav-panel",null,0),t.ɵɵelementStart(5,"div",4)(6,"table",5),t.ɵɵelementContainerStart(7,6),t.ɵɵtemplate(8,dn,3,3,"mat-header-cell",7)(9,un,3,4,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(10,9),t.ɵɵtemplate(11,mn,3,3,"mat-header-cell",10)(12,hn,3,3,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(13,11),t.ɵɵtemplate(14,gn,3,3,"mat-header-cell",12)(15,fn,2,3,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(16,yn,1,0,"mat-header-row",14)(17,vn,1,0,"mat-row",15),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"span",16),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(21,"span",17),t.ɵɵelementEnd(),t.ɵɵelement(22,"mat-paginator",18),t.ɵɵelementEnd()),2&e){const e=t.ɵɵreference(4);t.ɵɵadvance(),t.ɵɵproperty("tabPanel",e),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.logLinks),t.ɵɵadvance(4),t.ɵɵproperty("dataSource",n.dataSource)("trackBy",n.trackByLogTs)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(10),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",0!==n.dataSource.data.length),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,18,"attribute.no-telemetry-text")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",0===n.dataSource.data.length),t.ɵɵadvance(),t.ɵɵproperty("length",n.dataSource.data.length)("pageIndex",n.pageLink.page)("pageSize",n.pageLink.pageSize)("pageSizeOptions",t.ɵɵpureFunction0(20,pn))}},dependencies:t.ɵɵgetComponentDepsFactory(xn,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;overflow-x:auto;padding:0}[_nghost-%COMP%] .status[_ngcontent-%COMP%]{border-radius:20px;font-weight:500;padding:5px 15px}[_nghost-%COMP%] .status-debug[_ngcontent-%COMP%]{color:green;background:#0080001a}[_nghost-%COMP%] .status-warning[_ngcontent-%COMP%]{color:orange;background:#ffa5001a}[_nghost-%COMP%] .status-error[_ngcontent-%COMP%]{color:red;background:#ff00001a}[_nghost-%COMP%] .status-info[_ngcontent-%COMP%]{color:#00f;background:#0000801a}[_nghost-%COMP%] .msg-status-exception[_ngcontent-%COMP%]{color:red}']})}} -/** - * @license Angular v18.2.6 - * (c) 2010-2024 Google LLC. https://angular.io/ - * License: MIT - */ -function bn(e){e||(n(bn),e=i(a));const t=new Z((t=>e.onDestroy(t.next.bind(t))));return e=>e.pipe(le(t))}e("GatewayLogsComponent",xn);function wn(e,t){!t?.injector&&n(wn);const l=t?.injector??i(r),p=new Q(1),c=o((()=>{let t;try{t=e()}catch(e){return void s((()=>p.error(e)))}s((()=>p.next(t)))}),{injector:l,manualCleanup:!0});return l.get(a).onDestroy((()=>{c.destroy(),p.complete()})),p.asObservable()}const Sn=["commandInput"],Cn=(e,t)=>t.attributeOnGateway,_n=e=>({command:e});function Tn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.clear())})),t.ɵɵelementStart(2,"mat-icon",11),t.ɵɵtext(3,"close"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"action.clear"))}function In(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",12),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onCreateNewClick(n))})),t.ɵɵelementStart(1,"span",13),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"notification.create-new")))}function En(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵelement(1,"span",14),t.ɵɵpipe(2,"async"),t.ɵɵpipe(3,"highlight"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(3,4,e.attributeOnGateway,t.ɵɵpipeBind1(2,2,i.searchText$)),t.ɵɵsanitizeHtml)}}function Mn(e,n){if(1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"async"),t.ɵɵpipe(2,"translate")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind2(2,3,"gateway.statistics.no-commands-matching",t.ɵɵpureFunction1(6,_n,e.truncate.transform(t.ɵɵpipeBind1(1,1,e.searchText$),!0,6,"...")))," ")}}function kn(e,n){1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(1,1,"gateway.statistics.no-command-found")," ")}function Pn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-option",9)(1,"div",15),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(2,"span"),t.ɵɵtemplate(3,Mn,3,8),t.ɵɵpipe(4,"async"),t.ɵɵtemplate(5,kn,2,3),t.ɵɵelementStart(6,"a",16),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onCreateNewClick(n))})),t.ɵɵtext(7,"gateway.create-new-one"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("value",null),t.ɵɵadvance(3),t.ɵɵconditional(t.ɵɵpipeBind1(4,2,e.searchText$)?3:5)}}class Dn{constructor(e,t){this.truncate=e,this.fb=t,this.commands=l(),this.onCreateNewClicked=p(),this.selectStatisticsCommandControl=this.fb.control({}),this.searchText$=this.selectStatisticsCommandControl.valueChanges.pipe(pe((e=>e?"string"==typeof e?e:e?.attributeOnGateway:"")),ce(),J(1)),this.filteredCommands$=ee([this.searchText$,wn(this.commands)]).pipe(de(150),pe((([e,t])=>{const n=t.find((t=>t.attributeOnGateway===e))??null,i=this.selectStatisticsCommandControl.value;return"string"==typeof i&&n?.attributeOnGateway!==e||this.selectStatisticsCommandControl.patchValue(n,{emitEvent:!Se(n,i)}),t.filter((t=>t.attributeOnGateway.toLowerCase().includes(e?.toLowerCase()??"")))})),J(1)),this.onChanges=e=>{},this.selectStatisticsCommandControl.valueChanges.pipe(bn()).subscribe((e=>this.onChanges(e)))}registerOnChange(e){this.onChanges=e}registerOnTouched(e){}writeValue(e){this.selectStatisticsCommandControl.patchValue(e)}displayCommandFn(e){return e?e.attributeOnGateway:null}clear(){this.selectStatisticsCommandControl.patchValue(null,{emitEvent:!0}),setTimeout((()=>{this.commandInput.nativeElement.blur(),this.commandInput.nativeElement.focus()}),0)}onCreateNewClick(e){e.stopPropagation(),this.onCreateNewClicked.emit()}static{this.ɵfac=function(e){return new(e||Dn)(t.ɵɵdirectiveInject(T.TruncatePipe),t.ɵɵdirectiveInject(H.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Dn,selectors:[["tb-statistics-commands-autocomplete"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(Sn,7),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.commandInput=e.first)}},inputs:{commands:[1,"commands"]},outputs:{onCreateNewClicked:"onCreateNewClicked"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>Dn)),multi:!0}]),t.ɵɵStandaloneFeature],decls:14,vars:10,consts:[["commandInput",""],["commandAutocomplete","matAutocomplete"],["appearance","outline",1,"mat-block"],["translate",""],["matInput","","type","text",3,"formControl","matAutocomplete"],["type","button","matTooltipPosition","above","matSuffix","","mat-icon-button","","aria-label","Clear",1,"action-button",3,"matTooltip"],["mat-button","","color","primary","matSuffix","",1,"mr-2"],[1,"tb-autocomplete",3,"displayWith"],[3,"value"],[1,"tb-not-found",3,"value"],["type","button","matTooltipPosition","above","matSuffix","","mat-icon-button","","aria-label","Clear",1,"action-button",3,"click","matTooltip"],[1,"material-icons"],["mat-button","","color","primary","matSuffix","",1,"mr-2",3,"click"],[1,"whitespace-nowrap"],[3,"innerHTML"],[1,"tb-not-found-content",3,"click"],["translate","",3,"click"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field",2)(1,"mat-label",3),t.ɵɵtext(2,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(3,"input",4,0),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,Tn,4,3,"button",5)(7,In,4,3,"button",6),t.ɵɵelementStart(8,"mat-autocomplete",7,1),t.ɵɵrepeaterCreate(10,En,4,7,"mat-option",8,Cn,!1,Pn,8,4,"mat-option",9),t.ɵɵpipe(13,"async"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵreference(9);t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.selectStatisticsCommandControl)("matAutocomplete",e),t.ɵɵattribute("aria-label",t.ɵɵpipeBind1(5,6,"gateway.statistics.command")),t.ɵɵadvance(3),t.ɵɵconditional(n.selectStatisticsCommandControl.value?6:7),t.ɵɵadvance(2),t.ɵɵproperty("displayWith",n.displayCommandFn),t.ɵɵadvance(2),t.ɵɵrepeater(t.ɵɵpipeBind1(13,8,n.filteredCommands$))}},dependencies:t.ɵɵgetComponentDepsFactory(Dn,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border-bottom:none;color:inherit}[_nghost-%COMP%] .action-button[_ngcontent-%COMP%]{opacity:.7}']})}}const On=()=>["createdTime","message"];function An(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",12),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.created-time")))}function Fn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",13),t.ɵɵtext(1),t.ɵɵpipe(2,"date"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(2,1,e[0],"yyyy-MM-dd HH:mm:ss"))}}function Rn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",14),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"widgets.gateway.message")," "))}function Bn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell")(1,"div",15),t.ɵɵtext(2),t.ɵɵelement(3,"tb-copy-button",16),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",e[1]," "),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(4,3,"gateway.statistics.copy-message")),t.ɵɵproperty("copyText",e[1])}}function Nn(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",17)}function Ln(e,n){1&e&&t.ɵɵelement(0,"mat-row",17)}class Vn{constructor(){this.data=l([]),this.defaultPageSizes=[10,20,30],this.defaultSortOrder={property:"0",direction:w.DESC},this.pageLink=new S(this.defaultPageSizes[0],0,null,this.defaultSortOrder),this.dataSource=new x([]),o((()=>{this.dataSource.data=this.data()}))}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.dataSource.sortingDataAccessor=e=>e[Number(this.sort?.active)||0]}static{this.ɵfac=function(e){return new(e||Vn)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Vn,selectors:[["tb-custom-statistics-table"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(v,5),t.ɵɵviewQuery(b,5)),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first),t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.paginator=e.first)}},inputs:{data:[1,"data"]},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:12,vars:13,consts:[[1,"flex","h-full","flex-col"],[1,"flex-1","overflow-auto"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","matSortActive","matSortDirection"],["matColumnDef","createdTime"],["mat-sort-header","","class","w-1/5",4,"matHeaderCellDef"],["class","!w-1/5",4,"matCellDef"],["matColumnDef","message"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"length","pageSize","pageSizeOptions"],["mat-sort-header","",1,"w-1/5"],[1,"!w-1/5"],["mat-sort-header",""],[1,"flex","items-center","justify-between"],["tooltipPosition","above","icon","content_copy",1,"copy-content",3,"copyText","tooltipText"],[1,"mat-row-select"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"table",2),t.ɵɵelementContainerStart(3,3),t.ɵɵtemplate(4,An,3,3,"mat-header-cell",4)(5,Fn,3,4,"mat-cell",5),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(6,6),t.ɵɵtemplate(7,Rn,3,3,"mat-header-cell",7)(8,Bn,5,5,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(9,Nn,1,0,"mat-header-row",9)(10,Ln,1,0,"mat-row",10),t.ɵɵelementEnd()(),t.ɵɵelement(11,"mat-paginator",11),t.ɵɵelementEnd()),2&e){let e;t.ɵɵadvance(2),t.ɵɵproperty("dataSource",n.dataSource)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(7),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(11,On))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(12,On)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",!n.dataSource.data.length),t.ɵɵproperty("length",null!==(e=null==n.dataSource||null==n.dataSource.data?null:n.dataSource.data.length)&&void 0!==e?e:0)("pageSize",n.defaultPageSizes[0])("pageSizeOptions",n.defaultPageSizes)}},dependencies:t.ɵɵgetComponentDepsFactory(Vn,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .copy-content .mat-icon{padding:4px;font-size:18px}']})}}class qn{constructor(e,t,n){this.elementRef=e,this.renderer=t,this.tooltip=n,this.tooltipEnabled=!0,this.position="above",this.destroy$=new te}ngOnInit(){this.observeMouseEvents(),this.applyTruncationStyles()}ngAfterViewInit(){this.tooltip.position=this.position}ngOnDestroy(){this.tooltip._isTooltipVisible()&&this.hideTooltip(),this.destroy$.next(),this.destroy$.complete()}observeMouseEvents(){ne(this.elementRef.nativeElement,"mouseenter").pipe(ue((()=>this.tooltipEnabled)),ue((()=>this.isOverflown(this.elementRef.nativeElement))),me((()=>this.showTooltip())),le(this.destroy$)).subscribe(),ne(this.elementRef.nativeElement,"mouseleave").pipe(ue((()=>this.tooltipEnabled)),ue((()=>this.tooltip._isTooltipVisible())),me((()=>this.hideTooltip())),le(this.destroy$)).subscribe()}applyTruncationStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"white-space","nowrap"),this.renderer.setStyle(this.elementRef.nativeElement,"overflow","hidden"),this.renderer.setStyle(this.elementRef.nativeElement,"text-overflow","ellipsis")}isOverflown(e){return e.clientWidth{this.adjustChips()}),0))}constructor(e,t,n,i){this.el=e,this.renderer=t,this.translate=n,this.window=i,this.destroy$=new te,this.renderer.setStyle(this.el.nativeElement,"max-height","48px"),this.renderer.setStyle(this.el.nativeElement,"overflow","auto"),ne(i,"resize").pipe(le(this.destroy$)).subscribe((()=>{this.adjustChips()})),this.observeIntersection()}observeIntersection(){this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.adjustChips()}))})),this.intersectionObserver.observe(this.el.nativeElement)}adjustChips(){const e=this.el.nativeElement,t=this.el.nativeElement.querySelector(".ellipsis-chip"),n=parseFloat(this.window.getComputedStyle(t).marginLeft)||0,i=e.querySelectorAll("mat-chip:not(.ellipsis-chip)");if(this.chipsValue.length>1){const a=this.el.nativeElement.querySelector(".ellipsis-text");this.renderer.setStyle(t,"display","inline-flex"),a.innerHTML=this.translate.instant("gateway.ellipsis-chips-text",{count:this.chipsValue.length});const r=e.offsetWidth-(t.offsetWidth+n);let o=0,s=0;i.forEach((e=>{this.renderer.setStyle(e,"display","inline-flex");const t=e.querySelector(".mdc-evolution-chip__text-label");this.applyMaxChipTextWidth(t,r/3),o+(e.offsetWidth+n)<=r&&sae(E())))).subscribe((e=>{this.attributesSubject.next(e.data),this.pageDataSubject.next(e),a.next(e)})),a}fetchAttributes(e,t,n){return this.getAllAttributes(e,t).pipe(pe((e=>{const t=e.filter((e=>0!==e.lastUpdateTs));return n.filterData(t)})))}getAllAttributes(e,t){if(!this.allAttributes){let n;M.get(t)?(this.telemetrySubscriber=k.createEntityAttributesSubscription(this.telemetryWsService,e,t,this.zone),this.telemetrySubscriber.subscribe(),n=this.telemetrySubscriber.attributeData$()):n=this.attributeService.getEntityAttributes(e,t),this.allAttributes=n.pipe(ge(1),fe())}return this.allAttributes}isAllSelected(){const e=this.selection.selected.length;return this.attributesSubject.pipe(pe((t=>e===t.length)))}isEmpty(){return this.attributesSubject.pipe(pe((e=>!e.length)))}total(){return this.pageDataSubject.pipe(pe((e=>e.totalElements)))}masterToggle(){this.attributesSubject.pipe(me((e=>{this.selection.selected.length===e.length?this.selection.clear():e.forEach((e=>{this.selection.select(e)}))})),ye(1)).subscribe()}}e("AttributeDatasource",zn);const Un=()=>({maxWidth:"970px"});function jn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-expansion-panel",4)(1,"mat-expansion-panel-header",5)(2,"mat-panel-title")(3,"mat-slide-toggle",6),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(4,"mat-label"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementContainer(7,7),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(),n=t.ɵɵreference(5);t.ɵɵproperty("expanded",e.showStrategyControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showStrategyControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,4,"gateway.report-strategy.label")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n)}}function Hn(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",8),t.ɵɵtext(1,"gateway.report-strategy.label"),t.ɵɵelementEnd(),t.ɵɵelementContainer(2,7)),2&e){t.ɵɵnextContext();const e=t.ɵɵreference(5);t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",e)}}function Wn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",16),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ReportTypeTranslateMap.get(e)))}}function $n(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",19),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.reportStrategyFormGroup.get("reportPeriod").hasError("min")?"gateway.hints.report-period-range":"gateway.hints.report-period-required"))}}function Kn(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",17),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",18),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,$n,3,3,"mat-icon",19),t.ɵɵelementStart(8,"span",20),t.ɵɵtext(9,"gateway.suffix.ms"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.report-strategy.report-period")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.reportStrategyFormGroup.get("reportPeriod").hasError("required")||e.reportStrategyFormGroup.get("reportPeriod").hasError("min")&&e.reportStrategyFormGroup.get("reportPeriod").touched?7:-1)}}function Yn(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelement(4,"div",11),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",12)(6,"mat-select",13),t.ɵɵtemplate(7,Wn,3,4,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,Kn,10,7,"div",15)),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"gateway.type")," "),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/report-strategy_fn")("tb-help-popup-style",t.ɵɵpureFunction0(7,Un)),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.reportStrategyTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.reportStrategyFormGroup.get("type").value!==e.ReportStrategyType.OnChange&&e.reportStrategyFormGroup.get("type").value!==e.ReportStrategyType.OnReceived)}}class Xn{constructor(e){this.fb=e,this.isExpansionMode=!1,this.defaultValue=en.Key,this.reportStrategyTypes=Object.values(Jt),this.ReportTypeTranslateMap=tn,this.ReportStrategyType=Jt,this.destroy$=new te,this.showStrategyControl=this.fb.control(!1),this.reportStrategyFormGroup=this.fb.group({type:[{value:Jt.OnReportPeriod,disabled:!0},[]],reportPeriod:[{value:this.defaultValue,disabled:!0},[$.required,$.min(100)]]}),this.observeStrategyFormChange(),this.observeStrategyToggle()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}writeValue(e){this.isExpansionMode&&this.showStrategyControl.setValue(!!e,{emitEvent:!1}),e&&this.reportStrategyFormGroup.enable({emitEvent:!1});const{type:t=Jt.OnReportPeriod,reportPeriod:n=this.defaultValue}=e??{};this.reportStrategyFormGroup.setValue({type:t,reportPeriod:n},{emitEvent:!1}),this.onTypeChange(t)}validate(){return this.reportStrategyFormGroup.valid||this.reportStrategyFormGroup.disabled?null:{reportStrategyForm:{valid:!1}}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}observeStrategyFormChange(){this.reportStrategyFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()})),this.reportStrategyFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.onTypeChange(e)))}observeStrategyToggle(){this.showStrategyControl.valueChanges.pipe(le(this.destroy$),ue((()=>this.isExpansionMode))).subscribe((e=>{e?(this.reportStrategyFormGroup.enable({emitEvent:!1}),this.reportStrategyFormGroup.get("reportPeriod").addValidators($.required),this.onChange(this.reportStrategyFormGroup.value)):(this.reportStrategyFormGroup.disable({emitEvent:!1}),this.reportStrategyFormGroup.get("reportPeriod").removeValidators($.required),this.onChange(null)),this.reportStrategyFormGroup.updateValueAndValidity({emitEvent:!1})}))}onTypeChange(e){const t=this.reportStrategyFormGroup.get("reportPeriod");e===Jt.OnChange||e===Jt.OnReceived?t.disable({emitEvent:!1}):this.isExpansionMode&&!this.showStrategyControl.value||t.enable({emitEvent:!1})}static{this.ɵfac=function(e){return new(e||Xn)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Xn,selectors:[["tb-report-strategy"]],inputs:{isExpansionMode:"isExpansionMode",defaultValue:"defaultValue"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>Xn)),multi:!0},{provide:K,useExisting:c((()=>Xn)),multi:!0}]),t.ɵɵStandaloneFeature],decls:6,vars:3,consts:[["defaultMode",""],["strategyFields",""],[3,"formGroup"],["class","tb-settings",3,"expanded",4,"ngIf","ngIfElse"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],[3,"ngTemplateOutlet"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","flex","items-center","gap-2"],["matSuffix","","tb-help-popup-placement","right",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],[3,"value"],["tbTruncateWithTooltip","",1,"fixed-title-width","tb-required"],["matInput","","type","number","min","100","name","value","formControlName","reportPeriod",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["translate","","matSuffix","",1,"block","pr-2"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,2),t.ɵɵtemplate(1,jn,8,6,"mat-expansion-panel",3)(2,Hn,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor)(4,Yn,9,8,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(3);t.ɵɵproperty("formGroup",n.reportStrategyFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isExpansionMode)("ngIfElse",e)}},dependencies:t.ɵɵgetComponentDepsFactory(Xn,[j,_,qn]),encapsulation:2,changeDetection:d.OnPush})}}e("ReportStrategyComponent",Xn),Ge([I()],Xn.prototype,"isExpansionMode",void 0),Ge([P()],Xn.prototype,"defaultValue",void 0);class Zn{constructor(e,t){this.attributeService=e,this.cd=t,this.isGatewayActive=!1}ngAfterViewInit(){this.ctx.$scope.gatewayStatus=this,this.loadGatewayState()}loadGatewayState(){this.attributeService.getEntityAttributes(this.deviceId,D.SERVER_SCOPE,["active","lastDisconnectTime","lastConnectTime"]).subscribe((e=>{const t=e.find((e=>"active"===e.key)).value,n=e.find((e=>"lastDisconnectTime"===e.key))?.value,i=e.find((e=>"lastConnectTime"===e.key))?.value;this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}))}getGatewayStatus(e,t,n){return!!e&&(!n||t>n)}onDataUpdated(){const e=this.ctx.defaultSubscription.data,t=e.find((e=>"active"===e.dataKey.name)).data[0][1],n=e.find((e=>"lastDisconnectTime"===e.dataKey.name)).data[0][1],i=e.find((e=>"lastConnectTime"===e.dataKey.name)).data[0][1];this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}static{this.ɵfac=function(e){return new(e||Zn)(t.ɵɵdirectiveInject(_e.AttributeService),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Zn,selectors:[["tb-gateway-status"]],inputs:{ctx:"ctx",deviceId:"deviceId"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:9,vars:10,consts:[[1,"flex","min-h-10","flex-1","justify-center"],[1,"divider"],[1,"whitespace-nowrap"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-card",0),t.ɵɵelement(1,"div",1),t.ɵɵelementStart(2,"mat-card-header")(3,"mat-card-subtitle",2),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"mat-card-content"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵclassProp("divider-red",!n.isGatewayActive)("divider-green",n.isGatewayActive),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,6,"gateway.gateway-status")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,8,n.isGatewayActive?"gateway.active":"gateway.inactive")))},dependencies:t.ɵɵgetComponentDepsFactory(Zn,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex}[_nghost-%COMP%] .divider[_ngcontent-%COMP%]{position:absolute;width:3px;top:12px;border-radius:2px;bottom:4px;left:10px}[_nghost-%COMP%] .divider-green[_ngcontent-%COMP%] .divider[_ngcontent-%COMP%]{border:1px solid rgb(25,128,56);background-color:#198038}[_nghost-%COMP%] .divider-green[_ngcontent-%COMP%] .mat-mdc-card-content[_ngcontent-%COMP%]{color:#198038}[_nghost-%COMP%] .divider-red[_ngcontent-%COMP%] .divider[_ngcontent-%COMP%]{border:1px solid rgb(203,37,48);background-color:#cb2530}[_nghost-%COMP%] .divider-red[_ngcontent-%COMP%] .mat-mdc-card-content[_ngcontent-%COMP%]{color:#cb2530}.mdc-card[_ngcontent-%COMP%]{position:relative;padding-left:10px;box-shadow:none}.mat-mdc-card-subtitle[_ngcontent-%COMP%]{font-weight:400;font-size:12px}.mat-mdc-card-header[_ngcontent-%COMP%]{padding:8px 16px 0}.mat-mdc-card-content[_ngcontent-%COMP%]:last-child{padding-bottom:8px;font-size:16px}'],changeDetection:d.OnPush})}}e("GatewayStatusComponent",Zn);class Qn{constructor(){this.tooltipText=""}static{this.ɵfac=function(e){return new(e||Qn)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Qn,selectors:[["tb-error-icon"]],inputs:{tooltipText:"tooltipText"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:2,vars:1,consts:[["matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",0),t.ɵɵtext(1," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",n.tooltipText)},dependencies:t.ɵɵgetComponentDepsFactory(Qn,[_,j]),styles:["[_nghost-%COMP%]{display:flex;width:40px;height:40px;padding:10px}mat-icon[_ngcontent-%COMP%]{font-size:20px}"]})}}var Jn,ei;e("ErrorTooltipIconComponent",Qn),e("MqttConverterType",Jn),function(e){e.JSON="json",e.BYTES="bytes",e.CUSTOM="custom"}(Jn||e("MqttConverterType",Jn={})),e("MQTTSourceType",ei),function(e){e.MSG="message",e.TOPIC="topic",e.CONST="constant"}(ei||e("MQTTSourceType",ei={}));const ti=e("MqttVersions",[{name:3.1,value:3},{name:3.11,value:4},{name:5,value:5}]),ni=e("QualityTypeTranslationsMap",new Map([[0,"gateway.qos.at-most-once"],[1,"gateway.qos.at-least-once"],[2,"gateway.qos.exactly-once"]])),ii=e("ConvertorTypeTranslationsMap",new Map([[Jn.JSON,"gateway.JSON"],[Jn.BYTES,"gateway.bytes"],[Jn.CUSTOM,"gateway.custom"]]));var ai;e("RequestType",ai),function(e){e.CONNECT_REQUEST="connectRequests",e.DISCONNECT_REQUEST="disconnectRequests",e.ATTRIBUTE_REQUEST="attributeRequests",e.ATTRIBUTE_UPDATE="attributeUpdates",e.SERVER_SIDE_RPC="serverSideRpc"}(ai||e("RequestType",ai={}));const ri=e("RequestTypesTranslationsMap",new Map([[ai.CONNECT_REQUEST,"gateway.request.connect-request"],[ai.DISCONNECT_REQUEST,"gateway.request.disconnect-request"],[ai.ATTRIBUTE_REQUEST,"gateway.request.attribute-request"],[ai.ATTRIBUTE_UPDATE,"gateway.request.attribute-update"],[ai.SERVER_SIDE_RPC,"gateway.request.rpc-connection"]])),oi=e("DataConversionTranslationsMap",new Map([[Jn.JSON,"gateway.JSON-hint"],[Jn.BYTES,"gateway.bytes-hint"],[Jn.CUSTOM,"gateway.custom-hint"]]));var si,li;e("SocketType",si),function(e){e.TCP="TCP",e.UDP="UDP"}(si||e("SocketType",si={})),e("SocketValueKey",li),function(e){e.TIMESERIES="telemetry",e.ATTRIBUTES="attributes",e.ATTRIBUTES_REQUESTS="attributeRequests",e.ATTRIBUTES_UPDATES="attributeUpdates",e.RPC_METHODS="serverSideRpc"}(li||e("SocketValueKey",li={}));const pi=e("SocketKeysPanelTitleTranslationsMap",new Map([[li.ATTRIBUTES,"gateway.attributes"],[li.TIMESERIES,"gateway.timeseries"],[li.ATTRIBUTES_REQUESTS,"gateway.attribute-requests"],[li.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[li.RPC_METHODS,"gateway.rpc-methods"]]));var ci,di;e("RequestsType",ci),function(e){e.Shared="shared",e.Client="client"}(ci||e("RequestsType",ci={})),e("ExpressionType",di),function(e){e.Constant="constant",e.Expression="expression"}(di||e("ExpressionType",di={}));const ui=e("SocketKeysAddKeyTranslationsMap",new Map([[li.ATTRIBUTES,"gateway.add-attribute"],[li.TIMESERIES,"gateway.add-timeseries"],[li.ATTRIBUTES_REQUESTS,"gateway.add-attribute-request"],[li.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[li.RPC_METHODS,"gateway.add-rpc-method"]])),mi=e("SocketKeysDeleteKeyTranslationsMap",new Map([[li.ATTRIBUTES,"gateway.delete-attribute"],[li.TIMESERIES,"gateway.delete-timeseries"],[li.ATTRIBUTES_REQUESTS,"gateway.delete-attribute-request"],[li.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[li.RPC_METHODS,"gateway.delete-rpc-method"]])),hi=e("SocketKeysNoKeysTextTranslationsMap",new Map([[li.ATTRIBUTES,"gateway.no-attributes"],[li.TIMESERIES,"gateway.no-timeseries"],[li.ATTRIBUTES_REQUESTS,"gateway.no-attribute-requests"],[li.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[li.RPC_METHODS,"gateway.no-rpc-methods"]]));var gi,fi,yi,vi;e("RestConverterType",gi),function(e){e.JSON="json",e.CUSTOM="custom"}(gi||e("RestConverterType",gi={})),e("RestSourceType",fi),function(e){e.REQUEST="request",e.CONST="constant"}(fi||e("RestSourceType",fi={})),e("ResponseType",yi),function(e){e.DEFAULT="default",e.CONST="constant",e.ADVANCED="advanced"}(yi||e("ResponseType",yi={})),e("ResponseStatus",vi),function(e){e.OK="OK",e.ERROR="Error"}(vi||e("ResponseStatus",vi={}));const xi=e("ResponseTypeTranslationsMap",new Map([[yi.DEFAULT,"gateway.rest.response-type.default"],[yi.CONST,"gateway.rest.response-type.const"],[yi.ADVANCED,"gateway.rest.response-type.advanced"]]));var bi;e("RestRequestType",bi),function(e){e.ATTRIBUTE_REQUEST="attributeRequests",e.ATTRIBUTE_UPDATE="attributeUpdates",e.SERVER_SIDE_RPC="serverSideRpc"}(bi||e("RestRequestType",bi={}));const wi=e("RestRequestTypesTranslationsMap",new Map([[bi.ATTRIBUTE_REQUEST,"gateway.request.attribute-request"],[bi.ATTRIBUTE_UPDATE,"gateway.request.attribute-update"],[bi.SERVER_SIDE_RPC,"gateway.request.rpc-connection"]]));var Si;e("RestRequestsScopeType",Si),function(e){e.Shared="shared",e.Client="client"}(Si||e("RestRequestsScopeType",Si={}));const Ci=e("RestRequestTypeFieldsMap",new Map([[bi.ATTRIBUTE_REQUEST,["HTTPMethods","endpoint","type","deviceNameExpression","attributeNameExpression"]],[bi.ATTRIBUTE_UPDATE,["HTTPMethod","SSLVerify","deviceNameFilter","attributeFilter","requestUrlExpression","valueExpression","httpHeaders","tries","allowRedirects"]],[bi.SERVER_SIDE_RPC,["HTTPMethod","deviceNameFilter","methodFilter","requestUrlExpression","valueExpression","responseTimeout","httpHeaders","tries"]],["all",["requestType","timeout","security"]]])),_i=e("RestConvertorTypeTranslationsMap",new Map([[gi.JSON,"gateway.JSON"],[gi.CUSTOM,"gateway.custom"]])),Ti=e("RestDataConversionTranslationsMap",new Map([[gi.JSON,"gateway.hints.rest.JSON"],[gi.CUSTOM,"gateway.custom-hint"]]));var Ii;e("PortLimits",Ii),function(e){e[e.MIN=1]="MIN",e[e.MAX=65535]="MAX"}(Ii||e("PortLimits",Ii={}));const Ei=e("GatewayConnectorConfigVersionMap",new Map([[ct.REST,pt.v3_7_2],[ct.KNX,pt.v3_7_0],[ct.BACNET,pt.v3_6_2],[ct.SOCKET,pt.v3_6_0],[ct.MQTT,pt.v3_5_2],[ct.OPCUA,pt.v3_5_2],[ct.MODBUS,pt.v3_5_2]]));var Mi,ki,Pi,Di;e("OPCUaSourceType",Mi),function(e){e.PATH="path",e.IDENTIFIER="identifier",e.CONST="constant"}(Mi||e("OPCUaSourceType",Mi={})),e("SecurityType",ki),function(e){e.ANONYMOUS="anonymous",e.BASIC="basic",e.CERTIFICATES="certificates"}(ki||e("SecurityType",ki={})),e("ModeType",Pi),function(e){e.NONE="None",e.SIGN="Sign",e.SIGNANDENCRYPT="SignAndEncrypt"}(Pi||e("ModeType",Pi={})),e("MappingType",Di),function(e){e.DATA="data",e.REQUESTS="requests",e.OPCUA="OPCua"}(Di||e("MappingType",Di={}));const Oi=e("MappingTypeTranslationsMap",new Map([[Di.DATA,"gateway.data-mapping"],[Di.REQUESTS,"gateway.requests-mapping"],[Di.OPCUA,"gateway.data-mapping"]]));var Ai;e("SecurityPolicy",Ai),function(e){e.BASIC128="Basic128Rsa15",e.BASIC256="Basic256",e.BASIC256SHA="Basic256Sha256"}(Ai||e("SecurityPolicy",Ai={}));const Fi=e("SecurityPolicyTypes",[{value:Ai.BASIC128,name:"Basic128RSA15"},{value:Ai.BASIC256,name:"Basic256"},{value:Ai.BASIC256SHA,name:"Basic256SHA256"}]),Ri=e("SecurityTypeTranslationsMap",new Map([[ki.ANONYMOUS,"gateway.broker.security-types.anonymous"],[ki.BASIC,"gateway.broker.security-types.basic"],[ki.CERTIFICATES,"gateway.broker.security-types.certificates"]])),Bi=e("SourceTypeTranslationsMap",new Map([[ei.MSG,"gateway.source-type.msg"],[ei.TOPIC,"gateway.source-type.topic"],[ei.CONST,"gateway.source-type.const"],[Mi.PATH,"gateway.source-type.path"],[Mi.IDENTIFIER,"gateway.source-type.identifier"],[Mi.CONST,"gateway.source-type.const"],[di.Expression,"gateway.source-type.expression"],[fi.REQUEST,"gateway.source-type.request"]]));var Ni;e("MappingKeysType",Ni),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.CUSTOM="extensionConfig",e.RPC_METHODS="rpc_methods",e.ATTRIBUTES_UPDATES="attributes_updates"}(Ni||e("MappingKeysType",Ni={}));const Li=e("MappingKeysPanelTitleTranslationsMap",new Map([[Ni.ATTRIBUTES,"gateway.attributes"],[Ni.TIMESERIES,"gateway.timeseries"],[Ni.CUSTOM,"gateway.keys"],[Ni.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[Ni.RPC_METHODS,"gateway.rpc-methods"]])),Vi=e("MappingKeysAddKeyTranslationsMap",new Map([[Ni.ATTRIBUTES,"gateway.add-attribute"],[Ni.TIMESERIES,"gateway.add-timeseries"],[Ni.CUSTOM,"gateway.add-key"],[Ni.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[Ni.RPC_METHODS,"gateway.add-rpc-method"]])),qi=e("MappingKeysDeleteKeyTranslationsMap",new Map([[Ni.ATTRIBUTES,"gateway.delete-attribute"],[Ni.TIMESERIES,"gateway.delete-timeseries"],[Ni.CUSTOM,"gateway.delete-key"],[Ni.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[Ni.RPC_METHODS,"gateway.delete-rpc-method"]])),Gi=e("MappingKeysNoKeysTextTranslationsMap",new Map([[Ni.ATTRIBUTES,"gateway.no-attributes"],[Ni.TIMESERIES,"gateway.no-timeseries"],[Ni.CUSTOM,"gateway.no-keys"],[Ni.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[Ni.RPC_METHODS,"gateway.no-rpc-methods"]])),zi=e("QualityTypes",[0,1,2]);var Ui;e("ServerSideRpcType",Ui),function(e){e.WithResponse="twoWay",e.WithoutResponse="oneWay"}(Ui||e("ServerSideRpcType",Ui={}));const ji=e("HelpLinkByMappingTypeMap",new Map([[Di.DATA,O+"/docs/iot-gateway/config/mqtt/#section-mapping"],[Di.OPCUA,O+"/docs/iot-gateway/config/opc-ua/#section-mapping"],[Di.REQUESTS,O+"/docs/iot-gateway/config/mqtt/#requests-mapping"]])),Hi=e("MappingHintTranslationsMap",new Map([[Di.DATA,"gateway.data-mapping-hint"],[Di.OPCUA,"gateway.opcua-data-mapping-hint"],[Di.REQUESTS,"gateway.requests-mapping-hint"]]));var Wi,$i,Ki,Yi,Xi,Zi,Qi,Ji,ea;e("ServerSideRPCType",Wi),function(e){e.ONE_WAY="oneWay",e.TWO_WAY="twoWay"}(Wi||e("ServerSideRPCType",Wi={})),e("SecurityMode",$i),function(e){e.basic="basic",e.certificates="certificates",e.extendedCertificates="extendedCertificates"}($i||e("SecurityMode",$i={})),e("ModbusProtocolType",Ki),function(e){e.TCP="tcp",e.UDP="udp",e.Serial="serial"}(Ki||e("ModbusProtocolType",Ki={})),e("ModbusMethodType",Yi),function(e){e.SOCKET="socket",e.RTU="rtu"}(Yi||e("ModbusMethodType",Yi={})),e("ModbusSerialMethodType",Xi),function(e){e.RTU="rtu",e.ASCII="ascii"}(Xi||e("ModbusSerialMethodType",Xi={})),e("ModbusParity",Zi),function(e){e.Even="E",e.Odd="O",e.None="N"}(Zi||e("ModbusParity",Zi={})),e("ModbusOrderType",Qi),function(e){e.BIG="BIG",e.LITTLE="LITTLE"}(Qi||e("ModbusOrderType",Qi={})),e("ModbusRegisterType",Ji),function(e){e.HoldingRegisters="holding_registers",e.CoilsInitializer="coils_initializer",e.InputRegisters="input_registers",e.DiscreteInputs="discrete_inputs"}(Ji||e("ModbusRegisterType",Ji={})),e("ModbusValueKey",ea),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.ATTRIBUTES_UPDATES="attributeUpdates",e.RPC_REQUESTS="rpc"}(ea||e("ModbusValueKey",ea={}));const ta=e("ModbusBaudrates",[4800,9600,19200,38400,57600,115200,230400,460800,921600]),na=e("ModbusByteSizes",[5,6,7,8]),ia=e("ModbusRegisterTranslationsMap",new Map([[Ji.HoldingRegisters,"gateway.holding_registers"],[Ji.CoilsInitializer,"gateway.coils_initializer"],[Ji.InputRegisters,"gateway.input_registers"],[Ji.DiscreteInputs,"gateway.discrete_inputs"]]));var aa;e("ModbusBitTargetType",aa),function(e){e.BooleanType="bool",e.IntegerType="int"}(aa||e("ModbusBitTargetType",aa={}));const ra=e("ModbusBitTargetTypeTranslationMap",new Map([[aa.BooleanType,"gateway.boolean"],[aa.IntegerType,"gateway.integer"]])),oa=e("ModbusMethodLabelsMap",new Map([[Yi.SOCKET,"Socket"],[Yi.RTU,"RTU"],[Xi.ASCII,"ASCII"]])),sa=e("ModbusProtocolLabelsMap",new Map([[Ki.TCP,"TCP"],[Ki.UDP,"UDP"],[Ki.Serial,"Serial"]])),la=e("ModbusParityLabelsMap",new Map([[Zi.Even,"Even"],[Zi.Odd,"Odd"],[Zi.None,"None"]])),pa=e("ModbusKeysPanelTitleTranslationsMap",new Map([[ea.ATTRIBUTES,"gateway.attributes"],[ea.TIMESERIES,"gateway.timeseries"],[ea.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[ea.RPC_REQUESTS,"gateway.rpc-requests"]])),ca=e("ModbusKeysAddKeyTranslationsMap",new Map([[ea.ATTRIBUTES,"gateway.add-attribute"],[ea.TIMESERIES,"gateway.add-timeseries"],[ea.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[ea.RPC_REQUESTS,"gateway.add-rpc-request"]])),da=e("ModbusKeysDeleteKeyTranslationsMap",new Map([[ea.ATTRIBUTES,"gateway.delete-attribute"],[ea.TIMESERIES,"gateway.delete-timeseries"],[ea.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[ea.RPC_REQUESTS,"gateway.delete-rpc-request"]])),ua=e("ModbusKeysNoKeysTextTranslationsMap",new Map([[ea.ATTRIBUTES,"gateway.no-attributes"],[ea.TIMESERIES,"gateway.no-timeseries"],[ea.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[ea.RPC_REQUESTS,"gateway.no-rpc-requests"]]));var ma;e("ModifierType",ma),function(e){e.DIVIDER="divider",e.MULTIPLIER="multiplier"}(ma||e("ModifierType",ma={}));const ha=e("ModifierTypesMap",new Map([[ma.DIVIDER,{name:"gateway.divider",icon:"mdi:division"}],[ma.MULTIPLIER,{name:"gateway.multiplier",icon:"mdi:multiplication"}]]));var ga,fa;e("DeviceInfoType",ga),function(e){e.FULL="full",e.PARTIAL="partial"}(ga||e("DeviceInfoType",ga={})),e("SegmentationType",fa),function(e){e.BOTH="segmentedBoth",e.TRANSMIT="segmentedTransmit",e.RECEIVE="segmentedReceive",e.NO="noSegmentation"}(fa||e("SegmentationType",fa={}));const ya=e("SegmentationTypeTranslationsMap",new Map([[fa.BOTH,"gateway.bacnet.segmentation.both"],[fa.TRANSMIT,"gateway.bacnet.segmentation.transmit"],[fa.RECEIVE,"gateway.bacnet.segmentation.receive"],[fa.NO,"gateway.bacnet.segmentation.no"]]));var va;e("BacnetDeviceKeysType",va),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.RPC_METHODS="serverSideRpc",e.ATTRIBUTES_UPDATES="attributeUpdates"}(va||e("BacnetDeviceKeysType",va={}));const xa=e("BacnetDeviceKeysPanelTitleTranslationsMap",new Map([[va.ATTRIBUTES,"gateway.attributes"],[va.TIMESERIES,"gateway.timeseries"],[va.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[va.RPC_METHODS,"gateway.rpc-methods"]])),ba=e("BacnetDeviceKeysAddKeyTranslationsMap",new Map([[va.ATTRIBUTES,"gateway.add-attribute"],[va.TIMESERIES,"gateway.add-timeseries"],[va.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[va.RPC_METHODS,"gateway.add-rpc-method"]])),wa=e("BacnetDeviceKeysDeleteKeyTranslationsMap",new Map([[va.ATTRIBUTES,"gateway.delete-attribute"],[va.TIMESERIES,"gateway.delete-timeseries"],[va.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[va.RPC_METHODS,"gateway.delete-rpc-method"]])),Sa=e("BacnetDeviceKeysNoKeysTextTranslationsMap",new Map([[va.ATTRIBUTES,"gateway.no-attributes"],[va.TIMESERIES,"gateway.no-timeseries"],[va.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[va.RPC_METHODS,"gateway.no-rpc-methods"]]));var Ca;e("BacnetKeyObjectType",Ca),function(e){e.analogInput="analogInput",e.analogOutput="analogOutput",e.analogValue="analogValue",e.binaryInput="binaryInput",e.binaryOutput="binaryOutput",e.binaryValue="binaryValue"}(Ca||e("BacnetKeyObjectType",Ca={}));const _a=e("BacnetKeyObjectTypeTranslationsMap",new Map([[Ca.analogInput,"gateway.bacnet.object-type.analog-input"],[Ca.analogOutput,"gateway.bacnet.object-type.analog-output"],[Ca.analogValue,"gateway.bacnet.object-type.analog-value"],[Ca.binaryInput,"gateway.bacnet.object-type.binary-input"],[Ca.binaryOutput,"gateway.bacnet.object-type.binary-output"],[Ca.binaryValue,"gateway.bacnet.object-type.binary-value"]]));var Ta;e("BacnetPropertyId",Ta),function(e){e.presentValue="presentValue",e.statusFlags="statusFlags",e.covIncrement="covIncrement",e.eventState="eventState",e.outOfService="outOfService",e.polarity="polarity",e.priorityArray="priorityArray",e.relinquishDefault="relinquishDefault",e.currentCommandPriority="currentCommandPriority",e.eventMessageTexts="eventMessageTexts",e.eventMessageTextsConfig="eventMessageTextsConfig",e.eventAlgorithmInhibitReference="eventAlgorithmInhibitReference",e.timeDelayNormal="timeDelayNormal"}(Ta||e("BacnetPropertyId",Ta={}));const Ia=e("BacnetPropertyIdByObjectType",new Map([[Ca.analogInput,[Ta.presentValue,Ta.statusFlags,Ta.covIncrement]],[Ca.analogOutput,[Ta.presentValue,Ta.statusFlags,Ta.covIncrement]],[Ca.analogValue,[Ta.presentValue,Ta.statusFlags,Ta.covIncrement]],[Ca.binaryInput,[Ta.presentValue,Ta.statusFlags,Ta.eventState,Ta.outOfService,Ta.polarity]],[Ca.binaryOutput,[Ta.presentValue,Ta.statusFlags,Ta.eventState,Ta.outOfService,Ta.polarity,Ta.priorityArray,Ta.relinquishDefault,Ta.currentCommandPriority,Ta.eventMessageTexts,Ta.eventMessageTextsConfig,Ta.eventAlgorithmInhibitReference,Ta.timeDelayNormal]],[Ca.binaryValue,[Ta.presentValue,Ta.statusFlags,Ta.eventState,Ta.outOfService]]])),Ea=e("BacnetPropertyIdTranslationsMap",new Map([[Ta.presentValue,"gateway.bacnet.property-id.present-value"],[Ta.statusFlags,"gateway.bacnet.property-id.status-flags"],[Ta.covIncrement,"gateway.bacnet.property-id.cov-increment"],[Ta.eventState,"gateway.bacnet.property-id.event-state"],[Ta.outOfService,"gateway.bacnet.property-id.out-of-service"],[Ta.polarity,"gateway.bacnet.property-id.polarity"],[Ta.priorityArray,"gateway.bacnet.property-id.priority-array"],[Ta.relinquishDefault,"gateway.bacnet.property-id.relinquish-default"],[Ta.currentCommandPriority,"gateway.bacnet.property-id.current-command-priority"],[Ta.eventMessageTexts,"gateway.bacnet.property-id.event-message-texts"],[Ta.eventMessageTextsConfig,"gateway.bacnet.property-id.event-message-texts-config"],[Ta.eventAlgorithmInhibitReference,"gateway.bacnet.property-id.event-algorithm-inhibit-reference"],[Ta.timeDelayNormal,"gateway.bacnet.property-id.time-delay-normal"]]));var Ma;e("BacnetRequestType",Ma),function(e){e.Write="writeProperty",e.Read="readProperty"}(Ma||e("BacnetRequestType",Ma={}));const ka=e("BacnetRequestTypeTranslationsMap",new Map([[Ma.Write,"gateway.bacnet.request-type.write"],[Ma.Read,"gateway.bacnet.request-type.read"]]));class Pa{static{this.mqttRequestTypeKeys=Object.values(ai)}static{this.mqttRequestMappingOldFields=["attributeNameJsonExpression","deviceNameJsonExpression","deviceNameTopicExpression","extension-config"]}static{this.mqttRequestMappingNewFields=["attributeNameExpressionSource","responseTopicQoS","extensionConfig"]}static mapMappingToUpgradedVersion(e){return e?.map((({converter:e,topicFilter:t,subscriptionQos:n=1})=>{const i=e.deviceInfo??this.extractConverterDeviceInfo(e),a={...e,deviceInfo:i,extensionConfig:e.extensionConfig||e["extension-config"]||null};return this.cleanUpOldFields(a),{converter:a,topicFilter:t,subscriptionQos:n}}))}static mapRequestsToUpgradedVersion(e){return this.mqttRequestTypeKeys.reduce(((t,n)=>e[n]?(t[n]=e[n].map((e=>{const t=this.mapRequestToUpgradedVersion(e,n);return this.cleanUpOldFields(t),t})),t):t),{})}static mapRequestsToDowngradedVersion(e){return this.mqttRequestTypeKeys.reduce(((t,n)=>e[n]?(t[n]=e[n].map((e=>{n===ai.SERVER_SIDE_RPC&&delete e.type;const{attributeNameExpression:t,deviceInfo:i,...a}=e,r={...a,attributeNameJsonExpression:t||null,deviceNameJsonExpression:i?.deviceNameExpressionSource!==ei.TOPIC?i?.deviceNameExpression:null,deviceNameTopicExpression:i?.deviceNameExpressionSource===ei.TOPIC?i?.deviceNameExpression:null};return this.cleanUpNewFields(r),r})),t):t),{})}static mapMappingToDowngradedVersion(e){return e?.map((e=>{const t=this.mapConverterToDowngradedVersion(e.converter);return this.cleanUpNewFields(t),{converter:t,topicFilter:e.topicFilter}}))}static mapConverterToDowngradedVersion(e){const{deviceInfo:t,...n}=e;return e.type!==Jn.BYTES?{...n,deviceNameJsonExpression:t?.deviceNameExpressionSource===ei.MSG?t.deviceNameExpression:null,deviceTypeJsonExpression:t?.deviceProfileExpressionSource===ei.MSG?t.deviceProfileExpression:null,deviceNameTopicExpression:t?.deviceNameExpressionSource!==ei.MSG?t?.deviceNameExpression:null,deviceTypeTopicExpression:t?.deviceProfileExpressionSource!==ei.MSG?t?.deviceProfileExpression:null}:{...n,deviceNameExpression:t.deviceNameExpression,deviceTypeExpression:t.deviceProfileExpression,"extension-config":e.extensionConfig}}static cleanUpOldFields(e){this.mqttRequestMappingOldFields.forEach((t=>delete e[t])),Te(e)}static cleanUpNewFields(e){this.mqttRequestMappingNewFields.forEach((t=>delete e[t])),Te(e)}static getTypeSourceByValue(e){return e.includes("${")?ei.MSG:e.includes("/")?ei.TOPIC:ei.CONST}static extractConverterDeviceInfo(e){const t=e.deviceNameExpression||e.deviceNameJsonExpression||e.deviceNameTopicExpression||null,n=e.deviceNameExpressionSource?e.deviceNameExpressionSource:t?this.getTypeSourceByValue(t):null,i=e.deviceProfileExpression||e.deviceTypeTopicExpression||e.deviceTypeJsonExpression||"default",a=e.deviceProfileExpressionSource?e.deviceProfileExpressionSource:i?this.getTypeSourceByValue(i):null;return t||i?{deviceNameExpression:t,deviceNameExpressionSource:n,deviceProfileExpression:i,deviceProfileExpressionSource:a}:null}static mapRequestToUpgradedVersion(e,t){const n=e.deviceNameJsonExpression||e.deviceNameTopicExpression||null,i=e.deviceTypeTopicExpression||e.deviceTypeJsonExpression||"default",a=i?this.getTypeSourceByValue(i):null,r=e.attributeNameExpressionSource||e.attributeNameJsonExpression||null,o=t===ai.SERVER_SIDE_RPC?1:null,s=t===ai.SERVER_SIDE_RPC?e.responseTopicExpression?Ui.WithResponse:Ui.WithoutResponse:null;return{...e,attributeNameExpression:r,attributeNameExpressionSource:r?this.getTypeSourceByValue(r):null,deviceInfo:e.deviceInfo?e.deviceInfo:n?{deviceNameExpression:n,deviceNameExpressionSource:this.getTypeSourceByValue(n),deviceProfileExpression:i,deviceProfileExpressionSource:a}:null,responseTopicQoS:o,type:s}}}e("MqttVersionMappingUtil",Pa);class Da{constructor(e,t){this.gatewayVersionIn=e,this.connector=t,this.gatewayVersion=za.parseVersion(this.gatewayVersionIn),this.configVersion=za.parseVersion(this.connector.configVersion??this.connector.configurationJson.configVersion)}getProcessedByVersion(){return this.isVersionUpdateNeeded()?this.processVersionUpdate():this.connector}processVersionUpdate(){return this.isVersionUpgradeNeeded()?this.getUpgradedVersion():this.isVersionDowngradeNeeded()?this.getDowngradedVersion():this.connector}isVersionUpdateNeeded(){return!!this.gatewayVersion&&this.configVersion!==this.gatewayVersion}isVersionUpgradeNeeded(){const e=za.parseVersion(Ei.get(this.connector.type)),t=this.gatewayVersion>=e,n=!this.configVersion||this.configVersion=e&&e>this.gatewayVersion}}e("GatewayConnectorVersionProcessor",Da);class Oa extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t,this.mqttRequestTypeKeys=Object.values(ai)}getUpgradedVersion(){const{connectRequests:e,disconnectRequests:t,attributeRequests:n,attributeUpdates:i,serverSideRpc:a}=this.connector.configurationJson;let r={...this.connector.configurationJson,requestsMapping:Pa.mapRequestsToUpgradedVersion({connectRequests:e,disconnectRequests:t,attributeRequests:n,attributeUpdates:i,serverSideRpc:a}),mapping:Pa.mapMappingToUpgradedVersion(this.connector.configurationJson.mapping)};return this.mqttRequestTypeKeys.forEach((e=>{const{[e]:t,...n}=r;r={...n}})),this.cleanUpConfigJson(r),{...this.connector,configurationJson:r,configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const{requestsMapping:e,mapping:t,...n}=this.connector.configurationJson,i=e?Pa.mapRequestsToDowngradedVersion(e):{},a=Pa.mapMappingToDowngradedVersion(t);return{...this.connector,configurationJson:{...n,...i,mapping:a},configVersion:this.gatewayVersionIn}}cleanUpConfigJson(e){Se(e.requestsMapping,{})&&delete e.requestsMapping,Se(e.mapping,[])&&delete e.mapping}}e("MqttVersionProcessor",Oa);class Aa extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{master:e.master?.slaves?Ua.mapMasterToUpgradedVersion(e.master):{slaves:[]},slave:e.slave?Ua.mapSlaveToUpgradedVersion(e.slave):{}},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{...e,slave:e.slave?Ua.mapSlaveToDowngradedVersion(e.slave):{},master:e.master?.slaves?Ua.mapMasterToDowngradedVersion(e.master):{slaves:[]}},configVersion:this.gatewayVersionIn}}}e("ModbusVersionProcessor",Aa);class Fa extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson.server;return{...this.connector,configurationJson:{server:e?ja.mapServerToUpgradedVersion(e):{},mapping:e?.mapping?ja.mapMappingToUpgradedVersion(e.mapping):[]},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){return{...this.connector,configurationJson:{server:ja.mapServerToDowngradedVersion(this.connector.configurationJson)},configVersion:this.gatewayVersionIn}}}e("OpcVersionProcessor",Fa);class Ra{constructor(){this.fb=i(Y),this.destroyRef=i(a),this.formGroup=this.initFormGroup(),this.observeValueChanges()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.formGroup.valid?null:{formGroup:{valid:!1}}}writeValue(e){this.onWriteValue(e)}onWriteValue(e){this.formGroup.patchValue(e,{emitEvent:!1})}mapOnChangeValue(e){return e}observeValueChanges(){this.formGroup.valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>this.onChange(this.mapOnChangeValue(e))))}static{this.ɵfac=function(e){return new(e||Ra)}}static{this.ɵdir=t.ɵɵdefineDirective({type:Ra})}}e("ControlValueAccessorBaseAbstract",Ra);class Ba extends Ra{constructor(){super(...arguments),this.withReportStrategy=!0,this.initialized=new u,this.isLegacy=!1,this.fb=i(Y)}get basicFormGroup(){return this.formGroup}ngAfterViewInit(){this.initialized.emit()}onWriteValue(e){this.formGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}mapOnChangeValue(e){return this.getMappedValue(e)}initFormGroup(){return this.initBasicFormGroup()}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(Ba)))(n||Ba)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:Ba,inputs:{generalTabContent:"generalTabContent",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{initialized:"initialized"},features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature]})}}e("GatewayConnectorBasicConfigDirective",Ba);class Na extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{socket:e?Ha.mapSocketToUpgradedVersion(e):{},devices:e?.devices?Ha.mapDevicesToUpgradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){return{...this.connector,configurationJson:Ha.mapSocketToDowngradedVersion(this.connector.configurationJson),configVersion:this.gatewayVersionIn}}}e("SocketVersionProcessor",Na);class La extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{application:e?.general?Wa.mapApplicationToUpgradedVersion(e.general):{},devices:e?.devices?Wa.mapDevicesToUpgradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{general:e?.application?Wa.mapApplicationToDowngradedVersion(e.application):{},devices:e?.devices?Wa.mapDevicesToDowngradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}}e("BacnetVersionProcessor",La);const Va=["searchInput"];class qa{constructor(){this.withReportStrategy=!0,this.textSearchMode=!1,this.onChange=()=>{},this.translate=i(We),this.dialog=i(Le),this.dialogService=i(Ie),this.fb=i(Y),this.cd=i(h),this.destroyRef=i(a),this.textSearch=this.fb.control("",{nonNullable:!0}),this.entityFormArray=this.fb.array([]),this.entityFormArray.valueChanges.pipe(bn()).subscribe((e=>{this.updateTableData(e),this.onChange(e)})),this.dataSource=this.getDatasource()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(de(150),ce(((e,t)=>(e??"")===t.trim())),bn(this.destroyRef)).subscribe((e=>this.updateTableData(this.entityFormArray.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.entityFormArray.clear(),this.pushDataAsFormArrays(e)}enterFilterMode(){this.textSearchMode=!0,this.cd.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.entityFormArray.value),this.textSearchMode=!1,this.textSearch.reset()}validate(){return this.entityFormArray.controls.length?null:{devicesFormGroup:{valid:!1}}}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.entityFormArray.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||qa)}}static{this.ɵdir=t.ɵɵdefineDirective({type:qa,viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(Va,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},features:[t.ɵɵInputTransformsFeature]})}}e("AbstractDevicesConfigTableComponent",qa);class Ga extends Da{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t,this.restRequestTypeKeys=Object.values(bi)}getUpgradedVersion(){const{attributeRequests:e=[],attributeUpdates:t=[],serverSideRpc:n=[],mapping:i=[],...a}=this.connector.configurationJson;let r={server:za.cleanUpConfigBaseInfo(a),requestsMapping:{attributeRequests:e,attributeUpdates:t,serverSideRpc:n},mapping:$a.mapMappingToUpgradedVersion(i)};return this.restRequestTypeKeys.forEach((e=>{const{[e]:t,...n}=r;r={...n}})),{...this.connector,configurationJson:r,configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const{requestsMapping:e={},mapping:t,server:n,...i}=this.connector.configurationJson,{attributeRequests:a=[],attributeUpdates:r=[],serverSideRpc:o=[]}=e;return{...this.connector,configurationJson:{...i,...n,attributeRequests:a,attributeUpdates:r,serverSideRpc:o,mapping:$a.mapMappingToDowngradedVersion(t)},configVersion:this.gatewayVersionIn}}}e("RestVersionProcessor",Ga);class za{static getConfig(e,t){switch(e.type){case ct.MQTT:return new Oa(t,e).getProcessedByVersion();case ct.OPCUA:return new Fa(t,e).getProcessedByVersion();case ct.MODBUS:return new Aa(t,e).getProcessedByVersion();case ct.SOCKET:return new Na(t,e).getProcessedByVersion();case ct.BACNET:return new La(t,e).getProcessedByVersion();case ct.REST:return new Ga(t,e).getProcessedByVersion();default:return e}}static parseVersion(e){if(Ee(e))return e;if(Me(e)){const[t,n="0",i="0"]=e.split(".");return parseFloat(`${t}.${n}${i.slice(0,1)}`)}return 0}static cleanUpConfigBaseInfo(e){const{name:t,id:n,enableRemoteLogging:i,logLevel:a,reportStrategy:r,configVersion:o,...s}=e;return s}}e("GatewayConnectorVersionMappingUtil",za);class Ua{static mapMasterToUpgradedVersion(e){return{slaves:e.slaves.map((e=>{const{sendDataOnlyOnChange:t,...n}=e;return{...n,deviceType:e.deviceType??"default",reportStrategy:t?{type:Jt.OnChange}:{type:Jt.OnReportPeriod,reportPeriod:e.pollPeriod}}}))}}static mapMasterToDowngradedVersion(e){return{slaves:e.slaves.map((e=>{const{reportStrategy:t,...n}=e;return{...n,sendDataOnlyOnChange:t?.type!==Jt.OnReportPeriod}}))}}static mapSlaveToDowngradedVersion(e){if(!e?.values)return e;const t=Object.keys(e.values).reduce(((t,n)=>t={...t,[n]:[e.values[n]]}),{});return{...e,values:t}}static mapSlaveToUpgradedVersion(e){if(!e?.values)return e;const t=Object.keys(e.values).reduce(((t,n)=>t={...t,[n]:this.mapValuesToUpgradedVersion(e.values[n][0]??{})}),{});return{...e,values:t}}static mapValuesToUpgradedVersion(e){return Object.keys(e).reduce(((t,n)=>t={...t,[n]:e[n].map((e=>({...e,type:"int"===e.type?Wt.INT16:e.type})))}),{})}}e("ModbusVersionMappingUtil",Ua);class ja{static mapServerToUpgradedVersion(e){const{mapping:t,disableSubscriptions:n,pollPeriodInMillis:i,...a}=e;return{...a,pollPeriodInMillis:i??5e3,enableSubscriptions:!n}}static mapServerToDowngradedVersion(e){const{mapping:t,server:n}=e,{enableSubscriptions:i,...a}=n??{};return{...a,mapping:t?this.mapMappingToDowngradedVersion(t):[],disableSubscriptions:!i}}static mapMappingToUpgradedVersion(e){return e.map((e=>({deviceNodePattern:e.deviceNodePattern,deviceNodeSource:this.getDeviceNodeSourceByValue(e.deviceNodePattern),deviceInfo:{deviceNameExpression:e.deviceNamePattern,deviceNameExpressionSource:this.getTypeSourceByValue(e.deviceNamePattern),deviceProfileExpression:e.deviceTypePattern??"default",deviceProfileExpressionSource:this.getTypeSourceByValue(e.deviceTypePattern??"default")},attributes:e.attributes?.map((e=>({key:e.key,type:this.getTypeSourceByValue(e.path),value:e.path})))??[],attributes_updates:e.attributes_updates?.map((e=>({key:e.attributeOnThingsBoard,type:this.getTypeSourceByValue(e.attributeOnDevice),value:e.attributeOnDevice})))??[],timeseries:e.timeseries?.map((e=>({key:e.key,type:this.getTypeSourceByValue(e.path),value:e.path})))??[],rpc_methods:e.rpc_methods?.map((e=>({method:e.method,arguments:e.arguments.map((e=>({value:e,type:this.getArgumentType(e)})))})))??[]})))}static mapMappingToDowngradedVersion(e){return e.map((e=>({deviceNodePattern:e.deviceNodePattern,deviceNamePattern:e.deviceInfo.deviceNameExpression,deviceTypePattern:e.deviceInfo.deviceProfileExpression,attributes:e.attributes.map((e=>({key:e.key,path:e.value}))),attributes_updates:e.attributes_updates.map((e=>({attributeOnThingsBoard:e.key,attributeOnDevice:e.value}))),timeseries:e.timeseries.map((e=>({key:e.key,path:e.value}))),rpc_methods:e.rpc_methods.map((e=>({method:e.method,arguments:e.arguments.map((e=>e.value))})))})))}static getTypeSourceByValue(e){return e.includes("${")?Mi.IDENTIFIER:e.includes("/")||e.includes("\\")?Mi.PATH:Mi.CONST}static getDeviceNodeSourceByValue(e){return e.includes("${")?Mi.IDENTIFIER:Mi.PATH}static getArgumentType(e){switch(typeof e){case"boolean":return"boolean";case"number":return Number.isInteger(e)?"integer":"float";default:return"string"}}}e("OpcVersionMappingUtil",ja);class Ha{static mapSocketToUpgradedVersion(e){const{devices:t,...n}=e??{};return za.cleanUpConfigBaseInfo(n)}static mapSocketToDowngradedVersion(e){const{devices:t,socket:n}=e??{};return{...n,devices:this.mapDevicesToDowngradedVersion(t??[])}}static mapDevicesToUpgradedVersion(e){return e?.map((e=>({...e,attributeRequests:e.attributeRequests?.map((e=>({...e,requestExpressionSource:this.getExpressionSource(e.requestExpression),attributeNameExpressionSource:this.getExpressionSource(e.attributeNameExpression)})))??[]})))??[]}static mapDevicesToDowngradedVersion(e){return e.map((e=>({...e,attributeRequests:e.attributeRequests?.map((({requestExpressionSource:e,attributeNameExpressionSource:t,...n})=>n))??[]})))}static getExpressionSource(e){return e.includes("${")||e.includes("[")?di.Expression:di.Constant}}e("SocketVersionMappingUtil",Ha);class Wa{static mapApplicationToUpgradedVersion(e){const{address:t="",...n}=e,[i,a]=t.split(":"),[r,o]=i.split("/");return{host:r,port:a,mask:o,...n}}static mapApplicationToDowngradedVersion(e){const{host:t="",port:n="",mask:i="",...a}=e;return{address:i?`${t}/${i}:${n}`:`${t}:${n}`,...a}}static mapDevicesToUpgradedVersion(e){return e?.map((({address:e="",deviceName:t,deviceType:n,attributes:i,timeseries:a,attributeUpdates:r,serverSideRpc:o,...s})=>({...s,host:e.split(":")[0],port:e.split(":")[1],deviceInfo:{deviceNameExpression:t,deviceProfileExpression:n,deviceNameExpressionSource:this.getExpressionSource(t),deviceProfileExpressionSource:this.getExpressionSource(n)},attributes:this.getUpdateKeys(i),timeseries:this.getUpdateKeys(a),attributeUpdates:this.getUpdateKeys(r),serverSideRpc:this.getUpdateKeys(o)})))??[]}static mapDevicesToDowngradedVersion(e){return e?.map((({port:e,host:t,deviceInfo:n,attributes:i,timeseries:a,attributeUpdates:r,serverSideRpc:o,...s})=>({...s,address:`${t}:${e}`,deviceName:n?.deviceNameExpression,deviceType:n?.deviceProfileExpression,attributes:this.getDowngradedKeys(i),timeseries:this.getDowngradedKeys(a),attributeUpdates:this.getDowngradedKeys(r),serverSideRpc:this.getDowngradedKeys(o)})))??[]}static getExpressionSource(e){return e.includes("${")||e.includes("[")?di.Expression:di.Constant}static getUpdateKeys(e){return e?.map((({objectId:e="",...t})=>({objectType:e.split(":")[0],objectId:e.split(":")[1],...t})))??[]}static getDowngradedKeys(e){return e?.map((({objectId:e="",objectType:t="",...n})=>({objectId:`${t}:${e}`,...n})))??[]}}e("BacnetVersionMappingUtil",Wa);class $a{static mapMappingToUpgradedVersion(e){return e?.map((({converter:e,...t})=>{const{deviceNameExpression:n,deviceTypeExpression:i,...a}=e;return{converter:{deviceInfo:{deviceNameExpressionSource:this.getTypeSourceByValue(n),deviceNameExpression:n,deviceProfileExpressionSource:this.getTypeSourceByValue(i),deviceProfileExpression:i},...a},...t}}))}static mapMappingToDowngradedVersion(e){return e?.map((({converter:e,...t})=>{const{deviceInfo:n,...i}=e;return{converter:{deviceNameExpression:n?.deviceNameExpression,deviceTypeExpression:n?.deviceProfileExpression,...i},...t}}))}static getTypeSourceByValue(e=""){return e.includes("${")?fi.REQUEST:fi.CONST}}e("RestVersionMappingUtil",$a);class Ka{transform(e,t){const n=za.parseVersion(e);return t===ct.MODBUS?n>=za.parseVersion(pt.v3_5_2):n>=za.parseVersion(pt.v3_6_0)}static{this.ɵfac=function(e){return new(e||Ka)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"withReportStrategy",type:Ka,pure:!0,standalone:!0})}}function Ya(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-required")," "))}function Xa(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-pattern")," "))}function Za(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.name-already-exists")," "))}function Qa(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-required")," "))}function Ja(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-pattern")," "))}function er(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")," "))}function tr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.command-required")," "))}function nr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.command-pattern")," "))}e("ReportStrategyVersionPipe",Ka);class ir extends A{constructor(e,t,n,i,a,r,o,s){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.dialogService=r,this.translate=o,this.destroyRef=s,this.commandHelpLink=O+"/docs/iot-gateway/configuration/#subsection-statistics",this.editCommandFormGroup=this.fb.group({attributeOnGateway:["",[$.required,$.pattern(an),this.uniqNameRequired()]],command:["",[$.required,$.pattern(/^(?=\S).*\S$/)]],timeout:[10,[$.required,$.min(1),$.pattern(nn),$.pattern(/^[^.\s]+$/)]],installCmd:["",$.pattern(an)]}),this.editCommandFormGroup.patchValue(this.data.command,{emitEvent:!1})}cancel(){this.confirmConnectorChange().pipe(ve(Boolean),bn(this.destroyRef)).subscribe((()=>this.dialogRef.close(null)))}apply(){this.dialogRef.close({current:this.editCommandFormGroup.value,prev:this.data.command})}confirmConnectorChange(){return this.editCommandFormGroup.dirty?this.dialogService.confirm(this.translate.instant("gateway.statistics.change-command-title"),this.translate.instant("gateway.statistics.change-command-text"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0):ae(!0)}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase(),n=t&&this.data.existingCommands.some((e=>e.toLowerCase()===t))&&t!==this.data.command.attributeOnGateway.toLowerCase();return n?{duplicateName:{valid:!1}}:null}}static{this.ɵfac=function(e){return new(e||ir)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:ir,selectors:[["tb-edit-custom-command-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:64,vars:27,consts:[[1,"edit-command-container",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel","stroked","no-padding-bottom","no-gap","command-container"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["matInput","","formControlName","attributeOnGateway"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"],["matInput","","formControlName","timeout","type","number","min","1"],["appearance","outline",1,"mat-block"],["matInput","","formControlName","command"],[1,"tb-settings","pb-4"],["translate","",1,"tb-form-panel-title"],["matInput","","formControlName","installCmd"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2)(6,"div",3),t.ɵɵelementStart(7,"button",4),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",5),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",6)(11,"div",7)(12,"section",8)(13,"section",9)(14,"mat-form-field",10)(15,"mat-label",11),t.ɵɵtext(16,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(17,"input",12),t.ɵɵtemplate(18,Ya,3,3,"mat-error")(19,Xa,3,3,"mat-error")(20,Za,3,3,"mat-error"),t.ɵɵelementStart(21,"mat-icon",13),t.ɵɵpipe(22,"translate"),t.ɵɵtext(23,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"mat-form-field",10)(25,"mat-label",11),t.ɵɵtext(26,"gateway.statistics.timeout"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",14),t.ɵɵtemplate(28,Qa,3,3,"mat-error")(29,Ja,3,3,"mat-error")(30,er,3,3,"mat-error"),t.ɵɵelementStart(31,"mat-icon",13),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(34,"section")(35,"mat-form-field",15)(36,"mat-label",11),t.ɵɵtext(37,"gateway.statistics.command"),t.ɵɵelementEnd(),t.ɵɵelement(38,"input",16),t.ɵɵtemplate(39,tr,3,3,"mat-error")(40,nr,3,3,"mat-error"),t.ɵɵelementStart(41,"mat-icon",13),t.ɵɵpipe(42,"translate"),t.ɵɵtext(43,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(44,"section")(45,"mat-expansion-panel",17)(46,"mat-expansion-panel-header")(47,"mat-panel-title")(48,"div",18),t.ɵɵtext(49,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(50,"mat-form-field",10)(51,"mat-label",11),t.ɵɵtext(52,"gateway.statistics.install-cmd"),t.ɵɵelementEnd(),t.ɵɵelement(53,"input",19),t.ɵɵelementStart(54,"mat-icon",13),t.ɵɵpipe(55,"translate"),t.ɵɵtext(56,"info_outlined "),t.ɵɵelementEnd()()()()()()(),t.ɵɵelementStart(57,"div",20)(58,"button",21),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(59),t.ɵɵpipe(60,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(61,"button",22),t.ɵɵlistener("click",(function(){return n.apply()})),t.ɵɵtext(62),t.ɵɵpipe(63,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.editCommandFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,13,n.data.titleText)),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.commandHelpLink),t.ɵɵadvance(12),t.ɵɵconditional(n.editCommandFormGroup.get("attributeOnGateway").hasError("required")?18:n.editCommandFormGroup.get("attributeOnGateway").hasError("pattern")?19:n.editCommandFormGroup.get("attributeOnGateway").hasError("duplicateName")?20:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(22,15,"gateway.hints.attribute")),t.ɵɵadvance(7),t.ɵɵconditional(n.editCommandFormGroup.get("timeout").hasError("required")?28:n.editCommandFormGroup.get("timeout").hasError("pattern")?29:n.editCommandFormGroup.get("timeout").hasError("min")?30:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(32,17,"gateway.hints.timeout")),t.ɵɵadvance(8),t.ɵɵconditional(n.editCommandFormGroup.get("command").hasError("required")?39:n.editCommandFormGroup.get("command").hasError("pattern")?40:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(42,19,"gateway.hints.command")),t.ɵɵadvance(13),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(55,21,"gateway.hints.install-cmd")),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(60,23,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.editCommandFormGroup.invalid||!n.editCommandFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(63,25,n.data.buttonText)," "))},dependencies:t.ɵɵgetComponentDepsFactory(ir,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .edit-command-container[_ngcontent-%COMP%]{min-width:40vw;width:50vw}[_nghost-%COMP%] .pointer-event{pointer-events:all}[_nghost-%COMP%] .toggle-group span{padding:0 25px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{color:#e0e0e0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix:hover{color:#9e9e9e}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex;align-items:center}']})}}var ar=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},rr=new function(){this.browser=new ar,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(rr.wxa=!0,rr.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?rr.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(rr.node=!0,rr.svgSupported=!0):function(e,t){var n=t.browser,i=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),r=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);i&&(n.firefox=!0,n.version=i[1]);a&&(n.ie=!0,n.version=a[1]);r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18);o&&(n.weChat=!0);t.svgSupported="undefined"!=typeof SVGRect,t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported="undefined"!=typeof document;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,rr);var or="sans-serif",sr="12px "+or;var lr,pr,cr=function(e){var t={};if("undefined"==typeof JSON)return t;for(var n=0;n=0)r=a*e.length;else for(var o=0;o>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",a[l]+":0",i[1-s]+":auto",a[1-l]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return n}(t,r),s=function(e,t,n){for(var i=n?"invTrans":"trans",a=t[i],r=t.srcCoords,o=[],s=[],l=!0,p=0;p<4;p++){var c=e[p].getBoundingClientRect(),d=2*p,u=c.left,m=c.top;o.push(u,m),l=l&&r&&u===r[d]&&m===r[d+1],s.push(e[p].offsetLeft,e[p].offsetTop)}return l&&a?a:(t.srcCoords=o,t[i]=n?Wo(s,o):Wo(o,s))}(o,r,a);if(s)return s(e,n,i),!0}return!1}function Xo(e){return"CANVAS"===e.nodeName.toUpperCase()}var Zo=/([&<>"'])/g,Qo={"&":"&","<":"<",">":">",'"':""","'":"'"};function Jo(e){return null==e?"":(e+"").replace(Zo,(function(e,t){return Qo[t]}))}var es=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ts=[],ns=rr.browser.firefox&&+rr.browser.version.split(".")[0]<39;function is(e,t,n,i){return n=n||{},i?as(e,t,n):ns&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):as(e,t,n),n}function as(e,t,n){if(rr.domSupported&&e.getBoundingClientRect){var i=t.clientX,a=t.clientY;if(Xo(e)){var r=e.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=a-r.top)}if(Yo(ts,e,i,a))return n.zrX=ts[0],void(n.zrY=ts[1])}n.zrX=n.zrY=0}function rs(e){return e||window.event}function os(e,t,n){if(null!=(t=rs(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var a="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];a&&is(e,a,t,n)}else{is(e,t,t,n);var r=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;if(null==n||null==i)return t;return 3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(t);t.zrDelta=r?r/120:-(t.detail||0)/3}var o=t.button;return null==t.which&&void 0!==o&&es.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function ss(e,t,n,i){e.addEventListener(t,n,i)}var ls=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function ps(e){return 2===e.which||3===e.which}var cs=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},r=0,o=i.length;r1&&a&&a.length>1){var o=ds(a)/ds(r);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((i=a)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}};function ms(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function hs(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function gs(e,t,n){var i=t[0]*n[0]+t[2]*n[1],a=t[1]*n[0]+t[3]*n[1],r=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=l,e}function fs(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function ys(e,t,n,i){void 0===i&&(i=[0,0]);var a=t[0],r=t[2],o=t[4],s=t[1],l=t[3],p=t[5],c=Math.sin(n),d=Math.cos(n);return e[0]=a*d+s*c,e[1]=-a*c+s*d,e[2]=r*d+l*c,e[3]=-r*c+d*l,e[4]=d*(o-i[0])+c*(p-i[1])+i[0],e[5]=d*(p-i[1])-c*(o-i[0])+i[1],e}function vs(e,t,n){var i=n[0],a=n[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e}function xs(e,t){var n=t[0],i=t[2],a=t[4],r=t[1],o=t[3],s=t[5],l=n*o-r*i;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null}function bs(e){var t=[1,0,0,1,0,0];return hs(t,e),t}var ws=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var a=1-i;e.x=a*t.x+i*n.x,e.y=a*t.y+i*n.y},e}(),Ss=Math.min,Cs=Math.max,_s=new ws,Ts=new ws,Is=new ws,Es=new ws,Ms=new ws,ks=new ws,Ps=function(){function e(e,t,n,i){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=Ss(e.x,this.x),n=Ss(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Cs(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Cs(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,a=[1,0,0,1,0,0];return fs(a,a,[-t.x,-t.y]),vs(a,a,[n,i]),fs(a,a,[e.x,e.y]),a},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,a=i.x,r=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,p=t.x+t.width,c=t.y,d=t.y+t.height,u=!(rh&&(h=x,gh&&(h=b,y=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var a=i[0],r=i[3],o=i[4],s=i[5];return t.x=n.x*a+o,t.y=n.y*r+s,t.width=n.width*a,t.height=n.height*r,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}_s.x=Is.x=n.x,_s.y=Es.y=n.y,Ts.x=Es.x=n.x+n.width,Ts.y=Is.y=n.y+n.height,_s.transform(i),Es.transform(i),Ts.transform(i),Is.transform(i),t.x=Ss(_s.x,Ts.x,Is.x,Es.x),t.y=Ss(_s.y,Ts.y,Is.y,Es.y);var l=Cs(_s.x,Ts.x,Is.x,Es.x),p=Cs(_s.y,Ts.y,Is.y,Es.y);t.width=l-t.x,t.height=p-t.y}else t!==n&&e.copy(t,n)},e}(),Ds="silent";function Os(){ls(this.event)}var As=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return ze(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Uo),Fs=function(e,t){this.x=e,this.y=t},Rs=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Bs=new Ps(0,0,0,0),Ns=function(e){function t(t,n,i,a,r){var o=e.call(this)||this;return o._hovered=new Fs(0,0),o.storage=t,o.painter=n,o.painterRoot=a,o._pointerSize=r,i=i||new As,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new zo(o),o}return ze(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(Rr(Rs,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=qs(this,t,n),a=this._hovered,r=a.target;r&&!r.__zr&&(r=(a=this.findHover(a.x,a.y)).target);var o=this._hovered=i?new Fs(t,n):this.findHover(t,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(a,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==r&&this.dispatchToElement(o,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Fs(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var a="on"+t,r=function(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Os}}(t,e,n);i&&(i[a]&&(r.cancelBubble=!!i[a].call(i,r)),i.trigger(t,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(t,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[a]&&e[a].call(e,r),e.trigger&&e.trigger(t,r)})))}},t.prototype.findHover=function(e,t,n){var i=this.storage.getDisplayList(),a=new Fs(e,t);if(Vs(i,a,e,t,n),this._pointerSize&&!a.target){for(var r=[],o=this._pointerSize,s=o/2,l=new Ps(e-s,t-s,o,o),p=i.length-1;p>=0;p--){var c=i[p];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(Bs.copy(c.getBoundingRect()),c.transform&&Bs.applyTransform(c.transform),Bs.intersect(l)&&r.push(c))}if(r.length)for(var d=Math.PI/12,u=2*Math.PI,m=0;m=0;r--){var o=e[r],s=void 0;if(o!==a&&!o.ignore&&(s=Ls(o,n,i))&&(!t.topTarget&&(t.topTarget=o),s!==Ds)){t.target=o;break}}}function qs(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}Rr(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Ns.prototype[e]=function(t){var n,i,a=t.zrX,r=t.zrY,o=qs(this,a,r);if("mouseup"===e&&o||(i=(n=this.findHover(a,r)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Fo(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));function Gs(e,t,n,i){var a=t+1;if(a===n)return 1;if(i(e[a++],e[t])<0){for(;a=0;)a++;return a-t}function zs(e,t,n,i,a){for(i===t&&i++;i>>1])<0?l=r:s=r+1;var p=i-s;switch(p){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;p>0;)e[s+p]=e[s+p-1],p--}e[s]=o}}function Us(e,t,n,i,a,r){var o=0,s=0,l=1;if(r(e,t[n+a])>0){for(s=i-a;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;ls&&(l=s);var p=o;o=a-l,l=a-p}for(o++;o>>1);r(e,t[n+c])>0?o=c+1:l=c}return l}function js(e,t,n,i,a,r){var o=0,s=0,l=1;if(r(e,t[n+a])<0){for(s=a+1;ls&&(l=s);var p=o;o=a-l,l=a-p}else{for(s=i-a;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o>>1);r(e,t[n+c])<0?l=c:o=c+1}return l}function Hs(e,t){var n,i,a=7,r=0,o=[];function s(s){var l=n[s],p=i[s],c=n[s+1],d=i[s+1];i[s]=p+d,s===r-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),r--;var u=js(e[c],e,l,p,0,t);l+=u,0!==(p-=u)&&0!==(d=Us(e[l+p-1],e,c,d,d-1,t))&&(p<=d?function(n,i,r,s){var l=0;for(l=0;l=7||m>=7);if(h)break;g<0&&(g=0),g+=2}if((a=g)<1&&(a=1),1===i){for(l=0;l=0;l--)e[m+l]=e[u+l];return void(e[d]=o[c])}var h=a;for(;;){var g=0,f=0,y=!1;do{if(t(o[c],e[p])<0){if(e[d--]=e[p--],g++,f=0,0==--i){y=!0;break}}else if(e[d--]=o[c--],f++,g=0,1==--s){y=!0;break}}while((g|f)=0;l--)e[m+l]=e[u+l];if(0===i){y=!0;break}}if(e[d--]=o[c--],1==--s){y=!0;break}if(0!==(f=s-Us(e[p],o,0,s,s-1,t))){for(s-=f,m=(d-=f)+1,u=(c-=f)+1,l=0;l=7||f>=7);if(y)break;h<0&&(h=0),h+=2}(a=h)<1&&(a=1);if(1===s){for(m=(d-=i)+1,u=(p-=i)+1,l=i-1;l>=0;l--)e[m+l]=e[u+l];e[d]=o[c]}else{if(0===s)throw new Error;for(u=d-(s-1),l=0;l1;){var e=r-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;s(e)}},forceMergeRuns:function(){for(;r>1;){var e=r-2;e>0&&i[e-1]=32;)t|=1&e,e>>=1;return e+t}(a);do{if((r=Gs(e,n,i,t))s&&(l=s),zs(e,n,n+l,n+r,t),r=l}o.pushRun(n,r),o.mergeRuns(),a-=r,n+=r}while(0!==a);o.forceMergeRuns()}}}var $s=!1;function Ks(){$s||($s=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Ys(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Xs=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Ys}return e.prototype.traverse=function(e,t){for(var n=0;n0&&(p.__clipPaths=[]),isNaN(p.z)&&(Ks(),p.z=0),isNaN(p.z2)&&(Ks(),p.z2=0),isNaN(p.zlevel)&&(Ks(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,t,n);var u=e.getTextContent();u&&this._updateAndAddDisplayable(u,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),Zs=rr.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},Qs={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Qs.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*Qs.bounceIn(2*e):.5*Qs.bounceOut(2*e-1)+.5}},Js=Math.pow,el=Math.sqrt,tl=1e-8,nl=1e-4,il=el(3),al=1/3,rl=Co(),ol=Co(),sl=Co();function ll(e){return e>-1e-8&&etl||e<-1e-8}function cl(e,t,n,i,a){var r=1-a;return r*r*(r*e+3*a*t)+a*a*(a*i+3*r*n)}function dl(e,t,n,i,a){var r=1-a;return 3*(((t-e)*r+2*(n-t)*a)*r+(i-n)*a*a)}function ul(e,t,n,i,a,r){var o=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),p=e-a,c=s*s-3*o*l,d=s*l-9*o*p,u=l*l-3*s*p,m=0;if(ll(c)&&ll(d)){if(ll(s))r[0]=0;else(_=-l/s)>=0&&_<=1&&(r[m++]=_)}else{var h=d*d-4*c*u;if(ll(h)){var g=d/c,f=-g/2;(_=-s/o+g)>=0&&_<=1&&(r[m++]=_),f>=0&&f<=1&&(r[m++]=f)}else if(h>0){var y=el(h),v=c*s+1.5*o*(-d+y),x=c*s+1.5*o*(-d-y);(_=(-s-((v=v<0?-Js(-v,al):Js(v,al))+(x=x<0?-Js(-x,al):Js(x,al))))/(3*o))>=0&&_<=1&&(r[m++]=_)}else{var b=(2*c*s-3*o*d)/(2*el(c*c*c)),w=Math.acos(b)/3,S=el(c),C=Math.cos(w),_=(-s-2*S*C)/(3*o),T=(f=(-s+S*(C+il*Math.sin(w)))/(3*o),(-s+S*(C-il*Math.sin(w)))/(3*o));_>=0&&_<=1&&(r[m++]=_),f>=0&&f<=1&&(r[m++]=f),T>=0&&T<=1&&(r[m++]=T)}}return m}function ml(e,t,n,i,a){var r=6*n-12*t+6*e,o=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(ll(o)){if(pl(r))(c=-s/r)>=0&&c<=1&&(a[l++]=c)}else{var p=r*r-4*o*s;if(ll(p))a[0]=-r/(2*o);else if(p>0){var c,d=el(p),u=(-r-d)/(2*o);(c=(-r+d)/(2*o))>=0&&c<=1&&(a[l++]=c),u>=0&&u<=1&&(a[l++]=u)}}return l}function hl(e,t,n,i,a,r){var o=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,p=(s-o)*a+o,c=(l-s)*a+s,d=(c-p)*a+p;r[0]=e,r[1]=o,r[2]=p,r[3]=d,r[4]=d,r[5]=c,r[6]=l,r[7]=i}function gl(e,t,n,i,a,r,o,s,l,p,c){var d,u,m,h,g,f=.005,y=1/0;rl[0]=l,rl[1]=p;for(var v=0;v<1;v+=.05)ol[0]=cl(e,n,a,o,v),ol[1]=cl(t,i,r,s,v),(h=Bo(rl,ol))=0&&h=0&&f=1?1:ul(0,i,r,1,e,s)&&cl(0,a,o,1,s[0])}}}var Tl=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||wo,this.ondestroy=e.ondestroy||wo,this.onrestart=e.onrestart||wo,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),!this._paused){var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var r=this.easingFunc,o=r?r(a):a;if(this.onframe(o),1===a){if(!this.loop)return!0;var s=i%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=t},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=jr(e)?e:Qs[e]||_l(e)},e}(),Il=function(e){this.value=e},El=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Il(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Ml=function(){function e(e){this._list=new El,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,a=null;if(null==i[e]){var r=n.len(),o=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],a=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Il(t),o.key=e,n.insertEntry(o),i[e]=o}return a},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),kl={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Pl(e){return(e=Math.round(e))<0?0:e>255?255:e}function Dl(e){return e<0?0:e>1?1:e}function Ol(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Pl(parseFloat(t)/100*255):Pl(parseInt(t,10))}function Al(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Dl(parseFloat(t)/100):Dl(parseFloat(t))}function Fl(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function Rl(e,t,n){return e+(t-e)*n}function Bl(e,t,n,i,a){return e[0]=t,e[1]=n,e[2]=i,e[3]=a,e}function Nl(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Ll=new Ml(20),Vl=null;function ql(e,t){Vl&&Nl(Vl,t),Vl=Ll.put(e,Vl||t.slice())}function Gl(e,t){if(e){t=t||[];var n=Ll.get(e);if(n)return Nl(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in kl)return Nl(t,kl[i]),ql(e,t),t;var a,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(a=parseInt(i.slice(1,4),16))>=0&&a<=4095?(Bl(t,(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,5===r?parseInt(i.slice(4),16)/15:1),ql(e,t),t):void Bl(t,0,0,0,1):7===r||9===r?(a=parseInt(i.slice(1,7),16))>=0&&a<=16777215?(Bl(t,(16711680&a)>>16,(65280&a)>>8,255&a,9===r?parseInt(i.slice(7),16)/255:1),ql(e,t),t):void Bl(t,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===r){var l=i.substr(0,o),p=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(4!==p.length)return 3===p.length?Bl(t,+p[0],+p[1],+p[2],1):Bl(t,0,0,0,1);c=Al(p.pop());case"rgb":return p.length>=3?(Bl(t,Ol(p[0]),Ol(p[1]),Ol(p[2]),3===p.length?c:Al(p[3])),ql(e,t),t):void Bl(t,0,0,0,1);case"hsla":return 4!==p.length?void Bl(t,0,0,0,1):(p[3]=Al(p[3]),zl(p,t),ql(e,t),t);case"hsl":return 3!==p.length?void Bl(t,0,0,0,1):(zl(p,t),ql(e,t),t);default:return}}Bl(t,0,0,0,1)}}function zl(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=Al(e[1]),a=Al(e[2]),r=a<=.5?a*(i+1):a+i-a*i,o=2*a-r;return Bl(t=t||[],Pl(255*Fl(o,r,n+1/3)),Pl(255*Fl(o,r,n)),Pl(255*Fl(o,r,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Ul(e,t){var n=Gl(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return Kl(n,4===n.length?"rgba":"rgb")}}function jl(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),a=Math.floor(i),r=Math.ceil(i),o=t[a],s=t[r],l=i-a;return n[0]=Pl(Rl(o[0],s[0],l)),n[1]=Pl(Rl(o[1],s[1],l)),n[2]=Pl(Rl(o[2],s[2],l)),n[3]=Dl(Rl(o[3],s[3],l)),n}}function Hl(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),a=Math.floor(i),r=Math.ceil(i),o=Gl(t[a]),s=Gl(t[r]),l=i-a,p=Kl([Pl(Rl(o[0],s[0],l)),Pl(Rl(o[1],s[1],l)),Pl(Rl(o[2],s[2],l)),Dl(Rl(o[3],s[3],l))],"rgba");return n?{color:p,leftIndex:a,rightIndex:r,value:i}:p}}function Wl(e,t,n,i){var a=Gl(e);if(e)return a=function(e){if(e){var t,n,i=e[0]/255,a=e[1]/255,r=e[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o,p=(s+o)/2;if(0===l)t=0,n=0;else{n=p<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,d=((s-a)/6+l/2)/l,u=((s-r)/6+l/2)/l;i===s?t=u-d:a===s?t=1/3+c-u:r===s&&(t=2/3+d-c),t<0&&(t+=1),t>1&&(t-=1)}var m=[360*t,n,p];return null!=e[3]&&m.push(e[3]),m}}(a),null!=t&&(a[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(a[1]=Al(n)),null!=i&&(a[2]=Al(i)),Kl(zl(a),"rgba")}function $l(e,t){var n=Gl(e);if(n&&null!=t)return n[3]=Dl(t),Kl(n,"rgba")}function Kl(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function Yl(e,t){var n=Gl(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var Xl=new Ml(100);function Zl(e){if(Hr(e)){var t=Xl.get(e);return t||(t=Ul(e,-.1),Xl.put(e,t)),t}if(Qr(e)){var n=kr({},e);return n.colorStops=Br(e.colorStops,(function(e){return{offset:e.offset,color:Ul(e.color,-.1)}})),n}return e}var Ql=Math.round;function Jl(e){var t;if(e&&"transparent"!==e){if("string"==typeof e&&e.indexOf("rgba")>-1){var n=Gl(e);n&&(e="rgb("+n[0]+","+n[1]+","+n[2]+")",t=n[3])}}else e="none";return{color:e,opacity:null==t?1:t}}var ep=1e-4;function tp(e){return e-1e-4}function np(e){return Ql(1e3*e)/1e3}function ip(e){return Ql(1e4*e)/1e4}var ap={left:"start",right:"end",center:"middle",middle:"middle"};function rp(e){return e&&!!e.image}function op(e){return rp(e)||function(e){return e&&!!e.svgElement}(e)}function sp(e){return"linear"===e.type}function lp(e){return"radial"===e.type}function pp(e){return e&&("linear"===e.type||"radial"===e.type)}function cp(e){return"url(#"+e+")"}function dp(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function up(e){var t=e.x||0,n=e.y||0,i=(e.rotation||0)*So,a=io(e.scaleX,1),r=io(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||n)&&l.push("translate("+t+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===a&&1===r||l.push("scale("+a+","+r+")"),(o||s)&&l.push("skew("+Ql(o*So)+"deg, "+Ql(s*So)+"deg)"),l.join(" ")}var mp=rr.hasGlobalWindow&&jr(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:"undefined"!=typeof Buffer?function(e){return Buffer.from(e).toString("base64")}:function(e){return null},hp=Array.prototype.slice;function gp(e,t,n){return(t-e)*n+e}function fp(e,t,n,i){for(var a=t.length,r=0;ri?t:e,r=Math.min(n,i),o=a[r-1]||{color:[0,0,0,0],offset:0},s=r;so)i.length=o;else for(var s=r;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,a=i.length,r=!1,o=6,s=t;if(Fr(t)){var l=function(e){return Fr(e&&e[0])?2:1}(t);o=l,(1===l&&!$r(t[0])||2===l&&!$r(t[0][0]))&&(r=!0)}else if($r(t)&&!to(t))o=0;else if(Hr(t))if(isNaN(+t)){var p=Gl(t);p&&(s=p,o=3)}else o=0;else if(Qr(t)){var c=kr({},s);c.colorStops=Br(t.colorStops,(function(e){return{offset:e.offset,color:Gl(e.color)}})),sp(t)?o=4:lp(t)&&(o=5),s=c}0===a?this.valType=o:o===this.valType&&6!==o||(r=!0),this.discrete=this.discrete||r;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=jr(n)?n:Qs[n]||_l(n)),i.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort((function(e,t){return e.time-t.time}));for(var i=this.valType,a=n.length,r=n[a-1],o=this.discrete,s=_p(i),l=Cp(i),p=0;p=0&&!(l[n].percent<=t);n--);n=m(n,p-2)}else{for(n=u;nt);n++);n=m(n-1,p-2)}a=l[n+1],i=l[n]}if(i&&a){this._lastFr=n,this._lastFrP=t;var h=a.percent-i.percent,g=0===h?1:m((t-i.percent)/h,1);a.easingFunc&&(g=a.easingFunc(g));var f=r?this._additiveValue:d?Tp:e[c];if(!_p(s)&&!d||f||(f=this._additiveValue=[]),this.discrete)e[c]=g<1?i.rawValue:a.rawValue;else if(_p(s))1===s?fp(f,i[o],a[o],g):function(e,t,n,i){for(var a=t.length,r=a&&t[0].length,o=0;o0&&s.addKeyframe(0,wp(l),i),this._trackKeys.push(o)}s.addKeyframe(e,wp(t[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,a=0;a1){var o=r.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function Mp(){return(new Date).getTime()}var kp,Pp,Dp=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return ze(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Mp()-this._pausedTime,n=t-this._time,i=this._head;i;){var a=i.next;i.step(t,n)?(i.ondestroy(),this.removeClip(i),i=a):i=a}this._time=t,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,Zs((function t(){e._running&&(Zs(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=Mp(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Mp(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Mp()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Ep(e,t.loop);return this.addAnimator(n),n},t}(Uo),Op=rr.domSupported,Ap=(Pp={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:kp=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Br(kp,(function(e){var t=e.replace("mouse","pointer");return Pp.hasOwnProperty(t)?t:e}))}),Fp=["mousemove","mouseup"],Rp=["pointermove","pointerup"],Bp=!1;function Np(e){var t=e.pointerType;return"pen"===t||"touch"===t}function Lp(e){e&&(e.zrByTouch=!0)}function Vp(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var qp=function(e,t){this.stopPropagation=wo,this.stopImmediatePropagation=wo,this.preventDefault=wo,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},Gp={mousedown:function(e){e=os(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=os(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=os(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){Vp(this,(e=os(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){Bp=!0,e=os(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){Bp||(e=os(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){Lp(e=os(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Gp.mousemove.call(this,e),Gp.mousedown.call(this,e)},touchmove:function(e){Lp(e=os(this.dom,e)),this.handler.processGesture(e,"change"),Gp.mousemove.call(this,e)},touchend:function(e){Lp(e=os(this.dom,e)),this.handler.processGesture(e,"end"),Gp.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<300&&Gp.click.call(this,e)},pointerdown:function(e){Gp.mousedown.call(this,e)},pointermove:function(e){Np(e)||Gp.mousemove.call(this,e)},pointerup:function(e){Gp.mouseup.call(this,e)},pointerout:function(e){Np(e)||Gp.mouseout.call(this,e)}};Rr(["click","dblclick","contextmenu"],(function(e){Gp[e]=function(t){t=os(this.dom,t),this.trigger(e,t)}}));var zp={pointermove:function(e){Np(e)||zp.mousemove.call(this,e)},pointerup:function(e){zp.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Up(e,t){var n=t.domHandlers;rr.pointerEventsSupported?Rr(Ap.pointer,(function(i){Hp(t,i,(function(t){n[i].call(e,t)}))})):(rr.touchEventsSupported&&Rr(Ap.touch,(function(i){Hp(t,i,(function(a){n[i].call(e,a),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),Rr(Ap.mouse,(function(i){Hp(t,i,(function(a){a=rs(a),t.touching||n[i].call(e,a)}))})))}function jp(e,t){function n(n){Hp(t,n,(function(i){i=rs(i),Vp(e,i.target)||(i=function(e,t){return os(e.dom,new qp(e,t),!0)}(e,i),t.domHandlers[n].call(e,i))}),{capture:!0})}rr.pointerEventsSupported?Rr(Rp,n):rr.touchEventsSupported||Rr(Fp,n)}function Hp(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,ss(e.domTarget,t,n,i)}function Wp(e){var t,n,i,a,r=e.mounted;for(var o in r)r.hasOwnProperty(o)&&(t=e.domTarget,n=o,i=r[o],a=e.listenerOpts[o],t.removeEventListener(n,i,a));e.mounted={}}var $p=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},Kp=function(e){function t(t,n){var i=e.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=n,i._localHandlerScope=new $p(t,Gp),Op&&(i._globalHandlerScope=new $p(document,zp)),Up(i,i._localHandlerScope),i}return ze(t,e),t.prototype.dispose=function(){Wp(this._localHandlerScope),Op&&Wp(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Op&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?jp(this,t):Wp(t)}},t}(Uo),Yp=1;rr.hasGlobalWindow&&(Yp=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Xp=Yp,Zp="#333",Qp="#ccc",Jp=ms,ec=5e-5;function tc(e){return e>ec||e<-5e-5}var nc=[],ic=[],ac=[1,0,0,1,0,0],rc=Math.abs,oc=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return tc(this.rotation)||tc(this.x)||tc(this.y)||tc(this.scaleX-1)||tc(this.scaleY-1)||tc(this.skewX)||tc(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n=n||[1,0,0,1,0,0],t?this.getLocalTransform(n):Jp(n),e&&(t?gs(n,e,n):hs(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(Jp(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(nc);var n=nc[0]<0?-1:1,i=nc[1]<0?-1:1,a=((nc[0]-n)*t+n)/nc[0]||0,r=((nc[1]-i)*t+i)/nc[1]||0;e[0]*=a,e[1]*=a,e[2]*=r,e[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],xs(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||[1,0,0,1,0,0],gs(ic,e.invTransform,t),t=ic);var n=this.originX,i=this.originY;(n||i)&&(ac[4]=n,ac[5]=i,gs(ic,t,ac),ic[4]-=n,ic[5]-=i,t=ic),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&Lo(n,n,i),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&Lo(n,n,i),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&rc(e[0]-1)>1e-10&&rc(e[3]-1)>1e-10?Math.sqrt(rc(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){lc(this,e)},e.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,r=e.scaleY,o=e.anchorX,s=e.anchorY,l=e.rotation||0,p=e.x,c=e.y,d=e.skewX?Math.tan(e.skewX):0,u=e.skewY?Math.tan(-e.skewY):0;if(n||i||o||s){var m=n+o,h=i+s;t[4]=-m*a-d*h*r,t[5]=-h*r-u*m*a}else t[4]=t[5]=0;return t[0]=a,t[3]=r,t[1]=u*a,t[2]=d*r,l&&ys(t,t,l),t[4]+=n+p,t[5]+=i+c,t},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),sc=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function lc(e,t){for(var n=0;n=0?parseFloat(e)/100*t:parseFloat(e):e}function yc(e,t,n){var i=t.position||"inside",a=null!=t.distance?t.distance:5,r=n.height,o=n.width,s=r/2,l=n.x,p=n.y,c="left",d="top";if(i instanceof Array)l+=fc(i[0],n.width),p+=fc(i[1],n.height),c=null,d=null;else switch(i){case"left":l-=a,p+=s,c="right",d="middle";break;case"right":l+=a+o,p+=s,d="middle";break;case"top":l+=o/2,p-=a,c="center",d="bottom";break;case"bottom":l+=o/2,p+=r+a,c="center";break;case"inside":l+=o/2,p+=s,c="center",d="middle";break;case"insideLeft":l+=a,p+=s,d="middle";break;case"insideRight":l+=o-a,p+=s,c="right",d="middle";break;case"insideTop":l+=o/2,p+=a,c="center";break;case"insideBottom":l+=o/2,p+=r-a,c="center",d="bottom";break;case"insideTopLeft":l+=a,p+=a;break;case"insideTopRight":l+=o-a,p+=a,c="right";break;case"insideBottomLeft":l+=a,p+=r-a,d="bottom";break;case"insideBottomRight":l+=o-a,p+=r-a,c="right",d="bottom"}return(e=e||{}).x=l,e.y=p,e.align=c,e.verticalAlign=d,e}var vc="__zr_normal__",xc=sc.concat(["ignore"]),bc=Nr(sc,(function(e,t){return e[t]=!0,e}),{ignore:!1}),wc={},Sc=new Ps(0,0,0,0),Cc=function(){function e(e){this.id=_r(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=t.innerTransformable,r=void 0,o=void 0,s=!1;a.parent=i?this:null;var l=!1;if(a.copyTransform(t),null!=n.position){var p=Sc;n.layoutRect?p.copy(n.layoutRect):p.copy(this.getBoundingRect()),i||p.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(wc,n,p):yc(wc,n,p),a.x=wc.x,a.y=wc.y,r=wc.align,o=wc.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var d=void 0,u=void 0;"center"===c?(d=.5*p.width,u=.5*p.height):(d=fc(c[0],p.width),u=fc(c[1],p.height)),l=!0,a.originX=-a.x+d+(i?0:p.x),a.originY=-a.y+u+(i?0:p.y)}}null!=n.rotation&&(a.rotation=n.rotation);var m=n.offset;m&&(a.x+=m[0],a.y+=m[1],l||(a.originX=-m[0],a.originY=-m[1]));var h=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),f=void 0,y=void 0,v=void 0;h&&this.canBeInsideText()?(f=n.insideFill,y=n.insideStroke,null!=f&&"auto"!==f||(f=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(f),v=!0)):(f=n.outsideFill,y=n.outsideStroke,null!=f&&"auto"!==f||(f=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(f),v=!0)),(f=f||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&r===g.align&&o===g.verticalAlign||(s=!0,g.fill=f,g.stroke=y,g.autoStroke=v,g.align=r,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Qp:Zp},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&Gl(t);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(a?0:255)*(1-i);return n[3]=1,Kl(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},kr(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(Kr(e))for(var n=qr(e),i=0;i0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(vc,!1,e)},e.prototype.useState=function(e,t,n,i){var a=e===vc;if(this.hasState()||!a){var r=this.currentStates,o=this.stateTransition;if(!(Dr(r,e)>=0)||!t&&1!==r.length){var s;if(this.stateProxy&&!a&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||a){a||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&o&&o.duration>0,o);var p=this._textContent,c=this._textGuide;return p&&p.useState(e,t,n,l),c&&c.useState(e,t,n,l),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}Tr("State "+e+" not exists.")}}},e.prototype.useStates=function(e,t,n){if(e.length){var i=[],a=this.currentStates,r=e.length,o=r===a.length;if(o)for(var s=0;s0,m);var h=this._textContent,g=this._textGuide;h&&h.useStates(e,t,d),g&&g.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),a=Dr(i,e),r=Dr(i,t)>=0;a>=0?r?i.splice(a,1):i[a]=t:n&&!r&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,a=[],r=0;r0&&n.during&&r[0].during((function(e,t){n.during(t)}));for(var u=0;u0||a.force&&!o.length){var S,C=void 0,_=void 0,T=void 0;if(s){_={},u&&(C={});for(b=0;b=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=Dr(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var a=this.__zr;a&&i.removeSelfFromZr(a),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=Dr(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(e<=a)return o;if(e>=r)return s}else{if(e>=a)return o;if(e<=r)return s}else{if(e===a)return o;if(e===r)return s}return(e-a)/l*p+o}function Vc(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return Hr(e)?(n=e,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n}function qc(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function Gc(e){return e.sort((function(e,t){return e-t})),e}function zc(e){if(e=+e,isNaN(e))return 0;if(e>1e-14)for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n;return Uc(e)}function Uc(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),i=n>0?+t.slice(n+1):0,a=n>0?n:t.length,r=t.indexOf("."),o=r<0?0:a-1-r;return Math.max(0,o-i)}function jc(e,t){var n=Math.log,i=Math.LN10,a=Math.floor(n(e[1]-e[0])/i),r=Math.round(n(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-a+r,0),20);return isFinite(o)?o:20}function Hc(e,t){var n=Nr(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return[];for(var i=Math.pow(10,t),a=Br(e,(function(e){return(isNaN(e)?0:e)/n*i*100})),r=100*i,o=Br(a,(function(e){return Math.floor(e)})),s=Nr(o,(function(e,t){return e+t}),0),l=Br(a,(function(e,t){return e-o[t]}));sp&&(p=l[d],c=d);++o[c],l[c]=0,++s}return Br(o,(function(e){return e/i}))}function Wc(e,t){var n=Math.max(zc(e),zc(t)),i=e+t;return n>20?i:qc(i,n)}function $c(e){var t=2*Math.PI;return(e%t+t)%t}function Kc(e){return e>-1e-4&&e=10&&t++,t}function Jc(e,t){var n=Qc(e),i=Math.pow(10,n),a=e/i;return e=(t?a<1.5?1:a<2.5?2:a<4?3:a<7?5:10:a<1?1:a<2?2:a<3?3:a<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function ed(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i=0||a&&Dr(a,s)<0)){var l=n.getShallow(s,t);null!=l&&(r[e[o][0]]=l)}}return r}}var Ud=zd([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),jd=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return Ud(this,e,t)},e}(),Hd=new Ml(50);function Wd(e){if("string"==typeof e){var t=Hd.get(e);return t&&t.image}return e}function $d(e,t,n,i,a){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var r=Hd.get(e),o={hostEl:n,cb:i,cbPayload:a};return r?!Yd(t=r.image)&&r.pending.push(o):((t=dr.loadImage(e,Kd,Kd)).__zrImageSrc=e,Hd.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}return t}function Kd(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var p=cc(n,t);return p>s&&(n="",p=0),s=e-p,a.ellipsis=n,a.ellipsisWidth=p,a.contentWidth=s,a.containerWidth=e,a}function Jd(e,t){var n=t.containerWidth,i=t.font,a=t.contentWidth;if(!n)return"";var r=cc(e,i);if(r<=n)return e;for(var o=0;;o++){if(r<=a||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?eu(e,a,t.ascCharWidth,t.cnCharWidth):r>0?Math.floor(e.length*a/r):0;r=cc(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}function eu(e,t,n,i){for(var a=0,r=0,o=e.length;r0&&h+i.accumWidth>i.width&&(r=t.split("\n"),d=!0),i.accumWidth=h}else{var g=su(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+m,o=g.linesWidths,r=g.lines}}else r=t.split("\n");for(var f=0;f=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}(e)||!!ru[e]}function su(e,t,n,i,a){for(var r=[],o=[],s="",l="",p=0,c=0,d=0;dn:a+c+m>n)?c?(s||l)&&(h?(s||(s=l,l="",c=p=0),r.push(s),o.push(c-p),l+=u,s="",c=p+=m):(l&&(s+=l,l="",p=0),r.push(s),o.push(c),s=u,c=m)):h?(r.push(l),o.push(p),l=u,p=m):(r.push(u),o.push(m)):(c+=m,h?(l+=u,p+=m):(l&&(s+=l,l="",p=0),s+=u))}else l&&(s+=l,c+=p),r.push(s),o.push(c),s="",l="",p=0,c=0}return r.length||s||(s=e,l="",p=0),l&&(s+=l),s&&(r.push(s),o.push(c)),1===r.length&&(c+=a),{accumWidth:c,lines:r,linesWidths:o}}var lu="__zr_style_"+Math.round(10*Math.random()),pu={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},cu={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};pu[lu]=!0;var du=["z","z2","invisible"],uu=["invisible"],mu=function(e){function t(t){return e.call(this,t)||this}var n;return ze(t,e),t.prototype._init=function(t){for(var n=qr(t),i=0;i1e-4)return s[0]=e-n,s[1]=t-i,l[0]=e+n,void(l[1]=t+i);if(wu[0]=xu(a)*n+e,wu[1]=vu(a)*i+t,Su[0]=xu(r)*n+e,Su[1]=vu(r)*i+t,p(s,wu,Su),c(l,wu,Su),(a%=bu)<0&&(a+=bu),(r%=bu)<0&&(r+=bu),a>r&&!o?r+=bu:aa&&(Cu[0]=xu(m)*n+e,Cu[1]=vu(m)*i+t,p(s,Cu,s),c(l,Cu,l))}var Du={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Ou=[],Au=[],Fu=[],Ru=[],Bu=[],Nu=[],Lu=Math.min,Vu=Math.max,qu=Math.cos,Gu=Math.sin,zu=Math.abs,Uu=Math.PI,ju=2*Uu,Hu="undefined"!=typeof Float32Array,Wu=[];function $u(e){return Math.round(e/Uu*1e8)/1e8%2*Uu}function Ku(e,t){var n=$u(e[0]);n<0&&(n+=ju);var i=n-e[0],a=e[1];a+=i,!t&&a-n>=ju?a=n+ju:t&&n-a>=ju?a=n-ju:!t&&n>a?a=n+(ju-$u(n-a)):t&&n0&&(this._ux=zu(n/Xp/e)||0,this._uy=zu(n/Xp/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Du.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=zu(e-this._xi),i=zu(t-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Du.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=r)}return this},e.prototype.bezierCurveTo=function(e,t,n,i,a,r){return this._drawPendingPt(),this.addData(Du.C,e,t,n,i,a,r),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,a,r),this._xi=a,this._yi=r,this},e.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(Du.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(e,t,n,i,a,r){this._drawPendingPt(),Wu[0]=i,Wu[1]=a,Ku(Wu,r),i=Wu[0];var o=(a=Wu[1])-i;return this.addData(Du.A,e,t,n,n,i,o,0,r?0:1),this._ctx&&this._ctx.arc(e,t,n,i,a,r),this._xi=qu(a)*n+e,this._yi=Gu(a)*n+t,this},e.prototype.arcTo=function(e,t,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},e.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(Du.R,e,t,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Du.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!Hu||(this.data=new Float32Array(t));for(var n=0;np.length&&(this._expandData(),p=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){Fu[0]=Fu[1]=Bu[0]=Bu[1]=Number.MAX_VALUE,Ru[0]=Ru[1]=Nu[0]=Nu[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,a=0,r=0;for(e=0;en||zu(f)>i||d===t-1)&&(h=Math.sqrt(k*k+f*f),a=g,r=x);break;case Du.C:var y=e[d++],v=e[d++],x=(g=e[d++],e[d++]),b=e[d++],w=e[d++];h=fl(a,r,y,v,g,x,b,w,10),a=b,r=w;break;case Du.Q:h=Sl(a,r,y=e[d++],v=e[d++],g=e[d++],x=e[d++],10),a=g,r=x;break;case Du.A:var S=e[d++],C=e[d++],_=e[d++],T=e[d++],I=e[d++],E=e[d++],M=E+I;d+=1,m&&(o=qu(I)*_+S,s=Gu(I)*T+C),h=Vu(_,T)*Lu(ju,Math.abs(E)),a=qu(M)*_+S,r=Gu(M)*T+C;break;case Du.R:o=a=e[d++],s=r=e[d++],h=2*e[d++]+2*e[d++];break;case Du.Z:var k=o-a;f=s-r;h=Math.sqrt(k*k+f*f),a=o,r=s}h>=0&&(l[c++]=h,p+=h)}return this._pathLen=p,p},e.prototype.rebuildPath=function(e,t){var n,i,a,r,o,s,l,p,c,d,u=this.data,m=this._ux,h=this._uy,g=this._len,f=t<1,y=0,v=0,x=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,p=t*this._pathLen))e:for(var b=0;b0&&(e.lineTo(c,d),x=0),w){case Du.M:n=a=u[b++],i=r=u[b++],e.moveTo(a,r);break;case Du.L:o=u[b++],s=u[b++];var C=zu(o-a),_=zu(s-r);if(C>m||_>h){if(f){if(y+(K=l[v++])>p){var T=(p-y)/K;e.lineTo(a*(1-T)+o*T,r*(1-T)+s*T);break e}y+=K}e.lineTo(o,s),a=o,r=s,x=0}else{var I=C*C+_*_;I>x&&(c=o,d=s,x=I)}break;case Du.C:var E=u[b++],M=u[b++],k=u[b++],P=u[b++],D=u[b++],O=u[b++];if(f){if(y+(K=l[v++])>p){hl(a,E,k,D,T=(p-y)/K,Ou),hl(r,M,P,O,T,Au),e.bezierCurveTo(Ou[1],Au[1],Ou[2],Au[2],Ou[3],Au[3]);break e}y+=K}e.bezierCurveTo(E,M,k,P,D,O),a=D,r=O;break;case Du.Q:E=u[b++],M=u[b++],k=u[b++],P=u[b++];if(f){if(y+(K=l[v++])>p){bl(a,E,k,T=(p-y)/K,Ou),bl(r,M,P,T,Au),e.quadraticCurveTo(Ou[1],Au[1],Ou[2],Au[2]);break e}y+=K}e.quadraticCurveTo(E,M,k,P),a=k,r=P;break;case Du.A:var A=u[b++],F=u[b++],R=u[b++],B=u[b++],N=u[b++],L=u[b++],V=u[b++],q=!u[b++],G=R>B?R:B,z=zu(R-B)>.001,U=N+L,j=!1;if(f)y+(K=l[v++])>p&&(U=N+L*(p-y)/K,j=!0),y+=K;if(z&&e.ellipse?e.ellipse(A,F,R,B,V,N,U,q):e.arc(A,F,G,N,U,q),j)break e;S&&(n=qu(N)*R+A,i=Gu(N)*B+F),a=qu(U)*R+A,r=Gu(U)*B+F;break;case Du.R:n=a=u[b],i=r=u[b+1],o=u[b++],s=u[b++];var H=u[b++],W=u[b++];if(f){if(y+(K=l[v++])>p){var $=p-y;e.moveTo(o,s),e.lineTo(o+Lu($,H),s),($-=H)>0&&e.lineTo(o+H,s+Lu($,W)),($-=W)>0&&e.lineTo(o+Vu(H-$,0),s+W),($-=H)>0&&e.lineTo(o,s+Vu(W-$,0));break e}y+=K}e.rect(o,s,H,W);break;case Du.Z:if(f){var K;if(y+(K=l[v++])>p){T=(p-y)/K;e.lineTo(a*(1-T)+n*T,r*(1-T)+i*T);break e}y+=K}e.closePath(),a=n,r=i}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=Du,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Xu(e,t,n,i,a,r,o){if(0===a)return!1;var s=a,l=0;if(o>t+s&&o>i+s||oe+s&&r>n+s||rt+d&&c>i+d&&c>r+d&&c>s+d||ce+d&&p>n+d&&p>a+d&&p>o+d||pt+p&&l>i+p&&l>r+p||le+p&&s>n+p&&s>a+p||sn||c+pa&&(a+=tm);var u=Math.atan2(l,s);return u<0&&(u+=tm),u>=i&&u<=a||u+tm>=i&&u+tm<=a}function im(e,t,n,i,a,r){if(r>t&&r>i||ra?s:0}var am=Yu.CMD,rm=2*Math.PI;var om=[-1,-1,-1],sm=[-1,-1];function lm(e,t,n,i,a,r,o,s,l,p){if(p>t&&p>i&&p>r&&p>s||p1&&(c=void 0,c=sm[0],sm[0]=sm[1],sm[1]=c),h=cl(t,i,r,s,sm[0]),m>1&&(g=cl(t,i,r,s,sm[1]))),2===m?yt&&s>i&&s>r||s=0&&c<=1&&(a[l++]=c);else{var p=o*o-4*r*s;if(ll(p))(c=-o/(2*r))>=0&&c<=1&&(a[l++]=c);else if(p>0){var c,d=el(p),u=(-o-d)/(2*r);(c=(-o+d)/(2*r))>=0&&c<=1&&(a[l++]=c),u>=0&&u<=1&&(a[l++]=u)}}return l}(t,i,r,s,om);if(0===l)return 0;var p=xl(t,i,r);if(p>=0&&p<=1){for(var c=0,d=yl(t,i,r,p),u=0;un||s<-n)return 0;var l=Math.sqrt(n*n-s*s);om[0]=-l,om[1]=l;var p=Math.abs(i-a);if(p<1e-4)return 0;if(p>=rm-1e-4){i=0,a=rm;var c=r?1:-1;return o>=om[0]+e&&o<=om[1]+e?c:0}if(i>a){var d=i;i=a,a=d}i<0&&(i+=rm,a+=rm);for(var u=0,m=0;m<2;m++){var h=om[m];if(h+e>o){var g=Math.atan2(s,h);c=r?1:-1;g<0&&(g=rm+g),(g>=i&&g<=a||g+rm>=i&&g+rm<=a)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),u+=c)}}return u}function dm(e,t,n,i,a){for(var r,o,s,l,p=e.data,c=e.len(),d=0,u=0,m=0,h=0,g=0,f=0;f1&&(n||(d+=im(u,m,h,g,i,a))),v&&(h=u=p[f],g=m=p[f+1]),y){case am.M:u=h=p[f++],m=g=p[f++];break;case am.L:if(n){if(Xu(u,m,p[f],p[f+1],t,i,a))return!0}else d+=im(u,m,p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case am.C:if(n){if(Zu(u,m,p[f++],p[f++],p[f++],p[f++],p[f],p[f+1],t,i,a))return!0}else d+=lm(u,m,p[f++],p[f++],p[f++],p[f++],p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case am.Q:if(n){if(Qu(u,m,p[f++],p[f++],p[f],p[f+1],t,i,a))return!0}else d+=pm(u,m,p[f++],p[f++],p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case am.A:var x=p[f++],b=p[f++],w=p[f++],S=p[f++],C=p[f++],_=p[f++];f+=1;var T=!!(1-p[f++]);r=Math.cos(C)*w+x,o=Math.sin(C)*S+b,v?(h=r,g=o):d+=im(u,m,r,o,i,a);var I=(i-x)*S/w+x;if(n){if(nm(x,b,S,C,C+_,T,t,I,a))return!0}else d+=cm(x,b,S,C,C+_,T,I,a);u=Math.cos(C+_)*w+x,m=Math.sin(C+_)*S+b;break;case am.R:if(h=u=p[f++],g=m=p[f++],r=h+p[f++],o=g+p[f++],n){if(Xu(h,g,r,g,t,i,a)||Xu(r,g,r,o,t,i,a)||Xu(r,o,h,o,t,i,a)||Xu(h,o,h,g,t,i,a))return!0}else d+=im(r,g,r,o,i,a),d+=im(h,o,h,g,i,a);break;case am.Z:if(n){if(Xu(u,m,h,g,t,i,a))return!0}else d+=im(u,m,h,g,i,a);u=h,m=g}}return n||(s=m,l=g,Math.abs(s-l)<1e-4)||(d+=im(u,m,h,g,i,a)||0),0!==d}var um=Pr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},pu),mm={style:Pr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},cu.style)},hm=sc.concat(["invisible","culling","z","z2","zlevel","parent"]),gm=function(e){function t(t){return e.call(this,t)||this}var n;return ze(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var a=this._decalEl=this._decalEl||new t;a.buildPath===t.prototype.buildPath&&(a.buildPath=function(e){n.buildPath(e,n.shape)}),a.silent=!0;var r=a.style;for(var o in i)r[o]!==i[o]&&(r[o]=i[o]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?Zp:t>.2?"#eee":Qp}if(e)return Qp}return Zp},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(Hr(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===Yl(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Yu(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var a=this.path;(i||4&this.__dirty)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),e=a.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){r.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}o>1e-10&&(r.width+=s/o,r.height+=s/o,r.x-=s/o/2,r.y-=s/o/2)}return r}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),a=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var r=this.path;if(this.hasStroke()){var o=a.lineWidth,s=a.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),function(e,t,n,i){return dm(e,t,!0,n,i)}(r,o/s,e,t)))return!0}if(this.hasFill())return function(e,t,n){return dm(e,0,!1,t,n)}(r,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:kr(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(4&this.__dirty)},t.prototype.createStyle=function(e){return vo(um,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=kr({},this.shape))},t.prototype._applyStateObj=function(t,n,i,a,r,o){e.prototype._applyStateObj.call(this,t,n,i,a,r,o);var s,l=!(n&&a);if(n&&n.shape?r?a?s=n.shape:(s=kr({},i.shape),kr(s,n.shape)):(s=kr({},a?this.shape:i.shape),kr(s,n.shape)):l&&(s=i.shape),s)if(r){this.shape=kr({},this.shape);for(var p={},c=qr(s),d=0;d0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return vo(fm,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=uc(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(mu);ym.prototype.type="tspan";var vm=Pr({x:0,y:0},pu),xm={style:Pr({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},cu.style)};var bm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.createStyle=function(e){return vo(vm,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var i,a=(i=t.image)&&"string"!=typeof i&&i.width&&i.height?t.image:this.__image;if(!a)return 0;var r="width"===e?"height":"width",o=t[r];return null==o?a[e]:a[e]/a[r]*o},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return xm},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new Ps(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(mu);bm.prototype.type="image";var wm=Math.round;function Sm(e,t,n){if(t){var i=t.x1,a=t.x2,r=t.y1,o=t.y2;e.x1=i,e.x2=a,e.y1=r,e.y2=o;var s=n&&n.lineWidth;return s?(wm(2*i)===wm(2*a)&&(e.x1=e.x2=_m(i,s,!0)),wm(2*r)===wm(2*o)&&(e.y1=e.y2=_m(r,s,!0)),e):e}}function Cm(e,t,n){if(t){var i=t.x,a=t.y,r=t.width,o=t.height;e.x=i,e.y=a,e.width=r,e.height=o;var s=n&&n.lineWidth;return s?(e.x=_m(i,s,!0),e.y=_m(a,s,!0),e.width=Math.max(_m(i+r,s,!1)-e.x,0===r?0:1),e.height=Math.max(_m(a+o,s,!1)-e.y,0===o?0:1),e):e}}function _m(e,t,n){if(!t)return e;var i=wm(2*e);return(i+wm(t))%2==0?i/2:(i+(n?1:-1))/2}var Tm=function(){this.x=0,this.y=0,this.width=0,this.height=0},Im={},Em=function(e){function t(t){return e.call(this,t)||this}return ze(t,e),t.prototype.getDefaultShape=function(){return new Tm},t.prototype.buildPath=function(e,t){var n,i,a,r;if(this.subPixelOptimize){var o=Cm(Im,t,this.style);n=o.x,i=o.y,a=o.width,r=o.height,o.r=t.r,t=o}else n=t.x,i=t.y,a=t.width,r=t.height;t.r?function(e,t){var n,i,a,r,o,s=t.x,l=t.y,p=t.width,c=t.height,d=t.r;p<0&&(s+=p,p=-p),c<0&&(l+=c,c=-c),"number"==typeof d?n=i=a=r=d:d instanceof Array?1===d.length?n=i=a=r=d[0]:2===d.length?(n=a=d[0],i=r=d[1]):3===d.length?(n=d[0],i=r=d[1],a=d[2]):(n=d[0],i=d[1],a=d[2],r=d[3]):n=i=a=r=0,n+i>p&&(n*=p/(o=n+i),i*=p/o),a+r>p&&(a*=p/(o=a+r),r*=p/o),i+a>c&&(i*=c/(o=i+a),a*=c/o),n+r>c&&(n*=c/(o=n+r),r*=c/o),e.moveTo(s+n,l),e.lineTo(s+p-i,l),0!==i&&e.arc(s+p-i,l+i,i,-Math.PI/2,0),e.lineTo(s+p,l+c-a),0!==a&&e.arc(s+p-a,l+c-a,a,0,Math.PI/2),e.lineTo(s+r,l+c),0!==r&&e.arc(s+r,l+c-r,r,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(e,t):e.rect(n,i,a,r)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(gm);Em.prototype.type="rect";var Mm={fill:"#000"},km={style:Pr({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},cu.style)},Pm=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Mm,n.attr(t),n}return ze(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;tm&&c){var h=Math.floor(m/l);n=n.slice(0,h)}if(e&&o&&null!=d)for(var g=Qd(d,r,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),f=0;f0,T=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),I=i.calculatedLineHeight,E=0;El&&au(n,e.substring(l,p),t,s),au(n,i[2],t,s,i[1]),l=Xd.lastIndex}lr){w>0?(v.tokens=v.tokens.slice(0,w),f(v,b,x),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break e}var E=S.width,M=null==E||"auto"===E;if("string"==typeof E&&"%"===E.charAt(E.length-1))O.percentWidth=E,c.push(O),O.contentWidth=cc(O.text,T);else{if(M){var k=S.backgroundColor,P=k&&k.image;P&&Yd(P=Wd(P))&&(O.width=Math.max(O.width,P.width*I/P.height))}var D=h&&null!=a?a-b:null;null!=D&&D=0&&"right"===(E=x[I]).align;)this._placeToken(E,e,w,h,T,"right",f),S-=E.width,T-=E.width,I--;for(_+=(n-(_-m)-(g-T)-S)/2;C<=I;)E=x[C],this._placeToken(E,e,w,h,_+E.width/2,"center",f),_+=E.width,C++;h+=w}},t.prototype._placeToken=function(e,t,n,i,a,r,o){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,p=i+n/2;"top"===l?p=i+e.height/2:"bottom"===l&&(p=i+n-e.height/2),!e.isLineHolder&&zm(s)&&this._renderBackground(s,t,"right"===r?a-e.width:"center"===r?a-e.width/2:a,p-e.height/2,e.width,e.height);var c=!!s.backgroundColor,d=e.textPadding;d&&(a=qm(a,r,d),p-=e.height/2-d[0]-e.innerHeight/2);var u=this._getOrCreateChild(ym),m=u.createStyle();u.useStyle(m);var h=this._defaultStyle,g=!1,f=0,y=Vm("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,h.fill)),v=Lm("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||o||h.autoStroke&&!g?null:(f=2,h.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;m.text=e.text,m.x=a,m.y=p,x&&(m.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,m.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",m.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,m.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),m.textAlign=r,m.textBaseline="middle",m.font=e.font||sr,m.opacity=ao(s.opacity,t.opacity,1),Rm(m,s),v&&(m.lineWidth=ao(s.lineWidth,t.lineWidth,f),m.lineDash=io(s.lineDash,t.lineDash),m.lineDashOffset=t.lineDashOffset||0,m.stroke=v),y&&(m.fill=y);var b=e.contentWidth,w=e.contentHeight;u.setBoundingRect(new Ps(mc(m.x,b,m.textAlign),hc(m.y,w,m.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,i,a,r){var o,s,l,p=e.backgroundColor,c=e.borderWidth,d=e.borderColor,u=p&&p.image,m=p&&!u,h=e.borderRadius,g=this;if(m||e.lineHeight||c&&d){(o=this._getOrCreateChild(Em)).useStyle(o.createStyle()),o.style.fill=null;var f=o.shape;f.x=n,f.y=i,f.width=a,f.height=r,f.r=h,o.dirtyShape()}if(m)(l=o.style).fill=p||null,l.fillOpacity=io(e.fillOpacity,1);else if(u){(s=this._getOrCreateChild(bm)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=p.image,y.x=n,y.y=i,y.width=a,y.height=r}c&&d&&((l=o.style).lineWidth=c,l.stroke=d,l.strokeOpacity=io(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(o||s).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||"transparent",v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=ao(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";return Bm(e)&&(t=[e.fontStyle,e.fontWeight,Fm(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),t&&lo(t)||e.textFont||e.font},t}(mu),Dm={left:!0,right:1,center:1},Om={top:1,bottom:1,middle:1},Am=["fontStyle","fontWeight","fontSize","fontFamily"];function Fm(e){return"string"!=typeof e||-1===e.indexOf("px")&&-1===e.indexOf("rem")&&-1===e.indexOf("em")?isNaN(+e)?"12px":e+"px":e}function Rm(e,t){for(var n=0;n=0,r=!1;if(e instanceof gm){var o=$m(e),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(ih(s)||ih(l)){var p=(i=i||{}).style||{};"inherit"===p.fill?(r=!0,i=kr({},i),(p=kr({},p)).fill=s):!ih(p.fill)&&ih(s)?(r=!0,i=kr({},i),(p=kr({},p)).fill=Zl(s)):!ih(p.stroke)&&ih(l)&&(r||(i=kr({},i),p=kr({},p)),p.stroke=Zl(l)),i.style=p}}if(i&&null==i.z2){r||(i=kr({},i));var c=e.z2EmphasisLift;i.z2=e.z2+(null!=c?c:Zm)}return i}(this,0,t,n);if("blur"===e)return function(e,t,n){var i=Dr(e.currentStates,t)>=0,a=e.style.opacity,r=i?null:function(e,t,n,i){for(var a=e.style,r={},o=0;o0){var r={dataIndex:a,seriesIndex:e.seriesIndex};null!=i&&(r.dataType=i),t.push(r)}}))})),t}function Dh(e,t,n){Nh(e,!0),uh(e,gh),Ah(e,t,n)}function Oh(e,t,n,i){i?function(e){Nh(e,!1)}(e):Dh(e,t,n)}function Ah(e,t,n){var i=Um(e);null!=t?(i.focus=t,i.blurScope=n):i.focus&&(i.focus=null)}var Fh=["emphasis","blur","select"],Rh={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Bh(e,t,n,i){n=n||"itemStyle";for(var a=0;a1&&(o*=Wh(h),s*=Wh(h));var g=(a===r?-1:1)*Wh((o*o*(s*s)-o*o*(m*m)-s*s*(u*u))/(o*o*(m*m)+s*s*(u*u)))||0,f=g*o*m/s,y=g*-s*u/o,v=(e+n)/2+Kh(d)*f-$h(d)*y,x=(t+i)/2+$h(d)*f+Kh(d)*y,b=Qh([1,0],[(u-f)/o,(m-y)/s]),w=[(u-f)/o,(m-y)/s],S=[(-1*u-f)/o,(-1*m-y)/s],C=Qh(w,S);if(Zh(w,S)<=-1&&(C=Yh),Zh(w,S)>=1&&(C=0),C<0){var _=Math.round(C/Yh*1e6)/1e6;C=2*Yh+_%2*Yh}c.addData(p,v,x,o,s,b,C,d,r)}var eg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,tg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var ng=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.applyTransform=function(e){},t}(gm);function ig(e){return null!=e.setData}function ag(e,t){var n=function(e){var t=new Yu;if(!e)return t;var n,i=0,a=0,r=i,o=a,s=Yu.CMD,l=e.match(eg);if(!l)return t;for(var p=0;pP*P+D*D&&(_=I,T=E),{cx:_,cy:T,x0:-c,y0:-d,x1:_*(a/w-1),y1:T*(a/w-1)}}function Sg(e,t){var n,i=vg(t.r,0),a=vg(t.r0||0,0),r=i>0;if(r||a>0){if(r||(i=a,a=0),a>i){var o=i;i=a,a=o}var s=t.startAngle,l=t.endAngle;if(!isNaN(s)&&!isNaN(l)){var p=t.cx,c=t.cy,d=!!t.clockwise,u=fg(l-s),m=u>dg&&u%dg;if(m>bg&&(u=m),i>bg)if(u>dg-bg)e.moveTo(p+i*mg(s),c+i*ug(s)),e.arc(p,c,i,s,l,!d),a>bg&&(e.moveTo(p+a*mg(l),c+a*ug(l)),e.arc(p,c,a,l,s,d));else{var h=void 0,g=void 0,f=void 0,y=void 0,v=void 0,x=void 0,b=void 0,w=void 0,S=void 0,C=void 0,_=void 0,T=void 0,I=void 0,E=void 0,M=void 0,k=void 0,P=i*mg(s),D=i*ug(s),O=a*mg(l),A=a*ug(l),F=u>bg;if(F){var R=t.cornerRadius;R&&(n=function(e){var t;if(Ur(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(R),h=n[0],g=n[1],f=n[2],y=n[3]);var B=fg(i-a)/2;if(v=xg(B,f),x=xg(B,y),b=xg(B,h),w=xg(B,g),_=S=vg(v,x),T=C=vg(b,w),(S>bg||C>bg)&&(I=i*mg(l),E=i*ug(l),M=a*mg(s),k=a*ug(s),ubg){var j=xg(f,_),H=xg(y,_),W=wg(M,k,P,D,i,j,d),$=wg(I,E,O,A,i,H,d);e.moveTo(p+W.cx+W.x0,c+W.cy+W.y0),_0&&e.arc(p+W.cx,c+W.cy,j,gg(W.y0,W.x0),gg(W.y1,W.x1),!d),e.arc(p,c,i,gg(W.cy+W.y1,W.cx+W.x1),gg($.cy+$.y1,$.cx+$.x1),!d),H>0&&e.arc(p+$.cx,c+$.cy,H,gg($.y1,$.x1),gg($.y0,$.x0),!d))}else e.moveTo(p+P,c+D),e.arc(p,c,i,s,l,!d);else e.moveTo(p+P,c+D);if(a>bg&&F)if(T>bg){j=xg(h,T),W=wg(O,A,I,E,a,-(H=xg(g,T)),d),$=wg(P,D,M,k,a,-j,d);e.lineTo(p+W.cx+W.x0,c+W.cy+W.y0),T0&&e.arc(p+W.cx,c+W.cy,H,gg(W.y0,W.x0),gg(W.y1,W.x1),!d),e.arc(p,c,a,gg(W.cy+W.y1,W.cx+W.x1),gg($.cy+$.y1,$.cx+$.x1),d),j>0&&e.arc(p+$.cx,c+$.cy,j,gg($.y1,$.x1),gg($.y0,$.x0),!d))}else e.lineTo(p+O,c+A),e.arc(p,c,a,l,s,d);else e.lineTo(p+O,c+A)}else e.moveTo(p,c);e.closePath()}}}var Cg=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},_g=function(e){function t(t){return e.call(this,t)||this}return ze(t,e),t.prototype.getDefaultShape=function(){return new Cg},t.prototype.buildPath=function(e,t){Sg(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(gm);_g.prototype.type="sector";var Tg=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Ig=function(e){function t(t){return e.call(this,t)||this}return ze(t,e),t.prototype.getDefaultShape=function(){return new Tg},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,a=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,a,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,a,!0)},t}(gm);function Eg(e,t,n){var i=t.smooth,a=t.points;if(a&&a.length>=2){if(i){var r=function(e,t,n,i){var a,r,o,s,l=[],p=[],c=[],d=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var u=0,m=e.length;uWg[1]){if(o=!1,a)return o;var p=Math.abs(Wg[0]-Hg[1]),c=Math.abs(Hg[0]-Wg[1]);Math.min(p,c)>i.len()&&(p0){var d={duration:c.duration,delay:c.delay||0,easing:c.easing,done:r,force:!!r||!!o,setToFinal:!p,scope:e,during:o};l?t.animateFrom(n,d):t.animateTo(n,d)}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),r&&r()}function tf(e,t,n,i,a,r){ef("update",e,t,n,i,a,r)}function nf(e,t,n,i,a,r){ef("enter",e,t,n,i,a,r)}function af(e){if(!e.__zr)return!0;for(var t=0;tMath.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ef(e){return!e.isGroup}function Mf(e,t,n){if(e&&t){var i,a=(i={},e.traverse((function(e){Ef(e)&&e.anid&&(i[e.anid]=e)})),i);t.traverse((function(e){if(Ef(e)&&e.anid){var t=a[e.anid];if(t){var i=r(e);e.attr(r(t)),tf(e,i,n,Um(e).dataIndex)}}}))}function r(e){var t={x:e.x,y:e.y,rotation:e.rotation};return function(e){return null!=e.shape}(e)&&(t.shape=kr({},e.shape)),t}}function kf(e,t){return Br(e,(function(e){var n=e[0];n=pf(n,t.x),n=cf(n,t.x+t.width);var i=e[1];return i=pf(i,t.y),[n,i=cf(i,t.y+t.height)]}))}function Pf(e,t){var n=pf(e.x,t.x),i=cf(e.x+e.width,t.x+t.width),a=pf(e.y,t.y),r=cf(e.y+e.height,t.y+t.height);if(i>=n&&r>=a)return{x:n,y:a,width:i-n,height:r-a}}function Df(e,t,n){var i=kr({rectHover:!0},t),a=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(a.image=e.slice(8),Pr(a,n),new bm(i)):yf(e.replace("path://",""),i,n,"center")}function Of(e,t,n,i,a){for(var r=0,o=a[a.length-1];r=-1e-6)return!1;var h=e-a,g=t-r,f=Ff(h,g,p,c)/m;if(f<0||f>1)return!1;var y=Ff(h,g,d,u)/m;return!(y<0||y>1)}function Ff(e,t,n,i){return e*i-n*t}function Rf(e){var t=e.itemTooltipOption,n=e.componentModel,i=e.itemName,a=Hr(t)?{formatter:t}:t,r=n.mainType,o=n.componentIndex,s={componentType:r,name:i,$vars:["name"]};s[r+"Index"]=o;var l=e.formatterParamsExtra;l&&Rr(qr(l),(function(e){bo(s,e)||(s[e]=l[e],s.$vars.push(e))}));var p=Um(e.el);p.componentMainType=r,p.componentIndex=o,p.tooltipConfig={name:i,option:Pr({content:i,formatterParams:s},a)}}function Bf(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Nf(e,t){if(e)if(Ur(e))for(var n=0;n-1?fy:vy;function Sy(e,t){e=e.toUpperCase(),by[e]=new uy(t),xy[e]=t}function Cy(e){return by[e]}Sy(yy,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Sy(fy,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var _y=1e3,Ty=6e4,Iy=36e5,Ey=864e5,My=31536e6,ky={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Py="{yyyy}-{MM}-{dd}",Dy={year:"{yyyy}",month:"{yyyy}-{MM}",day:Py,hour:Py+" "+ky.hour,minute:Py+" "+ky.minute,second:Py+" "+ky.second,millisecond:ky.none},Oy=["year","month","day","hour","minute","second","millisecond"],Ay=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Fy(e,t){return"0000".substr(0,t-(e+="").length)+e}function Ry(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function By(e){return e===Ry(e)}function Ny(e,t,n,i){var a=Xc(e),r=a[qy(n)](),o=a[Gy(n)]()+1,s=Math.floor((o-1)/3)+1,l=a[zy(n)](),p=a["get"+(n?"UTC":"")+"Day"](),c=a[Uy(n)](),d=(c-1)%12+1,u=a[jy(n)](),m=a[Hy(n)](),h=a[Wy(n)](),g=(i instanceof uy?i:Cy(i||wy)||by[vy]).getModel("time"),f=g.get("month"),y=g.get("monthAbbr"),v=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,Fy(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,f[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,Fy(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Fy(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[p]).replace(/{ee}/g,x[p]).replace(/{e}/g,p+"").replace(/{HH}/g,Fy(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Fy(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Fy(u,2)).replace(/{m}/g,u+"").replace(/{ss}/g,Fy(m,2)).replace(/{s}/g,m+"").replace(/{SSS}/g,Fy(h,3)).replace(/{S}/g,h+"")}function Ly(e,t){var n=Xc(e),i=n[Gy(t)]()+1,a=n[zy(t)](),r=n[Uy(t)](),o=n[jy(t)](),s=n[Hy(t)](),l=0===n[Wy(t)](),p=l&&0===s,c=p&&0===o,d=c&&0===r,u=d&&1===a;return u&&1===i?"year":u?"month":d?"day":c?"hour":p?"minute":l?"second":"millisecond"}function Vy(e,t,n){var i=$r(e)?Xc(e):e;switch(t=t||Ly(e,n)){case"year":return i[qy(n)]();case"half-year":return i[Gy(n)]()>=6?1:0;case"quarter":return Math.floor((i[Gy(n)]()+1)/4);case"month":return i[Gy(n)]();case"day":return i[zy(n)]();case"half-day":return i[Uy(n)]()/24;case"hour":return i[Uy(n)]();case"minute":return i[jy(n)]();case"second":return i[Hy(n)]();case"millisecond":return i[Wy(n)]()}}function qy(e){return e?"getUTCFullYear":"getFullYear"}function Gy(e){return e?"getUTCMonth":"getMonth"}function zy(e){return e?"getUTCDate":"getDate"}function Uy(e){return e?"getUTCHours":"getHours"}function jy(e){return e?"getUTCMinutes":"getMinutes"}function Hy(e){return e?"getUTCSeconds":"getSeconds"}function Wy(e){return e?"getUTCMilliseconds":"getMilliseconds"}function $y(e){return e?"setUTCFullYear":"setFullYear"}function Ky(e){return e?"setUTCMonth":"setMonth"}function Yy(e){return e?"setUTCDate":"setDate"}function Xy(e){return e?"setUTCHours":"setHours"}function Zy(e){return e?"setUTCMinutes":"setMinutes"}function Qy(e){return e?"setUTCSeconds":"setSeconds"}function Jy(e){return e?"setUTCMilliseconds":"setMilliseconds"}function ev(e){if(!nd(e))return Hr(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function tv(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var nv=oo;function iv(e,t,n){function i(e){return e&&lo(e)?e:"-"}function a(e){return!(null==e||isNaN(e)||!isFinite(e))}var r="time"===t,o=e instanceof Date;if(r||o){var s=r?Xc(e):e;if(!isNaN(+s))return Ny(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(o)return"-"}if("ordinal"===t)return Wr(e)?i(e):$r(e)&&a(e)?e+"":"-";var l=td(e);return a(l)?ev(l):Wr(e)?i(e):"boolean"==typeof e?e+"":"-"}var av=["a","b","c","d","e","f","g"],rv=function(e,t){return"{"+e+(null==t?"":t)+"}"};function ov(e,t,n){Ur(t)||(t=[t]);var i=t.length;if(!i)return"";for(var a=t[0].$vars||[],r=0;r':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===a?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function lv(e,t){return t=t||"transparent",Hr(e)?e:Kr(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function pv(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var cv=Rr,dv=["left","right","top","bottom","width","height"],uv=[["width","left","right"],["height","top","bottom"]];function mv(e,t,n,i,a){var r=0,o=0;null==i&&(i=1/0),null==a&&(a=1/0);var s=0;t.eachChild((function(l,p){var c,d,u=l.getBoundingRect(),m=t.childAt(p+1),h=m&&m.getBoundingRect();if("horizontal"===e){var g=u.width+(h?-h.x+u.x:0);(c=r+g)>i||l.newline?(r=0,c=g,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var f=u.height+(h?-h.y+u.y:0);(d=o+f)>a||l.newline?(r+=s+n,o=0,d=f,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=r,l.y=o,l.markRedraw(),"horizontal"===e?r=c+n:o=d+n)}))}var hv=mv;zr(mv,"vertical"),zr(mv,"horizontal");function gv(e,t,n){n=nv(n||0);var i=t.width,a=t.height,r=Vc(e.left,i),o=Vc(e.top,a),s=Vc(e.right,i),l=Vc(e.bottom,a),p=Vc(e.width,i),c=Vc(e.height,a),d=n[2]+n[0],u=n[1]+n[3],m=e.aspect;switch(isNaN(p)&&(p=i-s-u-r),isNaN(c)&&(c=a-l-d-o),null!=m&&(isNaN(p)&&isNaN(c)&&(m>i/a?p=.8*i:c=.8*a),isNaN(p)&&(p=m*c),isNaN(c)&&(c=p/m)),isNaN(r)&&(r=i-s-p-u),isNaN(o)&&(o=a-l-c-d),e.left||e.right){case"center":r=i/2-p/2-n[3];break;case"right":r=i-p-u}switch(e.top||e.bottom){case"middle":case"center":o=a/2-c/2-n[0];break;case"bottom":o=a-c-d}r=r||0,o=o||0,isNaN(p)&&(p=i-u-r-(s||0)),isNaN(c)&&(c=a-d-o-(l||0));var h=new Ps(r+n[3],o+n[0],p,c);return h.margin=n,h}function fv(e,t,n,i,a,r){var o,s=!a||!a.hv||a.hv[0],l=!a||!a.hv||a.hv[1],p=a&&a.boundingMode||"all";if((r=r||e).x=e.x,r.y=e.y,!s&&!l)return!1;if("raw"===p)o="group"===e.type?new Ps(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(o=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(o=o.clone()).applyTransform(c)}var d=gv(Pr({width:o.width,height:o.height},t),n,i),u=s?d.x-o.x:0,m=l?d.y-o.y:0;return"raw"===p?(r.x=u,r.y=m):(r.x+=u,r.y+=m),r===e&&e.markRedraw(),!0}function yv(e){var t=e.layoutMode||e.constructor.layoutMode;return Kr(t)?t:t?{type:t}:null}function vv(e,t,n){var i=n&&n.ignoreSize;!Ur(i)&&(i=[i,i]);var a=o(uv[0],0),r=o(uv[1],1);function o(n,a){var r={},o=0,p={},c=0;if(cv(n,(function(t){p[t]=e[t]})),cv(n,(function(e){s(t,e)&&(r[e]=p[e]=t[e]),l(r,e)&&o++,l(p,e)&&c++})),i[a])return l(t,n[1])?p[n[2]]=null:l(t,n[2])&&(p[n[1]]=null),p;if(2!==c&&o){if(o>=2)return r;for(var d=0;d=0;o--)r=Er(r,n[o],!0);t.defaultOption=r}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",i=e+"Id";return kd(this.ecModel,e,{index:this.get(n,!0),id:this.get(i,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(uy);Nd(Sv,uy),Gd(Sv),function(e){var t={};e.registerSubTypeDefaulter=function(e,n){var i=Rd(e);t[i.main]=n},e.determineSubType=function(n,i){var a=i.type;if(!a){var r=Rd(n).main;e.hasSubTypes(n)&&t[r]&&(a=t[r](i))}return a}}(Sv),function(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,i,a,r){if(e.length){var o=function(e){var i={},a=[];return Rr(e,(function(r){var o=n(i,r),s=function(e,t){var n=[];return Rr(e,(function(e){Dr(t,e)>=0&&n.push(e)})),n}(o.originalDeps=t(r),e);o.entryCount=s.length,0===o.entryCount&&a.push(r),Rr(s,(function(e){Dr(o.predecessor,e)<0&&o.predecessor.push(e);var t=n(i,e);Dr(t.successor,e)<0&&t.successor.push(r)}))})),{graph:i,noEntryList:a}}(i),s=o.graph,l=o.noEntryList,p={};for(Rr(e,(function(e){p[e]=!0}));l.length;){var c=l.pop(),d=s[c],u=!!p[c];u&&(a.call(r,c,d.originalDeps.slice()),delete p[c]),Rr(d.successor,u?h:m)}Rr(p,(function(){var e="";throw new Error(e)}))}function m(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function h(e){p[e]=!0,m(e)}}}(Sv,(function(e){var t=[];Rr(Sv.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=Br(t,(function(e){return Rd(e).main})),"dataset"!==e&&Dr(t,"dataset")<=0&&t.unshift("dataset");return t}));var Cv="";"undefined"!=typeof navigator&&(Cv=navigator.platform||"");var _v="rgba(0, 0, 0, 0.2)",Tv={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:_v,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:_v,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:_v,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:_v,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:_v,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:_v,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Cv.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Iv=fo(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ev="original",Mv="arrayRows",kv="objectRows",Pv="keyedColumns",Dv="typedArray",Ov="unknown",Av="column",Fv="row",Rv=1,Bv=2,Nv=3,Lv=Cd();function Vv(e,t,n){var i={},a=Gv(t);if(!a||!e)return i;var r,o,s=[],l=[],p=t.ecModel,c=Lv(p).datasetMap,d=a.uid+"_"+n.seriesLayoutBy;Rr(e=e.slice(),(function(t,n){var a=Kr(t)?t:e[n]={name:t};"ordinal"===a.type&&null==r&&(r=n,o=h(a)),i[a.name]=[]}));var u=c.get(d)||c.set(d,{categoryWayDim:o,valueWayDim:0});function m(e,t,n){for(var i=0;it)return e[i];return e[n-1]}(i,o):n;if((c=c||n)&&c.length){var d=c[l];return a&&(p[a]=d),s.paletteIdx=(l+1)%c.length,d}}var Jv="\0_ec_inner";var ex=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.init=function(e,t,n,i,a,r){i=i||{},this.option=null,this._theme=new uy(i),this._locale=new uy(a),this._optionManager=r},t.prototype.setOption=function(e,t,n){var i=ix(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,ix(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var a=i.mountOption("recreate"===e);0,this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(a,t)):$v(this,a),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,t))}if(!e||"recreate"===e||"media"===e){var o=i.getMediaOption(this);o.length&&Rr(o,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,a=this._componentsCount,r=[],o=fo(),s=t&&t.replaceMergeMainTypeMap;Lv(this).datasetMap=fo(),Rr(e,(function(e,t){null!=e&&(Sv.hasClass(t)?t&&(r.push(t),o.set(t,!0)):n[t]=null==n[t]?Ir(e):Er(n[t],e,!0))})),s&&s.each((function(e,t){Sv.hasClass(t)&&!o.get(t)&&(r.push(t),o.set(t,!0))})),Sv.topologicalTravel(r,Sv.getAllClassMainTypes(),(function(t){var r=function(e,t,n){var i=jv.get(t);if(!i)return n;var a=i(e);return a?n.concat(a):n}(this,t,dd(e[t])),o=i.get(t),l=o?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",p=fd(o,r,l);(function(e,t,n){Rr(e,(function(e){var i=e.newOption;Kr(i)&&(e.keyInfo.mainType=t,e.keyInfo.subType=function(e,t,n,i){return t.type?t.type:n?n.subType:i.determineSubType(e,t)}(t,i,e.existing,n))}))})(p,t,Sv),n[t]=null,i.set(t,null),a.set(t,0);var c,d=[],u=[],m=0;Rr(p,(function(e,n){var i=e.existing,a=e.newOption;if(a){var r="series"===t,o=Sv.getClass(t,e.keyInfo.subType,!r);if(!o)return;if("tooltip"===t){if(c)return void 0;c=!0}if(i&&i.constructor===o)i.name=e.keyInfo.name,i.mergeOption(a,this),i.optionUpdated(a,!1);else{var s=kr({componentIndex:n},e.keyInfo);kr(i=new o(a,this,this,s),s),e.brandNew&&(i.__requireNewView=!0),i.init(a,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),u.push(i),m++):(d.push(void 0),u.push(void 0))}),this),n[t]=d,i.set(t,u),a.set(t,m),"series"===t&&Hv(this)}),this),this._seriesIndices||Hv(this)},t.prototype.getOption=function(){var e=Ir(this.option);return Rr(e,(function(t,n){if(Sv.hasClass(n)){for(var i=dd(t),a=i.length,r=!1,o=a-1;o>=0;o--)i[o]&&!wd(i[o])?r=!0:(i[o]=null,!r&&a--);i.length=a,e[n]=i}})),delete e[Jv],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t)for(var a=0;a=t:"max"===n?e<=t:e===t})(i[o],e,r)||(a=!1)}})),a}var dx=Rr,ux=Kr,mx=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function hx(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=mx.length;n=0;g--){var f=e[g];if(s||(u=f.data.rawIndexOf(f.stackedByDimension,d)),u>=0){var y=f.data.getByRawIndex(f.stackResultDimension,u);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&m>=0&&y>0||"samesign"===l&&m<=0&&y<0){m=Wc(m,y),h=y;break}}}return i[0]=m,i[1]=h,i}))}))}var Ax,Fx,Rx,Bx,Nx,Lx=function(e){this.data=e.data||(e.sourceFormat===Pv?{}:[]),this.sourceFormat=e.sourceFormat||Ov,this.seriesLayoutBy=e.seriesLayoutBy||Av,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;np&&(p=m)}s[0]=l,s[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};function a(e){for(var t=0;t=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""})):void 0},e.prototype.getRawValue=function(e,t){return ib(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function ob(e){var t,n;return Kr(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function sb(e){return new lb(e)}var lb=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n=this._upstream,i=e&&e.skip;if(this._dirty&&n){var a=this.context;a.data=a.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(t=this._plan(this.context));var r,o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),p=e&&e.modDataCount||0;function c(e){return!(e>=1)&&(e=1),e}o===l&&s===p||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,r=this._doReset(i)),this._modBy=l,this._modDataCount=p;var d=e&&e.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var u=this._dueIndex,m=Math.min(null!=d?this._dueIndex+d:1/0,this._dueEnd);if(!i&&(r||u1&&i>0?s:o}};return r;function o(){return t=e?null:rt},gte:function(e,t){return e>=t}},hb=function(){function e(e,t){if(!$r(t)){var n="";0,sd(n)}this._opFn=mb[e],this._rvalFloat=td(t)}return e.prototype.evaluate=function(e){return $r(e)?this._opFn(e,this._rvalFloat):this._opFn(td(e),this._rvalFloat)},e}(),gb=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=$r(e)?e:td(e),i=$r(t)?t:td(t),a=isNaN(n),r=isNaN(i);if(a&&(n=this._incomparable),r&&(i=this._incomparable),a&&r){var o=Hr(e),s=Hr(t);o&&(n=s?e:0),s&&(i=o?t:0)}return ni?-this._resultLT:0},e}(),fb=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=td(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=td(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function yb(e,t){return"eq"===e||"ne"===e?new fb("eq"===e,t):bo(mb,e)?new hb(e,t):null}var vb=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return cb(e,t)},e}();function xb(e){var t=e.sourceFormat;if(!Tb(t)){var n="";0,sd(n)}return e.data}function bb(e){var t=e.sourceFormat,n=e.data;if(!Tb(t)){var i="";0,sd(i)}if(t===Mv){for(var a=[],r=0,o=n.length;r65535?Mb:kb}function Fb(e,t,n,i,a){var r=Ob[n||"float"];if(a){var o=e[t],s=o&&o.length;if(s!==i){for(var l=new r(i),p=0;pg[1]&&(g[1]=h)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,a=this._chunks,r=this._dimensions,o=r.length,s=this._rawExtent,l=Br(r,(function(e){return e.property})),p=0;pf[1]&&(f[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&ne))return r;a=r-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks[e],a=[];if(!i)return a;null==n&&(n=1/0);for(var r=1/0,o=-1,s=0,l=0,p=this.count();l=0&&o<0)&&(r=d,o=c,s=0),c===o&&(a[s++]=l))}return a.length=s,a},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=p&&x<=c||isNaN(x))&&(o[s++]=m),m++}u=!0}else if(2===a){h=d[i[0]];var f=d[i[1]],y=e[i[1]][0],v=e[i[1]][1];for(g=0;g=p&&x<=c||isNaN(x))&&(b>=y&&b<=v||isNaN(b))&&(o[s++]=m),m++}u=!0}}if(!u)if(1===a)for(g=0;g=p&&x<=c||isNaN(x))&&(o[s++]=w)}else for(g=0;ge[_][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(g))}return sf[1]&&(f[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,i,a,r=this.clone([e],!0),o=r._chunks[e],s=this.count(),l=0,p=Math.floor(1/t),c=this.getRawIndex(0),d=new(Ab(this._rawCount))(Math.min(2*(Math.ceil(s/p)+2),s));d[l++]=c;for(var u=1;un&&(n=i,a=T)}_>0&&_p-m&&(s=p-m,o.length=s);for(var h=0;hc[1]&&(c[1]=f),d[u++]=y}return a._count=u,a._indices=d,a._updateGetRawIdx(),a},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,a=0,r=this.count();ao&&(o=l)}return i=[r,o],this._extent[e]=i,i},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,i){return cb(e[i],this._dimensions[i])}Ib={arrayRows:e,objectRows:function(e,t,n,i){return cb(e[t],this._dimensions[i])},keyedColumns:e,original:function(e,t,n,i){var a=e&&(null==e.value?e:e.value);return cb(a instanceof Array?a[i]:a,this._dimensions[i])},typedArray:function(e,t,n,i){return e[i]}}}(),e}(),Bb=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),a=!!i.length;if(Lb(n)){var r=n,o=void 0,s=void 0,l=void 0;if(a){var p=i[0];p.prepareSource(),o=(l=p.getSource()).data,s=l.sourceFormat,t=[p._getVersionSign()]}else s=Xr(o=r.get("data",!0))?Dv:Ev,t=[];var c=this._getSourceMetaRawOption()||{},d=l&&l.metaRawOption||{},u=io(c.seriesLayoutBy,d.seriesLayoutBy)||null,m=io(c.sourceHeader,d.sourceHeader),h=io(c.dimensions,d.dimensions);e=u!==d.seriesLayoutBy||!!m!=!!d.sourceHeader||h?[qx(o,{seriesLayoutBy:u,sourceHeader:m,dimensions:h},s)]:[]}else{var g=n;if(a){var f=this._applyTransform(i);e=f.sourceList,t=f.upstreamSignList}else{e=[qx(g.get("source",!0),this._getSourceMetaRawOption(),null)],t=[]}}this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,i=n.get("transform",!0),a=n.get("fromTransformResult",!0);if(null!=a){var r="";1!==e.length&&Vb(r)}var o,s=[],l=[];return Rr(e,(function(e){e.prepareSource();var t=e.getSource(a||0),n="";null==a||t||Vb(n),s.push(t),l.push(e._getVersionSign())})),i?t=function(e,t){var n=dd(e),i=n.length,a="";i||sd(a);for(var r=0,o=i;r1||n>0&&!e.noHeader;return Rr(e.blocks,(function(e){var n=$b(e);n>=t&&(t=n+ +(i&&(!n||Hb(e)&&!e.noHeader)))})),t}return 0}function Kb(e,t,n,i){var a,r=t.noHeader,o=(a=$b(t),{html:zb[a],richText:Ub[a]}),s=[],l=t.blocks||[];so(!l||Ur(l)),l=l||[];var p=e.orderMode;if(t.sortBlocks&&p){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(bo(c,p)){var d=new gb(c[p],null);l.sort((function(e,t){return d.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===p&&l.reverse()}Rr(l,(function(n,a){var r=t.valueFormatter,l=Wb(n)(r?kr(kr({},e),{valueFormatter:r}):e,n,a>0?o.html:0,i);null!=l&&s.push(l)}));var u="richText"===e.renderMode?s.join(o.richText):Zb(s.join(""),r?n:o.html);if(r)return u;var m=iv(t.header,"ordinal",e.useUTC),h=Gb(i,e.renderMode).nameStyle;return"richText"===e.renderMode?Qb(e,m,h)+o.richText+u:Zb('
'+Jo(m)+"
"+u,n)}function Yb(e,t,n,i){var a=e.renderMode,r=t.noName,o=t.noValue,s=!t.markerType,l=t.name,p=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return Br(e=Ur(e)?e:[e],(function(e,t){return iv(e,Ur(m)?m[t]:m,p)}))};if(!r||!o){var d=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",a),u=r?"":iv(l,"ordinal",p),m=t.valueType,h=o?[]:c(t.value,t.dataIndex),g=!s||!r,f=!s&&r,y=Gb(i,a),v=y.nameStyle,x=y.valueStyle;return"richText"===a?(s?"":d)+(r?"":Qb(e,u,v))+(o?"":function(e,t,n,i,a){var r=[a],o=i?10:20;return n&&r.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(Ur(t)?t.join(" "):t,r)}(e,h,g,f,x)):Zb((s?"":d)+(r?"":function(e,t,n){return''+Jo(e)+""}(u,!s,v))+(o?"":function(e,t,n,i){var a=n?"10px":"20px",r=t?"float:right;margin-left:"+a:"";return e=Ur(e)?e:[e],''+Br(e,(function(e){return Jo(e)})).join("  ")+""}(h,g,f,x)),n)}}function Xb(e,t,n,i,a,r){if(e)return Wb(e)({useUTC:a,renderMode:n,orderMode:i,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,r)}function Zb(e,t){return'
'+e+'
'}function Qb(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function Jb(e,t){return lv(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function ew(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var tw=function(){function e(){this.richTextStyles={},this._nextStyleNameId=id()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i="richText"===n?this._generateStyleName():null,a=sv({color:t,type:e,renderMode:n,markerId:i});return Hr(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};Ur(t)?Rr(t,(function(e){return kr(n,e)})):kr(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}();function nw(e){var t,n,i,a,r=e.series,o=e.dataIndex,s=e.multipleSeries,l=r.getData(),p=l.mapDimensionsAll("defaultedTooltip"),c=p.length,d=r.getRawValue(o),u=Ur(d),m=Jb(r,o);if(c>1||u&&!c){var h=function(e,t,n,i,a){var r=t.getData(),o=Nr(e,(function(e,t,n){var i=r.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],p=[];function c(e,t){var n=r.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(o?p.push(jb("nameValue",{markerType:"subItem",markerColor:a,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?Rr(i,(function(e){c(ib(r,n,e),e)})):Rr(e,c),{inlineValues:s,inlineValueTypes:l,blocks:p}}(d,r,o,p,m);t=h.inlineValues,n=h.inlineValueTypes,i=h.blocks,a=h.inlineValues[0]}else if(c){var g=l.getDimensionInfo(p[0]);a=t=ib(l,o,p[0]),n=g.type}else a=t=u?d[0]:d;var f=bd(r),y=f&&r.name||"",v=l.getName(o),x=s?y:v;return jb("section",{header:y,noHeader:s||!f,sortParam:a,blocks:[jb("nameValue",{markerType:"item",markerColor:m,name:x,noName:!lo(x),value:t,valueType:n,dataIndex:o})].concat(i||[])})}var iw=Cd();function aw(e,t){return e.getName(t)||e.getId(t)}var rw="__universalTransitionEnabled",ow=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return ze(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=sb({count:lw,reset:pw}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(iw(this).sourceManager=new Bb(this)).prepareSource();var i=this.getInitialData(e,n);dw(i,this),this.dataTask.context.data=i,iw(this).dataBeforeProcessed=i,sw(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=yv(this),i=n?xv(e):{},a=this.subType;Sv.hasClass(a)&&(a+="Series"),Er(e,t.getTheme().get(this.subType)),Er(e,this.getDefaultOption()),ud(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&vv(e,i,n)},t.prototype.mergeOption=function(e,t){e=Er(this.option,e,!0),this.fillDataTextStyle(e.data);var n=yv(this);n&&vv(this.option,e,n);var i=iw(this).sourceManager;i.dirty(),i.prepareSource();var a=this.getInitialData(e,t);dw(a,this),this.dataTask.dirty(),this.dataTask.context.data=a,iw(this).dataBeforeProcessed=a,sw(this),this._initSelectedMapFromData(a)},t.prototype.fillDataTextStyle=function(e){if(e&&!Xr(e))for(var t=["show"],n=0;nthis.getShallow("animationThreshold")&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,a=Xv.prototype.getColorFromPalette.call(this,e,t,n);return a||(a=i.getColorFromPalette(e,t,n)),a},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,a=this.getData(t);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(a)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(t);return("all"===n||n[aw(i,e)])&&!i.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[rw])return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},t.prototype._innerSelect=function(e,t){var n,i,a=this.option,r=a.selectedMode,o=t.length;if(r&&o)if("series"===r)a.selectedMap="all";else if("multiple"===r){Kr(a.selectedMap)||(a.selectedMap={});for(var s=a.selectedMap,l=0;l0&&this._innerSelect(e,t)}},t.registerClass=function(e){return Sv.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(Sv);function sw(e){var t=e.name;bd(e)||(e.name=function(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),i=[];return Rr(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)})),i.join(" ")}(e)||t)}function lw(e){return e.model.getRawData().count()}function pw(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),cw}function cw(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function dw(e,t){Rr(yo(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,zr(uw,t))}))}function uw(e,t){var n=mw(e);return n&&n.setOutputEnd((t||this).count()),t}function mw(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var a=i.agentStubMap;a&&(i=a.get(e.uid))}return i}}Ar(ow,rb),Ar(ow,Xv),Nd(ow,Sv);var hw=function(){function e(){this.group=new Mc,this.uid=hy("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();function gw(){var e=Cd();return function(t){var n=e(t),i=t.pipelineContext,a=!!n.large,r=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(a===o&&r===s)&&"reset"}}Bd(hw),Gd(hw);var fw=Cd(),yw=gw(),vw=function(){function e(){this.group=new Mc,this.uid=hy("viewChart"),this.renderTask=sb({plan:ww,reset:Sw}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){0},e.prototype.highlight=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&bw(a,i,"emphasis")},e.prototype.downplay=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&bw(a,i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.eachRendered=function(e){Nf(this.group,e)},e.markUpdateMethod=function(e,t){fw(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function xw(e,t,n){e&&Lh(e)&&("emphasis"===t?vh:xh)(e,n)}function bw(e,t,n){var i=Sd(e,t),a=t&&null!=t.highlightKey?function(e){var t=Wm[e];return null==t&&Hm<=32&&(t=Wm[e]=Hm++),t}(t.highlightKey):null;null!=i?Rr(dd(i),(function(t){xw(e.getItemGraphicEl(t),n,a)})):e.eachItemGraphicEl((function(e){xw(e,n,a)}))}function ww(e){return yw(e.model)}function Sw(e){var t=e.model,n=e.ecModel,i=e.api,a=e.payload,r=t.pipelineContext.progressiveRender,o=e.view,s=a&&fw(a).updateMethod,l=r?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,n,i,a),Cw[l]}Bd(vw),Gd(vw);var Cw={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},_w="\0__throttleOriginMethod",Tw="\0__throttleRate",Iw="\0__throttleType";function Ew(e,t,n){var i,a,r,o,s,l=0,p=0,c=null;function d(){p=(new Date).getTime(),c=null,e.apply(r,o||[])}t=t||0;var u=function(){for(var e=[],u=0;u=0?d():c=setTimeout(d,-a),l=i};return u.clear=function(){c&&(clearTimeout(c),c=null)},u.debounceNextCall=function(e){s=e},u}function Mw(e,t,n,i){var a=e[t];if(a){var r=a[_w]||a,o=a[Iw];if(a[Tw]!==n||o!==i){if(null==n||!i)return e[t]=r;(a=e[t]=Ew(r,n,"debounce"===i))[_w]=r,a[Iw]=i,a[Tw]=n}return a}}function kw(e,t){var n=e[t];n&&n[_w]&&(n.clear&&n.clear(),e[t]=n[_w])}var Pw=Cd(),Dw={itemStyle:zd(py,!0),lineStyle:zd(oy,!0)},Ow={lineStyle:"stroke",itemStyle:"fill"};function Aw(e,t){var n=e.visualStyleMapper||Dw[t];return n||(console.warn("Unknown style type '"+t+"'."),Dw.itemStyle)}function Fw(e,t){var n=e.visualDrawType||Ow[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var Rw={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",a=e.getModel(i),r=Aw(e,i)(a),o=a.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=Fw(e,i),l=r[s],p=jr(l)?l:null,c="auto"===r.fill||"auto"===r.stroke;if(!r[s]||p||c){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());r[s]||(r[s]=d,n.setVisual("colorFromPalette",!0)),r.fill="auto"===r.fill||jr(r.fill)?d:r.fill,r.stroke="auto"===r.stroke||jr(r.stroke)?d:r.stroke}if(n.setVisual("style",r),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&p)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),a=kr({},r);a[s]=p(i),t.setItemVisual(n,"style",a)}}}},Bw=new uy,Nw={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",a=Aw(e,i),r=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){Bw.option=n[i];var o=a(Bw);kr(e.ensureUniqueItemVisual(t,"style"),o),Bw.option.decal&&(e.setItemVisual(t,"decal",Bw.option.decal),Bw.option.decal.dirty=!0),r in o&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},Lw={performRawSeries:!0,overallReset:function(e){var t=fo();e.eachSeries((function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var i=e.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),Pw(e).scope=a}})),e.eachSeries((function(t){if(!t.isColorBySeries()&&!e.isSeriesFiltered(t)){var n=t.getRawData(),i={},a=t.getData(),r=Pw(t).scope,o=t.visualStyleAccessPath||"itemStyle",s=Fw(t,o);a.each((function(e){var t=a.getRawIndex(e);i[t]=e})),n.each((function(e){var o=i[e];if(a.getItemVisual(o,"colorFromPalette")){var l=a.ensureUniqueItemVisual(o,"style"),p=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(p,r,c)}}))}}))}},Vw=Math.PI;var qw=function(){function e(e,t,n,i){this._stageTaskMap=fo(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:a,modBy:null!=r?Math.ceil(r/a):null,modDataCount:r}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),a=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,r=e.get("large")&&i>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:a,modDataCount:o,large:r}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=fo();e.eachSeries((function(e){var i=e.getProgressive(),a=e.uid;n.set(a,{id:a,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;Rr(this._allHandlers,(function(i){var a=e.get(i.uid)||e.set(i.uid,{}),r="";so(!(i.reset&&i.overallReset),r),i.reset&&this._createSeriesStageTask(i,a,t,n),i.overallReset&&this._createOverallStageTask(i,a,t,n)}),this)},e.prototype.prepareView=function(e,t,n,i){var a=e.renderTask,r=a.context;r.model=t,r.ecModel=n,r.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var a=!1,r=this;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}Rr(e,(function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=r._stageTaskMap.get(e.uid),p=l.seriesTaskMap,c=l.overallTask;if(c){var d,u=c.agentStubMap;u.each((function(e){o(i,e)&&(e.dirty(),d=!0)})),d&&c.dirty(),r.updatePayload(c,n);var m=r.getPerformArgs(c,i.block);u.each((function(e){e.perform(m)})),c.perform(m)&&(a=!0)}else p&&p.each((function(s,l){o(i,s)&&s.dirty();var p=r.getPerformArgs(s,i.block);p.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),r.updatePayload(s,n),s.perform(p)&&(a=!0)}))}})),this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var a=this,r=t.seriesTaskMap,o=t.seriesTaskMap=fo(),s=e.seriesType,l=e.getTargetSeries;function p(t){var s=t.uid,l=o.set(s,r&&r.get(s)||sb({plan:Hw,reset:Ww,count:Yw}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(p):s?n.eachRawSeriesByType(s,p):l&&l(n,i).each(p)},e.prototype._createOverallStageTask=function(e,t,n,i){var a=this,r=t.overallTask=t.overallTask||sb({reset:Gw});r.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var o=r.agentStubMap,s=r.agentStubMap=fo(),l=e.seriesType,p=e.getTargetSeries,c=!0,d=!1,u="";function m(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,sb({reset:zw,onDirty:jw})));n.context={model:e,overallProgress:c},n.agent=r,n.__block=c,a._pipe(e,n)}so(!e.createOnAllSeries,u),l?n.eachRawSeriesByType(l,m):p?p(n,i).each(m):(c=!1,Rr(n.getSeries(),m)),d&&r.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return jr(e)&&(e={overallReset:e,seriesType:Xw(e)}),e.uid=hy("stageHandler"),t&&(e.visualType=t),e},e}();function Gw(e){e.overallReset(e.ecModel,e.api,e.payload)}function zw(e){return e.overallProgress&&Uw}function Uw(){this.agent.dirty(),this.getDownstream().dirty()}function jw(){this.agent&&this.agent.dirty()}function Hw(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Ww(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=dd(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Br(t,(function(e,t){return Kw(t)})):$w}var $w=Kw(0);function Kw(e){return function(t,n){var i=n.data,a=n.resetDefines[e];if(a&&a.dataEach)for(var r=t.start;r0&&c===a.length-p.length){var d=a.slice(0,c);"data"!==d&&(t.mainType=d,t[p.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(a)&&(n[a]=e,s=!0),s||(i[a]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,r=n.model,o=n.view;if(!r||!o)return!0;var s=t.cptQuery,l=t.dataQuery;return p(s,r,"mainType")&&p(s,r,"subType")&&p(s,r,"index","componentIndex")&&p(s,r,"name")&&p(s,r,"id")&&p(l,a,"name")&&p(l,a,"dataIndex")&&p(l,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,a));function p(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),pS=["symbol","symbolSize","symbolRotate","symbolOffset"],cS=pS.concat(["symbolKeepAspect"]),dS={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var i={},a={},r=!1,o=0;o=0&&AS(l)?l:.5,e.createRadialGradient(o,s,0,o,s,l)}(e,t,n):function(e,t,n){var i=null==t.x?0:t.x,a=null==t.x2?1:t.x2,r=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(i=i*n.width+n.x,a=a*n.width+n.x,r=r*n.height+n.y,o=o*n.height+n.y),i=AS(i)?i:0,a=AS(a)?a:1,r=AS(r)?r:0,o=AS(o)?o:0,e.createLinearGradient(i,r,a,o)}(e,t,n),a=t.colorStops,r=0;r0&&(t=i.lineDash,n=i.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:$r(t)?[t]:Ur(t)?t:null:null),r=i.lineDashOffset;if(a){var o=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;o&&1!==o&&(a=Br(a,(function(e){return e/o})),r/=o)}return[a,r]}var LS=new Yu(!0);function VS(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function qS(e){return"string"==typeof e&&"none"!==e}function GS(e){var t=e.fill;return null!=t&&"none"!==t}function zS(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function US(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function jS(e,t,n){var i=$d(t.image,t.__image,n);if(Yd(i)){var a=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix&&a&&a.setTransform){var r=new DOMMatrix;r.translateSelf(t.x||0,t.y||0),r.rotateSelf(0,0,(t.rotation||0)*So),r.scaleSelf(t.scaleX||1,t.scaleY||1),a.setTransform(r)}return a}}var HS=["shadowBlur","shadowOffsetX","shadowOffsetY"],WS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $S(e,t,n,i,a){var r=!1;if(!i&&t===(n=n||{}))return!1;if(i||t.opacity!==n.opacity){XS(e,a),r=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?pu.opacity:o}(i||t.blend!==n.blend)&&(r||(XS(e,a),r=!0),e.globalCompositeOperation=t.blend||pu.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[mC])if(this._disposed)jC(this.id);else{var i,a,r;if(Kr(t)&&(n=t.lazyUpdate,i=t.silent,a=t.replaceMerge,r=t.transition,t=t.notMerge),this[mC]=!0,!this._model||t){var o=new px(this._api),s=this._theme,l=this._model=new ex;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:a},KC);var p={seriesTransition:r,optionChanged:!0};if(n)this[hC]={silent:i,updateParams:p},this[mC]=!1,this.getZr().wakeUp();else{try{wC(this),_C.update.call(this,null,p)}catch(e){throw this[hC]=null,this[mC]=!1,e}this._ssr||this._zr.flush(),this[hC]=null,this[mC]=!1,MC.call(this,i),kC.call(this,i)}}},t.prototype.setTheme=function(){od()},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||rr.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var t=this._zr.painter;return t.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var t=this._zr.painter;return t.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(rr.svgSupported){var e=this._zr;return Rr(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,i=[],a=this;Rr(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=a._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)}))}));var r="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return Rr(i,(function(e){e.group.ignore=!1})),r}jC(this.id)},t.prototype.getConnectedDataURL=function(e){if(!this._disposed){var t="svg"===e.type,n=this.group,i=Math.min,a=Math.max,r=1/0;if(JC[n]){var o=r,s=r,l=-1/0,p=-1/0,c=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();Rr(QC,(function(r,d){if(r.group===n){var u=t?r.getZr().painter.getSvgDom().innerHTML:r.renderToCanvas(Ir(e)),m=r.getDom().getBoundingClientRect();o=i(m.left,o),s=i(m.top,s),l=a(m.right,l),p=a(m.bottom,p),c.push({dom:u,left:m.left,top:m.top})}}));var u=(l*=d)-(o*=d),m=(p*=d)-(s*=d),h=dr.createCanvas(),g=Ac(h,{renderer:t?"svg":"canvas"});if(g.resize({width:u,height:m}),t){var f="";return Rr(c,(function(e){var t=e.left-o,n=e.top-s;f+=''+e.dom+""})),g.painter.getSvgRoot().innerHTML=f,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new Em({shape:{x:0,y:0,width:u,height:m},style:{fill:e.connectedBackgroundColor}})),Rr(c,(function(e){var t=new bm({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),h.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}jC(this.id)},t.prototype.convertToPixel=function(e,t){return TC(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return TC(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return Rr(Td(this._model,e),(function(e,i){i.indexOf("Models")>=0&&Rr(e,(function(e){var a=e.coordinateSystem;if(a&&a.containPoint)n=n||!!a.containPoint(t);else if("seriesModels"===i){var r=this._chartsMap[e.__viewId];r&&r.containPoint&&(n=n||r.containPoint(t,e))}else 0}),this)}),this),!!n;jC(this.id)},t.prototype.getVisual=function(e,t){var n=Td(this._model,e,{defaultMainType:"series"}),i=n.seriesModel;var a=i.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?a.indexOfRawIndex(n.dataIndex):null;return null!=r?mS(a,r,t):hS(a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,i=this;Rr(UC,(function(e){var t=function(t){var n,a=i.getModel(),r=t.target,o="globalout"===e;if(o?n={}:r&&vS(r,(function(e){var t=Um(e);if(t&&null!=t.dataIndex){var i=t.dataModel||a.getSeriesByIndex(t.seriesIndex);return n=i&&i.getDataParams(t.dataIndex,t.dataType,r)||{},!0}if(t.eventData)return n=kr({},t.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var p=s&&null!=l&&a.getComponent(s,l),c=p&&i["series"===p.mainType?"_chartsMap":"_componentsMap"][p.__viewId];0,n.event=t,n.type=e,i._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:p,view:c},i.trigger(e,n)}};t.zrEventfulCallAtLast=!0,i._zr.on(e,t,i)})),Rr(WC,(function(e,t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),Rr(["selectchanged"],(function(e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",(function(e){var i=n.getModel();e.isFromClick?(yS("map","selectchanged",t,i,e),yS("pie","selectchanged",t,i,e)):"select"===e.fromAction?(yS("map","selected",t,i,e),yS("pie","selected",t,i,e)):"unselect"===e.fromAction&&(yS("map","unselected",t,i,e),yS("pie","unselected",t,i,e))}))},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?jC(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)jC(this.id);else{this._disposed=!0,this.getDom()&&Pd(this.getDom(),t_,"");var e=this,t=e._api,n=e._model;Rr(e._componentsViews,(function(e){e.dispose(n,t)})),Rr(e._chartsViews,(function(e){e.dispose(n,t)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete QC[e.id]}},t.prototype.resize=function(e){if(!this[mC])if(this._disposed)jC(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[hC]&&(null==i&&(i=this[hC].silent),n=!0,this[hC]=null),this[mC]=!0;try{n&&wC(this),_C.update.call(this,{type:"resize",animation:kr({duration:0},e&&e.animation)})}catch(e){throw this[mC]=!1,e}this[mC]=!1,MC.call(this,i),kC.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)jC(this.id);else if(Kr(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),ZC[e]){var n=ZC[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?jC(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=kr({},e);return t.type=WC[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)jC(this.id);else if(Kr(t)||(t={silent:!!t}),HC[e.type]&&this._model)if(this[mC])this._pendingActions.push(e);else{var n=t.silent;EC.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&rr.browser.weChat&&this._throttledZrFlush(),MC.call(this,n),kC.call(this,n)}},t.prototype.updateLabelLayout=function(){sC.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)jC(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);0,n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function t(e){for(var t=[],n=e.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(e){if(e.states&&e.states.emphasis){if(af(e))return;if(e instanceof gm&&function(e){var t=$m(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(a){e.stateTransition=o;var i=e.getTextContent(),r=e.getTextGuideLine();i&&(i.stateTransition=o),r&&(r.stateTransition=o)}e.__dirty&&t(e)}}))}wC=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),SC(e,!0),SC(e,!1),t.plan()},SC=function(e,t){for(var n=e._model,i=e._scheduler,a=t?e._componentsViews:e._chartsViews,r=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,l=0;lt.get("hoverLayerThreshold")&&!rr.node&&!rr.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,t),sC.trigger("series:afterupdate",t,i,s)},NC=function(e){e[gC]=!0,e.getZr().wakeUp()},LC=function(e){e[gC]&&(e.getZr().storage.traverse((function(e){af(e)||t(e)})),e[gC]=!1)},RC=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return ze(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){vh(t,n),NC(e)},n.prototype.leaveEmphasis=function(t,n){xh(t,n),NC(e)},n.prototype.enterBlur=function(t){bh(t),NC(e)},n.prototype.leaveBlur=function(t){wh(t),NC(e)},n.prototype.enterSelect=function(t){Sh(t),NC(e)},n.prototype.leaveSelect=function(t){Ch(t),NC(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(rx))(e)},BC=function(e){function t(e,t){for(var n=0;n=0)){p_.push(n);var r=qw.wrapStageHandler(n,a);r.__prio=t,r.__raw=n,e.push(r)}}function d_(e,t){ZC[e]=t}var u_=function(e){var t=(e=Ir(e)).type,n="";t||sd(n);var i=t.split(":");2!==i.length&&sd(n);var a=!1;"echarts"===i[0]&&(t=i[1],a=!0),e.__isBuiltIn=a,Cb.set(t,e)};function m_(e){return null==e?0:e.length||1}function h_(e){return e}l_(cC,Rw),l_(dC,Nw),l_(dC,Lw),l_(cC,dS),l_(dC,uS),l_(7e3,(function(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(e){var n=i.getItemVisual(e,"decal");n&&(i.ensureUniqueItemVisual(e,"style").decal=iC(n,t))}));var a=i.getVisual("decal");if(a)i.getVisual("style").decal=iC(a,t)}}))})),a_(Dx),r_(900,(function(e){var t=fo();e.eachSeries((function(e){var n=e.get("stack");if(n){var i=t.get(n)||t.set(n,[]),a=e.getData(),r={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:e};if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;i.length&&a.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(r)}})),t.each(Ox)})),d_("default",(function(e,t){Pr(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Mc,i=new Em({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(i);var a,r=new Pm({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),o=new Em({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(o),t.showSpinner&&((a=new qg({shape:{startAngle:-Vw/2,endAngle:-Vw/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Vw/2}).start("circularInOut"),a.animateShape(!0).when(1e3,{startAngle:3*Vw/2}).delay(300).start("circularInOut"),n.add(a)),n.resize=function(){var n=r.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),p=e.getHeight()/2;t.showSpinner&&a.setShape({cx:l,cy:p}),o.setShape({x:l-s,y:p-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n})),s_({type:Qm,event:Qm,update:Qm},wo),s_({type:Jm,event:Jm,update:Jm},wo),s_({type:eh,event:eh,update:eh},wo),s_({type:th,event:th,update:th},wo),s_({type:nh,event:nh,update:nh},wo),i_("light",nS),i_("dark",sS);var g_=function(){function e(e,t,n,i,a,r){this._old=e,this._new=t,this._oldKeyGetter=n||h_,this._newKeyGetter=i||h_,this.context=a,this._diffModeMultiple="multiple"===r}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,a,"_newKeyGetter");for(var r=0;r1){var p=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(p,r)}else 1===l?(n[o]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},a=[],r=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(t,i,r,"_newKeyGetter");for(var o=0;o1&&1===d)this._updateManyToOne&&this._updateManyToOne(p,l),i[s]=null;else if(1===c&&d>1)this._updateOneToMany&&this._updateOneToMany(p,l),i[s]=null;else if(1===c&&1===d)this._update&&this._update(p,l),i[s]=null;else if(c>1&&d>1)this._updateManyToMany&&this._updateManyToMany(p,l),i[s]=null;else if(c>1)for(var u=0;u1)for(var o=0;o30}var E_,M_,k_,P_,D_,O_,A_,F_=Kr,R_=Br,B_="undefined"==typeof Int32Array?Array:Int32Array,N_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],L_=["_approximateExtent"],V_=function(){function e(e,t){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;C_(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},r=[],o={},s=!1,l={},p=0;p=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,a=this._idList;if(n.getSource().sourceFormat===Ev&&!n.pure)for(var r=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[t];return null==a&&(Ur(a=this.getVisual(t))?a=a.slice():F_(a)&&(a=kr({},a)),i[t]=a),a},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,F_(t)?kr(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){F_(e)?kr(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?kr(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;jm(n,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){Rr(this._graphicEls,(function(n,i){n&&e&&e.call(t,n,i)}))},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:R_(this.dimensions,this._getDimInfo,this),this.hostModel)),D_(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];jr(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(ro(arguments)))})},e.internalField=(E_=function(e){var t=e._invertedIndicesMap;Rr(t,(function(n,i){var a=e._dimInfos[i],r=a.ordinalMeta,o=a.stack,s=e._store;if(r||o){if(n=t[i]=o?new Array(s.count()):new B_(r.categories.length),r)for(var l=0;l1&&(s+="__ec__"+p),i[t]=s}})),e}();function q_(e,t){Vx(e)||(e=Gx(e));var n=(t=t||{}).coordDimensions||[],i=t.dimensionsDefine||e.dimensionsDefine||[],a=fo(),r=[],o=function(e,t,n,i){var a=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,i||0);return Rr(t,(function(e){var t;Kr(e)&&(t=e.dimsDef)&&(a=Math.max(a,t.length))})),a}(e,n,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&I_(o),l=i===e.dimensionsDefine,p=l?T_(e):__(i),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var d=fo(c),u=new Pb(o),m=0;m0&&(i.name=a+(r-1)),r++,t.set(a,r)}}(r),new S_({source:e,dimensions:r,fullDimensionCount:o,dimensionOmitted:s})}function G_(e,t,n){if(n||t.hasKey(e)){for(var i=0;t.hasKey(e+i);)i++;e+=i}return t.set(e,!0),e}var z_=function(e){this.coordSysDims=[],this.axisMap=fo(),this.categoryAxisMap=fo(),this.coordSysName=e};var U_={cartesian2d:function(e,t,n,i){var a=e.getReferringComponents("xAxis",Ed).models[0],r=e.getReferringComponents("yAxis",Ed).models[0];t.coordSysDims=["x","y"],n.set("x",a),n.set("y",r),j_(a)&&(i.set("x",a),t.firstCategoryDimIndex=0),j_(r)&&(i.set("y",r),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var a=e.getReferringComponents("singleAxis",Ed).models[0];t.coordSysDims=["single"],n.set("single",a),j_(a)&&(i.set("single",a),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var a=e.getReferringComponents("polar",Ed).models[0],r=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",o),j_(r)&&(i.set("radius",r),t.firstCategoryDimIndex=0),j_(o)&&(i.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,i){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,i){var a=e.ecModel,r=a.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=r.dimensions.slice();Rr(r.parallelAxisIndex,(function(e,r){var s=a.getComponent("parallelAxis",e),l=o[r];n.set(l,s),j_(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=r))}))}};function j_(e){return"category"===e.get("type")}function H_(e,t,n){var i,a,r,o=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(e){return!C_(e.schema)}(t)?(a=t.schema,i=a.dimensions,r=t.store):i=t;var l,p,c,d,u=!(!e||!e.get("stack"));if(Rr(i,(function(e,t){Hr(e)&&(i[t]=e={name:e}),u&&!e.isExtraCoord&&(o||l||!e.ordinalMeta&&!e.stack||(l=e),p||"ordinal"===e.type||"time"===e.type||s&&s!==e.coordDim||(p=e))})),!p||o||l||(o=!0),p){c="__\0ecstackresult_"+e.id,d="__\0ecstackedover_"+e.id,l&&(l.createInvertedIndices=!0);var m=p.coordDim,h=p.type,g=0;Rr(i,(function(e){e.coordDim===m&&g++}));var f={name:c,coordDim:m,coordDimIndex:g,type:h,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:d,coordDim:d,coordDimIndex:g+1,type:h,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};a?(r&&(f.storeDimIndex=r.ensureCalculationDimension(d,h),y.storeDimIndex=r.ensureCalculationDimension(c,h)),a.appendCalculationDimension(f),a.appendCalculationDimension(y)):(i.push(f),i.push(y))}return{stackedDimension:p&&p.name,stackedByDimension:l&&l.name,isStackedByIndex:o,stackedOverDimension:d,stackResultDimension:c}}function W_(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function $_(e,t){return W_(e,t)?e.getCalculationInfo("stackResultDimension"):t}function K_(e,t,n){n=n||{};var i,a=t.getSourceManager(),r=!1;e?(r=!0,i=Gx(e)):r=(i=a.getSource()).sourceFormat===Ev;var o=function(e){var t=e.get("coordinateSystem"),n=new z_(t),i=U_[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}(t),s=function(e,t){var n,i=e.get("coordinateSystem"),a=sx.get(i);return t&&t.coordSysDims&&(n=Br(t.coordSysDims,(function(e){var n={name:e},i=t.axisMap.get(e);if(i){var a=i.get("type");n.type=v_(a)}return n}))),n||(n=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]),n}(t,o),l=n.useEncodeDefaulter,p=jr(l)?l:l?zr(Vv,s,t):null,c=q_(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:p,canOmitUnusedDimensions:!r}),d=function(e,t,n){var i,a;return n&&Rr(e,(function(e,r){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(null==i&&(i=r),e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(a=!0)})),a||null==i||(e[i].otherDims.itemName=0),i}(c.dimensions,n.createInvertedIndices,o),u=r?null:a.getSharedDataStore(c),m=H_(t,{schema:c,store:u}),h=new V_(c,t);h.setCalculationInfo(m);var g=null!=d&&function(e){if(e.sourceFormat===Ev){var t=function(e){var t=0;for(;tt[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();Gd(Y_);var X_=0,Z_=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++X_}return e.createByAxisModel=function(t){var n=t.option,i=n.data,a=i&&Br(i,Q_);return new e({categories:a,needCollect:!a,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!Hr(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=fo(this.categories))},e}();function Q_(e){return Kr(e)&&null!=e.value?e.value:e+""}function J_(e){return"interval"===e.type||"log"===e.type}function eT(e,t,n,i){var a={},r=e[1]-e[0],o=a.interval=Jc(r/t,!0);null!=n&&oi&&(o=a.interval=i);var s=a.intervalPrecision=nT(o);return function(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),iT(e,0,t),iT(e,1,t),e[0]>e[1]&&(e[0]=e[1])}(a.niceTickExtent=[qc(Math.ceil(e[0]/o)*o,s),qc(Math.floor(e[1]/o)*o,s)],e),a}function tT(e){var t=Math.pow(10,Qc(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,qc(n*t)}function nT(e){return zc(e)+2}function iT(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function aT(e,t){return e>=t[0]&&e<=t[1]}function rT(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function oT(e,t){return e*(t[1]-t[0])+t[0]}var sT=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Z_({})),Ur(i)&&(i=new Z_({categories:Br(i,(function(e){return Kr(e)?e.value:e}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return ze(t,e),t.prototype.parse=function(e){return null==e?NaN:Hr(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return aT(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return rT(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(oT(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null!=e){for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],a=0,r=this._ordinalMeta.categories.length,o=Math.min(r,t.length);a=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(Y_);Y_.registerClass(sT);var lT=qc,pT=function(e){function t(t){var n=e.call(this,t)||this;n.type="interval",n._interval=0,n._intervalPrecision=2;var i=n.getSetting("ticksGenerator");return jr(i)&&(n._ticksGenerator=i),n}return ze(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return aT(e,this._extent)},t.prototype.normalize=function(e){return rT(e,this._extent)},t.prototype.scale=function(e){return oT(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=nT(e)},t.prototype.getTicks=function(e){var t,n=this._interval,i=this._extent,a=this._niceExtent,r=this._intervalPrecision,o=this._ticksGenerator;if(o)try{if(t=o(i,n,a,r))return t}catch(e){}if(t=[],!n)return t;i[0]1e4)return[];var l=t.length?t[t.length-1].value:a[1];return i[1]>l&&(e?t.push({value:lT(l+n,r)}):t.push({value:i[1]})),t},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),a=1;ai[0]&&c0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(e),n=[];return Rr(e,(function(e){var i,a=e.coordinateSystem.getBaseAxis(),r=a.getExtent();if("category"===a.type)i=a.getBandWidth();else if("value"===a.type||"time"===a.type){var o=a.dim+"_"+a.index,s=t[o],l=Math.abs(r[1]-r[0]),p=a.scale.getExtent(),c=Math.abs(p[1]-p[0]);i=s?l/c*s:l}else{var d=e.getData();i=Math.abs(r[1]-r[0])/d.count()}var u=Vc(e.get("barWidth"),i),m=Vc(e.get("barMaxWidth"),i),h=Vc(e.get("barMinWidth")||(ST(e)?.5:1),i),g=e.get("barGap"),f=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:u,barMaxWidth:m,barMinWidth:h,barGap:g,barCategoryGap:f,axisKey:gT(a),stackId:hT(e)})})),vT(n)}function vT(e){var t={};Rr(e,(function(e,n){var i=e.axisKey,a=e.bandWidth,r=t[i]||{bandWidth:a,remainedWidth:a,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=r.stacks;t[i]=r;var s=e.stackId;o[s]||r.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var p=e.barMaxWidth;p&&(o[s].maxWidth=p);var c=e.barMinWidth;c&&(o[s].minWidth=c);var d=e.barGap;null!=d&&(r.gap=d);var u=e.barCategoryGap;null!=u&&(r.categoryGap=u)}));var n={};return Rr(t,(function(e,t){n[t]={};var i=e.stacks,a=e.bandWidth,r=e.categoryGap;if(null==r){var o=qr(i).length;r=Math.max(35-4*o,15)+"%"}var s=Vc(r,a),l=Vc(e.gap,1),p=e.remainedWidth,c=e.autoWidthCount,d=(p-s)/(c+(c-1)*l);d=Math.max(d,0),Rr(i,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,p-=i+l*i,c--}else{var i=d;t&&ti&&(i=n),i!==d&&(e.width=i,p-=i+l*i,c--)}})),d=(p-s)/(c+(c-1)*l),d=Math.max(d,0);var u,m=0;Rr(i,(function(e,t){e.width||(e.width=d),u=e,m+=e.width*(1+l)})),u&&(m-=u.width*l);var h=-m/2;Rr(i,(function(e,i){n[t][i]=n[t][i]||{bandWidth:a,offset:h,width:e.width},h+=e.width*(1+l)}))})),n}function xT(e,t){var n=fT(e,t),i=yT(n);Rr(n,(function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),a=hT(e),r=i[gT(n)][a],o=r.offset,s=r.width;t.setLayout({bandWidth:r.bandWidth,offset:o,size:s})}))}function bT(e){return{seriesType:e,plan:gw(),reset:function(e){if(wT(e)){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),r=t.getDimensionIndex(t.mapDimension(a.dim)),o=t.getDimensionIndex(t.mapDimension(i.dim)),s=e.get("showBackground",!0),l=t.mapDimension(a.dim),p=t.getCalculationInfo("stackResultDimension"),c=W_(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),d=a.isHorizontal(),u=function(e,t){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}(0,a),m=ST(e),h=e.get("barMinHeight")||0,g=p&&t.getDimensionIndex(p),f=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(e,t){for(var i,a=e.count,l=m&&uT(3*a),p=m&&s&&uT(3*a),v=m&&uT(a),x=n.master.getRect(),b=d?x.width:x.height,w=t.getStore(),S=0;null!=(i=e.next());){var C=w.get(c?g:r,i),_=w.get(o,i),T=u,I=void 0;c&&(I=+C-w.get(r,i));var E=void 0,M=void 0,k=void 0,P=void 0;if(d){var D=n.dataToPoint([C,_]);if(c)T=n.dataToPoint([I,_])[0];E=T,M=D[1]+y,k=D[0]-T,P=f,Math.abs(k)0)for(var s=0;s=0;--s)if(l[p]){r=l[p];break}r=r||o.none}if(Ur(r)){var c=null==e.level?0:e.level>=0?e.level:r.length+e.level;r=r[c=Math.min(c,r.length-1)]}}return Ny(new Date(e.value),r,a,i)}(e,t,n,this.getSetting("locale"),i)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var i=this.getSetting("useUTC"),a=function(e,t,n,i){var a=1e4,r=Ay,o=0;function s(e,t,n,a,r,o,s){for(var l=new Date(t),p=t,c=l[a]();p1&&0===p&&r.unshift({value:r[0].value-u})}}for(p=0;p=i[0]&&y<=i[1]&&d++)}var v=(i[1]-i[0])/t;if(d>1.5*v&&u>v/1.5)break;if(p.push(g),d>v||e===r[m])break}c=[]}}0;var x=Lr(Br(p,(function(e){return Lr(e,(function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd}))})),(function(e){return e.length>0})),b=[],w=x.length-1;for(m=0;mn&&(this._approxInterval=n);var r=_T.length,o=Math.min(function(e,t,n,i){for(;n>>1;e[a][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function IT(e){return(e/=2592e6)>6?6:e>3?3:e>2?2:1}function ET(e){return(e/=Iy)>12?12:e>6?6:e>3.5?4:e>2?2:1}function MT(e,t){return(e/=t?Ty:_y)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function kT(e){return Jc(e,!0)}function PT(e,t,n){var i=new Date(e);switch(Ry(t)){case"year":case"month":i[Ky(n)](0);case"day":i[Yy(n)](1);case"hour":i[Xy(n)](0);case"minute":i[Zy(n)](0);case"second":i[Qy(n)](0),i[Jy(n)](0)}return i.getTime()}Y_.registerClass(CT);var DT=Y_.prototype,OT=pT.prototype,AT=qc,FT=Math.floor,RT=Math.ceil,BT=Math.pow,NT=Math.log,LT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new pT,t._interval=0,t}return ze(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return Br(OT.getTicks.call(this,e),(function(e){var t=e.value,a=qc(BT(this.base,t));return a=t===n[0]&&this._fixMin?qT(a,i[0]):a,{value:a=t===n[1]&&this._fixMax?qT(a,i[1]):a}}),this)},t.prototype.setExtent=function(e,t){var n=NT(this.base);e=NT(Math.max(0,e))/n,t=NT(Math.max(0,t))/n,OT.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=DT.getExtent.call(this);t[0]=BT(e,t[0]),t[1]=BT(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=qT(t[0],n[0])),this._fixMax&&(t[1]=qT(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=NT(e[0])/NT(t),e[1]=NT(e[1])/NT(t),DT.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var i=Zc(n);for(e/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var a=[qc(RT(t[0]/i)*i),qc(FT(t[1]/i)*i)];this._interval=i,this._niceExtent=a}},t.prototype.calcNiceExtent=function(e){OT.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return aT(e=NT(e)/NT(this.base),this._extent)},t.prototype.normalize=function(e){return rT(e=NT(e)/NT(this.base),this._extent)},t.prototype.scale=function(e){return e=oT(e,this._extent),BT(this.base,e)},t.type="log",t}(Y_),VT=LT.prototype;function qT(e,t){return AT(e,zc(t))}VT.getMinorTicks=OT.getMinorTicks,VT.getLabel=OT.getLabel,Y_.registerClass(LT);var GT=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]0&&s>0&&!l&&(o=0),o<0&&s<0&&!p&&(s=0));var d=this._determinedMin,u=this._determinedMax;return null!=d&&(o=d,l=!0),null!=u&&(s=u,p=!0),{min:o,max:s,minFixed:l,maxFixed:p,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[UT[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=zT[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),zT={min:"_determinedMin",max:"_determinedMax"},UT={min:"_dataMin",max:"_dataMax"};function jT(e,t,n){var i=e.rawExtentInfo;return i||(i=new GT(e,t,n),e.rawExtentInfo=i,i)}function HT(e,t){return null==t?null:to(t)?NaN:e.parse(t)}function WT(e,t){var n=e.type,i=jT(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var a=i.min,r=i.max,o=t.ecModel;if(o&&"time"===n){var s=fT("bar",o),l=!1;if(Rr(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var p=yT(s),c=function(e,t,n,i){var a=n.axis.getExtent(),r=a[1]-a[0],o=function(e,t,n){if(e&&t){var i=e[gT(t)];return null!=i&&null!=n?i[hT(n)]:i}}(i,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;Rr(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Rr(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var p=s+l,c=t-e,d=c/(1-(s+l)/r)-c;return t+=d*(l/p),e-=d*(s/p),{min:e,max:t}}(a,r,t,p);a=c.min,r=c.max}}return{extent:[a,r],fixMin:i.minFixed,fixMax:i.maxFixed}}function $T(e,t){var n=t,i=WT(e,n),a=i.extent,r=n.get("splitNumber");e instanceof LT&&(e.base=n.get("logBase"));var o=e.type,s=n.get("interval"),l="interval"===o||"time"===o;e.setExtent(a[0],a[1]),e.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function KT(e,t){if(t=t||e.get("type"))switch(t){case"category":return new sT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new CT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});case"value":return new pT({ticksGenerator:e.getTicksGenerator()});default:return new(Y_.getClass(t)||pT)}}function YT(e){var t,n,i=e.getLabelModel().get("formatter"),a="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=i,function(t,i){return e.scale.getFormattedLabel(t,i,n)}):Hr(i)?function(t){return function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(i):jr(i)?(t=i,function(n,i){return null!=a&&(i=n.value-a),t(XT(e,n),i,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function XT(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function ZT(e,t){var n=t*Math.PI/180,i=e.width,a=e.height,r=i*Math.abs(Math.cos(n))+Math.abs(a*Math.sin(n)),o=i*Math.abs(Math.sin(n))+Math.abs(a*Math.cos(n));return new Ps(e.x,e.y,r,o)}function QT(e){var t=e.get("interval");return null==t?"auto":t}function JT(e){return"category"===e.type&&0===QT(e.getLabelModel())}function eI(e,t){var n={};return Rr(e.mapDimensionsAll(t),(function(t){n[$_(e,t)]=!0})),qr(n)}var tI=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();var nI=[],iI={registerPreprocessor:a_,registerProcessor:r_,registerPostInit:function(e){o_("afterinit",e)},registerPostUpdate:function(e){o_("afterupdate",e)},registerUpdateLifecycle:o_,registerAction:s_,registerCoordinateSystem:function(e,t){sx.register(e,t)},registerLayout:function(e,t){c_(YC,e,t,1e3,"layout")},registerVisual:l_,registerTransform:u_,registerLoading:d_,registerMap:function(e,t,n){var i=pC("registerMap");i&&i(e,t,n)},registerImpl:function(e,t){lC[e]=t},PRIORITY:uC,ComponentModel:Sv,ComponentView:hw,SeriesModel:ow,ChartView:vw,registerComponentModel:function(e){Sv.registerClass(e)},registerComponentView:function(e){hw.registerClass(e)},registerSeriesModel:function(e){ow.registerClass(e)},registerChartView:function(e){vw.registerClass(e)},registerSubTypeDefaulter:function(e,t){Sv.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Fc(e,t)}};function aI(e){Ur(e)?Rr(e,(function(e){aI(e)})):Dr(nI,e)>=0||(nI.push(e),jr(e)&&(e={install:e}),e.install(iI))}function rI(e,t){return Math.abs(e-t)<1e-8}function oI(e,t,n){var i=0,a=e[0];if(!a)return!1;for(var r=1;rn&&(e=a,n=o)}if(e)return function(e){for(var t=0,n=0,i=0,a=e.length,r=e[a-1][0],o=e[a-1][1],s=0;s>1^-(1&s),l=l>>1^-(1&l),a=s+=a,r=l+=r,i.push([s/n,l/n])}return i}function yI(e,t){return Br(Lr((e=function(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;return null==n&&(n=1024),Rr(t.features,(function(e){var t=e.geometry,i=t.encodeOffsets,a=t.coordinates;if(i)switch(t.type){case"LineString":t.coordinates=fI(a,i,n);break;case"Polygon":case"MultiLineString":gI(a,i,n);break;case"MultiPolygon":Rr(a,(function(e,t){return gI(e,i[t],n)}))}})),t.UTF8Encoding=!1,t}(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,i=e.geometry,a=[];switch(i.type){case"Polygon":var r=i.coordinates;a.push(new dI(r[0],r.slice(1)));break;case"MultiPolygon":Rr(i.coordinates,(function(e){e[0]&&a.push(new dI(e[0],e.slice(1)))}));break;case"LineString":a.push(new uI([i.coordinates]));break;case"MultiLineString":a.push(new uI(i.coordinates))}var o=new mI(n[t||"name"],a,n.cp);return o.properties=n,o}))}var vI=Cd();function xI(e){return"category"===e.type?function(e){var t=e.getLabelModel(),n=wI(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(e):function(e){var t=e.scale.getTicks(),n=YT(e);return{labels:Br(t,(function(t,i){return{level:t.level,formattedLabel:n(t,i),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}(e)}function bI(e,t){return"category"===e.type?function(e,t){var n,i,a=SI(e,"ticks"),r=QT(t),o=CI(a,r);if(o)return o;t.get("show")&&!e.scale.isBlank()||(n=[]);if(jr(r))n=II(e,r,!0);else if("auto"===r){var s=wI(e,e.getLabelModel());i=s.labelCategoryInterval,n=Br(s.labels,(function(e){return e.tickValue}))}else n=TI(e,i=r,!0);return _I(a,r,{ticks:n,tickCategoryInterval:i})}(e,t):{ticks:Br(e.scale.getTicks(),(function(e){return e.value}))}}function wI(e,t){var n,i,a=SI(e,"labels"),r=QT(t),o=CI(a,r);return o||(jr(r)?n=II(e,r):(i="auto"===r?function(e){var t=vI(e).autoInterval;return null!=t?t:vI(e).autoInterval=e.calculateCategoryInterval()}(e):r,n=TI(e,i)),_I(a,r,{labels:n,labelCategoryInterval:i}))}function SI(e,t){return vI(e)[t]||(vI(e)[t]=[])}function CI(e,t){for(var n=0;n1&&c/l>2&&(p=Math.round(Math.ceil(p/l)*l));var d=JT(e),u=o.get("showMinLabel")||d,m=o.get("showMaxLabel")||d;u&&p!==r[0]&&g(r[0]);for(var h=p;h<=r[1];h+=l)g(h);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:a.getLabel(t),tickValue:e})}return m&&h-l!==r[1]&&g(r[1]),s}function II(e,t,n){var i=e.scale,a=YT(e),r=[];return Rr(i.getTicks(),(function(e){var o=i.getLabel(e),s=e.value;t(e.value,o)&&r.push(n?s:{formattedLabel:a(e),rawLabel:o,tickValue:s})})),r}var EI=[0,1],MI=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return jc(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&kI(n=n.slice(),i.count()),Lc(e,EI,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&kI(n=n.slice(),i.count());var a=Lc(e,n,EI,t);return this.scale.scale(a)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=Br(bI(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this);return function(e,t,n,i){var a=t.length;if(!e.onBand||n||!a)return;var r,o,s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[1]};else{var l=t[a-1].tickValue-t[0].tickValue,p=(t[a-1].coord-t[0].coord)/l;Rr(t,(function(e){e.coord-=p/2})),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+p*o},t.push(r)}var c=s[0]>s[1];d(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift());i&&d(s[0],t[0].coord)&&t.unshift({coord:s[0]});d(s[1],r.coord)&&(i?r.coord=s[1]:t.pop());i&&d(r.coord,s[1])&&t.push({coord:s[1]});function d(e,t){return e=qc(e),t=qc(t),c?e>t:e0&&e<100||(e=5),Br(this.scale.getMinorTicks(e),(function(e){return Br(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return xI(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){if("time"===this.type){var e=this.model,t=e.get("bandWidthCalculator"),n=void 0;if(jr(t))try{if(n=t(e))return n}catch(e){}}var i=this._extent,a=this.scale.getExtent(),r=a[1]-a[0]+(this.onBand?1:0);0===r&&(r=1);var o=Math.abs(i[1]-i[0]);return Math.abs(o)/r},e.prototype.calculateCategoryInterval=function(){return function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),n=YT(e),i=(t.axisRotate-t.labelRotate)/180*Math.PI,a=e.scale,r=a.getExtent(),o=a.count();if(r[1]-r[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=r[0],p=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(p*Math.cos(i)),d=Math.abs(p*Math.sin(i)),u=0,m=0;l<=r[1];l+=s){var h,g,f=uc(n({value:l}),t.font,"center","top");h=1.3*f.width,g=1.3*f.height,u=Math.max(u,h,7),m=Math.max(m,g,7)}var y=u/c,v=m/d;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var x=Math.max(0,Math.floor(Math.min(y,v))),b=vI(e.model),w=e.getExtent(),S=b.lastAutoInterval,C=b.lastTickCount;return null!=S&&null!=C&&Math.abs(S-x)<=1&&Math.abs(C-o)<=1&&S>x&&b.axisExtent0===w[0]&&b.axisExtent1===w[1]?x=S:(b.lastTickCount=o,b.lastAutoInterval=x,b.axisExtent0=w[0],b.axisExtent1=w[1]),x}(this)},e}();function kI(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var PI=2*Math.PI,DI=Yu.CMD,OI=["top","right","bottom","left"];function AI(e,t,n,i,a){var r=n.width,o=n.height;switch(e){case"top":i.set(n.x+r/2,n.y-t),a.set(0,-1);break;case"bottom":i.set(n.x+r/2,n.y+o+t),a.set(0,1);break;case"left":i.set(n.x-t,n.y+o/2),a.set(-1,0);break;case"right":i.set(n.x+r+t,n.y+o/2),a.set(1,0)}}function FI(e,t,n,i,a,r,o,s,l){o-=e,s-=t;var p=Math.sqrt(o*o+s*s),c=(o/=p)*n+e,d=(s/=p)*n+t;if(Math.abs(i-a)%PI<1e-4)return l[0]=c,l[1]=d,p-n;if(r){var u=i;i=em(a),a=em(u)}else i=em(i),a=em(a);i>a&&(a+=PI);var m=Math.atan2(s,o);if(m<0&&(m+=PI),m>=i&&m<=a||m+PI>=i&&m+PI<=a)return l[0]=c,l[1]=d,p-n;var h=n*Math.cos(i)+e,g=n*Math.sin(i)+t,f=n*Math.cos(a)+e,y=n*Math.sin(a)+t,v=(h-o)*(h-o)+(g-s)*(g-s),x=(f-o)*(f-o)+(y-s)*(y-s);return v0){t=t/180*Math.PI,qI.fromArray(e[0]),GI.fromArray(e[1]),zI.fromArray(e[2]),ws.sub(UI,qI,GI),ws.sub(jI,zI,GI);var n=UI.len(),i=jI.len();if(!(n<.001||i<.001)){UI.scale(1/n),jI.scale(1/i);var a=UI.dot(jI);if(Math.cos(t)1&&ws.copy($I,zI),$I.toArray(e[1])}}}}function YI(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,qI.fromArray(e[0]),GI.fromArray(e[1]),zI.fromArray(e[2]),ws.sub(UI,GI,qI),ws.sub(jI,zI,GI);var i=UI.len(),a=jI.len();if(!(i<.001||a<.001))if(UI.scale(1/i),jI.scale(1/a),UI.dot(t)=o)ws.copy($I,zI);else{$I.scaleAndAdd(jI,r/Math.tan(Math.PI/2-s));var l=zI.x!==GI.x?($I.x-GI.x)/(zI.x-GI.x):($I.y-GI.y)/(zI.y-GI.y);if(isNaN(l))return;l<0?ws.copy($I,GI):l>1&&ws.copy($I,zI)}$I.toArray(e[1])}}}function XI(e,t,n,i){var a="normal"===n,r=a?e:e.ensureState(n);r.ignore=t;var o=i.get("smooth");o&&!0===o&&(o=.3),r.shape=r.shape||{},o>0&&(r.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();a?e.useStyle(s):r.style=s}function ZI(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var a=Fo(i[0],i[1]),r=Fo(i[1],i[2]);if(!a||!r)return e.lineTo(i[1][0],i[1][1]),void e.lineTo(i[2][0],i[2][1]);var o=Math.min(a,r)*n,s=No([],i[1],i[0],o/a),l=No([],i[1],i[2],o/r),p=No([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],p[0],p[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&r&&S(-d/o,0,o);var f,y,v=e[0],x=e[o-1];return b(),f<0&&C(-f,.8),y<0&&C(y,.8),b(),w(f,y,1),w(y,f,-1),b(),f<0&&_(-f),y<0&&_(y),p}function b(){f=v.rect[t]-i,y=a-x.rect[t]-x.rect[n]}function w(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){S(i*n,0,o);var a=i+e;a<0&&C(-a*n,1)}else C(-e*n,1)}}function S(n,i,a){0!==n&&(p=!0);for(var r=i;r0)for(l=0;l0;l--){S(-(r[l-1]*d),l,o)}}}function _(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),i=0;i0?S(n,0,i+1):S(-n,o-i-1,o),(e-=n)<=0)return}}function nE(e,t,n,i){return tE(e,"y","height",t,n,i)}function iE(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new Ps(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var a=0;a=0&&n.attr(m.oldLayoutSelect),Dr(p,"emphasis")>=0&&n.attr(m.oldLayoutEmphasis)),tf(n,s,t,o)}else if(n.attr(s),!Zf(n).valueAnimation){var c=io(n.style.opacity,1);n.style.opacity=0,nf(n,{style:{opacity:c}},t,o)}if(m.oldLayout=s,n.states.select){var d=m.oldLayoutSelect={};cE(d,s,dE),cE(d,n.states.select,dE)}if(n.states.emphasis){var u=m.oldLayoutEmphasis={};cE(u,s,dE),cE(u,n.states.emphasis,dE)}Jf(n,o,l,t,t)}if(i&&!i.ignore&&!i.invisible){a=(m=pE(i)).oldLayout;var m,h={points:i.shape.points};a?(i.attr({shape:a}),tf(i,{shape:h},t)):(i.setShape(h),i.style.strokePercent=0,nf(i,{style:{strokePercent:1}},t)),m.oldLayout=h}},e}(),mE=Cd();function hE(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){var i=mE(t).labelManager;i||(i=mE(t).labelManager=new uE),i.clearLabels()})),e.registerUpdateLifecycle("series:layoutlabels",(function(e,t,n){var i=mE(t).labelManager;n.updatedSeries.forEach((function(e){i.addLabelsOfSeries(t.getViewOfSeriesModel(e))})),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()}))}aI(hE);var gE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return ze(t,e),t.prototype.getInitialData=function(e){return K_(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Mc,n=PS("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var i=this.getData().getVisual("symbol"),a=this.getData().getVisual("symbolRotate"),r="none"===i?"circle":i,o=.8*e.itemHeight,s=PS(r,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?a:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),r.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(ow);function fE(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var a=ib(e,t,n[0]);return null!=a?a+"":null}if(i){for(var r=[],o=0;o=0&&i.push(t[r])}return i.join(" ")}var vE=function(e){function t(t,n,i,a){var r=e.call(this)||this;return r.updateData(t,n,i,a),r}return ze(t,e),t.prototype._createSymbol=function(e,t,n,i,a){this.removeAll();var r=PS(e,-1,-1,2,2,null,a);r.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),r.drift=xE,this._symbolType=e,this.add(r)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){vh(this.childAt(0))},t.prototype.downplay=function(){xh(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,i,a){this.silent=!1;var r=e.getItemVisual(n,"symbol")||"circle",o=e.hostModel,s=t.getSymbolSize(e,n),l=r!==this._symbolType,p=a&&a.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(r,e,n,s,c)}else{(u=this.childAt(0)).silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};p?u.attr(d):tf(u,d,o,n),lf(u)}if(this._updateCommon(e,n,s,i,a),l){var u=this.childAt(0);if(!p){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:u.style.opacity}};u.scaleX=u.scaleY=0,u.style.opacity=0,nf(u,d,o,n)}}p&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,i,a){var r,o,s,l,p,c,d,u,m,h=this.childAt(0),g=e.hostModel;if(i&&(r=i.emphasisItemStyle,o=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,p=i.blurScope,d=i.labelStatesModels,u=i.hoverScale,m=i.cursorStyle,c=i.emphasisDisabled),!i||e.hasItemOption){var f=i&&i.itemModel?i.itemModel:e.getItemModel(t),y=f.getModel("emphasis");r=y.getModel("itemStyle").getItemStyle(),s=f.getModel(["select","itemStyle"]).getItemStyle(),o=f.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),p=y.get("blurScope"),c=y.get("disabled"),d=Uf(f),u=y.getShallow("scale"),m=f.getShallow("cursor")}var v=e.getItemVisual(t,"symbolRotate");h.attr("rotation",(v||0)*Math.PI/180||0);var x=OS(e.getItemVisual(t,"symbolOffset"),n);x&&(h.x=x[0],h.y=x[1]),m&&h.attr("cursor",m);var b=e.getItemVisual(t,"style"),w=b.fill;if(h instanceof bm){var S=h.style;h.useStyle(kr({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else h.__isEmptyBrush?h.useStyle(kr({},b)):h.useStyle(b),h.style.decal=null,h.setColor(w,a&&a.symbolInnerColor),h.style.strokeNoScale=!0;var C=e.getItemVisual(t,"liftZ"),_=this._z2;null!=C?null==_&&(this._z2=h.z2,h.z2+=C):null!=_&&(h.z2=_,this._z2=null);var T=a&&a.useNameLabel;zf(h,d,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return T?e.getName(t):fE(e,t)},inheritColor:w,defaultOpacity:b.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=h.ensureState("emphasis");I.style=r,h.ensureState("select").style=s,h.ensureState("blur").style=o;var E=null==u||!0===u?Math.max(1.1,3/this._sizeY):isFinite(u)&&u>0?+u:1;I.scaleX=this._sizeX*E,I.scaleY=this._sizeY*E,this.setSymbolScale(1),Oh(this,l,p,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var i=this.childAt(0),a=Um(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var o=i.getTextContent();o&&rf(o,{style:{opacity:0}},t,{dataIndex:a,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();rf(i,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:a,cb:e,removeOpt:r})},t.getSymbolSize=function(e,t){return DS(e.getItemVisual(t,"symbolSize"))},t}(Mc);function xE(e,t){this.parent.drift(e,t)}function bE(e,t,n,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function wE(e){return null==e||Kr(e)||(e={isIgnore:e}),e||{}}function SE(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Uf(t),cursorStyle:t.get("cursor")}}var CE=function(){function e(e){this.group=new Mc,this._SymbolCtor=e||vE}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=wE(t);var n=this.group,i=e.hostModel,a=this._data,r=this._SymbolCtor,o=t.disableAnimation,s=SE(e),l={disableAnimation:o},p=t.getSymbolPoint||function(t){return e.getItemLayout(t)};a||n.removeAll(),e.diff(a).add((function(i){var a=p(i);if(bE(e,a,i,t)){var o=new r(e,i,s,l);o.setPosition(a),e.setItemGraphicEl(i,o),n.add(o)}})).update((function(c,d){var u=a.getItemGraphicEl(d),m=p(c);if(bE(e,m,c,t)){var h=e.getItemVisual(c,"symbol")||"circle",g=u&&u.getSymbolType&&u.getSymbolType();if(!u||g&&g!==h)n.remove(u),(u=new r(e,c,s,l)).setPosition(m);else{u.updateData(e,c,s,l);var f={x:m[0],y:m[1]};o?u.attr(f):tf(u,f,i)}n.add(u),e.setItemGraphicEl(c,u)}else n.remove(u)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}),i)})).execute(),this._getSymbolPoint=p,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var i=e._getSymbolPoint(n);t.setPosition(i),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=SE(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function i(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=wE(n);for(var a=e.start;a0?n=i[0]:i[1]<0&&(n=i[1]);return n}(a,n),o=i.dim,s=a.dim,l=t.mapDimension(s),p=t.mapDimension(o),c="x"===s||"radius"===s?1:0,d=Br(e.dimensions,(function(e){return t.mapDimension(e)})),u=!1,m=t.getCalculationInfo("stackResultDimension");return W_(t,d[0])&&(u=!0,d[0]=m),W_(t,d[1])&&(u=!0,d[1]=m),{dataDimsForPoint:d,valueStart:r,valueAxisDim:s,baseAxisDim:o,stacked:!!u,valueDim:l,baseDim:p,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function TE(e,t,n,i){var a=NaN;e.stacked&&(a=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(a)&&(a=e.valueStart);var r=e.baseDataOffset,o=[];return o[r]=n.get(e.baseDim,i),o[1-r]=a,t.dataToPoint(o)}var IE=Math.min,EE=Math.max;function ME(e,t){return isNaN(e)||isNaN(t)}function kE(e,t,n,i,a,r,o,s,l){for(var p,c,d,u,m,h,g=n,f=0;f=a||g<0)break;if(ME(y,v)){if(l){g+=r;continue}break}if(g===n)e[r>0?"moveTo":"lineTo"](y,v),d=y,u=v;else{var x=y-p,b=v-c;if(x*x+b*b<.5){g+=r;continue}if(o>0){for(var w=g+r,S=t[2*w],C=t[2*w+1];S===y&&C===v&&f=i||ME(S,C))m=y,h=v;else{I=S-p,E=C-c;var P=y-p,D=S-y,O=v-c,A=C-v,F=void 0,R=void 0;if("x"===s){var B=I>0?1:-1;m=y-B*(F=Math.abs(P))*o,h=v,M=y+B*(R=Math.abs(D))*o,k=v}else if("y"===s){var N=E>0?1:-1;m=y,h=v-N*(F=Math.abs(O))*o,M=y,k=v+N*(R=Math.abs(A))*o}else F=Math.sqrt(P*P+O*O),m=y-I*o*(1-(T=(R=Math.sqrt(D*D+A*A))/(R+F))),h=v-E*o*(1-T),k=v+E*o*T,M=IE(M=y+I*o*T,EE(S,y)),k=IE(k,EE(C,v)),M=EE(M,IE(S,y)),h=v-(E=(k=EE(k,IE(C,v)))-v)*F/R,m=IE(m=y-(I=M-y)*F/R,EE(p,y)),h=IE(h,EE(c,v)),M=y+(I=y-(m=EE(m,IE(p,y))))*R/F,k=v+(E=v-(h=EE(h,IE(c,v))))*R/F}e.bezierCurveTo(d,u,m,h,y,v),d=M,u=k}else e.lineTo(y,v)}p=y,c=v,g+=r}return f}var PE=function(){this.smooth=0,this.smoothConstraint=!0},DE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return ze(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new PE},t.prototype.buildPath=function(e,t){var n=t.points,i=0,a=n.length/2;if(t.connectNulls){for(;a>0&&ME(n[2*a-2],n[2*a-1]);a--);for(;i=0){var f=o?(c-i)*g+i:(p-n)*g+n;return o?[e,f]:[f,e]}n=p,i=c;break;case r.C:p=a[l++],c=a[l++],d=a[l++],u=a[l++],m=a[l++],h=a[l++];var y=o?ul(n,p,d,m,e,s):ul(i,c,u,h,e,s);if(y>0)for(var v=0;v=0){f=o?cl(i,c,u,h,x):cl(n,p,d,m,x);return o?[e,f]:[f,e]}}n=m,i=h}}},t}(gm),OE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t}(PE),AE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return ze(t,e),t.prototype.getDefaultShape=function(){return new OE},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,a=0,r=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;r>0&&ME(n[2*r-2],n[2*r-1]);r--);for(;a=0;o--){var s=e.getDimensionInfo(i[o].dimension);if("x"===(a=s&&s.coordDim)||"y"===a){r=i[o];break}}if(r){var l=t.getAxis(a),p=Br(r.stops,(function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}})),c=p.length,d=r.outerColors.slice();c&&p[0].coord>p[c-1].coord&&(p.reverse(),d.reverse());var u=function(e,t){var n,i,a=[],r=e.length;function o(e,t,n){var i=e.coord;return{coord:n,color:Hl((n-i)/(t.coord-i),[e.color,t.color])}}for(var s=0;st){i?a.push(o(i,l,t)):n&&a.push(o(n,l,0),o(n,l,t));break}n&&(a.push(o(n,l,0)),n=null),a.push(l),i=l}}return a}(p,"x"===a?n.getWidth():n.getHeight()),m=u.length;if(!m&&c)return p[0].coord<0?d[1]?d[1]:p[c-1].color:d[0]?d[0]:p[0].color;var h=u[0].coord-10,g=u[m-1].coord+10,f=g-h;if(f<.001)return"transparent";Rr(u,(function(e){e.offset=(e.coord-h)/f})),u.push({offset:m?u[m-1].offset:.5,color:d[1]||"transparent"}),u.unshift({offset:m?u[0].offset:.5,color:d[0]||"transparent"});var y=new Ug(0,0,0,0,u,!0);return y[a]=h,y[a+"2"]=g,y}}}function jE(e,t,n){var i=e.get("showAllSymbol"),a="auto"===i;if(!i||a){var r=n.getAxesByScale("ordinal")[0];if(r&&(!a||!function(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var a=t.count(),r=Math.max(1,Math.round(a/5)),o=0;oi)return!1;return!0}(r,t))){var o=t.mapDimension(r.dim),s={};return Rr(r.getViewLabels(),(function(e){var t=r.scale.getRawOrdinalNumber(e.tickValue);s[t]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function HE(e,t){return[e[2*t],e[2*t+1]]}function WE(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(m.getState("emphasis").style.lineWidth=+m.style.lineWidth+1);Um(m).seriesIndex=e.seriesIndex,Oh(m,P,D,O);var A=GE(e.get("smooth")),F=e.get("smoothMonotone");if(m.setShape({smooth:A,smoothMonotone:F,connectNulls:S}),h){var R=o.getCalculationInfo("stackedOnSeries"),B=0;h.useStyle(Pr(l.getAreaStyle(),{fill:E,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),R&&(B=GE(R.get("smooth"))),h.setShape({smooth:A,stackedOnSmooth:B,smoothMonotone:F,connectNulls:S}),Bh(h,e,"areaStyle"),Um(h).seriesIndex=e.seriesIndex,Oh(h,P,D,O)}var N=function(e){i._changePolyState(e)};o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=N)})),this._polyline.onHoverStateChange=N,this._data=o,this._coordSys=a,this._stackedOnPoints=b,this._points=p,this._step=I,this._valueOrigin=v,e.get("triggerLineEvent")&&(this.packEventData(e,m),h&&this.packEventData(e,h))},t.prototype.packEventData=function(e,t){Um(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,i){var a=e.getData(),r=Sd(a,i);if(this._changePolyState("emphasis"),!(r instanceof Array)&&null!=r&&r>=0){var o=a.getLayout("points"),s=a.getItemGraphicEl(r);if(!s){var l=o[2*r],p=o[2*r+1];if(isNaN(l)||isNaN(p))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,p))return;var c=e.get("zlevel")||0,d=e.get("z")||0;(s=new vE(a,r)).x=l,s.y=p,s.setZ(c,d);var u=s.getSymbolPath().getTextContent();u&&(u.zlevel=c,u.z=d,u.z2=this._polyline.z2+1),s.__temp=!0,a.setItemGraphicEl(r,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else vw.prototype.highlight.call(this,e,t,n,i)},t.prototype.downplay=function(e,t,n,i){var a=e.getData(),r=Sd(a,i);if(this._changePolyState("normal"),null!=r&&r>=0){var o=a.getItemGraphicEl(r);o&&(o.__temp?(a.setItemGraphicEl(r,null),this.group.remove(o)):o.downplay())}else vw.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;mh(this._polyline,e),t&&mh(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new DE({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new AE({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,a,r=t.getBaseAxis(),o=r.inverse;"cartesian2d"===t.type?(i=r.isHorizontal(),a=!1):"polar"===t.type&&(i="angle"===r.dim,a=!0);var s=e.hostModel,l=s.get("animationDuration");jr(l)&&(l=l(null));var p=s.get("animationDelay")||0,c=jr(p)?p(null):p;e.eachItemGraphicEl((function(e,r){var s=e;if(s){var d=[e.x,e.y],u=void 0,m=void 0,h=void 0;if(n)if(a){var g=n,f=t.pointToCoord(d);i?(u=g.startAngle,m=g.endAngle,h=-f[1]/180*Math.PI):(u=g.r0,m=g.r,h=f[0])}else{var y=n;i?(u=y.x,m=y.x+y.width,h=e.x):(u=y.y+y.height,m=y.y,h=e.y)}var v=m===u?0:(h-u)/(m-u);o&&(v=1-v);var x=jr(p)?p(r):l*v+c,b=s.getSymbolPath(),w=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:x}),w&&w.animateFrom({style:{opacity:0}},{duration:300,delay:x}),b.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t,n){var i=e.getModel("endLabel");if(WE(e)){var a=e.getData(),r=this._polyline,o=a.getLayout("points");if(!o)return r.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Pm({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);var l=function(e){for(var t,n,i=e.length/2;i>0&&(t=e[2*i-2],n=e[2*i-1],isNaN(t)||isNaN(n));i--);return i-1}(o);l>=0&&(zf(r,Uf(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:l,defaultText:function(e,t,n){return null!=n?yE(a,n):fE(a,e)},enableTextSetter:!0},function(e,t){var n=t.getBaseAxis(),i=n.isHorizontal(),a=n.inverse,r=i?a?"right":"left":"center",o=i?"middle":a?"top":"bottom";return{normal:{align:e.get("align")||r,verticalAlign:e.get("verticalAlign")||o}}}(i,t)),r.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,a,r,o){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var p=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),u=r.get("precision"),m=r.get("distance")||0,h=o.getBaseAxis(),g=h.isHorizontal(),f=h.inverse,y=t.shape,v=f?g?y.x:y.y+y.height:g?y.x+y.width:y.y,x=(g?m:0)*(f?-1:1),b=(g?0:-m)*(f?-1:1),w=g?"x":"y",S=function(e,t,n){for(var i,a,r=e.length/2,o="x"===n?0:1,s=0,l=-1,p=0;p=t||i>=t&&a<=t){l=p;break}s=p,i=a}else i=a;return{range:[s,l],t:(t-i)/(a-i)}}(p,v,w),C=S.range,_=C[1]-C[0],T=void 0;if(_>=1){if(_>1&&!d){var I=HE(p,C[0]);s.attr({x:I[0]+x,y:I[1]+b}),a&&(T=c.getRawValue(C[0]))}else{(I=l.getPointOn(v,w))&&s.attr({x:I[0]+x,y:I[1]+b});var E=c.getRawValue(C[0]),M=c.getRawValue(C[1]);a&&(T=Od(n,u,E,M,S.t))}i.lastFrameIndex=C[0]}else{var k=1===e||i.lastFrameIndex>0?C[0]:0;I=HE(p,k);a&&(T=c.getRawValue(k)),s.attr({x:I[0]+x,y:I[1]+b})}if(a){var P=Zf(s);"function"==typeof P.setLabelText&&P.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,i,a,r,o){var s=this._polyline,l=this._polygon,p=e.hostModel,c=function(e,t,n,i,a,r,o){for(var s=function(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}(e,t),l=[],p=[],c=[],d=[],u=[],m=[],h=[],g=_E(a,t,o),f=e.getLayout("points")||[],y=t.getLayout("points")||[],v=0;v3e3||l&&qE(u,h)>3e3)return s.stopAnimation(),s.setShape({points:m}),void(l&&(l.stopAnimation(),l.setShape({points:m,stackedOnPoints:h})));s.shape.__points=c.current,s.shape.points=d;var g={shape:{points:m}};c.current!==d&&(g.shape.__points=c.next),s.stopAnimation(),tf(s,g,p),l&&(l.setShape({points:d,stackedOnPoints:u}),l.stopAnimation(),tf(l,{shape:{stackedOnPoints:h}},p),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var f=[],y=c.status,v=0;vt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;nt&&(t=r,n=a)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},ZE=function(e){return Math.round(e.length/2)};function QE(e){return{seriesType:e,reset:function(e,t,n){var i=e.getData(),a=e.get("sampling"),r=e.coordinateSystem,o=i.count();if(o>10&&"cartesian2d"===r.type&&a){var s=r.getBaseAxis(),l=r.getOtherAxis(s),p=s.getExtent(),c=n.getDevicePixelRatio(),d=Math.abs(p[1]-p[0])*(c||1),u=Math.round(o/d);if(isFinite(u)&&u>1){"lttb"===a&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/u));var m=void 0;Hr(a)?m=XE[a]:jr(a)&&(m=a),m&&e.setData(i.downSample(i.mapDimension(l.dim),1/u,m,ZE))}}}}}function JE(e){e.registerChartView(KE),e.registerSeriesModel(gE),e.registerLayout(YE("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,QE("line"))}var eM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.getInitialData=function(e,t){return K_(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var i=this.coordinateSystem;if(i&&i.clampData){var a=i.clampData(e),r=i.dataToPoint(a);if(n)Rr(i.getAxes(),(function(e,n){if("category"===e.type&&null!=t){var i=e.getTicksCoords(),o=e.getTickModel().get("alignWithLabel"),s=a[n],l="x1"===t[n]||"y1"===t[n];if(l&&!o&&(s+=1),i.length<2)return;if(2===i.length)return void(r[n]=e.toGlobalCoord(e.getExtent()[l?1:0]));for(var p=void 0,c=void 0,d=1,u=0;us){c=(m+p)/2;break}1===u&&(d=h-i[0].tickValue)}null==c&&(p?p&&(c=i[i.length-1].coord):c=i[0].coord),r[n]=e.toGlobalCoord(c)}}));else{var o=this.getData(),s=o.getLayout("offset"),l=o.getLayout("size"),p=i.getBaseAxis().isHorizontal()?0:1;r[p]+=s+l/2}return r}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(ow);ow.registerClass(eM);var tM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.getInitialData=function(){return K_(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=gy(eM.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(eM),nM=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},iM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return ze(t,e),t.prototype.getDefaultShape=function(){return new nM},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=.5*(r-a),s=a+o,l=t.startAngle,p=t.endAngle,c=t.clockwise,d=2*Math.PI,u=c?p-lr)return!0;r=p}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,i=n.getExtent(),a=Math.max(0,i[0]),r=Math.min(i[1],n.getOrdinalMeta().categories.length-1);a<=r;++a)if(e.ordinalNumbers[a]!==n.getRawOrdinalNumber(a))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,i){if(this._isOrderChangedWithinSameData(e,t,n)){var a=this._dataSort(e,n,t);this._isOrderDifferentInView(a,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:a}))}},t.prototype._dispatchInitSort=function(e,t,n){var i=t.baseAxis,a=this._dataSort(e,i,(function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:a})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(t){sf(t,e,Um(t).dataIndex)}))):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(vw),cM={cartesian2d:function(e,t){var n=t.width<0?-1:1,i=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var a=e.x+e.width,r=e.y+e.height,o=sM(t.x,e.x),s=lM(t.x+t.width,a),l=sM(t.y,e.y),p=lM(t.y+t.height,r),c=sa?s:o,t.y=d&&l>r?p:l,t.width=c?0:s-o,t.height=d?0:p-l,n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),c||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}var a=lM(t.r,e.r),r=sM(t.r0,e.r0);t.r=a,t.r0=r;var o=a-r<0;if(n<0){i=t.r;t.r=t.r0,t.r0=i}return o}},dM={cartesian2d:function(e,t,n,i,a,r,o,s,l){var p=new Em({shape:kr({},i),z2:1});(p.__dataIndex=n,p.name="item",r)&&(p.shape[a?"height":"width"]=0);return p},polar:function(e,t,n,i,a,r,o,s,l){var p=!a&&l?iM:_g,c=new p({shape:i,z2:1});c.name="item";var d,u,m=vM(a);if(c.calculateTextPosition=(d=m,u=({isRoundCap:p===iM}||{}).isRoundCap,function(e,t,n){var i=t.position;if(!i||i instanceof Array)return yc(e,t,n);var a=d(i),r=null!=t.distance?t.distance:5,o=this.shape,s=o.cx,l=o.cy,p=o.r,c=o.r0,m=(p+c)/2,h=o.startAngle,g=o.endAngle,f=(h+g)/2,y=u?Math.abs(p-c)/2:0,v=Math.cos,x=Math.sin,b=s+p*v(h),w=l+p*x(h),S="left",C="top";switch(a){case"startArc":b=s+(c-r)*v(f),w=l+(c-r)*x(f),S="center",C="top";break;case"insideStartArc":b=s+(c+r)*v(f),w=l+(c+r)*x(f),S="center",C="bottom";break;case"startAngle":b=s+m*v(h)+aM(h,r+y,!1),w=l+m*x(h)+rM(h,r+y,!1),S="right",C="middle";break;case"insideStartAngle":b=s+m*v(h)+aM(h,-r+y,!1),w=l+m*x(h)+rM(h,-r+y,!1),S="left",C="middle";break;case"middle":b=s+m*v(f),w=l+m*x(f),S="center",C="middle";break;case"endArc":b=s+(p+r)*v(f),w=l+(p+r)*x(f),S="center",C="bottom";break;case"insideEndArc":b=s+(p-r)*v(f),w=l+(p-r)*x(f),S="center",C="top";break;case"endAngle":b=s+m*v(g)+aM(g,r+y,!0),w=l+m*x(g)+rM(g,r+y,!0),S="left",C="middle";break;case"insideEndAngle":b=s+m*v(g)+aM(g,-r+y,!0),w=l+m*x(g)+rM(g,-r+y,!0),S="right",C="middle";break;default:return yc(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=C,e}),r){var h=a?"r":"endAngle",g={};c.shape[h]=a?i.r0:i.startAngle,g[h]=i[h],(s?tf:nf)(c,{shape:g},r)}return c}};function uM(e,t,n,i,a,r,o,s){var l,p;r?(p={x:i.x,width:i.width},l={y:i.y,height:i.height}):(p={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?tf:nf)(n,{shape:l},t,a,null),(o?tf:nf)(n,{shape:p},t?e.baseAxis.model:null,a)}function mM(e,t){for(var n=0;n0?1:-1,o=i.height>0?1:-1;return{x:i.x+r*a/2,y:i.y+o*a/2,width:i.width-r*a,height:i.height-o*a}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function vM(e){return function(e){var t=e?"Arc":"Angle";return function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}(e)}function xM(e,t,n,i,a,r,o,s){var l=t.getItemVisual(n,"style");if(s){if(!r.get("roundCap")){var p=e.shape;kr(p,oM(i.getModel("itemStyle"),p,!0)),e.setShape(p)}}else{var c=i.get(["itemStyle","borderRadius"])||0;e.setShape("r",c)}e.useStyle(l);var d=i.getShallow("cursor");d&&e.attr("cursor",d);var u=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",m=Uf(i);zf(e,m,{labelFetcher:r,labelDataIndex:n,defaultText:fE(r.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:u});var h=e.getTextContent();if(s&&h){var g=i.get(["label","position"]);e.textConfig.inside="middle"===g||null,function(e,t,n,i){if($r(i))e.setTextConfig({rotation:i});else if(Ur(t))e.setTextConfig({rotation:0});else{var a,r=e.shape,o=r.clockwise?r.startAngle:r.endAngle,s=r.clockwise?r.endAngle:r.startAngle,l=(o+s)/2,p=n(t);switch(p){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":a=l;break;case"startAngle":case"insideStartAngle":a=o;break;case"endAngle":case"insideEndAngle":a=s;break;default:return void e.setTextConfig({rotation:0})}var c=1.5*Math.PI-a;"middle"===p&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),e.setTextConfig({rotation:c})}}(e,"outside"===g?u:g,vM(o),i.get(["label","rotate"]))}Qf(h,m,r.getRawValue(n),(function(e){return yE(t,e)}));var f=i.getModel(["emphasis"]);Oh(e,f.get("focus"),f.get("blurScope"),f.get("disabled")),Bh(e,i),function(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}(a)&&(e.style.fill="none",e.style.stroke="none",Rr(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}var bM=function(){},wM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return ze(t,e),t.prototype.getDefaultShape=function(){return new bM},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.baseDimIdx,a=1-this.baseDimIdx,r=[],o=[],s=this.barWidth,l=0;l=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return o[c]}return-1}(this,e.offsetX,e.offsetY);Um(this).dataIndex=t>=0?t:null}),30,!1);function _M(e,t,n){if(NE(n,"cartesian2d")){var i=t,a=n.getArea();return{x:e?i.x:a.x,y:e?a.y:i.y,width:e?i.width:a.width,height:e?a.height:i.height}}var r=t;return{cx:(a=n.getArea()).cx,cy:a.cy,r0:e?a.r0:r.r0,r:e?a.r:r.r,startAngle:e?r.startAngle:0,endAngle:e?r.endAngle:2*Math.PI}}function TM(e){e.registerChartView(pM),e.registerSeriesModel(tM),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,zr(xT,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,bT("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,QE("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))}))}var IM=2*Math.PI,EM=Math.PI/180;function MM(e,t){return gv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function kM(e,t){var n=MM(e,t),i=e.get("center"),a=e.get("radius");Ur(a)||(a=[0,a]);var r,o,s=Vc(n.width,t.getWidth()),l=Vc(n.height,t.getHeight()),p=Math.min(s,l),c=Vc(a[0],p/2),d=Vc(a[1],p/2),u=e.coordinateSystem;if(u){var m=u.dataToPoint(i);r=m[0]||0,o=m[1]||0}else Ur(i)||(i=[i,i]),r=Vc(i[0],s)+n.x,o=Vc(i[1],l)+n.y;return{cx:r,cy:o,r0:c,r:d}}function PM(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),i=t.mapDimension("value"),a=MM(e,n),r=kM(e,n),o=r.cx,s=r.cy,l=r.r,p=r.r0,c=-e.get("startAngle")*EM,d=e.get("endAngle"),u=e.get("padAngle")*EM;d="auto"===d?c-IM:-d*EM;var m=e.get("minAngle")*EM+u,h=0;t.each(i,(function(e){!isNaN(e)&&h++}));var g=t.getSum(i),f=Math.PI/(g||h)*2,y=e.get("clockwise"),v=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var w=y?1:-1,S=[c,d],C=w*u/2;Ku(S,!y),c=S[0],d=S[1];var _=Math.abs(d-c),T=_,I=0,E=c;if(t.setLayout({viewRect:a,r:l}),t.each(i,(function(e,n){var i;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:y,cx:o,cy:s,r0:p,r:v?NaN:l});else{(i="area"!==v?0===g&&x?f:e*f:_/h)i?c=r=E+w*i/2:(r=E+C,c=a-C),t.setItemLayout(n,{angle:i,startAngle:r,endAngle:c,clockwise:y,cx:o,cy:s,r0:p,r:v?Lc(e,b,[p,l]):l}),E=a}})),Tn?o:r,c=Math.abs(l.label.y-n);if(c>=p.maxY){var d=l.label.x-t-l.len2*a,u=i+l.len,h=Math.abs(d)e.unconstrainedWidth?null:m:null;i.setStyle("width",h)}var g=i.getBoundingRect();r.width=g.width;var f=(i.style.margin||0)+2.1;r.height=g.height+f,r.y-=(r.height-d)/2}}}function RM(e){return"center"===e.position}function BM(e){var t,n,i=e.getData(),a=[],r=!1,o=(e.get("minShowLabelAngle")||0)*OM,s=i.getLayout("viewRect"),l=i.getLayout("r"),p=s.width,c=s.x,d=s.y,u=s.height;function m(e){e.ignore=!0}i.each((function(e){var s=i.getItemGraphicEl(e),d=s.shape,u=s.getTextContent(),h=s.getTextGuideLine(),g=i.getItemModel(e),f=g.getModel("label"),y=f.get("position")||g.get(["emphasis","label","position"]),v=f.get("distanceToLabelLine"),x=f.get("alignTo"),b=Vc(f.get("edgeDistance"),p),w=f.get("bleedMargin"),S=g.getModel("labelLine"),C=S.get("length");C=Vc(C,p);var _=S.get("length2");if(_=Vc(_,p),Math.abs(d.endAngle-d.startAngle)0?"right":"left":P>0?"left":"right"}var L=Math.PI,V=0,q=f.get("rotate");if($r(q))V=q*(L/180);else if("center"===y)V=0;else if("radial"===q||!0===q){V=P<0?-k+L:-k}else if("tangential"===q&&"outside"!==y&&"outer"!==y){var G=Math.atan2(P,D);G<0&&(G=2*L+G),D>0&&(G=L+G),V=G-L}if(r=!!V,u.x=T,u.y=I,u.rotation=V,u.setStyle({verticalAlign:"middle"}),O){u.setStyle({align:M});var z=u.states.select;z&&(z.x+=u.x,z.y+=u.y)}else{var U=u.getBoundingRect().clone();U.applyTransform(u.getComputedTransform());var j=(u.style.margin||0)+2.1;U.y-=j/2,U.height+=j,a.push({label:u,labelLine:h,position:y,len:C,len2:_,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new ws(P,D),linePoints:E,textAlign:M,labelDistance:v,labelAlignTo:x,edgeDistance:b,bleedMargin:w,rect:U,unconstrainedWidth:U.width,labelStyleWidth:u.style.width})}s.setTextConfig({inside:O})}})),!r&&e.get("avoidLabelOverlap")&&function(e,t,n,i,a,r,o,s){for(var l=[],p=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,u=0;u0){for(var l=r.getItemLayout(0),p=1;isNaN(l&&l.startAngle)&&p=n.r0}},t.type="pie",t}(vw);function VM(e,t,n){t=Ur(t)&&{coordDimensions:t}||kr({encodeDefine:e.getEncode()},t);var i=e.getSource(),a=q_(i,t).dimensions,r=new V_(a,e);return r.initData(i,n),r}var qM=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),GM=Cd(),zM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new qM(Gr(this.getData,this),Gr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return VM(this,{coordDimensions:["value"],encodeDefaulter:zr(qv,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=GM(n),a=i.seats;if(!a){var r=[];n.each(n.mapDimension("value"),(function(e){r.push(e)})),a=i.seats=Hc(r,n.hostModel.get("percentPrecision"))}var o=e.prototype.getDataParams.call(this,t);return o.percent=a[t]||0,o.$vars.push("percent"),o},t.prototype._defaultLabelLine=function(e){ud(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(ow);function UM(e){e.registerChartView(LM),e.registerSeriesModel(zM),fS("pie",e.registerAction),e.registerLayout(zr(PM,"pie")),e.registerProcessor(DM("pie")),e.registerProcessor(function(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf((function(e){var t=n.mapDimension("value"),i=n.get(t,e);return!($r(i)&&!isNaN(i)&&i<0)}))}}}("pie"))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}ze(t,e),t.prototype.getInitialData=function(e,t){return K_(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}}}(ow);var jM=function(){},HM=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return ze(t,e),t.prototype.getDefaultShape=function(){return new jM},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,i=t.points,a=t.size,r=this.symbolProxy,o=r.shape,s=e.getContext?e.getContext():e,l=s&&a[0]<4,p=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,p=i[l]-r/2,c=i[l+1]-o/2;if(e>=p&&t>=c&&e<=p+r&&t<=c+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return e=n[0],t=n[1],i.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,i=t.size,a=i[0],r=i[1],o=1/0,s=1/0,l=-1/0,p=-1/0,c=0;c=0&&(l.dataIndex=n+(e.startIndex||0))}))},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),$M=(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var a=YE("").reset(e,t,n);a.progress&&a.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new WM:new CE,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter"}(vw),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(Sv)),KM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ed).models[0]},t.type="cartesian2dAxis",t}(Sv);Ar(KM,tI);var YM={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},XM=Er({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},YM),ZM=Er({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},YM),QM={category:XM,value:ZM,time:Er({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},ZM),log:Pr({logBase:10},ZM)},JM={value:1,category:1,time:1,log:1};function ek(e,t,n,i){Rr(JM,(function(a,r){var o=Er(Er({},QM[r],!0),i,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+r,n}return ze(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=yv(this),i=n?xv(e):{};Er(e,t.getTheme().get(r+"Axis")),Er(e,this.getDefaultOption()),e.type=tk(e),n&&vv(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=Z_.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.getTicksGenerator=function(){var e=this.option;if("value"===e.type)return e.ticksGenerator},n.type=t+"Axis."+r,n.defaultOption=o,n}(n);e.registerComponentModel(s)})),e.registerSubTypeDefaulter(t+"Axis",tk)}function tk(e){return e.type||(e.data?"category":"value")}var nk=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return Br(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Lr(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),ik=["x","y"];function ak(e){return"interval"===e.type||"time"===e.type}var rk=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=ik,t}return ze(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(ak(e)&&ak(t)){var n=e.getExtent(),i=t.getExtent(),a=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),o=n[1]-n[0],s=i[1]-i[0];if(o&&s){var l=(r[0]-a[0])/o,p=(r[1]-a[1])/s,c=a[0]-n[0]*l,d=a[1]-i[0]*p,u=this._transform=[l,0,0,p,c,d];this._invTransform=xs([],u)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),i=this.dataToPoint(t),a=this.getArea(),r=new Ps(n[0],n[1],i[0]-n[0],i[1]-n[1]);return a.intersect(r)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],a=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=a&&isFinite(a))return Lo(n,e,this._transform);var r=this.getAxis("x"),o=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,t)),n[1]=o.toGlobalCoord(o.dataToCoord(a,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,a=n.getExtent(),r=i.getExtent(),o=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(a[0],a[1]),o),Math.max(a[0],a[1])),t[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return Lo(n,e,this._invTransform);var i=this.getAxis("x"),a=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(e[0]),t),n[1]=a.coordToData(a.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1])-e,a=Math.min(n[0],n[1])-e,r=Math.max(t[0],t[1])-i+e,o=Math.max(n[0],n[1])-a+e;return new Ps(i,a,r,o)},t}(nk),ok=function(e){function t(t,n,i,a,r){var o=e.call(this,t,n,i)||this;return o.index=0,o.type=a||"value",o.position=r||"bottom",o}return ze(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(MI);function sk(e,t,n){n=n||{};var i=e.coordinateSystem,a=t.axis,r={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,p=a.dim,c=i.getRect(),d=[c.x,c.x+c.width,c.y,c.y+c.height],u={left:0,right:1,top:0,bottom:1,onZero:2},m=t.get("offset")||0,h="x"===p?[d[2]-m,d[3]+m]:[d[0]-m,d[1]+m];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));h[u.onZero]=Math.max(Math.min(g,h[1]),h[0])}r.position=["y"===p?h[u[l]]:d[0],"x"===p?h[u[l]]:d[3]],r.rotation=Math.PI/2*("x"===p?0:1);r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=o?h[u[s]]-h[u.onZero]:0,t.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),no(n.labelInside,t.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var f=t.get(["axisLabel","rotate"]);return r.labelRotate="top"===l?-f:f,r.z2=1,r}function lk(e){return"cartesian2d"===e.get("coordinateSystem")}function pk(e){var t={xAxisModel:null,yAxisModel:null};return Rr(t,(function(n,i){var a=i.replace(/Model$/,""),r=e.getReferringComponents(a,Ed).models[0];t[i]=r})),t}var ck=Math.log;function dk(e,t,n){var i=pT.prototype,a=i.getTicks.call(n),r=i.getTicks.call(n,!0),o=a.length-1,s=i.getInterval.call(n),l=WT(e,t),p=l.extent,c=l.fixMin,d=l.fixMax;if("log"===e.type){var u=ck(e.base);p=[ck(p[0])/u,ck(p[1])/u]}e.setExtent(p[0],p[1]),e.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:d});var m=i.getExtent.call(e);c&&(p[0]=m[0]),d&&(p[1]=m[1]);var h=i.getInterval.call(e),g=p[0],f=p[1];if(c&&d)h=(f-g)/o;else if(c)for(f=p[0]+h*o;fp[0]&&isFinite(g)&&isFinite(p[0]);)h=tT(h),g=p[1]-h*o;else{e.getTicks().length-1>o&&(h=tT(h));var y=h*o;(g=qc((f=Math.ceil(p[1]/h)*h)-y))<0&&p[0]>=0?(g=0,f=qc(y)):f>0&&p[1]<=0&&(f=0,g=-qc(y))}var v=(a[0].value-r[0].value)/s,x=(a[o].value-r[o].value)/s;i.setExtent.call(e,g+h*v,f+h*x),i.setInterval.call(e,h),(v||x)&&i.setNiceExtent.call(e,g+h,f-h)}var uk=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=ik,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function i(e){var t,n=qr(e),i=n.length;if(i){for(var a=[],r=i-1;r>=0;r--){var o=(l=e[+n[r]]).model,s=l.scale;J_(s)&&o.get("alignTicks")&&null==o.get("interval")&&null==o.getTicksGenerator()?a.push(l):($T(s,o),J_(s)&&!s.isBlank()&&(t=l))}if(a.length){for(;!t&&a.length;){var l;$T((l=a.pop()).scale,l.model),l.scale.isBlank()||(t=l)}a.length&&t&&Rr(a,(function(e){dk(e.scale,e.model,t.scale)}))}}}this._updateScale(e,this.model),i(n.x),i(n.y);var a={};Rr(n.x,(function(e){hk(n,"y",e,a)})),Rr(n.y,(function(e){hk(n,"x",e,a)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),r=gv(i,{width:t.getWidth(),height:t.getHeight()});this._rect=r;var o=this._axesList;function s(){Rr(o,(function(e){var t=e.isHorizontal(),n=t?[0,r.width]:[0,r.height],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),function(e,t){var n=e.getExtent(),i=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return i-e+t}}(e,t?r.x:r.y)}))}s(),a&&(Rr(o,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var i,a,r=n.getExtent();a=n instanceof sT?n.count():(i=n.getTicks()).length;var o,s=e.getLabelModel(),l=YT(e),p=1;a>40&&(p=Math.ceil(a/40));for(var c=0;c0&&i>0||n<0&&i<0)}(e)}var fk=Math.PI,yk=function(){function e(e,t){this.group=new Mc,this.opt=t,this.axisModel=e,Pr(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Mc({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!vk[e]},e.prototype.add=function(e){vk[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var i,a,r=$c(t-e);return Kc(r)?(a=n>0?"top":"bottom",i="center"):Kc(r-fk)?(a=n>0?"bottom":"top",i="center"):(a="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),vk={axisLine:function(e,t,n,i){var a=t.get(["axisLine","show"]);if("auto"===a&&e.handleAutoShown&&(a=e.handleAutoShown("axisLine")),a){var r=t.axis.getExtent(),o=i.transform,s=[r[0],0],l=[r[1],0],p=s[0]>l[0];o&&(Lo(s,s,o),Lo(l,l,o));var c=kr({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),d=new Fg({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});Sf(d.shape,d.style.lineWidth),d.anid="line",n.add(d);var u=t.get(["axisLine","symbol"]);if(null!=u){var m=t.get(["axisLine","symbolSize"]);Hr(u)&&(u=[u,u]),(Hr(m)||$r(m))&&(m=[m,m]);var h=OS(t.get(["axisLine","symbolOffset"])||0,m),g=m[0],f=m[1];Rr([{rotate:e.rotation+Math.PI/2,offset:h[0],r:0},{rotate:e.rotation-Math.PI/2,offset:h[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,i){if("none"!==u[i]&&null!=u[i]){var a=PS(u[i],-g/2,-f/2,g,f,c.stroke,!0),r=t.r+t.offset,o=p?l:s;a.attr({rotation:t.rotate,x:o[0]+r*Math.cos(e.rotation),y:o[1]-r*Math.sin(e.rotation),silent:!0,z2:11}),n.add(a)}}))}}},axisTickLabel:function(e,t,n,i){var a=function(e,t,n,i){var a=n.axis,r=n.getModel("axisTick"),o=r.get("show");"auto"===o&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick"));if(!o||a.scale.isBlank())return;for(var s=r.getModel("lineStyle"),l=i.tickDirection*r.get("length"),p=Sk(a.getTicksCoords(),t.transform,l,Pr(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;cd[1]?-1:1,m=["start"===s?d[0]-u*c:"end"===s?d[1]+u*c:(d[0]+d[1])/2,wk(s)?e.labelOffset+l*c:0],h=t.get("nameRotate");null!=h&&(h=h*fk/180),wk(s)?r=yk.innerTextLayout(e.rotation,null!=h?h:e.rotation,l):(r=function(e,t,n,i){var a,r,o=$c(n-e),s=i[0]>i[1],l="start"===t&&!s||"start"!==t&&s;Kc(o-fk/2)?(r=l?"bottom":"top",a="center"):Kc(o-1.5*fk)?(r=l?"top":"bottom",a="center"):(r="middle",a=o<1.5*fk&&o>fk/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:a,textVerticalAlign:r}}(e.rotation,s,h||0,d),null!=(o=e.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(r.rotation)),!isFinite(o)&&(o=null)));var g=p.getFont(),f=t.get("nameTruncate",!0)||{},y=f.ellipsis,v=no(e.nameTruncateMaxWidth,f.maxWidth,o),x=new Pm({x:m[0],y:m[1],rotation:r.rotation,silent:yk.isLabelSilent(t),style:jf(p,{text:a,font:g,overflow:"truncate",width:v,ellipsis:y,fill:p.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:p.get("align")||r.textAlign,verticalAlign:p.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(Rf({el:x,componentModel:t,itemName:a}),x.__fullText=a,x.anid="name",t.get("triggerEvent")){var b=yk.makeAxisEventDataBase(t);b.targetType="axisName",b.name=a,Um(x).eventData=b}i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};function xk(e){e&&(e.ignore=!0)}function bk(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var a=ms([]);return ys(a,a,-e.rotation),n.applyTransform(gs([],a,e.getLocalTransform())),i.applyTransform(gs([],a,t.getLocalTransform())),n.intersect(i)}}function wk(e){return"middle"===e||"center"===e}function Sk(e,t,n,i,a){for(var r=[],o=[],s=[],l=0;l=0||e===t}function Tk(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[Ek(e)]}function Ik(e){return!!e.get(["handle","show"])}function Ek(e){return e.type+"||"+e.id}var Mk={},kk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.render=function(t,n,i,a){this.axisPointerClass&&function(e){var t=Tk(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,a=n.option,r=n.get("status"),o=n.get("value");null!=o&&(o=i.parse(o));var s=Ik(n);null==r&&(a.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var u=o;null!=d.color&&(u=Pr({color:d.color},o));var m=Er(Ir(d),{boundaryGap:e,splitNumber:t,scale:n,axisLine:i,axisTick:a,axisLabel:r,name:d.text,showName:s,nameLocation:"end",nameGap:p,nameTextStyle:u,triggerEvent:c},!1);if(Hr(l)){var h=m.name;m.name=l.replace("{value}",null!=h?h:"")}else jr(l)&&(m.name=l(m.name,m));var g=new uy(m,null,this.ecModel);return Ar(g,tI.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Er({lineStyle:{color:"#bbb"}},Kk.axisLine),axisLabel:Yk(Kk.axisLabel,!1),axisTick:Yk(Kk.axisTick,!1),splitLine:Yk(Kk.splitLine,!0),splitArea:Yk(Kk.splitArea,!0),indicator:[]},t}(Sv),Zk=["axisLine","axisTickLabel","axisName"],Qk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;Rr(Br(t.getIndicatorAxes(),(function(e){var n=e.model.get("showName")?e.name:"";return new yk(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){Rr(Zk,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var i=e.get("shape"),a=e.getModel("splitLine"),r=e.getModel("splitArea"),o=a.getModel("lineStyle"),s=r.getModel("areaStyle"),l=a.get("show"),p=r.get("show"),c=o.get("color"),d=s.get("color"),u=Ur(c)?c:[c],m=Ur(d)?d:[d],h=[],g=[];if("circle"===i)for(var f=n[0].getTicksCoords(),y=t.cx,v=t.cy,x=0;x3?1.4:a>1?1.2:1.1;sP(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:r,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(i);sP(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){aP(this._zr,"globalPan")||sP(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Uo);function sP(e,t,n,i,a){e.pointerChecker&&e.pointerChecker(i,a.originX,a.originY)&&(ls(i.event),lP(e,t,n,i,a))}function lP(e,t,n,i,a){a.isAvailableBehavior=Gr(pP,null,n,i),e.trigger(t,a)}function pP(e,t,n){var i=n[e];return!e||i&&(!Hr(i)||t.event[i+"Key"])}function cP(e,t,n){var i=e.target;i.x+=t,i.y+=n,i.dirty()}function dP(e,t,n,i){var a=e.target,r=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,r){var s=r.min||0,l=r.max||1/0;o=Math.max(Math.min(l,o),s)}var p=o/e.zoom;e.zoom=o,a.x-=(n-a.x)*(p-1),a.y-=(i-a.y)*(p-1),a.scaleX*=p,a.scaleY*=p,a.dirty()}var uP,mP={axisPointer:1,tooltip:1,brush:1};function hP(e,t,n){var i=t.getComponentByElement(e.topTarget),a=i&&i.coordinateSystem;return i&&i!==n&&!mP.hasOwnProperty(i.mainType)&&a&&a.model!==n}function gP(e){Hr(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var fP={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},yP=qr(fP),vP={"alignment-baseline":"textBaseline","stop-color":"stopColor"},xP=qr(vP),bP=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t=t||{};var n=gP(e);this._defsUsePending=[];var i=new Mc;this._root=i;var a=[],r=n.getAttribute("viewBox")||"",o=parseFloat(n.getAttribute("width")||t.width),s=parseFloat(n.getAttribute("height")||t.height);isNaN(o)&&(o=null),isNaN(s)&&(s=null),IP(n,i,null,!0,!1);for(var l,p,c=n.firstChild;c;)this._parseNode(c,i,a,null,!1,!1),c=c.nextSibling;if(function(e,t){for(var n=0;n=4&&(l={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(l&&null!=o&&null!=s&&(p=RP(l,{x:0,y:0,width:o,height:s}),!t.ignoreViewBox)){var u=i;(i=new Mc).add(u),u.scaleX=u.scaleY=p.scale,u.x=p.x,u.y=p.y}return t.ignoreRootClip||null==o||null==s||i.setClipPath(new Em({shape:{x:0,y:0,width:o,height:s}})),{root:i,width:o,height:s,viewBoxRect:l,viewBoxTransform:p,named:a}},e.prototype._parseNode=function(e,t,n,i,a,r){var o,s=e.nodeName.toLowerCase(),l=i;if("defs"===s&&(a=!0),"text"===s&&(r=!0),"defs"===s||"switch"===s)o=t;else{if(!a){var p=uP[s];if(p&&bo(uP,s)){o=p.call(this,e,t);var c=e.getAttribute("name");if(c){var d={name:c,namedFrom:null,svgNodeTagLower:s,el:o};n.push(d),"g"===s&&(l=d)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:o});t.add(o)}}var u=wP[s];if(u&&bo(wP,s)){var m=u.call(this,e),h=e.getAttribute("id");h&&(this._defs[h]=m)}}if(o&&o.isGroup)for(var g=e.firstChild;g;)1===g.nodeType?this._parseNode(g,o,n,l,a,r):3===g.nodeType&&r&&this._parseText(g,o),g=g.nextSibling},e.prototype._parseText=function(e,t){var n=new ym({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});_P(t,n),IP(e,n,this._defsUsePending,!1,!1),function(e,t){var n=t.__selfStyle;if(n){var i=n.textBaseline,a=i;i&&"auto"!==i?"baseline"===i?a="alphabetic":"before-edge"===i||"text-before-edge"===i?a="top":"after-edge"===i||"text-after-edge"===i?a="bottom":"central"!==i&&"mathematical"!==i||(a="middle"):a="alphabetic",e.style.textBaseline=a}var r=t.__inheritedStyle;if(r){var o=r.textAlign,s=o;o&&("middle"===o&&(s="center"),e.style.textAlign=s)}}(n,t);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var r=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=r;var o=n.getBoundingRect();return this._textX+=o.width,t.add(n),n},e.internalField=void(uP={g:function(e,t){var n=new Mc;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new Em;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new sg;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new Fg;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new pg;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n,i=e.getAttribute("points");i&&(n=TP(i));var a=new kg({shape:{points:n||[]},silent:!0});return _P(t,a),IP(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var n,i=e.getAttribute("points");i&&(n=TP(i));var a=new Dg({shape:{points:n||[]},silent:!0});return _P(t,a),IP(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var n=new bm;return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",r=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(r);var o=new Mc;return _P(t,o),IP(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",r=e.getAttribute("dy")||"0",o=new Mc;return _P(t,o),IP(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(r),o},path:function(e,t){var n=rg(e.getAttribute("d")||"");return _P(t,n),IP(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),e}(),wP={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),a=parseInt(e.getAttribute("y2")||"0",10),r=new Ug(t,n,i,a);return SP(e,r),CP(e,r),r},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),n=parseInt(e.getAttribute("cy")||"0",10),i=parseInt(e.getAttribute("r")||"0",10),a=new jg(t,n,i);return SP(e,a),CP(e,a),a}};function SP(e,t){"userSpaceOnUse"===e.getAttribute("gradientUnits")&&(t.global=!0)}function CP(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),a=void 0;a=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var r={};FP(n,r,r);var o=r.stopColor||n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:a,color:o})}n=n.nextSibling}}function _P(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Pr(t.__inheritedStyle,e.__inheritedStyle))}function TP(e){for(var t=PP(e),n=[],i=0;i0;r-=2){var o=i[r],s=i[r-1],l=PP(o);switch(a=a||[1,0,0,1,0,0],s){case"translate":fs(a,a,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":vs(a,a,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":ys(a,a,-parseFloat(l[0])*OP,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":gs(a,[1,0,Math.tan(parseFloat(l[0])*OP),1,0,0],a);break;case"skewY":gs(a,[1,Math.tan(parseFloat(l[0])*OP),0,1,0,0],a);break;case"matrix":a[0]=parseFloat(l[0]),a[1]=parseFloat(l[1]),a[2]=parseFloat(l[2]),a[3]=parseFloat(l[3]),a[4]=parseFloat(l[4]),a[5]=parseFloat(l[5])}}t.setLocalTransform(a)}}(e,t),FP(e,o,s),i||function(e,t,n){for(var i=0;i0,h={api:n,geo:s,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:m,isGeo:r,transformInfoRaw:d};"geoJSON"===s.resourceType?this._buildGeoJSON(h):"geoSVG"===s.resourceType&&this._buildSVG(h),this._updateController(e,t,n),this._updateMapSelectHandler(e,l,n,i)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=fo(),n=fo(),i=this._regionsGroup,a=e.transformInfoRaw,r=e.mapOrGeoModel,o=e.data,s=e.geo.projection,l=s&&s.stream;function p(e,t){return t&&(e=t(e)),e&&[e[0]*a.scaleX+a.x,e[1]*a.scaleY+a.y]}function c(e){for(var t=[],n=!l&&s&&s.project,i=0;i=0)&&(u=a);var m=o?{normal:{align:"center",verticalAlign:"middle"}}:null;zf(t,Uf(i),{labelFetcher:u,labelDataIndex:d,defaultText:n},m);var h=t.getTextContent();if(h&&(QP(h).ignore=h.ignore,t.textConfig&&o)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function aD(e,t,n,i,a,r){e.data?e.data.setItemGraphicEl(r,t):Um(t).eventData={componentType:"geo",componentIndex:a.componentIndex,geoIndex:a.componentIndex,name:n,region:i&&i.option||{}}}function rD(e,t,n,i,a){e.data||Rf({el:t,componentModel:a,itemName:n,itemTooltipOption:i.get("tooltip")})}function oD(e,t,n,i,a){t.highDownSilentOnTouch=!!a.get("selectedMode");var r=i.getModel("emphasis"),o=r.get("focus");return Oh(t,o,r.get("blurScope"),r.get("disabled")),e.isGeo&&function(e,t,n){var i=Um(e);i.componentMainType=t.mainType,i.componentIndex=t.componentIndex,i.componentHighDownName=n}(t,a,n),o}function sD(e,t,n){var i,a=[];function r(){i=[]}function o(){i.length&&(a.push(i),i=[])}var s=t({polygonStart:r,polygonEnd:o,lineStart:r,lineEnd:o,point:function(e,t){isFinite(e)&&isFinite(t)&&i.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),Rr(e,(function(e){s.lineStart();for(var t=0;t-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"}}(ow);var lD=Lo,pD=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new oc,n._rawTransformable=new oc,n.name=t,n}return ze(t,e),t.prototype.setBoundingRect=function(e,t,n,i){return this._rect=new Ps(e,t,n,i),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,i){this._transformTo(e,t,n,i),this._viewRect=new Ps(e,t,n,i)},t.prototype._transformTo=function(e,t,n,i){var a=this.getBoundingRect(),r=this._rawTransformable;r.transform=a.calculateTransform(new Ps(e,t,n,i));var o=r.parent;r.parent=null,r.decomposeTransform(),r.parent=o,this._updateTransform()},t.prototype.setCenter=function(e,t){e&&(this._center=[Vc(e[0],t.getWidth()),Vc(e[1],t.getHeight())],this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),a=this.getZoom();i=Lo([],i,e),n=Lo([],n,e),t.originX=i[0],t.originY=i[1],t.x=n[0]-i[0],t.y=n[1]-i[1],t.scaleX=t.scaleY=a,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),hs(this.transform||(this.transform=[]),t.transform||[1,0,0,1,0,0]),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],xs(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new oc;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var i=t?this._rawTransform:this.transform;return n=n||[],i?lD(n,e,i):_o(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?lD([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var i=cD(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=cD(t);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(oc);function cD(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var dD={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},uD=["lng","lat"],mD=function(e){function t(t,n,i){var a=e.call(this,t)||this;a.dimensions=uD,a.type="geo",a._nameCoordMap=fo(),a.map=n;var r,o=i.projection,s=$P(n,i.nameMap,i.nameProperty),l=WP(n),p=(a.resourceType=l?l.type:null,a.regions=s.regions),c=dD[l.type];if(a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o,o)for(var d=0;d1?(m.width=u,m.height=u/x):(m.height=u,m.width=u*x),m.y=d[1]-m.height/2,m.x=d[0]-m.width/2;else{var w=e.getBoxLayoutParams();w.aspect=x,m=gv(w,{width:y,height:v})}this.setViewRect(m.x,m.y,m.width,m.height),this.setCenter(e.get("center"),t),this.setZoom(e.get("zoom"))}Ar(mD,pD);var fD=function(){function e(){this.dimensions=uD}return e.prototype.create=function(e,t){var n=[];function i(e){return{nameProperty:e.get("nameProperty"),aspectScale:e.get("aspectScale"),projection:e.get("projection")}}e.eachComponent("geo",(function(e,a){var r=e.get("map"),o=new mD(r+a,r,kr({nameMap:e.get("nameMap")},i(e)));o.zoomLimit=e.get("scaleLimit"),n.push(o),e.coordinateSystem=o,o.model=e,o.resize=gD,o.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var a={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();a[t]=a[t]||[],a[t].push(e)}})),Rr(a,(function(e,a){var r=Br(e,(function(e){return e.get("nameMap")})),o=new mD(a,a,kr({nameMap:Mr(r)},i(e[0])));o.zoomLimit=no.apply(null,Br(e,(function(e){return e.get("scaleLimit")}))),n.push(o),o.resize=gD,o.resize(e[0],t),Rr(e,(function(e){e.coordinateSystem=o,function(e,t){Rr(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}(o,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n,i){for(var a=(e||[]).slice(),r=fo(),o=0;ov.x)||(b-=Math.PI);var C=w?"left":"right",_=s.getModel("label"),T=_.get("rotate"),I=T*(Math.PI/180),E=f.getTextContent();E&&(f.setTextConfig({position:_.get("position")||C,rotation:null==T?-b:I,origin:"center"}),E.setStyle("verticalAlign","middle"))}var M=s.get(["emphasis","focus"]),k="relative"===M?yo(o.getAncestorsIndices(),o.getDescendantIndices()):"ancestor"===M?o.getAncestorsIndices():"descendant"===M?o.getDescendantIndices():null;k&&(Um(n).focus=k),function(e,t,n,i,a,r,o,s){var l=t.getModel(),p=e.get("edgeShape"),c=e.get("layout"),d=e.getOrient(),u=e.get(["lineStyle","curveness"]),m=e.get("edgeForkPosition"),h=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===p)t.parentNode&&t.parentNode!==n&&(g||(g=i.__edge=new Lg({shape:ID(c,d,u,a,a)})),tf(g,{shape:ID(c,d,u,r,o)},e));else if("polyline"===p)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var f=t.children,y=[],v=0;vt&&(t=i.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var i=n.getData().tree.root,a=e.targetNode;if(Hr(a)&&(a=i.getNodeById(a)),a&&i.contains(a))return{node:a};var r=e.targetNodeId;if(null!=r&&(a=i.getNodeById(r)))return{node:a}}}function VD(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function qD(e,t){return Dr(VD(e),t)>=0}function GD(e,t){for(var n=[];e;){var i=e.dataIndex;n.push({name:e.name,dataIndex:i,value:t.getRawValue(i)}),e=e.parentNode}return n.reverse(),n}!function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}ze(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},i=new uy(n,this,this.ecModel),a=ND.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=a.getNodeByDataIndex(t);return n&&n.children.length&&n.isExpand||(e.parentModel=i),e}))}));var r=0;a.eachNode("preorder",(function(e){e.depth>r&&(r=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:r;return a.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),a.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var i=this.getData().tree,a=i.root.children[0],r=i.getNodeByDataIndex(e),o=r.getValue(),s=r.name;r&&r!==a;)s=r.parentNode.name+"."+s,r=r.parentNode;return jb("nameValue",{name:s,value:o,noValue:isNaN(o)||null==o})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=GD(i,this),n.collapsed=!i.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500}}(ow);function zD(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var i=t;i&&i.depth>1;)i=i.parentNode;var a=Zv(e.ecModel,i.name||i.dataIndex+"",n);t.setVisual("decal",a)}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}ze(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};UD(n);var i=e.levels||[],a=this.designatedVisualItemStyle={},r=new uy({itemStyle:a},this,t);i=e.levels=function(e,t){var n,i,a=dd(t.get("color")),r=dd(t.get(["aria","decal","decals"]));if(!a)return;e=e||[],Rr(e,(function(e){var t=new uy(e),a=t.get("color"),r=t.get("decal");(t.get(["itemStyle","color"])||a&&"none"!==a)&&(n=!0),(t.get(["itemStyle","decal"])||r&&"none"!==r)&&(i=!0)}));var o=e[0]||(e[0]={});n||(o.color=a.slice());!i&&r&&(o.decal=r.slice());return e}(i,t);var o=Br(i||[],(function(e){return new uy(e,r,t)}),this),s=ND.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),i=n?o[n.depth]:null;return e.parentModel=i||r,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),a=this.getRawValue(e);return jb("nameValue",{name:i.getName(e),value:a})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=GD(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},kr(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=fo(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){zD(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]}}(ow);function UD(e){var t=0;Rr(e.children,(function(e){UD(e);var n=e.value;Ur(n)&&(n=n[0]),t+=n}));var n=e.value;Ur(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Ur(e.value)?e.value[0]=n:e.value=n}var jD=function(){function e(e){this.group=new Mc,e.add(this.group)}return e.prototype.render=function(e,t,n,i){var a=e.getModel("breadcrumb"),r=this.group;if(r.removeAll(),a.get("show")&&n){var o=a.getModel("itemStyle"),s=a.getModel("emphasis"),l=o.getModel("textStyle"),p=s.getModel(["itemStyle","textStyle"]),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,o,s,l,p,i),fv(r,c.pos,c.box)}},e.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var a=xd(i.getModel().get("name"),""),r=n.getTextRect(a),o=Math.max(r.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:i,text:a,width:o})}},e.prototype._renderContent=function(e,t,n,i,a,r,o){for(var s,l,p,c,d,u,m,h,g,f=0,y=t.emptyItemWidth,v=e.get(["breadcrumb","height"]),x=(s=t.pos,l=t.box,c=l.width,d=l.height,u=Vc(s.left,c),m=Vc(s.top,d),h=Vc(s.right,c),g=Vc(s.bottom,d),(isNaN(u)||isNaN(parseFloat(s.left)))&&(u=0),(isNaN(h)||isNaN(parseFloat(s.right)))&&(h=c),(isNaN(m)||isNaN(parseFloat(s.top)))&&(m=0),(isNaN(g)||isNaN(parseFloat(s.bottom)))&&(g=d),p=nv(p||0),{width:Math.max(h-u-p[1]-p[3],0),height:Math.max(g-m-p[0]-p[2],0)}),b=t.totalWidth,w=t.renderList,S=i.getModel("itemStyle").getItemStyle(),C=w.length-1;C>=0;C--){var _=w[C],T=_.node,I=_.width,E=_.text;b>x.width&&(b-=I-y,I=y,E=null);var M=new kg({shape:{points:HD(f,0,I,v,C===w.length-1,0===C)},style:Pr(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Pm({style:jf(a,{text:E})}),textConfig:{position:"inside"},z2:1e5,onclick:zr(o,T)});M.disableLabelAnimation=!0,M.getTextContent().ensureState("emphasis").style=jf(r,{text:E}),M.ensureState("emphasis").style=S,Oh(M,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(M),WD(M,e,T),f+=I+8}},e.prototype.remove=function(){this.group.removeAll()},e}();function HD(e,t,n,i,a,r){var o=[[a?e:e-5,t],[e+n,t],[e+n,t+i],[a?e:e-5,t+i]];return!r&&o.splice(2,0,[e+n+5,t+i/2]),!a&&o.push([e,t+i/2]),o}function WD(e,t,n){Um(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&GD(n,t)}}var $D=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,i,a){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var a=i.getLayout();if(!a)return;var r=new Ps(a.x,a.y,a.width,a.height),o=this.seriesModel.layoutInfo,s=[1,0,0,1,0,0];fs(s,s,[-(t-=o.x),-(n-=o.y)]),vs(s,s,[e.scale,e.scale]),fs(s,s,[t,n]),r.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:r.x,y:r.y,width:r.width,height:r.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var i=t.findTarget(e.offsetX,e.offsetY);if(i){var a=i.node;if(a.getLayout().isLeafRoot)t._rootToNode(i);else if("zoomToNode"===n)t._zoomToNode(i);else if("link"===n){var r=a.hostTree.data.getItemModel(a.dataIndex),o=r.get("link",!0),s=r.get("target",!0)||"blank";o&&pv(o,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var i=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new jD(this.group))).render(e,t,n.node,(function(t){"animating"!==i._state&&(qD(e.getViewRoot(),t)?i._rootToNode({node:t}):i._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var a=this._storage.background[i.getRawIndex()];if(a){var r=a.transformCoordToLocal(e,t),o=a.shape;if(!(o.x<=r[0]&&r[0]<=o.x+o.width&&o.y<=r[1]&&r[1]<=o.y+o.height))return!1;n={node:i,offsetX:r[0],offsetY:r[1]}}}),this),n},t.type="treemap"}(vw);var tO=Rr,nO=Kr,iO=-1,aO=function(){function e(t){var n=t.mappingMethod,i=t.type,a=this.option=Ir(t);this.type=i,this.mappingMethod=n,this._normalizeData=hO[n];var r=e.visualHandlers[i];this.applyVisual=r.applyVisual,this.getColorMapper=r.getColorMapper,this._normalizedToVisual=r._normalizedToVisual[n],"piecewise"===n?(rO(a),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,Rr(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(a)):"category"===n?a.categories?function(e){var t=e.categories,n=e.categoryMap={},i=e.visual;if(tO(t,(function(e,t){n[e]=t})),!Ur(i)){var a=[];Kr(i)?tO(i,(function(e,t){var i=n[t];a[null!=i?i:iO]=e})):a[-1]=i,i=mO(e,a)}for(var r=t.length-1;r>=0;r--)null==i[r]&&(delete n[t[r]],t.pop())}(a):rO(a,!0):(so("linear"!==n||a.dataExtent),rO(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return Gr(this._normalizeData,this)},e.listVisualTypes=function(){return qr(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){Kr(e)?Rr(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var a,r=Ur(t)?[]:Kr(t)?{}:(a=!0,null);return e.eachVisual(t,(function(e,t){var o=n.call(i,e,t);a?r=o:r[t]=o})),r},e.retrieveVisuals=function(t){var n,i={};return t&&tO(e.visualHandlers,(function(e,a){t.hasOwnProperty(a)&&(i[a]=t[a],n=!0)})),n?i:null},e.prepareVisualTypes=function(e){if(Ur(e))e=e.slice();else{if(!nO(e))return[];var t=[];tO(e,(function(e,n){t.push(n)})),e=t}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},e.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var i,a=1/0,r=0,o=t.length;ri&&(i=t);var r=i%2?i+2:i+3;a=[];for(var o=0;o0&&(v[0]=-v[0],v[1]=-v[1]);var b=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var w=-Math.atan2(y[1],y[0]);p[0].8?"left":c[0]<-.8?"right":"center",u=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*h+l[0],i.y=-c[1]*g+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",u=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=h*b+l[0],i.y=l[1]+S,d=y[0]<0?"right":"left",i.originX=-h*b,i.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+S,d="center",i.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-h*b+p[0],i.y=p[1]+S,d=y[0]>=0?"right":"left",i.originX=h*b,i.originY=-S}i.scaleX=i.scaleY=a,i.setStyle({verticalAlign:i.__verticalAlign||u,align:i.__align||d})}}}function C(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(Mc),zO=function(){function e(e){this.group=new Mc,this._LineCtor=e||GO}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var r=UO(e);e.diff(a).add((function(n){t._doAdd(e,n,r)})).update((function(n,i){t._doUpdate(a,e,i,n,r)})).remove((function(e){i.remove(a.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=UO(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=e.start;i=0?i+=p:i-=p:h>=0?i-=p:i+=p}return i}function JO(e,t){var n=[],i=bl,a=[[],[],[]],r=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),p=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[To(l[0]),To(l[1])],l[2]&&l.__original.push(To(l[2])));var d=l.__original;if(null!=l[2]){if(_o(a[0],d[0]),_o(a[1],d[2]),_o(a[2],d[1]),p&&"none"!==p){var u=TO(e.node1),m=QO(a,d[0],u*t);i(a[0][0],a[1][0],a[2][0],m,n),a[0][0]=n[3],a[1][0]=n[4],i(a[0][1],a[1][1],a[2][1],m,n),a[0][1]=n[3],a[1][1]=n[4]}if(c&&"none"!==c){u=TO(e.node2),m=QO(a,d[1],u*t);i(a[0][0],a[1][0],a[2][0],m,n),a[1][0]=n[1],a[2][0]=n[2],i(a[0][1],a[1][1],a[2][1],m,n),a[1][1]=n[1],a[2][1]=n[2]}_o(l[0],a[0]),_o(l[1],a[2]),_o(l[2],a[1])}else{if(_o(r[0],d[0]),_o(r[1],d[1]),Mo(o,r[1],r[0]),Oo(o,o),p&&"none"!==p){u=TO(e.node1);Eo(r[0],r[0],o,u*t)}if(c&&"none"!==c){u=TO(e.node2);Eo(r[1],r[1],o,-u*t)}_o(l[0],r[0]),_o(l[1],r[1])}}))}function eA(e){return"view"===e.type}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.init=function(e,t){var n=new CE,i=new zO,a=this.group;this._controller=new oP(t.getZr()),this._controllerHost={target:a},a.add(n.group),a.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,a=e.coordinateSystem;this._model=e;var r=this._symbolDraw,o=this._lineDraw,s=this.group;if(eA(a)){var l={x:a.x,y:a.y,scaleX:a.scaleX,scaleY:a.scaleY};this._firstRender?s.attr(l):tf(s,l,e)}JO(e.getGraph(),_O(e));var p=e.getData();r.updateData(p);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var d=e.forceLayout,u=e.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,u);var m=e.get("layout");p.graph.eachNode((function(t){var n=t.dataIndex,a=t.getGraphicEl(),r=t.getModel();if(a){a.off("drag").off("dragend");var o=r.get("draggable");o&&a.on("drag",(function(r){switch(m){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,u),d.setFixed(n),p.setItemLayout(n,[a.x,a.y]);break;case"circular":p.setItemLayout(n,[a.x,a.y]),t.setLayout({fixed:!0},!0),MO(e,"symbolSize",t,[r.offsetX,r.offsetY]),i.updateLayout(e);break;default:p.setItemLayout(n,[a.x,a.y]),CO(e.getGraph(),e),i.updateLayout(e)}})).on("dragend",(function(){d&&d.setUnfixed(n)})),a.setDraggable(o,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&(Um(a).focus=t.getAdjacentDataIndices())}})),p.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(Um(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var h="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),g=p.getLayout("cx"),f=p.getLayout("cy");p.graph.eachNode((function(e){PO(e,h,g,f)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function i(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(i,16):i())}))}()},t.prototype._updateController=function(e,t,n){var i=this,a=this._controller,r=this._controllerHost,o=this.group;a.setPointerChecker((function(t,i,a){var r=o.getBoundingRect();return r.applyTransform(o.transform),r.contain(i,a)&&!hP(t,n,e)})),eA(e.coordinateSystem)?(a.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),a.off("pan").off("zoom").on("pan",(function(t){cP(r,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){dP(r,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),i._updateNodeAndLinkScale(),JO(e.getGraph(),_O(e)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):a.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=_O(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){JO(e.getGraph(),_O(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph"}(vw);function tA(e){return"_EC_"+e}var nA=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[tA(e)]){var i=new iA(e,t);return i.hostGraph=this,this.nodes.push(i),n[tA(e)]=i,i}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[tA(e)]},e.prototype.addEdge=function(e,t,n){var i=this._nodesMap,a=this._edgesMap;if($r(e)&&(e=this.nodes[e]),$r(t)&&(t=this.nodes[t]),e instanceof iA||(e=i[tA(e)]),t instanceof iA||(t=i[tA(t)]),e&&t){var r=e.id+"-"+t.id,o=new aA(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),a[r]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof iA&&(e=e.id),t instanceof iA&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(t,n[a],a)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(t,n[a],a)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof iA||(t=this._nodesMap[tA(t)]),t){for(var a="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}));for(a=0,r=i.length;a=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function oA(e,t,n,i,a){for(var r=new nA(i),o=0;o "+u)),p++)}var m,h=n.get("coordinateSystem");if("cartesian2d"===h||"polar"===h)m=K_(e,n);else{var g=sx.get(h),f=g&&g.dimensions||[];Dr(f,"value")<0&&f.concat(["value"]);var y=q_(e,{coordDimensions:f,encodeDefine:n.getEncode()}).dimensions;(m=new V_(y,n)).initData(e)}var v=new V_(["value"],n);return v.initData(l,s),a&&a(m,v),MD({mainData:m,struct:r,structAttr:"graph",datas:{node:m,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}Ar(iA,rA("hostGraph","data")),Ar(aA,rA("hostGraph","edgeData"));!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}ze(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new qM(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),ud(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n,i=e.edges||e.links||[],a=e.data||e.nodes||[],r=this;if(a&&i){yO(n=this)&&(n.__curvenessList=[],n.__edgeMap={},vO(n));var o=oA(a,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=r._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=uy.prototype.getModel;function i(e,t){var i=n.call(this,e,t);return i.resolveParentPath=a,i}function a(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=a,e.getModel=i,e}))}));return Rr(o.edges,(function(e){!function(e,t,n,i){if(yO(n)){var a=xO(e,t,n),r=n.__edgeMap,o=r[bO(a)];r[a]&&!o?r[a].isForward=!0:o&&r[a]&&(o.isForward=!0,r[a].isForward=!1),r[a]=r[a]||[],r[a].push(i)}}(e.node1,e.node2,this,e.dataIndex)}),this),o.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if("edge"===n){var i=this.getData(),a=this.getDataParams(e,n),r=i.graph.getEdgeByIndex(e),o=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),jb("nameValue",{name:l.join(" > "),value:a.value,noValue:null==a.value})}return nw({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=Br(this.option.categories||[],(function(e){return null!=e.value?e:kr({value:0},e)})),t=new V_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}}}(ow);var sA=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},lA=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return ze(t,e),t.prototype.getDefaultShape=function(){return new sA},t.prototype.buildPath=function(e,t){var n=Math.cos,i=Math.sin,a=t.r,r=t.width,o=t.angle,s=t.x-n(o)*r*(r>=a/3?1:2),l=t.y-i(o)*r*(r>=a/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(o)*r,t.y+i(o)*r),e.lineTo(t.x+n(t.angle)*a,t.y+i(t.angle)*a),e.lineTo(t.x-n(o)*r,t.y-i(o)*r),e.lineTo(s,l)},t}(gm);function pA(e,t){var n=null==e?"":e+"";return t&&(Hr(t)?n=t.replace("{value}",n):jr(t)&&(n=t(e))),n}(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i=e.get(["axisLine","lineStyle","color"]),a=function(e,t){var n=e.get("center"),i=t.getWidth(),a=t.getHeight(),r=Math.min(i,a);return{cx:Vc(n[0],t.getWidth()),cy:Vc(n[1],t.getHeight()),r:Vc(e.get("radius"),r/2)}}(e,n);this._renderMain(e,t,n,i,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,a){var r=this.group,o=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,p=e.getModel("axisLine"),c=p.get("roundCap")?iM:_g,d=p.get("show"),u=p.getModel("lineStyle"),m=u.get("width"),h=[s,l];Ku(h,!o);for(var g=(l=h[1])-(s=h[0]),f=s,y=[],v=0;d&&v=e&&(0===t?0:i[t-1][0])Math.PI/2&&(L+=Math.PI):"tangential"===N?L=-_-Math.PI/2:$r(N)&&(L=N*Math.PI/180),0===L?d.add(new Pm({style:jf(x,{text:A,x:R,y:B,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:p<-.4?"left":p>.4?"right":"center"},{inheritColor:F}),silent:!0})):d.add(new Pm({style:jf(x,{text:A,x:R,y:B,verticalAlign:"middle",align:"center"},{inheritColor:F}),silent:!0,originX:R,originY:B,rotation:L}))}if(v.get("show")&&P!==b){O=(O=v.get("distance"))?O+l:l;for(var V=0;V<=w;V++){p=Math.cos(_),c=Math.sin(_);var q=new Fg({shape:{x1:p*(h-O)+u,y1:c*(h-O)+m,x2:p*(h-C-O)+u,y2:c*(h-C-O)+m},silent:!0,style:M});"auto"===M.stroke&&q.setStyle({stroke:i((P+V/w)/b)}),d.add(q),_+=I}_-=I}else _+=T}},t.prototype._renderPointer=function(e,t,n,i,a,r,o,s,l){var p=this.group,c=this._data,d=this._progressEls,u=[],m=e.get(["pointer","show"]),h=e.getModel("progress"),g=h.get("show"),f=e.getData(),y=f.mapDimension("value"),v=+e.get("min"),x=+e.get("max"),b=[v,x],w=[r,o];function S(t,n){var i,r=f.getItemModel(t).getModel("pointer"),o=Vc(r.get("width"),a.r),s=Vc(r.get("length"),a.r),l=e.get(["pointer","icon"]),p=r.get("offsetCenter"),c=Vc(p[0],a.r),d=Vc(p[1],a.r),u=r.get("keepAspect");return(i=l?PS(l,c-o/2,d-s,o,s,null,u):new lA({shape:{angle:-Math.PI/2,width:o,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),i.x=a.cx,i.y=a.cy,i}function C(e,t){var n=h.get("roundCap")?iM:_g,i=h.get("overlap"),o=i?h.get("width"):l/f.count(),p=i?a.r-o:a.r-(e+1)*o,c=i?a.r:a.r-e*o,d=new n({shape:{startAngle:r,endAngle:t,cx:a.cx,cy:a.cy,clockwise:s,r0:p,r:c}});return i&&(d.z2=x-f.get(y,e)%x),d}(g||m)&&(f.diff(c).add((function(t){var n=f.get(y,t);if(m){var i=S(t,r);nf(i,{rotation:-((isNaN(+n)?w[0]:Lc(n,b,w,!0))+Math.PI/2)},e),p.add(i),f.setItemGraphicEl(t,i)}if(g){var a=C(t,r),o=h.get("clip");nf(a,{shape:{endAngle:Lc(n,b,w,o)}},e),p.add(a),jm(e.seriesIndex,f.dataType,t,a),u[t]=a}})).update((function(t,n){var i=f.get(y,t);if(m){var a=c.getItemGraphicEl(n),o=a?a.rotation:r,s=S(t,o);s.rotation=o,tf(s,{rotation:-((isNaN(+i)?w[0]:Lc(i,b,w,!0))+Math.PI/2)},e),p.add(s),f.setItemGraphicEl(t,s)}if(g){var l=d[n],v=C(t,l?l.shape.endAngle:r),x=h.get("clip");tf(v,{shape:{endAngle:Lc(i,b,w,x)}},e),p.add(v),jm(e.seriesIndex,f.dataType,t,v),u[t]=v}})).execute(),f.each((function(e){var t=f.getItemModel(e),n=t.getModel("emphasis"),a=n.get("focus"),r=n.get("blurScope"),o=n.get("disabled");if(m){var s=f.getItemGraphicEl(e),l=f.getItemVisual(e,"style"),p=l.fill;if(s instanceof bm){var c=s.style;s.useStyle(kr({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(p);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Lc(f.get(y,e),b,[0,1],!0))),s.z2EmphasisLift=0,Bh(s,t),Oh(s,a,r,o)}if(g){var d=u[e];d.useStyle(f.getItemVisual(e,"style")),d.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,Bh(d,t),Oh(d,a,r,o)}})),this._progressEls=u)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),a=n.get("icon"),r=n.get("offsetCenter"),o=n.get("keepAspect"),s=PS(a,t.cx-i/2+Vc(r[0],t.r),t.cy-i/2+Vc(r[1],t.r),i,i,null,o);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,a){var r=this,o=e.getData(),s=o.mapDimension("value"),l=+e.get("min"),p=+e.get("max"),c=new Mc,d=[],u=[],m=e.isAnimationEnabled(),h=e.get(["pointer","showAbove"]);o.diff(this._data).add((function(e){d[e]=new Pm({silent:!0}),u[e]=new Pm({silent:!0})})).update((function(e,t){d[e]=r._titleEls[t],u[e]=r._detailEls[t]})).execute(),o.each((function(t){var n=o.getItemModel(t),r=o.get(s,t),g=new Mc,f=i(Lc(r,[l,p],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var v=y.get("offsetCenter"),x=a.cx+Vc(v[0],a.r),b=a.cy+Vc(v[1],a.r);(M=d[t]).attr({z2:h?0:2,style:jf(y,{x:x,y:b,text:o.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:f})}),g.add(M)}var w=n.getModel("detail");if(w.get("show")){var S=w.get("offsetCenter"),C=a.cx+Vc(S[0],a.r),_=a.cy+Vc(S[1],a.r),T=Vc(w.get("width"),a.r),I=Vc(w.get("height"),a.r),E=e.get(["progress","show"])?o.getItemVisual(t,"style").fill:f,M=u[t],k=w.get("formatter");M.attr({z2:h?0:2,style:jf(w,{x:C,y:_,text:pA(r,k),width:isNaN(T)?null:T,height:isNaN(I)?null:I,align:"center",verticalAlign:"middle"},{inheritColor:E})}),Qf(M,{normal:w},r,(function(e){return pA(e,k)})),m&&Jf(M,t,o,e,{getFormattedLabel:function(e,t,n,i,a,o){return pA(o?o.interpolatedValue:r,k)}}),g.add(M)}c.add(g)})),this.group.add(c),this._titleEls=d,this._detailEls=u},t.type="gauge"})(vw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}ze(t,e),t.prototype.getInitialData=function(e,t){return VM(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}}}(ow);var cA=["itemStyle","opacity"],dA=function(e){function t(t,n){var i=e.call(this)||this,a=i,r=new Dg,o=new Pm;return a.setTextContent(o),i.setTextGuideLine(r),i.updateData(t,n,!0),i}return ze(t,e),t.prototype.updateData=function(e,t,n){var i=this,a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t),s=r.getModel("emphasis"),l=r.get(cA);l=null==l?1:l,n||lf(i),i.useStyle(e.getItemVisual(t,"style")),i.style.lineJoin="round",n?(i.setShape({points:o.points}),i.style.opacity=0,nf(i,{style:{opacity:l}},a,t)):tf(i,{style:{opacity:l},shape:{points:o.points}},a,t),Bh(i,r),this._updateLabel(e,t),Oh(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t){var n=this,i=this.getTextGuideLine(),a=n.getTextContent(),r=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),p=l.fill;zf(a,Uf(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:p,outsideFill:p});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new ws(c[0][0],c[0][1]):null},tf(a,{style:{x:s.x,y:s.y}},r,t),a.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),QI(n,JI(o),{stroke:p})},t}(kg);(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}ze(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this._data,r=this.group;i.diff(a).add((function(e){var t=new dA(i,e);i.setItemGraphicEl(e,t),r.add(t)})).update((function(e,t){var n=a.getItemGraphicEl(t);n.updateData(i,e),r.add(n),i.setItemGraphicEl(e,n)})).remove((function(t){sf(a.getItemGraphicEl(t),e,t)})).execute(),this._data=i},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel"})(vw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new qM(Gr(this.getData,this),Gr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return VM(this,{coordDimensions:["value"],encodeDefaulter:zr(qv,this)})},t.prototype._defaultLabelLine=function(e){ud(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),a=n.mapDimension("value"),r=n.getSum(a);return i.percent=r?+(n.get(a,t)/r*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}}}(ow);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Mc,n._initialized=!1,n}ze(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var a=this._dataGroup,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,p=hA(e);if(r.diff(o).add((function(e){gA(mA(r,a,e,l,s),r,e,p)})).update((function(t,n){var i=o.getItemGraphicEl(n),a=uA(r,t,l,s);r.setItemGraphicEl(t,i),tf(i,{shape:{points:a}},e,t),lf(i),gA(i,r,t,p)})).remove((function(e){var t=o.getItemGraphicEl(e);a.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=function(e,t,n){var i=e.model,a=e.getRect(),r=new Em({shape:{x:a.x,y:a.y,width:a.width,height:a.height}}),o="horizontal"===i.get("layout")?"width":"height";return r.setShape(o,0),nf(r,{shape:{width:a.width,height:a.height}},t,n),r}(s,e,(function(){setTimeout((function(){a.removeClipPath()}))}));a.setClipPath(c)}this._data=r},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var i=t.getData(),a=t.coordinateSystem,r=a.dimensions,o=hA(t),s=this._progressiveEls=[],l=e.start;l5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&vA(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function vA(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&Er(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){Rr(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];Rr(Lr(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null}}(Sv);var xA=function(e){function t(t,n,i,a,r){var o=e.call(this,t,n,i)||this;return o.type=a||"value",o.axisIndex=r,o}return ze(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(MI);function bA(e,t,n,i,a,r){e=e||0;var o=n[1]-n[0];if(null!=a&&(a=SA(a,[0,o])),null!=r&&(r=Math.max(r,null!=a?a:0)),"all"===i){var s=Math.abs(t[1]-t[0]);s=SA(s,[0,o]),a=r=SA(s,[a,r]),i=0}t[0]=SA(t[0],n),t[1]=SA(t[1],n);var l=wA(t,i);t[i]+=e;var p,c=a||0,d=n.slice();return l.sign<0?d[0]+=c:d[1]-=c,t[i]=SA(t[i],d),p=wA(t,i),null!=a&&(p.sign!==l.sign||p.spanr&&(t[1-i]=t[i]+p.sign*r),t}function wA(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function SA(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var CA=Rr,_A=Math.min,TA=Math.max,IA=Math.floor,EA=Math.ceil,MA=qc,kA=Math.PI;!function(){function e(e,t,n){this.type="parallel",this._axesMap=fo(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}e.prototype._init=function(e,t,n){var i=e.dimensions,a=e.parallelAxisIndex;CA(i,(function(e,n){var i=a[n],r=t.getComponent("parallelAxis",i),o=this._axesMap.set(e,new xA(e,KT(r),[0,0],r.get("type"),i)),s="category"===o.type;o.onBand=s&&r.get("boundaryGap"),o.inverse=r.get("inverse"),r.axis=o,o.model=r,o.coordinateSystem=r.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,r=e[1-a],o=e[a];return r>=n&&r<=n+t.axisLength&&o>=i&&o<=i+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var i=n.getData();CA(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(i,i.mapDimension(e)),$T(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=gv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,i=["x","y"],a=["width","height"],r=t.get("layout"),o="horizontal"===r?0:1,s=n[a[o]],l=[0,s],p=this.dimensions.length,c=PA(t.get("axisExpandWidth"),l),d=PA(t.get("axisExpandCount")||0,[0,p]),u=t.get("axisExpandable")&&p>3&&p>d&&d>1&&c>0&&s>0,m=t.get("axisExpandWindow");m?(e=PA(m[1]-m[0],l),m[1]=m[0]+e):(e=PA(c*(d-1),l),(m=[c*(t.get("axisExpandCenter")||IA(p/2))-e/2])[1]=m[0]+e);var h=(s-e)/(p-d);h<3&&(h=0);var g=[IA(MA(m[0]/c,1))+1,EA(MA(m[1]/c,1))-1],f=h/c*m[0];return{layout:r,pixelDimIndex:o,layoutBase:n[i[o]],layoutLength:s,axisBase:n[i[1-o]],axisLength:n[a[1-o]],axisExpandable:u,axisExpandWidth:c,axisCollapseWidth:h,axisExpandWindow:m,axisCount:p,winInnerIndices:g,axisExpandWindow0Pos:f}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each((function(e){var t=[0,i.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),CA(n,(function(t,n){var r=(i.axisExpandable?OA:DA)(n,i),o={horizontal:{x:r.position,y:i.axisLength},vertical:{x:0,y:r.position}},s={horizontal:kA/2,vertical:0},l=[o[a].x+e.x,o[a].y+e.y],p=s[a],c=[1,0,0,1,0,0];ys(c,c,p),fs(c,c,l),this._axesLayout[t]={position:l,rotation:p,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,i){null==n&&(n=0),null==i&&(i=e.count());var a=this._axesMap,r=this.dimensions,o=[],s=[];Rr(r,(function(t){o.push(e.mapDimension(t)),s.push(a.get(t).model)}));for(var l=this.hasAxisBrushed(),p=n;pa*(1-c[0])?(l="jump",o=s-a*(1-c[2])):(o=s-a*c[1])>=0&&(o=s-a*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/p)?bA(o,i,r,"all"):l="none";else{var u=i[1]-i[0];(i=[TA(0,r[1]*s/u-u/2)])[1]=_A(r[1],i[0]+u),i[0]=i[1]-u}return{axisExpandWindow:i,behavior:l}}}();function PA(e,t){return _A(TA(e,t[0]),t[1])}function DA(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function OA(e,t){var n,i,a=t.layoutLength,r=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,p=s,c=!1;return e=0;n--)Gc(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var i=0,a=t.length;i6}(e)||r){if(o&&!r){"single"===s.brushMode&&QA(e);var l=Ir(s);l.brushType=gF(l.brushType,o),l.panelId=o===FA?null:o.panelId,r=e._creatingCover=jA(e,l),e._covers.push(r)}if(r){var p=vF[gF(e._brushType,o)];r.__brushOption.range=p.getCreatingRange(dF(e,r,e._track)),i&&(HA(e,r),p.updateCommon(e,r)),WA(e,r),a={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&XA(e,t,n)&&QA(e)&&(a={isEnd:i,removeOnClick:!0});return a}function gF(e,t){return"auto"===e?t.defaultBrushType:e}var fF={mousedown:function(e){if(this._dragging)yF(this,e);else if(!e.target||!e.target.draggable){uF(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=XA(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,i=this.group.transformCoordToLocal(t,n);if(function(e,t,n){if(e._brushType&&!function(e,t,n){var i=e._zr;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}(e,t.offsetX,t.offsetY)){var i=e._zr,a=e._covers,r=XA(e,t,n);if(!e._dragging)for(var o=0;o=0&&(r[a[o].depth]=new uy(a[o],this,t));if(i&&n){var s=oA(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getData().getItemLayout(t);if(i){var a=i.depth,r=n.levelModels[a];r&&(e.parentModel=r)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(i){var a=i.depth,r=n.levelModels[a];r&&(e.parentModel=r)}return e}))}));return s.data}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function i(e){return isNaN(e)||null==e}if("edge"===n){var a=this.getDataParams(e,n),r=a.data,o=a.value;return jb("nameValue",{name:r.source+" -- "+r.target,value:o,noValue:i(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,n).data.name;return jb("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var i=e.prototype.getDataParams.call(this,t,n);if(null==i.value&&"node"===n){var a=this.getGraph().getNodeByIndex(t).getLayout().value;i.value=a}return i},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3}}(ow);var MF=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,i,a=t.getComponent("xAxis",this.get("xAxisIndex")),r=t.getComponent("yAxis",this.get("yAxisIndex")),o=a.get("type"),s=r.get("type");"category"===o?(e.layout="horizontal",n=a.getOrdinalMeta(),i=!0):"category"===s?(e.layout="vertical",n=r.getOrdinalMeta(),i=!0):e.layout=e.layout||"horizontal";var l=["x","y"],p="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[p],d=l[1-p],u=[a,r],m=u[p].get("type"),h=u[1-p].get("type"),g=e.data;if(g&&i){var f=[];Rr(g,(function(e,t){var n;Ur(e)?(n=e.slice(),e.unshift(t)):Ur(e.value)?((n=kr({},e)).value=n.value.slice(),e.value.unshift(t)):n=e,f.push(n)})),e.data=f}var y=this.defaultValueDimensions,v=[{name:c,type:v_(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:v_(h),dimsDef:y.slice()}];return VM(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:zr(Vv,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),kF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return ze(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(ow);Ar(kF,MF,!0);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this.group,r=this._data;this._data||a.removeAll();var o="horizontal"===e.get("layout")?1:0;i.diff(r).add((function(e){if(i.hasValue(e)){var t=OF(i.getItemLayout(e),i,e,o,!0);i.setItemGraphicEl(e,t),a.add(t)}})).update((function(e,t){var n=r.getItemGraphicEl(t);if(i.hasValue(e)){var s=i.getItemLayout(e);n?(lf(n),AF(s,n,i,e)):n=OF(s,i,e,o),a.add(n),i.setItemGraphicEl(e,n)}else a.remove(n)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&a.remove(t)})).execute(),this._data=i},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot"}(vw);var PF=function(){},DF=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return ze(t,e),t.prototype.getDefaultShape=function(){return new PF},t.prototype.buildPath=function(e,t){var n=t.points,i=0;for(e.moveTo(n[i][0],n[i][1]),i++;i<4;i++)e.lineTo(n[i][0],n[i][1]);for(e.closePath();i0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]);0===e&&(a=n.get(["itemStyle","borderColorDoji"]));var r=n.getModel("itemStyle").getItemStyle(RF);t.useStyle(r),t.style.fill=null,t.style.stroke=a}var WF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return ze(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var i=t.getItemLayout(e);return i&&n.rect(i.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(ow);Ar(WF,MF,!0);var $F=["itemStyle","borderColor"],KF=["itemStyle","borderColor0"],YF=["itemStyle","borderColorDoji"],XF=["itemStyle","color"],ZF=["itemStyle","color0"];gw(),gw();function QF(e,t,n,i,a,r){return n>i?-1:n0?e.get(a,t-1)<=i?1:-1:1}function JF(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var eR=function(e){function t(t,n){var i=e.call(this)||this,a=new vE(t,n),r=new Mc;return i.add(a),i.add(r),i.updateData(t,n),i}return ze(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,i=e.rippleNumber,a=this.childAt(1),r=0;r0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||o!==this._loop||s!==this._roundTrip){i.stopAnimation();var c=void 0;c=jr(p)?p(n):p,i.__t>0&&(c=-r*i.__t),this._animateSymbol(i,r,c,o,s)}this._period=r,this._loop=o,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,i,a){if(t>0){e.__t=0;var r=this,o=e.animate("",i).when(a?2*t:t,{__t:a?2:1}).delay(n).during((function(){r._updateSymbolPosition(e)}));i||o.done((function(){r.remove(e)})),o.start()}},t.prototype._getLineLength=function(e){return Fo(e.__p1,e.__cp1)+Fo(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,i=e.__cp1,a=e.__t<1?e.__t:2-e.__t,r=[e.x,e.y],o=r.slice(),s=yl,l=vl;r[0]=s(t[0],i[0],n[0],a),r[1]=s(t[1],i[1],n[1],a);var p=e.__t<1?l(t[0],i[0],n[0],a):l(n[0],i[0],t[0],1-a),c=e.__t<1?l(t[1],i[1],n[1],a):l(n[1],i[1],t[1],1-a);e.rotation=-Math.atan2(c,p)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT=0&&!(i[r]<=t);r--);r=Math.min(r,a-2)}else{for(r=o;rt);r++);r=Math.min(r-1,a-2)}var s=(t-i[r])/(i[r+1]-i[r]),l=n[r],p=n[r+1];e.x=l[0]*(1-s)+s*p[0],e.y=l[1]*(1-s)+s*p[1];var c=e.__t<1?p[0]-l[0]:l[0]-p[0],d=e.__t<1?p[1]-l[1]:l[1]-p[1];e.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=t,e.ignore=!1}},t}(tR),aR=function(){this.polyline=!1,this.curveness=0,this.segs=[]},rR=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return ze(t,e),t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new aR},t.prototype.buildPath=function(e,t){var n,i=t.segs,a=t.curveness;if(t.polyline)for(n=this._off;n0){e.moveTo(i[n++],i[n++]);for(var o=1;o0){var d=(s+p)/2-(l-c)*a,u=(l+c)/2-(p-s)*a;e.quadraticCurveTo(d,u,p,c)}else e.lineTo(p,c)}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,i=n.segs,a=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s0)for(var p=i[s++],c=i[s++],d=1;d0){if(Qu(p,c,(p+u)/2-(c-m)*a,(c+m)/2-(u-p)*a,u,m,r,e,t))return o}else if(Xu(p,c,u,m,r,e,t))return o;o++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return e=n[0],t=n[1],i.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,i=1/0,a=-1/0,r=-1/0,o=0;o0&&(r.dataIndex=n+e.__startIndex)}))},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),sR={seriesType:"lines",plan:gw(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get("polyline"),i=e.pipelineContext.large;return{progress:function(a,r){var o=[];if(i){var s=void 0,l=a.end-a.start;if(n){for(var p=0,c=a.start;c0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),a.updateData(i);var p=e.get("clip",!0)&&BE(e.coordinateSystem,!1,e);p?this.group.setClipPath(p):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateLineDraw(i,e).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var i=e.getData(),a=e.pipelineContext;if(!this._finished||a.large||a.progressiveRender)return{update:!0};var r=sR.reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,i=this._showEffect(t),a=!!t.get("polyline"),r=t.pipelineContext.large;return n&&i===this._hasEffet&&a===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new oR:new zO(a?i?iR:nR:i?tR:GO),this._hasEffet=i,this._isPolyline=a,this._isLargeDraw=r),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type="lines"}(vw),"undefined"==typeof Uint32Array?Array:Uint32Array),pR="undefined"==typeof Float64Array?Array:Float64Array;function cR(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=Br(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),Mr([t,e[0],e[1]])})))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}ze(t,e),t.prototype.init=function(t){t.data=t.data||[],cR(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(cR(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=yo(this._flatCoords,t.flatCoords),this._flatCoordsOffset=yo(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],i=this._flatCoordsOffset[2*e+1],a=0;a ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),t=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&t>0?t+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}(ow);var dR=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=dr.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,i,a,r){var o=this._getBrush(),s=this._getGradient(a,"inRange"),l=this._getGradient(a,"outOfRange"),p=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),u=e.length;c.width=t,c.height=n;for(var m=0;m0){var T=r(y)?s:l;y>0&&(y=y*C+S),x[b++]=T[_],x[b++]=T[_+1],x[b++]=T[_+2],x[b++]=T[_+3]*y*256}else b+=4}return d.putImageData(v,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=dr.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,o=0;o<256;o++)e[t](o/255,!0,a),i[r++]=a[0],i[r++]=a[1],i[r++]=a[2],i[r++]=a[3];return i},e}();function uR(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.render=function(e,t,n){var i;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(i=t)}))})),this._progressiveEls=null,this.group.removeAll();var a=e.coordinateSystem;"cartesian2d"===a.type||"calendar"===a.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):uR(a)&&this._renderOnGeo(a,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){var a=t.coordinateSystem;a&&(uR(a)?this.render(t,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Nf(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,a){var r,o,s,l,p=e.coordinateSystem,c=NE(p,"cartesian2d");if(c){var d=p.getAxis("x"),u=p.getAxis("y");0,r=d.getBandWidth()+.5,o=u.getBandWidth()+.5,s=d.scale.getExtent(),l=u.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),f=e.getModel(["blur","itemStyle"]).getItemStyle(),y=e.getModel(["select","itemStyle"]).getItemStyle(),v=e.get(["itemStyle","borderRadius"]),x=Uf(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),C=b.get("disabled"),_=c?[h.mapDimension("x"),h.mapDimension("y"),h.mapDimension("value")]:[h.mapDimension("time"),h.mapDimension("value")],T=n;Ts[1]||kl[1])continue;var P=p.dataToPoint([M,k]);I=new Em({shape:{x:P[0]-r/2,y:P[1]-o/2,width:r,height:o},style:E})}else{if(isNaN(h.get(_[1],T)))continue;I=new Em({z2:1,shape:p.dataToRect([h.get(_[0],T)]).contentShape,style:E})}if(h.hasItemOption){var D=h.getItemModel(T),O=D.getModel("emphasis");g=O.getModel("itemStyle").getItemStyle(),f=D.getModel(["blur","itemStyle"]).getItemStyle(),y=D.getModel(["select","itemStyle"]).getItemStyle(),v=D.get(["itemStyle","borderRadius"]),w=O.get("focus"),S=O.get("blurScope"),C=O.get("disabled"),x=Uf(D)}I.shape.r=v;var A=e.getRawValue(T),F="-";A&&null!=A[2]&&(F=A[2]+""),zf(I,x,{labelFetcher:e,labelDataIndex:T,defaultOpacity:E.opacity,defaultText:F}),I.ensureState("emphasis").style=g,I.ensureState("blur").style=f,I.ensureState("select").style=y,Oh(I,w,S,C),I.incremental=a,a&&(I.states.emphasis.hoverLayer=!0),m.add(I),h.setItemGraphicEl(T,I),this._progressiveEls&&this._progressiveEls.push(I)}},t.prototype._renderOnGeo=function(e,t,n,i){var a=n.targetVisuals.inRange,r=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new dR;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),p=e.getRoamTransform();l.applyTransform(p);var c=Math.max(l.x,0),d=Math.max(l.y,0),u=Math.min(l.width+l.x,i.getWidth()),m=Math.min(l.height+l.y,i.getHeight()),h=u-c,g=m-d,f=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],y=o.mapArray(f,(function(t,n,i){var a=e.dataToPoint([t,n]);return a[0]-=c,a[1]-=d,a.push(i),a})),v=n.getExtent(),x="visualMap.continuous"===n.type?function(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}(v,n.option.range):function(e,t,n){var i=e[1]-e[0],a=(t=Br(t,(function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}}))).length,r=0;return function(e){var i;for(i=r;i=0;i--){var o;if((o=t[i].interval)[0]<=e&&e<=o[1]){r=i;break}}return i>=0&&i0?1:-1}(n,r,a,i,d),function(e,t,n,i,a,r,o,s,l,p){var c,d=l.valueDim,u=l.categoryDim,m=Math.abs(n[u.wh]),h=e.getItemVisual(t,"symbolSize");c=Ur(h)?h.slice():null==h?["100%","100%"]:[h,h];c[u.index]=Vc(c[u.index],m),c[d.index]=Vc(c[d.index],i?m:Math.abs(r)),p.symbolSize=c;var g=p.symbolScale=[c[0]/s,c[1]/s];g[d.index]*=(l.isHorizontal?-1:1)*o}(e,t,a,r,0,d.boundingLength,d.pxSign,p,i,d),function(e,t,n,i,a){var r=e.get(mR)||0;r&&(gR.attr({scaleX:t[0],scaleY:t[1],rotation:n}),gR.updateTransform(),r/=gR.getLineScale(),r*=t[i.valueDim.index]);a.valueLineWidth=r||0}(n,d.symbolScale,l,i,d);var u=d.symbolSize,m=OS(n.get("symbolOffset"),u);return function(e,t,n,i,a,r,o,s,l,p,c,d){var u=c.categoryDim,m=c.valueDim,h=d.pxSign,g=Math.max(t[m.index]+s,0),f=g;if(i){var y=Math.abs(l),v=no(e.get("symbolMargin"),"15%")+"",x=!1;v.lastIndexOf("!")===v.length-1&&(x=!0,v=v.slice(0,v.length-1));var b=Vc(v,t[m.index]),w=Math.max(g+2*b,0),S=x?0:2*b,C=nd(i),_=C?i:OR((y+S)/w);w=g+2*(b=(y-_*g)/2/(x?_:Math.max(_-1,1))),S=x?0:2*b,C||"fixed"===i||(_=p?OR((Math.abs(p)+S)/w):0),f=_*w-S,d.repeatTimes=_,d.symbolMargin=b}var T=h*(f/2),I=d.pathPosition=[];I[u.index]=n[u.wh]/2,I[m.index]="start"===o?T:"end"===o?l-T:l/2,r&&(I[0]+=r[0],I[1]+=r[1]);var E=d.bundlePosition=[];E[u.index]=n[u.xy],E[m.index]=n[m.xy];var M=d.barRectShape=kr({},n);M[m.wh]=h*Math.max(Math.abs(n[m.wh]),Math.abs(I[m.index]+T)),M[u.wh]=n[u.wh];var k=d.clipShape={};k[u.xy]=-n[u.xy],k[u.wh]=c.ecSize[u.wh],k[m.xy]=0,k[m.wh]=n[m.wh]}(n,u,a,r,0,m,s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,i,d),d}function yR(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function vR(e){var t=e.symbolPatternSize,n=PS(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function xR(e,t,n,i){var a=e.__pictorialBundle,r=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,p=n.repeatTimes||0,c=0,d=r[t.valueDim.index]+o+2*n.symbolMargin;for(kR(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=p,c0:i<0)&&(a=p-1-e),t[l.index]=d*(a-p/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function bR(e,t,n,i){var a=e.__pictorialBundle,r=e.__pictorialMainPath;r?PR(r,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(r=e.__pictorialMainPath=vR(n),a.add(r),PR(r,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function wR(e,t,n){var i=kr({},t.barRectShape),a=e.__pictorialBarRect;a?PR(a,null,{shape:i},t,n):((a=e.__pictorialBarRect=new Em({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,e.add(a))}function SR(e,t,n,i){if(n.symbolClip){var a=e.__pictorialClipPath,r=kr({},n.clipShape),o=t.valueDim,s=n.animationModel,l=n.dataIndex;if(a)tf(a,{shape:r},s,l);else{r[o.wh]=0,a=new Em({shape:r}),e.__pictorialBundle.setClipPath(a),e.__pictorialClipPath=a;var p={};p[o.wh]=n.clipShape[o.wh],Lf[i?"updateProps":"initProps"](a,{shape:p},s,l)}}}function CR(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=_R,n.isAnimationEnabled=TR,n}function _R(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function TR(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function IR(e,t,n,i){var a=new Mc,r=new Mc;return a.add(r),a.__pictorialBundle=r,r.x=n.bundlePosition[0],r.y=n.bundlePosition[1],n.symbolRepeat?xR(a,t,n):bR(a,0,n),wR(a,n,i),SR(a,t,n,i),a.__pictorialShapeStr=MR(e,n),a.__pictorialSymbolMeta=n,a}function ER(e,t,n,i){var a=i.__pictorialBarRect;a&&a.removeTextContent();var r=[];kR(i,(function(e){r.push(e)})),i.__pictorialMainPath&&r.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),Rr(r,(function(e){rf(e,{scaleX:0,scaleY:0},n,t,(function(){i.parent&&i.parent.remove(i)}))})),e.setItemGraphicEl(t,null)}function MR(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function kR(e,t,n){Rr(e.__pictorialBundle.children(),(function(i){i!==e.__pictorialBarRect&&t.call(n,i)}))}function PR(e,t,n,i,a,r){t&&e.attr(t),i.symbolClip&&!a?n&&e.attr(n):n&&Lf[a?"updateProps":"initProps"](e,n,i.animationModel,i.dataIndex,r)}function DR(e,t,n){var i=n.dataIndex,a=n.itemModel,r=a.getModel("emphasis"),o=r.getModel("itemStyle").getItemStyle(),s=a.getModel(["blur","itemStyle"]).getItemStyle(),l=a.getModel(["select","itemStyle"]).getItemStyle(),p=a.getShallow("cursor"),c=r.get("focus"),d=r.get("blurScope"),u=r.get("scale");kR(e,(function(e){if(e instanceof bm){var t=e.style;e.useStyle(kr({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var i=e.ensureState("emphasis");i.style=o,u&&(i.scaleX=1.1*e.scaleX,i.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,p&&(e.cursor=p),e.z2=n.z2}));var m=t.valueDim.posDesc[+(n.boundingLength>0)],h=e.__pictorialBarRect;h.ignoreClip=!0,zf(h,Uf(a),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:fE(t.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:m}),Oh(e,c,d,r.get("disabled"))}function OR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}ze(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=gy(eM.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}})}(eM);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}ze(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this,r=this.group,o=e.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,p=s.boundaryGap;function c(e){return e.name}r.x=0,r.y=l.y+p[0];var d=new g_(this._layersSeries||[],o,c,c),u=[];function m(t,n,s){var l=a._layers;if("remove"!==t){for(var p,c,d=[],m=[],h=o[n].indices,g=0;gT&&!Kc(E-T)&&E0?(a.virtualPiece?a.virtualPiece.updateData(!1,i,e,t,n):(a.virtualPiece=new AR(i,e,t,n),l.add(a.virtualPiece)),r.piece.off("click"),a.virtualPiece.on("click",(function(e){a._rootToNode(r.parentNode)}))):a.virtualPiece&&(l.remove(a.virtualPiece),a.virtualPiece=null)}(o,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===t.target){var a=i.getModel().get("nodeClick");if("rootToNode"===a)e._rootToNode(i);else if("link"===a){var r=i.getModel(),o=r.get("link");if(o)pv(o,r.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:FR,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,a=e[1]-n.cy,r=Math.sqrt(i*i+a*a);return r<=n.r&&r>=n.r0}},t.type="sunburst"})(vw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}ze(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};RR(n);var i=this._levelModels=Br(e.levels||[],(function(e){return new uy(e,this,t)}),this),a=ND.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=a.getNodeByDataIndex(t),r=i[n.depth];return r&&(e.parentModel=r),e}))}));return a.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=GD(i,this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){zD(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"}}(ow);function RR(e){var t=0;Rr(e.children,(function(e){RR(e);var n=e.value;Ur(n)&&(n=n[0]),t+=n}));var n=e.value;Ur(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Ur(e.value)?e.value[0]=n:e.value=n}Math.PI;var BR={color:"fill",borderColor:"stroke"},NR={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},LR=Cd(),VR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return K_(null,this)},t.prototype.getDataParams=function(t,n,i){var a=e.prototype.getDataParams.call(this,t,n);return i&&(a.info=LR(i).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(ow);function qR(e,t){return t=t||[0,0],Br(["x","y"],(function(n,i){var a=this.getAxis(n),r=t[i],o=e[i]/2;return"category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o))}),this)}function GR(e,t){return t=t||[0,0],Br([0,1],(function(n){var i=t[n],a=e[n]/2,r=[],o=[];return r[n]=i-a,o[n]=i+a,r[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(r)[n]-this.dataToPoint(o)[n])}),this)}function zR(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,a=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-a)-n.dataToCoord(i+a))}function UR(e,t){return t=t||[0,0],Br(["Radius","Angle"],(function(n,i){var a=this["get"+n+"Axis"](),r=t[i],o=e[i]/2,s="category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function jR(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||bo(e,"text")))}function HR(e,t,n){var i,a,r,o=e;if("text"===t)r=o;else{r={},bo(o,"text")&&(r.text=o.text),bo(o,"rich")&&(r.rich=o.rich),bo(o,"textFill")&&(r.fill=o.textFill),bo(o,"textStroke")&&(r.stroke=o.textStroke),bo(o,"fontFamily")&&(r.fontFamily=o.fontFamily),bo(o,"fontSize")&&(r.fontSize=o.fontSize),bo(o,"fontStyle")&&(r.fontStyle=o.fontStyle),bo(o,"fontWeight")&&(r.fontWeight=o.fontWeight),a={type:"text",style:r,silent:!0},i={};var s=bo(o,"textPosition");n?i.position=s?o.textPosition:"inside":s&&(i.position=o.textPosition),bo(o,"textPosition")&&(i.position=o.textPosition),bo(o,"textOffset")&&(i.offset=o.textOffset),bo(o,"textRotation")&&(i.rotation=o.textRotation),bo(o,"textDistance")&&(i.distance=o.textDistance)}return WR(r,e),Rr(r.rich,(function(e){WR(e,e)})),{textConfig:i,textContent:a}}function WR(e,t){t&&(t.font=t.textFont||t.font,bo(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),bo(t,"textAlign")&&(e.align=t.textAlign),bo(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),bo(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),bo(t,"textWidth")&&(e.width=t.textWidth),bo(t,"textHeight")&&(e.height=t.textHeight),bo(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),bo(t,"textPadding")&&(e.padding=t.textPadding),bo(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),bo(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),bo(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),bo(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),bo(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),bo(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),bo(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function $R(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var a=i.textPosition.indexOf("inside")>=0,r=e.fill||"#000";KR(i,t);var o=null==i.textFill;return a?o&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=r),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(o&&(i.textFill=e.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,Rr(t.rich,(function(e){KR(e,e)})),i}function KR(e,t){t&&(bo(t,"fill")&&(e.textFill=t.fill),bo(t,"stroke")&&(e.textStroke=t.fill),bo(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),bo(t,"font")&&(e.font=t.font),bo(t,"fontStyle")&&(e.fontStyle=t.fontStyle),bo(t,"fontWeight")&&(e.fontWeight=t.fontWeight),bo(t,"fontSize")&&(e.fontSize=t.fontSize),bo(t,"fontFamily")&&(e.fontFamily=t.fontFamily),bo(t,"align")&&(e.textAlign=t.align),bo(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),bo(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),bo(t,"width")&&(e.textWidth=t.width),bo(t,"height")&&(e.textHeight=t.height),bo(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),bo(t,"padding")&&(e.textPadding=t.padding),bo(t,"borderColor")&&(e.textBorderColor=t.borderColor),bo(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),bo(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),bo(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),bo(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),bo(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),bo(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),bo(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),bo(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),bo(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),bo(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var YR={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},XR=qr(YR),ZR=(Nr(sc,(function(e,t){return e[t]=1,e}),{}),sc.join(", "),["","style","shape","extra"]),QR=Cd();function JR(e,t,n,i,a){var r=e+"Animation",o=Jg(e,i,a)||{},s=QR(t).userDuring;return o.duration>0&&(o.during=s?Gr(oB,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),kr(o,n[r]),o}function eB(e,t,n,i){var a=(i=i||{}).dataIndex,r=i.isInit,o=i.clearStyle,s=n.isAnimationEnabled(),l=QR(e),p=t.style;l.userDuring=t.during;var c={},d={};if(function(e,t,n){for(var i=0;i=0)){var d=e.getAnimationStyleProps(),u=d?d.style:null;if(u){!a&&(a=i.style={});var m=qr(n);for(p=0;p0&&e.animateFrom(u,m)}else!function(e,t,n,i,a){if(a){var r=JR("update",e,t,i,n);r.duration>0&&e.animateFrom(a,r)}}(e,t,a||0,n,c);tB(e,t),p?e.dirty():e.markRedraw()}function tB(e,t){for(var n=QR(e).leaveToProps,i=0;i=0){!r&&(r=i[e]={});var u=qr(o);for(c=0;ci[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),r=n.dataToAngle(i[1]),o=e.coordToPoint([a,r]);return o.push(a,r*Math.PI/180),o},size:Gr(UR,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function _B(e){return e instanceof gm}function TB(e){return e instanceof mu}var IB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var a=this._data,r=e.getData(),o=this.group,s=DB(e,r,t,n);a||o.removeAll(),r.diff(a).add((function(t){AB(n,null,t,s(t,i),e,o,r)})).remove((function(t){var n=a.getItemGraphicEl(t);n&&nB(n,LR(n).option,e)})).update((function(t,l){var p=a.getItemGraphicEl(l);AB(n,p,t,s(t,i),e,o,r)})).execute();var l=e.get("clip",!0)?BE(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=r},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,i,a){var r=t.getData(),o=DB(t,r,n,i),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var p=e.start;p=0?t.getStore().get(a,n):void 0}var r=t.get(i.name,n),o=i&&i.ordinalMeta;return o?o.categories[r]:r},styleEmphasis:function(n,i){0;null==i&&(i=s);var a=v(i,hB).getItemStyle(),r=x(i,hB),o=jf(r,null,null,!0,!0);o.text=r.getShallow("show")?ao(e.getFormattedLabel(i,hB),e.getFormattedLabel(i,gB),fE(t,i)):null;var l=Hf(r,null,!0);return w(n,a),a=$R(a,o,l),n&&b(a,n),a.legacy=!0,a},visual:function(e,n){if(null==n&&(n=s),bo(BR,e)){var i=t.getItemVisual(n,"style");return i?i[BR[e]]:null}if(bo(NR,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===r.type){return function(e){var t=[],n=e.axis,i="axis0";if("category"===n.type){for(var a=n.getBandWidth(),r=0;r=d;h--){var g=t.childAt(h);VB(t,g,a)}}(e,d,n,i,a),o>=0?r.replaceAt(d,o):r.add(d),d}function RB(e,t,n){var i,a=LR(e),r=t.type,o=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=r&&r!==a.customGraphicType||"path"===r&&((i=o)&&(bo(i,"pathData")||bo(i,"d")))&&UB(o)!==a.customPathData||"image"===r&&bo(s,"image")&&s.image!==a.customImagePath}function BB(e,t,n){var i=t?NB(e,t):e,a=t?LB(e,i,hB):e.style,r=e.type,o=i?i.textConfig:null,s=e.textContent,l=s?t?NB(s,t):s:null;if(a&&(n.isLegacy||jR(a,r,!!o,!!l))){n.isLegacy=!0;var p=HR(a,r,!t);!o&&p.textConfig&&(o=p.textConfig),!l&&p.textContent&&(l=p.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text")}var d=t?n[t]:n.normal;d.cfg=o,d.conOpt=l}function NB(e,t){return t?e?e[t]:null:e}function LB(e,t,n){var i=t&&t.style;return null==i&&n===hB&&e&&(i=e.styleEmphasis),i}function VB(e,t,n){t&&nB(t,LR(e).option,n)}function qB(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function GB(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,a=null!=t?n.oldChildren[t]:null;FB(n.api,a,n.dataIndex,i,n.seriesModel,n.group)}function zB(e){var t=this.context,n=t.oldChildren[e];n&&nB(n,LR(n).option,t.seriesModel)}function UB(e){return e&&(e.pathData||e.d)}function jB(e){e.registerChartView(IB),e.registerSeriesModel(VR)}var HB=Cd(),WB=Ir,$B=Gr,KB=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var a=t.get("value"),r=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==a||this._lastStatus!==r){this._lastValue=a,this._lastStatus=r;var o=this._group,s=this._handle;if(!r||"hide"===r)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,a,e,t,n);var p=l.graphicKey;p!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=p;var c=this._moveAnimation=this.determineAnimation(e,t);if(o){var d=zr(YB,t,c);this.updatePointerEl(o,l,d),this.updateLabelEl(o,l,d,t)}else o=this._group=new Mc,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),n.getZr().add(o);JB(o,t,!0),this._renderHandle(a)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,a="category"===i.type,r=t.get("snap");if(!r&&!a)return!1;if("auto"===n||null==n){var o=this.animationThreshold;if(a&&i.getBandWidth()>o)return!0;if(r){var s=Tk(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,a){},e.prototype.createPointerEl=function(e,t,n,i){var a=t.pointer;if(a){var r=HB(e).pointerEl=new Lf[a.type](WB(t.pointer));e.add(r)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var a=HB(e).labelEl=new Pm(WB(t.label));e.add(a),ZB(a,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=HB(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var a=HB(e).labelEl;a&&(a.setStyle(t.label.style),n(a,{x:t.label.x,y:t.label.y}),ZB(a,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),a=this._handle,r=n.getModel("handle"),o=n.get("status");if(!r.get("show")||!o||"hide"===o)return a&&i.remove(a),void(this._handle=null);this._handle||(t=!0,a=this._handle=Df(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){ls(e.event)},onmousedown:$B(this._onHandleDragMove,this,0,0),drift:$B(this._onHandleDragMove,this),ondragend:$B(this._onHandleDragEnd,this)}),i.add(a)),JB(a,n,!1),a.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");Ur(s)||(s=[s,s]),a.scaleX=s[0]/2,a.scaleY=s[1]/2,Mw(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){YB(this._axisPointerModel,!t&&this._moveAnimation,this._handle,QB(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(QB(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(QB(i)),HB(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),kw(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function YB(e,t,n,i){XB(HB(n).lastProp,i)||(HB(n).lastProp=i,t?tf(n,i,e):(n.stopAnimation(),n.attr(i)))}function XB(e,t){if(Kr(e)&&Kr(t)){var n=!0;return Rr(t,(function(t,i){n=n&&XB(e[i],t)})),!!n}return e===t}function ZB(e,t){e[t.get(["label","show"])?"show":"hide"]()}function QB(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function JB(e,t,n){var i=t.get("z"),a=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=a&&(e.zlevel=a),e.silent=n)}))}function eN(e){var t,n=e.get("type"),i=e.getModel(n+"Style");return"line"===n?(t=i.getLineStyle()).fill=null:"shadow"===n&&((t=i.getAreaStyle()).stroke=null),t}function tN(e,t,n,i,a){var r=nN(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),o=n.getModel("label"),s=nv(o.get("padding")||0),l=o.getFont(),p=uc(r,l),c=a.position,d=p.width+s[1]+s[3],u=p.height+s[0]+s[2],m=a.align;"right"===m&&(c[0]-=d),"center"===m&&(c[0]-=d/2);var h=a.verticalAlign;"bottom"===h&&(c[1]-=u),"middle"===h&&(c[1]-=u/2),function(e,t,n,i){var a=i.getWidth(),r=i.getHeight();e[0]=Math.min(e[0]+t,a)-t,e[1]=Math.min(e[1]+n,r)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(c,d,u,i);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:jf(o,{text:r,font:l,fill:o.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function nN(e,t,n,i,a){e=t.scale.parse(e);var r=t.scale.getLabel({value:e},{precision:a.precision}),o=a.formatter;if(o){var s={value:XT(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};Rr(i,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,a=t&&t.getDataParams(i);a&&s.seriesData.push(a)})),Hr(o)?r=o.replace("{value}",r):jr(o)&&(r=o(s))}return r}function iN(e,t,n){var i=[1,0,0,1,0,0];return ys(i,i,n.rotation),fs(i,i,n.position),Tf([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function aN(e,t,n,i,a,r){var o=yk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=a.get(["label","margin"]),tN(t,i,a,r,{position:iN(i.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function rN(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function oN(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function sN(e,t,n,i,a,r){return{cx:e,cy:t,r0:n,r:i,startAngle:a,endAngle:r,clockwise:!0}}var lN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis,o=r.grid,s=i.get("type"),l=pN(o,r).getOtherAxis(r).getGlobalExtent(),p=r.toGlobalCoord(r.dataToCoord(t,!0));if(s&&"none"!==s){var c=eN(i),d=cN[s](r,p,l);d.style=c,e.graphicKey=d.type,e.pointer=d}aN(t,e,sk(o.model,n),n,i,a)},t.prototype.getHandleTransform=function(e,t,n){var i=sk(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var a=iN(t.axis,e,i);return{x:a[0],y:a[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var a=n.axis,r=a.grid,o=a.getGlobalExtent(!0),s=pN(r,a).getOtherAxis(a).getGlobalExtent(),l="x"===a.dim?0:1,p=[e.x,e.y];p[l]+=t[l],p[l]=Math.min(o[1],p[l]),p[l]=Math.max(o[0],p[l]);var c=(s[1]+s[0])/2,d=[c,c];d[l]=p[l];return{x:p[0],y:p[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(KB);function pN(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var cN={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:rN([t,n[0]],[t,n[1]],dN(e))}},shadow:function(e,t,n){var i=Math.max(1,e.getBandWidth()),a=n[1]-n[0];return{type:"Rect",shape:oN([t-i/2,n[0]],[i,a],dN(e))}}};function dN(e){return"x"===e.dim?0:1}var uN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(Sv),mN=Cd(),hN=Rr;function gN(e,t,n){if(!rr.node){var i=t.getZr();mN(i).records||(mN(i).records={}),function(e,t){if(mN(e).initialized)return;function n(n,i){e.on(n,(function(n){var a=function(e){var t={showTip:[],hideTip:[]},n=function(i){var a=t[i.type];a?a.push(i):(i.dispatchAction=n,e.dispatchAction(i))};return{dispatchAction:n,pendings:t}}(t);hN(mN(e).records,(function(e){e&&i(e,n,a.dispatchAction)})),function(e,t){var n,i=e.showTip.length,a=e.hideTip.length;i?n=e.showTip[i-1]:a&&(n=e.hideTip[a-1]);n&&(n.dispatchAction=null,t.dispatchAction(n))}(a.pendings,t)}))}mN(e).initialized=!0,n("click",zr(yN,"click")),n("mousemove",zr(yN,"mousemove")),n("globalout",fN)}(i,t),(mN(i).records[e]||(mN(i).records[e]={})).handler=n}}function fN(e,t,n){e.handler("leave",null,n)}function yN(e,t,n,i){t.handler(e,n,i)}function vN(e,t){if(!rr.node){var n=t.getZr();(mN(n).records||{})[e]&&(mN(n).records[e]=null)}}var xN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),a=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";gN("axisPointer",n,(function(e,t,n){"none"!==a&&("leave"===e||a.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){vN("axisPointer",t)},t.prototype.dispose=function(e,t){vN("axisPointer",t)},t.type="axisPointer",t}(hw);function bN(e,t){var n,i=[],a=e.seriesIndex;if(null==a||!(n=t.getSeriesByIndex(a)))return{point:[]};var r=n.getData(),o=Sd(r,e);if(null==o||o<0||Ur(o))return{point:[]};var s=r.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var p=l.getBaseAxis(),c=l.getOtherAxis(p).dim,d=p.dim,u="x"===c||"radius"===c?1:0,m=r.mapDimension(d),h=[];h[u]=r.get(m,o),h[1-u]=r.get(r.getCalculationInfo("stackResultDimension"),o),i=l.dataToPoint(h)||[]}else i=l.dataToPoint(r.getValues(Br(l.dimensions,(function(e){return r.mapDimension(e)})),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var wN=Cd();function SN(e,t,n){var i=e.currTrigger,a=[e.x,e.y],r=e,o=e.dispatchAction||Gr(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){EN(a)&&(a=bN({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},t).point);var l=EN(a),p=r.axesInfo,c=s.axesInfo,d="leave"===i||EN(a),u={},m={},h={list:[],map:{}},g={showPointer:zr(_N,m),showTooltip:zr(TN,h)};Rr(s.coordSysMap,(function(e,t){var n=l||e.containPoint(a);Rr(s.coordSysAxesInfo[t],(function(e,t){var i=e.axis,r=function(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}(p,e);if(!d&&n&&(!p||r)){var o=r&&r.value;null!=o||l||(o=i.pointToData(a)),null!=o&&CN(e,o,g,!1,u)}}))}));var f={};return Rr(c,(function(e,t){var n=e.linkGroup;n&&!m[t]&&Rr(n.axesInfo,(function(t,i){var a=m[i];if(t!==e&&a){var r=a.value;n.mapper&&(r=e.axis.scale.parse(n.mapper(r,IN(t),IN(e)))),f[e.key]=r}}))})),Rr(f,(function(e,t){CN(c[t],e,g,!0,u)})),function(e,t,n){var i=n.axesInfo=[];Rr(t,(function(t,n){var a=t.axisPointerModel.option,r=e[n];r?(!t.useHandle&&(a.status="show"),a.value=r.value,a.seriesDataIndices=(r.payloadBatch||[]).slice()):!t.useHandle&&(a.status="hide"),"show"===a.status&&i.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:a.value})}))}(m,c,u),function(e,t,n,i){if(EN(t)||!e.list.length)return void i({type:"hideTip"});var a=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:e.list})}(h,a,e,o),function(e,t,n){var i=n.getZr(),a="axisPointerLastHighlights",r=wN(i)[a]||{},o=wN(i)[a]={};Rr(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&Rr(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];Rr(r,(function(e,t){!o[t]&&l.push(e)})),Rr(o,(function(e,t){!r[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(c,0,n),u}}function CN(e,t,n,i,a){var r=e.axis;if(!r.scale.isBlank()&&r.containData(t))if(e.involveSeries){var o=function(e,t){var n=t.axis,i=n.dim,a=e,r=[],o=Number.MAX_VALUE,s=-1;return Rr(t.seriesModels,(function(t,l){var p,c,d=t.getData().mapDimensionsAll(i);if(t.getAxisTooltipData){var u=t.getAxisTooltipData(d,e,n);c=u.dataIndices,p=u.nestestValue}else{if(!(c=t.getData().indicesOfNearest(d[0],e,"category"===n.type?.5:null)).length)return;p=t.getData().get(d[0],c[0])}if(null!=p&&isFinite(p)){var m=e-p,h=Math.abs(m);h<=o&&((h=0&&s<0)&&(o=h,s=m,a=p,r.length=0),Rr(c,(function(e){r.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:r,snapToValue:a}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==a.seriesIndex&&kr(a,s[0]),!i&&e.snap&&r.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,o,l)}else n.showPointer(e,t)}function _N(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function TN(e,t,n,i){var a=n.payloadBatch,r=t.axis,o=r.model,s=t.axisPointerModel;if(t.triggerTooltip&&a.length){var l=t.coordSys.model,p=Ek(l),c=e.map[p];c||(c=e.map[p]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:r.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function IN(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function EN(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function MN(e){kk.registerAxisPointerClass("CartesianAxisPointer",lN),e.registerComponentModel(uN),e.registerComponentView(xN),e.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Ur(t)&&(e.axisPointer.link=[t])}})),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=Ck(e,t)})),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},SN)}function kN(e){aI(Gk),aI(MN)}var PN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var o=r.polar,s=o.getOtherAxis(r).getExtent(),l=r.dataToCoord(t),p=i.get("type");if(p&&"none"!==p){var c=eN(i),d=DN[p](r,o,l,s);d.style=c,e.graphicKey=d.type,e.pointer=d}var u=function(e,t,n,i,a){var r=t.axis,o=r.dataToCoord(e),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,p,c,d=i.getRadiusAxis().getExtent();if("radius"===r.dim){var u=[1,0,0,1,0,0];ys(u,u,s),fs(u,u,[i.cx,i.cy]),l=Tf([o,-a],u);var m=t.getModel("axisLabel").get("rotate")||0,h=yk.innerTextLayout(s,m*Math.PI/180,-1);p=h.textAlign,c=h.textVerticalAlign}else{var g=d[1];l=i.coordToPoint([g+a,o]);var f=i.cx,y=i.cy;p=Math.abs(l[0]-f)/g<.3?"center":l[0]>f?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:p,verticalAlign:c}}(t,n,0,o,i.get(["label","margin"]));tN(e,n,i,a,u)},t}(KB);var DN={line:function(e,t,n,i){return"angle"===e.dim?{type:"Line",shape:rN(t.coordToPoint([i[0],n]),t.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,i){var a=Math.max(1,e.getBandWidth()),r=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:sN(t.cx,t.cy,i[0],i[1],(-n-a/2)*r,(a/2-n)*r)}:{type:"Sector",shape:sN(t.cx,t.cy,n-a/2,n+a/2,0,2*Math.PI)}}},ON=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(Sv),AN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ze(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ed).models[0]},t.type="polarAxis",t}(Sv);Ar(AN,tI);var FN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="angleAxis",t}(AN),RN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="radiusAxis",t}(AN),BN=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return ze(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(MI);BN.prototype.dataToRadius=MI.prototype.dataToCoord,BN.prototype.radiusToData=MI.prototype.coordToData;var NN=Cd(),LN=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return ze(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,i=n.getExtent(),a=n.count();if(i[1]-i[0]<1)return 0;var r=i[0],o=e.dataToCoord(r+1)-e.dataToCoord(r),s=Math.abs(o),l=uc(null==r?"":r+"",t.getFont(),"center","top"),p=Math.max(l.height,7)/s;isNaN(p)&&(p=1/0);var c=Math.max(0,Math.floor(p)),d=NN(e.model),u=d.lastAutoInterval,m=d.lastTickCount;return null!=u&&null!=m&&Math.abs(u-c)<=1&&Math.abs(m-a)<=1&&u>c?c=u:(d.lastTickCount=a,d.lastAutoInterval=c),c},t}(MI);LN.prototype.dataToAngle=MI.prototype.dataToCoord,LN.prototype.angleToData=MI.prototype.coordToData;var VN=["radius","angle"],qN=function(){function e(e){this.dimensions=VN,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new BN,this._angleAxis=new LN,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),r=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?r=o-360:o=r+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,p=lo;)l+=360*p;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,i=t-this.cy,a=n*n+i*i-1e-4,r=this.r,o=this.r0;return a<=r*r&&a>=o*o}}},e.prototype.convertToPixel=function(e,t,n){return GN(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return GN(t)===this?this.pointToData(n):null},e}();function GN(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function zN(e,t){var n=this,i=n.getAngleAxis(),a=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();Rr(eI(t,"radius"),(function(e){a.scale.unionExtentFromData(t,e)})),Rr(eI(t,"angle"),(function(e){i.scale.unionExtentFromData(t,e)}))}})),$T(i.scale,i.model),$T(a.scale,a.model),"category"===i.type&&!i.onBand){var r=i.getExtent(),o=360/i.scale.count();i.inverse?r[1]+=o:r[1]-=o,i.setExtent(r[0],r[1])}}function UN(e,t){var n;if(e.type=t.get("type"),e.scale=KT(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),function(e){return"angleAxis"===e.mainType}(t)){e.inverse=e.inverse!==t.get("clockwise");var i=t.get("startAngle"),a=null!==(n=t.get("endAngle"))&&void 0!==n?n:i+(e.inverse?-360:360);e.setExtent(i,a)}t.axis=e,e.model=t}var jN={dimensions:VN,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,i){var a=new qN(i+"");a.update=zN;var r=a.getRadiusAxis(),o=a.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");UN(r,s),UN(o,l),function(e,t,n){var i=t.get("center"),a=n.getWidth(),r=n.getHeight();e.cx=Vc(i[0],a),e.cy=Vc(i[1],r);var o=e.getRadiusAxis(),s=Math.min(a,r)/2,l=t.get("radius");null==l?l=[0,"100%"]:Ur(l)||(l=[0,l]);var p=[Vc(l[0],s),Vc(l[1],s)];o.inverse?o.setExtent(p[1],p[0]):o.setExtent(p[0],p[1])}(a,e,t),n.push(a),e.coordinateSystem=a,a.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",Ed).models[0];0,e.coordinateSystem=t.coordinateSystem}})),n}},HN=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function WN(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var i=e.coordToPoint([t[0],n]),a=e.coordToPoint([t[1],n]);return{x1:i[0],y1:i[1],x2:a[0],y2:a[1]}}function $N(e){return e.getRadiusAxis().inverse?0:1}function KN(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var YN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return ze(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,a=i.getRadiusAxis().getExtent(),r=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=Br(n.getViewLabels(),(function(e){e=Ir(e);var t=n.scale,i="ordinal"===t.type?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(i),e}));KN(s),KN(r),Rr(HN,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||XN[t](this.group,e,i,r,o,a,s)}),this)}},t.type="angleAxis",t}(kk),XN={axisLine:function(e,t,n,i,a,r){var o,s=t.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),p=Math.PI/180,c=l.getExtent(),d=$N(n),u=d?0:1,m=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(o=0===r[u]?new Lf[m]({shape:{cx:n.cx,cy:n.cy,r:r[d],startAngle:-c[0]*p,endAngle:-c[1]*p,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new Ig({shape:{cx:n.cx,cy:n.cy,r:r[d],r0:r[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(o)},axisTick:function(e,t,n,i,a,r){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=r[$N(n)],p=Br(i,(function(e){return new Fg({shape:WN(n,[l,l+s],e.coord)})}));e.add(bf(p,{style:Pr(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,i,a,r){if(a.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),p=r[$N(n)],c=[],d=0;dh?"left":"right",y=Math.abs(m[1]-g)/u<.3?"middle":m[1]>g?"top":"bottom";if(s&&s[d]){var v=s[d];Kr(v)&&v.textStyle&&(o=new uy(v.textStyle,l,l.ecModel))}var x=new Pm({silent:yk.isLabelSilent(t),style:jf(o,{x:m[0],y:m[1],fill:o.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:f,verticalAlign:y})});if(e.add(x),c){var b=yk.makeAxisEventDataBase(t);b.targetType="axisLabel",b.value=i.rawLabel,Um(x).eventData=b}}),this)},splitLine:function(e,t,n,i,a,r){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var p=[],c=0;c=0?"p":"n",I=b;v&&(i[s][_]||(i[s][_]={p:b,n:b}),I=i[s][_][T]);var E=void 0,M=void 0,k=void 0,P=void 0;if("radius"===d.dim){var D=d.dataToCoord(C)-b,O=r.dataToCoord(_);Math.abs(D)=P})}}}))}var aL={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},rL={splitNumber:5},oL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="polar",t}(hw);function sL(e){aI(MN),kk.registerAxisPointerClass("PolarAxisPointer",PN),e.registerCoordinateSystem("polar",jN),e.registerComponentModel(ON),e.registerComponentView(oL),ek(e,"angle",FN,aL),ek(e,"radius",RN,rL),e.registerComponentView(YN),e.registerComponentView(JN),e.registerLayout(zr(iL,"bar"))}function lL(e,t){t=t||{};var n=e.coordinateSystem,i=e.axis,a={},r=i.position,o=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],p={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};a.position=["vertical"===o?p.vertical[r]:l[0],"horizontal"===o?p.horizontal[r]:l[3]];a.rotation=Math.PI/2*{horizontal:0,vertical:1}[o];a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),no(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),a.labelRotation="top"===r?-c:c,a.z2=1,a}var pL=["axisLine","axisTickLabel","axisName"],cL=["splitArea","splitLine"],dL=(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}ze(t,e),t.prototype.render=function(t,n,i,a){var r=this.group;r.removeAll();var o=this._axisGroup;this._axisGroup=new Mc;var s=lL(t),l=new yk(t,s);Rr(pL,l.add,l),r.add(this._axisGroup),r.add(l.getGroup()),Rr(cL,(function(e){t.get([e,"show"])&&dL[e](this,this.group,this._axisGroup,t)}),this),Mf(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,a)},t.prototype.remove=function(){Ok(this)},t.type="singleAxis"}(kk),{splitLine:function(e,t,n,i){var a=i.axis;if(!a.scale.isBlank()){var r=i.getModel("splitLine"),o=r.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=o.get("width"),p=i.coordinateSystem.getRect(),c=a.isHorizontal(),d=[],u=0,m=a.getTicksCoords({tickModel:r}),h=[],g=[],f=0;f=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],a="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=0===a?n.y+n.height/2:n.x+n.width/2,i},e.prototype.convertToPixel=function(e,t,n){return gL(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return gL(t)===this?this.pointToData(n):null}}();function gL(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var fL=["x","y"],yL=["width","height"],vL=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ze(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis,o=r.coordinateSystem,s=bL(o,1-xL(r)),l=o.dataToPoint(t)[0],p=i.get("type");if(p&&"none"!==p){var c=eN(i),d=vL[p](r,l,s);d.style=c,e.graphicKey=d.type,e.pointer=d}aN(t,e,lL(n),n,i,a)},t.prototype.getHandleTransform=function(e,t,n){var i=lL(t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var a=iN(t.axis,e,i);return{x:a[0],y:a[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var a=n.axis,r=a.coordinateSystem,o=xL(a),s=bL(r,o),l=[e.x,e.y];l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var p=bL(r,1-o),c=(p[1]+p[0])/2,d=[c,c];return d[o]=l[o],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}}}(KB),{line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:rN([t,n[0]],[t,n[1]],xL(e))}},shadow:function(e,t,n){var i=e.getBandWidth(),a=n[1]-n[0];return{type:"Rect",shape:oN([t-i/2,n[0]],[i,a],xL(e))}}});function xL(e){return e.isHorizontal()?0:1}function bL(e,t){var n=e.getRect();return[n[fL[t]],n[fL[t]]+n[yL[t]]]}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.type="single"}(hw);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.init=function(t,n,i){var a=xv(t);e.prototype.init.apply(this,arguments),wL(t,a)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),wL(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}}}(Sv);function wL(e,t){var n,i=e.cellSize;1===(n=Ur(i)?i:e.cellSize=[i,i]).length&&(n[1]=n[0]);var a=Br([0,1],(function(e){return function(e,t){return null!=e[uv[t][0]]||null!=e[uv[t][1]]&&null!=e[uv[t][2]]}(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));vv(e,t,{type:"box",ignoreSize:a})}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.render=function(e,t,n){var i=this.group;i.removeAll();var a=e.coordinateSystem,r=a.getRangeInfo(),o=a.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,r,i),this._renderLines(e,r,o,i),this._renderYearText(e,r,o,i),this._renderMonthText(e,s,o,i),this._renderWeekText(e,s,r,o,i)},t.prototype._renderDayRect=function(e,t,n){for(var i=e.coordinateSystem,a=e.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),o=i.getCellHeight(),s=t.start.time;s<=t.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,p=new Em({shape:{x:l[0],y:l[1],width:r,height:o},cursor:"default",style:a});n.add(p)}},t.prototype._renderLines=function(e,t,n,i){var a=this,r=e.coordinateSystem,o=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var p=t.start,c=0;p.time<=t.end.time;c++){u(p.formatedDate),0===c&&(p=r.getDateInfo(t.start.y+"-"+t.start.m));var d=p.date;d.setMonth(d.getMonth()+1),p=r.getDateInfo(d)}function u(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var l=a._getLinePointsOfOneWeek(e,t,n);a._tlpoints.push(l[0]),a._blpoints.push(l[l.length-1]),s&&a._drawSplitline(l,o,i)}u(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,l,n),o,i),s&&this._drawSplitline(a._getEdgesPoints(a._blpoints,l,n),o,i)},t.prototype._getEdgesPoints=function(e,t,n){var i=[e[0].slice(),e[e.length-1].slice()],a="horizontal"===n?0:1;return i[0][a]=i[0][a]-t/2,i[1][a]=i[1][a]+t/2,i},t.prototype._drawSplitline=function(e,t,n){var i=new Dg({z2:20,shape:{points:e},style:t});n.add(i)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var i=e.coordinateSystem,a=i.getDateInfo(t),r=[],o=0;o<7;o++){var s=i.getNextNDay(a.time,o),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},t.prototype._formatterLabel=function(e,t){return Hr(e)&&e?(n=e,Rr(t,(function(e,t){n=n.replace("{"+t+"}",i?Jo(e):e)})),n):jr(e)?e(t):t.nameMap;var n,i},t.prototype._yearTextPositionControl=function(e,t,n,i,a){var r=t[0],o=t[1],s=["center","bottom"];"bottom"===i?(o+=a,s=["center","top"]):"left"===i?r-=a:"right"===i?(r+=a,s=["center","top"]):o-=a;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:r,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,i){var a=e.getModel("yearLabel");if(a.get("show")){var r=a.get("margin"),o=a.get("position");o||(o="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,p=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,d={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],p],right:[s[c][0],p]},u=t.start.y;+t.end.y>+t.start.y&&(u=u+"-"+t.end.y);var m=a.get("formatter"),h={start:t.start.y,end:t.end.y,nameMap:u},g=this._formatterLabel(m,h),f=new Pm({z2:30,style:jf(a,{text:g})});f.attr(this._yearTextPositionControl(f,d[o],n,o,r)),i.add(f)}},t.prototype._monthTextPositionControl=function(e,t,n,i,a){var r="left",o="top",s=e[0],l=e[1];return"horizontal"===n?(l+=a,t&&(r="center"),"start"===i&&(o="bottom")):(s+=a,t&&(o="middle"),"start"===i&&(r="right")),{x:s,y:l,align:r,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n,i){var a=e.getModel("monthLabel");if(a.get("show")){var r=a.get("nameMap"),o=a.get("margin"),s=a.get("position"),l=a.get("align"),p=[this._tlpoints,this._blpoints];r&&!Hr(r)||(r&&(t=Cy(r)||t),r=t.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,d="horizontal"===n?0:1;o="start"===s?-o:o;for(var u="center"===l,m=0;m=i.start.time&&n.timeo.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var i=Math.floor(n[1].time/SL)-Math.floor(n[0].time/SL)+1,a=new Date(n[0].time),r=a.getDate(),o=n[1].date.getDate();a.setDate(r+i-1);var s=a.getDate();if(s!==o)for(var l=a.getTime()-n[1].time>0?1:-1;(s=a.getDate())!==o&&(a.getTime()-n[1].time)*l>0;)i-=l,a.setDate(s-l);var p=Math.floor((i+n[0].day+6)/7),c=t?1-p:p-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:p,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||0===e&&ti.lweek)return null;var a=7*(e-1)-i.fweek+t,r=new Date(i.start.time);return r.setDate(+i.start.d+a),this.getDateInfo(r)},e.create=function(t,n){var i=[];return t.eachComponent("calendar",(function(a){var r=new e(a,t,n);i.push(r),a.coordinateSystem=r})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},e.dimensions=["time","value"]}();function CL(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function _L(e,t){var n;return Rr(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}var TL=["transition","enterFrom","leaveTo"],IL=TL.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function EL(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var i=n?TL:IL,a=0;a=0;l--){var u,m,h;if(h=null!=(m=xd((u=n[l]).id,null))?a.get(m):null){var g=h.parent,f=(d=kL(g),{}),y=fv(h,u,g===i?{width:r,height:o}:{width:d.width,height:d.height},null,{hv:u.hv,boundingMode:u.bounding},f);if(!kL(h).isNew&&y){for(var v=u.transition,x={},b=0;b=0)?x[w]=S:h[w]=S}tf(h,x,e,0)}else h.attr(f)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each((function(n){OL(n,kL(n).option,t,e._lastGraphicModel)})),this._elMap=fo()},t.prototype.dispose=function(){this._clear()},t.type="graphic"}(hw);function PL(e){var t=bo(ML,e)?ML[e]:ff(e);var n=new t({});return kL(n).type=e,n}function DL(e,t,n,i){var a=PL(n);return t.add(a),i.set(e,a),kL(a).id=e,kL(a).isNew=!0,a}function OL(e,t,n,i){e&&e.parent&&("group"===e.type&&e.traverse((function(e){OL(e,t,n,i)})),nB(e,t,i),n.removeKey(kL(e).id))}function AL(e,t,n,i){e.isGroup||Rr([["cursor",mu.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];bo(t,i)?e[i]=io(t[i],n[1]):null==e[i]&&(e[i]=n[1])})),Rr(qr(t),(function(n){if(0===n.indexOf("on")){var i=t[n];e[n]=jr(i)?i:null}})),bo(t,"draggable")&&(e.draggable=t.draggable),null!=t.name&&(e.name=t.name),null!=t.id&&(e.id=t.id)}var FL=["x","y","radius","angle","single"],RL=["cartesian2d","polar","singleAxis"];function BL(e){return e+"Axis"}function NL(e,t){var n,i=fo(),a=[],r=fo();e.eachComponent({mainType:"dataZoom",query:t},(function(e){r.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",o)}while(n);function o(e){!r.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var a=i.get(e);a&&a[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){r.set(e.uid,!0),a.push(e),e.eachTargetAxis((function(e,t){(i.get(e)||i.set(e,[]))[t]=!0}))}return a}function LL(e){var t=e.ecModel,n={infoList:[],infoMap:fo()};return e.eachTargetAxis((function(e,i){var a=t.getComponent(BL(e),i);if(a){var r=a.getCoordSysModel();if(r){var o=r.uid,s=n.infoMap.get(o);s||(s={model:r,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(a)}}})),n}var VL=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),qL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return ze(t,e),t.prototype.init=function(e,t,n){var i=GL(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=GL(e);Er(this.option,e,!0),Er(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;Rr([["start","startValue"],["end","endValue"]],(function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=fo();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return Rr(FL,(function(n){var i=this.getReferringComponents(BL(n),Md);if(i.specified){t=!0;var a=new VL;Rr(i.models,(function(e){a.add(e.componentIndex)})),e.set(n,a)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0;if(i){var a="vertical"===t?"y":"x";r(n.findComponents({mainType:a+"Axis"}),a)}i&&r(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function r(t,n){var a=t[0];if(a){var r=new VL;if(r.add(a.componentIndex),e.set(n,r),i=!1,"x"===n||"y"===n){var o=a.getReferringComponents("grid",Ed).models[0];o&&Rr(t,(function(e){a.componentIndex!==e.componentIndex&&o===e.getReferringComponents("grid",Ed).models[0]&&r.add(e.componentIndex)}))}}}i&&Rr(FL,(function(t){if(i){var a=n.findComponents({mainType:BL(t),filter:function(e){return"category"===e.get("type",!0)}});if(a[0]){var r=new VL;r.add(a[0].componentIndex),e.set(t,r),i=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");Rr([["start","startValue"],["end","endValue"]],(function(i,a){var r=null!=e[i[0]],o=null!=e[i[1]];r&&!o?t[a]="percent":!r&&o?t[a]="value":n?t[a]=n[a]:r&&(t[a]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(BL(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,i){Rr(n.indexList,(function(n){e.call(t,i,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(BL(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;Rr([["start","startValue"],["end","endValue"]],(function(i){null==e[i[0]]&&null==e[i[1]]||(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;Rr(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){var n;if(null==e&&null==t){if(n=this.findRepresentativeAxisProxy())return n.getDataValueWindow()}else if(n=this.getAxisProxy(e,t))return n.getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;i=0}(t)){var n=BL(this._dimName),i=t.getReferringComponents(n,Ed).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return Ir(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,i=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),r=[0,100],o=[],s=[];UL(["start","end"],(function(l,p){var c=e[l],d=e[l+"Value"];"percent"===a[p]?(null==c&&(c=r[p]),d=i.parse(Lc(c,r,n))):(t=!0,c=Lc(d=null==d?n[p]:i.parse(d),n,r)),s[p]=null==d||isNaN(d)?n[p]:d,o[p]=null==c||isNaN(c)?r[p]:c})),jL(s),jL(o);var l=this._minMaxSpan;function p(e,t,n,a,r){var o=r?"Span":"ValueSpan";bA(0,e,n,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=Lc(e[s],n,a,!0),r&&(t[s]=i.parse(t[s]))}return t?p(s,o,n,r,!1):p(o,s,r,n,!0),{valueWindow:s,percentWindow:o}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,n){var i=[1/0,-1/0];UL(n,(function(e){!function(e,t,n){t&&Rr(eI(t,n),(function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])}))}(i,e.getData(),t)}));var a=e.getAxisModel(),r=jT(a.axis.scale,a,i).calculate();return[r.min,r.max]}(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),a=e.get("filterMode"),r=this._valueWindow;"none"!==a&&UL(i,(function(e){var t=e.getData(),i=t.mapDimensionsAll(n);if(i.length){if("weakFilter"===a){var o=t.getStore(),s=Br(i,(function(e){return t.getDimensionIndex(e)}),t);t.filterSelf((function(e){for(var t,n,a,l=0;lr[1];if(c&&!d&&!u)return!0;c&&(a=!0),d&&(t=!0),u&&(n=!0)}return a&&t&&n}))}else UL(i,(function(n){if("empty"===a)e.setData(t=t.map(n,(function(e){return function(e){return e>=r[0]&&e<=r[1]}(e)?e:NaN})));else{var i={};i[n]=r,t.selectRange(i)}}));UL(i,(function(e){t.setApproximateExtent(r,e)}))}}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;UL(["min","max"],(function(i){var a=t.get(i+"Span"),r=t.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?a=Lc(n[0]+r,n,[0,100],!0):null!=a&&(r=Lc(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=r}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=jc(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;0!==t[0]&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},e}();var WL={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,a){var r=e.getComponent(BL(i),a);t(i,a,r,n)}))}))}t((function(e,t,n,i){n.__dzAxisProxy=null}));var n=[];t((function(t,i,a,r){a.__dzAxisProxy||(a.__dzAxisProxy=new HL(t,i,r,e),n.push(a.__dzAxisProxy))}));var i=fo();return Rr(n,(function(e){Rr(e.getTargetSeriesModels(),(function(e){i.set(e.uid,e)}))})),i},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){var i=e.getAxisProxy(t,n);i&&i.reset(e)})),e.eachTargetAxis((function(n,i){var a=e.getAxisProxy(n,i);a&&a.filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var $L=!1;function KL(e){$L||($L=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,WL),function(e){e.registerAction("dataZoom",(function(e,t){Rr(NL(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}))}(e),e.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}var YL=function(){},XL={};function ZL(e){return XL[e]}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;Rr(this.option.feature,(function(e,n){var i=ZL(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),Er(e,i.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}}}(Sv);function QL(e,t){var n=nv(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Em({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ze(t,e),t.prototype.render=function(e,t,n,i){var a=this.group;if(a.removeAll(),e.get("show")){var r=+e.get("itemSize"),o="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),p=[];Rr(s,(function(e,t){p.push(t)})),new g_(this._featureNames||[],p).add(c).update(c).remove(zr(c,null)).execute(),this._featureNames=p,function(e,t,n){var i=t.getBoxLayoutParams(),a=t.get("padding"),r={width:n.getWidth(),height:n.getHeight()},o=gv(i,r,a);hv(t.get("orient"),e,t.get("itemGap"),o.width,o.height),fv(e,i,r,a)}(a,e,n),a.add(QL(a.getBoundingRect(),e)),o||a.eachChild((function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!jr(l)&&t){var p=l.style||(l.style={}),c=uc(t,Pm.makeFont(p)),d=e.x+a.x,u=!1;e.y+a.y+r+c.height>n.getHeight()&&(o.position="top",u=!0);var m=u?-5-c.height:r+10;d+c.width/2>n.getWidth()?(o.position=["100%",m],p.align="right"):d-c.width/2<0&&(o.position=[0,m],p.align="left")}}))}function c(c,d){var u,m=p[c],h=p[d],g=s[m],f=new uy(g,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===m&&(g.title=i.newTitle),m&&!h){if(function(e){return 0===e.indexOf("my")}(m))u={onclick:f.option.onclick,featureName:m};else{var y=ZL(m);if(!y)return;u=new y}l[m]=u}else if(!(u=l[h]))return;u.uid=hy("toolbox-feature"),u.model=f,u.ecModel=t,u.api=n;var v=u instanceof YL;m||!h?!f.get("show")||v&&u.unusable?v&&u.remove&&u.remove(t,n):(!function(i,s,l){var p,c,d=i.getModel("iconStyle"),u=i.getModel(["emphasis","iconStyle"]),m=s instanceof YL&&s.getIcons?s.getIcons():i.get("icon"),h=i.get("title")||{};Hr(m)?(p={})[l]=m:p=m;Hr(h)?(c={})[l]=h:c=h;var g=i.iconPaths={};Rr(p,(function(l,p){var m=Df(l,{},{x:-r/2,y:-r/2,width:r,height:r});m.setStyle(d.getItemStyle()),m.ensureState("emphasis").style=u.getItemStyle();var h=new Pm({style:{text:c[p],align:u.get("textAlign"),borderRadius:u.get("textBorderRadius"),padding:u.get("textPadding"),fill:null,font:Xf({fontStyle:u.get("textFontStyle"),fontFamily:u.get("textFontFamily"),fontSize:u.get("textFontSize"),fontWeight:u.get("textFontWeight")},t)},ignore:!0});m.setTextContent(h),Rf({el:m,componentModel:e,itemName:p,formatterParamsExtra:{title:c[p]}}),m.__title=c[p],m.on("mouseover",(function(){var t=u.getItemStyle(),i=o?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";h.setStyle({fill:u.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:u.get("textBackgroundColor")}),m.setTextConfig({position:u.get("textPosition")||i}),h.ignore=!e.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",p])&&n.leaveEmphasis(this),h.hide()})),("emphasis"===i.get(["iconStatus",p])?vh:xh)(m),a.add(m),m.on("click",Gr(s.onclick,s,t,n,p)),g[p]=m}))}(f,u,m),f.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?vh:xh)(i[e])},u instanceof YL&&u.render&&u.render(f,t,n,i)):v&&u.dispose&&u.dispose(t,n)}},t.prototype.updateView=function(e,t,n,i){Rr(this._features,(function(e){e instanceof YL&&e.updateView&&e.updateView(e.model,t,n,i)}))},t.prototype.remove=function(e,t){Rr(this._features,(function(n){n instanceof YL&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){Rr(this._features,(function(n){n instanceof YL&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox"}(hw);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ze(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",a="svg"===t.getZr().painter.getType(),r=a?"svg":n.get("type",!0)||"png",o=t.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=rr.browser;if(jr(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+r,l.target="_blank",l.href=o;var p=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(p)}else if(window.navigator.msSaveOrOpenBlob||a){var c=o.split(","),d=c[0].indexOf("base64")>-1,u=a?decodeURIComponent(c[1]):c[1];d&&(u=window.atob(u));var m=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var h=u.length,g=new Uint8Array(h);h--;)g[h]=u.charCodeAt(h);var f=new Blob([g]);window.navigator.msSaveOrOpenBlob(f,m)}else{var y=document.createElement("iframe");document.body.appendChild(y);var v=y.contentWindow,x=v.document;x.open("image/svg+xml","replace"),x.write(u),x.close(),v.focus(),x.execCommand("SaveAs",!0,m),document.body.removeChild(y)}}else{var b=n.get("lang"),w='',S=window.open();S.document.write(w),S.document.title=i}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}}}(YL);var JL="__ec_magicType_stack__",eV=[["line","bar"],["stack"]],tV=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ze(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return Rr(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i=this.model,a=i.get(["seriesIndex",n]);if(tV[n]){var r,o={series:[]};Rr(eV,(function(e){Dr(e,n)>=0&&Rr(e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==a?null:{seriesIndex:a}},(function(e){var t=e.subType,a=e.id,r=tV[n](t,a,e,i);r&&(Pr(r,e.option),o.series.push(r));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var p=l.dim+"Axis",c=e.getReferringComponents(p,Ed).models[0].componentIndex;o[p]=o[p]||[];for(var d=0;d<=c;d++)o[p][c]=o[p][c]||{};o[p][c].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(r=Er({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:o,newTitle:r,featureName:"magicType"})}}}(YL),{line:function(e,t,n,i){if("bar"===e)return Er({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return Er({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var a=n.get("stack")===JL;if("line"===e||"bar"===e)return i.setIconStatus("stack",a?"normal":"emphasis"),Er({id:t,stack:a?"":JL},i.get(["option","stack"])||{},!0)}});s_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var nV=new Array(60).join("-"),iV="\t";function aV(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var rV=new RegExp("[\t]+","g");function oV(e,t){var n=e.split(new RegExp("\n*"+nV+"\n*","g")),i={series:[]};return Rr(n,(function(e,n){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(iV)>=0)return!0}(e)){var a=function(e){for(var t=e.split(/\n+/g),n=[],i=Br(aV(t.shift()).split(rV),(function(e){return{name:e,data:[]}})),a=0;a=0)&&e(a,i._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=vV[e.brushType](0,n,t);e.__rangeOffset={offset:bV[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){Rr(e,(function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&Rr(i.coordSyses,(function(i){var a=vV[e.brushType](1,i,e.range,!0);n(e,a.values,i,t)}))}),this)},e.prototype.setInputRanges=function(e,t){Rr(e,(function(e){var n,i,a,r,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=vV[e.brushType](0,s.coordSys,e.coordRange),p=e.__rangeOffset;e.range=p?bV[e.brushType](l.values,p.offset,(n=l.xyMinMax,i=p.xyMinMax,a=SV(n),r=SV(i),o=[a[0]/r[0],a[1]/r[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},e.prototype.makePanelOpts=function(e,t){return Br(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:bF(i),isTargetByCursor:SF(i,e,n.coordSysModel),getLinearBrushOtherExtent:wF(i)}}))},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&Dr(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=hV(t,e),a=0;ae[1]&&e.reverse(),e}function hV(e,t){return Td(e,t,{includeMainTypes:dV})}var gV={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,a=e.gridModels,r=fo(),o={},s={};(n||i||a)&&(Rr(n,(function(e){var t=e.axis.grid.model;r.set(t.id,t),o[t.id]=!0})),Rr(i,(function(e){var t=e.axis.grid.model;r.set(t.id,t),s[t.id]=!0})),Rr(a,(function(e){r.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),r.each((function(e){var a=e.coordinateSystem,r=[];Rr(a.getCartesians(),(function(e,t){(Dr(n,e.getAxis("x").model)>=0||Dr(i,e.getAxis("y").model)>=0)&&r.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:r[0],coordSyses:r,getPanelRect:yV.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){Rr(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:yV.geo})}))}},fV=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,a=e.gridModel;return!a&&n&&(a=n.axis.grid.model),!a&&i&&(a=i.axis.grid.model),a&&a===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],yV={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(_f(e)),t}},vV={lineX:zr(xV,0),lineY:zr(xV,1),rect:function(e,t,n,i){var a=e?t.pointToData([n[0][0],n[1][0]],i):t.dataToPoint([n[0][0],n[1][0]],i),r=e?t.pointToData([n[0][1],n[1][1]],i):t.dataToPoint([n[0][1],n[1][1]],i),o=[mV([a[0],r[0]]),mV([a[1],r[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,n,i){var a=[[1/0,-1/0],[1/0,-1/0]];return{values:Br(n,(function(n){var r=e?t.pointToData(n,i):t.dataToPoint(n,i);return a[0][0]=Math.min(a[0][0],r[0]),a[1][0]=Math.min(a[1][0],r[1]),a[0][1]=Math.max(a[0][1],r[0]),a[1][1]=Math.max(a[1][1],r[1]),r})),xyMinMax:a}}};function xV(e,t,n,i){var a=n.getAxis(["x","y"][e]),r=mV(Br([0,1],(function(e){return t?a.coordToData(a.toLocalCoord(i[e]),!0):a.toGlobalCoord(a.dataToCoord(i[e]))}))),o=[];return o[e]=r,o[1-e]=[NaN,NaN],{values:r,xyMinMax:o}}var bV={lineX:zr(wV,0),lineY:zr(wV,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return Br(e,(function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]}))}};function wV(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function SV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var CV,_V,TV=Rr,IV=cd+"toolbox-dataZoom_",EV=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ze(t,e),t.prototype.render=function(e,t,n,i){this._brushController||(this._brushController=new UA(n.getZr()),this._brushController.on("brush",Gr(this._onBrush,this)).mount()),function(e,t,n,i,a){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=r,e.setIconStatus("zoom",r?"emphasis":"normal");var o=new uV(MV(e),t,{include:["grid"]}),s=o.makePanelOpts(a,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!r||!s.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,i,n),function(e,t){e.setIconStatus("back",function(e){return cV(e).length}(t)>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){EV[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new uV(MV(this.model),i,{include:["grid"]}).matchOutputRanges(t,i,(function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(a("x",n,t[0]),a("y",n,t[1])):a({lineX:"x",lineY:"y"}[i],n,t)}})),function(e,t){var n=cV(e);lV(t,(function(t,i){for(var a=n.length-1;a>=0&&!n[a][i];a--);if(a<0){var r=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var o=r.getPercentRange();n[0][i]={dataZoomId:i,start:o[0],end:o[1]}}}})),n.push(t)}(i,n),this._dispatchZoomAction(n)}function a(e,t,a){var r=t.getAxis(e),o=r.model,s=function(e,t,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(i=n)})),i}(e,o,i),l=s.findRepresentativeAxisProxy(o);if(l){var p=l.getMinMaxSpan();null==p.minValueSpan&&null==p.maxValueSpan||(a=bA(0,a.slice(),r.scale.getExtent(),0,p.minValueSpan,p.maxValueSpan))}s&&(n[s.id]={dataZoomId:s.id,startValue:a[0],endValue:a[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];TV(e,(function(e,n){t.push(Ir(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}}}(YL),{zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(function(e){var t=cV(e),n=t[t.length-1];t.length>1&&t.pop();var i={};return lV(n,(function(e,n){for(var a=t.length-1;a>=0;a--)if(e=t[a][n]){i[n]=e;break}})),i}(this.ecModel))}});function MV(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}CV="dataZoom",_V=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var i=t.getModel(n),a=[],r=Td(e,MV(i));return TV(r.xAxisModels,(function(e){return o(e,"xAxis","xAxisIndex")})),TV(r.yAxisModels,(function(e){return o(e,"yAxis","yAxisIndex")})),a}function o(e,t,n){var r=e.componentIndex,o={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:IV+t+r};o[n]=r,a.push(o)}},so(null==jv.get(CV)&&_V),jv.set(CV,_V);var kV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(Sv);function PV(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function DV(e){if(rr.domSupported)for(var t=document.documentElement.style,n=0,i=e.length;n-1?(p+="top:50%",c+="translateY(-50%) rotate("+(o="left"===s?-225:-45)+"deg)"):(p+="left:50%",c+="translateX(-50%) rotate("+(o="top"===s?225:45)+"deg)");var d=o*Math.PI/180,u=l+a,m=u*Math.abs(Math.cos(d))+u*Math.abs(Math.sin(d)),h=t+" solid "+a+"px;";return'
'}(n,i,a)),Hr(e))r.innerHTML=e+o;else if(e){r.innerHTML="",Ur(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,i=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var a=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&a.manuallyShowTip(e,t,n,{x:a._lastX,y:a._lastY,dataByCoordSys:a._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!rr.node&&n.getDom()){var a=KV(i,n);this._ticket="";var r=i.dataByCoordSys,o=function(e,t,n){var i=Id(e).queryOptionMap,a=i.keys()[0];if(!a||"series"===a)return;var r=kd(t,a,i.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=r.models[0];if(!o)return;var s,l=n.getViewOfComponentModel(o);if(l.group.traverse((function(t){var n=Um(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s)return{componentMainType:a,componentIndex:o.componentIndex,el:s}}(i,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:i.position,positionDefault:"bottom"},a)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=HV;l.x=i.x,l.y=i.y,l.update(),Um(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},a)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},a);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var p=bN(i,t),c=p.point[0],d=p.point[1];null!=c&&null!=d&&this._tryShow({offsetX:c,offsetY:d,target:p.el,position:i.position,positionDefault:"bottom"},a)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},a))}},t.prototype.manuallyHideTip=function(e,t,n,i){var a=this._tooltipContent;this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(KV(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var a=i.seriesIndex,r=i.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=r&&null!=o){var s=t.getSeriesByIndex(a);if(s)if("axis"===$V([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:r,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i=e.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,e);else if(n){var a,r;if("legend"===Um(n).ssrType)return;this._lastDataByCoordSys=null,vS(n,(function(e){return null!=Um(e).dataIndex?(a=e,!0):null!=Um(e).tooltipConfig?(r=e,!0):void 0}),!0),a?this._showSeriesItemTooltip(e,a,t):r?this._showComponentItemTooltip(e,r,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=Gr(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,a=[t.offsetX,t.offsetY],r=$V([t.tooltipOption],i),o=this._renderMode,s=[],l=jb("section",{blocks:[],noHeader:!0}),p=[],c=new tw;Rr(e,(function(e){Rr(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),a=e.value;if(t&&t.axis&&null!=a){var r=nN(a,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),d=jb("section",{header:r,noHeader:!lo(r),sortBlocks:!0,blocks:[]});l.blocks.push(d),Rr(e.seriesDataIndices,(function(l){var u=n.getSeriesByIndex(l.seriesIndex),m=l.dataIndexInside,h=u.getDataParams(m);if(!(h.dataIndex<0)){h.axisDim=e.axisDim,h.axisIndex=e.axisIndex,h.axisType=e.axisType,h.axisId=e.axisId,h.axisValue=XT(t.axis,{value:a}),h.axisValueLabel=r,h.marker=c.makeTooltipMarker("item",lv(h.color),o);var g=ob(u.formatTooltip(m,!0,null)),f=g.frag;if(f){var y=$V([u],i).get("valueFormatter");d.blocks.push(y?kr({valueFormatter:y},f):f)}g.text&&p.push(g.text),s.push(h)}}))}}))})),l.blocks.reverse(),p.reverse();var d=t.position,u=r.get("order"),m=Xb(l,c,o,u,n.get("useUTC"),r.get("textStyle"));m&&p.unshift(m);var h="richText"===o?"\n\n":"
",g=p.join(h);this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(r,d,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(r,g,s,Math.random()+"",a[0],a[1],d,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=this._ecModel,a=Um(t),r=a.seriesIndex,o=i.getSeriesByIndex(r),s=a.dataModel||o,l=a.dataIndex,p=a.dataType,c=s.getData(p),d=this._renderMode,u=e.positionDefault,m=$V([c.getItemModel(l),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,u?{position:u}:null),h=m.get("trigger");if(null==h||"item"===h){var g=s.getDataParams(l,p),f=new tw;g.marker=f.makeTooltipMarker("item",lv(g.color),d);var y=ob(s.formatTooltip(l,!1,p)),v=m.get("order"),x=m.get("valueFormatter"),b=y.frag,w=b?Xb(x?kr({valueFormatter:x},b):b,f,d,v,i.get("useUTC"),m.get("textStyle")):y.text,S="item_"+s.name+"_"+l;this._showOrMove(m,(function(){this._showTooltipContent(m,w,g,S,e.offsetX,e.offsetY,e.position,e.target,f)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:r,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=Um(t),a=i.tooltipConfig.option||{};if(Hr(a)){a={content:a,formatter:a}}var r=[a],o=this._ecModel.getComponent(i.componentMainType,i.componentIndex);o&&r.push(o),r.push({formatter:a.content});var s=e.positionDefault,l=$V(r,this._tooltipModel,s?{position:s}:null),p=l.get("content"),c=Math.random()+"",d=new tw;this._showOrMove(l,(function(){var n=Ir(l.get("formatterParams")||{});this._showTooltipContent(l,p,n,c,e.offsetX,e.offsetY,e.position,t,d)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,a,r,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var p=this._tooltipContent;p.setEnterable(e.get("enterable"));var c=e.get("formatter");o=o||e.get("position");var d=t,u=this._getNearestPoint([a,r],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(Hr(c)){var m=e.ecModel.get("useUTC"),h=Ur(n)?n[0]:n;d=c,h&&h.axisType&&h.axisType.indexOf("time")>=0&&(d=Ny(h.axisValue,d,m)),d=ov(d,n,!0)}else if(jr(c)){var g=Gr((function(t,i){t===this._ticket&&(p.setContent(i,l,e,u,o),this._updatePosition(e,o,a,r,p,n,s))}),this);this._ticket=i,d=c(n,i,g)}else d=c;p.setContent(d,l,e,u,o),p.show(e,u),this._updatePosition(e,o,a,r,p,n,s)}},t.prototype._getNearestPoint=function(e,t,n,i){return"axis"===n||Ur(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:Ur(t)?void 0:{color:i||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,a,r,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var p=a.getSize(),c=e.get("align"),d=e.get("verticalAlign"),u=o&&o.getBoundingRect().clone();if(o&&u.applyTransform(o.transform),jr(t)&&(t=t([n,i],r,a.el,u,{viewSize:[s,l],contentSize:p.slice()})),Ur(t))n=Vc(t[0],s),i=Vc(t[1],l);else if(Kr(t)){var m=t;m.width=p[0],m.height=p[1];var h=gv(m,{width:s,height:l});n=h.x,i=h.y,c=null,d=null}else if(Hr(t)&&o){var g=function(e,t,n,i){var a=n[0],r=n[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,p=t.width,c=t.height;switch(e){case"inside":s=t.x+p/2-a/2,l=t.y+c/2-r/2;break;case"top":s=t.x+p/2-a/2,l=t.y-r-o;break;case"bottom":s=t.x+p/2-a/2,l=t.y+c+o;break;case"left":s=t.x-a-o,l=t.y+c/2-r/2;break;case"right":s=t.x+p+o,l=t.y+c/2-r/2}return[s,l]}(t,u,p,e.get("borderWidth"));n=g[0],i=g[1]}else{g=function(e,t,n,i,a,r,o){var s=n.getSize(),l=s[0],p=s[1];null!=r&&(e+l+r+2>i?e-=l+r:e+=r);null!=o&&(t+p+o>a?t-=p+o:t+=o);return[e,t]}(n,i,a,s,l,c?null:20,d?null:20);n=g[0],i=g[1]}if(c&&(n-=YV(c)?p[0]/2:"right"===c?p[0]:0),d&&(i-=YV(d)?p[1]/2:"bottom"===d?p[1]:0),PV(e)){g=function(e,t,n,i,a){var r=n.getSize(),o=r[0],s=r[1];return e=Math.min(e+o,i)-o,t=Math.min(t+s,a)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(n,i,a,s,l);n=g[0],i=g[1]}a.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,i=this._cbParamsList,a=!!n&&n.length===e.length;return a&&Rr(n,(function(n,r){var o=n.dataByAxis||[],s=(e[r]||{}).dataByAxis||[];(a=a&&o.length===s.length)&&Rr(o,(function(e,n){var r=s[n]||{},o=e.seriesDataIndices||[],l=r.seriesDataIndices||[];(a=a&&e.value===r.value&&e.axisType===r.axisType&&e.axisId===r.axisId&&o.length===l.length)&&Rr(o,(function(e,t){var n=l[t];a=a&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),i&&Rr(e.seriesDataIndices,(function(e){var n=e.seriesIndex,r=t[n],o=i[n];r&&o&&o.data!==r.data&&(a=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!a},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!rr.node&&t.getDom()&&(kw(this,"_updatePosition"),this._tooltipContent.dispose(),vN("itemTooltip",t))},t.type="tooltip",t}(hw);function $V(e,t,n){var i,a=t.ecModel;n?(i=new uy(n,a,a),i=new uy(t.option,i,a)):i=t;for(var r=e.length-1;r>=0;r--){var o=e[r];o&&(o instanceof uy&&(o=o.get("tooltip",!0)),Hr(o)&&(o={formatter:o}),o&&(i=new uy(o,i,a)))}return i}function KV(e,t){return e.dispatchAction||Gr(t.dispatchAction,t)}function YV(e){return"center"===e||"middle"===e}function XV(e){aI(MN),e.registerComponentModel(kV),e.registerComponentView(WV),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},wo),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},wo)}var ZV=Rr;function QV(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function JV(e,t,n){var i={};return ZV(t,(function(t){var a,r=i[t]=((a=function(){}).prototype.__hidden=a.prototype,new a);ZV(e[t],(function(e,i){if(aO.isValidType(i)){var a={type:i,visual:e};n&&n(a,t),r[i]=new aO(a),"opacity"===i&&((a=Ir(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new aO(a))}}))})),i}function eq(e,t,n){var i;Rr(n,(function(e){t.hasOwnProperty(e)&&QV(t[e])&&(i=!0)})),i&&Rr(n,(function(n){t.hasOwnProperty(n)&&QV(t[n])?e[n]=Ir(t[n]):delete e[n]}))}tq(0),tq(1);function tq(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,i){if(t){var a=i.range;return nq(t[e],a)}},rect:function(i,a,r){if(i){var o=r.range,s=[i[t[e]],i[t[e]]+i[n[e]]];return s[1]=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],i=t.axisType,a=this._names=[];"category"===i?(e=[],Rr(n,(function(t,n){var i,r=xd(hd(t),"");Kr(t)?(i=Ir(t)).value=n:i=n,e.push(i),a.push(r)}))):e=n;var r={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new V_([{name:"value",type:r}],this)).initData(e,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(Sv),sq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="timeline.slider",t.defaultOption=gy(oq.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(oq);Ar(sq,rb.prototype);var lq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="timeline",t}(hw),pq=function(e){function t(t,n,i,a){var r=e.call(this,t,n,i)||this;return r.type=a||"value",r}return ze(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(MI),cq=Math.PI,dq=Cd();!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var i=this._layout(e,n),a=this._createGroup("_mainGroup"),r=this._createGroup("_labelGroup"),o=this._axis=this._createAxis(i,e);e.formatTooltip=function(e){return jb("nameValue",{noName:!0,value:o.scale.getLabel({value:e})})},Rr(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](i,a,o,e)}),this),this._renderAxisLabel(i,r,o,e),this._position(i,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,i,a,r,o=e.get(["label","position"]),s=e.get("orient"),l=function(e,t){return gv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t),p={horizontal:"center",vertical:(n=null==o||"auto"===o?"horizontal"===s?l.y+l.height/2=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},d={horizontal:0,vertical:cq/2},u="vertical"===s?l.height:l.width,m=e.getModel("controlStyle"),h=m.get("show",!0),g=h?m.get("itemSize"):0,f=h?m.get("itemGap"):0,y=g+f,v=e.get(["label","rotate"])||0;v=v*cq/180;var x=m.get("position",!0),b=h&&m.get("showPlayBtn",!0),w=h&&m.get("showPrevBtn",!0),S=h&&m.get("showNextBtn",!0),C=0,_=u;"left"===x||"bottom"===x?(b&&(i=[0,0],C+=y),w&&(a=[C,0],C+=y),S&&(r=[_-g,0],_-=y)):(b&&(i=[_-g,0],_-=y),w&&(a=[0,0],C+=y),S&&(r=[_-g,0],_-=y));var T=[C,_];return e.get("inverse")&&T.reverse(),{viewRect:l,mainLength:u,orient:s,rotation:d[s],labelRotation:v,labelPosOpt:n,labelAlign:e.get(["label","align"])||p[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:i,prevBtnPosition:a,nextBtnPosition:r,axisExtent:T,controlSize:g,controlGap:f}},t.prototype._position=function(e,t){var n=this._mainGroup,i=this._labelGroup,a=e.viewRect;if("vertical"===e.orient){var r=[1,0,0,1,0,0],o=a.x,s=a.y+a.height;fs(r,r,[-o,-s]),ys(r,r,-cq/2),fs(r,r,[o,s]),(a=a.clone()).applyTransform(r)}var l=f(a),p=f(n.getBoundingRect()),c=f(i.getBoundingRect()),d=[n.x,n.y],u=[i.x,i.y];u[0]=d[0]=l[0][0];var m,h=e.labelPosOpt;null==h||Hr(h)?(y(d,p,l,1,m="+"===h?0:1),y(u,c,l,1,1-m)):(y(d,p,l,1,m=h>=0?0:1),u[1]=d[1]+h);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function f(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function y(e,t,n,i,a){e[i]+=n[i][a]-t[i][a]}n.setPosition(d),i.setPosition(u),n.rotation=i.rotation=e.rotation,g(n),g(i)},t.prototype._createAxis=function(e,t){var n=t.getData(),i=t.get("axisType"),a=function(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new sT({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new CT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new pT}}(t,i);a.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var r=n.getDataExtent("value");a.setExtent(r[0],r[1]),a.calcNiceTicks();var o=new pq("value",a,e.axisExtent,i);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Mc;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,i){var a=n.getExtent();if(i.get(["lineStyle","show"])){var r=new Fg({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:kr({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(r);var o=this._progressLine=new Fg({shape:{x1:a[0],x2:this._currentPointer?this._currentPointer.x:a[0],y1:0,y2:0},style:Pr({lineCap:"round",lineWidth:r.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,i){var a=this,r=i.getData(),o=n.scale.getTicks();this._tickSymbols=[],Rr(o,(function(e){var o=n.dataToCoord(e.value),s=r.getItemModel(e.value),l=s.getModel("itemStyle"),p=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),d={x:o,y:0,onclick:Gr(a._changeTimeline,a,e.value)},u=uq(s,l,t,d);u.ensureState("emphasis").style=p.getItemStyle(),u.ensureState("progress").style=c.getItemStyle(),Dh(u);var m=Um(u);s.get("tooltip")?(m.dataIndex=e.value,m.dataModel=i):m.dataIndex=m.dataModel=null,a._tickSymbols.push(u)}))},t.prototype._renderAxisLabel=function(e,t,n,i){var a=this;if(n.getLabelModel().get("show")){var r=i.getData(),o=n.getViewLabels();this._tickLabels=[],Rr(o,(function(i){var o=i.tickValue,s=r.getItemModel(o),l=s.getModel("label"),p=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),d=n.dataToCoord(i.tickValue),u=new Pm({x:d,y:0,rotation:e.labelRotation-e.rotation,onclick:Gr(a._changeTimeline,a,o),silent:!1,style:jf(l,{text:i.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});u.ensureState("emphasis").style=jf(p),u.ensureState("progress").style=jf(c),t.add(u),Dh(u),dq(u).dataIndex=o,a._tickLabels.push(u)}))}},t.prototype._renderControl=function(e,t,n,i){var a=e.controlSize,r=e.rotation,o=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),p=i.get("inverse",!0);function c(e,n,l,p){if(e){var c=fc(io(i.get(["controlStyle",n+"BtnSize"]),a),a),d=function(e,t,n,i){var a=i.style,r=Df(e.get(["controlStyle",t]),i||{},new Ps(n[0],n[1],n[2],n[3]));a&&r.setStyle(a);return r}(i,n+"Icon",[0,-c/2,c,c],{x:e[0],y:e[1],originX:a/2,originY:0,rotation:p?-r:0,rectHover:!0,style:o,onclick:l});d.ensureState("emphasis").style=s,t.add(d),Dh(d)}}c(e.nextBtnPosition,"next",Gr(this._changeTimeline,this,p?"-":"+")),c(e.prevBtnPosition,"prev",Gr(this._changeTimeline,this,p?"+":"-")),c(e.playPosition,l?"stop":"play",Gr(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,i){var a=i.getData(),r=i.getCurrentIndex(),o=a.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=Gr(s._handlePointerDrag,s),e.ondragend=Gr(s._handlePointerDragend,s),mq(e,s._progressLine,r,n,i,!0)},onUpdate:function(e){mq(e,s._progressLine,r,n,i)}};this._currentPointer=uq(o,o,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],i=Gc(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(o[r]=+o[r].toFixed(d)),[o,c]}var bq={min:zr(xq,"min"),max:zr(xq,"max"),average:zr(xq,"average"),median:zr(xq,"median")};function wq(e,t){if(t){var n=e.getData(),i=e.coordinateSystem,a=i&&i.dimensions;if(!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Ur(t.coord)&&Ur(a)){var r=Sq(t,n,i,e);if((t=Ir(t)).type&&bq[t.type]&&r.baseAxis&&r.valueAxis){var o=Dr(a,r.baseAxis.dim),s=Dr(a,r.valueAxis.dim),l=bq[t.type](n,r.baseDataDim,r.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&Ur(a))for(var p=t.coord,c=0;c<2;c++)bq[p[c]]&&(p[c]=Tq(n,n.mapDimension(a[c]),p[c]));else t.coord=[];return t}}function Sq(e,t,n,i){var a={};return null!=e.valueIndex||null!=e.valueDim?(a.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,a.valueAxis=n.getAxis(function(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}(i,a.valueDataDim)),a.baseAxis=n.getOtherAxis(a.valueAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim)):(a.baseAxis=i.getBaseAxis(),a.valueAxis=n.getOtherAxis(a.baseAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim),a.valueDataDim=t.mapDimension(a.valueAxis.dim)),a}function Cq(e,t){return!(e&&e.containData&&t.coord&&!vq(t))||e.containData(t.coord)}function _q(e,t){return e?function(e,n,i,a){return cb(a<2?e.coord&&e.coord[a]:e.value,t[a])}:function(e,n,i,a){return cb(e.value,t[a])}}function Tq(e,t,n){if("average"===n){var i=0,a=0;return e.each(t,(function(e,t){isNaN(e)||(i+=e,a++)})),i/a}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var Iq=Cd(),Eq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.init=function(){this.markerGroupMap=fo()},t.prototype.render=function(e,t,n){var i=this,a=this.markerGroupMap;a.each((function(e){Iq(e).keep=!1})),t.eachSeries((function(e){var a=yq.getMarkerModelFromSeries(e,i.type);a&&i.renderSeries(e,a,t,n)})),a.each((function(e){!Iq(e).keep&&i.group.remove(e.group)}))},t.prototype.markKeep=function(e){Iq(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;Rr(e,(function(e){var i=yq.getMarkerModelFromSeries(e,n.type);i&&i.getData().eachItemGraphicEl((function(e){e&&(t?bh(e):wh(e))}))}))},t.type="marker",t}(hw);function Mq(e,t,n){var i=t.coordinateSystem;e.each((function(a){var r,o=e.getItemModel(a),s=Vc(o.get("x"),n.getWidth()),l=Vc(o.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)r=t.getMarkerPosition(e.getValues(e.dimensions,a));else if(i){var p=e.get(i.dimensions[0],a),c=e.get(i.dimensions[1],a);r=i.dataToPoint([p,c])}}else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),e.setItemLayout(a,r)}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=yq.getMarkerModelFromSeries(e,"markPoint");t&&(Mq(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new CE),p=function(e,t,n){var i;i=e?Br(e&&e.dimensions,(function(e){return kr(kr({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var a=new V_(i,n),r=Br(n.get("data"),zr(wq,t));e&&(r=Lr(r,zr(Cq,e)));var o=_q(!!e,i);return a.initData(r,null,o),a}(a,e,t);t.setData(p),Mq(t.getData(),e,i),p.each((function(e){var n=p.getItemModel(e),i=n.getShallow("symbol"),a=n.getShallow("symbolSize"),r=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(jr(i)||jr(a)||jr(r)||jr(s)){var c=t.getRawValue(e),d=t.getDataParams(e);jr(i)&&(i=i(c,d)),jr(a)&&(a=a(c,d)),jr(r)&&(r=r(c,d)),jr(s)&&(s=s(c,d))}var u=n.getModel("itemStyle").getItemStyle(),m=hS(o,"color");u.fill||(u.fill=m),p.setItemVisual(e,{symbol:i,symbolSize:a,symbolRotate:r,symbolOffset:s,symbolKeepAspect:l,style:u})})),l.updateData(p),this.group.add(l.group),p.eachItemGraphicEl((function(e){e.traverse((function(e){Um(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint"}(Eq);var kq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(yq),Pq=Cd(),Dq=function(e,t,n,i){var a,r=e.getData();if(Ur(i))a=i;else{var o=i.type;if("min"===o||"max"===o||"average"===o||"median"===o||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=t.getAxis(null!=i.yAxis?"y":"x"),l=no(i.yAxis,i.xAxis);else{var p=Sq(i,r,t,e);s=p.valueAxis,l=Tq(r,$_(r,p.valueDataDim),o)}var c="x"===s.dim?0:1,d=1-c,u=Ir(i),m={coord:[]};u.type=null,u.coord=[],u.coord[d]=-1/0,m.coord[d]=1/0;var h=n.get("precision");h>=0&&$r(l)&&(l=+l.toFixed(Math.min(h,20))),u.coord[c]=m.coord[c]=l,a=[u,m,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var g=[wq(e,a[0]),wq(e,a[1]),kr({},a[2])];return g[2].type=g[2].type||null,Er(g[2],g[0]),Er(g[2],g[1]),g};function Oq(e){return!isNaN(e)&&!isFinite(e)}function Aq(e,t,n,i){var a=1-e,r=i.dimensions[e];return Oq(t[a])&&Oq(n[a])&&t[e]===n[e]&&i.getAxis(r).containData(t[e])}function Fq(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(Aq(1,n,i,e)||Aq(0,n,i,e)))return!0}return Cq(e,t[0])&&Cq(e,t[1])}function Rq(e,t,n,i,a){var r,o=i.coordinateSystem,s=e.getItemModel(t),l=Vc(s.get("x"),a.getWidth()),p=Vc(s.get("y"),a.getHeight());if(isNaN(l)||isNaN(p)){if(i.getMarkerPosition)r=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=o.dimensions,d=e.get(c[0],t),u=e.get(c[1],t);r=o.dataToPoint([d,u])}if(NE(o,"cartesian2d")){var m=o.getAxis("x"),h=o.getAxis("y");c=o.dimensions;Oq(e.get(c[0],t))?r[0]=m.toGlobalCoord(m.getExtent()[n?0:1]):Oq(e.get(c[1],t))&&(r[1]=h.toGlobalCoord(h.getExtent()[n?0:1]))}isNaN(l)||(r[0]=l),isNaN(p)||(r[1]=p)}else r=[l,p];e.setItemLayout(t,r)}var Bq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=yq.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),a=Pq(t).from,r=Pq(t).to;a.each((function(t){Rq(a,t,!0,e,n),Rq(r,t,!1,e,n)})),i.each((function(e){i.setItemLayout(e,[a.getItemLayout(e),r.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new zO);this.group.add(l.group);var p=function(e,t,n){var i;i=e?Br(e&&e.dimensions,(function(e){return kr(kr({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var a=new V_(i,n),r=new V_(i,n),o=new V_([],n),s=Br(n.get("data"),zr(Dq,t,e,n));e&&(s=Lr(s,zr(Fq,e)));var l=_q(!!e,i);return a.initData(Br(s,(function(e){return e[0]})),null,l),r.initData(Br(s,(function(e){return e[1]})),null,l),o.initData(Br(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:a,to:r,line:o}}(a,e,t),c=p.from,d=p.to,u=p.line;Pq(t).from=c,Pq(t).to=d,t.setData(u);var m=t.get("symbol"),h=t.get("symbolSize"),g=t.get("symbolRotate"),f=t.get("symbolOffset");function y(t,n,a){var r=t.getItemModel(n);Rq(t,n,a,e,i);var s=r.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=hS(o,"color")),t.setItemVisual(n,{symbolKeepAspect:r.get("symbolKeepAspect"),symbolOffset:io(r.get("symbolOffset",!0),f[a?0:1]),symbolRotate:io(r.get("symbolRotate",!0),g[a?0:1]),symbolSize:io(r.get("symbolSize"),h[a?0:1]),symbol:io(r.get("symbol",!0),m[a?0:1]),style:s})}Ur(m)||(m=[m,m]),Ur(h)||(h=[h,h]),Ur(g)||(g=[g,g]),Ur(f)||(f=[f,f]),p.from.each((function(e){y(c,e,!0),y(d,e,!1)})),u.each((function(e){var t=u.getItemModel(e).getModel("lineStyle").getLineStyle();u.setItemLayout(e,[c.getItemLayout(e),d.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),u.setItemVisual(e,{fromSymbolKeepAspect:c.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(e,"symbolOffset"),fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolKeepAspect:d.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(e,"symbolOffset"),toSymbolRotate:d.getItemVisual(e,"symbolRotate"),toSymbolSize:d.getItemVisual(e,"symbolSize"),toSymbol:d.getItemVisual(e,"symbol"),style:t})})),l.updateData(u),p.line.eachItemGraphicEl((function(e){Um(e).dataModel=t,e.traverse((function(e){Um(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(Eq);function Nq(e){e.registerComponentModel(kq),e.registerComponentView(Bq),e.registerPreprocessor((function(e){hq(e.series,"markLine")&&(e.markLine=e.markLine||{})}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}}(yq);var Lq=Cd(),Vq=function(e,t,n,i){var a=i[0],r=i[1];if(a&&r){var o=wq(e,a),s=wq(e,r),l=o.coord,p=s.coord;l[0]=no(l[0],-1/0),l[1]=no(l[1],-1/0),p[0]=no(p[0],1/0),p[1]=no(p[1],1/0);var c=Mr([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function qq(e){return!isNaN(e)&&!isFinite(e)}function Gq(e,t,n,i){var a=1-e;return qq(t[a])&&qq(n[a])}function zq(e,t){var n=t.coord[0],i=t.coord[1],a={coord:n,x:t.x0,y:t.y0},r={coord:i,x:t.x1,y:t.y1};return NE(e,"cartesian2d")?!(!n||!i||!Gq(1,n,i)&&!Gq(0,n,i))||function(e,t,n){return!(e&&e.containZone&&t.coord&&n.coord&&!vq(t)&&!vq(n))||e.containZone(t.coord,n.coord)}(e,a,r):Cq(e,a)||Cq(e,r)}function Uq(e,t,n,i,a){var r,o=i.coordinateSystem,s=e.getItemModel(t),l=Vc(s.get(n[0]),a.getWidth()),p=Vc(s.get(n[1]),a.getHeight());if(isNaN(l)||isNaN(p)){if(i.getMarkerPosition){var c=e.getValues(["x0","y0"],t),d=e.getValues(["x1","y1"],t),u=o.clampData(c),m=o.clampData(d),h=[];"x0"===n[0]?h[0]=u[0]>m[0]?d[0]:c[0]:h[0]=u[0]>m[0]?c[0]:d[0],"y0"===n[1]?h[1]=u[1]>m[1]?d[1]:c[1]:h[1]=u[1]>m[1]?c[1]:d[1],r=i.getMarkerPosition(h,n,!0)}else{var g=[v=e.get(n[0],t),x=e.get(n[1],t)];o.clampData&&o.clampData(g,g),r=o.dataToPoint(g,!0)}if(NE(o,"cartesian2d")){var f=o.getAxis("x"),y=o.getAxis("y"),v=e.get(n[0],t),x=e.get(n[1],t);qq(v)?r[0]=f.toGlobalCoord(f.getExtent()["x0"===n[0]?0:1]):qq(x)&&(r[1]=y.toGlobalCoord(y.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(r[0]=l),isNaN(p)||(r[1]=p)}else r=[l,p];return r}var jq=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}ze(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=yq.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each((function(t){var a=Br(jq,(function(a){return Uq(i,t,a,e,n)}));i.setItemLayout(t,a),i.getItemGraphicEl(t).setShape("points",a)}))}}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,{group:new Mc});this.group.add(l.group),this.markKeep(l);var p=function(e,t,n){var i,a,r=["x0","y0","x1","y1"];if(e){var o=Br(e&&e.dimensions,(function(e){var n=t.getData();return kr(kr({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}));a=Br(r,(function(e,t){return{name:e,type:o[t%2].type}})),i=new V_(a,n)}else i=new V_(a=[{name:"value",type:"float"}],n);var s=Br(n.get("data"),zr(Vq,t,e,n));e&&(s=Lr(s,zr(zq,e)));var l=e?function(e,t,n,i){return cb(e.coord[Math.floor(i/2)][i%2],a[i])}:function(e,t,n,i){return cb(e.value,a[i])};return i.initData(s,null,l),i.hasItemOption=!0,i}(a,e,t);t.setData(p),p.each((function(t){var n=Br(jq,(function(n){return Uq(p,t,n,e,i)})),r=a.getAxis("x").scale,s=a.getAxis("y").scale,l=r.getExtent(),c=s.getExtent(),d=[r.parse(p.get("x0",t)),r.parse(p.get("x1",t))],u=[s.parse(p.get("y0",t)),s.parse(p.get("y1",t))];Gc(d),Gc(u);var m=!!(l[0]>d[1]||l[1]u[1]||c[1]=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(Sv),Wq=zr,$q=Rr,Kq=Mc,Yq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return ze(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Kq),this.group.add(this._selectorGroup=new Kq),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var a=e.get("align"),r=e.get("orient");a&&"auto"!==a||(a="right"===e.get("left")&&"vertical"===r?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(a,e,t,n,o,r,s);var l=e.getBoxLayoutParams(),p={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),d=gv(l,p,c),u=this.layoutInner(e,a,d,i,o,s),m=gv(Pr({width:u.width,height:u.height},l),p,c);this.group.x=m.x-u.x,this.group.y=m.y-u.y,this.group.markRedraw(),this.group.add(this._backgroundEl=QL(u,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,a,r,o){var s=this.getContentGroup(),l=fo(),p=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),$q(t.getData(),(function(a,r){var o=a.get("name");if(!this.newlineDisabled&&(""===o||"\n"===o)){var d=new Kq;return d.newline=!0,void s.add(d)}var u=n.getSeriesByName(o)[0];if(!l.get(o)){if(u){var m=u.getData(),h=m.getVisual("legendLineStyle")||{},g=m.getVisual("legendIcon"),f=m.getVisual("style"),y=this._createItem(u,o,r,a,t,e,h,f,g,p,i);y.on("click",Wq(Xq,o,null,i,c)).on("mouseover",Wq(Qq,u.name,null,i,c)).on("mouseout",Wq(Jq,u.name,null,i,c)),n.ssr&&y.eachChild((function(e){var t=Um(e);t.seriesIndex=u.seriesIndex,t.dataIndex=r,t.ssrType="legend"})),l.set(o,!0)}else n.eachRawSeries((function(s){if(!l.get(o)&&s.legendVisualProvider){var d=s.legendVisualProvider;if(!d.containName(o))return;var u=d.indexOfName(o),m=d.getItemVisual(u,"style"),h=d.getItemVisual(u,"legendIcon"),g=Gl(m.fill);g&&0===g[3]&&(g[3]=.2,m=kr(kr({},m),{fill:Kl(g,"rgba")}));var f=this._createItem(s,o,r,a,t,e,{},m,h,p,i);f.on("click",Wq(Xq,null,o,i,c)).on("mouseover",Wq(Qq,null,o,i,c)).on("mouseout",Wq(Jq,null,o,i,c)),n.ssr&&f.eachChild((function(e){var t=Um(e);t.seriesIndex=s.seriesIndex,t.dataIndex=r,t.ssrType="legend"})),l.set(o,!0)}}),this);0}}),this),a&&this._createSelector(a,t,i,r,o)},t.prototype._createSelector=function(e,t,n,i,a){var r=this.getSelectorGroup();$q(e,(function(e){var i=e.type,a=new Pm({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});r.add(a),zf(a,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),Dh(a)}))},t.prototype._createItem=function(e,t,n,i,a,r,o,s,l,p,c){var d=e.visualDrawType,u=a.get("itemWidth"),m=a.get("itemHeight"),h=a.isSelected(t),g=i.get("symbolRotate"),f=i.get("symbolKeepAspect"),y=i.get("icon"),v=function(e,t,n,i,a,r,o){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),$q(e,(function(n,i){"inherit"===e[i]&&(e[i]=t[i])}))}var l=t.getModel("itemStyle"),p=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",d=l.getShallow("decal");p.decal=d&&"inherit"!==d?iC(d,o):i.decal,"inherit"===p.fill&&(p.fill=i[a]);"inherit"===p.stroke&&(p.stroke=i[c]);"inherit"===p.opacity&&(p.opacity=("fill"===a?i:n).opacity);s(p,i);var u=t.getModel("lineStyle"),m=u.getLineStyle();if(s(m,n),"auto"===p.fill&&(p.fill=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),"auto"===m.stroke&&(m.stroke=i.fill),!r){var h=t.get("inactiveBorderWidth"),g=p[c];p.lineWidth="auto"===h?i.lineWidth>0&&g?2:0:p.lineWidth,p.fill=t.get("inactiveColor"),p.stroke=t.get("inactiveBorderColor"),m.stroke=u.get("inactiveColor"),m.lineWidth=u.get("inactiveWidth")}return{itemStyle:p,lineStyle:m}}(l=y||l||"roundRect",i,o,s,d,h,c),x=new Kq,b=i.getModel("textStyle");if(!jr(e.getLegendIcon)||y&&"inherit"!==y){var w="inherit"===y&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add(function(e){var t=e.icon||"roundRect",n=PS(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:u,itemHeight:m,icon:l,iconRotate:w,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:f}))}else x.add(e.getLegendIcon({itemWidth:u,itemHeight:m,icon:l,iconRotate:g,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:f}));var S="left"===r?u+5:-5,C=r,_=a.get("formatter"),T=t;Hr(_)&&_?T=_.replace("{name}",null!=t?t:""):jr(_)&&(T=_(t));var I=h?b.getTextColor():i.get("inactiveColor");x.add(new Pm({style:jf(b,{text:T,x:S,y:m/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var E=new Em({shape:x.getBoundingRect(),style:{fill:"transparent"}}),M=i.getModel("tooltip");return M.get("show")&&Rf({el:E,componentModel:a,itemName:t,itemTooltipOption:M.option}),x.add(E),x.eachChild((function(e){e.silent=!0})),E.silent=!p,this.getContentGroup().add(x),Dh(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,i,a,r){var o=this.getContentGroup(),s=this.getSelectorGroup();hv(e.get("orient"),o,e.get("itemGap"),n.width,n.height);var l=o.getBoundingRect(),p=[-l.x,-l.y];if(s.markRedraw(),o.markRedraw(),a){hv("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],u=e.get("selectorButtonGap",!0),m=e.getOrient().index,h=0===m?"width":"height",g=0===m?"height":"width",f=0===m?"y":"x";"end"===r?d[m]+=l[h]+u:p[m]+=c[h]+u,d[1-m]+=l[g]/2-c[g]/2,s.x=d[0],s.y=d[1],o.x=p[0],o.y=p[1];var y={x:0,y:0};return y[h]=l[h]+u+c[h],y[g]=Math.max(l[g],c[g]),y[f]=Math.min(0,c[f]+d[1-m]),y}return o.x=p[0],o.y=p[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(hw);function Xq(e,t,n,i){Jq(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),Qq(e,t,n,i)}function Zq(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,a=n.length;in[a],h=[-d.x,-d.y];t||(h[i]=l[s]);var g=[0,0],f=[-u.x,-u.y],y=io(e.get("pageButtonGap",!0),e.get("itemGap",!0));m&&("end"===e.get("pageButtonPosition",!0)?f[i]+=n[a]-u[a]:g[i]+=u[a]+y);f[1-i]+=d[r]/2-u[r]/2,l.setPosition(h),p.setPosition(g),c.setPosition(f);var v={x:0,y:0};if(v[a]=m?n[a]:d[a],v[r]=Math.max(d[r],u[r]),v[o]=Math.min(0,u[o]+f[1-i]),p.__rectSize=n[a],m){var x={x:0,y:0};x[a]=Math.max(n[a]-u[a]-y,0),x[r]=v[r],p.setClipPath(new Em({shape:x})),p.__rectSize=x[a]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var b=this._getPageInfo(e);return null!=b.pageIndex&&tf(l,{x:b.contentPosition[0],y:b.contentPosition[1]},m?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;Rr(["pagePrev","pageNext"],(function(i){var a=null!=t[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",a?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=a?"pointer":"default")}));var i=n.childOfName("pageText"),a=e.get("pageFormatter"),r=t.pageIndex,o=null!=r?r+1:0,s=t.pageCount;i&&a&&i.setStyle("text",Hr(a)?a.replace("{current}",null==o?"":o+"").replace("{total}",null==s?"":s+""):a({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,a=e.getOrient().index,r=nG[a],o=iG[a],s=this._findTargetItemIndex(t),l=n.children(),p=l[s],c=l.length,d=c?1:0,u={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!p)return u;var m=v(p);u.contentPosition[a]=-m.s;for(var h=s+1,g=m,f=m,y=null;h<=c;++h)(!(y=v(l[h]))&&f.e>g.s+i||y&&!x(y,g.s))&&(g=f.i>g.i?f:y)&&(null==u.pageNextDataIndex&&(u.pageNextDataIndex=g.i),++u.pageCount),f=y;for(h=s-1,g=m,f=m,y=null;h>=-1;--h)(y=v(l[h]))&&x(f,y.s)||!(g.i=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(i,a){var r=i.__legendDataIndex;null==n&&null!=r&&(n=a),r===e&&(t=a)})),null!=t?t:n):0;var t,n},t.type="legend.scroll"}(Yq);var aG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="dataZoom.inside",t.defaultOption=gy(qL.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(qL),rG=Cd();function oG(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function sG(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function lG(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}function pG(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=rG(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=fo());i.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){Rr(LL(e).infoList,(function(n){var a=n.model.uid,r=i.get(a)||i.set(a,function(e,t){var n={model:t,containsPoint:zr(lG,t),dispatchAction:zr(sG,e),dataZoomInfoMap:null,controller:null},i=n.controller=new oP(e.getZr());return Rr(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(t){var i=[];n.dataZoomInfoMap.each((function(a){if(t.isAvailableBehavior(a.model.option)){var r=(a.getRange||{})[e],o=r&&r(a.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!a.model.get("disabled",!0)&&o&&i.push({dataZoomId:a.model.id,start:o[0],end:o[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(t,n.model));(r.dataZoomInfoMap||(r.dataZoomInfoMap=fo())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),i.each((function(e){var t,n=e.controller,a=e.dataZoomInfoMap;if(a){var r=a.keys()[0];null!=r&&(t=a.get(r))}if(t){var o=function(e){var t,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return e.each((function(e){var r=e.model,o=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+o]>i[n+t]&&(t=o),a=a&&r.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}(a);n.enable(o.controlType,o.opt),n.setPointerChecker(e.containsPoint),Mw(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else oG(i,e)}))}))}var cG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return ze(t,e),t.prototype.render=function(t,n,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(e,t,n){rG(e).coordSysRecordMap.each((function(e){var i=e.dataZoomInfoMap.get(t.uid);i&&(i.getRange=n)}))}(i,t,{pan:Gr(dG.pan,this),zoom:Gr(dG.zoom,this),scrollMove:Gr(dG.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=rG(e).coordSysRecordMap,i=n.keys(),a=0;a0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],p=Math.max(1/i.scale,0);r[0]=(r[0]-l)*p+l,r[1]=(r[1]-l)*p+l;var c=this.dataZoomModel.findRepresentativeAxisProxy();if(c){var d=c.getMinMaxSpan();if(bA(0,r,[0,100],0,d.minSpan,d.maxSpan),this.range=r,a[0]!==r[0]||a[1]!==r[1])return r}}},pan:uG((function(e,t,n,i,a,r){var o=mG[i]([r.oldX,r.oldY],[r.newX,r.newY],t,a,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:uG((function(e,t,n,i,a,r){return mG[i]([0,0],[r.scrollDelta,r.scrollDelta],t,a,n).signal*(e[1]-e[0])*r.scrollDelta}))};function uG(e){return function(t,n,i,a){var r=this.range,o=r.slice(),s=t.axisModels[0];if(s)return bA(e(o,s,t,n,i,a),o,[0,100],"all"),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}}var mG={grid:function(e,t,n,i,a){var r=n.axis,o={},s=a.model.coordinateSystem.getRect();return e=e||[0,0],"x"===r.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=r.inverse?-1:1),o},polar:function(e,t,n,i,a){var r=n.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),p=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=p[1]-p[0],o.pixelStart=p[0],o.signal=r.inverse?-1:1),o},singleAxis:function(e,t,n,i,a){var r=n.axis,o=a.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===r.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=r.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=r.inverse?-1:1),s}};function hG(e){KL(e),e.registerComponentModel(aG),e.registerComponentView(cG),pG(e)}var gG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=gy(qL.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(qL),fG=Em,yG="horizontal",vG="vertical",xG=["line","bar","candlestick","scatter","custom"],bG={easing:"cubicOut",duration:100,delay:0},wG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return ze(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=Gr(this._onBrush,this),this._onBrushEnd=Gr(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,a){if(e.prototype.render.apply(this,arguments),Mw(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();a&&"dataZoom"===a.type&&a.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kw(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Mc;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?7:0,i=this._findCoordRect(),a={width:t.getWidth(),height:t.getHeight()},r=this._orient===yG?{right:a.width-i.x-i.width,top:a.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},o=xv(e.option);Rr(["right","top","width","height"],(function(e){"ph"===o[e]&&(o[e]=r[e])}));var s=gv(o,a);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===vG&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),a=i&&i.get("inverse"),r=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(n!==yG||a?n===yG&&a?{scaleY:o?1:-1,scaleX:-1}:n!==vG||a?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=e.getBoundingRect([r]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new fG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var a=new fG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:Gr(this._onClickPanel,this)}),r=this.api.getZr();i?(a.on("mousedown",this._onBrushStart,this),a.cursor="crosshair",r.on("mousemove",this._onBrush),r.on("mouseup",this._onBrushEnd)):(r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)),n.add(a)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],i=e.series,a=i.getRawData(),r=i.getShadowDim&&i.getShadowDim(),o=r&&a.getDimensionInfo(r)?i.getShadowDim():e.otherDim;if(null!=o){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(a!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var p=a.getDataExtent(o),c=.3*(p[1]-p[0]);p=[p[0]-c,p[1]+c];var d,u=[0,t[1]],m=[0,t[0]],h=[[t[0],0],[0,0]],g=[],f=m[1]/(a.count()-1),y=0,v=Math.round(a.count()/t[0]);a.each([o],(function(e,t){if(v>0&&t%v)y+=f;else{var n=null==e||isNaN(e)||""===e,i=n?0:Lc(e,p,u,!0);n&&!d&&t?(h.push([h[h.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&d&&(h.push([y,0]),g.push([y,0])),h.push([y,i]),g.push([y,i]),y+=f,d=n}})),s=this._shadowPolygonPts=h,l=this._shadowPolylinePts=g}this._shadowData=a,this._shadowDim=o,this._shadowSize=[t[0],t[1]];for(var x=this.dataZoomModel,b=0;b<3;b++){var w=S(1===b);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}function S(e){var t=x.getModel(e?"selectedDataBackground":"dataBackground"),n=new Mc,i=new kg({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),a=new Dg({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(a),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,i=this.ecModel;return e.eachTargetAxis((function(a,r){var o=e.getAxisProxy(a,r);o&&Rr(o.getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&Dr(xG,e.get("type"))<0)){var o,s=i.getComponent(BL(a),r).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(a),p=e.coordinateSystem;null!=l&&p.getOtherAxis&&(o=p.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:a,otherDim:l,otherAxisInverse:o}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],a=this._displayables.sliderGroup,r=this._size,o=this.dataZoomModel,s=this.api,l=o.get("borderRadius")||0,p=o.get("brushSelect"),c=t.filler=new fG({silent:p,style:{fill:o.get("fillerColor")},textConfig:{position:"inside"}});a.add(c),a.add(new fG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1],r:l},style:{stroke:o.get("dataBackgroundColor")||o.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),Rr([0,1],(function(t){var r=o.get("handleIcon");!ES[r]&&r.indexOf("path://")<0&&r.indexOf("image://")<0&&(r="path://"+r);var s=PS(r,-1,0,2,2,null,!0);s.attr({cursor:SG(this._orient),draggable:!0,drift:Gr(this._onDragMove,this,t),ondragend:Gr(this._onDragEnd,this),onmouseover:Gr(this._showDataInfo,this,!0),onmouseout:Gr(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),p=o.get("handleSize");this._handleHeight=Vc(p,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(o.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=o.getModel(["emphasis","handleStyle"]).getItemStyle(),Dh(s);var c=o.get("handleColor");null!=c&&(s.style.fill=c),a.add(n[t]=s);var d=o.getModel("textStyle");e.add(i[t]=new Pm({silent:!0,invisible:!0,style:jf(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))}),this);var d=c;if(p){var u=Vc(o.get("moveHandleSize"),r[1]),m=t.moveHandle=new Em({style:o.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:r[1]-.5,height:u}}),h=.8*u,g=t.moveHandleIcon=PS(o.get("moveHandleIcon"),-h/2,-h/2,h,h,"#fff",!0);g.silent=!0,g.y=r[1]+u/2-.5,m.ensureState("emphasis").style=o.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var f=Math.min(r[1]/2,Math.max(u,10));(d=t.moveZone=new Em({invisible:!0,shape:{y:r[1]-f,height:u+f}})).on("mouseover",(function(){s.enterEmphasis(m)})).on("mouseout",(function(){s.leaveEmphasis(m)})),a.add(m),a.add(g),a.add(d)}d.attr({draggable:!0,cursor:SG(this._orient),drift:Gr(this._onDragMove,this,"all"),ondragstart:Gr(this._showDataInfo,this,!0),ondragend:Gr(this._onDragEnd,this),onmouseover:Gr(this._showDataInfo,this,!0),onmouseout:Gr(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Lc(e[0],[0,100],t,!0),Lc(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,a=this._getViewExtent(),r=n.findRepresentativeAxisProxy();if(r){var o=r.getMinMaxSpan(),s=[0,100];bA(t,i,a,n.get("zoomLock")?"all":e,null!=o.minSpan?Lc(o.minSpan,s,a,!0):null,null!=o.maxSpan?Lc(o.maxSpan,s,a,!0):null);var l=this._range,p=this._range=Gc([Lc(i[0],a,s,!0),Lc(i[1],a,s,!0)]);return!l||l[0]!==p[0]||l[1]!==p[1]}return!1},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=Gc(n.slice()),a=this._size;Rr([0,1],(function(e){var i=t.handles[e],r=this._handleHeight;i.attr({scaleX:r/2,scaleY:r/2,x:n[e]+(e?-1:1),y:a[1]/2-r/2})}),this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:a[1]});var r={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(r),t.moveZone.setShape(r),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",r.x+r.width/2));for(var o=t.dataShadowSegs,s=[0,i[0],i[1],a[0]],l=0;lt[0]||n[1]<0||n[1]>t[1])){var i=this._handleEnds,a=(i[0]+i[1])/2,r=this._updateInterval("all",n[0]-a);this._updateView(),r&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new ws(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),a=[0,100];this._range=Gc([Lc(n.x,i,a,!0),Lc(n.x+n.width,i,a,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(ls(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,a=n.brushRect;a||(a=n.brushRect=new fG({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(a)),a.attr("ignore",!1);var r=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),l=o.transformCoordToLocal(r.x,r.y),p=this._size;s[0]=Math.max(Math.min(p[0],s[0]),0),a.setShape({x:l[0],y:0,width:s[0]-l[0],height:p[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?bG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=LL(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),a=this.api.getHeight();e={x:.2*i,y:.2*a,width:.6*i,height:.6*a}}return e},t.type="dataZoom.slider",t}(zL);function SG(e){return"vertical"===e?"ns-resize":"ew-resize"}function CG(e){e.registerComponentModel(gG),e.registerComponentView(wG),KL(e)}function _G(e){aI(hG),aI(CG)}var TG=function(e,t,n){var i=Ir((IG[e]||{})[t]);return n&&Ur(i)?i[i.length-1]:i},IG={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},EG=aO.mapVisual,MG=aO.eachVisual,kG=Ur,PG=Rr,DG=Gc,OG=Lc,AG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return ze(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&eq(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=Gr(e,this),this.controllerVisuals=JV(this.option.controller,t,e),this.targetVisuals=JV(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,n){t.push(n)})):t=dd(e),t},t.prototype.eachTargetSeries=function(e,t){Rr(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&e.call(t,i)}),this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries((function(n){n===e&&(t=!0)})),t},t.prototype.formatValueText=function(e,t,n){var i,a=this.option,r=a.precision,o=this.dataBound,s=a.formatter;n=n||["<",">"],Ur(e)&&(e=e.slice(),i=!0);var l=t?e:i?[p(e[0]),p(e[1])]:p(e);return Hr(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):jr(s)?i?s(e[0],e[1]):s(e):i?e[0]===o[0]?n[0]+" "+l[1]:e[1]===o[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function p(e){return e===o[0]?"min":e===o[1]?"max":(+e).toFixed(Math.min(r,20))}},t.prototype.resetExtent=function(){var e=this.option,t=DG([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,i=n.length-1;i>=0;i--){var a=n[i],r=e.getDimensionInfo(a);if(!r.isCalculationCoord)return r.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),a=t.controller||(t.controller={});Er(i,n),Er(a,n);var r=this.isCategory();function o(n){kG(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,a),function(e,t,n){var i=e[t],a=e[n];i&&!a&&(a=e[n]={},PG(i,(function(e,t){if(aO.isValidType(t)){var n=TG(t,"inactive",r);null!=n&&(a[t]=n,"color"!==t||a.hasOwnProperty("opacity")||a.hasOwnProperty("colorAlpha")||(a.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),a=this.getItemSymbol()||"roundRect";PG(this.stateList,(function(o){var s=this.itemSize,l=e[o];l||(l=e[o]={color:r?i:[i]}),null==l.symbol&&(l.symbol=t&&Ir(t)||(r?a:[a])),null==l.symbolSize&&(l.symbolSize=n&&Ir(n)||(r?s[0]:[s[0],s[0]])),l.symbol=EG(l.symbol,(function(e){return"none"===e?a:e}));var p=l.symbolSize;if(null!=p){var c=-1/0;MG(p,(function(e){e>c&&(c=e)})),l.symbolSize=EG(p,(function(e){return OG(e,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,a)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(Sv),FG=[20,140],RG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=FG[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=FG[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):Ur(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),Rr(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=Gc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var i=[],a=n.getData();a.each(this.getDataDimensionIndex(a),(function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)}),this),t.push({seriesId:n.id,dataIndex:i})}),this),t},t.prototype.getVisualMeta=function(e){var t=BG(this,"outOfRange",this.getExtent()),n=BG(this,"inRange",this.option.range.slice()),i=[];function a(t,n){i.push({value:t,color:e(t,n)})}for(var r=0,o=0,s=n.length,l=t.length;oe[1])break;n.push({color:this.getControllerVisual(r,"color",t),offset:a/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Mc("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,a=n.handleThumbs,r=n.handleLabels,o=i.itemSize,s=i.getExtent();zG([0,1],(function(l){var p=a[l];p.setStyle("fill",t.handlesColor[l]),p.y=e[l];var c=GG(e[l],[0,o[1]],s,!0),d=this.getControllerVisual(c,"symbolSize");p.scaleX=p.scaleY=d/o[0],p.x=o[0]-d/2;var u=Tf(n.handleLabelPoints[l],_f(p,this.group));r[l].setStyle({x:u[0],y:u[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,i){var a=this.visualMapModel,r=a.getExtent(),o=a.itemSize,s=[0,o[1]],l=this._shapes,p=l.indicator;if(p){p.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,"symbolSize"),u=GG(e,r,s,!0),m=o[0]-d/2,h={x:p.x,y:p.y};p.y=u,p.x=m;var g=Tf(l.indicatorLabelPoint,_f(p,this.group)),f=l.indicatorLabel;f.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;f.setStyle({text:(n||"")+a.formatValueText(t),verticalAlign:v?y:"middle",align:v?"center":y});var x={x:m,y:u,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(a.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};p.x=h.x,p.y=h.y,p.animateTo(x,w),f.animateTo(b,w)}else p.attr(x),f.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ca[1]&&(p[1]=1/0),t&&(p[0]===-1/0?this._showIndicator(l,p[1],"< ",o):p[1]===1/0?this._showIndicator(l,p[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,d=[];(t||$G(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(p));var u=function(e,t){var n={},i={};return a(e||[],n),a(t||[],i,n),[r(n),r(i)];function a(e,t,n){for(var i=0,a=e.length;i=0&&(a.dimension=r,i.push(a))}})),e.getData().setVisual("visualMeta",i)}}];function QG(e,t,n,i){for(var a=t.targetVisuals[i],r=aO.prepareVisualTypes(a),o={color:hS(e.getData(),"color")},s=0,l=r.length;s0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"})),e.registerAction(YG,XG),Rr(ZG,(function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)})),e.registerPreprocessor(ez))}function az(e){e.registerComponentModel(RG),e.registerComponentView(HG),iz(e)}var rz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return ze(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],oz[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var a=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=Ir(a)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=Br(this._pieceList,(function(e){return e=Ir(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=aO.listVisualTypes(),a=this.isCategory();function r(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}Rr(t.pieces,(function(e){Rr(i,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),Rr(n,(function(e,n){var i=!1;Rr(this.stateList,(function(e){i=i||r(t,e,n)||r(t.target,e,n)}),this),!i&&Rr(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=TG(n,"inRange"===e?"active":"inactive",a)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,i=this._pieceList,a=(t?n:e).selected||{};if(n.selected=a,Rr(i,(function(e,t){var n=this.getSelectedMapKey(e);a.hasOwnProperty(n)||(a[n]=!0)}),this),"single"===n.selectedMode){var r=!1;Rr(i,(function(e,t){var n=this.getSelectedMapKey(e);a[n]&&(r?a[n]=!1:r=!0)}),this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=Ir(e)},t.prototype.getValueState=function(e){var t=aO.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(i){var a=[],r=i.getData();r.each(this.getDataDimensionIndex(r),(function(t,i){aO.findPieceIndex(t,n)===e&&a.push(i)}),this),t.push({seriesId:i.id,dataIndex:a})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var o=-1/0;return Rr(a,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:n}}function s(a,r){var o=i.getRepresentValue({interval:a});r||(r=i.getValueState(o));var s=e(o,r);a[0]===-1/0?n[0]=s:a[1]===1/0?n[1]=s:t.push({value:a[0],color:s},{value:a[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=gy(AG.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(AG),oz={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),a=t.splitNumber;a=Math.max(parseInt(a,10),1),t.splitNumber=a;for(var r=(i[1]-i[0])/a;+r.toFixed(n)!==r&&n<5;)n++;t.precision=n,r=+r.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function sz(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var lz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return ze(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,a=i.getFont(),r=i.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),p=l.endsText,c=no(t.get("showLabel",!0),!p);p&&this._renderEndsText(e,p[0],s,c,o),Rr(l.viewPieceList,(function(i){var l=i.piece,p=new Mc;p.onclick=Gr(this._onItemClick,this,l),this._enableHoverLink(p,i.indexInModelPieceList);var d=t.getRepresentValue(l);if(this._createItemSymbol(p,d,[0,0,s[0],s[1]]),c){var u=this.visualMapModel.getValueState(d);p.add(new Pm({style:{x:"right"===o?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:o,font:a,fill:r,opacity:"outOfRange"===u?.5:1}}))}e.add(p)}),this),p&&this._renderEndsText(e,p[1],s,c,o),hv(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:qG(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return VG(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,a){if(t){var r=new Mc,o=this.visualMapModel.textStyleModel;r.add(new Pm({style:jf(o,{x:i?"right"===a?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?a:"center",text:t})})),e.add(r)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=Br(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),i=e.get("orient"),a=e.get("inverse");return("horizontal"===i?a:!a)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(PS(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=n.selectedMode;if(i){var a=Ir(n.selected),r=t.getSelectedMapKey(e);"single"===i||!0===i?(a[r]=!0,Rr(a,(function(e,t){a[t]=t===r}))):a[r]=!a[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:a})}},t.type="visualMap.piecewise",t}(NG);function pz(e){e.registerComponentModel(rz),e.registerComponentView(lz),iz(e)}function cz(e){aI(az),aI(pz)}Cd();var dz={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},uz=function(){function e(e){if(null==(this._condVal=Hr(e)?new RegExp(e):eo(e)?e:null)){var t="";0,sd(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return Hr(t)?this._condVal.test(e):!!$r(t)&&this._condVal.test(e+"")},e}(),mz=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),hz=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t=_z:-l>=_z),u=l>0?l%_z:l%_z+_z,m=!1;m=!!d||!tp(c)&&u>=Cz==!!p;var h=e+n*Sz(r),g=t+i*wz(r);this._start&&this._add("M",h,g);var f=Math.round(a*Tz);if(d){var y=1/this._p,v=(p?1:-1)*(_z-y);this._add("A",n,i,f,1,+p,e+n*Sz(r+v),t+i*wz(r+v)),y>.01&&this._add("A",n,i,f,0,+p,h,g)}else{var x=e+n*Sz(o),b=t+i*wz(o);this._add("A",n,i,f,+m,+p,x,b)}},e.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,i,a,r,o,s,l){for(var p=[],c=this._p,d=1;d"}(a,r)+("style"!==a?Jo(o):o||"")+(i?""+n+Br(i,(function(t){return e(t)})).join(n)+n:"")+("")}(e)}function Lz(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Vz(e,t,n,i){return Bz("svg","root",{width:e,height:t,xmlns:Oz,"xmlns:xlink":Az,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+e+" "+t},n)}var qz=0;function Gz(){return qz++}var zz={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Uz="transform-origin";function jz(e,t,n){var i=kr({},e.shape);kr(i,t),e.buildPath(n,i);var a=new Iz;return a.reset(dp(e)),n.rebuildPath(a,1),a.generateStr(),a.getStr()}function Hz(e,t){var n=t.originX,i=t.originY;(n||i)&&(e[Uz]=n+"px "+i+"px")}var Wz={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function $z(e,t){var n=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function Kz(e){return Hr(e)?zz[e]?"cubic-bezier("+zz[e]+")":_l(e)?e:"":""}function Yz(e,t,n,i){var a=e.animators,r=a.length,o=[];if(e instanceof Gg){var s=function(e,t,n){var i,a,r=e.shape.paths,o={};if(Rr(r,(function(e){var t=Lz(n.zrId);t.animation=!0,Yz(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,l=qr(r),p=l.length;if(p){var c=r[a=l[p-1]];for(var d in c){var u=c[d];o[d]=o[d]||{d:""},o[d].d+=u.d||""}for(var m in s){var h=s[m].animation;h.indexOf(a)>=0&&(i=h)}}})),i){t.d=!1;var s=$z(o,n);return i.replace(a,s)}}(e,t,n);if(s)o.push(s);else if(!r)return}else if(!r)return;for(var l={},p=0;p0})).length)return $z(c,n)+" "+a[0]+" both"}for(var f in l){(s=g(l[f]))&&o.push(s)}if(o.length){var y=n.zrId+"-cls-"+Gz();n.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function Xz(e,t,n,i){var a=JSON.stringify(e),r=n.cssStyleCache[a];r||(r=n.zrId+"-cls-"+Gz(),n.cssStyleCache[a]=r,n.cssNodes["."+r+(i?":hover":"")]=e),t.class=t.class?t.class+" "+r:r}var Zz=Math.round;function Qz(e){return e&&Hr(e.src)}function Jz(e){return e&&jr(e.toDataURL)}function eU(e,t,n,i){Dz((function(a,r){var o="fill"===a||"stroke"===a;o&&pp(r)?dU(t,e,a,i):o&&op(r)?uU(n,e,a,i):e[a]=o&&"none"===r?"transparent":r}),t,n,!1),function(e,t,n){var i=e.style;if(function(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}(i)){var a=function(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(e),r=n.shadowCache,o=r[a];if(!o){var s=e.getGlobalScale(),l=s[0],p=s[1];if(!l||!p)return;var c=i.shadowOffsetX||0,d=i.shadowOffsetY||0,u=i.shadowBlur,m=Jl(i.shadowColor),h=m.opacity,g=m.color,f=u/2/l+" "+u/2/p;o=n.zrId+"-s"+n.shadowIdx++,n.defs[o]=Bz("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Bz("feDropShadow","",{dx:c/l,dy:d/p,stdDeviation:f,"flood-color":g,"flood-opacity":h})]),r[a]=o}t.filter=cp(o)}}(n,e,i)}function tU(e,t){var n=Rc(t);n&&(n.each((function(t,n){null!=t&&(e[(Fz+n).toLowerCase()]=t+"")})),t.isSilent()&&(e[Fz+"silent"]="true"))}function nU(e){return tp(e[0]-1)&&tp(e[1])&&tp(e[2])&&tp(e[3]-1)}function iU(e,t,n){if(t&&(!function(e){return tp(e[4])&&tp(e[5])}(t)||!nU(t))){var i=n?10:1e4;e.transform=nU(t)?"translate("+Zz(t[4]*i)/i+" "+Zz(t[5]*i)/i+")":function(e){return"matrix("+np(e[0])+","+np(e[1])+","+np(e[2])+","+np(e[3])+","+ip(e[4])+","+ip(e[5])+")"}(t)}}function aU(e,t,n){for(var i=e.points,a=[],r=0;r=0&&o||r;s&&(a=Zl(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&e.transform?e.transform[0]:1);var p={cursor:"pointer"};a&&(p.fill=a),i.stroke&&(p.stroke=i.stroke),l&&(p["stroke-width"]=l),Xz(p,t,n,!0)}}(e,r,t),Bz(s,e.id+"",r)}function cU(e,t){return e instanceof gm?pU(e,t):e instanceof bm?function(e,t){var n=e.style,i=n.image;if(i&&!Hr(i)&&(Qz(i)?i=i.src:Jz(i)&&(i=i.toDataURL())),i){var a=n.x||0,r=n.y||0,o={href:i,width:n.width,height:n.height};return a&&(o.x=a),r&&(o.y=r),iU(o,e.transform),eU(o,n,e,t),tU(o,e),t.animation&&Yz(e,o,t),Bz("image",e.id+"",o)}}(e,t):e instanceof ym?function(e,t){var n=e.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var a=n.font||sr,r=n.x||0,o=function(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}(n.y||0,gc(a),n.textBaseline),s={"dominant-baseline":"central","text-anchor":ap[n.textAlign]||n.textAlign};if(Bm(n)){var l="",p=n.fontStyle,c=Fm(n.fontSize);if(!parseFloat(c))return;var d=n.fontFamily||or,u=n.fontWeight;l+="font-size:"+c+";font-family:"+d+";",p&&"normal"!==p&&(l+="font-style:"+p+";"),u&&"normal"!==u&&(l+="font-weight:"+u+";"),s.style=l}else s.style="font: "+a;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),o&&(s.y=o),iU(s,e.transform),eU(s,n,e,t),tU(s,e),t.animation&&Yz(e,s,t),Bz("text",e.id+"",s,void 0,i)}}(e,t):void 0}function dU(e,t,n,i){var a,r=e[n],o={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(sp(r))a="linearGradient",o.x1=r.x,o.y1=r.y,o.x2=r.x2,o.y2=r.y2;else{if(!lp(r))return void 0;a="radialGradient",o.cx=io(r.x,.5),o.cy=io(r.y,.5),o.r=io(r.r,.5)}for(var s=r.colorStops,l=[],p=0,c=s.length;pl?EU(e,null==n[d+1]?null:n[d+1].elm,n,s,d):MU(e,t,o,l))}(n,i,a):CU(a)?(CU(e.text)&&bU(n,""),EU(n,null,a,0,a.length-1)):CU(i)?MU(n,i,0,i.length-1):CU(e.text)&&bU(n,""):e.text!==t.text&&(CU(i)&&MU(n,i,0,i.length-1),bU(n,t.text)))}var DU=0,OU=function(){function e(e,t,n){if(this.type="svg",this.refreshHover=AU("refreshHover"),this.configLayer=AU("configLayer"),this.storage=t,this._opts=n=kr({},n),this.root=e,this._id="zr"+DU++,this._oldVNode=Vz(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Rz("svg");kU(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",function(e,t){if(TU(e,t))PU(e,t);else{var n=e.elm,i=vU(n);IU(t),null!==i&&(gU(i,t.elm,xU(n)),MU(i,[e],0,0))}}(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return cU(e,Lz(this._id))},e.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=Lz(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var r=[],o=this._bgVNode=function(e,t,n,i){var a;if(n&&"none"!==n)if(a=Bz("rect","bg",{width:e,height:t,x:"0",y:"0"}),pp(n))dU({fill:n},a.attrs,"fill",i);else if(op(n))uU({style:{fill:n},dirty:wo,getBoundingRect:function(){return{width:e,height:t}}},a.attrs,"fill",i);else{var r=Jl(n),o=r.color,s=r.opacity;a.attrs.fill=o,s<1&&(a.attrs["fill-opacity"]=s)}return a}(n,i,this._backgroundColor,a);o&&r.push(o);var s=e.compress?null:this._mainVNode=Bz("g","main",{},[]);this._paintList(t,a,s?s.children:r),s&&r.push(s);var l=Br(qr(a.defs),(function(e){return a.defs[e]}));if(l.length&&r.push(Bz("defs","defs",{},l)),e.animation){var p=function(e,t,n){var i=(n=n||{}).newline?"\n":"",a=" {"+i,r=i+"}",o=Br(qr(e),(function(t){return t+a+Br(qr(e[t]),(function(n){return n+":"+e[t][n]+";"})).join(i)+r})).join(i),s=Br(qr(t),(function(e){return"@keyframes "+e+a+Br(qr(t[e]),(function(n){return n+a+Br(qr(t[e][n]),(function(i){var a=t[e][n][i];return"d"===i&&(a='path("'+a+'")'),i+":"+a+";"})).join(i)+r})).join(i)+r})).join(i);return o||s?[""].join(i):""}(a.cssNodes,a.cssAnims,{newline:!0});if(p){var c=Bz("style","stl",{},[],p);r.push(c)}}return Vz(n,i,r,e.useViewBox)},e.prototype.renderToString=function(e){return e=e||{},Nz(this.renderToVNode({animation:io(e.cssAnimation,!0),emphasis:io(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:io(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var i,a,r=e.length,o=[],s=0,l=0,p=0;p=0&&(!d||!a||d[h]!==a[h]);h--);for(var g=m-1;g>h;g--)i=o[--s-1];for(var f=h+1;f=o)}}for(var c=this.__startIndex;c15)break}n.prevElClipPaths&&d.restore()};if(m)if(0===m.length)s=l.__endIndex;else for(var b=u.dpr,w=0;w0&&e>i[0]){for(s=0;se);s++);o=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var l=o.dom;l.nextSibling?r.insertBefore(t.dom,l.nextSibling):r.appendChild(t.dom)}else r.firstChild?r.insertBefore(t.dom,r.firstChild):r.appendChild(t.dom);t.painter||(t.painter=this)}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?VU:0),this._needsManuallyCompositing),p.__builtin__||Tr("ZLevel "+l+" has been used by unkown layer "+p.id),p!==r&&(p.__used=!0,p.__startIndex!==a&&(p.__dirty=!0),p.__startIndex=a,p.incremental?p.__drawIndex=-1:p.__drawIndex=a,t(a),r=p),1&s.__dirty&&!s.__inHover&&(p.__dirty=!0,p.incremental&&p.__drawIndex<0&&(p.__drawIndex=a))}t(a),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,Rr(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Er(n[e],t,!0):n[e]=t;for(var i=0;i({legendKey:e,left:!0}),jU=e=>({background:e});function HU(e,n){1&e&&t.ɵɵelementContainer(0)}function WU(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,HU,1,0,"ng-container",8),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e.widgetTitlePanel)}}function $U(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Min")))}function KU(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Max")))}function YU(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Avg")))}function XU(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Total")))}function ZU(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Latest")))}function QU(e,n){1&e&&t.ɵɵelementContainer(0)}function JU(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].min,"html"),t.ɵɵsanitizeHtml)}}function ej(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].max,"html"),t.ɵɵsanitizeHtml)}}function tj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].avg,"html"),t.ɵɵsanitizeHtml)}}function nj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].total,"html"),t.ɵɵsanitizeHtml)}}function ij(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].latest,"html"),t.ɵɵsanitizeHtml)}}function aj(e,n){if(1&e&&(t.ɵɵelementStart(0,"tr")(1,"th"),t.ɵɵtemplate(2,QU,1,0,"ng-container",14),t.ɵɵelementEnd(),t.ɵɵtemplate(3,JU,2,4,"td",15)(4,ej,2,4,"td",15)(5,tj,2,4,"td",15)(6,nj,2,4,"td",15)(7,ij,2,4,"td",15),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2),a=t.ɵɵreference(8);t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",a)("ngTemplateOutletContext",t.ɵɵpureFunction1(7,UU,e)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showMin),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showMax),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showAvg),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showTotal),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showLatest)}}function rj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"table",10)(2,"thead")(3,"tr"),t.ɵɵelement(4,"th"),t.ɵɵtemplate(5,$U,3,3,"th",11)(6,KU,3,3,"th",11)(7,YU,3,3,"th",11)(8,XU,3,3,"th",11)(9,ZU,3,3,"th",11),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"tbody"),t.ɵɵtemplate(11,aj,8,9,"tr",12),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngIf",!0===e.legendConfig.showMin),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showMax),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showAvg),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showTotal),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showLatest),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",e.legendKeys)}}function oj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",18),t.ɵɵelement(2,"div",19)(3,"div",20),t.ɵɵpipe(4,"safe"),t.ɵɵelementEnd()()),2&e){const e=n.legendKey,i=n.left;t.ɵɵclassProp("left",i),t.ɵɵadvance(2),t.ɵɵstyleMap(t.ɵɵpureFunction1(8,jU,e.dataKey.color)),t.ɵɵadvance(),t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(4,5,e.dataKey.label,"html"),t.ɵɵsanitizeHtml)}}class sj{constructor(e,t,n){this.renderer=e,this.sanitizer=t,this.widgetComponent=n,this.updateXAxisTimeWindow=(e,t)=>{e.min=t.minTime,e.max=t.maxTime}}ngOnInit(){this.initEchart(),this.initLegend()}ngAfterViewInit(){this.myChart=function(e,t,n){var i=!(n&&n.ssr);if(i){var a=n_(e);if(a)return a}var r=new GC(e,t,n);return r.id="ec_"+e_++,QC[r.id]=r,i&&Pd(e,t_,r.id),BC(r),sC.trigger("afterinit",r),r}(this.echartContainer.nativeElement,null,{renderer:"svg"}),this.initResize(),this.xAxis=this.setupXAxis(),this.yAxis=this.setupYAxis(),this.option={...this.setupAnimationSettings(),formatter:e=>this.setupTooltipElement(e),backgroundColor:"transparent",darkMode:!1,tooltip:{show:!0,trigger:"axis",confine:!0,padding:[8,12],appendTo:"body",textStyle:{fontFamily:"Roboto",fontSize:12,fontWeight:"normal",lineHeight:16}},grid:[{backgroundColor:null,borderColor:"#ccc",borderWidth:1,bottom:45,left:5,right:5,show:!1,top:10}],xAxis:[this.xAxis],yAxis:[this.yAxis],series:this.setupChartLines(),dataZoom:[{type:"inside",disabled:!1,realtime:!0,filterMode:"none"},{type:"slider",show:!0,showDetail:!1,realtime:!0,filterMode:"none",bottom:5}]},this.myChart.setOption(this.option),this.updateAxisOffset(!1)}onDataUpdated(){const e=[];this.onResize(),this.updateXAxisTimeWindow(this.xAxis,this.ctx.defaultSubscription.timeWindow);for(const t in this.ctx.data){e[t]=[];for(const[n,i]of this.ctx.data[t].data)e[t].push({name:n,value:[n,i]})}const t=[];for(const n of e)t.push({data:n});this.option.series=t,this.myChart.setOption(this.option),this.updateAxisOffset()}updateAxisOffset(e=!0){const t=Ze(this.myChart,this.yAxis.mainType,this.yAxis.id),n=Qe(this.myChart,this.yAxis.mainType,this.yAxis.id,this.yAxis.name),i=Ze(this.myChart,this.xAxis.mainType,this.xAxis.id),a=t+n,r=i+Qe(this.myChart,this.yAxis.mainType,this.yAxis.id,this.yAxis.name)+35;this.option.grid[0].left===a&&this.option.grid[0].bottom===r||(this.option.grid[0].left=a,this.yAxis.nameGap=t,this.option.grid[0].bottom=r,this.xAxis.nameGap=i,this.myChart.setOption(this.option,{replaceMerge:["yAxis","xAxis","grid"],lazyUpdate:e}))}initEchart(){aI([XV,kN,cz,_G,Nq,sL,tP,JE,TM,UM,nP,jB,hE,GU,FU])}initLegend(){this.showLegend=this.ctx.settings.showLegend,this.showLegend&&(this.legendConfig=this.ctx.settings.legendConfig,this.legendData=this.ctx.defaultSubscription.legendData,this.legendKeys=this.legendData.keys,this.legendClass=`legend-${this.legendConfig.position}`,this.legendConfig.sortDataKeys?this.legendKeys=this.legendData.keys.sort(((e,t)=>e.dataKey.label.localeCompare(t.dataKey.label))):this.legendKeys=this.legendData.keys)}initResize(){this.shapeResize$=new ResizeObserver((()=>{this.onResize()})),this.shapeResize$.observe(this.echartContainer.nativeElement)}onResize(){this.myChart.resize()}setupTooltipElement(e){const t=this.renderer.createElement("div");if(this.renderer.setStyle(t,"display","flex"),this.renderer.setStyle(t,"flex-direction","column"),this.renderer.setStyle(t,"align-items","flex-start"),this.renderer.setStyle(t,"gap","16px"),e.length){const n=this.renderer.createElement("div");this.renderer.setStyle(n,"display","flex"),this.renderer.setStyle(n,"flex-direction","column"),this.renderer.setStyle(n,"align-items","flex-start"),this.renderer.setStyle(n,"gap","4px"),this.renderer.appendChild(n,this.setTooltipDate(e));for(const[t,i]of e.entries())this.renderer.appendChild(n,this.constructTooltipSeriesElement(i,t));this.renderer.appendChild(t,n)}return t}constructTooltipSeriesElement(e,t){const n=this.renderer.createElement("div");this.renderer.setStyle(n,"display","flex"),this.renderer.setStyle(n,"flex-direction","row"),this.renderer.setStyle(n,"align-items","center"),this.renderer.setStyle(n,"align-self","stretch"),this.renderer.setStyle(n,"gap","12px");const i=this.renderer.createElement("div");this.renderer.setStyle(i,"display","flex"),this.renderer.setStyle(i,"align-items","center"),this.renderer.setStyle(i,"gap","8px"),this.renderer.appendChild(n,i);const a=this.renderer.createElement("div");this.renderer.setStyle(a,"width","8px"),this.renderer.setStyle(a,"height","8px"),this.renderer.setStyle(a,"border-radius","50%"),this.renderer.setStyle(a,"background",e.color),this.renderer.appendChild(i,a);const r=this.renderer.createElement("div");this.renderer.setProperty(r,"innerHTML",this.sanitizer.sanitize(g.HTML,e.seriesName)),this.renderer.setStyle(r,"font-family","Roboto"),this.renderer.setStyle(r,"font-size","12px"),this.renderer.setStyle(r,"font-style","normal"),this.renderer.setStyle(r,"font-weight",400),this.renderer.setStyle(r,"line-height","16px"),this.renderer.setStyle(r,"color","rgba(0, 0, 0, 0.76)"),this.renderer.appendChild(i,r);const o=ke(this.ctx.data[t].dataKey.decimals)?this.ctx.data[t].dataKey.decimals:this.ctx.decimals,s=ke(this.ctx.data[t].dataKey.units)?this.ctx.data[t].dataKey.units:this.ctx.units,l=Pe(e.value[1],o,s,!1),p=this.renderer.createElement("div");return this.renderer.setProperty(p,"innerHTML",this.sanitizer.sanitize(g.HTML,l)),this.renderer.setStyle(p,"flex","1"),this.renderer.setStyle(p,"text-align","end"),this.renderer.setStyle(p,"font-family","Roboto"),this.renderer.setStyle(p,"font-size","12px"),this.renderer.setStyle(p,"font-style","normal"),this.renderer.setStyle(p,"font-weight",500),this.renderer.setStyle(p,"line-height","16px"),this.renderer.setStyle(p,"color","rgba(0, 0, 0, 0.76)"),this.renderer.appendChild(n,p),n}setTooltipDate(e){const t=this.renderer.createElement("div");return this.renderer.appendChild(t,this.renderer.createText(new Date(e[0].value[0]).toLocaleString("en-GB"))),this.renderer.setStyle(t,"font-family","Roboto"),this.renderer.setStyle(t,"font-size","11px"),this.renderer.setStyle(t,"font-style","normal"),this.renderer.setStyle(t,"font-weight","400"),this.renderer.setStyle(t,"line-height","16px"),this.renderer.setStyle(t,"color","rgba(0, 0, 0, 0.76)"),t}setupAnimationSettings(){return{animation:!0,animationDelay:0,animationDelayUpdate:0,animationDuration:500,animationDurationUpdate:300,animationEasing:"cubicOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3}}setupChartLines(){const e=[];for(const[t,n]of this.ctx.datasources[0].dataKeys.entries())e.push({id:t,name:n.label,type:"line",showSymbol:!1,smooth:!1,step:!1,stackStrategy:"all",data:[],lineStyle:{color:n.color},itemStyle:{color:n.color}});return e}setupYAxis(){return{type:"value",position:"left",mainType:"yAxis",id:"yAxis",offset:0,nameLocation:"middle",nameRotate:90,alignTicks:!0,scale:!0,show:!0,axisLabel:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:12,fontStyle:"normal",fontWeight:400,show:!0,formatter:e=>Pe(e,this.ctx.decimals,this.ctx.units,!1)},splitLine:{show:!0},axisLine:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisTick:{lineStyle:{color:"rgba(0, 0, 0, 0.54)"},show:!0},nameTextStyle:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:12,fontStyle:"normal",fontWeight:600}}}setupXAxis(){return{id:"xAxis",mainType:"xAxis",show:!0,type:"time",position:"bottom",offset:0,nameLocation:"middle",max:this.ctx.defaultSubscription.timeWindow.maxTime,min:this.ctx.defaultSubscription.timeWindow.minTime,nameTextStyle:{color:"rgba(0, 0, 0, 0.54)",fontStyle:"normal",fontWeight:600,fontFamily:"Roboto",fontSize:12},axisPointer:{shadowStyle:{color:"rgba(210,219,238,0.2)"}},splitLine:{show:!0},axisTick:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisLine:{onZero:!1,show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisLabel:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:10,fontStyle:"normal",fontWeight:400,show:!0,hideOverlap:!0}}}static{this.ɵfac=function(e){return new(e||sj)(t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(Je.DomSanitizer),t.ɵɵdirectiveInject(et.WidgetComponent))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:sj,selectors:[["tb-gateway-statistics-chart"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(zU,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.echartContainer=e.first)}},inputs:{ctx:"ctx",widgetTitlePanel:"widgetTitlePanel"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:9,vars:4,consts:[["echartContainer",""],["legendItem",""],[1,"tb-time-series-chart-panel"],[1,"tb-time-series-chart-overlay"],[4,"ngIf"],[1,"tb-time-series-chart-content"],[1,"tb-time-series-chart-shape"],["class","tb-time-series-chart-legend",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"tb-time-series-chart-legend"],[1,"tb-time-series-chart-legend-table","vertical"],["class","tb-time-series-chart-legend-type-label right legend legend-row-color",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tb-time-series-chart-legend-type-label","right","legend","legend-row-color"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","tb-time-series-chart-legend-value legend",3,"innerHTML",4,"ngIf"],[1,"tb-time-series-chart-legend-value","legend",3,"innerHTML"],[1,"tb-time-series-chart-legend-item"],[1,"tb-time-series-chart-legend-item-label"],[1,"tb-time-series-chart-legend-item-label-circle"],[1,"legend","legend-label-color",3,"innerHTML"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",2),t.ɵɵelement(1,"div",3),t.ɵɵtemplate(2,WU,2,1,"ng-container",4),t.ɵɵelementStart(3,"div",5),t.ɵɵelement(4,"div",6,0),t.ɵɵtemplate(6,rj,12,6,"div",7)(7,oj,5,10,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.widgetComponent.dashboardWidget.showWidgetTitlePanel),t.ɵɵadvance(),t.ɵɵclassMap(n.legendClass),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.showLegend))},dependencies:t.ɵɵgetComponentDepsFactory(sj,[j,_]),styles:['@charset "UTF-8";.tb-time-series-chart-panel[_ngcontent-%COMP%]{width:100%;height:100%;position:relative;display:flex;flex-direction:column;gap:8px;padding:12px}.tb-time-series-chart-panel[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(.tb-time-series-chart-overlay){z-index:1}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-overlay[_ngcontent-%COMP%]{position:absolute;inset:12px}.tb-time-series-chart-panel[_ngcontent-%COMP%] div.tb-widget-title[_ngcontent-%COMP%]{padding:0}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%]{flex-direction:column-reverse}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-right[_ngcontent-%COMP%]{flex-direction:row}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-left[_ngcontent-%COMP%]{flex-direction:row-reverse}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-shape[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-right[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-left[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{display:inline-grid;grid-auto-flow:column;grid-template-rows:repeat(auto-fit,minmax(16px,min-content));max-width:calc(25% - 8px);height:fit-content;max-height:100%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{align-self:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend.tb-simple-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend.tb-simple-legend[_ngcontent-%COMP%]{justify-content:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]:not(.tb-simple-legend), .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]:not(.tb-simple-legend){width:100%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{display:flex;align-items:flex-start;align-self:stretch;column-gap:16px;row-gap:8px;flex-wrap:wrap;overflow:auto;width:fit-content;max-width:100%;max-height:calc(35% - 8px)}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%]{border-spacing:0;table-layout:fixed}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table.vertical[_ngcontent-%COMP%]{width:100%;table-layout:auto}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table.vertical[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:95%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:last-child), .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:last-child){padding-right:16px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:last-child) th[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:last-child) td[_ngcontent-%COMP%]{padding-bottom:8px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%]{align-items:flex-end}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] .tb-time-series-chart-legend-item.left[_ngcontent-%COMP%]{align-items:flex-start}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;-webkit-user-select:none;user-select:none}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;color:#ccc;white-space:nowrap;cursor:pointer}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label-circle[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:#ccc}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-type-label[_ngcontent-%COMP%]{white-space:nowrap;text-align:left}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-type-label.right[_ngcontent-%COMP%]{text-align:right}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-value[_ngcontent-%COMP%]{white-space:nowrap;text-align:right}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{font-size:12px;font-style:normal;font-weight:500;letter-spacing:normal;line-height:16px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend.legend-row-color[_ngcontent-%COMP%]{color:#00000061}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend.legend-label-color[_ngcontent-%COMP%]{color:#000}']})}}const lj=["statisticChart"];function pj(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",12),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.openEditCommandDialog())})),t.ɵɵelementStart(2,"mat-icon",13),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",12),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.onDeleteClick())})),t.ɵɵelementStart(6,"mat-icon",13),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function cj(e,n){if(1&e&&t.ɵɵelement(0,"tb-gateway-statistics-chart",14,0),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("ctx",e.ctx)}}function dj(e,n){if(1&e&&t.ɵɵelement(0,"tb-custom-statistics-table",15),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("data",e.subscriptionData)}}function uj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10),t.ɵɵtemplate(1,cj,2,1,"tb-gateway-statistics-chart",14)(2,dj,1,1,"tb-custom-statistics-table",15),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵconditional(e.isNumericData?1:2)}}function mj(e,n){1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵelement(1,"div",16),t.ɵɵelementStart(2,"div",17),t.ɵɵtext(3,"attribute.no-telemetry-text"),t.ɵɵelementEnd()())}class hj{constructor(e,t,n,i,a,r){this.fb=e,this.attributeService=t,this.destroyRef=n,this.dialog=i,this.dialogService=a,this.utils=r,this.subscriptionData=[],this.statisticForm=this.fb.group({command:[]}),this.isNumericData=!1,this.commands=[],this.subscribed=!1,this.dataTypeDefined=!1,this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.isDataOnlyNumbers(),this.isNumericData&&this.statisticChart?.onDataUpdated()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)}))},useDashboardTimewindow:!1,legendConfig:F(R.timeseries)},this.statisticForm.get("command").valueChanges.pipe(bn()).subscribe((e=>{this.subscribed=!1,this.subscriptionInfo&&e?.attributeOnGateway&&this.createSubscription(this.ctx.defaultSubscription.datasources[0].entity,e.attributeOnGateway)}))}ngAfterViewInit(){if(this.ctx.defaultSubscription.datasources.length){const e=this.ctx.defaultSubscription.datasources[0].entity;if(e.id.id===B)return;this.getGatewayGeneralConfig().pipe(bn(this.destroyRef)).subscribe((t=>{this.commands=t?.statistics.commands.reverse()??[],this.commands.length&&(this.statisticForm.get("command").setValue(this.commands[0]),this.createSubscription(e,this.commands[0].attributeOnGateway))}))}}openEditCommandDialog(){const e=this.statisticForm.get("command").value,t="string"==typeof e||!e,n="string"==typeof e?{attributeOnGateway:e}:e;let i;this.dialog.open(ir,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{titleText:t?"gateway.statistics.create-command":"gateway.statistics.edit-command",buttonText:t?"action.add":"action.apply",command:n,existingCommands:this.commands.map((e=>e.attributeOnGateway))}}).afterClosed().pipe(xe((e=>re(this.getGatewayGeneralConfig(),ae(e)))),xe((([e,t])=>(this.commands=[...e?.statistics.commands.filter((e=>e.attributeOnGateway!==t?.prev?.attributeOnGateway))??[],...t?.current?[{...t.current}]:[]],i=t?.current,this.updateStatisticsCommands(e,this.commands)))),bn(this.destroyRef)).subscribe((()=>{i&&this.statisticForm.get("command").patchValue(i)}))}onDeleteClick(){const e=this.statisticForm.get("command").value.attributeOnGateway;this.dialogService.confirm(this.ctx.translate.instant("gateway.statistics.delete-command",{command:e}),this.ctx.translate.instant("gateway.statistics.delete-command-data"),this.ctx.translate.instant("action.cancel"),this.ctx.translate.instant("action.confirm")).pipe(ve(Boolean),xe((()=>this.getGatewayGeneralConfig())),xe((t=>(this.commands=[...t.statistics.commands.filter((t=>t.attributeOnGateway!==e))],this.updateStatisticsCommands(t,this.commands)))),bn(this.destroyRef)).subscribe()}getGatewayGeneralConfig(){const e=this.ctx.defaultSubscription.datasources[0].entity;return e.id.id===B?ae(null):this.attributeService.getEntityAttributes(e.id,D.SHARED_SCOPE,["general_configuration"]).pipe(pe((e=>e[0]?.value)))}updateStatisticsCommands(e,t){const n=this.ctx.defaultSubscription.datasources[0].entity;return n.id.id!==B&&e?this.attributeService.saveEntityAttributes(n.id,D.SHARED_SCOPE,[{key:"general_configuration",value:{...e,statistics:{...e.statistics,commands:t}}}]):ae(null)}createSubscription(e,t){const n=[{type:N.entity,entityType:L.DEVICE,entityId:e.id.id,entityName:e.name,timeseries:[]}];n[0].timeseries=[{name:t,label:t,settings:{}}],this.subscriptionInfo=n,this.changeSubscription(n)}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}isDataOnlyNumbers(){this.subscriptionData=this.ctx.defaultSubscription.data[0]?.data??[],this.subscriptionData.length&&!this.dataTypeDefined&&(this.isNumericData=this.subscriptionData.every((e=>!isNaN(+e[1]))),this.dataTypeDefined=!0),this.ctx.detectChanges()}changeSubscription(e){this.ctx.defaultSubscription?.unsubscribe(),this.ctx.datasources[0].entity&&this.ctx.subscriptionApi.createSubscriptionFromInfo(R.timeseries,e,this.subscriptionOptions,!1,!0).pipe(bn(this.destroyRef)).subscribe((e=>{this.dataTypeDefined=!1,this.ctx.defaultSubscription=e,this.ctx.settings.showLegend=!1,this.ctx.data=e.data,this.ctx.datasources=e.datasources,this.isDataOnlyNumbers(),this.subscribed=!0}))}static{this.ɵfac=function(e){return new(e||hj)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(_e.AttributeService),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(_e.UtilsService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:hj,selectors:[["tb-gateway-statistics"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(lj,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.statisticChart=e.first)}},inputs:{ctx:"ctx"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:18,vars:13,consts:[["statisticChart",""],[1,"flex","flex-1","flex-col","max-h-full"],[1,"entry-container","flex","items-center"],[1,"tb-form-panel","stroked","w-full","flex-1",3,"formGroup"],["translate","",1,"tb-form-panel-title"],[1,"entry-container","flex","w-full","gap-2"],["formControlName","command",1,"flex-1",3,"onCreateNewClicked","commands"],["appearance","outline",1,"flex-1"],["matInput","","disabled","",3,"tbTruncateWithTooltip","value"],[1,"actions-container","flex","flex-col","p-2","min-w-16"],[1,"chart-box","flex","flex-1","flex-col","overflow-auto"],[1,"tb-no-data-available","h-full"],["type","button","matSuffix","","mat-icon-button","","aria-label","Edit","matTooltipPosition","above",1,"action-button",3,"click","matTooltip"],[1,"material-icons"],[1,"flex-1",3,"ctx"],[1,"h-full","flex-1",3,"data"],[1,"tb-no-data-bg"],["translate","",1,"tb-no-data-text"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t.ɵɵtext(4,"gateway.statistics.entry"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",5)(6,"tb-statistics-commands-autocomplete",6),t.ɵɵlistener("onCreateNewClicked",(function(){return n.openEditCommandDialog()})),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-form-field",7)(8,"mat-label"),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(11,"input",8),t.ɵɵpipe(12,"translate"),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(14,"div",9),t.ɵɵtemplate(15,pj,8,6),t.ɵɵelementEnd()(),t.ɵɵtemplate(16,uj,3,1,"div",10)(17,mj,4,0,"div",11),t.ɵɵelementEnd()),2&e){let e,i,a,r;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",n.statisticForm),t.ɵɵadvance(4),t.ɵɵproperty("commands",n.commands),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,7,"gateway.statistics.command")),t.ɵɵadvance(2),t.ɵɵproperty("tbTruncateWithTooltip",null!==(e=null==(e=n.statisticForm.get("command").value)?null:e.command)&&void 0!==e?e:t.ɵɵpipeBind1(12,9,"gateway.statistics.no-config-commands-found"))("value",null!==(i=null==(i=n.statisticForm.get("command").value)?null:i.command)&&void 0!==i?i:t.ɵɵpipeBind1(13,11,"gateway.statistics.no-config-commands-found")),t.ɵɵadvance(4),t.ɵɵconditional(null!=(a=n.statisticForm.get("command").value)&&a.attributeOnGateway?15:-1),t.ɵɵadvance(),t.ɵɵconditional(null!=(r=n.statisticForm.get("command").value)&&r.attributeOnGateway&&n.subscriptionData.length&&n.subscribed?16:17)}},dependencies:t.ɵɵgetComponentDepsFactory(hj,[j,_,Dn,Vn,sj]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;padding:4px;display:flex;flex-direction:column}[_nghost-%COMP%] .action-button[_ngcontent-%COMP%]{opacity:.7}@media screen and (max-width: 599px){[_nghost-%COMP%] .entry-container[_ngcontent-%COMP%]{flex-direction:column}[_nghost-%COMP%] .actions-container[_ngcontent-%COMP%]{flex-direction:row}}']})}}var gj;e("GatewayStatisticsComponent",hj),e("BACnetRequestTypes",gj),function(e){e.WriteProperty="writeProperty",e.ReadProperty="readProperty"}(gj||e("BACnetRequestTypes",gj={}));const fj=e("BACnetRequestTypesTranslates",new Map([[gj.WriteProperty,"gateway.rpc.write-property"],[gj.ReadProperty,"gateway.rpc.read-property"]]));var yj;e("BACnetObjectTypes",yj),function(e){e.BinaryInput="binaryInput",e.BinaryOutput="binaryOutput",e.AnalogInput="analogInput",e.AnalogOutput="analogOutput",e.BinaryValue="binaryValue",e.AnalogValue="analogValue"}(yj||e("BACnetObjectTypes",yj={}));const vj=e("BACnetObjectTypesTranslates",new Map([[yj.AnalogOutput,"gateway.rpc.analog-output"],[yj.AnalogInput,"gateway.rpc.analog-input"],[yj.BinaryOutput,"gateway.rpc.binary-output"],[yj.BinaryInput,"gateway.rpc.binary-input"],[yj.BinaryValue,"gateway.rpc.binary-value"],[yj.AnalogValue,"gateway.rpc.analog-value"]]));var xj;e("BLEMethods",xj),function(e){e.WRITE="write",e.READ="read",e.SCAN="scan"}(xj||e("BLEMethods",xj={}));const bj=e("BLEMethodsTranslates",new Map([[xj.WRITE,"gateway.rpc.write"],[xj.READ,"gateway.rpc.read"],[xj.SCAN,"gateway.rpc.scan"]]));var wj,Sj;e("CANByteOrders",wj),function(e){e.LITTLE="LITTLE",e.BIG="BIG"}(wj||e("CANByteOrders",wj={})),e("SocketMethodProcessings",Sj),function(e){e.WRITE="write",e.READ="read"}(Sj||e("SocketMethodProcessings",Sj={}));const Cj=e("SocketMethodProcessingsTranslates",new Map([[Sj.WRITE,"gateway.rpc.write"],[Sj.READ,"gateway.rpc.read"]]));var _j;e("SNMPMethods",_j),function(e){e.SET="set",e.MULTISET="multiset",e.GET="get",e.BULKWALK="bulkwalk",e.TABLE="table",e.MULTIGET="multiget",e.GETNEXT="getnext",e.BULKGET="bulkget",e.WALKS="walk"}(_j||e("SNMPMethods",_j={}));const Tj=e("SNMPMethodsTranslations",new Map([[_j.SET,"gateway.rpc.set"],[_j.MULTISET,"gateway.rpc.multiset"],[_j.GET,"gateway.rpc.get"],[_j.BULKWALK,"gateway.rpc.bulk-walk"],[_j.TABLE,"gateway.rpc.table"],[_j.MULTIGET,"gateway.rpc.multi-get"],[_j.GETNEXT,"gateway.rpc.get-next"],[_j.BULKGET,"gateway.rpc.bulk-get"],[_j.WALKS,"gateway.rpc.walk"]]));var Ij,Ej;e("SocketEncodings",Ij),function(e){e.UTF_8="utf-8"}(Ij||e("SocketEncodings",Ij={})),e("RestSecurityType",Ej),function(e){e.ANONYMOUS="anonymous",e.BASIC="basic"}(Ej||e("RestSecurityType",Ej={}));const Mj=e("RestSecurityTypeTranslationsMap",new Map([[Ej.ANONYMOUS,"gateway.broker.security-types.anonymous"],[Ej.BASIC,"gateway.broker.security-types.basic"]]));class kj{transform(e){return e.map((e=>(e?.value??e).toString())).join(", ")}static{this.ɵfac=function(e){return new(e||kj)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getRpcTemplateArrayView",type:kj,pure:!0,standalone:!0})}}e("RpcTemplateArrayViewPipe",kj);class Pj{constructor(){this.differs=i(f),this.keyValues=[]}transform(e){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ??=this.differs.find(e).create();const t=this.differ.diff(e);return t&&(this.keyValues=[],t.forEachItem((e=>{ke(e.currentValue)&&this.keyValues.push(this.makeKeyValuePair(e.key,e.currentValue))}))),this.keyValues}makeKeyValuePair(e,t){return{key:e,value:t}}static{this.ɵfac=function(e){return new(e||Pj)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"keyValueIsNotEmpty",type:Pj,pure:!1,standalone:!0})}}e("KeyValueIsNotEmptyPipe",Pj);const Dj=e=>({$implicit:e,innerValue:!1}),Oj=e=>({"padding-left":e}),Aj=(e,t)=>({"boolean-true":e,"boolean-false":t}),Fj=e=>({$implicit:e,innerValue:!0});function Rj(e,n){if(1&e&&t.ɵɵelementContainer(0,13),2&e){const e=n.$implicit;t.ɵɵnextContext();const i=t.ɵɵreference(15);t.ɵɵproperty("ngTemplateOutlet",i)("ngTemplateOutletContext",t.ɵɵpureFunction1(2,Dj,e))}}function Bj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",19),t.ɵɵtext(1),t.ɵɵpipe(2,"getRpcTemplateArrayView"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,e.value)," ")}}function Nj(e,n){if(1&e&&t.ɵɵelementContainer(0,20),2&e){t.ɵɵnextContext();const e=t.ɵɵreference(12);t.ɵɵproperty("ngTemplateOutlet",e)}}function Lj(e,n){if(1&e&&t.ɵɵelementContainer(0,20),2&e){t.ɵɵnextContext(2);const e=t.ɵɵreference(10);t.ɵɵproperty("ngTemplateOutlet",e)}}function Vj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵtemplate(1,Lj,1,1,"ng-container",21),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵreference(8),i=t.ɵɵnextContext().$implicit,a=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction2(4,Aj,!0===e.value,!1===e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",i.type===a.ConnectorType.SNMP&&"method"===e.key)("ngIfElse",n)}}function qj(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate(e.value)}}function Gj(e,n){if(1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵtextInterpolate(t.ɵɵpipeBind1(1,1,n.SNMPMethodsTranslations.get(e.value)))}}function zj(e,n){if(1&e&&t.ɵɵelementContainer(0,13),2&e){const e=n.$implicit;t.ɵɵnextContext(3);const i=t.ɵɵreference(15);t.ɵɵproperty("ngTemplateOutlet",i)("ngTemplateOutletContext",t.ɵɵpureFunction1(2,Fj,e))}}function Uj(e,n){if(1&e&&(t.ɵɵtemplate(0,zj,1,4,"ng-container",12),t.ɵɵpipe(1,"keyvalue")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("ngForOf",t.ɵɵpipeBind2(1,1,e.value,n.originalOrder))}}function jj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14)(1,"div",15),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(4,Bj,3,3,"div",16)(5,Nj,1,1,"ng-container",17)(6,Vj,2,7,"div",18)(7,qj,1,1,"ng-template",null,1,t.ɵɵtemplateRefExtractor)(9,Gj,2,3,"ng-template",null,2,t.ɵɵtemplateRefExtractor)(11,Uj,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=n.innerValue,a=t.ɵɵnextContext(2);t.ɵɵstyleMap(t.ɵɵpureFunction1(10,Oj,i?"16px":"0")),t.ɵɵclassMap(a.getRpcParamsRowClasses(e.value)),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",i?e.key:t.ɵɵpipeBind1(3,8,"gateway.rpc."+e.key)," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",a.isArray(e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",a.isObject(e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!a.isObject(e.value)&&!a.isArray(e.value))}}function Hj(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-expansion-panel",6)(1,"mat-expansion-panel-header")(2,"mat-panel-title",7)(3,"span",8),t.ɵɵtext(4),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"mat-panel-description")(6,"button",9),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteTemplate(n,i))})),t.ɵɵelementStart(7,"mat-icon",10),t.ɵɵtext(8,"delete"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",11),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.applyTemplate(n,i))})),t.ɵɵelementStart(10,"mat-icon",10),t.ɵɵtext(11,"play_arrow"),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(12,Rj,1,4,"ng-container",12),t.ɵɵpipe(13,"keyValueIsNotEmpty"),t.ɵɵtemplate(14,jj,13,12,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit;t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",e.name),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(13,3,e.config))}}class Wj{constructor(e){this.attributeService=e,this.saveTemplate=new u,this.useTemplate=new u,this.ConnectorType=ct,this.originalOrder=()=>0,this.isObject=e=>De(e),this.isArray=e=>Array.isArray(e),this.SNMPMethodsTranslations=Tj}applyTemplate(e,t){e.stopPropagation(),this.useTemplate.emit(t)}deleteTemplate(e,t){e.stopPropagation();const n=this.rpcTemplates.findIndex((e=>e.name==t.name));this.rpcTemplates.splice(n,1);const i=`${this.connectorType}_template`;this.attributeService.saveEntityAttributes({id:this.ctx.defaultSubscription.targetDeviceId,entityType:L.DEVICE},D.SERVER_SCOPE,[{key:i,value:this.rpcTemplates}]).subscribe((()=>{}))}getRpcParamsRowClasses(e){return this.isObject(e)?"flex-col":"flex-row justify-between items-center"}static{this.ɵfac=function(e){return new(e||Wj)(t.ɵɵdirectiveInject(_e.AttributeService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Wj,selectors:[["tb-gateway-service-rpc-connector-templates"]],inputs:{connectorType:"connectorType",ctx:"ctx",rpcTemplates:"rpcTemplates"},outputs:{saveTemplate:"saveTemplate",useTemplate:"useTemplate"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:4,vars:4,consts:[["RPCTemplateRef",""],["value",""],["SNMPMethod",""],["RPCObjectRow",""],[1,"mat-subtitle-1","title"],["hideToggle","",4,"ngFor","ngForOf"],["hideToggle",""],[1,"template-name"],["matTooltipPosition","above",3,"matTooltip"],["mat-icon-button","","matTooltip","Delete",3,"click"],[1,"material-icons"],["mat-icon-button","","matTooltip","Use",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"rpc-params-row","flex"],[1,"template-key"],["tbTruncateWithTooltip","","class","array-value",4,"ngIf"],[3,"ngTemplateOutlet",4,"ngIf"],[3,"class",4,"ngIf"],["tbTruncateWithTooltip","",1,"array-value"],[3,"ngTemplateOutlet"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(3,Hj,16,5,"mat-expansion-panel",5)),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,"gateway.rpc.templates-title")),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",n.rpcTemplates))},dependencies:t.ɵɵgetComponentDepsFactory(Wj,[j,_,kj,Pj]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;padding:0}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .template-key[_ngcontent-%COMP%]{color:#00000061;height:32px;line-height:32px}[_nghost-%COMP%] .boolean-true[_ngcontent-%COMP%], [_nghost-%COMP%] .boolean-false[_ngcontent-%COMP%]{border-radius:3px;height:32px;line-height:32px;padding:0 12px;width:fit-content;font-size:14px;text-transform:capitalize}[_nghost-%COMP%] .boolean-false[_ngcontent-%COMP%]{color:#d12730;background-color:#d1273014}[_nghost-%COMP%] .boolean-true[_ngcontent-%COMP%]{color:#198038;background-color:#19803814}[_nghost-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{margin-top:10px;overflow:visible}[_nghost-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-direction:row-reverse;align-items:center;margin-right:0;flex:0}[_nghost-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{margin-left:15px;color:#00000061}[_nghost-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 0 0 12px}[_nghost-%COMP%] .mat-expansion-panel-header.mat-expansion-panel-header.mat-expanded[_ngcontent-%COMP%]{height:48px}[_nghost-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%] .mat-content.mat-content-hide-toggle[_ngcontent-%COMP%]{margin-right:0}[_nghost-%COMP%] .rpc-params-row[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap}[_nghost-%COMP%] .rpc-params-row[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:first-child){white-space:pre;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .template-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;display:block}[_nghost-%COMP%] .mat-content{align-items:center}[_nghost-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%]{flex:1;margin:0}[_nghost-%COMP%] .array-value[_ngcontent-%COMP%]{margin-left:10px}']})}}function $j(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.template-name-required")," "))}function Kj(e,n){1&e&&(t.ɵɵelementStart(0,"div",12),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.template-name-duplicate")," "))}e("GatewayServiceRPCConnectorTemplatesComponent",Wj);class Yj extends A{constructor(e,t,n,i,a){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.config=this.data.config,this.templates=this.data.templates,this.templateNameCtrl=this.fb.control("",[$.required])}validateDuplicateName(e){const t=e.value.trim();return!!this.templates.find((e=>e.name===t))}close(){this.dialogRef.close()}save(){this.templateNameCtrl.setValue(this.templateNameCtrl.value.trim()),this.templateNameCtrl.valid&&this.dialogRef.close(this.templateNameCtrl.value)}static{this.ɵfac=function(e){return new(e||Yj)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Yj,selectors:[["tb-gateway-service-rpc-connector-template-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:20,vars:10,consts:[["color","primary",1,"justify-between"],["translate",""],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"mat-content","flex","flex-col",2,"width","600px"],[1,"mat-block","tb-value-type",2,"flex-grow","0"],["matInput","","required","",3,"formControl"],[4,"ngIf"],["class","mat-mdc-form-field-error","style","margin-top: -15px; padding-left: 10px; font-size: 14px;",4,"ngIf"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"mat-mdc-form-field-error",2,"margin-top","-15px","padding-left","10px","font-size","14px"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-toolbar",0)(1,"h2",1),t.ɵɵtext(2,"gateway.rpc.save-template"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"button",2),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵelementStart(4,"mat-icon",3),t.ɵɵtext(5,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(6,"div",4)(7,"mat-form-field",5)(8,"mat-label",1),t.ɵɵtext(9,"gateway.rpc.template-name"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",6),t.ɵɵtemplate(11,$j,3,3,"mat-error",7),t.ɵɵelementEnd(),t.ɵɵtemplate(12,Kj,3,3,"div",8),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",9)(14,"button",10),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵlistener("click",(function(){return n.save()})),t.ɵɵtext(18),t.ɵɵpipe(19,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(10),t.ɵɵproperty("formControl",n.templateNameCtrl),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.templateNameCtrl.hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.validateDuplicateName(n.templateNameCtrl)),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(16,6,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",!n.templateNameCtrl.valid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(19,8,"action.save")," "))},dependencies:t.ɵɵgetComponentDepsFactory(Yj,[j,_]),encapsulation:2})}}function Xj(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",6),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SecurityTypeTranslationsMap.get(e))," ")}}function Zj(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function Qj(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.password-required"))}function Jj(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",7)(2,"div",8),t.ɵɵtext(3,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",9)(5,"mat-form-field",10),t.ɵɵelement(6,"input",11),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,Zj,3,3,"mat-icon",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",7)(10,"div",8),t.ɵɵtext(11,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"div",9)(13,"mat-form-field",10),t.ɵɵelement(14,"input",13),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,Qj,3,3,"mat-icon",12),t.ɵɵelementStart(17,"div",14),t.ɵɵelement(18,"tb-toggle-password",15),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,6,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("password").hasError("required")&&e.securityFormGroup.get("password").touched),t.ɵɵadvance(),t.ɵɵclassProp("hide-toggle",e.securityFormGroup.get("password").hasError("required"))}}e("GatewayServiceRPCConnectorTemplateDialogComponent",Yj);class eH{constructor(e){this.fb=e,this.BrokerSecurityType=Ej,this.securityTypes=Object.values(Ej),this.SecurityTypeTranslationsMap=Mj,this.destroy$=new te,this.propagateChange=e=>{},this.securityFormGroup=this.fb.group({type:[Ej.ANONYMOUS,[]],username:["",[$.required,$.pattern(an)]],password:["",[$.required,$.pattern(an)]]}),this.observeSecurityForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}writeValue(e){e.type||(e.type=Ej.ANONYMOUS),this.securityFormGroup.reset(e),this.updateView(e)}validate(){return this.securityFormGroup.valid?null:{securityForm:{valid:!1}}}updateView(e){this.propagateChange(e)}updateValidators(e){e===Ej.BASIC?(this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1})):(this.securityFormGroup.get("username").disable({emitEvent:!1}),this.securityFormGroup.get("password").disable({emitEvent:!1}))}observeSecurityForm(){this.securityFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateView(e))),this.securityFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateValidators(e)))}static{this.ɵfac=function(e){return new(e||eH)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:eH,selectors:[["tb-rest-connector-security"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>eH)),multi:!0},{provide:K,useExisting:c((()=>eH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:7,vars:3,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fields-label"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"value"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["translate","",1,"fixed-title-width"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","username",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","password","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.security"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"tb-toggle-select",3),t.ɵɵtemplate(5,Xj,3,4,"tb-toggle-option",4),t.ɵɵelementEnd()(),t.ɵɵtemplate(6,Jj,19,10,"ng-container",5),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.securityTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value===n.BrokerSecurityType.BASIC))},dependencies:t.ɵɵgetComponentDepsFactory(eH,[_,j]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block;margin-bottom:10px}[_nghost-%COMP%] .fields-label[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .hide-toggle[_ngcontent-%COMP%]{display:none}'],changeDetection:d.OnPush})}}e("RestConnectorSecurityComponent",eH);const tH=e=>({type:e});function nH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bACnetRequestTypesTranslates.get(e))," ")}}function iH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bACnetObjectTypesTranslates.get(e))," ")}}function aH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",9),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",10)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",11),t.ɵɵtemplate(10,nH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field")(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",13),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",14)(17,"mat-form-field",15)(18,"mat-label"),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-select",16),t.ɵɵtemplate(22,iH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",17),t.ɵɵelementEnd()(),t.ɵɵelementStart(28,"mat-form-field",10)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",18),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,8,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,10,"gateway.rpc.requestType")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bACnetRequestTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,12,"gateway.rpc.requestTimeout")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,14,"gateway.rpc.objectType")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bACnetObjectTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,16,"gateway.rpc.identifier")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,18,"gateway.rpc.propertyId"))}}function rH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bLEMethodsTranslates.get(e))," ")}}function oH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",20),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",21),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-form-field",10)(11,"mat-label"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-select",22),t.ɵɵtemplate(15,rH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"mat-slide-toggle",23),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,5,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,7,"gateway.rpc.characteristicUUID")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,9,"gateway.rpc.methodProcessing")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bLEMethods),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,11,"gateway.rpc.withResponse")," ")}}function sH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e)," ")}}function lH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",24),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",25),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",26),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-slide-toggle",27),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-slide-toggle",28),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",14)(20,"mat-form-field",15)(21,"mat-label"),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",29),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",15)(26,"mat-label"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-select",30),t.ɵɵtemplate(30,sH,3,4,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(31,"div",14)(32,"mat-form-field",15)(33,"mat-label"),t.ɵɵtext(34),t.ɵɵpipe(35,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(36,"input",31),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",15)(38,"mat-label"),t.ɵɵtext(39),t.ɵɵpipe(40,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(41,"input",32),t.ɵɵelementEnd()(),t.ɵɵelementStart(42,"mat-form-field")(43,"mat-label"),t.ɵɵtext(44),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(46,"input",33),t.ɵɵelementEnd(),t.ɵɵelementStart(47,"mat-form-field")(48,"mat-label"),t.ɵɵtext(49),t.ɵɵpipe(50,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(51,"input",34),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,12,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,14,"gateway.rpc.nodeID")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,16,"gateway.rpc.isExtendedID")," "),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,18,"gateway.rpc.isFD")," "),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,20,"gateway.rpc.bitrateSwitch")," "),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(23,22,"gateway.rpc.dataLength")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,24,"gateway.rpc.dataByteorder")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.cANByteOrders),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(35,26,"gateway.rpc.dataBefore")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(40,28,"gateway.rpc.dataAfter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(45,30,"gateway.rpc.dataInHEX")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(50,32,"gateway.rpc.dataExpression"))}}function pH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",35),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,2,"gateway.rpc.methodFilter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,4,"gateway.rpc.valueExpression")))}function cH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",37),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",38),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,5,"gateway.rpc.valueExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.rpc.withResponse")," "))}function dH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",37),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",38),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,5,"gateway.rpc.valueExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.rpc.withResponse")," "))}function uH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SNMPMethodsTranslations.get(e))," ")}}function mH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",45)(1,"mat-form-field",46),t.ɵɵelement(2,"input",47),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-icon",48),t.ɵɵpipe(4,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(3);return t.ɵɵresetView(i.removeSNMPoid(n))})),t.ɵɵtext(5,"delete "),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵproperty("formControl",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(4,2,"gateway.rpc.remove"))}}function hH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",39),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",10)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",40),t.ɵɵtemplate(10,uH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-slide-toggle",38),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"fieldset",41)(15,"span",42),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(18,mH,6,4,"div",43),t.ɵɵelementStart(19,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addSNMPoid())})),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,7,"gateway.rpc.requestFilter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,9,"gateway.rpc.method")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sNMPMethods),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,11,"gateway.rpc.withResponse")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(17,13,"gateway.rpc.oids"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",e.getFormArrayControls("oid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(21,15,"gateway.rpc.add-oid")," ")}}function gH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function fH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",59),t.ɵɵelementContainerStart(1,63),t.ɵɵelementStart(2,"mat-form-field",64),t.ɵɵelement(3,"input",65),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",64),t.ɵɵelement(5,"input",66),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-icon",67),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(4);return t.ɵɵresetView(i.removeHTTPHeader(n))})),t.ɵɵtext(8,"delete "),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()}if(2&e){const e=n.index;t.ɵɵadvance(),t.ɵɵproperty("formGroupName",e),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,2,"gateway.rpc.remove"))}}function yH(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",58)(1,"div",59)(2,"span",60),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"span",60),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"span",61),t.ɵɵelementEnd(),t.ɵɵelement(9,"mat-divider"),t.ɵɵtemplate(10,fH,9,4,"div",62),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.header-name")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,5,"gateway.rpc.value")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.getFormArrayControls("httpHeaders"))}}function vH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",49),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",14)(6,"mat-form-field",50)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",51),t.ɵɵtemplate(11,gH,2,2,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",15)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",52),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",14)(18,"mat-form-field",15)(19,"mat-label"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(22,"input",53),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",54),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",15)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",55),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"mat-form-field")(34,"mat-label"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"fieldset",56)(39,"span",42),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(42,yH,11,7,"div",57),t.ɵɵelementStart(43,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addHTTPHeader())})),t.ɵɵtext(44),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,11,"gateway.rpc.methodFilter")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,13,"gateway.rpc.httpMethod")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.hTTPMethods),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,15,"gateway.rpc.requestUrlExpression")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(21,17,"gateway.rpc.responseTimeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,19,"gateway.rpc.timeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,21,"gateway.rpc.tries")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,23,"gateway.rpc.valueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,25,"gateway.rpc.httpHeaders")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.getFormArrayControls("httpHeaders").length),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(45,27,"gateway.rpc.add-header")," ")}}function xH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function bH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",59),t.ɵɵelementContainerStart(1,63),t.ɵɵelementStart(2,"mat-form-field",64),t.ɵɵelement(3,"input",73),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",64),t.ɵɵelement(6,"input",74),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-icon",67),t.ɵɵpipe(8,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(4);return t.ɵɵresetView(i.removeHTTPHeader(n))})),t.ɵɵtext(9,"delete "),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()}if(2&e){const e=n.index;t.ɵɵadvance(),t.ɵɵproperty("formGroupName",e),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(4,3,"gateway.rpc.set")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,5,"gateway.rpc.remove"))}}function wH(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",58)(1,"div",59)(2,"span",60),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"span",60),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"span",61),t.ɵɵelementEnd(),t.ɵɵelement(9,"mat-divider"),t.ɵɵtemplate(10,bH,10,7,"div",62),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.header-name")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,5,"gateway.rpc.value")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.getFormArrayControls("httpHeaders"))}}function SH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",68),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",59)(6,"mat-form-field",50)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",51),t.ɵɵtemplate(11,xH,2,2,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",15)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",52),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",59)(18,"mat-form-field",15)(19,"mat-label"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(22,"input",53),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",69),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",15)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",70),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"mat-form-field")(34,"mat-label"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",71),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"mat-form-field")(39,"mat-label"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(42,"input",72),t.ɵɵelementEnd(),t.ɵɵelementStart(43,"fieldset",56)(44,"span",42),t.ɵɵtext(45),t.ɵɵpipe(46,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(47,wH,11,7,"div",57),t.ɵɵelementStart(48,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addHTTPHeader())})),t.ɵɵtext(49),t.ɵɵpipe(50,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,12,"gateway.rpc.methodFilter")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,14,"gateway.rpc.httpMethod")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.hTTPMethods),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,16,"gateway.rpc.requestUrlExpression")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(21,18,"gateway.rpc.responseTimeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,20,"gateway.rpc.timeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,22,"gateway.rpc.tries")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,24,"gateway.rpc.requestValueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,26,"gateway.rpc.responseValueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(46,28,"gateway.rpc.httpHeaders")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.getFormArrayControls("httpHeaders").length),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(50,30,"gateway.rpc.add-header")," ")}}function CH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.json-value-invalid")," "))}function _H(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",75),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",76),t.ɵɵelementStart(10,"mat-icon",77),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext(2);return t.ɵɵresetView(i.openEditJSONDialog(n))})),t.ɵɵtext(12,"edit "),t.ɵɵelementEnd(),t.ɵɵtemplate(13,CH,3,3,"mat-error",78),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,4,"gateway.statistics.command")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,6,"widget-config.datasource-parameters")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,8,"gateway.rpc-command-edit-params")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.commandForm.get("params").hasError("invalidJSON"))}}function TH(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,6),t.ɵɵtemplate(1,aH,33,20,"ng-template",7)(2,oH,19,13,"ng-template",7)(3,lH,52,34,"ng-template",7)(4,pH,10,6,"ng-template",7)(5,cH,13,9,"ng-template",7)(6,dH,13,9,"ng-template",7)(7,hH,22,17,"ng-template",7)(8,vH,46,29,"ng-template",7)(9,SH,51,32,"ng-template",7)(10,_H,14,10,"ng-template",8),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("ngSwitch",e.connectorType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.CAN),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.FTP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OCPP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.XMPP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SNMP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REQUEST)}}class IH{constructor(e,t){this.fb=e,this.dialog=t,this.sendCommand=new u,this.saveTemplate=new u,this.ConnectorType=ct,this.bACnetRequestTypes=Object.values(gj),this.bACnetObjectTypes=Object.values(yj),this.bLEMethods=Object.values(xj),this.cANByteOrders=Object.values(wj),this.sNMPMethods=Object.values(_j),this.hTTPMethods=Object.values(ht),this.bACnetRequestTypesTranslates=fj,this.bACnetObjectTypesTranslates=vj,this.bLEMethodsTranslates=bj,this.SNMPMethodsTranslations=Tj,this.gatewayConnectorDefaultTypesTranslates=dt,this.urlPattern=/^[-a-zA-Zd_$:{}?~+=\/.0-9-]*$/,this.numbersOnlyPattern=/^[0-9]*$/,this.hexOnlyPattern=/^[0-9A-Fa-f ]+$/,this.propagateChange=e=>{},this.destroy$=new te}ngOnInit(){this.commandForm=this.connectorParamsFormGroupByType(this.connectorType),this.observeFormChanges()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}connectorParamsFormGroupByType(e){let t;switch(e){case ct.BACNET:t=this.fb.group({method:[null,[$.required,$.pattern(an)]],requestType:[null,[$.required,$.pattern(an)]],requestTimeout:[null,[$.required,$.min(10),$.pattern(this.numbersOnlyPattern)]],objectType:[null,[]],identifier:[null,[$.required,$.min(1),$.pattern(this.numbersOnlyPattern)]],propertyId:[null,[$.required,$.pattern(an)]]});break;case ct.BLE:t=this.fb.group({methodRPC:[null,[$.required,$.pattern(an)]],characteristicUUID:["00002A00-0000-1000-8000-00805F9B34FB",[$.required,$.pattern(an)]],methodProcessing:[null,[$.required]],withResponse:[!1,[]]});break;case ct.CAN:t=this.fb.group({method:[null,[$.required,$.pattern(an)]],nodeID:[null,[$.required,$.min(0),$.pattern(this.numbersOnlyPattern)]],isExtendedID:[!1,[]],isFD:[!1,[]],bitrateSwitch:[!1,[]],dataLength:[null,[$.min(1),$.pattern(this.numbersOnlyPattern)]],dataByteorder:[null,[]],dataBefore:[null,[$.pattern(an),$.pattern(this.hexOnlyPattern)]],dataAfter:[null,[$.pattern(an),$.pattern(this.hexOnlyPattern)]],dataInHEX:[null,[$.pattern(an),$.pattern(this.hexOnlyPattern)]],dataExpression:[null,[$.pattern(an)]]});break;case ct.FTP:t=this.fb.group({methodFilter:[null,[$.required,$.pattern(an)]],valueExpression:[null,[$.required,$.pattern(an)]]});break;case ct.OCPP:case ct.XMPP:t=this.fb.group({methodRPC:[null,[$.required,$.pattern(an)]],valueExpression:[null,[$.required,$.pattern(an)]],withResponse:[!1,[]]});break;case ct.SNMP:t=this.fb.group({requestFilter:[null,[$.required,$.pattern(an)]],method:[null,[$.required]],withResponse:[!1,[]],oid:this.fb.array([],[$.required])});break;case ct.REST:t=this.fb.group({methodFilter:[null,[$.required,$.pattern(an)]],httpMethod:[null,[$.required]],requestUrlExpression:[null,[$.required,$.pattern(this.urlPattern)]],responseTimeout:[null,[$.required,$.min(10),$.pattern(this.numbersOnlyPattern)]],timeout:[null,[$.required,$.min(10),$.pattern(this.numbersOnlyPattern)]],tries:[null,[$.required,$.min(1),$.pattern(this.numbersOnlyPattern)]],valueExpression:[null,[$.required,$.pattern(an)]],httpHeaders:this.fb.array([]),security:[{},[$.required]]});break;case ct.REQUEST:t=this.fb.group({methodFilter:[null,[$.required,$.pattern(an)]],httpMethod:[null,[$.required]],requestUrlExpression:[null,[$.required,$.pattern(this.urlPattern)]],responseTimeout:[null,[$.required,$.min(10),$.pattern(this.numbersOnlyPattern)]],timeout:[null,[$.required,$.min(10),$.pattern(this.numbersOnlyPattern)]],tries:[null,[$.required,$.min(1),$.pattern(this.numbersOnlyPattern)]],requestValueExpression:[null,[$.required,$.pattern(an)]],responseValueExpression:[null,[$.pattern(an)]],httpHeaders:this.fb.array([])});break;default:t=this.fb.group({command:[null,[$.required,$.pattern(an)]],params:[{},[st]]})}return t}addSNMPoid(e=null){const t=this.commandForm.get("oid");t&&t.push(this.fb.control(e,[$.required,$.pattern(an)]),{emitEvent:!1})}removeSNMPoid(e){this.commandForm.get("oid").removeAt(e)}addHTTPHeader(e={headerName:null,value:null}){const t=this.commandForm.get("httpHeaders"),n=this.fb.group({headerName:[e.headerName,[$.required,$.pattern(an)]],value:[e.value,[$.required,$.pattern(an)]]});t&&t.push(n,{emitEvent:!1})}removeHTTPHeader(e){this.commandForm.get("httpHeaders").removeAt(e)}getFormArrayControls(e){return this.commandForm.get(e).controls}openEditJSONDialog(e){e&&e.stopPropagation(),this.dialog.open(tt,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{jsonValue:this.commandForm.get("params").value,required:!0}}).afterClosed().subscribe((e=>{e&&this.commandForm.get("params").setValue(e)}))}save(){this.saveTemplate.emit()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}clearFromArrayByName(e){const t=this.commandForm.get(e);for(;0!==t.length;)t.removeAt(0)}writeValue(e){if("object"==typeof e){switch(e=Oe(e),this.connectorType){case ct.SNMP:this.clearFromArrayByName("oid"),e.oid.forEach((e=>{this.addSNMPoid(e)})),delete e.oid;break;case ct.REQUEST:case ct.REST:this.clearFromArrayByName("httpHeaders"),e.httpHeaders&&Object.entries(e.httpHeaders).forEach((e=>{this.addHTTPHeader({headerName:e[0],value:e[1]})})),delete e.httpHeaders}this.commandForm.patchValue(e,{onlySelf:!1})}}observeFormChanges(){this.commandForm.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.connectorType!==ct.REST&&this.connectorType!==ct.REQUEST||(e.httpHeaders=e.httpHeaders.reduce(((e,t)=>(e[t.headerName]=t.value,e)),{})),this.commandForm.valid&&this.propagateChange({...this.commandForm.value,...e})}))}static{this.ɵfac=function(e){return new(e||IH)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(qe.MatDialog))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:IH,selectors:[["tb-gateway-service-rpc-connector"]],inputs:{connectorType:"connectorType"},outputs:{sendCommand:"sendCommand",saveTemplate:"saveTemplate"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>IH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:12,vars:16,consts:[[1,"command-form","flex","flex-col",3,"formGroup"],[1,"mat-subtitle-1","title"],[3,"ngIf"],[1,"template-actions","flex","flex-row","justify-end","gap-2.5"],["mat-raised-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"ngSwitch"],[3,"ngSwitchCase"],["ngSwitchDefault",""],["matInput","","formControlName","method","placeholder","set_state"],[1,"mat-block"],["formControlName","requestType"],[3,"value",4,"ngFor","ngForOf"],["matInput","","formControlName","requestTimeout","type","number","min","10","step","1","placeholder","1000"],[1,"flex","flex-1","flex-row","gap-2.5"],[1,"flex-1"],["formControlName","objectType"],["matInput","","formControlName","identifier","type","number","min","1","step","1","placeholder","1"],["matInput","","formControlName","propertyId","placeholder","presentValue"],[3,"value"],["matInput","","formControlName","methodRPC","placeholder","rpcMethod1"],["matInput","","formControlName","characteristicUUID","placeholder","00002A00-0000-1000-8000-00805F9B34FB"],["formControlName","methodProcessing"],["formControlName","withResponse",1,"mat-slide"],["matInput","","formControlName","method","placeholder","sendSameData"],["matInput","","formControlName","nodeID","type","number","placeholder","4","min","0","step","1"],["formControlName","isExtendedID",1,"mat-slide","margin"],["formControlName","isFD",1,"mat-slide","margin"],["formControlName","bitrateSwitch",1,"mat-slide","margin"],["matInput","","formControlName","dataLength","type","number","placeholder","2","min","1","step","1"],["formControlName","dataByteorder"],["matInput","","formControlName","dataBefore","placeholder","00AA"],["matInput","","formControlName","dataAfter","placeholder","0102"],["matInput","","formControlName","dataInHEX","placeholder","aa bb cc dd ee ff aa bb aa bb cc d ee ff"],["matInput","","formControlName","dataExpression","placeholder","userSpeed if maxAllowedSpeed > userSpeed else maxAllowedSpeed"],["matInput","","formControlName","methodFilter","placeholder","read"],["matInput","","formControlName","valueExpression","placeholder","${params}"],["matInput","","formControlName","methodRPC","placeholder","rpc1"],["formControlName","withResponse",1,"mat-slide","margin"],["matInput","","formControlName","requestFilter","placeholder","setData"],["formControlName","method"],["formArrayName","oid",1,"fields","flex","flex-col","gap-2.5","border"],[1,"fields-label"],["class","flex flex-1 flex-row items-center justify-center gap-2.5",4,"ngFor","ngForOf"],["mat-raised-button","",1,"self-start",3,"click"],[1,"flex","flex-1","flex-row","items-center","justify-center","gap-2.5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","flex-1"],["matInput","","required","",3,"formControl"],[1,"flex-[1_1_30px]",2,"cursor","pointer","max-width","30px","min-width","30px",3,"click","matTooltip"],["matInput","","formControlName","methodFilter","placeholder","post_attributes"],[1,"max-w-4/12","flex-[1_1_33%]"],["formControlName","httpMethod"],["matInput","","formControlName","requestUrlExpression","placeholder","http://127.0.0.1:5000/my_devices"],["matInput","","formControlName","responseTimeout","type","number","step","1","min","10","placeholder","10"],["matInput","","formControlName","timeout","type","number","step","1","min","10","placeholder","1000"],["matInput","","formControlName","tries","type","number","step","1","min","1","placeholder","3"],["formArrayName","httpHeaders",1,"fields","flex","flex-col","gap-2.5","border"],["class","flex flex-col gap-2.5 border",4,"ngIf"],[1,"flex","flex-col","gap-2.5","border"],[1,"flex","flex-row","items-center","justify-center","gap-2.5"],[1,"title","flex-1"],[2,"width","30px"],["class","flex flex-row items-center justify-center gap-2.5",4,"ngFor","ngForOf"],[3,"formGroupName"],["appearance","outline",1,"flex-1"],["matInput","","formControlName","headerName"],["matInput","","formControlName","value","placeholder","application/json"],[2,"cursor","pointer","width","30px",3,"click","matTooltip"],["matInput","","formControlName","methodFilter","placeholder","echo"],["matInput","","formControlName","timeout","type","number","step","1","min","10","placeholder","10"],["matInput","","formControlName","tries","type","number","step","1","min","1","placeholder","1"],["matInput","","formControlName","requestValueExpression","placeholder","${params}"],["matInput","","formControlName","responseValueExpression","placeholder","${temp}"],["matInput","","formControlName","headerName",3,"placeholder"],["matInput","","formControlName","value"],["matInput","","formControlName","command"],["matInput","","formControlName","params","type","JSON","tb-json-to-string",""],["aria-hidden","false","aria-label","help-icon","matIconSuffix","",1,"material-icons-outlined",2,"cursor","pointer",3,"click","matTooltip"],[4,"ngIf"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(4,TH,11,10,"ng-template",2),t.ɵɵelementStart(5,"div",3)(6,"button",4),t.ɵɵlistener("click",(function(){return n.save()})),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",5),t.ɵɵlistener("click",(function(){return n.sendCommand.emit()})),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(3,7,"gateway.rpc.title",t.ɵɵpureFunction1(14,tH,n.gatewayConnectorDefaultTypesTranslates.get(n.connectorType)))),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorType),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,10,"gateway.rpc-command-save-template")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,12,"gateway.rpc-command-send")," "))},dependencies:t.ɵɵgetComponentDepsFactory(IH,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;padding:0}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%]{flex-wrap:nowrap}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] .mat-mdc-slide-toggle.margin[_ngcontent-%COMP%]{margin-bottom:10px;margin-left:10px}[_nghost-%COMP%] .fields[_ngcontent-%COMP%] .fields-label[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .border[_ngcontent-%COMP%]{padding:16px;margin-bottom:10px;box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{color:#0000008a}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{color:#00000061}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .mat-divider[_ngcontent-%COMP%]{margin-left:-16px;margin-right:-16px;margin-bottom:16px}']})}}function EH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",11),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function MH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",11),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ModbusFunctionCodeTranslationsMap.get(e)))}}function kH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",12),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function PH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",12),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function DH(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",13)(1,"mat-form-field",3)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",14),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,PH,3,3,"mat-icon",8),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.value")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.rpcParametersFormGroup.get("value").hasError("required")&&e.rpcParametersFormGroup.get("value").touched)}}class OH{constructor(e){this.fb=e,this.ModbusEditableDataTypes=$t,this.ModbusFunctionCodeTranslationsMap=Zt,this.modbusDataTypes=Object.values(Wt),this.writeFunctionCodes=[5,6,15,16],this.defaultFunctionCodes=[3,4,6,16],this.readFunctionCodes=[1,2,3,4],this.bitsFunctionCodes=[...this.readFunctionCodes,...this.writeFunctionCodes],this.destroy$=new te,this.rpcParametersFormGroup=this.fb.group({type:[Wt.BYTES,[$.required]],functionCode:[this.defaultFunctionCodes[0],[$.required]],value:[{value:"",disabled:!0},[$.required,$.pattern(an)]],address:[null,[$.required]],objectsCount:[1,[$.required]]}),this.updateFunctionCodes(this.rpcParametersFormGroup.get("type").value),this.observeValueChanges(),this.observeKeyDataType(),this.observeFunctionCode()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.rpcParametersFormGroup.patchValue(e,{emitEvent:!1})}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}observeKeyDataType(){this.rpcParametersFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.ModbusEditableDataTypes.includes(e)||this.rpcParametersFormGroup.get("objectsCount").patchValue(Kt[e],{emitEvent:!1}),this.updateFunctionCodes(e)}))}observeFunctionCode(){this.rpcParametersFormGroup.get("functionCode").valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateValueEnabling(e)))}updateValueEnabling(e){this.writeFunctionCodes.includes(e)?this.rpcParametersFormGroup.get("value").enable({emitEvent:!1}):(this.rpcParametersFormGroup.get("value").setValue(null),this.rpcParametersFormGroup.get("value").disable({emitEvent:!1}))}updateFunctionCodes(e){this.functionCodes=e===Wt.BITS?this.bitsFunctionCodes:this.defaultFunctionCodes,this.functionCodes.includes(this.rpcParametersFormGroup.get("functionCode").value)||this.rpcParametersFormGroup.get("functionCode").patchValue(this.functionCodes[0],{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||OH)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:OH,selectors:[["tb-gateway-modbus-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>OH)),multi:!0},{provide:K,useExisting:c((()=>OH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:35,vars:30,consts:[[3,"formGroup"],[1,"tb-form-hint","tb-primary-fill","no-padding-top","hint-container"],[1,"flex","flex-1","flex-row","gap-2.5"],[1,"flex-1"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["formControlName","functionCode"],["matInput","","type","number","min","0","max","50000","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","min","1","max","50000","name","value","formControlName","objectsCount",3,"placeholder","readonly"],["class","flex",4,"ngIf"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"flex"],["matInput","","name","value","formControlName","value",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelement(4,"br"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",2)(8,"mat-form-field",3)(9,"mat-label"),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-select",4),t.ɵɵtemplate(13,EH,2,2,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-form-field",3)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"mat-select",6),t.ɵɵtemplate(19,MH,3,4,"mat-option",5),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",2)(21,"mat-form-field",3)(22,"mat-label"),t.ɵɵtext(23),t.ɵɵpipe(24,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",7),t.ɵɵpipe(26,"translate"),t.ɵɵtemplate(27,kH,3,3,"mat-icon",8),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",3)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",9),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,DH,8,7,"div",10),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,14,"gateway.rpc.hint.modbus-response-reading"),""),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,16,"gateway.rpc.hint.modbus-writing-functions")," "),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(11,18,"gateway.rpc.type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.modbusDataTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(17,20,"gateway.rpc.functionCode")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.functionCodes),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(24,22,"gateway.rpc.address")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.rpcParametersFormGroup.get("address").hasError("required")&&n.rpcParametersFormGroup.get("address").touched),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,26,"gateway.rpc.objectsCount")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(33,28,"gateway.set")),t.ɵɵproperty("readonly",!n.ModbusEditableDataTypes.includes(n.rpcParametersFormGroup.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.writeFunctionCodes.includes(n.rpcParametersFormGroup.get("functionCode").value)))},dependencies:t.ɵɵgetComponentDepsFactory(OH,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{margin-bottom:12px}'],changeDetection:d.OnPush})}}function AH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",6),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rpc.responseTopicExpression")))}function FH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",7),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rpc.responseTimeout")))}class RH{constructor(e){this.fb=e,this.onChange=e=>{},this.onTouched=()=>{},this.destroy$=new te,this.rpcParametersFormGroup=this.fb.group({methodFilter:[null,[$.required,$.pattern(an)]],requestTopicExpression:[null,[$.required,$.pattern(an)]],responseTopicExpression:[{value:null,disabled:!0},[$.required,$.pattern(an)]],responseTimeout:[{value:null,disabled:!0},[$.min(10),$.pattern(rn)]],valueExpression:[null,[$.required,$.pattern(an)]],withResponse:[!1,[]]}),this.observeValueChanges(),this.observeWithResponse()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.rpcParametersFormGroup.patchValue(e,{emitEvent:!1}),this.toggleResponseFields(e.withResponse)}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}observeWithResponse(){this.rpcParametersFormGroup.get("withResponse").valueChanges.pipe(me((e=>this.toggleResponseFields(e))),le(this.destroy$)).subscribe()}toggleResponseFields(e){const t=this.rpcParametersFormGroup.get("responseTopicExpression"),n=this.rpcParametersFormGroup.get("responseTimeout");e?(t.enable(),n.enable()):(t.disable(),n.disable())}static{this.ɵfac=function(e){return new(e||RH)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:RH,selectors:[["tb-gateway-mqtt-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>RH)),multi:!0},{provide:K,useExisting:c((()=>RH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:21,vars:15,consts:[[3,"formGroup"],["matInput","","formControlName","methodFilter","placeholder","echo"],["matInput","","formControlName","requestTopicExpression","placeholder","sensor/${deviceName}/request/${methodName}/${requestId}"],["formControlName","withResponse",1,"margin",3,"click"],[4,"ngIf"],["matInput","","formControlName","valueExpression","placeholder","${params}"],["matInput","","formControlName","responseTopicExpression","placeholder","sensor/${deviceName}/response/${methodName}/${requestId}"],["matInput","","formControlName","responseTimeout","type","number","placeholder","10000","min","10","step","1"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",1),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field")(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",2),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-slide-toggle",3),t.ɵɵlistener("click",(function(e){return e.stopPropagation()})),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(14,AH,5,3,"mat-form-field",4)(15,FH,5,3,"mat-form-field",4),t.ɵɵelementStart(16,"mat-form-field")(17,"mat-label"),t.ɵɵtext(18),t.ɵɵpipe(19,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(20,"input",5),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){let e,i;t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,7,"gateway.rpc.method-name")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,9,"gateway.rpc.requestTopicExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,11,"gateway.rpc.withResponse")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==(e=n.rpcParametersFormGroup.get("withResponse"))?null:e.value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",null==(i=n.rpcParametersFormGroup.get("withResponse"))?null:i.value),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(19,13,"gateway.rpc.valueExpression"))}},dependencies:t.ɵɵgetComponentDepsFactory(RH,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .mat-mdc-slide-toggle.margin[_ngcontent-%COMP%]{margin-bottom:10px;margin-left:10px}'],changeDetection:d.OnPush})}}function BH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",26),t.ɵɵelement(1,"mat-icon",27),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",i.valueTypes.get(e).icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,i.valueTypes.get(e).name))}}function NH(e,n){1&e&&(t.ɵɵelement(0,"input",28),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function LH(e,n){1&e&&(t.ɵɵelement(0,"input",29),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function VH(e,n){1&e&&(t.ɵɵelement(0,"input",30),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function qH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-select",31)(1,"mat-option",26),t.ɵɵtext(2,"true"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-option",26),t.ɵɵtext(4,"false"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵproperty("value",!0),t.ɵɵadvance(2),t.ɵɵproperty("value",!1))}function GH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",32),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function zH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",8)(1,"div",9)(2,"div",10),t.ɵɵtext(3,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",11)(5,"mat-form-field",12)(6,"mat-select",13)(7,"mat-select-trigger")(8,"div",14),t.ɵɵelement(9,"mat-icon",15),t.ɵɵelementStart(10,"span"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(13,BH,5,5,"mat-option",16),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(14,"div",17)(15,"div",10),t.ɵɵtext(16,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-form-field",18),t.ɵɵelementContainerStart(18,19),t.ɵɵtemplate(19,NH,2,3,"input",20)(20,LH,2,3,"input",21)(21,VH,2,3,"input",22)(22,qH,5,2,"mat-select",23),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(23,GH,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"button",25),t.ɵɵpipe(25,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext();return t.ɵɵresetView(i.removeArgument(n))})),t.ɵɵelementStart(26,"mat-icon"),t.ɵɵtext(27,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext();t.ɵɵproperty("formGroup",a),t.ɵɵadvance(9),t.ɵɵproperty("svgIcon",null==(e=r.valueTypes.get(a.get("type").value))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,11,null==(i=r.valueTypes.get(a.get("type").value))?null:i.name)),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",r.valueTypeKeys),t.ɵɵadvance(5),t.ɵɵproperty("ngSwitch",a.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.STRING),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.INTEGER),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.DOUBLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.BOOLEAN),t.ɵɵadvance(),t.ɵɵproperty("ngIf",a.get(a.get("type").value+"Value").hasError("required")&&a.get(a.get("type").value+"Value").touched),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(25,13,"gateway.rpc.remove"))}}class UH{constructor(e,t){this.fb=e,this.cdr=t,this.valueTypeKeys=Object.values(Yt),this.MappingValueType=Yt,this.valueTypes=Xt,this.onChange=e=>{},this.onTouched=()=>{},this.destroy$=new te,this.rpcParametersFormGroup=this.fb.group({method:[null,[$.required,$.pattern(an)]],arguments:this.fb.array([])}),this.observeValueChanges()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.clearArguments(),e.arguments?.map((({type:e,value:t})=>({type:e,[e+"Value"]:t}))).forEach((e=>this.addArgument(e))),this.cdr.markForCheck(),this.rpcParametersFormGroup.get("method").patchValue(e.method)}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{const t=e.arguments.map((({type:e,...t})=>({type:e,value:t[e+"Value"]})));this.onChange({method:e.method,arguments:t}),this.onTouched()}))}removeArgument(e){this.rpcParametersFormGroup.get("arguments").removeAt(e)}addArgument(e={}){const t=this.fb.group({type:[e.type??Yt.STRING],stringValue:[e.stringValue??{value:"",disabled:!(Se(e,{})||e.stringValue)},[$.required,$.pattern(an)]],integerValue:[{value:e.integerValue??0,disabled:!ke(e.integerValue)},[$.required,$.pattern(rn)]],doubleValue:[{value:e.doubleValue??0,disabled:!ke(e.doubleValue)},[$.required]],booleanValue:[{value:e.booleanValue??!1,disabled:!ke(e.booleanValue)},[$.required]]});this.observeTypeChange(t),this.rpcParametersFormGroup.get("arguments").push(t,{emitEvent:!1})}clearArguments(){const e=this.rpcParametersFormGroup.get("arguments");for(;0!==e.length;)e.removeAt(0)}observeTypeChange(e){e.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((t=>{e.disable({emitEvent:!1}),e.get("type").enable({emitEvent:!1}),e.get(t+"Value").enable({emitEvent:!1})}))}static{this.ɵfac=function(e){return new(e||UH)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:UH,selectors:[["tb-gateway-opc-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>UH)),multi:!0},{provide:K,useExisting:c((()=>UH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:18,vars:14,consts:[[3,"formGroup"],[1,"tb-form-hint","tb-primary-fill","tb-flex","no-padding-top","hint-container"],[1,"tb-flex"],["matInput","","formControlName","method","placeholder","multiply"],["formArrayName","arguments",1,"tb-form-panel","stroked","arguments-container"],[1,"fields-label"],["class","flex flex-1 items-center justify-center gap-2.5",3,"formGroup",4,"ngFor","ngForOf"],["mat-raised-button","",1,"self-start",3,"click"],[1,"flex","flex-1","items-center","justify-center","gap-2.5",3,"formGroup"],[1,"tb-form-row","column-xs","type-container","items-center","justify-between"],["translate","",1,"tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[1,"tb-flex","align-center"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-row","column-xs","value-container","item-center","justify-between"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],[3,"ngSwitch"],["matInput","","required","","formControlName","stringValue",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder",4,"ngSwitchCase"],["formControlName","booleanValue",4,"ngSwitchCase"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["mat-icon-button","","matTooltipPosition","above",1,"tb-box-button",3,"click","matTooltip"],[3,"value"],[1,"tb-mat-20",3,"svgIcon"],["matInput","","required","","formControlName","stringValue",3,"placeholder"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder"],["formControlName","booleanValue"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",2)(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"input",3),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"fieldset",4)(10,"strong")(11,"span",5),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(14,zH,28,15,"div",6),t.ɵɵelementStart(15,"button",7),t.ɵɵlistener("click",(function(){return n.addArgument()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,6,"gateway.rpc.hint.opc-method")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,8,"gateway.rpc.method")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,10,"gateway.rpc.arguments")),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",n.rpcParametersFormGroup.get("arguments").controls),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,12,"gateway.rpc.add-argument")," "))},dependencies:t.ɵɵgetComponentDepsFactory(UH,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .arguments-container[_ngcontent-%COMP%]{margin-bottom:10px}[_nghost-%COMP%] .type-container[_ngcontent-%COMP%]{width:40%}[_nghost-%COMP%] .value-container[_ngcontent-%COMP%]{width:50%}[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{margin-bottom:12px}'],changeDetection:d.OnPush})}}function jH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SocketMethodProcessingsTranslates.get(e))," ")}}function HH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}class WH extends Ra{constructor(){super(...arguments),this.SocketMethodProcessingsTranslates=Cj,this.socketMethodProcessings=Object.values(Sj),this.socketEncoding=Object.values(mt)}initFormGroup(){return this.fb.group({methodRPC:[null,[$.required,$.pattern(an)]],methodProcessing:[Sj.WRITE,[$.required]],encoding:[Ij.UTF_8,[$.required,$.pattern(an)]],withResponse:[!1,[]]})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(WH)))(n||WH)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:WH,selectors:[["tb-gateway-socket-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>WH)),multi:!0},{provide:K,useExisting:c((()=>WH)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:21,vars:15,consts:[[3,"formGroup"],[1,"w-full"],["matInput","","formControlName","methodRPC","placeholder","rpcMethod1"],[1,"mat-block"],["formControlName","methodProcessing"],[3,"value",4,"ngFor","ngForOf"],["formControlName","encoding"],["formControlName","withResponse",1,"mat-slide","margin"],[3,"value"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"mat-form-field",1)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",2),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",3)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",4),t.ɵɵtemplate(11,jH,3,4,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",3)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-select",6),t.ɵɵtemplate(17,HH,2,2,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"mat-slide-toggle",7),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.formGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,7,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,9,"gateway.rpc.methodProcessing")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketMethodProcessings),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,11,"gateway.encoding")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(20,13,"gateway.rpc.withResponse")," "))},dependencies:t.ɵɵgetComponentDepsFactory(WH,[j,_]),encapsulation:2,changeDetection:d.OnPush})}}const $H=e=>({border:e}),KH=e=>({type:e});function YH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",15),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function XH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")," "))}function ZH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-select",9),t.ɵɵtemplate(6,YH,2,2,"mat-option",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"mat-form-field",11)(8,"mat-label"),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(11,"input",12),t.ɵɵtemplate(12,XH,3,3,"mat-error",13),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.sendCommand())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,6,"gateway.statistics.command")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.RPCCommands),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,8,"gateway.statistics.timeout")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.commandForm.get("time").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("disabled",e.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,10,"gateway.rpc-command-send")," ")}}function QH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-service-rpc-connector",17),t.ɵɵlistener("sendCommand",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.sendCommand())}))("saveTemplate",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.saveTemplate())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("connectorType",e.connectorType)}}function JH(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-modbus-rpc-parameters",24)}function eW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-mqtt-rpc-parameters",24)}function tW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-opc-rpc-parameters",24)}function nW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-socket-rpc-parameters",24)}function iW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",18)(1,"div",19),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(4,20),t.ɵɵtemplate(5,JH,1,0,"tb-gateway-modbus-rpc-parameters",21)(6,eW,1,0,"tb-gateway-mqtt-rpc-parameters",21)(7,tW,1,0,"tb-gateway-opc-rpc-parameters",21)(8,nW,1,0,"tb-gateway-socket-rpc-parameters",21),t.ɵɵelementContainerEnd(),t.ɵɵelementStart(9,"div",22)(10,"button",23),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.saveTemplate())})),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.sendCommand())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(3,10,"gateway.rpc.title",t.ɵɵpureFunction1(17,KH,e.gatewayConnectorDefaultTypesTranslates.get(e.connectorType)))),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",e.connectorType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MODBUS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MQTT),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OPCUA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SOCKET),t.ɵɵadvance(2),t.ɵɵproperty("disabled",e.commandForm.get("params").invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,13,"gateway.rpc-command-save-template")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",e.commandForm.get("params").invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,15,"gateway.rpc-command-send")," ")}}function aW(e,n){if(1&e&&t.ɵɵtemplate(0,QH,1,1,"tb-gateway-service-rpc-connector",16)(1,iW,16,19,"ng-template",null,1,t.ɵɵtemplateRefExtractor),2&e){const e=t.ɵɵreference(2),n=t.ɵɵnextContext();t.ɵɵproperty("ngIf",!n.typesWithUpdatedParams.has(n.connectorType))("ngIfElse",e)}}function rW(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",25)(1,"mat-icon",26),t.ɵɵtext(2,"schedule"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"span"),t.ɵɵtext(4),t.ɵɵpipe(5,"date"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(5,1,e.resultTime,"yyyy/MM/dd HH:mm:ss"))}}function oW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-service-rpc-connector-templates",27),t.ɵɵlistener("useTemplate",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.useTemplate(n))})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("rpcTemplates",e.templates)("ctx",e.ctx)("connectorType",e.connectorType)}}class sW{constructor(e,t,n,i,a){this.fb=e,this.dialog=t,this.utils=n,this.cd=i,this.attributeService=a,this.contentTypes=V,this.RPCCommands=["Ping","Stats","Devices","Update","Version","Restart","Reboot"],this.templates=[],this.ConnectorType=ct,this.gatewayConnectorDefaultTypesTranslates=dt,this.typesWithUpdatedParams=new Set([ct.MQTT,ct.OPCUA,ct.MODBUS,ct.SOCKET]),this.modbusReadFunctionCodes=[1,2,3,4],this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.updateTemplates()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)})),dataLoading:()=>{}}},this.commandForm=this.fb.group({command:[null,[$.required]],time:[60,[$.required,$.min(1)]],params:["{}",[st]],result:[null]})}ngOnInit(){if(this.isConnector=this.ctx.settings.isConnector,this.isConnector){this.connectorType=this.ctx.stateController.getStateParams().connector_rpc.value.type;const e=[{type:N.entity,entityType:L.DEVICE,entityId:this.ctx.defaultSubscription.targetDeviceId,entityName:"Connector",attributes:[{name:`${this.connectorType}_template`}]}];this.ctx.subscriptionApi.createSubscriptionFromInfo(R.latest,e,this.subscriptionOptions,!1,!0).subscribe((e=>{this.subscription=e}))}else this.commandForm.get("command").setValue(this.RPCCommands[0])}sendCommand(e){this.resultTime=null;const t=e||this.commandForm.value,n=this.isConnector?`${this.connectorType}_`:"gateway_",i=this.isConnector?this.getCommandFromParamsByType(t.params):t.command.toLowerCase(),a=this.ctx.stateController.getStateParams().connector_rpc?.value.configurationJson.id,r=a?{...t.params,connectorId:a}:t.params;this.ctx.controlApi.sendTwoWayCommand(n+i,r,t.time).subscribe({next:e=>{this.resultTime=(new Date).getTime(),this.commandForm.get("result").setValue(JSON.stringify(e))},error:e=>{this.resultTime=(new Date).getTime(),console.error(e),this.commandForm.get("result").setValue(JSON.stringify(e.error))}})}getCommandFromParamsByType(e){switch(this.connectorType){case ct.MQTT:case ct.FTP:case ct.SNMP:case ct.REST:case ct.REQUEST:return e.methodFilter;case ct.MODBUS:return this.modbusReadFunctionCodes.includes(e.functionCode)?"get":"set";case ct.BACNET:case ct.CAN:case ct.OPCUA:return e.method;case ct.BLE:case ct.OCPP:case ct.SOCKET:case ct.XMPP:return e.methodRPC;default:return e.command}}saveTemplate(){this.dialog.open(Yj,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{config:this.commandForm.value.params,templates:this.templates}}).afterClosed().subscribe((e=>{if(e){const t={name:e,config:this.commandForm.value.params,type:this.connectorType},n=this.templates,i=n.findIndex((e=>e.name==t.name));i>-1&&n.splice(i,1),n.push(t);const a=`${this.connectorType}_template`;this.attributeService.saveEntityAttributes({id:this.ctx.defaultSubscription.targetDeviceId,entityType:L.DEVICE},D.SERVER_SCOPE,[{key:a,value:n}]).subscribe((()=>{this.cd.detectChanges()}))}}))}useTemplate(e){this.commandForm.get("params").patchValue(e.config)}updateTemplates(){this.templates=this.subscription.data[0].data[0][1].length?JSON.parse(this.subscription.data[0].data[0][1]):[],this.cd.detectChanges()}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}static{this.ɵfac=function(e){return new(e||sW)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.UtilsService),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(_e.AttributeService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:sW,selectors:[["tb-gateway-service-rpc"]],inputs:{ctx:"ctx",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:12,vars:14,consts:[["connectorForm",""],["updatedParameters",""],[1,"flex","flex-1","flex-col"],[1,"command-form","flex","flex-row","gap-2.5","lt-sm:flex-col",3,"formGroup"],[4,"ngIf","ngIfElse"],[1,"result-block",3,"formGroup"],["class","result-time flex flex-1 flex-row items-center justify-center",4,"ngIf"],["readonly","true","formControlName","result",3,"contentType"],["class","border",3,"rpcTemplates","ctx","connectorType","useTemplate",4,"ngIf"],["formControlName","command"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-1"],["matInput","","formControlName","time","type","number","min","1"],[4,"ngIf"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["formControlName","params",3,"connectorType","sendCommand","saveTemplate",4,"ngIf","ngIfElse"],["formControlName","params",3,"sendCommand","saveTemplate","connectorType"],[1,"rpc-parameters","flex","flex-col"],[1,"mat-subtitle-1","tb-form-panel-title"],[3,"ngSwitch"],["formControlName","params",4,"ngSwitchCase"],[1,"fex-row","template-actions","flex","flex-1","items-center","justify-end","gap-2.5"],["mat-raised-button","",3,"click","disabled"],["formControlName","params"],[1,"result-time","flex","flex-1","flex-row","items-center","justify-center"],[1,"material-icons"],[1,"border",3,"useTemplate","rpcTemplates","ctx","connectorType"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",2)(1,"div",3),t.ɵɵtemplate(2,ZH,16,12,"ng-container",4)(3,aW,3,2,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"section",5)(6,"span"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,rW,6,4,"div",6),t.ɵɵelementEnd(),t.ɵɵelement(10,"tb-json-content",7),t.ɵɵelementEnd()(),t.ɵɵtemplate(11,oW,1,3,"tb-gateway-service-rpc-connector-templates",8)),2&e){const e=t.ɵɵreference(4);t.ɵɵclassMap(t.ɵɵpureFunction1(12,$H,n.isConnector)),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.isConnector)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(8,10,"gateway.rpc-command-result")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.resultTime),t.ɵɵadvance(),t.ɵɵproperty("contentType",n.contentTypes.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isConnector)}},dependencies:t.ɵɵgetComponentDepsFactory(sW,[j,_,IH,OH,RH,UH,Wj,WH]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;overflow:auto;display:flex;flex-direction:row;padding:0 5px}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{height:100%;overflow:auto}[_nghost-%COMP%] > tb-gateway-service-rpc-connector-templates[_ngcontent-%COMP%]:last-child{margin-left:10px}[_nghost-%COMP%] tb-gateway-service-rpc-connector-templates[_ngcontent-%COMP%]{flex:1 1 30%;max-width:30%}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%]{flex-wrap:nowrap;padding:0 5px 5px}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] .rpc-parameters[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%]{padding:0 5px;display:flex;flex-direction:column;flex:1}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-weight:600;position:relative;font-size:14px;margin-bottom:10px}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .result-time[_ngcontent-%COMP%]{font-weight:400;font-size:14px;line-height:32px;position:absolute;left:0;top:25px;z-index:5;color:#0000008a}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .result-time[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding-left:10px}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] tb-json-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .border[_ngcontent-%COMP%]{padding:16px;box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}']})}}function lW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.configuration-delete-dialog-input-required")," "))}e("GatewayServiceRPCComponent",sW);class pW extends A{constructor(e,t,n,i,a){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.gatewayName=this.data.gatewayName,this.gatewayControl=this.fb.control("")}close(){this.dialogRef.close()}turnOff(){this.dialogRef.close(!0)}static{this.ɵfac=function(e){return new(e||pW)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:pW,selectors:[["tb-gateway-remote-configuration-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:24,vars:14,consts:[["color","warn"],["translate",""],[1,"flex-1"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"mat-content","flex-col",2,"max-width","600px"],[3,"innerHTML"],[1,"mat-block","tb-value-type",2,"flex-grow","0"],["matInput","","required","",3,"formControl"],[4,"ngIf"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","warn","type","button","cdkFocusInitial","",3,"click"],["mat-button","","color","warn","type","button",3,"click","disabled"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-toolbar",0)(1,"mat-icon"),t.ɵɵtext(2,"warning"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"h2",1),t.ɵɵtext(4,"gateway.configuration-delete-dialog-header"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2),t.ɵɵelementStart(6,"button",3),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵelementStart(7,"mat-icon",4),t.ɵɵtext(8,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",5),t.ɵɵelement(10,"span",6),t.ɵɵpipe(11,"translate"),t.ɵɵelementStart(12,"mat-form-field",7)(13,"mat-label",1),t.ɵɵtext(14,"gateway.configuration-delete-dialog-input"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",8),t.ɵɵtemplate(16,lW,3,3,"mat-error",9),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",10)(18,"button",11),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",12),t.ɵɵlistener("click",(function(){return n.turnOff()})),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(10),t.ɵɵpropertyInterpolate2("innerHTML","",t.ɵɵpipeBind1(11,8,"gateway.configuration-delete-dialog-body")," ",n.gatewayName,"",t.ɵɵsanitizeHtml),t.ɵɵadvance(5),t.ɵɵproperty("formControl",n.gatewayControl),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayControl.hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(20,10,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.gatewayControl.value!==n.gatewayName),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,12,"gateway.configuration-delete-dialog-confirm")," "))},dependencies:t.ɵɵgetComponentDepsFactory(pW,[j,_]),encapsulation:2})}}var cW;e("GatewayRemoteConfigurationDialogComponent",pW),function(e){e.tls="tls",e.accessToken="accessToken"}(cW||(cW={}));const dW="configuration_drafts",uW="RemoteLoggingLevel",mW=new Map([[cW.tls,"gateway.security-types.tls"],[cW.accessToken,"gateway.security-types.access-token"]]);var hW,gW;!function(e){e.none="NONE",e.critical="CRITICAL",e.error="ERROR",e.warning="WARNING",e.info="INFO",e.debug="DEBUG"}(hW||(hW={})),function(e){e.memory="memory",e.file="file"}(gW||(gW={}));const fW=new Map([[gW.memory,"gateway.storage-types.memory-storage"],[gW.file,"gateway.storage-types.file-storage"]]);var yW;!function(e){e.mqtt="MQTT",e.modbus="Modbus",e.opcua="OPC-UA",e.ble="BLE",e.request="Request",e.can="CAN",e.bacnet="BACnet",e.custom="Custom"}(yW||(yW={}));const vW={config:{},name:"",configType:null,enabled:!1};function xW(e){return JSON.stringify(e.value)===JSON.stringify({})?{validJSON:!0}:null}function bW(e){return e.replace("_","").replace("-","").replace(/^\s+|\s+/g,"").toLowerCase()+".json"}function wW(e,t){return'[loggers]}}keys=root, service, connector, converter, tb_connection, storage, extension}}[handlers]}}keys=consoleHandler, serviceHandler, connectorHandler, converterHandler, tb_connectionHandler, storageHandler, extensionHandler}}[formatters]}}keys=LogFormatter}}[logger_root]}}level=ERROR}}handlers=consoleHandler}}[logger_connector]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=connector}}[logger_storage]}}level={ERROR}}}handlers=storageHandler}}formatter=LogFormatter}}qualname=storage}}[logger_tb_connection]}}level={ERROR}}}handlers=tb_connectionHandler}}formatter=LogFormatter}}qualname=tb_connection}}[logger_service]}}level={ERROR}}}handlers=serviceHandler}}formatter=LogFormatter}}qualname=service}}[logger_converter]}}level={ERROR}}}handlers=converterHandler}}formatter=LogFormatter}}qualname=converter}}[logger_extension]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=extension}}[handler_consoleHandler]}}class=StreamHandler}}level={ERROR}}}formatter=LogFormatter}}args=(sys.stdout,)}}[handler_connectorHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}connector.log", "d", 1, 7,)}}[handler_storageHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}storage.log", "d", 1, 7,)}}[handler_serviceHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}service.log", "d", 1, 7,)}}[handler_converterHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}converter.log", "d", 1, 3,)}}[handler_extensionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}extension.log", "d", 1, 3,)}}[handler_tb_connectionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}tb_connection.log", "d", 1, 3,)}}[formatter_LogFormatter]}}format="%(asctime)s - %(levelname)s - [%(filename)s] - %(module)s - %(lineno)d - %(message)s" }}datefmt="%Y-%m-%d %H:%M:%S"'.replace(/{ERROR}/g,e).replace(/{.\/logs\/}/g,t)}function SW(e){return{id:e,entityType:L.DEVICE}}function CW(e){const t={};return Object.prototype.hasOwnProperty.call(e,"thingsboard")&&(t.host=e.thingsboard.host,t.port=e.thingsboard.port,t.remoteConfiguration=e.thingsboard.remoteConfiguration,Object.prototype.hasOwnProperty.call(e.thingsboard.security,cW.accessToken)?(t.securityType=cW.accessToken,t.accessToken=e.thingsboard.security.accessToken):(t.securityType=cW.tls,t.caCertPath=e.thingsboard.security.caCert,t.privateKeyPath=e.thingsboard.security.privateKey,t.certPath=e.thingsboard.security.cert)),Object.prototype.hasOwnProperty.call(e,"storage")&&Object.prototype.hasOwnProperty.call(e.storage,"type")&&(e.storage.type===gW.memory?(t.storageType=gW.memory,t.readRecordsCount=e.storage.read_records_count,t.maxRecordsCount=e.storage.max_records_count):e.storage.type===gW.file&&(t.storageType=gW.file,t.dataFolderPath=e.storage.data_folder_path,t.maxFilesCount=e.storage.max_file_count,t.readRecordsCount=e.storage.read_records_count,t.maxRecordsCount=e.storage.max_records_count)),t}function _W(e){const t={};for(const n of e)n.enabled||(t[n.name]={connector:n.configType,config:n.config});return t}function TW(e){const t={thingsboard:IW(e)};return function(e,t){for(const n of t)if(n.enabled){const t=n.configType;Array.isArray(e[t])||(e[t]=[]);const i={name:n.name,config:n.config};e[t].push(i)}}(t,e.connectors),t}function IW(e){let t;t=e.securityType===cW.accessToken?{accessToken:e.accessToken}:{caCert:e.caCertPath,privateKey:e.privateKeyPath,cert:e.certPath};const n={host:e.host,remoteConfiguration:e.remoteConfiguration,port:e.port,security:t};let i;i=e.storageType===gW.memory?{type:gW.memory,read_records_count:e.readRecordsCount,max_records_count:e.maxRecordsCount}:{type:gW.file,data_folder_path:e.dataFolderPath,max_file_count:e.maxFilesCount,max_read_records_count:e.readRecordsCount,max_records_per_file:e.maxRecordsCount};const a=[];for(const t of e.connectors)if(t.enabled){const e={configuration:bW(t.name),name:t.name,type:t.configType};a.push(e)}return{thingsboard:n,connectors:a,storage:i,logs:window.btoa(wW(e.remoteLoggingLevel,e.remoteLoggingPathToLogs))}}const EW=["formContainer"],MW=(e,t,n)=>({"gap-1.25":e,"flex-row":t,"flex-col":n}),kW=(e,t,n)=>({"gap-1.25":e,"flex-row justify-end item-center":t,"flex-col justify-evenly item-center":n});function PW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value.toString())," ")}}function DW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-host-required "),t.ɵɵelementEnd())}function OW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-required "),t.ɵɵelementEnd())}function AW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-min "),t.ɵɵelementEnd())}function FW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-max "),t.ɵɵelementEnd())}function RW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-pattern "),t.ɵɵelementEnd())}function BW(e,n){1&e&&(t.ɵɵelementStart(0,"div",16)(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",30),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field")(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",31),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field")(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",32),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.tls-path-ca-certificate")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,5,"gateway.tls-path-private-key")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,7,"gateway.tls-path-client-certificate")))}function NW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function LW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.path-logs-required "),t.ɵɵelementEnd())}function VW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value.toString())," ")}}function qW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-required "),t.ɵɵelementEnd())}function GW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-min "),t.ɵɵelementEnd())}function zW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-pattern "),t.ɵɵelementEnd())}function UW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-required "),t.ɵɵelementEnd())}function jW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-min "),t.ɵɵelementEnd())}function HW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-pattern "),t.ɵɵelementEnd())}function WW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-required "),t.ɵɵelementEnd())}function $W(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-min "),t.ɵɵelementEnd())}function KW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-pattern "),t.ɵɵelementEnd())}function YW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-path-required "),t.ɵɵelementEnd())}function XW(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",5)(1,"mat-form-field",8)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",33),t.ɵɵtemplate(6,WW,2,0,"mat-error",10)(7,$W,2,0,"mat-error",10)(8,KW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-form-field",8)(10,"mat-label"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",34),t.ɵɵtemplate(14,YW,2,0,"mat-error",10),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction3(12,MW,e.layoutGap,e.alignment,!e.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,8,"gateway.storage-max-files")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("pattern")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,10,"gateway.storage-path")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("dataFolderPath").hasError("required"))}}function ZW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function QW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.connector-type-required "),t.ɵɵelementEnd())}function JW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.connector-name-required "),t.ɵɵelementEnd())}function e$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",35)(1,"div",36)(2,"div",37),t.ɵɵelement(3,"mat-slide-toggle",38),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",39)(5,"mat-form-field",8)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",40),t.ɵɵlistener("selectionChange",(function(){const n=t.ɵɵrestoreView(e).$implicit,i=t.ɵɵnextContext();return t.ɵɵresetView(i.changeConnectorType(n))})),t.ɵɵtemplate(10,ZW,2,2,"mat-option",7),t.ɵɵelementEnd(),t.ɵɵtemplate(11,QW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",8)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"input",41),t.ɵɵlistener("blur",(function(){const n=t.ɵɵrestoreView(e),i=n.$implicit,a=n.index,r=t.ɵɵnextContext();return t.ɵɵresetView(r.changeConnectorName(i,a))})),t.ɵɵelementEnd(),t.ɵɵtemplate(17,JW,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",42)(19,"button",43),t.ɵɵpipe(20,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e),a=i.$implicit,r=i.index,o=t.ɵɵnextContext();return t.ɵɵresetView(o.openConfigDialog(n,r,a.get("config").value,a.get("name").value))})),t.ɵɵelementStart(21,"mat-icon"),t.ɵɵtext(22,"more_horiz"),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"button",43),t.ɵɵpipe(24,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext();return t.ɵɵresetView(i.removeConnector(n))})),t.ɵɵelementStart(25,"mat-icon"),t.ɵɵtext(26,"close"),t.ɵɵelementEnd()()()()()}if(2&e){const e=n.$implicit,i=n.index,a=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("formGroupName",i),t.ɵɵadvance(3),t.ɵɵclassMap(t.ɵɵpureFunction3(24,MW,a.layoutGap,a.alignment,!a.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,16,"gateway.connector-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",a.connectorTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("configType").hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,18,"gateway.connector-name")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.get("name").hasError("required")),t.ɵɵadvance(),t.ɵɵclassMap(t.ɵɵpureFunction3(28,kW,a.layoutGap,a.alignment,!a.alignment)),t.ɵɵadvance(),t.ɵɵclassProp("mat-warn",e.get("config").invalid),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,20,"gateway.update-config")),t.ɵɵproperty("disabled",a.isReadOnlyForm),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(24,22,"gateway.delete")),t.ɵɵproperty("disabled",a.isReadOnlyForm)}}function t$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",44),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.exportConfig())})),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,3,"gateway.download-tip")),t.ɵɵproperty("disabled",!e.gatewayConfigurationGroup.dirty||e.gatewayConfigurationGroup.invalid),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"action.download")," ")}}function n$(e,n){if(1&e&&(t.ɵɵelementStart(0,"button",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,3,"gateway.save-tip")),t.ɵɵproperty("disabled",!e.gatewayConfigurationGroup.dirty||e.gatewayConfigurationGroup.invalid),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"action.save")," ")}}class i$ extends q{constructor(e,t,n,i,a,r,o,s,l,p,c){super(e),this.store=e,this.elementRef=t,this.utils=n,this.ngZone=i,this.fb=a,this.window=r,this.dialog=o,this.translate=s,this.deviceService=l,this.attributeService=p,this.importExport=c,this.alignment=!0,this.layoutGap=!0,this.securityTypes=mW,this.gatewayLogLevels=Object.keys(hW).map((e=>hW[e])),this.connectorTypes=Object.keys(yW),this.storageTypes=fW,this.toastTargetId="gateway-configuration-widget"+this.utils.guid(),this.isReadOnlyForm=!1}get connectors(){return this.gatewayConfigurationGroup.get("connectors")}ngOnInit(){this.initWidgetSettings(this.ctx.settings),this.ctx.datasources&&this.ctx.datasources.length&&(this.deviceNameForm=this.ctx.datasources[0].name),this.buildForm(),this.ctx.updateWidgetParams(),this.formResize$=new ResizeObserver((()=>{this.resize()})),this.formResize$.observe(this.formContainerRef.nativeElement)}ngOnDestroy(){this.formResize$&&this.formResize$.disconnect(),this.subscribeGateway$.unsubscribe(),this.subscribeStorageType$.unsubscribe()}initWidgetSettings(e){let t;t=e.gatewayTitle&&e.gatewayTitle.length?this.utils.customTranslation(e.gatewayTitle,e.gatewayTitle):this.translate.instant("gateway.gateway"),this.ctx.widgetTitle=t,this.isReadOnlyForm=!!e.readOnly&&e.readOnly,this.archiveFileName=e.archiveFileName?.length?e.archiveFileName:"gatewayConfiguration",this.gatewayType=e.gatewayType?.length?e.gatewayType:"Gateway",this.gatewayNameExists=this.utils.customTranslation(e.gatewayNameExists,e.gatewayNameExists)||this.translate.instant("gateway.gateway-exists"),this.successfulSaved=this.utils.customTranslation(e.successfulSave,e.successfulSave)||this.translate.instant("gateway.gateway-saved"),this.updateWidgetDisplaying()}resize(){this.ngZone.run((()=>{this.updateWidgetDisplaying(),this.ctx.detectChanges()}))}updateWidgetDisplaying(){this.ctx.$container&&this.ctx.$container[0].offsetWidth<=425?(this.layoutGap=!1,this.alignment=!1):(this.layoutGap=!0,this.alignment=!0)}saveAttribute(e,t,n){const i=this.gatewayConfigurationGroup.get("gateway").value,a={key:e,value:t};return this.attributeService.saveEntityAttributes(SW(i),n,[a])}createConnector(e=vW){this.connectors.push(this.fb.group({enabled:[e.enabled],configType:[e.configType,[$.required]],name:[e.name,[$.required]],config:[e.config,[$.nullValidator,xW]]}))}getFormField(e){return this.gatewayConfigurationGroup.get(e)}buildForm(){this.gatewayConfigurationGroup=this.fb.group({gateway:[null,[]],accessToken:[null,[$.required]],securityType:[cW.accessToken],host:[this.window.location.hostname,[$.required]],port:[1883,[$.required,$.min(1),$.max(65535),$.pattern(/^-?[0-9]+$/)]],remoteConfiguration:[!0],caCertPath:["/etc/thingsboard-gateway/ca.pem"],privateKeyPath:["/etc/thingsboard-gateway/privateKey.pem"],certPath:["/etc/thingsboard-gateway/certificate.pem"],remoteLoggingLevel:[hW.debug],remoteLoggingPathToLogs:["./logs/",[$.required]],storageType:[gW.memory],readRecordsCount:[100,[$.required,$.min(1),$.pattern(/^-?[0-9]+$/)]],maxRecordsCount:[1e4,[$.required,$.min(1),$.pattern(/^-?[0-9]+$/)]],maxFilesCount:[5,[$.required,$.min(1),$.pattern(/^-?[0-9]+$/)]],dataFolderPath:["./data/",[$.required]],connectors:this.fb.array([])}),this.isReadOnlyForm&&this.gatewayConfigurationGroup.disable({emitEvent:!1}),this.subscribeStorageType$=this.getFormField("storageType").valueChanges.subscribe((e=>{e===gW.memory?(this.getFormField("maxFilesCount").disable(),this.getFormField("dataFolderPath").disable()):(this.getFormField("maxFilesCount").enable(),this.getFormField("dataFolderPath").enable())})),this.subscribeGateway$=this.getFormField("gateway").valueChanges.subscribe((e=>{null!==e?oe([this.deviceService.getDeviceCredentials(e).pipe(me((e=>{this.getFormField("accessToken").patchValue(e.credentialsId)}))),...this.getAttributes(e)]).subscribe((()=>{this.gatewayConfigurationGroup.markAsPristine(),this.ctx.detectChanges()})):this.getFormField("accessToken").patchValue("")}))}gatewayExist(){this.ctx.showErrorToast(this.gatewayNameExists,"top","left",this.toastTargetId)}exportConfig(){const e=this.gatewayConfigurationGroup.value,t={};var n,i,a;t["tb_gateway.yaml"]=function(e){let t;t="thingsboard:\n",t+=" host: "+e.host+"\n",t+=" remoteConfiguration: "+e.remoteConfiguration+"\n",t+=" port: "+e.port+"\n",t+=" security:\n",e.securityType===cW.accessToken?t+=" access-token: "+e.accessToken+"\n":(t+=" ca_cert: "+e.caCertPath+"\n",t+=" privateKey: "+e.privateKeyPath+"\n",t+=" cert: "+e.certPath+"\n"),t+="storage:\n",e.storageType===gW.memory?(t+=" type: memory\n",t+=" read_records_count: "+e.readRecordsCount+"\n",t+=" max_records_count: "+e.maxRecordsCount+"\n"):(t+=" type: file\n",t+=" data_folder_path: "+e.dataFolderPath+"\n",t+=" max_file_count: "+e.maxFilesCount+"\n",t+=" max_read_records_count: "+e.readRecordsCount+"\n",t+=" max_records_per_file: "+e.maxRecordsCount+"\n"),t+="connectors:\n";for(const n of e.connectors)n.enabled&&(t+=" -\n",t+=" name: "+n.name+"\n",t+=" type: "+n.configType+"\n",t+=" configuration: "+bW(n.name)+"\n");return t}(e),function(e,t){for(const n of t)n.enabled&&(e[bW(n.name)]=JSON.stringify(n.config))}(t,e.connectors),n=t,i=e.remoteLoggingLevel,a=e.remoteLoggingPathToLogs,n["logs.conf"]=wW(i,a),this.importExport.exportJSZip(t,this.archiveFileName),this.saveAttribute(uW,this.gatewayConfigurationGroup.value.remoteLoggingLevel.toUpperCase(),D.SHARED_SCOPE)}addNewConnector(){this.createConnector()}removeConnector(e){e>-1&&(this.connectors.removeAt(e),this.connectors.markAsDirty())}openConfigDialog(e,t,n,i){e&&(e.stopPropagation(),e.preventDefault()),this.dialog.open(tt,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{jsonValue:n,required:!0,title:this.translate.instant("gateway.title-connectors-json",{typeName:i})}}).afterClosed().subscribe((e=>{e&&(this.connectors.at(t).get("config").patchValue(e),this.ctx.detectChanges())}))}createConnectorName(e,t,n=0){const i=n?t+n:t;return-1===e.findIndex((e=>e.name===i))?i:this.createConnectorName(e,t,++n)}validateConnectorName(e,t,n,i=0){for(let a=0;a{this.ctx.showSuccessToast(this.successfulSaved,2e3,"top","left",this.toastTargetId),this.gatewayConfigurationGroup.markAsPristine()}))}getAttributes(e){const t=[];return t.push(oe([this.getAttribute("current_configuration",D.CLIENT_SCOPE,e),this.getAttribute(dW,D.SERVER_SCOPE,e)]).pipe(me((([e,t])=>{this.setFormGatewaySettings(e),this.setFormConnectorsDraft(t),this.isReadOnlyForm&&this.gatewayConfigurationGroup.disable({emitEvent:!1})})))),t.push(this.getAttribute(uW,D.SHARED_SCOPE,e).pipe(me((e=>this.processLoggingLevel(e))))),t}getAttribute(e,t,n){return this.attributeService.getEntityAttributes(SW(n),t,[e])}setFormGatewaySettings(e){if(this.connectors.clear(),e.length>0){const t=JSON.parse(window.atob(e[0].value));for(const e of Object.keys(t)){const n=t[e];if("thingsboard"===e)null!==n&&Object.keys(n).length>0&&this.gatewayConfigurationGroup.patchValue(CW(n));else for(const t of Object.keys(n)){let i="No name";Object.prototype.hasOwnProperty.call(n[t],"name")&&(i=n[t].name);const a={enabled:!0,configType:e,config:n[t].config,name:i};this.createConnector(a)}}}}setFormConnectorsDraft(e){if(e.length>0){const t=JSON.parse(window.atob(e[0].value));for(const e of Object.keys(t)){const n={enabled:!1,configType:t[e].connector,config:t[e].config,name:e};this.createConnector(n)}}}processLoggingLevel(e){let t=hW.debug;e.length>0&&hW[e[0].value.toLowerCase()]&&(t=hW[e[0].value.toLowerCase()]),this.getFormField("remoteLoggingLevel").patchValue(t)}static{this.ɵfac=function(e){return new(e||i$)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(t.ElementRef),t.ɵɵdirectiveInject(_e.UtilsService),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(H.UntypedFormBuilder),t.ɵɵdirectiveInject(Ce),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(_e.DeviceService),t.ɵɵdirectiveInject(_e.AttributeService),t.ɵɵdirectiveInject(nt.ImportExportService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:i$,selectors:[["tb-gateway-form"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(EW,7),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.formContainerRef=e.first)}},inputs:{ctx:"ctx",isStateForm:"isStateForm"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:104,vars:104,consts:[["formContainer",""],["tb-toast","",1,"gateway-form",3,"ngSubmit","formGroup","toastTarget"],["multi","true",1,"mat-body-2"],[1,"tb-panel-title"],["formControlName","gateway","required","",3,"gatewayNameExist","deviceName","isStateForm","newGatewayType"],[1,"flex"],["formControlName","securityType"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-1"],["matInput","","type","text","formControlName","host"],["translate","",4,"ngIf"],["matInput","","type","number","formControlName","port"],["class","flex flex-col",4,"ngIf"],["formControlName","remoteConfiguration"],["formControlName","remoteLoggingLevel"],["matInput","","type","text","formControlName","remoteLoggingPathToLogs"],[1,"flex","flex-col"],["formControlName","storageType"],["matInput","","type","number","formControlName","readRecordsCount"],["matInput","","type","number","formControlName","maxRecordsCount"],["class","flex",3,"class",4,"ngIf"],[1,"gateway-config","flex","flex-col"],["formArrayName","connectors",4,"ngFor","ngForOf"],[1,"no-data-found","items-center","justify-center"],["mat-raised-button","","type","button","matTooltipPosition","above",3,"click","matTooltip"],[1,"form-action-buttons","flex","flex-row","items-center","justify-end"],["mat-raised-button","","color","primary","type","button",3,"disabled","matTooltip","click",4,"ngIf"],["mat-raised-button","","color","primary","type","submit",3,"disabled","matTooltip",4,"ngIf"],[3,"value"],["translate",""],["matInput","","type","text","formControlName","caCertPath"],["matInput","","type","text","formControlName","privateKeyPath"],["matInput","","type","text","formControlName","certPath"],["matInput","","type","number","formControlName","maxFilesCount"],["matInput","","type","text","formControlName","dataFolderPath"],["formArrayName","connectors"],[1,"flex","flex-row","items-stretch","justify-between","gap-2",3,"formGroupName"],[1,"flex","flex-col","justify-center"],["formControlName","enabled"],[1,"flex-full","flex"],["formControlName","configType",3,"selectionChange"],["matInput","","type","text","formControlName","name",3,"blur"],[1,"action-buttons","flex"],["mat-icon-button","","matTooltipPosition","above",3,"click","disabled","matTooltip"],["mat-raised-button","","color","primary","type","button",3,"click","disabled","matTooltip"],["mat-raised-button","","color","primary","type","submit",3,"disabled","matTooltip"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"form",1,0),t.ɵɵlistener("ngSubmit",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.save())})),t.ɵɵelementStart(2,"mat-accordion",2)(3,"mat-expansion-panel")(4,"mat-expansion-panel-header")(5,"mat-panel-title")(6,"div",3),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵpipe(9,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"tb-entity-gateway-select",4),t.ɵɵlistener("gatewayNameExist",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.gatewayExist())})),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",5)(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-select",6),t.ɵɵtemplate(16,PW,3,4,"mat-option",7),t.ɵɵpipe(17,"keyvalue"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",5)(19,"mat-form-field",8)(20,"mat-label"),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(23,"input",9),t.ɵɵtemplate(24,DW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",8)(26,"mat-label"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(29,"input",11),t.ɵɵtemplate(30,OW,2,0,"mat-error",10)(31,AW,2,0,"mat-error",10)(32,FW,2,0,"mat-error",10)(33,RW,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,BW,16,9,"div",12),t.ɵɵelementStart(35,"mat-checkbox",13),t.ɵɵtext(36),t.ɵɵpipe(37,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"div",5)(39,"mat-form-field",8)(40,"mat-label"),t.ɵɵtext(41),t.ɵɵpipe(42,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(43,"mat-select",14),t.ɵɵtemplate(44,NW,2,2,"mat-option",7),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"mat-form-field",8)(46,"mat-label"),t.ɵɵtext(47),t.ɵɵpipe(48,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(49,"input",15),t.ɵɵtemplate(50,LW,2,0,"mat-error",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(51,"mat-expansion-panel")(52,"mat-expansion-panel-header")(53,"mat-panel-title")(54,"div",3),t.ɵɵtext(55),t.ɵɵpipe(56,"translate"),t.ɵɵpipe(57,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(58,"div",16)(59,"mat-form-field")(60,"mat-label"),t.ɵɵtext(61),t.ɵɵpipe(62,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"mat-select",17),t.ɵɵtemplate(64,VW,3,4,"mat-option",7),t.ɵɵpipe(65,"keyvalue"),t.ɵɵelementEnd()(),t.ɵɵelementStart(66,"div",5)(67,"mat-form-field",8)(68,"mat-label"),t.ɵɵtext(69),t.ɵɵpipe(70,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(71,"input",18),t.ɵɵtemplate(72,qW,2,0,"mat-error",10)(73,GW,2,0,"mat-error",10)(74,zW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(75,"mat-form-field",8)(76,"mat-label"),t.ɵɵtext(77),t.ɵɵpipe(78,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(79,"input",19),t.ɵɵtemplate(80,UW,2,0,"mat-error",10)(81,jW,2,0,"mat-error",10)(82,HW,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵtemplate(83,XW,15,16,"div",20),t.ɵɵelementEnd()(),t.ɵɵelementStart(84,"mat-expansion-panel")(85,"mat-expansion-panel-header")(86,"mat-panel-title")(87,"div",3),t.ɵɵtext(88),t.ɵɵpipe(89,"translate"),t.ɵɵpipe(90,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(91,"div",21),t.ɵɵtemplate(92,e$,27,32,"section",22),t.ɵɵelementStart(93,"span",23),t.ɵɵtext(94),t.ɵɵpipe(95,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(96,"div")(97,"button",24),t.ɵɵpipe(98,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addNewConnector())})),t.ɵɵtext(99),t.ɵɵpipe(100,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(101,"section",25),t.ɵɵtemplate(102,t$,4,7,"button",26)(103,n$,4,7,"button",27),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("toastTarget",n.toastTargetId),t.ɵɵproperty("formGroup",n.gatewayConfigurationGroup),t.ɵɵadvance(7),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,54,t.ɵɵpipeBind1(8,52,"gateway.thingsboard"))),t.ɵɵadvance(3),t.ɵɵproperty("deviceName",n.deviceNameForm)("isStateForm",n.isStateForm)("newGatewayType",n.gatewayType),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,56,"gateway.security-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(17,58,n.securityTypes)),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(92,MW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,60,"gateway.thingsboard-host")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("host").hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,62,"gateway.thingsboard-port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("max")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("pattern")),t.ɵɵadvance(),t.ɵɵproperty("ngIf","tls"===n.gatewayConfigurationGroup.get("securityType").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(37,64,"gateway.remote")),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(96,MW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(42,66,"gateway.remote-logging-level")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.gatewayLogLevels),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(48,68,"gateway.path-logs")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("remoteLoggingPathToLogs").hasError("required")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(57,72,t.ɵɵpipeBind1(56,70,"gateway.storage"))),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(62,74,"gateway.storage-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(65,76,n.storageTypes)),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(100,MW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(70,78,"gateway.storage-pack-size")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("pattern")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(78,80,"file"!==n.gatewayConfigurationGroup.get("storageType").value?"gateway.storage-max-records":"gateway.storage-max-file-records")," "),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("pattern")),t.ɵɵadvance(),t.ɵɵproperty("ngIf","file"===n.gatewayConfigurationGroup.get("storageType").value),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(90,84,t.ɵɵpipeBind1(89,82,"gateway.connectors-config"))),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",n.connectors.controls),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.connectors.length),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(95,86,"gateway.no-connectors")),t.ɵɵadvance(3),t.ɵɵclassProp("!hidden",n.isReadOnlyForm),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(98,88,"gateway.connector-add")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(100,90,"action.add")," "),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.isReadOnlyForm),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.gatewayConfigurationGroup.get("remoteConfiguration").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("remoteConfiguration").value))},dependencies:t.ɵɵgetComponentDepsFactory(i$,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%]{height:100%;padding:5px;background-color:transparent;overflow-y:auto;overflow-x:hidden}[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%] .form-action-buttons[_ngcontent-%COMP%]{padding-top:8px}[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%] .gateway-config[_ngcontent-%COMP%] .no-data-found[_ngcontent-%COMP%]{position:relative;display:flex;height:40px}']})}}e("GatewayFormComponent",i$);class a${transform(e,t){return za.parseVersion(e)>=za.parseVersion(Ei.get(t))}static{this.ɵfac=function(e){return new(e||a$)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"isLatestVersionConfig",type:a$,pure:!0,standalone:!0})}}class r${constructor(e){this.translate=e}transform(e){return e.hasError("required")?this.translate.instant("gateway.port-required"):e.hasError("min")||e.hasError("max")?this.translate.instant("gateway.port-limits-error",{min:Ii.MIN,max:Ii.MAX}):""}static{this.ɵfac=function(e){return new(e||r$)(t.ɵɵdirectiveInject(He.TranslateService,16))}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getGatewayPortTooltip",type:r$,pure:!0,standalone:!0})}}class o${transform(e,t,n,i){switch(e){case ct.OPCUA:return this.getOpcConnectorHelpLink(t,n);case ct.MQTT:return this.getMqttConnectorHelpLink(t,n,i);case ct.BACNET:return this.getBacnetConnectorHelpLink(t,n);case ct.REST:return this.getRestConnectorHelpLink(n)}}getOpcConnectorHelpLink(e,t){if(t!==Mi.CONST)return`widget/lib/gateway/${e}-${t}_fn`}getMqttConnectorHelpLink(e,t,n){if(t!==ei.CONST)return n?e!==Ni.ATTRIBUTES&&e!==Ni.TIMESERIES||n!==Jn.JSON?`widget/lib/gateway/mqtt-${n}-expression_fn`:"widget/lib/gateway/mqtt-json-key-expression_fn":"widget/lib/gateway/mqtt-expression_fn"}getBacnetConnectorHelpLink(e,t){if(t!==Mi.CONST)return`widget/lib/gateway/bacnet-device-${e}-${t}_fn`}getRestConnectorHelpLink(e){if(e!==fi.CONST)return"widget/lib/gateway/rest-json_fn"}static{this.ɵfac=function(e){return new(e||o$)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getConnectorMappingHelpLink",type:o$,pure:!0,standalone:!0})}}function s$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.gatewayConnectorDefaultTypesTranslatesMap.get(e)," ")}}function l$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.connectorForm.get("name").hasError("duplicateName")?"gateway.connector-duplicate-name":"gateway.name-required"))}}function p$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.connectors-table-class"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",10),t.ɵɵelement(4,"input",23),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,1,"gateway.set")))}function c$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.connectors-table-key"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",10),t.ɵɵelement(4,"input",24),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,1,"gateway.set")))}function d$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function u$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"mat-slide-toggle",25)(2,"mat-label",26),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.fill-connector-defaults-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.fill-connector-defaults")," "))}function m$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"mat-slide-toggle",27)(2,"mat-label",26),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.send-change-data-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.send-change-data")," "))}class h$ extends A{constructor(e,t,n,i,a,r){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.isLatestVersionConfig=r,this.connectorType=ct,this.gatewayConnectorDefaultTypesTranslatesMap=dt,this.gatewayLogLevel=Object.values(lt),this.submitted=!1,this.destroy$=new te,this.updateConnectorTypesByVersion(),this.connectorForm=this.fb.group({type:[ct.MQTT,[]],name:["",[$.required,this.uniqNameRequired(),$.pattern(an)]],logLevel:[lt.INFO,[]],useDefaults:[!0,[]],sendDataOnlyOnChange:[!1,[]],class:["",[]],key:["auto",[]]})}ngOnInit(){this.observeTypeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}helpLinkId(){return O+"/docs/iot-gateway/configuration/"}cancel(){this.dialogRef.close(null)}add(){this.submitted=!0;const e=this.connectorForm.getRawValue();if(e.useDefaults){const t=Ht(e.type),n=this.data.gatewayVersion;n&&(e.configVersion=n),e.configurationJson=(this.isLatestVersionConfig.transform(n,e.type)?t[Ei.get(e.type)]:t[pt.Legacy])??t,this.connectorForm.valid&&this.dialogRef.close(e)}else this.connectorForm.valid&&this.dialogRef.close(e)}uniqNameRequired(){return e=>{const t=e.value.trim().toLowerCase();return this.data.dataSourceData.some((({value:{name:e}})=>e.toLowerCase()===t))?{duplicateName:{valid:!1}}:null}}updateConnectorTypesByVersion(){const e=ut.keys();for(let t of e)if(t===pt.Legacy||za.parseVersion(this.data.gatewayVersion)>=za.parseVersion(t)){this.connectorTypes=ut.get(t);break}}observeTypeChange(){this.connectorForm.get("type").valueChanges.pipe(me((e=>{const t=this.connectorForm.get("useDefaults");e===ct.GRPC||e===ct.CUSTOM?t.setValue(!1):t.value||t.setValue(!0)})),le(this.destroy$)).subscribe()}static{this.ɵfac=function(e){return new(e||h$)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(a$))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:h$,selectors:[["tb-add-connector-dialog"]],standalone:!0,features:[t.ɵɵProvidersFeature([a$]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:43,vars:25,consts:[[1,"add-connector",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","autocomplete","off","name","value","formControlName","name",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf"],["formControlName","logLevel"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","class",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"],["formControlName","useDefaults",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2)(6,"div",3),t.ɵɵelementStart(7,"button",4),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",5),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",6)(11,"div",7)(12,"div",8)(13,"div",9),t.ɵɵtext(14,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",10)(16,"mat-select",11),t.ɵɵtemplate(17,s$,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(18,"div",8)(19,"div",13),t.ɵɵtext(20,"gateway.name"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",10),t.ɵɵelement(22,"input",14),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,l$,3,3,"mat-icon",15),t.ɵɵelementEnd()(),t.ɵɵtemplate(25,p$,6,3,"div",16)(26,c$,6,3,"div",16),t.ɵɵelementStart(27,"div",8)(28,"div",9),t.ɵɵtext(29,"gateway.remote-logging-level"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",10)(31,"mat-select",17),t.ɵɵtemplate(32,d$,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵtemplate(33,u$,6,6,"div",16)(34,m$,6,6,"div",16),t.ɵɵpipe(35,"withReportStrategy"),t.ɵɵelementEnd()(),t.ɵɵelementStart(36,"div",18)(37,"button",19),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(38),t.ɵɵpipe(39,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(40,"button",20),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(41),t.ɵɵpipe(42,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.connectorForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,14,"gateway.add-connector")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLinkId()),t.ɵɵadvance(11),t.ɵɵproperty("ngForOf",n.connectorTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorForm.get("name").hasError("required")&&n.connectorForm.get("name").touched||n.connectorForm.get("name").hasError("duplicateName")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.GRPC),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.gatewayLogLevel),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value!==n.connectorType.GRPC&&n.connectorForm.get("type").value!==n.connectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.MQTT&&!t.ɵɵpipeBind2(35,18,n.data.gatewayVersion,n.connectorType.MQTT)),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(39,21,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.connectorForm.invalid||!n.connectorForm.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(42,23,"action.add")," "))},dependencies:t.ɵɵgetComponentDepsFactory(h$,[j,_,Ka]),styles:['@charset "UTF-8";[_nghost-%COMP%] .add-connector[_ngcontent-%COMP%]{min-width:400px;width:500px}']})}}e("AddConnectorDialogComponent",h$);const g$=()=>({maxWidth:"970px"});function f$(e,n){1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtext(1,"gateway.device-info.source"),t.ɵɵelementEnd())}function y$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function v$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-form-field",18)(2,"mat-select",19),t.ɵɵtemplate(3,y$,3,4,"mat-option",20),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sourceTypes)}}function x$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-name-expression-required"))}function b$(e,n){if(1&e&&(t.ɵɵelement(0,"div",23),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,e.connectorType,"name-field",e.mappingFormGroup.get("deviceNameExpressionSource").value,e.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,g$))}}function w$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function S$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-form-field",18)(2,"mat-select",26),t.ɵɵtemplate(3,w$,3,4,"mat-option",20),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sourceTypes)}}function C$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-profile-expression-required"))}function _$(e,n){if(1&e&&(t.ɵɵelement(0,"div",23),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,e.connectorType,"profile-name",e.mappingFormGroup.get("deviceProfileExpressionSource").value,e.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,g$))}}function T$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",24)(1,"div",9),t.ɵɵtext(2,"gateway.device-info.profile-name"),t.ɵɵelementEnd(),t.ɵɵtemplate(3,S$,4,1,"div",10),t.ɵɵelementStart(4,"div",11)(5,"mat-form-field",12),t.ɵɵelement(6,"input",25),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,C$,3,3,"mat-icon",14)(9,_$,2,8,"div",15),t.ɵɵpipe(10,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.useSource),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingFormGroup.get("deviceProfileExpression").hasError("required")&&e.mappingFormGroup.get("deviceProfileExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(10,6,e.connectorType,"profile-name",e.mappingFormGroup.get("deviceProfileExpressionSource").value,e.convertorType))}}class I$ extends q{get deviceInfoType(){return this.deviceInfoTypeValue}set deviceInfoType(e){this.deviceInfoTypeValue!==e&&(this.deviceInfoTypeValue=e)}constructor(e,t,n,i){super(e),this.store=e,this.translate=t,this.dialog=n,this.fb=i,this.SourceTypeTranslationsMap=Bi,this.DeviceInfoType=ga,this.useSource=!0,this.required=!1,this.connectorType=ct.MQTT,this.sourceTypes=Object.values(ei),this.destroy$=new te,this.propagateChange=e=>{}}ngOnInit(){this.mappingFormGroup=this.fb.group({deviceNameExpression:["",this.required?[$.required,$.pattern(an)]:[$.pattern(an)]]}),this.useSource&&this.mappingFormGroup.addControl("deviceNameExpressionSource",this.fb.control(this.sourceTypes[0],[])),this.deviceInfoType===ga.FULL&&(this.useSource&&this.mappingFormGroup.addControl("deviceProfileExpressionSource",this.fb.control(this.sourceTypes[0],[])),this.mappingFormGroup.addControl("deviceProfileExpression",this.fb.control("",this.required?[$.required,$.pattern(an)]:[$.pattern(an)]))),this.mappingFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateView(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}writeValue(e){this.mappingFormGroup.patchValue(e,{emitEvent:!1})}validate(){return this.mappingFormGroup.valid?null:{mappingForm:{valid:!1}}}updateView(e){this.propagateChange(e)}static{this.ɵfac=function(e){return new(e||I$)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:I$,selectors:[["tb-device-info-table"]],inputs:{useSource:"useSource",required:"required",connectorType:"connectorType",convertorType:"convertorType",sourceTypes:"sourceTypes",deviceInfoType:"deviceInfoType"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>I$)),multi:!0},{provide:K,useExisting:c((()=>I$)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:23,vars:18,consts:[[1,"tb-form-panel","stroked",3,"formGroup"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-table","no-padding","no-gap"],[1,"tb-form-table-header"],["translate","",1,"tb-form-table-header-cell","w-1/5"],["class","tb-form-table-header-cell w-1/5","translate","",4,"ngIf"],["translate","",1,"tb-form-table-header-cell","w-1/2"],[1,"tb-form-table-body","no-gap"],[1,"tb-form-table-row","tb-form-row","no-border","same-padding","pt-4"],["translate","",1,"tb-required","w-1/5"],["class","no-gap w-1/5",4,"ngIf"],[1,"tb-form-table-row-cell","tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","deviceNameExpression",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],["class","tb-form-table-row tb-form-row no-border same-padding pb-4",4,"ngIf"],[1,"no-gap","w-1/5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","!w-full"],["formControlName","deviceNameExpressionSource"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-form-table-row","tb-form-row","no-border","same-padding","pb-4"],["matInput","","name","value","formControlName","deviceProfileExpression",3,"placeholder"],["formControlName","deviceProfileExpressionSource"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2,"device.device"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",2)(4,"div",3)(5,"div",4),t.ɵɵtext(6,"gateway.device-info.entity-field"),t.ɵɵelementEnd(),t.ɵɵtemplate(7,f$,2,0,"div",5),t.ɵɵelementStart(8,"div",6),t.ɵɵtext(9," gateway.device-info.expression "),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",7)(11,"div",8)(12,"div",9),t.ɵɵtext(13,"gateway.device-info.name"),t.ɵɵelementEnd(),t.ɵɵtemplate(14,v$,4,1,"div",10),t.ɵɵelementStart(15,"div",11)(16,"mat-form-field",12),t.ɵɵelement(17,"input",13),t.ɵɵpipe(18,"translate"),t.ɵɵtemplate(19,x$,3,3,"mat-icon",14)(20,b$,2,8,"div",15),t.ɵɵpipe(21,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(22,T$,11,11,"div",16),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(),t.ɵɵclassProp("tb-required",n.required),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.useSource),t.ɵɵadvance(4),t.ɵɵclassProp("pb-4",n.deviceInfoType!==n.DeviceInfoType.FULL),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.useSource),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(18,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.mappingFormGroup.get("deviceNameExpression").hasError("required")&&n.mappingFormGroup.get("deviceNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(21,13,n.connectorType,"name-field",n.mappingFormGroup.get("deviceNameExpressionSource").value,n.convertorType)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceInfoType===n.DeviceInfoType.FULL))},dependencies:t.ɵɵgetComponentDepsFactory(I$,[j,_,o$]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}Ge([I()],I$.prototype,"useSource",void 0),Ge([I()],I$.prototype,"required",void 0);const E$=()=>({maxWidth:"970px"});function M$(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",19),2&e){let e;const n=t.ɵɵnextContext();t.ɵɵproperty("svgIcon",null==(e=n.valueTypes.get(n.valueTypeFormGroup.get("type").value))?null:e.icon)}}function k$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵelement(1,"mat-icon",22),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext(2);t.ɵɵproperty("value",a),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",null==(e=r.valueTypes.get(a))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,null==(i=r.valueTypes.get(a))?null:i.name))}}function P$(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,k$,5,5,"mat-option",20),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueTypeKeys)}}function D$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-option",23)(1,"span"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.raw")))}function O$(e,n){1&e&&(t.ɵɵelement(0,"input",24),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function A$(e,n){1&e&&(t.ɵɵelement(0,"input",25),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function F$(e,n){1&e&&(t.ɵɵelement(0,"input",26),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function R$(e,n){1&e&&(t.ɵɵelement(0,"input",27),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function B$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-select",28)(1,"mat-option",21),t.ɵɵtext(2,"true"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-option",21),t.ɵɵtext(4,"false"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵproperty("value",!0),t.ɵɵadvance(2),t.ɵɵproperty("value",!1))}function N$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",29),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function L$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",30),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("tb-help-popup",e.helpLink)("tb-help-popup-style",t.ɵɵpureFunction0(2,E$))}}class V${constructor(e){this.fb=e,this.valueTypeKeys=Object.values(Yt),this.valueTypes=Xt,this.MappingValueType=Yt,this.destroy$=new te,this.onChange=e=>{},this.valueTypeFormGroup=this.fb.group({type:[Yt.STRING],stringValue:[{value:"",disabled:this.rawData},[$.required,$.pattern(an)]],integerValue:[{value:0,disabled:!0},[$.required,$.pattern(rn)]],doubleValue:[{value:0,disabled:!0},[$.required]],booleanValue:[{value:!1,disabled:!0},[$.required]],rawValue:[{value:"",disabled:!this.rawData},[$.required,$.pattern(an)]]}),this.valueTypeFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((({type:e,...t})=>{this.onChange({type:e,value:t[e+"Value"]})})),this.observeTypeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}observeTypeChange(){this.valueTypeFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.toggleTypeInputs(e)))}toggleTypeInputs(e){this.valueTypeFormGroup.disable({emitEvent:!1}),this.valueTypeFormGroup.get("type").enable({emitEvent:!1}),this.valueTypeFormGroup.get(e+"Value").enable({emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){const t=this.getValueType(e?.value),n={stringValue:"",rawValue:"",integerValue:0,doubleValue:0,booleanValue:!1,type:t};n[t+"Value"]=e?.value,this.toggleTypeInputs(t),this.valueTypeFormGroup.patchValue(n,{emitEvent:!1})}validate(){return this.valueTypeFormGroup.valid?null:{valueTypeFormGroup:{valid:!1}}}getValueType(e){if(this.rawData)return"raw";switch(typeof e){case"boolean":return Yt.BOOLEAN;case"number":return Number.isInteger(e)?Yt.INTEGER:Yt.DOUBLE;default:return Yt.STRING}}static{this.ɵfac=function(e){return new(e||V$)(t.ɵɵdirectiveInject(H.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:V$,selectors:[["tb-type-value-field"]],inputs:{rawData:"rawData",helpLink:"helpLink"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>V$)),multi:!0},{provide:K,useExisting:c((()=>V$)),multi:!0}]),t.ɵɵStandaloneFeature],decls:29,vars:17,consts:[["raw",""],[3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[1,"tb-flex","align-center"],["class","tb-mat-18",3,"svgIcon",4,"ngIf"],[4,"ngIf","ngIfElse"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","flex","tb-suffix-absolute"],[3,"ngSwitch"],["matInput","","required","","formControlName","stringValue",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","rawValue",3,"placeholder",4,"ngSwitchCase"],["formControlName","booleanValue",4,"ngSwitchCase"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style","click",4,"ngIf"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"tb-mat-20",3,"svgIcon"],["value","raw"],["matInput","","required","","formControlName","stringValue",3,"placeholder"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","rawValue",3,"placeholder"],["formControlName","booleanValue"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"click","tb-help-popup","tb-help-popup-style"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,1),t.ɵɵelementStart(1,"div",2)(2,"div",3),t.ɵɵtext(3,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",4)(5,"mat-form-field",5)(6,"mat-select",6)(7,"mat-select-trigger")(8,"div",7),t.ɵɵtemplate(9,M$,1,1,"mat-icon",8),t.ɵɵelementStart(10,"span"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(14,P$,2,1,"ng-container",9)(15,D$,4,3,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(17,"div",2)(18,"div",3),t.ɵɵtext(19,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"mat-form-field",10),t.ɵɵelementContainerStart(21,11),t.ɵɵtemplate(22,O$,2,3,"input",12)(23,A$,2,3,"input",13)(24,F$,2,3,"input",14)(25,R$,2,3,"input",15)(26,B$,5,2,"mat-select",16),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(27,N$,3,3,"mat-icon",17)(28,L$,1,3,"div",18),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){let e,i;const a=t.ɵɵreference(16);t.ɵɵproperty("formGroup",n.valueTypeFormGroup),t.ɵɵadvance(9),t.ɵɵproperty("ngIf",!n.rawData),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,13,null==(e=n.valueTypes.get(n.valueTypeFormGroup.get("type").value))?null:e.name)||t.ɵɵpipeBind1(13,15,"gateway.raw")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",!n.rawData)("ngIfElse",a),t.ɵɵadvance(7),t.ɵɵproperty("ngSwitch",n.valueTypeFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.STRING),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.INTEGER),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.DOUBLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase","raw"),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.BOOLEAN),t.ɵɵadvance(),t.ɵɵproperty("ngIf",(null==(i=n.valueTypeFormGroup.get(n.valueTypeFormGroup.get("type").value))?null:i.hasError("required"))&&n.valueTypeFormGroup.get(n.valueTypeFormGroup.get("type").value).touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.helpLink)}},dependencies:t.ɵɵgetComponentDepsFactory(V$,[_,j]),styles:['@charset "UTF-8";[_nghost-%COMP%]{gap:16px;display:grid;width:100%}']})}}function q$(e,n){if(1&e&&t.ɵɵelement(0,"tb-type-value-field",14),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("helpLink",e.helpLink)}}function G$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",7),t.ɵɵelementContainerStart(2,8),t.ɵɵelementStart(3,"mat-expansion-panel",9)(4,"mat-expansion-panel-header",10)(5,"mat-panel-title")(6,"div",11),t.ɵɵtext(7),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,q$,1,1,"ng-template",12),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",13),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e;const i=n.$implicit,a=n.last;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i),t.ɵɵadvance(),t.ɵɵproperty("expanded",a),t.ɵɵadvance(4),t.ɵɵtextInterpolate(null!==(e=null==(e=i.get("typeValue").value)?null:e.value)&&void 0!==e?e:""),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(10,4,"gateway.delete-argument"))}}function z$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtemplate(1,G$,13,6,"div",5),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function U$(e,n){1&e&&(t.ɵɵelementStart(0,"div",15)(1,"span",16),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate("gateway.no-value"))}Ge([I()],V$.prototype,"rawData",void 0);class j${constructor(e){this.fb=e,this.destroy$=new te,this.onChange=e=>{}}ngOnInit(){this.valueListFormArray=this.fb.array([]),this.valueListFormArray.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e.map((({typeValue:e})=>({...e}))))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}trackByKey(e,t){return t}addKey(){const e=this.fb.group({typeValue:[]});this.valueListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.valueListFormArray.removeAt(t),this.valueListFormArray.markAsDirty()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){for(const t of e){const e={typeValue:[t]},n=this.fb.group(e);this.valueListFormArray.push(n)}}validate(){return this.valueListFormArray.valid?null:{valueListForm:{valid:!1}}}static{this.ɵfac=function(e){return new(e||j$)(t.ɵɵdirectiveInject(H.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:j$,selectors:[["tb-type-value-panel"]],inputs:{helpLink:"helpLink"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>j$)),multi:!0},{provide:K,useExisting:c((()=>j$)),multi:!0}]),t.ɵɵStandaloneFeature],decls:8,vars:5,consts:[["noKeys",""],[1,"tb-form-panel","no-border","no-padding"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["tbTruncateWithTooltip","",1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["formControlName","typeValue",3,"helpLink"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",1),t.ɵɵtemplate(1,z$,2,2,"div",2),t.ɵɵelementStart(2,"div")(3,"button",3),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(6,U$,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor)}if(2&e){const e=t.ɵɵreference(7);t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.valueListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,3,"gateway.add-value")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(j$,[j,_,V$]),styles:['@charset "UTF-8";[_nghost-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw}[_nghost-%COMP%] .key-panel[_ngcontent-%COMP%]{height:250px;overflow:auto}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}const H$=()=>({maxWidth:"970px"});function W$(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",19),t.ɵɵtext(2),t.ɵɵelementEnd(),t.ɵɵtext(3),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",e.get("key").value," "),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",":","  ")}}function $$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function K$(e,n){if(1&e&&(t.ɵɵelement(0,"div",41),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(3).$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,n.connectorType,n.keysType,e.get("type").value,n.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,H$))}}function Y$(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",44),2&e){let e;const n=t.ɵɵnextContext(4).$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("svgIcon",null==(e=i.valueTypes.get(n.get("type").value))?null:e.icon)}}function X$(e,n){if(1&e&&(t.ɵɵelementStart(0,"span"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){let e;const n=t.ɵɵnextContext(4).$implicit,i=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,null!==(e=null==(e=i.valueTypes.get(n.get("type").value))?null:e.name)&&void 0!==e?e:i.valueTypes.get(n.get("type").value))," ")}}function Z$(e,n){1&e&&(t.ɵɵelementStart(0,"span"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.raw")))}function Q$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-select-trigger")(1,"div",42),t.ɵɵtemplate(2,Y$,1,1,"mat-icon",43)(3,X$,3,3,"span",36)(4,Z$,3,3,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()),2&e){let e;const n=t.ɵɵreference(5),i=t.ɵɵnextContext(3).$implicit,a=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==(e=a.valueTypes.get(i.get("type").value))?null:e.icon),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!a.rawData)("ngIfElse",n)}}function J$(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",48),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(6);t.ɵɵpropertyInterpolate("svgIcon",n.valueTypes.get(e).icon)}}function eK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵtemplate(1,J$,1,1,"mat-icon",47),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext(6);t.ɵɵproperty("value",a),t.ɵɵadvance(),t.ɵɵproperty("ngIf",null==(e=r.valueTypes.get(a))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,3,null!==(i=null==(i=r.valueTypes.get(a))?null:i.name)&&void 0!==i?i:r.valueTypes.get(a))," ")}}function tK(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,eK,5,5,"mat-option",45),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(5);t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueTypeKeys)}}function nK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-option",46)(1,"span"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("value","raw"),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,2,"gateway.raw")))}function iK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function aK(e,n){if(1&e&&(t.ɵɵelement(0,"div",41),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(3).$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,n.connectorType,n.keysType,e.get("type").value,n.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,H$))}}function rK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",24)(2,"div",25),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",26)(5,"div",27),t.ɵɵpipe(6,"translate"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-form-field",28),t.ɵɵelement(10,"input",29),t.ɵɵpipe(11,"translate"),t.ɵɵtemplate(12,$$,3,3,"mat-icon",30)(13,K$,2,8,"div",31),t.ɵɵpipe(14,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",24)(16,"div",25),t.ɵɵtext(17,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",32)(19,"div",33),t.ɵɵtext(20,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",34)(22,"mat-select",35),t.ɵɵtemplate(23,Q$,6,3,"mat-select-trigger",18)(24,tK,2,1,"ng-container",36)(25,nK,4,4,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()(),t.ɵɵelementStart(27,"div",37)(28,"div",27),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-form-field",38),t.ɵɵelement(33,"input",39),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,iK,3,3,"mat-icon",30)(36,aK,2,8,"div",31),t.ɵɵpipe(37,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵreference(26),n=t.ɵɵnextContext(2).$implicit,i=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,13,"gateway.JSONPath-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,15,"gateway.key")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(11,17,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("key").hasError("required")&&n.get("key").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(14,19,i.connectorType,i.keysType,n.get("type").value,i.convertorType)),t.ɵɵadvance(10),t.ɵɵproperty("ngIf",!i.rawData),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!i.rawData)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(29,24,"gateway.JSONPath-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(31,26,"gateway.value")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(34,28,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("value").hasError("required")&&n.get("value").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(37,30,i.connectorType,i.keysType,n.get("type").value,i.convertorType))}}function oK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function sK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function lK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",26)(2,"div",33),t.ɵɵtext(3,"gateway.key"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",28),t.ɵɵelement(5,"input",29),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,oK,3,3,"mat-icon",30),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",26)(9,"div",33),t.ɵɵtext(10,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",49),t.ɵɵelement(12,"input",39),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,sK,3,3,"mat-icon",30),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("key").hasError("required")&&e.get("key").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,6,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("value").hasError("required")&&e.get("value").touched)}}function pK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function cK(e,n){1&e&&t.ɵɵelement(0,"tb-type-value-panel",54)}function dK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",26)(2,"div",27),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",28),t.ɵɵelement(7,"input",50),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,pK,3,3,"mat-icon",30),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",14)(11,"mat-expansion-panel",51)(12,"mat-expansion-panel-header",52)(13,"mat-panel-title")(14,"div",53),t.ɵɵpipe(15,"translate"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(18,cK,1,0,"ng-template",20),t.ɵɵelementEnd()()()),2&e){let e;const n=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,7,"gateway.hints.method-name")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,9,"gateway.method-name")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("method").hasError("required")&&n.get("method").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(15,13,"gateway.hints.arguments")),t.ɵɵadvance(2),t.ɵɵtextInterpolate2(" ",t.ɵɵpipeBind1(17,15,"gateway.arguments"),""," ("+(null==(e=n.get("arguments").value)?null:e.length)+")"," ")}}function uK(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",55),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}function mK(e,n){if(1&e&&t.ɵɵtemplate(0,rK,38,35,"div",22)(1,lK,15,8,"div",22)(2,dK,19,17,"div",22)(3,uK,1,2,"tb-report-strategy",23),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngIf",e.keysType!==e.MappingKeysType.CUSTOM&&e.keysType!==e.MappingKeysType.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.MappingKeysType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.MappingKeysType.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.withReportStrategy&&(e.keysType===e.MappingKeysType.ATTRIBUTES||e.keysType===e.MappingKeysType.TIMESERIES))}}function hK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",13)(1,"div",14),t.ɵɵelementContainerStart(2,15),t.ɵɵelementStart(3,"mat-expansion-panel",16)(4,"mat-expansion-panel-header",17)(5,"mat-panel-title"),t.ɵɵtemplate(6,W$,4,2,"ng-container",18),t.ɵɵelementStart(7,"div",19),t.ɵɵtext(8),t.ɵɵelementEnd()()(),t.ɵɵtemplate(9,mK,4,4,"ng-template",20),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",21),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",a.keysType!==a.MappingKeysType.RPC_METHODS),t.ɵɵadvance(2),t.ɵɵtextInterpolate(a.valueTitle(e)),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,a.deleteKeyTitle))}}function gK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵtemplate(1,hK,14,7,"div",12),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function fK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",56)(1,"span",57),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class yK extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.valueTypeEnum=Yt,this.valueTypes=Xt,this.valueTypeKeys=Object.values(Yt),this.rawData=!1,this.withReportStrategy=!0,this.keysDataApplied=new u,this.MappingKeysType=Ni,this.ReportStrategyDefaultValue=en,this.ConnectorType=ct,this.errorText=""}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}trackByKey(e,t){return t}addKey(){let e;e=this.keysType===Ni.RPC_METHODS?this.fb.group({method:["",[$.required]],arguments:[[],[]]}):this.keysType===Ni.CUSTOM?this.fb.group({key:["",[$.required,$.pattern(an)]],value:["",[$.required,$.pattern(an)]]}):this.fb.group({key:["",[$.required,$.pattern(an)]],type:[this.rawData?"raw":this.valueTypeKeys[0]],value:["",[$.required,$.pattern(an)]],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]}),this.keysListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){let e=this.keysListFormArray.value.map((({reportStrategy:e,...t})=>({...t,...e&&{reportStrategy:e}})));if(this.keysType===Ni.CUSTOM){e={};for(let t of this.keysListFormArray.value)e[t.key]=t.value}this.keysDataApplied.emit(e)}prepareKeysFormArray(e){const t=[];return e&&(this.keysType===Ni.CUSTOM&&(e=Object.keys(e).map((t=>({key:t,value:e[t],type:""})))),e.forEach((e=>{let n;if(this.keysType===Ni.RPC_METHODS)n=this.fb.group({method:[e.method,[$.required]],arguments:[[...e.arguments],[]]});else if(this.keysType===Ni.CUSTOM){const{key:t,value:i}=e;n=this.fb.group({key:[t,[$.required,$.pattern(an)]],value:[i,[$.required,$.pattern(an)]]})}else{const{key:t,value:i,type:a,reportStrategy:r}=e;n=this.fb.group({key:[t,[$.required,$.pattern(an)]],type:[a],value:[i,[$.required,$.pattern(an)]],reportStrategy:[{value:r,disabled:this.isReportStrategyDisabled()}]})}t.push(n)}))),this.fb.array(t)}valueTitle(e){const t=this.keysType===Ni.RPC_METHODS?e.get("method").value:e.get("value").value;return ke(t)?"object"==typeof t?JSON.stringify(t):t:""}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keysType===Ni.ATTRIBUTES||this.keysType===Ni.TIMESERIES))}static{this.ɵfac=function(e){return new(e||yK)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(it.TbPopoverComponent),t.ɵɵdirectiveInject(Ye.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:yK,selectors:[["tb-mapping-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",connectorType:"connectorType",convertorType:"convertorType",sourceType:"sourceType",valueTypeEnum:"valueTypeEnum",valueTypes:"valueTypes",valueTypeKeys:"valueTypeKeys",rawData:"rawData",withReportStrategy:"withReportStrategy"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["rawOption",""],["rawText",""],[1,"tb-mapping-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex","flex-row","flex-wrap"],[4,"ngIf"],["tbTruncateWithTooltip","",1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["class","tb-form-panel no-border no-padding",4,"ngIf"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],[1,"tb-form-row"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs","flex","items-center","justify-between"],["appearance","outline","subscriptSizing","dynamic",1,"no-gap","flex","flex-1"],["matInput","","required","","formControlName","value",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-flex","align-center"],["class","tb-mat-18",3,"svgIcon",4,"ngIf"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["class","tb-mat-20",3,"svgIcon",4,"ngIf"],[1,"tb-mat-20",3,"svgIcon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],["matInput","","name","value","formControlName","method",3,"placeholder"],[1,"tb-settings"],[1,"flex","flex-wrap"],[1,"title-container",3,"tb-hint-tooltip-icon"],["formControlName","arguments"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"div",5),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,gK,2,2,"div",6),t.ɵɵelementStart(6,"div")(7,"button",7),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(10,fK,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",8)(13,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(11);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")",""),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,n.addKeyTitle)," "),t.ɵɵadvance(6),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(yK,[j,_,Xn,j$,o$]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] tb-value-input[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}Ge([I()],yK.prototype,"rawData",void 0),Ge([I()],yK.prototype,"withReportStrategy",void 0);const vK=()=>({maxWidth:"970px"}),xK=(e,t)=>[e,t];function bK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.topic-required"))}function wK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.QualityTranslationsMap.get(e))," ")}}function SK(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.ConvertorTypeTranslationsMap.get(e))," ")}}function CK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",41),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("convertorType",e.ConvertorTypeEnum.JSON)("deviceInfoType",e.DeviceInfoType.FULL)}}function _K(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",42),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.FULL)("convertorType",e.ConvertorTypeEnum.BYTES)("sourceTypes",t.ɵɵpureFunction2(3,xK,e.sourceTypesEnum.MSG,e.sourceTypesEnum.CONST))}}function TK(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",37),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function IK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function EK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function MK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",14)(1,"div",31)(2,"div",32),t.ɵɵtext(3,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",43)(5,"mat-chip-listbox",44),t.ɵɵtemplate(6,IK,2,1,"mat-chip",45),t.ɵɵelementStart(7,"mat-chip",46),t.ɵɵelement(8,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",48,0),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(10),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(12,"tb-icon",49),t.ɵɵtext(13,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(14,"div",31)(15,"div",32),t.ɵɵtext(16,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"div",43)(18,"mat-chip-listbox",44),t.ɵɵtemplate(19,EK,2,1,"mat-chip",45),t.ɵɵelementStart(20,"mat-chip",46),t.ɵɵelement(21,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"button",48,1),t.ɵɵpipe(24,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(23),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(25,"tb-icon",49),t.ɵɵtext(26,"edit"),t.ɵɵelementEnd()()()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",e.converterAttributes),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.converterAttributes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,6,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.converterTelemetry),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.converterTelemetry),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(24,8,"action.edit"))}}function kK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.extension-required"))}function PK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function DK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",14)(1,"div",21)(2,"div",50),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",23),t.ɵɵelement(7,"input",51),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,kK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",52)(11,"div",35),t.ɵɵtext(12,"gateway.extension-configuration"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",15),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",31)(17,"div",32),t.ɵɵtext(18,"gateway.keys"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",43)(20,"mat-chip-listbox",44),t.ɵɵtemplate(21,PK,2,1,"mat-chip",45),t.ɵɵelementStart(22,"mat-chip",46),t.ɵɵelement(23,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"button",48,2),t.ɵɵpipe(26,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(25),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.CUSTOM))})),t.ɵɵelementStart(27,"tb-icon",49),t.ɵɵtext(28,"edit"),t.ɵɵelementEnd()()()()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,8,"gateway.extension-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,10,"gateway.extension")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,12,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("converter.custom.extension").hasError("required")&&e.mappingForm.get("converter.custom.extension").touched),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,14,"gateway.extension-configuration-hint")),t.ɵɵadvance(6),t.ɵɵproperty("tbEllipsisChipList",e.customKeys),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.customKeys),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(26,16,"action.edit"))}}function OK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",22),t.ɵɵtext(2,"gateway.topic-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23),t.ɵɵelement(4,"input",24),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,bK,3,3,"mat-icon",25),t.ɵɵelement(7,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",21)(9,"div",27),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",23)(14,"mat-select",28),t.ɵɵtemplate(15,wK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(16,30),t.ɵɵelementStart(17,"div",31)(18,"div",32),t.ɵɵtext(19,"gateway.payload-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"tb-toggle-select",33),t.ɵɵtemplate(21,SK,3,4,"tb-toggle-option",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",34)(23,"div",35),t.ɵɵtext(24,"gateway.data-conversion"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",15),t.ɵɵtext(26),t.ɵɵpipe(27,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(28,36),t.ɵɵtemplate(29,CK,1,2,"ng-template",17)(30,_K,1,6,"ng-template",17)(31,TK,1,2,"tb-report-strategy",37)(32,MK,27,10,"div",38)(33,DK,29,18,"div",38),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("topicFilter").hasError("required")&&e.mappingForm.get("topicFilter").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/topic-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(24,vK)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,18,"gateway.response-topic-Qos-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,20,"gateway.mqtt-qos")," "),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.qualityTypes),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",e.convertorTypes),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(27,22,e.DataConversionTranslationsMap.get(e.converterType))," "),t.ɵɵadvance(2),t.ɵɵproperty("formGroupName",e.converterType)("ngSwitch",e.converterType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConvertorTypeEnum.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConvertorTypeEnum.BYTES),t.ɵɵadvance(),t.ɵɵconditional(e.data.withReportStrategy?31:-1),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.converterType===e.ConvertorTypeEnum.BYTES||e.converterType===e.ConvertorTypeEnum.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.converterType===e.ConvertorTypeEnum.CUSTOM)}}function AK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.RequestTypesTranslationsMap.get(e))," ")}}function FK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.topic-required"))}function RK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",22),t.ɵɵtext(2,"gateway.topic-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23),t.ɵɵelement(4,"input",57),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,FK,3,3,"mat-icon",25),t.ɵɵelement(7,"div",26),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,5,"gateway.set")),t.ɵɵproperty("formControl",e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter").hasError("required")&&e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/topic-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(7,vK))}}function BK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",58),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.FULL)}}function NK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",58),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.PARTIAL)}}function LK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function VK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-name-expression-required"))}function qK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function GK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-name-expression-required"))}function zK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-value-expression-required"))}function UK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function jK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",34)(1,"div",59),t.ɵɵtext(2,"gateway.from-device-request-settings"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",60),t.ɵɵtext(4," gateway.from-device-request-settings-hint "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",61)(6,"div",62)(7,"div",63),t.ɵɵtext(8,"gateway.device-info.device-name-expression"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",64)(10,"div",65)(11,"mat-form-field",23)(12,"mat-select",66),t.ɵɵtemplate(13,LK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(14,"mat-form-field",23),t.ɵɵelement(15,"input",67),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,VK,3,3,"mat-icon",25),t.ɵɵelement(18,"div",26),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",21)(20,"div",22),t.ɵɵtext(21,"gateway.attribute-name-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"div",64)(23,"div",65)(24,"mat-form-field",23)(25,"mat-select",68),t.ɵɵtemplate(26,qK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(27,"mat-form-field",23),t.ɵɵelement(28,"input",69),t.ɵɵpipe(29,"translate"),t.ɵɵtemplate(30,GK,3,3,"mat-icon",25),t.ɵɵelement(31,"div",26),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(32,"div",34)(33,"div",59),t.ɵɵtext(34,"gateway.to-device-response-settings"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"div",60),t.ɵɵtext(36," gateway.to-device-response-settings-hint "),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"div",21)(38,"div",22),t.ɵɵtext(39,"gateway.response-value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(40,"mat-form-field",23),t.ɵɵelement(41,"input",70),t.ɵɵpipe(42,"translate"),t.ɵɵtemplate(43,zK,3,3,"mat-icon",25),t.ɵɵelement(44,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"div",21)(46,"div",22),t.ɵɵtext(47,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(48,"mat-form-field",23),t.ɵɵelement(49,"input",71),t.ɵɵpipe(50,"translate"),t.ɵɵtemplate(51,UK,3,3,"mat-icon",25),t.ɵɵelement(52,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(53,"div",72)(54,"mat-slide-toggle",73)(55,"mat-label",74),t.ɵɵpipe(56,"translate"),t.ɵɵtext(57),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(13),t.ɵɵproperty("ngForOf",e.sourceTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.deviceInfo.deviceNameExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.deviceInfo.deviceNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(32,vK)),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",e.sourceTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(29,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.attributeNameExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.attributeNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(33,vK)),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(42,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(34,vK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(50,26,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.topicExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.topicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(35,vK)),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(56,28,"gateway.retain-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(58,30,"gateway.retain")," ")}}function HK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-filter-required"))}function WK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-filter-required"))}function $K(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-value-expression-required"))}function KK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function YK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",50),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",23),t.ɵɵelement(6,"input",75),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,HK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",21)(10,"div",50),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-form-field",23),t.ɵɵelement(15,"input",76),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,WK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",21)(19,"div",22),t.ɵɵtext(20,"gateway.response-value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",23),t.ɵɵelement(22,"input",70),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,$K,3,3,"mat-icon",25),t.ɵɵelement(25,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"div",21)(27,"div",22),t.ɵɵtext(28,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-form-field",23),t.ɵɵelement(30,"input",71),t.ɵɵpipe(31,"translate"),t.ɵɵtemplate(32,KK,3,3,"mat-icon",25),t.ɵɵelement(33,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",72)(35,"mat-slide-toggle",73)(36,"mat-label",74),t.ɵɵpipe(37,"translate"),t.ɵɵtext(38),t.ɵɵpipe(39,"translate"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,18,"gateway.device-name-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,20,"gateway.device-name-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.deviceNameFilter").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.deviceNameFilter").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,24,"gateway.attribute-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,26,"gateway.attribute-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,28,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.attributeFilter").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.attributeFilter").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,30,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(38,vK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(31,32,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.topicExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.topicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(39,vK)),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(37,34,"gateway.retain-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(39,36,"gateway.retain")," ")}}function XK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-filter-required"))}function ZK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-filter-required"))}function QK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.request-topic-expression-required"))}function JK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-expression-required"))}function eY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function tY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(4);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.QualityTranslationsMap.get(e))," ")}}function nY(e,n){if(1&e&&t.ɵɵelement(0,"tb-error-icon",84),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("tooltipText",e.responseTimeoutErrorTooltip)}}function iY(e,n){1&e&&(t.ɵɵelementStart(0,"span",85),t.ɵɵtext(1,"gateway.suffix.ms"),t.ɵɵelementEnd())}function aY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",21)(2,"div",22),t.ɵɵtext(3,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",23),t.ɵɵelement(5,"input",81),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,eY,3,3,"mat-icon",25),t.ɵɵelement(8,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",21)(10,"div",27),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-form-field",23)(15,"mat-select",82),t.ɵɵtemplate(16,tY,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(17,"div",21)(18,"div",22),t.ɵɵtext(19,"gateway.response-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"mat-form-field",23),t.ɵɵelement(21,"input",83),t.ɵɵpipe(22,"translate"),t.ɵɵtemplate(23,nY,1,1,"tb-error-icon",84)(24,iY,2,0,"span",85),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.responseTopicExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.responseTopicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(17,vK)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,11,"gateway.response-topic-Qos-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,13,"gateway.response-topic-Qos")," "),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.qualityTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").hasError("required")||e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").hasError("min"))&&e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").touched?23:24)}}function rY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",77)(1,"tb-toggle-select",33)(2,"tb-toggle-option",40),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-option",40),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",21)(9,"div",50),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",23),t.ɵɵelement(14,"input",75),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,XK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",21)(18,"div",50),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",23),t.ɵɵelement(23,"input",78),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,ZK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"div",21)(27,"div",22),t.ɵɵtext(28,"gateway.request-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-form-field",23),t.ɵɵelement(30,"input",79),t.ɵɵpipe(31,"translate"),t.ɵɵtemplate(32,QK,3,3,"mat-icon",25),t.ɵɵelement(33,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",21)(35,"div",22),t.ɵɵtext(36,"gateway.value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",23),t.ɵɵelement(38,"input",70),t.ɵɵpipe(39,"translate"),t.ɵɵtemplate(40,JK,3,3,"mat-icon",25),t.ɵɵelement(41,"div",26),t.ɵɵelementEnd()(),t.ɵɵtemplate(42,aY,25,18,"ng-container",80)),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("value",e.ServerSideRPCType.TWO_WAY),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,21,"gateway.with-response")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",e.ServerSideRPCType.ONE_WAY),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,23,"gateway.without-response")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,25,"gateway.device-name-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,27,"gateway.device-name-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,29,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.deviceNameFilter").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.deviceNameFilter").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(19,31,"gateway.method-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(21,33,"gateway.method-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,35,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.methodFilter").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.methodFilter").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(31,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.requestTopicExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.requestTopicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(41,vK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(39,39,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(42,vK)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.type").value===e.ServerSideRPCType.TWO_WAY)}}function oY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",32),t.ɵɵtext(2,"gateway.request-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23)(4,"mat-select",53),t.ɵɵtemplate(5,AK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(6,54)(7,55),t.ɵɵtemplate(8,RK,8,8,"div",56)(9,BK,1,1,"ng-template",17)(10,NK,1,1,"ng-template",17)(11,jK,59,36,"ng-template",17)(12,YK,40,40,"ng-template",17)(13,rY,43,43,"ng-template",17),t.ɵɵelementContainerEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.requestTypes),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e.mappingForm.get("requestValue").get(e.requestMappingType))("ngSwitch",e.requestMappingType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.requestMappingType===e.RequestTypeEnum.ATTRIBUTE_REQUEST||e.requestMappingType===e.RequestTypeEnum.CONNECT_REQUEST||e.requestMappingType===e.RequestTypeEnum.DISCONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.CONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.DISCONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.ATTRIBUTE_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.ATTRIBUTE_UPDATE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.SERVER_SIDE_RPC)}}function sY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function lY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-node-required"))}function pY(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",37),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function cY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function dY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function uY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function mY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function hY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",86)(1,"div",87)(2,"div",88),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"div",89)(7,"mat-form-field",90)(8,"mat-select",91),t.ɵɵtemplate(9,sY,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"mat-form-field",90),t.ɵɵelement(11,"input",92),t.ɵɵpipe(12,"translate"),t.ɵɵtemplate(13,lY,3,3,"mat-icon",25),t.ɵɵelement(14,"div",26),t.ɵɵpipe(15,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()(),t.ɵɵelement(16,"tb-device-info-table",93),t.ɵɵtemplate(17,pY,1,2,"tb-report-strategy",37),t.ɵɵelementStart(18,"div",31)(19,"div",32),t.ɵɵtext(20,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",43)(22,"mat-chip-listbox",44),t.ɵɵtemplate(23,cY,2,1,"mat-chip",45),t.ɵɵelementStart(24,"mat-chip",46),t.ɵɵelement(25,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"button",48,3),t.ɵɵpipe(28,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(27),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(29,"tb-icon",49),t.ɵɵtext(30,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(31,"div",31)(32,"div",32),t.ɵɵtext(33,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"div",43)(35,"mat-chip-listbox",44),t.ɵɵtemplate(36,dY,2,1,"mat-chip",45),t.ɵɵelementStart(37,"mat-chip",46),t.ɵɵelement(38,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"button",48,4),t.ɵɵpipe(41,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(40),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(42,"tb-icon",49),t.ɵɵtext(43,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(44,"div",31)(45,"div",32),t.ɵɵtext(46,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(47,"div",43)(48,"mat-chip-listbox",44),t.ɵɵtemplate(49,uY,2,1,"mat-chip",45),t.ɵɵelementStart(50,"mat-chip",46),t.ɵɵelement(51,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(52,"button",48,5),t.ɵɵpipe(54,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(53),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(55,"tb-icon",49),t.ɵɵtext(56,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(57,"div",31)(58,"div",32),t.ɵɵtext(59,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(60,"div",43)(61,"mat-chip-listbox",44),t.ɵɵtemplate(62,mY,2,1,"mat-chip",45),t.ɵɵelementStart(63,"mat-chip",46),t.ɵɵelement(64,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(65,"button",48,6),t.ɵɵpipe(67,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(66),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.RPC_METHODS))})),t.ɵɵelementStart(68,"tb-icon",49),t.ɵɵtext(69,"edit"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,23,"gateway.device-node-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,25,"gateway.device-node")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",t.ɵɵpureFunction2(41,xK,e.OPCUaSourceTypesEnum.PATH,e.OPCUaSourceTypesEnum.IDENTIFIER)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,27,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("deviceNodePattern").hasError("required")&&e.mappingForm.get("deviceNodePattern").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind3(15,29,e.ConnectorType.OPCUA,"device-node",e.mappingForm.get("deviceNodeSource").value))("tb-help-popup-style",t.ɵɵpureFunction0(44,vK)),t.ɵɵadvance(2),t.ɵɵproperty("connectorType",e.ConnectorType.OPCUA)("sourceTypes",e.OPCUaSourceTypes)("deviceInfoType",e.DeviceInfoType.FULL),t.ɵɵadvance(),t.ɵɵconditional(e.data.withReportStrategy?17:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",e.opcAttributes),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcAttributes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,33,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcTelemetry),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcTelemetry),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(41,35,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcAttributesUpdates),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcAttributesUpdates),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(54,37,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcRpcMethods),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcRpcMethods),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(67,39,"action.edit"))}}class gY extends A{constructor(e,t,n,i,a,r,o,s,l){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.translate=l,this.MappingType=Di,this.qualityTypes=zi,this.QualityTranslationsMap=ni,this.convertorTypes=Object.values(Jn),this.ConvertorTypeEnum=Jn,this.ConvertorTypeTranslationsMap=ii,this.sourceTypes=Object.values(ei),this.OPCUaSourceTypes=Object.values(Mi),this.OPCUaSourceTypesEnum=Mi,this.sourceTypesEnum=ei,this.SourceTypeTranslationsMap=Bi,this.requestTypes=Object.values(ai),this.RequestTypeEnum=ai,this.RequestTypesTranslationsMap=ri,this.DeviceInfoType=ga,this.ServerSideRPCType=Wi,this.MappingKeysType=Ni,this.MappingHintTranslationsMap=Hi,this.MappingTypeTranslationsMap=Oi,this.DataConversionTranslationsMap=oi,this.HelpLinkByMappingTypeMap=ji,this.ConnectorType=ct,this.ReportStrategyDefaultValue=en,this.keysPopupClosed=!0,this.destroy$=new te,this.createMappingForm()}get converterAttributes(){if(this.converterType)return this.mappingForm.get("converter").get(this.converterType).value.attributes.map((e=>e.key))}get converterTelemetry(){if(this.converterType)return this.mappingForm.get("converter").get(this.converterType).value.timeseries.map((e=>e.key))}get opcAttributes(){return this.mappingForm.get("attributes").value?.map((e=>e.key))||[]}get opcTelemetry(){return this.mappingForm.get("timeseries").value?.map((e=>e.key))||[]}get opcRpcMethods(){return this.mappingForm.get("rpc_methods").value?.map((e=>e.method))||[]}get opcAttributesUpdates(){return this.mappingForm.get("attributes_updates")?.value?.map((e=>e.key))||[]}get converterType(){return this.mappingForm.get("converter")?.get("type").value}get customKeys(){return Object.keys(this.mappingForm.get("converter").get("custom").value.extensionConfig)}get requestMappingType(){return this.mappingForm.get("requestType").value}get responseTimeoutErrorTooltip(){const e=this.mappingForm.get("requestValue.serverSideRpc.responseTimeout");return e.hasError("required")?this.translate.instant("gateway.response-timeout-required"):e.hasError("min")?this.translate.instant("gateway.response-timeout-limits-error",{min:1}):""}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}createMappingForm(){switch(this.data.mappingType){case Di.DATA:this.mappingForm=this.fb.group({}),this.createDataMappingForm();break;case Di.REQUESTS:this.mappingForm=this.fb.group({}),this.createRequestMappingForm();break;case Di.OPCUA:this.createOPCUAMappingForm()}}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){this.mappingForm.valid&&this.dialogRef.close(this.prepareMappingData())}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))this.popoverService.hidePopover(i);else{const e=(this.data.mappingType!==Di.OPCUA?this.mappingForm.get("converter").get(this.converterType):this.mappingForm).get(n),t={keys:e.value,keysType:n,rawData:this.mappingForm.get("converter.type")?.value===Jn.BYTES,panelTitle:Li.get(n),addKeyTitle:Vi.get(n),deleteKeyTitle:qi.get(n),noKeysText:Gi.get(n),withReportStrategy:this.data.withReportStrategy,connectorType:this.data.mappingType===Di.OPCUA?ct.OPCUA:ct.MQTT,convertorType:this.converterType};this.data.mappingType===Di.OPCUA&&(t.valueTypeKeys=Object.values(Mi),t.valueTypeEnum=Mi,t.valueTypes=Bi,t.sourceType=this.mappingForm.get("deviceNodeSource").value),this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,yK,"leftBottom",!1,null,t,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(le(this.destroy$)).subscribe((t=>{this.popoverComponent.hide(),e.patchValue(t),e.markAsDirty()})),this.popoverComponent.tbHideStart.pipe(le(this.destroy$)).subscribe((()=>{this.keysPopupClosed=!0}))}}prepareMappingData(){const e=this.mappingForm.value;switch(Te(e),this.data.mappingType){case Di.DATA:const{converter:t,topicFilter:n,subscriptionQos:i}=e,{reportStrategy:a,...r}=t[t.type];return{topicFilter:n,subscriptionQos:i,...a?{reportStrategy:a}:{},converter:{type:t.type,...r}};case Di.REQUESTS:return{requestType:e.requestType,requestValue:e.requestValue[e.requestType]};default:return e}}getFormValueData(){if(this.data.value&&Object.keys(this.data.value).length)switch(this.data.mappingType){case Di.DATA:const{converter:e,topicFilter:t,subscriptionQos:n,reportStrategy:i}=this.data.value;return{topicFilter:t,subscriptionQos:n,converter:{type:e.type,[e.type]:{...e,...i?{reportStrategy:i}:{}}}};case Di.REQUESTS:return{requestType:this.data.value.requestType,requestValue:{[this.data.value.requestType]:this.data.value.requestValue}};default:return this.data.value}}createDataMappingForm(){this.mappingForm.addControl("topicFilter",this.fb.control("",[$.required,$.pattern(an)])),this.mappingForm.addControl("subscriptionQos",this.fb.control(0)),this.mappingForm.addControl("converter",this.fb.group({type:[Jn.JSON,[]],json:this.fb.group({deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),bytes:this.fb.group({deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),custom:this.fb.group({extension:["",[$.required,$.pattern(an)]],extensionConfig:[{},[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]})})),this.mappingForm.patchValue(this.getFormValueData()),this.mappingForm.get("converter.type").valueChanges.pipe(be(this.mappingForm.get("converter.type").value),le(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("converter");t.get("json").disable({emitEvent:!1}),t.get("bytes").disable({emitEvent:!1}),t.get("custom").disable({emitEvent:!1}),t.get(e).enable({emitEvent:!1})}))}createRequestMappingForm(){this.mappingForm.addControl("requestType",this.fb.control(ai.CONNECT_REQUEST,[])),this.mappingForm.addControl("requestValue",this.fb.group({connectRequests:this.fb.group({topicFilter:["",[$.required,$.pattern(an)]],deviceInfo:[{},[]]}),disconnectRequests:this.fb.group({topicFilter:["",[$.required,$.pattern(an)]],deviceInfo:[{},[]]}),attributeRequests:this.fb.group({topicFilter:["",[$.required,$.pattern(an)]],deviceInfo:this.fb.group({deviceNameExpressionSource:[ei.MSG,[]],deviceNameExpression:["",[$.required]]}),attributeNameExpressionSource:[ei.MSG,[]],attributeNameExpression:["",[$.required,$.pattern(an)]],topicExpression:["",[$.required,$.pattern(an)]],valueExpression:["",[$.required,$.pattern(an)]],retain:[!1,[]]}),attributeUpdates:this.fb.group({deviceNameFilter:["",[$.required,$.pattern(an)]],attributeFilter:["",[$.required,$.pattern(an)]],topicExpression:["",[$.required,$.pattern(an)]],valueExpression:["",[$.required,$.pattern(an)]],retain:[!0,[]]}),serverSideRpc:this.fb.group({type:[Wi.TWO_WAY,[]],deviceNameFilter:["",[$.required,$.pattern(an)]],methodFilter:["",[$.required,$.pattern(an)]],requestTopicExpression:["",[$.required,$.pattern(an)]],responseTopicExpression:["",[$.required,$.pattern(an)]],valueExpression:["",[$.required,$.pattern(an)]],responseTopicQoS:[0,[]],responseTimeout:[1e4,[$.required,$.min(1)]]}),reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]})),this.mappingForm.get("requestType").valueChanges.pipe(be(this.mappingForm.get("requestType").value),le(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("requestValue");t.get("connectRequests").disable({emitEvent:!1}),t.get("disconnectRequests").disable({emitEvent:!1}),t.get("attributeRequests").disable({emitEvent:!1}),t.get("attributeUpdates").disable({emitEvent:!1}),t.get("serverSideRpc").disable({emitEvent:!1}),t.get(e).enable()})),this.mappingForm.get("requestValue.serverSideRpc.type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("requestValue.serverSideRpc");e===Wi.ONE_WAY?(t.get("responseTopicExpression").disable({emitEvent:!1}),t.get("responseTopicQoS").disable({emitEvent:!1}),t.get("responseTimeout").disable({emitEvent:!1})):(t.get("responseTopicExpression").enable({emitEvent:!1}),t.get("responseTopicQoS").enable({emitEvent:!1}),t.get("responseTimeout").enable({emitEvent:!1}))})),this.mappingForm.patchValue(this.getFormValueData())}createOPCUAMappingForm(){this.mappingForm=this.fb.group({deviceNodeSource:[Mi.PATH,[]],deviceNodePattern:["",[$.required]],deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],rpc_methods:[[],[]],attributes_updates:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.mappingForm.patchValue(this.getFormValueData())}static{this.ɵfac=function(e){return new(e||gY)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(He.TranslateService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:gY,selectors:[["tb-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:26,vars:19,consts:[["attributesButton",""],["telemetryButton",""],["keysButton",""],["opcAttributesButton",""],["opcTelemetryButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"key-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-hint","tb-primary-fill"],[3,"ngSwitch"],[3,"ngSwitchCase"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["matInput","","name","value","formControlName","topicFilter",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","subscriptionQos"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","converter"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[3,"formGroupName","ngSwitch"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],["class","tb-form-panel no-border no-padding",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["formControlName","deviceInfo","required","true",3,"convertorType","deviceInfoType"],["formControlName","deviceInfo","required","true",3,"deviceInfoType","convertorType","sourceTypes"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","name","value","formControlName","extension",3,"placeholder"],[1,"tb-form-row","space-between","same-padding","tb-flex","column"],["formControlName","requestType"],["formGroupName","requestValue"],[3,"formGroup","ngSwitch"],["class","tb-form-row column-xs",4,"ngIf"],["matInput","","name","value",3,"formControl","placeholder"],["formControlName","deviceInfo","required","true",3,"deviceInfoType"],["translate","",1,"tb-form-panel-title","tb-required"],["translate","",1,"tb-form-hint","tb-primary-fill"],["formGroupName","deviceInfo",1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-flex","no-flex","align-center"],["translate","",1,"tb-required"],[1,"flex","flex-1","gap-2"],[1,"flex","w-1/4"],["formControlName","deviceNameExpressionSource"],["matInput","","name","value","formControlName","deviceNameExpression",3,"placeholder"],["formControlName","attributeNameExpressionSource"],["matInput","","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matInput","","name","value","formControlName","valueExpression",3,"placeholder"],["matInput","","name","value","formControlName","topicExpression",3,"placeholder"],[1,"tb-form-row"],["formControlName","retain",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["matInput","","name","value","formControlName","deviceNameFilter",3,"placeholder"],["matInput","","name","value","formControlName","attributeFilter",3,"placeholder"],[1,"tb-flex","row","center","align-center","no-gap","fill-width"],["matInput","","name","value","formControlName","methodFilter",3,"placeholder"],["matInput","","name","value","formControlName","requestTopicExpression",3,"placeholder"],[4,"ngIf"],["matInput","","name","value","formControlName","responseTopicExpression",3,"placeholder"],["formControlName","responseTopicQoS"],["matInput","","name","value","type","number","min","1","formControlName","responseTimeout",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],[1,"device-node-row","tb-form-row","column-xs","pr-4"],["translate","",1,"tb-flex","no-flex","align-center","w-1/5"],[1,"tb-required",3,"tb-hint-tooltip-icon"],[1,"flex","w-1/5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","deviceNodeSource"],["matInput","","name","value","formControlName","deviceNodePattern",3,"placeholder"],["formControlName","deviceInfo","required","true",3,"connectorType","sourceTypes","deviceInfoType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",7)(1,"mat-toolbar",8)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",9)(6,"div",10),t.ɵɵelementStart(7,"button",11),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",12),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",13)(11,"div",14)(12,"div",15),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(15,16),t.ɵɵtemplate(16,OK,34,25,"ng-template",17)(17,oY,14,9,"ng-template",17)(18,hY,70,45,"ng-template",17),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",18)(20,"button",19),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"button",20),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,11,n.MappingTypeTranslationsMap.get(null==n.data?null:n.data.mappingType))),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.HelpLinkByMappingTypeMap.get(n.data.mappingType)),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,13,n.MappingHintTranslationsMap.get(null==n.data?null:n.data.mappingType))," "),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.data.mappingType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.OPCUA),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(22,15,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingForm.invalid||!n.mappingForm.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,17,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(gY,[j,_,o$,Gn,I$,Qn,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .key-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center;flex-wrap:nowrap}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .device-node-row.tb-form-row{gap:12px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}e("MappingDialogComponent",gY);const fY=["searchInput"],yY=()=>({minWidth:"96px",textAlign:"center"});function vY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",24)(2,"span",25),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,e.mappingTypeTranslationsMap.get(e.mappingType))),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search"))}}function xY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-header-cell",29),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext();t.ɵɵclassProp("request-column",n.mappingType===n.mappingTypeEnum.REQUESTS),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,3,e.title)," ")}}function bY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext().$implicit,a=t.ɵɵnextContext();t.ɵɵclassProp("request-column",a.mappingType===a.mappingTypeEnum.REQUESTS),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e[i.def]," ")}}function wY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,26),t.ɵɵtemplate(1,xY,3,5,"mat-header-cell",27)(2,bY,2,3,"mat-cell",28),t.ɵɵelementContainerEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("matColumnDef",e.def)}}function SY(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",31)}function CY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function _Y(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,CY,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",32),t.ɵɵelementContainer(4,33),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",34)(6,"button",35),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",36),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",37,2),t.ɵɵelementContainer(11,33),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,yY)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function TY(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",38)}function IY(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class EY{set mappingType(e){this.mappingTypeValue!==e&&(this.mappingTypeValue=e)}get mappingType(){return this.mappingTypeValue}constructor(e,t,n,i){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.required=!1,this.withReportStrategy=!0,this.mappingTypeTranslationsMap=Oi,this.mappingTypeEnum=Di,this.displayedColumns=[],this.mappingColumns=[],this.textSearchMode=!1,this.hidePageSize=!1,this.activeValue=!1,this.dirtyValue=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.onChange=()=>{},this.onTouched=()=>{},this.destroy$=new te,this.mappingFormGroup=this.fb.array([]),this.dirtyValue=!this.activeValue,this.dataSource=new MY}ngOnInit(){this.setMappingColumns(),this.displayedColumns.push(...this.mappingColumns.map((e=>e.def)),"actions"),this.mappingFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateTableData(e),this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(de(150),ce(((e,t)=>(e??"")===t.trim())),le(this.destroy$)).subscribe((e=>{const t=e.trim();this.updateTableData(this.mappingFormGroup.value,t.trim())}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.mappingFormGroup.clear(),this.pushDataAsFormArrays(e)}validate(){return!this.required||this.mappingFormGroup.controls.length?null:{mappingFormGroup:{valid:!1}}}enterFilterMode(){this.textSearchMode=!0,setTimeout((()=>{this.searchInputField.nativeElement.focus(),this.searchInputField.nativeElement.setSelectionRange(0,0)}),10)}exitFilterMode(){this.updateTableData(this.mappingFormGroup.value),this.textSearchMode=!1,this.textSearch.reset()}manageMapping(e,t){e&&e.stopPropagation();const n=ke(t)?this.mappingFormGroup.at(t).value:{};this.dialog.open(gY,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{mappingType:this.mappingType,value:n,buttonTitle:Ae(t)?"action.add":"action.apply",withReportStrategy:this.withReportStrategy}}).afterClosed().pipe(ye(1),le(this.destroy$)).subscribe((e=>{e&&(ke(t)?this.mappingFormGroup.at(t).patchValue(e):this.pushDataAsFormArrays([e]),this.mappingFormGroup.markAsDirty())}))}updateTableData(e,t){let n=e.map((e=>this.getMappingValue(e)));t&&(n=n.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(n)}deleteMapping(e,t){e&&e.stopPropagation();const n=this.mappingFormGroup.controls[t].value,i=n.deviceInfo?.deviceNameExpression??n.topicFilter??this.getRequestDetails(n);this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:i}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).subscribe((e=>{e&&(this.mappingFormGroup.removeAt(t),this.mappingFormGroup.markAsDirty())}))}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.mappingFormGroup.push(this.fb.control(e))))}getMappingValue(e){switch(this.mappingType){case Di.DATA:const t=ii.get(e.converter?.type);return{topicFilter:e.topicFilter,QoS:e.subscriptionQos,converter:t?this.translate.instant(t):""};case Di.REQUESTS:return{requestType:e.requestType,type:this.translate.instant(ri.get(e.requestType)),details:this.getRequestDetails(e)};case Di.OPCUA:const n=e.deviceInfo?.deviceNameExpression,i=e.deviceInfo?.deviceProfileExpression,{deviceNodePattern:a}=e;return{deviceNodePattern:a,deviceNamePattern:n,deviceProfileExpression:i};default:return{}}}getRequestDetails(e){let t;return t=e.requestType===ai.ATTRIBUTE_UPDATE?e.requestValue.attributeFilter:e.requestType===ai.SERVER_SIDE_RPC?e.requestValue.methodFilter:e.requestValue.topicFilter,t}setMappingColumns(){switch(this.mappingType){case Di.DATA:this.mappingColumns.push({def:"topicFilter",title:"gateway.topic-filter"},{def:"QoS",title:"gateway.mqtt-qos"},{def:"converter",title:"gateway.payload-type"});break;case Di.REQUESTS:this.mappingColumns.push({def:"type",title:"gateway.type"},{def:"details",title:"gateway.details"});break;case Di.OPCUA:this.mappingColumns.push({def:"deviceNodePattern",title:"gateway.device-node"},{def:"deviceNamePattern",title:"gateway.device-name"},{def:"deviceProfileExpression",title:"gateway.device-profile"})}}static{this.ɵfac=function(e){return new(e||EY)(t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:EY,selectors:[["tb-mapping-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(fY,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{required:"required",withReportStrategy:"withReportStrategy",mappingType:"mappingType"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>EY)),multi:!0},{provide:K,useExisting:c((()=>EY)),multi:!0}]),t.ɵɵStandaloneFeature],decls:40,vars:33,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-mapping-table","tb-absolute-fill"],[1,"tb-mapping-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-mapping-table-title"],[3,"matColumnDef"],["class","table-value-column",3,"request-column",4,"matHeaderCellDef"],["tbTruncateWithTooltip","","class","table-value-column",3,"request-column",4,"matCellDef"],[1,"table-value-column"],["tbTruncateWithTooltip","",1,"table-value-column"],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,vY,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵtemplate(23,wY,3,1,"ng-container",14),t.ɵɵelementContainerStart(24,15),t.ɵɵtemplate(25,SY,1,0,"mat-header-cell",16)(26,_Y,12,6,"mat-cell",17),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(27,TY,1,0,"mat-header-row",18)(28,IY,1,0,"mat-row",19),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"section",20),t.ɵɵpipe(30,"async"),t.ɵɵelementStart(31,"button",21),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(32,"mat-icon",22),t.ɵɵtext(33,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"span"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(37,"span",23),t.ɵɵpipe(38,"async"),t.ɵɵtext(39," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,19,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,21,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,23,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,25,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.mappingColumns),t.ɵɵadvance(4),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(30,27,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,29,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(38,31,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(EY,[j,_,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content.tb-outlined-border[_ngcontent-%COMP%]{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .tb-mapping-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:21%}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column.request-column[_ngcontent-%COMP%]{width:35%}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .ellipsis[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-mapping-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("MappingTableComponent",EY),Ge([I()],EY.prototype,"required",void 0),Ge([I()],EY.prototype,"withReportStrategy",void 0);let MY=class extends G{constructor(){super()}};function kY(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",7),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SecurityTypeTranslationsMap.get(e))," ")}}function PY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",18),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function DY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",10)(4,"mat-form-field",11),t.ɵɵelement(5,"input",12),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,PY,3,3,"mat-icon",13),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",8)(9,"div",14),t.ɵɵtext(10,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",10)(12,"mat-form-field",11),t.ɵɵelement(13,"input",15),t.ɵɵpipe(14,"translate"),t.ɵɵelementStart(15,"div",16),t.ɵɵelement(16,"tb-toggle-password",17),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,3,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,5,"gateway.set"))}}function OY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",7),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function AY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",18),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function FY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",8)(2,"div",14),t.ɵɵtext(3,"gateway.mode"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",10)(5,"mat-form-field",11)(6,"mat-select",25),t.ɵɵtemplate(7,OY,2,2,"mat-option",4),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(8,"div",8)(9,"div",14),t.ɵɵtext(10,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",10)(12,"mat-form-field",11),t.ɵɵelement(13,"input",12),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,AY,3,3,"mat-icon",13),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",8)(17,"div",14),t.ɵɵtext(18,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",10)(20,"mat-form-field",11),t.ɵɵelement(21,"input",15),t.ɵɵpipe(22,"translate"),t.ɵɵelementStart(23,"div",16),t.ɵɵelement(24,"tb-toggle-password",17),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",e.modeTypes),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,6,"gateway.set"))}}function RY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",8)(4,"div",20),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",10)(8,"mat-form-field",11),t.ɵɵelement(9,"input",21),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",8)(12,"div",20),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"div",10)(16,"mat-form-field",11),t.ɵɵelement(17,"input",22),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",8)(20,"div",20),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"div",10)(24,"mat-form-field",11),t.ɵɵelement(25,"input",23),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(27,FY,25,8,"ng-container",24)),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,8,"gateway.path-hint")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,10,"gateway.CA-certificate-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(10,12,"gateway.set")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,14,"gateway.private-key-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(18,16,"gateway.set")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,18,"gateway.client-cert-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mode()===e.SecurityMode.extendedCertificates)}}e("MappingDatasource",MY);class BY{constructor(e,t){this.fb=e,this.cdr=t,this.title="gateway.security",this.mode=l($i.certificates),this.BrokerSecurityType=ki,this.SecurityMode=$i,this.securityTypes=Object.values(ki),this.modeTypes=Object.values(Pi),this.SecurityTypeTranslationsMap=Ri,this.destroy$=new te,o((()=>{this.mode()===$i.basic&&(this.securityTypes=this.securityTypes.filter((e=>e!==ki.CERTIFICATES)))}))}ngOnInit(){this.securityFormGroup=this.fb.group({type:[ki.ANONYMOUS,[]],username:["",[$.required,$.pattern(an)]],password:["",[$.pattern(an)]],pathToCACert:["",[$.pattern(an)]],pathToPrivateKey:["",[$.pattern(an)]],pathToClientCert:["",[$.pattern(an)]]}),this.mode()===$i.extendedCertificates&&this.securityFormGroup.addControl("mode",this.fb.control(Pi.NONE,[])),this.securityFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{Te(e),this.onChange(e),this.onTouched()})),this.securityFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateValidators(e)))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}writeValue(e){if(e)e.type||(e.type=ki.ANONYMOUS),this.updateValidators(e.type),this.securityFormGroup.reset(e,{emitEvent:!1});else{const e={type:ki.ANONYMOUS};this.securityFormGroup.reset(e,{emitEvent:!1})}this.cdr.markForCheck()}validate(){return this.securityFormGroup.get("type").value!==ki.BASIC||this.securityFormGroup.valid?null:{securityForm:{valid:!1}}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}updateValidators(e){if(e)if(this.securityFormGroup.get("username").disable({emitEvent:!1}),this.securityFormGroup.get("password").disable({emitEvent:!1}),this.securityFormGroup.get("pathToCACert").disable({emitEvent:!1}),this.securityFormGroup.get("pathToPrivateKey").disable({emitEvent:!1}),this.securityFormGroup.get("pathToClientCert").disable({emitEvent:!1}),this.securityFormGroup.get("mode")?.disable({emitEvent:!1}),e===ki.BASIC)this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1});else if(e===ki.CERTIFICATES&&(this.securityFormGroup.get("pathToCACert").enable({emitEvent:!1}),this.securityFormGroup.get("pathToPrivateKey").enable({emitEvent:!1}),this.securityFormGroup.get("pathToClientCert").enable({emitEvent:!1}),this.mode()===$i.extendedCertificates)){const e=this.securityFormGroup.get("mode");e&&!e.value&&e.setValue(Pi.NONE,{emitEvent:!1}),e?.enable({emitEvent:!1}),this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1})}}static{this.ɵfac=function(e){return new(e||BY)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:BY,selectors:[["tb-security-config"]],inputs:{title:"title",mode:[1,"mode"]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>BY)),multi:!0},{provide:K,useExisting:c((()=>BY)),multi:!0}]),t.ɵɵStandaloneFeature],decls:10,vars:8,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],[1,"fixed-title-width","tb-required"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"ngSwitchCase"],[3,"value"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","username",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width"],["matInput","","type","password","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"tb-form-hint","tb-primary-fill"],["tbTruncateWithTooltip","",1,"fixed-title-width"],["matInput","","name","value","formControlName","pathToCACert",3,"placeholder"],["matInput","","name","value","formControlName","pathToPrivateKey",3,"placeholder"],["matInput","","name","value","formControlName","pathToClientCert",3,"placeholder"],[4,"ngIf"],["formControlName","mode"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",3),t.ɵɵtemplate(6,kY,3,4,"tb-toggle-option",4),t.ɵɵelementEnd()(),t.ɵɵelementContainerStart(7,5),t.ɵɵtemplate(8,DY,17,7,"ng-template",6)(9,RY,28,22,"ng-template",6),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,6,n.title)),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.securityTypes),t.ɵɵadvance(),t.ɵɵproperty("ngSwitch",n.securityFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.BrokerSecurityType.BASIC),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.BrokerSecurityType.CERTIFICATES))},dependencies:t.ɵɵgetComponentDepsFactory(BY,[j,_,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}'],changeDetection:d.OnPush})}}e("SecurityConfigComponent",BY);const NY=()=>({min:1e3}),LY=()=>({min:50}),VY=()=>({min:100});function qY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.server-url-required"))}function GY(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",9),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.timeout-error",t.ɵɵpureFunction0(4,NY)))}function zY(e,n){1&e&&(t.ɵɵelementStart(0,"span",10),t.ɵɵtext(1,"gateway.suffix.ms"),t.ɵɵelementEnd())}function UY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",22),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.value),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name)}}function jY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.scan-period-error",t.ɵɵpureFunction0(4,NY)))}function HY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.poll-period-error",t.ɵɵpureFunction0(4,LY)))}function WY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",6),t.ɵɵpipe(2,"translate"),t.ɵɵelementStart(3,"div",7),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"mat-form-field",3),t.ɵɵelement(7,"input",23),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,HY,3,5,"mat-icon",5),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,4,"gateway.hints.poll-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,6,"gateway.poll-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.serverConfigFormGroup.get("pollPeriodInMillis").hasError("required")||e.serverConfigFormGroup.get("pollPeriodInMillis").hasError("min"))&&e.serverConfigFormGroup.get("pollPeriodInMillis").touched)}}function $Y(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.sub-check-period-error",t.ɵɵpureFunction0(4,VY)))}class KY{constructor(e){this.fb=e,this.hideNewFields=!1,this.securityPolicyTypes=Fi,this.SecurityMode=$i,this.destroy$=new te,this.serverConfigFormGroup=this.fb.group({url:["",[$.required,$.pattern(an)]],timeoutInMillis:[1e3,[$.required,$.min(1e3)]],scanPeriodInMillis:[z,[$.required,$.min(1e3)]],pollPeriodInMillis:[5e3,[$.required,$.min(50)]],enableSubscriptions:[!0,[]],subCheckPeriodInMillis:[100,[$.required,$.min(100)]],showMap:[!1,[]],security:[Ai.BASIC128,[]],identity:[]}),this.serverConfigFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngAfterViewInit(){this.hideNewFields&&this.serverConfigFormGroup.get("pollPeriodInMillis").disable({emitEvent:!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.serverConfigFormGroup.valid?null:{serverConfigFormGroup:{valid:!1}}}writeValue(e){const{timeoutInMillis:t=1e3,scanPeriodInMillis:n=z,pollPeriodInMillis:i=5e3,enableSubscriptions:a=!0,subCheckPeriodInMillis:r=100,showMap:o=!1,security:s=Ai.BASIC128,identity:l={}}=e;this.serverConfigFormGroup.reset({...e,timeoutInMillis:t,scanPeriodInMillis:n,pollPeriodInMillis:i,enableSubscriptions:a,subCheckPeriodInMillis:r,showMap:o,security:s,identity:l},{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||KY)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:KY,selectors:[["tb-opc-server-config"]],inputs:{hideNewFields:"hideNewFields"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>KY)),multi:!0},{provide:K,useExisting:c((()=>KY)),multi:!0}]),t.ɵɵStandaloneFeature],decls:63,vars:56,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["tbTruncateWithTooltip","","translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","url",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip",""],["matInput","","type","number","min","1000","name","value","formControlName","timeoutInMillis",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],["formControlName","security"],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","number","min","1000","name","value","formControlName","scanPeriodInMillis",3,"placeholder"],["class","tb-form-row column-xs",4,"ngIf"],["matInput","","type","number","min","100","name","value","formControlName","subCheckPeriodInMillis",3,"placeholder"],[1,"tb-form-row"],["formControlName","enableSubscriptions",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","showMap",1,"mat-slide"],["formControlName","identity",3,"mode"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["matInput","","type","number","min","50","name","value","formControlName","pollPeriodInMillis",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.server-url"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",3),t.ɵɵelement(5,"input",4),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,qY,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",6),t.ɵɵpipe(10,"translate"),t.ɵɵelementStart(11,"div",7),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-form-field",3),t.ɵɵelement(15,"input",8),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,GY,2,5,"tb-error-icon",9)(18,zY,2,0,"span",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",1)(20,"div",6),t.ɵɵpipe(21,"translate"),t.ɵɵelementStart(22,"div",7),t.ɵɵtext(23),t.ɵɵpipe(24,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(25,"mat-form-field",3)(26,"mat-select",11),t.ɵɵtemplate(27,UY,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(28,"div",1)(29,"div",6),t.ɵɵpipe(30,"translate"),t.ɵɵelementStart(31,"div",7),t.ɵɵtext(32),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"mat-form-field",3),t.ɵɵelement(35,"input",13),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,jY,3,5,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵtemplate(38,WY,10,10,"div",14),t.ɵɵelementStart(39,"div",1)(40,"div",6),t.ɵɵpipe(41,"translate"),t.ɵɵelementStart(42,"div",7),t.ɵɵtext(43),t.ɵɵpipe(44,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"mat-form-field",3),t.ɵɵelement(46,"input",15),t.ɵɵpipe(47,"translate"),t.ɵɵtemplate(48,$Y,3,5,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(49,"div",16)(50,"mat-slide-toggle",17)(51,"mat-label",18),t.ɵɵpipe(52,"translate"),t.ɵɵelementStart(53,"div",7),t.ɵɵtext(54),t.ɵɵpipe(55,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(56,"div",16)(57,"mat-slide-toggle",19)(58,"mat-label",18),t.ɵɵpipe(59,"translate"),t.ɵɵtext(60),t.ɵɵpipe(61,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelement(62,"tb-security-config",20),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.serverConfigFormGroup),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.serverConfigFormGroup.get("url").hasError("required")&&n.serverConfigFormGroup.get("url").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,26,"gateway.hints.opc-timeout")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,28,"gateway.timeout")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,30,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((n.serverConfigFormGroup.get("timeoutInMillis").hasError("required")||n.serverConfigFormGroup.get("timeoutInMillis").hasError("min"))&&n.serverConfigFormGroup.get("timeoutInMillis").touched?17:18),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,32,"gateway.hints.security-policy")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(24,34,"gateway.security-policy")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",n.securityPolicyTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(30,36,"gateway.hints.scan-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(33,38,"gateway.scan-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,40,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.serverConfigFormGroup.get("scanPeriodInMillis").hasError("required")||n.serverConfigFormGroup.get("scanPeriodInMillis").hasError("min"))&&n.serverConfigFormGroup.get("scanPeriodInMillis").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.hideNewFields),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(41,42,"gateway.hints.sub-check-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(44,44,"gateway.sub-check-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(47,46,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.serverConfigFormGroup.get("subCheckPeriodInMillis").hasError("required")||n.serverConfigFormGroup.get("subCheckPeriodInMillis").hasError("min"))&&n.serverConfigFormGroup.get("subCheckPeriodInMillis").touched),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(52,48,"gateway.hints.enable-subscription")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(55,50,"gateway.enable-subscription")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(59,52,"gateway.hints.show-map")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(61,54,"gateway.show-map")," "),t.ɵɵadvance(2),t.ɵɵproperty("mode",n.SecurityMode.extendedCertificates))},dependencies:t.ɵɵgetComponentDepsFactory(KY,[j,_,BY,qn,Qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}'],changeDetection:d.OnPush})}}e("OpcServerConfigComponent",KY),Ge([I()],KY.prototype,"hideNewFields",void 0);class YY extends Ba{constructor(){super(...arguments),this.withReportStrategy=!0,this.mappingTypes=Di,this.isLegacy=!0}initBasicFormGroup(){return this.fb.group({mapping:[],server:[]})}mapConfigToFormValue(e){return{server:e.server?ja.mapServerToUpgradedVersion(e.server):{},mapping:e.server?.mapping?ja.mapMappingToUpgradedVersion(e.server.mapping):[]}}getMappedValue(e){return{server:ja.mapServerToDowngradedVersion(e)}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(YY)))(n||YY)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:YY,selectors:[["tb-opc-ua-legacy-basic-config"]],inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>YY)),multi:!0},{provide:K,useExisting:c((()=>YY)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server",3,"hideNewFields"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"required","withReportStrategy","mappingType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-opc-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,11,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,13,"gateway.server"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("hideNewFields",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,15,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("required",!0)("withReportStrategy",n.withReportStrategy)("mappingType",n.mappingTypes.OPCUA))},dependencies:t.ɵɵgetComponentDepsFactory(YY,[j,_,BY,EY,KY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("OpcUaLegacyBasicConfigComponent",YY),Ge([I()],YY.prototype,"withReportStrategy",void 0);class XY extends Ba{constructor(){super(...arguments),this.withReportStrategy=!0,this.mappingTypes=Di,this.isLegacy=!1}initBasicFormGroup(){return this.fb.group({mapping:[],server:[]})}mapConfigToFormValue(e){return{server:e.server??{},mapping:e.mapping??[]}}getMappedValue(e){return{server:e.server,mapping:e.mapping}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(XY)))(n||XY)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:XY,selectors:[["tb-opc-ua-basic-config"]],inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>XY)),multi:!0},{provide:K,useExisting:c((()=>XY)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server",3,"hideNewFields"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"required","withReportStrategy","mappingType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-opc-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,11,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,13,"gateway.server"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("hideNewFields",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,15,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("required",!0)("withReportStrategy",n.withReportStrategy)("mappingType",n.mappingTypes.OPCUA))},dependencies:t.ɵɵgetComponentDepsFactory(XY,[j,_,BY,EY,KY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("OpcUaBasicConfigComponent",XY),Ge([I()],XY.prototype,"withReportStrategy",void 0);class ZY extends Ba{constructor(){super(...arguments),this.withReportStrategy=!0,this.MappingType=Di}initBasicFormGroup(){return this.fb.group({mapping:[],requestsMapping:[],broker:[],workers:[]})}getRequestDataArray(e){const t=[];return Fe(e)&&Object.keys(e).forEach((n=>{for(const i of e[n])t.push({requestType:n,requestValue:i})})),t}getRequestDataObject(e){return e.reduce(((e,{requestType:t,requestValue:n})=>(e[t].push(n),e)),{connectRequests:[],disconnectRequests:[],attributeRequests:[],attributeUpdates:[],serverSideRpc:[]})}getBrokerMappedValue(e,t){return{...e,maxNumberOfWorkers:t.maxNumberOfWorkers??100,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker??10}}writeValue(e){this.basicFormGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(ZY)))(n||ZY)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:ZY,inputs:{withReportStrategy:"withReportStrategy"},features:[t.ɵɵInheritDefinitionFeature]})}}function QY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",8),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.max-number-of-workers-required"))}function JY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",8),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.max-messages-queue-for-worker-required"))}e("MqttBasicConfigDirective",ZY),Ge([I()],ZY.prototype,"withReportStrategy",void 0);class eX{constructor(e){this.fb=e,this.destroy$=new te,this.workersConfigFormGroup=this.fb.group({maxNumberOfWorkers:[100,[$.required,$.min(1)]],maxMessageNumberPerWorker:[10,[$.required,$.min(1)]]}),this.workersConfigFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){const{maxNumberOfWorkers:t,maxMessageNumberPerWorker:n}=e;this.workersConfigFormGroup.reset({maxNumberOfWorkers:t||100,maxMessageNumberPerWorker:n||10},{emitEvent:!1})}validate(){return this.workersConfigFormGroup.valid?null:{workersConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||eX)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:eX,selectors:[["tb-workers-config-control"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>eX)),multi:!0},{provide:K,useExisting:c((()=>eX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:21,vars:21,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",2,"width","50%",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip",""],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","type","number","min","1","formControlName","maxNumberOfWorkers",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","name","value","type","number","min","1","formControlName","maxMessageNumberPerWorker",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"div",3),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"mat-form-field",4),t.ɵɵelement(8,"input",5),t.ɵɵpipe(9,"translate"),t.ɵɵtemplate(10,QY,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"div",1)(12,"div",2),t.ɵɵpipe(13,"translate"),t.ɵɵelementStart(14,"div",3),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"mat-form-field",4),t.ɵɵelement(18,"input",7),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,JY,3,3,"mat-icon",6),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.workersConfigFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,9,"gateway.max-number-of-workers-hint")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,11,"gateway.max-number-of-workers")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(9,13,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.workersConfigFormGroup.get("maxNumberOfWorkers").hasError("min")||n.workersConfigFormGroup.get("maxNumberOfWorkers").hasError("required")&&n.workersConfigFormGroup.get("maxNumberOfWorkers").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(13,15,"gateway.max-messages-queue-for-worker-hint")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,17,"gateway.max-messages-queue-for-worker")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,19,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.workersConfigFormGroup.get("maxMessageNumberPerWorker").hasError("min")||n.workersConfigFormGroup.get("maxMessageNumberPerWorker").hasError("required")&&n.workersConfigFormGroup.get("maxMessageNumberPerWorker").touched))},dependencies:t.ɵɵgetComponentDepsFactory(eX,[j,_,qn]),encapsulation:2,changeDetection:d.OnPush})}}function tX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",13),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function nX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",13),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.brokerConfigFormGroup.get("port")))}}function iX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",14),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.value),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name)}}function aX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",15),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("clientId"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.generate-client-id"))}e("WorkersConfigControlComponent",eX);class rX{constructor(e,t){this.fb=e,this.cdr=t,this.mqttVersions=ti,this.portLimits=Ii,this.destroy$=new te,this.brokerConfigFormGroup=this.fb.group({host:["",[$.required,$.pattern(an)]],port:[null,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],version:[5,[]],clientId:["tb_gw_"+Re(5),[$.pattern(an)]],security:[]}),this.brokerConfigFormGroup.valueChanges.subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}generate(e){this.brokerConfigFormGroup.get(e)?.patchValue("tb_gw_"+Re(5))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){const{version:t=5,clientId:n=`tb_gw_${Re(5)}`,security:i={}}=e;this.brokerConfigFormGroup.reset({...e,version:t,clientId:n,security:i},{emitEvent:!1}),this.cdr.markForCheck()}validate(){return this.brokerConfigFormGroup.valid?null:{brokerConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||rX)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:rX,selectors:[["tb-broker-config-control"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>rX)),multi:!0},{provide:K,useExisting:c((()=>rX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:29,vars:16,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["translate","",1,"fixed-title-width"],["formControlName","version"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","value","formControlName","clientId",3,"placeholder"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip","click",4,"ngIf"],["formControlName","security"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",3),t.ɵɵelement(5,"input",4),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,tX,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",2),t.ɵɵtext(10,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",3),t.ɵɵelement(12,"input",6),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,nX,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"div",1)(16,"div",7),t.ɵɵtext(17,"gateway.mqtt-version"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"mat-form-field",3)(19,"mat-select",8),t.ɵɵtemplate(20,iX,2,2,"mat-option",9),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",1)(22,"div",7),t.ɵɵtext(23,"gateway.client-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(24,"mat-form-field",3),t.ɵɵelement(25,"input",10),t.ɵɵpipe(26,"translate"),t.ɵɵtemplate(27,aX,4,3,"button",11),t.ɵɵelementEnd()(),t.ɵɵelement(28,"tb-security-config",12),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.brokerConfigFormGroup),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.brokerConfigFormGroup.get("host").hasError("required")&&n.brokerConfigFormGroup.get("host").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,12,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.brokerConfigFormGroup.get("port").hasError("required")||n.brokerConfigFormGroup.get("port").hasError("min")||n.brokerConfigFormGroup.get("port").hasError("max"))&&n.brokerConfigFormGroup.get("port").touched),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.mqttVersions),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,14,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",!n.brokerConfigFormGroup.get("clientId").value))},dependencies:t.ɵɵgetComponentDepsFactory(rX,[j,_,BY,r$]),encapsulation:2,changeDetection:d.OnPush})}}e("BrokerConfigControlComponent",rX);class oX extends ZY{mapConfigToFormValue(e){const{broker:t,mapping:n=[],requestsMapping:i}=e;return{workers:t&&(t.maxNumberOfWorkers||t.maxMessageNumberPerWorker)?{maxNumberOfWorkers:t.maxNumberOfWorkers,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker}:{},mapping:n??[],broker:t??{},requestsMapping:this.getRequestDataArray(i)}}getMappedValue(e){const{broker:t,workers:n,mapping:i,requestsMapping:a}=e||{};return{broker:this.getBrokerMappedValue(t,n),mapping:i,requestsMapping:a?.length?this.getRequestDataObject(a):{}}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(oX)))(n||oX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:oX,selectors:[["tb-mqtt-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>oX)),multi:!0},{provide:K,useExisting:c((()=>oX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:24,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","broker"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"withReportStrategy","required","mappingType"],["formControlName","requestsMapping",3,"withReportStrategy","mappingType"],[1,"tb-form-panel","no-border","no-padding"],["formControlName","workers"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-broker-config-control",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",1),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"div",4),t.ɵɵelement(14,"tb-mapping-table",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-tab",1),t.ɵɵpipe(16,"translate"),t.ɵɵelementStart(17,"div",7),t.ɵɵelement(18,"tb-workers-config-control",8),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,14,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,16,"gateway.broker.connection"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,18,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("required",!0)("mappingType",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,20,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("mappingType",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(16,22,"gateway.workers-settings")))},dependencies:t.ɵɵgetComponentDepsFactory(oX,[j,_,eX,rX,EY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("MqttBasicConfigComponent",oX);class sX extends ZY{mapConfigToFormValue(e){const{broker:t,mapping:n=[],connectRequests:i=[],disconnectRequests:a=[],attributeRequests:r=[],attributeUpdates:o=[],serverSideRpc:s=[]}=e,l=Pa.mapRequestsToUpgradedVersion({connectRequests:i,disconnectRequests:a,attributeRequests:r,attributeUpdates:o,serverSideRpc:s});return{workers:t&&(t.maxNumberOfWorkers||t.maxMessageNumberPerWorker)?{maxNumberOfWorkers:t.maxNumberOfWorkers,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker}:{},mapping:Pa.mapMappingToUpgradedVersion(n)||[],broker:t||{},requestsMapping:this.getRequestDataArray(l)}}getMappedValue(e){const{broker:t,workers:n,mapping:i,requestsMapping:a}=e||{},r=a?.length?this.getRequestDataObject(a):{};return{broker:this.getBrokerMappedValue(t,n),mapping:Pa.mapMappingToDowngradedVersion(i),...Pa.mapRequestsToDowngradedVersion(r)}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(sX)))(n||sX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:sX,selectors:[["tb-mqtt-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>sX)),multi:!0},{provide:K,useExisting:c((()=>sX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:24,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","broker"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"withReportStrategy","required","mappingType"],["formControlName","requestsMapping",3,"withReportStrategy","mappingType"],[1,"tb-form-panel","no-border","no-padding"],["formControlName","workers"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-broker-config-control",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",1),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"div",4),t.ɵɵelement(14,"tb-mapping-table",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-tab",1),t.ɵɵpipe(16,"translate"),t.ɵɵelementStart(17,"div",7),t.ɵɵelement(18,"tb-workers-config-control",8),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,14,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,16,"gateway.broker.connection"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,18,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("required",!0)("mappingType",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,20,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("mappingType",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(16,22,"gateway.workers-settings")))},dependencies:t.ɵɵgetComponentDepsFactory(sX,[j,_,eX,rX,EY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("MqttLegacyBasicConfigComponent",sX);class lX extends A{constructor(e,t,n,i,a){super(t,n,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a,this.portLimits=Ii,this.modbusProtocolTypes=Object.values(Ki),this.modbusMethodTypes=Object.values(Yi),this.modbusSerialMethodTypes=Object.values(Xi),this.modbusParities=Object.values(Zi),this.modbusByteSizes=na,this.modbusBaudrates=ta,this.modbusOrderType=Object.values(Qi),this.ModbusProtocolType=Ki,this.ModbusParityLabelsMap=la,this.ModbusProtocolLabelsMap=sa,this.ModbusMethodLabelsMap=oa,this.ReportStrategyDefaultValue=en,this.modbusHelpLink=O+"/docs/iot-gateway/config/modbus/#section-master-description-and-configuration-parameters",this.serialSpecificControlKeys=["serialPort","baudrate","stopbits","bytesize","parity","strict"],this.tcpUdpSpecificControlKeys=["port","security","host"],this.destroy$=new te,this.showSecurityControl=this.fb.control(!1),this.initializeSlaveFormGroup(),this.updateSlaveFormGroup(),this.updateControlsEnabling(this.data.value.type),this.observeTypeChange(),this.observeShowSecurity(),this.showSecurityControl.patchValue(!!this.data.value.security&&!Se(this.data.value.security,{}))}get protocolType(){return this.slaveConfigFormGroup.get("type").value}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}cancel(){this.dialogRef.close(null)}add(){this.slaveConfigFormGroup.valid&&this.dialogRef.close(this.getSlaveResultData())}initializeSlaveFormGroup(){this.slaveConfigFormGroup=this.fb.group({type:[Ki.TCP],host:["",[$.required,$.pattern(an)]],port:[null,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],serialPort:["",[$.required,$.pattern(an)]],method:[Yi.SOCKET,[$.required]],baudrate:[this.modbusBaudrates[0]],stopbits:[1],bytesize:[na[0]],parity:[Zi.None],strict:[!0],unitId:[null,[$.required]],deviceName:["",[$.required,$.pattern(an)]],deviceType:["",[$.required,$.pattern(an)]],timeout:[35],byteOrder:[Qi.BIG],wordOrder:[Qi.BIG],retries:[!0],retryOnEmpty:[!0],retryOnInvalid:[!0],pollPeriod:[1e3,[$.required]],connectAttemptTimeMs:[500,[$.required]],connectAttemptCount:[5,[$.required]],waitAfterFailedAttemptsMs:[3e4,[$.required]],values:[{}],security:[{}]}),this.addFieldsToFormGroup()}updateSlaveFormGroup(){this.slaveConfigFormGroup.patchValue({...this.data.value,port:this.data.value.type===Ki.Serial?null:this.data.value.port,serialPort:this.data.value.type===Ki.Serial?this.data.value.port:"",values:{attributes:this.data.value.attributes??[],timeseries:this.data.value.timeseries??[],attributeUpdates:this.data.value.attributeUpdates??[],rpc:this.data.value.rpc??[]}})}observeTypeChange(){this.slaveConfigFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateControlsEnabling(e),this.updateMethodType(e)}))}updateMethodType(e){this.slaveConfigFormGroup.get("method").value!==Yi.RTU&&this.slaveConfigFormGroup.get("method").patchValue(e===Ki.Serial?Xi.ASCII:Yi.SOCKET,{emitEvent:!1})}updateControlsEnabling(e){const[t,n]=e===Ki.Serial?[this.serialSpecificControlKeys,this.tcpUdpSpecificControlKeys]:[this.tcpUdpSpecificControlKeys,this.serialSpecificControlKeys];t.forEach((e=>this.slaveConfigFormGroup.get(e)?.enable({emitEvent:!1}))),n.forEach((e=>this.slaveConfigFormGroup.get(e)?.disable({emitEvent:!1}))),this.updateSecurityEnabling(this.showSecurityControl.value)}observeShowSecurity(){this.showSecurityControl.valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateSecurityEnabling(e)))}updateSecurityEnabling(e){e&&this.protocolType!==Ki.Serial?this.slaveConfigFormGroup.get("security").enable({emitEvent:!1}):this.slaveConfigFormGroup.get("security").disable({emitEvent:!1})}static{this.ɵfac=function(e){return new(e||lX)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef))}}static{this.ɵdir=t.ɵɵdefineDirective({type:lX,features:[t.ɵɵInheritDefinitionFeature]})}}e("ModbusSlaveDialogAbstract",lX);const pX=()=>({maxWidth:"970px"});function cX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",20),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate3(" ",e.get("tag").value,"",": ","",e.get("value").value," ")}}function dX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",22),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"span",23),t.ɵɵtext(5),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"div",24),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"span",25),t.ɵɵtext(10),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"div",24),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementStart(14,"span",25),t.ɵɵtext(15),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(3,6,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.method":"gateway.key"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("tag").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(8,8,"gateway.address"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("address").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(13,10,"gateway.type"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("type").value)}}function uX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.keysType===e.ModbusValueKey.RPC_REQUESTS?"gateway.method-required":"gateway.key-required"))}}function mX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function hX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(5);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.ModbusFunctionCodeTranslationsMap.get(e))," ")}}function gX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",30)(1,"div",35),t.ɵɵtext(2,"gateway.function-code"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",32)(4,"mat-select",47),t.ɵɵtemplate(5,hX,3,4,"mat-option",37),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.functionCodesMap.get(e.get("id").value)||n.defaultFunctionCodes)}}function fX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.objects-count-required"))}function yX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.modbus.max-bit"))}function vX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",30)(1,"div",48),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.bit"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",49),t.ɵɵelement(5,"input",50),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,yX,3,3,"mat-icon",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(3).$implicit;t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.bit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("bit").hasError("max")&&e.get("bit").touched)}}function xX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(6);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.BitTargetTypeTranslationMap.get(e)))}}function bX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",30)(1,"div",48),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.bit-target-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",51)(5,"mat-form-field",52)(6,"mat-select",53),t.ɵɵtemplate(7,xX,3,4,"mat-option",37),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(5);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.modbus.bit-target-type")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",e.bitTargetTypes)}}function wX(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,vX,8,7,"div",38)(2,bX,8,4,"div",38),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("objectsCount").value>1),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.hideNewFields)}}function SX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function CX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵelement(1,"mat-icon",62),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(5);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",i.ModifierTypesMap.get(e).icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,i.ModifierTypesMap.get(e).name))}}function _X(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.modifier-invalid"))}function TX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",54)(1,"mat-expansion-panel",15)(2,"mat-expansion-panel-header",16)(3,"mat-panel-title")(4,"mat-slide-toggle",55),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label",56),t.ɵɵpipe(6,"translate"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",51)(10,"div",57)(11,"div",35),t.ɵɵtext(12,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",52)(14,"mat-select",58)(15,"mat-select-trigger")(16,"div",59),t.ɵɵelement(17,"mat-icon",60),t.ɵɵelementStart(18,"span"),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(21,CX,5,5,"mat-option",37),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(22,"div",30)(23,"div",35),t.ɵɵtext(24,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",49),t.ɵɵelement(26,"input",61),t.ɵɵpipe(27,"translate"),t.ɵɵtemplate(28,_X,3,3,"mat-icon",34),t.ɵɵelementEnd()()()()}if(2&e){let e,n;const i=t.ɵɵnextContext(2).$implicit,a=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("expanded",a.enableModifiersControlMap.get(i.get("id").value).value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",a.enableModifiersControlMap.get(i.get("id").value)),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,9,"gateway.hints.modbus.modifier")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,11,"gateway.modifier")," "),t.ɵɵadvance(10),t.ɵɵproperty("svgIcon",null==(e=a.ModifierTypesMap.get(i.get("modifierType").value))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,13,null==(n=a.ModifierTypesMap.get(i.get("modifierType").value))?null:n.name)),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",a.modifierTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(27,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",i.get("modifierValue").hasError("pattern")&&i.get("modifierValue").touched)}}function IX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function EX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",30)(1,"div",63),t.ɵɵtext(2,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",32),t.ɵɵelement(4,"input",64),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,IX,3,3,"mat-icon",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("value").hasError("required")&&e.get("value").touched)}}function MX(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",65),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Key)("isExpansionMode",!0)}}function kX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",26),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelement(3,"div",27),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",28)(5,"div",29),t.ɵɵtext(6,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",30)(8,"div",31),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",32),t.ɵɵelement(13,"input",33),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,uX,3,3,"mat-icon",34),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",28)(17,"div",29),t.ɵɵtext(18,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",30)(20,"div",35),t.ɵɵtext(21," gateway.type "),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",32)(23,"mat-select",36),t.ɵɵtemplate(24,mX,2,2,"mat-option",37),t.ɵɵelementEnd()()(),t.ɵɵtemplate(25,gX,6,1,"div",38),t.ɵɵelementStart(26,"div",30)(27,"div",39),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"gateway.objects-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",32),t.ɵɵelement(31,"input",40),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,fX,3,3,"mat-icon",34),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,wX,3,2,"ng-container",41),t.ɵɵelementStart(35,"div",30)(36,"div",39),t.ɵɵpipe(37,"translate"),t.ɵɵtext(38,"gateway.address"),t.ɵɵelementEnd(),t.ɵɵelementStart(39,"mat-form-field",32),t.ɵɵelement(40,"input",42),t.ɵɵpipe(41,"translate"),t.ɵɵtemplate(42,SX,3,3,"mat-icon",34),t.ɵɵelementEnd()(),t.ɵɵtemplate(43,TX,29,17,"div",43)(44,EX,7,4,"div",38)(45,MX,1,2,"tb-report-strategy",44),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,20,"gateway.hints.modbus.data-keys")," "),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/modbus-functions-data-types_fn")("tb-help-popup-style",t.ɵɵpureFunction0(36,pX)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(9,22,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.hints.modbus.method":"gateway.hints.modbus.key")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,24,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.method-name":"gateway.key")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,26,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("tag").hasError("required")&&e.get("tag").touched),t.ɵɵadvance(9),t.ɵɵproperty("ngForOf",n.modbusDataTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withFunctionCode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(28,28,"gateway.hints.modbus.objects-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,30,"gateway.set")),t.ɵɵproperty("readonly",!n.ModbusEditableDataTypes.includes(e.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("objectsCount").hasError("required")&&e.get("objectsCount").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("type").value===n.ModbusDataType.BITS),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(37,32,"gateway.hints.modbus.address")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(41,34,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("address").hasError("required")&&e.get("address").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.showModifiersMap.get(e.get("id").value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isMaster),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withReportStrategy)}}function PX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",12)(1,"div",13),t.ɵɵelementContainerStart(2,14),t.ɵɵelementStart(3,"mat-expansion-panel",15)(4,"mat-expansion-panel-header",16)(5,"mat-panel-title"),t.ɵɵtemplate(6,cX,2,3,"div",17)(7,dX,16,12,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,kX,46,37,"ng-template",18),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",19),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵreference(8),r=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",r.isMaster)("ngIfElse",a),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,r.deleteKeyTitle))}}function DX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10),t.ɵɵtemplate(1,PX,14,7,"div",11),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByControlId)}}function OX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",66)(1,"span",67),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class AX{constructor(e,t){this.fb=e,this.popover=t,this.isMaster=!1,this.hideNewFields=!1,this.keysDataApplied=new u,this.withFunctionCode=!0,this.withReportStrategy=!0,this.enableModifiersControlMap=new Map,this.showModifiersMap=new Map,this.functionCodesMap=new Map,this.defaultFunctionCodes=[],this.modbusDataTypes=Object.values(Wt),this.modifierTypes=Object.values(ma),this.bitTargetTypes=Object.values(aa),this.BitTargetTypeTranslationMap=ra,this.ModbusEditableDataTypes=$t,this.ModbusFunctionCodeTranslationsMap=Zt,this.ModifierTypesMap=ha,this.ReportStrategyDefaultValue=en,this.ModbusDataType=Wt,this.ModbusValueKey=ea,this.destroy$=new te,this.defaultReadFunctionCodes=[3,4],this.bitsReadFunctionCodes=[1,2],this.defaultWriteFunctionCodes=[6,16],this.bitsWriteFunctionCodes=[5,15]}ngOnInit(){this.withFunctionCode=!this.isMaster||this.keysType!==ea.ATTRIBUTES&&this.keysType!==ea.TIMESERIES,this.withReportStrategy=!(this.isMaster||this.keysType!==ea.ATTRIBUTES&&this.keysType!==ea.TIMESERIES||this.hideNewFields),this.keysListFormArray=this.prepareKeysFormArray(this.values),this.defaultFunctionCodes=this.getDefaultFunctionCodes()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}trackByControlId(e,t){return t.value.id}addKey(){const e=Re(5),t=this.fb.group({tag:["",[$.required,$.pattern(an)]],value:[{value:"",disabled:!this.isMaster},[$.required,$.pattern(an)]],type:[Wt.BYTES,[$.required]],address:[null,[$.required]],objectsCount:[1,[$.required]],functionCode:[{value:this.getDefaultFunctionCodes()[0],disabled:!this.withFunctionCode},[$.required]],reportStrategy:[{value:null,disabled:!this.withReportStrategy}],modifierType:[{value:ma.MULTIPLIER,disabled:!0}],modifierValue:[{value:1,disabled:!0},[$.pattern(on)]],bit:[{value:null,disabled:!0}],bitTargetType:[{value:aa.IntegerType,disabled:!0}],id:[{value:e,disabled:!0}]});this.showModifiersMap.set(e,!1),this.enableModifiersControlMap.set(e,this.fb.control(!1)),this.observeKeyDataType(t),this.observeObjectsCount(t),this.observeEnableModifier(t),this.keysListFormArray.push(t)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover.hide()}applyKeysData(){this.keysDataApplied.emit(this.getFormValue())}getFormValue(){return this.mapKeysWithModifier(this.withReportStrategy?this.cleanUpEmptyStrategies(this.keysListFormArray.value):this.keysListFormArray.value)}cleanUpEmptyStrategies(e){return e.map((e=>{const{reportStrategy:t,...n}=e;return t?e:n}))}mapKeysWithModifier(e){return e.map(((e,t)=>{if(this.showModifiersMap.get(this.keysListFormArray.controls[t].get("id").value)){const{modifierType:t,modifierValue:n,...i}=e;return t?{...i,[t]:n}:i}return e}))}prepareKeysFormArray(e){const t=[];return e&&e.forEach((e=>{const n=this.createDataKeyFormGroup(e);this.observeKeyDataType(n),this.observeObjectsCount(n),this.observeEnableModifier(n),this.functionCodesMap.set(n.get("id").value,this.getFunctionCodes(e.type)),t.push(n)})),this.fb.array(t)}createDataKeyFormGroup(e){const{tag:t,value:n,type:i,address:a,objectsCount:r,functionCode:o,multiplier:s,divider:l,reportStrategy:p,bit:c,bitTargetType:d}=e,u=Re(5),m=this.shouldShowModifier(i);return this.showModifiersMap.set(u,m),this.enableModifiersControlMap.set(u,this.fb.control((s||l)&&m)),this.fb.group({tag:[t,[$.required,$.pattern(an)]],value:[{value:n,disabled:!this.isMaster},[$.required,$.pattern(an)]],type:[i,[$.required]],address:[a,[$.required]],objectsCount:[r,[$.required]],functionCode:[{value:o,disabled:!this.withFunctionCode},[$.required]],modifierType:[{value:l?ma.DIVIDER:ma.MULTIPLIER,disabled:!this.enableModifiersControlMap.get(u).value}],bit:[{value:c,disabled:i!==Wt.BITS||r<2},[$.max(r-1)]],bitTargetType:[{value:d??aa.IntegerType,disabled:i!==Wt.BITS||this.hideNewFields}],modifierValue:[{value:s??l??1,disabled:!this.enableModifiersControlMap.get(u).value},[$.pattern(on)]],id:[{value:u,disabled:!0}],reportStrategy:[{value:p,disabled:!this.withReportStrategy}]})}shouldShowModifier(e){return!(this.isMaster||this.keysType!==ea.ATTRIBUTES&&this.keysType!==ea.TIMESERIES||this.ModbusEditableDataTypes.includes(e))}observeKeyDataType(e){e.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((t=>{this.ModbusEditableDataTypes.includes(t)||e.get("objectsCount").patchValue(Kt[t],{emitEvent:!1}),this.toggleBitsFields(e);const n=this.shouldShowModifier(t);this.showModifiersMap.set(e.get("id").value,n),this.updateFunctionCodes(e,t)}))}observeObjectsCount(e){e.get("objectsCount").valueChanges.pipe(ue((()=>e.get("type").value===Wt.BITS)),le(this.destroy$)).subscribe((()=>this.toggleBitsFields(e)))}toggleBitsFields(e){const{objectsCount:t,type:n,bit:i,bitTargetType:a}=e.controls,r=n.value===Wt.BITS,o=t.value>1;r&&o?(i.enable({emitEvent:!1}),i.setValidators($.max(t.value-1))):i.disable({emitEvent:!1}),i.updateValueAndValidity({emitEvent:!1}),a[r?"enable":"disable"]({emitEvent:!1})}observeEnableModifier(e){this.enableModifiersControlMap.get(e.get("id").value).valueChanges.pipe(le(this.destroy$)).subscribe((t=>this.toggleModifierControls(e,t)))}toggleModifierControls(e,t){const n=e.get("modifierType"),i=e.get("modifierValue");n[t?"enable":"disable"]({emitEvent:!1}),i[t?"enable":"disable"]({emitEvent:!1}),n.markAsDirty(),i.markAsDirty()}updateFunctionCodes(e,t){const n=this.getFunctionCodes(t);this.functionCodesMap.set(e.get("id").value,n),n.includes(e.get("functionCode").value)||e.get("functionCode").patchValue(n[0],{emitEvent:!1})}getFunctionCodes(e){const t=[...e===Wt.BITS?this.bitsWriteFunctionCodes:[],...this.defaultWriteFunctionCodes];if(this.keysType===ea.ATTRIBUTES_UPDATES)return t.sort(((e,t)=>e-t));const n=[...this.defaultReadFunctionCodes];return e===Wt.BITS&&n.push(...this.bitsReadFunctionCodes),this.keysType===ea.RPC_REQUESTS&&n.push(...t),n.sort(((e,t)=>e-t))}getDefaultFunctionCodes(){return this.keysType===ea.ATTRIBUTES_UPDATES?this.defaultWriteFunctionCodes:this.keysType===ea.RPC_REQUESTS?[...this.defaultReadFunctionCodes,...this.defaultWriteFunctionCodes]:this.defaultReadFunctionCodes}static{this.ɵfac=function(e){return new(e||AX)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(it.TbPopoverComponent))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:AX,selectors:[["tb-modbus-data-keys-panel"]],inputs:{isMaster:"isMaster",hideNewFields:"hideNewFields",panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keysType:"keysType",values:"values"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["tagName",""],[1,"tb-modbus-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["class","title-container","tbTruncateWithTooltip","",4,"ngIf","ngIfElse"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["tbTruncateWithTooltip","",1,"title-container"],[1,"tb-flex"],[1,"title-container","tb-flex"],["tbTruncateWithTooltip","",1,"key-label"],[1,"title-container"],[1,"key-label"],[1,"tb-form-hint","tb-primary-fill","tb-flex","align-center"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","tag",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","1","max","50000","name","value","formControlName","objectsCount",3,"placeholder","readonly"],[4,"ngIf"],["matInput","","type","number","min","0","max","50000","name","value","formControlName","address",3,"placeholder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],["class","stroked tb-form-panel","formControlName","reportStrategy",3,"defaultValue","isExpansionMode",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["formControlName","functionCode"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],["matInput","","formControlName","bit","step","1","type","number","min","0",3,"placeholder"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","bitTargetType"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"mat-slide",3,"click","formControl"],[3,"tb-hint-tooltip-icon"],[1,"tb-form-row","column-xs","w-full"],["formControlName","modifierType"],[1,"tb-flex","align-center"],[1,"tb-mat-18",3,"svgIcon"],["matInput","","required","","formControlName","modifierValue","step","0.1","type","number",3,"placeholder"],[1,"tb-mat-20",3,"svgIcon"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","value",3,"placeholder"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"div",3)(2,"div",4),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,DX,2,2,"div",5),t.ɵɵelementStart(6,"div")(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(10,OX,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",7)(13,"button",8),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(11);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")",""),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,n.addKeyTitle)," "),t.ɵɵadvance(6),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(AX,[j,_,Xn,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{width:180px}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{font-weight:400}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}']})}}e("ModbusDataKeysPanelComponent",AX),Ge([I()],AX.prototype,"isMaster",void 0),Ge([I()],AX.prototype,"hideNewFields",void 0);const FX=()=>({$implicit:null}),RX=e=>({$implicit:e});function BX(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",7),t.ɵɵelementContainer(2,8),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(),n=t.ɵɵreference(4);t.ɵɵadvance(),t.ɵɵproperty("formGroup",e.valuesFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",n)("ngTemplateOutletContext",t.ɵɵpureFunction0(3,FX))}}function NX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab",11),t.ɵɵpipe(1,"translate"),t.ɵɵelementStart(2,"div",7),t.ɵɵelementContainer(3,8),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2),a=t.ɵɵreference(4);t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(1,4,i.ModbusValuesTranslationsMap.get(e))),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i.valuesFormGroup.get(e)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",a)("ngTemplateOutletContext",t.ɵɵpureFunction1(6,RX,e))}}function LX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab-group",9),t.ɵɵtemplate(1,NX,4,8,"mat-tab",10),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.valuesFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.modbusRegisterTypes)}}function VX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function qX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function GX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function zX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function UX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",12)(1,"div",13),t.ɵɵtext(2,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",14)(4,"mat-chip-listbox",15),t.ɵɵtemplate(5,VX,2,1,"mat-chip",16),t.ɵɵelementStart(6,"mat-chip",17),t.ɵɵelement(7,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"button",19,2),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(9),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.ATTRIBUTES,i))})),t.ɵɵelementStart(11,"tb-icon",20),t.ɵɵtext(12,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(13,"div",12)(14,"div",13),t.ɵɵtext(15,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",14)(17,"mat-chip-listbox",15),t.ɵɵtemplate(18,qX,2,1,"mat-chip",16),t.ɵɵelementStart(19,"mat-chip",17),t.ɵɵelement(20,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(21,"button",19,3),t.ɵɵpipe(23,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(22),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.TIMESERIES,i))})),t.ɵɵelementStart(24,"tb-icon",20),t.ɵɵtext(25,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(26,"div",12)(27,"div",13),t.ɵɵtext(28,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",14)(30,"mat-chip-listbox",15),t.ɵɵtemplate(31,GX,2,1,"mat-chip",16),t.ɵɵelementStart(32,"mat-chip",17),t.ɵɵelement(33,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"button",19,4),t.ɵɵpipe(36,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(35),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.ATTRIBUTES_UPDATES,i))})),t.ɵɵelementStart(37,"tb-icon",20),t.ɵɵtext(38,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(39,"div",12)(40,"div",13),t.ɵɵtext(41,"gateway.rpc-requests"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",14)(43,"mat-chip-listbox",15),t.ɵɵtemplate(44,zX,2,1,"mat-chip",16),t.ɵɵelementStart(45,"mat-chip",17),t.ɵɵelement(46,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(47,"button",19,5),t.ɵɵpipe(49,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(48),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.RPC_REQUESTS,i))})),t.ɵɵelementStart(50,"tb-icon",20),t.ɵɵtext(51,"edit"),t.ɵɵelementEnd()()()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,16,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.TIMESERIES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.TIMESERIES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(23,18,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES_UPDATES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES_UPDATES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(36,20,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.RPC_REQUESTS,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.RPC_REQUESTS,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(49,22,"action.edit")),t.ɵɵproperty("disabled",i.disabled)}}class jX{constructor(e,t,n,i,a,r){this.fb=e,this.popoverService=t,this.renderer=n,this.viewContainerRef=i,this.cdr=a,this.destroyRef=r,this.singleMode=!1,this.hideNewFields=!1,this.disabled=!1,this.modbusRegisterTypes=Object.values(Ji),this.modbusValueKeys=Object.values(ea),this.ModbusValuesTranslationsMap=ia,this.ModbusValueKey=ea}ngOnInit(){this.initializeValuesFormGroup(),this.observeValuesChanges()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){if(this.singleMode)this.valuesFormGroup.setValue(this.getSingleRegisterState(e),{emitEvent:!1});else{const{holding_registers:t,coils_initializer:n,input_registers:i,discrete_inputs:a}=e;this.valuesFormGroup.setValue({holding_registers:this.getSingleRegisterState(t),coils_initializer:this.getSingleRegisterState(n),input_registers:this.getSingleRegisterState(i),discrete_inputs:this.getSingleRegisterState(a)},{emitEvent:!1})}this.cdr.markForCheck()}validate(){return this.valuesFormGroup.valid?null:{valuesFormGroup:{valid:!1}}}setDisabledState(e){this.disabled=e,this.cdr.markForCheck()}getValueGroup(e,t){return t?this.valuesFormGroup.get(t).get(e):this.valuesFormGroup.get(e)}manageKeys(e,t,n,i){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const a=t._elementRef.nativeElement;if(this.popoverService.hasPopover(a))return void this.popoverService.hidePopover(a);const r=this.getValueGroup(n,i),o={values:r.value,isMaster:!this.singleMode,keysType:n,panelTitle:pa.get(n),addKeyTitle:ca.get(n),deleteKeyTitle:da.get(n),noKeysText:ua.get(n),hideNewFields:this.hideNewFields};this.popoverComponent=this.popoverService.displayPopover(a,this.renderer,this.viewContainerRef,AX,"leftBottom",!1,null,o,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(bn(this.destroyRef)).subscribe((e=>{this.popoverComponent.hide(),r.patchValue(e),r.markAsDirty(),this.cdr.markForCheck()}))}initializeValuesFormGroup(){const e=()=>this.fb.group(this.modbusValueKeys.reduce(((e,t)=>(e[t]=this.fb.control([[],[]]),e)),{}));this.singleMode?this.valuesFormGroup=e():this.valuesFormGroup=this.fb.group(this.modbusRegisterTypes.reduce(((t,n)=>(t[n]=e(),t)),{}))}observeValuesChanges(){this.valuesFormGroup.valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>{this.onChange(e),this.onTouched()}))}getSingleRegisterState(e){return{attributes:e?.attributes??[],timeseries:e?.timeseries??[],attributeUpdates:e?.attributeUpdates??[],rpc:e?.rpc??[]}}static{this.ɵfac=function(e){return new(e||jX)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:jX,selectors:[["tb-modbus-values"]],inputs:{singleMode:"singleMode",hideNewFields:"hideNewFields"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>jX)),multi:!0},{provide:K,useExisting:c((()=>jX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:5,vars:2,consts:[["multipleView",""],["singleView",""],["attributesButton",""],["telemetryButton",""],["attributesUpdatesButton",""],["rpcRequestsButton",""],[4,"ngIf","ngIfElse"],[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"formGroup"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","disabled","matTooltip"],["matButtonIcon",""]],template:function(e,n){if(1&e&&t.ɵɵtemplate(0,BX,3,4,"ng-container",6)(1,LX,2,2,"ng-template",null,0,t.ɵɵtemplateRefExtractor)(3,UX,52,24,"ng-template",null,1,t.ɵɵtemplateRefExtractor),2&e){const e=t.ɵɵreference(2);t.ɵɵproperty("ngIf",n.singleMode)("ngIfElse",e)}},dependencies:t.ɵɵgetComponentDepsFactory(jX,[j,_,Gn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .mat-mdc-tab-body-wrapper{min-height:320px} .mdc-evolution-chip-set__chips{align-items:center}'],changeDetection:d.OnPush})}}function HX(e,n){1&e&&(t.ɵɵelementStart(0,"div",2)(1,"div",10),t.ɵɵtext(2,"gateway.server-hostname"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",5)(4,"mat-form-field",6),t.ɵɵelement(5,"input",16),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function WX(e,n){1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-slide-toggle",18)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.request-client-certificate")," "))}e("ModbusValuesComponent",jX),Ge([I()],jX.prototype,"singleMode",void 0),Ge([I()],jX.prototype,"hideNewFields",void 0);class $X{constructor(e,t){this.fb=e,this.cdr=t,this.isMaster=!1,this.disabled=!1,this.destroy$=new te,this.securityConfigFormGroup=this.fb.group({certfile:["",[$.pattern(an)]],keyfile:["",[$.pattern(an)]],password:["",[$.pattern(an)]],server_hostname:["",[$.pattern(an)]],reqclicert:[{value:!1,disabled:!0}]}),this.observeValueChanges()}ngOnChanges(){this.updateMasterEnabling()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this.disabled?this.securityConfigFormGroup.disable({emitEvent:!1}):this.securityConfigFormGroup.enable({emitEvent:!1}),this.updateMasterEnabling(),this.cdr.markForCheck()}validate(){return this.securityConfigFormGroup.valid?null:{securityConfigFormGroup:{valid:!1}}}writeValue(e){const{certfile:t,password:n,keyfile:i,server_hostname:a}=e,r={certfile:t??"",password:n??"",keyfile:i??"",server_hostname:a??"",reqclicert:!!e.reqclicert};this.securityConfigFormGroup.reset(r,{emitEvent:!1})}updateMasterEnabling(){this.isMaster?(this.disabled||this.securityConfigFormGroup.get("reqclicert").enable({emitEvent:!1}),this.securityConfigFormGroup.get("server_hostname").disable({emitEvent:!1})):(this.disabled||this.securityConfigFormGroup.get("server_hostname").enable({emitEvent:!1}),this.securityConfigFormGroup.get("reqclicert").disable({emitEvent:!1}))}observeValueChanges(){this.securityConfigFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}static{this.ɵfac=function(e){return new(e||$X)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:$X,selectors:[["tb-modbus-security-config"]],inputs:{isMaster:"isMaster"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>$X)),multi:!0},{provide:K,useExisting:c((()=>$X)),multi:!0}]),t.ɵɵNgOnChangesFeature,t.ɵɵStandaloneFeature],decls:33,vars:21,consts:[[1,"tb-form-panel","no-border","no-padding",3,"formGroup"],[1,"tb-form-hint","tb-primary-fill"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["tbTruncateWithTooltip","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","certfile",3,"placeholder"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["matInput","","name","value","formControlName","keyfile",3,"placeholder"],["translate","",1,"fixed-title-width"],["matInput","","type","password","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["class","tb-form-row space-between tb-flex fill-width",4,"ngIf"],["class","tb-form-row",4,"ngIf"],["matInput","","name","value","formControlName","server_hostname",3,"placeholder"],[1,"tb-form-row"],["formControlName","reqclicert",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",2)(5,"div",3),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"span",4),t.ɵɵtext(8,"gateway.client-cert-path"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",5)(10,"mat-form-field",6),t.ɵɵelement(11,"input",7),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(13,"div",2)(14,"div",8),t.ɵɵpipe(15,"translate"),t.ɵɵelementStart(16,"span",4),t.ɵɵtext(17,"gateway.private-key-path"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",5)(19,"mat-form-field",6),t.ɵɵelement(20,"input",9),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",2)(23,"div",10),t.ɵɵtext(24,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",5)(26,"mat-form-field",6),t.ɵɵelement(27,"input",11),t.ɵɵpipe(28,"translate"),t.ɵɵelementStart(29,"div",12),t.ɵɵelement(30,"tb-toggle-password",13),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(31,HX,7,3,"div",14)(32,WX,5,3,"div",15),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityConfigFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,9,"gateway.hints.path-in-os")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,11,"gateway.hints.ca-cert")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,13,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(15,15,"gateway.private-key-path")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,17,"gateway.set")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,19,"gateway.set")),t.ɵɵadvance(4),t.ɵɵproperty("ngIf",!n.isMaster),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isMaster))},dependencies:t.ɵɵgetComponentDepsFactory($X,[j,_,qn]),encapsulation:2,changeDetection:d.OnPush})}}function KX(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function YX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function XX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",53),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,YX,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function ZX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function QX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",55),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,ZX,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function JX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function eZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",56),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,JX,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("serialPort").hasError("required")&&e.slaveConfigFormGroup.get("serialPort").touched)}}function tZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function nZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function iZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function aZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusParityLabelsMap.get(e))}}function rZ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",17)(2,"div",18),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",19)(6,"mat-select",57),t.ɵɵtemplate(7,nZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",17)(9,"div",18),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"gateway.bytesize"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19)(13,"mat-select",58),t.ɵɵtemplate(14,iZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",17)(16,"div",18),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"gateway.stopbits"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",19),t.ɵɵelement(20,"input",59),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",17)(23,"div",18),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25,"gateway.parity"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",19)(27,"mat-select",60),t.ɵɵtemplate(28,aZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(29,"div",36)(30,"mat-slide-toggle",61)(31,"mat-label",38),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,12,"gateway.hints.modbus.bytesize")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusByteSizes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(17,14,"gateway.hints.modbus.stopbits")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,16,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,18,"gateway.hints.modbus.parity")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusParities),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(32,20,"gateway.hints.modbus.strict")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(34,22,"gateway.strict")," ")}}function oZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function sZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function lZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function pZ(e,n){1&e&&(t.ɵɵelementStart(0,"div",36)(1,"mat-slide-toggle",62)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.send-data-on-change")," "))}function cZ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",63),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Device)("isExpansionMode",!0)}}function dZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function uZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function mZ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",64)(1,"mat-expansion-panel",65)(2,"mat-expansion-panel-header",66)(3,"mat-panel-title")(4,"mat-slide-toggle",67),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",68),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusSecurityConfigComponent",$X),Ge([I()],$X.prototype,"isMaster",void 0);class hZ extends lX{constructor(e,t,n,i,a){super(e,t,n,i,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a}getSlaveResultData(){const{values:e,type:t,serialPort:n,...i}=this.slaveConfigFormGroup.value,a={...i,type:t,...e};return t===Ki.Serial&&(a.port=n),a.reportStrategy||delete a.reportStrategy,Te(a),a}addFieldsToFormGroup(){this.slaveConfigFormGroup.addControl("reportStrategy",this.fb.control(null))}static{this.ɵfac=function(e){return new(e||hZ)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:hZ,selectors:[["tb-modbus-slave-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:141,vars:97,consts:[["serialPort",""],["reportStrategy",""],[1,"slaves-config-container"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"tb-form-panel",3,"formGroup"],[1,"stroked","tb-form-panel"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],[4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["class","tb-form-row",4,"ngIf","ngIfElse"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[1,"tb-form-row"],["formControlName","retries",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","retryOnEmpty",1,"mat-slide"],["formControlName","retryOnInvalid",1,"mat-slide"],[1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],["translate","",1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","500","name","value","formControlName","connectAttemptTimeMs",3,"placeholder"],["matInput","","type","number","min","1","name","value","formControlName","connectAttemptCount",3,"placeholder"],["matInput","","type","number","min","30000","name","value","formControlName","waitAfterFailedAttemptsMs",3,"placeholder"],["formControlName","values",3,"singleMode","hideNewFields"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],["formControlName","bytesize"],["matInput","","type","number","min","0","name","value","formControlName","stopbits",3,"placeholder"],["formControlName","parity"],["formControlName","strict",1,"mat-slide"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide","justify-start",3,"click","formControl"],["formControlName","security",1,"security-config"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"mat-toolbar",3)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",4)(6,"div",5),t.ɵɵelementStart(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12),t.ɵɵtext(15,"gateway.server-connection"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"tb-toggle-select",13),t.ɵɵtemplate(17,KX,2,2,"tb-toggle-option",14),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",10),t.ɵɵtemplate(19,XX,8,7,"div",15)(20,QX,8,9,"div",16)(21,eZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(23,"div",17)(24,"div",18),t.ɵɵpipe(25,"translate"),t.ɵɵtext(26," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(27,"mat-form-field",19)(28,"mat-select",20),t.ɵɵtemplate(29,tZ,2,2,"mat-option",14),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(30,rZ,35,24,"ng-container",21),t.ɵɵelementStart(31,"div",17)(32,"div",22),t.ɵɵpipe(33,"translate"),t.ɵɵtext(34,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"mat-form-field",19),t.ɵɵelement(36,"input",23),t.ɵɵpipe(37,"translate"),t.ɵɵtemplate(38,oZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"div",17)(40,"div",25),t.ɵɵtext(41,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"mat-form-field",19),t.ɵɵelement(43,"input",26),t.ɵɵpipe(44,"translate"),t.ɵɵtemplate(45,sZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"div",17)(47,"div",25),t.ɵɵtext(48,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"mat-form-field",19),t.ɵɵelement(50,"input",27),t.ɵɵpipe(51,"translate"),t.ɵɵtemplate(52,lZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵtemplate(53,pZ,5,3,"div",28)(54,cZ,1,2,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(56,"div",29)(57,"mat-expansion-panel",30)(58,"mat-expansion-panel-header")(59,"mat-panel-title")(60,"div",31),t.ɵɵtext(61,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(62,"div",10)(63,"div",17)(64,"div",18),t.ɵɵpipe(65,"translate"),t.ɵɵtext(66,"gateway.connection-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(67,"mat-form-field",19),t.ɵɵelement(68,"input",32),t.ɵɵpipe(69,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(70,"div",17)(71,"div",18),t.ɵɵpipe(72,"translate"),t.ɵɵtext(73,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(74,"mat-form-field",19)(75,"mat-select",33),t.ɵɵtemplate(76,dZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(77,"div",17)(78,"div",18),t.ɵɵpipe(79,"translate"),t.ɵɵtext(80,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",19)(82,"mat-select",34),t.ɵɵtemplate(83,uZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(84,mZ,9,5,"div",35),t.ɵɵelementStart(85,"div",36)(86,"mat-slide-toggle",37)(87,"mat-label",38),t.ɵɵpipe(88,"translate"),t.ɵɵtext(89),t.ɵɵpipe(90,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(91,"div",36)(92,"mat-slide-toggle",39)(93,"mat-label",38),t.ɵɵpipe(94,"translate"),t.ɵɵtext(95),t.ɵɵpipe(96,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(97,"div",36)(98,"mat-slide-toggle",40)(99,"mat-label",38),t.ɵɵpipe(100,"translate"),t.ɵɵtext(101),t.ɵɵpipe(102,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(103,"div",17)(104,"div",41),t.ɵɵpipe(105,"translate"),t.ɵɵelementStart(106,"span",42),t.ɵɵtext(107," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(108,"mat-form-field",19),t.ɵɵelement(109,"input",43),t.ɵɵpipe(110,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(111,"div",17)(112,"div",44),t.ɵɵpipe(113,"translate"),t.ɵɵtext(114,"gateway.connect-attempt-time"),t.ɵɵelementEnd(),t.ɵɵelementStart(115,"mat-form-field",19),t.ɵɵelement(116,"input",45),t.ɵɵpipe(117,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(118,"div",17)(119,"div",44),t.ɵɵpipe(120,"translate"),t.ɵɵtext(121,"gateway.connect-attempt-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(122,"mat-form-field",19),t.ɵɵelement(123,"input",46),t.ɵɵpipe(124,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(125,"div",17)(126,"div",44),t.ɵɵpipe(127,"translate"),t.ɵɵtext(128,"gateway.wait-after-failed-attempts"),t.ɵɵelementEnd(),t.ɵɵelementStart(129,"mat-form-field",19),t.ɵɵelement(130,"input",47),t.ɵɵpipe(131,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(132,"div",29),t.ɵɵelement(133,"tb-modbus-values",48),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(134,"div",49)(135,"button",50),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(136),t.ɵɵpipe(137,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(138,"button",51),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(139),t.ɵɵpipe(140,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(22),i=t.ɵɵreference(55);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,45,"gateway.server-slave")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.modbusHelpLink),t.ɵɵadvance(4),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(25,47,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(33,49,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(37,51,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(44,53,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(51,55,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.data.hideNewFields)("ngIfElse",i),t.ɵɵadvance(11),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(65,57,"gateway.hints.modbus.connection-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(69,59,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(72,61,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(79,63,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(88,65,"gateway.hints.modbus.retries")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(90,67,"gateway.retries")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(94,69,"gateway.hints.modbus.retries-on-empty")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(96,71,"gateway.retries-on-empty")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(100,73,"gateway.hints.modbus.retries-on-invalid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(102,75,"gateway.retries-on-invalid")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(105,77,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(110,79,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(113,81,"gateway.hints.modbus.connect-attempt-time")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(117,83,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(120,85,"gateway.hints.modbus.connect-attempt-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(124,87,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(127,89,"gateway.hints.modbus.wait-after-failed-attempts")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(131,91,"gateway.set")),t.ɵɵadvance(3),t.ɵɵproperty("singleMode",!0)("hideNewFields",n.data.hideNewFields),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(137,93,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.slaveConfigFormGroup.invalid||!n.slaveConfigFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(140,95,n.data.buttonTitle)," ")}},dependencies:t.ɵɵgetComponentDepsFactory(hZ,[j,_,jX,$X,r$,Xn,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .slaves-config-container[_ngcontent-%COMP%]{width:80vw;max-width:900px}[_nghost-%COMP%] .slave-name-label[_ngcontent-%COMP%]{margin-right:16px;color:#000000de}[_nghost-%COMP%] .fixed-title-width-260[_ngcontent-%COMP%]{min-width:260px}[_nghost-%COMP%] .security-config .fixed-title-width{min-width:230px}'],changeDetection:d.OnPush})}}function gZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function fZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function yZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",53),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,fZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function vZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function xZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",55),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,vZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function bZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function wZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",56),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,bZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("serialPort").hasError("required")&&e.slaveConfigFormGroup.get("serialPort").touched)}}function SZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function CZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function _Z(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function TZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusParityLabelsMap.get(e))}}function IZ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",17)(2,"div",18),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",19)(6,"mat-select",57),t.ɵɵtemplate(7,CZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",17)(9,"div",18),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"gateway.bytesize"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19)(13,"mat-select",58),t.ɵɵtemplate(14,_Z,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",17)(16,"div",18),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"gateway.stopbits"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",19),t.ɵɵelement(20,"input",59),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",17)(23,"div",18),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25,"gateway.parity"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",19)(27,"mat-select",60),t.ɵɵtemplate(28,TZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(29,"div",36)(30,"mat-slide-toggle",61)(31,"mat-label",38),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,12,"gateway.hints.modbus.bytesize")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusByteSizes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(17,14,"gateway.hints.modbus.stopbits")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,16,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,18,"gateway.hints.modbus.parity")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusParities),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(32,20,"gateway.hints.modbus.strict")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(34,22,"gateway.strict")," ")}}function EZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function MZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function kZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function PZ(e,n){1&e&&(t.ɵɵelementStart(0,"div",36)(1,"mat-slide-toggle",62)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.send-data-on-change")," "))}function DZ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",63),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Device)("isExpansionMode",!0)}}function OZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function AZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function FZ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",64)(1,"mat-expansion-panel",65)(2,"mat-expansion-panel-header",66)(3,"mat-panel-title")(4,"mat-slide-toggle",67),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",68),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusSlaveDialogComponent",hZ);class RZ extends lX{constructor(e,t,n,i,a){super(e,t,n,i,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a}getSlaveResultData(){const{values:e,type:t,serialPort:n,...i}=this.slaveConfigFormGroup.value,a={...i,type:t,...e};return t===Ki.Serial&&(a.port=n),Te(a),a}addFieldsToFormGroup(){this.slaveConfigFormGroup.addControl("sendDataOnlyOnChange",this.fb.control(!1))}static{this.ɵfac=function(e){return new(e||RZ)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:RZ,selectors:[["tb-modbus-legacy-slave-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:141,vars:97,consts:[["serialPort",""],["reportStrategy",""],[1,"slaves-config-container"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"tb-form-panel",3,"formGroup"],[1,"stroked","tb-form-panel"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],[4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["class","tb-form-row",4,"ngIf","ngIfElse"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[1,"tb-form-row"],["formControlName","retries",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","retryOnEmpty",1,"mat-slide"],["formControlName","retryOnInvalid",1,"mat-slide"],[1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],["translate","",1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","500","name","value","formControlName","connectAttemptTimeMs",3,"placeholder"],["matInput","","type","number","min","1","name","value","formControlName","connectAttemptCount",3,"placeholder"],["matInput","","type","number","min","30000","name","value","formControlName","waitAfterFailedAttemptsMs",3,"placeholder"],["formControlName","values",3,"singleMode","hideNewFields"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],["formControlName","bytesize"],["matInput","","type","number","min","0","name","value","formControlName","stopbits",3,"placeholder"],["formControlName","parity"],["formControlName","strict",1,"mat-slide"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide","justify-start",3,"click","formControl"],["formControlName","security",1,"security-config"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"mat-toolbar",3)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",4)(6,"div",5),t.ɵɵelementStart(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12),t.ɵɵtext(15,"gateway.server-connection"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"tb-toggle-select",13),t.ɵɵtemplate(17,gZ,2,2,"tb-toggle-option",14),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",10),t.ɵɵtemplate(19,yZ,8,7,"div",15)(20,xZ,8,9,"div",16)(21,wZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(23,"div",17)(24,"div",18),t.ɵɵpipe(25,"translate"),t.ɵɵtext(26," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(27,"mat-form-field",19)(28,"mat-select",20),t.ɵɵtemplate(29,SZ,2,2,"mat-option",14),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(30,IZ,35,24,"ng-container",21),t.ɵɵelementStart(31,"div",17)(32,"div",22),t.ɵɵpipe(33,"translate"),t.ɵɵtext(34,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"mat-form-field",19),t.ɵɵelement(36,"input",23),t.ɵɵpipe(37,"translate"),t.ɵɵtemplate(38,EZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"div",17)(40,"div",25),t.ɵɵtext(41,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"mat-form-field",19),t.ɵɵelement(43,"input",26),t.ɵɵpipe(44,"translate"),t.ɵɵtemplate(45,MZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"div",17)(47,"div",25),t.ɵɵtext(48,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"mat-form-field",19),t.ɵɵelement(50,"input",27),t.ɵɵpipe(51,"translate"),t.ɵɵtemplate(52,kZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵtemplate(53,PZ,5,3,"div",28)(54,DZ,1,2,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(56,"div",29)(57,"mat-expansion-panel",30)(58,"mat-expansion-panel-header")(59,"mat-panel-title")(60,"div",31),t.ɵɵtext(61,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(62,"div",10)(63,"div",17)(64,"div",18),t.ɵɵpipe(65,"translate"),t.ɵɵtext(66,"gateway.connection-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(67,"mat-form-field",19),t.ɵɵelement(68,"input",32),t.ɵɵpipe(69,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(70,"div",17)(71,"div",18),t.ɵɵpipe(72,"translate"),t.ɵɵtext(73,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(74,"mat-form-field",19)(75,"mat-select",33),t.ɵɵtemplate(76,OZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(77,"div",17)(78,"div",18),t.ɵɵpipe(79,"translate"),t.ɵɵtext(80,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",19)(82,"mat-select",34),t.ɵɵtemplate(83,AZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(84,FZ,9,5,"div",35),t.ɵɵelementStart(85,"div",36)(86,"mat-slide-toggle",37)(87,"mat-label",38),t.ɵɵpipe(88,"translate"),t.ɵɵtext(89),t.ɵɵpipe(90,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(91,"div",36)(92,"mat-slide-toggle",39)(93,"mat-label",38),t.ɵɵpipe(94,"translate"),t.ɵɵtext(95),t.ɵɵpipe(96,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(97,"div",36)(98,"mat-slide-toggle",40)(99,"mat-label",38),t.ɵɵpipe(100,"translate"),t.ɵɵtext(101),t.ɵɵpipe(102,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(103,"div",17)(104,"div",41),t.ɵɵpipe(105,"translate"),t.ɵɵelementStart(106,"span",42),t.ɵɵtext(107," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(108,"mat-form-field",19),t.ɵɵelement(109,"input",43),t.ɵɵpipe(110,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(111,"div",17)(112,"div",44),t.ɵɵpipe(113,"translate"),t.ɵɵtext(114,"gateway.connect-attempt-time"),t.ɵɵelementEnd(),t.ɵɵelementStart(115,"mat-form-field",19),t.ɵɵelement(116,"input",45),t.ɵɵpipe(117,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(118,"div",17)(119,"div",44),t.ɵɵpipe(120,"translate"),t.ɵɵtext(121,"gateway.connect-attempt-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(122,"mat-form-field",19),t.ɵɵelement(123,"input",46),t.ɵɵpipe(124,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(125,"div",17)(126,"div",44),t.ɵɵpipe(127,"translate"),t.ɵɵtext(128,"gateway.wait-after-failed-attempts"),t.ɵɵelementEnd(),t.ɵɵelementStart(129,"mat-form-field",19),t.ɵɵelement(130,"input",47),t.ɵɵpipe(131,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(132,"div",29),t.ɵɵelement(133,"tb-modbus-values",48),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(134,"div",49)(135,"button",50),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(136),t.ɵɵpipe(137,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(138,"button",51),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(139),t.ɵɵpipe(140,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(22),i=t.ɵɵreference(55);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,45,"gateway.server-slave")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.modbusHelpLink),t.ɵɵadvance(4),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(25,47,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(33,49,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(37,51,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(44,53,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(51,55,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.data.hideNewFields)("ngIfElse",i),t.ɵɵadvance(11),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(65,57,"gateway.hints.modbus.connection-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(69,59,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(72,61,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(79,63,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(88,65,"gateway.hints.modbus.retries")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(90,67,"gateway.retries")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(94,69,"gateway.hints.modbus.retries-on-empty")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(96,71,"gateway.retries-on-empty")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(100,73,"gateway.hints.modbus.retries-on-invalid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(102,75,"gateway.retries-on-invalid")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(105,77,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(110,79,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(113,81,"gateway.hints.modbus.connect-attempt-time")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(117,83,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(120,85,"gateway.hints.modbus.connect-attempt-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(124,87,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(127,89,"gateway.hints.modbus.wait-after-failed-attempts")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(131,91,"gateway.set")),t.ɵɵadvance(3),t.ɵɵproperty("singleMode",!0)("hideNewFields",n.data.hideNewFields),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(137,93,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.slaveConfigFormGroup.invalid||!n.slaveConfigFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(140,95,n.data.buttonTitle)," ")}},dependencies:t.ɵɵgetComponentDepsFactory(RZ,[j,_,jX,$X,r$,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .slaves-config-container[_ngcontent-%COMP%]{width:80vw;max-width:900px}[_nghost-%COMP%] .slave-name-label[_ngcontent-%COMP%]{margin-right:16px;color:#000000de}[_nghost-%COMP%] .fixed-title-width-260[_ngcontent-%COMP%]{min-width:260px}[_nghost-%COMP%] .security-config .fixed-title-width{min-width:230px}'],changeDetection:d.OnPush})}}function BZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function NZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function LZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",39),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,NZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function VZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function qZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",41),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,VZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function GZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function zZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",42),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,GZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("port").hasError("required")&&e.slaveConfigFormGroup.get("port").touched)}}function UZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function jZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function HZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function WZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function $Z(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function KZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",11),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12)(5,"mat-select",43),t.ɵɵtemplate(6,$Z,2,2,"mat-option",6),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates)}}function YZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function XZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function ZZ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",44)(1,"mat-expansion-panel",45)(2,"mat-expansion-panel-header",46)(3,"mat-panel-title")(4,"mat-slide-toggle",47),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",48),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusLegacySlaveDialogComponent",RZ);class QZ{constructor(e){this.fb=e,this.ModbusProtocolLabelsMap=sa,this.ModbusMethodLabelsMap=oa,this.portLimits=Ii,this.modbusProtocolTypes=Object.values(Ki),this.modbusMethodTypes=Object.values(Yi),this.modbusSerialMethodTypes=Object.values(Xi),this.modbusOrderType=Object.values(Qi),this.ModbusProtocolType=Ki,this.modbusBaudrates=ta,this.isSlaveEnabled=!1,this.serialSpecificControlKeys=["serialPort","baudrate"],this.tcpUdpSpecificControlKeys=["port","security","host"],this.destroy$=new te,this.showSecurityControl=this.fb.control(!1),this.slaveConfigFormGroup=this.fb.group({type:[Ki.TCP],host:["",[$.required,$.pattern(an)]],port:[null,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],serialPort:["",[$.required,$.pattern(an)]],method:[Yi.SOCKET],unitId:[null,[$.required]],baudrate:[this.modbusBaudrates[0]],deviceName:["",[$.required,$.pattern(an)]],deviceType:["",[$.required,$.pattern(an)]],pollPeriod:[1e3,[$.required]],sendDataToThingsBoard:[!1],byteOrder:[Qi.BIG],wordOrder:[Qi.BIG],security:[],identity:this.fb.group({vendorName:["",[$.pattern(an)]],productCode:["",[$.pattern(an)]],vendorUrl:["",[$.pattern(an)]],productName:["",[$.pattern(an)]],modelName:["",[$.pattern(an)]]}),values:[]}),this.observeValueChanges(),this.observeTypeChange(),this.observeShowSecurity()}get protocolType(){return this.slaveConfigFormGroup.get("type").value}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.slaveConfigFormGroup.valid?null:{slaveConfigFormGroup:{valid:!1}}}writeValue(e){this.showSecurityControl.patchValue(!!e.security&&!Se(e.security,{})),this.updateSlaveConfig(e)}setDisabledState(e){this.isSlaveEnabled=!e,this.updateFormEnableState()}observeValueChanges(){this.slaveConfigFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{e.type===Ki.Serial&&(e.port=e.serialPort,delete e.serialPort),this.onChange(e),this.onTouched()}))}observeTypeChange(){this.slaveConfigFormGroup.get("type").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateFormEnableState(),this.updateMethodType(e)}))}updateMethodType(e){this.slaveConfigFormGroup.get("method").value!==Yi.RTU&&this.slaveConfigFormGroup.get("method").patchValue(e===Ki.Serial?Xi.ASCII:Yi.SOCKET,{emitEvent:!1})}updateFormEnableState(){this.isSlaveEnabled?(this.slaveConfigFormGroup.enable({emitEvent:!1}),this.showSecurityControl.enable({emitEvent:!1})):(this.slaveConfigFormGroup.disable({emitEvent:!1}),this.showSecurityControl.disable({emitEvent:!1})),this.updateEnablingByProtocol(),this.updateSecurityEnable(this.showSecurityControl.value)}observeShowSecurity(){this.showSecurityControl.valueChanges.pipe(le(this.destroy$)).subscribe((e=>this.updateSecurityEnable(e)))}updateSecurityEnable(e){e&&this.isSlaveEnabled&&this.protocolType!==Ki.Serial?this.slaveConfigFormGroup.get("security").enable({emitEvent:!1}):this.slaveConfigFormGroup.get("security").disable({emitEvent:!1})}updateEnablingByProtocol(){const e=this.protocolType===Ki.Serial,t=e?this.serialSpecificControlKeys:this.tcpUdpSpecificControlKeys,n=e?this.tcpUdpSpecificControlKeys:this.serialSpecificControlKeys;this.isSlaveEnabled&&t.forEach((e=>this.slaveConfigFormGroup.get(e)?.enable({emitEvent:!1}))),n.forEach((e=>this.slaveConfigFormGroup.get(e)?.disable({emitEvent:!1})))}updateSlaveConfig(e){const{vendorName:t="",productCode:n="",vendorUrl:i="",productName:a="",modelName:r=""}=e.identity??{},o={vendorName:t,productCode:n,vendorUrl:i,productName:a,modelName:r},{type:s=Ki.TCP,method:l=Yi.RTU,unitId:p=0,deviceName:c="",deviceType:d="",pollPeriod:u=1e3,sendDataToThingsBoard:m=!1,byteOrder:h=Qi.BIG,wordOrder:g=Qi.BIG,security:f={},values:y={},baudrate:v=this.modbusBaudrates[0],host:x="",port:b=null}=e,w={type:s,method:l,unitId:p,deviceName:c,deviceType:d,pollPeriod:u,sendDataToThingsBoard:!!m,byteOrder:h,wordOrder:g,security:f,identity:o,values:y,baudrate:v,host:s===Ki.Serial?"":x,port:s===Ki.Serial?null:b,serialPort:s===Ki.Serial?b:""};this.slaveConfigFormGroup.setValue(w,{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||QZ)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:QZ,selectors:[["tb-modbus-slave-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>QZ)),multi:!0},{provide:K,useExisting:c((()=>QZ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:112,vars:59,consts:[["serialPort",""],[1,"slave-container",3,"formGroup"],[1,"slave-content","tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-panel","no-border","no-padding","padding-top"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],[1,"tb-form-row"],["formControlName","sendDataToThingsBoard",1,"mat-slide"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[3,"formGroup"],["matInput","","name","value","formControlName","vendorName",3,"placeholder"],["matInput","","name","value","formControlName","productCode",3,"placeholder"],["matInput","","name","value","formControlName","vendorUrl",3,"placeholder"],["matInput","","name","value","formControlName","productName",3,"placeholder"],["matInput","","name","value","formControlName","modelName",3,"placeholder"],["formControlName","values"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],["formControlName","security"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t.ɵɵtext(4,"gateway.server-slave-config"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",5),t.ɵɵtemplate(6,BZ,2,2,"tb-toggle-option",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",7),t.ɵɵtemplate(8,LZ,8,7,"div",8)(9,qZ,8,9,"div",9)(10,zZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",10)(13,"div",11),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-form-field",12)(17,"mat-select",13),t.ɵɵtemplate(18,UZ,2,2,"mat-option",6),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(19,"div",10)(20,"div",14),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",12),t.ɵɵelement(24,"input",15),t.ɵɵpipe(25,"translate"),t.ɵɵtemplate(26,jZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(27,"div",10)(28,"div",17),t.ɵɵtext(29,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",12),t.ɵɵelement(31,"input",18),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,HZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",10)(35,"div",17),t.ɵɵtext(36,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",12),t.ɵɵelement(38,"input",19),t.ɵɵpipe(39,"translate"),t.ɵɵtemplate(40,WZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(41,"div",10)(42,"div",20),t.ɵɵpipe(43,"translate"),t.ɵɵelementStart(44,"span",21),t.ɵɵtext(45," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"mat-form-field",12),t.ɵɵelement(47,"input",22),t.ɵɵpipe(48,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(49,KZ,7,4,"div",8),t.ɵɵelementStart(50,"div",23)(51,"mat-slide-toggle",24)(52,"mat-label"),t.ɵɵtext(53),t.ɵɵpipe(54,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(55,"div",25)(56,"mat-expansion-panel",26)(57,"mat-expansion-panel-header")(58,"mat-panel-title")(59,"div",27),t.ɵɵtext(60,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(61,"div",7)(62,"div",10)(63,"div",11),t.ɵɵpipe(64,"translate"),t.ɵɵtext(65,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(66,"mat-form-field",12)(67,"mat-select",28),t.ɵɵtemplate(68,YZ,2,2,"mat-option",6),t.ɵɵelementEnd()()(),t.ɵɵelementStart(69,"div",10)(70,"div",11),t.ɵɵpipe(71,"translate"),t.ɵɵtext(72,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(73,"mat-form-field",12)(74,"mat-select",29),t.ɵɵtemplate(75,XZ,2,2,"mat-option",6),t.ɵɵelementEnd()()(),t.ɵɵtemplate(76,ZZ,9,5,"div",30),t.ɵɵelementContainerStart(77,31),t.ɵɵelementStart(78,"div",10)(79,"div",4),t.ɵɵtext(80,"gateway.vendor-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",12),t.ɵɵelement(82,"input",32),t.ɵɵpipe(83,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(84,"div",10)(85,"div",4),t.ɵɵtext(86,"gateway.product-code"),t.ɵɵelementEnd(),t.ɵɵelementStart(87,"mat-form-field",12),t.ɵɵelement(88,"input",33),t.ɵɵpipe(89,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(90,"div",10)(91,"div",4),t.ɵɵtext(92,"gateway.vendor-url"),t.ɵɵelementEnd(),t.ɵɵelementStart(93,"mat-form-field",12),t.ɵɵelement(94,"input",34),t.ɵɵpipe(95,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(96,"div",10)(97,"div",4),t.ɵɵtext(98,"gateway.product-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(99,"mat-form-field",12),t.ɵɵelement(100,"input",35),t.ɵɵpipe(101,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(102,"div",10)(103,"div",4),t.ɵɵtext(104,"gateway.model-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(105,"mat-form-field",12),t.ɵɵelement(106,"input",36),t.ɵɵpipe(107,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()(),t.ɵɵelementStart(108,"div",25)(109,"div",27),t.ɵɵtext(110,"gateway.values"),t.ɵɵelementEnd(),t.ɵɵelement(111,"tb-modbus-values",37),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵreference(11);t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,29,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,31,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(25,33,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,35,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(39,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(43,39,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(48,41,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(54,43,"gateway.send-data-to-platform")," "),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(64,45,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(71,47,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup.get("identity")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(83,49,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(89,51,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(95,53,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(101,55,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(107,57,"gateway.set"))}},dependencies:t.ɵɵgetComponentDepsFactory(QZ,[j,_,jX,$X,r$,qn]),encapsulation:2,changeDetection:d.OnPush})}}e("ModbusSlaveConfigComponent",QZ);const JZ=["searchInput"],eQ=()=>["deviceName","info","unitId","type","actions"],tQ=()=>({minWidth:"96px",textAlign:"center"});function nQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",28)(2,"span",29),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",11),t.ɵɵelementStart(6,"button",13),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageSlave(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",13),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.servers-slaves")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function iQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function aQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.deviceName)}}function rQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.info")," "))}function oQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){let e;const i=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(null!==(e=i.host)&&void 0!==e?e:i.port)}}function sQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.unit-id")," "))}function lQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.unitId)}}function pQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.type")))}function cQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.ModbusProtocolLabelsMap.get(e.type)," ")}}function dQ(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",32)}function uQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageSlave(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",13),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteSlave(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function mQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,uQ,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",33),t.ɵɵelementContainer(4,34),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",35)(6,"button",36),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",37),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",38,2),t.ɵɵelementContainer(11,34),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,tQ)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function hQ(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",39)}function gQ(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class fQ{constructor(e,t,n,i,a){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.cdr=a,this.isLegacy=!1,this.textSearchMode=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.ModbusProtocolLabelsMap=sa,this.onChange=()=>{},this.onTouched=()=>{},this.destroy$=new te,this.masterFormGroup=this.fb.group({slaves:this.fb.array([])}),this.dataSource=new yQ}get slaves(){return this.masterFormGroup.get("slaves")}ngOnInit(){this.masterFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateTableData(e.slaves),this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(de(150),ce(((e,t)=>(e??"")===t.trim())),le(this.destroy$)).subscribe((e=>this.updateTableData(this.slaves.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.slaves.clear(),this.pushDataAsFormArrays(e.slaves)}enterFilterMode(){this.textSearchMode=!0,this.cdr.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.slaves.value),this.textSearchMode=!1,this.textSearch.reset()}manageSlave(e,t){e&&e.stopPropagation();const n=ke(t),i=n?this.slaves.at(t).value:{};this.getSlaveDialog(i,n?"action.apply":"action.add").afterClosed().pipe(ye(1),le(this.destroy$)).subscribe((e=>{e&&(n?this.slaves.at(t).patchValue(e):this.slaves.push(this.fb.control(e)),this.masterFormGroup.markAsDirty())}))}getSlaveDialog(e,t){return this.isLegacy?this.dialog.open(RZ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,hideNewFields:!0,buttonTitle:t}}):this.dialog.open(hZ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,hideNewFields:!1}})}deleteSlave(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-slave-title",{name:this.slaves.controls[t].value.deviceName}),this.translate.instant("gateway.delete-slave-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(ye(1),le(this.destroy$)).subscribe((e=>{e&&(this.slaves.removeAt(t),this.masterFormGroup.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.slaves.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||fQ)(t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:fQ,selectors:[["tb-modbus-master-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(JZ,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{isLegacy:"isLegacy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>fQ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:55,vars:41,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-master-table","tb-absolute-fill"],[1,"tb-form-panel","no-border","no-padding","padding-top","hint-container"],["tbTruncateWithTooltip","",1,"tb-form-hint","tb-primary-fill","tb-flex"],[1,"tb-master-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-master-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"div",5),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"div",6)(6,"mat-toolbar",7),t.ɵɵtemplate(7,nQ,14,9,"div",8),t.ɵɵpipe(8,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-toolbar",7)(10,"div",9)(11,"button",10),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"mat-icon"),t.ɵɵtext(14,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-form-field",11)(16,"mat-label"),t.ɵɵtext(17," "),t.ɵɵelementEnd(),t.ɵɵelement(18,"input",12,0),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",13),t.ɵɵpipe(22,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(23,"mat-icon"),t.ɵɵtext(24,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(25,"div",14)(26,"table",15),t.ɵɵelementContainerStart(27,16),t.ɵɵtemplate(28,iQ,4,3,"mat-header-cell",17)(29,aQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(30,16),t.ɵɵtemplate(31,rQ,3,3,"mat-header-cell",17)(32,oQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(33,16),t.ɵɵtemplate(34,sQ,3,3,"mat-header-cell",17)(35,lQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(36,16),t.ɵɵtemplate(37,pQ,4,3,"mat-header-cell",17)(38,cQ,2,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(39,19),t.ɵɵtemplate(40,dQ,1,0,"mat-header-cell",20)(41,mQ,12,6,"mat-cell",21),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(42,hQ,1,0,"mat-header-row",22)(43,gQ,1,0,"mat-row",23),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"section",24),t.ɵɵpipe(45,"async"),t.ɵɵelementStart(46,"button",25),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageSlave(i))})),t.ɵɵelementStart(47,"mat-icon",26),t.ɵɵtext(48,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"span"),t.ɵɵtext(50),t.ɵɵpipe(51,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(52,"span",27),t.ɵɵpipe(53,"async"),t.ɵɵtext(54," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,23,"gateway.hints.modbus-master")),t.ɵɵadvance(3),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(8,25,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(12,27,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(20,29,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(22,31,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","info"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","unitId"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","type"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(39,eQ))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(40,eQ)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(45,33,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(51,35,"gateway.add-slave")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(53,37,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(fQ,[j,_,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 60px);background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .tb-master-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:15%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-master-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{z-index:1000}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("ModbusMasterTableComponent",fQ),Ge([rt()],fQ.prototype,"isLegacy",void 0);class yQ extends G{constructor(){super()}}e("SlavesDatasource",yQ);class vQ extends Ba{constructor(){super(),this.enableSlaveControl=new X(!1),this.enableSlaveControl.valueChanges.pipe(bn()).subscribe((e=>{this.updateSlaveEnabling(e),this.basicFormGroup.get("slave").updateValueAndValidity({emitEvent:!!this.onChange})}))}writeValue(e){super.writeValue(e),this.onEnableSlaveControl(e)}validate(){const{master:e,slave:t}=this.basicFormGroup.value,n=!e?.slaves?.length&&(Se(t,{})||!t);return!this.basicFormGroup.valid||n?{basicFormGroup:{valid:!1}}:null}initBasicFormGroup(){return this.fb.group({master:[],slave:[]})}updateSlaveEnabling(e){e?this.basicFormGroup.get("slave").enable({emitEvent:!1}):this.basicFormGroup.get("slave").disable({emitEvent:!1})}onEnableSlaveControl(e){this.enableSlaveControl.setValue(!!e.slave&&!Se(e.slave,{}))}static{this.ɵfac=function(e){return new(e||vQ)}}static{this.ɵdir=t.ɵɵdefineDirective({type:vQ,features:[t.ɵɵInheritDefinitionFeature]})}}e("ModbusBasicConfigDirective",vQ);class xQ extends vQ{constructor(){super(...arguments),this.isLegacy=!1}mapConfigToFormValue({master:e,slave:t}){return{master:e?.slaves?e:{slaves:[]},slave:t??{}}}getMappedValue(e){return{master:e.master,slave:e.slave}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(xQ)))(n||xQ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:xQ,selectors:[["tb-modbus-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>xQ)),multi:!0},{provide:K,useExisting:c((()=>xQ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:19,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","master",3,"isLegacy"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-form-hint","tb-primary-fill","tb-flex","center"],[1,"tb-form-row"],[1,"mat-slide",3,"formControl"],["formControlName","slave"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-modbus-master-table",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4)(10,"div",5),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",6)(14,"mat-slide-toggle",7)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(18,"tb-modbus-slave-config",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(5,11,"gateway.master-connections")),t.ɵɵadvance(2),t.ɵɵproperty("isLegacy",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(8,13,"gateway.server-config")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,15,"gateway.hints.modbus-server")),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.enableSlaveControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,17,"gateway.enable")," "))},dependencies:t.ɵɵgetComponentDepsFactory(xQ,[j,_,QZ,fQ,Gn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}'],changeDetection:d.OnPush})}}e("ModbusBasicConfigComponent",xQ);class bQ extends vQ{constructor(){super(...arguments),this.isLegacy=!0}mapConfigToFormValue(e){return{master:e.master?.slaves?e.master:{slaves:[]},slave:e.slave?Ua.mapSlaveToUpgradedVersion(e.slave):{}}}getMappedValue(e){return{master:e.master,slave:e.slave?Ua.mapSlaveToDowngradedVersion(e.slave):{}}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(bQ)))(n||bQ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:bQ,selectors:[["tb-modbus-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>bQ)),multi:!0},{provide:K,useExisting:c((()=>bQ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:19,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","master",3,"isLegacy"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-form-hint","tb-primary-fill","tb-flex","center"],[1,"tb-form-row"],[1,"mat-slide",3,"formControl"],["formControlName","slave"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-modbus-master-table",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4)(10,"div",5),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",6)(14,"mat-slide-toggle",7)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(18,"tb-modbus-slave-config",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(5,11,"gateway.master-connections")),t.ɵɵadvance(2),t.ɵɵproperty("isLegacy",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(8,13,"gateway.server-config")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,15,"gateway.hints.modbus-server")),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.enableSlaveControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,17,"gateway.enable")," "))},dependencies:t.ɵɵgetComponentDepsFactory(bQ,[j,_,QZ,fQ,Gn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}'],changeDetection:d.OnPush})}}e("ModbusLegacyBasicConfigComponent",bQ);const wQ=()=>({maxWidth:"970px"});function SQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",20),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.get("key").value," ")}}function CQ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(e.get("methodRPC").value)}}function _Q(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(e.get("attributeOnThingsBoard").value)}}function TQ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate2(" ",e.get("requestExpression").value+" - ","",e.get("attributeNameExpression").value," ")}}function IQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21),t.ɵɵtemplate(1,CQ,2,1,"ng-container",22)(2,_Q,2,1,"ng-container",22)(3,TQ,2,2,"ng-container",22),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngSwitch",e.keysType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.ATTRIBUTES_UPDATES),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.ATTRIBUTES_REQUESTS)}}function EQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function MQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function kQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function PQ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",42),2&e){const e=t.ɵɵnextContext(5);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}function DQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",24)(2,"div",25),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",26)(5,"div",27),t.ɵɵpipe(6,"translate"),t.ɵɵpipe(7,"translate"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"div",28)(11,"mat-form-field",29),t.ɵɵelement(12,"input",30),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,EQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(15,"div",24)(16,"div",25),t.ɵɵtext(17,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",26)(19,"div",32)(20,"span",33),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(23,"div",34),t.ɵɵelementEnd(),t.ɵɵelementStart(24,"label",35),t.ɵɵtext(25,"from"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",36),t.ɵɵelement(27,"input",37),t.ɵɵpipe(28,"translate"),t.ɵɵtemplate(29,MQ,3,3,"mat-icon",31),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"label",38),t.ɵɵtext(31,"to"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-form-field",36),t.ɵɵelement(33,"input",39),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,kQ,3,3,"mat-icon",31),t.ɵɵelementEnd()(),t.ɵɵtemplate(36,PQ,1,2,"tb-report-strategy",40),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",n.keysType===n.SocketValueKey.ATTRIBUTES?t.ɵɵpipeBind1(6,12,"gateway.hints.socket.key-attribute"):t.ɵɵpipeBind1(7,14,"gateway.hints.socket.key-telemetry")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,16,"gateway.key")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,18,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("key").hasError("required")&&e.get("key").touched),t.ɵɵadvance(7),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,20,"gateway.byte")),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/byte_fn")("tb-help-popup-style",t.ɵɵpureFunction0(26,wQ)),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("byteFrom").hasError("required")&&e.get("byteFrom").touched),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(34,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("byteTo").hasError("required")&&e.get("byteTo").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withReportStrategy&&(n.keysType===n.SocketValueKey.ATTRIBUTES||n.keysType===n.SocketValueKey.TIMESERIES))}}function OQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function AQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function FQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",43),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29),t.ɵɵelement(7,"input",44),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,OQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",26)(11,"div",45),t.ɵɵpipe(12,"translate"),t.ɵɵtext(13," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",28)(15,"mat-form-field",29)(16,"mat-select",46),t.ɵɵtemplate(17,AQ,2,2,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(18,"div",48)(19,"mat-slide-toggle",49),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(20,"mat-label",50),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,7,"gateway.method-name")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("methodRPC").hasError("required")&&e.get("methodRPC").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(12,11,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,13,"gateway.hints.socket.with-response")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,15,"gateway.rpc.withResponse")," ")}}function RQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function BQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function NQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.request-expression-required"))}function LQ(e,n){1&e&&t.ɵɵelement(0,"div",34),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/request-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,wQ))}function VQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function qQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-name-expression-required"))}function GQ(e,n){1&e&&t.ɵɵelement(0,"div",34),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/attribute-name-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,wQ))}function zQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",45),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4," gateway.type "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29)(7,"mat-select",52),t.ɵɵtemplate(8,RQ,3,4,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",26)(10,"div",43),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",53)(14,"mat-form-field",29)(15,"mat-select",54),t.ɵɵtemplate(16,BQ,3,4,"mat-option",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"mat-form-field",29),t.ɵɵelement(18,"input",55),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,NQ,3,3,"mat-icon",31)(21,LQ,1,3,"div",56),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",26)(23,"div",43),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"div",53)(27,"mat-form-field",29)(28,"mat-select",57),t.ɵɵtemplate(29,VQ,3,4,"mat-option",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(30,"mat-form-field",29),t.ɵɵelement(31,"input",58),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,qQ,3,3,"mat-icon",31)(34,GQ,1,3,"div",56),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,12,"gateway.hints.socket.attribute-requests-type")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.requestsType),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,14,"gateway.request-expression")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.expressionType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("requestExpression").hasError("required")&&e.get("requestExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("requestExpressionSource").value===n.ExpressionType.Expression),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,18,"gateway.attribute-name-expression")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.expressionType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("attributeNameExpression").hasError("required")&&e.get("attributeNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("attributeNameExpressionSource").value===n.ExpressionType.Expression)}}function UQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function jQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.socket.attribute-on-platform-required"))}function HQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",45),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29)(7,"mat-select",46),t.ɵɵtemplate(8,UQ,2,2,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",26)(10,"div",43),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",28)(14,"mat-form-field",29),t.ɵɵelement(15,"input",59),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,jQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,5,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.attribute-on-platform")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("attributeOnThingsBoard").hasError("required")&&e.get("attributeOnThingsBoard").touched)}}function WQ(e,n){if(1&e&&t.ɵɵtemplate(0,DQ,37,27,"div",23)(1,FQ,24,17,"div",23)(2,zQ,35,22,"div",23)(3,HQ,18,11,"div",23),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.TIMESERIES||e.keysType===e.SocketValueKey.ATTRIBUTES),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.ATTRIBUTES_REQUESTS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.ATTRIBUTES_UPDATES)}}function $Q(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",12)(1,"div",13),t.ɵɵelementContainerStart(2,14),t.ɵɵelementStart(3,"mat-expansion-panel",15)(4,"mat-expansion-panel-header",16)(5,"mat-panel-title"),t.ɵɵtemplate(6,SQ,2,1,"div",17)(7,IQ,4,4,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,WQ,4,4,"ng-template",18),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",19),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵreference(8),r=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",r.keysType===r.SocketValueKey.TIMESERIES||r.keysType===r.SocketValueKey.ATTRIBUTES)("ngIfElse",a),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,r.deleteKeyTitle))}}function KQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10),t.ɵɵtemplate(1,$Q,14,7,"div",11),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function YQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",60)(1,"span",61),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class XQ extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.withReportStrategy=!0,this.keysDataApplied=new u,this.SocketValueKey=li,this.socketEncoding=Object.values(mt),this.requestsType=Object.values(ci),this.expressionType=Object.values(di),this.ExpressionType=di,this.ReportStrategyDefaultValue=en}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}trackByKey(e,t){return t}addKey(){let e;e=this.keysType===li.RPC_METHODS?this.fb.group({methodRPC:["",[$.required]],encoding:[mt.UTF16,[$.required]],withResponse:[!0]}):this.keysType===li.ATTRIBUTES_UPDATES?this.fb.group({encoding:[mt.UTF16,[$.required]],attributeOnThingsBoard:["",[$.required]]}):this.keysType===li.ATTRIBUTES_REQUESTS?this.fb.group({type:[ci.Shared],requestExpressionSource:[di.Constant],attributeNameExpressionSource:[di.Constant],requestExpression:["",[$.required]],attributeNameExpression:["",[$.required]]}):this.fb.group({key:["",[$.required,$.pattern(an)]],byteFrom:[0,[$.required]],byteTo:[0,[$.required]],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]}),this.keysListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){let e=this.keysListFormArray.value.map((({reportStrategy:e,...t})=>({...t,...e&&{reportStrategy:e}})));this.keysDataApplied.emit(e)}prepareKeysFormArray(e){const t=[];return e?.forEach((e=>{let n;if(this.keysType===li.RPC_METHODS){const t=e;n=this.fb.group({methodRPC:[t.methodRPC,[$.required]],encoding:[t.encoding,[$.required]],withResponse:[t.withResponse]})}else if(this.keysType===li.ATTRIBUTES_REQUESTS){const t=e;n=this.fb.group({type:[t.type??ci.Shared],requestExpressionSource:[t.requestExpressionSource??di.Constant],attributeNameExpressionSource:[t.attributeNameExpressionSource??di.Constant],requestExpression:[t.requestExpression,[$.required]],attributeNameExpression:[t.attributeNameExpression,[$.required]]})}else if(this.keysType===li.ATTRIBUTES_UPDATES)n=this.fb.group({encoding:[e.encoding??mt.UTF16],attributeOnThingsBoard:[e.attributeOnThingsBoard,[$.required]]});else{const{key:t,byteFrom:i,byteTo:a,reportStrategy:r}=e;n=this.fb.group({key:[t,[$.required,$.pattern(an)]],byteFrom:[i??0,[$.required]],byteTo:[a??0,[$.required]],reportStrategy:[{value:r,disabled:this.isReportStrategyDisabled()}]})}t.push(n)})),this.fb.array(t)}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keysType===li.ATTRIBUTES||this.keysType===li.TIMESERIES))}static{this.ɵfac=function(e){return new(e||XQ)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(it.TbPopoverComponent),t.ɵɵdirectiveInject(Ye.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:XQ,selectors:[["tb-device-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",withReportStrategy:"withReportStrategy"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["valueTitle",""],[1,"tb-device-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["class","title-container",4,"ngIf","ngIfElse"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"title-container"],[1,"title-container",3,"ngSwitch"],[4,"ngSwitchCase"],["class","tb-form-panel no-border no-padding",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],[1,"fixed-title-width","tb-flex","align-center"],[1,"tb-required"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["for","byteFrom",1,"tb-small-label"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","flex-1"],["matInput","","required","","formControlName","byteFrom","type","number","id","byteFrom",3,"placeholder"],["for","byteTo",1,"tb-small-label"],["matInput","","required","","formControlName","byteTo","type","number","id","byteTo",3,"placeholder"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","methodRPC",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","encoding"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-row"],["formControlName","withResponse",1,"mat-slide",3,"click"],[3,"tb-hint-tooltip-icon"],[3,"value"],["formControlName","type"],[1,"tb-flex"],["formControlName","requestExpressionSource"],["matInput","","name","value","formControlName","requestExpression",3,"placeholder"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],["formControlName","attributeNameExpressionSource"],["matInput","","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matInput","","name","value","formControlName","attributeOnThingsBoard",3,"placeholder"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"div",3)(2,"div",4),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,KQ,2,2,"div",5),t.ɵɵelementStart(6,"div")(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(10,YQ,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",7)(13,"button",8),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(11);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,n.addKeyTitle)," "),t.ɵɵadvance(6),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(XQ,[j,_,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-small-label[_ngcontent-%COMP%]{font-size:16px;padding-right:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}e("DeviceDataKeysPanelComponent",XQ),Ge([I()],XQ.prototype,"withReportStrategy",void 0);const ZQ=()=>({maxWidth:"970px"});function QQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-filter-required"))}function JQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function eJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function tJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",41),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function nJ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",27),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function iJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function aJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function rJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.type," ")}}function oJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.encoding," ")}}function sJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.methodRPC," ")}}class lJ extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.destroyRef=l,this.cdr=p,this.deviceFormGroup=this.fb.group({address:["",[$.required,$.pattern(an)]],deviceName:["",[$.required,$.pattern(an)]],deviceType:["",[$.required,$.pattern(an)]],encoding:[mt.UTF8],telemetry:[[]],attributes:[[]],attributeRequests:[[]],attributeUpdates:[[]],serverSideRpc:[[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.keysPopupClosed=!0,this.SocketValueKey=li,this.socketDeviceHelpLink=O+"/docs/iot-gateway/config/socket/#device-subsection",this.socketEncoding=Object.values(mt),this.ReportStrategyDefaultValue=en,this.deviceFormGroup.patchValue(this.data.value,{emitEvent:!1})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.deviceFormGroup.valid){const e=this.deviceFormGroup.value;Te(e),this.dialogRef.close(e)}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))return void this.popoverService.hidePopover(i);const a=this.deviceFormGroup.get(n),r={keys:a.value,keysType:n,panelTitle:pi.get(n),addKeyTitle:ui.get(n),deleteKeyTitle:mi.get(n),noKeysText:hi.get(n),withReportStrategy:this.data.withReportStrategy};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,XQ,"leftBottom",!1,null,r,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(bn(this.destroyRef)).subscribe((e=>{this.popoverComponent.hide(),a.patchValue(e),a.markAsDirty(),this.cdr.markForCheck()})),this.popoverComponent.tbHideStart.pipe(bn(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}static{this.ɵfac=function(e){return new(e||lJ)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:lJ,selectors:[["tb-device-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:119,vars:57,consts:[["socketTelemetryButton",""],["attributesButton",""],["attributeRequestsButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"dialog-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width"],["translate","",1,"tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","encoding"],[3,"value",4,"ngFor","ngForOf"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",5)(1,"mat-toolbar",6)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",7)(6,"div",8),t.ɵɵelementStart(7,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",10),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15),t.ɵɵtext(15," gateway.address-filter "),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"div",16)(17,"mat-form-field",17),t.ɵɵelement(18,"input",18),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,QQ,3,3,"mat-icon",19),t.ɵɵelement(21,"div",20),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",13)(23,"div",21),t.ɵɵtext(24,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",16)(26,"mat-form-field",17),t.ɵɵelement(27,"input",22),t.ɵɵpipe(28,"translate"),t.ɵɵtemplate(29,JQ,3,3,"mat-icon",19),t.ɵɵelementEnd()()(),t.ɵɵelementStart(30,"div",13)(31,"div",21),t.ɵɵtext(32,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"div",16)(34,"mat-form-field",17),t.ɵɵelement(35,"input",23),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,eJ,3,3,"mat-icon",19),t.ɵɵelementEnd()()(),t.ɵɵelementStart(38,"div",13)(39,"div",24),t.ɵɵpipe(40,"translate"),t.ɵɵtext(41," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",16)(43,"mat-form-field",17)(44,"mat-select",25),t.ɵɵtemplate(45,tJ,2,2,"mat-option",26),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(46,nJ,1,2,"tb-report-strategy",27),t.ɵɵelementStart(47,"div",28)(48,"div",29),t.ɵɵtext(49,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(50,"div",30)(51,"mat-chip-listbox",31),t.ɵɵtemplate(52,iJ,2,1,"mat-chip",32),t.ɵɵelementStart(53,"mat-chip",33),t.ɵɵelement(54,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(55,"button",35,0),t.ɵɵpipe(57,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(56);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.TIMESERIES))})),t.ɵɵelementStart(58,"tb-icon",36),t.ɵɵtext(59,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(60,"div",28)(61,"div",29),t.ɵɵtext(62,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"div",30)(64,"mat-chip-listbox",31),t.ɵɵtemplate(65,aJ,2,1,"mat-chip",32),t.ɵɵelementStart(66,"mat-chip",33),t.ɵɵelement(67,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(68,"button",35,1),t.ɵɵpipe(70,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(69);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES))})),t.ɵɵelementStart(71,"tb-icon",36),t.ɵɵtext(72,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(73,"div",28)(74,"div",29),t.ɵɵtext(75,"gateway.attribute-requests"),t.ɵɵelementEnd(),t.ɵɵelementStart(76,"div",30)(77,"mat-chip-listbox",31),t.ɵɵtemplate(78,rJ,2,1,"mat-chip",32),t.ɵɵelementStart(79,"mat-chip",33),t.ɵɵelement(80,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(81,"button",35,2),t.ɵɵpipe(83,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(82);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES_REQUESTS))})),t.ɵɵelementStart(84,"tb-icon",36),t.ɵɵtext(85,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(86,"div",28)(87,"div",29),t.ɵɵtext(88,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(89,"div",30)(90,"mat-chip-listbox",31),t.ɵɵtemplate(91,oJ,2,1,"mat-chip",32),t.ɵɵelementStart(92,"mat-chip",33),t.ɵɵelement(93,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(94,"button",35,3),t.ɵɵpipe(96,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(95);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(97,"tb-icon",36),t.ɵɵtext(98,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(99,"div",28)(100,"div",29),t.ɵɵtext(101,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(102,"div",30)(103,"mat-chip-listbox",31),t.ɵɵtemplate(104,sJ,2,1,"mat-chip",32),t.ɵɵelementStart(105,"mat-chip",33),t.ɵɵelement(106,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(107,"button",35,4),t.ɵɵpipe(109,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(108);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.RPC_METHODS))})),t.ɵɵelementStart(110,"tb-icon",36),t.ɵɵtext(111,"edit"),t.ɵɵelementEnd()()()()()(),t.ɵɵelementStart(112,"div",37)(113,"button",38),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(114),t.ɵɵpipe(115,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(116,"button",39),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(117),t.ɵɵpipe(118,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵproperty("formGroup",n.deviceFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,32,"gateway.device")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.socketDeviceHelpLink),t.ɵɵadvance(12),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,34,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("address").hasError("required")&&n.deviceFormGroup.get("address").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/address-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(56,ZQ)),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,36,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("deviceName").hasError("required")&&n.deviceFormGroup.get("deviceName").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,38,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("deviceType").hasError("required")&&n.deviceFormGroup.get("deviceType").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(40,40,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?46:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("telemetry").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("telemetry").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(57,42,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,44,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeRequests").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributeRequests").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(83,46,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(96,48,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(109,50,"action.edit")),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(115,52,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.deviceFormGroup.invalid||!n.deviceFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(118,54,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(lJ,[j,_,Gn,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%]{width:77vw;max-width:800px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .dialog-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}[_nghost-%COMP%] .device-config{gap:12px;padding-left:10px;padding-right:10px}[_nghost-%COMP%] .device-node-pattern-field{flex-basis:3%}'],changeDetection:d.OnPush})}}e("DeviceDialogComponent",lJ);const pJ=["searchInput"],cJ=()=>["address","deviceName","actions"],dJ=()=>({minWidth:"96px",textAlign:"center"});function uJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",26)(2,"span",27),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageDevices(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.devices")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function mJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.address-filter")," "))}function hJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.address)}}function gJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function fJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.deviceName)}}function yJ(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",30)}function vJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageDevices(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteDevice(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function xJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,vJ,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",31),t.ɵɵelementContainer(4,32),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"button",34),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",35),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",36,2),t.ɵɵelementContainer(11,32),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,dJ)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function bJ(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",37)}function wJ(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class SJ{constructor(e,t,n,i,a){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.cdr=a,this.withReportStrategy=!0,this.textSearchMode=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.onChange=()=>{},this.destroy$=new te,this.devicesFormGroup=this.fb.array([]),this.dataSource=new CJ}ngOnInit(){this.devicesFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.updateTableData(e),this.onChange(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(de(150),ce(((e,t)=>(e??"")===t.trim())),le(this.destroy$)).subscribe((e=>this.updateTableData(this.devicesFormGroup.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.devicesFormGroup.clear(),this.pushDataAsFormArrays(e)}enterFilterMode(){this.textSearchMode=!0,this.cdr.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.devicesFormGroup.value),this.textSearchMode=!1,this.textSearch.reset()}manageDevices(e,t){e&&e.stopPropagation();const n=ke(t),i=n?this.devicesFormGroup.at(t).value:{};this.getDeviceDialog(i,n?"action.apply":"action.add").afterClosed().pipe(ye(1),le(this.destroy$)).subscribe((e=>{e&&(n?this.devicesFormGroup.at(t).patchValue(e):this.devicesFormGroup.push(this.fb.control(e)),this.devicesFormGroup.markAsDirty())}))}validate(){return this.devicesFormGroup.controls.length?null:{devicesFormGroup:{valid:!1}}}getDeviceDialog(e,t){return this.dialog.open(lJ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy}})}deleteDevice(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-device-title",{name:this.devicesFormGroup.controls[t].value.deviceName}),this.translate.instant("gateway.delete-device-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(ye(1),le(this.destroy$)).subscribe((e=>{e&&(this.devicesFormGroup.removeAt(t),this.devicesFormGroup.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.devicesFormGroup.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||SJ)(t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:SJ,selectors:[["tb-devices-config-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(pJ,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>SJ)),multi:!0},{provide:K,useExisting:c((()=>SJ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:45,vars:36,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-device-table","tb-absolute-fill"],[1,"tb-device-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-device-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,uJ,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵelementContainerStart(23,14),t.ɵɵtemplate(24,mJ,3,3,"mat-header-cell",15)(25,hJ,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(26,14),t.ɵɵtemplate(27,gJ,4,3,"mat-header-cell",15)(28,fJ,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(29,17),t.ɵɵtemplate(30,yJ,1,0,"mat-header-cell",18)(31,xJ,12,6,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(32,bJ,1,0,"mat-header-row",20)(33,wJ,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"section",22),t.ɵɵpipe(35,"async"),t.ɵɵelementStart(36,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageDevices(i))})),t.ɵɵelementStart(37,"mat-icon",24),t.ɵɵtext(38,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(39,"span"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(42,"span",25),t.ɵɵpipe(43,"async"),t.ɵɵtext(44," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,20,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,22,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,24,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,26,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","address"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(34,cJ))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(35,cJ)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(35,28,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,30,"gateway.add-device")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(43,32,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(SJ,[j,_,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:35%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("DevicesConfigTableComponent",SJ),Ge([I()],SJ.prototype,"withReportStrategy",void 0);let CJ=class extends G{constructor(){super()}};function _J(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",14),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function TJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function IJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.socketConfigFormGroup.get("port")))}}function EJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.socketConfigFormGroup.get("bufferSize").hasError("min")?"gateway.buffer-size-range":"gateway.buffer-size-required"))}}e("DevicesDatasource",CJ);class MJ{constructor(e){this.fb=e,this.portLimits=Ii,this.socketTypes=Object.values(si),this.onChange=e=>{},this.destroy$=new te,this.socketConfigFormGroup=this.fb.group({address:["",[$.required,$.pattern(an)]],type:[si.TCP],port:[5e4,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],bufferSize:[1024,[$.required,$.min(1),$.pattern(an)]]}),this.socketConfigFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){const{address:t="",type:n=si.TCP,port:i=5e4,bufferSize:a=1024}=e??{};this.socketConfigFormGroup.reset({address:t,type:n,port:i,bufferSize:a})}validate(){return this.socketConfigFormGroup.valid?null:{socketConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||MJ)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:MJ,selectors:[["tb-socket-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>MJ)),multi:!0},{provide:K,useExisting:c((()=>MJ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:34,vars:25,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width"],["tbTruncateWithTooltip",""],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","name","value","min","1","formControlName","bufferSize",3,"placeholder"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"tb-toggle-select",4),t.ɵɵtemplate(7,_J,2,2,"tb-toggle-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",6),t.ɵɵtext(10,"gateway.address"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",7)(12,"mat-form-field",8),t.ɵɵelement(13,"input",9),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,TJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",1)(17,"div",6),t.ɵɵtext(18,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",7)(20,"mat-form-field",8),t.ɵɵelement(21,"input",11),t.ɵɵpipe(22,"translate"),t.ɵɵtemplate(23,IJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(24,"div",1)(25,"div",12),t.ɵɵpipe(26,"translate"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",7)(30,"mat-form-field",8),t.ɵɵelement(31,"input",13),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,EJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()()()),2&e&&(t.ɵɵproperty("formGroup",n.socketConfigFormGroup),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,13,"gateway.connection-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketTypes),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.socketConfigFormGroup.get("address").hasError("required")&&n.socketConfigFormGroup.get("address").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,17,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.socketConfigFormGroup.get("port").hasError("required")||n.socketConfigFormGroup.get("port").hasError("min")||n.socketConfigFormGroup.get("port").hasError("max"))&&n.socketConfigFormGroup.get("port").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(26,19,"gateway.hints.buffer-size")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(28,21,"gateway.buffer-size")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,23,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.socketConfigFormGroup.get("bufferSize").hasError("required")||n.socketConfigFormGroup.get("bufferSize").hasError("min")&&n.socketConfigFormGroup.get("bufferSize").touched))},dependencies:t.ɵɵgetComponentDepsFactory(MJ,[j,_,r$,qn]),encapsulation:2,changeDetection:d.OnPush})}}e("SocketConfigComponent",MJ);class kJ extends Ba{constructor(){super(...arguments),this.isLegacy=!1}getMappedValue(e){return e}initBasicFormGroup(){return this.fb.group({socket:[],devices:[]})}mapConfigToFormValue(e){return{socket:e.socket??{},devices:e.devices??[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(kJ)))(n||kJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:kJ,selectors:[["tb-socket-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>kJ)),multi:!0},{provide:K,useExisting:c((()=>kJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:10,vars:14,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","socket"],["formControlName","devices",3,"withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-socket-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-devices-config-table",4),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,8,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,10,"gateway.socket"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,12,"gateway.devices"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("withReportStrategy",!n.isLegacy))},dependencies:t.ɵɵgetComponentDepsFactory(kJ,[j,_,MJ,SJ]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("SocketBasicConfigComponent",kJ);class PJ extends Ba{constructor(){super(...arguments),this.isLegacy=!0}getMappedValue(e){return Ha.mapSocketToDowngradedVersion(e)}initBasicFormGroup(){return this.fb.group({socket:[],devices:[]})}mapConfigToFormValue(e){return{socket:Ha.mapSocketToUpgradedVersion(e),devices:e?.devices?Ha.mapDevicesToUpgradedVersion(e.devices):[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(PJ)))(n||PJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:PJ,selectors:[["tb-socket-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>PJ)),multi:!0},{provide:K,useExisting:c((()=>PJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:10,vars:14,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","socket"],["formControlName","devices",3,"withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-socket-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-devices-config-table",4),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,8,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,10,"gateway.socket"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,12,"gateway.devices"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("withReportStrategy",!n.isLegacy))},dependencies:t.ɵɵgetComponentDepsFactory(PJ,[j,_,MJ,SJ]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}function DJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.name-required"))}function OJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function AJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.applicationConfigFormGroup.get("port")))}}function FJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.object-id-required"))}function RJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.vendor-id-required"))}function BJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SegmentationTypeTranslationsMap.get(e))," ")}}e("SocketLegacyBasicConfigComponent",PJ);class NJ extends Ra{constructor(){super(...arguments),this.segmentationTypes=Object.values(fa),this.SegmentationTypeTranslationsMap=ya,this.portLimits=Ii}get applicationConfigFormGroup(){return this.formGroup}initFormGroup(){return this.fb.group({objectName:["",[$.required,$.pattern(an)]],host:["",[$.required,$.pattern(an)]],port:[null,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],mask:[""],objectIdentifier:[null,[$.required]],vendorIdentifier:[null,[$.required]],maxApduLengthAccepted:[],segmentationSupported:[fa.BOTH],networkNumber:[],deviceDiscoveryTimeoutInSec:[]})}mapOnChangeValue(e){return Te(e),e}onWriteValue(e){const{maxApduLengthAccepted:t=1476,segmentationSupported:n=fa.BOTH,networkNumber:i=3,deviceDiscoveryTimeoutInSec:a=5,...r}=e;this.formGroup.reset({...r,maxApduLengthAccepted:t,segmentationSupported:n,networkNumber:i,deviceDiscoveryTimeoutInSec:a},{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(NJ)))(n||NJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:NJ,selectors:[["tb-bacnet-application-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>NJ)),multi:!0},{provide:K,useExisting:c((()=>NJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:83,vars:53,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","autocomplete","off","name","value","formControlName","objectName",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["translate","",1,"fixed-title-width"],["matInput","","name","value","formControlName","mask",3,"placeholder"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","objectIdentifier",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","vendorIdentifier",3,"placeholder"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","padding-top"],["matInput","","type","number","min","0","name","value","formControlName","maxApduLengthAccepted",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","segmentationSupported"],[3,"value"],["matInput","","type","number","min","0","name","value","formControlName","networkNumber",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","deviceDiscoveryTimeoutInSec",3,"placeholder"],["translate","","matSuffix","",1,"block","pr-2"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.bacnet.object-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3)(5,"mat-form-field",4),t.ɵɵelement(6,"input",5),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,DJ,3,3,"mat-icon",6),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",1)(10,"div",2),t.ɵɵtext(11,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",4),t.ɵɵelement(13,"input",7),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,OJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"div",1)(17,"div",2),t.ɵɵtext(18,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",4),t.ɵɵelement(20,"input",8),t.ɵɵpipe(21,"translate"),t.ɵɵtemplate(22,AJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"div",1)(24,"div",9),t.ɵɵtext(25,"gateway.network-mask"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",4),t.ɵɵelement(27,"input",10),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(29,"div",1)(30,"div",11),t.ɵɵpipe(31,"translate"),t.ɵɵtext(32,"gateway.object-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"mat-form-field",4),t.ɵɵelement(34,"input",12),t.ɵɵpipe(35,"translate"),t.ɵɵtemplate(36,FJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(37,"div",1)(38,"div",11),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"gateway.vendor-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(41,"mat-form-field",4),t.ɵɵelement(42,"input",13),t.ɵɵpipe(43,"translate"),t.ɵɵtemplate(44,RJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"div",14)(46,"mat-expansion-panel",15)(47,"mat-expansion-panel-header")(48,"mat-panel-title")(49,"div",16),t.ɵɵtext(50,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(51,"div",17)(52,"div",1)(53,"div",11),t.ɵɵpipe(54,"translate"),t.ɵɵtext(55,"gateway.bacnet.apdu-length"),t.ɵɵelementEnd(),t.ɵɵelementStart(56,"mat-form-field",4),t.ɵɵelement(57,"input",18),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(59,"div",1)(60,"div",19),t.ɵɵpipe(61,"translate"),t.ɵɵtext(62,"gateway.bacnet.segmentation.label"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"mat-form-field",4)(64,"mat-select",20),t.ɵɵrepeaterCreate(65,BJ,3,4,"mat-option",21,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵelementStart(67,"div",1)(68,"div",19),t.ɵɵpipe(69,"translate"),t.ɵɵtext(70,"gateway.bacnet.network-number"),t.ɵɵelementEnd(),t.ɵɵelementStart(71,"mat-form-field",4),t.ɵɵelement(72,"input",22),t.ɵɵpipe(73,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(74,"div",1)(75,"div",19),t.ɵɵpipe(76,"translate"),t.ɵɵtext(77,"gateway.bacnet.device-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(78,"mat-form-field",4),t.ɵɵelement(79,"input",23),t.ɵɵpipe(80,"translate"),t.ɵɵelementStart(81,"span",24),t.ɵɵtext(82,"gateway.suffix.s"),t.ɵɵelementEnd()()()()()()()),2&e&&(t.ɵɵproperty("formGroup",n.applicationConfigFormGroup),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,23,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("objectName").hasError("required")&&n.applicationConfigFormGroup.get("objectName").touched?8:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,25,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("host").hasError("required")&&n.applicationConfigFormGroup.get("host").touched?15:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,27,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((n.applicationConfigFormGroup.get("port").hasError("required")||n.applicationConfigFormGroup.get("port").hasError("min")||n.applicationConfigFormGroup.get("port").hasError("max"))&&n.applicationConfigFormGroup.get("port").touched?22:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,29,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(31,31,"gateway.hints.bacnet.object-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(35,33,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("objectIdentifier").hasError("required")&&n.applicationConfigFormGroup.get("objectIdentifier").touched?36:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(39,35,"gateway.hints.bacnet.vendor-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(43,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("vendorIdentifier").hasError("required")&&n.applicationConfigFormGroup.get("vendorIdentifier").touched?44:-1),t.ɵɵadvance(9),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(54,39,"gateway.hints.bacnet.apdu-length")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(58,41,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(61,43,"gateway.hints.bacnet.segmentation")),t.ɵɵadvance(5),t.ɵɵrepeater(n.segmentationTypes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(69,45,"gateway.hints.bacnet.network-number")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(73,47,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(76,49,"gateway.hints.bacnet.device-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(80,51,"gateway.set")))},dependencies:t.ɵɵgetComponentDepsFactory(NJ,[j,_,r$]),encapsulation:2,changeDetection:d.OnPush})}}function LJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function VJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",15)(6,"mat-form-field",6),t.ɵɵelement(7,"input",16),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,LJ,3,3,"mat-icon",11),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",e.keyType===e.BacnetDeviceKeysType.TIMESERIES?t.ɵɵpipeBind1(1,4,"gateway.hints.socket.key-telemetry"):t.ɵɵpipeBind1(2,6,"gateway.hints.socket.key-attribute")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,8,"gateway.key")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.formGroup.get("key").hasError("required")&&e.formGroup.get("key").touched?9:-1)}}function qJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function GJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",15)(5,"mat-form-field",6),t.ɵɵelement(6,"input",17),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,qJ,3,3,"mat-icon",11),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(1,4,"gateway.hints.method")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,6,"gateway.method")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.formGroup.get("method").hasError("required")&&e.formGroup.get("method").touched?8:-1)}}function zJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetRequestTypeTranslationsMap.get(e))," ")}}function UJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",18)(2,"div",14),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"tb-toggle-select",19),t.ɵɵrepeaterCreate(7,zJ,3,4,"tb-toggle-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.hints.bacnet.request-type")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,4,"gateway.bacnet.request-type.label")),t.ɵɵadvance(3),t.ɵɵrepeater(e.requestTypes)}}function jJ(e,n){1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",4),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.request-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",6),t.ɵɵelement(5,"input",20),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.bacnet.request-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,4,"gateway.set")))}function HJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetKeyObjectTypeTranslationsMap.get(e))," ")}}function WJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.object-id-required"))}function $J(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetPropertyIdTranslationsMap.get(e))," ")}}function KJ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",13),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}class YJ extends Ra{constructor(){super(...arguments),this.withReportStrategy=!0,this.propertyIds=Ia.get(Ca.analogOutput),this.objectTypes=Object.values(Ca),this.requestTypes=Object.values(Ma),this.ReportStrategyDefaultValue=en,this.BacnetDeviceKeysType=va,this.BacnetKeyObjectTypeTranslationsMap=_a,this.BacnetPropertyIdTranslationsMap=Ea,this.BacnetRequestTypeTranslationsMap=ka}ngOnInit(){this.formGroup=this.initKeyFormGroup(),this.observeValueChanges(),this.observeObjectType()}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keyType===va.ATTRIBUTES||this.keyType===va.TIMESERIES))}initKeyFormGroup(){return this.fb.group({key:[{value:"",disabled:this.keyType===va.RPC_METHODS},[$.required,$.pattern(an)]],method:[{value:"",disabled:this.keyType!==va.RPC_METHODS},[$.required,$.pattern(an)]],objectType:[Ca.analogOutput],objectId:[0,[$.required]],propertyId:[Ta.presentValue],requestTimeout:[{value:0,disabled:this.keyType!==va.RPC_METHODS}],requestType:[{value:Ma.Write,disabled:this.keyType!==va.RPC_METHODS}],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]})}observeObjectType(){this.formGroup.get("objectType").valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>{this.propertyIds=Ia.get(e),this.propertyIds.includes(this.formGroup.get("propertyId").value)||this.formGroup.get("propertyId").patchValue(this.propertyIds[0],{emitEvent:!1})}))}initFormGroup(){return this.fb.group({})}mapOnChangeValue({reportStrategy:e,...t}){return e?{...t,reportStrategy:e}:t}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(YJ)))(n||YJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:YJ,selectors:[["tb-bacnet-device-data-key"]],inputs:{keyType:"keyType",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>YJ)),multi:!0},{provide:K,useExisting:c((()=>YJ)),multi:!0}]),t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:35,vars:15,consts:[[1,"tb-form-panel","no-border","no-padding",3,"formGroup"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap","raw-value-option"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","objectType"],[3,"value"],[1,"tb-form-table-row-cell","tb-flex","no-gap"],["matInput","","type","number","min","0","name","value","formControlName","objectId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["formControlName","propertyId"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matInput","","name","value","formControlName","method",3,"placeholder"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["formControlName","requestType","appearance","fill"],["matInput","","type","number","min","0","name","value","formControlName","requestTimeout",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3),t.ɵɵtemplate(5,VJ,10,12)(6,GJ,9,10),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",1)(8,"div",2),t.ɵɵtext(9,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵtemplate(10,UJ,9,6,"div",3)(11,jJ,7,6,"div",3),t.ɵɵelementStart(12,"div",3)(13,"div",4),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15,"gateway.object-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",5)(17,"mat-form-field",6)(18,"mat-select",7),t.ɵɵrepeaterCreate(19,HJ,3,4,"mat-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",9)(22,"mat-form-field",6),t.ɵɵelement(23,"input",10),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,WJ,3,3,"mat-icon",11),t.ɵɵelementEnd()()(),t.ɵɵelementStart(26,"div",3)(27,"div",4),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"gateway.property-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",6)(31,"mat-select",12),t.ɵɵrepeaterCreate(32,$J,3,4,"mat-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()(),t.ɵɵtemplate(34,KJ,1,2,"tb-report-strategy",13),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.formGroup),t.ɵɵadvance(5),t.ɵɵconditional(n.keyType!==n.BacnetDeviceKeysType.RPC_METHODS?5:6),t.ɵɵadvance(5),t.ɵɵconditional(n.keyType===n.BacnetDeviceKeysType.RPC_METHODS?10:-1),t.ɵɵadvance(),t.ɵɵconditional(n.keyType===n.BacnetDeviceKeysType.RPC_METHODS?11:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,9,"gateway.hints.bacnet.key-object-id")),t.ɵɵadvance(6),t.ɵɵrepeater(n.objectTypes),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.formGroup.get("objectId").hasError("required")&&n.formGroup.get("objectId").touched?25:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(28,13,"gateway.hints.bacnet.property-id")),t.ɵɵadvance(5),t.ɵɵrepeater(n.propertyIds),t.ɵɵadvance(2),t.ɵɵconditional(n.isReportStrategyDisabled()?-1:34))},dependencies:t.ɵɵgetComponentDepsFactory(YJ,[j,_,Xn]),encapsulation:2,changeDetection:d.OnPush})}}function XJ(e,n){if(1&e&&t.ɵɵelement(0,"tb-bacnet-device-data-key",17),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("formControl",e)("keyType",n.keysType)("withReportStrategy",n.withReportStrategy)}}function ZJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵelementContainerStart(2,11),t.ɵɵelementStart(3,"mat-expansion-panel",12)(4,"mat-expansion-panel-header",13)(5,"mat-panel-title")(6,"div",14),t.ɵɵtext(7),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,XJ,1,3,"ng-template",15),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",16),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e;const i=n.$implicit,a=n.$index,r=n.$count,o=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i),t.ɵɵadvance(),t.ɵɵproperty("expanded",a===r-1),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",null!==(e=null==i.value?null:i.value.key)&&void 0!==e?e:null==i.value?null:i.value.method," "),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(10,4,o.deleteKeyTitle))}}function QJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3),t.ɵɵrepeaterCreate(1,ZJ,13,6,"div",9,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵrepeater(e.keysListFormArray.controls)}}function JJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"span",18),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class e1 extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.withReportStrategy=!0,this.keysDataApplied=p(),this.ReportStrategyDefaultValue=en}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}addKey(){this.keysListFormArray.push(this.fb.control({}))}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){this.keysDataApplied.emit(this.keysListFormArray.value)}prepareKeysFormArray(e){const t=[];return e?.forEach((e=>{t.push(this.fb.control(e))})),this.fb.array(t)}static{this.ɵfac=function(e){return new(e||e1)(t.ɵɵdirectiveInject(H.UntypedFormBuilder),t.ɵɵdirectiveInject(it.TbPopoverComponent),t.ɵɵdirectiveInject(Ye.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:e1,selectors:[["tb-bacnet-device-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:18,vars:15,consts:[[1,"tb-device-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","key-panel"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[3,"formControl","keyType","withReportStrategy"],["translate","",1,"tb-prompt"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,QJ,3,0,"div",3)(6,JJ,3,1,"div",4),t.ɵɵelementStart(7,"div")(8,"button",5),t.ɵɵlistener("click",(function(){return n.addKey()})),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",6)(12,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"button",8),t.ɵɵlistener("click",(function(){return n.applyKeysData()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,7,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵconditional(n.keysListFormArray.controls.length?5:6),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(10,9,n.addKeyTitle)," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,11,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,13,"action.apply")," "))},dependencies:t.ɵɵgetComponentDepsFactory(e1,[j,_,YJ]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-small-label[_ngcontent-%COMP%]{font-size:16px;padding-right:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}function t1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function n1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.deviceFormGroup.get("port")))}}function i1(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",12)(1,"mat-expansion-panel",34)(2,"mat-expansion-panel-header")(3,"mat-panel-title")(4,"div",35),t.ɵɵtext(5,"gateway.advanced-configuration-settings"),t.ɵɵelementEnd()()(),t.ɵɵelement(6,"tb-string-items-list",36),t.ɵɵpipe(7,"translate"),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()),2&e){let e;const n=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(7,2,"gateway.bacnet.alt-responses-address")),t.ɵɵpropertyInterpolate("placeholder",null!=(e=n.deviceFormGroup.get("altResponsesAddresses").value)&&e.length?"":t.ɵɵpipeBind1(8,4,"gateway.address"))}}function a1(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",19),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function r1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.poll-period-required"))}function o1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function s1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function l1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function p1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.method," ")}}class c1 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.cdr=l,this.destroyRef=p,this.deviceFormGroup=this.fb.group({host:["",[$.required,$.pattern(an)]],port:["",[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],deviceInfo:[],altResponsesAddresses:[{value:[],disabled:this.data.hideNewFields}],pollPeriod:[1e4,[$.required,$.min(0)]],timeseries:[[]],attributes:[[]],attributeUpdates:[[]],serverSideRpc:[[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.keysPopupClosed=!0,this.BacnetDeviceKeysType=va,this.DeviceInfoType=ga,this.portLimits=Ii,this.deviceHelpLink=O+"/docs/iot-gateway/config/bacnet/#device-object-settings",this.sourceTypes=Object.values(di),this.ConnectorType=ct,this.ReportStrategyDefaultValue=en,this.deviceFormGroup.patchValue(this.data.value,{emitEvent:!1})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.deviceFormGroup.valid){const{altResponsesAddresses:e,reportStrategy:t,...n}=this.deviceFormGroup.value;this.dialogRef.close({altResponsesAddresses:e??[],...t?{reportStrategy:t}:{},...n})}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))return void this.popoverService.hidePopover(i);const a=this.deviceFormGroup.get(n),r={keys:a.value,keysType:n,panelTitle:xa.get(n),addKeyTitle:ba.get(n),deleteKeyTitle:wa.get(n),noKeysText:Sa.get(n),withReportStrategy:this.data.withReportStrategy};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,e1,"leftBottom",!1,null,r,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.subscribe((e=>{this.popoverComponent.hide(),a.patchValue(e),a.markAsDirty(),this.cdr.markForCheck()})),this.popoverComponent.tbHideStart.pipe(bn(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}static{this.ɵfac=function(e){return new(e||c1)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:c1,selectors:[["tb-bacnet-device-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:100,vars:47,consts:[["attributesButton",""],["socketTelemetryButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"dialog-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["formControlName","deviceInfo","required","true",3,"deviceInfoType","sourceTypes","connectorType"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","0","name","value","formControlName","pollPeriod",3,"placeholder"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-settings","chips-panel","w-full"],["translate","",1,"tb-form-panel-title"],["editable","","floatLabel","always","formControlName","altResponsesAddresses",1,"chips-list",3,"label","placeholder"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",4)(1,"mat-toolbar",5)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",6)(6,"div",7),t.ɵɵelementStart(7,"button",8),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",9),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",10)(11,"div",11)(12,"div",12)(13,"div",13),t.ɵɵtext(14,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",14),t.ɵɵelement(16,"input",15),t.ɵɵpipe(17,"translate"),t.ɵɵtemplate(18,t1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",12)(20,"div",13),t.ɵɵtext(21,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",14),t.ɵɵelement(23,"input",17),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,n1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵtemplate(26,i1,9,6,"div",12),t.ɵɵelement(27,"tb-device-info-table",18),t.ɵɵtemplate(28,a1,1,2,"tb-report-strategy",19),t.ɵɵelementStart(29,"div",12)(30,"div",20)(31,"span",21),t.ɵɵtext(32,"gateway.poll-period"),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"mat-form-field",14),t.ɵɵelement(34,"input",22),t.ɵɵpipe(35,"translate"),t.ɵɵtemplate(36,r1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(37,"div",23)(38,"div",24),t.ɵɵtext(39,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(40,"div",25)(41,"mat-chip-listbox",26),t.ɵɵrepeaterCreate(42,o1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(44,"mat-chip",27),t.ɵɵelement(45,"label",28),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"button",29,0),t.ɵɵpipe(48,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(47);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.ATTRIBUTES))})),t.ɵɵelementStart(49,"tb-icon",30),t.ɵɵtext(50,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(51,"div",23)(52,"div",24),t.ɵɵtext(53,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(54,"div",25)(55,"mat-chip-listbox",26),t.ɵɵrepeaterCreate(56,s1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(58,"mat-chip",27),t.ɵɵelement(59,"label",28),t.ɵɵelementEnd()(),t.ɵɵelementStart(60,"button",29,1),t.ɵɵpipe(62,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(61);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.TIMESERIES))})),t.ɵɵelementStart(63,"tb-icon",30),t.ɵɵtext(64,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(65,"div",23)(66,"div",24),t.ɵɵtext(67,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(68,"div",25)(69,"mat-chip-listbox",26),t.ɵɵrepeaterCreate(70,l1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(72,"mat-chip",27),t.ɵɵelement(73,"label",28),t.ɵɵelementEnd()(),t.ɵɵelementStart(74,"button",29,2),t.ɵɵpipe(76,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(75);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(77,"tb-icon",30),t.ɵɵtext(78,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(79,"div",23)(80,"div",24),t.ɵɵtext(81,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(82,"div",25)(83,"mat-chip-listbox",26),t.ɵɵrepeaterCreate(84,p1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(86,"mat-chip",27),t.ɵɵelement(87,"label",28),t.ɵɵelementEnd()(),t.ɵɵelementStart(88,"button",29,3),t.ɵɵpipe(90,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(89);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.RPC_METHODS))})),t.ɵɵelementStart(91,"tb-icon",30),t.ɵɵtext(92,"edit"),t.ɵɵelementEnd()()()()()(),t.ɵɵelementStart(93,"div",31)(94,"button",32),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(95),t.ɵɵpipe(96,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(97,"button",33),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(98),t.ɵɵpipe(99,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵproperty("formGroup",n.deviceFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,27,"gateway.device")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.deviceHelpLink),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(17,29,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.deviceFormGroup.get("host").hasError("required")&&n.deviceFormGroup.get("host").touched?18:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,31,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((n.deviceFormGroup.get("port").hasError("required")||n.deviceFormGroup.get("port").hasError("min")||n.deviceFormGroup.get("port").hasError("max"))&&n.deviceFormGroup.get("port").touched?25:-1),t.ɵɵadvance(),t.ɵɵconditional(n.data.hideNewFields?-1:26),t.ɵɵadvance(),t.ɵɵproperty("deviceInfoType",n.DeviceInfoType.FULL)("sourceTypes",n.sourceTypes)("connectorType",n.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?28:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(35,33,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.deviceFormGroup.get("pollPeriod").hasError("required")&&n.deviceFormGroup.get("pollPeriod").touched?36:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(48,35,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("timeseries").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("timeseries").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(62,37,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(76,39,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(90,41,"action.edit")),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(96,43,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.deviceFormGroup.invalid||!n.deviceFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(99,45,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(c1,[j,_,Gn,qn,r$,I$,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%]{width:77vw;max-width:800px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .chips-panel[_ngcontent-%COMP%]{padding:6px 6px 6px 0}[_nghost-%COMP%] .dialog-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .tb-form-row .chips-list .mat-mdc-form-field{width:100%}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}[_nghost-%COMP%] .device-config{gap:12px;padding-left:10px;padding-right:10px}[_nghost-%COMP%] .device-node-pattern-field{flex-basis:3%}'],changeDetection:d.OnPush})}}const d1=()=>["deviceName","host","port","actions"],u1=()=>({minWidth:"96px",textAlign:"center"});function m1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",26)(2,"span",27),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageDevices(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.devices")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function h1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function g1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(null==e.deviceInfo?null:e.deviceInfo.deviceNameExpression)}}function f1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.host")," "))}function y1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.host)}}function v1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.port")," "))}function x1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.port)}}function b1(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",30)}function w1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageDevices(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteDevice(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function S1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,w1,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",31),t.ɵɵelementContainer(4,32),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"button",34),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",35),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",36,2),t.ɵɵelementContainer(11,32),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,u1)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function C1(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",37)}function _1(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class T1 extends qa{constructor(){super(...arguments),this.hideNewFields=!1}getDatasource(){return new I1}manageDevices(e,t){e&&e.stopPropagation();const n=ke(t),i=n?this.entityFormArray.at(t).value:{};this.getDeviceDialog(i,n?"action.apply":"action.add").afterClosed().pipe(ye(1),bn(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteDevice(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-device-title",{name:this.entityFormArray.controls[t].value.deviceInfo?.deviceNameExpression}),this.translate.instant("gateway.delete-device-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(ye(1),bn(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}getDeviceDialog(e,t){return this.dialog.open(c1,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy,hideNewFields:this.hideNewFields}})}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())||e.deviceNameExpression?.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(T1)))(n||T1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:T1,selectors:[["tb-bacnet-devices-config-table"]],inputs:{hideNewFields:[2,"hideNewFields","hideNewFields",m]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>T1)),multi:!0},{provide:K,useExisting:c((()=>T1)),multi:!0}]),t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:48,vars:37,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-device-table","tb-absolute-fill"],[1,"tb-device-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-device-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,m1,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵelementContainerStart(23,14),t.ɵɵtemplate(24,h1,4,3,"mat-header-cell",15)(25,g1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(26,14),t.ɵɵtemplate(27,f1,3,3,"mat-header-cell",15)(28,y1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(29,14),t.ɵɵtemplate(30,v1,3,3,"mat-header-cell",15)(31,x1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(32,17),t.ɵɵtemplate(33,b1,1,0,"mat-header-cell",18)(34,S1,12,6,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(35,C1,1,0,"mat-header-row",20)(36,_1,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"section",22),t.ɵɵpipe(38,"async"),t.ɵɵelementStart(39,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageDevices(i))})),t.ɵɵelementStart(40,"mat-icon",24),t.ɵɵtext(41,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"span"),t.ɵɵtext(43),t.ɵɵpipe(44,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(45,"span",25),t.ɵɵpipe(46,"async"),t.ɵɵtext(47," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,21,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,23,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,25,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,27,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","host"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","port"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(35,d1))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(36,d1)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(38,29,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(44,31,"gateway.add-device")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(46,33,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(T1,[j,_,qn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:21%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}class I1 extends G{constructor(){super()}}class E1 extends Ba{initBasicFormGroup(){return this.fb.group({application:[],devices:[]})}mapConfigToFormValue(e){return{application:e.application??{},devices:e.devices??[]}}getMappedValue(e){return{application:e.application,devices:e.devices??[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(E1)))(n||E1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:E1,selectors:[["tb-bacnet-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>E1)),multi:!0},{provide:K,useExisting:c((()=>E1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:15,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","application"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","devices",3,"hideNewFields","withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-bacnet-application-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-bacnet-devices-config-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.application"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.devices"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("hideNewFields",n.isLegacy)("withReportStrategy",n.withReportStrategy))},dependencies:t.ɵɵgetComponentDepsFactory(E1,[j,_,NJ,T1]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}class M1 extends Ba{constructor(){super(...arguments),this.isLegacy=!0}initBasicFormGroup(){return this.fb.group({application:[],devices:[]})}mapConfigToFormValue(e){return{application:e.general?Wa.mapApplicationToUpgradedVersion(e.general):{},devices:e.devices?.length?Wa.mapDevicesToUpgradedVersion(e.devices):[]}}getMappedValue(e){return{general:e.application?Wa.mapApplicationToDowngradedVersion(e.application):{},devices:e.devices?.length?Wa.mapDevicesToDowngradedVersion(e.devices):[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(M1)))(n||M1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:M1,selectors:[["tb-bacnet-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>M1)),multi:!0},{provide:K,useExisting:c((()=>M1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:15,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","application"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","devices",3,"hideNewFields","withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-bacnet-application-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-bacnet-devices-config-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.application"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.devices"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("hideNewFields",n.isLegacy)("withReportStrategy",n.withReportStrategy))},dependencies:t.ɵɵgetComponentDepsFactory(M1,[j,_,NJ,T1]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}function k1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",5),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function P1(e,n){if(1&e&&(t.ɵɵelement(0,"tb-error-icon",8),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵpipe(2,"translate")),2&e){t.ɵɵnextContext();const e=t.ɵɵreadContextLet(16);t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(2,3,t.ɵɵpipeBind1(1,1,e)))}}class D1 extends Ra{constructor(){super(...arguments),this.portLimits=Ii}get serverConfigFormGroup(){return this.formGroup}initFormGroup(){return this.fb.group({host:["",[$.required,$.pattern(an)]],port:[null,[$.required,$.min(Ii.MIN),$.max(Ii.MAX)]],SSL:[!1],security:this.fb.group({cert:[""],key:[""]})})}mapOnChangeValue(e){return Te(e),e}onWriteValue(e){this.formGroup.reset(e,{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(D1)))(n||D1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:D1,selectors:[["tb-rest-server-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>D1)),multi:!0},{provide:K,useExisting:c((()=>D1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:46,vars:43,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"tb-form-row","column-xs"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matSuffix","",3,"tooltipText"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["formControlName","SSL",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],[3,"formGroup"],["tbTruncateWithTooltip","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","cert",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",3),t.ɵɵelement(6,"input",4),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,k1,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",6)(10,"div",2),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",3),t.ɵɵelement(14,"input",7),t.ɵɵpipe(15,"translate"),t.ɵɵdeclareLet(16),t.ɵɵtemplate(17,P1,3,5,"tb-error-icon",8),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",9)(19,"div",10),t.ɵɵtext(20,"gateway.security"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",11)(22,"mat-slide-toggle",12)(23,"mat-label",13),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(27,14),t.ɵɵelementStart(28,"div",11)(29,"div",15),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31),t.ɵɵpipe(32,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"div",16)(34,"mat-form-field",3),t.ɵɵelement(35,"input",17),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(37,"div",11)(38,"div",15),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",16)(43,"mat-form-field",3),t.ɵɵelement(44,"input",18),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e){t.ɵɵproperty("formGroup",n.serverConfigFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,18,"gateway.hints.rest.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.serverConfigFormGroup.get("host").hasError("required")&&n.serverConfigFormGroup.get("host").touched?8:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,22,"gateway.hints.rest.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,24,"gateway.set")),t.ɵɵadvance(2);const e=t.ɵɵstoreLet(n.serverConfigFormGroup.get("port"));t.ɵɵadvance(),t.ɵɵconditional((e.hasError("required")||e.hasError("min")||e.hasError("max"))&&e.touched?17:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,27,"gateway.hints.rest.ssl-verify")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(26,29,"gateway.rest.ssl-verify")," "),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",n.serverConfigFormGroup.get("security")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(30,31,"gateway.hints.rest.cert")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(32,33,"gateway.certificate")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,35,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(39,37,"gateway.hints.rest.key")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,39,"gateway.key")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(45,41,"gateway.set"))}},dependencies:t.ɵɵgetComponentDepsFactory(D1,[j,_,r$,qn,Qn]),encapsulation:2,changeDetection:d.OnPush})}}const O1=()=>({min:1});function A1(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",4),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ResponseTypeTranslationsMap.get(e)))}}function F1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",4),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function R1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",4),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function B1(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,7),t.ɵɵelementStart(1,"div",8)(2,"div",9),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",10)(6,"mat-form-field",11)(7,"mat-select",12),t.ɵɵrepeaterCreate(8,F1,2,2,"mat-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",10)(15,"mat-form-field",11)(16,"mat-select",13),t.ɵɵrepeaterCreate(17,R1,2,2,"mat-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.responseConfigFormGroup.get(e.ResponseType.CONST)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rest.on-success")),t.ɵɵadvance(5),t.ɵɵrepeater(e.responseStatuses),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,5,"gateway.rest.on-error")),t.ɵɵadvance(5),t.ɵɵrepeater(e.responseStatuses)}}function N1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.response-timeout-required"))}function L1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,O1)))}function V1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function q1(e,n){1&e&&(t.ɵɵelementStart(0,"span",18),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function G1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.response-attribute-required"))}function z1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.response-attribute-pattern"))}function U1(e,n){if(1&e&&(t.ɵɵdeclareLet(0),t.ɵɵelementContainerStart(1,7),t.ɵɵelementStart(2,"div",8)(3,"mat-slide-toggle",14)(4,"mat-label"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(7,"div",8)(8,"div",15),t.ɵɵtext(9,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-form-field",11),t.ɵɵelement(11,"input",16),t.ɵɵpipe(12,"translate"),t.ɵɵdeclareLet(13),t.ɵɵtemplate(14,N1,2,3,"tb-error-icon",17)(15,L1,2,5,"tb-error-icon",17)(16,V1,2,3,"tb-error-icon",17)(17,q1,2,0,"span",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",8)(19,"div",15),t.ɵɵtext(20,"gateway.rest.response-attribute"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",11),t.ɵɵelement(22,"input",19),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,G1,2,3,"tb-error-icon",17)(25,z1,2,3,"tb-error-icon",17),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(),n=e.responseConfigFormGroup.get(e.ResponseType.ADVANCED);t.ɵɵadvance(),t.ɵɵproperty("formGroup",n),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,6,"gateway.rest.response-expected")," "),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,8,"gateway.set"));const i=n.get("timeout").touched;t.ɵɵadvance(3),t.ɵɵconditional(n.get("timeout").hasError("required")&&i?14:n.get("timeout").hasError("min")&&i?15:n.get("timeout").hasError("pattern")&&i?16:17),t.ɵɵadvance(8),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.get("responseAttribute").hasError("required")&&n.get("responseAttribute").touched?24:n.get("responseAttribute").hasError("pattern")&&n.get("responseAttribute").touched?25:-1)}}class j1 extends Ra{get responseConfigFormGroup(){return this.formGroup}constructor(){super(),this.ResponseTypeTranslationsMap=xi,this.ResponseType=yi,this.responseTypes=Object.values(yi),this.responseStatuses=Object.values(vi),this.observeIsExpected()}initFormGroup(){return this.fb.group({type:[yi.DEFAULT],[yi.CONST]:this.fb.group({successResponse:[vi.OK],unsuccessfulResponse:[vi.ERROR]}),[yi.ADVANCED]:this.fb.group({responseExpected:[!0],timeout:[null,[$.required,$.min(.001),$.pattern(nn)]],responseAttribute:["",[$.required,$.pattern(an)]]})})}mapOnChangeValue({type:e,...t}){return{type:e,...t[e]??{}}}onWriteValue(e){const{type:t=yi.DEFAULT,...n}=e??{};this.toggleIsExpected(n.responseExpected,t),this.responseConfigFormGroup.patchValue({type:t,[t]:n},{emitEvent:!1})}toggleIsExpected(e,t){const n=e&&t===yi.ADVANCED;this.responseConfigFormGroup.get(yi.ADVANCED).get("timeout")[n?"enable":"disable"]({emitEvent:!1}),this.responseConfigFormGroup.get(yi.ADVANCED).get("responseAttribute")[n?"enable":"disable"]({emitEvent:!1})}observeIsExpected(){se(this.responseConfigFormGroup.get("type").valueChanges,this.responseConfigFormGroup.get(yi.ADVANCED).get("responseExpected").valueChanges).pipe(bn()).subscribe((()=>this.toggleIsExpected(this.responseConfigFormGroup.get(yi.ADVANCED).get("responseExpected").value,this.responseConfigFormGroup.get("type").value)))}static{this.ɵfac=function(e){return new(e||j1)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:j1,selectors:[["tb-rest-response-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>j1)),multi:!0},{provide:K,useExisting:c((()=>j1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:7,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column","size-full",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],[1,"fixed-title-width","tb-required"],["formControlName","type","appearance","fill"],[3,"value"],[3,"ngSwitch"],[3,"ngSwitchCase"],[3,"formGroup"],[1,"tb-form-row"],[1,"fixed-title-width"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","successResponse"],["formControlName","unsuccessfulResponse"],["formControlName","responseExpected",1,"mat-slide"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],["matInput","","type","text","name","value","formControlName","responseAttribute",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",3),t.ɵɵrepeaterCreate(6,A1,3,4,"tb-toggle-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()(),t.ɵɵelementContainerStart(8,5),t.ɵɵtemplate(9,B1,19,7,"ng-template",6)(10,U1,26,12,"ng-template",6),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.responseConfigFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,5,"gateway.response")),t.ɵɵadvance(3),t.ɵɵrepeater(n.responseTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.responseConfigFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.ResponseType.CONST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.ResponseType.ADVANCED))},dependencies:t.ɵɵgetComponentDepsFactory(j1,[j,_,Qn]),encapsulation:2,changeDetection:d.OnPush})}}function H1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-required"))}function W1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",17),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function $1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.http-methods-required"))}function K1(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",17),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.RestConvertorTypeTranslationsMap.get(e)))}}function Y1(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",27),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function X1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function Z1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function Q1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",28)(1,"div",20)(2,"div",21),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"mat-chip-listbox",34),t.ɵɵrepeaterCreate(7,X1,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(9,"mat-chip",35),t.ɵɵelement(10,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"button",37,0),t.ɵɵpipe(13,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(12),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(14,"tb-icon",38),t.ɵɵtext(15,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(16,"div",20)(17,"div",39),t.ɵɵtext(18,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",33)(20,"mat-chip-listbox",34),t.ɵɵrepeaterCreate(21,Z1,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(23,"mat-chip",35),t.ɵɵelement(24,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(25,"button",37,1),t.ɵɵpipe(27,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(26),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(28,"tb-icon",38),t.ɵɵtext(29,"edit"),t.ɵɵelementEnd()()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,5,"gateway.attributes")),t.ɵɵadvance(3),t.ɵɵproperty("tbEllipsisChipList",e.converterAttributes),t.ɵɵadvance(),t.ɵɵrepeater(e.converterAttributes),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(13,7,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.converterTelemetry),t.ɵɵadvance(),t.ɵɵrepeater(e.converterTelemetry),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(27,9,"action.edit"))}}function J1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.extension-required"))}function e0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function t0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",28)(1,"div",11)(2,"div",12),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",41),t.ɵɵelement(7,"input",42),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,J1,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",43)(11,"div",24),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",25),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"div",20)(18,"div",21),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",44)(22,"mat-chip-listbox",34),t.ɵɵtemplate(23,e0,3,1,"mat-chip",45),t.ɵɵelementStart(24,"mat-chip",35),t.ɵɵelement(25,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"button",37,2),t.ɵɵpipe(28,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(27),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.CUSTOM))})),t.ɵɵelementStart(29,"tb-icon",38),t.ɵɵtext(30,"edit"),t.ɵɵelementEnd()()()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.rest.extension")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,12,"gateway.extension")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,14,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("converter.extension").hasError("required")&&e.mappingFormGroup.get("converter.extension").touched?9:-1),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,16,"gateway.extension-configuration")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,18,"gateway.extension-configuration-hint")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,20,"gateway.keys")),t.ɵɵadvance(3),t.ɵɵproperty("tbEllipsisChipList",e.customKeys),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.customKeys),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,22,"action.edit"))}}class n0 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.destroyRef=l,this.cd=p,this.mappingFormGroup=this.fb.group({endpoint:["",[$.required,$.pattern(an)]],HTTPMethods:[[ht.POST],[$.required]],security:[{type:ki.ANONYMOUS}],converter:this.fb.group({type:[gi.JSON,[]],deviceInfo:[],reportStrategy:[],attributes:[[]],timeseries:[[]],extension:["",[$.required,$.pattern(an)]],extensionConfig:[]}),response:[]}),this.keysPopupClosed=!0,this.helpLink=`${O}/docs/iot-gateway/config/rest/#mapping-section`,this.httpMethods=Object.values(ht),this.converterTypes=Object.values(gi),this.restSourceTypes=Object.values(fi),this.SecurityMode=$i,this.MappingKeysType=Ni,this.DeviceInfoType=ga,this.RestConvertorTypeTranslationsMap=_i,this.RestDataConversionTranslationsMap=Ti,this.RestConverterType=gi,this.ConnectorType=ct,this.ReportStrategyDefaultValue=en,this.setInitialFormValue(),this.observeConverterTypeChange(),this.toggleConverterFieldsByType(this.converterType)}get converterType(){return this.mappingFormGroup.get("converter")?.get("type").value}get converterAttributes(){if(this.converterType)return this.mappingFormGroup.get("converter").value.attributes.map((e=>e.key))}get converterTelemetry(){if(this.converterType)return this.mappingFormGroup.get("converter").value.timeseries.map((e=>e.key))}get customKeys(){return Object.keys(this.mappingFormGroup.get("converter").value.extensionConfig??{})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.mappingFormGroup.valid){const{converter:e,...t}=this.mappingFormGroup.value,{reportStrategy:n,...i}=e,a={...t,reportStrategy:n,converter:i};Te(a),this.dialogRef.close(a)}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))this.popoverService.hidePopover(i);else{const e=this.mappingFormGroup.get("converter").get(n),t={keys:e.value,keysType:n,panelTitle:Li.get(n),addKeyTitle:Vi.get(n),deleteKeyTitle:qi.get(n),noKeysText:Gi.get(n),withReportStrategy:this.data.withReportStrategy,convertorType:this.converterType,connectorType:ct.REST};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,yK,"leftBottom",!1,null,t,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(bn(this.destroyRef)).subscribe((t=>{this.popoverComponent.hide(),e.patchValue(t),e.markAsDirty(),this.cd.markForCheck()})),this.popoverComponent.tbHideStart.pipe(bn(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}}setInitialFormValue(){const{converter:e,reportStrategy:t,...n}=this.data.value;this.mappingFormGroup.patchValue({...n,converter:{...e,...t?{reportStrategy:t}:{}}},{emitEvent:!1})}observeConverterTypeChange(){this.mappingFormGroup.get("converter").get("type").valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>this.toggleConverterFieldsByType(e)))}toggleConverterFieldsByType(e){const t=e===gi.JSON;this.mappingFormGroup.get("converter").get("attributes")[t?"enable":"disable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("timeseries")[t?"enable":"disable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("extension")[t?"disable":"enable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("extensionConfig")[t?"disable":"enable"]({emitEvent:!1})}static{this.ɵfac=function(e){return new(e||n0)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:n0,selectors:[["tb-rest-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:59,vars:45,consts:[["attributesButton",""],["telemetryButton",""],["keysButton",""],[1,"h-full","w-[77vw]","max-w-3xl",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","endpoint",3,"placeholder"],["matSuffix","",3,"tooltipText"],["formControlName","HTTPMethods","multiple",""],[3,"value"],["formControlName","security",3,"mode"],["formGroupName","converter"],[1,"tb-form-row","space-between","tb-flex"],[1,"fixed-title-width"],["formControlName","type","appearance","fill"],[1,"tb-form-panel","stroked"],[1,"tb-form-panel-title"],[1,"tb-form-hint","tb-primary-fill"],["formControlName","deviceInfo","required","true",1,"device-info",3,"sourceTypes","convertorType","deviceInfoType","connectorType"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"tb-form-panel","no-border","no-padding","w-full"],["formControlName","response"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-flex","max-w-70%"],[1,"tb-flex","gw-chip-list",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["translate","",1,"fixed-title-width"],["tbTruncateWithTooltip",""],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["matInput","","name","value","formControlName","extension",3,"placeholder"],[1,"tb-form-row","space-between","same-padding","tb-flex","column"],[1,"tb-flex","ellipsis-chips-container"],[4,"ngFor","ngForOf"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",3)(1,"mat-toolbar",4)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",5)(6,"div",6),t.ɵɵelementStart(7,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",8),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",9)(11,"div",10)(12,"div",11)(13,"div",12),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-form-field",13),t.ɵɵelement(18,"input",14),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,H1,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(21,"div",11)(22,"div",12),t.ɵɵpipe(23,"translate"),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",13)(27,"mat-select",16),t.ɵɵrepeaterCreate(28,W1,2,2,"mat-option",17,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd(),t.ɵɵtemplate(30,$1,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelement(31,"tb-security-config",18),t.ɵɵelementContainerStart(32,19),t.ɵɵelementStart(33,"div",20)(34,"div",21),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"tb-toggle-select",22),t.ɵɵrepeaterCreate(38,K1,3,4,"tb-toggle-option",17,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()(),t.ɵɵelementStart(40,"div",23)(41,"div",24),t.ɵɵtext(42),t.ɵɵpipe(43,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"div",25),t.ɵɵtext(45),t.ɵɵpipe(46,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(47,"tb-device-info-table",26),t.ɵɵtemplate(48,Y1,1,2,"tb-report-strategy",27)(49,Q1,30,11,"div",28)(50,t0,31,24,"div",28),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelement(51,"tb-rest-response-config",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(52,"div",30)(53,"button",31),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(54),t.ɵɵpipe(55,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(56,"button",32),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(57),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,23,"gateway.data-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLink),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,25,"gateway.hints.rest.endpoint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,27,"gateway.rest.endpoint")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,29,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.mappingFormGroup.get("endpoint").hasError("required")&&n.mappingFormGroup.get("endpoint").touched?20:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(23,31,"gateway.hints.rest.http-methods")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(25,33,"gateway.rest.http-methods")),t.ɵɵadvance(4),t.ɵɵrepeater(n.httpMethods),t.ɵɵadvance(2),t.ɵɵconditional(n.mappingFormGroup.get("HTTPMethods").hasError("required")&&n.mappingFormGroup.get("HTTPMethods").touched?30:-1),t.ɵɵadvance(),t.ɵɵproperty("mode",n.SecurityMode.basic),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,35,"gateway.payload-type")),t.ɵɵadvance(3),t.ɵɵrepeater(n.converterTypes),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(43,37,"gateway.data-conversion")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(46,39,n.RestDataConversionTranslationsMap.get(n.converterType))," "),t.ɵɵadvance(2),t.ɵɵproperty("sourceTypes",n.restSourceTypes)("convertorType",n.RestConverterType.JSON)("deviceInfoType",n.DeviceInfoType.FULL)("connectorType",n.ConnectorType.REST),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?48:-1),t.ɵɵadvance(),t.ɵɵconditional(n.converterType===n.RestConverterType.JSON?49:50),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(55,41,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingFormGroup.invalid||!n.mappingFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(58,43,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(n0,[j,_,Gn,I$,BY,j1,Qn,Xn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .device-info .fixed-title-width{min-width:0}'],changeDetection:d.OnPush})}}const i0=()=>["endpoint","httpMethods","securityType","actions"];function a0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"span",8),t.ɵɵelementStart(5,"button",10),t.ɵɵpipe(6,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(7,"mat-icon"),t.ɵɵtext(8,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",10),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.data-mapping")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(6,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,7,"action.search")))}function r0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rest.endpoint")))}function o0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",32)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.endpoint)}}function s0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",33),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rest.http-methods")," "))}function l0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",38),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function p0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",34)(1,"mat-chip-listbox",35),t.ɵɵrepeaterCreate(2,l0,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(4,"mat-chip",36),t.ɵɵelement(5,"label",37),t.ɵɵelementEnd()()()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵproperty("tbEllipsisChipList",e.HTTPMethods),t.ɵɵadvance(),t.ɵɵrepeater(e.HTTPMethods)}}function c0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.security-type")," "))}function d0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",39)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"titlecase"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,null==e.security?null:e.security.type))}}function u0(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",40)}function m0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",10),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function h0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,m0,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",41),t.ɵɵelementContainer(4,42),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",43)(6,"button",44),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",45),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",46,2),t.ɵɵelementContainer(11,42),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(4),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function g0(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",47)}function f0(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class y0 extends qa{getDatasource(){return new v0}manageMapping(e,t){e&&e.stopPropagation();const n=ke(t),i=n?this.entityFormArray.at(t).value:{};this.getMappingDialog(i,n?"action.apply":"action.add").afterClosed().pipe(bn(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteMapping(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:this.entityFormArray.at(t).value.endpoint}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(bn(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())||e.type?.toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}getMappingDialog(e,t){return this.dialog.open(n0,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy}})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(y0)))(n||y0)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:y0,selectors:[["tb-rest-mapping-table"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>y0)),multi:!0},{provide:K,useExisting:c((()=>y0)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:47,vars:37,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-absolute-fill","size-full"],[1,"flex","size-full","flex-col"],[1,"gw-table-toolbar","mat-mdc-table-toolbar"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"gw-connector-table"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","!w-1/5",4,"matHeaderCellDef"],["class","w-1/5",4,"matCellDef"],["class","w-1/3 !pl-0",4,"matHeaderCellDef"],["class","w-1/3",4,"matCellDef"],["class","w-1/6",4,"matHeaderCellDef"],["class","w-1/6",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"!w-1/5"],["tbTruncateWithTooltip",""],[1,"w-1/5"],[1,"w-1/3","!pl-0"],[1,"w-1/3"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text","http-method-label","font-medium"],["tbTruncateWithTooltip","",1,"http-method-label","font-medium"],[1,"w-1/6"],[1,"w-12"],[1,"lt-lg:!hidden","flex","min-w-24","flex-1","flex-row","items-stretch","justify-end","text-center"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,a0,13,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"button",7),t.ɵɵpipe(7,"translate"),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",8)(11,"mat-label"),t.ɵɵtext(12," "),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",9,0),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵpipe(17,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(18,"mat-icon"),t.ɵɵtext(19,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"table",12),t.ɵɵelementContainerStart(22,13),t.ɵɵtemplate(23,r0,4,3,"mat-header-cell",14)(24,o0,3,1,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,13),t.ɵɵtemplate(26,s0,3,3,"mat-header-cell",16)(27,p0,6,1,"mat-cell",17),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(28,13),t.ɵɵtemplate(29,c0,3,3,"mat-header-cell",18)(30,d0,4,3,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(31,20),t.ɵɵtemplate(32,u0,1,0,"mat-header-cell",21)(33,h0,12,3,"mat-cell",22),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(34,g0,1,0,"mat-header-row",23)(35,f0,1,0,"mat-row",24),t.ɵɵelementEnd(),t.ɵɵelementStart(36,"section",25),t.ɵɵpipe(37,"async"),t.ɵɵelementStart(38,"button",26),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(39,"mat-icon",27),t.ɵɵtext(40,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(41,"span"),t.ɵɵtext(42),t.ɵɵpipe(43,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(44,"span",28),t.ɵɵpipe(45,"async"),t.ɵɵtext(46," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵconditional(!1===t.ɵɵpipeBind1(4,21,n.dataSource.isEmpty())?3:-1),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,23,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,25,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,27,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","endpoint"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","httpMethods"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","securityType"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(35,i0))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(36,i0)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(37,29,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(43,31,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(45,33,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(y0,[j,_,qn,Gn]),styles:[".http-method-label[_ngcontent-%COMP%]{font-size:12px}"],changeDetection:d.OnPush})}}let v0=class extends G{constructor(){super()}};function x0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" : ",e.value.value," ")}}function b0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function w0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function S0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",16)(1,"div",17),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",18)(5,"mat-form-field",19),t.ɵɵelement(6,"input",20),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,b0,3,3,"mat-icon",21),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",16)(10,"div",22),t.ɵɵtext(11,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19),t.ɵɵelement(13,"input",23),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,w0,3,3,"mat-icon",21),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,5,"gateway.key")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.get("key").hasError("required")&&e.get("key").touched?8:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.get("value").hasError("required")&&e.get("value").touched?15:-1)}}function C0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵelementContainerStart(2,11),t.ɵɵelementStart(3,"mat-expansion-panel",12)(4,"mat-expansion-panel-header")(5,"mat-panel-title")(6,"div",13),t.ɵɵtext(7),t.ɵɵelementEnd(),t.ɵɵtemplate(8,x0,2,1,"div",13),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,S0,16,11,"ng-template",14),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",15),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.$index,a=n.$count;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i===a-1),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",null==e.value?null:e.value.key," "),t.ɵɵadvance(),t.ɵɵconditional(null!=e.value&&e.value.value?8:-1),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,"gateway.rest.delete-http-header"))}}function _0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3),t.ɵɵrepeaterCreate(1,C0,14,7,"div",9,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵrepeater(e.keysListFormArray.controls)}}function T0(e,n){1&e&&(t.ɵɵelementStart(0,"div",4)(1,"span",24),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rest.no-http-headers")))}class I0 extends q{constructor(e,t){super(t),this.fb=e,this.store=t,this.withReportStrategy=!0,this.keysDataApplied=p(),this.ReportStrategyDefaultValue=en}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}addKey(){this.keysListFormArray.push(this.fb.group({key:["",[$.required,$.pattern(an)]],value:["",[$.required,$.pattern(an)]]}))}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){this.keysDataApplied.emit(this.keysListFormArray.value.reduce(((e,{key:t,value:n})=>({...e,[t]:n})),{}))}prepareKeysFormArray(e){const t=[];return Object.keys(e)?.forEach((n=>{t.push(this.fb.group({key:[n,[$.required,$.pattern(an)]],value:[e[n],[$.required,$.pattern(an)]]}))})),this.fb.array(t)}static{this.ɵfac=function(e){return new(e||I0)(t.ɵɵdirectiveInject(H.UntypedFormBuilder),t.ɵɵdirectiveInject(Ye.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:I0,selectors:[["tb-rest-http-headers-panel"]],inputs:{keys:"keys",popover:"popover",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:18,vars:15,consts:[[1,"w-[77vw]","max-w-2xl"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","h-[500px]"],[1,"tb-flex","no-flex","center","align-center","h-[500px]"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],["tbTruncateWithTooltip","",1,"max-w-[11vw]"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",1,"gw-delete-icon-button",3,"click","matTooltip"],[1,"tb-form-row"],[1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","text","name","value","formControlName","value",3,"placeholder"],[1,"tb-prompt"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,_0,3,0,"div",3)(6,T0,4,3,"div",4),t.ɵɵelementStart(7,"div")(8,"button",5),t.ɵɵlistener("click",(function(){return n.addKey()})),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",6)(12,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"button",8),t.ɵɵlistener("click",(function(){return n.applyKeysData()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,7,"gateway.rest.http-headers"),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵconditional(n.keysListFormArray.controls.length?5:6),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(10,9,"gateway.rest.add-http-header")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,11,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,13,"action.apply")," "))},dependencies:t.ɵɵgetComponentDepsFactory(I0,[j,_]),encapsulation:2,changeDetection:d.OnPush})}}const E0=()=>({min:1}),M0=()=>({maxWidth:"970px"});function k0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.RestRequestTypesTranslationsMap.get(e)))}}function P0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-required"))}function D0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-pattern"))}function O0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function A0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.http-methods-required"))}function F0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,e))}}function R0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.rest.endpoint"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",21),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,P0,2,3,"tb-error-icon",22)(8,D0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",19),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.rest.http-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",20)(14,"mat-select",23),t.ɵɵrepeaterCreate(15,O0,2,2,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd(),t.ɵɵtemplate(17,A0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",9)(19,"div",24),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",20)(23,"mat-select",25),t.ɵɵrepeaterCreate(24,F0,3,4,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,6,"gateway.hints.rest.endpoint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("endpoint").hasError("required")&&e.mappingFormGroup.get("endpoint").touched?7:e.mappingFormGroup.get("endpoint").hasError("pattern")&&e.mappingFormGroup.get("endpoint").touched?8:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,10,"gateway.hints.rest.http-methods")),t.ɵɵadvance(5),t.ɵɵrepeater(e.httpMethods),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("HTTPMethods").hasError("required")&&e.mappingFormGroup.get("HTTPMethods").touched?17:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(20,12,"gateway.hints.rest.scope-type")),t.ɵɵadvance(5),t.ɵɵrepeater(e.requestsScopeType)}}function B0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-required"))}function N0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-pattern"))}function L0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.device-name-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",26),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,B0,2,3,"tb-error-icon",22)(8,N0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.device-name-filter-hint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("deviceNameFilter").hasError("required")&&e.mappingFormGroup.get("deviceNameFilter").touched?7:e.mappingFormGroup.get("deviceNameFilter").hasError("pattern")&&e.mappingFormGroup.get("deviceNameFilter").touched?8:-1)}}function V0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.method-filter-required"))}function q0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.method-filter-pattern"))}function G0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.method-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",27),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,V0,2,3,"tb-error-icon",22)(8,q0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.rest.method-filter")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("methodFilter").hasError("required")&&e.mappingFormGroup.get("methodFilter").touched?7:e.mappingFormGroup.get("methodFilter").hasError("pattern")&&e.mappingFormGroup.get("methodFilter").touched?8:-1)}}function z0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-filter-required"))}function U0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-filter-pattern"))}function j0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.attribute-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",28),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,z0,2,3,"tb-error-icon",22)(8,U0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.rest.attribute-filter")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("attributeFilter").hasError("required")&&e.mappingFormGroup.get("attributeFilter").touched?7:e.mappingFormGroup.get("attributeFilter").hasError("pattern")&&e.mappingFormGroup.get("attributeFilter").touched?8:-1)}}function H0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.request-url-expression-required"))}function W0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.request-url-expression-pattern"))}function $0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function K0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.value-expression-required"))}function Y0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.value-expression-pattern"))}function X0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",29)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.rest.request-url-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",30),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,H0,2,3,"tb-error-icon",22)(8,W0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",19),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.rest.http-method"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",20)(14,"mat-select",31),t.ɵɵrepeaterCreate(15,$0,2,2,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵelementStart(17,"div",9)(18,"div",19),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"gateway.value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",20),t.ɵɵelement(22,"input",32),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,K0,2,3,"tb-error-icon",22)(25,Y0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,7,"gateway.hints.rest.attribute-url-expression")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("requestUrlExpression").hasError("required")&&e.mappingFormGroup.get("requestUrlExpression").touched?7:e.mappingFormGroup.get("requestUrlExpression").hasError("pattern")&&e.mappingFormGroup.get("requestUrlExpression").touched?8:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,11,"gateway.hints.rest.http-method")),t.ɵɵadvance(5),t.ɵɵrepeater(e.httpMethods),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(19,13,"gateway.hints.rest.value-expression")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("valueExpression").hasError("required")&&e.mappingFormGroup.get("valueExpression").touched?24:e.mappingFormGroup.get("valueExpression").hasError("pattern")&&e.mappingFormGroup.get("valueExpression").touched?25:-1)}}function Z0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,E0)))}function Q0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function J0(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function e2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2,"gateway.response-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",20),t.ɵɵelement(4,"input",33),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,Z0,2,5,"tb-error-icon",22)(7,Q0,2,3,"tb-error-icon",22)(8,J0,2,0,"span",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("responseTimeout").hasError("min")&&e.mappingFormGroup.get("responseTimeout").touched?6:e.mappingFormGroup.get("responseTimeout").hasError("pattern")&&e.mappingFormGroup.get("responseTimeout").touched?7:8)}}function t2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-required"))}function n2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-pattern"))}function i2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-name-expression-required"))}function a2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-name-expression-pattern"))}function r2(e,n){1&e&&t.ɵɵelement(0,"div",38),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/rest-json_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,M0))}function o2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.device-name-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",35),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,t2,2,3,"tb-error-icon",22)(8,n2,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",36),t.ɵɵtext(11,"gateway.attribute-name-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",20),t.ɵɵelement(13,"input",37),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,i2,2,3,"tb-error-icon",22)(16,a2,2,3,"tb-error-icon",22)(17,r2,1,3,"div",38),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.device-name-filter-hint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("deviceNameExpression").hasError("required")&&e.mappingFormGroup.get("deviceNameExpression").touched?7:e.mappingFormGroup.get("deviceNameExpression").hasError("pattern")&&e.mappingFormGroup.get("deviceNameExpression").touched?8:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("attributeNameExpression").hasError("required")&&e.mappingFormGroup.get("attributeNameExpression").touched?15:e.mappingFormGroup.get("attributeNameExpression").hasError("pattern")&&e.mappingFormGroup.get("attributeNameExpression").touched?16:17)}}function s2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,E0)))}function l2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function p2(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function c2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",20),t.ɵɵelement(4,"input",39),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,s2,2,5,"tb-error-icon",22)(7,l2,2,3,"tb-error-icon",22)(8,p2,2,0,"span",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("timeout").hasError("min")&&e.mappingFormGroup.get("timeout").touched?6:e.mappingFormGroup.get("timeout").hasError("pattern")&&e.mappingFormGroup.get("timeout").touched?7:8)}}function d2(e,n){1&e&&(t.ɵɵelementStart(0,"div",14)(1,"mat-slide-toggle",40)(2,"mat-label",41),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.hints.rest.update-ssl")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.rest.ssl-verify")," "))}function u2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",53),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.value)}}function m2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,E0)))}function h2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function g2(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function f2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.tries-min"))}function y2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.tries-pattern"))}function v2(e,n){1&e&&(t.ɵɵelementStart(0,"div",14)(1,"mat-slide-toggle",54)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.rest.allow-redirects")," "))}function x2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",8)(1,"mat-expansion-panel",42)(2,"mat-expansion-panel-header")(3,"mat-panel-title",43)(4,"div",44),t.ɵɵtext(5,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(6,"div",45)(7,"div",10),t.ɵɵtext(8,"gateway.rest.http-headers"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"div",46)(10,"mat-chip-listbox",47),t.ɵɵpipe(11,"keyvalue"),t.ɵɵrepeaterCreate(12,u2,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵpipe(14,"keyvalue"),t.ɵɵelementStart(15,"mat-chip",48),t.ɵɵelement(16,"label",49),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"button",50,0),t.ɵɵpipe(19,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(18),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i))})),t.ɵɵelementStart(20,"tb-icon",51),t.ɵɵtext(21,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(22,"div",9)(23,"div",10),t.ɵɵtext(24,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",20),t.ɵɵelement(26,"input",39),t.ɵɵpipe(27,"translate"),t.ɵɵtemplate(28,m2,2,5,"tb-error-icon",22)(29,h2,2,3,"tb-error-icon",22)(30,g2,2,0,"span",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(31,"div",9)(32,"div",10),t.ɵɵtext(33,"gateway.rest.tries"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"mat-form-field",20),t.ɵɵelement(35,"input",52),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,f2,2,3,"tb-error-icon",22)(38,y2,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵtemplate(39,v2,5,3,"div",14),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(10),t.ɵɵproperty("tbEllipsisChipList",t.ɵɵpipeBind1(11,7,e.mappingFormGroup.get("httpHeaders").value)),t.ɵɵadvance(2),t.ɵɵrepeater(t.ɵɵpipeBind1(14,9,e.mappingFormGroup.get("httpHeaders").value)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,11,"action.edit")),t.ɵɵadvance(9),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(27,13,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("timeout").hasError("min")&&e.mappingFormGroup.get("timeout").touched?28:e.mappingFormGroup.get("timeout").hasError("pattern")&&e.mappingFormGroup.get("timeout").touched?29:30),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("tries").hasError("min")&&e.mappingFormGroup.get("tries").touched?37:e.mappingFormGroup.get("tries").hasError("pattern")&&e.mappingFormGroup.get("tries").touched?38:-1),t.ɵɵadvance(2),t.ɵɵconditional(e.requestType===e.RestRequestType.ATTRIBUTE_UPDATE?39:-1)}}class b2 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.cdr=l,this.destroyRef=p,this.requestTypes=Object.values(bi),this.requestsScopeType=Object.values(Si),this.httpMethods=Object.values(ht),this.helpLink=`${O}/docs/iot-gateway/config/rest/#attribute-request-section`,this.RestRequestTypesTranslationsMap=wi,this.SecurityMode=$i,this.RestRequestType=bi,this.mappingFormGroup=this.fb.group({requestType:[bi.ATTRIBUTE_REQUEST],endpoint:["",[$.required,$.pattern(an)]],HTTPMethods:[[ht.POST],[$.required]],HTTPMethod:[ht.POST,[$.required]],type:[Si.Shared],security:[{type:ki.ANONYMOUS}],timeout:[null,[$.min(.001),$.pattern(nn)]],deviceNameExpression:["",[$.required,$.pattern(an)]],attributeNameExpression:["",[$.required,$.pattern(an)]],SSLVerify:[!1],deviceNameFilter:["",[$.required,$.pattern(an)]],methodFilter:["",[$.required,$.pattern(an)]],attributeFilter:["",[$.required,$.pattern(an)]],requestUrlExpression:[this.data.defaultRequestUrl,[$.required,$.pattern(an)]],valueExpression:["",[$.required,$.pattern(an)]],responseTimeout:[null,[$.min(.001),$.pattern(nn)]],tries:[null,[$.min(1),$.pattern(nn)]],allowRedirects:[!1],httpHeaders:[{}]}),this.keysPopupClosed=!0,this.mappingFormGroup.patchValue(this.data.value,{emitEvent:!1}),this.observeRequestTypeChange(),this.toggleFieldsByRequestType(this.mappingFormGroup.get("requestType").value)}get requestType(){return this.mappingFormGroup.get("requestType").value}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.mappingFormGroup.valid){const{requestType:e,...t}=this.mappingFormGroup.value;Te(t),this.dialogRef.close({requestType:e,requestValue:t})}}manageKeys(e,t){e.stopPropagation();const n=t._elementRef.nativeElement;if(this.popoverService.hasPopover(n))return void this.popoverService.hidePopover(n);this.popoverService.hasPopover(n)&&this.popoverService.hidePopover(n),this.keysPopupClosed=!1;const i=this.popoverService.displayPopover(n,this.renderer,this.viewContainerRef,I0,"leftBottom",!1,null,{keys:this.mappingFormGroup.get("httpHeaders").value,withReportStrategy:this.data.withReportStrategy},{},{},{},!0);i.tbComponentRef.instance.popover=i,i.tbComponentRef.instance.keysDataApplied.subscribe((e=>{i.hide(),this.mappingFormGroup.get("httpHeaders").patchValue(e),this.mappingFormGroup.get("httpHeaders").markAsDirty(),this.cdr.markForCheck()})),i.tbHideStart.pipe(bn(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}observeRequestTypeChange(){this.mappingFormGroup.get("requestType").valueChanges.pipe(ce(),bn(this.destroyRef)).subscribe((e=>this.toggleFieldsByRequestType(e)))}toggleFieldsByRequestType(e){this.mappingFormGroup.disable({emitEvent:!1}),Ci.get("all").forEach((e=>this.mappingFormGroup.get(e).enable({emitEvent:!1}))),Ci.get(e).forEach((e=>this.mappingFormGroup.get(e).enable({emitEvent:!1})))}static{this.ɵfac=function(e){return new(e||b2)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(Xe.Router),t.ɵɵdirectiveInject(Ve),t.ɵɵdirectiveInject(qe.MatDialogRef),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:b2,selectors:[["tb-rest-requests-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:37,vars:23,consts:[["button",""],[1,"h-full","w-[77vw]","max-w-3xl",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row"],["translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["formControlName","requestType"],[3,"value"],[1,"tb-form-row","tb-flex","fill-width"],["formControlName","security",3,"mode"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","type","text","name","value","formControlName","endpoint",3,"placeholder"],["matSuffix","",3,"tooltipText"],["formControlName","HTTPMethods","multiple",""],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","type"],["matInput","","type","text","name","value","formControlName","deviceNameFilter",3,"placeholder"],["matInput","","type","text","name","value","formControlName","methodFilter",3,"placeholder"],["matInput","","type","text","name","value","formControlName","attributeFilter",3,"placeholder"],[1,"tb-form-row","request-url-row"],["matInput","","type","text","name","value","formControlName","requestUrlExpression",3,"placeholder"],["formControlName","HTTPMethod"],["matInput","","type","text","name","value","formControlName","valueExpression",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","responseTimeout",3,"placeholder"],["translate","","matSuffix","",1,"block","pr-2"],["matInput","","type","text","name","value","formControlName","deviceNameExpression",3,"placeholder"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","text","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","SSLVerify",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],[1,"tb-settings"],[1,"justify-end"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","space-between","tb-flex"],[1,"tb-flex","gw-chip-list"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["matInput","","type","number","min","0","name","value","formControlName","tries",3,"placeholder"],["tbTruncateWithTooltip",""],["formControlName","allowRedirects",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",1)(1,"mat-toolbar",2)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",3)(6,"div",4),t.ɵɵelementStart(7,"button",5),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",6),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10),t.ɵɵtext(14,"gateway.request-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",11)(16,"mat-select",12),t.ɵɵrepeaterCreate(17,k0,3,4,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵtemplate(19,R0,26,14)(20,L0,9,7,"div",9)(21,G0,9,7,"div",9)(22,j0,9,7,"div",9)(23,X0,26,17)(24,e2,9,4,"div",9)(25,o2,18,11)(26,c2,9,4,"div",9)(27,d2,6,6,"div",14),t.ɵɵelement(28,"tb-security-config",15),t.ɵɵtemplate(29,x2,40,17,"div",8),t.ɵɵelementEnd()(),t.ɵɵelementStart(30,"div",16)(31,"button",17),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(32),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"button",18),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,17,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLink),t.ɵɵadvance(11),t.ɵɵrepeater(n.requestTypes),t.ɵɵadvance(2),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?19:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?20:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.SERVER_SIDE_RPC?21:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_UPDATE?22:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?23:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.SERVER_SIDE_RPC?24:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?25:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?26:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_UPDATE?27:-1),t.ɵɵadvance(),t.ɵɵproperty("mode",n.SecurityMode.basic),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?29:-1),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(33,19,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingFormGroup.invalid||!n.mappingFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(36,21,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(b2,[j,_,Gn,BY,Qn]),styles:["[_nghost-%COMP%] .tb-form-row.request-url-row[_ngcontent-%COMP%]{gap:6px}"],changeDetection:d.OnPush})}}const w2=()=>["type","details","actions"],S2=()=>({});function C2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",26),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"span",8),t.ɵɵelementStart(5,"button",10),t.ɵɵpipe(6,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(7,"mat-icon"),t.ɵɵtext(8,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",10),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.requests-mapping")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(6,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,7,"action.search")))}function _2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",27)(1,"div",28),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.type")))}function T2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",29)(1,"div",28),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,i.RestRequestTypesTranslationsMap.get(e.requestType)))}}function I2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.details")," "))}function E2(e,n){if(1&e&&t.ɵɵtext(0),2&e){let e;const n=t.ɵɵnextContext().$implicit,i=t.ɵɵnextContext();t.ɵɵtextInterpolate1(" ",i.Object.values(null!==(e=n.requestValue.httpHeaders)&&void 0!==e?e:t.ɵɵpureFunction0(1,S2)).join(", ")," ")}}function M2(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate1(" ",e.requestValue.methodFilter," ")}}function k2(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate1(" ",e.requestValue.endpoint," ")}}function P2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",29)(1,"div",28),t.ɵɵtemplate(2,E2,1,2)(3,M2,1,1)(4,k2,1,1),t.ɵɵelementEnd()()),2&e){let e;const i=n.$implicit;t.ɵɵadvance(2),t.ɵɵconditional("attributeUpdates"===(e=i.requestType)?2:"serverSideRpc"===e?3:4)}}function D2(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",31)}function O2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",10),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function A2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,O2,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",32),t.ɵɵelementContainer(4,33),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",34)(6,"button",35),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",36),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",37,2),t.ɵɵelementContainer(11,33),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(4),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function F2(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",38)}function R2(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class B2 extends qa{constructor(){super(...arguments),this.Object=Object,this.RestRequestTypesTranslationsMap=wi}getDatasource(){return new N2}manageMapping(e,t){e&&e.stopPropagation();const n=ke(t),{requestType:i=bi.ATTRIBUTE_REQUEST,requestValue:a={}}=n?this.entityFormArray.at(t).value:{};this.getMappingDialog({requestType:i,...a},n?"action.apply":"action.add").afterClosed().pipe(bn(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteMapping(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:this.getRequestDetails(this.entityFormArray.at(t).value)}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(bn(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>{const n=this.getRequestDetails(e);return Object.values(e).some((e=>Me(e)&&this.translate.instant(wi.get(e)).toLowerCase().includes(t.toLowerCase())||n?.toLowerCase().includes(t.toLowerCase())))}))),this.dataSource.loadData(e)}getRequestDetails(e){let t;switch(e.requestType){case"attributeUpdates":t=Object.values(e.requestValue.httpHeaders).join(", ");break;case"serverSideRpc":t=e.requestValue.methodFilter;break;default:t=e.requestValue.endpoint}return t}validate(){return null}getMappingDialog(e,t){return this.dialog.open(b2,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,defaultRequestUrl:this.defaultRequestUrl,withReportStrategy:this.withReportStrategy}})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(B2)))(n||B2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:B2,selectors:[["tb-rest-request-mapping-table"]],inputs:{defaultRequestUrl:"defaultRequestUrl"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>B2)),multi:!0},{provide:K,useExisting:c((()=>B2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:44,vars:36,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-absolute-fill","size-full"],[1,"flex","size-full","flex-col"],[1,"gw-table-toolbar","mat-mdc-table-toolbar"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"gw-connector-table"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","!w-1/3",4,"matHeaderCellDef"],["class","w-1/3",4,"matCellDef"],["class","w-1/3 !pl-0",4,"matHeaderCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"!w-1/3"],["tbTruncateWithTooltip",""],[1,"w-1/3"],[1,"w-1/3","!pl-0"],[1,"w-12"],[1,"lt-lg:!hidden","flex","min-w-24","flex-1","flex-row","items-stretch","justify-end","text-center"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,C2,13,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"button",7),t.ɵɵpipe(7,"translate"),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",8)(11,"mat-label"),t.ɵɵtext(12," "),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",9,0),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵpipe(17,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(18,"mat-icon"),t.ɵɵtext(19,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"table",12),t.ɵɵelementContainerStart(22,13),t.ɵɵtemplate(23,_2,4,3,"mat-header-cell",14)(24,T2,4,3,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,13),t.ɵɵtemplate(26,I2,3,3,"mat-header-cell",16)(27,P2,5,1,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(28,17),t.ɵɵtemplate(29,D2,1,0,"mat-header-cell",18)(30,A2,12,3,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(31,F2,1,0,"mat-header-row",20)(32,R2,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"section",22),t.ɵɵpipe(34,"async"),t.ɵɵelementStart(35,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(36,"mat-icon",24),t.ɵɵtext(37,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"span"),t.ɵɵtext(39),t.ɵɵpipe(40,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(41,"span",25),t.ɵɵpipe(42,"async"),t.ɵɵtext(43," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵconditional(!1===t.ɵɵpipeBind1(4,20,n.dataSource.isEmpty())?3:-1),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,22,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,24,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,26,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","type"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","details"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(34,w2))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(35,w2)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(34,28,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(40,30,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(42,32,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(B2,[j,_,qn]),encapsulation:2,changeDetection:d.OnPush})}}class N2 extends G{constructor(){super()}}class L2 extends Ba{initBasicFormGroup(){return this.fb.group({server:[],mapping:[],requestsMapping:[]})}getRequestDataArray(e){const t=[];return Fe(e)&&Object.keys(e).forEach((n=>{for(const i of e[n])t.push({requestType:n,requestValue:i})})),t}getRequestDataObject(e){return e.reduce(((e,{requestType:t,requestValue:n})=>(e[t]?.push(n),e)),{attributeRequests:[],attributeUpdates:[],serverSideRpc:[]})}updateDefaultUrl({host:e,port:t,SSL:n}){this.defaultRequestUrl=e&&t?`${n?"https":"http"}//${e}:${t}/`:document.location.origin}writeValue(e){this.basicFormGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(L2)))(n||L2)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:L2,features:[t.ɵɵInheritDefinitionFeature]})}}class V2 extends L2{mapConfigToFormValue(e){return{server:e.server??{},mapping:e.mapping??[],requestsMapping:this.getRequestDataArray(e.requestsMapping)}}getMappedValue(e){return this.updateDefaultUrl(e?.server??{}),{server:e.server??{},mapping:e.mapping??[],requestsMapping:this.getRequestDataObject(e.requestsMapping??[])}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(V2)))(n||V2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:V2,selectors:[["tb-rest-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>V2)),multi:!0},{provide:K,useExisting:c((()=>V2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:13,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server"],["formControlName","mapping"],["formControlName","requestsMapping",3,"defaultRequestUrl"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-rest-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-rest-mapping-table",4),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-tab",1),t.ɵɵpipe(11,"translate"),t.ɵɵelement(12,"tb-rest-request-mapping-table",5),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.server"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(11,15,"gateway.requests-mapping")),t.ɵɵadvance(2),t.ɵɵproperty("defaultRequestUrl",n.defaultRequestUrl))},dependencies:t.ɵɵgetComponentDepsFactory(V2,[j,_,D1,y0,B2]),encapsulation:2,changeDetection:d.OnPush})}}class q2 extends L2{mapConfigToFormValue({attributeRequests:e=[],attributeUpdates:t=[],serverSideRpc:n=[],mapping:i=[],...a}){return{server:{...a??{}},mapping:$a.mapMappingToUpgradedVersion(i),requestsMapping:this.getRequestDataArray({attributeRequests:e,attributeUpdates:t,serverSideRpc:n})}}getMappedValue({requestsMapping:e,mapping:t=[],server:n={}}){this.updateDefaultUrl(n);const{attributeRequests:i=[],attributeUpdates:a=[],serverSideRpc:r=[]}=this.getRequestDataObject(e);return{...n,mapping:$a.mapMappingToDowngradedVersion(t),attributeRequests:i,attributeUpdates:a,serverSideRpc:r}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(q2)))(n||q2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:q2,selectors:[["tb-rest-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>q2)),multi:!0},{provide:K,useExisting:c((()=>q2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:13,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server"],["formControlName","mapping"],["formControlName","requestsMapping",3,"defaultRequestUrl"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-rest-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-rest-mapping-table",4),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-tab",1),t.ɵɵpipe(11,"translate"),t.ɵɵelement(12,"tb-rest-request-mapping-table",5),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.server"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(11,15,"gateway.requests-mapping")),t.ɵɵadvance(2),t.ɵɵproperty("defaultRequestUrl",n.defaultRequestUrl))},dependencies:t.ɵɵgetComponentDepsFactory(q2,[j,_,D1,y0,B2]),encapsulation:2,changeDetection:d.OnPush})}}const G2=(e,t)=>({hasErrors:e,noErrors:t}),z2=()=>({minWidth:"144px",maxWidth:"144px",textAlign:"center"}),U2=()=>({minWidth:"144px",maxWidth:"144px",width:"144px",textAlign:"center"}),j2=e=>({"tb-current-entity":e});function H2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",32),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"async"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onAddConnector(n))})),t.ɵɵelementStart(3,"mat-icon"),t.ɵɵtext(4,"add"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.add")),t.ɵɵproperty("disabled",t.ɵɵpipeBind1(2,4,e.isLoading$))}}function W2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",33)(1,"button",34),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onAddConnector(n))})),t.ɵɵelementStart(2,"mat-icon",35),t.ɵɵtext(3,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"span"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,1,"gateway.add-connector")))}function $2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",36),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-enabled")," "))}function K2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell")(1,"mat-slide-toggle",37),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return n.stopPropagation(),t.ɵɵresetView(a.onEnableConnector(i))})),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("checked",i.activeConnectors.includes(e.key))}}function Y2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",38),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-name"),""))}function X2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function Z2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-type")," "))}function Q2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",40),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.returnType(e)," ")}}function J2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.configuration")," "))}function e3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",40)(1,"div",41),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(i.isConnectorSynced(e)?"status-sync":"status-unsync"),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.isConnectorSynced(e)?"sync":"out of sync"," ")}}function t3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-status")," "))}function n3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell",40)(1,"span",42),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(t.ɵɵpureFunction2(3,G2,+i.getErrorsCount(e)>0,0==+i.getErrorsCount(e)||""===i.getErrorsCount(e))),t.ɵɵpropertyInterpolate("matTooltip","Errors: "+i.getErrorsCount(e))}}function i3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell"),t.ɵɵelement(1,"div",43),t.ɵɵelementStart(2,"div",44),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,z2)),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.connectors-table-actions")))}function a3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell")(1,"div",45)(2,"button",46),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorRpc(i,n))})),t.ɵɵelementStart(3,"mat-icon"),t.ɵɵtext(4,"private_connectivity"),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"button",47),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementStart(6,"mat-icon"),t.ɵɵtext(7,"list"),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"button",48),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteConnector(i,n))})),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"delete"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",49)(12,"button",50),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(13,"mat-icon",51),t.ɵɵtext(14,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-menu",52,1)(17,"button",46),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorRpc(i,n))})),t.ɵɵelementStart(18,"mat-icon"),t.ɵɵtext(19,"private_connectivity"),t.ɵɵelementEnd()(),t.ɵɵelementStart(20,"button",47),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementStart(21,"mat-icon"),t.ɵɵtext(22,"list"),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"button",48),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteConnector(i,n))})),t.ɵɵelementStart(24,"mat-icon"),t.ɵɵtext(25,"delete"),t.ɵɵelementEnd()()()()()}if(2&e){const e=n.$implicit,i=t.ɵɵreference(16);t.ɵɵadvance(),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,U2)),t.ɵɵadvance(),t.ɵɵproperty("disabled",!e.value.configurationJson.id),t.ɵɵadvance(10),t.ɵɵproperty("matMenuTriggerFor",i),t.ɵɵadvance(5),t.ɵɵproperty("disabled",!e.value.configurationJson.id)}}function r3(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",53)}function o3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-row",54),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.selectConnector(n,i))})),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction1(2,j2,i.isSameConnector(e)))}}function s3(e,n){if(1&e&&(t.ɵɵelementStart(0,"span",55),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1("v",e.connectorForm.get("configVersion").value,"")}}function l3(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-select",56)(1,"tb-toggle-option",57),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"tb-toggle-option",57),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("value",e.ConnectorConfigurationModes.BASIC),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,4,"gateway.basic")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",e.ConnectorConfigurationModes.ADVANCED),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,6,"gateway.advanced")," ")}}function p3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-mqtt-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function c3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-mqtt-legacy-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function d3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,p3,2,4,"tb-mqtt-basic-config",64),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,c3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.MQTT))("ngIfElse",e)}}function u3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-opc-ua-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function m3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-opc-ua-legacy-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function h3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,u3,2,4,"tb-opc-ua-basic-config",64),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,m3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.OPCUA))("ngIfElse",e)}}function g3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-modbus-basic-config",67),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function f3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-modbus-legacy-basic-config",67),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function y3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,g3,1,1,"tb-modbus-basic-config",66),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,f3,1,1,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.MODBUS))("ngIfElse",e)}}function v3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-socket-basic-config",67),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function x3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-socket-legacy-basic-config",67),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function b3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,v3,1,1,"tb-socket-basic-config",66),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,x3,1,1,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.SOCKET))("ngIfElse",e)}}function w3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-bacnet-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function S3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-bacnet-legacy-basic-config",65),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function C3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,w3,2,4,"tb-bacnet-basic-config",64),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,S3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.BACNET))("ngIfElse",e)}}function _3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-rest-basic-config",69),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function T3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-rest-legacy-basic-config",69),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function I3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,_3,2,4,"tb-rest-basic-config",68),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,T3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.REST))("ngIfElse",e)}}function E3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0)(1,62),t.ɵɵtemplate(2,d3,5,5,"ng-container",63)(3,h3,5,5,"ng-container",63)(4,y3,5,5,"ng-container",63)(5,b3,5,5,"ng-container",63)(6,C3,5,5,"ng-container",63)(7,I3,5,5,"ng-container",63),t.ɵɵelementContainerEnd()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("ngSwitch",e.initialConnector.type),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MQTT),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OPCUA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MODBUS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SOCKET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REST)}}function M3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab-group")(1,"mat-tab",70),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,71),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",70),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-json-object-edit",72),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()),2&e){t.ɵɵnextContext(2);const e=t.ɵɵreference(41);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,6,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,8,"gateway.configuration"),"*"),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(7,10,"gateway.configuration")),t.ɵɵproperty("fillHeight",!0)}}function k3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",58),t.ɵɵtemplate(1,E3,8,7,"ng-container",59)(2,M3,8,12,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(4,"div",60)(5,"button",61),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.onSaveConnector())})),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()}if(2&e){let e;const n=t.ɵɵreference(3),i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngIf",(null==(e=i.connectorForm.get("mode"))?null:e.value)===i.ConnectorConfigurationModes.BASIC)("ngIfElse",n),t.ɵɵadvance(4),t.ɵɵproperty("disabled",!i.connectorForm.dirty||i.connectorForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,4,"action.save")," ")}}function P3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",89),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.connectorForm.get("name").hasError("duplicateName")?"gateway.connector-duplicate-name":"gateway.name-required"))}}function D3(e,n){1&e&&(t.ɵɵelementStart(0,"div",74)(1,"div",85),t.ɵɵtext(2,"gateway.connectors-table-class"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",76)(4,"mat-form-field",77),t.ɵɵelement(5,"input",90),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function O3(e,n){1&e&&(t.ɵɵelementStart(0,"div",74)(1,"div",85),t.ɵɵtext(2,"gateway.connectors-table-key"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",76)(4,"mat-form-field",77),t.ɵɵelement(5,"input",91),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function A3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",57),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function F3(e,n){1&e&&(t.ɵɵelementStart(0,"div",74)(1,"mat-slide-toggle",92)(2,"mat-label",93),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.send-change-data-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.send-change-data")," "))}function R3(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",94),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Connector)}}function B3(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",73)(1,"div",74)(2,"div",75),t.ɵɵtext(3,"gateway.name"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",76)(5,"mat-form-field",77),t.ɵɵelement(6,"input",78),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,P3,3,3,"mat-icon",79),t.ɵɵelementEnd()()(),t.ɵɵtemplate(9,D3,7,3,"div",80)(10,O3,7,3,"div",80),t.ɵɵelementStart(11,"div",81)(12,"div",82),t.ɵɵtext(13,"gateway.logs-configuration"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",83)(15,"mat-slide-toggle",84)(16,"mat-label"),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",74)(20,"div",85),t.ɵɵtext(21,"gateway.remote-logging-level"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"div",76)(23,"mat-form-field",77)(24,"mat-select",86),t.ɵɵtemplate(25,A3,2,2,"mat-option",87),t.ɵɵelementEnd()()()()(),t.ɵɵtemplate(26,F3,6,6,"div",80),t.ɵɵpipe(27,"withReportStrategy"),t.ɵɵtemplate(28,R3,1,2,"tb-report-strategy",88),t.ɵɵpipe(29,"withReportStrategy"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.connectorForm),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.connectorForm.get("name").hasError("required")&&e.connectorForm.get("name").touched||e.connectorForm.get("name").hasError("duplicateName")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.GRPC),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,11,"gateway.enable-remote-logging")," "),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",e.gatewayLogLevel),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.MQTT&&!t.ɵɵpipeBind2(27,13,e.connectorForm.get("configVersion").value,e.ConnectorType.MQTT)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(29,16,e.connectorForm.get("configVersion").value,e.connectorForm.get("type").value))}}class N3{isErrorState(e){return e&&e.invalid}}e("ForceErrorStateMatcher",N3);class L3 extends q{constructor(e,t,n,i,a,r,o,s,l,p,c){super(e),this.store=e,this.fb=t,this.translate=n,this.attributeService=i,this.dialogService=a,this.dialog=r,this.telemetryWsService=o,this.zone=s,this.utils=l,this.withReportStrategy=p,this.cd=c,this.ConnectorType=ct,this.allowBasicConfig=new Set([ct.MQTT,ct.OPCUA,ct.MODBUS,ct.SOCKET,ct.BACNET,ct.REST]),this.gatewayLogLevel=Object.values(lt),this.displayedColumns=["enabled","key","type","syncStatus","errors","actions"],this.GatewayConnectorTypesTranslatesMap=dt,this.ConnectorConfigurationModes=Qt,this.ReportStrategyDefaultValue=en,this.basicConfigInitSubject=new te,this.activeData=[],this.inactiveData=[],this.sharedAttributeData=[],this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.onErrorsUpdated()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)}))}},this.destroy$=new te,this.attributeUpdateSubject=new te,this.initDataSources(),this.initConnectorForm(),this.observeAttributeChange()}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.sortingDataAccessor=this.getSortingDataAccessor(),this.ctx.$scope.gatewayConnectors=this,this.loadConnectors(),this.loadGatewayState(),this.observeModeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}onSaveConnector(){this.saveConnector(this.getUpdatedConnectorData(this.connectorForm.value),!1)}saveConnector(e,t=!0){const n=t||this.activeConnectors.includes(this.initialConnector.name)?D.SHARED_SCOPE:D.SERVER_SCOPE;oe(this.getEntityAttributeTasks(e,n)).pipe(ye(1)).subscribe((n=>{this.showToast(t?this.translate.instant("gateway.connector-created"):this.translate.instant("gateway.connector-updated")),this.initialConnector=e,this.updateData(!0),this.connectorForm.markAsPristine()}))}getEntityAttributeTasks(e,t){const n=[],i=[{key:e.name,value:e}],a=[],r=!this.activeConnectors.includes(e.name)&&t===D.SHARED_SCOPE||!this.inactiveConnectors.includes(e.name)&&t===D.SERVER_SCOPE,o=this.initialConnector&&this.initialConnector.name!==e.name;return o&&(a.push({key:this.initialConnector.name}),this.removeConnectorFromList(this.initialConnector.name,!0),this.removeConnectorFromList(this.initialConnector.name,!1)),r&&(t===D.SHARED_SCOPE?this.activeConnectors.push(e.name):this.inactiveConnectors.push(e.name)),(o||r)&&n.push(this.getSaveEntityAttributesTask(t)),n.push(this.attributeService.saveEntityAttributes(this.device,t,i)),a.length&&n.push(this.attributeService.deleteEntityAttributes(this.device,t,a)),n}getSaveEntityAttributesTask(e){const t=e===D.SHARED_SCOPE?"active_connectors":"inactive_connectors",n=e===D.SHARED_SCOPE?this.activeConnectors:this.inactiveConnectors;return this.attributeService.saveEntityAttributes(this.device,e,[{key:t,value:n}])}removeConnectorFromList(e,t){const n=t?this.activeConnectors:this.inactiveConnectors,i=n.indexOf(e);-1!==i&&n.splice(i,1)}getUpdatedConnectorData(e){const t={...e};return t.configuration=`${Be(t.name)}.json`,delete t.basicConfig,t.type!==ct.GRPC&&delete t.key,t.type!==ct.CUSTOM&&delete t.class,this.allowBasicConfig.has(t.type)||delete t.mode,this.withReportStrategy.transform(t.configVersion,t.type)&&(t.configurationJson.reportStrategy=t.reportStrategy,Ae(t.reportStrategy)&&delete t.reportStrategy,Ae(t.configurationJson.reportStrategy)&&delete t.configurationJson.reportStrategy),this.gatewayVersion&&!t.configVersion&&(t.configVersion=this.gatewayVersion),t.ts=Date.now(),t}updateData(e=!1){this.pageLink.sortOrder.property=this.sort.active,this.pageLink.sortOrder.direction=w[this.sort.direction.toUpperCase()],this.attributeDataSource.loadAttributes(this.device,D.CLIENT_SCOPE,this.pageLink,e).subscribe((e=>{this.activeData=e.data.filter((e=>this.activeConnectors.includes(e.key))),this.combineData(),this.generateSubscription(),this.setClientData(e)})),this.inactiveConnectorsDataSource.loadAttributes(this.device,D.SHARED_SCOPE,this.pageLink,e).subscribe((e=>{this.sharedAttributeData=e.data.filter((e=>this.activeConnectors.includes(e.key))),this.combineData()})),this.serverDataSource.loadAttributes(this.device,D.SERVER_SCOPE,this.pageLink,e).subscribe((e=>{this.inactiveData=e.data.filter((e=>this.inactiveConnectors.includes(e.key))),this.combineData()}))}isConnectorSynced(e){const t=e.value;if(!t.ts||e.skipSync||!this.isGatewayActive)return!1;if(-1===this.activeData.findIndex((e=>("string"==typeof e.value?JSON.parse(e.value):e.value).name===t.name)))return!1;return-1!==this.sharedAttributeData.findIndex((e=>{const n=e.value,i=n.name===t.name,a=Se(n.configurationJson,{})&&i,r=this.hasSameConfig(n.configurationJson,t.configurationJson),o=n.ts&&n.ts<=t.ts;return i&&o&&(r||a)}))}hasSameConfig(e,t){const{name:n,id:i,enableRemoteLogging:a,logLevel:r,reportStrategy:o,configVersion:s,...l}=e,{name:p,id:c,enableRemoteLogging:d,logLevel:u,reportStrategy:m,configVersion:h,...g}=t;return Se(l,g)}combineData(){const e=[...this.activeData,...this.inactiveData,...this.sharedAttributeData].reduce(((e,t)=>{const n=e.findIndex((e=>e.key===t.key));return-1===n?e.push(t):t.lastUpdateTs>e[n].lastUpdateTs&&!this.isConnectorSynced(e[n])&&(e[n]={...t,skipSync:!0}),e}),[]);this.dataSource.data=e.map((e=>({...e,value:"string"==typeof e.value?JSON.parse(e.value):e.value})))}clearOutConnectorForm(){this.initialConnector=null,this.connectorForm.setValue({mode:Qt.BASIC,name:"",type:ct.MQTT,sendDataOnlyOnChange:!1,enableRemoteLogging:!1,logLevel:lt.INFO,key:"auto",class:"",configuration:"",configurationJson:{},basicConfig:{},configVersion:"",reportStrategy:[{value:{},disabled:!0}]},{emitEvent:!1}),this.connectorForm.markAsPristine()}selectConnector(e,t){e&&e.stopPropagation();const n=t.value;n?.name!==this.initialConnector?.name&&this.confirmConnectorChange().subscribe((e=>{e&&this.setFormValue(n)}))}isSameConnector(e){if(!this.initialConnector)return!1;const t=e.value;return this.initialConnector.name===t.name}showToast(e){this.store.dispatch({type:"[Notification] Show",notification:{message:e,type:"success",duration:1e3,verticalPosition:"top",horizontalPosition:"left",target:"dashboardRoot",forceDismiss:!0}})}returnType(e){const t=e.value;return this.GatewayConnectorTypesTranslatesMap.get(t.type)}deleteConnector(e,t){t?.stopPropagation();const n=`Delete connector "${e.key}"?`;this.dialogService.confirm(n,"All connector data will be deleted.","Cancel","Delete").pipe(ye(1),xe((t=>{if(!t)return;const n=[],i=this.activeConnectors.includes(e.value?.name)?D.SHARED_SCOPE:D.SERVER_SCOPE;return n.push(this.attributeService.deleteEntityAttributes(this.device,i,[e])),this.removeConnectorFromList(e.key,!0),this.removeConnectorFromList(e.key,!1),n.push(this.getSaveEntityAttributesTask(i)),oe(n)}))).subscribe((()=>{this.initialConnector&&this.initialConnector.name!==e.key||(this.clearOutConnectorForm(),this.cd.detectChanges()),this.updateData(!0)}))}connectorLogs(e,t){t&&t.stopPropagation();const n=Oe(this.ctx.stateController.getStateParams());n.connector_logs=e,n.targetEntityParamName="connector_logs",this.ctx.stateController.openState("connector_logs",n)}connectorRpc(e,t){t&&t.stopPropagation();const n=Oe(this.ctx.stateController.getStateParams());n.connector_rpc=e,n.targetEntityParamName="connector_rpc",this.ctx.stateController.openState("connector_rpc",n)}onEnableConnector(e){e.value.ts=(new Date).getTime(),this.updateActiveConnectorKeys(e.key),this.attributeUpdateSubject.next(e)}getErrorsCount(e){const t=e.key,n=this.subscription&&this.subscription.data.find((e=>e&&e.dataKey.name===`${t}_ERRORS_COUNT`));return n&&this.activeConnectors.includes(t)?n.data[0][1]||0:"Inactive"}onAddConnector(e){e?.stopPropagation(),this.confirmConnectorChange().pipe(ye(1),ue(Boolean),xe((()=>this.openAddConnectorDialog())),ue(Boolean)).subscribe((e=>this.addConnector(e)))}addConnector(e){e.configurationJson||(e.configurationJson={}),this.gatewayVersion&&!e.configVersion&&(e.configVersion=this.gatewayVersion),e.basicConfig=e.configurationJson,this.initialConnector=e;const t=this.connectorForm.get("type").value;this.setInitialConnectorValues(e),this.saveConnector(this.getUpdatedConnectorData(e)),t!==e.type&&this.allowBasicConfig.has(e.type)?this.basicConfigInitSubject.pipe(ye(1)).subscribe((()=>{this.patchConnectorBasicConfig(e.basicConfig)})):this.patchConnectorBasicConfig(e.basicConfig)}setInitialConnectorValues(e){const{basicConfig:t,mode:n,enableRemoteLogging:i,...a}=e;this.toggleReportStrategy(e),this.connectorForm.get("mode").setValue(this.allowBasicConfig.has(e.type)?e.mode??Qt.BASIC:null,{emitEvent:!1}),this.connectorForm.get("enableRemoteLogging").setValue(i,{emitEvent:!1}),this.connectorForm.patchValue(a,{emitEvent:!1})}openAddConnectorDialog(){return this.ctx.ngZone.run((()=>this.dialog.open(h$,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{dataSourceData:this.dataSource.data,gatewayVersion:this.gatewayVersion}}).afterClosed()))}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase(),n=this.dataSource.data.some((e=>e.value.name.toLowerCase()===t)),i=this.initialConnector?.name.toLowerCase()===t;return n&&!i?{duplicateName:{valid:!1}}:null}}initDataSources(){const e={property:"key",direction:w.ASC};this.pageLink=new S(1e3,0,null,e),this.attributeDataSource=new zn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.inactiveConnectorsDataSource=new zn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.serverDataSource=new zn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.dataSource=new x([])}initConnectorForm(){this.connectorForm=this.fb.group({mode:[Qt.BASIC],name:["",[$.required,this.uniqNameRequired(),$.pattern(an)]],type:["",[$.required]],enableRemoteLogging:[!1],logLevel:["",[$.required]],sendDataOnlyOnChange:[!1],key:["auto"],class:[""],configuration:[""],configurationJson:[{},[$.required]],basicConfig:[{}],configVersion:[""],reportStrategy:[{value:{},disabled:!0}]})}getSortingDataAccessor(){return(e,t)=>{switch(t){case"syncStatus":return this.isConnectorSynced(e)?1:0;case"enabled":return this.activeConnectors.includes(e.key)?1:0;case"errors":const n=this.getErrorsCount(e);return"string"==typeof n?this.sort.direction.toUpperCase()===w.DESC?-1:1/0:n;default:return e[t]||e.value[t]}}}loadConnectors(){this.device&&this.device.id!==B&&oe([this.attributeService.getEntityAttributes(this.device,D.SHARED_SCOPE,["active_connectors"]),this.attributeService.getEntityAttributes(this.device,D.SERVER_SCOPE,["inactive_connectors"]),this.attributeService.getEntityAttributes(this.device,D.CLIENT_SCOPE,["Version"])]).pipe(le(this.destroy$)).subscribe((e=>{this.activeConnectors=this.parseConnectors(e[0]),this.inactiveConnectors=this.parseConnectors(e[1]),this.gatewayVersion=e[2][0]?.value,this.updateData(!0)}))}loadGatewayState(){this.attributeService.getEntityAttributes(this.device,D.SERVER_SCOPE).pipe(le(this.destroy$)).subscribe((e=>{const t=e.find((e=>"active"===e.key)).value,n=e.find((e=>"lastDisconnectTime"===e.key))?.value,i=e.find((e=>"lastConnectTime"===e.key))?.value;this.isGatewayActive=this.getGatewayStatus(t,i,n)}))}parseConnectors(e){const t=e?.[0]?.value||[];return Me(t)?JSON.parse(t):t}observeModeChange(){this.connectorForm.get("mode").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{e===Qt.BASIC&&this.patchConnectorBasicConfig(this.connectorForm.get("configurationJson").value)}))}observeAttributeChange(){this.attributeUpdateSubject.pipe(de(300),me((e=>this.executeAttributeUpdates(e))),le(this.destroy$)).subscribe()}updateActiveConnectorKeys(e){if(this.activeConnectors.includes(e)){const t=this.activeConnectors.indexOf(e);-1!==t&&this.activeConnectors.splice(t,1),this.inactiveConnectors.push(e)}else{const t=this.inactiveConnectors.indexOf(e);-1!==t&&this.inactiveConnectors.splice(t,1),this.activeConnectors.push(e)}}executeAttributeUpdates(e){oe(this.getAttributeExecutionTasks(e)).pipe(ye(1),me((()=>this.updateData(!0))),le(this.destroy$)).subscribe()}getAttributeExecutionTasks(e){const t=this.activeConnectors.includes(e.key),n=t?D.SERVER_SCOPE:D.SHARED_SCOPE,i=t?D.SHARED_SCOPE:D.SERVER_SCOPE;return[this.attributeService.saveEntityAttributes(this.device,D.SHARED_SCOPE,[{key:"active_connectors",value:this.activeConnectors}]),this.attributeService.saveEntityAttributes(this.device,D.SERVER_SCOPE,[{key:"inactive_connectors",value:this.inactiveConnectors}]),this.attributeService.deleteEntityAttributes(this.device,n,[e]),this.attributeService.saveEntityAttributes(this.device,i,[e])]}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}onErrorsUpdated(){this.cd.detectChanges()}onDataUpdated(){const e=this.ctx.defaultSubscription.data,t=e.find((e=>"active"===e.dataKey.name)).data[0][1],n=e.find((e=>"lastDisconnectTime"===e.dataKey.name)).data[0][1],i=e.find((e=>"lastConnectTime"===e.dataKey.name)).data[0][1];this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}getGatewayStatus(e,t,n){return!!e&&(!n||t>n)}generateSubscription(){if(this.subscription&&this.subscription.unsubscribe(),this.device){const e=[{type:N.entity,entityType:L.DEVICE,entityId:this.device.id,entityName:"Gateway",timeseries:[]}];this.dataSource.data.forEach((t=>{e[0].timeseries.push({name:`${t.key}_ERRORS_COUNT`,label:`${t.key}_ERRORS_COUNT`})})),this.ctx.subscriptionApi.createSubscriptionFromInfo(R.latest,e,this.subscriptionOptions,!1,!0).subscribe((e=>{this.subscription=e}))}}createBasicConfigWatcher(){this.basicConfigSub&&this.basicConfigSub.unsubscribe(),this.basicConfigSub=this.connectorForm.get("basicConfig").valueChanges.pipe(ue((()=>!!this.initialConnector)),le(this.destroy$)).subscribe((e=>{const t=this.connectorForm.get("configurationJson"),n=this.connectorForm.get("type").value,i=this.connectorForm.get("mode").value;if(!Se(e,t?.value)&&this.allowBasicConfig.has(n)&&i===Qt.BASIC){const n={...t.value,...e};this.connectorForm.get("configurationJson").patchValue(n,{emitEvent:!1})}}))}createJsonConfigWatcher(){this.jsonConfigSub&&this.jsonConfigSub.unsubscribe(),this.jsonConfigSub=this.connectorForm.get("configurationJson").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{const t=this.connectorForm.get("basicConfig"),n=this.connectorForm.get("type").value,i=this.connectorForm.get("mode").value;!Se(e,t?.value)&&this.allowBasicConfig.has(n)&&i===Qt.ADVANCED&&this.connectorForm.get("basicConfig").patchValue(e,{emitEvent:!1})}))}confirmConnectorChange(){return this.initialConnector&&this.connectorForm.dirty?this.dialogService.confirm(this.translate.instant("gateway.change-connector-title"),this.translate.instant("gateway.change-connector-text"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0):ae(!0)}setFormValue(e){this.connectorForm.disabled&&this.connectorForm.enable();const t=za.getConfig({configuration:"",key:"auto",configurationJson:{},...e},this.gatewayVersion);this.gatewayVersion&&!t.configVersion&&(t.configVersion=this.gatewayVersion),t.basicConfig=t.configurationJson,this.initialConnector=t,this.updateConnector(t)}updateConnector(e){this.jsonConfigSub?.unsubscribe(),this.allowBasicConfig.has(e.type)?this.updateBasicConfigConnector(e):(this.setInitialConnectorValues(e),this.connectorForm.markAsPristine(),this.createJsonConfigWatcher())}updateBasicConfigConnector(e){this.basicConfigSub?.unsubscribe();const t=this.connectorForm.get("type").value;this.setInitialConnectorValues(e),t!==e.type&&this.allowBasicConfig.has(e.type)&&e.mode!==Qt.ADVANCED?this.basicConfigInitSubject.asObservable().pipe(ye(1)).subscribe((()=>{this.patchConnectorBasicConfig(e.basicConfig)})):this.patchConnectorBasicConfig(e.basicConfig)}patchConnectorBasicConfig(e){this.connectorForm.get("basicConfig").patchValue(e,{emitEvent:!1}),this.connectorForm.markAsPristine(),this.createBasicConfigWatcher(),this.createJsonConfigWatcher()}toggleReportStrategy(e){const t=this.connectorForm.get("reportStrategy"),n=this.connectorForm.get("sendDataOnlyOnChange");this.connectorForm.get("reportStrategy").reset(e.reportStrategy,{emitEvent:!1}),this.withReportStrategy.transform(e.configVersion,e.type)?(t.enable({emitEvent:!1}),n.disable({emitEvent:!1})):(t.disable({emitEvent:!1}),e.type===ct.MQTT&&n.enable({emitEvent:!1}))}setClientData(e){if(this.initialConnector){const t=e.data.find((e=>e.key===this.initialConnector.name));t&&(t.value="string"==typeof t.value?JSON.parse(t.value):t.value,this.isConnectorSynced(t)&&t.value.configurationJson&&this.setFormValue({...t.value,mode:this.connectorForm.get("mode").value??t.value.mode}))}}static{this.ɵfac=function(e){return new(e||L3)(t.ɵɵdirectiveInject(Ye.Store),t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(He.TranslateService),t.ɵɵdirectiveInject(_e.AttributeService),t.ɵɵdirectiveInject(_e.DialogService),t.ɵɵdirectiveInject(qe.MatDialog),t.ɵɵdirectiveInject(_e.TelemetryWebsocketService),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(_e.UtilsService),t.ɵɵdirectiveInject(Ka),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:L3,selectors:[["tb-gateway-connector"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(v,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first)}},inputs:{ctx:"ctx",device:"device"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ot,useClass:N3},Ka]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:42,vars:21,consts:[["generalTabContent",""],["cellActionsMenu","matMenu"],["defaultConfig",""],["legacy",""],[1,"connector-container","tb-form-panel","no-border"],[1,"table-section","tb-form-panel","no-padding","section-container","flex"],[1,"mat-mdc-table-toolbar","justify-between"],["mat-icon-button","","matTooltipPosition","above",3,"disabled","matTooltip","click",4,"ngIf"],[1,"table-container"],["class","mat-headline-5 tb-absolute-fill tb-add-new items-center justify-center",4,"ngIf"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","matSortActive","matSortDirection"],["matColumnDef","enabled","sticky",""],["style","width: 60px;min-width: 60px;",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","key"],["mat-sort-header","","style","width: 40%",4,"matHeaderCellDef"],["matColumnDef","type"],["mat-sort-header","","style","width: 30%",4,"matHeaderCellDef"],["style","text-transform: uppercase",4,"matCellDef"],["matColumnDef","syncStatus"],["matColumnDef","errors"],["matColumnDef","actions","stickyEnd",""],[4,"matHeaderCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",3,"class","click",4,"matRowDef","matRowDefColumns"],[1,"tb-form-panel","section-container","flex",3,"formGroup"],[1,"tb-form-panel-title","tb-flex","no-flex","space-between","align-center"],[1,"tb-form-panel-title"],["class","version-placeholder",4,"ngIf"],["formControlName","mode","appearance","fill",4,"ngIf"],["translate","",1,"no-data-found","items-center","justify-center"],["class","tb-form-panel section-container no-border no-padding tb-flex space-between",4,"ngIf"],["mat-icon-button","","matTooltipPosition","above",3,"click","disabled","matTooltip"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],[2,"width","60px","min-width","60px"],[3,"click","checked"],["mat-sort-header","",2,"width","40%"],["mat-sort-header","",2,"width","30%"],[2,"text-transform","uppercase"],[1,"status"],["matTooltipPosition","above",1,"dot",3,"click","matTooltip"],[1,"gt-md:!hidden",2,"width","48px","min-width","48px","max-width","48px"],[1,"lt-lg:!hidden"],[1,"lt-md:!hidden","flex-row","justify-end"],["mat-icon-button","","matTooltip","RPC","matTooltipPosition","above",3,"click","disabled"],["mat-icon-button","","matTooltip","Logs","matTooltipPosition","above",3,"click"],["mat-icon-button","","matTooltip","Delete connector","matTooltipPosition","above",3,"click"],[1,"gt-sm:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"],[1,"mat-row-select",3,"click"],[1,"version-placeholder"],["formControlName","mode","appearance","fill"],[3,"value"],[1,"tb-form-panel","section-container","no-border","no-padding","tb-flex","space-between"],[4,"ngIf","ngIfElse"],[1,"flex","justify-end"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[3,"ngSwitch"],[4,"ngSwitchCase"],["formControlName","basicConfig",3,"generalTabContent","withReportStrategy","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",3,"initialized","generalTabContent","withReportStrategy"],["formControlName","basicConfig",3,"generalTabContent","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",3,"initialized","generalTabContent"],["class","h-full","formControlName","basicConfig",3,"generalTabContent","withReportStrategy","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",1,"h-full",3,"initialized","generalTabContent","withReportStrategy"],[3,"label"],[3,"ngTemplateOutlet"],["jsonRequired","","formControlName","configurationJson",1,"configuration-json",3,"fillHeight","label"],[1,"tb-form-panel","no-border","no-padding","padding-top","section-container","flex",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","autocomplete","off","name","value","formControlName","name",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row"],["formControlName","enableRemoteLogging",1,"mat-slide"],["translate","",1,"fixed-title-width"],["formControlName","logLevel"],[3,"value",4,"ngFor","ngForOf"],["class","stroked tb-form-panel","formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","class",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",4)(1,"section",5)(2,"mat-toolbar",6)(3,"h2"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(6,H2,5,6,"button",7),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",8),t.ɵɵtemplate(8,W2,7,3,"section",9),t.ɵɵelementStart(9,"table",10),t.ɵɵelementContainerStart(10,11),t.ɵɵtemplate(11,$2,3,3,"mat-header-cell",12)(12,K2,2,1,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(13,14),t.ɵɵtemplate(14,Y2,3,3,"mat-header-cell",15)(15,X2,2,1,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(16,16),t.ɵɵtemplate(17,Z2,3,3,"mat-header-cell",17)(18,Q2,2,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(19,19),t.ɵɵtemplate(20,J2,3,3,"mat-header-cell",17)(21,e3,3,3,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(22,20),t.ɵɵtemplate(23,t3,3,3,"mat-header-cell",17)(24,n3,2,6,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,21),t.ɵɵtemplate(26,i3,5,6,"mat-header-cell",22)(27,a3,26,6,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(28,r3,1,0,"mat-header-row",23)(29,o3,1,4,"mat-row",24),t.ɵɵelementEnd()()(),t.ɵɵelementStart(30,"section",25)(31,"div",26)(32,"div",27),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,s3,2,1,"span",28),t.ɵɵelementEnd(),t.ɵɵtemplate(36,l3,7,8,"tb-toggle-select",29),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"span",30),t.ɵɵtext(38," gateway.select-connector "),t.ɵɵelementEnd(),t.ɵɵtemplate(39,k3,8,6,"section",31),t.ɵɵelementEnd()(),t.ɵɵtemplate(40,B3,30,19,"ng-template",null,0,t.ɵɵtemplateRefExtractor)),2&e&&(t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,17,"gateway.connectors")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==n.dataSource||null==n.dataSource.data?null:n.dataSource.data.length),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",!(null!=n.dataSource&&(null!=n.dataSource.data&&n.dataSource.data.length))),t.ɵɵadvance(),t.ɵɵproperty("dataSource",n.dataSource)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(19),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.connectorForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate2(" ",null!=n.initialConnector&&n.initialConnector.type?n.GatewayConnectorTypesTranslatesMap.get(n.initialConnector.type):""," ",t.ɵɵpipeBind1(34,19,"gateway.configuration")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorForm.get("configVersion").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.initialConnector&&n.allowBasicConfig.has(n.initialConnector.type)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.initialConnector),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.initialConnector))},dependencies:t.ɵɵgetComponentDepsFactory(L3,[j,_,Ka,a$,oX,sX,XY,YY,xQ,bQ,kJ,PJ,Xn,E1,M1,q2,V2]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow-x:auto;padding:0}[_nghost-%COMP%] .version-placeholder[_ngcontent-%COMP%]{color:gray;font-size:12px}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%]{height:100%;width:100%;flex-direction:row}@media screen and (max-width: 1279px){[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%]{flex-direction:column}}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] > section[_ngcontent-%COMP%]:not(.table-section){max-width:unset}@media screen and (min-width: 1280px){[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] > section[_ngcontent-%COMP%]:not(.table-section){max-width:50%}}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .table-section[_ngcontent-%COMP%]{min-height:35vh;overflow:hidden}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .table-section[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .flex[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .input-container[_ngcontent-%COMP%]{height:auto}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .section-container[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{background:transparent;color:#000000de!important}[_nghost-%COMP%] .mat-mdc-slide-toggle[_ngcontent-%COMP%]{margin:0 8px}[_nghost-%COMP%] .status[_ngcontent-%COMP%]{text-align:center;border-radius:16px;font-weight:500;width:fit-content;padding:5px 15px}[_nghost-%COMP%] .status-sync[_ngcontent-%COMP%]{background:#1980380f;color:#198038}[_nghost-%COMP%] .status-unsync[_ngcontent-%COMP%]{background:#cb25300f;color:#cb2530}[_nghost-%COMP%] mat-row[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .dot[_ngcontent-%COMP%]{height:12px;width:12px;background-color:#bbb;border-radius:50%;display:inline-block}[_nghost-%COMP%] .hasErrors[_ngcontent-%COMP%]{background-color:#cb2530}[_nghost-%COMP%] .noErrors[_ngcontent-%COMP%]{background-color:#198038}[_nghost-%COMP%] .connector-container .mat-mdc-tab-group, [_nghost-%COMP%] .connector-container .mat-mdc-tab-body-wrapper{height:100%}[_nghost-%COMP%] .connector-container .mat-mdc-tab-body.mat-mdc-tab-body-active{position:absolute}[_nghost-%COMP%] .connector-container .tb-form-row .fixed-title-width{min-width:120px;width:30%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .connector-container .tb-add-new{display:flex;z-index:999;pointer-events:none;background-color:#fff}[_nghost-%COMP%] .connector-container .tb-add-new button.connector{height:auto;padding-right:12px;font-size:20px;border-style:dashed;border-width:2px;border-radius:8px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;color:#00000061}@media screen and (min-width: 960px){[_nghost-%COMP%] .configuration-json .ace_tooltip{transform:translate(-250px,-120px)}}']})}}e("GatewayConnectorComponent",L3);class V3{constructor(e){this.deviceService=e}download(e){e&&e.stopPropagation(),this.deviceId&&this.deviceService.downloadGatewayDockerComposeFile(this.deviceId).subscribe((()=>{}))}static{this.ɵfac=function(e){return new(e||V3)(t.ɵɵdirectiveInject(_e.DeviceService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:V3,selectors:[["tb-gateway-command"]],inputs:{deviceId:"deviceId"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:32,vars:9,consts:[["mat-dialog-content","",1,"tb-form-panel","no-border",2,"padding","16px 16px 8px"],[1,"tb-no-data-text"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","no-border","no-padding","space-between"],["translate","",1,"tb-no-data-text","tb-commands-hint"],["mat-stroked-button","","color","primary","href","https://docs.docker.com/compose/install/","target","_blank"],["mat-stroked-button","","color","primary",3,"click"],["usePlainMarkdown","","containerClass","start-code","data","\n ```bash\n docker compose up\n {:copy-code}\n ```\n "]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",2)(5,"div",3),t.ɵɵtext(6,"device.connectivity.install-necessary-client-tools"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",4)(8,"div",5),t.ɵɵtext(9,"gateway.install-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"a",6)(11,"mat-icon"),t.ɵɵtext(12,"description"),t.ɵɵelementEnd(),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",2)(16,"div",3),t.ɵɵtext(17,"gateway.download-configuration-file"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",4)(19,"div",5),t.ɵɵtext(20,"gateway.download-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",7),t.ɵɵlistener("click",(function(e){return n.download(e)})),t.ɵɵelementStart(22,"mat-icon"),t.ɵɵtext(23,"download"),t.ɵɵelementEnd(),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(26,"div",2)(27,"div",3),t.ɵɵtext(28,"gateway.launch-gateway"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",5),t.ɵɵtext(30,"gateway.launch-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelement(31,"tb-markdown",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.docker-label")),t.ɵɵadvance(11),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,5,"common.documentation")," "),t.ɵɵadvance(11),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,7,"action.download")," "))},dependencies:t.ɵɵgetComponentDepsFactory(V3,[j,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-commands-hint[_ngcontent-%COMP%]{color:inherit;font-weight:400;flex:1}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper{padding:0}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper pre[class*=language-]{margin:0;background:#f3f6fa;border-color:#305680;padding-right:38px;overflow:scroll;padding-bottom:4px;min-height:42px;scrollbar-width:thin}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper pre[class*=language-]::-webkit-scrollbar{width:4px;height:4px}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn{right:-2px}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn p{color:#305680}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn p, [_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div{background-color:#f3f6fa}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div img{display:none}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div:after{content:"";position:initial;display:block;width:18px;height:18px;background:#305680;mask-image:url(/assets/copy-code-icon.svg);-webkit-mask-image:url(/assets/copy-code-icon.svg);mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat}']})}}var q3,G3,z3;e("DeviceGatewayCommandComponent",V3),e("GatewayBasicConfigTab",q3),function(e){e[e.general=0]="general",e[e.logs=1]="logs",e[e.storage=2]="storage",e[e.grpc=3]="grpc",e[e.statistics=4]="statistics",e[e.other=5]="other"}(q3||e("GatewayBasicConfigTab",q3={})),e("StorageTypes",G3),function(e){e.MEMORY="memory",e.FILE="file",e.SQLITE="sqlite"}(G3||e("StorageTypes",G3={})),e("LocalLogsConfigs",z3),function(e){e.service="service",e.connector="connector",e.converter="converter",e.tb_connection="tb_connection",e.storage="storage",e.extension="extension"}(z3||e("LocalLogsConfigs",z3={}));const U3=e("LocalLogsConfigTranslateMap",new Map([[z3.service,"Service"],[z3.connector,"Connector"],[z3.converter,"Converter"],[z3.tb_connection,"TB Connection"],[z3.storage,"Storage"],[z3.extension,"Extension"]])),j3=e("StorageTypesTranslationMap",new Map([[G3.MEMORY,"gateway.storage-types.memory-storage"],[G3.FILE,"gateway.storage-types.file-storage"],[G3.SQLITE,"gateway.storage-types.sqlite"]]));var H3;e("LogSavingPeriod",H3),function(e){e.days="D",e.hours="H",e.minutes="M",e.seconds="S"}(H3||e("LogSavingPeriod",H3={}));const W3=e("LogSavingPeriodTranslations",new Map([[H3.days,"gateway.logs.days"],[H3.hours,"gateway.logs.hours"],[H3.minutes,"gateway.logs.minutes"],[H3.seconds,"gateway.logs.seconds"]]));var $3;e("SecurityTypes",$3),function(e){e.ACCESS_TOKEN="accessToken",e.USERNAME_PASSWORD="usernamePassword",e.TLS_ACCESS_TOKEN="tlsAccessToken",e.TLS_PRIVATE_KEY="tlsPrivateKey"}($3||e("SecurityTypes",$3={}));const K3=e("SecurityTypesTranslationsMap",new Map([[$3.ACCESS_TOKEN,"gateway.security-types.access-token"],[$3.USERNAME_PASSWORD,"gateway.security-types.username-password"],[$3.TLS_ACCESS_TOKEN,"gateway.security-types.tls-access-token"]])),Y3=e("logsHandlerClass","thingsboard_gateway.tb_utility.tb_rotating_file_handler.TimedRotatingFileHandler"),X3=e("logsLegacyHandlerClass","thingsboard_gateway.tb_utility.tb_handler.TimedRotatingFileHandler");function Z3(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",10),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.storageTypesTranslationMap.get(e))," ")}}function Q3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-required")," "))}function J3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-min")," "))}function e4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-pattern")," "))}function t4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-required")," "))}function n4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-min")," "))}function i4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-pattern")," "))}function a4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",11)(1,"mat-form-field",12)(2,"mat-label",13),t.ɵɵtext(3,"gateway.storage-read-record-count"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",14),t.ɵɵtemplate(5,Q3,3,3,"mat-error",15)(6,J3,3,3,"mat-error",15)(7,e4,3,3,"mat-error",15),t.ɵɵelementStart(8,"mat-icon",16),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",12)(12,"mat-label",13),t.ɵɵtext(13,"gateway.storage-max-records"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",17),t.ɵɵtemplate(15,t4,3,3,"mat-error",15)(16,n4,3,3,"mat-error",15)(17,i4,3,3,"mat-error",15),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,8,"gateway.hints.read-record-count")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,10,"gateway.hints.max-records-count"))}}function r4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-data-folder-path-required")," "))}function o4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-required")," "))}function s4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-min")," "))}function l4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-pattern")," "))}function p4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-required")," "))}function c4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-min")," "))}function d4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-pattern")," "))}function u4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-required")," "))}function m4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-min")," "))}function h4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-pattern")," "))}function g4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section")(1,"div",11)(2,"mat-form-field",12)(3,"mat-label",13),t.ɵɵtext(4,"gateway.storage-data-folder-path"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",18),t.ɵɵtemplate(6,r4,3,3,"mat-error",15),t.ɵɵelementStart(7,"mat-icon",19),t.ɵɵpipe(8,"translate"),t.ɵɵtext(9,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",12)(11,"mat-label",13),t.ɵɵtext(12,"gateway.storage-max-files"),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",20),t.ɵɵtemplate(14,o4,3,3,"mat-error",15)(15,s4,3,3,"mat-error",15)(16,l4,3,3,"mat-error",15),t.ɵɵelementStart(17,"mat-icon",16),t.ɵɵpipe(18,"translate"),t.ɵɵtext(19,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"mat-form-field",12)(22,"mat-label",13),t.ɵɵtext(23,"gateway.storage-max-read-record-count"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",21),t.ɵɵtemplate(25,p4,3,3,"mat-error",15)(26,c4,3,3,"mat-error",15)(27,d4,3,3,"mat-error",15),t.ɵɵelementStart(28,"mat-icon",16),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(31,"mat-form-field",12)(32,"mat-label",13),t.ɵɵtext(33,"gateway.storage-max-records"),t.ɵɵelementEnd(),t.ɵɵelement(34,"input",22),t.ɵɵtemplate(35,u4,3,3,"mat-error",15)(36,m4,3,3,"mat-error",15)(37,h4,3,3,"mat-error",15),t.ɵɵelementStart(38,"mat-icon",16),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"info_outlined "),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_folder_path").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,14,"gateway.hints.data-folder")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,16,"gateway.hints.max-file-count")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(29,18,"gateway.hints.max-read-count")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(39,20,"gateway.hints.max-records"))}}function f4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-path-required")," "))}function y4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-required")," "))}function v4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-min")," "))}function x4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-pattern")," "))}function b4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-required")," "))}function w4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-min")," "))}function S4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-pattern")," "))}function C4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-required")," "))}function _4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-min")," "))}function T4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-pattern")," "))}function I4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section")(1,"div",11)(2,"mat-form-field",12)(3,"mat-label",13),t.ɵɵtext(4,"gateway.storage-path"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",23),t.ɵɵtemplate(6,f4,3,3,"mat-error",15),t.ɵɵelementStart(7,"mat-icon",16),t.ɵɵpipe(8,"translate"),t.ɵɵtext(9,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",12)(11,"mat-label",13),t.ɵɵtext(12,"gateway.messages-ttl-check-in-hours"),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",24),t.ɵɵtemplate(14,y4,3,3,"mat-error",15)(15,v4,3,3,"mat-error",15)(16,x4,3,3,"mat-error",15),t.ɵɵelementStart(17,"mat-icon",16),t.ɵɵpipe(18,"translate"),t.ɵɵtext(19,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"mat-form-field",12)(22,"mat-label",13),t.ɵɵtext(23,"gateway.messages-ttl-in-days"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",25),t.ɵɵtemplate(25,b4,3,3,"mat-error",15)(26,w4,3,3,"mat-error",15)(27,S4,3,3,"mat-error",15),t.ɵɵelementStart(28,"mat-icon",26),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(31,"mat-form-field",12)(32,"mat-label",13),t.ɵɵtext(33,"gateway.storage-max-records"),t.ɵɵelementEnd(),t.ɵɵelement(34,"input",22),t.ɵɵtemplate(35,C4,3,3,"mat-error",15)(36,_4,3,3,"mat-error",15)(37,T4,3,3,"mat-error",15),t.ɵɵelementStart(38,"mat-icon",26),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"info_outlined "),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_file_path").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,14,"gateway.hints.data-folder")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,16,"gateway.hints.ttl-check-hour")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(29,18,"gateway.hints.ttl-messages-day")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(39,20,"gateway.hints.max-records"))}}class E4{constructor(e){this.fb=e,this.initialized=new u,this.StorageTypes=G3,this.storageTypes=Object.values(G3),this.storageTypesTranslationMap=j3,this.onChange=()=>{},this.storageFormGroup=this.initStorageFormGroup(),this.observeStorageTypeChanges(),this.storageFormGroup.valueChanges.pipe(bn()).subscribe((e=>{this.onChange(e)}))}ngAfterViewInit(){this.initialized.emit({storage:this.storageFormGroup.value})}writeValue(e){this.storageFormGroup.patchValue(e,{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.storageFormGroup.valid?null:{storageFormGroup:{valid:!1}}}removeAllStorageValidators(){for(const e in this.storageFormGroup.controls)"type"!==e&&(this.storageFormGroup.controls[e].clearValidators(),this.storageFormGroup.controls[e].setErrors(null),this.storageFormGroup.controls[e].updateValueAndValidity())}initStorageFormGroup(){return this.fb.group({type:[G3.MEMORY,[$.required]],read_records_count:[100,[$.required,$.min(1),$.pattern(nn)]],max_records_count:[1e5,[$.required,$.min(1),$.pattern(nn)]],data_folder_path:["./data/",[$.required]],max_file_count:[10,[$.min(1),$.pattern(nn)]],max_read_records_count:[10,[$.min(1),$.pattern(nn)]],max_records_per_file:[1e4,[$.min(1),$.pattern(nn)]],data_file_path:["./data/data.db",[$.required]],messages_ttl_check_in_hours:[1,[$.min(1),$.pattern(nn)]],messages_ttl_in_days:[7,[$.min(1),$.pattern(nn)]]})}observeStorageTypeChanges(){this.storageFormGroup.get("type").valueChanges.pipe(bn()).subscribe((e=>{switch(this.removeAllStorageValidators(),e){case G3.MEMORY:this.addMemoryStorageValidators(this.storageFormGroup);break;case G3.FILE:this.addFileStorageValidators(this.storageFormGroup);break;case G3.SQLITE:this.addSqliteStorageValidators(this.storageFormGroup)}}))}addMemoryStorageValidators(e){e.get("read_records_count").addValidators([$.required,$.min(1),$.pattern(nn)]),e.get("max_records_count").addValidators([$.required,$.min(1),$.pattern(nn)]),e.get("read_records_count").updateValueAndValidity({emitEvent:!1}),e.get("max_records_count").updateValueAndValidity({emitEvent:!1})}addFileStorageValidators(e){["max_file_count","max_read_records_count","max_records_per_file"].forEach((t=>{e.get(t).addValidators([$.required,$.min(1),$.pattern(nn)]),e.get(t).updateValueAndValidity({emitEvent:!1})}))}addSqliteStorageValidators(e){["messages_ttl_check_in_hours","messages_ttl_in_days","max_records_per_file"].forEach((t=>{e.get(t).addValidators([$.required,$.min(1),$.pattern(nn)]),e.get(t).updateValueAndValidity({emitEvent:!1})}))}static{this.ɵfac=function(e){return new(e||E4)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:E4,selectors:[["tb-gateway-storage-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>E4)),multi:!0},{provide:K,useExisting:c((()=>E4)),multi:!0}]),t.ɵɵStandaloneFeature],decls:15,vars:9,consts:[[1,"mat-content","mat-padding","flex","w-full","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom","w-full"],["translate","",1,"tb-form-panel-title"],["translate","",1,"tb-form-panel-hint"],["formControlName","type",1,"flex"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-panel-hint"],[3,"ngSwitch"],["class","tb-form-row no-border no-padding tb-standard-fields column-xs",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"value"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["type","number","matInput","","formControlName","read_records_count"],[4,"ngIf"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["type","number","matInput","","formControlName","max_records_count"],["matInput","","formControlName","data_folder_path"],["aria-hidden","false","aria-label","help-icon","matSuffix","",1,"mat-form-field-infix","pointer-event","suffix-icon",2,"cursor","pointer",3,"matTooltip"],["matInput","","type","number","formControlName","max_file_count"],["matInput","","type","number","formControlName","max_read_records_count"],["matInput","","type","number","formControlName","max_records_per_file"],["matInput","","formControlName","data_file_path"],["matInput","","type","number","formControlName","messages_ttl_check_in_hours"],["matInput","","type","number","formControlName","messages_ttl_in_days"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.storage"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3),t.ɵɵtext(5,"gateway.hints.storage"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"tb-toggle-select",4),t.ɵɵtemplate(7,Z3,3,4,"tb-toggle-option",5),t.ɵɵelementEnd(),t.ɵɵelementStart(8,"div",6),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(11,7),t.ɵɵtemplate(12,a4,21,12,"section",8)(13,g4,41,22,"section",9)(14,I4,41,22,"section",9),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.storageFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.storageTypes),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,7,"gateway.hints."+n.storageFormGroup.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.storageFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.MEMORY),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.FILE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.SQLITE))},dependencies:t.ɵɵgetComponentDepsFactory(E4,[j,_]),encapsulation:2})}}function M4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-required")," "))}function k4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-min")," "))}function P4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-max")," "))}function D4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-pattern")," "))}function O4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-required")," "))}function A4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-min")," "))}function F4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-pattern")," "))}function R4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-required")," "))}function B4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-min")," "))}function N4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-pattern")," "))}function L4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-required")," "))}function V4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-min")," "))}function q4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-pattern")," "))}function G4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-required")," "))}function z4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-min")," "))}function U4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-pattern")," "))}function j4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-required")," "))}function H4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-min")," "))}function W4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-pattern")," "))}class $4{constructor(e){this.fb=e,this.initialized=new u,this.onChange=()=>{},this.grpcFormGroup=this.initGrpcFormGroup(),this.grpcFormGroup.valueChanges.pipe(bn()).subscribe((e=>{this.onChange(e)})),this.grpcFormGroup.get("enabled").valueChanges.pipe(bn()).subscribe((e=>{this.toggleRpcFields(e)}))}ngAfterViewInit(){this.initialized.emit({grpc:this.grpcFormGroup.value})}writeValue(e){e&&this.toggleRpcFields(e.enabled),this.grpcFormGroup.patchValue(e,{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.grpcFormGroup.valid?null:{grpcFormGroup:{valid:!1}}}toggleRpcFields(e){const t=this.grpcFormGroup;e?(t.get("serverPort").enable({emitEvent:!1}),t.get("keepAliveTimeMs").enable({emitEvent:!1}),t.get("keepAliveTimeoutMs").enable({emitEvent:!1}),t.get("keepalivePermitWithoutCalls").enable({emitEvent:!1}),t.get("maxPingsWithoutData").enable({emitEvent:!1}),t.get("minTimeBetweenPingsMs").enable({emitEvent:!1}),t.get("minPingIntervalWithoutDataMs").enable({emitEvent:!1})):(t.get("serverPort").disable({emitEvent:!1}),t.get("keepAliveTimeMs").disable({emitEvent:!1}),t.get("keepAliveTimeoutMs").disable({emitEvent:!1}),t.get("keepalivePermitWithoutCalls").disable({emitEvent:!1}),t.get("maxPingsWithoutData").disable({emitEvent:!1}),t.get("minTimeBetweenPingsMs").disable({emitEvent:!1}),t.get("minPingIntervalWithoutDataMs").disable({emitEvent:!1}))}initGrpcFormGroup(){return this.fb.group({enabled:[!1],serverPort:[9595,[$.required,$.min(1),$.max(65535),$.pattern(nn)]],keepAliveTimeMs:[1e4,[$.required,$.min(1),$.pattern(nn)]],keepAliveTimeoutMs:[5e3,[$.required,$.min(1),$.pattern(nn)]],keepalivePermitWithoutCalls:[!0],maxPingsWithoutData:[0,[$.required,$.min(0),$.pattern(nn)]],minTimeBetweenPingsMs:[1e4,[$.required,$.min(1),$.pattern(nn)]],minPingIntervalWithoutDataMs:[5e3,[$.required,$.min(1),$.pattern(nn)]]})}static{this.ɵfac=function(e){return new(e||$4)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:$4,selectors:[["tb-gateway-grpc-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>$4)),multi:!0},{provide:K,useExisting:c((()=>$4)),multi:!0}]),t.ɵɵStandaloneFeature],decls:75,vars:47,consts:[[1,"mat-content","mat-padding","flex","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom","w-full"],["color","primary","formControlName","enabled",1,"mat-slide"],[1,"tb-form-row","no-border","no-padding",3,"tb-hint-tooltip-icon"],["color","primary","formControlName","keepalivePermitWithoutCalls",1,"mat-slide"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["matInput","","formControlName","serverPort","type","number","min","0"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],[4,"ngIf"],["matInput","","formControlName","keepAliveTimeoutMs","type","number","min","0"],["matInput","","formControlName","keepAliveTimeMs","type","number","min","0"],["matInput","","formControlName","minTimeBetweenPingsMs","type","number","min","0"],["matInput","","formControlName","maxPingsWithoutData","type","number","min","0"],["matInput","","formControlName","minPingIntervalWithoutDataMs","type","number","min","0"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"mat-slide-toggle",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",3),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"mat-slide-toggle",4),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"section")(11,"section",5)(12,"mat-form-field",6)(13,"mat-label",7),t.ɵɵtext(14,"gateway.server-port"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",8),t.ɵɵelementStart(16,"mat-icon",9),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(19,M4,3,3,"mat-error",10)(20,k4,3,3,"mat-error",10)(21,P4,3,3,"mat-error",10)(22,D4,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",6)(24,"mat-label",7),t.ɵɵtext(25,"gateway.grpc-keep-alive-timeout"),t.ɵɵelementEnd(),t.ɵɵelement(26,"input",11),t.ɵɵelementStart(27,"mat-icon",9),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(30,O4,3,3,"mat-error",10)(31,A4,3,3,"mat-error",10)(32,F4,3,3,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"section",5)(34,"mat-form-field",6)(35,"mat-label",7),t.ɵɵtext(36,"gateway.grpc-keep-alive"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",12),t.ɵɵelementStart(38,"mat-icon",9),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(41,R4,3,3,"mat-error",10)(42,B4,3,3,"mat-error",10)(43,N4,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-form-field",6)(45,"mat-label",7),t.ɵɵtext(46,"gateway.grpc-min-time-between-pings"),t.ɵɵelementEnd(),t.ɵɵelement(47,"input",13),t.ɵɵelementStart(48,"mat-icon",9),t.ɵɵpipe(49,"translate"),t.ɵɵtext(50,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(51,L4,3,3,"mat-error",10)(52,V4,3,3,"mat-error",10)(53,q4,3,3,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(54,"section",5)(55,"mat-form-field",6)(56,"mat-label",7),t.ɵɵtext(57,"gateway.grpc-max-pings-without-data"),t.ɵɵelementEnd(),t.ɵɵelement(58,"input",14),t.ɵɵelementStart(59,"mat-icon",9),t.ɵɵpipe(60,"translate"),t.ɵɵtext(61,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(62,G4,3,3,"mat-error",10)(63,z4,3,3,"mat-error",10)(64,U4,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(65,"mat-form-field",6)(66,"mat-label",7),t.ɵɵtext(67,"gateway.grpc-min-ping-interval-without-data"),t.ɵɵelementEnd(),t.ɵɵelement(68,"input",15),t.ɵɵelementStart(69,"mat-icon",9),t.ɵɵpipe(70,"translate"),t.ɵɵtext(71,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(72,j4,3,3,"mat-error",10)(73,H4,3,3,"mat-error",10)(74,W4,3,3,"mat-error",10),t.ɵɵelementEnd()()()()()),2&e&&(t.ɵɵproperty("formGroup",n.grpcFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,29,"gateway.grpc")," "),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,31,"gateway.hints.permit-without-calls")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,33,"gateway.permit-without-calls")," "),t.ɵɵadvance(8),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,35,"gateway.hints.server-port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("max")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,37,"gateway.hints.grpc-keep-alive-timeout")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("pattern")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(39,39,"gateway.hints.grpc-keep-alive")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(49,41,"gateway.hints.grpc-min-time-between-pings")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("pattern")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(60,43,"gateway.hints.grpc-max-pings-without-data")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,45,"gateway.hints.grpc-min-ping-interval-without-data")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("pattern")))},dependencies:t.ɵɵgetComponentDepsFactory($4,[j,_]),encapsulation:2})}}function K4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.date-format-required")," "))}function Y4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.log-format-required")," "))}function X4(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function Z4(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.localLogsConfigTranslateMap.get(e))}}function Q4(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function J4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.file-path-required")," "))}function e5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.saving-period-required")," "))}function t5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.saving-period-min")," "))}function n5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value)," ")}}function i5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.backup-count-required")," "))}function a5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.backup-count-min")," "))}class r5{constructor(e){this.fb=e,this.initialized=new u,this.logSavingPeriods=W3,this.localLogsConfigs=Object.keys(z3),this.localLogsConfigTranslateMap=U3,this.gatewayLogLevel=Object.values(lt),this.remoteLogLevel=Object.values(lt).filter((e=>e!==lt.NONE)),this.onChange=()=>{},this.logsFormGroup=this.initLogsFormGroup(),this.showRemoteLogsControl=this.fb.control(!1),this.logsFormGroup.valueChanges.pipe(bn()).subscribe((e=>{this.onChange(e)})),this.logSelector=this.fb.control(z3.service);for(const e of Object.keys(z3))this.addLocalLogConfig(e,{});this.showRemoteLogsControl.valueChanges.pipe(bn()).subscribe((e=>this.logsFormGroup.get("logLevel")[e?"enable":"disable"]()))}ngAfterViewInit(){this.initialized.emit({logs:this.logsFormGroup.value})}writeValue(e){this.logsFormGroup.patchValue(e,{emitEvent:!1}),this.updateRemoteLogs(e?.logLevel??lt.NONE)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}getLogFormGroup(e){return this.logsFormGroup.get(`local.${e}`)}validate(){return this.logsFormGroup.valid?null:{logsFormGroup:{valid:!1}}}initLogsFormGroup(){return this.fb.group({dateFormat:["%Y-%m-%d %H:%M:%S",[$.required,$.pattern(/^[^\s].*[^\s]$/)]],logFormat:["%(asctime)s.%(msecs)03d - |%(levelname)s| - [%(filename)s] - %(module)s - %(funcName)s - %(lineno)d - %(message)s",[$.required,$.pattern(/^[^\s].*[^\s]$/)]],type:["remote",[$.required]],logLevel:[{value:lt.INFO,disabled:!0}],local:this.fb.group({})})}addLocalLogConfig(e,t){const n=this.logsFormGroup.get("local"),i=this.fb.group({logLevel:[t.logLevel||lt.INFO,[$.required]],filePath:[t.filePath||"./logs",[$.required]],backupCount:[t.backupCount||7,[$.required,$.min(0)]],savingTime:[t.savingTime||3,[$.required,$.min(0)]],savingPeriod:[t.savingPeriod||H3.days,[$.required]]});n.addControl(e,i,{emitEvent:!1})}updateRemoteLogs(e){const t=e&&e!==lt.NONE;this.showRemoteLogsControl.patchValue(t,{emitEvent:!1}),this.logsFormGroup.get("logLevel")[t?"enable":"disable"]({emitEvent:!1}),this.logsFormGroup.get("logLevel").patchValue(e===lt.NONE?lt.INFO:e,{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||r5)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:r5,selectors:[["tb-gateway-logs-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>r5)),multi:!0},{provide:K,useExisting:c((()=>r5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:72,vars:33,consts:[[1,"mat-content","mat-padding","flex","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom"],[1,"flex","flex-col"],["appearance","outline"],["translate",""],["matInput","","formControlName","dateFormat"],[4,"ngIf"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","logFormat","rows","2"],[1,"tb-form-panel"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],[3,"tb-hint-tooltip-icon"],["formControlName","logLevel"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","local",1,"tb-form-panel","no-padding-bottom"],["translate","",1,"tb-form-panel-title"],[1,"toggle-group",3,"formControl"],["class","first-capital",3,"value",4,"ngFor","ngForOf"],[3,"formGroup"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["matInput","","formControlName","filePath"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","saving-period"],["matInput","","formControlName","savingTime","type","number","min","0"],["appearance","outline","hideRequiredMarker","",2,"min-width","110px","width","30%"],["formControlName","savingPeriod"],["matInput","","formControlName","backupCount","type","number","min","0"],[3,"value"],[1,"first-capital",3,"value"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label",4),t.ɵɵtext(5,"gateway.logs.date-format"),t.ɵɵelementEnd(),t.ɵɵelement(6,"input",5),t.ɵɵtemplate(7,K4,3,3,"mat-error",6),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",3)(12,"mat-label",4),t.ɵɵtext(13,"gateway.logs.log-format"),t.ɵɵelementEnd(),t.ɵɵelement(14,"textarea",8),t.ɵɵtemplate(15,Y4,3,3,"mat-error",6),t.ɵɵelementStart(16,"mat-icon",7),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"info_outlined "),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(19,"div",9)(20,"mat-expansion-panel",10)(21,"mat-expansion-panel-header",11)(22,"mat-panel-title")(23,"mat-slide-toggle",12),t.ɵɵlistener("click",(function(e){return e.stopPropagation()})),t.ɵɵelementStart(24,"mat-label")(25,"div",13),t.ɵɵpipe(26,"translate"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(29,"mat-form-field",3)(30,"mat-label",4),t.ɵɵtext(31,"gateway.logs.level"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-select",14),t.ɵɵtemplate(33,X4,2,2,"mat-option",15),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(34,"div",16)(35,"div",17),t.ɵɵtext(36,"gateway.logs.local"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"tb-toggle-select",18),t.ɵɵtemplate(38,Z4,2,2,"tb-toggle-option",19),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(39,20),t.ɵɵelementStart(40,"div",21)(41,"mat-form-field",22)(42,"mat-label",4),t.ɵɵtext(43,"gateway.logs.level"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-select",14),t.ɵɵtemplate(45,Q4,2,2,"mat-option",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"mat-form-field",22)(47,"mat-label",4),t.ɵɵtext(48,"gateway.logs.file-path"),t.ɵɵelementEnd(),t.ɵɵelement(49,"input",23),t.ɵɵtemplate(50,J4,3,3,"mat-error",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(51,"div",21)(52,"div",24)(53,"mat-form-field",22)(54,"mat-label",4),t.ɵɵtext(55,"gateway.logs.saving-period"),t.ɵɵelementEnd(),t.ɵɵelement(56,"input",25),t.ɵɵtemplate(57,e5,3,3,"mat-error",6)(58,t5,3,3,"mat-error",6),t.ɵɵelementEnd(),t.ɵɵelementStart(59,"mat-form-field",26)(60,"mat-select",27),t.ɵɵtemplate(61,n5,3,4,"mat-option",15),t.ɵɵpipe(62,"keyvalue"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(63,"mat-form-field",22)(64,"mat-label",4),t.ɵɵtext(65,"gateway.logs.backup-count"),t.ɵɵelementEnd(),t.ɵɵelement(66,"input",28),t.ɵɵtemplate(67,i5,3,3,"mat-error",6)(68,a5,3,3,"mat-error",6),t.ɵɵelementStart(69,"mat-icon",7),t.ɵɵpipe(70,"translate"),t.ɵɵtext(71,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.logsFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("dateFormat").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,21,"gateway.hints.date-form")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("logFormat").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,23,"gateway.hints.log-format")),t.ɵɵadvance(4),t.ɵɵproperty("expanded",n.showRemoteLogsControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.showRemoteLogsControl),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(26,25,"gateway.hints.remote-log")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,27,"gateway.logs.remote")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.remoteLogLevel),t.ɵɵadvance(4),t.ɵɵproperty("formControl",n.logSelector),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.localLogsConfigs),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.getLogFormGroup(n.logSelector.value)),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.gatewayLogLevel),t.ɵɵadvance(5),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".filePath").hasError("required")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".savingTime").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".savingTime").hasError("min")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(62,29,n.logSavingPeriods)),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".backupCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".backupCount").hasError("min")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,31,"gateway.hints.backup-count")))},dependencies:t.ɵɵgetComponentDepsFactory(r5,[j,_]),encapsulation:2})}}function o5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.clientId-required")," "))}function s5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-client-id")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("clientId").value)}}function l5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("clientId"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-client-id"))}function p5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.username-required")," "))}function c5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-username")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("username").value)}}function d5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("username"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-user-name"))}function u5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-password")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("password").value)}}function m5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("password"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-password"))}function h5(e,n){1&e&&(t.ɵɵelement(0,"tb-error",14),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("error",t.ɵɵpipeBind1(1,1,"device.client-id-or-user-name-necessary"))}function g5(e,n){1&e&&(t.ɵɵelement(0,"tb-error",14),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("error",t.ɵɵpipeBind1(1,1,"gateway.hints.username-required-with-password"))}class f5{constructor(e){this.fb=e,this.onChange=()=>{},this.initForm(),this.usernameFormGroup.valueChanges.pipe(bn()).subscribe((e=>this.onChange(e)))}writeValue(e){this.usernameFormGroup.patchValue(e,{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){e?this.usernameFormGroup.disable({emitEvent:!1}):this.usernameFormGroup.enable({emitEvent:!1})}validate(){return this.usernameFormGroup.valid?null:{usernameFormGroup:{valid:!1}}}initForm(){this.usernameFormGroup=this.createSecurityFormGroup()}createSecurityFormGroup(){return this.fb.group({clientId:[null,[$.pattern(/^[^.\s]+$/)]],username:[null,[$.pattern(/^[^.\s]+$/)]],password:[null,[$.pattern(/^[^.\s]+$/)]]},{validators:[this.atLeastOneRequired,this.usernameRequired]})}atLeastOneRequired(e){const t=e.get("clientId").value,n=e.get("username").value;return t||n?null:{atLeastOneRequired:!0}}usernameRequired(e){const t=e.get("username").value,n=e.get("password").value;return!t&&n?{usernameRequired:!0}:null}generate(e){this.usernameFormGroup.get(e).patchValue(Re(20))}static{this.ɵfac=function(e){return new(e||f5)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:f5,selectors:[["tb-gateway-username-configuration"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>f5)),multi:!0},{provide:K,useExisting:c((()=>f5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:33,vars:17,consts:[[3,"formGroup"],[1,"xs:flex-col","no-border","no-padding","tb-standard-fields","flex","gap-2"],["appearance","outline",1,"flex","flex-1"],["translate",""],["matInput","","formControlName","clientId"],[4,"ngIf"],["matSuffix","","miniButton","false","tooltipPosition","above","icon","content_copy",3,"copyText","tooltipText"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","username"],["appearance","outline","subscriptSizing","dynamic",2,"width","100%"],["matInput","","formControlName","password"],["class","block",3,"error",4,"ngIf"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"],[1,"block",3,"error"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"section",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label",3),t.ɵɵtext(4,"security.clientId"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",4),t.ɵɵtemplate(6,o5,3,3,"mat-error",5)(7,s5,2,4,"tb-copy-button",6)(8,l5,4,3,"button",7),t.ɵɵelementStart(9,"mat-icon",8),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",2)(13,"mat-label",3),t.ɵɵtext(14,"security.username"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",9),t.ɵɵtemplate(16,p5,3,3,"mat-error",5)(17,c5,2,4,"tb-copy-button",6)(18,d5,4,3,"button",7),t.ɵɵelementStart(19,"mat-icon",8),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"mat-form-field",10)(23,"mat-label",3),t.ɵɵtext(24,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",11),t.ɵɵtemplate(26,u5,2,4,"tb-copy-button",6)(27,m5,4,3,"button",7),t.ɵɵelementStart(28,"mat-icon",8),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵtemplate(31,h5,2,3,"tb-error",12)(32,g5,2,3,"tb-error",12)),2&e&&(t.ɵɵproperty("formGroup",n.usernameFormGroup),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.usernameFormGroup.get("clientId").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(n.usernameFormGroup.get("clientId").value?7:8),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,11,"gateway.hints.client-id")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.usernameFormGroup.get("username").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(n.usernameFormGroup.get("username").value?17:18),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,13,"gateway.hints.username")),t.ɵɵadvance(7),t.ɵɵconditional(n.usernameFormGroup.get("password").value?26:27),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(29,15,"gateway.hints.password")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.usernameFormGroup.hasError("atLeastOneRequired")&&n.usernameFormGroup.touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.usernameFormGroup.hasError("usernameRequired")&&n.usernameFormGroup.touched))},dependencies:t.ɵɵgetComponentDepsFactory(f5,[j,_]),encapsulation:2})}}class y5{constructor(e,t){this.deviceService=e,this.destroyRef=t,this.initialCredentialsSubject=new ie(null)}get initialCredentials(){return this.initialCredentialsSubject.value}get initialCredentials$(){return this.initialCredentialsSubject.asObservable()}updateCredentials(e){let t={};switch(e.type){case $3.USERNAME_PASSWORD:this.shouldUpdateCredentials(e)&&(t=this.generateMqttCredentials(e));break;case $3.ACCESS_TOKEN:case $3.TLS_ACCESS_TOKEN:this.shouldUpdateAccessToken(e)&&(t={credentialsType:U.ACCESS_TOKEN,credentialsId:e.accessToken,credentialsValue:null})}return this.initialCredentialsSubject.next({...this.initialCredentials,...t}),Object.keys(t).length?this.deviceService.saveDeviceCredentials(this.initialCredentials):ae(null)}setInitialCredentials(e){this.deviceService.getDeviceCredentials(e.id).pipe(bn(this.destroyRef)).subscribe((e=>{this.initialCredentialsSubject.next({...e,version:null})}))}shouldUpdateSecurityConfig(e){switch(e.type){case $3.USERNAME_PASSWORD:return this.shouldUpdateCredentials(e);case $3.ACCESS_TOKEN:case $3.TLS_ACCESS_TOKEN:return this.shouldUpdateAccessToken(e)}}credentialsToSecurityConfig(e){const t=e.credentialsType===U.MQTT_BASIC?$3.USERNAME_PASSWORD:$3.ACCESS_TOKEN;if(e.credentialsType!==U.MQTT_BASIC)return{type:t,accessToken:e.credentialsId};if(e.credentialsValue){const{clientId:n,userName:i,password:a}=JSON.parse(e.credentialsValue);return{type:t,clientId:n,username:i,password:a}}}shouldUpdateCredentials(e){if(this.initialCredentials.credentialsType!==U.MQTT_BASIC)return!0;const t=JSON.parse(this.initialCredentials.credentialsValue);return!(t.clientId===e.clientId&&t.userName===e.username&&t.password===e.password)}shouldUpdateAccessToken(e){return this.initialCredentials.credentialsType!==U.ACCESS_TOKEN||this.initialCredentials.credentialsId!==e.accessToken}generateMqttCredentials(e){const{clientId:t,username:n,password:i}=e,a={...t&&{clientId:t},...n&&{userName:n},...i&&{password:i}};return{credentialsType:U.MQTT_BASIC,credentialsValue:JSON.stringify(a)}}static{this.ɵfac=function(e){return new(e||y5)(t.ɵɵinject(_e.DeviceService),t.ɵɵinject(t.DestroyRef))}}static{this.ɵprov=t.ɵɵdefineInjectable({token:y5,factory:y5.ɵfac})}}function v5(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e.value)," ")}}function x5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.access-token-required")," "))}function b5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",13),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"device.copy-access-token")),t.ɵɵproperty("copyText",e.securityFormGroup.get("accessToken").value)}}function w5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",16),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.generateAccessToken())})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-access-token"))}function S5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field",9)(1,"mat-label",10),t.ɵɵtext(2,"security.access-token"),t.ɵɵelementEnd(),t.ɵɵelement(3,"input",11),t.ɵɵtemplate(4,x5,3,3,"mat-error",12)(5,b5,2,4,"tb-copy-button",13)(6,w5,4,3,"button",14),t.ɵɵelementStart(7,"mat-icon",15),t.ɵɵpipe(8,"translate"),t.ɵɵtext(9,"info_outlined "),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵproperty("ngIf",e.securityFormGroup.get("accessToken").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(e.securityFormGroup.get("accessToken").value?5:6),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,3,"gateway.hints.token"))}}function C5(e,n){1&e&&(t.ɵɵelement(0,"tb-file-input",17),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"translate"),t.ɵɵpipe(3,"translate")),2&e&&(t.ɵɵpropertyInterpolate("hint",t.ɵɵpipeBind1(1,5,"gateway.hints.ca-cert")),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,7,"security.ca-cert")),t.ɵɵpropertyInterpolate("dropLabel",t.ɵɵpipeBind1(3,9,"gateway.drop-file")),t.ɵɵproperty("allowedExtensions","pem,cert,key")("accept",".pem, application/pem,.cert, application/cert, .key,application/key"))}class _5{constructor(e,t,n){this.fb=e,this.cd=t,this.gatewayCredentialsService=n,this.initialized=new u,this.securityTypes=K3,this.onChange=()=>{},this.securityFormGroup=this.createSecurityFormGroup(),this.setupFormListeners()}ngAfterViewInit(){const{usernamePassword:e,...t}=this.securityFormGroup.value;this.initialized.emit({thingsboard:{security:e?{...t,...e}:t}})}writeValue(e){e?this.updateFormBySecurityConfig(e):this.updateFormBySecurityConfig(this.gatewayCredentialsService.credentialsToSecurityConfig(this.gatewayCredentialsService.initialCredentials))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.securityFormGroup.valid?null:{securityFormGroup:{valid:!1}}}updateFormBySecurityConfig(e){const{clientId:t,username:n,password:i,...a}=e??{};a?.type===$3.USERNAME_PASSWORD?this.securityFormGroup.patchValue({...a,usernamePassword:{clientId:t,username:n,password:i}},{emitEvent:!1}):this.securityFormGroup.patchValue(a,{emitEvent:!1}),this.toggleBySecurityType(this.securityFormGroup.get("type").value)}createSecurityFormGroup(){return this.fb.group({type:[$3.ACCESS_TOKEN,[$.required]],accessToken:[null,[$.required,$.pattern(/^[^.\s]+$/)]],caCert:[null,[$.required]],usernamePassword:[]})}setupFormListeners(){this.securityFormGroup.valueChanges.pipe(bn()).subscribe((({usernamePassword:e,...t})=>{this.onChange(e?{...t,...e}:t)})),this.securityFormGroup.get("type").valueChanges.pipe(bn()).subscribe((e=>{this.toggleBySecurityType(e)})),this.securityFormGroup.get("caCert").valueChanges.pipe(bn()).subscribe((()=>this.cd.detectChanges()))}toggleBySecurityType(e){switch(this.securityFormGroup.disable({emitEvent:!1}),this.securityFormGroup.get("type").enable({emitEvent:!1}),e){case $3.ACCESS_TOKEN:this.securityFormGroup.get("accessToken").enable({emitEvent:!1});break;case $3.TLS_PRIVATE_KEY:this.securityFormGroup.get("caCert").enable({emitEvent:!1});break;case $3.TLS_ACCESS_TOKEN:this.securityFormGroup.get("accessToken").enable({emitEvent:!1}),this.securityFormGroup.get("caCert").enable({emitEvent:!1});break;case $3.USERNAME_PASSWORD:this.securityFormGroup.get("usernamePassword").enable({emitEvent:!1})}}generateAccessToken(){this.securityFormGroup.get("accessToken").patchValue(Re(20))}static{this.ɵfac=function(e){return new(e||_5)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(y5))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:_5,selectors:[["tb-gateway-security-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>_5)),multi:!0},{provide:K,useExisting:c((()=>_5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:10,vars:8,consts:[[1,"tb-form-panel"],["translate","",1,"tb-form-panel-title"],[3,"formGroup"],["formControlName","type",1,"toggle-group","flex"],[3,"value",4,"ngFor","ngForOf"],["appearance","outline",4,"ngIf"],["formControlName","usernamePassword"],["formControlName","caCert",3,"hint","label","allowedExtensions","accept","dropLabel",4,"ngIf"],[3,"value"],["appearance","outline"],["translate",""],["matInput","","formControlName","accessToken"],[4,"ngIf"],["matSuffix","","miniButton","false","tooltipPosition","above","icon","content_copy",3,"copyText","tooltipText"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"],["formControlName","caCert",3,"hint","label","allowedExtensions","accept","dropLabel"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2,"security.security"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(3,2),t.ɵɵelementStart(4,"tb-toggle-select",3),t.ɵɵtemplate(5,v5,3,4,"tb-toggle-option",4),t.ɵɵpipe(6,"keyvalue"),t.ɵɵelementEnd(),t.ɵɵtemplate(7,S5,10,5,"mat-form-field",5),t.ɵɵelement(8,"tb-gateway-username-configuration",6),t.ɵɵtemplate(9,C5,4,11,"tb-file-input",7),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(3),t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(6,6,n.securityTypes)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value.toLowerCase().includes("accesstoken")),t.ɵɵadvance(),t.ɵɵclassProp("hidden","usernamePassword"!==n.securityFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value.toLowerCase().includes("tls")))},dependencies:t.ɵɵgetComponentDepsFactory(_5,[j,_,f5]),encapsulation:2})}}const T5=["configGroup"];function I5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-host-required")))}function E5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-required")))}function M5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-min")))}function k5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-max")))}function P5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-pattern")))}function D5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-security-configuration",20),t.ɵɵlistener("initialized",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext(2);return t.ɵɵresetView(i.onInitialized(n))})),t.ɵɵelementEnd()}}function O5(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",21),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Gateway)}}function A5(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",7)(1,"div",8)(2,"div",9),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"mat-slide-toggle",10),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",9),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-slide-toggle",11),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"div",12)(13,"mat-form-field",13)(14,"mat-label",14),t.ɵɵtext(15,"gateway.thingsboard-host"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",15),t.ɵɵelementStart(17,"mat-icon",16),t.ɵɵpipe(18,"translate"),t.ɵɵtext(19,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(20,I5,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",13)(22,"mat-label",14),t.ɵɵtext(23,"gateway.thingsboard-port"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",17),t.ɵɵtemplate(25,E5,3,3,"mat-error")(26,M5,3,3,"mat-error")(27,k5,3,3,"mat-error")(28,P5,3,3,"mat-error"),t.ɵɵelementStart(29,"mat-icon",16),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31,"info_outlined "),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(32,D5,1,0,"tb-gateway-security-configuration",18),t.ɵɵpipe(33,"async"),t.ɵɵtemplate(34,O5,1,1,"tb-report-strategy",19),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.remote-configuration")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,12,"gateway.remote-configuration")," "),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(8,14,"gateway.hints.remote-shell")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,16,"gateway.remote-shell")," "),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,18,"gateway.hints.host")),t.ɵɵadvance(3),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.host").hasError("required")?20:-1),t.ɵɵadvance(5),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.port").hasError("required")?25:e.basicFormGroup.get("thingsboard.port").hasError("min")?26:e.basicFormGroup.get("thingsboard.port").hasError("max")?27:e.basicFormGroup.get("thingsboard.port").hasError("pattern")?28:-1),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(30,20,"gateway.hints.port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",t.ɵɵpipeBind1(33,22,e.initialCredentials$)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.withReportStrategy)}}function F5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-slide-toggle",23)(1,"mat-label",33),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"mat-slide-toggle",34)(6,"mat-label",33),t.ɵɵpipe(7,"translate"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,4,"gateway.hints.enable-general-statistics")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,6,"gateway.statistics.general-statistics")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(7,8,"gateway.hints.enable-custom-statistics")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,"gateway.statistics.custom-statistics")," "))}function R5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-slide-toggle",23),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.statistics")," "))}function B5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-required")))}function N5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-min")))}function L5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-pattern")))}function V5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-required")))}function q5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-min")))}function G5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-pattern")))}function z5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-required")))}function U5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-pattern")," "))}function j5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-already-exists")))}function H5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-required")))}function W5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")))}function $5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-pattern")))}function K5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.command-required")))}function Y5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.command-pattern")))}function X5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",35)(1,"section",36)(2,"section",37)(3,"mat-form-field",38)(4,"mat-label",14),t.ɵɵtext(5,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(6,"input",39),t.ɵɵtemplate(7,z5,3,3,"mat-error")(8,U5,3,3,"mat-error")(9,j5,3,3,"mat-error"),t.ɵɵelementStart(10,"mat-icon",16),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(13,"mat-form-field",38)(14,"mat-label",14),t.ɵɵtext(15,"gateway.statistics.timeout"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",40),t.ɵɵtemplate(17,H5,3,3,"mat-error")(18,W5,3,3,"mat-error")(19,$5,3,3,"mat-error"),t.ɵɵelementStart(20,"mat-icon",16),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(23,"section")(24,"mat-form-field",41)(25,"mat-label",14),t.ɵɵtext(26,"gateway.statistics.command"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",42),t.ɵɵtemplate(28,K5,3,3,"mat-error")(29,Y5,3,3,"mat-error"),t.ɵɵelementStart(30,"mat-icon",16),t.ɵɵpipe(31,"translate"),t.ɵɵtext(32,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(33,"section")(34,"mat-expansion-panel",43)(35,"mat-expansion-panel-header")(36,"mat-panel-title")(37,"div",28),t.ɵɵtext(38,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(39,"mat-form-field",38)(40,"mat-label",14),t.ɵɵtext(41,"gateway.statistics.install-cmd"),t.ɵɵelementEnd(),t.ɵɵelement(42,"input",44),t.ɵɵelementStart(43,"mat-icon",45),t.ɵɵpipe(44,"translate"),t.ɵɵtext(45,"info_outlined "),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(46,"button",46),t.ɵɵpipe(47,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.removeCommandControl(i,n))})),t.ɵɵelementStart(48,"mat-icon"),t.ɵɵtext(49,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.index,a=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("formGroupName",i),t.ɵɵadvance(6),t.ɵɵconditional(e.get("attributeOnGateway").hasError("required")?7:e.get("attributeOnGateway").hasError("pattern")?8:e.get("attributeOnGateway").hasError("duplicateName")?9:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,10,"gateway.hints.attribute")),t.ɵɵadvance(7),t.ɵɵconditional(e.get("timeout").hasError("required")?17:e.get("timeout").hasError("min")?18:e.get("timeout").hasError("pattern")?19:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(21,12,"gateway.hints.timeout")),t.ɵɵadvance(8),t.ɵɵconditional(e.get("command").hasError("required")?28:e.get("command").hasError("pattern")?29:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(31,14,"gateway.hints.command")),t.ɵɵadvance(13),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(44,16,"gateway.hints.install-cmd")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(47,18,"gateway.statistics.remove")),t.ɵɵproperty("disabled",!a.basicFormGroup.get("thingsboard.remoteConfiguration").value)}}function Z5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",22),t.ɵɵtemplate(2,F5,10,12)(3,R5,3,3,"mat-slide-toggle",23),t.ɵɵelementStart(4,"mat-form-field",24)(5,"mat-label",14),t.ɵɵtext(6,"gateway.statistics.send-period"),t.ɵɵelementEnd(),t.ɵɵelement(7,"input",25),t.ɵɵtemplate(8,B5,3,3,"mat-error")(9,N5,3,3,"mat-error")(10,L5,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",24)(12,"mat-label",14),t.ɵɵtext(13,"gateway.statistics.custom-send-period"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",26),t.ɵɵtemplate(15,V5,3,3,"mat-error")(16,q5,3,3,"mat-error")(17,G5,3,3,"mat-error"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",27)(19,"div",28),t.ɵɵtext(20,"gateway.statistics.commands"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",29),t.ɵɵtext(22,"gateway.hints.commands"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(23,30),t.ɵɵtemplate(24,X5,50,20,"div",31),t.ɵɵelementStart(25,"button",32),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.addCommand())})),t.ɵɵtext(26),t.ɵɵpipe(27,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵconditional(e.hasUpdatedStatistics?2:3),t.ɵɵadvance(6),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("required")?8:e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("min")?9:e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("pattern")?10:-1),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("required")?15:e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("min")?16:e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("pattern")?17:-1),t.ɵɵadvance(9),t.ɵɵproperty("ngForOf",e.commandFormArray().controls),t.ɵɵadvance(),t.ɵɵproperty("disabled",!e.basicFormGroup.get("thingsboard.remoteConfiguration").value),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(27,6,"gateway.statistics.add")," ")}}function Q5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-required")))}function J5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-min")))}function e6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-pattern")))}function t6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-required")))}function n6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-min")))}function i6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-pattern")))}function a6(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",37)(1,"mat-form-field",38)(2,"mat-label",14),t.ɵɵtext(3,"gateway.inactivity-timeout-seconds"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",56),t.ɵɵtemplate(5,Q5,3,3,"mat-error")(6,J5,3,3,"mat-error")(7,e6,3,3,"mat-error"),t.ɵɵelementStart(8,"mat-icon",16),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",38)(12,"mat-label",14),t.ɵɵtext(13,"gateway.inactivity-check-period-seconds"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",57),t.ɵɵtemplate(15,t6,3,3,"mat-error")(16,n6,3,3,"mat-error")(17,i6,3,3,"mat-error"),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("required")?5:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("min")?6:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("pattern")?7:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,4,"gateway.hints.inactivity-timeout")),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("required")?15:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("min")?16:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("pattern")?17:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,6,"gateway.hints.inactivity-period"))}}function r6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-required")))}function o6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-min")))}function s6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-pattern")))}function l6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-required")))}function p6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-range")))}function c6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-range")))}function d6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-required")))}function u6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-min")))}function m6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-pattern")))}function h6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-required")))}function g6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-min")))}function f6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-pattern")))}function y6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-required")))}function v6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-min")))}function x6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-pattern")))}function b6(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",7)(1,"div",47)(2,"div",9),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"mat-slide-toggle",48),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(7,a6,21,8,"section",49),t.ɵɵelementEnd(),t.ɵɵelementStart(8,"div",8)(9,"div",28),t.ɵɵtext(10,"gateway.advanced"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"section",37)(12,"mat-form-field",38)(13,"mat-label",14),t.ɵɵtext(14,"gateway.min-pack-send-delay"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",50),t.ɵɵtemplate(16,r6,3,3,"mat-error")(17,o6,3,3,"mat-error")(18,s6,3,3,"mat-error"),t.ɵɵelementStart(19,"mat-icon",16),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"mat-form-field",38)(23,"mat-label",14),t.ɵɵtext(24,"gateway.mqtt-qos"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-select",51)(26,"mat-option",52),t.ɵɵtext(27,"0"),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-option",52),t.ɵɵtext(29,"1"),t.ɵɵelementEnd()(),t.ɵɵtemplate(30,l6,3,3,"mat-error")(31,p6,3,3,"mat-error")(32,c6,3,3,"mat-error"),t.ɵɵelementStart(33,"mat-icon",16),t.ɵɵpipe(34,"translate"),t.ɵɵtext(35,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(36,"section",37)(37,"mat-form-field",38)(38,"mat-label",14),t.ɵɵtext(39,"gateway.statistics.check-connectors-configuration"),t.ɵɵelementEnd(),t.ɵɵelement(40,"input",53),t.ɵɵtemplate(41,d6,3,3,"mat-error")(42,u6,3,3,"mat-error")(43,m6,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-form-field",38)(45,"mat-label",14),t.ɵɵtext(46,"gateway.statistics.max-payload-size-bytes"),t.ɵɵelementEnd(),t.ɵɵelement(47,"input",54),t.ɵɵtemplate(48,h6,3,3,"mat-error")(49,g6,3,3,"mat-error")(50,f6,3,3,"mat-error"),t.ɵɵelementStart(51,"mat-icon",16),t.ɵɵpipe(52,"translate"),t.ɵɵtext(53,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(54,"section",37)(55,"mat-form-field",38)(56,"mat-label",14),t.ɵɵtext(57,"gateway.statistics.min-pack-size-to-send"),t.ɵɵelementEnd(),t.ɵɵelement(58,"input",55),t.ɵɵtemplate(59,y6,3,3,"mat-error")(60,v6,3,3,"mat-error")(61,x6,3,3,"mat-error"),t.ɵɵelementStart(62,"mat-icon",16),t.ɵɵpipe(63,"translate"),t.ɵɵtext(64,"info_outlined "),t.ɵɵelementEnd()()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassProp("no-padding-bottom",e.basicFormGroup.get("thingsboard.checkingDeviceActivity.checkDeviceInactivity").value),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,16,"gateway.hints.check-device-activity")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,18,"gateway.checking-device-activity")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.basicFormGroup.get("thingsboard.checkingDeviceActivity.checkDeviceInactivity").value),t.ɵɵadvance(9),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("required")?16:e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("min")?17:e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("pattern")?18:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,20,"gateway.hints.minimal-pack-delay")),t.ɵɵadvance(7),t.ɵɵproperty("value",0),t.ɵɵadvance(2),t.ɵɵproperty("value",1),t.ɵɵadvance(2),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.qos").hasError("required")?30:e.basicFormGroup.get("thingsboard.qos").hasError("min")?31:e.basicFormGroup.get("thingsboard.qos").hasError("max")?32:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(34,22,"gateway.hints.qos")),t.ɵɵadvance(8),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("required")?41:e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("min")?42:e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("pattern")?43:-1),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("required")?48:e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("min")?49:e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("pattern")?50:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(52,24,"gateway.hints.max-payload-size-bytes")),t.ɵɵadvance(8),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("required")?59:e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("min")?60:e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("pattern")?61:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(63,26,"gateway.hints.min-pack-size-to-send"))}}class w6{constructor(e,t,n,i,a){this.fb=e,this.deviceService=t,this.gatewayCredentialsService=n,this.destroyRef=i,this.dialog=a,this.gatewayVersion=pt.Legacy,this.dialogMode=!1,this.withReportStrategy=!1,this.initialized=new u,this.ReportStrategyDefaultValue=en,this.initialCredentials$=this.gatewayCredentialsService.initialCredentials$,this.onChange=()=>{},this.destroy$=new te,this.initBasicFormGroup(),this.observeFormChanges(),this.basicFormGroup.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e)}))}ngOnChanges(e){e.withReportStrategy&&!e.withReportStrategy.firstChange&&this.withReportStrategy&&this.basicFormGroup.get("thingsboard.reportStrategy").enable({emitEvent:!1}),e.gatewayVersion?.previousValue!==e.gatewayVersion.currentValue&&this.onVersionChange()}ngAfterViewInit(){this.defaultTab&&(this.configGroup.selectedIndex=q3[this.defaultTab])}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.basicFormGroup.patchValue(e,{emitEvent:!1});const t=e?.thingsboard?.statistics?.commands??[];this.commandFormArray().clear({emitEvent:!1}),t.forEach((e=>this.addCommand(e,!1)))}validate(){return this.basicFormGroup.valid?null:{basicFormGroup:{valid:!1}}}commandFormArray(){return this.basicFormGroup.get("thingsboard.statistics.commands")}removeCommandControl(e,t){""!==t.pointerType&&(this.commandFormArray().removeAt(e),this.basicFormGroup.markAsDirty())}openConfigurationConfirmDialog(){this.deviceService.getDevice(this.device.id).pipe(le(this.destroy$)).subscribe((e=>{this.dialog.open(pW,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{gatewayName:e.name}}).afterClosed().pipe(ye(1)).subscribe((e=>{e||this.basicFormGroup.get("thingsboard.remoteConfiguration").setValue(!0,{emitEvent:!1})}))}))}addCommand(e,t=!0){const{attributeOnGateway:n=null,command:i=null,timeout:a=10,installCmd:r=""}=e||{},o=this.fb.group({attributeOnGateway:[n,[$.required,$.pattern(an),this.uniqNameRequired()]],command:[i,[$.required,$.pattern(/^(?=\S).*\S$/)]],timeout:[a,[$.required,$.min(1),$.pattern(nn),$.pattern(/^[^.\s]+$/)]],installCmd:[r,$.pattern(an)]});this.commandFormArray().push(o,{emitEvent:t})}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase(),n=e.dirty&&t&&this.commandFormArray().value.some((e=>e.attributeOnGateway?.toLowerCase()===t));return n?{duplicateName:{valid:!1}}:null}}onInitialized(e){this.basicFormGroup.patchValue(e,{emitEvent:!1}),this.initialized.emit(this.basicFormGroup.value)}initBasicFormGroup(){this.basicFormGroup=this.fb.group({thingsboard:this.initThingsboardFormGroup(),storage:[],grpc:[],connectors:this.fb.array([]),logs:[]})}initThingsboardFormGroup(){return this.fb.group({host:[window.location.hostname,[$.required,$.pattern(/^[^\s]+$/)]],port:[1883,[$.required,$.min(1),$.max(65535),$.pattern(nn)]],remoteShell:[!1],remoteConfiguration:[!0],checkConnectorsConfigurationInSeconds:[60,[$.required,$.min(1),$.pattern(nn)]],statistics:this.fb.group({enable:[!0],enableCustom:[{value:!1,disabled:!0}],statsSendPeriodInSeconds:[3600,[$.required,$.min(60),$.pattern(nn)]],customStatsSendPeriodInSeconds:[3600,[$.required,$.min(60),$.pattern(nn)]],commands:this.fb.array([])}),maxPayloadSizeBytes:[8196,[$.required,$.min(100),$.pattern(nn)]],minPackSendDelayMS:[50,[$.required,$.min(10),$.pattern(nn)]],minPackSizeToSend:[500,[$.required,$.min(100),$.pattern(nn)]],handleDeviceRenaming:[!0],checkingDeviceActivity:this.initCheckingDeviceActivityFormGroup(),security:[],qos:[1],reportStrategy:[{value:{type:Jt.OnReceived},disabled:!0}]})}initCheckingDeviceActivityFormGroup(){return this.fb.group({checkDeviceInactivity:[!1],inactivityTimeoutSeconds:[300,[$.min(1),$.pattern(nn)]],inactivityCheckPeriodSeconds:[10,[$.min(1),$.pattern(nn)]]})}onVersionChange(){if(this.hasUpdatedStatistics=za.parseVersion(this.gatewayVersion)>=za.parseVersion(pt.v3_7_3),this.hasUpdatedStatistics){const e=this.basicFormGroup.get("thingsboard.statistics.enableCustom");e.enable({emitEvent:!1}),this.basicFormGroup.get("thingsboard.statistics.enable").valueChanges.pipe(bn(this.destroyRef)).subscribe((t=>{t||e.patchValue(!1,{emitEvent:!1}),e[t?"enable":"disable"]({emitEvent:!1})}))}}observeFormChanges(){this.observeRemoteConfigurationChanges(),this.observeDeviceActivityChanges()}observeRemoteConfigurationChanges(){this.basicFormGroup.get("thingsboard.remoteConfiguration").valueChanges.pipe(le(this.destroy$)).subscribe((e=>{e||this.openConfigurationConfirmDialog()}))}observeDeviceActivityChanges(){const e=this.basicFormGroup.get("thingsboard.checkingDeviceActivity");e.get("checkDeviceInactivity").valueChanges.pipe(le(this.destroy$)).subscribe((t=>{e.updateValueAndValidity();const n=[$.min(1),$.required,$.pattern(nn)];t?(e.get("inactivityTimeoutSeconds").setValidators(n),e.get("inactivityCheckPeriodSeconds").setValidators(n)):(e.get("inactivityTimeoutSeconds").clearValidators(),e.get("inactivityCheckPeriodSeconds").clearValidators()),e.get("inactivityTimeoutSeconds").updateValueAndValidity({emitEvent:!1}),e.get("inactivityCheckPeriodSeconds").updateValueAndValidity({emitEvent:!1})}))}static{this.ɵfac=function(e){return new(e||w6)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(_e.DeviceService),t.ɵɵdirectiveInject(y5),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(qe.MatDialog))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:w6,selectors:[["tb-gateway-basic-configuration"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(T5,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.configGroup=e.first)}},inputs:{device:"device",defaultTab:"defaultTab",gatewayVersion:"gatewayVersion",dialogMode:"dialogMode",withReportStrategy:"withReportStrategy"},outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>w6)),multi:!0},{provide:K,useExisting:c((()=>w6)),multi:!0}]),t.ɵɵNgOnChangesFeature,t.ɵɵStandaloneFeature],decls:20,vars:21,consts:[["configGroup",""],[1,"tab-group-block",3,"formGroup"],[3,"label"],["matTabContent",""],["formControlName","logs",1,"configuration-block",3,"initialized"],["formControlName","storage",3,"initialized"],["formControlName","grpc",3,"initialized"],["formGroupName","thingsboard",1,"mat-content","mat-padding","configuration-block"],[1,"tb-form-panel","no-padding-bottom"],[1,"tb-form-row","no-border","no-padding",3,"tb-hint-tooltip-icon"],["color","primary","formControlName","remoteConfiguration",1,"mat-slide"],["color","primary","formControlName","remoteShell",1,"mat-slide"],[1,"no-border","no-padding","tb-standard-fields","xs:flex-col","flex","gap-2"],["appearance","outline",1,"flex","flex-1"],["translate",""],["matInput","","formControlName","host"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","port","type","number","min","0"],["formControlName","security",3,"initialized",4,"ngIf"],["class","tb-form-panel","formControlName","reportStrategy",3,"defaultValue",4,"ngIf"],["formControlName","security",3,"initialized"],["formControlName","reportStrategy",1,"tb-form-panel",3,"defaultValue"],["formGroupName","statistics",1,"tb-form-panel","no-padding-bottom"],["color","primary","formControlName","enable",1,"mat-slide"],["appearance","outline"],["matInput","","formControlName","statsSendPeriodInSeconds","type","number","min","60"],["matInput","","formControlName","customStatsSendPeriodInSeconds","type","number","min","60"],[1,"tb-form-panel"],["translate","",1,"tb-form-panel-title"],["translate","",1,"tb-form-panel-hint"],["formGroupName","statistics"],["formArrayName","commands","class","statistics-container flex flex-row",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button",2,"width","fit-content",3,"click","disabled"],[3,"tb-hint-tooltip-icon"],["color","primary","formControlName","enableCustom",1,"mat-slide"],["formArrayName","commands",1,"statistics-container","flex","flex-row"],[1,"tb-form-panel","stroked","no-padding-bottom","no-gap","command-container",3,"formGroupName"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["matInput","","formControlName","attributeOnGateway"],["matInput","","formControlName","timeout","type","number","min","0"],["appearance","outline",1,"mat-block"],["matInput","","formControlName","command"],[1,"tb-settings","pb-4"],["matInput","","formControlName","installCmd"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"],["mat-icon-button","","matTooltipPosition","above",1,"tb-box-button",3,"click","disabled","matTooltip"],["formGroupName","checkingDeviceActivity",1,"tb-form-panel"],["color","primary","formControlName","checkDeviceInactivity",1,"mat-slide"],["class","tb-form-row no-border no-padding tb-standard-fields column-xs",4,"ngIf"],["matInput","","formControlName","minPackSendDelayMS","type","number","min","0"],["formControlName","qos"],[3,"value"],["matInput","","formControlName","checkConnectorsConfigurationInSeconds","type","number","min","0"],["matInput","","formControlName","maxPayloadSizeBytes","type","number","min","0"],["matInput","","formControlName","minPackSizeToSend","type","number","min","0"],["matInput","","formControlName","inactivityTimeoutSeconds","type","number","min","0"],["matInput","","type","number","min","0","formControlName","inactivityCheckPeriodSeconds"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-tab-group",1,0)(2,"mat-tab",2),t.ɵɵpipe(3,"translate"),t.ɵɵtemplate(4,A5,35,24,"ng-template",3),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-tab",2),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"tb-gateway-logs-configuration",4),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"mat-tab",2),t.ɵɵpipe(9,"translate"),t.ɵɵelementStart(10,"tb-gateway-storage-configuration",5),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",2),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"tb-gateway-grpc-configuration",6),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-tab",2),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,Z5,28,8,"ng-template",3),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-tab",2),t.ɵɵpipe(18,"translate"),t.ɵɵtemplate(19,b6,65,28,"ng-template",3),t.ɵɵelementEnd()()}2&e&&(t.ɵɵclassProp("dialog-mode",n.dialogMode),t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(3,9,"gateway.general")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(6,11,"gateway.logs.logs")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(9,13,"gateway.storage")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,15,"gateway.grpc")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(15,17,"gateway.statistics.statistics")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(18,19,"gateway.other")))},dependencies:t.ɵɵgetComponentDepsFactory(w6,[j,_,Xn,E4,$4,r5,_5]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:grid;grid-template-rows:min-content minmax(auto,1fr) min-content}[_nghost-%COMP%] .configuration-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{grid-row:1;background:transparent;color:#000000de!important}[_nghost-%COMP%] .tab-group-block[_ngcontent-%COMP%]{min-width:0;height:100%;min-height:0;grid-row:2}[_nghost-%COMP%] .toggle-group[_ngcontent-%COMP%]{margin-right:auto}[_nghost-%COMP%] .first-capital[_ngcontent-%COMP%]{text-transform:capitalize}[_nghost-%COMP%] textarea[_ngcontent-%COMP%]{resize:none}[_nghost-%COMP%] .saving-period[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .statistics-container[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .statistics-container[_ngcontent-%COMP%] .command-container[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] mat-form-field[_ngcontent-%COMP%] mat-error[_ngcontent-%COMP%]{display:none!important}[_nghost-%COMP%] mat-form-field[_ngcontent-%COMP%] mat-error[_ngcontent-%COMP%]:first-child{display:block!important}[_nghost-%COMP%] .pointer-event{pointer-events:all}[_nghost-%COMP%] .toggle-group span{padding:0 25px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{color:#e0e0e0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix:hover{color:#9e9e9e}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex;align-items:center}']})}}e("GatewayBasicConfigurationComponent",w6),Ge([I()],w6.prototype,"dialogMode",void 0),Ge([I()],w6.prototype,"withReportStrategy",void 0);class S6{constructor(e){this.fb=e,this.destroy$=new te,this.advancedFormControl=this.fb.control(""),this.advancedFormControl.valueChanges.pipe(le(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.advancedFormControl.reset(e,{emitEvent:!1})}validate(){return this.advancedFormControl.valid?null:{advancedFormControl:{valid:!1}}}static{this.ɵfac=function(e){return new(e||S6)(t.ɵɵdirectiveInject(H.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:S6,selectors:[["tb-gateway-advanced-configuration"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:W,useExisting:c((()=>S6)),multi:!0},{provide:K,useExisting:c((()=>S6)),multi:!0}]),t.ɵɵStandaloneFeature],decls:2,vars:4,consts:[["fillHeight","true","jsonRequired","",1,"flex","h-full","flex-col","p-2",3,"label","formControl"]],template:function(e,n){1&e&&(t.ɵɵelement(0,"tb-json-object-edit",0),t.ɵɵpipe(1,"translate")),2&e&&(t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(1,2,"gateway.configuration")),t.ɵɵproperty("formControl",n.advancedFormControl))},dependencies:t.ɵɵgetComponentDepsFactory(S6,[j,_]),encapsulation:2})}}function C6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(1,"mat-icon",15),t.ɵɵtext(2,"close"),t.ɵɵelementEnd()()}}function _6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-basic-configuration",16),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onInitialized(n))})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("device",e.device)("defaultTab",e.defaultTab)("gatewayVersion",e.gatewayVersion)("dialogMode",!!e.dialogRef)("withReportStrategy",t.ɵɵpipeBind1(1,5,e.gatewayVersion))}}function T6(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-advanced-configuration",10)}function I6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",17),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.cancel())})),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()}2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"action.cancel")," "))}e("GatewayAdvancedConfigurationComponent",S6);class E6{constructor(e,t,n,i,a){this.fb=e,this.attributeService=t,this.cd=n,this.gatewayCredentialsService=i,this.destroyRef=a,this.ConfigurationModes=Qt,this.gatewayConfigAttributeKeys=["general_configuration","grpc_configuration","logs_configuration","storage_configuration","RemoteLoggingLevel","mode"],this.useUpdatedLogs=!1,this.gatewayConfigGroup=this.fb.group({basicConfig:[],advancedConfig:[],mode:[Qt.BASIC]}),this.observeAlignConfigs()}ngAfterViewInit(){this.fetchConfigAttribute(this.device)}saveConfig(){const{mode:e,advancedConfig:t}=Ne(this.removeEmpty(this.gatewayConfigGroup.value)),n={mode:e,...t};n.thingsboard.statistics.commands=Object.values(n.thingsboard.statistics.commands??[]);const i=this.generateAttributes(n);this.attributeService.saveEntityAttributes(this.device,D.SHARED_SCOPE,i).pipe(xe((e=>this.gatewayCredentialsService.updateCredentials(n.thingsboard.security))),bn(this.destroyRef)).subscribe((()=>{this.dialogRef?this.dialogRef.close():(this.gatewayConfigGroup.markAsPristine(),this.cd.detectChanges())}))}onInitialized(e){this.gatewayConfigGroup.get("basicConfig").patchValue(e,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(e,{emitEvent:!1})}observeAlignConfigs(){this.gatewayConfigGroup.get("basicConfig").valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>{const t=this.gatewayConfigGroup.get("advancedConfig");Se(t.value,e)||this.gatewayConfigGroup.get("mode").value!==Qt.BASIC||t.patchValue(e,{emitEvent:!1})})),this.gatewayConfigGroup.get("advancedConfig").valueChanges.pipe(bn(this.destroyRef)).subscribe((e=>{const t=this.gatewayConfigGroup.get("basicConfig");Se(t.value,e)||this.gatewayConfigGroup.get("mode").value!==Qt.ADVANCED||t.patchValue(e,{emitEvent:!1})}))}generateAttributes(e){const t=[],n=(e,n)=>{t.push({key:e,value:n})},i=(e,t)=>{t={...t,ts:(new Date).getTime()},n(e,t)};return n("RemoteLoggingLevel",e.logs?.logLevel??lt.NONE),delete e.connectors,n("logs_configuration",this.generateLogsFile(e.logs)),i("grpc_configuration",e.grpc),i("storage_configuration",e.storage),i("general_configuration",e.thingsboard),n("mode",e.mode),t}cancel(){this.dialogRef&&this.dialogRef.close()}removeEmpty(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>null!=t)).map((([e,t])=>[e,t===Object(t)?this.removeEmpty(t):t])))}generateLogsFile(e){const t={version:1,disable_existing_loggers:!1,formatters:{LogFormatter:{class:"logging.Formatter",format:e.logFormat,datefmt:e.dateFormat}},handlers:{consoleHandler:{class:"logging.StreamHandler",formatter:"LogFormatter",level:0,stream:"ext://sys.stdout"},...this.useUpdatedLogs?{}:{databaseHandler:{class:this.useUpdatedLogs?Y3:X3,formatter:"LogFormatter",filename:"./logs/database.log",backupCount:1,encoding:"utf-8"}}},loggers:{...this.useUpdatedLogs?{}:{database:{handlers:["databaseHandler","consoleHandler"],level:"DEBUG",propagate:!1}}},root:{level:"ERROR",handlers:["consoleHandler"]},ts:(new Date).getTime()};return this.addLocalLoggers(t,e?.local),t}addLocalLoggers(e,t){if(t)for(const n of Object.keys(t))e.handlers[n+"Handler"]=this.createHandlerObj(t[n],n),e.loggers[n]=this.createLoggerObj(t[n],n)}createHandlerObj(e,t){return{class:this.useUpdatedLogs?Y3:X3,formatter:"LogFormatter",filename:`${e.filePath}/${t}.log`,backupCount:e.backupCount,interval:e.savingTime,when:e.savingPeriod,encoding:"utf-8"}}createLoggerObj(e,t){return{handlers:[`${t}Handler`,"consoleHandler"],level:e.logLevel,propagate:!1}}fetchConfigAttribute(e){e.id!==B&&this.attributeService.getEntityAttributes(e,D.CLIENT_SCOPE).pipe(we((t=>t.length?ae(t):this.attributeService.getEntityAttributes(e,D.SHARED_SCOPE,this.gatewayConfigAttributeKeys))),bn(this.destroyRef)).subscribe((e=>{this.gatewayVersion=e.find((e=>"Version"===e.key))?.value,this.useUpdatedLogs=za.parseVersion(this.gatewayVersion??pt.Legacy)>=za.parseVersion(pt.v3_6_3),this.updateConfigs(e),this.cd.detectChanges()}))}updateConfigs(e){let t={},n=lt.NONE;this.gatewayCredentialsService.setInitialCredentials(this.device),e.forEach((e=>{switch(e.key){case"general_configuration":e.value&&(t={...t,thingsboard:e.value});break;case"grpc_configuration":e.value&&(t={...t,grpc:e.value});break;case"logs_configuration":e.value&&(t={...t,logs:this.logsToObj(e.value)});break;case"storage_configuration":e.value&&(t={...t,storage:e.value});break;case"mode":t={...t,mode:e.value??Qt.BASIC};break;case"RemoteLoggingLevel":e.value&&(n=e.value)}})),t.logs&&(t={...t,logs:{...t.logs,logLevel:n}}),t.thingsboard?.security?this.gatewayCredentialsService.initialCredentials$.pipe(ue(Boolean),ye(1),bn(this.destroyRef)).subscribe((e=>{this.gatewayCredentialsService.shouldUpdateSecurityConfig(t.thingsboard.security)&&(t.thingsboard.security=this.gatewayCredentialsService.credentialsToSecurityConfig(e)),this.gatewayConfigGroup.get("basicConfig").patchValue(t,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(t,{emitEvent:!1})})):(this.gatewayConfigGroup.get("basicConfig").patchValue(t,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(t,{emitEvent:!1}))}logsToObj(e){const{format:t,datefmt:n}=e.formatters.LogFormatter;return{local:Object.keys(z3).reduce(((t,n)=>{const i=e.handlers[`${n}Handler`]||{},a=e.loggers[n]||{};return t[n]={logLevel:a.level||lt.INFO,filePath:i.filename?.split(`/${n}`)[0]||"./logs",backupCount:i.backupCount||7,savingTime:i.interval||3,savingPeriod:i.when||H3.days},t}),{}),logFormat:t,dateFormat:n}}static{this.ɵfac=function(e){return new(e||E6)(t.ɵɵdirectiveInject(H.FormBuilder),t.ɵɵdirectiveInject(_e.AttributeService),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(y5),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:E6,selectors:[["tb-gateway-configuration"]],inputs:{device:"device",defaultTab:"defaultTab",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵProvidersFeature([y5]),t.ɵɵStandaloneFeature],decls:24,vars:24,consts:[[1,"flex","size-full","max-w-full","flex-col",3,"formGroup"],["color","primary"],[1,"tb-flex","space-between","align-center","h-16"],["tbTruncateWithTooltip",""],[1,"flex","items-center"],["formControlName","mode",3,"appearance"],[3,"value"],["mat-icon-button","","type","button",3,"click",4,"ngIf"],[1,"content-wrapper","flex-1"],["formControlName","basicConfig",3,"device","defaultTab","gatewayVersion","dialogMode","withReportStrategy"],["formControlName","advancedConfig"],[1,"flex","h-full","items-center","justify-end","gap-2","pr-4"],["mat-button","","color","primary","type","button"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["formControlName","basicConfig",3,"initialized","device","defaultTab","gatewayVersion","dialogMode","withReportStrategy"],["mat-button","","color","primary","type","button",3,"click"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"div",2)(3,"h2")(4,"div",3),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",4)(8,"tb-toggle-select",5)(9,"tb-toggle-option",6),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"tb-toggle-option",6),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(15,C6,3,0,"button",7),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",8),t.ɵɵtemplate(17,_6,2,7,"tb-gateway-basic-configuration",9)(18,T6,1,0,"tb-gateway-advanced-configuration",10),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",11),t.ɵɵtemplate(20,I6,3,3,"button",12),t.ɵɵelementStart(21,"button",13),t.ɵɵlistener("click",(function(){return n.saveConfig()})),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.gatewayConfigGroup),t.ɵɵadvance(),t.ɵɵclassProp("page-header",!n.dialogRef),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,16,"gateway.gateway-configuration")),t.ɵɵadvance(3),t.ɵɵclassProp("dialog-toggle",!!n.dialogRef),t.ɵɵpropertyInterpolate("appearance",n.dialogRef?"stroked":"fill"),t.ɵɵadvance(),t.ɵɵproperty("value",n.ConfigurationModes.BASIC),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,18,"gateway.basic")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",n.ConfigurationModes.ADVANCED),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,20,"gateway.advanced")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.dialogRef),t.ɵɵadvance(2),t.ɵɵconditional(n.gatewayConfigGroup.get("mode").value===n.ConfigurationModes.BASIC?17:18),t.ɵɵadvance(3),t.ɵɵconditional(n.dialogRef?20:-1),t.ɵɵadvance(),t.ɵɵproperty("disabled",n.gatewayConfigGroup.invalid||!n.gatewayConfigGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,22,"action.save")," "))},dependencies:t.ɵɵgetComponentDepsFactory(E6,[j,_,Ka,w6,S6]),styles:['@charset "UTF-8";[_nghost-%COMP%]{overflow:hidden;padding:0!important;max-height:75vh;height:75vh;width:800px;max-width:80vw}@media screen and (max-width: 599px){[_nghost-%COMP%]{max-height:100%;height:100%;width:100%;max-width:100%}}[_nghost-%COMP%] .page-header.mat-toolbar[_ngcontent-%COMP%]{background:transparent;color:#000000de!important}[_nghost-%COMP%] .content-wrapper[_ngcontent-%COMP%]{min-height:calc(100% - 116px)}.dialog-toggle[_ngcontent-%COMP%] .mat-button-toggle-button{color:#ffffffbf}']})}}e("GatewayConfigurationComponent",E6);class M6{constructor(){}static{this.ɵfac=function(e){return new(e||M6)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:M6,selectors:[["tb-lib-styles-entry"]],standalone:!0,features:[t.ɵɵStandaloneFeature],decls:0,vars:0,template:function(e,t){},styles:['@charset "UTF-8";.gw-delete-icon-button{color:#0000008a}.gw-connector-table .mat-mdc-table{table-layout:fixed}.gw-chip-list .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}.gw-table-toolbar.mat-mdc-table-toolbar.mat-mdc-table-toolbar{padding:0 8px}.tb-default .h-16{height:4rem}.tb-default .h-\\[500px\\]{height:500px}.tb-default .max-h-full{max-height:100%}.tb-default .min-h-10{min-height:2.5rem}.tb-default .\\!w-1\\/5{width:20%!important}.tb-default .w-1\\/2{width:50%}.tb-default .w-12{width:3rem}.tb-default .w-\\[77vw\\]{width:77vw}.tb-default .min-w-16{min-width:4rem}.tb-default .min-w-24{min-width:6rem}.tb-default .max-w-2xl{max-width:42rem}.tb-default .max-w-3xl{max-width:48rem}.tb-default .max-w-4\\/12{max-width:33.333333%}.tb-default .max-w-\\[11vw\\]{max-width:11vw}.tb-default .max-w-full{max-width:100%}.tb-default .flex-\\[1_1_30px\\]{flex:1 1 30px}.tb-default .flex-\\[1_1_33\\%\\]{flex:1 1 33%}.tb-default .flex-grow{flex-grow:1}.tb-default .gap-1\\.25{gap:.3125rem}.tb-default .p-1{padding:.25rem}.tb-default .\\!pl-0{padding-left:0!important}.tb-default .pr-4{padding-right:1rem}.tb-default .pt-4{padding-top:1rem}.tb-default .text-center{text-align:center}@media (max-width: 599px){.tb-default .lt-sm\\:flex-col{flex-direction:column}}\n'],encapsulation:2})}}const k6=(e,t)=>{const n=e[y];if(n.styles?.length){const e=n.styles[0];let i=document.getElementById(t);if(!i){i=document.createElement("style"),i.id=t;(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}i.innerHTML=e}};class P6{constructor(e){this.translate=e,function(e){e.setTranslation("en_US",gt,!0),e.setTranslation("ar_AE",ft,!0),e.setTranslation("ca_ES",yt,!0),e.setTranslation("cs_CZ",vt,!0),e.setTranslation("da_DK",xt,!0),e.setTranslation("es_ES",bt,!0),e.setTranslation("ko_KR",wt,!0),e.setTranslation("lt_LT",St,!0),e.setTranslation("nl_BE",Ct,!0),e.setTranslation("pl_PL",_t,!0),e.setTranslation("pt_BR",Tt,!0),e.setTranslation("sl_SI",It,!0),e.setTranslation("tr_TR",Et,!0),e.setTranslation("zh_CN",Mt,!0),e.setTranslation("zh_TW",kt,!0)}(e),(e=>{k6(M6,e)})("tb-gateway-css")}static{this.ɵfac=function(e){return new(e||P6)(t.ɵɵinject(He.TranslateService))}}static{this.ɵmod=t.ɵɵdefineNgModule({type:P6})}static{this.ɵinj=t.ɵɵdefineInjector({imports:[j,_,$e,hj,sW,i$,E6,xn,V3,L3]})}}e("GatewayExtensionModule",P6),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(P6,{imports:[j,_,$e,hj,sW,i$,E6,xn,V3,L3]})}}}));//# sourceMappingURL=gateway-management-extension.js.map +System.register(["@angular/core","@angular/material/sort","@angular/material/table","@angular/material/paginator","@shared/public-api","@core/public-api","@angular/common","@ngx-translate/core","@angular/forms","rxjs","rxjs/operators","@angular/material/dialog","tslib","@angular/material/tooltip","@angular/cdk/collections","@ngrx/store","@angular/router","@home/components/public-api","@angular/platform-browser","@home/components/widget/widget.component","@shared/components/dialog/json-object-edit-dialog.component","@shared/import-export/import-export.service","@shared/components/popover.component","@shared/components/popover.service","@shared/decorators/coercion","@angular/material/core"],(function(e){"use strict";var t,n,i,a,r,o,s,l,p,c,d,u,m,h,g,f,y,v,x,b,w,S,C,_,T,I,E,M,k,P,D,O,A,F,R,B,N,L,V,q,G,z,U,j,H,W,$,K,Y,X,Z,Q,J,ee,te,ne,ie,ae,re,oe,se,le,pe,ce,de,ue,me,he,ge,fe,ye,ve,xe,be,we,Se,Ce,_e,Te,Ie,Ee,Me,ke,Pe,De,Oe,Ae,Fe,Re,Be,Ne,Le,Ve,qe,Ge,ze,Ue,je,He,We,$e,Ke,Ye,Xe,Ze,Qe,Je,et,tt,nt,it,at,rt,ot,st;return{setters:[function(e){t=e,n=e.assertInInjectionContext,i=e.inject,a=e.DestroyRef,e.ɵRuntimeError,e.ɵgetOutputDestroyRef,r=e.Injector,o=e.effect,s=e.untracked,e.assertNotInReactiveContext,e.signal,e.computed,l=e.input,p=e.output,c=e.forwardRef,d=e.ChangeDetectionStrategy,u=e.EventEmitter,m=e.booleanAttribute,h=e.ChangeDetectorRef,g=e.SecurityContext,f=e.KeyValueDiffers,y=e.ɵNG_COMP_DEF},function(e){v=e.MatSort},function(e){x=e.MatTableDataSource},function(e){b=e.MatPaginator},function(e){w=e.Direction,S=e.PageLink,C=e.DataKeyType,_=e.SharedModule,T=e,I=e.coerceBoolean,E=e.emptyPageData,M=e.isClientSideTelemetryType,k=e.TelemetrySubscriber,P=e.coerceNumber,D=e.AttributeScope,O=e.helpBaseUrl,A=e.DialogComponent,F=e.defaultLegendConfig,R=e.widgetType,B=e.NULL_UUID,N=e.DatasourceType,L=e.EntityType,V=e.ContentType,q=e.PageComponent,G=e.TbTableDatasource,z=e.HOUR,U=e.DeviceCredentialsType},function(e){j=e.mergeDeep,H=e.isLiteralObject,W=e.isEqual,$=e.WINDOW,K=e,Y=e.deleteNullProperties,X=e.DialogService,Z=e.isNumber,Q=e.isString,J=e.isDefinedAndNotNull,ee=e.formatValue,te=e.deepClone,ne=e.isUndefinedOrNull,ie=e.isObject,ae=e.generateSecret,re=e.camelCase,oe=e.deepTrim},function(e){se=e.CommonModule},function(e){le=e,pe=e.TranslateService,ce=e.TranslateModule},function(e){de=e,ue=e.NG_VALUE_ACCESSOR,me=e.Validators,he=e.NG_VALIDATORS,ge=e.FormBuilder,fe=e.FormControl},function(e){ye=e.Observable,ve=e.ReplaySubject,xe=e.shareReplay,be=e.combineLatest,we=e.Subject,Se=e.fromEvent,Ce=e.BehaviorSubject,_e=e.of,Te=e.zip,Ie=e.forkJoin,Ee=e.merge},function(e){Me=e.takeUntil,ke=e.map,Pe=e.distinctUntilChanged,De=e.debounceTime,Oe=e.filter,Ae=e.tap,Fe=e.catchError,Re=e.publishReplay,Be=e.refCount,Ne=e.take,Le=e.takeWhile,Ve=e.switchMap,qe=e.startWith,Ge=e.mergeMap},function(e){ze=e.MatDialog,Ue=e.MAT_DIALOG_DATA,je=e},function(e){He=e.__decorate,We=e.__extends},function(e){$e=e,Ke=e.MatTooltip},function(e){Ye=e.SelectionModel},function(e){Xe=e},function(e){Ze=e},function(e){Qe=e.calculateAxisSize,Je=e.measureAxisNameSize},function(e){et=e},function(e){tt=e},function(e){nt=e.JsonObjectEditDialogComponent},function(e){it=e},function(e){at=e},function(e){rt=e},function(e){ot=e.coerceBoolean},function(e){st=e.ErrorStateMatcher}],execute:function(){e("getDefaultConfig",Xt);const lt=e("jsonRequired",(e=>e.value?null:{required:!0}));var pt,ct,dt;e("GatewayLogLevel",pt),function(e){e.NONE="NONE",e.CRITICAL="CRITICAL",e.ERROR="ERROR",e.WARNING="WARNING",e.INFO="INFO",e.DEBUG="DEBUG",e.TRACE="TRACE"}(pt||e("GatewayLogLevel",pt={})),e("GatewayVersion",ct),function(e){e.v3_7_3="3.7.3",e.v3_7_2="3.7.2",e.v3_7_0="3.7",e.v3_6_3="3.6.3",e.v3_6_2="3.6.2",e.v3_6_0="3.6",e.v3_5_2="3.5.2",e.Legacy="legacy"}(ct||e("GatewayVersion",ct={})),e("ConnectorType",dt),function(e){e.MQTT="mqtt",e.MODBUS="modbus",e.GRPC="grpc",e.OPCUA="opcua",e.BLE="ble",e.REQUEST="request",e.CAN="can",e.BACNET="bacnet",e.ODBC="odbc",e.REST="rest",e.SNMP="snmp",e.FTP="ftp",e.SOCKET="socket",e.XMPP="xmpp",e.OCPP="ocpp",e.CUSTOM="custom",e.KNX="knx"}(dt||e("ConnectorType",dt={}));const ut=e("GatewayConnectorDefaultTypesTranslatesMap",new Map([[dt.MQTT,"MQTT"],[dt.MODBUS,"MODBUS"],[dt.GRPC,"GRPC"],[dt.OPCUA,"OPCUA"],[dt.BLE,"BLE"],[dt.REQUEST,"REQUEST"],[dt.CAN,"CAN"],[dt.BACNET,"BACNET"],[dt.ODBC,"ODBC"],[dt.REST,"REST"],[dt.SNMP,"SNMP"],[dt.FTP,"FTP"],[dt.SOCKET,"SOCKET"],[dt.XMPP,"XMPP"],[dt.OCPP,"OCPP"],[dt.CUSTOM,"CUSTOM"],[dt.KNX,"KNX"]])),mt=e("ConnectorsTypesByVersion",new Map([[ct.v3_7_0,Object.values(dt)],[ct.Legacy,Object.values(dt).filter((e=>e!==dt.KNX))]]));var ht,gt;e("SocketEncoding",ht),function(e){e.UTF8="utf-8",e.HEX="hex",e.UTF16="utf-16",e.UTF32="utf-32",e.UTF16BE="utf-16-be",e.UTF16LE="utf-16-le",e.UTF32BE="utf-32-be",e.UTF32LE="utf-32-le"}(ht||e("SocketEncoding",ht={})),e("HTTPMethods",gt),function(e){e.DELETE="DELETE",e.GET="GET",e.HEAD="HEAD",e.OPTIONS="OPTIONS",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT"}(gt||e("HTTPMethods",gt={}));var ft,yt={gateway:{active:"Active",address:"Address","address-required":"Address required","add-entry":"Add configuration","add-attribute":"Add attribute","add-attribute-update":"Add attribute update","add-attribute-request":"Add attribute request","add-key":"Add key","add-timeseries":"Add time series","add-mapping":"Add mapping","add-slave":"Add Slave",arguments:"Arguments","add-rpc-method":"Add method","add-rpc-request":"Add request","add-value":"Add argument","advanced-settings":"Advanced settings",application:"Application",bacnet:{"device-timeout":"Discovery timeout","network-number":"Network number","alt-responses-address":"Alternative responses address","apdu-length":"APDU Length","object-name":"Object Name","object-type":{"analog-input":"Analog Input","analog-output":"Analog Output","analog-value":"Analog Value","binary-input":"Binary Input","binary-output":"Binary Output","binary-value":"Binary Value"},"request-type":{label:"Request Type",write:"Write Property",read:"Read Property"},"property-id":{"present-value":"Present Value","status-flags":"Status Flags","cov-increment":"COV Increment","event-state":"Event State","out-of-service":"Out of Service",polarity:"Polarity","priority-array":"Priority Array","relinquish-default":"Relinquish Default","current-command-priority":"Current Command Priority","event-message-texts":"Event Message Texts","event-message-texts-config":"Event Message Texts Config","event-algorithm-inhibit-reference":"Event Algorithm Inhibit Reference","time-delay-normal":"Time Delay Normal"},segmentation:{label:"Segmentation",no:"None",both:"Both",transmit:"Transmit",receive:"Receive"}},baudrate:"Baudrate","buffer-size":"Buffer size","buffer-size-required":"Buffer size is required","buffer-size-range":"Buffer size should be greater than 0",bytesize:"Bytesize",boolean:"Boolean",bit:"Bit","bit-target-type":"Bit target type","delete-value":"Delete value","delete-argument":"Delete argument","delete-rpc-method":"Delete method","delete-rpc-request":"Delete request","delete-attribute-update":"Delete attribute update","delete-attribute-request":"Delete attribute request",advanced:"Advanced","add-device":"Add device","address-filter":"Address filter","address-filter-required":"Address filter is required","advanced-connection-settings":"Advanced connection settings","advanced-configuration-settings":"Advanced configuration settings",attributes:"Attributes","attribute-updates":"Attribute updates","attribute-on-platform":"Attribute on platform","attribute-requests":"Attribute requests","attribute-filter":"Attribute filter","attribute-filter-hint":"Filter for incoming attribute name from platform, supports regular expression.","attribute-filter-required":"Attribute filter required.","attribute-name-expression":"Attribute name expression","attribute-name-expression-required":"Attribute name expression required.","attribute-name-expression-hint":"Hint for Attribute name expression",basic:"Basic","byte-order":"Byte order","word-order":"Word order",broker:{connection:"Connection to broker",name:"Broker name","name-required":"Broker name required.","security-types":{anonymous:"Anonymous",basic:"Basic",certificates:"Certificates"}},certificate:"Certificate","CA-certificate-path":"Path to CA certificate file","path-to-CA-cert-required":"Path to CA certificate file is required.","change-connector-title":"Confirm connector change","change-connector-text":"Switching connectors will discard any unsaved changes. Continue?","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","add-connector":"Add connector","delete-connector":"Delete connector","connector-add":"Add new connector","connector-enabled":"Enable connector","connector-name":"Connector name",connector:"Connector",converter:"Converter","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","connection-timeout":"Connection timeout (s)","connect-attempt-time":"Connect attempt time (ms)","connect-attempt-count":"Connect attempt count","copy-username":"Copy username","copy-password":"Copy password","copy-client-id":"Copy client ID","connector-created":"Connector created","connector-updated":"Connector updated","create-new-one":"Create new one!","rpc-command-save-template":"Save Template","rpc-command-send":"Send","rpc-command-result":"Response","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"Use the following instruction to run IoT Gateway in Docker compose with credentials for selected device","install-docker-compose":"Use the instructions to download, install and setup docker compose",integer:"Integer",inactive:"Inactive",device:"Device",devices:"Devices","device-profile":"Device profile","device-info-settings":"Device info settings","device-info":{"entity-field":"Entity field",source:"Source",expression:"Value / Expression","expression-hint":"Show help",name:"Name","profile-name":"Profile name","device-name-expression":"Device name expression","device-name-expression-required":"Device name expression is required.","device-profile-expression-required":"Device profile expression is required."},"device-name-filter":"Device name filter","device-name-filter-hint":"This field supports regular expressions to filter incoming data by device name.","device-name-filter-required":"Device name filter is required.",details:"Details","delete-mapping-title":"Are you sure you want to delete the mapping related with '{{name}}'?","delete-mapping-description":"Be careful, after the confirmation mapping configuration and all related data will become unrecoverable.","delete-slave-title":"Are you sure you want to delete the server '{{name}}'?","delete-slave-description":"Be careful, after the confirmation server configuration and all related data will become unrecoverable.","delete-device-title":"Are you sure you want to delete the device '{{name}}'?","delete-device-description":"Be careful, after the confirmation the device configuration and all related data will become unrecoverable.",divider:"Divider","download-configuration-file":"Download configuration file","download-docker-compose":"Download docker-compose.yml for your gateway","enable-remote-logging":"Enable remote logging","ellipsis-chips-text":"+ {{count}} more","launch-gateway":"Launch gateway","launch-docker-compose":"Start the gateway using the following command in the terminal from folder with docker-compose.yml file","logs-configuration":"Logs configuration","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off","connector-duplicate-name":"Connector with such name already exists.","connection-type":"Connection type","connector-side":"Connector side","payload-type":"Payload type","platform-side":"Platform side",JSON:"JSON","JSON-hint":"Converter for this payload type processes MQTT messages in JSON format. It uses JSON Path expressions to extract vital details such as device names, device profile names, attributes, and time series from the message. And regular expressions to get device details from topics.",byte:"Byte",bytes:"Bytes","bytes-hint":"Converter for this payload type designed for binary MQTT payloads, this converter directly interprets binary data to retrieve device names and device profile names, along with attributes and time series, using specific byte positions for data extraction.",custom:"Custom","custom-hint":"This option allows you to use a custom converter for specific data tasks. You need to add your custom converter to the extension folder and enter its class name in the UI settings. Any keys you provide will be sent as configuration to your custom converter.","client-cert-path":"Path to client certificate file","path-to-client-cert-required":"Path to client certificate file is required.","client-id":"Client ID","data-conversion":"Data conversion","data-mapping":"Data mapping","data-mapping-hint":"Data mapping provides the capability to parse and convert the data received from a MQTT client in incoming messages into specific attributes and time series data keys.","opcua-data-mapping-hint":"Data mapping provides the capability to parse and convert the data received from a OPCUA server into specific data keys.",delete:"Delete configuration","delete-attribute":"Delete attribute","delete-key":"Delete key","delete-timeseries":"Delete time series",default:"Default","device-node":"Device node","device-node-required":"Device node required.","device-node-hint":"Path or identifier for device node on OPC UA server. Relative paths from it for attributes and time series can be used.","device-name":"Device name","device-profile-label":"Device profile","device-name-required":"Device name required","device-profile-required":"Device profile required","download-tip":"Download configuration file","drop-file":"Drop file here or",enable:"Enable",encoding:"Encoding","enable-subscription":"Enable subscription",extension:"Extension","extension-hint":"Put your converter classname in the field. Custom converter with such class should be in extension/mqtt folder.","extension-required":"Extension is required.","extension-configuration":"Extension configuration","extension-configuration-hint":"Configuration for converter. These arguments will be passed as a config to convert function.","fill-connector-defaults":"Fill configuration with default values","fill-connector-defaults-hint":"This property allows to fill connector configuration with default values on it's creation.","from-device-request-settings":"Input request parsing","from-device-request-settings-hint":"These fields support JSONPath expressions to extract a name from incoming message.","function-code":"Function code","function-codes":{"read-coils":"01 - Read Coils","read-discrete-inputs":"02 - Read Discrete Inputs","read-multiple-holding-registers":"03 - Read Multiple Holding Registers","read-input-registers":"04 - Read Input Registers","write-single-coil":"05 - Write Single Coil","write-single-holding-register":"06 - Write Single Holding Register","write-multiple-coils":"15 - Write Multiple Coils","write-multiple-holding-registers":"16 - Write Multiple Holding Registers"},"to-device-response-settings":"Output request processing","to-device-response-settings-hint":"For these fields you can use the following variables and they will be replaced with actual values: ${deviceName}, ${attributeKey}, ${attributeValue}",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-status":"Gateway status","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.","generate-client-id":"Generate Client ID",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid",info:"Info",identity:"Identity","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","unit-id":"Unit ID",host:"Host","host-required":"Host is required.",holding_registers:"Holding registers",coils_initializer:"Coils initializer",input_registers:"Input registers",discrete_inputs:"Discrete inputs","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.","JSONPath-hint":"Supports constants and JSONPath expressions to extract data.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",columns:{general:"General",service:"Service",connection:"Connection",storage:"Storage",extension:"Extension"},remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"max-number-of-workers":"Max number of workers","max-number-of-workers-hint":"Maximal number of workers threads for converters \n(The amount of workers changes dynamically, depending on load) \nRecommended amount 50-150.","max-number-of-workers-required":"Max number of workers is required.","max-messages-queue-for-worker":"Max messages queue per worker","max-messages-queue-for-worker-hint":"Maximal messages count that will be in the queue \nfor each converter worker.","max-messages-queue-for-worker-required":"Max messages queue per worker is required.",method:"Method","method-name":"Method name","method-required":"Method name is required.","min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 10","min-pack-send-delay-pattern":"Min pack send delay is not valid",multiplier:"Multiplier",mode:"Mode","model-name":"Model name",modifier:"Modifier","modifier-invalid":"Modifier is not valid","mqtt-version":"MQTT version",name:"Name","name-required":"Name is required.","network-mask":"Network mask","no-attributes":"No attributes","no-attribute-updates":"No attribute updates","no-attribute-requests":"No attribute requests","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","no-timeseries":"No time series","no-keys":"No keys","no-value":"No arguments","no-rpc-methods":"No RPC methods","no-rpc-requests":"No RPC requests","path-hint":"The path is local to the gateway file system","path-logs":"Path to log files","path-logs-required":"Path is required.",password:"Password","password-required":"Password is required.","permit-without-calls":"Keep alive permit without calls","property-id":"Property ID","poll-period":"Poll period (ms)","poll-period-error":"Poll period should be at least {{min}} (ms).",port:"Port","port-required":"Port is required.","port-limits-error":"Port should be number from {{min}} to {{max}}.","private-key-path":"Path to private key file","path-to-private-key-required":"Path to private key file is required.",parity:"Parity","product-code":"Product code","product-name":"Product name",raw:"Raw",retain:"Retain","retain-hint":"This flag tells the broker to store the message for a topic\nand ensures any new client subscribing to that topic\nwill receive the stored message.",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","remote-shell":"Remote shell","remote-configuration":"Remote Configuration","request-expression":"Request expression","request-expression-required":"Request expression is required",retries:"Retries","retries-on-empty":"Retries on empty","retries-on-invalid":"Retries on invalid",response:"Response",rest:{"add-http-header":"Add HTTP header","no-http-headers":"No HTTP headers","delete-http-header":"Delete HTTP header","ssl-verify":"SSL verify",endpoint:"Endpoint","http-methods":"HTTP methods","http-method":"HTTP method","on-error":"On error","on-success":"On success",tries:"Tries","http-headers":"HTTP headers","allow-redirects":"Allow redirects","request-url-expression":"Request URL expression","response-attribute":"Response attribute","response-expected":"Expected","response-type":{default:"Default",const:"Constant",advanced:"Advanced"}},rpc:{rpc:"RPC",title:"{{type}} Connector RPC parameters","templates-title":"Connector RPC Templates",methodFilter:"Method filter","method-name":"Method name",requestTopicExpression:"Request topic expression",responseTopicExpression:"Response topic expression",responseTimeout:"Response timeout",valueExpression:"Value expression",tag:"Tag",type:"Type",functionCode:"Function Code",objectsCount:"Objects Count",address:"Address",method:"Method",requestType:"Request Type",requestTimeout:"Request Timeout",objectType:"Object type",identifier:"Identifier",propertyId:"Property ID",methodRPC:"Method RPC name",withResponse:"With Response",characteristicUUID:"Characteristic UUID",methodProcessing:"Method Processing",nodeID:"Node ID",isExtendedID:"Is Extended ID",isFD:"Is FD",bitrateSwitch:"Bitrate Switch",dataInHEX:"Data In HEX",dataLength:"Data Length",dataByteorder:"Data Byte Order",dataBefore:"Data Before",dataAfter:"Data After",dataExpression:"Data Expression",oid:"OID","add-oid":"Add OID","add-header":"Add header","add-security":"Add security",remove:"Remove",requestFilter:"Request Filter",requestUrlExpression:"Request URL Expression",httpMethod:"HTTP Method",timeout:"Timeout",tries:"Tries",httpHeaders:"HTTP Headers","header-name":"Header name",hint:{"modbus-response-reading":"RPC response will return all subtracted values from all connected devices when the reading functions are selected.","modbus-writing-functions":"RPC will write a filled value to all connected devices when the writing functions are selected.","opc-method":"A filled method name is the OPC-UA method that will processed on the server side (make sure your node has the requested method)."},"security-name":"Security name",value:"Value",security:"Security",responseValueExpression:"Response Value Expression",requestValueExpression:"Request Value Expression",arguments:"Arguments","add-argument":"Add argument","write-property":"Write property","read-property":"Read property","analog-output":"Analog output","analog-input":"Analog input","binary-output":"Binary output","binary-input":"Binary input","binary-value":"Binary value","analog-value":"Analog value",write:"Write",read:"Read",scan:"Scan",oids:"OIDS",set:"Set",multiset:"Multiset",get:"Get","bulk-walk":"Bulk walk",table:"Table","multi-get":"Multiget","get-next":"Get next","bulk-get":"Bulk get",walk:"Walk","save-template":"Save template","template-name":"Template name","template-name-required":"Template name is required.","template-name-duplicate":"Template with such name already exists, it will be updated.",command:"Command",params:"Params","json-value-invalid":"JSON value has an invalid format"},"rpc-methods":"RPC methods","rpc-requests":"RPC requests",request:{"connect-request":"Connect request","disconnect-request":"Disconnect request","attribute-request":"Attribute request","attribute-update":"Attribute update","rpc-connection":"RPC command"},"request-type":"Request type","request-timeout":"Request timeout (ms)","requests-mapping":"Requests mapping","requests-mapping-hint":"MQTT Connector requests allows you to connect, disconnect, process attribute requests from the device, handle attribute updates on the server and RPC processing configuration.","request-topic-expression":"Request topic expression","request-client-certificate":"Request client certificate","request-topic-expression-required":"Request topic expression is required.","response-timeout":"Response timeout","response-timeout-required":"Response timeout is required.","response-timeout-limits-error":"Timeout must be more then {{min}} ms.","response-topic-Qos":"Response topic QoS","response-topic-Qos-hint":"MQTT Quality of Service (QoS) is an agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message.","response-topic-expression":"Response topic expression","response-topic-expression-required":"Response topic expression is required.","response-value-expression":"Response value expression","response-value-expression-required":"Response value expression is required.","vendor-name":"Vendor name","vendor-url":"Vendor URL",value:"Value",values:"Values","value-required":"Value is required.","value-expression":"Value expression","value-expression-required":"Value expression is required.","with-response":"With response","without-response":"Without response",other:"Other",socket:"Socket","save-tip":"Save configuration file","scan-period":"Scan period (ms)","scan-period-error":"Scan period should be at least {{min}} (ms).","sub-check-period":"Subscription check period (ms)","sub-check-period-error":"Subscription check period should be at least {{min}} (ms).",security:"Security","security-policy":"Security policy","security-type":"Security type","security-types":{"access-token":"Access Token","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"select-connector":"Select connector to display config","send-change-data":"Send data only on change","send-data-to-platform":"Send data to platform","send-data-on-change":"Send data only on change","send-change-data-hint":"The values will be saved to the database only if they are different from the corresponding values in the previous converted message. This functionality applies to both attributes and time series in the converter output.",server:"Server","server-hostname":"Server hostname","server-slave":"Server (Slave)","servers-slaves":"Servers (Slaves)","server-port":"Server port","server-url":"Server endpoint url","server-connection":"Server Connection","server-config":"Server configuration","server-slave-config":"Server (Slave) configuration","server-url-required":"Server endpoint url is required.",stopbits:"Stopbits",strict:"Strict",set:"Set","show-map":"Show map",statistics:{entry:"Statistic entry","custom-send-period":"Custom send period (in sec)","custom-send-period-pattern":"Custom send period is not valid","custom-send-period-min":"Custom send period can not be less then 60","custom-send-period-required":"Custom send period is required","create-command":"Create command",attributes:"Attributes","name-already-exists":"Attribute name already exists.",telemetry:"Telemetry","storage-message-count":"Storage message count","messages-from-platform":"Messages from platform","pushed-datapoints":"Pushed datapoints","messages-pulled-from-storage":"Messages pulled from storage","messages-pushed-to-platform":"Messages pushed to platform","messages-sent-to-platform":"Messages sent to platform","process-cpu-usage":"Gateway process CPU usage",memory:"Gateway process memory usage","machine-resources":"Machine resources","free-disk":"Free disk",statistic:"Statistic",statistics:"Statistics","general-statistics":"General statistics","custom-statistics":"Custom statistics","copy-message":"Copy message","statistic-commands-empty":'No configured statistic keys found. You can configure them in "Statistics" tab in general configuration.',"statistics-button":"Go to configuration",commands:"Commands",name:"Time series name","time-series-name-already-exists":"Time series name already exists.","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)",messages:"Messages","max-payload-size-bytes":"Max payload size in bytes","max-payload-size-bytes-required":"Max payload size in bytes is required","max-payload-size-bytes-min":"Max payload size in bytes can not be less then 100","max-payload-size-bytes-pattern":"Max payload size in bytes is not valid","min-pack-size-to-send":"Min packet size to send","min-pack-size-to-send-required":"Min packet size to send is required","min-pack-size-to-send-min":"Min packet size to send can not be less then 100","min-pack-size-to-send-pattern":"Min packet size to send is not valid","no-config-commands-found":"No configuration commands found","delete-command":"Delete command '{{command}}'?","delete-command-data":"All command data will be deleted.","edit-command":"Edit command","change-command-title":"Discard command change","change-command-text":"Cancelling command edit will discard any unsaved changes. Continue?","no-command-found":"No command found","no-commands-matching":"No command matching '{{command}}' were found.","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid","install-cmd":"Install command",add:"Add command",timeout:"Timeout (in sec)","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","time-series-name-required":"Time series name is required","time-series-name-pattern":"Time series name is not valid",command:"Command","command-required":"Command is required","command-pattern":"Command is not valid",remove:"Remove command"},storage:"Storage","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count-storage":"Max read record count in storage","storage-max-read-record-count":"Max read record count","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-data-folder-path-pattern":"Data folder path path path must start with './' and end with '/', without dots in folder names.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-path-pattern":"Storage path path must start with './' and end with '/', without dots in folder names.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage",sqlite:"SQLITE"},suffix:{s:"s",ms:"ms"},"report-strategy":{label:"Report strategy","on-change":"On value change","on-report-period":"On report period","on-change-or-report-period":"On value change or report period","report-period":"Report period","on-received":"On received"},"source-type":{msg:"Message",topic:"Topic",const:"Constant",identifier:"Identifier",path:"Path",expression:"Expression",request:"From request"},"workers-settings":"Workers settings",thingsboard:"ThingsBoard",general:"General",timeseries:"Time series",key:"Key",keys:"Keys","key-required":"Key is required.","thingsboard-host":"Platform host","thingsboard-host-required":"Host is required.","thingsboard-port":"Platform port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON",timeout:"Timeout","timeout-error":"Timeout should be at least {{min}} (ms).","title-connectors-json":"Connector {{typeName}} configuration",type:"Type","topic-filter":"Topic filter","topic-required":"Topic filter is required.","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-connection":"TLS Connection","master-connections":"Master Connections","method-filter":"Method filter","method-filter-hint":"Regular expression to filter incoming RPC method from platform.","method-filter-required":"Method filter is required.","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","size-limit":"Size limit","size-limit-hint":"Maximum size of each SQLite file in megabytes. When exceeded, triggers rotation to a new DB file.","size-limit-required":"Size limit is required.","size-limit-min":"Min size limit is 1.","size-limit-pattern":"Number is not valid.","max-db-amount":"Maximum DB amount","max-db-amount-hint":"Maximum number of rotated DB files to keep on disk. When reached, further writes are dropped until cleanup.","max-db-amount-required":"Maximum DB amount is required.","max-db-amount-min":"Min number is 1.","max-db-amount-pattern":"Number is not valid.","oversize-check-period":"Oversize check period","oversize-check-period-hint":"How frequently (in minutes) to check the current DB’s file size against size_limit.","oversize-check-period-required":"Oversize check period is required.","oversize-check-period-min":"Min number is 1.","oversize-check-period-pattern":"Number is not valid.","writing-batch-size":"Writing batch size","writing-batch-size-hint":"Maximum number of messages collected before writing to the DB during single write request.","writing-batch-size-required":"Writing batch size is required.","writing-batch-size-min":"Min number is 1.","writing-batch-size-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1",qos:{"at-most-once":"0 - At most once","at-least-once":"1 - At least once","exactly-once":"2 - Exactly once"},"objects-count":"Objects count","object-id":"Object ID","objects-count-required":"Objects count is required","wait-after-failed-attempts":"Wait after failed attempts (ms)","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON",username:"Username","username-required":"Username is required.","unit-id-required":"Unit ID is required.","vendor-id":"Vendor ID","write-coil":"Write Coil","write-coils":"Write Coils","write-register":"Write Register","write-registers":"Write Registers","general-configuration-widget":{"general-configuration":"General configuration","connectors-configuration":"Connectors configuration",logs:"Logs",statistics:"Statistics","remote-shell":"Remote Shell",rpc:"RPC"},"statistics-nav-widget":{"storage-statistics":"Storage","machine-statistics":"Machine","custom-statistics":"Custom"},"status-widget":{status:"Status","gateway-name":"Gateway name","gateway-version":"Gateway version","gateway-type":"Gateway type",devices:"Devices","active-inactive":"(Active | Inactive)",connectors:"Connectors","enabled-disabled":"(Enabled | Disabled)",errors:"Errors"},hints:{"enable-general-statistics":"Enables gateway statistics (machine, storage, connectors).","enable-custom-statistics":"Enables collecting statistics using custom commands.","buffer-size":"Buffer size for received data blocks.",encoding:"Encoding used for writing received string data to storage.",method:"Name for method on a platform.","modbus-master":"Configuration sections for connecting to Modbus servers and reading data from them.","modbus-server":"Configuration section for the Modbus server, storing data and sending updates to the platform when changes occur or at fixed intervals.","remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of platform server",port:"Port of MQTT service on platform server",token:"Access token for the gateway from platform server","client-id":"MQTT client id for the gateway form platform server",username:"MQTT username for the gateway form platform server",password:"MQTT password for the gateway form platform server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","object-id-required":"Object ID is required","vendor-id-required":"Vendor ID is required","data-folder":"Path to the folder that will contain data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum number of files that will be created","max-read-count":"Number of messages to retrieve from the storage and send to platform","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Number of messages to retrieve from the storage and send to platform","max-records-count":"Maximum number of data entries in storage before sending to platform","ttl-check-hour":"How often will the Gateway check data for obsolescence","ttl-messages-day":"Maximum number of days that the storage will retain data","username-required-with-password":"Username required if password is specified",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls.","path-in-os":"Path in gateway os.",memory:"Your data will be stored in the in-memory queue, it is a fastest but no persistence guarantee.",file:"Your data will be stored in separated files and will be saved even after the gateway restart.",sqlite:"Your data will be stored in file based database. And will be saved even after the gateway restart.","opc-timeout":"Timeout in milliseconds for connecting to OPC-UA server.","security-policy":"Security Policy defines the security mechanisms to be applied.","install-cmd":"Packages that will be installed for command executing.","scan-period":"Period in milliseconds to rescan the server.","sub-check-period":"Period to check the subscriptions in the OPC-UA server.","enable-subscription":"If true - the gateway will subscribe to interesting nodes and wait for data update and if false - the gateway will rescan OPC-UA server every scanPeriodInMillis.","show-map":"Show nodes on scanning.","method-name":"Name of method on OPC-UA server.",arguments:"Arguments for the method (will be overwritten by arguments from the RPC request).","min-pack-size-to-send":"Minimum package size for sending.","max-payload-size-bytes":"Maximum package size in bytes","poll-period":"Period in milliseconds to read data from nodes.","poll-period-required":"Poll period is required.","report-period-required":"Report period is required.","report-period-range":"Report period must be greater than 100.","timeout-pattern":"Timeout is not valid",rest:{"endpoint-required":"Endpoint is required.","endpoint-pattern":"Endpoint is not valid.","device-name-filter-required":"Device name filter is required.","device-name-filter-pattern":"Device name filter is not valid.","request-url-expression-required":"Request URL expression is required.","request-url-expression-pattern":"Request URL expression is not valid.","value-expression-required":"Value expression is required.","value-expression-pattern":"Value expression is not valid.","method-filter-required":"Method filter is required.","method-filter-pattern":"Method filter is not valid.","scope-type":"Attribute scope on platform.","tries-min":"Request tries number should be greater than 0.","tries-pattern":"Request tries is invalid.","http-methods-required":"HTTP methods are required.",host:"Domain or IP address of the server.",port:"Port on the server for listening clients connection.","ssl-verify":"Enable SSL certificate verification.",cert:"Path to the certificate file.",key:"Path to the private key file",endpoint:"Endpoint path on the server.","http-methods":"HTTP methods allowed for endpoint.","http-method":"Request to external URL HTTP method.",JSON:"Converter for this payload type processes REST messages in JSON format. It uses JSON Path expressions to extract vital details such as device names, device profile names, attributes, and time series from the request body.",extension:"Custom converter classname. File with this class should be in extension/rest folder.","response-attribute-required":"Response attribute is required.","response-attribute-pattern":"Response attribute is not valid.","update-ssl":"Verify SSL certificate on the external server.","attribute-filter":"Filter for incoming attribute name from platform, support regular expression.","value-expression":"Used to create request body for request to external server. Supports ${deviceName}, ${deviceType}, ${attributeName}, ${attributeValue} variables.","attribute-url-expression":"Used to create request URL for request to external server. Supports ${deviceName}, ${deviceType}, ${attributeName}, ${attributeValue} variables.","method-filter":"Filter for RPC requests from the platform based on the method name. Supports regular expressions.","attribute-name-expression-required":"Attribute name expression is required.","attribute-name-expression-pattern":"Attribute name expression is not valid.","attribute-filter-required":"Attribute filter is required.","attribute-filter-pattern":"Attribute filter is not valid."},socket:{"attribute-on-platform-required":"Attribute on platform is required","attribute-requests-type":"The type of requested attribute can be “shared” or “client.“","with-response":"Boolean flag that specifies whether to send a response back to platform.","key-telemetry":"Name for telemetry on platform.","key-attribute":"Name for attribute on platform."},modbus:{"bit-target-type":"The response type can be either an integer (1/0) or a boolean (True/False).",bit:"Specify the index of the bit to read from the array, or leave it blank to read the entire array.","max-bit":"The bit value must not exceed the objects count.","framer-type":"Type of a framer (Socket, RTU, or ASCII), if needed.",host:"Hostname or IP address of Modbus server.",port:"Modbus server port for connection.","unit-id":"Modbus slave ID.","connection-timeout":"Connection timeout (in seconds) for the Modbus server.","byte-order":"Byte order for reading data.","word-order":"Word order when reading multiple registers.",retries:"Retrying sending data to the master.","retries-on-empty":"Retry sending data to the master if the data is empty.","retries-on-invalid":"Retry sending data to the master if it fails.","poll-period":"Period in milliseconds to check attributes and telemetry on the slave.","connect-attempt-time":"A waiting period in milliseconds before establishing a connection to the master.","connect-attempt-count":"The number of connection attempts made through the gateway.","wait-after-failed-attempts":"A waiting period in milliseconds before attempting to send data to the master.","serial-port":"Serial port for connection.",baudrate:"Baud rate for the serial device.",stopbits:"The number of stop bits sent after each character in a message to indicate the end of the byte.",bytesize:"The number of bits in a byte of serial data. This can be one of 5, 6, 7, or 8.",parity:"The type of checksum used to verify data integrity. Options: (E)ven, (O)dd, (N)one.",strict:"Use inter-character timeout for baudrates ≤ 19200.","objects-count":"Depends on the selected type.",address:"Register address to verify.",key:"Key to be used as the attribute key for the platform instance.",method:"Method name to be used for the platform instance.","data-keys":"For more information about function codes and data types click on help icon",modifier:"The retrieved value will be adjusted (by multiplying or dividing it) based on the specified modifier value."},bacnet:{"object-id":"The gateway object identifier in the BACnet network.","vendor-id":"The gateway vendor identifier in the BACnet network","apdu-length":"Maximal length of the APDU.",segmentation:"Segmentation type for transmitting large BACnet messages.","key-object-id":"Object id in the BACnet device.","property-id":"Property id in the BACnet device.","request-type":"“writeProperty” to write data and “readProperty” to read data.","request-timeout":"Timeout to wait the response from the BACnet device, milliseconds.","device-timeout":"Period of time when the connector will try to discover BACnet devices.","network-number":"Identifier of the network segment."}}}},vt={gateway:{"add-entry":"إضافة تكوين",advanced:"متقدم","checking-device-activity":"فحص نشاط الجهاز",command:"أوامر Docker","command-copied-message":"تم نسخ أمر Docker إلى الحافظة",configuration:"التكوين","connector-add":"إضافة موصل جديد","connector-enabled":"تمكين الموصل","connector-name":"اسم الموصل","connector-name-required":"اسم الموصل مطلوب.","connector-type":"نوع الموصل","connector-type-required":"نوع الموصل مطلوب.",connectors:"الموصلات","connectors-config":"تكوينات الموصلات","connectors-table-enabled":"ممكّن","connectors-table-name":"الاسم","connectors-table-type":"النوع","connectors-table-status":"الحالة","connectors-table-actions":"الإجراءات","connectors-table-key":"المفتاح","connectors-table-class":"الفئة","rpc-command-send":"إرسال","rpc-command-result":"الاستجابة","rpc-command-edit-params":"تحرير المعلمات","gateway-configuration":"تكوين عام","docker-label":"استخدم التعليمات التالية لتشغيل IoT Gateway في Docker compose مع بيانات اعتماد للجهاز المحدد","install-docker-compose":"استخدم التعليمات لتنزيل وتثبيت وإعداد docker compose","download-configuration-file":"تنزيل ملف التكوين","download-docker-compose":"تنزيل docker-compose.yml لبوابتك","launch-gateway":"تشغيل البوابة","launch-docker-compose":"بدء تشغيل البوابة باستخدام الأمر التالي في الطرفية من المجلد الذي يحتوي على ملف docker-compose.yml","create-new-gateway":"إنشاء بوابة جديدة","create-new-gateway-text":"هل أنت متأكد أنك تريد إنشاء بوابة جديدة باسم: '{{gatewayName}}'؟","created-time":"وقت الإنشاء","configuration-delete-dialog-header":"سيتم حذف التكوينات","configuration-delete-dialog-body":"يمكن تعطيل التكوين عن بُعد فقط إذا كان هناك وصول جسدي إلى البوابة. ستتم حذف جميع التكوينات السابقة.

\n لتعطيل التكوين، أدخل اسم البوابة أدناه","configuration-delete-dialog-input":"اسم البوابة","configuration-delete-dialog-input-required":"اسم البوابة إلزامي","configuration-delete-dialog-confirm":"إيقاف التشغيل",delete:"حذف التكوين","download-tip":"تنزيل ملف التكوين","drop-file":"أفلق الملف هنا أو",gateway:"البوابة","gateway-exists":"الجهاز بنفس الاسم موجود بالفعل.","gateway-name":"اسم البوابة","gateway-name-required":"اسم البوابة مطلوب.","gateway-saved":"تم حفظ تكوين البوابة بنجاح.",grpc:"GRPC","grpc-keep-alive-timeout":"مهلة البقاء على قيد الحياة (بالمللي ثانية)","grpc-keep-alive-timeout-required":"مهلة البقاء على قيد الحياة مطلوبة","grpc-keep-alive-timeout-min":"مهلة البقاء على قيد الحياة لا يمكن أن تكون أقل من 1","grpc-keep-alive-timeout-pattern":"مهلة البقاء على قيد الحياة غير صالحة","grpc-keep-alive":"البقاء على قيد الحياة (بالمللي ثانية)","grpc-keep-alive-required":"البقاء على قيد الحياة مطلوب","grpc-keep-alive-min":"البقاء على قيد الحياة لا يمكن أن يكون أقل من 1","grpc-keep-alive-pattern":"البقاء على قيد الحياة غير صالح","grpc-min-time-between-pings":"الحد الأدنى للوقت بين البينغات (بالمللي ثانية)","grpc-min-time-between-pings-required":"الحد الأدنى للوقت بين البينغات مطلوب","grpc-min-time-between-pings-min":"الحد الأدنى للوقت بين البينغات لا يمكن أن يكون أقل من 1","grpc-min-time-between-pings-pattern":"الحد الأدنى للوقت بين البينغات غير صالح","grpc-min-ping-interval-without-data":"الحد الأدنى لفاصل البينغ بدون بيانات (بالمللي ثانية)","grpc-min-ping-interval-without-data-required":"الحد الأدنى لفاصل البينغ بدون بيانات مطلوب","grpc-min-ping-interval-without-data-min":"الحد الأدنى لفاصل البينغ بدون بيانات لا يمكن أن يكون أقل من 1","grpc-min-ping-interval-without-data-pattern":"الحد الأدنى لفاصل البينغ بدون بيانات غير صالح","grpc-max-pings-without-data":"الحد الأقصى لعدد البينغات بدون بيانات","grpc-max-pings-without-data-required":"الحد الأقصى لعدد البينغات بدون بيانات مطلوب","grpc-max-pings-without-data-min":"الحد الأقصى لعدد البينغات بدون بيانات لا يمكن أن يكون أقل من 1","grpc-max-pings-without-data-pattern":"الحد الأقصى لعدد البينغات بدون بيانات غير صالح","inactivity-check-period-seconds":"فترة فحص الخمول (بالثواني)","inactivity-check-period-seconds-required":"فترة فحص الخمول مطلوبة","inactivity-check-period-seconds-min":"فترة فحص الخمول لا يمكن أن تكون أقل من 1","inactivity-check-period-seconds-pattern":"فترة فحص الخمول غير صالحة","inactivity-timeout-seconds":"فترة الخمول (بالثواني)","inactivity-timeout-seconds-required":"فترة الخمول مطلوبة","inactivity-timeout-seconds-min":"فترة الخمول لا يمكن أن تكون أقل من 1","inactivity-timeout-seconds-pattern":"فترة الخمول غير صالحة","json-parse":"JSON غير صالح.","json-required":"الحقل لا يمكن أن يكون فارغًا.",logs:{logs:"السجلات",days:"أيام",hours:"ساعات",minutes:"دقائق",seconds:"ثواني","date-format":"تنسيق التاريخ","date-format-required":"تنسيق التاريخ مطلوب","log-format":"تنسيق السجل","log-type":"نوع السجل","log-format-required":"تنسيق السجل مطلوب",remote:"التسجيل عن بُعد","remote-logs":"السجلات عن بُعد",local:"التسجيل المحلي",level:"مستوى السجل","file-path":"مسار الملف","file-path-required":"مسار الملف مطلوب","saving-period":"فترة حفظ السجل","saving-period-min":"فترة حفظ السجل لا يمكن أن تكون أقل من 1","saving-period-required":"فترة حفظ السجل مطلوبة","backup-count":"عدد النسخ الاحتياطية","backup-count-min":"عدد النسخ الاحتياطية لا يمكن أن يكون أقل من 1","backup-count-required":"عدد النسخ الاحتياطية مطلوب"},"min-pack-send-delay":"الحد الأدنى لتأخير إرسال الحزمة (بالمللي ثانية)","min-pack-send-delay-required":"الحد الأدنى لتأخير إرسال الحزمة مطلوب","min-pack-send-delay-min":"لا يمكن أن يكون الحد الأدنى لتأخير إرسال الحزمة أقل من 0","no-connectors":"لا توجد موصلات","no-data":"لا توجد تكوينات","no-gateway-found":"لم يتم العثور على بوابة.","no-gateway-matching":"'{{item}}' غير موجود.","path-logs":"مسار إلى ملفات السجل","path-logs-required":"المسار مطلوب.","permit-without-calls":"البقاء على الحياة يسمح بدون مكالمات",remote:"التكوين عن بُعد","remote-logging-level":"مستوى التسجيل","remove-entry":"إزالة التكوين","remote-shell":"قشرة عن بُعد","remote-configuration":"التكوين عن بُعد",other:"آخر","save-tip":"حفظ ملف التكوين","security-type":"نوع الأمان","security-types":{"access-token":"رمز الوصول","username-password":"اسم المستخدم وكلمة المرور",tls:"TLS","tls-access-token":"TLS + رمز الوصول","tls-private-key":"TLS + المفتاح الخاص"},"server-port":"منفذ الخادم",statistics:{statistic:"إحصائية",statistics:"الإحصائيات","statistic-commands-empty":"لا تتوفر إحصائيات",commands:"الأوامر","send-period":"فترة إرسال الإحصائيات (بالثواني)","send-period-required":"فترة إرسال الإحصائيات مطلوبة","send-period-min":"لا يمكن أن تكون فترة إرسال الإحصائيات أقل من 60","send-period-pattern":"فترة إرسال الإحصائيات غير صالحة","check-connectors-configuration":"فترة فحص تكوين الموصلات (بالثواني)","check-connectors-configuration-required":"فترة فحص تكوين الموصلات مطلوبة","check-connectors-configuration-min":"لا يمكن أن تكون فترة فحص تكوين الموصلات أقل من 1","check-connectors-configuration-pattern":"فترة فحص تكوين الموصلات غير صالحة",add:"إضافة أمر",timeout:"المهلة","timeout-required":"المهلة مطلوبة","timeout-min":"لا يمكن أن تكون المهلة أقل من 1","timeout-pattern":"المهلة غير صالحة","attribute-name":"اسم السمة","attribute-name-required":"اسم السمة مطلوب",command:"الأمر","command-required":"الأمر مطلوب","command-pattern":"الأمر غير صالح",remove:"إزالة الأمر"},storage:"التخزين","storage-max-file-records":"السجلات القصوى في الملف","storage-max-files":"الحد الأقصى لعدد الملفات","storage-max-files-min":"الحد الأدنى هو 1.","storage-max-files-pattern":"العدد غير صالح.","storage-max-files-required":"العدد مطلوب.","storage-max-records":"السجلات القصوى في التخزين","storage-max-records-min":"الحد الأدنى لعدد السجلات هو 1.","storage-max-records-pattern":"العدد غير صالح.","storage-max-records-required":"السجلات القصوى مطلوبة.","storage-read-record-count":"عدد قراءة السجلات في التخزين","storage-read-record-count-min":"الحد الأدنى لعدد السجلات هو 1.","storage-read-record-count-pattern":"العدد غير صالح.","storage-read-record-count-required":"عدد قراءة السجلات مطلوب.","storage-max-read-record-count":"الحد الأقصى لعدد قراءة السجلات في التخزين","storage-max-read-record-count-min":"الحد الأدنى لعدد السجلات هو 1.","storage-max-read-record-count-pattern":"العدد غير صالح.","storage-max-read-record-count-required":"عدد القراءة القصوى مطلوب.","storage-data-folder-path":"مسار مجلد البيانات","storage-data-folder-path-required":"مسار مجلد البيانات مطلوب.","storage-pack-size":"الحد الأقصى لحجم حزمة الحدث","storage-pack-size-min":"الحد الأدنى هو 1.","storage-pack-size-pattern":"العدد غير صالح.","storage-pack-size-required":"الحجم الأقصى لحزمة الحدث مطلوب.","storage-path":"مسار التخزين","storage-path-required":"مسار التخزين مطلوب.","storage-type":"نوع التخزين","storage-types":{"file-storage":"تخزين الملفات","memory-storage":"تخزين الذاكرة",sqlite:"SQLITE"},thingsboard:"ثينغزبورد",general:"عام","thingsboard-host":"مضيف ثينغزبورد","thingsboard-host-required":"المضيف مطلوب.","thingsboard-port":"منفذ ثينغزبورد","thingsboard-port-max":"الحد الأقصى لرقم المنفذ هو 65535.","thingsboard-port-min":"الحد الأدنى لرقم المنفذ هو 1.","thingsboard-port-pattern":"المنفذ غير صالح.","thingsboard-port-required":"المنفذ مطلوب.",tidy:"ترتيب","tidy-tip":"ترتيب تكوين JSON","title-connectors-json":"تكوين موصل {{typeName}}","tls-path-ca-certificate":"المسار إلى شهادة CA على البوابة","tls-path-client-certificate":"المسار إلى شهادة العميل على البوابة","messages-ttl-check-in-hours":"فحص TTL الرسائل بالساعات","messages-ttl-check-in-hours-required":"يجب تحديد فحص TTL الرسائل بالساعات.","messages-ttl-check-in-hours-min":"الحد الأدنى هو 1.","messages-ttl-check-in-hours-pattern":"الرقم غير صالح.","messages-ttl-in-days":"TTL الرسائل بالأيام","messages-ttl-in-days-required":"يجب تحديد TTL الرسائل بالأيام.","messages-ttl-in-days-min":"الحد الأدنى هو 1.","messages-ttl-in-days-pattern":"الرقم غير صالح.","mqtt-qos":"جودة الخدمة (QoS)","mqtt-qos-required":"جودة الخدمة (QoS) مطلوبة","mqtt-qos-range":"تتراوح قيم جودة الخدمة (QoS) من 0 إلى 1","tls-path-private-key":"المسار إلى المفتاح الخاص على البوابة","toggle-fullscreen":"تبديل وضع ملء الشاشة","transformer-json-config":"تكوين JSON*","update-config":"إضافة/تحديث تكوين JSON",hints:{"remote-configuration":"يمكنك تمكين التكوين وإدارة البوابة عن بُعد","remote-shell":"يمكنك تمكين التحكم البعيد في نظام التشغيل مع البوابة من عنصر واجهة المستخدم قشرة عن بُعد",host:"اسم المضيف أو عنوان IP لخادم ثينغزبورد",port:"منفذ خدمة MQTT على خادم ثينغزبورد",token:"رمز الوصول للبوابة من خادم ثينغزبورد","client-id":"معرف عميل MQTT للبوابة من خادم ثينغزبورد",username:"اسم المستخدم MQTT للبوابة من خادم ثينغزبورد",password:"كلمة المرور MQTT للبوابة من خادم ثينغزبورد","ca-cert":"المسار إلى ملف شهادة CA","date-form":"تنسيق التاريخ في رسالة السجل","data-folder":"المسار إلى المجلد الذي سيحتوي على البيانات (نسبي أو مطلق)","log-format":"تنسيق رسالة السجل","remote-log":"يمكنك تمكين التسجيل البعيد وقراءة السجلات من البوابة","backup-count":"إذا كان عدد النسخ الاحتياطية > 0، عند عملية تدوير، لا يتم الاحتفاظ بأكثر من عدد النسخ الاحتياطية المحددة - يتم حذف الأقدم",storage:"يوفر تكوينًا لحفظ البيانات الواردة قبل إرسالها إلى المنصة","max-file-count":"العدد الأقصى لعدد الملفات التي سيتم إنشاؤها","max-read-count":"عدد الرسائل للحصول عليها من التخزين وإرسالها إلى ثينغزبورد","max-records":"العدد الأقصى للسجلات التي ستخزن في ملف واحد","read-record-count":"عدد الرسائل للحصول عليها من التخزين وإرسالها إلى ثينغزبورد","max-records-count":"العدد الأقصى للبيانات في التخزين قبل إرسالها إلى ثينغزبورد","ttl-check-hour":"كم مرة سيتحقق البوابة من البيانات القديمة","ttl-messages-day":"الحد الأقصى لعدد الأيام التي ستحتفظ فيها التخزين بالبيانات",commands:"الأوامر لجمع الإحصائيات الإضافية",attribute:"مفتاح تلقي الإحصائيات",timeout:"مهلة زمنية لتنفيذ الأمر",command:"سيتم استخدام نتيجة تنفيذ الأمر كقيمة لتلقي الإحصائيات","check-device-activity":"يمكنك تمكين مراقبة نشاط كل جهاز متصل","inactivity-timeout":"الوقت بعد الذي ستفصل البوابة الجهاز","inactivity-period":"تكرار فحص نشاط الجهاز","minimal-pack-delay":"التأخير بين إرسال حزم الرسائل (يؤدي تقليل هذا الإعداد إلى زيادة استخدام وحدة المعالجة المركزية)",qos:"جودة الخدمة في رسائل MQTT (0 - على الأكثر مرة واحدة، 1 - على الأقل مرة واحدة)","server-port":"منفذ الشبكة الذي سيستمع فيه خادم GRPC للاستفسارات الواردة.","grpc-keep-alive-timeout":"الحد الأقصى للوقت الذي يجب أن ينتظره الخادم لاستجابة رسالة الحفاظ على الاتصال قبل اعتبار الاتصال ميتًا.","grpc-keep-alive":"المدة بين رسائل حفظ الاتصال المتعاقبة عند عدم وجود استدعاء RPC نشط.","grpc-min-time-between-pings":"الحد الأدنى للوقت الذي يجب فيه أن ينتظر الخادم بين إرسال رسائل حفظ الاتصال","grpc-max-pings-without-data":"الحد الأقصى لعدد رسائل حفظ الاتصال التي يمكن للخادم إرسالها دون تلقي أي بيانات قبل اعتبار الاتصال ميتًا.","grpc-min-ping-interval-without-data":"الحد الأدنى للوقت الذي يجب فيه أن ينتظر الخادم بين إرسال رسائل حفظ الاتصال عند عدم إرسال أو استلام بيانات.","permit-without-calls":"السماح للخادم بإبقاء اتصال GRPC حيًا حتى عندما لا تكون هناك استدعاءات RPC نشطة."}}},xt={gateway:{"add-entry":"Afegir configuració","connector-add":"Afegir conector","connector-enabled":"Activar conector","connector-name":"Nom conector","connector-name-required":"Cal nom conector.","connector-type":"Tipus conector","connector-type-required":"Cal tipus conector.",connectors:"Configuració de conectors","create-new-gateway":"Crear un gateway nou","create-new-gateway-text":"Crear un nou gateway amb el nom: '{{gatewayName}}'?",delete:"Esborrar configuració","download-tip":"Descarregar fitxer de configuració",gateway:"Gateway","gateway-exists":"Ja existeix un dispositiu amb el mateix nom.","gateway-name":"Nom de Gateway","gateway-name-required":"Cal un nom de gateway.","gateway-saved":"Configuració de gateway gravada satisfactòriament.","json-parse":"JSON no vàlid.","json-required":"El camp no pot ser buit.","no-connectors":"No hi ha conectors","no-data":"No hi ha configuracions","no-gateway-found":"No s'ha trobat cap gateway.","no-gateway-matching":" '{{item}}' no trobat.","path-logs":"Ruta als fitxers de log","path-logs-required":"Cal ruta.",remote:"Configuració remota","remote-logging-level":"Nivel de logging","remove-entry":"Esborrar configuració","save-tip":"Gravar fitxer de configuració","security-type":"Tipus de seguretat","security-types":{"access-token":"Token d'accés",tls:"TLS"},storage:"Grabació","storage-max-file-records":"Número màxim de registres en fitxer","storage-max-files":"Número màxim de fitxers","storage-max-files-min":"El número mínim és 1.","storage-max-files-pattern":"Número no vàlid.","storage-max-files-required":"Cal número.","storage-max-records":"Màxim de registres en el magatzem","storage-max-records-min":"El número mínim és 1.","storage-max-records-pattern":"Número no vàlid.","storage-max-records-required":"Cal número.","storage-pack-size":"Mida màxim de esdeveniments","storage-pack-size-min":"El número mínim és 1.","storage-pack-size-pattern":"Número no vàlid.","storage-pack-size-required":"Cal número.","storage-path":"Ruta de magatzem","storage-path-required":"Cal ruta de magatzem.","storage-type":"Tipus de magatzem","storage-types":{"file-storage":"Magatzem fitxer","memory-storage":"Magatzem en memoria"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Cal Host.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"El port màxim és 65535.","thingsboard-port-min":"El port mínim és 1.","thingsboard-port-pattern":"Port no vàlid.","thingsboard-port-required":"Cal port.",tidy:"Endreçat","tidy-tip":"Endreçat JSON","title-connectors-json":"Configuració conector {{typeName}}","tls-path-ca-certificate":"Ruta al certificat CA al gateway","tls-path-client-certificate":"Ruta al certificat client al gateway","tls-path-private-key":"Ruta a la clau privada al gateway","toggle-fullscreen":"Pantalla completa fullscreen","transformer-json-config":"Configuració JSON*","update-config":"Afegir/actualizar configuració JSON"}},bt={gateway:{"add-entry":"Přidat konfiguraci","connector-add":"Přidat nový konektor","connector-enabled":"Povolit konektor","connector-name":"Název konektoru","connector-name-required":"Název konektoru je povinný.","connector-type":"Typ konektoru","connector-type-required":"Typ konektoru je povinný.",connectors:"Konfigurace konektoru","create-new-gateway":"Vytvořit novou bránu","create-new-gateway-text":"Jste si jisti, že chcete vytvořit novou bránu s názvem: '{{gatewayName}}'?",delete:"Smazat konfiguraci","download-tip":"Stáhnout soubor konfigurace",gateway:"Brána","gateway-exists":"Zařízení se shodným názvem již existuje.","gateway-name":"Název brány","gateway-name-required":"Název brány je povinný.","gateway-saved":"Konfigurace brány byla úspěšně uložena.","json-parse":"Neplatný JSON.","json-required":"Pole nemůže být prázdné.","no-connectors":"Žádné konektory","no-data":"Žádné konfigurace","no-gateway-found":"Žádné brány nebyly nalezeny.","no-gateway-matching":" '{{item}}' nenalezena.","path-logs":"Cesta k souborům logu","path-logs-required":"Cesta je povinná.",remote:"Vzdálená konfigurace","remote-logging-level":"Úroveň logování","remove-entry":"Odstranit konfiguraci","save-tip":"Uložit soubor konfigurace","security-type":"Typ zabezpečení","security-types":{"access-token":"Přístupový token",tls:"TLS"},storage:"Úložiště","storage-max-file-records":"Maximální počet záznamů v souboru","storage-max-files":"Maximální počet souborů","storage-max-files-min":"Minimální počet je 1.","storage-max-files-pattern":"Počet není platný.","storage-max-files-required":"Počet je povinný.","storage-max-records":"Maximální počet záznamů v úložišti","storage-max-records-min":"Minimální počet záznamů je 1.","storage-max-records-pattern":"Počet není platný.","storage-max-records-required":"Maximální počet záznamů je povinný.","storage-pack-size":"Maximální velikost souboru událostí","storage-pack-size-min":"Minimální počet je 1.","storage-pack-size-pattern":"Počet není platný.","storage-pack-size-required":"Maximální velikost souboru událostí je povinná.","storage-path":"Cesta k úložišti","storage-path-required":"Cesta k úložišti je povinná.","storage-type":"Typ úložiště","storage-types":{"file-storage":"Soubor","memory-storage":"Paměť"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Host je povinný.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"Maximální číslo portu je 65535.","thingsboard-port-min":"Minimální číslo portu je 1.","thingsboard-port-pattern":"Port není platný.","thingsboard-port-required":"Port je povinný.",tidy:"Uspořádat","tidy-tip":"Uspořádat JSON konfiguraci","title-connectors-json":"Konfigurace {{typeName}} konektoru","tls-path-ca-certificate":"Cesta k certifikátu CA brány","tls-path-client-certificate":"Cesta k certifikátu klienta brány","tls-path-private-key":"Cesta k privátnímu klíči brány","toggle-fullscreen":"Přepnout do režimu celé obrazovky","transformer-json-config":"JSON* konfigurace","update-config":"Přidat/editovat JSON konfiguraci"}},wt={gateway:{"add-entry":"Tilføj konfiguration","connector-add":"Tilføj ny stikforbindelse","connector-enabled":"Aktivér stikforbindelse","connector-name":"Navn på stikforbindelse","connector-name-required":"Navn på stikforbindelse er påkrævet.","connector-type":"Stikforbindelsestype","connector-type-required":"Stikforbindelsestype er påkrævet.",connectors:"Konfiguration af stikforbindelser","create-new-gateway":"Opret en ny gateway","create-new-gateway-text":"",delete:"Slet konfiguration","download-tip":"Download konfigurationsfil",gateway:"Gateway","gateway-exists":"Enhed med samme navn findes allerede.","gateway-name":"Gateway-navn","gateway-name-required":"Gateway-navn er påkrævet.","gateway-saved":"Gateway-konfigurationen blev gemt.","json-parse":"Ikke gyldig JSON.","json-required":"Feltet må ikke være tomt.","no-connectors":"Ingen stikforbindelser","no-data":"Ingen konfigurationer","no-gateway-found":"Ingen gateway fundet.","no-gateway-matching":"","path-logs":"Sti til logfiler","path-logs-required":"Sti er påkrævet.",remote:"Fjernkonfiguration","remote-logging-level":"Logføringsniveau","remove-entry":"Fjern konfiguration","save-tip":"Gem konfigurationsfil","security-type":"Sikkerhedstype","security-types":{"access-token":"Adgangstoken",tls:"TLS"},storage:"Lagring","storage-max-file-records":"Maks. antal poster i fil","storage-max-files":"Maks. antal filer","storage-max-files-min":"Min. antal er 1.","storage-max-files-pattern":"Antal er ikke gyldigt.","storage-max-files-required":"Antal er påkrævet.","storage-max-records":"Maks. antal poster i lagring","storage-max-records-min":"Min. antal poster er 1.","storage-max-records-pattern":"Antal er ikke gyldigt.","storage-max-records-required":"Maks. antal poster er påkrævet.","storage-pack-size":"Maks. antal pakkestørrelse for begivenhed","storage-pack-size-min":"Min. antal er 1.","storage-pack-size-pattern":"Antal er ikke gyldigt.","storage-pack-size-required":"Maks. antal pakkestørrelse for begivenhed er påkrævet.","storage-path":"Lagringssti","storage-path-required":"Lagringssti er påkrævet.","storage-type":"Lagringstype","storage-types":{"file-storage":"Lagring af filter","memory-storage":"Lagring af hukommelse"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard-vært","thingsboard-host-required":"Vært er påkrævet.","thingsboard-port":"ThingsBoard-port","thingsboard-port-max":"Maks. portnummer er 65535.","thingsboard-port-min":"Min. portnummer er 1.","thingsboard-port-pattern":"Port er ikke gyldig.","thingsboard-port-required":"Port er påkrævet.",tidy:"Tidy","tidy-tip":"Tidy konfig. JSON","title-connectors-json":"","tls-path-ca-certificate":"Sti til CA-certifikat på gateway","tls-path-client-certificate":"Sti til klientcertifikat på gateway","tls-path-private-key":"Sti til privat nøgle på gateway","toggle-fullscreen":"Skift til fuld skærm","transformer-json-config":"Konfiguration JSON*","update-config":"Tilføj/opdater konfiguration JSON"}},St={gateway:{"add-entry":"Añadir configuración",advanced:"Avanzado","checking-device-activity":"Probando actividad de dispositivo",command:"Comandos Docker","command-copied-message":"Se han copiado los comandos al portapapeles",configuration:"Configuración","connector-add":"Añadir conector","connector-enabled":"Activar conector","connector-name":"Nombre conector","connector-name-required":"Se requiere nombre conector.","connector-type":"Tipo conector","connector-type-required":"Se requiere tipo conector.",connectors:"Conectores","connectors-config":"Configuración de conectores","connectors-table-enabled":"Enabled","connectors-table-name":"Nombre","connectors-table-type":"Tipo","connectors-table-status":"Estado","connectors-table-actions":"Acciones","connectors-table-key":"Clave","connectors-table-class":"Clase","rpc-command-send":"Enviar","rpc-command-result":"Resultado","rpc-command-edit-params":"Editar parametros","gateway-configuration":"Configuración General","create-new-gateway":"Crear un gateway nuevo","create-new-gateway-text":"Crear un nuevo gateway con el nombre: '{{gatewayName}}'?","created-time":"Hora de creación","configuration-delete-dialog-header":"Las configuraciones se borrarán","configuration-delete-dialog-body":"Sólo es posible desactivar la configuración remota, si hay acceso físico al gateway. Se borrarán todas las configuraciones previas.

\nPara desactivar la configuración, introduce el nombre del gateway aquí","configuration-delete-dialog-input":"Nombre Gateway","configuration-delete-dialog-input-required":"Se requiere nombre de gateway","configuration-delete-dialog-confirm":"Desactivar",delete:"Borrar configuración","download-tip":"Descargar fichero de configuración","drop-file":"Arrastra un fichero o",gateway:"Gateway","gateway-exists":"Ya existe un dispositivo con el mismo nombre.","gateway-name":"Nombre de Gateway","gateway-name-required":"Se requiere un nombre de gateway.","gateway-saved":"Configuración de gateway grabada satisfactoriamente.",grpc:"GRPC","grpc-keep-alive-timeout":"Timeout Keep alive (en ms)","grpc-keep-alive-timeout-required":"Se requiere Timeout Keep alive","grpc-keep-alive-timeout-min":"El valor no puede ser menor de 1","grpc-keep-alive-timeout-pattern":"El valor no es válido","grpc-keep-alive":"Keep alive (en ms)","grpc-keep-alive-required":"Se requiere keep alive","grpc-keep-alive-min":"El valor no puede ser menor de 1","grpc-keep-alive-pattern":"El valor keep alive no es válido","grpc-min-time-between-pings":"Tiempo mínimo entre pings (en ms)","grpc-min-time-between-pings-required":"Se requiere tiempo mínimo entre pings","grpc-min-time-between-pings-min":"El valor no puede ser menor de 1","grpc-min-time-between-pings-pattern":"El valor de tiempo mínimo entre pings no es válido","grpc-min-ping-interval-without-data":"Intervalo mínimo sin datos (en ms)","grpc-min-ping-interval-without-data-required":"Se requiere intervalo","grpc-min-ping-interval-without-data-min":"El valor no puede ser menor de 1","grpc-min-ping-interval-without-data-pattern":"El valor de intervalo no es válido","grpc-max-pings-without-data":"Intervalo máximo sin datos","grpc-max-pings-without-data-required":"Se requiere intervalo","grpc-max-pings-without-data-min":"El valor no puede ser menor de 1","grpc-max-pings-without-data-pattern":"El valor de intervalo no es válido","inactivity-check-period-seconds":"Periodo de control de inactividad (en segundos)","inactivity-check-period-seconds-required":"Se requiere periodo","inactivity-check-period-seconds-min":"El valor no puede ser menor de 1","inactivity-check-period-seconds-pattern":"El valor del periodo no es válido","inactivity-timeout-seconds":"Timeout de inactividad (en segundos)","inactivity-timeout-seconds-required":"Se requiere timeout de inactividad","inactivity-timeout-seconds-min":"El valor no puede ser menor de 1","inactivity-timeout-seconds-pattern":"El valor de inactividad no es válido","json-parse":"JSON no válido.","json-required":"El campo no puede estar vacío.",logs:{logs:"Registros",days:"días",hours:"horas",minutes:"minutos",seconds:"segundos","date-format":"Formato de fecha","date-format-required":"Se requiere formato de fecha","log-format":"Formato de registro","log-type":"Tipo de registro","log-format-required":"Se requiere tipo de registro",remote:"Registro remoto","remote-logs":"Registro remoto",local:"Registro local",level:"Nivel de registro","file-path":"Ruta de fichero","file-path-required":"Se requiere ruta de fichero","saving-period":"Periodo de guardado de registros","saving-period-min":"El periodo no puede ser menor que 1","saving-period-required":"Se requiere periodo de guardado","backup-count":"Número de backups","backup-count-min":"El número de backups no puede ser menor que 1","backup-count-required":"Se requiere número de backups"},"min-pack-send-delay":"Tiempo de espera, envío de paquetes (en ms)","min-pack-send-delay-required":"Se requiere tiempo de espera","min-pack-send-delay-min":"El tiempo de espera no puede ser menor que 0","no-connectors":"No hay conectores","no-data":"No hay configuraciones","no-gateway-found":"No se ha encontrado ningún gateway.","no-gateway-matching":" '{{item}}' no encontrado.","path-logs":"Ruta a los archivos de log","path-logs-required":"Ruta requerida.","permit-without-calls":"Permitir Keep alive si llamadas",remote:"Configuración remota","remote-logging-level":"Nivel de logging","remove-entry":"Borrar configuración","remote-shell":"Consola remota","remote-configuration":"Configuración remota",other:"otros","save-tip":"Grabar fichero de configuración","security-type":"Tipo de seguridad","security-types":{"access-token":"Tóken de acceso","username-password":"Usuario y contraseña",tls:"TLS","tls-access-token":"TLS + Tóken de acceso","tls-private-key":"TLS + Clave privada"},"server-port":"Puerto del servidor",statistics:{statistic:"Estadística",statistics:"Estadísticas","statistic-commands-empty":"No hay estadísticas",commands:"Comandos","send-period":"Periodo de envío de estadísticas (en segundos)","send-period-required":"Se requiere periodo de envío","send-period-min":"El periodo de envío no puede ser menor de 60","send-period-pattern":"El periodo de envío no es válido","check-connectors-configuration":"Revisar configuración de conectores (en segundos)","check-connectors-configuration-required":"Se requiere un valor","check-connectors-configuration-min":"El valor no puede ser menor de 1","check-connectors-configuration-pattern":"La configuración no es válida",add:"Añadir comando",timeout:"Timeout","timeout-required":"Se requiere timeout","timeout-min":"El timeout no puede ser menor de 1","timeout-pattern":"El timeout no es válido","attribute-name":"Nombre de atributo","attribute-name-required":"Se requiere nombre de atributo",command:"Comando","command-required":"Se requiere comando",remove:"Borrar comando"},storage:"Grabación","storage-max-file-records":"Número máximo de registros en fichero","storage-max-files":"Número máximo de ficheros","storage-max-files-min":"El número mínimo es 1.","storage-max-files-pattern":"Número no válido.","storage-max-files-required":"Se requiere número.","storage-max-records":"Máximo de registros en el almacén","storage-max-records-min":"El número mínimo es 1.","storage-max-records-pattern":"Número no válido.","storage-max-records-required":"Se requiere número.","storage-read-record-count":"Leer número de entradas en almacén","storage-read-record-count-min":"El número mínimo de entradas es 1.","storage-read-record-count-pattern":"El número no es válido.","storage-read-record-count-required":"Se requiere número de entradas.","storage-max-read-record-count":"Número máximo de entradas en el almacén","storage-max-read-record-count-min":"El número mínimo es 1.","storage-max-read-record-count-pattern":"El número no es válido","storage-max-read-record-count-required":"Se requiere número máximo de entradas.","storage-data-folder-path":"Ruta de carpeta de datos","storage-data-folder-path-required":"Se requiere ruta.","storage-pack-size":"Tamaño máximo de eventos","storage-pack-size-min":"El número mínimo es 1.","storage-pack-size-pattern":"Número no válido.","storage-pack-size-required":"Se requiere número.","storage-path":"Ruta de almacén","storage-path-required":"Se requiere ruta de almacén.","storage-type":"Tipo de almacén","storage-types":{"file-storage":"Almacén en fichero","memory-storage":"Almacén en memoria",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"Se requiere Host.","thingsboard-port":"Puerto ThingsBoard","thingsboard-port-max":"El puerto máximo es 65535.","thingsboard-port-min":"El puerto mínimo es 1.","thingsboard-port-pattern":"Puerto no válido.","thingsboard-port-required":"Se requiere puerto.",tidy:"Tidy","tidy-tip":"Tidy JSON","title-connectors-json":"Configuración conector {{typeName}}","tls-path-ca-certificate":"Ruta al certificado CA en el gateway","tls-path-client-certificate":"Ruta al certificado cliente en el gateway","messages-ttl-check-in-hours":"Comprobación de TTL de mensajes en horas","messages-ttl-check-in-hours-required":"Campo requerido.","messages-ttl-check-in-hours-min":"El mínimo es 1.","messages-ttl-check-in-hours-pattern":"El número no es válido.","messages-ttl-in-days":"TTL (Time to live) de mensages en días","messages-ttl-in-days-required":"Se requiere TTL de mensajes.","messages-ttl-in-days-min":"El número mínimo es 1.","messages-ttl-in-days-pattern":"El número no es válido.","mqtt-qos":"QoS","mqtt-qos-required":"Se requiere QoS","mqtt-qos-range":"El rango de valores es desde 0 a 1","tls-path-private-key":"Ruta a la clave privada en el gateway","toggle-fullscreen":"Pantalla completa fullscreen","transformer-json-config":"Configuración JSON*","update-config":"Añadir/actualizar configuración JSON",hints:{"remote-configuration":"Habilita la administración y configuración remota del gateway","remote-shell":"Habilita el control remoto del sistema operativo del gateway desde el widget terminal remoto",host:"Hostname o dirección IP del servidor Thingsboard",port:"Puerto del servicio MQTT en el servidor Thingsboard",token:"Access token para el gateway","client-id":"ID de cliente MQTT para el gateway",username:"Usuario MQTT para el gateway",password:"Contraseña MQTT para el gateway","ca-cert":"Ruta al fichero del certificado CA","date-form":"Formato de fecha en los mensajes de registro","data-folder":"Ruta a la carpeta que contendrá los datos (Relativa o absoluta)","log-format":"Formato de mensajes en registro","remote-log":"Habilita el registro remoto y la posterior lectura desde el gateway","backup-count":"Si el contaje de copias de seguridad es mayor que 0, cuando se realice una renovación, no se conservan más que los archivos de recuento de copias de seguridad, los más antíguos se eliminarán",storage:"Provee la configuración para el grabado de datos entrantes antes de que se envíen a la plataforma","max-file-count":"Número máximo de ficheros que se crearán","max-read-count":"Númeo máximo de mensajes a obtener desde el disco y enviados a la plataforma","max-records":"Número máximo de registros que se guardarán en un solo fichero","read-record-count":"Número de mensages a obtener desde el almacenamiento y enviados a la plataforma","max-records-count":"Número máximo de datos en almacenamiento antes de enviar a la plataforma","ttl-check-hour":"Con qué frecuencia el gateway comprobará si los datos están obsoletos","ttl-messages-day":"Número máximo de días para la retención de datos en el almacén",commands:"Comandos para recoger estadísticas adicionales",attribute:"Clave de telemetría para estadísticas",timeout:"Timeout para la ejecución de comandos",command:"El resultado de la ejecución del comando, se usará como valor para la telemetría","check-device-activity":"Habilita la monitorización de cada uno de los dispositivos conectados","inactivity-timeout":"Tiempo tras que el gateway desconectará el dispositivo","inactivity-period":"Periodo de monitorización de actividad en el dispositivo","minimal-pack-delay":"Tiempo de espera entre envío de paquetes de mensajes (Un valor muy bajo, resultará en un aumento de uso de la CPU en el gateway)",qos:"Quality of Service en los mensajes MQTT (0 - at most once, 1 - at least once)","server-port":"Puerto de red en el cual el servidor GRPC escuchará conexiones entrantes.","grpc-keep-alive-timeout":"Tiempo máximo, el cual el servidor esperara un ping keepalive antes de considerar la conexión terminada.","grpc-keep-alive":"Duración entre dos pings keepalive cuando no haya llamada RPC activa.","grpc-min-time-between-pings":"Mínimo tiempo que el servidor debe esperar entre envíos de mensajes de ping","grpc-max-pings-without-data":"Número máximo de pings keepalive que el servidor puede enviar sin recibir ningún dato antes de considerar la conexión terminada.","grpc-min-ping-interval-without-data":"Mínimo tiempo que el servidor debe esperar entre envíos de ping keepalive cuando no haya ningún dato en envío o recepción.","permit-without-calls":"Permitir al servidor mantener la conexión GRPC abierta, cuando no haya llamadas RPC activas."}}},Ct={gateway:{"add-entry":"설정 추가","connector-add":"새로운 연결자 추가","connector-enabled":"Enable connector","connector-name":"Connector name","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors configuration","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?",delete:"Delete configuration","download-tip":"Download configuration file",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","path-logs":"Path to log files","path-logs-required":"Path is required.",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","save-tip":"Save configuration file","security-type":"Security type","security-types":{"access-token":"Access Token",tls:"TLS"},storage:"Storage","storage-max-file-records":"Maximum records in file","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host is required.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON"}},_t={gateway:{"add-entry":"Add configuration",advanced:"Advanced","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","connector-add":"Add new connector","connector-enabled":"Enable connector","connector-name":"Connector name","connector-name-required":"Connector name is required.","connector-type":"Connector type","connector-type-required":"Connector type is required.",connectors:"Connectors","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","rpc-command-send":"Send","rpc-command-result":"Result","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"In order to run ThingsBoard IoT gateway in docker with credentials for this device you can use the following commands.","create-new-gateway":"Create a new gateway","create-new-gateway-text":"Are you sure you want create a new gateway with name: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off",delete:"Delete configuration","download-tip":"Download configuration file","drop-file":"Drop file here or",gateway:"Gateway","gateway-exists":"Device with same name is already exists.","gateway-name":"Gateway name","gateway-name-required":"Gateway name is required.","gateway-saved":"Gateway configuration successfully saved.",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","json-parse":"Not valid JSON.","json-required":"Field cannot be empty.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 0","no-connectors":"No connectors","no-data":"No configurations","no-gateway-found":"No gateway found.","no-gateway-matching":" '{{item}}' not found.","path-logs":"Path to log files","path-logs-required":"Path is required.","permit-without-calls":"Keep alive permit without calls",remote:"Remote configuration","remote-logging-level":"Logging level","remove-entry":"Remove configuration","remote-shell":"Remote shell","remote-configuration":"Remote Configuration",other:"Other","save-tip":"Save configuration file","security-type":"Security type","security-types":{"access-token":"Access Token","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"server-port":"Server port",statistics:{statistic:"Statistic",statistics:"Statistics","statistic-commands-empty":"No statistics available",commands:"Commands","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid",add:"Add command",timeout:"Timeout","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","attribute-name":"Attribute name","attribute-name-required":"Attribute name is required",command:"Command","command-required":"Command is required",remove:"Remove command"},storage:"Storage","storage-max-file-records":"Maximum records in file","storage-max-files":"Maximum number of files","storage-max-files-min":"Minimum number is 1.","storage-max-files-pattern":"Number is not valid.","storage-max-files-required":"Number is required.","storage-max-records":"Maximum records in storage","storage-max-records-min":"Minimum number of records is 1.","storage-max-records-pattern":"Number is not valid.","storage-max-records-required":"Maximum records is required.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count":"Max read record count in storage","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max Read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-pack-size":"Maximum event pack size","storage-pack-size-min":"Minimum number is 1.","storage-pack-size-pattern":"Number is not valid.","storage-pack-size-required":"Maximum event pack size is required.","storage-path":"Storage path","storage-path-required":"Storage path is required.","storage-type":"Storage type","storage-types":{"file-storage":"File storage","memory-storage":"Memory storage",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host is required.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maximum port number is 65535.","thingsboard-port-min":"Minimum port number is 1.","thingsboard-port-pattern":"Port is not valid.","thingsboard-port-required":"Port is required.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON",hints:{"remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of ThingsBoard server",port:"Port of MQTT service on ThingsBoard server",token:"Access token for the gateway from ThingsBoard server","client-id":"MQTT client id for the gateway form ThingsBoard server",username:"MQTT username for the gateway form ThingsBoard server",password:"MQTT password for the gateway form ThingsBoard server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","data-folder":"Path to folder, that will contains data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum count of file that will be created","max-read-count":"Count of messages to get from storage and send to ThingsBoard","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Count of messages to get from storage and send to ThingsBoard","max-records-count":"Maximum count of data in storage before send to ThingsBoard","ttl-check-hour":"How often will Gateway check data for obsolescence","ttl-messages-day":"Maximum days that storage will save data",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls."}}},Tt={gateway:{"add-entry":"Configuratie toevoegen","connector-add":"Nieuwe connector toevoegen","connector-enabled":"Connector inschakelen","connector-name":"Naam van de connector","connector-name-required":"De naam van de connector is vereist.","connector-type":"Type aansluiting","connector-type-required":"Het type connector is vereist.",connectors:"Configuratie van connectoren","create-new-gateway":"Een nieuwe gateway maken","create-new-gateway-text":"Weet u zeker dat u een nieuwe gateway wilt maken met de naam: '{{gatewayName}}'?",delete:"Configuratie verwijderen","download-tip":"Configuratiebestand downloaden",gateway:"Gateway","gateway-exists":"Device met dezelfde naam bestaat al.","gateway-name":"Naam van de gateway","gateway-name-required":"De naam van de gateway is vereist.","gateway-saved":"Gatewayconfiguratie succesvol opgeslagen.","json-parse":"Ongeldige JSON.","json-required":"Het veld mag niet leeg zijn.","no-connectors":"Geen connectoren","no-data":"Geen configuraties","no-gateway-found":"Geen gateway gevonden.","no-gateway-matching":"'{{item}}' niet gevonden.","path-logs":"Pad naar logbestanden","path-logs-required":"Pad is vereist.",remote:"Configuratie op afstand","remote-logging-level":"Registratie niveau","remove-entry":"Configuratie verwijderen","save-tip":"Configuratiebestand opslaan","security-type":"Soort beveiliging","security-types":{"access-token":"Toegang tot token",tls:"TLS (TLS)"},storage:"Opslag","storage-max-file-records":"Maximum aantal records in bestand","storage-max-files":"Maximaal aantal bestanden","storage-max-files-min":"Minimum aantal is 1.","storage-max-files-pattern":"Nummer is niet geldig.","storage-max-files-required":"Nummer is vereist.","storage-max-records":"Maximum aantal records in opslag","storage-max-records-min":"Minimum aantal records is 1.","storage-max-records-pattern":"Nummer is niet geldig.","storage-max-records-required":"Maximale records zijn vereist.","storage-pack-size":"Maximale pakketgrootte voor events","storage-pack-size-min":"Minimum aantal is 1.","storage-pack-size-pattern":"Nummer is niet geldig.","storage-pack-size-required":"De maximale pakketgrootte van het event is vereist.","storage-path":"Opslag pad","storage-path-required":"Opslagpad is vereist.","storage-type":"Type opslag","storage-types":{"file-storage":"Opslag van bestanden","memory-storage":"Geheugen opslag"},thingsboard:"Dingen Bord","thingsboard-host":"ThingsBoard-gastheer","thingsboard-host-required":"Server host is vereist.","thingsboard-port":"ThingsBoard-poort","thingsboard-port-max":"Het maximale poortnummer is 65535.","thingsboard-port-min":"Het minimale poortnummer is 1.","thingsboard-port-pattern":"Poort is niet geldig.","thingsboard-port-required":"Poort is vereist.",tidy:"Ordelijk","tidy-tip":"Opgeruimde configuratie JSON","title-connectors-json":"Configuratie van connector {{typeName}}","tls-path-ca-certificate":"Pad naar CA-certificaat op gateway","tls-path-client-certificate":"Pad naar clientcertificaat op gateway","tls-path-private-key":"Pad naar privésleutel op gateway","toggle-fullscreen":"Volledig scherm in- en uitschakelen","transformer-json-config":"Configuratie JSON*","update-config":"Configuratie JSON toevoegen/bijwerken"}},It={gateway:{"add-entry":"Dodaj konfigurację",advanced:"Advanced","checking-device-activity":"Checking device activity",command:"Docker commands","command-copied-message":"Docker command has been copied to clipboard",configuration:"Configuration","connector-add":"Dodaj nowe złącze","connector-enabled":"Włącz złącze","connector-name":"Nazwa złącza","connector-name-required":"Nazwa złącza jest wymagana.","connector-type":"Typ złącza","connector-type-required":"Typ złącza jest wymagany.",connectors:"Konfiguracja złączy","connectors-config":"Connectors configuration","connectors-table-enabled":"Enabled","connectors-table-name":"Name","connectors-table-type":"Type","connectors-table-status":"Status","connectors-table-actions":"Actions","connectors-table-key":"Key","connectors-table-class":"Class","rpc-command-send":"Send","rpc-command-result":"Result","rpc-command-edit-params":"Edit parameters","gateway-configuration":"General Configuration","docker-label":"In order to run ThingsBoard IoT gateway in docker with credentials for this device you can use the following commands.","create-new-gateway":"Utwórz nowy gateway","create-new-gateway-text":"Czy na pewno chcesz utworzyć nowy gateway o nazwie: '{{gatewayName}}'?","created-time":"Created time","configuration-delete-dialog-header":"Configurations will be deleted","configuration-delete-dialog-body":"Turning off Remote Configuration is possible only if there is physical access to the Gateway. All previous configurations will be deleted.

\nTo turn off configuration, enter gateway name below","configuration-delete-dialog-input":"Gateway name","configuration-delete-dialog-input-required":"Gateway name is mandatory","configuration-delete-dialog-confirm":"Turn Off",delete:"Usuń konfigurację","download-tip":"Pobierz plik konfiguracyjny","drop-file":"Drop file here or",gateway:"Wejście","gateway-exists":"Urządzenie o tej samej nazwie już istnieje.","gateway-name":"Nazwa Gateway","gateway-name-required":"Nazwa Gateway'a jest wymagana.","gateway-saved":"Konfiguracja Gatewey'a została pomyślnie zapisana.",grpc:"GRPC","grpc-keep-alive-timeout":"Keep alive timeout (in ms)","grpc-keep-alive-timeout-required":"Keep alive timeout is required","grpc-keep-alive-timeout-min":"Keep alive timeout can not be less then 1","grpc-keep-alive-timeout-pattern":"Keep alive timeout is not valid","grpc-keep-alive":"Keep alive (in ms)","grpc-keep-alive-required":"Keep alive is required","grpc-keep-alive-min":"Keep alive can not be less then 1","grpc-keep-alive-pattern":"Keep alive is not valid","grpc-min-time-between-pings":"Min time between pings (in ms)","grpc-min-time-between-pings-required":"Min time between pings is required","grpc-min-time-between-pings-min":"Min time between pings can not be less then 1","grpc-min-time-between-pings-pattern":"Min time between pings is not valid","grpc-min-ping-interval-without-data":"Min ping interval without data (in ms)","grpc-min-ping-interval-without-data-required":"Min ping interval without data is required","grpc-min-ping-interval-without-data-min":"Min ping interval without data can not be less then 1","grpc-min-ping-interval-without-data-pattern":"Min ping interval without data is not valid","grpc-max-pings-without-data":"Max pings without data","grpc-max-pings-without-data-required":"Max pings without data is required","grpc-max-pings-without-data-min":"Max pings without data can not be less then 1","grpc-max-pings-without-data-pattern":"Max pings without data is not valid","inactivity-check-period-seconds":"Inactivity check period (in sec)","inactivity-check-period-seconds-required":"Inactivity check period is required","inactivity-check-period-seconds-min":"Inactivity check period can not be less then 1","inactivity-check-period-seconds-pattern":"Inactivity check period is not valid","inactivity-timeout-seconds":"Inactivity timeout (in sec)","inactivity-timeout-seconds-required":"Inactivity timeout is required","inactivity-timeout-seconds-min":"Inactivity timeout can not be less then 1","inactivity-timeout-seconds-pattern":"Inactivity timeout is not valid","json-parse":"Nieprawidłowy JSON.","json-required":"Pole nie może być puste.",logs:{logs:"Logs",days:"days",hours:"hours",minutes:"minutes",seconds:"seconds","date-format":"Date format","date-format-required":"Date format required","log-format":"Log format","log-type":"Log type","log-format-required":"Log format required",remote:"Remote logging","remote-logs":"Remote logs",local:"Local logging",level:"Log level","file-path":"File path","file-path-required":"File path required","saving-period":"Log saving period","saving-period-min":"Log saving period can not be less then 1","saving-period-required":"Log saving period required","backup-count":"Backup count","backup-count-min":"Backup count can not be less then 1","backup-count-required":"Backup count required"},"min-pack-send-delay":"Min pack send delay (in ms)","min-pack-send-delay-required":"Min pack send delay is required","min-pack-send-delay-min":"Min pack send delay can not be less then 0","no-connectors":"Brak złączy","no-data":"Brak konfiguracji","no-gateway-found":"Nie znaleziono gateway'a.","no-gateway-matching":" '{{item}}' nie znaleziono.","path-logs":"Ścieżka do plików dziennika","path-logs-required":"Ścieżka jest wymagana.","permit-without-calls":"Keep alive permit without calls",remote:"Zdalna konfiguracja","remote-logging-level":"Poziom logowania","remove-entry":"Usuń konfigurację","remote-shell":"Remote shell","remote-configuration":"Remote Configuration",other:"Other","save-tip":"Zapisz plik konfiguracyjny","security-type":"Rodzaj zabezpieczenia","security-types":{"access-token":"Token dostępu","username-password":"Username and Password",tls:"TLS","tls-access-token":"TLS + Access Token","tls-private-key":"TLS + Private Key"},"server-port":"Server port",statistics:{statistic:"Statistic",statistics:"Statistics","statistic-commands-empty":"No statistics available",commands:"Commands","send-period":"Statistic send period (in sec)","send-period-required":"Statistic send period is required","send-period-min":"Statistic send period can not be less then 60","send-period-pattern":"Statistic send period is not valid","check-connectors-configuration":"Check connectors configuration (in sec)","check-connectors-configuration-required":"Check connectors configuration is required","check-connectors-configuration-min":"Check connectors configuration can not be less then 1","check-connectors-configuration-pattern":"Check connectors configuration is not valid",add:"Add command",timeout:"Timeout","timeout-required":"Timeout is required","timeout-min":"Timeout can not be less then 1","timeout-pattern":"Timeout is not valid","attribute-name":"Attribute name","attribute-name-required":"Attribute name is required",command:"Command","command-required":"Command is required",remove:"Remove command"},storage:"Składowanie","storage-max-file-records":"Maksymalna liczba rekordów w pliku","storage-max-files":"Maksymalna liczba plików","storage-max-files-min":"Minimalna liczba to 1.","storage-max-files-pattern":"Numer jest nieprawidłowy.","storage-max-files-required":"Numer jest wymagany.","storage-max-records":"Maksymalna liczba rekordów w pamięci","storage-max-records-min":"Minimalna liczba rekordów to 1.","storage-max-records-pattern":"Numer jest nieprawidłowy.","storage-max-records-required":"Maksymalna liczba rekordów jest wymagana.","storage-read-record-count":"Read record count in storage","storage-read-record-count-min":"Minimum number of records is 1.","storage-read-record-count-pattern":"Number is not valid.","storage-read-record-count-required":"Read record count is required.","storage-max-read-record-count":"Max read record count in storage","storage-max-read-record-count-min":"Minimum number of records is 1.","storage-max-read-record-count-pattern":"Number is not valid.","storage-max-read-record-count-required":"Max Read record count is required.","storage-data-folder-path":"Data folder path","storage-data-folder-path-required":"Data folder path is required.","storage-pack-size":"Maksymalny rozmiar pakietu wydarzeń","storage-pack-size-min":"Minimalna liczba to 1.","storage-pack-size-pattern":"Numer jest nieprawidłowy.","storage-pack-size-required":"Maksymalny rozmiar pakietu wydarzeń jest wymagany.","storage-path":"Ścieżka przechowywania","storage-path-required":"Ścieżka do przechowywania jest wymagana.","storage-type":"Typ składowania","storage-types":{"file-storage":"Nośnik danych","memory-storage":"Przechowywanie pamięci",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"General","thingsboard-host":"Gospodarz ThingsBoard","thingsboard-host-required":"Host jest wymagany.","thingsboard-port":"Port ThingsBoard","thingsboard-port-max":"Maksymalny numer portu to 65535.","thingsboard-port-min":"Minimalny numer portu to 1.","thingsboard-port-pattern":"Port jest nieprawidłowy.","thingsboard-port-required":"Port jest wymagany.",tidy:"Uporządkuj","tidy-tip":"Uporządkowana konfiguracja JSON","title-connectors-json":"Złącze {{typeName}} konfiguracja","tls-path-ca-certificate":"Ścieżka do certyfikatu CA na gateway","tls-path-client-certificate":"Ścieżka do certyfikatu klienta na gateway","messages-ttl-check-in-hours":"Messages TTL check in hours","messages-ttl-check-in-hours-required":"Messages TTL check in hours is required.","messages-ttl-check-in-hours-min":"Min number is 1.","messages-ttl-check-in-hours-pattern":"Number is not valid.","messages-ttl-in-days":"Messages TTL in days","messages-ttl-in-days-required":"Messages TTL in days is required.","messages-ttl-in-days-min":"Min number is 1.","messages-ttl-in-days-pattern":"Number is not valid.","mqtt-qos":"QoS","mqtt-qos-required":"QoS is required","mqtt-qos-range":"QoS values range is from 0 to 1","tls-path-private-key":"Ścieżka do klucza prywatnego na bramce","toggle-fullscreen":"Przełącz tryb pełnoekranowy","transformer-json-config":"Konfiguracja JSON*","update-config":"Dodaj/zaktualizuj konfigurację JSON",hints:{"remote-configuration":"Enables remote configuration and management of the gateway","remote-shell":"Enables remote control of the operating system with the gateway from the Remote Shell widget",host:"Hostname or IP address of ThingsBoard server",port:"Port of MQTT service on ThingsBoard server",token:"Access token for the gateway from ThingsBoard server","client-id":"MQTT client id for the gateway form ThingsBoard server",username:"MQTT username for the gateway form ThingsBoard server",password:"MQTT password for the gateway form ThingsBoard server","ca-cert":"Path to CA certificate file","date-form":"Date format in log message","data-folder":"Path to folder, that will contains data (Relative or Absolute)","log-format":"Log message format","remote-log":"Enables remote logging and logs reading from the gateway","backup-count":"If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",storage:"Provides configuration for saving incoming data before it is sent to the platform","max-file-count":"Maximum count of file that will be created","max-read-count":"Count of messages to get from storage and send to ThingsBoard","max-records":"Maximum count of records that will be stored in one file","read-record-count":"Count of messages to get from storage and send to ThingsBoard","max-records-count":"Maximum count of data in storage before send to ThingsBoard","ttl-check-hour":"How often will Gateway check data for obsolescence","ttl-messages-day":"Maximum days that storage will save data",commands:"Commands for collecting additional statistic",attribute:"Statistic telemetry key",timeout:"Timeout for command executing",command:"The result of the command execution, will be used as the value for telemetry","check-device-activity":"Enables monitor the activity of each connected device","inactivity-timeout":"Time after whose the gateway will disconnect device","inactivity-period":"Periodicity of device activity check","minimal-pack-delay":"Delay between sending packs of messages (Decreasing this setting results in increased CPU usage)",qos:"Quality of Service in MQTT messaging (0 - at most once, 1 - at least once)","server-port":"Network port on which GRPC server will listen for incoming connections.","grpc-keep-alive-timeout":"Maximum time the server should wait for a keepalive ping response before considering the connection dead.","grpc-keep-alive":"Duration between two successive keepalive ping messages when there is no active RPC call.","grpc-min-time-between-pings":"Minimum amount of time the server should wait between sending keepalive ping messages","grpc-max-pings-without-data":"Maximum number of keepalive ping messages that the server can send without receiving any data before it considers the connection dead.","grpc-min-ping-interval-without-data":"Minimum amount of time the server should wait between sending keepalive ping messages when there is no data being sent or received.","permit-without-calls":"Allow server to keep the GRPC connection alive even when there are no active RPC calls."}}},Et={gateway:{"add-entry":"Adicionar configuração","connector-add":"Adicionar novo conector","connector-enabled":"Habilitar conector","connector-name":"Nome do conector","connector-name-required":"O nome do conector é obrigatório.","connector-type":"Tipo de conector","connector-type-required":"O tipo de conector é obrigatório.",connectors:"Configuração de conectores","create-new-gateway":"Criar um novo gateway","create-new-gateway-text":"Tem certeza de que deseja criar um novo gateway com o nome: '{{gatewayName}}'?",delete:"Excluir configuração","download-tip":"Download de arquivo de configuração",gateway:"Gateway","gateway-exists":"Já existe um dispositivo com o mesmo nome.","gateway-name":"Nome do gateway","gateway-name-required":"O nome do gateway é obrigatório.","gateway-saved":"A configuração do gateway foi salva corretamente.","json-parse":"JSON inválido.","json-required":"O campo não pode estar em branco.","no-connectors":"Sem conectores","no-data":"Sem configurações","no-gateway-found":"Nenhum gateway encontrado.","no-gateway-matching":" '{{item}}' não encontrado.","path-logs":"Caminho para arquivos de log","path-logs-required":"O caminho é obrigatório",remote:"Configuração remota","remote-logging-level":"Nível de registro em log","remove-entry":"Remover configuração","save-tip":"Salvar arquivo de configuração","security-type":"Tipo de segurança","security-types":{"access-token":"Token de Acesso",tls:"TLS"},storage:"Armazenamento","storage-max-file-records":"Número máximo de registros em arquivo","storage-max-files":"Número máximo de arquivos","storage-max-files-min":"O número mínimo é 1.","storage-max-files-pattern":"O número não é válido.","storage-max-files-required":"O número é obrigatório.","storage-max-records":"Número máximo de registros em armazenamento","storage-max-records-min":"O número mínimo de registros é 1.","storage-max-records-pattern":"O número não é válido.","storage-max-records-required":"O número máximo de registros é obrigatório.","storage-pack-size":"Tamanho máximo de pacote de eventos","storage-pack-size-min":"O número mínimo é 1.","storage-pack-size-pattern":"O número não é válido.","storage-pack-size-required":"O tamanho máximo de pacote de eventos é obrigatório.","storage-path":"Caminho de armazenamento","storage-path-required":"O caminho de armazenamento é obrigatório.","storage-type":"Tipo de armazenamento","storage-types":{"file-storage":"Armazenamento de arquivo","memory-storage":"Armazenamento de memória"},thingsboard:"ThingsBoard","thingsboard-host":"Host ThingsBoard","thingsboard-host-required":"O host é obrigatório.","thingsboard-port":"Porta ThingsBoard","thingsboard-port-max":"O número máximo de portas é 65535.","thingsboard-port-min":"O número mínimo de portas é 1.","thingsboard-port-pattern":"A porta não é válida.","thingsboard-port-required":"A porta é obrigatória.",tidy:"Tidy","tidy-tip":"Config Tidy JSON","title-connectors-json":"Configuração do conector {{typeName}}","tls-path-ca-certificate":"Caminho para certificado de Autoridade de Certificação no gateway","tls-path-client-certificate":"Caminho para certificado de cliente no gateway","tls-path-private-key":"Caminho para chave privada no gateway","toggle-fullscreen":"Alternar tela inteira","transformer-json-config":"Configuração JSON*","update-config":"Adicionar/atualizar configuração de JSON"}},Mt={gateway:{"add-entry":"Dodaj konfiguracijo","connector-add":"Dodaj nov priključek","connector-enabled":"Omogoči priključek","connector-name":"Ime priključka","connector-name-required":"Ime priključka je obvezno.","connector-type":"Vrsta priključka","connector-type-required":"Zahteva se vrsta priključka.",connectors:"Konfiguracija priključkov","create-new-gateway":"Ustvari nov prehod","create-new-gateway-text":"Ali ste prepričani, da želite ustvariti nov prehod z imenom: '{{gatewayName}}'?",delete:"Izbriši konfiguracijo","download-tip":"Prenos konfiguracijske datoteke",gateway:"Prehod","gateway-exists":"Naprava z istim imenom že obstaja.","gateway-name":"Ime prehoda","gateway-name-required":"Ime prehoda je obvezno.","gateway-saved":"Konfiguracija prehoda je uspešno shranjena.","json-parse":"Neveljaven JSON.","json-required":"Polje ne sme biti prazno.","no-connectors":"Ni priključkov","no-data":"Brez konfiguracij","no-gateway-found":"Prehod ni najden.","no-gateway-matching":" '{{item}}' ni mogoče najti.","path-logs":"Pot do dnevniških datotek","path-logs-required":"Pot je obvezna.",remote:"Oddaljena konfiguracija","remote-logging-level":"Raven beleženja","remove-entry":"Odstrani konfiguracijo","save-tip":"Shrani konfiguracijsko datoteko","security-type":"Vrsta zaščite","security-types":{"access-token":"Dostopni žeton",tls:"TLS"},storage:"Shramba","storage-max-file-records":"Največ zapisov v datoteki","storage-max-files":"Največje število datotek","storage-max-files-min":"Najmanjše število je 1.","storage-max-files-pattern":"Številka ni veljavna.","storage-max-files-required":"Številka je obvezna.","storage-max-records":"Največ zapisov v pomnilniku","storage-max-records-min":"Najmanjše število zapisov je 1.","storage-max-records-pattern":"Številka ni veljavna.","storage-max-records-required":"Zahtevan je največ zapisov.","storage-pack-size":"Največja velikost paketa dogodkov","storage-pack-size-min":"Najmanjše število je 1.","storage-pack-size-pattern":"Številka ni veljavna.","storage-pack-size-required":"Zahtevana je največja velikost paketa dogodkov.","storage-path":"Pot pomnilnika","storage-path-required":"Zahtevana je pot do pomnilnika.","storage-type":"Vrsta pomnilnika","storage-types":{"file-storage":"Shramba datotek","memory-storage":"Spomin pomnilnika"},thingsboard:"ThingsBoard","thingsboard-host":"Gostitelj ThingsBoard","thingsboard-host-required":"Potreben je gostitelj.","thingsboard-port":"Vrata ThingsBoard","thingsboard-port-max":"Največja številka vrat je 65535.","thingsboard-port-min":"Najmanjša številka vrat je 1.","thingsboard-port-pattern":"Vrata niso veljavna.","thingsboard-port-required":"Potrebna so vrata.",tidy:"Urejeno","tidy-tip":"Urejena konfiguracija JSON","title-connectors-json":"Konfiguracija konektorja {{typeName}}","tls-path-ca-certificate":"Pot do potrdila CA na prehodu","tls-path-client-certificate":"Pot do potrdila stranke na prehodu","tls-path-private-key":"Pot do zasebnega ključa na prehodu","toggle-fullscreen":"Preklop na celozaslonski način","transformer-json-config":"Konfiguracija JSON *","update-config":"Dodaj / posodobi konfiguracijo JSON"}},kt={gateway:{"add-entry":"Yapılandırma ekle","connector-add":"Yeni bağlayıcı ekle","connector-enabled":"Bağlayıcıyı etkinleştir","connector-name":"Bağlayıcı adı","connector-name-required":"Bağlayıcı adı gerekli.","connector-type":"Bağlayıcı tipi","connector-type-required":"Bağlayıcı türü gerekli.",connectors:"Bağlayıcıların yapılandırması","create-new-gateway":"Yeni bir ağ geçidi oluştur","create-new-gateway-text":"'{{gatewayName}}' adında yeni bir ağ geçidi oluşturmak istediğinizden emin misiniz?",delete:"Yapılandırmayı sil","download-tip":"Yapılandırma dosyasını indirin",gateway:"Ağ geçidi","gateway-exists":"Aynı ada sahip cihaz zaten var.","gateway-name":"Ağ geçidi adı","gateway-name-required":"Ağ geçidi adı gerekli.","gateway-saved":"Ağ geçidi yapılandırması başarıyla kaydedildi.","json-parse":"Geçerli bir JSON değil.","json-required":"Alan boş olamaz.","no-connectors":"Bağlayıcı yok","no-data":"Yapılandırma yok","no-gateway-found":"Ağ geçidi bulunamadı.","no-gateway-matching":" '{{item}}' bulunamadı.","path-logs":"Log dosyaları yolu","path-logs-required":"Log dosyaları dizini gerekli.",remote:"Uzaktan yapılandırma","remote-logging-level":"Loglama seviyesi","remove-entry":"Yapılandırmayı kaldır","save-tip":"Yapılandırma dosyasını kaydet","security-type":"Güvenlik türü","security-types":{"access-token":"Access Token",tls:"TLS"},storage:"Depolama","storage-max-file-records":"Dosyadaki maksimum kayıt","storage-max-files":"Maksimum dosya sayısı","storage-max-files-min":"Minimum sayı 1'dir.","storage-max-files-pattern":"Sayı geçerli değil.","storage-max-files-required":"Sayı gerekli.","storage-max-records":"Depodaki maksimum kayıt","storage-max-records-min":"Minimum kayıt sayısı 1'dir.","storage-max-records-pattern":"Sayı geçerli değil.","storage-max-records-required":"Maksimum kayıt gerekli.","storage-pack-size":"Maksimum etkinlik paketi boyutu","storage-pack-size-min":"Minimum sayı 1'dir.","storage-pack-size-pattern":"Sayı geçerli değil.","storage-pack-size-required":"Maksimum etkinlik paketi boyutu gerekli.","storage-path":"Depolama yolu","storage-path-required":"Depolama yolu gerekli.","storage-type":"Depolama türü","storage-types":{"file-storage":"Dosya depolama","memory-storage":"Bellek depolama"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard host","thingsboard-host-required":"Host gerekli.","thingsboard-port":"ThingsBoard port","thingsboard-port-max":"Maksimum port numarası 65535.","thingsboard-port-min":"Minimum port numarası 1'dir.","thingsboard-port-pattern":"Port geçerli değil.","thingsboard-port-required":"Port gerekli.",tidy:"Tidy","tidy-tip":"Tidy config JSON","title-connectors-json":"Connector {{typeName}} configuration","tls-path-ca-certificate":"Path to CA certificate on gateway","tls-path-client-certificate":"Path to client certificate on gateway","tls-path-private-key":"Path to private key on gateway","toggle-fullscreen":"Toggle fullscreen","transformer-json-config":"Configuration JSON*","update-config":"Add/update configuration JSON"}},Pt={gateway:{"add-entry":"添加配置",advanced:"高级","checking-device-activity":"检查设备活动",command:"Docker命令","command-copied-message":"Docker命令已复制到剪贴板",configuration:"配置","connector-add":"添加连接器","connector-enabled":"启用连接器","connector-name":"连接器名称","connector-name-required":"连接器名称必填。","connector-type":"连接器类型","connector-type-required":"连接器类型必填。",connectors:"连接器配置","connectors-config":"连接器配置","connectors-table-enabled":"已启用","connectors-table-name":"名称","connectors-table-type":"类型","connectors-table-status":"状态","connectors-table-actions":"操作","connectors-table-key":"键","connectors-table-class":"类","rpc-command-send":"发送","rpc-command-result":"结果","rpc-command-edit-params":"编辑参数","gateway-configuration":"通用配置","create-new-gateway":"创建网关","create-new-gateway-text":"确定要创建名为 '{{gatewayName}}' 的新网关?","created-time":"创建时间","configuration-delete-dialog-header":"配置将被删除","configuration-delete-dialog-body":"只有对网关进行物理访问时,才有可能关闭远程配置。所有先前的配置都将被删除。

\n要关闭配置,请在下面输入网关名称","configuration-delete-dialog-input":"网关名称","configuration-delete-dialog-input-required":"网关名称是必需的","configuration-delete-dialog-confirm":"关闭",delete:"删除配置","download-tip":"下载配置","drop-file":"将文件拖放到此处或",gateway:"网关","gateway-exists":"同名设备已存在。","gateway-name":"网关名称","gateway-name-required":"网关名称必填。","gateway-saved":"已成功保存网关配置。",grpc:"GRPC","grpc-keep-alive-timeout":"保持连接超时(毫秒)","grpc-keep-alive-timeout-required":"需要保持连接超时","grpc-keep-alive-timeout-min":"保持连接超时不能小于1","grpc-keep-alive-timeout-pattern":"保持连接超时无效","grpc-keep-alive":"保持连接(毫秒)","grpc-keep-alive-required":"需要保持连接","grpc-keep-alive-min":"保持连接不能小于1","grpc-keep-alive-pattern":"保持连接无效","grpc-min-time-between-pings":"最小Ping间隔(毫秒)","grpc-min-time-between-pings-required":"需要最小Ping间隔","grpc-min-time-between-pings-min":"最小Ping间隔不能小于1","grpc-min-time-between-pings-pattern":"最小Ping间隔无效","grpc-min-ping-interval-without-data":"无数据时的最小Ping间隔(毫秒)","grpc-min-ping-interval-without-data-required":"需要无数据时的最小Ping间隔","grpc-min-ping-interval-without-data-min":"无数据时的最小Ping间隔不能小于1","grpc-min-ping-interval-without-data-pattern":"无数据时的最小Ping间隔无效","grpc-max-pings-without-data":"无数据时的最大Ping数","grpc-max-pings-without-data-required":"需要无数据时的最大Ping数","grpc-max-pings-without-data-min":"无数据时的最大Ping数不能小于1","grpc-max-pings-without-data-pattern":"无数据时的最大Ping数无效","inactivity-check-period-seconds":"不活跃检查期(秒)","inactivity-check-period-seconds-required":"需要不活跃检查期","inactivity-check-period-seconds-min":"不活跃检查期不能小于1","inactivity-check-period-seconds-pattern":"不活跃检查期无效","inactivity-timeout-seconds":"不活跃超时(秒)","inactivity-timeout-seconds-required":"需要不活跃超时","inactivity-timeout-seconds-min":"不活跃超时不能小于1","inactivity-timeout-seconds-pattern":"不活跃超时无效","json-parse":"无效的JSON。","json-required":"字段不能为空。",logs:{logs:"日志",days:"天",hours:"小时",minutes:"分钟",seconds:"秒","date-format":"日期格式","date-format-required":"需要日期格式","log-format":"日志格式","log-type":"日志类型","log-format-required":"需要日志格式",remote:"远程日志记录","remote-logs":"远程日志",local:"本地日志记录",level:"日志级别","file-path":"文件路径","file-path-required":"需要文件路径","saving-period":"日志保存期限","saving-period-min":"日志保存期限不能小于1","saving-period-required":"需要日志保存期限","backup-count":"备份数量","backup-count-min":"备份数量不能小于1","backup-count-required":"需要备份数量"},"min-pack-send-delay":"最小包发送延迟(毫秒)","min-pack-send-delay-required":"最小包发送延迟是必需的","min-pack-send-delay-min":"最小包发送延迟不能小于0","no-connectors":"无连接器","no-data":"没有配置","no-gateway-found":"未找到网关。","no-gateway-matching":"未找到 '{{item}}' 。","path-logs":"日志文件的路径","path-logs-required":"路径是必需的。","permit-without-calls":"保持连接许可,无需响应",remote:"远程配置","remote-logging-level":"日志记录级别","remove-entry":"删除配置","remote-shell":"远程Shell","remote-configuration":"远程配置",other:"其他","save-tip":"保存配置","security-type":"安全类型","security-types":{"access-token":"访问令牌","username-password":"用户名和密码",tls:"TLS","tls-access-token":"TLS + 访问令牌","tls-private-key":"TLS + 私钥"},"server-port":"服务器端口",statistics:{statistic:"统计信息",statistics:"统计信息","statistic-commands-empty":"无可用统计信息",commands:"命令","send-period":"统计信息发送周期(秒)","send-period-required":"统计信息发送周期是必需的","send-period-min":"统计信息发送周期不能小于60","send-period-pattern":"统计信息发送周期无效","check-connectors-configuration":"检查连接器配置(秒)","check-connectors-configuration-required":"检查连接器配置是必需的","check-connectors-configuration-min":"检查连接器配置不能小于1","check-connectors-configuration-pattern":"检查连接器配置无效",add:"添加命令",timeout:"超时时间","timeout-required":"超时时间是必需的","timeout-min":"超时时间不能小于1","timeout-pattern":"超时时间无效","attribute-name":"属性名称","attribute-name-required":"属性名称是必需的",command:"命令","command-required":"命令是必需的","command-pattern":"命令无效",remove:"删除命令"},storage:"存储","storage-max-file-records":"文件中的最大记录数","storage-max-files":"最大文件数","storage-max-files-min":"最小值为1。","storage-max-files-pattern":"数字无效。","storage-max-files-required":"数字是必需的。","storage-max-records":"存储中的最大记录数","storage-max-records-min":"最小记录数为1。","storage-max-records-pattern":"数字无效。","storage-max-records-required":"最大记录项必填。","storage-read-record-count":"存储中的读取记录数","storage-read-record-count-min":"最小记录数为1。","storage-read-record-count-pattern":"数字不合法。","storage-read-record-count-required":"需要读取记录数。","storage-max-read-record-count":"存储中的最大读取记录数","storage-max-read-record-count-min":"最小记录数为1。","storage-max-read-record-count-pattern":"数字不合法。","storage-max-read-record-count-required":"最大读取记录数必需。","storage-data-folder-path":"数据文件夹路径","storage-data-folder-path-required":"需要数据文件夹路径。","storage-pack-size":"最大事件包大小","storage-pack-size-min":"最小值为1。","storage-pack-size-pattern":"数字无效。","storage-pack-size-required":"最大事件包大小必填。","storage-path":"存储路径","storage-path-required":"存储路径必填。","storage-type":"存储类型","storage-types":{"file-storage":"文件存储","memory-storage":"内存存储",sqlite:"SQLITE"},thingsboard:"ThingsBoard",general:"常规","thingsboard-host":"ThingsBoard主机","thingsboard-host-required":"主机必填。","thingsboard-port":"ThingsBoard端口","thingsboard-port-max":"最大端口号为65535。","thingsboard-port-min":"最小端口号为1。","thingsboard-port-pattern":"端口无效。","thingsboard-port-required":"端口必填。",tidy:"整理","tidy-tip":"整理配置JSON","title-connectors-json":"连接器 {{typeName}} 配置","tls-path-ca-certificate":"网关上CA证书的路径","tls-path-client-certificate":"网关上客户端证书的路径","messages-ttl-check-in-hours":"消息TTL检查小时数","messages-ttl-check-in-hours-required":"需要提供消息TTL检查小时数。","messages-ttl-check-in-hours-min":"最小值为1。","messages-ttl-check-in-hours-pattern":"数字无效。","messages-ttl-in-days":"消息TTL天数","messages-ttl-in-days-required":"需要提供消息TTL天数。","messages-ttl-in-days-min":"最小值为1。","messages-ttl-in-days-pattern":"数字无效。","mqtt-qos":"QoS","mqtt-qos-required":"需要提供QoS","mqtt-qos-range":"QoS值的范围是从0到1","tls-path-private-key":"网关上私钥的路径","toggle-fullscreen":"切换全屏","transformer-json-config":"配置JSON*","update-config":"添加/更新配置JSON",hints:{"remote-configuration":"启用对网关的远程配置和管理","remote-shell":"通过远程Shell小部件启用对网关操作系统的远程控制",host:"ThingsBoard 主机名或IP地址",port:"ThingsBoard MQTT服务端口",token:"ThingsBoard 网关访问令牌","client-id":"ThingsBoard 网关MQTT客户端ID",username:"ThingsBoard 网关MQTT用户名",password:"ThingsBoard 网关MQTT密码","ca-cert":"CA证书文件的路径","date-form":"日志消息中的日期格式","data-folder":"包含数据的文件夹的路径(相对或绝对路径)","log-format":"日志消息格式","remote-log":"启用对网关的远程日志记录和日志读取","backup-count":"如果备份计数大于0,则在执行轮换时,最多保留备份计数个文件-最旧的文件将被删除",storage:"提供将数据发送到平台之前保存传入数据的配置","max-file-count":"将创建的文件的最大数量","max-read-count":"从存储中获取的消息计数并发送到ThingsBoard","max-records":"一个文件中存储的最大记录数","read-record-count":"从存储中获取的消息计数并发送到ThingsBoard","max-records-count":"在将数据发送到ThingsBoard之前,存储中的最大数据计数","ttl-check-hour":"网关多久检查一次数据是否过时","ttl-messages-day":"存储将保存数据的最大天数",commands:"用于收集附加统计信息的命令",attribute:"统计遥测键",timeout:"命令执行的超时时间",command:"命令执行的结果,将用作遥测的值","check-device-activity":"启用监视每个连接设备的活动","inactivity-timeout":"在此时间后,网关将断开设备的连接","inactivity-period":"设备活动检查的周期","minimal-pack-delay":"发送消息包之间的延迟(减小此设置会导致增加CPU使用率)",qos:"MQTT消息传递的服务质量(0-至多一次,1-至少一次)","server-port":"GRPC服务器侦听传入连接的网络端口","grpc-keep-alive-timeout":"在考虑连接死亡之前,服务器等待keepalive ping响应的最长时间","grpc-keep-alive":"没有活动RPC调用时两个连续keepalive ping消息之间的持续时间","grpc-min-time-between-pings":"服务器在发送keepalive ping消息之间应等待的最小时间量","grpc-max-pings-without-data":"在没有接收到任何数据之前,服务器可以发送的keepalive ping消息的最大数量,然后将连接视为死亡","grpc-min-ping-interval-without-data":"在没有发送或接收数据时,服务器在发送keepalive ping消息之间应等待的最小时间量","permit-without-calls":"允许服务器在没有活动RPC调用时保持GRPC连接活动"},"docker-label":"使用以下指令在 Docker compose 中运行 IoT 网关,并为选定的设备提供凭据","install-docker-compose":"使用以下说明下载、安装和设置 Docker Compose","download-configuration-file":"下载配置文件","download-docker-compose":"下载您的网关的 docker-compose.yml 文件","launch-gateway":"启动网关","launch-docker-compose":"在包含 docker-compose.yml 文件的文件夹中,使用以下命令在终端中启动网关"}},Dt={gateway:{"add-entry":"增加配置","connector-add":"增加新連接器","connector-enabled":"啟用連接器","connector-name":"連接器名稱","connector-name-required":"需要連接器名稱。","connector-type":"連接器類型","connector-type-required":"需要連接器類型。",connectors:"連接器配置","create-new-gateway":"建立新閘道","create-new-gateway-text":"您確定要建立一個名稱為:'{{gatewayName}}'的新閘道嗎?",delete:"刪除配置","download-tip":"下載配置文件",gateway:"閘道","gateway-exists":"同名設備已存在。","gateway-name":"閘道名稱","gateway-name-required":"需要閘道名稱。","gateway-saved":"閘道配置已成功保存。","json-parse":"無效的JSON","json-required":"欄位不能為空。","no-connectors":"無連接器","no-data":"無配置","no-gateway-found":"未找到閘道。","no-gateway-matching":" 未找到'{{item}}'。","path-logs":"日誌文件的路徑","path-logs-required":"需要路徑。",remote:"移除配置","remote-logging-level":"日誌記錄級別","remove-entry":"移除配置","save-tip":"保存配置文件","security-type":"安全類型","security-types":{"access-token":"訪問Token",tls:"TLS"},storage:"貯存","storage-max-file-records":"文件中的最大紀錄","storage-max-files":"最大文件數","storage-max-files-min":"最小數量為1。","storage-max-files-pattern":"號碼無效。","storage-max-files-required":"需要號碼。","storage-max-records":"存儲中的最大紀錄","storage-max-records-min":"最小紀錄數為1。","storage-max-records-pattern":"號碼無效。","storage-max-records-required":"需要最大紀錄數","storage-pack-size":"最大事件包大小","storage-pack-size-min":"最小數量為1。","storage-pack-size-pattern":"號碼無效.","storage-pack-size-required":"需要最大事件包大小","storage-path":"存儲路徑","storage-path-required":"需要存儲路徑。","storage-type":"存儲類型","storage-types":{"file-storage":"文件存儲","memory-storage":"記憶體存儲"},thingsboard:"ThingsBoard","thingsboard-host":"ThingsBoard主機","thingsboard-host-required":"需要主機。","thingsboard-port":"ThingsBoard連接埠","thingsboard-port-max":"最大埠號為 65535。","thingsboard-port-min":"最小埠號為1。","thingsboard-port-pattern":"連接埠無效。","thingsboard-port-required":"需要連接埠。",tidy:"整理","tidy-tip":"整理配置JSON","title-connectors-json":"連接器{{typeName}}配置","tls-path-ca-certificate":"閘道上CA證書的路徑","tls-path-client-certificate":"閘道上用戶端憑據的路徑","tls-path-private-key":"閘道上的私鑰路徑","toggle-fullscreen":"切換全螢幕","transformer-json-config":"配置JSON*","update-config":"增加/更新配置JSON"}};e("AvailableLanguages",ft),function(e){e.English="en_US",e.Arabic="ar_AE",e.Catalan="ca_ES",e.Czech="cs_CZ",e.Danish="da_DK",e.Spanish="es_ES",e.Korean="ko_KR",e.Lithuanian="lt_LT",e.Dutch="nl_BE",e.Polish="pl_PL",e.PortugueseBrazil="pt_BR",e.Slovenian="sl_SI",e.Turkish="tr_TR",e.ChineseSimplified="zh_CN",e.ChineseTraditional="zh_TW"}(ft||e("AvailableLanguages",ft={}));const Ot=new Map([[ft.English,yt],[ft.Arabic,vt],[ft.Catalan,xt],[ft.Czech,bt],[ft.Danish,wt],[ft.Spanish,St],[ft.Korean,Ct],[ft.Lithuanian,_t],[ft.Dutch,Tt],[ft.Polish,It],[ft.PortugueseBrazil,Et],[ft.Slovenian,Mt],[ft.Turkish,kt],[ft.ChineseSimplified,Pt],[ft.ChineseTraditional,Dt]]),At=e("addGatewayLocale",(e=>{const t=ft.English,n=e.currentLang??t,i=e.translations[n]?.gateway?n:t,a=Ot.get(n)?.gateway?n:t,r=[a===t?void 0:Ot.get(t)?.gateway,Ot.get(a)?.gateway,e.translations[i]?.gateway].filter(Ft);if(!r.length)return;const o=1===r.length?r[0]:j({},...r);e.setTranslation(i,{gateway:o},!0)})),Ft=e=>H(e)&&0!==Object.keys(e).length;var Rt={3.6:{socket:{type:"TCP",address:"127.0.0.1",port:5e4,bufferSize:1024},devices:[{address:"*:*",deviceName:"Device Example",deviceType:"default",encoding:"utf-8",telemetry:[{key:"temp",byteFrom:0,byteTo:-1},{key:"hum",byteFrom:0,byteTo:2}],attributes:[{key:"name",byteFrom:0,byteTo:-1},{key:"num",byteFrom:2,byteTo:4}],attributeRequests:[{type:"shared",requestExpressionSource:"constant",attributeNameExpressionSource:"constant",requestExpression:"${[0:3]==atr}",attributeNameExpression:"[3:]"}],attributeUpdates:[{encoding:"utf-16",attributeOnThingsBoard:"sharedName"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,encoding:"utf-8"}]}]},legacy:{type:"TCP",address:"127.0.0.1",port:5e4,bufferSize:1024,devices:[{address:"*:*",deviceName:"Device Example",deviceType:"default",encoding:"utf-8",telemetry:[{key:"temp",byteFrom:0,byteTo:-1},{key:"hum",byteFrom:0,byteTo:2}],attributes:[{key:"name",byteFrom:0,byteTo:-1},{key:"num",byteFrom:2,byteTo:4}],attributeRequests:[{type:"shared",requestExpression:"${[0:3]==atr}",attributeNameExpression:"[3:]"}],attributeUpdates:[{encoding:"utf-16",attributeOnThingsBoard:"sharedName"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,methodProcessing:"write",encoding:"utf-8"}]}]}},Bt={"3.5.2":{broker:{host:"127.0.0.1",port:1883,clientId:"ThingsBoard_gateway",version:5,maxMessageNumberPerWorker:10,maxNumberOfWorkers:100,sendDataOnlyOnChange:!1,security:{type:"anonymous"}},mapping:[{topicFilter:"sensor/data",subscriptionQos:1,converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}",deviceProfileExpressionSource:"message",deviceProfileExpression:"${sensorType}"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"${sensorModel}",value:"on"}],timeseries:[{type:"string",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"},{type:"string",key:"combine",value:"${hum}:${temp}"}]}},{topicFilter:"sensor/+/data",subscriptionQos:1,converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/data)",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"string",key:"humidity",value:"${hum}"}]}},{topicFilter:"sensor/raw_data",subscriptionQos:1,converter:{type:"bytes",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"[0:4]",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"raw",key:"rawData",value:"[:]"}],timeseries:[{type:"raw",key:"temp",value:"[4:]"}]}},{topicFilter:"custom/sensors/+",subscriptionQos:1,converter:{type:"custom",extension:"CustomMqttUplinkConverter",cached:!0,extensionConfig:{temperature:2,humidity:2,batteryLevel:1}}}],requestsMapping:{connectRequests:[{topicFilter:"sensor/connect",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"}},{topicFilter:"sensor/+/connect",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/connect)",deviceProfileExpressionSource:"constant",deviceProfileExpression:"Thermometer"}}],disconnectRequests:[{topicFilter:"sensor/disconnect",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}"}},{topicFilter:"sensor/+/disconnect",deviceInfo:{deviceNameExpressionSource:"topic",deviceNameExpression:"(?<=sensor/)(.*?)(?=/connect)"}}],attributeRequests:[{retain:!1,topicFilter:"v1/devices/me/attributes/request",deviceInfo:{deviceNameExpressionSource:"message",deviceNameExpression:"${serialNumber}"},attributeNameExpressionSource:"message",attributeNameExpression:"${versionAttribute}, ${pduAttribute}",topicExpression:"devices/${deviceName}/attrs",valueExpression:"${attributeKey}: ${attributeValue}"}],attributeUpdates:[{retain:!0,deviceNameFilter:".*",attributeFilter:"firmwareVersion",topicExpression:"sensor/${deviceName}/${attributeKey}",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{type:"twoWay",deviceNameFilter:".*",methodFilter:"echo",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTopicExpression:"sensor/${deviceName}/response/${methodName}/${requestId}",responseTopicQoS:1,responseTimeout:1e4,valueExpression:"${params}"},{type:"oneWay",deviceNameFilter:".*",methodFilter:"no-reply",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",valueExpression:"${params}"}]}},legacy:{broker:{name:"Default Local Broker",host:"127.0.0.1",port:1883,clientId:"ThingsBoard_gateway",version:5,maxMessageNumberPerWorker:10,maxNumberOfWorkers:100,sendDataOnlyOnChange:!1,security:{type:"basic",username:"user",password:"password"}},mapping:[{topicFilter:"sensor/data",converter:{type:"json",deviceNameJsonExpression:"${serialNumber}",deviceTypeJsonExpression:"${sensorType}",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"${sensorModel}",value:"on"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"},{type:"string",key:"combine",value:"${hum}:${temp}"}]}},{topicFilter:"sensor/+/data",converter:{type:"json",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/data)",deviceTypeTopicExpression:"Thermometer",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"string",key:"model",value:"${sensorModel}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{topicFilter:"sensor/raw_data",converter:{type:"bytes",deviceNameExpression:"[0:4]",deviceTypeExpression:"default",sendDataOnlyOnChange:!1,timeout:6e4,attributes:[{type:"raw",key:"rawData",value:"[:]"}],timeseries:[{type:"raw",key:"temp",value:"[4:]"}]}},{topicFilter:"custom/sensors/+",converter:{type:"custom",extension:"CustomMqttUplinkConverter",cached:!0,"extension-config":{temperatureBytes:2,humidityBytes:2,batteryLevelBytes:1}}}],connectRequests:[{topicFilter:"sensor/connect",deviceNameJsonExpression:"${serialNumber}"},{topicFilter:"sensor/+/connect",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/connect)"}],disconnectRequests:[{topicFilter:"sensor/disconnect",deviceNameJsonExpression:"${serialNumber}"},{topicFilter:"sensor/+/disconnect",deviceNameTopicExpression:"(?<=sensor/)(.*?)(?=/disconnect)"}],attributeRequests:[{retain:!1,topicFilter:"v1/devices/me/attributes/request",deviceNameJsonExpression:"${serialNumber}",attributeNameJsonExpression:"${versionAttribute}, ${pduAttribute}",topicExpression:"devices/${deviceName}/attrs",valueExpression:"${attributeKey}: ${attributeValue}"}],attributeUpdates:[{retain:!0,deviceNameFilter:".*",attributeFilter:"firmwareVersion",topicExpression:"sensor/${deviceName}/${attributeKey}",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTopicExpression:"sensor/${deviceName}/response/${methodName}/${requestId}",responseTimeout:1e4,valueExpression:"${params}"},{deviceNameFilter:".*",methodFilter:"no-reply",requestTopicExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",valueExpression:"${params}"}]}},Nt={"3.5.2":{master:{slaves:[{host:"127.0.0.1",port:5021,type:"tcp",method:"socket",timeout:35,byteOrder:"LITTLE",wordOrder:"LITTLE",retries:3,retryOnEmpty:!0,retryOnInvalid:!0,pollPeriod:5e3,unitId:1,deviceName:"Temp Sensor",deviceType:"default",connectAttemptTimeMs:5e3,connectAttemptCount:5,waitAfterFailedAttemptsMs:3e5,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:3e4},attributes:[{tag:"string_read",type:"string",functionCode:4,objectsCount:4,address:1,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:15e3}},{tag:"bits_read",type:"bits",functionCode:4,objectsCount:1,address:5},{tag:"8int_read",type:"8int",functionCode:4,objectsCount:1,address:6},{tag:"16int_read",type:"16int",functionCode:4,objectsCount:1,address:7},{tag:"32int_read_divider",type:"32int",functionCode:4,objectsCount:2,address:8,divider:10},{tag:"8int_read_multiplier",type:"8int",functionCode:4,objectsCount:1,address:10,multiplier:10},{tag:"32int_read",type:"32int",functionCode:4,objectsCount:2,address:11},{tag:"64int_read",type:"64int",functionCode:4,objectsCount:4,address:13}],timeseries:[{tag:"8uint_read",type:"8uint",functionCode:4,objectsCount:1,address:17,reportStrategy:{type:"ON_REPORT_PERIOD",reportPeriod:15e3}},{tag:"16uint_read",type:"16uint",functionCode:4,objectsCount:2,address:18},{tag:"32uint_read",type:"32uint",functionCode:4,objectsCount:4,address:20},{tag:"64uint_read",type:"64uint",functionCode:4,objectsCount:1,address:24},{tag:"16float_read",type:"16float",functionCode:4,objectsCount:1,address:25},{tag:"32float_read",type:"32float",functionCode:4,objectsCount:2,address:26},{tag:"64float_read",type:"64float",functionCode:4,objectsCount:4,address:28}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31},{tag:"getValue",type:"bits",functionCode:1,objectsCount:1,address:31},{tag:"setCPUFanSpeed",type:"32int",functionCode:16,objectsCount:2,address:33},{tag:"getCPULoad",type:"32int",functionCode:4,objectsCount:2,address:35}]}]},slave:{type:"tcp",host:"127.0.0.1",port:5026,method:"socket",deviceName:"Modbus Slave Example",deviceType:"default",pollPeriod:5e3,sendDataToThingsBoard:!1,byteOrder:"LITTLE",wordOrder:"LITTLE",unitId:0,values:{holding_registers:{attributes:[{address:1,type:"string",tag:"sm",objectsCount:1,value:"ON"}],timeseries:[{address:2,type:"8int",tag:"smm",objectsCount:1,value:"12334"}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29,value:1243}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31,value:1}]},coils_initializer:{attributes:[{address:5,type:"8int",tag:"coil",objectsCount:1,value:0}],timeseries:[],attributeUpdates:[],rpc:[]}}}},legacy:{master:{slaves:[{host:"127.0.0.1",port:5021,type:"tcp",method:"socket",timeout:35,byteOrder:"LITTLE",wordOrder:"LITTLE",retries:3,retryOnEmpty:!0,retryOnInvalid:!0,pollPeriod:5e3,unitId:1,deviceName:"Temp Sensor",deviceType:"default",sendDataOnlyOnChange:!0,connectAttemptTimeMs:5e3,connectAttemptCount:5,waitAfterFailedAttemptsMs:3e5,attributes:[{tag:"string_read",type:"string",functionCode:4,objectsCount:4,address:1},{tag:"bits_read",type:"bits",functionCode:4,objectsCount:1,address:5},{tag:"16int_read",type:"16int",functionCode:4,objectsCount:1,address:7},{tag:"32int_read_divider",type:"32int",functionCode:4,objectsCount:2,address:8,divider:10},{tag:"32int_read",type:"32int",functionCode:4,objectsCount:2,address:11},{tag:"64int_read",type:"64int",functionCode:4,objectsCount:4,address:13}],timeseries:[{tag:"16uint_read",type:"16uint",functionCode:4,objectsCount:2,address:18},{tag:"32uint_read",type:"32uint",functionCode:4,objectsCount:4,address:20},{tag:"64uint_read",type:"64uint",functionCode:4,objectsCount:1,address:24},{tag:"16float_read",type:"16float",functionCode:4,objectsCount:1,address:25},{tag:"32float_read",type:"32float",functionCode:4,objectsCount:2,address:26},{tag:"64float_read",type:"64float",functionCode:4,objectsCount:4,address:28}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31},{tag:"getValue",type:"bits",functionCode:1,objectsCount:1,address:31},{tag:"setCPUFanSpeed",type:"32int",functionCode:16,objectsCount:2,address:33},{tag:"getCPULoad",type:"32int",functionCode:4,objectsCount:2,address:35}]}]},slave:{type:"tcp",host:"127.0.0.1",port:5026,method:"socket",deviceName:"Modbus Slave Example",deviceType:"default",pollPeriod:5e3,sendDataToThingsBoard:!1,byteOrder:"LITTLE",wordOrder:"LITTLE",unitId:0,values:{holding_registers:[{attributes:[{address:1,type:"string",tag:"sm",objectsCount:1,value:"ON"}],timeseries:[{address:2,type:"int",tag:"smm",objectsCount:1,value:"12334"}],attributeUpdates:[{tag:"shared_attribute_write",type:"32int",functionCode:6,objectsCount:2,address:29,value:1243}],rpc:[{tag:"setValue",type:"bits",functionCode:5,objectsCount:1,address:31,value:1}]}],coils_initializer:[{attributes:[{address:5,type:"string",tag:"sm",objectsCount:1,value:"12"}],timeseries:[],attributeUpdates:[],rpc:[]}]}}}},Lt={"3.5.2":{server:{url:"localhost:4840/freeopcua/server/",timeoutInMillis:5e3,scanPeriodInMillis:36e5,pollPeriodInMillis:5e3,enableSubscriptions:!0,subCheckPeriodInMillis:100,showMap:!1,security:"Basic128Rsa15",identity:{type:"anonymous"}},mapping:[{deviceNodePattern:"Root\\.Objects\\.Device1",deviceNodeSource:"path",deviceInfo:{deviceNameExpression:"Device ${Root\\.Objects\\.Device1\\.serialNumber}",deviceNameExpressionSource:"path",deviceProfileExpression:"Device",deviceProfileExpressionSource:"constant"},attributes:[{key:"temperature °C",type:"path",value:"${ns=2;i=5}"}],timeseries:[{key:"humidity",type:"path",value:"${Root\\.Objects\\.Device1\\.TemperatureAndHumiditySensor\\.Humidity}"},{key:"batteryLevel",type:"path",value:"${Battery\\.batteryLevel}"}],rpc_methods:[{method:"multiply",arguments:[{type:"integer",value:2},{type:"integer",value:4}]}],attributes_updates:[{key:"deviceName",type:"path",value:"Root\\.Objects\\.Device1\\.serialNumber"}]}]},legacy:{server:{name:"OPC-UA Default Server",url:"localhost:4840/freeopcua/server/",timeoutInMillis:5e3,scanPeriodInMillis:5e3,disableSubscriptions:!1,subCheckPeriodInMillis:100,showMap:!1,security:"Basic128Rsa15",identity:{type:"anonymous"},mapping:[{deviceNodePattern:"Root\\.Objects\\.Device1",deviceNamePattern:"Device ${Root\\.Objects\\.Device1\\.serialNumber}",attributes:[{key:"temperature °C",path:"${ns=2;i=5}"}],timeseries:[{key:"humidity",path:"${Root\\.Objects\\.Device1\\.TemperatureAndHumiditySensor\\.Humidity}"},{key:"batteryLevel",path:"${Battery\\.batteryLevel}"}],rpc_methods:[{method:"multiply",arguments:[2,4]}],attributes_updates:[{attributeOnThingsBoard:"deviceName",attributeOnDevice:"Root\\.Objects\\.Device1\\.serialNumber"}]}]}}},Vt={passiveScanMode:!0,showMap:!1,scanner:{timeout:1e4,deviceName:"Device name"},devices:[{name:"Temperature and humidity sensor",MACAddress:"4C:65:A8:DF:85:C0",pollPeriod:5e5,showMap:!1,timeout:1e4,connectRetry:5,connectRetryInSeconds:0,waitAfterConnectRetries:10,telemetry:[{key:"temperature",method:"notify",characteristicUUID:"226CAA55-6476-4566-7562-66734470666D",valueExpression:"[2]"},{key:"humidity",method:"notify",characteristicUUID:"226CAA55-6476-4566-7562-66734470666D",valueExpression:"[0]"}],attributes:[{key:"name",method:"read",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",valueExpression:"[0:2]cm [2:]A"},{key:"values",method:"read",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",valueExpression:"All values: [:]"}],attributeUpdates:[{attributeOnThingsBoard:"sharedName",characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB"}],serverSideRpc:[{methodRPC:"rpcMethod1",withResponse:!0,characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",methodProcessing:"read"},{methodRPC:"rpcMethod2",withResponse:!0,characteristicUUID:"00002A00-0000-1000-8000-00805F9B34FB",methodProcessing:"write"},{methodRPC:"rpcMethod3",withResponse:!0,methodProcessing:"scan"}]}]},qt={host:"http://127.0.0.1:5000",SSLVerify:!0,security:{type:"basic",username:"user",password:"password"},mapping:[{url:"getdata",httpMethod:"GET",httpHeaders:{ACCEPT:"application/json"},content:{name:"morpheus",job:"leader"},allowRedirects:!0,timeout:.5,scanPeriod:5,converter:{type:"json",deviceNameJsonExpression:"SD8500",deviceTypeJsonExpression:"SD",attributes:[{key:"serialNumber",type:"string",value:"${serial}"}],telemetry:[{key:"Maintainer",type:"string",value:"${Developer}"},{key:"combine",type:"string",value:"${Developer}:${hum}"}]}},{url:"get_info",httpMethod:"GET",httpHeaders:{ACCEPT:"application/json"},allowRedirects:!0,timeout:.5,scanPeriod:100,converter:{type:"custom",deviceNameJsonExpression:"SD8500",deviceTypeJsonExpression:"SD",extension:"CustomRequestUplinkConverter","extension-config":[{key:"Totaliser",type:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1},{key:"Flow",type:"int",fromByte:4,toByte:6,byteorder:"big",signed:!0,multiplier:.01},{key:"Temperature",type:"int",fromByte:8,toByte:10,byteorder:"big",signed:!0,multiplier:.01},{key:"Pressure",type:"int",fromByte:12,toByte:14,byteorder:"big",signed:!0,multiplier:.01},{key:"deviceStatus",type:"int",byteAddress:15,fromBit:4,toBit:8,byteorder:"big",signed:!1},{key:"OUT2",type:"int",byteAddress:15,fromBit:1,toBit:2,byteorder:"big"},{key:"OUT1",type:"int",byteAddress:15,fromBit:0,toBit:1,byteorder:"big"}]}}],attributeUpdates:[{httpMethod:"POST",httpHeaders:{"CONTENT-TYPE":"application/json"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SD.*",attributeFilter:"send_data",requestUrlExpression:"sensor/${deviceName}/${attributeKey}",requestValueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",responseTimeout:1,httpMethod:"GET",requestValueExpression:"${params}",responseValueExpression:"${temp}",timeout:.5,tries:3,httpHeaders:{"Content-Type":"application/json"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",httpMethod:"POST",requestValueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"}}]},Gt={interface:"socketcan",channel:"vcan0",backend:{fd:!0},reconnectPeriod:5,devices:[{name:"Car",sendDataOnlyOnChange:!1,enableUnknownRpc:!0,strictEval:!1,attributes:[{key:"isDriverDoorOpened",nodeId:41,command:"2:2:big:8717",value:"4:1:int",expression:"bool(value & 0b00000100)",polling:{type:"once",dataInHex:"AB CD AB CD"}}],timeseries:[{key:"rpm",nodeId:1918,isExtendedId:!0,command:"2:2:big:48059",value:"4:2:big:int",expression:"value / 4",polling:{type:"always",period:5,dataInHex:"aaaa bbbb aaaa bbbb"}},{key:"milliage",nodeId:1918,isExtendedId:!0,value:"4:2:little:int",expression:"value * 10",polling:{type:"always",period:30,dataInHex:"aa bb cc dd ee ff aa bb"}}],attributeUpdates:[{attributeOnThingsBoard:"softwareVersion",nodeId:64,isExtendedId:!0,dataLength:4,dataExpression:"value + 5",dataByteorder:"little"}],serverSideRpc:[{method:"sendSameData",nodeId:4,isExtendedId:!0,isFd:!0,bitrateSwitch:!0,dataInHex:"aa bb cc dd ee ff aa bb aa bb cc d ee ff"},{method:"setLightLevel",nodeId:5,dataLength:2,dataByteorder:"little",dataBefore:"00AA"},{method:"setSpeed",nodeId:16,dataAfter:"0102",dataExpression:"userSpeed if maxAllowedSpeed > userSpeed else maxAllowedSpeed"}]}]},zt={"3.6.2":{application:{objectName:"TB_gateway",host:"0.0.0.0",port:47808,objectIdentifier:599,maxApduLengthAccepted:1476,segmentationSupported:"segmentedBoth",vendorIdentifier:15},devices:[{deviceInfo:{deviceNameExpression:"BACnet Device ${objectName}",deviceProfileExpression:"default",deviceNameExpressionSource:"expression",deviceProfileExpressionSource:"constant"},host:"192.168.2.110",port:"47808",pollPeriod:1e4,attributes:[{key:"temperature",objectType:"analogOutput",objectId:1,propertyId:"presentValue"}],timeseries:[{key:"state",objectType:"binaryValue",objectId:1,propertyId:"presentValue"}],attributeUpdates:[{key:"brightness",objectType:"analogOutput",objectId:1,propertyId:"presentValue"}],serverSideRpc:[{method:"set_state",requestType:"writeProperty",requestTimeout:1e4,objectType:"binaryOutput",objectId:1,propertyId:"presentValue"},{method:"get_state",requestType:"readProperty",requestTimeout:1e4,objectType:"binaryOutput",objectId:1,propertyId:"presentValue"}]}]},legacy:{general:{objectName:"TB_gateway",address:"0.0.0.0:47808",objectIdentifier:599,maxApduLengthAccepted:1476,segmentationSupported:"segmentedBoth",vendorIdentifier:15},devices:[{deviceName:"BACnet Device ${objectName}",deviceType:"default",address:"192.168.2.110:47808",pollPeriod:1e4,attributes:[{key:"temperature",type:"string",objectId:"analogOutput:1",propertyId:"presentValue"}],timeseries:[{key:"state",type:"bool",objectId:"binaryValue:1",propertyId:"presentValue"}],attributeUpdates:[{key:"brightness",requestType:"writeProperty",objectId:"analogOutput:1",propertyId:"presentValue"}],serverSideRpc:[{method:"set_state",requestType:"writeProperty",requestTimeout:1e4,objectId:"binaryOutput:1",propertyId:"presentValue"},{method:"get_state",requestType:"readProperty",requestTimeout:1e4,objectId:"binaryOutput:1",propertyId:"presentValue"}]}]}},Ut={connection:{str:"Driver={PostgreSQL};Server=localhost;Port=5432;Database=thingsboard;Uid=postgres;Pwd=postgres;",attributes:{autocommit:!0,timeout:0},encoding:"utf-8",decoding:{char:"utf-8",wchar:"utf-8",metadata:"utf-16le"},reconnect:!0,reconnectPeriod:60},pyodbc:{pooling:!1},polling:{query:"SELECT bool_v, str_v, dbl_v, long_v, entity_id, ts FROM ts_kv WHERE ts > ? ORDER BY ts ASC LIMIT 10",period:10,iterator:{column:"ts",query:"SELECT MIN(ts) - 1 FROM ts_kv",persistent:!1}},mapping:{device:{type:"postgres",name:"'ODBC ' + entity_id"},sendDataOnlyOnChange:!1,attributes:"*",timeseries:[{name:"value",value:"[i for i in [str_v, long_v, dbl_v,bool_v] if i is not None][0]"}]},serverSideRpc:{enableUnknownRpc:!1,overrideRpcConfig:!0,methods:["procedureOne",{name:"procedureTwo",args:["One",2,3]}]}},jt={"3.7.2":{server:{host:"127.0.0.1",port:"5000",SSL:!1,security:{cert:"~/ssl/cert.pem",key:"~/ssl/key.pem"}},mapping:[{endpoint:"/my_devices",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"request",deviceNameExpression:"${sensorName}",deviceProfileExpressionSource:"request",deviceProfileExpression:"${sensorType}"},attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"certificateNumber",value:"${certificateNumber}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon1",HTTPMethods:["GET","POST"],security:{type:"anonymous"},converter:{type:"json",deviceInfo:{deviceNameExpressionSource:"constant",deviceNameExpression:"Device 2",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},attributes:[{type:"string",key:"model",value:"Model2"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon2",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"custom",deviceInfo:{deviceNameExpressionSource:"constant",deviceNameExpression:"SuperAnonDevice",deviceProfileExpressionSource:"constant",deviceProfileExpression:"default"},extension:"CustomRestUplinkConverter",extensionConfig:{key:"Totaliser",datatype:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1}}}],requestsMapping:{attributeRequests:[{endpoint:"/sharedAttributes",type:"shared",HTTPMethods:["POST"],security:{type:"anonymous"},timeout:10,deviceNameExpression:"${deviceName}",attributeNameExpression:"${attribute}${attribute1}"}],attributeUpdates:[{HTTPMethod:"POST",SSLVerify:!1,httpHeaders:{"CONTENT-TYPE":"application/json"},security:{type:"anonymous"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SN.*",attributeFilter:".*",requestUrlExpression:"http://127.0.0.1:5001/",valueExpression:'{"deviceName":"${deviceName}","${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"http://127.0.0.1:5001/${deviceName}",responseTimeout:1,HTTPMethod:"GET",valueExpression:"${params}",timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:"SN.*",methodFilter:"post_attributes",requestUrlExpression:"http://127.0.0.1:5000/my_devices",responseTimeout:1,HTTPMethod:"POST",valueExpression:'{"sensorName":"${deviceName}", "sensorModel":"${params.sensorModel}", "certificateNumber":"${params.certificateNumber}", "temp":"${params.temp}", "hum":"${params.hum}"}',timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",HTTPMethod:"POST",valueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}}]}},legacy:{host:"127.0.0.1",port:"5000",SSL:!1,security:{cert:"~/ssl/cert.pem",key:"~/ssl/key.pem"},mapping:[{endpoint:"/my_devices",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"json",deviceNameExpression:"${sensorName}",deviceTypeExpression:"${sensorType}",attributes:[{type:"string",key:"model",value:"${sensorModel}"},{type:"string",key:"certificateNumber",value:"${certificateNumber}"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon1",HTTPMethods:["GET","POST"],security:{type:"anonymous"},converter:{type:"json",deviceNameExpression:"Device 2",deviceTypeExpression:"default",attributes:[{type:"string",key:"model",value:"Model2"}],timeseries:[{type:"double",key:"temperature",value:"${temp}"},{type:"double",key:"humidity",value:"${hum}"}]}},{endpoint:"/anon2",HTTPMethods:["POST"],security:{type:"anonymous"},converter:{type:"custom",deviceNameExpression:"SuperAnonDevice",deviceTypeExpression:"default",extension:"CustomRestUplinkConverter","extension-config":{key:"Totaliser",datatype:"float",fromByte:0,toByte:4,byteorder:"big",signed:!0,multiplier:1}}}],attributeRequests:[{endpoint:"/sharedAttributes",type:"shared",HTTPMethods:["POST"],security:{type:"anonymous"},timeout:10,deviceNameExpression:"${deviceName}",attributeNameExpression:"${attribute}${attribute1}"}],attributeUpdates:[{HTTPMethod:"POST",SSLVerify:!1,httpHeaders:{"CONTENT-TYPE":"application/json"},security:{type:"anonymous"},timeout:.5,tries:3,allowRedirects:!0,deviceNameFilter:"SN.*",attributeFilter:".*",requestUrlExpression:"http://127.0.0.1:5001/",valueExpression:'{"deviceName":"${deviceName}","${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"echo",requestUrlExpression:"http://127.0.0.1:5001/${deviceName}",responseTimeout:1,HTTPMethod:"GET",valueExpression:"${params}",timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:"SN.*",methodFilter:"post_attributes",requestUrlExpression:"http://127.0.0.1:5000/my_devices",responseTimeout:1,HTTPMethod:"POST",valueExpression:'{"sensorName":"${deviceName}", "sensorModel":"${params.sensorModel}", "certificateNumber":"${params.certificateNumber}", "temp":"${params.temp}", "hum":"${params.hum}"}',timeout:10,tries:3,httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}},{deviceNameFilter:".*",methodFilter:"no-reply",requestUrlExpression:"sensor/${deviceName}/request/${methodName}/${requestId}",HTTPMethod:"POST",valueExpression:"${params}",httpHeaders:{"Content-Type":"application/json"},security:{type:"anonymous"}}]}},Ht={devices:[{deviceName:"SNMP router",deviceType:"snmp",ip:"snmp.live.gambitcommunications.com",port:161,pollPeriod:5e3,community:"public",attributes:[{key:"ReceivedFromGet",method:"get",oid:"1.3.6.1.2.1.1.1.0",timeout:6},{key:"ReceivedFromMultiGet",method:"multiget",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],timeout:6},{key:"ReceivedFromGetNext",method:"getnext",oid:"1.3.6.1.2.1.1.1.0",timeout:6},{key:"ReceivedFromMultiWalk",method:"multiwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.0.1.2.1"]},{key:"ReceivedFromBulkWalk",method:"bulkwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"]},{key:"ReceivedFromBulkGet",method:"bulkget",scalarOid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],repeatingOid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"],maxListSize:10}],telemetry:[{key:"ReceivedFromWalk",community:"private",method:"walk",oid:"1.3.6.1.2.1.1.1.0"},{key:"ReceivedFromTable",method:"table",oid:"1.3.6.1.2.1.1"}],attributeUpdateRequests:[{attributeFilter:"dataToSet",method:"set",oid:"1.3.6.1.2.1.1.1.0"},{attributeFilter:"dataToMultiSet",method:"multiset",mappings:{"1.2.3":"10","2.3.4":"${attribute}"}}],serverSideRpcRequests:[{requestFilter:"setData",method:"set",oid:"1.3.6.1.2.1.1.1.0"},{requestFilter:"multiSetData",method:"multiset"},{requestFilter:"getData",method:"get",oid:"1.3.6.1.2.1.1.1.0"},{requestFilter:"runBulkWalk",method:"bulkwalk",oid:["1.3.6.1.2.1.1.1.0","1.3.6.1.2.1.1.2.0"]}]},{deviceName:"SNMP router",deviceType:"snmp",ip:"127.0.0.1",pollPeriod:5e3,community:"public",converter:"CustomSNMPConverter",attributes:[{key:"ReceivedFromGetWithCustomConverter",method:"get",oid:"1.3.6.1.2.1.1.1.0"}],telemetry:[{key:"ReceivedFromTableWithCustomConverter",method:"table",oid:"1.3.6.1.2.1.1.1.0"}]}]},Wt={host:"0.0.0.0",port:21,TLSSupport:!1,security:{type:"basic",username:"admin",password:"admin"},paths:[{devicePatternName:"asd",devicePatternType:"Device",delimiter:",",path:"fol/*_hello*.txt",readMode:"FULL",maxFileSize:5,pollPeriod:500,txtFileDataView:"SLICED",withSortingFiles:!0,attributes:[{key:"temp",value:"[1:]"},{key:"tmp",value:"[0:1]"}],timeseries:[{type:"int",key:"[0:1]",value:"[0:1]"},{type:"int",key:"temp",value:"[1:]"}]}],attributeUpdates:[{path:"fol/hello.json",deviceNameFilter:".*",writingMode:"WRITE",valueExpression:"{'${attributeKey}':'${attributeValue}'}"}],serverSideRpc:[{deviceNameFilter:".*",methodFilter:"read",valueExpression:"${params}"},{deviceNameFilter:".*",methodFilter:"write",valueExpression:"${params}"}]},$t={server:{jid:"gateway@localhost",password:"password",host:"localhost",port:5222,use_ssl:!1,disable_starttls:!1,force_starttls:!0,timeout:1e4,plugins:["xep_0030","xep_0323","xep_0325"]},devices:[{jid:"device@localhost/TMP_1101",deviceNameExpression:"${serialNumber}",deviceTypeExpression:"default",attributes:[{key:"temperature",value:"${temp}"}],timeseries:[{key:"humidity",value:"${hum}"},{key:"combination",value:"${temp}:${hum}"}],attributeUpdates:[{attributeOnThingsBoard:"shared",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{methodRPC:"rpc1",withResponse:!0,valueExpression:"${params}"}]}]},Kt={centralSystem:{name:"Central System",host:"127.0.0.1",port:9e3,connection:{type:"insecure"},security:[{type:"token",tokens:["Bearer ACCESS_TOKEN"]},{type:"basic",credentials:[{username:"admin",password:"admin"}]}]},chargePoints:[{idRegexpPattern:"bidon/hello/CP_1",deviceNameExpression:"${Vendor} ${Model}",deviceTypeExpression:"default",attributes:[{messageTypeFilter:"MeterValues,",key:"temp1",value:"${meter_value[:].sampled_value[:].value}"},{messageTypeFilter:"MeterValues,",key:"vendorId",value:"${connector_id}"}],timeseries:[{messageTypeFilter:"DataTransfer,",key:"temp",value:"${data.temp}"}],attributeUpdates:[{attributeOnThingsBoard:"shared",valueExpression:'{"${attributeKey}":"${attributeValue}"}'}],serverSideRpc:[{methodRPC:"rpc1",withResponse:!0,valueExpression:"${params}"}]}]};const Yt=e("connectorConfigs",{[dt.MQTT]:Bt,[dt.MODBUS]:Nt,[dt.OPCUA]:Lt,[dt.BLE]:Vt,[dt.REQUEST]:qt,[dt.CAN]:Gt,[dt.BACNET]:zt,[dt.ODBC]:Ut,[dt.REST]:jt,[dt.SNMP]:Ht,[dt.FTP]:Wt,[dt.SOCKET]:Rt,[dt.XMPP]:$t,[dt.OCPP]:Kt,[dt.KNX]:{3.7:{logLevel:"INFO",client:{type:"AUTOMATIC",addressFormat:"LONG",gatewayIP:"127.0.0.1",gatewayPort:3671,autoReconnect:!0,autoReconnectWait:3,gatewaysScanner:{enabled:!0,scanPeriod:3,stopOnFound:!1}},devices:[{deviceInfo:{deviceNameDataType:"string",deviceNameExpressionSource:"expression",deviceNameExpression:"Device ${1/0/5}",deviceProfileDataType:"none",deviceProfileExpressionSource:"constant",deviceProfileNameExpression:"default"},pollPeriod:5e3,attributes:[{type:"temperature",key:"temperature",groupAddress:"1/0/6"}],timeseries:[{type:"humidity",key:"humidity",groupAddress:"1/0/7"}]}],attributeUpdates:[{deviceNameFilter:".*",dataType:"precent_U8",groupAddress:"1/0/9",key:"brightness"}],serverSideRpc:[{requestType:"read",deviceNameFilter:".*",method:"get_name",dataType:"string",groupAddress:"1/0/5"},{requestType:"write",deviceNameFilter:".*",method:"set_name",dataType:"string",groupAddress:"1/0/5"}]}}});function Xt(e){const t=Yt[e];if(!t)throw new Error("No default config found");return t}var Zt;e("ModbusDataType",Zt),function(e){e.STRING="string",e.BYTES="bytes",e.BITS="bits",e.INT8="8int",e.UINT8="8uint",e.INT16="16int",e.UINT16="16uint",e.FLOAT16="16float",e.INT32="32int",e.UINT32="32uint",e.FLOAT32="32float",e.INT64="64int",e.UINT64="64uint",e.FLOAT64="64float"}(Zt||e("ModbusDataType",Zt={}));const Qt=e("ModbusEditableDataTypes",[Zt.BYTES,Zt.BITS,Zt.STRING]);var Jt,en;e("ModbusObjectCountByDataType",Jt),function(e){e[e["8int"]=1]="8int",e[e["8uint"]=1]="8uint",e[e["16int"]=1]="16int",e[e["16uint"]=1]="16uint",e[e["16float"]=1]="16float",e[e["32int"]=2]="32int",e[e["32uint"]=2]="32uint",e[e["32float"]=2]="32float",e[e["64int"]=4]="64int",e[e["64uint"]=4]="64uint",e[e["64float"]=4]="64float"}(Jt||e("ModbusObjectCountByDataType",Jt={})),e("MappingValueType",en),function(e){e.STRING="string",e.INTEGER="integer",e.DOUBLE="double",e.BOOLEAN="boolean"}(en||e("MappingValueType",en={}));const tn=e("mappingValueTypesMap",new Map([[en.STRING,{name:"value.string",icon:"mdi:format-text"}],[en.INTEGER,{name:"value.integer",icon:"mdi:numeric"}],[en.DOUBLE,{name:"value.double",icon:"mdi:numeric"}],[en.BOOLEAN,{name:"value.boolean",icon:"mdi:checkbox-marked-outline"}]])),nn=e("ModbusFunctionCodeTranslationsMap",new Map([[1,"gateway.function-codes.read-coils"],[2,"gateway.function-codes.read-discrete-inputs"],[3,"gateway.function-codes.read-multiple-holding-registers"],[4,"gateway.function-codes.read-input-registers"],[5,"gateway.function-codes.write-single-coil"],[6,"gateway.function-codes.write-single-holding-register"],[15,"gateway.function-codes.write-multiple-coils"],[16,"gateway.function-codes.write-multiple-holding-registers"]]));var an,rn,on;e("ConfigurationModes",an),function(e){e.BASIC="basic",e.ADVANCED="advanced"}(an||e("ConfigurationModes",an={})),e("ReportStrategyType",rn),function(e){e.OnChange="ON_CHANGE",e.OnReportPeriod="ON_REPORT_PERIOD",e.OnChangeOrReportPeriod="ON_CHANGE_OR_REPORT_PERIOD",e.OnReceived="ON_RECEIVED"}(rn||e("ReportStrategyType",rn={})),e("ReportStrategyDefaultValue",on),function(e){e[e.Gateway=6e4]="Gateway",e[e.Connector=6e4]="Connector",e[e.Device=3e4]="Device",e[e.Key=15e3]="Key"}(on||e("ReportStrategyDefaultValue",on={}));const sn=e("ReportStrategyTypeTranslationsMap",new Map([[rn.OnChange,"gateway.report-strategy.on-change"],[rn.OnReportPeriod,"gateway.report-strategy.on-report-period"],[rn.OnChangeOrReportPeriod,"gateway.report-strategy.on-change-or-report-period"],[rn.OnReceived,"gateway.report-strategy.on-received"]])),ln=e("numberInputPattern",new RegExp(/^\d{1,15}(\.\d{1,15})?$/)),pn=e("noLeadTrailSpacesRegex",/^\S+(?: \S+)*$/),cn=e("integerRegex",/^[-+]?\d+$/),dn=e("nonZeroFloat",/^-?(?!0(\.0+)?$)\d+(\.\d+)?$/),un=e("directoryRegex",new RegExp(/^\.\/[^.\/ ]+(?: [^.\/ ]+)*(?:\/[^.\/ ]+(?: [^.\/ ]+)*)*\/$/));var mn;!function(e){e.EXCEPTION="EXCEPTION"}(mn||(mn={}));const hn={...pt,...mn},gn=()=>[10,20,30];function fn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"a",19),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).$implicit,i=t.ɵɵnextContext();return t.ɵɵresetView(i.onTabChanged(n))})),t.ɵɵtext(1),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("active",i.activeLink.name===e.name),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.name," ")}}function yn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",20),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.created-time")))}function vn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵpipe(2,"date"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind2(2,1,e.ts,"yyyy-MM-dd HH:mm:ss")," ")}}function xn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.level")))}function bn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell")(1,"span"),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(i.statusClass(e.status)),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.status)}}function wn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",22),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.message")))}function Sn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵclassMap(i.statusClassMsg(e.status)),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.message," ")}}function Cn(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",23)}function _n(e,n){1&e&&t.ɵɵelement(0,"mat-row",23)}class Tn{constructor(e){this.translate=e,this.displayedColumns=["ts","status","message"],this.gatewayLogLinks=[{name:this.translate.instant("gateway.logs.columns.general"),key:"LOGS"},{name:this.translate.instant("gateway.logs.columns.service"),key:"SERVICE_LOGS"},{name:this.translate.instant("gateway.logs.columns.connection"),key:"CONNECTION_LOGS"},{name:this.translate.instant("gateway.logs.columns.storage"),key:"STORAGE_LOGS"},{key:"EXTENSIONS_LOGS",name:this.translate.instant("gateway.logs.columns.extension")}];const t={property:"ts",direction:w.DESC};this.pageLink=new S(10,0,null,t),this.dataSource=new x([])}ngOnInit(){this.updateWidgetTitle()}ngAfterViewInit(){if(this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.ctx.defaultSubscription.onTimewindowChangeFunction=e=>(this.ctx.defaultSubscription.options.timeWindowConfig=e,this.ctx.defaultSubscription.updateDataSubscriptions(),e),this.ctx.settings.isConnectorLog&&this.ctx.settings.connectorLogState){const e=this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];this.logLinks=[{key:`${e.key}_LOGS`,name:this.translate.instant("gateway.connector"),filterFn:e=>!e.message.includes("_converter.py")},{key:`${e.key}_converter_LOGS`,name:this.translate.instant("gateway.converter"),filterFn:e=>e.message.includes("_converter.py")}]}else this.logLinks=this.gatewayLogLinks;this.activeLink=this.logLinks[0],this.changeSubscription()}updateWidgetTitle(){if(this.ctx.settings.isConnectorLog&&this.ctx.settings.connectorLogState){const e=this.ctx.widgetConfig.title,t="${connectorName}";if(e.includes(t)){const n=this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];this.ctx.widgetTitle=e.replace(t,n.key)}}}updateData(){if(this.ctx.defaultSubscription.data.length&&this.ctx.defaultSubscription.data[0]){let e=this.ctx.defaultSubscription.data[0].data.map((e=>{const t={ts:e[0],key:this.activeLink.key,message:e[1],status:"INVALID LOG FORMAT"};try{t.message=/\[(.*)/.exec(e[1])[0]}catch(n){t.message=e[1]}try{t.status=e[1].match(/\|(\w+)\|/)[1]}catch(e){t.status="INVALID LOG FORMAT"}return t}));this.activeLink.filterFn&&(e=e.filter((e=>this.activeLink.filterFn(e)))),this.dataSource.data=e}}onTabChanged(e){this.activeLink=e,this.changeSubscription()}statusClass(e){switch(e){case hn.DEBUG:return"status status-debug";case hn.WARNING:return"status status-warning";case hn.ERROR:case hn.EXCEPTION:return"status status-error";default:return"status status-info"}}statusClassMsg(e){if(e===hn.EXCEPTION)return"msg-status-exception"}trackByLogTs(e,t){return t.ts}changeSubscription(){this.ctx.datasources&&this.ctx.datasources[0].entity&&this.ctx.defaultSubscription.options.datasources&&(this.ctx.defaultSubscription.options.datasources[0].dataKeys=[{name:this.activeLink.key,type:C.timeseries,settings:{}}],this.ctx.defaultSubscription.unsubscribe(),this.ctx.defaultSubscription.updateDataSubscriptions(),this.ctx.defaultSubscription.callbacks.onDataUpdated=()=>{this.updateData()})}static{this.ɵfac=function(e){return new(e||Tn)(t.ɵɵdirectiveInject(le.TranslateService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Tn,selectors:[["tb-gateway-logs"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(v,5),t.ɵɵviewQuery(b,5)),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first),t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.paginator=e.first)}},inputs:{ctx:"ctx",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:23,vars:21,consts:[["tabPanel",""],[1,"flex","h-full","flex-col"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","",3,"active","click",4,"ngFor","ngForOf"],[1,"flex-1","overflow-auto"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","trackBy","matSortActive","matSortDirection"],["matColumnDef","ts"],["mat-sort-header","","style","width: 20%",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","status"],["mat-sort-header","","style","width: 10%",4,"matHeaderCellDef"],["matColumnDef","message"],["mat-sort-header","","style","width: 70%",4,"matHeaderCellDef"],[3,"class",4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",4,"matRowDef","matRowDefColumns"],[1,"no-data-found","flex-1","items-center","justify-center"],[1,"flex-1"],["showFirstLastButtons","",3,"length","pageIndex","pageSize","pageSizeOptions"],["mat-tab-link","",3,"click","active"],["mat-sort-header","",2,"width","20%"],["mat-sort-header","",2,"width","10%"],["mat-sort-header","",2,"width","70%"],[1,"mat-row-select"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"nav",2),t.ɵɵtemplate(2,fn,2,2,"a",3),t.ɵɵelementEnd(),t.ɵɵelement(3,"mat-tab-nav-panel",null,0),t.ɵɵelementStart(5,"div",4)(6,"table",5),t.ɵɵelementContainerStart(7,6),t.ɵɵtemplate(8,yn,3,3,"mat-header-cell",7)(9,vn,3,4,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(10,9),t.ɵɵtemplate(11,xn,3,3,"mat-header-cell",10)(12,bn,3,3,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(13,11),t.ɵɵtemplate(14,wn,3,3,"mat-header-cell",12)(15,Sn,2,3,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(16,Cn,1,0,"mat-header-row",14)(17,_n,1,0,"mat-row",15),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"span",16),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(21,"span",17),t.ɵɵelementEnd(),t.ɵɵelement(22,"mat-paginator",18),t.ɵɵelementEnd()),2&e){const e=t.ɵɵreference(4);t.ɵɵadvance(),t.ɵɵproperty("tabPanel",e),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.logLinks),t.ɵɵadvance(4),t.ɵɵproperty("dataSource",n.dataSource)("trackBy",n.trackByLogTs)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(10),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",0!==n.dataSource.data.length),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,18,"attribute.no-telemetry-text")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",0===n.dataSource.data.length),t.ɵɵadvance(),t.ɵɵproperty("length",n.dataSource.data.length)("pageIndex",n.pageLink.page)("pageSize",n.pageLink.pageSize)("pageSizeOptions",t.ɵɵpureFunction0(20,gn))}},dependencies:t.ɵɵgetComponentDepsFactory(Tn,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;overflow-x:auto;padding:0}[_nghost-%COMP%] .status[_ngcontent-%COMP%]{border-radius:20px;font-weight:500;padding:5px 15px}[_nghost-%COMP%] .status-debug[_ngcontent-%COMP%]{color:green;background:#0080001a}[_nghost-%COMP%] .status-warning[_ngcontent-%COMP%]{color:orange;background:#ffa5001a}[_nghost-%COMP%] .status-error[_ngcontent-%COMP%]{color:red;background:#ff00001a}[_nghost-%COMP%] .status-info[_ngcontent-%COMP%]{color:#00f;background:#0000801a}[_nghost-%COMP%] .msg-status-exception[_ngcontent-%COMP%]{color:red}']})}} + /** + * @license Angular v18.2.6 + * (c) 2010-2024 Google LLC. https://angular.io/ + * License: MIT + */ + function In(e){e||(n(In),e=i(a));const t=new ye((t=>e.onDestroy(t.next.bind(t))));return e=>e.pipe(Me(t))}e("GatewayLogsComponent",Tn);function En(e,t){!t?.injector&&n(En);const l=t?.injector??i(r),p=new ve(1),c=o((()=>{let t;try{t=e()}catch(e){return void s((()=>p.error(e)))}s((()=>p.next(t)))}),{injector:l,manualCleanup:!0});return l.get(a).onDestroy((()=>{c.destroy(),p.complete()})),p.asObservable()}const Mn=["commandInput"],kn=(e,t)=>t.attributeOnGateway,Pn=e=>({command:e});function Dn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.clear())})),t.ɵɵelementStart(2,"mat-icon",11),t.ɵɵtext(3,"close"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"action.clear"))}function On(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",12),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onCreateNewClick(n))})),t.ɵɵelementStart(1,"span",13),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"notification.create-new")))}function An(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵelement(1,"span",14),t.ɵɵpipe(2,"async"),t.ɵɵpipe(3,"highlight"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(3,4,e.attributeOnGateway,t.ɵɵpipeBind1(2,2,i.searchText$)),t.ɵɵsanitizeHtml)}}function Fn(e,n){if(1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"async"),t.ɵɵpipe(2,"translate")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind2(2,3,"gateway.statistics.no-commands-matching",t.ɵɵpureFunction1(6,Pn,e.truncate.transform(t.ɵɵpipeBind1(1,1,e.searchText$),!0,6,"...")))," ")}}function Rn(e,n){1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(1,1,"gateway.statistics.no-command-found")," ")}function Bn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-option",9)(1,"div",15),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(2,"span"),t.ɵɵtemplate(3,Fn,3,8),t.ɵɵpipe(4,"async"),t.ɵɵtemplate(5,Rn,2,3),t.ɵɵelementStart(6,"a",16),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onCreateNewClick(n))})),t.ɵɵtext(7,"gateway.create-new-one"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("value",null),t.ɵɵadvance(3),t.ɵɵconditional(t.ɵɵpipeBind1(4,2,e.searchText$)?3:5)}}class Nn{constructor(e,t){this.truncate=e,this.fb=t,this.commands=l(),this.onCreateNewClicked=p(),this.selectStatisticsCommandControl=this.fb.control({}),this.searchText$=this.selectStatisticsCommandControl.valueChanges.pipe(ke((e=>e?"string"==typeof e?e:e?.attributeOnGateway:"")),Pe(),xe(1)),this.filteredCommands$=be([this.searchText$,En(this.commands)]).pipe(De(150),ke((([e,t])=>{const n=t.find((t=>t.attributeOnGateway===e))??null,i=this.selectStatisticsCommandControl.value;return"string"==typeof i&&n?.attributeOnGateway!==e||this.selectStatisticsCommandControl.patchValue(n,{emitEvent:!W(n,i)}),t.filter((t=>t.attributeOnGateway.toLowerCase().includes(e?.toLowerCase()??"")))})),xe(1)),this.onChanges=e=>{},this.selectStatisticsCommandControl.valueChanges.pipe(In()).subscribe((e=>this.onChanges(e)))}registerOnChange(e){this.onChanges=e}registerOnTouched(e){}writeValue(e){this.selectStatisticsCommandControl.patchValue(e)}displayCommandFn(e){return e?e.attributeOnGateway:null}clear(){this.selectStatisticsCommandControl.patchValue(null,{emitEvent:!0}),setTimeout((()=>{this.commandInput.nativeElement.blur(),this.commandInput.nativeElement.focus()}),0)}onCreateNewClick(e){e.stopPropagation(),this.onCreateNewClicked.emit()}static{this.ɵfac=function(e){return new(e||Nn)(t.ɵɵdirectiveInject(T.TruncatePipe),t.ɵɵdirectiveInject(de.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Nn,selectors:[["tb-statistics-commands-autocomplete"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(Mn,7),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.commandInput=e.first)}},inputs:{commands:[1,"commands"]},outputs:{onCreateNewClicked:"onCreateNewClicked"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>Nn)),multi:!0}]),t.ɵɵStandaloneFeature],decls:14,vars:10,consts:[["commandInput",""],["commandAutocomplete","matAutocomplete"],["appearance","outline",1,"mat-block"],["translate",""],["matInput","","type","text",3,"formControl","matAutocomplete"],["type","button","matTooltipPosition","above","matSuffix","","mat-icon-button","","aria-label","Clear",1,"action-button",3,"matTooltip"],["mat-button","","color","primary","matSuffix","",1,"mr-2"],[1,"tb-autocomplete",3,"displayWith"],[3,"value"],[1,"tb-not-found",3,"value"],["type","button","matTooltipPosition","above","matSuffix","","mat-icon-button","","aria-label","Clear",1,"action-button",3,"click","matTooltip"],[1,"material-icons"],["mat-button","","color","primary","matSuffix","",1,"mr-2",3,"click"],[1,"whitespace-nowrap"],[3,"innerHTML"],[1,"tb-not-found-content",3,"click"],["translate","",3,"click"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field",2)(1,"mat-label",3),t.ɵɵtext(2,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(3,"input",4,0),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,Dn,4,3,"button",5)(7,On,4,3,"button",6),t.ɵɵelementStart(8,"mat-autocomplete",7,1),t.ɵɵrepeaterCreate(10,An,4,7,"mat-option",8,kn,!1,Bn,8,4,"mat-option",9),t.ɵɵpipe(13,"async"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵreference(9);t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.selectStatisticsCommandControl)("matAutocomplete",e),t.ɵɵattribute("aria-label",t.ɵɵpipeBind1(5,6,"gateway.statistics.command")),t.ɵɵadvance(3),t.ɵɵconditional(n.selectStatisticsCommandControl.value?6:7),t.ɵɵadvance(2),t.ɵɵproperty("displayWith",n.displayCommandFn),t.ɵɵadvance(2),t.ɵɵrepeater(t.ɵɵpipeBind1(13,8,n.filteredCommands$))}},dependencies:t.ɵɵgetComponentDepsFactory(Nn,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border-bottom:none;color:inherit}[_nghost-%COMP%] .action-button[_ngcontent-%COMP%]{opacity:.7}']})}}const Ln=()=>["createdTime","message"];function Vn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",12),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"widgets.gateway.created-time")))}function qn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",13),t.ɵɵtext(1),t.ɵɵpipe(2,"date"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(2,1,e[0],"yyyy-MM-dd HH:mm:ss"))}}function Gn(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",14),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"widgets.gateway.message")," "))}function zn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell")(1,"div",15),t.ɵɵtext(2),t.ɵɵelement(3,"tb-copy-button",16),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",e[1]," "),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(4,3,"gateway.statistics.copy-message")),t.ɵɵproperty("copyText",e[1])}}function Un(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",17)}function jn(e,n){1&e&&t.ɵɵelement(0,"mat-row",17)}class Hn{constructor(){this.data=l([]),this.defaultPageSizes=[10,20,30],this.defaultSortOrder={property:"0",direction:w.DESC},this.pageLink=new S(this.defaultPageSizes[0],0,null,this.defaultSortOrder),this.dataSource=new x([]),o((()=>{this.dataSource.data=this.data()}))}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.dataSource.sortingDataAccessor=e=>e[Number(this.sort?.active)||0]}static{this.ɵfac=function(e){return new(e||Hn)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Hn,selectors:[["tb-custom-statistics-table"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(v,5),t.ɵɵviewQuery(b,5)),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first),t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.paginator=e.first)}},inputs:{data:[1,"data"]},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:12,vars:13,consts:[[1,"flex","h-full","flex-col"],[1,"flex-1","overflow-auto"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","matSortActive","matSortDirection"],["matColumnDef","createdTime"],["mat-sort-header","","class","w-1/5",4,"matHeaderCellDef"],["class","!w-1/5",4,"matCellDef"],["matColumnDef","message"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"length","pageSize","pageSizeOptions"],["mat-sort-header","",1,"w-1/5"],[1,"!w-1/5"],["mat-sort-header",""],[1,"flex","items-center","justify-between"],["tooltipPosition","above","icon","content_copy",1,"copy-content",3,"copyText","tooltipText"],[1,"mat-row-select"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"table",2),t.ɵɵelementContainerStart(3,3),t.ɵɵtemplate(4,Vn,3,3,"mat-header-cell",4)(5,qn,3,4,"mat-cell",5),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(6,6),t.ɵɵtemplate(7,Gn,3,3,"mat-header-cell",7)(8,zn,5,5,"mat-cell",8),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(9,Un,1,0,"mat-header-row",9)(10,jn,1,0,"mat-row",10),t.ɵɵelementEnd()(),t.ɵɵelement(11,"mat-paginator",11),t.ɵɵelementEnd()),2&e){let e;t.ɵɵadvance(2),t.ɵɵproperty("dataSource",n.dataSource)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(7),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(11,Ln))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(12,Ln)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",!n.dataSource.data.length),t.ɵɵproperty("length",null!==(e=null==n.dataSource||null==n.dataSource.data?null:n.dataSource.data.length)&&void 0!==e?e:0)("pageSize",n.defaultPageSizes[0])("pageSizeOptions",n.defaultPageSizes)}},dependencies:t.ɵɵgetComponentDepsFactory(Hn,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .copy-content .mat-icon{padding:4px;font-size:18px}']})}}class Wn{constructor(e,t,n){this.elementRef=e,this.renderer=t,this.tooltip=n,this.tooltipEnabled=!0,this.position="above",this.destroy$=new we}ngOnInit(){this.observeMouseEvents(),this.applyTruncationStyles()}ngAfterViewInit(){this.tooltip.position=this.position}ngOnDestroy(){this.tooltip._isTooltipVisible()&&this.hideTooltip(),this.destroy$.next(),this.destroy$.complete()}observeMouseEvents(){Se(this.elementRef.nativeElement,"mouseenter").pipe(Oe((()=>this.tooltipEnabled)),Oe((()=>this.isOverflown(this.elementRef.nativeElement))),Ae((()=>this.showTooltip())),Me(this.destroy$)).subscribe(),Se(this.elementRef.nativeElement,"mouseleave").pipe(Oe((()=>this.tooltipEnabled)),Oe((()=>this.tooltip._isTooltipVisible())),Ae((()=>this.hideTooltip())),Me(this.destroy$)).subscribe()}applyTruncationStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"white-space","nowrap"),this.renderer.setStyle(this.elementRef.nativeElement,"overflow","hidden"),this.renderer.setStyle(this.elementRef.nativeElement,"text-overflow","ellipsis")}isOverflown(e){return e.clientWidth{this.adjustChips()}),0))}constructor(e,t,n,i){this.el=e,this.renderer=t,this.translate=n,this.window=i,this.destroy$=new we,this.renderer.setStyle(this.el.nativeElement,"max-height","48px"),this.renderer.setStyle(this.el.nativeElement,"overflow","auto"),Se(i,"resize").pipe(Me(this.destroy$)).subscribe((()=>{this.adjustChips()})),this.observeIntersection()}observeIntersection(){this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.adjustChips()}))})),this.intersectionObserver.observe(this.el.nativeElement)}adjustChips(){const e=this.el.nativeElement,t=this.el.nativeElement.querySelector(".ellipsis-chip"),n=parseFloat(this.window.getComputedStyle(t).marginLeft)||0,i=e.querySelectorAll("mat-chip:not(.ellipsis-chip)");if(this.chipsValue.length>1){const a=this.el.nativeElement.querySelector(".ellipsis-text");this.renderer.setStyle(t,"display","inline-flex"),a.innerHTML=this.translate.instant("gateway.ellipsis-chips-text",{count:this.chipsValue.length});const r=e.offsetWidth-(t.offsetWidth+n);let o=0,s=0;i.forEach((e=>{this.renderer.setStyle(e,"display","inline-flex");const t=e.querySelector(".mdc-evolution-chip__text-label");this.applyMaxChipTextWidth(t,r/3),o+(e.offsetWidth+n)<=r&&s_e(E())))).subscribe((e=>{this.attributesSubject.next(e.data),this.pageDataSubject.next(e),a.next(e)})),a}fetchAttributes(e,t,n){return this.getAllAttributes(e,t).pipe(ke((e=>{const t=e.filter((e=>0!==e.lastUpdateTs));return n.filterData(t)})))}getAllAttributes(e,t){if(!this.allAttributes){let n;M.get(t)?(this.telemetrySubscriber=k.createEntityAttributesSubscription(this.telemetryWsService,e,t,this.zone),this.telemetrySubscriber.subscribe(),n=this.telemetrySubscriber.attributeData$()):n=this.attributeService.getEntityAttributes(e,t),this.allAttributes=n.pipe(Re(1),Be())}return this.allAttributes}isAllSelected(){const e=this.selection.selected.length;return this.attributesSubject.pipe(ke((t=>e===t.length)))}isEmpty(){return this.attributesSubject.pipe(ke((e=>!e.length)))}total(){return this.pageDataSubject.pipe(ke((e=>e.totalElements)))}masterToggle(){this.attributesSubject.pipe(Ae((e=>{this.selection.selected.length===e.length?this.selection.clear():e.forEach((e=>{this.selection.select(e)}))})),Ne(1)).subscribe()}}e("AttributeDatasource",Kn);const Yn=()=>({maxWidth:"970px"});function Xn(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-expansion-panel",4)(1,"mat-expansion-panel-header",5)(2,"mat-panel-title")(3,"mat-slide-toggle",6),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(4,"mat-label"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementContainer(7,7),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(),n=t.ɵɵreference(5);t.ɵɵproperty("expanded",e.showStrategyControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showStrategyControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,4,"gateway.report-strategy.label")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n)}}function Zn(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",8),t.ɵɵtext(1,"gateway.report-strategy.label"),t.ɵɵelementEnd(),t.ɵɵelementContainer(2,7)),2&e){t.ɵɵnextContext();const e=t.ɵɵreference(5);t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",e)}}function Qn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",16),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ReportTypeTranslateMap.get(e)))}}function Jn(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",19),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.reportStrategyFormGroup.get("reportPeriod").hasError("min")?"gateway.hints.report-period-range":"gateway.hints.report-period-required"))}}function ei(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",17),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",18),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,Jn,3,3,"mat-icon",19),t.ɵɵelementStart(8,"span",20),t.ɵɵtext(9,"gateway.suffix.ms"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.report-strategy.report-period")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.reportStrategyFormGroup.get("reportPeriod").hasError("required")||e.reportStrategyFormGroup.get("reportPeriod").hasError("min")&&e.reportStrategyFormGroup.get("reportPeriod").touched?7:-1)}}function ti(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelement(4,"div",11),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",12)(6,"mat-select",13),t.ɵɵtemplate(7,Qn,3,4,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,ei,10,7,"div",15)),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"gateway.type")," "),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/report-strategy_fn")("tb-help-popup-style",t.ɵɵpureFunction0(7,Yn)),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.reportStrategyTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.reportStrategyFormGroup.get("type").value!==e.ReportStrategyType.OnChange&&e.reportStrategyFormGroup.get("type").value!==e.ReportStrategyType.OnReceived)}}class ni{constructor(e){this.fb=e,this.isExpansionMode=!1,this.defaultValue=on.Key,this.isConfig=!1,this.reportStrategyTypes=Object.values(rn),this.ReportTypeTranslateMap=sn,this.ReportStrategyType=rn,this.destroy$=new we,this.showStrategyControl=this.fb.control(!1),this.reportStrategyFormGroup=this.fb.group({type:[{value:rn.OnReportPeriod,disabled:!0},[]],reportPeriod:[{value:this.defaultValue,disabled:!0},[me.required,me.min(100)]]}),this.observeStrategyFormChange(),this.observeStrategyToggle()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}writeValue(e){const t=this.isDisabledConfig(e);if(this.isExpansionMode&&this.showStrategyControl.setValue(!t&&!!e,{emitEvent:!1}),t||!e)return this.reportStrategyFormGroup.disable({emitEvent:!1}),void this.reportStrategyFormGroup.setValue(this.getDefaultConfig(),{emitEvent:!1});this.reportStrategyFormGroup.enable({emitEvent:!1});const n=this.getDefaultConfig(),{type:i=n.type,reportPeriod:a=n.reportPeriod}=e??{};this.reportStrategyFormGroup.setValue({type:i,reportPeriod:a},{emitEvent:!1}),this.onTypeChange(i)}validate(){return this.reportStrategyFormGroup.valid||this.reportStrategyFormGroup.disabled?null:{reportStrategyForm:{valid:!1}}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}observeStrategyFormChange(){this.reportStrategyFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()})),this.reportStrategyFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.onTypeChange(e)))}observeStrategyToggle(){this.showStrategyControl.valueChanges.pipe(Me(this.destroy$),Oe((()=>this.isExpansionMode))).subscribe((e=>{if(e)this.reportStrategyFormGroup.enable({emitEvent:!1}),this.onTypeChange(this.reportStrategyFormGroup.get("type").value),this.reportStrategyFormGroup.updateValueAndValidity({emitEvent:!1}),this.onChange(this.reportStrategyFormGroup.value);else{this.reportStrategyFormGroup.disable({emitEvent:!1});const e=this.isConfig?{type:"DISABLED"}:null;this.onChange(e)}}))}onTypeChange(e){const t=this.reportStrategyFormGroup.get("reportPeriod");e===rn.OnChange||e===rn.OnReceived?t.disable({emitEvent:!1}):this.isExpansionMode&&!this.showStrategyControl.value||(t.enable({emitEvent:!1}),this.isConfig&&t.setValue(on.Gateway,{emitEvent:!1}))}getDefaultConfig(){return{type:this.isConfig?rn.OnReceived:rn.OnReportPeriod,reportPeriod:this.isConfig?null:this.defaultValue}}isDisabledConfig(e){return this.isConfig&&("DISABLED"===e?.type||"DISABLED"===e?.type)}static{this.ɵfac=function(e){return new(e||ni)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:ni,selectors:[["tb-report-strategy"]],inputs:{isExpansionMode:"isExpansionMode",defaultValue:"defaultValue",isConfig:"isConfig"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>ni)),multi:!0},{provide:he,useExisting:c((()=>ni)),multi:!0}]),t.ɵɵStandaloneFeature],decls:6,vars:3,consts:[["defaultMode",""],["strategyFields",""],[3,"formGroup"],["class","tb-settings",3,"expanded",4,"ngIf","ngIfElse"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],[3,"ngTemplateOutlet"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","flex","items-center","gap-2"],["matSuffix","","tb-help-popup-placement","right",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],[3,"value"],["tbTruncateWithTooltip","",1,"fixed-title-width","tb-required"],["matInput","","type","number","min","100","name","value","formControlName","reportPeriod",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["translate","","matSuffix","",1,"block","pr-2"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,2),t.ɵɵtemplate(1,Xn,8,6,"mat-expansion-panel",3)(2,Zn,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor)(4,ti,9,8,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(3);t.ɵɵproperty("formGroup",n.reportStrategyFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isExpansionMode)("ngIfElse",e)}},dependencies:t.ɵɵgetComponentDepsFactory(ni,[se,_,Wn]),encapsulation:2,changeDetection:d.OnPush})}}e("ReportStrategyComponent",ni),He([I()],ni.prototype,"isExpansionMode",void 0),He([P()],ni.prototype,"defaultValue",void 0),He([I()],ni.prototype,"isConfig",void 0);class ii{constructor(e,t){this.attributeService=e,this.cd=t,this.isGatewayActive=!1}ngAfterViewInit(){this.ctx.$scope.gatewayStatus=this,this.loadGatewayState()}loadGatewayState(){this.attributeService.getEntityAttributes(this.deviceId,D.SERVER_SCOPE,["active","lastDisconnectTime","lastConnectTime"]).subscribe((e=>{const t=e.find((e=>"active"===e.key)).value,n=e.find((e=>"lastDisconnectTime"===e.key))?.value,i=e.find((e=>"lastConnectTime"===e.key))?.value;this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}))}getGatewayStatus(e,t,n){return!!e&&(!n||t>n)}onDataUpdated(){const e=this.ctx.defaultSubscription.data,t=e.find((e=>"active"===e.dataKey.name)).data[0][1],n=e.find((e=>"lastDisconnectTime"===e.dataKey.name)).data[0][1],i=e.find((e=>"lastConnectTime"===e.dataKey.name)).data[0][1];this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}static{this.ɵfac=function(e){return new(e||ii)(t.ɵɵdirectiveInject(K.AttributeService),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:ii,selectors:[["tb-gateway-status"]],inputs:{ctx:"ctx",deviceId:"deviceId"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:9,vars:10,consts:[[1,"flex","min-h-10","flex-1","justify-center"],[1,"divider"],[1,"whitespace-nowrap"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-card",0),t.ɵɵelement(1,"div",1),t.ɵɵelementStart(2,"mat-card-header")(3,"mat-card-subtitle",2),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"mat-card-content"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵclassProp("divider-red",!n.isGatewayActive)("divider-green",n.isGatewayActive),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,6,"gateway.gateway-status")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,8,n.isGatewayActive?"gateway.active":"gateway.inactive")))},dependencies:t.ɵɵgetComponentDepsFactory(ii,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex}[_nghost-%COMP%] .divider[_ngcontent-%COMP%]{position:absolute;width:3px;top:12px;border-radius:2px;bottom:4px;left:10px}[_nghost-%COMP%] .divider-green[_ngcontent-%COMP%] .divider[_ngcontent-%COMP%]{border:1px solid rgb(25,128,56);background-color:#198038}[_nghost-%COMP%] .divider-green[_ngcontent-%COMP%] .mat-mdc-card-content[_ngcontent-%COMP%]{color:#198038}[_nghost-%COMP%] .divider-red[_ngcontent-%COMP%] .divider[_ngcontent-%COMP%]{border:1px solid rgb(203,37,48);background-color:#cb2530}[_nghost-%COMP%] .divider-red[_ngcontent-%COMP%] .mat-mdc-card-content[_ngcontent-%COMP%]{color:#cb2530}.mdc-card[_ngcontent-%COMP%]{position:relative;padding-left:10px;box-shadow:none}.mat-mdc-card-subtitle[_ngcontent-%COMP%]{font-weight:400;font-size:12px}.mat-mdc-card-header[_ngcontent-%COMP%]{padding:8px 16px 0}.mat-mdc-card-content[_ngcontent-%COMP%]:last-child{padding-bottom:8px;font-size:16px}'],changeDetection:d.OnPush})}}e("GatewayStatusComponent",ii);class ai{constructor(){this.tooltipText=""}static{this.ɵfac=function(e){return new(e||ai)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:ai,selectors:[["tb-error-icon"]],inputs:{tooltipText:"tooltipText"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:2,vars:1,consts:[["matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",0),t.ɵɵtext(1," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",n.tooltipText)},dependencies:t.ɵɵgetComponentDepsFactory(ai,[_,se]),styles:["[_nghost-%COMP%]{display:flex;width:40px;height:40px;padding:10px}mat-icon[_ngcontent-%COMP%]{font-size:20px}"]})}}var ri,oi;e("ErrorTooltipIconComponent",ai),e("MqttConverterType",ri),function(e){e.JSON="json",e.BYTES="bytes",e.CUSTOM="custom"}(ri||e("MqttConverterType",ri={})),e("MQTTSourceType",oi),function(e){e.MSG="message",e.TOPIC="topic",e.CONST="constant"}(oi||e("MQTTSourceType",oi={}));const si=e("MqttVersions",[{name:3.1,value:3},{name:3.11,value:4},{name:5,value:5}]),li=e("QualityTypeTranslationsMap",new Map([[0,"gateway.qos.at-most-once"],[1,"gateway.qos.at-least-once"],[2,"gateway.qos.exactly-once"]])),pi=e("ConvertorTypeTranslationsMap",new Map([[ri.JSON,"gateway.JSON"],[ri.BYTES,"gateway.bytes"],[ri.CUSTOM,"gateway.custom"]]));var ci;e("RequestType",ci),function(e){e.CONNECT_REQUEST="connectRequests",e.DISCONNECT_REQUEST="disconnectRequests",e.ATTRIBUTE_REQUEST="attributeRequests",e.ATTRIBUTE_UPDATE="attributeUpdates",e.SERVER_SIDE_RPC="serverSideRpc"}(ci||e("RequestType",ci={}));const di=e("RequestTypesTranslationsMap",new Map([[ci.CONNECT_REQUEST,"gateway.request.connect-request"],[ci.DISCONNECT_REQUEST,"gateway.request.disconnect-request"],[ci.ATTRIBUTE_REQUEST,"gateway.request.attribute-request"],[ci.ATTRIBUTE_UPDATE,"gateway.request.attribute-update"],[ci.SERVER_SIDE_RPC,"gateway.request.rpc-connection"]])),ui=e("DataConversionTranslationsMap",new Map([[ri.JSON,"gateway.JSON-hint"],[ri.BYTES,"gateway.bytes-hint"],[ri.CUSTOM,"gateway.custom-hint"]]));var mi,hi;e("SocketType",mi),function(e){e.TCP="TCP",e.UDP="UDP"}(mi||e("SocketType",mi={})),e("SocketValueKey",hi),function(e){e.TIMESERIES="telemetry",e.ATTRIBUTES="attributes",e.ATTRIBUTES_REQUESTS="attributeRequests",e.ATTRIBUTES_UPDATES="attributeUpdates",e.RPC_METHODS="serverSideRpc"}(hi||e("SocketValueKey",hi={}));const gi=e("SocketKeysPanelTitleTranslationsMap",new Map([[hi.ATTRIBUTES,"gateway.attributes"],[hi.TIMESERIES,"gateway.timeseries"],[hi.ATTRIBUTES_REQUESTS,"gateway.attribute-requests"],[hi.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[hi.RPC_METHODS,"gateway.rpc-methods"]]));var fi,yi;e("RequestsType",fi),function(e){e.Shared="shared",e.Client="client"}(fi||e("RequestsType",fi={})),e("ExpressionType",yi),function(e){e.Constant="constant",e.Expression="expression"}(yi||e("ExpressionType",yi={}));const vi=e("SocketKeysAddKeyTranslationsMap",new Map([[hi.ATTRIBUTES,"gateway.add-attribute"],[hi.TIMESERIES,"gateway.add-timeseries"],[hi.ATTRIBUTES_REQUESTS,"gateway.add-attribute-request"],[hi.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[hi.RPC_METHODS,"gateway.add-rpc-method"]])),xi=e("SocketKeysDeleteKeyTranslationsMap",new Map([[hi.ATTRIBUTES,"gateway.delete-attribute"],[hi.TIMESERIES,"gateway.delete-timeseries"],[hi.ATTRIBUTES_REQUESTS,"gateway.delete-attribute-request"],[hi.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[hi.RPC_METHODS,"gateway.delete-rpc-method"]])),bi=e("SocketKeysNoKeysTextTranslationsMap",new Map([[hi.ATTRIBUTES,"gateway.no-attributes"],[hi.TIMESERIES,"gateway.no-timeseries"],[hi.ATTRIBUTES_REQUESTS,"gateway.no-attribute-requests"],[hi.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[hi.RPC_METHODS,"gateway.no-rpc-methods"]]));var wi,Si,Ci,_i;e("RestConverterType",wi),function(e){e.JSON="json",e.CUSTOM="custom"}(wi||e("RestConverterType",wi={})),e("RestSourceType",Si),function(e){e.REQUEST="request",e.CONST="constant"}(Si||e("RestSourceType",Si={})),e("ResponseType",Ci),function(e){e.DEFAULT="default",e.CONST="constant",e.ADVANCED="advanced"}(Ci||e("ResponseType",Ci={})),e("ResponseStatus",_i),function(e){e.OK="OK",e.ERROR="Error"}(_i||e("ResponseStatus",_i={}));const Ti=e("ResponseTypeTranslationsMap",new Map([[Ci.DEFAULT,"gateway.rest.response-type.default"],[Ci.CONST,"gateway.rest.response-type.const"],[Ci.ADVANCED,"gateway.rest.response-type.advanced"]]));var Ii;e("RestRequestType",Ii),function(e){e.ATTRIBUTE_REQUEST="attributeRequests",e.ATTRIBUTE_UPDATE="attributeUpdates",e.SERVER_SIDE_RPC="serverSideRpc"}(Ii||e("RestRequestType",Ii={}));const Ei=e("RestRequestTypesTranslationsMap",new Map([[Ii.ATTRIBUTE_REQUEST,"gateway.request.attribute-request"],[Ii.ATTRIBUTE_UPDATE,"gateway.request.attribute-update"],[Ii.SERVER_SIDE_RPC,"gateway.request.rpc-connection"]]));var Mi;e("RestRequestsScopeType",Mi),function(e){e.Shared="shared",e.Client="client"}(Mi||e("RestRequestsScopeType",Mi={}));const ki=e("RestRequestTypeFieldsMap",new Map([[Ii.ATTRIBUTE_REQUEST,["HTTPMethods","endpoint","type","deviceNameExpression","attributeNameExpression"]],[Ii.ATTRIBUTE_UPDATE,["HTTPMethod","SSLVerify","deviceNameFilter","attributeFilter","requestUrlExpression","valueExpression","httpHeaders","tries","allowRedirects"]],[Ii.SERVER_SIDE_RPC,["HTTPMethod","deviceNameFilter","methodFilter","requestUrlExpression","valueExpression","responseTimeout","httpHeaders","tries"]],["all",["requestType","timeout","security"]]])),Pi=e("RestConvertorTypeTranslationsMap",new Map([[wi.JSON,"gateway.JSON"],[wi.CUSTOM,"gateway.custom"]])),Di=e("RestDataConversionTranslationsMap",new Map([[wi.JSON,"gateway.hints.rest.JSON"],[wi.CUSTOM,"gateway.custom-hint"]]));var Oi;e("PortLimits",Oi),function(e){e[e.MIN=1]="MIN",e[e.MAX=65535]="MAX"}(Oi||e("PortLimits",Oi={}));const Ai=e("GatewayConnectorConfigVersionMap",new Map([[dt.REST,ct.v3_7_2],[dt.KNX,ct.v3_7_0],[dt.BACNET,ct.v3_6_2],[dt.SOCKET,ct.v3_6_0],[dt.MQTT,ct.v3_5_2],[dt.OPCUA,ct.v3_5_2],[dt.MODBUS,ct.v3_5_2]]));var Fi,Ri,Bi,Ni;e("OPCUaSourceType",Fi),function(e){e.PATH="path",e.IDENTIFIER="identifier",e.CONST="constant"}(Fi||e("OPCUaSourceType",Fi={})),e("SecurityType",Ri),function(e){e.ANONYMOUS="anonymous",e.BASIC="basic",e.CERTIFICATES="certificates"}(Ri||e("SecurityType",Ri={})),e("ModeType",Bi),function(e){e.NONE="None",e.SIGN="Sign",e.SIGNANDENCRYPT="SignAndEncrypt"}(Bi||e("ModeType",Bi={})),e("MappingType",Ni),function(e){e.DATA="data",e.REQUESTS="requests",e.OPCUA="OPCua"}(Ni||e("MappingType",Ni={}));const Li=e("MappingTypeTranslationsMap",new Map([[Ni.DATA,"gateway.data-mapping"],[Ni.REQUESTS,"gateway.requests-mapping"],[Ni.OPCUA,"gateway.data-mapping"]]));var Vi;e("SecurityPolicy",Vi),function(e){e.BASIC128="Basic128Rsa15",e.BASIC256="Basic256",e.BASIC256SHA="Basic256Sha256"}(Vi||e("SecurityPolicy",Vi={}));const qi=e("SecurityPolicyTypes",[{value:Vi.BASIC128,name:"Basic128RSA15"},{value:Vi.BASIC256,name:"Basic256"},{value:Vi.BASIC256SHA,name:"Basic256SHA256"}]),Gi=e("SecurityTypeTranslationsMap",new Map([[Ri.ANONYMOUS,"gateway.broker.security-types.anonymous"],[Ri.BASIC,"gateway.broker.security-types.basic"],[Ri.CERTIFICATES,"gateway.broker.security-types.certificates"]])),zi=e("SourceTypeTranslationsMap",new Map([[oi.MSG,"gateway.source-type.msg"],[oi.TOPIC,"gateway.source-type.topic"],[oi.CONST,"gateway.source-type.const"],[Fi.PATH,"gateway.source-type.path"],[Fi.IDENTIFIER,"gateway.source-type.identifier"],[Fi.CONST,"gateway.source-type.const"],[yi.Expression,"gateway.source-type.expression"],[Si.REQUEST,"gateway.source-type.request"]]));var Ui;e("MappingKeysType",Ui),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.CUSTOM="extensionConfig",e.RPC_METHODS="rpc_methods",e.ATTRIBUTES_UPDATES="attributes_updates"}(Ui||e("MappingKeysType",Ui={}));const ji=e("MappingKeysPanelTitleTranslationsMap",new Map([[Ui.ATTRIBUTES,"gateway.attributes"],[Ui.TIMESERIES,"gateway.timeseries"],[Ui.CUSTOM,"gateway.keys"],[Ui.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[Ui.RPC_METHODS,"gateway.rpc-methods"]])),Hi=e("MappingKeysAddKeyTranslationsMap",new Map([[Ui.ATTRIBUTES,"gateway.add-attribute"],[Ui.TIMESERIES,"gateway.add-timeseries"],[Ui.CUSTOM,"gateway.add-key"],[Ui.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[Ui.RPC_METHODS,"gateway.add-rpc-method"]])),Wi=e("MappingKeysDeleteKeyTranslationsMap",new Map([[Ui.ATTRIBUTES,"gateway.delete-attribute"],[Ui.TIMESERIES,"gateway.delete-timeseries"],[Ui.CUSTOM,"gateway.delete-key"],[Ui.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[Ui.RPC_METHODS,"gateway.delete-rpc-method"]])),$i=e("MappingKeysNoKeysTextTranslationsMap",new Map([[Ui.ATTRIBUTES,"gateway.no-attributes"],[Ui.TIMESERIES,"gateway.no-timeseries"],[Ui.CUSTOM,"gateway.no-keys"],[Ui.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[Ui.RPC_METHODS,"gateway.no-rpc-methods"]])),Ki=e("QualityTypes",[0,1,2]);var Yi;e("ServerSideRpcType",Yi),function(e){e.WithResponse="twoWay",e.WithoutResponse="oneWay"}(Yi||e("ServerSideRpcType",Yi={}));const Xi=e("HelpLinkByMappingTypeMap",new Map([[Ni.DATA,O+"/docs/iot-gateway/config/mqtt/#section-mapping"],[Ni.OPCUA,O+"/docs/iot-gateway/config/opc-ua/#section-mapping"],[Ni.REQUESTS,O+"/docs/iot-gateway/config/mqtt/#requests-mapping"]])),Zi=e("MappingHintTranslationsMap",new Map([[Ni.DATA,"gateway.data-mapping-hint"],[Ni.OPCUA,"gateway.opcua-data-mapping-hint"],[Ni.REQUESTS,"gateway.requests-mapping-hint"]]));var Qi,Ji,ea,ta,na,ia,aa,ra,oa;e("ServerSideRPCType",Qi),function(e){e.ONE_WAY="oneWay",e.TWO_WAY="twoWay"}(Qi||e("ServerSideRPCType",Qi={})),e("SecurityMode",Ji),function(e){e.basic="basic",e.certificates="certificates",e.extendedCertificates="extendedCertificates"}(Ji||e("SecurityMode",Ji={})),e("ModbusProtocolType",ea),function(e){e.TCP="tcp",e.UDP="udp",e.Serial="serial"}(ea||e("ModbusProtocolType",ea={})),e("ModbusMethodType",ta),function(e){e.SOCKET="socket",e.RTU="rtu"}(ta||e("ModbusMethodType",ta={})),e("ModbusSerialMethodType",na),function(e){e.RTU="rtu",e.ASCII="ascii"}(na||e("ModbusSerialMethodType",na={})),e("ModbusParity",ia),function(e){e.Even="E",e.Odd="O",e.None="N"}(ia||e("ModbusParity",ia={})),e("ModbusOrderType",aa),function(e){e.BIG="BIG",e.LITTLE="LITTLE"}(aa||e("ModbusOrderType",aa={})),e("ModbusRegisterType",ra),function(e){e.HoldingRegisters="holding_registers",e.CoilsInitializer="coils_initializer",e.InputRegisters="input_registers",e.DiscreteInputs="discrete_inputs"}(ra||e("ModbusRegisterType",ra={})),e("ModbusValueKey",oa),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.ATTRIBUTES_UPDATES="attributeUpdates",e.RPC_REQUESTS="rpc"}(oa||e("ModbusValueKey",oa={}));const sa=e("ModbusBaudrates",[4800,9600,19200,38400,57600,115200,230400,460800,921600]),la=e("ModbusByteSizes",[5,6,7,8]),pa=e("ModbusDefaultRetries",3),ca=e("ModbusRegisterTranslationsMap",new Map([[ra.HoldingRegisters,"gateway.holding_registers"],[ra.CoilsInitializer,"gateway.coils_initializer"],[ra.InputRegisters,"gateway.input_registers"],[ra.DiscreteInputs,"gateway.discrete_inputs"]]));var da;e("ModbusBitTargetType",da),function(e){e.BooleanType="bool",e.IntegerType="int"}(da||e("ModbusBitTargetType",da={}));const ua=e("ModbusBitTargetTypeTranslationMap",new Map([[da.BooleanType,"gateway.boolean"],[da.IntegerType,"gateway.integer"]])),ma=e("ModbusMethodLabelsMap",new Map([[ta.SOCKET,"Socket"],[ta.RTU,"RTU"],[na.ASCII,"ASCII"]])),ha=e("ModbusProtocolLabelsMap",new Map([[ea.TCP,"TCP"],[ea.UDP,"UDP"],[ea.Serial,"Serial"]])),ga=e("ModbusParityLabelsMap",new Map([[ia.Even,"Even"],[ia.Odd,"Odd"],[ia.None,"None"]])),fa=e("ModbusKeysPanelTitleTranslationsMap",new Map([[oa.ATTRIBUTES,"gateway.attributes"],[oa.TIMESERIES,"gateway.timeseries"],[oa.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[oa.RPC_REQUESTS,"gateway.rpc-requests"]])),ya=e("ModbusKeysAddKeyTranslationsMap",new Map([[oa.ATTRIBUTES,"gateway.add-attribute"],[oa.TIMESERIES,"gateway.add-timeseries"],[oa.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[oa.RPC_REQUESTS,"gateway.add-rpc-request"]])),va=e("ModbusKeysDeleteKeyTranslationsMap",new Map([[oa.ATTRIBUTES,"gateway.delete-attribute"],[oa.TIMESERIES,"gateway.delete-timeseries"],[oa.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[oa.RPC_REQUESTS,"gateway.delete-rpc-request"]])),xa=e("ModbusKeysNoKeysTextTranslationsMap",new Map([[oa.ATTRIBUTES,"gateway.no-attributes"],[oa.TIMESERIES,"gateway.no-timeseries"],[oa.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[oa.RPC_REQUESTS,"gateway.no-rpc-requests"]]));var ba;e("ModifierType",ba),function(e){e.DIVIDER="divider",e.MULTIPLIER="multiplier"}(ba||e("ModifierType",ba={}));const wa=e("ModifierTypesMap",new Map([[ba.DIVIDER,{name:"gateway.divider",icon:"mdi:division"}],[ba.MULTIPLIER,{name:"gateway.multiplier",icon:"mdi:multiplication"}]]));var Sa,Ca;e("DeviceInfoType",Sa),function(e){e.FULL="full",e.PARTIAL="partial"}(Sa||e("DeviceInfoType",Sa={})),e("SegmentationType",Ca),function(e){e.BOTH="segmentedBoth",e.TRANSMIT="segmentedTransmit",e.RECEIVE="segmentedReceive",e.NO="noSegmentation"}(Ca||e("SegmentationType",Ca={}));const _a=e("SegmentationTypeTranslationsMap",new Map([[Ca.BOTH,"gateway.bacnet.segmentation.both"],[Ca.TRANSMIT,"gateway.bacnet.segmentation.transmit"],[Ca.RECEIVE,"gateway.bacnet.segmentation.receive"],[Ca.NO,"gateway.bacnet.segmentation.no"]]));var Ta;e("BacnetDeviceKeysType",Ta),function(e){e.ATTRIBUTES="attributes",e.TIMESERIES="timeseries",e.RPC_METHODS="serverSideRpc",e.ATTRIBUTES_UPDATES="attributeUpdates"}(Ta||e("BacnetDeviceKeysType",Ta={}));const Ia=e("BacnetDeviceKeysPanelTitleTranslationsMap",new Map([[Ta.ATTRIBUTES,"gateway.attributes"],[Ta.TIMESERIES,"gateway.timeseries"],[Ta.ATTRIBUTES_UPDATES,"gateway.attribute-updates"],[Ta.RPC_METHODS,"gateway.rpc-methods"]])),Ea=e("BacnetDeviceKeysAddKeyTranslationsMap",new Map([[Ta.ATTRIBUTES,"gateway.add-attribute"],[Ta.TIMESERIES,"gateway.add-timeseries"],[Ta.ATTRIBUTES_UPDATES,"gateway.add-attribute-update"],[Ta.RPC_METHODS,"gateway.add-rpc-method"]])),Ma=e("BacnetDeviceKeysDeleteKeyTranslationsMap",new Map([[Ta.ATTRIBUTES,"gateway.delete-attribute"],[Ta.TIMESERIES,"gateway.delete-timeseries"],[Ta.ATTRIBUTES_UPDATES,"gateway.delete-attribute-update"],[Ta.RPC_METHODS,"gateway.delete-rpc-method"]])),ka=e("BacnetDeviceKeysNoKeysTextTranslationsMap",new Map([[Ta.ATTRIBUTES,"gateway.no-attributes"],[Ta.TIMESERIES,"gateway.no-timeseries"],[Ta.ATTRIBUTES_UPDATES,"gateway.no-attribute-updates"],[Ta.RPC_METHODS,"gateway.no-rpc-methods"]]));var Pa;e("BacnetKeyObjectType",Pa),function(e){e.analogInput="analogInput",e.analogOutput="analogOutput",e.analogValue="analogValue",e.binaryInput="binaryInput",e.binaryOutput="binaryOutput",e.binaryValue="binaryValue"}(Pa||e("BacnetKeyObjectType",Pa={}));const Da=e("BacnetKeyObjectTypeTranslationsMap",new Map([[Pa.analogInput,"gateway.bacnet.object-type.analog-input"],[Pa.analogOutput,"gateway.bacnet.object-type.analog-output"],[Pa.analogValue,"gateway.bacnet.object-type.analog-value"],[Pa.binaryInput,"gateway.bacnet.object-type.binary-input"],[Pa.binaryOutput,"gateway.bacnet.object-type.binary-output"],[Pa.binaryValue,"gateway.bacnet.object-type.binary-value"]]));var Oa;e("BacnetPropertyId",Oa),function(e){e.presentValue="presentValue",e.statusFlags="statusFlags",e.covIncrement="covIncrement",e.eventState="eventState",e.outOfService="outOfService",e.polarity="polarity",e.priorityArray="priorityArray",e.relinquishDefault="relinquishDefault",e.currentCommandPriority="currentCommandPriority",e.eventMessageTexts="eventMessageTexts",e.eventMessageTextsConfig="eventMessageTextsConfig",e.eventAlgorithmInhibitReference="eventAlgorithmInhibitReference",e.timeDelayNormal="timeDelayNormal"}(Oa||e("BacnetPropertyId",Oa={}));const Aa=e("BacnetPropertyIdByObjectType",new Map([[Pa.analogInput,[Oa.presentValue,Oa.statusFlags,Oa.covIncrement]],[Pa.analogOutput,[Oa.presentValue,Oa.statusFlags,Oa.covIncrement]],[Pa.analogValue,[Oa.presentValue,Oa.statusFlags,Oa.covIncrement]],[Pa.binaryInput,[Oa.presentValue,Oa.statusFlags,Oa.eventState,Oa.outOfService,Oa.polarity]],[Pa.binaryOutput,[Oa.presentValue,Oa.statusFlags,Oa.eventState,Oa.outOfService,Oa.polarity,Oa.priorityArray,Oa.relinquishDefault,Oa.currentCommandPriority,Oa.eventMessageTexts,Oa.eventMessageTextsConfig,Oa.eventAlgorithmInhibitReference,Oa.timeDelayNormal]],[Pa.binaryValue,[Oa.presentValue,Oa.statusFlags,Oa.eventState,Oa.outOfService]]])),Fa=e("BacnetPropertyIdTranslationsMap",new Map([[Oa.presentValue,"gateway.bacnet.property-id.present-value"],[Oa.statusFlags,"gateway.bacnet.property-id.status-flags"],[Oa.covIncrement,"gateway.bacnet.property-id.cov-increment"],[Oa.eventState,"gateway.bacnet.property-id.event-state"],[Oa.outOfService,"gateway.bacnet.property-id.out-of-service"],[Oa.polarity,"gateway.bacnet.property-id.polarity"],[Oa.priorityArray,"gateway.bacnet.property-id.priority-array"],[Oa.relinquishDefault,"gateway.bacnet.property-id.relinquish-default"],[Oa.currentCommandPriority,"gateway.bacnet.property-id.current-command-priority"],[Oa.eventMessageTexts,"gateway.bacnet.property-id.event-message-texts"],[Oa.eventMessageTextsConfig,"gateway.bacnet.property-id.event-message-texts-config"],[Oa.eventAlgorithmInhibitReference,"gateway.bacnet.property-id.event-algorithm-inhibit-reference"],[Oa.timeDelayNormal,"gateway.bacnet.property-id.time-delay-normal"]]));var Ra;e("BacnetRequestType",Ra),function(e){e.Write="writeProperty",e.Read="readProperty"}(Ra||e("BacnetRequestType",Ra={}));const Ba=e("BacnetRequestTypeTranslationsMap",new Map([[Ra.Write,"gateway.bacnet.request-type.write"],[Ra.Read,"gateway.bacnet.request-type.read"]]));class Na{static{this.mqttRequestTypeKeys=Object.values(ci)}static{this.mqttRequestMappingOldFields=["attributeNameJsonExpression","deviceNameJsonExpression","deviceNameTopicExpression","extension-config"]}static{this.mqttRequestMappingNewFields=["attributeNameExpressionSource","responseTopicQoS","extensionConfig"]}static mapMappingToUpgradedVersion(e){return e?.map((({converter:e,topicFilter:t,subscriptionQos:n=1})=>{const i=e.deviceInfo??this.extractConverterDeviceInfo(e),a={...e,deviceInfo:i,extensionConfig:e.extensionConfig||e["extension-config"]||null};return this.cleanUpOldFields(a),{converter:a,topicFilter:t,subscriptionQos:n}}))}static mapRequestsToUpgradedVersion(e){return this.mqttRequestTypeKeys.reduce(((t,n)=>e[n]?(t[n]=e[n].map((e=>{const t=this.mapRequestToUpgradedVersion(e,n);return this.cleanUpOldFields(t),t})),t):t),{})}static mapRequestsToDowngradedVersion(e){return this.mqttRequestTypeKeys.reduce(((t,n)=>e[n]?(t[n]=e[n].map((e=>{n===ci.SERVER_SIDE_RPC&&delete e.type;const{attributeNameExpression:t,deviceInfo:i,...a}=e,r={...a,attributeNameJsonExpression:t||null,deviceNameJsonExpression:i?.deviceNameExpressionSource!==oi.TOPIC?i?.deviceNameExpression:null,deviceNameTopicExpression:i?.deviceNameExpressionSource===oi.TOPIC?i?.deviceNameExpression:null};return this.cleanUpNewFields(r),r})),t):t),{})}static mapMappingToDowngradedVersion(e){return e?.map((e=>{const t=this.mapConverterToDowngradedVersion(e.converter);return this.cleanUpNewFields(t),{converter:t,topicFilter:e.topicFilter}}))}static mapConverterToDowngradedVersion(e){const{deviceInfo:t,...n}=e;return e.type!==ri.BYTES?{...n,deviceNameJsonExpression:t?.deviceNameExpressionSource===oi.MSG?t.deviceNameExpression:null,deviceTypeJsonExpression:t?.deviceProfileExpressionSource===oi.MSG?t.deviceProfileExpression:null,deviceNameTopicExpression:t?.deviceNameExpressionSource!==oi.MSG?t?.deviceNameExpression:null,deviceTypeTopicExpression:t?.deviceProfileExpressionSource!==oi.MSG?t?.deviceProfileExpression:null}:{...n,deviceNameExpression:t.deviceNameExpression,deviceTypeExpression:t.deviceProfileExpression,"extension-config":e.extensionConfig}}static cleanUpOldFields(e){this.mqttRequestMappingOldFields.forEach((t=>delete e[t])),Y(e)}static cleanUpNewFields(e){this.mqttRequestMappingNewFields.forEach((t=>delete e[t])),Y(e)}static getTypeSourceByValue(e){return e.includes("${")?oi.MSG:e.includes("/")?oi.TOPIC:oi.CONST}static extractConverterDeviceInfo(e){const t=e.deviceNameExpression||e.deviceNameJsonExpression||e.deviceNameTopicExpression||null,n=e.deviceNameExpressionSource?e.deviceNameExpressionSource:t?this.getTypeSourceByValue(t):null,i=e.deviceProfileExpression||e.deviceTypeTopicExpression||e.deviceTypeJsonExpression||"default",a=e.deviceProfileExpressionSource?e.deviceProfileExpressionSource:i?this.getTypeSourceByValue(i):null;return t||i?{deviceNameExpression:t,deviceNameExpressionSource:n,deviceProfileExpression:i,deviceProfileExpressionSource:a}:null}static mapRequestToUpgradedVersion(e,t){const n=e.deviceNameJsonExpression||e.deviceNameTopicExpression||null,i=e.deviceTypeTopicExpression||e.deviceTypeJsonExpression||"default",a=i?this.getTypeSourceByValue(i):null,r=e.attributeNameExpressionSource||e.attributeNameJsonExpression||null,o=t===ci.SERVER_SIDE_RPC?1:null,s=t===ci.SERVER_SIDE_RPC?e.responseTopicExpression?Yi.WithResponse:Yi.WithoutResponse:null;return{...e,attributeNameExpression:r,attributeNameExpressionSource:r?this.getTypeSourceByValue(r):null,deviceInfo:e.deviceInfo?e.deviceInfo:n?{deviceNameExpression:n,deviceNameExpressionSource:this.getTypeSourceByValue(n),deviceProfileExpression:i,deviceProfileExpressionSource:a}:null,responseTopicQoS:o,type:s}}}e("MqttVersionMappingUtil",Na);class La{constructor(e,t){this.gatewayVersionIn=e,this.connector=t,this.gatewayVersion=Ya.parseVersion(this.gatewayVersionIn),this.configVersion=Ya.parseVersion(this.connector.configVersion??this.connector.configurationJson.configVersion)}getProcessedByVersion(){return this.isVersionUpdateNeeded()?this.processVersionUpdate():this.connector}processVersionUpdate(){return this.isVersionUpgradeNeeded()?this.getUpgradedVersion():this.isVersionDowngradeNeeded()?this.getDowngradedVersion():this.connector}isVersionUpdateNeeded(){return!!this.gatewayVersion&&this.configVersion!==this.gatewayVersion}isVersionUpgradeNeeded(){const e=Ya.parseVersion(Ai.get(this.connector.type)),t=this.gatewayVersion>=e,n=!this.configVersion||this.configVersion=e&&e>this.gatewayVersion}}e("GatewayConnectorVersionProcessor",La);class Va extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t,this.mqttRequestTypeKeys=Object.values(ci)}getUpgradedVersion(){const{connectRequests:e,disconnectRequests:t,attributeRequests:n,attributeUpdates:i,serverSideRpc:a}=this.connector.configurationJson;let r={...this.connector.configurationJson,requestsMapping:Na.mapRequestsToUpgradedVersion({connectRequests:e,disconnectRequests:t,attributeRequests:n,attributeUpdates:i,serverSideRpc:a}),mapping:Na.mapMappingToUpgradedVersion(this.connector.configurationJson.mapping)};return this.mqttRequestTypeKeys.forEach((e=>{const{[e]:t,...n}=r;r={...n}})),this.cleanUpConfigJson(r),{...this.connector,configurationJson:r,configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const{requestsMapping:e,mapping:t,...n}=this.connector.configurationJson,i=e?Na.mapRequestsToDowngradedVersion(e):{},a=Na.mapMappingToDowngradedVersion(t);return{...this.connector,configurationJson:{...n,...i,mapping:a},configVersion:this.gatewayVersionIn}}cleanUpConfigJson(e){W(e.requestsMapping,{})&&delete e.requestsMapping,W(e.mapping,[])&&delete e.mapping}}e("MqttVersionProcessor",Va);class qa extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{master:e.master?.slaves?Xa.mapMasterToUpgradedVersion(e.master):{slaves:[]},slave:e.slave?Xa.mapSlaveToUpgradedVersion(e.slave):{}},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{...e,slave:e.slave?Xa.mapSlaveToDowngradedVersion(e.slave):{},master:e.master?.slaves?Xa.mapMasterToDowngradedVersion(e.master):{slaves:[]}},configVersion:this.gatewayVersionIn}}}e("ModbusVersionProcessor",qa);class Ga extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson.server;let t;return t="mapping"in this.connector.configurationJson.server?Za.mapMappingToUpgradedVersion(this.connector.configurationJson.server.mapping):"mapping"in this.connector.configurationJson?Za.mapMappingToCurrentVersion(this.connector.configurationJson.mapping):[],{...this.connector,configurationJson:{server:e?Za.mapServerToUpgradedVersion(e):{},mapping:t},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){return{...this.connector,configurationJson:{server:Za.mapServerToDowngradedVersion(this.connector.configurationJson)},configVersion:this.gatewayVersionIn}}}e("OpcVersionProcessor",Ga);class za{constructor(){this.fb=i(ge),this.destroyRef=i(a),this.formGroup=this.initFormGroup(),this.observeValueChanges()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.formGroup.valid?null:{formGroup:{valid:!1}}}writeValue(e){this.onWriteValue(e)}onWriteValue(e){this.formGroup.patchValue(e,{emitEvent:!1})}mapOnChangeValue(e){return e}observeValueChanges(){this.formGroup.valueChanges.pipe(In(this.destroyRef)).subscribe((e=>this.onChange(this.mapOnChangeValue(e))))}static{this.ɵfac=function(e){return new(e||za)}}static{this.ɵdir=t.ɵɵdefineDirective({type:za})}}e("ControlValueAccessorBaseAbstract",za);class Ua extends za{constructor(){super(...arguments),this.withReportStrategy=!0,this.initialized=new u,this.isLegacy=!1,this.fb=i(ge)}get basicFormGroup(){return this.formGroup}ngAfterViewInit(){this.initialized.emit()}onWriteValue(e){this.formGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}mapOnChangeValue(e){return this.getMappedValue(e)}initFormGroup(){return this.initBasicFormGroup()}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(Ua)))(n||Ua)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:Ua,inputs:{generalTabContent:"generalTabContent",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{initialized:"initialized"},features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature]})}}e("GatewayConnectorBasicConfigDirective",Ua);class ja extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{socket:e?Qa.mapSocketToUpgradedVersion(e):{},devices:e?.devices?Qa.mapDevicesToUpgradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){return{...this.connector,configurationJson:Qa.mapSocketToDowngradedVersion(this.connector.configurationJson),configVersion:this.gatewayVersionIn}}}e("SocketVersionProcessor",ja);class Ha extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t}getUpgradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{application:e?.general?Ja.mapApplicationToUpgradedVersion(e.general):{},devices:e?.devices?Ja.mapDevicesToUpgradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const e=this.connector.configurationJson;return{...this.connector,configurationJson:{general:e?.application?Ja.mapApplicationToDowngradedVersion(e.application):{},devices:e?.devices?Ja.mapDevicesToDowngradedVersion(e.devices):[]},configVersion:this.gatewayVersionIn}}}e("BacnetVersionProcessor",Ha);const Wa=["searchInput"];class $a{constructor(){this.withReportStrategy=!0,this.textSearchMode=!1,this.onChange=()=>{},this.translate=i(pe),this.dialog=i(ze),this.dialogService=i(X),this.fb=i(ge),this.cd=i(h),this.destroyRef=i(a),this.textSearch=this.fb.control("",{nonNullable:!0}),this.entityFormArray=this.fb.array([]),this.entityFormArray.valueChanges.pipe(In()).subscribe((e=>{this.updateTableData(e),this.onChange(e)})),this.dataSource=this.getDatasource()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(De(150),Pe(((e,t)=>(e??"")===t.trim())),In(this.destroyRef)).subscribe((e=>this.updateTableData(this.entityFormArray.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.entityFormArray.clear(),this.pushDataAsFormArrays(e)}enterFilterMode(){this.textSearchMode=!0,this.cd.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.entityFormArray.value),this.textSearchMode=!1,this.textSearch.reset()}validate(){return this.entityFormArray.controls.length?null:{devicesFormGroup:{valid:!1}}}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.entityFormArray.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||$a)}}static{this.ɵdir=t.ɵɵdefineDirective({type:$a,viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(Wa,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},features:[t.ɵɵInputTransformsFeature]})}}e("AbstractDevicesConfigTableComponent",$a);class Ka extends La{constructor(e,t){super(e,t),this.gatewayVersionIn=e,this.connector=t,this.restRequestTypeKeys=Object.values(Ii)}getUpgradedVersion(){const{attributeRequests:e=[],attributeUpdates:t=[],serverSideRpc:n=[],mapping:i=[],...a}=this.connector.configurationJson;let r={server:Ya.cleanUpConfigBaseInfo(a),requestsMapping:{attributeRequests:e,attributeUpdates:t,serverSideRpc:n},mapping:er.mapMappingToUpgradedVersion(i)};return this.restRequestTypeKeys.forEach((e=>{const{[e]:t,...n}=r;r={...n}})),{...this.connector,configurationJson:r,configVersion:this.gatewayVersionIn}}getDowngradedVersion(){const{requestsMapping:e={},mapping:t,server:n,...i}=this.connector.configurationJson,{attributeRequests:a=[],attributeUpdates:r=[],serverSideRpc:o=[]}=e;return{...this.connector,configurationJson:{...i,...n,attributeRequests:a,attributeUpdates:r,serverSideRpc:o,mapping:er.mapMappingToDowngradedVersion(t)},configVersion:this.gatewayVersionIn}}}e("RestVersionProcessor",Ka);class Ya{static getConfig(e,t){switch(e.type){case dt.MQTT:return new Va(t,e).getProcessedByVersion();case dt.OPCUA:return new Ga(t,e).getProcessedByVersion();case dt.MODBUS:return new qa(t,e).getProcessedByVersion();case dt.SOCKET:return new ja(t,e).getProcessedByVersion();case dt.BACNET:return new Ha(t,e).getProcessedByVersion();case dt.REST:return new Ka(t,e).getProcessedByVersion();default:return e}}static parseVersion(e){if(Z(e))return e;if(Q(e)){const[t,n="0",i="0"]=e.split(".");return parseFloat(`${t}.${n}${i.slice(0,1)}`)}return 0}static cleanUpConfigBaseInfo(e){const{name:t,id:n,enableRemoteLogging:i,logLevel:a,reportStrategy:r,configVersion:o,...s}=e;return s}}e("GatewayConnectorVersionMappingUtil",Ya);class Xa{static mapMasterToUpgradedVersion(e){return{slaves:e.slaves.map((e=>{const{sendDataOnlyOnChange:t,...n}=e;return{...n,deviceType:e.deviceType??"default",reportStrategy:t?{type:rn.OnChange}:{type:rn.OnReportPeriod,reportPeriod:e.pollPeriod}}}))}}static mapMasterToDowngradedVersion(e){return{slaves:e.slaves.map((e=>{const{reportStrategy:t,...n}=e;return{...n,sendDataOnlyOnChange:t?.type!==rn.OnReportPeriod}}))}}static mapSlaveToDowngradedVersion(e){if(!e?.values)return e;const t=Object.keys(e.values).reduce(((t,n)=>t={...t,[n]:[e.values[n]]}),{});return{...e,values:t}}static mapSlaveToUpgradedVersion(e){if(!e?.values)return e;const t=Object.keys(e.values).reduce(((t,n)=>t={...t,[n]:this.mapValuesToUpgradedVersion(e.values[n][0]??{})}),{});return{...e,values:t}}static mapValuesToUpgradedVersion(e){return Object.keys(e).reduce(((t,n)=>t={...t,[n]:e[n].map((e=>({...e,type:"int"===e.type?Zt.INT16:e.type})))}),{})}}e("ModbusVersionMappingUtil",Xa);class Za{static mapServerToUpgradedVersion(e){const{mapping:t,disableSubscriptions:n,pollPeriodInMillis:i,...a}=e;return{...a,pollPeriodInMillis:i??5e3,enableSubscriptions:!n}}static mapServerToDowngradedVersion(e){const{mapping:t,server:n}=e,{enableSubscriptions:i,...a}=n??{};return{...a,mapping:t?this.mapMappingToDowngradedVersion(t):[],disableSubscriptions:!i}}static mapMappingToUpgradedVersion(e){return e.map((e=>({deviceNodePattern:e.deviceNodePattern,deviceNodeSource:this.getDeviceNodeSourceByValue(e.deviceNodePattern),deviceInfo:{deviceNameExpression:e.deviceNamePattern,deviceNameExpressionSource:this.getTypeSourceByValue(e.deviceNamePattern),deviceProfileExpression:e.deviceTypePattern??"default",deviceProfileExpressionSource:this.getTypeSourceByValue(e.deviceTypePattern??"default")},attributes:e.attributes?.map((e=>({key:e.key,type:this.getTypeSourceByValue(e.path),value:e.path})))??[],attributes_updates:e.attributes_updates?.map((e=>({key:e.attributeOnThingsBoard,type:this.getTypeSourceByValue(e.attributeOnDevice),value:e.attributeOnDevice})))??[],timeseries:e.timeseries?.map((e=>({key:e.key,type:this.getTypeSourceByValue(e.path),value:e.path})))??[],rpc_methods:e.rpc_methods?.map((e=>({method:e.method,arguments:e.arguments.map((e=>({value:e,type:this.getArgumentType(e)})))})))??[]})))}static mapMappingToCurrentVersion(e){return e.map((e=>({deviceNodePattern:e.deviceNodePattern,deviceNodeSource:this.getDeviceNodeSourceByValue(e.deviceNodePattern),deviceInfo:{deviceNameExpression:e.deviceInfo.deviceNameExpression,deviceNameExpressionSource:this.getTypeSourceByValue(e?.deviceInfo?.deviceNameExpressionSource),deviceProfileExpression:e?.deviceInfo?.deviceProfileExpression??"default",deviceProfileExpressionSource:this.getTypeSourceByValue(e?.deviceInfo?.deviceProfileExpressionSource??"default")},attributes:e.attributes?.map((e=>({key:e.key,type:e.type,value:e?.value})))??[],attributes_updates:e.attributes_updates?.map((e=>({key:e.key,type:e.type,value:e.value})))??[],timeseries:e.timeseries?.map((e=>({key:e.key,type:e.type,value:e.value})))??[],rpc_methods:e.rpc_methods?.map((e=>({method:e.method,arguments:e.arguments.map((e=>({value:e,type:this.getArgumentType(e)})))})))??[]})))}static mapMappingToDowngradedVersion(e){return e.map((e=>({deviceNodePattern:e.deviceNodePattern,deviceNamePattern:e.deviceInfo.deviceNameExpression,deviceTypePattern:e.deviceInfo.deviceProfileExpression,attributes:e.attributes.map((e=>({key:e.key,path:e.value}))),attributes_updates:e.attributes_updates.map((e=>({attributeOnThingsBoard:e.key,attributeOnDevice:e.value}))),timeseries:e.timeseries.map((e=>({key:e.key,path:e.value}))),rpc_methods:e.rpc_methods.map((e=>({method:e.method,arguments:e.arguments.map((e=>e.value))})))})))}static getTypeSourceByValue(e){return e.includes("${")?Fi.IDENTIFIER:e.includes("/")||e.includes("\\")?Fi.PATH:Fi.CONST}static getDeviceNodeSourceByValue(e){return e.includes("${")?Fi.IDENTIFIER:Fi.PATH}static getArgumentType(e){switch(typeof e){case"boolean":return"boolean";case"number":return Number.isInteger(e)?"integer":"float";default:return"string"}}}e("OpcVersionMappingUtil",Za);class Qa{static mapSocketToUpgradedVersion(e){const{devices:t,...n}=e??{};return Ya.cleanUpConfigBaseInfo(n)}static mapSocketToDowngradedVersion(e){const{devices:t,socket:n}=e??{};return{...n,devices:this.mapDevicesToDowngradedVersion(t??[])}}static mapDevicesToUpgradedVersion(e){return e?.map((e=>({...e,attributeRequests:e.attributeRequests?.map((e=>({...e,requestExpressionSource:this.getExpressionSource(e.requestExpression),attributeNameExpressionSource:this.getExpressionSource(e.attributeNameExpression)})))??[]})))??[]}static mapDevicesToDowngradedVersion(e){return e.map((e=>({...e,attributeRequests:e.attributeRequests?.map((({requestExpressionSource:e,attributeNameExpressionSource:t,...n})=>n))??[]})))}static getExpressionSource(e){return e.includes("${")||e.includes("[")?yi.Expression:yi.Constant}}e("SocketVersionMappingUtil",Qa);class Ja{static mapApplicationToUpgradedVersion(e){const{address:t="",...n}=e,[i,a]=t.split(":"),[r,o]=i.split("/");return{host:r,port:a,mask:o,...n}}static mapApplicationToDowngradedVersion(e){const{host:t="",port:n="",mask:i="",...a}=e;return{address:i?`${t}/${i}:${n}`:`${t}:${n}`,...a}}static mapDevicesToUpgradedVersion(e){return e?.map((({address:e="",deviceName:t,deviceType:n,attributes:i,timeseries:a,attributeUpdates:r,serverSideRpc:o,...s})=>({...s,host:e.split(":")[0],port:e.split(":")[1],deviceInfo:{deviceNameExpression:t,deviceProfileExpression:n,deviceNameExpressionSource:this.getExpressionSource(t),deviceProfileExpressionSource:this.getExpressionSource(n)},attributes:this.getUpdateKeys(i),timeseries:this.getUpdateKeys(a),attributeUpdates:this.getUpdateKeys(r),serverSideRpc:this.getUpdateKeys(o)})))??[]}static mapDevicesToDowngradedVersion(e){return e?.map((({port:e,host:t,deviceInfo:n,attributes:i,timeseries:a,attributeUpdates:r,serverSideRpc:o,...s})=>({...s,address:`${t}:${e}`,deviceName:n?.deviceNameExpression,deviceType:n?.deviceProfileExpression,attributes:this.getDowngradedKeys(i),timeseries:this.getDowngradedKeys(a),attributeUpdates:this.getDowngradedKeys(r),serverSideRpc:this.getDowngradedKeys(o)})))??[]}static getExpressionSource(e){return e?.includes("${")||e?.includes("[")?yi.Expression:yi.Constant}static getUpdateKeys(e){return e?.map((({objectId:e="",...t})=>({objectType:e.split(":")[0],objectId:e.split(":")[1],...t})))??[]}static getDowngradedKeys(e){return e?.map((({objectId:e="",objectType:t="",...n})=>({objectId:`${t}:${e}`,...n})))??[]}}e("BacnetVersionMappingUtil",Ja);class er{static mapMappingToUpgradedVersion(e){return e?.map((({converter:e,...t})=>{const{deviceNameExpression:n,deviceTypeExpression:i,...a}=e;return{converter:{deviceInfo:{deviceNameExpressionSource:this.getTypeSourceByValue(n),deviceNameExpression:n,deviceProfileExpressionSource:this.getTypeSourceByValue(i),deviceProfileExpression:i},...a},...t}}))}static mapMappingToDowngradedVersion(e){return e?.map((({converter:e,...t})=>{const{deviceInfo:n,...i}=e;return{converter:{deviceNameExpression:n?.deviceNameExpression,deviceTypeExpression:n?.deviceProfileExpression,...i},...t}}))}static getTypeSourceByValue(e=""){return e.includes("${")?Si.REQUEST:Si.CONST}}e("RestVersionMappingUtil",er);class tr{transform(e,t){const n=Ya.parseVersion(e);return t===dt.MODBUS?n>=Ya.parseVersion(ct.v3_5_2):n>=Ya.parseVersion(ct.v3_6_0)}static{this.ɵfac=function(e){return new(e||tr)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"withReportStrategy",type:tr,pure:!0,standalone:!0})}}function nr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-required")," "))}function ir(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-pattern")," "))}function ar(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.name-already-exists")," "))}function rr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-required")," "))}function or(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-pattern")," "))}function sr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")," "))}function lr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.command-required")," "))}function pr(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.command-pattern")," "))}e("ReportStrategyVersionPipe",tr);class cr extends A{constructor(e,t,n,i,a,r,o,s){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.dialogService=r,this.translate=o,this.destroyRef=s,this.commandHelpLink=O+"/docs/iot-gateway/configuration/#subsection-statistics",this.editCommandFormGroup=this.fb.group({attributeOnGateway:["",[me.required,me.pattern(pn),this.uniqNameRequired()]],command:["",[me.required,me.pattern(/^(?=\S).*\S$/)]],timeout:[10,[me.required,me.min(1),me.pattern(ln),me.pattern(/^[^.\s]+$/)]],installCmd:["",me.pattern(pn)]}),this.editCommandFormGroup.patchValue(this.data.command,{emitEvent:!1})}cancel(){this.confirmConnectorChange().pipe(Le(Boolean),In(this.destroyRef)).subscribe((()=>this.dialogRef.close(null)))}apply(){this.dialogRef.close({current:this.editCommandFormGroup.value,prev:this.data.command})}confirmConnectorChange(){return this.editCommandFormGroup.dirty?this.dialogService.confirm(this.translate.instant("gateway.statistics.change-command-title"),this.translate.instant("gateway.statistics.change-command-text"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0):_e(!0)}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase();return t&&this.data.existingCommands.some((e=>e.toLowerCase()===t))&&t!==this.data.command.attributeOnGateway.toLowerCase()?{duplicateName:{valid:!1}}:null}}static{this.ɵfac=function(e){return new(e||cr)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:cr,selectors:[["tb-edit-custom-command-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:64,vars:27,consts:[[1,"edit-command-container",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel","stroked","no-padding-bottom","no-gap","command-container"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["matInput","","formControlName","attributeOnGateway"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"],["matInput","","formControlName","timeout","type","number","min","1"],["appearance","outline",1,"mat-block"],["matInput","","formControlName","command"],[1,"tb-settings","pb-4"],["translate","",1,"tb-form-panel-title"],["matInput","","formControlName","installCmd"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2)(6,"div",3),t.ɵɵelementStart(7,"button",4),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",5),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",6)(11,"div",7)(12,"section",8)(13,"section",9)(14,"mat-form-field",10)(15,"mat-label",11),t.ɵɵtext(16,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(17,"input",12),t.ɵɵtemplate(18,nr,3,3,"mat-error")(19,ir,3,3,"mat-error")(20,ar,3,3,"mat-error"),t.ɵɵelementStart(21,"mat-icon",13),t.ɵɵpipe(22,"translate"),t.ɵɵtext(23,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"mat-form-field",10)(25,"mat-label",11),t.ɵɵtext(26,"gateway.statistics.timeout"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",14),t.ɵɵtemplate(28,rr,3,3,"mat-error")(29,or,3,3,"mat-error")(30,sr,3,3,"mat-error"),t.ɵɵelementStart(31,"mat-icon",13),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(34,"section")(35,"mat-form-field",15)(36,"mat-label",11),t.ɵɵtext(37,"gateway.statistics.command"),t.ɵɵelementEnd(),t.ɵɵelement(38,"input",16),t.ɵɵtemplate(39,lr,3,3,"mat-error")(40,pr,3,3,"mat-error"),t.ɵɵelementStart(41,"mat-icon",13),t.ɵɵpipe(42,"translate"),t.ɵɵtext(43,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(44,"section")(45,"mat-expansion-panel",17)(46,"mat-expansion-panel-header")(47,"mat-panel-title")(48,"div",18),t.ɵɵtext(49,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(50,"mat-form-field",10)(51,"mat-label",11),t.ɵɵtext(52,"gateway.statistics.install-cmd"),t.ɵɵelementEnd(),t.ɵɵelement(53,"input",19),t.ɵɵelementStart(54,"mat-icon",13),t.ɵɵpipe(55,"translate"),t.ɵɵtext(56,"info_outlined "),t.ɵɵelementEnd()()()()()()(),t.ɵɵelementStart(57,"div",20)(58,"button",21),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(59),t.ɵɵpipe(60,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(61,"button",22),t.ɵɵlistener("click",(function(){return n.apply()})),t.ɵɵtext(62),t.ɵɵpipe(63,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.editCommandFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,13,n.data.titleText)),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.commandHelpLink),t.ɵɵadvance(12),t.ɵɵconditional(n.editCommandFormGroup.get("attributeOnGateway").hasError("required")?18:n.editCommandFormGroup.get("attributeOnGateway").hasError("pattern")?19:n.editCommandFormGroup.get("attributeOnGateway").hasError("duplicateName")?20:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(22,15,"gateway.hints.attribute")),t.ɵɵadvance(7),t.ɵɵconditional(n.editCommandFormGroup.get("timeout").hasError("required")?28:n.editCommandFormGroup.get("timeout").hasError("pattern")?29:n.editCommandFormGroup.get("timeout").hasError("min")?30:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(32,17,"gateway.hints.timeout")),t.ɵɵadvance(8),t.ɵɵconditional(n.editCommandFormGroup.get("command").hasError("required")?39:n.editCommandFormGroup.get("command").hasError("pattern")?40:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(42,19,"gateway.hints.command")),t.ɵɵadvance(13),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(55,21,"gateway.hints.install-cmd")),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(60,23,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.editCommandFormGroup.invalid||!n.editCommandFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(63,25,n.data.buttonText)," "))},dependencies:t.ɵɵgetComponentDepsFactory(cr,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .edit-command-container[_ngcontent-%COMP%]{min-width:40vw;width:50vw}[_nghost-%COMP%] .pointer-event{pointer-events:all}[_nghost-%COMP%] .toggle-group span{padding:0 25px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{color:#e0e0e0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix:hover{color:#9e9e9e}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex;align-items:center}']})}}var dr=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},ur=new function(){this.browser=new dr,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(ur.wxa=!0,ur.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?ur.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(ur.node=!0,ur.svgSupported=!0):function(e,t){var n=t.browser,i=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),r=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);i&&(n.firefox=!0,n.version=i[1]);a&&(n.ie=!0,n.version=a[1]);r&&(n.edge=!0,n.version=r[1],n.newEdge=+r[1].split(".")[0]>18);o&&(n.weChat=!0);t.svgSupported="undefined"!=typeof SVGRect,t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported="undefined"!=typeof document;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,ur);var mr="sans-serif",hr="12px "+mr;var gr,fr,yr=function(e){var t={};if("undefined"==typeof JSON)return t;for(var n=0;n=0)r=a*e.length;else for(var o=0;o>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",a[l]+":0",i[1-s]+":auto",a[1-l]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return n}(t,r),s=function(e,t,n){for(var i=n?"invTrans":"trans",a=t[i],r=t.srcCoords,o=[],s=[],l=!0,p=0;p<4;p++){var c=e[p].getBoundingClientRect(),d=2*p,u=c.left,m=c.top;o.push(u,m),l=l&&r&&u===r[d]&&m===r[d+1],s.push(e[p].offsetLeft,e[p].offsetTop)}return l&&a?a:(t.srcCoords=o,t[i]=n?Jo(s,o):Jo(o,s))}(o,r,a);if(s)return s(e,n,i),!0}return!1}function is(e){return"CANVAS"===e.nodeName.toUpperCase()}var as=/([&<>"'])/g,rs={"&":"&","<":"<",">":">",'"':""","'":"'"};function os(e){return null==e?"":(e+"").replace(as,(function(e,t){return rs[t]}))}var ss=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ls=[],ps=ur.browser.firefox&&+ur.browser.version.split(".")[0]<39;function cs(e,t,n,i){return n=n||{},i?ds(e,t,n):ps&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):ds(e,t,n),n}function ds(e,t,n){if(ur.domSupported&&e.getBoundingClientRect){var i=t.clientX,a=t.clientY;if(is(e)){var r=e.getBoundingClientRect();return n.zrX=i-r.left,void(n.zrY=a-r.top)}if(ns(ls,e,i,a))return n.zrX=ls[0],void(n.zrY=ls[1])}n.zrX=n.zrY=0}function us(e){return e||window.event}function ms(e,t,n){if(null!=(t=us(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var a="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];a&&cs(e,a,t,n)}else{cs(e,t,t,n);var r=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;if(null==n||null==i)return t;return 3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(t);t.zrDelta=r?r/120:-(t.detail||0)/3}var o=t.button;return null==t.which&&void 0!==o&&ss.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function hs(e,t,n,i){e.addEventListener(t,n,i)}var gs=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function fs(e){return 2===e.which||3===e.which}var ys=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},r=0,o=i.length;r1&&a&&a.length>1){var o=vs(a)/vs(r);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((i=a)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}};function bs(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function ws(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ss(e,t,n){var i=t[0]*n[0]+t[2]*n[1],a=t[1]*n[0]+t[3]*n[1],r=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=l,e}function Cs(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function _s(e,t,n,i){void 0===i&&(i=[0,0]);var a=t[0],r=t[2],o=t[4],s=t[1],l=t[3],p=t[5],c=Math.sin(n),d=Math.cos(n);return e[0]=a*d+s*c,e[1]=-a*c+s*d,e[2]=r*d+l*c,e[3]=-r*c+d*l,e[4]=d*(o-i[0])+c*(p-i[1])+i[0],e[5]=d*(p-i[1])-c*(o-i[0])+i[1],e}function Ts(e,t,n){var i=n[0],a=n[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e}function Is(e,t){var n=t[0],i=t[2],a=t[4],r=t[1],o=t[3],s=t[5],l=n*o-r*i;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-o*a)*l,e[5]=(r*a-n*s)*l,e):null}function Es(e){var t=[1,0,0,1,0,0];return ws(t,e),t}var Ms=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var a=1-i;e.x=a*t.x+i*n.x,e.y=a*t.y+i*n.y},e}(),ks=Math.min,Ps=Math.max,Ds=new Ms,Os=new Ms,As=new Ms,Fs=new Ms,Rs=new Ms,Bs=new Ms,Ns=function(){function e(e,t,n,i){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=ks(e.x,this.x),n=ks(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ps(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ps(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,a=[1,0,0,1,0,0];return Cs(a,a,[-t.x,-t.y]),Ts(a,a,[n,i]),Cs(a,a,[e.x,e.y]),a},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,a=i.x,r=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,p=t.x+t.width,c=t.y,d=t.y+t.height,u=!(rh&&(h=x,gh&&(h=b,y=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var a=i[0],r=i[3],o=i[4],s=i[5];return t.x=n.x*a+o,t.y=n.y*r+s,t.width=n.width*a,t.height=n.height*r,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}Ds.x=As.x=n.x,Ds.y=Fs.y=n.y,Os.x=Fs.x=n.x+n.width,Os.y=As.y=n.y+n.height,Ds.transform(i),Fs.transform(i),Os.transform(i),As.transform(i),t.x=ks(Ds.x,Os.x,As.x,Fs.x),t.y=ks(Ds.y,Os.y,As.y,Fs.y);var l=Ps(Ds.x,Os.x,As.x,Fs.x),p=Ps(Ds.y,Os.y,As.y,Fs.y);t.width=l-t.x,t.height=p-t.y}else t!==n&&e.copy(t,n)},e}(),Ls="silent";function Vs(){gs(this.event)}var qs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return We(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Xo),Gs=function(e,t){this.x=e,this.y=t},zs=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Us=new Ns(0,0,0,0),js=function(e){function t(t,n,i,a,r){var o=e.call(this)||this;return o._hovered=new Gs(0,0),o.storage=t,o.painter=n,o.painterRoot=a,o._pointerSize=r,i=i||new qs,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new Yo(o),o}return We(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(zr(zs,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=$s(this,t,n),a=this._hovered,r=a.target;r&&!r.__zr&&(r=(a=this.findHover(a.x,a.y)).target);var o=this._hovered=i?new Gs(t,n):this.findHover(t,n),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(a,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==r&&this.dispatchToElement(o,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Gs(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var a="on"+t,r=function(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Vs}}(t,e,n);i&&(i[a]&&(r.cancelBubble=!!i[a].call(i,r)),i.trigger(t,r),i=i.__hostTarget?i.__hostTarget:i.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(t,r),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(e){"function"==typeof e[a]&&e[a].call(e,r),e.trigger&&e.trigger(t,r)})))}},t.prototype.findHover=function(e,t,n){var i=this.storage.getDisplayList(),a=new Gs(e,t);if(Ws(i,a,e,t,n),this._pointerSize&&!a.target){for(var r=[],o=this._pointerSize,s=o/2,l=new Ns(e-s,t-s,o,o),p=i.length-1;p>=0;p--){var c=i[p];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(Us.copy(c.getBoundingRect()),c.transform&&Us.applyTransform(c.transform),Us.intersect(l)&&r.push(c))}if(r.length)for(var d=Math.PI/12,u=2*Math.PI,m=0;m=0;r--){var o=e[r],s=void 0;if(o!==a&&!o.ignore&&(s=Hs(o,n,i))&&(!t.topTarget&&(t.topTarget=o),s!==Ls)){t.target=o;break}}}function $s(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}zr(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){js.prototype[e]=function(t){var n,i,a=t.zrX,r=t.zrY,o=$s(this,a,r);if("mouseup"===e&&o||(i=(n=this.findHover(a,r)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Go(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}}));function Ks(e,t,n,i){var a=t+1;if(a===n)return 1;if(i(e[a++],e[t])<0){for(;a=0;)a++;return a-t}function Ys(e,t,n,i,a){for(i===t&&i++;i>>1])<0?l=r:s=r+1;var p=i-s;switch(p){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;p>0;)e[s+p]=e[s+p-1],p--}e[s]=o}}function Xs(e,t,n,i,a,r){var o=0,s=0,l=1;if(r(e,t[n+a])>0){for(s=i-a;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;ls&&(l=s);var p=o;o=a-l,l=a-p}for(o++;o>>1);r(e,t[n+c])>0?o=c+1:l=c}return l}function Zs(e,t,n,i,a,r){var o=0,s=0,l=1;if(r(e,t[n+a])<0){for(s=a+1;ls&&(l=s);var p=o;o=a-l,l=a-p}else{for(s=i-a;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o>>1);r(e,t[n+c])<0?l=c:o=c+1}return l}function Qs(e,t){var n,i,a=7,r=0,o=[];function s(s){var l=n[s],p=i[s],c=n[s+1],d=i[s+1];i[s]=p+d,s===r-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),r--;var u=Zs(e[c],e,l,p,0,t);l+=u,0!==(p-=u)&&0!==(d=Xs(e[l+p-1],e,c,d,d-1,t))&&(p<=d?function(n,i,r,s){var l=0;for(l=0;l=7||m>=7);if(h)break;g<0&&(g=0),g+=2}if((a=g)<1&&(a=1),1===i){for(l=0;l=0;l--)e[m+l]=e[u+l];return void(e[d]=o[c])}var h=a;for(;;){var g=0,f=0,y=!1;do{if(t(o[c],e[p])<0){if(e[d--]=e[p--],g++,f=0,0==--i){y=!0;break}}else if(e[d--]=o[c--],f++,g=0,1==--s){y=!0;break}}while((g|f)=0;l--)e[m+l]=e[u+l];if(0===i){y=!0;break}}if(e[d--]=o[c--],1==--s){y=!0;break}if(0!==(f=s-Xs(e[p],o,0,s,s-1,t))){for(s-=f,m=(d-=f)+1,u=(c-=f)+1,l=0;l=7||f>=7);if(y)break;h<0&&(h=0),h+=2}(a=h)<1&&(a=1);if(1===s){for(m=(d-=i)+1,u=(p-=i)+1,l=i-1;l>=0;l--)e[m+l]=e[u+l];e[d]=o[c]}else{if(0===s)throw new Error;for(u=d-(s-1),l=0;l1;){var e=r-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;s(e)}},forceMergeRuns:function(){for(;r>1;){var e=r-2;e>0&&i[e-1]=32;)t|=1&e,e>>=1;return e+t}(a);do{if((r=Ks(e,n,i,t))s&&(l=s),Ys(e,n,n+l,n+r,t),r=l}o.pushRun(n,r),o.mergeRuns(),a-=r,n+=r}while(0!==a);o.forceMergeRuns()}}}var el=!1;function tl(){el||(el=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function nl(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var il=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=nl}return e.prototype.traverse=function(e,t){for(var n=0;n0&&(p.__clipPaths=[]),isNaN(p.z)&&(tl(),p.z=0),isNaN(p.z2)&&(tl(),p.z2=0),isNaN(p.zlevel)&&(tl(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,n);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,t,n);var u=e.getTextContent();u&&this._updateAndAddDisplayable(u,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),al=ur.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},rl={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-rl.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*rl.bounceIn(2*e):.5*rl.bounceOut(2*e-1)+.5}},ol=Math.pow,sl=Math.sqrt,ll=1e-8,pl=1e-4,cl=sl(3),dl=1/3,ul=Po(),ml=Po(),hl=Po();function gl(e){return e>-1e-8&&ell||e<-1e-8}function yl(e,t,n,i,a){var r=1-a;return r*r*(r*e+3*a*t)+a*a*(a*i+3*r*n)}function vl(e,t,n,i,a){var r=1-a;return 3*(((t-e)*r+2*(n-t)*a)*r+(i-n)*a*a)}function xl(e,t,n,i,a,r){var o=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),p=e-a,c=s*s-3*o*l,d=s*l-9*o*p,u=l*l-3*s*p,m=0;if(gl(c)&&gl(d)){if(gl(s))r[0]=0;else(_=-l/s)>=0&&_<=1&&(r[m++]=_)}else{var h=d*d-4*c*u;if(gl(h)){var g=d/c,f=-g/2;(_=-s/o+g)>=0&&_<=1&&(r[m++]=_),f>=0&&f<=1&&(r[m++]=f)}else if(h>0){var y=sl(h),v=c*s+1.5*o*(-d+y),x=c*s+1.5*o*(-d-y);(_=(-s-((v=v<0?-ol(-v,dl):ol(v,dl))+(x=x<0?-ol(-x,dl):ol(x,dl))))/(3*o))>=0&&_<=1&&(r[m++]=_)}else{var b=(2*c*s-3*o*d)/(2*sl(c*c*c)),w=Math.acos(b)/3,S=sl(c),C=Math.cos(w),_=(-s-2*S*C)/(3*o),T=(f=(-s+S*(C+cl*Math.sin(w)))/(3*o),(-s+S*(C-cl*Math.sin(w)))/(3*o));_>=0&&_<=1&&(r[m++]=_),f>=0&&f<=1&&(r[m++]=f),T>=0&&T<=1&&(r[m++]=T)}}return m}function bl(e,t,n,i,a){var r=6*n-12*t+6*e,o=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(gl(o)){if(fl(r))(c=-s/r)>=0&&c<=1&&(a[l++]=c)}else{var p=r*r-4*o*s;if(gl(p))a[0]=-r/(2*o);else if(p>0){var c,d=sl(p),u=(-r-d)/(2*o);(c=(-r+d)/(2*o))>=0&&c<=1&&(a[l++]=c),u>=0&&u<=1&&(a[l++]=u)}}return l}function wl(e,t,n,i,a,r){var o=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,p=(s-o)*a+o,c=(l-s)*a+s,d=(c-p)*a+p;r[0]=e,r[1]=o,r[2]=p,r[3]=d,r[4]=d,r[5]=c,r[6]=l,r[7]=i}function Sl(e,t,n,i,a,r,o,s,l,p,c){var d,u,m,h,g,f=.005,y=1/0;ul[0]=l,ul[1]=p;for(var v=0;v<1;v+=.05)ml[0]=yl(e,n,a,o,v),ml[1]=yl(t,i,r,s,v),(h=Uo(ul,ml))=0&&h=0&&f=1?1:xl(0,i,r,1,e,s)&&yl(0,a,o,1,s[0])}}}var Ol=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Mo,this.ondestroy=e.ondestroy||Mo,this.onrestart=e.onrestart||Mo,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),!this._paused){var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var r=this.easingFunc,o=r?r(a):a;if(this.onframe(o),1===a){if(!this.loop)return!0;var s=i%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=t},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Zr(e)?e:rl[e]||Dl(e)},e}(),Al=function(e){this.value=e},Fl=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Al(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Rl=function(){function e(e){this._list=new Fl,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,a=null;if(null==i[e]){var r=n.len(),o=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=n.head;n.remove(s),delete i[s.key],a=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Al(t),o.key=e,n.insertEntry(o),i[e]=o}return a},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),Bl={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Nl(e){return(e=Math.round(e))<0?0:e>255?255:e}function Ll(e){return e<0?0:e>1?1:e}function Vl(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Nl(parseFloat(t)/100*255):Nl(parseInt(t,10))}function ql(e){var t=e;return t.length&&"%"===t.charAt(t.length-1)?Ll(parseFloat(t)/100):Ll(parseFloat(t))}function Gl(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function zl(e,t,n){return e+(t-e)*n}function Ul(e,t,n,i,a){return e[0]=t,e[1]=n,e[2]=i,e[3]=a,e}function jl(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Hl=new Rl(20),Wl=null;function $l(e,t){Wl&&jl(Wl,t),Wl=Hl.put(e,Wl||t.slice())}function Kl(e,t){if(e){t=t||[];var n=Hl.get(e);if(n)return jl(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in Bl)return jl(t,Bl[i]),$l(e,t),t;var a,r=i.length;if("#"===i.charAt(0))return 4===r||5===r?(a=parseInt(i.slice(1,4),16))>=0&&a<=4095?(Ul(t,(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,5===r?parseInt(i.slice(4),16)/15:1),$l(e,t),t):void Ul(t,0,0,0,1):7===r||9===r?(a=parseInt(i.slice(1,7),16))>=0&&a<=16777215?(Ul(t,(16711680&a)>>16,(65280&a)>>8,255&a,9===r?parseInt(i.slice(7),16)/255:1),$l(e,t),t):void Ul(t,0,0,0,1):void 0;var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===r){var l=i.substr(0,o),p=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(4!==p.length)return 3===p.length?Ul(t,+p[0],+p[1],+p[2],1):Ul(t,0,0,0,1);c=ql(p.pop());case"rgb":return p.length>=3?(Ul(t,Vl(p[0]),Vl(p[1]),Vl(p[2]),3===p.length?c:ql(p[3])),$l(e,t),t):void Ul(t,0,0,0,1);case"hsla":return 4!==p.length?void Ul(t,0,0,0,1):(p[3]=ql(p[3]),Yl(p,t),$l(e,t),t);case"hsl":return 3!==p.length?void Ul(t,0,0,0,1):(Yl(p,t),$l(e,t),t);default:return}}Ul(t,0,0,0,1)}}function Yl(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=ql(e[1]),a=ql(e[2]),r=a<=.5?a*(i+1):a+i-a*i,o=2*a-r;return Ul(t=t||[],Nl(255*Gl(o,r,n+1/3)),Nl(255*Gl(o,r,n)),Nl(255*Gl(o,r,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Xl(e,t){var n=Kl(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return tp(n,4===n.length?"rgba":"rgb")}}function Zl(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),a=Math.floor(i),r=Math.ceil(i),o=t[a],s=t[r],l=i-a;return n[0]=Nl(zl(o[0],s[0],l)),n[1]=Nl(zl(o[1],s[1],l)),n[2]=Nl(zl(o[2],s[2],l)),n[3]=Ll(zl(o[3],s[3],l)),n}}function Ql(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),a=Math.floor(i),r=Math.ceil(i),o=Kl(t[a]),s=Kl(t[r]),l=i-a,p=tp([Nl(zl(o[0],s[0],l)),Nl(zl(o[1],s[1],l)),Nl(zl(o[2],s[2],l)),Ll(zl(o[3],s[3],l))],"rgba");return n?{color:p,leftIndex:a,rightIndex:r,value:i}:p}}function Jl(e,t,n,i){var a=Kl(e);if(e)return a=function(e){if(e){var t,n,i=e[0]/255,a=e[1]/255,r=e[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o,p=(s+o)/2;if(0===l)t=0,n=0;else{n=p<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,d=((s-a)/6+l/2)/l,u=((s-r)/6+l/2)/l;i===s?t=u-d:a===s?t=1/3+c-u:r===s&&(t=2/3+d-c),t<0&&(t+=1),t>1&&(t-=1)}var m=[360*t,n,p];return null!=e[3]&&m.push(e[3]),m}}(a),null!=t&&(a[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=n&&(a[1]=ql(n)),null!=i&&(a[2]=ql(i)),tp(Yl(a),"rgba")}function ep(e,t){var n=Kl(e);if(n&&null!=t)return n[3]=Ll(t),tp(n,"rgba")}function tp(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}function np(e,t){var n=Kl(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var ip=new Rl(100);function ap(e){if(Qr(e)){var t=ip.get(e);return t||(t=Xl(e,-.1),ip.put(e,t)),t}if(ro(e)){var n=Br({},e);return n.colorStops=Ur(e.colorStops,(function(e){return{offset:e.offset,color:Xl(e.color,-.1)}})),n}return e}var rp=Math.round;function op(e){var t;if(e&&"transparent"!==e){if("string"==typeof e&&e.indexOf("rgba")>-1){var n=Kl(e);n&&(e="rgb("+n[0]+","+n[1]+","+n[2]+")",t=n[3])}}else e="none";return{color:e,opacity:null==t?1:t}}var sp=1e-4;function lp(e){return e-1e-4}function pp(e){return rp(1e3*e)/1e3}function cp(e){return rp(1e4*e)/1e4}var dp={left:"start",right:"end",center:"middle",middle:"middle"};function up(e){return e&&!!e.image}function mp(e){return up(e)||function(e){return e&&!!e.svgElement}(e)}function hp(e){return"linear"===e.type}function gp(e){return"radial"===e.type}function fp(e){return e&&("linear"===e.type||"radial"===e.type)}function yp(e){return"url(#"+e+")"}function vp(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function xp(e){var t=e.x||0,n=e.y||0,i=(e.rotation||0)*ko,a=co(e.scaleX,1),r=co(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,l=[];return(t||n)&&l.push("translate("+t+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===a&&1===r||l.push("scale("+a+","+r+")"),(o||s)&&l.push("skew("+rp(o*ko)+"deg, "+rp(s*ko)+"deg)"),l.join(" ")}var bp=ur.hasGlobalWindow&&Zr(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:"undefined"!=typeof Buffer?function(e){return Buffer.from(e).toString("base64")}:function(e){return null},wp=Array.prototype.slice;function Sp(e,t,n){return(t-e)*n+e}function Cp(e,t,n,i){for(var a=t.length,r=0;ri?t:e,r=Math.min(n,i),o=a[r-1]||{color:[0,0,0,0],offset:0},s=r;so)i.length=o;else for(var s=r;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,a=i.length,r=!1,o=6,s=t;if(Gr(t)){var l=function(e){return Gr(e&&e[0])?2:1}(t);o=l,(1===l&&!eo(t[0])||2===l&&!eo(t[0][0]))&&(r=!0)}else if(eo(t)&&!lo(t))o=0;else if(Qr(t))if(isNaN(+t)){var p=Kl(t);p&&(s=p,o=3)}else o=0;else if(ro(t)){var c=Br({},s);c.colorStops=Ur(t.colorStops,(function(e){return{offset:e.offset,color:Kl(e.color)}})),hp(t)?o=4:gp(t)&&(o=5),s=c}0===a?this.valType=o:o===this.valType&&6!==o||(r=!0),this.discrete=this.discrete||r;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=Zr(n)?n:rl[n]||Dl(n)),i.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort((function(e,t){return e.time-t.time}));for(var i=this.valType,a=n.length,r=n[a-1],o=this.discrete,s=Dp(i),l=Pp(i),p=0;p=0&&!(l[n].percent<=t);n--);n=m(n,p-2)}else{for(n=u;nt);n++);n=m(n-1,p-2)}a=l[n+1],i=l[n]}if(i&&a){this._lastFr=n,this._lastFrP=t;var h=a.percent-i.percent,g=0===h?1:m((t-i.percent)/h,1);a.easingFunc&&(g=a.easingFunc(g));var f=r?this._additiveValue:d?Op:e[c];if(!Dp(s)&&!d||f||(f=this._additiveValue=[]),this.discrete)e[c]=g<1?i.rawValue:a.rawValue;else if(Dp(s))1===s?Cp(f,i[o],a[o],g):function(e,t,n,i){for(var a=t.length,r=a&&t[0].length,o=0;o0&&s.addKeyframe(0,Mp(l),i),this._trackKeys.push(o)}s.addKeyframe(e,Mp(t[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,a=0;a1){var o=r.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function Rp(){return(new Date).getTime()}var Bp,Np,Lp=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return We(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Rp()-this._pausedTime,n=t-this._time,i=this._head;i;){var a=i.next;i.step(t,n)?(i.ondestroy(),this.removeClip(i),i=a):i=a}this._time=t,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,al((function t(){e._running&&(al(t),!e._paused&&e.update())}))},t.prototype.start=function(){this._running||(this._time=Rp(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Rp(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Rp()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new Fp(e,t.loop);return this.addAnimator(n),n},t}(Xo),Vp=ur.domSupported,qp=(Np={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Bp=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Ur(Bp,(function(e){var t=e.replace("mouse","pointer");return Np.hasOwnProperty(t)?t:e}))}),Gp=["mousemove","mouseup"],zp=["pointermove","pointerup"],Up=!1;function jp(e){var t=e.pointerType;return"pen"===t||"touch"===t}function Hp(e){e&&(e.zrByTouch=!0)}function Wp(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var $p=function(e,t){this.stopPropagation=Mo,this.stopImmediatePropagation=Mo,this.preventDefault=Mo,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},Kp={mousedown:function(e){e=ms(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=ms(this.dom,e);var t=this.__mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=ms(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){Wp(this,(e=ms(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){Up=!0,e=ms(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){Up||(e=ms(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){Hp(e=ms(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Kp.mousemove.call(this,e),Kp.mousedown.call(this,e)},touchmove:function(e){Hp(e=ms(this.dom,e)),this.handler.processGesture(e,"change"),Kp.mousemove.call(this,e)},touchend:function(e){Hp(e=ms(this.dom,e)),this.handler.processGesture(e,"end"),Kp.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<300&&Kp.click.call(this,e)},pointerdown:function(e){Kp.mousedown.call(this,e)},pointermove:function(e){jp(e)||Kp.mousemove.call(this,e)},pointerup:function(e){Kp.mouseup.call(this,e)},pointerout:function(e){jp(e)||Kp.mouseout.call(this,e)}};zr(["click","dblclick","contextmenu"],(function(e){Kp[e]=function(t){t=ms(this.dom,t),this.trigger(e,t)}}));var Yp={pointermove:function(e){jp(e)||Yp.mousemove.call(this,e)},pointerup:function(e){Yp.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Xp(e,t){var n=t.domHandlers;ur.pointerEventsSupported?zr(qp.pointer,(function(i){Qp(t,i,(function(t){n[i].call(e,t)}))})):(ur.touchEventsSupported&&zr(qp.touch,(function(i){Qp(t,i,(function(a){n[i].call(e,a),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),zr(qp.mouse,(function(i){Qp(t,i,(function(a){a=us(a),t.touching||n[i].call(e,a)}))})))}function Zp(e,t){function n(n){Qp(t,n,(function(i){i=us(i),Wp(e,i.target)||(i=function(e,t){return ms(e.dom,new $p(e,t),!0)}(e,i),t.domHandlers[n].call(e,i))}),{capture:!0})}ur.pointerEventsSupported?zr(zp,n):ur.touchEventsSupported||zr(Gp,n)}function Qp(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,hs(e.domTarget,t,n,i)}function Jp(e){var t,n,i,a,r=e.mounted;for(var o in r)r.hasOwnProperty(o)&&(t=e.domTarget,n=o,i=r[o],a=e.listenerOpts[o],t.removeEventListener(n,i,a));e.mounted={}}var ec=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},tc=function(e){function t(t,n){var i=e.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=n,i._localHandlerScope=new ec(t,Kp),Vp&&(i._globalHandlerScope=new ec(document,Yp)),Xp(i,i._localHandlerScope),i}return We(t,e),t.prototype.dispose=function(){Jp(this._localHandlerScope),Vp&&Jp(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Vp&&+this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?Zp(this,t):Jp(t)}},t}(Xo),nc=1;ur.hasGlobalWindow&&(nc=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var ic=nc,ac="#333",rc="#ccc",oc=bs,sc=5e-5;function lc(e){return e>sc||e<-5e-5}var pc=[],cc=[],dc=[1,0,0,1,0,0],uc=Math.abs,mc=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return lc(this.rotation)||lc(this.x)||lc(this.y)||lc(this.scaleX-1)||lc(this.scaleY-1)||lc(this.skewX)||lc(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n=n||[1,0,0,1,0,0],t?this.getLocalTransform(n):oc(n),e&&(t?Ss(n,e,n):ws(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(oc(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(pc);var n=pc[0]<0?-1:1,i=pc[1]<0?-1:1,a=((pc[0]-n)*t+n)/pc[0]||0,r=((pc[1]-i)*t+i)/pc[1]||0;e[0]*=a,e[1]*=a,e[2]*=r,e[3]*=r}this.invTransform=this.invTransform||[1,0,0,1,0,0],Is(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||[1,0,0,1,0,0],Ss(cc,e.invTransform,t),t=cc);var n=this.originX,i=this.originY;(n||i)&&(dc[4]=n,dc[5]=i,Ss(cc,t,dc),cc[4]-=n,cc[5]-=i,t=cc),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&Ho(n,n,i),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&Ho(n,n,i),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&uc(e[0]-1)>1e-10&&uc(e[3]-1)>1e-10?Math.sqrt(uc(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){gc(this,e)},e.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,r=e.scaleY,o=e.anchorX,s=e.anchorY,l=e.rotation||0,p=e.x,c=e.y,d=e.skewX?Math.tan(e.skewX):0,u=e.skewY?Math.tan(-e.skewY):0;if(n||i||o||s){var m=n+o,h=i+s;t[4]=-m*a-d*h*r,t[5]=-h*r-u*m*a}else t[4]=t[5]=0;return t[0]=a,t[3]=r,t[1]=u*a,t[2]=d*r,l&&_s(t,t,l),t[4]+=n+p,t[5]+=i+c,t},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),hc=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function gc(e,t){for(var n=0;n=0?parseFloat(e)/100*t:parseFloat(e):e}function _c(e,t,n){var i=t.position||"inside",a=null!=t.distance?t.distance:5,r=n.height,o=n.width,s=r/2,l=n.x,p=n.y,c="left",d="top";if(i instanceof Array)l+=Cc(i[0],n.width),p+=Cc(i[1],n.height),c=null,d=null;else switch(i){case"left":l-=a,p+=s,c="right",d="middle";break;case"right":l+=a+o,p+=s,d="middle";break;case"top":l+=o/2,p-=a,c="center",d="bottom";break;case"bottom":l+=o/2,p+=r+a,c="center";break;case"inside":l+=o/2,p+=s,c="center",d="middle";break;case"insideLeft":l+=a,p+=s,d="middle";break;case"insideRight":l+=o-a,p+=s,c="right",d="middle";break;case"insideTop":l+=o/2,p+=a,c="center";break;case"insideBottom":l+=o/2,p+=r-a,c="center",d="bottom";break;case"insideTopLeft":l+=a,p+=a;break;case"insideTopRight":l+=o-a,p+=a,c="right";break;case"insideBottomLeft":l+=a,p+=r-a,d="bottom";break;case"insideBottomRight":l+=o-a,p+=r-a,c="right",d="bottom"}return(e=e||{}).x=l,e.y=p,e.align=c,e.verticalAlign=d,e}var Tc="__zr_normal__",Ic=hc.concat(["ignore"]),Ec=jr(hc,(function(e,t){return e[t]=!0,e}),{ignore:!1}),Mc={},kc=new Ns(0,0,0,0),Pc=function(){function e(e){this.id=Dr(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=t.innerTransformable,r=void 0,o=void 0,s=!1;a.parent=i?this:null;var l=!1;if(a.copyTransform(t),null!=n.position){var p=kc;n.layoutRect?p.copy(n.layoutRect):p.copy(this.getBoundingRect()),i||p.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Mc,n,p):_c(Mc,n,p),a.x=Mc.x,a.y=Mc.y,r=Mc.align,o=Mc.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var d=void 0,u=void 0;"center"===c?(d=.5*p.width,u=.5*p.height):(d=Cc(c[0],p.width),u=Cc(c[1],p.height)),l=!0,a.originX=-a.x+d+(i?0:p.x),a.originY=-a.y+u+(i?0:p.y)}}null!=n.rotation&&(a.rotation=n.rotation);var m=n.offset;m&&(a.x+=m[0],a.y+=m[1],l||(a.originX=-m[0],a.originY=-m[1]));var h=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),f=void 0,y=void 0,v=void 0;h&&this.canBeInsideText()?(f=n.insideFill,y=n.insideStroke,null!=f&&"auto"!==f||(f=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(f),v=!0)):(f=n.outsideFill,y=n.outsideStroke,null!=f&&"auto"!==f||(f=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(f),v=!0)),(f=f||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&r===g.align&&o===g.verticalAlign||(s=!0,g.fill=f,g.stroke=y,g.autoStroke=v,g.align=r,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?rc:ac},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&Kl(t);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),r=0;r<3;r++)n[r]=n[r]*i+(a?0:255)*(1-i);return n[3]=1,tp(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},Br(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(to(e))for(var n=$r(e),i=0;i0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Tc,!1,e)},e.prototype.useState=function(e,t,n,i){var a=e===Tc;if(this.hasState()||!a){var r=this.currentStates,o=this.stateTransition;if(!(Lr(r,e)>=0)||!t&&1!==r.length){var s;if(this.stateProxy&&!a&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||a){a||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&o&&o.duration>0,o);var p=this._textContent,c=this._textGuide;return p&&p.useState(e,t,n,l),c&&c.useState(e,t,n,l),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}Or("State "+e+" not exists.")}}},e.prototype.useStates=function(e,t,n){if(e.length){var i=[],a=this.currentStates,r=e.length,o=r===a.length;if(o)for(var s=0;s0,m);var h=this._textContent,g=this._textGuide;h&&h.useStates(e,t,d),g&&g.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),a=Lr(i,e),r=Lr(i,t)>=0;a>=0?r?i.splice(a,1):i[a]=t:n&&!r&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i=0&&t.splice(n,1)})),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,a=[],r=0;r0&&n.during&&r[0].during((function(e,t){n.during(t)}));for(var u=0;u0||a.force&&!o.length){var S,C=void 0,_=void 0,T=void 0;if(s){_={},u&&(C={});for(b=0;b=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=Lr(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var a=this.__zr;a&&i.removeSelfFromZr(a),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=Lr(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(e<=a)return o;if(e>=r)return s}else{if(e>=a)return o;if(e<=r)return s}else{if(e===a)return o;if(e===r)return s}return(e-a)/l*p+o}function Wc(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return Qr(e)?(n=e,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n}function $c(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function Kc(e){return e.sort((function(e,t){return e-t})),e}function Yc(e){if(e=+e,isNaN(e))return 0;if(e>1e-14)for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n;return Xc(e)}function Xc(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),i=n>0?+t.slice(n+1):0,a=n>0?n:t.length,r=t.indexOf("."),o=r<0?0:a-1-r;return Math.max(0,o-i)}function Zc(e,t){var n=Math.log,i=Math.LN10,a=Math.floor(n(e[1]-e[0])/i),r=Math.round(n(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-a+r,0),20);return isFinite(o)?o:20}function Qc(e,t){var n=jr(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return[];for(var i=Math.pow(10,t),a=Ur(e,(function(e){return(isNaN(e)?0:e)/n*i*100})),r=100*i,o=Ur(a,(function(e){return Math.floor(e)})),s=jr(o,(function(e,t){return e+t}),0),l=Ur(a,(function(e,t){return e-o[t]}));sp&&(p=l[d],c=d);++o[c],l[c]=0,++s}return Ur(o,(function(e){return e/i}))}function Jc(e,t){var n=Math.max(Yc(e),Yc(t)),i=e+t;return n>20?i:$c(i,n)}function ed(e){var t=2*Math.PI;return(e%t+t)%t}function td(e){return e>-1e-4&&e=10&&t++,t}function od(e,t){var n=rd(e),i=Math.pow(10,n),a=e/i;return e=(t?a<1.5?1:a<2.5?2:a<4?3:a<7?5:10:a<1?1:a<2?2:a<3?3:a<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function sd(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i=0||a&&Lr(a,s)<0)){var l=n.getShallow(s,t);null!=l&&(r[e[o][0]]=l)}}return r}}var Xd=Yd([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Zd=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return Xd(this,e,t)},e}(),Qd=new Rl(50);function Jd(e){if("string"==typeof e){var t=Qd.get(e);return t&&t.image}return e}function eu(e,t,n,i,a){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var r=Qd.get(e),o={hostEl:n,cb:i,cbPayload:a};return r?!nu(t=r.image)&&r.pending.push(o):((t=vr.loadImage(e,tu,tu)).__zrImageSrc=e,Qd.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}return t}function tu(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var p=yc(n,t);return p>s&&(n="",p=0),s=e-p,a.ellipsis=n,a.ellipsisWidth=p,a.contentWidth=s,a.containerWidth=e,a}function ou(e,t){var n=t.containerWidth,i=t.font,a=t.contentWidth;if(!n)return"";var r=yc(e,i);if(r<=n)return e;for(var o=0;;o++){if(r<=a||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?su(e,a,t.ascCharWidth,t.cnCharWidth):r>0?Math.floor(e.length*a/r):0;r=yc(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}function su(e,t,n,i){for(var a=0,r=0,o=e.length;r0&&h+i.accumWidth>i.width&&(r=t.split("\n"),d=!0),i.accumWidth=h}else{var g=hu(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+m,o=g.linesWidths,r=g.lines}}else r=t.split("\n");for(var f=0;f=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}(e)||!!uu[e]}function hu(e,t,n,i,a){for(var r=[],o=[],s="",l="",p=0,c=0,d=0;dn:a+c+m>n)?c?(s||l)&&(h?(s||(s=l,l="",c=p=0),r.push(s),o.push(c-p),l+=u,s="",c=p+=m):(l&&(s+=l,l="",p=0),r.push(s),o.push(c),s=u,c=m)):h?(r.push(l),o.push(p),l=u,p=m):(r.push(u),o.push(m)):(c+=m,h?(l+=u,p+=m):(l&&(s+=l,l="",p=0),s+=u))}else l&&(s+=l,c+=p),r.push(s),o.push(c),s="",l="",p=0,c=0}return r.length||s||(s=e,l="",p=0),l&&(s+=l),s&&(r.push(s),o.push(c)),1===r.length&&(c+=a),{accumWidth:c,lines:r,linesWidths:o}}var gu="__zr_style_"+Math.round(10*Math.random()),fu={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},yu={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};fu[gu]=!0;var vu=["z","z2","invisible"],xu=["invisible"],bu=function(e){function t(t){return e.call(this,t)||this}var n;return We(t,e),t.prototype._init=function(t){for(var n=$r(t),i=0;i1e-4)return s[0]=e-n,s[1]=t-i,l[0]=e+n,void(l[1]=t+i);if(Mu[0]=Iu(a)*n+e,Mu[1]=Tu(a)*i+t,ku[0]=Iu(r)*n+e,ku[1]=Tu(r)*i+t,p(s,Mu,ku),c(l,Mu,ku),(a%=Eu)<0&&(a+=Eu),(r%=Eu)<0&&(r+=Eu),a>r&&!o?r+=Eu:aa&&(Pu[0]=Iu(m)*n+e,Pu[1]=Tu(m)*i+t,p(s,Pu,s),c(l,Pu,l))}var Lu={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Vu=[],qu=[],Gu=[],zu=[],Uu=[],ju=[],Hu=Math.min,Wu=Math.max,$u=Math.cos,Ku=Math.sin,Yu=Math.abs,Xu=Math.PI,Zu=2*Xu,Qu="undefined"!=typeof Float32Array,Ju=[];function em(e){return Math.round(e/Xu*1e8)/1e8%2*Xu}function tm(e,t){var n=em(e[0]);n<0&&(n+=Zu);var i=n-e[0],a=e[1];a+=i,!t&&a-n>=Zu?a=n+Zu:t&&n-a>=Zu?a=n-Zu:!t&&n>a?a=n+(Zu-em(n-a)):t&&n0&&(this._ux=Yu(n/ic/e)||0,this._uy=Yu(n/ic/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Lu.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=Yu(e-this._xi),i=Yu(t-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Lu.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var r=n*n+i*i;r>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=r)}return this},e.prototype.bezierCurveTo=function(e,t,n,i,a,r){return this._drawPendingPt(),this.addData(Lu.C,e,t,n,i,a,r),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,a,r),this._xi=a,this._yi=r,this},e.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(Lu.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},e.prototype.arc=function(e,t,n,i,a,r){this._drawPendingPt(),Ju[0]=i,Ju[1]=a,tm(Ju,r),i=Ju[0];var o=(a=Ju[1])-i;return this.addData(Lu.A,e,t,n,n,i,o,0,r?0:1),this._ctx&&this._ctx.arc(e,t,n,i,a,r),this._xi=$u(a)*n+e,this._yi=Ku(a)*n+t,this},e.prototype.arcTo=function(e,t,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},e.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(Lu.R,e,t,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Lu.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;this.data&&this.data.length===t||!Qu||(this.data=new Float32Array(t));for(var n=0;np.length&&(this._expandData(),p=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){Gu[0]=Gu[1]=Uu[0]=Uu[1]=Number.MAX_VALUE,zu[0]=zu[1]=ju[0]=ju[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,a=0,r=0;for(e=0;en||Yu(f)>i||d===t-1)&&(h=Math.sqrt(k*k+f*f),a=g,r=x);break;case Lu.C:var y=e[d++],v=e[d++],x=(g=e[d++],e[d++]),b=e[d++],w=e[d++];h=Cl(a,r,y,v,g,x,b,w,10),a=b,r=w;break;case Lu.Q:h=kl(a,r,y=e[d++],v=e[d++],g=e[d++],x=e[d++],10),a=g,r=x;break;case Lu.A:var S=e[d++],C=e[d++],_=e[d++],T=e[d++],I=e[d++],E=e[d++],M=E+I;d+=1,m&&(o=$u(I)*_+S,s=Ku(I)*T+C),h=Wu(_,T)*Hu(Zu,Math.abs(E)),a=$u(M)*_+S,r=Ku(M)*T+C;break;case Lu.R:o=a=e[d++],s=r=e[d++],h=2*e[d++]+2*e[d++];break;case Lu.Z:var k=o-a;f=s-r;h=Math.sqrt(k*k+f*f),a=o,r=s}h>=0&&(l[c++]=h,p+=h)}return this._pathLen=p,p},e.prototype.rebuildPath=function(e,t){var n,i,a,r,o,s,l,p,c,d,u=this.data,m=this._ux,h=this._uy,g=this._len,f=t<1,y=0,v=0,x=0;if(!f||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,p=t*this._pathLen))e:for(var b=0;b0&&(e.lineTo(c,d),x=0),w){case Lu.M:n=a=u[b++],i=r=u[b++],e.moveTo(a,r);break;case Lu.L:o=u[b++],s=u[b++];var C=Yu(o-a),_=Yu(s-r);if(C>m||_>h){if(f){if(y+(K=l[v++])>p){var T=(p-y)/K;e.lineTo(a*(1-T)+o*T,r*(1-T)+s*T);break e}y+=K}e.lineTo(o,s),a=o,r=s,x=0}else{var I=C*C+_*_;I>x&&(c=o,d=s,x=I)}break;case Lu.C:var E=u[b++],M=u[b++],k=u[b++],P=u[b++],D=u[b++],O=u[b++];if(f){if(y+(K=l[v++])>p){wl(a,E,k,D,T=(p-y)/K,Vu),wl(r,M,P,O,T,qu),e.bezierCurveTo(Vu[1],qu[1],Vu[2],qu[2],Vu[3],qu[3]);break e}y+=K}e.bezierCurveTo(E,M,k,P,D,O),a=D,r=O;break;case Lu.Q:E=u[b++],M=u[b++],k=u[b++],P=u[b++];if(f){if(y+(K=l[v++])>p){El(a,E,k,T=(p-y)/K,Vu),El(r,M,P,T,qu),e.quadraticCurveTo(Vu[1],qu[1],Vu[2],qu[2]);break e}y+=K}e.quadraticCurveTo(E,M,k,P),a=k,r=P;break;case Lu.A:var A=u[b++],F=u[b++],R=u[b++],B=u[b++],N=u[b++],L=u[b++],V=u[b++],q=!u[b++],G=R>B?R:B,z=Yu(R-B)>.001,U=N+L,j=!1;if(f)y+(K=l[v++])>p&&(U=N+L*(p-y)/K,j=!0),y+=K;if(z&&e.ellipse?e.ellipse(A,F,R,B,V,N,U,q):e.arc(A,F,G,N,U,q),j)break e;S&&(n=$u(N)*R+A,i=Ku(N)*B+F),a=$u(U)*R+A,r=Ku(U)*B+F;break;case Lu.R:n=a=u[b],i=r=u[b+1],o=u[b++],s=u[b++];var H=u[b++],W=u[b++];if(f){if(y+(K=l[v++])>p){var $=p-y;e.moveTo(o,s),e.lineTo(o+Hu($,H),s),($-=H)>0&&e.lineTo(o+H,s+Hu($,W)),($-=W)>0&&e.lineTo(o+Wu(H-$,0),s+W),($-=H)>0&&e.lineTo(o,s+Wu(W-$,0));break e}y+=K}e.rect(o,s,H,W);break;case Lu.Z:if(f){var K;if(y+(K=l[v++])>p){T=(p-y)/K;e.lineTo(a*(1-T)+n*T,r*(1-T)+i*T);break e}y+=K}e.closePath(),a=n,r=i}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=Lu,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function im(e,t,n,i,a,r,o){if(0===a)return!1;var s=a,l=0;if(o>t+s&&o>i+s||oe+s&&r>n+s||rt+d&&c>i+d&&c>r+d&&c>s+d||ce+d&&p>n+d&&p>a+d&&p>o+d||pt+p&&l>i+p&&l>r+p||le+p&&s>n+p&&s>a+p||sn||c+pa&&(a+=lm);var u=Math.atan2(l,s);return u<0&&(u+=lm),u>=i&&u<=a||u+lm>=i&&u+lm<=a}function cm(e,t,n,i,a,r){if(r>t&&r>i||ra?s:0}var dm=nm.CMD,um=2*Math.PI;var mm=[-1,-1,-1],hm=[-1,-1];function gm(e,t,n,i,a,r,o,s,l,p){if(p>t&&p>i&&p>r&&p>s||p1&&(c=void 0,c=hm[0],hm[0]=hm[1],hm[1]=c),h=yl(t,i,r,s,hm[0]),m>1&&(g=yl(t,i,r,s,hm[1]))),2===m?yt&&s>i&&s>r||s=0&&c<=1&&(a[l++]=c);else{var p=o*o-4*r*s;if(gl(p))(c=-o/(2*r))>=0&&c<=1&&(a[l++]=c);else if(p>0){var c,d=sl(p),u=(-o-d)/(2*r);(c=(-o+d)/(2*r))>=0&&c<=1&&(a[l++]=c),u>=0&&u<=1&&(a[l++]=u)}}return l}(t,i,r,s,mm);if(0===l)return 0;var p=Il(t,i,r);if(p>=0&&p<=1){for(var c=0,d=_l(t,i,r,p),u=0;un||s<-n)return 0;var l=Math.sqrt(n*n-s*s);mm[0]=-l,mm[1]=l;var p=Math.abs(i-a);if(p<1e-4)return 0;if(p>=um-1e-4){i=0,a=um;var c=r?1:-1;return o>=mm[0]+e&&o<=mm[1]+e?c:0}if(i>a){var d=i;i=a,a=d}i<0&&(i+=um,a+=um);for(var u=0,m=0;m<2;m++){var h=mm[m];if(h+e>o){var g=Math.atan2(s,h);c=r?1:-1;g<0&&(g=um+g),(g>=i&&g<=a||g+um>=i&&g+um<=a)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),u+=c)}}return u}function vm(e,t,n,i,a){for(var r,o,s,l,p=e.data,c=e.len(),d=0,u=0,m=0,h=0,g=0,f=0;f1&&(n||(d+=cm(u,m,h,g,i,a))),v&&(h=u=p[f],g=m=p[f+1]),y){case dm.M:u=h=p[f++],m=g=p[f++];break;case dm.L:if(n){if(im(u,m,p[f],p[f+1],t,i,a))return!0}else d+=cm(u,m,p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case dm.C:if(n){if(am(u,m,p[f++],p[f++],p[f++],p[f++],p[f],p[f+1],t,i,a))return!0}else d+=gm(u,m,p[f++],p[f++],p[f++],p[f++],p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case dm.Q:if(n){if(rm(u,m,p[f++],p[f++],p[f],p[f+1],t,i,a))return!0}else d+=fm(u,m,p[f++],p[f++],p[f],p[f+1],i,a)||0;u=p[f++],m=p[f++];break;case dm.A:var x=p[f++],b=p[f++],w=p[f++],S=p[f++],C=p[f++],_=p[f++];f+=1;var T=!!(1-p[f++]);r=Math.cos(C)*w+x,o=Math.sin(C)*S+b,v?(h=r,g=o):d+=cm(u,m,r,o,i,a);var I=(i-x)*S/w+x;if(n){if(pm(x,b,S,C,C+_,T,t,I,a))return!0}else d+=ym(x,b,S,C,C+_,T,I,a);u=Math.cos(C+_)*w+x,m=Math.sin(C+_)*S+b;break;case dm.R:if(h=u=p[f++],g=m=p[f++],r=h+p[f++],o=g+p[f++],n){if(im(h,g,r,g,t,i,a)||im(r,g,r,o,t,i,a)||im(r,o,h,o,t,i,a)||im(h,o,h,g,t,i,a))return!0}else d+=cm(r,g,r,o,i,a),d+=cm(h,o,h,g,i,a);break;case dm.Z:if(n){if(im(u,m,h,g,t,i,a))return!0}else d+=cm(u,m,h,g,i,a);u=h,m=g}}return n||(s=m,l=g,Math.abs(s-l)<1e-4)||(d+=cm(u,m,h,g,i,a)||0),0!==d}var xm=Nr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},fu),bm={style:Nr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},yu.style)},wm=hc.concat(["invisible","culling","z","z2","zlevel","parent"]),Sm=function(e){function t(t){return e.call(this,t)||this}var n;return We(t,e),t.prototype.update=function(){var n=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var a=this._decalEl=this._decalEl||new t;a.buildPath===t.prototype.buildPath&&(a.buildPath=function(e){n.buildPath(e,n.shape)}),a.silent=!0;var r=a.style;for(var o in i)r[o]!==i[o]&&(r[o]=i[o]);r.fill=i.fill?i.decal:null,r.decal=null,r.shadowColor=null,i.strokeFirst&&(r.stroke=null);for(var s=0;s.5?ac:t>.2?"#eee":rc}if(e)return rc}return ac},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(Qr(t)){var n=this.__zr;if(!(!n||!n.isDarkMode())===np(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new nm(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var a=this.path;(i||4&this.__dirty)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),e=a.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var r=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){r.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}o>1e-10&&(r.width+=s/o,r.height+=s/o,r.x-=s/o/2,r.y-=s/o/2)}return r}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),a=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var r=this.path;if(this.hasStroke()){var o=a.lineWidth,s=a.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),function(e,t,n,i){return vm(e,t,!0,n,i)}(r,o/s,e,t)))return!0}if(this.hasFill())return function(e,t,n){return vm(e,0,!1,t,n)}(r,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:Br(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(4&this.__dirty)},t.prototype.createStyle=function(e){return To(xm,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=Br({},this.shape))},t.prototype._applyStateObj=function(t,n,i,a,r,o){e.prototype._applyStateObj.call(this,t,n,i,a,r,o);var s,l=!(n&&a);if(n&&n.shape?r?a?s=n.shape:(s=Br({},i.shape),Br(s,n.shape)):(s=Br({},a?this.shape:i.shape),Br(s,n.shape)):l&&(s=i.shape),s)if(r){this.shape=Br({},this.shape);for(var p={},c=$r(s),d=0;d0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return To(Cm,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=xc(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(bu);_m.prototype.type="tspan";var Tm=Nr({x:0,y:0},fu),Im={style:Nr({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},yu.style)};var Em=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.createStyle=function(e){return To(Tm,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(null!=n)return n;var i,a=(i=t.image)&&"string"!=typeof i&&i.width&&i.height?t.image:this.__image;if(!a)return 0;var r="width"===e?"height":"width",o=t[r];return null==o?a[e]:a[e]/a[r]*o},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return Im},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new Ns(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(bu);Em.prototype.type="image";var Mm=Math.round;function km(e,t,n){if(t){var i=t.x1,a=t.x2,r=t.y1,o=t.y2;e.x1=i,e.x2=a,e.y1=r,e.y2=o;var s=n&&n.lineWidth;return s?(Mm(2*i)===Mm(2*a)&&(e.x1=e.x2=Dm(i,s,!0)),Mm(2*r)===Mm(2*o)&&(e.y1=e.y2=Dm(r,s,!0)),e):e}}function Pm(e,t,n){if(t){var i=t.x,a=t.y,r=t.width,o=t.height;e.x=i,e.y=a,e.width=r,e.height=o;var s=n&&n.lineWidth;return s?(e.x=Dm(i,s,!0),e.y=Dm(a,s,!0),e.width=Math.max(Dm(i+r,s,!1)-e.x,0===r?0:1),e.height=Math.max(Dm(a+o,s,!1)-e.y,0===o?0:1),e):e}}function Dm(e,t,n){if(!t)return e;var i=Mm(2*e);return(i+Mm(t))%2==0?i/2:(i+(n?1:-1))/2}var Om=function(){this.x=0,this.y=0,this.width=0,this.height=0},Am={},Fm=function(e){function t(t){return e.call(this,t)||this}return We(t,e),t.prototype.getDefaultShape=function(){return new Om},t.prototype.buildPath=function(e,t){var n,i,a,r;if(this.subPixelOptimize){var o=Pm(Am,t,this.style);n=o.x,i=o.y,a=o.width,r=o.height,o.r=t.r,t=o}else n=t.x,i=t.y,a=t.width,r=t.height;t.r?function(e,t){var n,i,a,r,o,s=t.x,l=t.y,p=t.width,c=t.height,d=t.r;p<0&&(s+=p,p=-p),c<0&&(l+=c,c=-c),"number"==typeof d?n=i=a=r=d:d instanceof Array?1===d.length?n=i=a=r=d[0]:2===d.length?(n=a=d[0],i=r=d[1]):3===d.length?(n=d[0],i=r=d[1],a=d[2]):(n=d[0],i=d[1],a=d[2],r=d[3]):n=i=a=r=0,n+i>p&&(n*=p/(o=n+i),i*=p/o),a+r>p&&(a*=p/(o=a+r),r*=p/o),i+a>c&&(i*=c/(o=i+a),a*=c/o),n+r>c&&(n*=c/(o=n+r),r*=c/o),e.moveTo(s+n,l),e.lineTo(s+p-i,l),0!==i&&e.arc(s+p-i,l+i,i,-Math.PI/2,0),e.lineTo(s+p,l+c-a),0!==a&&e.arc(s+p-a,l+c-a,a,0,Math.PI/2),e.lineTo(s+r,l+c),0!==r&&e.arc(s+r,l+c-r,r,Math.PI/2,Math.PI),e.lineTo(s,l+n),0!==n&&e.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(e,t):e.rect(n,i,a,r)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Sm);Fm.prototype.type="rect";var Rm={fill:"#000"},Bm={style:Nr({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},yu.style)},Nm=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Rm,n.attr(t),n}return We(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;tm&&c){var h=Math.floor(m/l);n=n.slice(0,h)}if(e&&o&&null!=d)for(var g=ru(d,r,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),f=0;f0,T=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),I=i.calculatedLineHeight,E=0;El&&du(n,e.substring(l,p),t,s),du(n,i[2],t,s,i[1]),l=iu.lastIndex}lr){w>0?(v.tokens=v.tokens.slice(0,w),f(v,b,x),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break e}var E=S.width,M=null==E||"auto"===E;if("string"==typeof E&&"%"===E.charAt(E.length-1))O.percentWidth=E,c.push(O),O.contentWidth=yc(O.text,T);else{if(M){var k=S.backgroundColor,P=k&&k.image;P&&nu(P=Jd(P))&&(O.width=Math.max(O.width,P.width*I/P.height))}var D=h&&null!=a?a-b:null;null!=D&&D=0&&"right"===(E=x[I]).align;)this._placeToken(E,e,w,h,T,"right",f),S-=E.width,T-=E.width,I--;for(_+=(n-(_-m)-(g-T)-S)/2;C<=I;)E=x[C],this._placeToken(E,e,w,h,_+E.width/2,"center",f),_+=E.width,C++;h+=w}},t.prototype._placeToken=function(e,t,n,i,a,r,o){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,p=i+n/2;"top"===l?p=i+e.height/2:"bottom"===l&&(p=i+n-e.height/2),!e.isLineHolder&&Ym(s)&&this._renderBackground(s,t,"right"===r?a-e.width:"center"===r?a-e.width/2:a,p-e.height/2,e.width,e.height);var c=!!s.backgroundColor,d=e.textPadding;d&&(a=$m(a,r,d),p-=e.height/2-d[0]-e.innerHeight/2);var u=this._getOrCreateChild(_m),m=u.createStyle();u.useStyle(m);var h=this._defaultStyle,g=!1,f=0,y=Wm("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,h.fill)),v=Hm("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||o||h.autoStroke&&!g?null:(f=2,h.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;m.text=e.text,m.x=a,m.y=p,x&&(m.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,m.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",m.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,m.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),m.textAlign=r,m.textBaseline="middle",m.font=e.font||hr,m.opacity=uo(s.opacity,t.opacity,1),zm(m,s),v&&(m.lineWidth=uo(s.lineWidth,t.lineWidth,f),m.lineDash=co(s.lineDash,t.lineDash),m.lineDashOffset=t.lineDashOffset||0,m.stroke=v),y&&(m.fill=y);var b=e.contentWidth,w=e.contentHeight;u.setBoundingRect(new Ns(bc(m.x,b,m.textAlign),wc(m.y,w,m.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,i,a,r){var o,s,l,p=e.backgroundColor,c=e.borderWidth,d=e.borderColor,u=p&&p.image,m=p&&!u,h=e.borderRadius,g=this;if(m||e.lineHeight||c&&d){(o=this._getOrCreateChild(Fm)).useStyle(o.createStyle()),o.style.fill=null;var f=o.shape;f.x=n,f.y=i,f.width=a,f.height=r,f.r=h,o.dirtyShape()}if(m)(l=o.style).fill=p||null,l.fillOpacity=co(e.fillOpacity,1);else if(u){(s=this._getOrCreateChild(Em)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=p.image,y.x=n,y.y=i,y.width=a,y.height=r}c&&d&&((l=o.style).lineWidth=c,l.stroke=d,l.strokeOpacity=co(e.strokeOpacity,1),l.lineDash=e.borderDash,l.lineDashOffset=e.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(o||s).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||"transparent",v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=uo(e.opacity,t.opacity,1)},t.makeFont=function(e){var t="";return Um(e)&&(t=[e.fontStyle,e.fontWeight,Gm(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),t&&fo(t)||e.textFont||e.font},t}(bu),Lm={left:!0,right:1,center:1},Vm={top:1,bottom:1,middle:1},qm=["fontStyle","fontWeight","fontSize","fontFamily"];function Gm(e){return"string"!=typeof e||-1===e.indexOf("px")&&-1===e.indexOf("rem")&&-1===e.indexOf("em")?isNaN(+e)?"12px":e+"px":e}function zm(e,t){for(var n=0;n=0,r=!1;if(e instanceof Sm){var o=eh(e),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(ch(s)||ch(l)){var p=(i=i||{}).style||{};"inherit"===p.fill?(r=!0,i=Br({},i),(p=Br({},p)).fill=s):!ch(p.fill)&&ch(s)?(r=!0,i=Br({},i),(p=Br({},p)).fill=ap(s)):!ch(p.stroke)&&ch(l)&&(r||(i=Br({},i),p=Br({},p)),p.stroke=ap(l)),i.style=p}}if(i&&null==i.z2){r||(i=Br({},i));var c=e.z2EmphasisLift;i.z2=e.z2+(null!=c?c:ah)}return i}(this,0,t,n);if("blur"===e)return function(e,t,n){var i=Lr(e.currentStates,t)>=0,a=e.style.opacity,r=i?null:function(e,t,n,i){for(var a=e.style,r={},o=0;o0){var r={dataIndex:a,seriesIndex:e.seriesIndex};null!=i&&(r.dataType=i),t.push(r)}}))})),t}function Lh(e,t,n){jh(e,!0),xh(e,Sh),qh(e,t,n)}function Vh(e,t,n,i){i?function(e){jh(e,!1)}(e):Lh(e,t,n)}function qh(e,t,n){var i=Xm(e);null!=t?(i.focus=t,i.blurScope=n):i.focus&&(i.focus=null)}var Gh=["emphasis","blur","select"],zh={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Uh(e,t,n,i){n=n||"itemStyle";for(var a=0;a1&&(o*=Jh(h),s*=Jh(h));var g=(a===r?-1:1)*Jh((o*o*(s*s)-o*o*(m*m)-s*s*(u*u))/(o*o*(m*m)+s*s*(u*u)))||0,f=g*o*m/s,y=g*-s*u/o,v=(e+n)/2+tg(d)*f-eg(d)*y,x=(t+i)/2+eg(d)*f+tg(d)*y,b=rg([1,0],[(u-f)/o,(m-y)/s]),w=[(u-f)/o,(m-y)/s],S=[(-1*u-f)/o,(-1*m-y)/s],C=rg(w,S);if(ag(w,S)<=-1&&(C=ng),ag(w,S)>=1&&(C=0),C<0){var _=Math.round(C/ng*1e6)/1e6;C=2*ng+_%2*ng}c.addData(p,v,x,o,s,b,C,d,r)}var sg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,lg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var pg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.applyTransform=function(e){},t}(Sm);function cg(e){return null!=e.setData}function dg(e,t){var n=function(e){var t=new nm;if(!e)return t;var n,i=0,a=0,r=i,o=a,s=nm.CMD,l=e.match(sg);if(!l)return t;for(var p=0;pP*P+D*D&&(_=I,T=E),{cx:_,cy:T,x0:-c,y0:-d,x1:_*(a/w-1),y1:T*(a/w-1)}}function kg(e,t){var n,i=Tg(t.r,0),a=Tg(t.r0||0,0),r=i>0;if(r||a>0){if(r||(i=a,a=0),a>i){var o=i;i=a,a=o}var s=t.startAngle,l=t.endAngle;if(!isNaN(s)&&!isNaN(l)){var p=t.cx,c=t.cy,d=!!t.clockwise,u=Cg(l-s),m=u>vg&&u%vg;if(m>Eg&&(u=m),i>Eg)if(u>vg-Eg)e.moveTo(p+i*bg(s),c+i*xg(s)),e.arc(p,c,i,s,l,!d),a>Eg&&(e.moveTo(p+a*bg(l),c+a*xg(l)),e.arc(p,c,a,l,s,d));else{var h=void 0,g=void 0,f=void 0,y=void 0,v=void 0,x=void 0,b=void 0,w=void 0,S=void 0,C=void 0,_=void 0,T=void 0,I=void 0,E=void 0,M=void 0,k=void 0,P=i*bg(s),D=i*xg(s),O=a*bg(l),A=a*xg(l),F=u>Eg;if(F){var R=t.cornerRadius;R&&(n=function(e){var t;if(Xr(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(R),h=n[0],g=n[1],f=n[2],y=n[3]);var B=Cg(i-a)/2;if(v=Ig(B,f),x=Ig(B,y),b=Ig(B,h),w=Ig(B,g),_=S=Tg(v,x),T=C=Tg(b,w),(S>Eg||C>Eg)&&(I=i*bg(l),E=i*xg(l),M=a*bg(s),k=a*xg(s),uEg){var j=Ig(f,_),H=Ig(y,_),W=Mg(M,k,P,D,i,j,d),$=Mg(I,E,O,A,i,H,d);e.moveTo(p+W.cx+W.x0,c+W.cy+W.y0),_0&&e.arc(p+W.cx,c+W.cy,j,Sg(W.y0,W.x0),Sg(W.y1,W.x1),!d),e.arc(p,c,i,Sg(W.cy+W.y1,W.cx+W.x1),Sg($.cy+$.y1,$.cx+$.x1),!d),H>0&&e.arc(p+$.cx,c+$.cy,H,Sg($.y1,$.x1),Sg($.y0,$.x0),!d))}else e.moveTo(p+P,c+D),e.arc(p,c,i,s,l,!d);else e.moveTo(p+P,c+D);if(a>Eg&&F)if(T>Eg){j=Ig(h,T),W=Mg(O,A,I,E,a,-(H=Ig(g,T)),d),$=Mg(P,D,M,k,a,-j,d);e.lineTo(p+W.cx+W.x0,c+W.cy+W.y0),T0&&e.arc(p+W.cx,c+W.cy,H,Sg(W.y0,W.x0),Sg(W.y1,W.x1),!d),e.arc(p,c,a,Sg(W.cy+W.y1,W.cx+W.x1),Sg($.cy+$.y1,$.cx+$.x1),d),j>0&&e.arc(p+$.cx,c+$.cy,j,Sg($.y1,$.x1),Sg($.y0,$.x0),!d))}else e.lineTo(p+O,c+A),e.arc(p,c,a,l,s,d);else e.lineTo(p+O,c+A)}else e.moveTo(p,c);e.closePath()}}}var Pg=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Dg=function(e){function t(t){return e.call(this,t)||this}return We(t,e),t.prototype.getDefaultShape=function(){return new Pg},t.prototype.buildPath=function(e,t){kg(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Sm);Dg.prototype.type="sector";var Og=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Ag=function(e){function t(t){return e.call(this,t)||this}return We(t,e),t.prototype.getDefaultShape=function(){return new Og},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,a=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,a,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,a,!0)},t}(Sm);function Fg(e,t,n){var i=t.smooth,a=t.points;if(a&&a.length>=2){if(i){var r=function(e,t,n,i){var a,r,o,s,l=[],p=[],c=[],d=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var u=0,m=e.length;uJg[1]){if(o=!1,a)return o;var p=Math.abs(Jg[0]-Qg[1]),c=Math.abs(Qg[0]-Jg[1]);Math.min(p,c)>i.len()&&(p0){var d={duration:c.duration,delay:c.delay||0,easing:c.easing,done:r,force:!!r||!!o,setToFinal:!p,scope:e,during:o};l?t.animateFrom(n,d):t.animateTo(n,d)}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),r&&r()}function pf(e,t,n,i,a,r){lf("update",e,t,n,i,a,r)}function cf(e,t,n,i,a,r){lf("enter",e,t,n,i,a,r)}function df(e){if(!e.__zr)return!0;for(var t=0;tMath.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ff(e){return!e.isGroup}function Rf(e,t,n){if(e&&t){var i,a=(i={},e.traverse((function(e){Ff(e)&&e.anid&&(i[e.anid]=e)})),i);t.traverse((function(e){if(Ff(e)&&e.anid){var t=a[e.anid];if(t){var i=r(e);e.attr(r(t)),pf(e,i,n,Xm(e).dataIndex)}}}))}function r(e){var t={x:e.x,y:e.y,rotation:e.rotation};return function(e){return null!=e.shape}(e)&&(t.shape=Br({},e.shape)),t}}function Bf(e,t){return Ur(e,(function(e){var n=e[0];n=ff(n,t.x),n=yf(n,t.x+t.width);var i=e[1];return i=ff(i,t.y),[n,i=yf(i,t.y+t.height)]}))}function Nf(e,t){var n=ff(e.x,t.x),i=yf(e.x+e.width,t.x+t.width),a=ff(e.y,t.y),r=yf(e.y+e.height,t.y+t.height);if(i>=n&&r>=a)return{x:n,y:a,width:i-n,height:r-a}}function Lf(e,t,n){var i=Br({rectHover:!0},t),a=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(a.image=e.slice(8),Nr(a,n),new Em(i)):_f(e.replace("path://",""),i,n,"center")}function Vf(e,t,n,i,a){for(var r=0,o=a[a.length-1];r=-1e-6)return!1;var h=e-a,g=t-r,f=Gf(h,g,p,c)/m;if(f<0||f>1)return!1;var y=Gf(h,g,d,u)/m;return!(y<0||y>1)}function Gf(e,t,n,i){return e*i-n*t}function zf(e){var t=e.itemTooltipOption,n=e.componentModel,i=e.itemName,a=Qr(t)?{formatter:t}:t,r=n.mainType,o=n.componentIndex,s={componentType:r,name:i,$vars:["name"]};s[r+"Index"]=o;var l=e.formatterParamsExtra;l&&zr($r(l),(function(e){Eo(s,e)||(s[e]=l[e],s.$vars.push(e))}));var p=Xm(e.el);p.componentMainType=r,p.componentIndex=o,p.tooltipConfig={name:i,option:Nr({content:i,formatterParams:s},a)}}function Uf(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function jf(e,t){if(e)if(Xr(e))for(var n=0;n-1?Cy:Ty;function ky(e,t){e=e.toUpperCase(),Ey[e]=new xy(t),Iy[e]=t}function Py(e){return Ey[e]}ky(_y,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),ky(Cy,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Dy=1e3,Oy=6e4,Ay=36e5,Fy=864e5,Ry=31536e6,By={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Ny="{yyyy}-{MM}-{dd}",Ly={year:"{yyyy}",month:"{yyyy}-{MM}",day:Ny,hour:Ny+" "+By.hour,minute:Ny+" "+By.minute,second:Ny+" "+By.second,millisecond:By.none},Vy=["year","month","day","hour","minute","second","millisecond"],qy=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Gy(e,t){return"0000".substr(0,t-(e+="").length)+e}function zy(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function Uy(e){return e===zy(e)}function jy(e,t,n,i){var a=id(e),r=a[$y(n)](),o=a[Ky(n)]()+1,s=Math.floor((o-1)/3)+1,l=a[Yy(n)](),p=a["get"+(n?"UTC":"")+"Day"](),c=a[Xy(n)](),d=(c-1)%12+1,u=a[Zy(n)](),m=a[Qy(n)](),h=a[Jy(n)](),g=(i instanceof xy?i:Py(i||My)||Ey[Ty]).getModel("time"),f=g.get("month"),y=g.get("monthAbbr"),v=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,Gy(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,f[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,Gy(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Gy(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[p]).replace(/{ee}/g,x[p]).replace(/{e}/g,p+"").replace(/{HH}/g,Gy(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Gy(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Gy(u,2)).replace(/{m}/g,u+"").replace(/{ss}/g,Gy(m,2)).replace(/{s}/g,m+"").replace(/{SSS}/g,Gy(h,3)).replace(/{S}/g,h+"")}function Hy(e,t){var n=id(e),i=n[Ky(t)]()+1,a=n[Yy(t)](),r=n[Xy(t)](),o=n[Zy(t)](),s=n[Qy(t)](),l=0===n[Jy(t)](),p=l&&0===s,c=p&&0===o,d=c&&0===r,u=d&&1===a;return u&&1===i?"year":u?"month":d?"day":c?"hour":p?"minute":l?"second":"millisecond"}function Wy(e,t,n){var i=eo(e)?id(e):e;switch(t=t||Hy(e,n)){case"year":return i[$y(n)]();case"half-year":return i[Ky(n)]()>=6?1:0;case"quarter":return Math.floor((i[Ky(n)]()+1)/4);case"month":return i[Ky(n)]();case"day":return i[Yy(n)]();case"half-day":return i[Xy(n)]()/24;case"hour":return i[Xy(n)]();case"minute":return i[Zy(n)]();case"second":return i[Qy(n)]();case"millisecond":return i[Jy(n)]()}}function $y(e){return e?"getUTCFullYear":"getFullYear"}function Ky(e){return e?"getUTCMonth":"getMonth"}function Yy(e){return e?"getUTCDate":"getDate"}function Xy(e){return e?"getUTCHours":"getHours"}function Zy(e){return e?"getUTCMinutes":"getMinutes"}function Qy(e){return e?"getUTCSeconds":"getSeconds"}function Jy(e){return e?"getUTCMilliseconds":"getMilliseconds"}function ev(e){return e?"setUTCFullYear":"setFullYear"}function tv(e){return e?"setUTCMonth":"setMonth"}function nv(e){return e?"setUTCDate":"setDate"}function iv(e){return e?"setUTCHours":"setHours"}function av(e){return e?"setUTCMinutes":"setMinutes"}function rv(e){return e?"setUTCSeconds":"setSeconds"}function ov(e){return e?"setUTCMilliseconds":"setMilliseconds"}function sv(e){if(!pd(e))return Qr(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function lv(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var pv=ho;function cv(e,t,n){function i(e){return e&&fo(e)?e:"-"}function a(e){return!(null==e||isNaN(e)||!isFinite(e))}var r="time"===t,o=e instanceof Date;if(r||o){var s=r?id(e):e;if(!isNaN(+s))return jy(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(o)return"-"}if("ordinal"===t)return Jr(e)?i(e):eo(e)&&a(e)?e+"":"-";var l=ld(e);return a(l)?sv(l):Jr(e)?i(e):"boolean"==typeof e?e+"":"-"}var dv=["a","b","c","d","e","f","g"],uv=function(e,t){return"{"+e+(null==t?"":t)+"}"};function mv(e,t,n){Xr(t)||(t=[t]);var i=t.length;if(!i)return"";for(var a=t[0].$vars||[],r=0;r':'':{renderMode:r,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===a?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function gv(e,t){return t=t||"transparent",Qr(e)?e:to(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function fv(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var yv=zr,vv=["left","right","top","bottom","width","height"],xv=[["width","left","right"],["height","top","bottom"]];function bv(e,t,n,i,a){var r=0,o=0;null==i&&(i=1/0),null==a&&(a=1/0);var s=0;t.eachChild((function(l,p){var c,d,u=l.getBoundingRect(),m=t.childAt(p+1),h=m&&m.getBoundingRect();if("horizontal"===e){var g=u.width+(h?-h.x+u.x:0);(c=r+g)>i||l.newline?(r=0,c=g,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var f=u.height+(h?-h.y+u.y:0);(d=o+f)>a||l.newline?(r+=s+n,o=0,d=f,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=r,l.y=o,l.markRedraw(),"horizontal"===e?r=c+n:o=d+n)}))}var wv=bv;Yr(bv,"vertical"),Yr(bv,"horizontal");function Sv(e,t,n){n=pv(n||0);var i=t.width,a=t.height,r=Wc(e.left,i),o=Wc(e.top,a),s=Wc(e.right,i),l=Wc(e.bottom,a),p=Wc(e.width,i),c=Wc(e.height,a),d=n[2]+n[0],u=n[1]+n[3],m=e.aspect;switch(isNaN(p)&&(p=i-s-u-r),isNaN(c)&&(c=a-l-d-o),null!=m&&(isNaN(p)&&isNaN(c)&&(m>i/a?p=.8*i:c=.8*a),isNaN(p)&&(p=m*c),isNaN(c)&&(c=p/m)),isNaN(r)&&(r=i-s-p-u),isNaN(o)&&(o=a-l-c-d),e.left||e.right){case"center":r=i/2-p/2-n[3];break;case"right":r=i-p-u}switch(e.top||e.bottom){case"middle":case"center":o=a/2-c/2-n[0];break;case"bottom":o=a-c-d}r=r||0,o=o||0,isNaN(p)&&(p=i-u-r-(s||0)),isNaN(c)&&(c=a-d-o-(l||0));var h=new Ns(r+n[3],o+n[0],p,c);return h.margin=n,h}function Cv(e,t,n,i,a,r){var o,s=!a||!a.hv||a.hv[0],l=!a||!a.hv||a.hv[1],p=a&&a.boundingMode||"all";if((r=r||e).x=e.x,r.y=e.y,!s&&!l)return!1;if("raw"===p)o="group"===e.type?new Ns(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(o=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(o=o.clone()).applyTransform(c)}var d=Sv(Nr({width:o.width,height:o.height},t),n,i),u=s?d.x-o.x:0,m=l?d.y-o.y:0;return"raw"===p?(r.x=u,r.y=m):(r.x+=u,r.y+=m),r===e&&e.markRedraw(),!0}function _v(e){var t=e.layoutMode||e.constructor.layoutMode;return to(t)?t:t?{type:t}:null}function Tv(e,t,n){var i=n&&n.ignoreSize;!Xr(i)&&(i=[i,i]);var a=o(xv[0],0),r=o(xv[1],1);function o(n,a){var r={},o=0,p={},c=0;if(yv(n,(function(t){p[t]=e[t]})),yv(n,(function(e){s(t,e)&&(r[e]=p[e]=t[e]),l(r,e)&&o++,l(p,e)&&c++})),i[a])return l(t,n[1])?p[n[2]]=null:l(t,n[2])&&(p[n[1]]=null),p;if(2!==c&&o){if(o>=2)return r;for(var d=0;d=0;o--)r=Fr(r,n[o],!0);t.defaultOption=r}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+"Index",i=e+"Id";return Bd(this.ecModel,e,{index:this.get(n,!0),id:this.get(i,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(xy);jd(kv,xy),Kd(kv),function(e){var t={};e.registerSubTypeDefaulter=function(e,n){var i=zd(e);t[i.main]=n},e.determineSubType=function(n,i){var a=i.type;if(!a){var r=zd(n).main;e.hasSubTypes(n)&&t[r]&&(a=t[r](i))}return a}}(kv),function(e,t){function n(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,i,a,r){if(e.length){var o=function(e){var i={},a=[];return zr(e,(function(r){var o=n(i,r),s=function(e,t){var n=[];return zr(e,(function(e){Lr(t,e)>=0&&n.push(e)})),n}(o.originalDeps=t(r),e);o.entryCount=s.length,0===o.entryCount&&a.push(r),zr(s,(function(e){Lr(o.predecessor,e)<0&&o.predecessor.push(e);var t=n(i,e);Lr(t.successor,e)<0&&t.successor.push(r)}))})),{graph:i,noEntryList:a}}(i),s=o.graph,l=o.noEntryList,p={};for(zr(e,(function(e){p[e]=!0}));l.length;){var c=l.pop(),d=s[c],u=!!p[c];u&&(a.call(r,c,d.originalDeps.slice()),delete p[c]),zr(d.successor,u?h:m)}zr(p,(function(){var e="";throw new Error(e)}))}function m(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function h(e){p[e]=!0,m(e)}}}(kv,(function(e){var t=[];zr(kv.getClassesByMainType(e),(function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])})),t=Ur(t,(function(e){return zd(e).main})),"dataset"!==e&&Lr(t,"dataset")<=0&&t.unshift("dataset");return t}));var Pv="";"undefined"!=typeof navigator&&(Pv=navigator.platform||"");var Dv="rgba(0, 0, 0, 0.2)",Ov={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Dv,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Dv,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Dv,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Dv,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Dv,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Dv,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Pv.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Av=Co(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Fv="original",Rv="arrayRows",Bv="objectRows",Nv="keyedColumns",Lv="typedArray",Vv="unknown",qv="column",Gv="row",zv=1,Uv=2,jv=3,Hv=Pd();function Wv(e,t,n){var i={},a=Kv(t);if(!a||!e)return i;var r,o,s=[],l=[],p=t.ecModel,c=Hv(p).datasetMap,d=a.uid+"_"+n.seriesLayoutBy;zr(e=e.slice(),(function(t,n){var a=to(t)?t:e[n]={name:t};"ordinal"===a.type&&null==r&&(r=n,o=h(a)),i[a.name]=[]}));var u=c.get(d)||c.set(d,{categoryWayDim:o,valueWayDim:0});function m(e,t,n){for(var i=0;it)return e[i];return e[n-1]}(i,o):n;if((c=c||n)&&c.length){var d=c[l];return a&&(p[a]=d),s.paletteIdx=(l+1)%c.length,d}}var ox="\0_ec_inner";var sx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.init=function(e,t,n,i,a,r){i=i||{},this.option=null,this._theme=new xy(i),this._locale=new xy(a),this._optionManager=r},t.prototype.setOption=function(e,t,n){var i=cx(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,cx(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var a=i.mountOption("recreate"===e);0,this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(a,t)):ex(this,a),n=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,t))}if(!e||"recreate"===e||"media"===e){var o=i.getMediaOption(this);o.length&&zr(o,(function(e){n=!0,this._mergeOption(e,t)}),this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,a=this._componentsCount,r=[],o=Co(),s=t&&t.replaceMergeMainTypeMap;Hv(this).datasetMap=Co(),zr(e,(function(e,t){null!=e&&(kv.hasClass(t)?t&&(r.push(t),o.set(t,!0)):n[t]=null==n[t]?Ar(e):Fr(n[t],e,!0))})),s&&s.each((function(e,t){kv.hasClass(t)&&!o.get(t)&&(r.push(t),o.set(t,!0))})),kv.topologicalTravel(r,kv.getAllClassMainTypes(),(function(t){var r=function(e,t,n){var i=Zv.get(t);if(!i)return n;var a=i(e);return a?n.concat(a):n}(this,t,vd(e[t])),o=i.get(t),l=o?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",p=Cd(o,r,l);(function(e,t,n){zr(e,(function(e){var i=e.newOption;to(i)&&(e.keyInfo.mainType=t,e.keyInfo.subType=function(e,t,n,i){return t.type?t.type:n?n.subType:i.determineSubType(e,t)}(t,i,e.existing,n))}))})(p,t,kv),n[t]=null,i.set(t,null),a.set(t,0);var c,d=[],u=[],m=0;zr(p,(function(e,n){var i=e.existing,a=e.newOption;if(a){var r="series"===t,o=kv.getClass(t,e.keyInfo.subType,!r);if(!o)return;if("tooltip"===t){if(c)return void 0;c=!0}if(i&&i.constructor===o)i.name=e.keyInfo.name,i.mergeOption(a,this),i.optionUpdated(a,!1);else{var s=Br({componentIndex:n},e.keyInfo);Br(i=new o(a,this,this,s),s),e.brandNew&&(i.__requireNewView=!0),i.init(a,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(d.push(i.option),u.push(i),m++):(d.push(void 0),u.push(void 0))}),this),n[t]=d,i.set(t,u),a.set(t,m),"series"===t&&Qv(this)}),this),this._seriesIndices||Qv(this)},t.prototype.getOption=function(){var e=Ar(this.option);return zr(e,(function(t,n){if(kv.hasClass(n)){for(var i=vd(t),a=i.length,r=!1,o=a-1;o>=0;o--)i[o]&&!Md(i[o])?r=!0:(i[o]=null,!r&&a--);i.length=a,e[n]=i}})),delete e[ox],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t)for(var a=0;a=t:"max"===n?e<=t:e===t})(i[o],e,r)||(a=!1)}})),a}var vx=zr,xx=to,bx=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Sx(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=bx.length;n=0;g--){var f=e[g];if(s||(u=f.data.rawIndexOf(f.stackedByDimension,d)),u>=0){var y=f.data.getByRawIndex(f.stackResultDimension,u);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&m>=0&&y>0||"samesign"===l&&m<=0&&y<0){m=Jc(m,y),h=y;break}}}return i[0]=m,i[1]=h,i}))}))}var qx,Gx,zx,Ux,jx,Hx=function(e){this.data=e.data||(e.sourceFormat===Nv?{}:[]),this.sourceFormat=e.sourceFormat||Vv,this.seriesLayoutBy=e.seriesLayoutBy||qv,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;np&&(p=m)}s[0]=l,s[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};function a(e){for(var t=0;t=0&&(s=r.interpolatedValue[l])}return null!=s?s+"":""})):void 0},e.prototype.getRawValue=function(e,t){return cb(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function mb(e){var t,n;return to(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function hb(e){return new gb(e)}var gb=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n=this._upstream,i=e&&e.skip;if(this._dirty&&n){var a=this.context;a.data=a.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(t=this._plan(this.context));var r,o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),p=e&&e.modDataCount||0;function c(e){return!(e>=1)&&(e=1),e}o===l&&s===p||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,r=this._doReset(i)),this._modBy=l,this._modDataCount=p;var d=e&&e.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var u=this._dueIndex,m=Math.min(null!=d?this._dueIndex+d:1/0,this._dueEnd);if(!i&&(r||u1&&i>0?s:o}};return r;function o(){return t=e?null:rt},gte:function(e,t){return e>=t}},wb=function(){function e(e,t){if(!eo(t)){var n="";0,hd(n)}this._opFn=bb[e],this._rvalFloat=ld(t)}return e.prototype.evaluate=function(e){return eo(e)?this._opFn(e,this._rvalFloat):this._opFn(ld(e),this._rvalFloat)},e}(),Sb=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=eo(e)?e:ld(e),i=eo(t)?t:ld(t),a=isNaN(n),r=isNaN(i);if(a&&(n=this._incomparable),r&&(i=this._incomparable),a&&r){var o=Qr(e),s=Qr(t);o&&(n=s?e:0),s&&(i=o?t:0)}return ni?-this._resultLT:0},e}(),Cb=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=ld(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(t=ld(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function _b(e,t){return"eq"===e||"ne"===e?new Cb("eq"===e,t):Eo(bb,e)?new wb(e,t):null}var Tb=function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(e){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return yb(e,t)},e}();function Ib(e){var t=e.sourceFormat;if(!Ob(t)){var n="";0,hd(n)}return e.data}function Eb(e){var t=e.sourceFormat,n=e.data;if(!Ob(t)){var i="";0,hd(i)}if(t===Rv){for(var a=[],r=0,o=n.length;r65535?Rb:Bb}function Gb(e,t,n,i,a){var r=Vb[n||"float"];if(a){var o=e[t],s=o&&o.length;if(s!==i){for(var l=new r(i),p=0;pg[1]&&(g[1]=h)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,a=this._chunks,r=this._dimensions,o=r.length,s=this._rawExtent,l=Ur(r,(function(e){return e.property})),p=0;pf[1]&&(f[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&ne))return r;a=r-1}}return-1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks[e],a=[];if(!i)return a;null==n&&(n=1/0);for(var r=1/0,o=-1,s=0,l=0,p=this.count();l=0&&o<0)&&(r=d,o=c,s=0),c===o&&(a[s++]=l))}return a.length=s,a},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=p&&x<=c||isNaN(x))&&(o[s++]=m),m++}u=!0}else if(2===a){h=d[i[0]];var f=d[i[1]],y=e[i[1]][0],v=e[i[1]][1];for(g=0;g=p&&x<=c||isNaN(x))&&(b>=y&&b<=v||isNaN(b))&&(o[s++]=m),m++}u=!0}}if(!u)if(1===a)for(g=0;g=p&&x<=c||isNaN(x))&&(o[s++]=w)}else for(g=0;ge[_][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(g))}return sf[1]&&(f[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,i,a,r=this.clone([e],!0),o=r._chunks[e],s=this.count(),l=0,p=Math.floor(1/t),c=this.getRawIndex(0),d=new(qb(this._rawCount))(Math.min(2*(Math.ceil(s/p)+2),s));d[l++]=c;for(var u=1;un&&(n=i,a=T)}_>0&&_p-m&&(s=p-m,o.length=s);for(var h=0;hc[1]&&(c[1]=f),d[u++]=y}return a._count=u,a._indices=d,a._updateGetRawIdx(),a},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,a=0,r=this.count();ao&&(o=l)}return i=[r,o],this._extent[e]=i,i},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,i){return yb(e[i],this._dimensions[i])}Ab={arrayRows:e,objectRows:function(e,t,n,i){return yb(e[t],this._dimensions[i])},keyedColumns:e,original:function(e,t,n,i){var a=e&&(null==e.value?e:e.value);return yb(a instanceof Array?a[i]:a,this._dimensions[i])},typedArray:function(e,t,n,i){return e[i]}}}(),e}(),Ub=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),a=!!i.length;if(Hb(n)){var r=n,o=void 0,s=void 0,l=void 0;if(a){var p=i[0];p.prepareSource(),o=(l=p.getSource()).data,s=l.sourceFormat,t=[p._getVersionSign()]}else s=io(o=r.get("data",!0))?Lv:Fv,t=[];var c=this._getSourceMetaRawOption()||{},d=l&&l.metaRawOption||{},u=co(c.seriesLayoutBy,d.seriesLayoutBy)||null,m=co(c.sourceHeader,d.sourceHeader),h=co(c.dimensions,d.dimensions);e=u!==d.seriesLayoutBy||!!m!=!!d.sourceHeader||h?[$x(o,{seriesLayoutBy:u,sourceHeader:m,dimensions:h},s)]:[]}else{var g=n;if(a){var f=this._applyTransform(i);e=f.sourceList,t=f.upstreamSignList}else{e=[$x(g.get("source",!0),this._getSourceMetaRawOption(),null)],t=[]}}this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n=this._sourceHost,i=n.get("transform",!0),a=n.get("fromTransformResult",!0);if(null!=a){var r="";1!==e.length&&Wb(r)}var o,s=[],l=[];return zr(e,(function(e){e.prepareSource();var t=e.getSource(a||0),n="";null==a||t||Wb(n),s.push(t),l.push(e._getVersionSign())})),i?t=function(e,t){var n=vd(e),i=n.length,a="";i||hd(a);for(var r=0,o=i;r1||n>0&&!e.noHeader;return zr(e.blocks,(function(e){var n=ew(e);n>=t&&(t=n+ +(i&&(!n||Qb(e)&&!e.noHeader)))})),t}return 0}function tw(e,t,n,i){var a,r=t.noHeader,o=(a=ew(t),{html:Yb[a],richText:Xb[a]}),s=[],l=t.blocks||[];go(!l||Xr(l)),l=l||[];var p=e.orderMode;if(t.sortBlocks&&p){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Eo(c,p)){var d=new Sb(c[p],null);l.sort((function(e,t){return d.evaluate(e.sortParam,t.sortParam)}))}else"seriesDesc"===p&&l.reverse()}zr(l,(function(n,a){var r=t.valueFormatter,l=Jb(n)(r?Br(Br({},e),{valueFormatter:r}):e,n,a>0?o.html:0,i);null!=l&&s.push(l)}));var u="richText"===e.renderMode?s.join(o.richText):aw(s.join(""),r?n:o.html);if(r)return u;var m=cv(t.header,"ordinal",e.useUTC),h=Kb(i,e.renderMode).nameStyle;return"richText"===e.renderMode?rw(e,m,h)+o.richText+u:aw('
'+os(m)+"
"+u,n)}function nw(e,t,n,i){var a=e.renderMode,r=t.noName,o=t.noValue,s=!t.markerType,l=t.name,p=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return Ur(e=Xr(e)?e:[e],(function(e,t){return cv(e,Xr(m)?m[t]:m,p)}))};if(!r||!o){var d=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",a),u=r?"":cv(l,"ordinal",p),m=t.valueType,h=o?[]:c(t.value,t.dataIndex),g=!s||!r,f=!s&&r,y=Kb(i,a),v=y.nameStyle,x=y.valueStyle;return"richText"===a?(s?"":d)+(r?"":rw(e,u,v))+(o?"":function(e,t,n,i,a){var r=[a],o=i?10:20;return n&&r.push({padding:[0,0,0,o],align:"right"}),e.markupStyleCreator.wrapRichTextStyle(Xr(t)?t.join(" "):t,r)}(e,h,g,f,x)):aw((s?"":d)+(r?"":function(e,t,n){return''+os(e)+""}(u,!s,v))+(o?"":function(e,t,n,i){var a=n?"10px":"20px",r=t?"float:right;margin-left:"+a:"";return e=Xr(e)?e:[e],''+Ur(e,(function(e){return os(e)})).join("  ")+""}(h,g,f,x)),n)}}function iw(e,t,n,i,a,r){if(e)return Jb(e)({useUTC:a,renderMode:n,orderMode:i,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,r)}function aw(e,t){return'
'+e+'
'}function rw(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function ow(e,t){return gv(e.getData().getItemVisual(t,"style")[e.visualDrawType])}function sw(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var lw=function(){function e(){this.richTextStyles={},this._nextStyleNameId=cd()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i="richText"===n?this._generateStyleName():null,a=hv({color:t,type:e,renderMode:n,markerId:i});return Qr(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};Xr(t)?zr(t,(function(e){return Br(n,e)})):Br(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}();function pw(e){var t,n,i,a,r=e.series,o=e.dataIndex,s=e.multipleSeries,l=r.getData(),p=l.mapDimensionsAll("defaultedTooltip"),c=p.length,d=r.getRawValue(o),u=Xr(d),m=ow(r,o);if(c>1||u&&!c){var h=function(e,t,n,i,a){var r=t.getData(),o=jr(e,(function(e,t,n){var i=r.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],p=[];function c(e,t){var n=r.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(o?p.push(Zb("nameValue",{markerType:"subItem",markerColor:a,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?zr(i,(function(e){c(cb(r,n,e),e)})):zr(e,c),{inlineValues:s,inlineValueTypes:l,blocks:p}}(d,r,o,p,m);t=h.inlineValues,n=h.inlineValueTypes,i=h.blocks,a=h.inlineValues[0]}else if(c){var g=l.getDimensionInfo(p[0]);a=t=cb(l,o,p[0]),n=g.type}else a=t=u?d[0]:d;var f=Ed(r),y=f&&r.name||"",v=l.getName(o),x=s?y:v;return Zb("section",{header:y,noHeader:s||!f,sortParam:a,blocks:[Zb("nameValue",{markerType:"item",markerColor:m,name:x,noName:!fo(x),value:t,valueType:n,dataIndex:o})].concat(i||[])})}var cw=Pd();function dw(e,t){return e.getName(t)||e.getId(t)}var uw="__universalTransitionEnabled",mw=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return We(t,e),t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=hb({count:gw,reset:fw}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(cw(this).sourceManager=new Ub(this)).prepareSource();var i=this.getInitialData(e,n);vw(i,this),this.dataTask.context.data=i,cw(this).dataBeforeProcessed=i,hw(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=_v(this),i=n?Iv(e):{},a=this.subType;kv.hasClass(a)&&(a+="Series"),Fr(e,t.getTheme().get(this.subType)),Fr(e,this.getDefaultOption()),xd(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Tv(e,i,n)},t.prototype.mergeOption=function(e,t){e=Fr(this.option,e,!0),this.fillDataTextStyle(e.data);var n=_v(this);n&&Tv(this.option,e,n);var i=cw(this).sourceManager;i.dirty(),i.prepareSource();var a=this.getInitialData(e,t);vw(a,this),this.dataTask.dirty(),this.dataTask.context.data=a,cw(this).dataBeforeProcessed=a,hw(this),this._initSelectedMapFromData(a)},t.prototype.fillDataTextStyle=function(e){if(e&&!io(e))for(var t=["show"],n=0;nthis.getShallow("animationThreshold")&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,a=ix.prototype.getColorFromPalette.call(this,e,t,n);return a||(a=i.getColorFromPalette(e,t,n)),a},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,a=this.getData(t);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r=0&&n.push(a)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(t);return("all"===n||n[dw(i,e)])&&!i.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[uw])return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},t.prototype._innerSelect=function(e,t){var n,i,a=this.option,r=a.selectedMode,o=t.length;if(r&&o)if("series"===r)a.selectedMap="all";else if("multiple"===r){to(a.selectedMap)||(a.selectedMap={});for(var s=a.selectedMap,l=0;l0&&this._innerSelect(e,t)}},t.registerClass=function(e){return kv.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(kv);function hw(e){var t=e.name;Ed(e)||(e.name=function(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),i=[];return zr(n,(function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)})),i.join(" ")}(e)||t)}function gw(e){return e.model.getRawData().count()}function fw(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),yw}function yw(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function vw(e,t){zr(_o(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),(function(n){e.wrapMethod(n,Yr(xw,t))}))}function xw(e,t){var n=bw(e);return n&&n.setOutputEnd((t||this).count()),t}function bw(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var a=i.agentStubMap;a&&(i=a.get(e.uid))}return i}}qr(mw,ub),qr(mw,ix),jd(mw,kv);var ww=function(){function e(){this.group=new Rc,this.uid=wy("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();function Sw(){var e=Pd();return function(t){var n=e(t),i=t.pipelineContext,a=!!n.large,r=!!n.progressiveRender,o=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(a===o&&r===s)&&"reset"}}Ud(ww),Kd(ww);var Cw=Pd(),_w=Sw(),Tw=function(){function e(){this.group=new Rc,this.uid=wy("viewChart"),this.renderTask=hb({plan:Mw,reset:kw}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){0},e.prototype.highlight=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&Ew(a,i,"emphasis")},e.prototype.downplay=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&Ew(a,i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.eachRendered=function(e){jf(this.group,e)},e.markUpdateMethod=function(e,t){Cw(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function Iw(e,t,n){e&&Hh(e)&&("emphasis"===t?Th:Ih)(e,n)}function Ew(e,t,n){var i=kd(e,t),a=t&&null!=t.highlightKey?function(e){var t=Jm[e];return null==t&&Qm<=32&&(t=Jm[e]=Qm++),t}(t.highlightKey):null;null!=i?zr(vd(i),(function(t){Iw(e.getItemGraphicEl(t),n,a)})):e.eachItemGraphicEl((function(e){Iw(e,n,a)}))}function Mw(e){return _w(e.model)}function kw(e){var t=e.model,n=e.ecModel,i=e.api,a=e.payload,r=t.pipelineContext.progressiveRender,o=e.view,s=a&&Cw(a).updateMethod,l=r?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,n,i,a),Pw[l]}Ud(Tw),Kd(Tw);var Pw={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},Dw="\0__throttleOriginMethod",Ow="\0__throttleRate",Aw="\0__throttleType";function Fw(e,t,n){var i,a,r,o,s,l=0,p=0,c=null;function d(){p=(new Date).getTime(),c=null,e.apply(r,o||[])}t=t||0;var u=function(){for(var e=[],u=0;u=0?d():c=setTimeout(d,-a),l=i};return u.clear=function(){c&&(clearTimeout(c),c=null)},u.debounceNextCall=function(e){s=e},u}function Rw(e,t,n,i){var a=e[t];if(a){var r=a[Dw]||a,o=a[Aw];if(a[Ow]!==n||o!==i){if(null==n||!i)return e[t]=r;(a=e[t]=Fw(r,n,"debounce"===i))[Dw]=r,a[Aw]=i,a[Ow]=n}return a}}function Bw(e,t){var n=e[t];n&&n[Dw]&&(n.clear&&n.clear(),e[t]=n[Dw])}var Nw=Pd(),Lw={itemStyle:Yd(fy,!0),lineStyle:Yd(my,!0)},Vw={lineStyle:"stroke",itemStyle:"fill"};function qw(e,t){var n=e.visualStyleMapper||Lw[t];return n||(console.warn("Unknown style type '"+t+"'."),Lw.itemStyle)}function Gw(e,t){var n=e.visualDrawType||Vw[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var zw={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",a=e.getModel(i),r=qw(e,i)(a),o=a.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var s=Gw(e,i),l=r[s],p=Zr(l)?l:null,c="auto"===r.fill||"auto"===r.stroke;if(!r[s]||p||c){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());r[s]||(r[s]=d,n.setVisual("colorFromPalette",!0)),r.fill="auto"===r.fill||Zr(r.fill)?d:r.fill,r.stroke="auto"===r.stroke||Zr(r.stroke)?d:r.stroke}if(n.setVisual("style",r),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&p)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),a=Br({},r);a[s]=p(i),t.setItemVisual(n,"style",a)}}}},Uw=new xy,jw={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData&&!t.isSeriesFiltered(e)){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",a=qw(e,i),r=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){Uw.option=n[i];var o=a(Uw);Br(e.ensureUniqueItemVisual(t,"style"),o),Uw.option.decal&&(e.setItemVisual(t,"decal",Uw.option.decal),Uw.option.decal.dirty=!0),r in o&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}},Hw={performRawSeries:!0,overallReset:function(e){var t=Co();e.eachSeries((function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var i=e.type+"-"+n,a=t.get(i);a||(a={},t.set(i,a)),Nw(e).scope=a}})),e.eachSeries((function(t){if(!t.isColorBySeries()&&!e.isSeriesFiltered(t)){var n=t.getRawData(),i={},a=t.getData(),r=Nw(t).scope,o=t.visualStyleAccessPath||"itemStyle",s=Gw(t,o);a.each((function(e){var t=a.getRawIndex(e);i[t]=e})),n.each((function(e){var o=i[e];if(a.getItemVisual(o,"colorFromPalette")){var l=a.ensureUniqueItemVisual(o,"style"),p=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(p,r,c)}}))}}))}},Ww=Math.PI;var $w=function(){function e(e,t,n,i){this._stageTaskMap=Co(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:a,modBy:null!=r?Math.ceil(r/a):null,modDataCount:r}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),a=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,r=e.get("large")&&i>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:a,modDataCount:o,large:r}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=Co();e.eachSeries((function(e){var i=e.getProgressive(),a=e.uid;n.set(a,{id:a,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)}))},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;zr(this._allHandlers,(function(i){var a=e.get(i.uid)||e.set(i.uid,{}),r="";go(!(i.reset&&i.overallReset),r),i.reset&&this._createSeriesStageTask(i,a,t,n),i.overallReset&&this._createOverallStageTask(i,a,t,n)}),this)},e.prototype.prepareView=function(e,t,n,i){var a=e.renderTask,r=a.context;r.model=t,r.ecModel=n,r.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var a=!1,r=this;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}zr(e,(function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=r._stageTaskMap.get(e.uid),p=l.seriesTaskMap,c=l.overallTask;if(c){var d,u=c.agentStubMap;u.each((function(e){o(i,e)&&(e.dirty(),d=!0)})),d&&c.dirty(),r.updatePayload(c,n);var m=r.getPerformArgs(c,i.block);u.each((function(e){e.perform(m)})),c.perform(m)&&(a=!0)}else p&&p.each((function(s,l){o(i,s)&&s.dirty();var p=r.getPerformArgs(s,i.block);p.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),r.updatePayload(s,n),s.perform(p)&&(a=!0)}))}})),this.unfinished=a||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t=e.dataTask.perform()||t})),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var a=this,r=t.seriesTaskMap,o=t.seriesTaskMap=Co(),s=e.seriesType,l=e.getTargetSeries;function p(t){var s=t.uid,l=o.set(s,r&&r.get(s)||hb({plan:Qw,reset:Jw,count:nS}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(p):s?n.eachRawSeriesByType(s,p):l&&l(n,i).each(p)},e.prototype._createOverallStageTask=function(e,t,n,i){var a=this,r=t.overallTask=t.overallTask||hb({reset:Kw});r.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var o=r.agentStubMap,s=r.agentStubMap=Co(),l=e.seriesType,p=e.getTargetSeries,c=!0,d=!1,u="";function m(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,hb({reset:Yw,onDirty:Zw})));n.context={model:e,overallProgress:c},n.agent=r,n.__block=c,a._pipe(e,n)}go(!e.createOnAllSeries,u),l?n.eachRawSeriesByType(l,m):p?p(n,i).each(m):(c=!1,zr(n.getSeries(),m)),d&&r.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return Zr(e)&&(e={overallReset:e,seriesType:iS(e)}),e.uid=wy("stageHandler"),t&&(e.visualType=t),e},e}();function Kw(e){e.overallReset(e.ecModel,e.api,e.payload)}function Yw(e){return e.overallProgress&&Xw}function Xw(){this.agent.dirty(),this.getDownstream().dirty()}function Zw(){this.agent&&this.agent.dirty()}function Qw(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Jw(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=vd(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Ur(t,(function(e,t){return tS(t)})):eS}var eS=tS(0);function tS(e){return function(t,n){var i=n.data,a=n.resetDefines[e];if(a&&a.dataEach)for(var r=t.start;r0&&c===a.length-p.length){var d=a.slice(0,c);"data"!==d&&(t.mainType=d,t[p.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(a)&&(n[a]=e,s=!0),s||(i[a]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,r=n.model,o=n.view;if(!r||!o)return!0;var s=t.cptQuery,l=t.dataQuery;return p(s,r,"mainType")&&p(s,r,"subType")&&p(s,r,"index","componentIndex")&&p(s,r,"name")&&p(s,r,"id")&&p(l,a,"name")&&p(l,a,"dataIndex")&&p(l,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,a));function p(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),fS=["symbol","symbolSize","symbolRotate","symbolOffset"],yS=fS.concat(["symbolKeepAspect"]),vS={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var i={},a={},r=!1,o=0;o=0&&qS(l)?l:.5,e.createRadialGradient(o,s,0,o,s,l)}(e,t,n):function(e,t,n){var i=null==t.x?0:t.x,a=null==t.x2?1:t.x2,r=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(i=i*n.width+n.x,a=a*n.width+n.x,r=r*n.height+n.y,o=o*n.height+n.y),i=qS(i)?i:0,a=qS(a)?a:1,r=qS(r)?r:0,o=qS(o)?o:0,e.createLinearGradient(i,r,a,o)}(e,t,n),a=t.colorStops,r=0;r0&&(t=i.lineDash,n=i.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:eo(t)?[t]:Xr(t)?t:null:null),r=i.lineDashOffset;if(a){var o=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;o&&1!==o&&(a=Ur(a,(function(e){return e/o})),r/=o)}return[a,r]}var HS=new nm(!0);function WS(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function $S(e){return"string"==typeof e&&"none"!==e}function KS(e){var t=e.fill;return null!=t&&"none"!==t}function YS(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function XS(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function ZS(e,t,n){var i=eu(t.image,t.__image,n);if(nu(i)){var a=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix&&a&&a.setTransform){var r=new DOMMatrix;r.translateSelf(t.x||0,t.y||0),r.rotateSelf(0,0,(t.rotation||0)*ko),r.scaleSelf(t.scaleX||1,t.scaleY||1),a.setTransform(r)}return a}}var QS=["shadowBlur","shadowOffsetX","shadowOffsetY"],JS=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function eC(e,t,n,i,a){var r=!1;if(!i&&t===(n=n||{}))return!1;if(i||t.opacity!==n.opacity){iC(e,a),r=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?fu.opacity:o}(i||t.blend!==n.blend)&&(r||(iC(e,a),r=!0),e.globalCompositeOperation=t.blend||fu.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[bC])if(this._disposed)ZC(this.id);else{var i,a,r;if(to(t)&&(n=t.lazyUpdate,i=t.silent,a=t.replaceMerge,r=t.transition,t=t.notMerge),this[bC]=!0,!this._model||t){var o=new fx(this._api),s=this._theme,l=this._model=new sx;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:a},t_);var p={seriesTransition:r,optionChanged:!0};if(n)this[wC]={silent:i,updateParams:p},this[bC]=!1,this.getZr().wakeUp();else{try{MC(this),DC.update.call(this,null,p)}catch(e){throw this[wC]=null,this[bC]=!1,e}this._ssr||this._zr.flush(),this[wC]=null,this[bC]=!1,RC.call(this,i),BC.call(this,i)}}},t.prototype.setTheme=function(){md()},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ur.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var t=this._zr.painter;return t.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var t=this._zr.painter;return t.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(ur.svgSupported){var e=this._zr;return zr(e.storage.getDisplayList(),(function(e){e.stopAnimation(null,!0)})),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,n=this._model,i=[],a=this;zr(t,(function(e){n.eachComponent({mainType:e},(function(e){var t=a._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)}))}));var r="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return zr(i,(function(e){e.group.ignore=!1})),r}ZC(this.id)},t.prototype.getConnectedDataURL=function(e){if(!this._disposed){var t="svg"===e.type,n=this.group,i=Math.min,a=Math.max,r=1/0;if(o_[n]){var o=r,s=r,l=-1/0,p=-1/0,c=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();zr(r_,(function(r,d){if(r.group===n){var u=t?r.getZr().painter.getSvgDom().innerHTML:r.renderToCanvas(Ar(e)),m=r.getDom().getBoundingClientRect();o=i(m.left,o),s=i(m.top,s),l=a(m.right,l),p=a(m.bottom,p),c.push({dom:u,left:m.left,top:m.top})}}));var u=(l*=d)-(o*=d),m=(p*=d)-(s*=d),h=vr.createCanvas(),g=qc(h,{renderer:t?"svg":"canvas"});if(g.resize({width:u,height:m}),t){var f="";return zr(c,(function(e){var t=e.left-o,n=e.top-s;f+=''+e.dom+""})),g.painter.getSvgRoot().innerHTML=f,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new Fm({shape:{x:0,y:0,width:u,height:m},style:{fill:e.connectedBackgroundColor}})),zr(c,(function(e){var t=new Em({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});g.add(t)})),g.refreshImmediately(),h.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}ZC(this.id)},t.prototype.convertToPixel=function(e,t){return OC(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return OC(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;if(!this._disposed)return zr(Od(this._model,e),(function(e,i){i.indexOf("Models")>=0&&zr(e,(function(e){var a=e.coordinateSystem;if(a&&a.containPoint)n=n||!!a.containPoint(t);else if("seriesModels"===i){var r=this._chartsMap[e.__viewId];r&&r.containPoint&&(n=n||r.containPoint(t,e))}else 0}),this)}),this),!!n;ZC(this.id)},t.prototype.getVisual=function(e,t){var n=Od(this._model,e,{defaultMainType:"series"}),i=n.seriesModel;var a=i.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?a.indexOfRawIndex(n.dataIndex):null;return null!=r?bS(a,r,t):wS(a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,i=this;zr(XC,(function(e){var t=function(t){var n,a=i.getModel(),r=t.target,o="globalout"===e;if(o?n={}:r&&TS(r,(function(e){var t=Xm(e);if(t&&null!=t.dataIndex){var i=t.dataModel||a.getSeriesByIndex(t.seriesIndex);return n=i&&i.getDataParams(t.dataIndex,t.dataType,r)||{},!0}if(t.eventData)return n=Br({},t.eventData),!0}),!0),n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var p=s&&null!=l&&a.getComponent(s,l),c=p&&i["series"===p.mainType?"_chartsMap":"_componentsMap"][p.__viewId];0,n.event=t,n.type=e,i._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:p,view:c},i.trigger(e,n)}};t.zrEventfulCallAtLast=!0,i._zr.on(e,t,i)})),zr(JC,(function(e,t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),zr(["selectchanged"],(function(e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",(function(e){var i=n.getModel();e.isFromClick?(_S("map","selectchanged",t,i,e),_S("pie","selectchanged",t,i,e)):"select"===e.fromAction?(_S("map","selected",t,i,e),_S("pie","selected",t,i,e)):"unselect"===e.fromAction&&(_S("map","unselected",t,i,e),_S("pie","unselected",t,i,e))}))},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?ZC(this.id):this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)ZC(this.id);else{this._disposed=!0,this.getDom()&&Nd(this.getDom(),l_,"");var e=this,t=e._api,n=e._model;zr(e._componentsViews,(function(e){e.dispose(n,t)})),zr(e._chartsViews,(function(e){e.dispose(n,t)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete r_[e.id]}},t.prototype.resize=function(e){if(!this[bC])if(this._disposed)ZC(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[wC]&&(null==i&&(i=this[wC].silent),n=!0,this[wC]=null),this[bC]=!0;try{n&&MC(this),DC.update.call(this,{type:"resize",animation:Br({duration:0},e&&e.animation)})}catch(e){throw this[bC]=!1,e}this[bC]=!1,RC.call(this,i),BC.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)ZC(this.id);else if(to(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),a_[e]){var n=a_[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?ZC(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=Br({},e);return t.type=JC[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)ZC(this.id);else if(to(t)||(t={silent:!!t}),QC[e.type]&&this._model)if(this[bC])this._pendingActions.push(e);else{var n=t.silent;FC.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&ur.browser.weChat&&this._throttledZrFlush(),RC.call(this,n),BC.call(this,n)}},t.prototype.updateLabelLayout=function(){hC.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)ZC(this.id);else{var t=e.seriesIndex,n=this.getModel().getSeriesByIndex(t);0,n.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function t(e){for(var t=[],n=e.currentStates,i=0;i0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(e){if(e.states&&e.states.emphasis){if(df(e))return;if(e instanceof Sm&&function(e){var t=eh(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(a){e.stateTransition=o;var i=e.getTextContent(),r=e.getTextGuideLine();i&&(i.stateTransition=o),r&&(r.stateTransition=o)}e.__dirty&&t(e)}}))}MC=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),kC(e,!0),kC(e,!1),t.plan()},kC=function(e,t){for(var n=e._model,i=e._scheduler,a=t?e._componentsViews:e._chartsViews,r=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,l=0;lt.get("hoverLayerThreshold")&&!ur.node&&!ur.worker&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered((function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)}))}}))}(e,t),hC.trigger("series:afterupdate",t,i,s)},jC=function(e){e[SC]=!0,e.getZr().wakeUp()},HC=function(e){e[SC]&&(e.getZr().storage.traverse((function(e){df(e)||t(e)})),e[SC]=!1)},zC=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return We(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Th(t,n),jC(e)},n.prototype.leaveEmphasis=function(t,n){Ih(t,n),jC(e)},n.prototype.enterBlur=function(t){Eh(t),jC(e)},n.prototype.leaveBlur=function(t){Mh(t),jC(e)},n.prototype.enterSelect=function(t){kh(t),jC(e)},n.prototype.leaveSelect=function(t){Ph(t),jC(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(ux))(e)},UC=function(e){function t(e,t){for(var n=0;n=0)){f_.push(n);var r=$w.wrapStageHandler(n,a);r.__prio=t,r.__raw=n,e.push(r)}}function v_(e,t){a_[e]=t}var x_=function(e){var t=(e=Ar(e)).type,n="";t||hd(n);var i=t.split(":");2!==i.length&&hd(n);var a=!1;"echarts"===i[0]&&(t=i[1],a=!0),e.__isBuiltIn=a,Pb.set(t,e)};function b_(e){return null==e?0:e.length||1}function w_(e){return e}g_(yC,zw),g_(vC,jw),g_(vC,Hw),g_(yC,vS),g_(vC,xS),g_(7e3,(function(e,t){e.eachRawSeries((function(n){if(!e.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(e){var n=i.getItemVisual(e,"decal");n&&(i.ensureUniqueItemVisual(e,"style").decal=cC(n,t))}));var a=i.getVisual("decal");if(a)i.getVisual("style").decal=cC(a,t)}}))})),d_(Lx),u_(900,(function(e){var t=Co();e.eachSeries((function(e){var n=e.get("stack");if(n){var i=t.get(n)||t.set(n,[]),a=e.getData(),r={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:e};if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;i.length&&a.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(r)}})),t.each(Vx)})),v_("default",(function(e,t){Nr(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Rc,i=new Fm({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(i);var a,r=new Nm({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),o=new Fm({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return n.add(o),t.showSpinner&&((a=new $g({shape:{startAngle:-Ww/2,endAngle:-Ww/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Ww/2}).start("circularInOut"),a.animateShape(!0).when(1e3,{startAngle:3*Ww/2}).delay(300).start("circularInOut"),n.add(a)),n.resize=function(){var n=r.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),p=e.getHeight()/2;t.showSpinner&&a.setShape({cx:l,cy:p}),o.setShape({x:l-s,y:p-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n})),h_({type:rh,event:rh,update:rh},Mo),h_({type:oh,event:oh,update:oh},Mo),h_({type:sh,event:sh,update:sh},Mo),h_({type:lh,event:lh,update:lh},Mo),h_({type:ph,event:ph,update:ph},Mo),c_("light",pS),c_("dark",hS);var S_=function(){function e(e,t,n,i,a,r){this._old=e,this._new=t,this._oldKeyGetter=n||w_,this._newKeyGetter=i||w_,this.context=a,this._diffModeMultiple="multiple"===r}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,a,"_newKeyGetter");for(var r=0;r1){var p=s.shift();1===s.length&&(n[o]=s[0]),this._update&&this._update(p,r)}else 1===l?(n[o]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(a,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},a=[],r=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(t,i,r,"_newKeyGetter");for(var o=0;o1&&1===d)this._updateManyToOne&&this._updateManyToOne(p,l),i[s]=null;else if(1===c&&d>1)this._updateOneToMany&&this._updateOneToMany(p,l),i[s]=null;else if(1===c&&1===d)this._update&&this._update(p,l),i[s]=null;else if(c>1&&d>1)this._updateManyToMany&&this._updateManyToMany(p,l),i[s]=null;else if(c>1)for(var u=0;u1)for(var o=0;o30}var F_,R_,B_,N_,L_,V_,q_,G_=to,z_=Ur,U_="undefined"==typeof Int32Array?Array:Int32Array,j_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],H_=["_approximateExtent"],W_=function(){function e(e,t){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;P_(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},r=[],o={},s=!1,l={},p=0;p=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,a=this._idList;if(n.getSource().sourceFormat===Fv&&!n.pure)for(var r=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[t];return null==a&&(Xr(a=this.getVisual(t))?a=a.slice():G_(a)&&(a=Br({},a)),i[t]=a),a},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,G_(t)?Br(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){G_(e)?Br(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?Br(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;Zm(n,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){zr(this._graphicEls,(function(n,i){n&&e&&e.call(t,n,i)}))},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:z_(this.dimensions,this._getDimInfo,this),this.hostModel)),L_(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];Zr(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(mo(arguments)))})},e.internalField=(F_=function(e){var t=e._invertedIndicesMap;zr(t,(function(n,i){var a=e._dimInfos[i],r=a.ordinalMeta,o=a.stack,s=e._store;if(r||o){if(n=t[i]=o?new Array(s.count()):new U_(r.categories.length),r)for(var l=0;l1&&(s+="__ec__"+p),i[t]=s}})),e}();function $_(e,t){Wx(e)||(e=Kx(e));var n=(t=t||{}).coordDimensions||[],i=t.dimensionsDefine||e.dimensionsDefine||[],a=Co(),r=[],o=function(e,t,n,i){var a=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,i||0);return zr(t,(function(e){var t;to(e)&&(t=e.dimsDef)&&(a=Math.max(a,t.length))})),a}(e,n,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&A_(o),l=i===e.dimensionsDefine,p=l?O_(e):D_(i),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var d=Co(c),u=new Nb(o),m=0;m0&&(i.name=a+(r-1)),r++,t.set(a,r)}}(r),new k_({source:e,dimensions:r,fullDimensionCount:o,dimensionOmitted:s})}function K_(e,t,n){if(n||t.hasKey(e)){for(var i=0;t.hasKey(e+i);)i++;e+=i}return t.set(e,!0),e}var Y_=function(e){this.coordSysDims=[],this.axisMap=Co(),this.categoryAxisMap=Co(),this.coordSysName=e};var X_={cartesian2d:function(e,t,n,i){var a=e.getReferringComponents("xAxis",Fd).models[0],r=e.getReferringComponents("yAxis",Fd).models[0];t.coordSysDims=["x","y"],n.set("x",a),n.set("y",r),Z_(a)&&(i.set("x",a),t.firstCategoryDimIndex=0),Z_(r)&&(i.set("y",r),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var a=e.getReferringComponents("singleAxis",Fd).models[0];t.coordSysDims=["single"],n.set("single",a),Z_(a)&&(i.set("single",a),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var a=e.getReferringComponents("polar",Fd).models[0],r=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",o),Z_(r)&&(i.set("radius",r),t.firstCategoryDimIndex=0),Z_(o)&&(i.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,i){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,i){var a=e.ecModel,r=a.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=r.dimensions.slice();zr(r.parallelAxisIndex,(function(e,r){var s=a.getComponent("parallelAxis",e),l=o[r];n.set(l,s),Z_(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=r))}))}};function Z_(e){return"category"===e.get("type")}function Q_(e,t,n){var i,a,r,o=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(e){return!P_(e.schema)}(t)?(a=t.schema,i=a.dimensions,r=t.store):i=t;var l,p,c,d,u=!(!e||!e.get("stack"));if(zr(i,(function(e,t){Qr(e)&&(i[t]=e={name:e}),u&&!e.isExtraCoord&&(o||l||!e.ordinalMeta&&!e.stack||(l=e),p||"ordinal"===e.type||"time"===e.type||s&&s!==e.coordDim||(p=e))})),!p||o||l||(o=!0),p){c="__\0ecstackresult_"+e.id,d="__\0ecstackedover_"+e.id,l&&(l.createInvertedIndices=!0);var m=p.coordDim,h=p.type,g=0;zr(i,(function(e){e.coordDim===m&&g++}));var f={name:c,coordDim:m,coordDimIndex:g,type:h,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:d,coordDim:d,coordDimIndex:g+1,type:h,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};a?(r&&(f.storeDimIndex=r.ensureCalculationDimension(d,h),y.storeDimIndex=r.ensureCalculationDimension(c,h)),a.appendCalculationDimension(f),a.appendCalculationDimension(y)):(i.push(f),i.push(y))}return{stackedDimension:p&&p.name,stackedByDimension:l&&l.name,isStackedByIndex:o,stackedOverDimension:d,stackResultDimension:c}}function J_(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function eT(e,t){return J_(e,t)?e.getCalculationInfo("stackResultDimension"):t}function tT(e,t,n){n=n||{};var i,a=t.getSourceManager(),r=!1;e?(r=!0,i=Kx(e)):r=(i=a.getSource()).sourceFormat===Fv;var o=function(e){var t=e.get("coordinateSystem"),n=new Y_(t),i=X_[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}(t),s=function(e,t){var n,i=e.get("coordinateSystem"),a=hx.get(i);return t&&t.coordSysDims&&(n=Ur(t.coordSysDims,(function(e){var n={name:e},i=t.axisMap.get(e);if(i){var a=i.get("type");n.type=T_(a)}return n}))),n||(n=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]),n}(t,o),l=n.useEncodeDefaulter,p=Zr(l)?l:l?Yr(Wv,s,t):null,c=$_(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:p,canOmitUnusedDimensions:!r}),d=function(e,t,n){var i,a;return n&&zr(e,(function(e,r){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(null==i&&(i=r),e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(a=!0)})),a||null==i||(e[i].otherDims.itemName=0),i}(c.dimensions,n.createInvertedIndices,o),u=r?null:a.getSharedDataStore(c),m=Q_(t,{schema:c,store:u}),h=new W_(c,t);h.setCalculationInfo(m);var g=null!=d&&function(e){if(e.sourceFormat===Fv){var t=function(e){var t=0;for(;tt[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();Kd(nT);var iT=0,aT=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++iT}return e.createByAxisModel=function(t){var n=t.option,i=n.data,a=i&&Ur(i,rT);return new e({categories:a,needCollect:!a,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!Qr(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=Co(this.categories))},e}();function rT(e){return to(e)&&null!=e.value?e.value:e+""}function oT(e){return"interval"===e.type||"log"===e.type}function sT(e,t,n,i){var a={},r=e[1]-e[0],o=a.interval=od(r/t,!0);null!=n&&oi&&(o=a.interval=i);var s=a.intervalPrecision=pT(o);return function(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),cT(e,0,t),cT(e,1,t),e[0]>e[1]&&(e[0]=e[1])}(a.niceTickExtent=[$c(Math.ceil(e[0]/o)*o,s),$c(Math.floor(e[1]/o)*o,s)],e),a}function lT(e){var t=Math.pow(10,rd(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,$c(n*t)}function pT(e){return Yc(e)+2}function cT(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function dT(e,t){return e>=t[0]&&e<=t[1]}function uT(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function mT(e,t){return e*(t[1]-t[0])+t[0]}var hT=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new aT({})),Xr(i)&&(i=new aT({categories:Ur(i,(function(e){return to(e)?e.value:e}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return We(t,e),t.prototype.parse=function(e){return null==e?NaN:Qr(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return dT(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return uT(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(mT(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null!=e){for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],a=0,r=this._ordinalMeta.categories.length,o=Math.min(r,t.length);a=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(nT);nT.registerClass(hT);var gT=$c,fT=function(e){function t(t){var n=e.call(this,t)||this;n.type="interval",n._interval=0,n._intervalPrecision=2;var i=n.getSetting("ticksGenerator");return Zr(i)&&(n._ticksGenerator=i),n}return We(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return dT(e,this._extent)},t.prototype.normalize=function(e){return uT(e,this._extent)},t.prototype.scale=function(e){return mT(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=pT(e)},t.prototype.getTicks=function(e){var t,n=this._interval,i=this._extent,a=this._niceExtent,r=this._intervalPrecision,o=this._ticksGenerator;if(o)try{if(t=o(i,n,a,r))return t}catch(e){}if(t=[],!n)return t;i[0]1e4)return[];var l=t.length?t[t.length-1].value:a[1];return i[1]>l&&(e?t.push({value:gT(l+n,r)}):t.push({value:i[1]})),t},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),a=1;ai[0]&&c0&&(r=null===r?s:Math.min(r,s))}n[i]=r}}return n}(e),n=[];return zr(e,(function(e){var i,a=e.coordinateSystem.getBaseAxis(),r=a.getExtent();if("category"===a.type)i=a.getBandWidth();else if("value"===a.type||"time"===a.type){var o=a.dim+"_"+a.index,s=t[o],l=Math.abs(r[1]-r[0]),p=a.scale.getExtent(),c=Math.abs(p[1]-p[0]);i=s?l/c*s:l}else{var d=e.getData();i=Math.abs(r[1]-r[0])/d.count()}var u=Wc(e.get("barWidth"),i),m=Wc(e.get("barMaxWidth"),i),h=Wc(e.get("barMinWidth")||(kT(e)?.5:1),i),g=e.get("barGap"),f=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:u,barMaxWidth:m,barMinWidth:h,barGap:g,barCategoryGap:f,axisKey:ST(a),stackId:wT(e)})})),TT(n)}function TT(e){var t={};zr(e,(function(e,n){var i=e.axisKey,a=e.bandWidth,r=t[i]||{bandWidth:a,remainedWidth:a,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},o=r.stacks;t[i]=r;var s=e.stackId;o[s]||r.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var p=e.barMaxWidth;p&&(o[s].maxWidth=p);var c=e.barMinWidth;c&&(o[s].minWidth=c);var d=e.barGap;null!=d&&(r.gap=d);var u=e.barCategoryGap;null!=u&&(r.categoryGap=u)}));var n={};return zr(t,(function(e,t){n[t]={};var i=e.stacks,a=e.bandWidth,r=e.categoryGap;if(null==r){var o=$r(i).length;r=Math.max(35-4*o,15)+"%"}var s=Wc(r,a),l=Wc(e.gap,1),p=e.remainedWidth,c=e.autoWidthCount,d=(p-s)/(c+(c-1)*l);d=Math.max(d,0),zr(i,(function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,p-=i+l*i,c--}else{var i=d;t&&ti&&(i=n),i!==d&&(e.width=i,p-=i+l*i,c--)}})),d=(p-s)/(c+(c-1)*l),d=Math.max(d,0);var u,m=0;zr(i,(function(e,t){e.width||(e.width=d),u=e,m+=e.width*(1+l)})),u&&(m-=u.width*l);var h=-m/2;zr(i,(function(e,i){n[t][i]=n[t][i]||{bandWidth:a,offset:h,width:e.width},h+=e.width*(1+l)}))})),n}function IT(e,t){var n=CT(e,t),i=_T(n);zr(n,(function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),a=wT(e),r=i[ST(n)][a],o=r.offset,s=r.width;t.setLayout({bandWidth:r.bandWidth,offset:o,size:s})}))}function ET(e){return{seriesType:e,plan:Sw(),reset:function(e){if(MT(e)){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),r=t.getDimensionIndex(t.mapDimension(a.dim)),o=t.getDimensionIndex(t.mapDimension(i.dim)),s=e.get("showBackground",!0),l=t.mapDimension(a.dim),p=t.getCalculationInfo("stackResultDimension"),c=J_(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),d=a.isHorizontal(),u=function(e,t){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}(0,a),m=kT(e),h=e.get("barMinHeight")||0,g=p&&t.getDimensionIndex(p),f=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(e,t){for(var i,a=e.count,l=m&&xT(3*a),p=m&&s&&xT(3*a),v=m&&xT(a),x=n.master.getRect(),b=d?x.width:x.height,w=t.getStore(),S=0;null!=(i=e.next());){var C=w.get(c?g:r,i),_=w.get(o,i),T=u,I=void 0;c&&(I=+C-w.get(r,i));var E=void 0,M=void 0,k=void 0,P=void 0;if(d){var D=n.dataToPoint([C,_]);if(c)T=n.dataToPoint([I,_])[0];E=T,M=D[1]+y,k=D[0]-T,P=f,Math.abs(k)0)for(var s=0;s=0;--s)if(l[p]){r=l[p];break}r=r||o.none}if(Xr(r)){var c=null==e.level?0:e.level>=0?e.level:r.length+e.level;r=r[c=Math.min(c,r.length-1)]}}return jy(new Date(e.value),r,a,i)}(e,t,n,this.getSetting("locale"),i)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var i=this.getSetting("useUTC"),a=function(e,t,n,i){var a=1e4,r=qy,o=0;function s(e,t,n,a,r,o,s){for(var l=new Date(t),p=t,c=l[a]();p1&&0===p&&r.unshift({value:r[0].value-u})}}for(p=0;p=i[0]&&y<=i[1]&&d++)}var v=(i[1]-i[0])/t;if(d>1.5*v&&u>v/1.5)break;if(p.push(g),d>v||e===r[m])break}c=[]}}0;var x=Hr(Ur(p,(function(e){return Hr(e,(function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd}))})),(function(e){return e.length>0})),b=[],w=x.length-1;for(m=0;mn&&(this._approxInterval=n);var r=DT.length,o=Math.min(function(e,t,n,i){for(;n>>1;e[a][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function AT(e){return(e/=2592e6)>6?6:e>3?3:e>2?2:1}function FT(e){return(e/=Ay)>12?12:e>6?6:e>3.5?4:e>2?2:1}function RT(e,t){return(e/=t?Oy:Dy)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function BT(e){return od(e,!0)}function NT(e,t,n){var i=new Date(e);switch(zy(t)){case"year":case"month":i[tv(n)](0);case"day":i[nv(n)](1);case"hour":i[iv(n)](0);case"minute":i[av(n)](0);case"second":i[rv(n)](0),i[ov(n)](0)}return i.getTime()}nT.registerClass(PT);var LT=nT.prototype,VT=fT.prototype,qT=$c,GT=Math.floor,zT=Math.ceil,UT=Math.pow,jT=Math.log,HT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new fT,t._interval=0,t}return We(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return Ur(VT.getTicks.call(this,e),(function(e){var t=e.value,a=$c(UT(this.base,t));return a=t===n[0]&&this._fixMin?$T(a,i[0]):a,{value:a=t===n[1]&&this._fixMax?$T(a,i[1]):a}}),this)},t.prototype.setExtent=function(e,t){var n=jT(this.base);e=jT(Math.max(0,e))/n,t=jT(Math.max(0,t))/n,VT.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=LT.getExtent.call(this);t[0]=UT(e,t[0]),t[1]=UT(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=$T(t[0],n[0])),this._fixMax&&(t[1]=$T(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=jT(e[0])/jT(t),e[1]=jT(e[1])/jT(t),LT.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(!(n===1/0||n<=0)){var i=ad(n);for(e/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var a=[$c(zT(t[0]/i)*i),$c(GT(t[1]/i)*i)];this._interval=i,this._niceExtent=a}},t.prototype.calcNiceExtent=function(e){VT.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return dT(e=jT(e)/jT(this.base),this._extent)},t.prototype.normalize=function(e){return uT(e=jT(e)/jT(this.base),this._extent)},t.prototype.scale=function(e){return e=mT(e,this._extent),UT(this.base,e)},t.type="log",t}(nT),WT=HT.prototype;function $T(e,t){return qT(e,Yc(t))}WT.getMinorTicks=VT.getMinorTicks,WT.getLabel=VT.getLabel,nT.registerClass(HT);var KT=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]0&&s>0&&!l&&(o=0),o<0&&s<0&&!p&&(s=0));var d=this._determinedMin,u=this._determinedMax;return null!=d&&(o=d,l=!0),null!=u&&(s=u,p=!0),{min:o,max:s,minFixed:l,maxFixed:p,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[XT[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=YT[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),YT={min:"_determinedMin",max:"_determinedMax"},XT={min:"_dataMin",max:"_dataMax"};function ZT(e,t,n){var i=e.rawExtentInfo;return i||(i=new KT(e,t,n),e.rawExtentInfo=i,i)}function QT(e,t){return null==t?null:lo(t)?NaN:e.parse(t)}function JT(e,t){var n=e.type,i=ZT(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var a=i.min,r=i.max,o=t.ecModel;if(o&&"time"===n){var s=CT("bar",o),l=!1;if(zr(s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var p=_T(s),c=function(e,t,n,i){var a=n.axis.getExtent(),r=a[1]-a[0],o=function(e,t,n){if(e&&t){var i=e[ST(t)];return null!=i&&null!=n?i[wT(n)]:i}}(i,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;zr(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;zr(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var p=s+l,c=t-e,d=c/(1-(s+l)/r)-c;return t+=d*(l/p),e-=d*(s/p),{min:e,max:t}}(a,r,t,p);a=c.min,r=c.max}}return{extent:[a,r],fixMin:i.minFixed,fixMax:i.maxFixed}}function eI(e,t){var n=t,i=JT(e,n),a=i.extent,r=n.get("splitNumber");e instanceof HT&&(e.base=n.get("logBase"));var o=e.type,s=n.get("interval"),l="interval"===o||"time"===o;e.setExtent(a[0],a[1]),e.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function tI(e,t){if(t=t||e.get("type"))switch(t){case"category":return new hT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new PT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});case"value":return new fT({ticksGenerator:e.getTicksGenerator()});default:return new(nT.getClass(t)||fT)}}function nI(e){var t,n,i=e.getLabelModel().get("formatter"),a="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(n=i,function(t,i){return e.scale.getFormattedLabel(t,i,n)}):Qr(i)?function(t){return function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(i):Zr(i)?(t=i,function(n,i){return null!=a&&(i=n.value-a),t(iI(e,n),i,null!=n.level?{level:n.level}:null)}):function(t){return e.scale.getLabel(t)}}function iI(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function aI(e,t){var n=t*Math.PI/180,i=e.width,a=e.height,r=i*Math.abs(Math.cos(n))+Math.abs(a*Math.sin(n)),o=i*Math.abs(Math.sin(n))+Math.abs(a*Math.cos(n));return new Ns(e.x,e.y,r,o)}function rI(e){var t=e.get("interval");return null==t?"auto":t}function oI(e){return"category"===e.type&&0===rI(e.getLabelModel())}function sI(e,t){var n={};return zr(e.mapDimensionsAll(t),(function(t){n[eT(e,t)]=!0})),$r(n)}var lI=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}();var pI=[],cI={registerPreprocessor:d_,registerProcessor:u_,registerPostInit:function(e){m_("afterinit",e)},registerPostUpdate:function(e){m_("afterupdate",e)},registerUpdateLifecycle:m_,registerAction:h_,registerCoordinateSystem:function(e,t){hx.register(e,t)},registerLayout:function(e,t){y_(n_,e,t,1e3,"layout")},registerVisual:g_,registerTransform:x_,registerLoading:v_,registerMap:function(e,t,n){var i=fC("registerMap");i&&i(e,t,n)},registerImpl:function(e,t){gC[e]=t},PRIORITY:xC,ComponentModel:kv,ComponentView:ww,SeriesModel:mw,ChartView:Tw,registerComponentModel:function(e){kv.registerClass(e)},registerComponentView:function(e){ww.registerClass(e)},registerSeriesModel:function(e){mw.registerClass(e)},registerChartView:function(e){Tw.registerClass(e)},registerSubTypeDefaulter:function(e,t){kv.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Gc(e,t)}};function dI(e){Xr(e)?zr(e,(function(e){dI(e)})):Lr(pI,e)>=0||(pI.push(e),Zr(e)&&(e={install:e}),e.install(cI))}function uI(e,t){return Math.abs(e-t)<1e-8}function mI(e,t,n){var i=0,a=e[0];if(!a)return!1;for(var r=1;rn&&(e=a,n=o)}if(e)return function(e){for(var t=0,n=0,i=0,a=e.length,r=e[a-1][0],o=e[a-1][1],s=0;s>1^-(1&s),l=l>>1^-(1&l),a=s+=a,r=l+=r,i.push([s/n,l/n])}return i}function _I(e,t){return Ur(Hr((e=function(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;return null==n&&(n=1024),zr(t.features,(function(e){var t=e.geometry,i=t.encodeOffsets,a=t.coordinates;if(i)switch(t.type){case"LineString":t.coordinates=CI(a,i,n);break;case"Polygon":case"MultiLineString":SI(a,i,n);break;case"MultiPolygon":zr(a,(function(e,t){return SI(e,i[t],n)}))}})),t.UTF8Encoding=!1,t}(e)).features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,i=e.geometry,a=[];switch(i.type){case"Polygon":var r=i.coordinates;a.push(new vI(r[0],r.slice(1)));break;case"MultiPolygon":zr(i.coordinates,(function(e){e[0]&&a.push(new vI(e[0],e.slice(1)))}));break;case"LineString":a.push(new xI([i.coordinates]));break;case"MultiLineString":a.push(new xI(i.coordinates))}var o=new bI(n[t||"name"],a,n.cp);return o.properties=n,o}))}var TI=Pd();function II(e){return"category"===e.type?function(e){var t=e.getLabelModel(),n=MI(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(e):function(e){var t=e.scale.getTicks(),n=nI(e);return{labels:Ur(t,(function(t,i){return{level:t.level,formattedLabel:n(t,i),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}(e)}function EI(e,t){return"category"===e.type?function(e,t){var n,i,a=kI(e,"ticks"),r=rI(t),o=PI(a,r);if(o)return o;t.get("show")&&!e.scale.isBlank()||(n=[]);if(Zr(r))n=AI(e,r,!0);else if("auto"===r){var s=MI(e,e.getLabelModel());i=s.labelCategoryInterval,n=Ur(s.labels,(function(e){return e.tickValue}))}else n=OI(e,i=r,!0);return DI(a,r,{ticks:n,tickCategoryInterval:i})}(e,t):{ticks:Ur(e.scale.getTicks(),(function(e){return e.value}))}}function MI(e,t){var n,i,a=kI(e,"labels"),r=rI(t),o=PI(a,r);return o||(Zr(r)?n=AI(e,r):(i="auto"===r?function(e){var t=TI(e).autoInterval;return null!=t?t:TI(e).autoInterval=e.calculateCategoryInterval()}(e):r,n=OI(e,i)),DI(a,r,{labels:n,labelCategoryInterval:i}))}function kI(e,t){return TI(e)[t]||(TI(e)[t]=[])}function PI(e,t){for(var n=0;n1&&c/l>2&&(p=Math.round(Math.ceil(p/l)*l));var d=oI(e),u=o.get("showMinLabel")||d,m=o.get("showMaxLabel")||d;u&&p!==r[0]&&g(r[0]);for(var h=p;h<=r[1];h+=l)g(h);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:a.getLabel(t),tickValue:e})}return m&&h-l!==r[1]&&g(r[1]),s}function AI(e,t,n){var i=e.scale,a=nI(e),r=[];return zr(i.getTicks(),(function(e){var o=i.getLabel(e),s=e.value;t(e.value,o)&&r.push(n?s:{formattedLabel:a(e),rawLabel:o,tickValue:s})})),r}var FI=[0,1],RI=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return Zc(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&BI(n=n.slice(),i.count()),Hc(e,FI,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&BI(n=n.slice(),i.count());var a=Hc(e,n,FI,t);return this.scale.scale(a)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=Ur(EI(this,t).ticks,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this);return function(e,t,n,i){var a=t.length;if(!e.onBand||n||!a)return;var r,o,s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[1]};else{var l=t[a-1].tickValue-t[0].tickValue,p=(t[a-1].coord-t[0].coord)/l;zr(t,(function(e){e.coord-=p/2})),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+p*o},t.push(r)}var c=s[0]>s[1];d(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift());i&&d(s[0],t[0].coord)&&t.unshift({coord:s[0]});d(s[1],r.coord)&&(i?r.coord=s[1]:t.pop());i&&d(r.coord,s[1])&&t.push({coord:s[1]});function d(e,t){return e=$c(e),t=$c(t),c?e>t:e0&&e<100||(e=5),Ur(this.scale.getMinorTicks(e),(function(e){return Ur(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},e.prototype.getViewLabels=function(){return II(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){if("time"===this.type){var e=this.model,t=e.get("bandWidthCalculator"),n=void 0;if(Zr(t))try{if(n=t(e))return n}catch(e){}}var i=this._extent,a=this.scale.getExtent(),r=a[1]-a[0]+(this.onBand?1:0);0===r&&(r=1);var o=Math.abs(i[1]-i[0]);return Math.abs(o)/r},e.prototype.calculateCategoryInterval=function(){return function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),n=nI(e),i=(t.axisRotate-t.labelRotate)/180*Math.PI,a=e.scale,r=a.getExtent(),o=a.count();if(r[1]-r[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=r[0],p=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(p*Math.cos(i)),d=Math.abs(p*Math.sin(i)),u=0,m=0;l<=r[1];l+=s){var h,g,f=xc(n({value:l}),t.font,"center","top");h=1.3*f.width,g=1.3*f.height,u=Math.max(u,h,7),m=Math.max(m,g,7)}var y=u/c,v=m/d;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var x=Math.max(0,Math.floor(Math.min(y,v))),b=TI(e.model),w=e.getExtent(),S=b.lastAutoInterval,C=b.lastTickCount;return null!=S&&null!=C&&Math.abs(S-x)<=1&&Math.abs(C-o)<=1&&S>x&&b.axisExtent0===w[0]&&b.axisExtent1===w[1]?x=S:(b.lastTickCount=o,b.lastAutoInterval=x,b.axisExtent0=w[0],b.axisExtent1=w[1]),x}(this)},e}();function BI(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var NI=2*Math.PI,LI=nm.CMD,VI=["top","right","bottom","left"];function qI(e,t,n,i,a){var r=n.width,o=n.height;switch(e){case"top":i.set(n.x+r/2,n.y-t),a.set(0,-1);break;case"bottom":i.set(n.x+r/2,n.y+o+t),a.set(0,1);break;case"left":i.set(n.x-t,n.y+o/2),a.set(-1,0);break;case"right":i.set(n.x+r+t,n.y+o/2),a.set(1,0)}}function GI(e,t,n,i,a,r,o,s,l){o-=e,s-=t;var p=Math.sqrt(o*o+s*s),c=(o/=p)*n+e,d=(s/=p)*n+t;if(Math.abs(i-a)%NI<1e-4)return l[0]=c,l[1]=d,p-n;if(r){var u=i;i=sm(a),a=sm(u)}else i=sm(i),a=sm(a);i>a&&(a+=NI);var m=Math.atan2(s,o);if(m<0&&(m+=NI),m>=i&&m<=a||m+NI>=i&&m+NI<=a)return l[0]=c,l[1]=d,p-n;var h=n*Math.cos(i)+e,g=n*Math.sin(i)+t,f=n*Math.cos(a)+e,y=n*Math.sin(a)+t,v=(h-o)*(h-o)+(g-s)*(g-s),x=(f-o)*(f-o)+(y-s)*(y-s);return v0){t=t/180*Math.PI,$I.fromArray(e[0]),KI.fromArray(e[1]),YI.fromArray(e[2]),Ms.sub(XI,$I,KI),Ms.sub(ZI,YI,KI);var n=XI.len(),i=ZI.len();if(!(n<.001||i<.001)){XI.scale(1/n),ZI.scale(1/i);var a=XI.dot(ZI);if(Math.cos(t)1&&Ms.copy(eE,YI),eE.toArray(e[1])}}}}function nE(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,$I.fromArray(e[0]),KI.fromArray(e[1]),YI.fromArray(e[2]),Ms.sub(XI,KI,$I),Ms.sub(ZI,YI,KI);var i=XI.len(),a=ZI.len();if(!(i<.001||a<.001))if(XI.scale(1/i),ZI.scale(1/a),XI.dot(t)=o)Ms.copy(eE,YI);else{eE.scaleAndAdd(ZI,r/Math.tan(Math.PI/2-s));var l=YI.x!==KI.x?(eE.x-KI.x)/(YI.x-KI.x):(eE.y-KI.y)/(YI.y-KI.y);if(isNaN(l))return;l<0?Ms.copy(eE,KI):l>1&&Ms.copy(eE,YI)}eE.toArray(e[1])}}}function iE(e,t,n,i){var a="normal"===n,r=a?e:e.ensureState(n);r.ignore=t;var o=i.get("smooth");o&&!0===o&&(o=.3),r.shape=r.shape||{},o>0&&(r.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();a?e.useStyle(s):r.style=s}function aE(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var a=Go(i[0],i[1]),r=Go(i[1],i[2]);if(!a||!r)return e.lineTo(i[1][0],i[1][1]),void e.lineTo(i[2][0],i[2][1]);var o=Math.min(a,r)*n,s=jo([],i[1],i[0],o/a),l=jo([],i[1],i[2],o/r),p=jo([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],p[0],p[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c0&&r&&S(-d/o,0,o);var f,y,v=e[0],x=e[o-1];return b(),f<0&&C(-f,.8),y<0&&C(y,.8),b(),w(f,y,1),w(y,f,-1),b(),f<0&&_(-f),y<0&&_(y),p}function b(){f=v.rect[t]-i,y=a-x.rect[t]-x.rect[n]}function w(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){S(i*n,0,o);var a=i+e;a<0&&C(-a*n,1)}else C(-e*n,1)}}function S(n,i,a){0!==n&&(p=!0);for(var r=i;r0)for(l=0;l0;l--){S(-(r[l-1]*d),l,o)}}}function _(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),i=0;i0?S(n,0,i+1):S(-n,o-i-1,o),(e-=n)<=0)return}}function pE(e,t,n,i){return lE(e,"y","height",t,n,i)}function cE(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new Ns(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var a=0;a=0&&n.attr(m.oldLayoutSelect),Lr(p,"emphasis")>=0&&n.attr(m.oldLayoutEmphasis)),pf(n,s,t,o)}else if(n.attr(s),!ay(n).valueAnimation){var c=co(n.style.opacity,1);n.style.opacity=0,cf(n,{style:{opacity:c}},t,o)}if(m.oldLayout=s,n.states.select){var d=m.oldLayoutSelect={};yE(d,s,vE),yE(d,n.states.select,vE)}if(n.states.emphasis){var u=m.oldLayoutEmphasis={};yE(u,s,vE),yE(u,n.states.emphasis,vE)}oy(n,o,l,t,t)}if(i&&!i.ignore&&!i.invisible){a=(m=fE(i)).oldLayout;var m,h={points:i.shape.points};a?(i.attr({shape:a}),pf(i,{shape:h},t)):(i.setShape(h),i.style.strokePercent=0,cf(i,{style:{strokePercent:1}},t)),m.oldLayout=h}},e}(),bE=Pd();function wE(e){e.registerUpdateLifecycle("series:beforeupdate",(function(e,t,n){var i=bE(t).labelManager;i||(i=bE(t).labelManager=new xE),i.clearLabels()})),e.registerUpdateLifecycle("series:layoutlabels",(function(e,t,n){var i=bE(t).labelManager;n.updatedSeries.forEach((function(e){i.addLabelsOfSeries(t.getViewOfSeriesModel(e))})),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()}))}dI(wE);var SE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return We(t,e),t.prototype.getInitialData=function(e){return tT(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Rc,n=NS("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var i=this.getData().getVisual("symbol"),a=this.getData().getVisual("symbolRotate"),r="none"===i?"circle":i,o=.8*e.itemHeight,s=NS(r,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);t.add(s),s.setStyle(e.itemStyle);var l="inherit"===e.iconRotate?a:e.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),r.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(mw);function CE(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var a=cb(e,t,n[0]);return null!=a?a+"":null}if(i){for(var r=[],o=0;o=0&&i.push(t[r])}return i.join(" ")}var TE=function(e){function t(t,n,i,a){var r=e.call(this)||this;return r.updateData(t,n,i,a),r}return We(t,e),t.prototype._createSymbol=function(e,t,n,i,a){this.removeAll();var r=NS(e,-1,-1,2,2,null,a);r.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),r.drift=IE,this._symbolType=e,this.add(r)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Th(this.childAt(0))},t.prototype.downplay=function(){Ih(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,i,a){this.silent=!1;var r=e.getItemVisual(n,"symbol")||"circle",o=e.hostModel,s=t.getSymbolSize(e,n),l=r!==this._symbolType,p=a&&a.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(r,e,n,s,c)}else{(u=this.childAt(0)).silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};p?u.attr(d):pf(u,d,o,n),gf(u)}if(this._updateCommon(e,n,s,i,a),l){var u=this.childAt(0);if(!p){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:u.style.opacity}};u.scaleX=u.scaleY=0,u.style.opacity=0,cf(u,d,o,n)}}p&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,i,a){var r,o,s,l,p,c,d,u,m,h=this.childAt(0),g=e.hostModel;if(i&&(r=i.emphasisItemStyle,o=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,p=i.blurScope,d=i.labelStatesModels,u=i.hoverScale,m=i.cursorStyle,c=i.emphasisDisabled),!i||e.hasItemOption){var f=i&&i.itemModel?i.itemModel:e.getItemModel(t),y=f.getModel("emphasis");r=y.getModel("itemStyle").getItemStyle(),s=f.getModel(["select","itemStyle"]).getItemStyle(),o=f.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),p=y.get("blurScope"),c=y.get("disabled"),d=Xf(f),u=y.getShallow("scale"),m=f.getShallow("cursor")}var v=e.getItemVisual(t,"symbolRotate");h.attr("rotation",(v||0)*Math.PI/180||0);var x=VS(e.getItemVisual(t,"symbolOffset"),n);x&&(h.x=x[0],h.y=x[1]),m&&h.attr("cursor",m);var b=e.getItemVisual(t,"style"),w=b.fill;if(h instanceof Em){var S=h.style;h.useStyle(Br({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else h.__isEmptyBrush?h.useStyle(Br({},b)):h.useStyle(b),h.style.decal=null,h.setColor(w,a&&a.symbolInnerColor),h.style.strokeNoScale=!0;var C=e.getItemVisual(t,"liftZ"),_=this._z2;null!=C?null==_&&(this._z2=h.z2,h.z2+=C):null!=_&&(h.z2=_,this._z2=null);var T=a&&a.useNameLabel;Yf(h,d,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return T?e.getName(t):CE(e,t)},inheritColor:w,defaultOpacity:b.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=h.ensureState("emphasis");I.style=r,h.ensureState("select").style=s,h.ensureState("blur").style=o;var E=null==u||!0===u?Math.max(1.1,3/this._sizeY):isFinite(u)&&u>0?+u:1;I.scaleX=this._sizeX*E,I.scaleY=this._sizeY*E,this.setSymbolScale(1),Vh(this,l,p,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var i=this.childAt(0),a=Xm(this).dataIndex,r=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var o=i.getTextContent();o&&uf(o,{style:{opacity:0}},t,{dataIndex:a,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();uf(i,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:a,cb:e,removeOpt:r})},t.getSymbolSize=function(e,t){return LS(e.getItemVisual(t,"symbolSize"))},t}(Rc);function IE(e,t){this.parent.drift(e,t)}function EE(e,t,n,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function ME(e){return null==e||to(e)||(e={isIgnore:e}),e||{}}function kE(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Xf(t),cursorStyle:t.get("cursor")}}var PE=function(){function e(e){this.group=new Rc,this._SymbolCtor=e||TE}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=ME(t);var n=this.group,i=e.hostModel,a=this._data,r=this._SymbolCtor,o=t.disableAnimation,s=kE(e),l={disableAnimation:o},p=t.getSymbolPoint||function(t){return e.getItemLayout(t)};a||n.removeAll(),e.diff(a).add((function(i){var a=p(i);if(EE(e,a,i,t)){var o=new r(e,i,s,l);o.setPosition(a),e.setItemGraphicEl(i,o),n.add(o)}})).update((function(c,d){var u=a.getItemGraphicEl(d),m=p(c);if(EE(e,m,c,t)){var h=e.getItemVisual(c,"symbol")||"circle",g=u&&u.getSymbolType&&u.getSymbolType();if(!u||g&&g!==h)n.remove(u),(u=new r(e,c,s,l)).setPosition(m);else{u.updateData(e,c,s,l);var f={x:m[0],y:m[1]};o?u.attr(f):pf(u,f,i)}n.add(u),e.setItemGraphicEl(c,u)}else n.remove(u)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&t.fadeOut((function(){n.remove(t)}),i)})).execute(),this._getSymbolPoint=p,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl((function(t,n){var i=e._getSymbolPoint(n);t.setPosition(i),t.markRedraw()}))},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=kE(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function i(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=ME(n);for(var a=e.start;a0?n=i[0]:i[1]<0&&(n=i[1]);return n}(a,n),o=i.dim,s=a.dim,l=t.mapDimension(s),p=t.mapDimension(o),c="x"===s||"radius"===s?1:0,d=Ur(e.dimensions,(function(e){return t.mapDimension(e)})),u=!1,m=t.getCalculationInfo("stackResultDimension");return J_(t,d[0])&&(u=!0,d[0]=m),J_(t,d[1])&&(u=!0,d[1]=m),{dataDimsForPoint:d,valueStart:r,valueAxisDim:s,baseAxisDim:o,stacked:!!u,valueDim:l,baseDim:p,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function OE(e,t,n,i){var a=NaN;e.stacked&&(a=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(a)&&(a=e.valueStart);var r=e.baseDataOffset,o=[];return o[r]=n.get(e.baseDim,i),o[1-r]=a,t.dataToPoint(o)}var AE=Math.min,FE=Math.max;function RE(e,t){return isNaN(e)||isNaN(t)}function BE(e,t,n,i,a,r,o,s,l){for(var p,c,d,u,m,h,g=n,f=0;f=a||g<0)break;if(RE(y,v)){if(l){g+=r;continue}break}if(g===n)e[r>0?"moveTo":"lineTo"](y,v),d=y,u=v;else{var x=y-p,b=v-c;if(x*x+b*b<.5){g+=r;continue}if(o>0){for(var w=g+r,S=t[2*w],C=t[2*w+1];S===y&&C===v&&f=i||RE(S,C))m=y,h=v;else{I=S-p,E=C-c;var P=y-p,D=S-y,O=v-c,A=C-v,F=void 0,R=void 0;if("x"===s){var B=I>0?1:-1;m=y-B*(F=Math.abs(P))*o,h=v,M=y+B*(R=Math.abs(D))*o,k=v}else if("y"===s){var N=E>0?1:-1;m=y,h=v-N*(F=Math.abs(O))*o,M=y,k=v+N*(R=Math.abs(A))*o}else F=Math.sqrt(P*P+O*O),m=y-I*o*(1-(T=(R=Math.sqrt(D*D+A*A))/(R+F))),h=v-E*o*(1-T),k=v+E*o*T,M=AE(M=y+I*o*T,FE(S,y)),k=AE(k,FE(C,v)),M=FE(M,AE(S,y)),h=v-(E=(k=FE(k,AE(C,v)))-v)*F/R,m=AE(m=y-(I=M-y)*F/R,FE(p,y)),h=AE(h,FE(c,v)),M=y+(I=y-(m=FE(m,AE(p,y))))*R/F,k=v+(E=v-(h=FE(h,AE(c,v))))*R/F}e.bezierCurveTo(d,u,m,h,y,v),d=M,u=k}else e.lineTo(y,v)}p=y,c=v,g+=r}return f}var NE=function(){this.smooth=0,this.smoothConstraint=!0},LE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return We(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new NE},t.prototype.buildPath=function(e,t){var n=t.points,i=0,a=n.length/2;if(t.connectNulls){for(;a>0&&RE(n[2*a-2],n[2*a-1]);a--);for(;i=0){var f=o?(c-i)*g+i:(p-n)*g+n;return o?[e,f]:[f,e]}n=p,i=c;break;case r.C:p=a[l++],c=a[l++],d=a[l++],u=a[l++],m=a[l++],h=a[l++];var y=o?xl(n,p,d,m,e,s):xl(i,c,u,h,e,s);if(y>0)for(var v=0;v=0){f=o?yl(i,c,u,h,x):yl(n,p,d,m,x);return o?[e,f]:[f,e]}}n=m,i=h}}},t}(Sm),VE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t}(NE),qE=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return We(t,e),t.prototype.getDefaultShape=function(){return new VE},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,a=0,r=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;r>0&&RE(n[2*r-2],n[2*r-1]);r--);for(;a=0;o--){var s=e.getDimensionInfo(i[o].dimension);if("x"===(a=s&&s.coordDim)||"y"===a){r=i[o];break}}if(r){var l=t.getAxis(a),p=Ur(r.stops,(function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}})),c=p.length,d=r.outerColors.slice();c&&p[0].coord>p[c-1].coord&&(p.reverse(),d.reverse());var u=function(e,t){var n,i,a=[],r=e.length;function o(e,t,n){var i=e.coord;return{coord:n,color:Ql((n-i)/(t.coord-i),[e.color,t.color])}}for(var s=0;st){i?a.push(o(i,l,t)):n&&a.push(o(n,l,0),o(n,l,t));break}n&&(a.push(o(n,l,0)),n=null),a.push(l),i=l}}return a}(p,"x"===a?n.getWidth():n.getHeight()),m=u.length;if(!m&&c)return p[0].coord<0?d[1]?d[1]:p[c-1].color:d[0]?d[0]:p[0].color;var h=u[0].coord-10,g=u[m-1].coord+10,f=g-h;if(f<.001)return"transparent";zr(u,(function(e){e.offset=(e.coord-h)/f})),u.push({offset:m?u[m-1].offset:.5,color:d[1]||"transparent"}),u.unshift({offset:m?u[0].offset:.5,color:d[0]||"transparent"});var y=new Xg(0,0,0,0,u,!0);return y[a]=h,y[a+"2"]=g,y}}}function ZE(e,t,n){var i=e.get("showAllSymbol"),a="auto"===i;if(!i||a){var r=n.getAxesByScale("ordinal")[0];if(r&&(!a||!function(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var a=t.count(),r=Math.max(1,Math.round(a/5)),o=0;oi)return!1;return!0}(r,t))){var o=t.mapDimension(r.dim),s={};return zr(r.getViewLabels(),(function(e){var t=r.scale.getRawOrdinalNumber(e.tickValue);s[t]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function QE(e,t){return[e[2*t],e[2*t+1]]}function JE(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&"bolder"===e.get(["emphasis","lineStyle","width"]))&&(m.getState("emphasis").style.lineWidth=+m.style.lineWidth+1);Xm(m).seriesIndex=e.seriesIndex,Vh(m,P,D,O);var A=KE(e.get("smooth")),F=e.get("smoothMonotone");if(m.setShape({smooth:A,smoothMonotone:F,connectNulls:S}),h){var R=o.getCalculationInfo("stackedOnSeries"),B=0;h.useStyle(Nr(l.getAreaStyle(),{fill:E,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),R&&(B=KE(R.get("smooth"))),h.setShape({smooth:A,stackedOnSmooth:B,smoothMonotone:F,connectNulls:S}),Uh(h,e,"areaStyle"),Xm(h).seriesIndex=e.seriesIndex,Vh(h,P,D,O)}var N=function(e){i._changePolyState(e)};o.eachItemGraphicEl((function(e){e&&(e.onHoverStateChange=N)})),this._polyline.onHoverStateChange=N,this._data=o,this._coordSys=a,this._stackedOnPoints=b,this._points=p,this._step=I,this._valueOrigin=v,e.get("triggerLineEvent")&&(this.packEventData(e,m),h&&this.packEventData(e,h))},t.prototype.packEventData=function(e,t){Xm(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,i){var a=e.getData(),r=kd(a,i);if(this._changePolyState("emphasis"),!(r instanceof Array)&&null!=r&&r>=0){var o=a.getLayout("points"),s=a.getItemGraphicEl(r);if(!s){var l=o[2*r],p=o[2*r+1];if(isNaN(l)||isNaN(p))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,p))return;var c=e.get("zlevel")||0,d=e.get("z")||0;(s=new TE(a,r)).x=l,s.y=p,s.setZ(c,d);var u=s.getSymbolPath().getTextContent();u&&(u.zlevel=c,u.z=d,u.z2=this._polyline.z2+1),s.__temp=!0,a.setItemGraphicEl(r,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else Tw.prototype.highlight.call(this,e,t,n,i)},t.prototype.downplay=function(e,t,n,i){var a=e.getData(),r=kd(a,i);if(this._changePolyState("normal"),null!=r&&r>=0){var o=a.getItemGraphicEl(r);o&&(o.__temp?(a.setItemGraphicEl(r,null),this.group.remove(o)):o.downplay())}else Tw.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;bh(this._polyline,e),t&&bh(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new LE({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new qE({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,a,r=t.getBaseAxis(),o=r.inverse;"cartesian2d"===t.type?(i=r.isHorizontal(),a=!1):"polar"===t.type&&(i="angle"===r.dim,a=!0);var s=e.hostModel,l=s.get("animationDuration");Zr(l)&&(l=l(null));var p=s.get("animationDelay")||0,c=Zr(p)?p(null):p;e.eachItemGraphicEl((function(e,r){var s=e;if(s){var d=[e.x,e.y],u=void 0,m=void 0,h=void 0;if(n)if(a){var g=n,f=t.pointToCoord(d);i?(u=g.startAngle,m=g.endAngle,h=-f[1]/180*Math.PI):(u=g.r0,m=g.r,h=f[0])}else{var y=n;i?(u=y.x,m=y.x+y.width,h=e.x):(u=y.y+y.height,m=y.y,h=e.y)}var v=m===u?0:(h-u)/(m-u);o&&(v=1-v);var x=Zr(p)?p(r):l*v+c,b=s.getSymbolPath(),w=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:x}),w&&w.animateFrom({style:{opacity:0}},{duration:300,delay:x}),b.disableLabelAnimation=!0}}))},t.prototype._initOrUpdateEndLabel=function(e,t,n){var i=e.getModel("endLabel");if(JE(e)){var a=e.getData(),r=this._polyline,o=a.getLayout("points");if(!o)return r.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Nm({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);var l=function(e){for(var t,n,i=e.length/2;i>0&&(t=e[2*i-2],n=e[2*i-1],isNaN(t)||isNaN(n));i--);return i-1}(o);l>=0&&(Yf(r,Xf(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:l,defaultText:function(e,t,n){return null!=n?_E(a,n):CE(a,e)},enableTextSetter:!0},function(e,t){var n=t.getBaseAxis(),i=n.isHorizontal(),a=n.inverse,r=i?a?"right":"left":"center",o=i?"middle":a?"top":"bottom";return{normal:{align:e.get("align")||r,verticalAlign:e.get("verticalAlign")||o}}}(i,t)),r.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,a,r,o){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var p=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),u=r.get("precision"),m=r.get("distance")||0,h=o.getBaseAxis(),g=h.isHorizontal(),f=h.inverse,y=t.shape,v=f?g?y.x:y.y+y.height:g?y.x+y.width:y.y,x=(g?m:0)*(f?-1:1),b=(g?0:-m)*(f?-1:1),w=g?"x":"y",S=function(e,t,n){for(var i,a,r=e.length/2,o="x"===n?0:1,s=0,l=-1,p=0;p=t||i>=t&&a<=t){l=p;break}s=p,i=a}else i=a;return{range:[s,l],t:(t-i)/(a-i)}}(p,v,w),C=S.range,_=C[1]-C[0],T=void 0;if(_>=1){if(_>1&&!d){var I=QE(p,C[0]);s.attr({x:I[0]+x,y:I[1]+b}),a&&(T=c.getRawValue(C[0]))}else{(I=l.getPointOn(v,w))&&s.attr({x:I[0]+x,y:I[1]+b});var E=c.getRawValue(C[0]),M=c.getRawValue(C[1]);a&&(T=Vd(n,u,E,M,S.t))}i.lastFrameIndex=C[0]}else{var k=1===e||i.lastFrameIndex>0?C[0]:0;I=QE(p,k);a&&(T=c.getRawValue(k)),s.attr({x:I[0]+x,y:I[1]+b})}if(a){var P=ay(s);"function"==typeof P.setLabelText&&P.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,i,a,r,o){var s=this._polyline,l=this._polygon,p=e.hostModel,c=function(e,t,n,i,a,r,o){for(var s=function(e,t){var n=[];return t.diff(e).add((function(e){n.push({cmd:"+",idx:e})})).update((function(e,t){n.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){n.push({cmd:"-",idx:e})})).execute(),n}(e,t),l=[],p=[],c=[],d=[],u=[],m=[],h=[],g=DE(a,t,o),f=e.getLayout("points")||[],y=t.getLayout("points")||[],v=0;v3e3||l&&$E(u,h)>3e3)return s.stopAnimation(),s.setShape({points:m}),void(l&&(l.stopAnimation(),l.setShape({points:m,stackedOnPoints:h})));s.shape.__points=c.current,s.shape.points=d;var g={shape:{points:m}};c.current!==d&&(g.shape.__points=c.next),s.stopAnimation(),pf(s,g,p),l&&(l.setShape({points:d,stackedOnPoints:u}),l.stopAnimation(),pf(l,{shape:{stackedOnPoints:h}},p),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var f=[],y=c.status,v=0;vt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;nt&&(t=r,n=a)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},aM=function(e){return Math.round(e.length/2)};function rM(e){return{seriesType:e,reset:function(e,t,n){var i=e.getData(),a=e.get("sampling"),r=e.coordinateSystem,o=i.count();if(o>10&&"cartesian2d"===r.type&&a){var s=r.getBaseAxis(),l=r.getOtherAxis(s),p=s.getExtent(),c=n.getDevicePixelRatio(),d=Math.abs(p[1]-p[0])*(c||1),u=Math.round(o/d);if(isFinite(u)&&u>1){"lttb"===a&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/u));var m=void 0;Qr(a)?m=iM[a]:Zr(a)&&(m=a),m&&e.setData(i.downSample(i.mapDimension(l.dim),1/u,m,aM))}}}}}function oM(e){e.registerChartView(tM),e.registerSeriesModel(SE),e.registerLayout(nM("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,rM("line"))}var sM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.getInitialData=function(e,t){return tT(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var i=this.coordinateSystem;if(i&&i.clampData){var a=i.clampData(e),r=i.dataToPoint(a);if(n)zr(i.getAxes(),(function(e,n){if("category"===e.type&&null!=t){var i=e.getTicksCoords(),o=e.getTickModel().get("alignWithLabel"),s=a[n],l="x1"===t[n]||"y1"===t[n];if(l&&!o&&(s+=1),i.length<2)return;if(2===i.length)return void(r[n]=e.toGlobalCoord(e.getExtent()[l?1:0]));for(var p=void 0,c=void 0,d=1,u=0;us){c=(m+p)/2;break}1===u&&(d=h-i[0].tickValue)}null==c&&(p?p&&(c=i[i.length-1].coord):c=i[0].coord),r[n]=e.toGlobalCoord(c)}}));else{var o=this.getData(),s=o.getLayout("offset"),l=o.getLayout("size"),p=i.getBaseAxis().isHorizontal()?0:1;r[p]+=s+l/2}return r}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(mw);mw.registerClass(sM);var lM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.getInitialData=function(){return tT(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Sy(sM.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(sM),pM=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},cM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return We(t,e),t.prototype.getDefaultShape=function(){return new pM},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=.5*(r-a),s=a+o,l=t.startAngle,p=t.endAngle,c=t.clockwise,d=2*Math.PI,u=c?p-lr)return!0;r=p}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,i=n.getExtent(),a=Math.max(0,i[0]),r=Math.min(i[1],n.getOrdinalMeta().categories.length-1);a<=r;++a)if(e.ordinalNumbers[a]!==n.getRawOrdinalNumber(a))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,i){if(this._isOrderChangedWithinSameData(e,t,n)){var a=this._dataSort(e,n,t);this._isOrderDifferentInView(a,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:a}))}},t.prototype._dispatchInitSort=function(e,t,n){var i=t.baseAxis,a=this._dataSort(e,i,(function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:a})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(t){hf(t,e,Xm(t).dataIndex)}))):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(Tw),yM={cartesian2d:function(e,t){var n=t.width<0?-1:1,i=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var a=e.x+e.width,r=e.y+e.height,o=hM(t.x,e.x),s=gM(t.x+t.width,a),l=hM(t.y,e.y),p=gM(t.y+t.height,r),c=sa?s:o,t.y=d&&l>r?p:l,t.width=c?0:s-o,t.height=d?0:p-l,n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),c||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}var a=gM(t.r,e.r),r=hM(t.r0,e.r0);t.r=a,t.r0=r;var o=a-r<0;if(n<0){i=t.r;t.r=t.r0,t.r0=i}return o}},vM={cartesian2d:function(e,t,n,i,a,r,o,s,l){var p=new Fm({shape:Br({},i),z2:1});(p.__dataIndex=n,p.name="item",r)&&(p.shape[a?"height":"width"]=0);return p},polar:function(e,t,n,i,a,r,o,s,l){var p=!a&&l?cM:Dg,c=new p({shape:i,z2:1});c.name="item";var d,u,m=TM(a);if(c.calculateTextPosition=(d=m,u=({isRoundCap:p===cM}||{}).isRoundCap,function(e,t,n){var i=t.position;if(!i||i instanceof Array)return _c(e,t,n);var a=d(i),r=null!=t.distance?t.distance:5,o=this.shape,s=o.cx,l=o.cy,p=o.r,c=o.r0,m=(p+c)/2,h=o.startAngle,g=o.endAngle,f=(h+g)/2,y=u?Math.abs(p-c)/2:0,v=Math.cos,x=Math.sin,b=s+p*v(h),w=l+p*x(h),S="left",C="top";switch(a){case"startArc":b=s+(c-r)*v(f),w=l+(c-r)*x(f),S="center",C="top";break;case"insideStartArc":b=s+(c+r)*v(f),w=l+(c+r)*x(f),S="center",C="bottom";break;case"startAngle":b=s+m*v(h)+dM(h,r+y,!1),w=l+m*x(h)+uM(h,r+y,!1),S="right",C="middle";break;case"insideStartAngle":b=s+m*v(h)+dM(h,-r+y,!1),w=l+m*x(h)+uM(h,-r+y,!1),S="left",C="middle";break;case"middle":b=s+m*v(f),w=l+m*x(f),S="center",C="middle";break;case"endArc":b=s+(p+r)*v(f),w=l+(p+r)*x(f),S="center",C="bottom";break;case"insideEndArc":b=s+(p-r)*v(f),w=l+(p-r)*x(f),S="center",C="top";break;case"endAngle":b=s+m*v(g)+dM(g,r+y,!0),w=l+m*x(g)+uM(g,r+y,!0),S="left",C="middle";break;case"insideEndAngle":b=s+m*v(g)+dM(g,-r+y,!0),w=l+m*x(g)+uM(g,-r+y,!0),S="right",C="middle";break;default:return _c(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=C,e}),r){var h=a?"r":"endAngle",g={};c.shape[h]=a?i.r0:i.startAngle,g[h]=i[h],(s?pf:cf)(c,{shape:g},r)}return c}};function xM(e,t,n,i,a,r,o,s){var l,p;r?(p={x:i.x,width:i.width},l={y:i.y,height:i.height}):(p={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?pf:cf)(n,{shape:l},t,a,null),(o?pf:cf)(n,{shape:p},t?e.baseAxis.model:null,a)}function bM(e,t){for(var n=0;n0?1:-1,o=i.height>0?1:-1;return{x:i.x+r*a/2,y:i.y+o*a/2,width:i.width-r*a,height:i.height-o*a}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function TM(e){return function(e){var t=e?"Arc":"Angle";return function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}(e)}function IM(e,t,n,i,a,r,o,s){var l=t.getItemVisual(n,"style");if(s){if(!r.get("roundCap")){var p=e.shape;Br(p,mM(i.getModel("itemStyle"),p,!0)),e.setShape(p)}}else{var c=i.get(["itemStyle","borderRadius"])||0;e.setShape("r",c)}e.useStyle(l);var d=i.getShallow("cursor");d&&e.attr("cursor",d);var u=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",m=Xf(i);Yf(e,m,{labelFetcher:r,labelDataIndex:n,defaultText:CE(r.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:u});var h=e.getTextContent();if(s&&h){var g=i.get(["label","position"]);e.textConfig.inside="middle"===g||null,function(e,t,n,i){if(eo(i))e.setTextConfig({rotation:i});else if(Xr(t))e.setTextConfig({rotation:0});else{var a,r=e.shape,o=r.clockwise?r.startAngle:r.endAngle,s=r.clockwise?r.endAngle:r.startAngle,l=(o+s)/2,p=n(t);switch(p){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":a=l;break;case"startAngle":case"insideStartAngle":a=o;break;case"endAngle":case"insideEndAngle":a=s;break;default:return void e.setTextConfig({rotation:0})}var c=1.5*Math.PI-a;"middle"===p&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),e.setTextConfig({rotation:c})}}(e,"outside"===g?u:g,TM(o),i.get(["label","rotate"]))}ry(h,m,r.getRawValue(n),(function(e){return _E(t,e)}));var f=i.getModel(["emphasis"]);Vh(e,f.get("focus"),f.get("blurScope"),f.get("disabled")),Uh(e,i),function(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}(a)&&(e.style.fill="none",e.style.stroke="none",zr(e.states,(function(e){e.style&&(e.style.fill=e.style.stroke="none")})))}var EM=function(){},MM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return We(t,e),t.prototype.getDefaultShape=function(){return new EM},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.baseDimIdx,a=1-this.baseDimIdx,r=[],o=[],s=this.barWidth,l=0;l=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return o[c]}return-1}(this,e.offsetX,e.offsetY);Xm(this).dataIndex=t>=0?t:null}),30,!1);function DM(e,t,n){if(jE(n,"cartesian2d")){var i=t,a=n.getArea();return{x:e?i.x:a.x,y:e?a.y:i.y,width:e?i.width:a.width,height:e?a.height:i.height}}var r=t;return{cx:(a=n.getArea()).cx,cy:a.cy,r0:e?a.r0:r.r0,r:e?a.r:r.r,startAngle:e?r.startAngle:0,endAngle:e?r.endAngle:2*Math.PI}}function OM(e){e.registerChartView(fM),e.registerSeriesModel(lM),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Yr(IT,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,ET("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,rM("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},(function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)}))}))}var AM=2*Math.PI,FM=Math.PI/180;function RM(e,t){return Sv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function BM(e,t){var n=RM(e,t),i=e.get("center"),a=e.get("radius");Xr(a)||(a=[0,a]);var r,o,s=Wc(n.width,t.getWidth()),l=Wc(n.height,t.getHeight()),p=Math.min(s,l),c=Wc(a[0],p/2),d=Wc(a[1],p/2),u=e.coordinateSystem;if(u){var m=u.dataToPoint(i);r=m[0]||0,o=m[1]||0}else Xr(i)||(i=[i,i]),r=Wc(i[0],s)+n.x,o=Wc(i[1],l)+n.y;return{cx:r,cy:o,r0:c,r:d}}function NM(e,t,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),i=t.mapDimension("value"),a=RM(e,n),r=BM(e,n),o=r.cx,s=r.cy,l=r.r,p=r.r0,c=-e.get("startAngle")*FM,d=e.get("endAngle"),u=e.get("padAngle")*FM;d="auto"===d?c-AM:-d*FM;var m=e.get("minAngle")*FM+u,h=0;t.each(i,(function(e){!isNaN(e)&&h++}));var g=t.getSum(i),f=Math.PI/(g||h)*2,y=e.get("clockwise"),v=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var w=y?1:-1,S=[c,d],C=w*u/2;tm(S,!y),c=S[0],d=S[1];var _=Math.abs(d-c),T=_,I=0,E=c;if(t.setLayout({viewRect:a,r:l}),t.each(i,(function(e,n){var i;if(isNaN(e))t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:y,cx:o,cy:s,r0:p,r:v?NaN:l});else{(i="area"!==v?0===g&&x?f:e*f:_/h)i?c=r=E+w*i/2:(r=E+C,c=a-C),t.setItemLayout(n,{angle:i,startAngle:r,endAngle:c,clockwise:y,cx:o,cy:s,r0:p,r:v?Hc(e,b,[p,l]):l}),E=a}})),Tn?o:r,c=Math.abs(l.label.y-n);if(c>=p.maxY){var d=l.label.x-t-l.len2*a,u=i+l.len,h=Math.abs(d)e.unconstrainedWidth?null:m:null;i.setStyle("width",h)}var g=i.getBoundingRect();r.width=g.width;var f=(i.style.margin||0)+2.1;r.height=g.height+f,r.y-=(r.height-d)/2}}}function zM(e){return"center"===e.position}function UM(e){var t,n,i=e.getData(),a=[],r=!1,o=(e.get("minShowLabelAngle")||0)*VM,s=i.getLayout("viewRect"),l=i.getLayout("r"),p=s.width,c=s.x,d=s.y,u=s.height;function m(e){e.ignore=!0}i.each((function(e){var s=i.getItemGraphicEl(e),d=s.shape,u=s.getTextContent(),h=s.getTextGuideLine(),g=i.getItemModel(e),f=g.getModel("label"),y=f.get("position")||g.get(["emphasis","label","position"]),v=f.get("distanceToLabelLine"),x=f.get("alignTo"),b=Wc(f.get("edgeDistance"),p),w=f.get("bleedMargin"),S=g.getModel("labelLine"),C=S.get("length");C=Wc(C,p);var _=S.get("length2");if(_=Wc(_,p),Math.abs(d.endAngle-d.startAngle)0?"right":"left":P>0?"left":"right"}var L=Math.PI,V=0,q=f.get("rotate");if(eo(q))V=q*(L/180);else if("center"===y)V=0;else if("radial"===q||!0===q){V=P<0?-k+L:-k}else if("tangential"===q&&"outside"!==y&&"outer"!==y){var G=Math.atan2(P,D);G<0&&(G=2*L+G),D>0&&(G=L+G),V=G-L}if(r=!!V,u.x=T,u.y=I,u.rotation=V,u.setStyle({verticalAlign:"middle"}),O){u.setStyle({align:M});var z=u.states.select;z&&(z.x+=u.x,z.y+=u.y)}else{var U=u.getBoundingRect().clone();U.applyTransform(u.getComputedTransform());var j=(u.style.margin||0)+2.1;U.y-=j/2,U.height+=j,a.push({label:u,labelLine:h,position:y,len:C,len2:_,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new Ms(P,D),linePoints:E,textAlign:M,labelDistance:v,labelAlignTo:x,edgeDistance:b,bleedMargin:w,rect:U,unconstrainedWidth:U.width,labelStyleWidth:u.style.width})}s.setTextConfig({inside:O})}})),!r&&e.get("avoidLabelOverlap")&&function(e,t,n,i,a,r,o,s){for(var l=[],p=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,u=0;u0){for(var l=r.getItemLayout(0),p=1;isNaN(l&&l.startAngle)&&p=n.r0}},t.type="pie",t}(Tw);function WM(e,t,n){t=Xr(t)&&{coordDimensions:t}||Br({encodeDefine:e.getEncode()},t);var i=e.getSource(),a=$_(i,t).dimensions,r=new W_(a,e);return r.initData(i,n),r}var $M=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),KM=Pd(),YM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new $M(Kr(this.getData,this),Kr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return WM(this,{coordDimensions:["value"],encodeDefaulter:Yr($v,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=KM(n),a=i.seats;if(!a){var r=[];n.each(n.mapDimension("value"),(function(e){r.push(e)})),a=i.seats=Qc(r,n.hostModel.get("percentPrecision"))}var o=e.prototype.getDataParams.call(this,t);return o.percent=a[t]||0,o.$vars.push("percent"),o},t.prototype._defaultLabelLine=function(e){xd(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(mw);function XM(e){e.registerChartView(HM),e.registerSeriesModel(YM),CS("pie",e.registerAction),e.registerLayout(Yr(NM,"pie")),e.registerProcessor(LM("pie")),e.registerProcessor(function(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf((function(e){var t=n.mapDimension("value"),i=n.get(t,e);return!(eo(i)&&!isNaN(i)&&i<0)}))}}}("pie"))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}We(t,e),t.prototype.getInitialData=function(e,t){return tT(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}}}(mw);var ZM=function(){},QM=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return We(t,e),t.prototype.getDefaultShape=function(){return new ZM},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,i=t.points,a=t.size,r=this.symbolProxy,o=r.shape,s=e.getContext?e.getContext():e,l=s&&a[0]<4,p=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n=0;s--){var l=2*s,p=i[l]-r/2,c=i[l+1]-o/2;if(e>=p&&t>=c&&e<=p+r&&t<=c+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return e=n[0],t=n[1],i.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,i=t.size,a=i[0],r=i[1],o=1/0,s=1/0,l=-1/0,p=-1/0,c=0;c=0&&(l.dataIndex=n+(e.startIndex||0))}))},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),ek=(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var a=nM("").reset(e,t,n);a.progress&&a.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new JM:new PE,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter"}(Tw),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(kv)),tk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Fd).models[0]},t.type="cartesian2dAxis",t}(kv);qr(tk,lI);var nk={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},ik=Fr({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},nk),ak=Fr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},nk),rk={category:ik,value:ak,time:Fr({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},ak),log:Nr({logBase:10},ak)},ok={value:1,category:1,time:1,log:1};function sk(e,t,n,i){zr(ok,(function(a,r){var o=Fr(Fr({},rk[r],!0),i,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+r,n}return We(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=_v(this),i=n?Iv(e):{};Fr(e,t.getTheme().get(r+"Axis")),Fr(e,this.getDefaultOption()),e.type=lk(e),n&&Tv(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=aT.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.getTicksGenerator=function(){var e=this.option;if("value"===e.type)return e.ticksGenerator},n.type=t+"Axis."+r,n.defaultOption=o,n}(n);e.registerComponentModel(s)})),e.registerSubTypeDefaulter(t+"Axis",lk)}function lk(e){return e.type||(e.data?"category":"value")}var pk=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return Ur(this._dimList,(function(e){return this._axes[e]}),this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Hr(this.getAxes(),(function(t){return t.scale.type===e}))},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),ck=["x","y"];function dk(e){return"interval"===e.type||"time"===e.type}var uk=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=ck,t}return We(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(dk(e)&&dk(t)){var n=e.getExtent(),i=t.getExtent(),a=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),o=n[1]-n[0],s=i[1]-i[0];if(o&&s){var l=(r[0]-a[0])/o,p=(r[1]-a[1])/s,c=a[0]-n[0]*l,d=a[1]-i[0]*p,u=this._transform=[l,0,0,p,c,d];this._invTransform=Is([],u)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),i=this.dataToPoint(t),a=this.getArea(),r=new Ns(n[0],n[1],i[0]-n[0],i[1]-n[1]);return a.intersect(r)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],a=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=a&&isFinite(a))return Ho(n,e,this._transform);var r=this.getAxis("x"),o=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,t)),n[1]=o.toGlobalCoord(o.dataToCoord(a,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,a=n.getExtent(),r=i.getExtent(),o=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(a[0],a[1]),o),Math.max(a[0],a[1])),t[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return Ho(n,e,this._invTransform);var i=this.getAxis("x"),a=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(e[0]),t),n[1]=a.coordToData(a.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1])-e,a=Math.min(n[0],n[1])-e,r=Math.max(t[0],t[1])-i+e,o=Math.max(n[0],n[1])-a+e;return new Ns(i,a,r,o)},t}(pk),mk=function(e){function t(t,n,i,a,r){var o=e.call(this,t,n,i)||this;return o.index=0,o.type=a||"value",o.position=r||"bottom",o}return We(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(RI);function hk(e,t,n){n=n||{};var i=e.coordinateSystem,a=t.axis,r={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,p=a.dim,c=i.getRect(),d=[c.x,c.x+c.width,c.y,c.y+c.height],u={left:0,right:1,top:0,bottom:1,onZero:2},m=t.get("offset")||0,h="x"===p?[d[2]-m,d[3]+m]:[d[0]-m,d[1]+m];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));h[u.onZero]=Math.max(Math.min(g,h[1]),h[0])}r.position=["y"===p?h[u[l]]:d[0],"x"===p?h[u[l]]:d[3]],r.rotation=Math.PI/2*("x"===p?0:1);r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=o?h[u[s]]-h[u.onZero]:0,t.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),po(n.labelInside,t.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var f=t.get(["axisLabel","rotate"]);return r.labelRotate="top"===l?-f:f,r.z2=1,r}function gk(e){return"cartesian2d"===e.get("coordinateSystem")}function fk(e){var t={xAxisModel:null,yAxisModel:null};return zr(t,(function(n,i){var a=i.replace(/Model$/,""),r=e.getReferringComponents(a,Fd).models[0];t[i]=r})),t}var yk=Math.log;function vk(e,t,n){var i=fT.prototype,a=i.getTicks.call(n),r=i.getTicks.call(n,!0),o=a.length-1,s=i.getInterval.call(n),l=JT(e,t),p=l.extent,c=l.fixMin,d=l.fixMax;if("log"===e.type){var u=yk(e.base);p=[yk(p[0])/u,yk(p[1])/u]}e.setExtent(p[0],p[1]),e.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:d});var m=i.getExtent.call(e);c&&(p[0]=m[0]),d&&(p[1]=m[1]);var h=i.getInterval.call(e),g=p[0],f=p[1];if(c&&d)h=(f-g)/o;else if(c)for(f=p[0]+h*o;fp[0]&&isFinite(g)&&isFinite(p[0]);)h=lT(h),g=p[1]-h*o;else{e.getTicks().length-1>o&&(h=lT(h));var y=h*o;(g=$c((f=Math.ceil(p[1]/h)*h)-y))<0&&p[0]>=0?(g=0,f=$c(y)):f>0&&p[1]<=0&&(f=0,g=-$c(y))}var v=(a[0].value-r[0].value)/s,x=(a[o].value-r[o].value)/s;i.setExtent.call(e,g+h*v,f+h*x),i.setInterval.call(e,h),(v||x)&&i.setNiceExtent.call(e,g+h,f-h)}var xk=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=ck,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function i(e){var t,n=$r(e),i=n.length;if(i){for(var a=[],r=i-1;r>=0;r--){var o=(l=e[+n[r]]).model,s=l.scale;oT(s)&&o.get("alignTicks")&&null==o.get("interval")&&null==o.getTicksGenerator()?a.push(l):(eI(s,o),oT(s)&&!s.isBlank()&&(t=l))}if(a.length){for(;!t&&a.length;){var l;eI((l=a.pop()).scale,l.model),l.scale.isBlank()||(t=l)}a.length&&t&&zr(a,(function(e){vk(e.scale,e.model,t.scale)}))}}}this._updateScale(e,this.model),i(n.x),i(n.y);var a={};zr(n.x,(function(e){wk(n,"y",e,a)})),zr(n.y,(function(e){wk(n,"x",e,a)})),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),r=Sv(i,{width:t.getWidth(),height:t.getHeight()});this._rect=r;var o=this._axesList;function s(){zr(o,(function(e){var t=e.isHorizontal(),n=t?[0,r.width]:[0,r.height],i=e.inverse?1:0;e.setExtent(n[i],n[1-i]),function(e,t){var n=e.getExtent(),i=n[0]+n[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return i-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return i-e+t}}(e,t?r.x:r.y)}))}s(),a&&(zr(o,(function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var i,a,r=n.getExtent();a=n instanceof hT?n.count():(i=n.getTicks()).length;var o,s=e.getLabelModel(),l=nI(e),p=1;a>40&&(p=Math.ceil(a/40));for(var c=0;c0&&i>0||n<0&&i<0)}(e)}var Ck=Math.PI,_k=function(){function e(e,t){this.group=new Rc,this.opt=t,this.axisModel=e,Nr(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Rc({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!Tk[e]},e.prototype.add=function(e){Tk[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var i,a,r=ed(t-e);return td(r)?(a=n>0?"top":"bottom",i="center"):td(r-Ck)?(a=n>0?"bottom":"top",i="center"):(a="middle",i=r>0&&r0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),Tk={axisLine:function(e,t,n,i){var a=t.get(["axisLine","show"]);if("auto"===a&&e.handleAutoShown&&(a=e.handleAutoShown("axisLine")),a){var r=t.axis.getExtent(),o=i.transform,s=[r[0],0],l=[r[1],0],p=s[0]>l[0];o&&(Ho(s,s,o),Ho(l,l,o));var c=Br({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),d=new Gg({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});kf(d.shape,d.style.lineWidth),d.anid="line",n.add(d);var u=t.get(["axisLine","symbol"]);if(null!=u){var m=t.get(["axisLine","symbolSize"]);Qr(u)&&(u=[u,u]),(Qr(m)||eo(m))&&(m=[m,m]);var h=VS(t.get(["axisLine","symbolOffset"])||0,m),g=m[0],f=m[1];zr([{rotate:e.rotation+Math.PI/2,offset:h[0],r:0},{rotate:e.rotation-Math.PI/2,offset:h[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(t,i){if("none"!==u[i]&&null!=u[i]){var a=NS(u[i],-g/2,-f/2,g,f,c.stroke,!0),r=t.r+t.offset,o=p?l:s;a.attr({rotation:t.rotate,x:o[0]+r*Math.cos(e.rotation),y:o[1]-r*Math.sin(e.rotation),silent:!0,z2:11}),n.add(a)}}))}}},axisTickLabel:function(e,t,n,i){var a=function(e,t,n,i){var a=n.axis,r=n.getModel("axisTick"),o=r.get("show");"auto"===o&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick"));if(!o||a.scale.isBlank())return;for(var s=r.getModel("lineStyle"),l=i.tickDirection*r.get("length"),p=kk(a.getTicksCoords(),t.transform,l,Nr(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;cd[1]?-1:1,m=["start"===s?d[0]-u*c:"end"===s?d[1]+u*c:(d[0]+d[1])/2,Mk(s)?e.labelOffset+l*c:0],h=t.get("nameRotate");null!=h&&(h=h*Ck/180),Mk(s)?r=_k.innerTextLayout(e.rotation,null!=h?h:e.rotation,l):(r=function(e,t,n,i){var a,r,o=ed(n-e),s=i[0]>i[1],l="start"===t&&!s||"start"!==t&&s;td(o-Ck/2)?(r=l?"bottom":"top",a="center"):td(o-1.5*Ck)?(r=l?"top":"bottom",a="center"):(r="middle",a=o<1.5*Ck&&o>Ck/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:a,textVerticalAlign:r}}(e.rotation,s,h||0,d),null!=(o=e.axisNameAvailableWidth)&&(o=Math.abs(o/Math.sin(r.rotation)),!isFinite(o)&&(o=null)));var g=p.getFont(),f=t.get("nameTruncate",!0)||{},y=f.ellipsis,v=po(e.nameTruncateMaxWidth,f.maxWidth,o),x=new Nm({x:m[0],y:m[1],rotation:r.rotation,silent:_k.isLabelSilent(t),style:Zf(p,{text:a,font:g,overflow:"truncate",width:v,ellipsis:y,fill:p.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:p.get("align")||r.textAlign,verticalAlign:p.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(zf({el:x,componentModel:t,itemName:a}),x.__fullText=a,x.anid="name",t.get("triggerEvent")){var b=_k.makeAxisEventDataBase(t);b.targetType="axisName",b.name=a,Xm(x).eventData=b}i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};function Ik(e){e&&(e.ignore=!0)}function Ek(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var a=bs([]);return _s(a,a,-e.rotation),n.applyTransform(Ss([],a,e.getLocalTransform())),i.applyTransform(Ss([],a,t.getLocalTransform())),n.intersect(i)}}function Mk(e){return"middle"===e||"center"===e}function kk(e,t,n,i,a){for(var r=[],o=[],s=[],l=0;l=0||e===t}function Ok(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[Fk(e)]}function Ak(e){return!!e.get(["handle","show"])}function Fk(e){return e.type+"||"+e.id}var Rk={},Bk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.render=function(t,n,i,a){this.axisPointerClass&&function(e){var t=Ok(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,a=n.option,r=n.get("status"),o=n.get("value");null!=o&&(o=i.parse(o));var s=Ak(n);null==r&&(a.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var u=o;null!=d.color&&(u=Nr({color:d.color},o));var m=Fr(Ar(d),{boundaryGap:e,splitNumber:t,scale:n,axisLine:i,axisTick:a,axisLabel:r,name:d.text,showName:s,nameLocation:"end",nameGap:p,nameTextStyle:u,triggerEvent:c},!1);if(Qr(l)){var h=m.name;m.name=l.replace("{value}",null!=h?h:"")}else Zr(l)&&(m.name=l(m.name,m));var g=new xy(m,null,this.ecModel);return qr(g,lI.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Fr({lineStyle:{color:"#bbb"}},tP.axisLine),axisLabel:nP(tP.axisLabel,!1),axisTick:nP(tP.axisTick,!1),splitLine:nP(tP.splitLine,!0),splitArea:nP(tP.splitArea,!0),indicator:[]},t}(kv),aP=["axisLine","axisTickLabel","axisName"],rP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;zr(Ur(t.getIndicatorAxes(),(function(e){var n=e.model.get("showName")?e.name:"";return new _k(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(e){zr(aP,e.add,e),this.group.add(e.getGroup())}),this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(n.length){var i=e.get("shape"),a=e.getModel("splitLine"),r=e.getModel("splitArea"),o=a.getModel("lineStyle"),s=r.getModel("areaStyle"),l=a.get("show"),p=r.get("show"),c=o.get("color"),d=s.get("color"),u=Xr(c)?c:[c],m=Xr(d)?d:[d],h=[],g=[];if("circle"===i)for(var f=n[0].getTicksCoords(),y=t.cx,v=t.cy,x=0;x3?1.4:a>1?1.2:1.1;hP(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:r,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(i);hP(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){dP(this._zr,"globalPan")||hP(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})},t}(Xo);function hP(e,t,n,i,a){e.pointerChecker&&e.pointerChecker(i,a.originX,a.originY)&&(gs(i.event),gP(e,t,n,i,a))}function gP(e,t,n,i,a){a.isAvailableBehavior=Kr(fP,null,n,i),e.trigger(t,a)}function fP(e,t,n){var i=n[e];return!e||i&&(!Qr(i)||t.event[i+"Key"])}function yP(e,t,n){var i=e.target;i.x+=t,i.y+=n,i.dirty()}function vP(e,t,n,i){var a=e.target,r=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,r){var s=r.min||0,l=r.max||1/0;o=Math.max(Math.min(l,o),s)}var p=o/e.zoom;e.zoom=o,a.x-=(n-a.x)*(p-1),a.y-=(i-a.y)*(p-1),a.scaleX*=p,a.scaleY*=p,a.dirty()}var xP,bP={axisPointer:1,tooltip:1,brush:1};function wP(e,t,n){var i=t.getComponentByElement(e.topTarget),a=i&&i.coordinateSystem;return i&&i!==n&&!bP.hasOwnProperty(i.mainType)&&a&&a.model!==n}function SP(e){Qr(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));var t=e;for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}var CP={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},_P=$r(CP),TP={"alignment-baseline":"textBaseline","stop-color":"stopColor"},IP=$r(TP),EP=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t=t||{};var n=SP(e);this._defsUsePending=[];var i=new Rc;this._root=i;var a=[],r=n.getAttribute("viewBox")||"",o=parseFloat(n.getAttribute("width")||t.width),s=parseFloat(n.getAttribute("height")||t.height);isNaN(o)&&(o=null),isNaN(s)&&(s=null),AP(n,i,null,!0,!1);for(var l,p,c=n.firstChild;c;)this._parseNode(c,i,a,null,!1,!1),c=c.nextSibling;if(function(e,t){for(var n=0;n=4&&(l={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(l&&null!=o&&null!=s&&(p=zP(l,{x:0,y:0,width:o,height:s}),!t.ignoreViewBox)){var u=i;(i=new Rc).add(u),u.scaleX=u.scaleY=p.scale,u.x=p.x,u.y=p.y}return t.ignoreRootClip||null==o||null==s||i.setClipPath(new Fm({shape:{x:0,y:0,width:o,height:s}})),{root:i,width:o,height:s,viewBoxRect:l,viewBoxTransform:p,named:a}},e.prototype._parseNode=function(e,t,n,i,a,r){var o,s=e.nodeName.toLowerCase(),l=i;if("defs"===s&&(a=!0),"text"===s&&(r=!0),"defs"===s||"switch"===s)o=t;else{if(!a){var p=xP[s];if(p&&Eo(xP,s)){o=p.call(this,e,t);var c=e.getAttribute("name");if(c){var d={name:c,namedFrom:null,svgNodeTagLower:s,el:o};n.push(d),"g"===s&&(l=d)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:o});t.add(o)}}var u=MP[s];if(u&&Eo(MP,s)){var m=u.call(this,e),h=e.getAttribute("id");h&&(this._defs[h]=m)}}if(o&&o.isGroup)for(var g=e.firstChild;g;)1===g.nodeType?this._parseNode(g,o,n,l,a,r):3===g.nodeType&&r&&this._parseText(g,o),g=g.nextSibling},e.prototype._parseText=function(e,t){var n=new _m({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});DP(t,n),AP(e,n,this._defsUsePending,!1,!1),function(e,t){var n=t.__selfStyle;if(n){var i=n.textBaseline,a=i;i&&"auto"!==i?"baseline"===i?a="alphabetic":"before-edge"===i||"text-before-edge"===i?a="top":"after-edge"===i||"text-after-edge"===i?a="bottom":"central"!==i&&"mathematical"!==i||(a="middle"):a="alphabetic",e.style.textBaseline=a}var r=t.__inheritedStyle;if(r){var o=r.textAlign,s=o;o&&("middle"===o&&(s="center"),e.style.textAlign=s)}}(n,t);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var r=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=r;var o=n.getBoundingRect();return this._textX+=o.width,t.add(n),n},e.internalField=void(xP={g:function(e,t){var n=new Rc;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new Fm;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new hg;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new Gg;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new fg;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n,i=e.getAttribute("points");i&&(n=OP(i));var a=new Bg({shape:{points:n||[]},silent:!0});return DP(t,a),AP(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var n,i=e.getAttribute("points");i&&(n=OP(i));var a=new Lg({shape:{points:n||[]},silent:!0});return DP(t,a),AP(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var n=new Em;return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",r=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(r);var o=new Rc;return DP(t,o),AP(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",r=e.getAttribute("dy")||"0",o=new Rc;return DP(t,o),AP(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(r),o},path:function(e,t){var n=ug(e.getAttribute("d")||"");return DP(t,n),AP(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),e}(),MP={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),n=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),a=parseInt(e.getAttribute("y2")||"0",10),r=new Xg(t,n,i,a);return kP(e,r),PP(e,r),r},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),n=parseInt(e.getAttribute("cy")||"0",10),i=parseInt(e.getAttribute("r")||"0",10),a=new Zg(t,n,i);return kP(e,a),PP(e,a),a}};function kP(e,t){"userSpaceOnUse"===e.getAttribute("gradientUnits")&&(t.global=!0)}function PP(e,t){for(var n=e.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),a=void 0;a=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var r={};GP(n,r,r);var o=r.stopColor||n.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:a,color:o})}n=n.nextSibling}}function DP(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Nr(t.__inheritedStyle,e.__inheritedStyle))}function OP(e){for(var t=NP(e),n=[],i=0;i0;r-=2){var o=i[r],s=i[r-1],l=NP(o);switch(a=a||[1,0,0,1,0,0],s){case"translate":Cs(a,a,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Ts(a,a,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":_s(a,a,-parseFloat(l[0])*VP,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":Ss(a,[1,0,Math.tan(parseFloat(l[0])*VP),1,0,0],a);break;case"skewY":Ss(a,[1,Math.tan(parseFloat(l[0])*VP),0,1,0,0],a);break;case"matrix":a[0]=parseFloat(l[0]),a[1]=parseFloat(l[1]),a[2]=parseFloat(l[2]),a[3]=parseFloat(l[3]),a[4]=parseFloat(l[4]),a[5]=parseFloat(l[5])}}t.setLocalTransform(a)}}(e,t),GP(e,o,s),i||function(e,t,n){for(var i=0;i<_P.length;i++){var a=_P[i];null!=(r=e.getAttribute(a))&&(t[CP[a]]=r)}for(i=0;i0,h={api:n,geo:s,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:m,isGeo:r,transformInfoRaw:d};"geoJSON"===s.resourceType?this._buildGeoJSON(h):"geoSVG"===s.resourceType&&this._buildSVG(h),this._updateController(e,t,n),this._updateMapSelectHandler(e,l,n,i)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=Co(),n=Co(),i=this._regionsGroup,a=e.transformInfoRaw,r=e.mapOrGeoModel,o=e.data,s=e.geo.projection,l=s&&s.stream;function p(e,t){return t&&(e=t(e)),e&&[e[0]*a.scaleX+a.x,e[1]*a.scaleY+a.y]}function c(e){for(var t=[],n=!l&&s&&s.project,i=0;i=0)&&(u=a);var m=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Yf(t,Xf(i),{labelFetcher:u,labelDataIndex:d,defaultText:n},m);var h=t.getTextContent();if(h&&(rD(h).ignore=h.ignore,t.textConfig&&o)){var g=t.getBoundingRect().clone();t.textConfig.layoutRect=g,t.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function dD(e,t,n,i,a,r){e.data?e.data.setItemGraphicEl(r,t):Xm(t).eventData={componentType:"geo",componentIndex:a.componentIndex,geoIndex:a.componentIndex,name:n,region:i&&i.option||{}}}function uD(e,t,n,i,a){e.data||zf({el:t,componentModel:a,itemName:n,itemTooltipOption:i.get("tooltip")})}function mD(e,t,n,i,a){t.highDownSilentOnTouch=!!a.get("selectedMode");var r=i.getModel("emphasis"),o=r.get("focus");return Vh(t,o,r.get("blurScope"),r.get("disabled")),e.isGeo&&function(e,t,n){var i=Xm(e);i.componentMainType=t.mainType,i.componentIndex=t.componentIndex,i.componentHighDownName=n}(t,a,n),o}function hD(e,t,n){var i,a=[];function r(){i=[]}function o(){i.length&&(a.push(i),i=[])}var s=t({polygonStart:r,polygonEnd:o,lineStart:r,lineEnd:o,point:function(e,t){isFinite(e)&&isFinite(t)&&i.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),zr(e,(function(e){s.lineStart();for(var t=0;t-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"}}(mw);var gD=Ho,fD=function(e){function t(t){var n=e.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new mc,n._rawTransformable=new mc,n.name=t,n}return We(t,e),t.prototype.setBoundingRect=function(e,t,n,i){return this._rect=new Ns(e,t,n,i),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,i){this._transformTo(e,t,n,i),this._viewRect=new Ns(e,t,n,i)},t.prototype._transformTo=function(e,t,n,i){var a=this.getBoundingRect(),r=this._rawTransformable;r.transform=a.calculateTransform(new Ns(e,t,n,i));var o=r.parent;r.parent=null,r.decomposeTransform(),r.parent=o,this._updateTransform()},t.prototype.setCenter=function(e,t){e&&(this._center=[Wc(e[0],t.getWidth()),Wc(e[1],t.getHeight())],this._updateCenterAndZoom())},t.prototype.setZoom=function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),a=this.getZoom();i=Ho([],i,e),n=Ho([],n,e),t.originX=i[0],t.originY=i[1],t.x=n[0]-i[0],t.y=n[1]-i[1],t.scaleX=t.scaleY=a,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),ws(this.transform||(this.transform=[]),t.transform||[1,0,0,1,0,0]),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],Is(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new mc;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var i=t?this._rawTransform:this.transform;return n=n||[],i?gD(n,e,i):Do(n,e)},t.prototype.pointToData=function(e){var t=this.invTransform;return t?gD([],e,t):[e[0],e[1]]},t.prototype.convertToPixel=function(e,t,n){var i=yD(t);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var i=yD(t);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=["x","y"],t}(mc);function yD(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var vD={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},xD=["lng","lat"],bD=function(e){function t(t,n,i){var a=e.call(this,t)||this;a.dimensions=xD,a.type="geo",a._nameCoordMap=Co(),a.map=n;var r,o=i.projection,s=eD(n,i.nameMap,i.nameProperty),l=JP(n),p=(a.resourceType=l?l.type:null,a.regions=s.regions),c=vD[l.type];if(a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o,o)for(var d=0;d1?(m.width=u,m.height=u/x):(m.height=u,m.width=u*x),m.y=d[1]-m.height/2,m.x=d[0]-m.width/2;else{var w=e.getBoxLayoutParams();w.aspect=x,m=Sv(w,{width:y,height:v})}this.setViewRect(m.x,m.y,m.width,m.height),this.setCenter(e.get("center"),t),this.setZoom(e.get("zoom"))}qr(bD,fD);var CD=function(){function e(){this.dimensions=xD}return e.prototype.create=function(e,t){var n=[];function i(e){return{nameProperty:e.get("nameProperty"),aspectScale:e.get("aspectScale"),projection:e.get("projection")}}e.eachComponent("geo",(function(e,a){var r=e.get("map"),o=new bD(r+a,r,Br({nameMap:e.get("nameMap")},i(e)));o.zoomLimit=e.get("scaleLimit"),n.push(o),e.coordinateSystem=o,o.model=e,o.resize=SD,o.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=n[t]}}));var a={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();a[t]=a[t]||[],a[t].push(e)}})),zr(a,(function(e,a){var r=Ur(e,(function(e){return e.get("nameMap")})),o=new bD(a,a,Br({nameMap:Rr(r)},i(e[0])));o.zoomLimit=po.apply(null,Ur(e,(function(e){return e.get("scaleLimit")}))),n.push(o),o.resize=SD,o.resize(e[0],t),zr(e,(function(e){e.coordinateSystem=o,function(e,t){zr(t.get("geoCoord"),(function(t,n){e.addGeoCoord(n,t)}))}(o,e)}))})),n},e.prototype.getFilledRegions=function(e,t,n,i){for(var a=(e||[]).slice(),r=Co(),o=0;ov.x)||(b-=Math.PI);var C=w?"left":"right",_=s.getModel("label"),T=_.get("rotate"),I=T*(Math.PI/180),E=f.getTextContent();E&&(f.setTextConfig({position:_.get("position")||C,rotation:null==T?-b:I,origin:"center"}),E.setStyle("verticalAlign","middle"))}var M=s.get(["emphasis","focus"]),k="relative"===M?_o(o.getAncestorsIndices(),o.getDescendantIndices()):"ancestor"===M?o.getAncestorsIndices():"descendant"===M?o.getDescendantIndices():null;k&&(Xm(n).focus=k),function(e,t,n,i,a,r,o,s){var l=t.getModel(),p=e.get("edgeShape"),c=e.get("layout"),d=e.getOrient(),u=e.get(["lineStyle","curveness"]),m=e.get("edgeForkPosition"),h=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===p)t.parentNode&&t.parentNode!==n&&(g||(g=i.__edge=new Hg({shape:AD(c,d,u,a,a)})),pf(g,{shape:AD(c,d,u,r,o)},e));else if("polyline"===p)if("orthogonal"===c){if(t!==n&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var f=t.children,y=[],v=0;vt&&(t=i.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var i=n.getData().tree.root,a=e.targetNode;if(Qr(a)&&(a=i.getNodeById(a)),a&&i.contains(a))return{node:a};var r=e.targetNodeId;if(null!=r&&(a=i.getNodeById(r)))return{node:a}}}function WD(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function $D(e,t){return Lr(WD(e),t)>=0}function KD(e,t){for(var n=[];e;){var i=e.dataIndex;n.push({name:e.name,dataIndex:i,value:t.getRawValue(i)}),e=e.parentNode}return n.reverse(),n}!function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}We(t,e),t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=e.leaves||{},i=new xy(n,this,this.ecModel),a=jD.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=a.getNodeByDataIndex(t);return n&&n.children.length&&n.isExpand||(e.parentModel=i),e}))}));var r=0;a.eachNode("preorder",(function(e){e.depth>r&&(r=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:r;return a.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),a.data},t.prototype.getOrient=function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var i=this.getData().tree,a=i.root.children[0],r=i.getNodeByDataIndex(e),o=r.getValue(),s=r.name;r&&r!==a;)s=r.parentNode.name+"."+s,r=r.parentNode;return Zb("nameValue",{name:s,value:o,noValue:isNaN(o)||null==o})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=KD(i,this),n.collapsed=!i.isExpand,n},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500}}(mw);function YD(e){var t=e.getData().tree,n={};t.eachNode((function(t){for(var i=t;i&&i.depth>1;)i=i.parentNode;var a=ax(e.ecModel,i.name||i.dataIndex+"",n);t.setVisual("decal",a)}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}We(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};XD(n);var i=e.levels||[],a=this.designatedVisualItemStyle={},r=new xy({itemStyle:a},this,t);i=e.levels=function(e,t){var n,i,a=vd(t.get("color")),r=vd(t.get(["aria","decal","decals"]));if(!a)return;e=e||[],zr(e,(function(e){var t=new xy(e),a=t.get("color"),r=t.get("decal");(t.get(["itemStyle","color"])||a&&"none"!==a)&&(n=!0),(t.get(["itemStyle","decal"])||r&&"none"!==r)&&(i=!0)}));var o=e[0]||(e[0]={});n||(o.color=a.slice());!i&&r&&(o.decal=r.slice());return e}(i,t);var o=Ur(i||[],(function(e){return new xy(e,r,t)}),this),s=jD.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=s.getNodeByDataIndex(t),i=n?o[n.depth]:null;return e.parentModel=i||r,e}))}));return s.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),a=this.getRawValue(e);return Zb("nameValue",{name:i.getName(e),value:a})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=KD(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},Br(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=Co(),this._idIndexMapCount=0);var n=t.get(e);return null==n&&t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){YD(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]}}(mw);function XD(e){var t=0;zr(e.children,(function(e){XD(e);var n=e.value;Xr(n)&&(n=n[0]),t+=n}));var n=e.value;Xr(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Xr(e.value)?e.value[0]=n:e.value=n}var ZD=function(){function e(e){this.group=new Rc,e.add(this.group)}return e.prototype.render=function(e,t,n,i){var a=e.getModel("breadcrumb"),r=this.group;if(r.removeAll(),a.get("show")&&n){var o=a.getModel("itemStyle"),s=a.getModel("emphasis"),l=o.getModel("textStyle"),p=s.getModel(["itemStyle","textStyle"]),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,o,s,l,p,i),Cv(r,c.pos,c.box)}},e.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var a=Id(i.getModel().get("name"),""),r=n.getTextRect(a),o=Math.max(r.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:i,text:a,width:o})}},e.prototype._renderContent=function(e,t,n,i,a,r,o){for(var s,l,p,c,d,u,m,h,g,f=0,y=t.emptyItemWidth,v=e.get(["breadcrumb","height"]),x=(s=t.pos,l=t.box,c=l.width,d=l.height,u=Wc(s.left,c),m=Wc(s.top,d),h=Wc(s.right,c),g=Wc(s.bottom,d),(isNaN(u)||isNaN(parseFloat(s.left)))&&(u=0),(isNaN(h)||isNaN(parseFloat(s.right)))&&(h=c),(isNaN(m)||isNaN(parseFloat(s.top)))&&(m=0),(isNaN(g)||isNaN(parseFloat(s.bottom)))&&(g=d),p=pv(p||0),{width:Math.max(h-u-p[1]-p[3],0),height:Math.max(g-m-p[0]-p[2],0)}),b=t.totalWidth,w=t.renderList,S=i.getModel("itemStyle").getItemStyle(),C=w.length-1;C>=0;C--){var _=w[C],T=_.node,I=_.width,E=_.text;b>x.width&&(b-=I-y,I=y,E=null);var M=new Bg({shape:{points:QD(f,0,I,v,C===w.length-1,0===C)},style:Nr(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Nm({style:Zf(a,{text:E})}),textConfig:{position:"inside"},z2:1e5,onclick:Yr(o,T)});M.disableLabelAnimation=!0,M.getTextContent().ensureState("emphasis").style=Zf(r,{text:E}),M.ensureState("emphasis").style=S,Vh(M,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(M),JD(M,e,T),f+=I+8}},e.prototype.remove=function(){this.group.removeAll()},e}();function QD(e,t,n,i,a,r){var o=[[a?e:e-5,t],[e+n,t],[e+n,t+i],[a?e:e-5,t+i]];return!r&&o.splice(2,0,[e+n+5,t+i/2]),!a&&o.push([e,t+i/2]),o}function JD(e,t,n){Xm(e).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&KD(n,t)}}var eO=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,i,a){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:a}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){--t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var a=i.getLayout();if(!a)return;var r=new Ns(a.x,a.y,a.width,a.height),o=this.seriesModel.layoutInfo,s=[1,0,0,1,0,0];Cs(s,s,[-(t-=o.x),-(n-=o.y)]),Ts(s,s,[e.scale,e.scale]),Cs(s,s,[t,n]),r.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:r.x,y:r.y,width:r.width,height:r.height}})}},t.prototype._initEvents=function(e){var t=this;e.on("click",(function(e){if("ready"===t._state){var n=t.seriesModel.get("nodeClick",!0);if(n){var i=t.findTarget(e.offsetX,e.offsetY);if(i){var a=i.node;if(a.getLayout().isLeafRoot)t._rootToNode(i);else if("zoomToNode"===n)t._zoomToNode(i);else if("link"===n){var r=a.hostTree.data.getItemModel(a.dataIndex),o=r.get("link",!0),s=r.get("target",!0)||"blank";o&&fv(o,s)}}}}}),this)},t.prototype._renderBreadcrumb=function(e,t,n){var i=this;n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new ZD(this.group))).render(e,t,n.node,(function(t){"animating"!==i._state&&($D(e.getViewRoot(),t)?i._rootToNode({node:t}):i._zoomToNode({node:t}))}))},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var a=this._storage.background[i.getRawIndex()];if(a){var r=a.transformCoordToLocal(e,t),o=a.shape;if(!(o.x<=r[0]&&r[0]<=o.x+o.width&&o.y<=r[1]&&r[1]<=o.y+o.height))return!1;n={node:i,offsetX:r[0],offsetY:r[1]}}}),this),n},t.type="treemap"}(Tw);var lO=zr,pO=to,cO=-1,dO=function(){function e(t){var n=t.mappingMethod,i=t.type,a=this.option=Ar(t);this.type=i,this.mappingMethod=n,this._normalizeData=wO[n];var r=e.visualHandlers[i];this.applyVisual=r.applyVisual,this.getColorMapper=r.getColorMapper,this._normalizedToVisual=r._normalizedToVisual[n],"piecewise"===n?(uO(a),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,zr(t,(function(t,n){t.originIndex=n,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(a)):"category"===n?a.categories?function(e){var t=e.categories,n=e.categoryMap={},i=e.visual;if(lO(t,(function(e,t){n[e]=t})),!Xr(i)){var a=[];to(i)?lO(i,(function(e,t){var i=n[t];a[null!=i?i:cO]=e})):a[-1]=i,i=bO(e,a)}for(var r=t.length-1;r>=0;r--)null==i[r]&&(delete n[t[r]],t.pop())}(a):uO(a,!0):(go("linear"!==n||a.dataExtent),uO(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return Kr(this._normalizeData,this)},e.listVisualTypes=function(){return $r(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){to(e)?zr(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var a,r=Xr(t)?[]:to(t)?{}:(a=!0,null);return e.eachVisual(t,(function(e,t){var o=n.call(i,e,t);a?r=o:r[t]=o})),r},e.retrieveVisuals=function(t){var n,i={};return t&&lO(e.visualHandlers,(function(e,a){t.hasOwnProperty(a)&&(i[a]=t[a],n=!0)})),n?i:null},e.prepareVisualTypes=function(e){if(Xr(e))e=e.slice();else{if(!pO(e))return[];var t=[];lO(e,(function(e,n){t.push(n)})),e=t}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},e.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var i,a=1/0,r=0,o=t.length;ri&&(i=t);var r=i%2?i+2:i+3;a=[];for(var o=0;o0&&(v[0]=-v[0],v[1]=-v[1]);var b=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var w=-Math.atan2(y[1],y[0]);p[0].8?"left":c[0]<-.8?"right":"center",u=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*h+l[0],i.y=-c[1]*g+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",u=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=h*b+l[0],i.y=l[1]+S,d=y[0]<0?"right":"left",i.originX=-h*b,i.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+S,d="center",i.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-h*b+p[0],i.y=p[1]+S,d=y[0]>=0?"right":"left",i.originX=h*b,i.originY=-S}i.scaleX=i.scaleY=a,i.setStyle({verticalAlign:i.__verticalAlign||u,align:i.__align||d})}}}function C(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(Rc),YO=function(){function e(e){this.group=new Rc,this._LineCtor=e||KO}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var r=XO(e);e.diff(a).add((function(n){t._doAdd(e,n,r)})).update((function(n,i){t._doUpdate(a,e,i,n,r)})).remove((function(e){i.remove(a.getItemGraphicEl(e))})).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,n){t.updateLayout(e,n)}),this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=XO(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=e.start;i=0?i+=p:i-=p:h>=0?i-=p:i+=p}return i}function oA(e,t){var n=[],i=El,a=[[],[],[]],r=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),p=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[Oo(l[0]),Oo(l[1])],l[2]&&l.__original.push(Oo(l[2])));var d=l.__original;if(null!=l[2]){if(Do(a[0],d[0]),Do(a[1],d[2]),Do(a[2],d[1]),p&&"none"!==p){var u=OO(e.node1),m=rA(a,d[0],u*t);i(a[0][0],a[1][0],a[2][0],m,n),a[0][0]=n[3],a[1][0]=n[4],i(a[0][1],a[1][1],a[2][1],m,n),a[0][1]=n[3],a[1][1]=n[4]}if(c&&"none"!==c){u=OO(e.node2),m=rA(a,d[1],u*t);i(a[0][0],a[1][0],a[2][0],m,n),a[1][0]=n[1],a[2][0]=n[2],i(a[0][1],a[1][1],a[2][1],m,n),a[1][1]=n[1],a[2][1]=n[2]}Do(l[0],a[0]),Do(l[1],a[2]),Do(l[2],a[1])}else{if(Do(r[0],d[0]),Do(r[1],d[1]),Ro(o,r[1],r[0]),Vo(o,o),p&&"none"!==p){u=OO(e.node1);Fo(r[0],r[0],o,u*t)}if(c&&"none"!==c){u=OO(e.node2);Fo(r[1],r[1],o,-u*t)}Do(l[0],r[0]),Do(l[1],r[1])}}))}function sA(e){return"view"===e.type}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.init=function(e,t){var n=new PE,i=new YO,a=this.group;this._controller=new mP(t.getZr()),this._controllerHost={target:a},a.add(n.group),a.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},t.prototype.render=function(e,t,n){var i=this,a=e.coordinateSystem;this._model=e;var r=this._symbolDraw,o=this._lineDraw,s=this.group;if(sA(a)){var l={x:a.x,y:a.y,scaleX:a.scaleX,scaleY:a.scaleY};this._firstRender?s.attr(l):pf(s,l,e)}oA(e.getGraph(),DO(e));var p=e.getData();r.updateData(p);var c=e.getEdgeData();o.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var d=e.forceLayout,u=e.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,u);var m=e.get("layout");p.graph.eachNode((function(t){var n=t.dataIndex,a=t.getGraphicEl(),r=t.getModel();if(a){a.off("drag").off("dragend");var o=r.get("draggable");o&&a.on("drag",(function(r){switch(m){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,u),d.setFixed(n),p.setItemLayout(n,[a.x,a.y]);break;case"circular":p.setItemLayout(n,[a.x,a.y]),t.setLayout({fixed:!0},!0),RO(e,"symbolSize",t,[r.offsetX,r.offsetY]),i.updateLayout(e);break;default:p.setItemLayout(n,[a.x,a.y]),PO(e.getGraph(),e),i.updateLayout(e)}})).on("dragend",(function(){d&&d.setUnfixed(n)})),a.setDraggable(o,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&(Xm(a).focus=t.getAdjacentDataIndices())}})),p.graph.eachEdge((function(e){var t=e.getGraphicEl(),n=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===n&&(Xm(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var h="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),g=p.getLayout("cx"),f=p.getLayout("cy");p.graph.eachNode((function(e){NO(e,h,g,f)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;!function i(){e.step((function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(i,16):i())}))}()},t.prototype._updateController=function(e,t,n){var i=this,a=this._controller,r=this._controllerHost,o=this.group;a.setPointerChecker((function(t,i,a){var r=o.getBoundingRect();return r.applyTransform(o.transform),r.contain(i,a)&&!wP(t,n,e)})),sA(e.coordinateSystem)?(a.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),a.off("pan").off("zoom").on("pan",(function(t){yP(r,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){vP(r,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),i._updateNodeAndLinkScale(),oA(e.getGraph(),DO(e)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):a.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=DO(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(n)}))},t.prototype.updateLayout=function(e){oA(e.getGraph(),DO(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph"}(Tw);function lA(e){return"_EC_"+e}var pA=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var n=this._nodesMap;if(!n[lA(e)]){var i=new cA(e,t);return i.hostGraph=this,this.nodes.push(i),n[lA(e)]=i,i}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[lA(e)]},e.prototype.addEdge=function(e,t,n){var i=this._nodesMap,a=this._edgesMap;if(eo(e)&&(e=this.nodes[e]),eo(t)&&(t=this.nodes[t]),e instanceof cA||(e=i[lA(e)]),t instanceof cA||(t=i[lA(t)]),e&&t){var r=e.id+"-"+t.id,o=new dA(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),a[r]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof cA&&(e=e.id),t instanceof cA&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(t,n[a],a)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(t,n[a],a)},e.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof cA||(t=this._nodesMap[lA(t)]),t){for(var a="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r=0&&n.node2.dataIndex>=0}));for(a=0,r=i.length;a=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function mA(e,t,n,i,a){for(var r=new pA(i),o=0;o "+u)),p++)}var m,h=n.get("coordinateSystem");if("cartesian2d"===h||"polar"===h)m=tT(e,n);else{var g=hx.get(h),f=g&&g.dimensions||[];Lr(f,"value")<0&&f.concat(["value"]);var y=$_(e,{coordDimensions:f,encodeDefine:n.getEncode()}).dimensions;(m=new W_(y,n)).initData(e)}var v=new W_(["value"],n);return v.initData(l,s),a&&a(m,v),RD({mainData:m,struct:r,structAttr:"graph",datas:{node:m,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}qr(cA,uA("hostGraph","data")),qr(dA,uA("hostGraph","edgeData"));!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}We(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new $M(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),xd(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var n,i=e.edges||e.links||[],a=e.data||e.nodes||[],r=this;if(a&&i){_O(n=this)&&(n.__curvenessList=[],n.__edgeMap={},TO(n));var o=mA(a,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=r._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=xy.prototype.getModel;function i(e,t){var i=n.call(this,e,t);return i.resolveParentPath=a,i}function a(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=a,e.getModel=i,e}))}));return zr(o.edges,(function(e){!function(e,t,n,i){if(_O(n)){var a=IO(e,t,n),r=n.__edgeMap,o=r[EO(a)];r[a]&&!o?r[a].isForward=!0:o&&r[a]&&(o.isForward=!0,r[a].isForward=!1),r[a]=r[a]||[],r[a].push(i)}}(e.node1,e.node2,this,e.dataIndex)}),this),o.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if("edge"===n){var i=this.getData(),a=this.getDataParams(e,n),r=i.graph.getEdgeByIndex(e),o=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),Zb("nameValue",{name:l.join(" > "),value:a.value,noValue:null==a.value})}return pw({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=Ur(this.option.categories||[],(function(e){return null!=e.value?e:Br({value:0},e)})),t=new W_(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}}}(mw);var hA=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},gA=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return We(t,e),t.prototype.getDefaultShape=function(){return new hA},t.prototype.buildPath=function(e,t){var n=Math.cos,i=Math.sin,a=t.r,r=t.width,o=t.angle,s=t.x-n(o)*r*(r>=a/3?1:2),l=t.y-i(o)*r*(r>=a/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(o)*r,t.y+i(o)*r),e.lineTo(t.x+n(t.angle)*a,t.y+i(t.angle)*a),e.lineTo(t.x-n(o)*r,t.y-i(o)*r),e.lineTo(s,l)},t}(Sm);function fA(e,t){var n=null==e?"":e+"";return t&&(Qr(t)?n=t.replace("{value}",n):Zr(t)&&(n=t(e))),n}(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i=e.get(["axisLine","lineStyle","color"]),a=function(e,t){var n=e.get("center"),i=t.getWidth(),a=t.getHeight(),r=Math.min(i,a);return{cx:Wc(n[0],t.getWidth()),cy:Wc(n[1],t.getHeight()),r:Wc(e.get("radius"),r/2)}}(e,n);this._renderMain(e,t,n,i,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,a){var r=this.group,o=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,p=e.getModel("axisLine"),c=p.get("roundCap")?cM:Dg,d=p.get("show"),u=p.getModel("lineStyle"),m=u.get("width"),h=[s,l];tm(h,!o);for(var g=(l=h[1])-(s=h[0]),f=s,y=[],v=0;d&&v=e&&(0===t?0:i[t-1][0])Math.PI/2&&(L+=Math.PI):"tangential"===N?L=-_-Math.PI/2:eo(N)&&(L=N*Math.PI/180),0===L?d.add(new Nm({style:Zf(x,{text:A,x:R,y:B,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:p<-.4?"left":p>.4?"right":"center"},{inheritColor:F}),silent:!0})):d.add(new Nm({style:Zf(x,{text:A,x:R,y:B,verticalAlign:"middle",align:"center"},{inheritColor:F}),silent:!0,originX:R,originY:B,rotation:L}))}if(v.get("show")&&P!==b){O=(O=v.get("distance"))?O+l:l;for(var V=0;V<=w;V++){p=Math.cos(_),c=Math.sin(_);var q=new Gg({shape:{x1:p*(h-O)+u,y1:c*(h-O)+m,x2:p*(h-C-O)+u,y2:c*(h-C-O)+m},silent:!0,style:M});"auto"===M.stroke&&q.setStyle({stroke:i((P+V/w)/b)}),d.add(q),_+=I}_-=I}else _+=T}},t.prototype._renderPointer=function(e,t,n,i,a,r,o,s,l){var p=this.group,c=this._data,d=this._progressEls,u=[],m=e.get(["pointer","show"]),h=e.getModel("progress"),g=h.get("show"),f=e.getData(),y=f.mapDimension("value"),v=+e.get("min"),x=+e.get("max"),b=[v,x],w=[r,o];function S(t,n){var i,r=f.getItemModel(t).getModel("pointer"),o=Wc(r.get("width"),a.r),s=Wc(r.get("length"),a.r),l=e.get(["pointer","icon"]),p=r.get("offsetCenter"),c=Wc(p[0],a.r),d=Wc(p[1],a.r),u=r.get("keepAspect");return(i=l?NS(l,c-o/2,d-s,o,s,null,u):new gA({shape:{angle:-Math.PI/2,width:o,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),i.x=a.cx,i.y=a.cy,i}function C(e,t){var n=h.get("roundCap")?cM:Dg,i=h.get("overlap"),o=i?h.get("width"):l/f.count(),p=i?a.r-o:a.r-(e+1)*o,c=i?a.r:a.r-e*o,d=new n({shape:{startAngle:r,endAngle:t,cx:a.cx,cy:a.cy,clockwise:s,r0:p,r:c}});return i&&(d.z2=x-f.get(y,e)%x),d}(g||m)&&(f.diff(c).add((function(t){var n=f.get(y,t);if(m){var i=S(t,r);cf(i,{rotation:-((isNaN(+n)?w[0]:Hc(n,b,w,!0))+Math.PI/2)},e),p.add(i),f.setItemGraphicEl(t,i)}if(g){var a=C(t,r),o=h.get("clip");cf(a,{shape:{endAngle:Hc(n,b,w,o)}},e),p.add(a),Zm(e.seriesIndex,f.dataType,t,a),u[t]=a}})).update((function(t,n){var i=f.get(y,t);if(m){var a=c.getItemGraphicEl(n),o=a?a.rotation:r,s=S(t,o);s.rotation=o,pf(s,{rotation:-((isNaN(+i)?w[0]:Hc(i,b,w,!0))+Math.PI/2)},e),p.add(s),f.setItemGraphicEl(t,s)}if(g){var l=d[n],v=C(t,l?l.shape.endAngle:r),x=h.get("clip");pf(v,{shape:{endAngle:Hc(i,b,w,x)}},e),p.add(v),Zm(e.seriesIndex,f.dataType,t,v),u[t]=v}})).execute(),f.each((function(e){var t=f.getItemModel(e),n=t.getModel("emphasis"),a=n.get("focus"),r=n.get("blurScope"),o=n.get("disabled");if(m){var s=f.getItemGraphicEl(e),l=f.getItemVisual(e,"style"),p=l.fill;if(s instanceof Em){var c=s.style;s.useStyle(Br({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(p);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Hc(f.get(y,e),b,[0,1],!0))),s.z2EmphasisLift=0,Uh(s,t),Vh(s,a,r,o)}if(g){var d=u[e];d.useStyle(f.getItemVisual(e,"style")),d.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,Uh(d,t),Vh(d,a,r,o)}})),this._progressEls=u)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),a=n.get("icon"),r=n.get("offsetCenter"),o=n.get("keepAspect"),s=NS(a,t.cx-i/2+Wc(r[0],t.r),t.cy-i/2+Wc(r[1],t.r),i,i,null,o);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,a){var r=this,o=e.getData(),s=o.mapDimension("value"),l=+e.get("min"),p=+e.get("max"),c=new Rc,d=[],u=[],m=e.isAnimationEnabled(),h=e.get(["pointer","showAbove"]);o.diff(this._data).add((function(e){d[e]=new Nm({silent:!0}),u[e]=new Nm({silent:!0})})).update((function(e,t){d[e]=r._titleEls[t],u[e]=r._detailEls[t]})).execute(),o.each((function(t){var n=o.getItemModel(t),r=o.get(s,t),g=new Rc,f=i(Hc(r,[l,p],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var v=y.get("offsetCenter"),x=a.cx+Wc(v[0],a.r),b=a.cy+Wc(v[1],a.r);(M=d[t]).attr({z2:h?0:2,style:Zf(y,{x:x,y:b,text:o.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:f})}),g.add(M)}var w=n.getModel("detail");if(w.get("show")){var S=w.get("offsetCenter"),C=a.cx+Wc(S[0],a.r),_=a.cy+Wc(S[1],a.r),T=Wc(w.get("width"),a.r),I=Wc(w.get("height"),a.r),E=e.get(["progress","show"])?o.getItemVisual(t,"style").fill:f,M=u[t],k=w.get("formatter");M.attr({z2:h?0:2,style:Zf(w,{x:C,y:_,text:fA(r,k),width:isNaN(T)?null:T,height:isNaN(I)?null:I,align:"center",verticalAlign:"middle"},{inheritColor:E})}),ry(M,{normal:w},r,(function(e){return fA(e,k)})),m&&oy(M,t,o,e,{getFormattedLabel:function(e,t,n,i,a,o){return fA(o?o.interpolatedValue:r,k)}}),g.add(M)}c.add(g)})),this.group.add(c),this._titleEls=d,this._detailEls=u},t.type="gauge"})(Tw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}We(t,e),t.prototype.getInitialData=function(e,t){return WM(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}}}(mw);var yA=["itemStyle","opacity"],vA=function(e){function t(t,n){var i=e.call(this)||this,a=i,r=new Lg,o=new Nm;return a.setTextContent(o),i.setTextGuideLine(r),i.updateData(t,n,!0),i}return We(t,e),t.prototype.updateData=function(e,t,n){var i=this,a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t),s=r.getModel("emphasis"),l=r.get(yA);l=null==l?1:l,n||gf(i),i.useStyle(e.getItemVisual(t,"style")),i.style.lineJoin="round",n?(i.setShape({points:o.points}),i.style.opacity=0,cf(i,{style:{opacity:l}},a,t)):pf(i,{style:{opacity:l},shape:{points:o.points}},a,t),Uh(i,r),this._updateLabel(e,t),Vh(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t){var n=this,i=this.getTextGuideLine(),a=n.getTextContent(),r=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"style"),p=l.fill;Yf(a,Xf(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:l.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:p,outsideFill:p});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Ms(c[0][0],c[0][1]):null},pf(a,{style:{x:s.x,y:s.y}},r,t),a.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),rE(n,oE(o),{stroke:p})},t}(Bg);(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}We(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this._data,r=this.group;i.diff(a).add((function(e){var t=new vA(i,e);i.setItemGraphicEl(e,t),r.add(t)})).update((function(e,t){var n=a.getItemGraphicEl(t);n.updateData(i,e),r.add(n),i.setItemGraphicEl(e,n)})).remove((function(t){hf(a.getItemGraphicEl(t),e,t)})).execute(),this._data=i},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel"})(Tw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new $M(Kr(this.getData,this),Kr(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return WM(this,{coordDimensions:["value"],encodeDefaulter:Yr($v,this)})},t.prototype._defaultLabelLine=function(e){xd(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),i=e.prototype.getDataParams.call(this,t),a=n.mapDimension("value"),r=n.getSum(a);return i.percent=r?+(n.get(a,t)/r*100).toFixed(2):0,i.$vars.push("percent"),i},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}}}(mw);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Rc,n._initialized=!1,n}We(t,e),t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var a=this._dataGroup,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,p=wA(e);if(r.diff(o).add((function(e){SA(bA(r,a,e,l,s),r,e,p)})).update((function(t,n){var i=o.getItemGraphicEl(n),a=xA(r,t,l,s);r.setItemGraphicEl(t,i),pf(i,{shape:{points:a}},e,t),gf(i),SA(i,r,t,p)})).remove((function(e){var t=o.getItemGraphicEl(e);a.remove(t)})).execute(),!this._initialized){this._initialized=!0;var c=function(e,t,n){var i=e.model,a=e.getRect(),r=new Fm({shape:{x:a.x,y:a.y,width:a.width,height:a.height}}),o="horizontal"===i.get("layout")?"width":"height";return r.setShape(o,0),cf(r,{shape:{width:a.width,height:a.height}},t,n),r}(s,e,(function(){setTimeout((function(){a.removeClipPath()}))}));a.setClipPath(c)}this._data=r},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var i=t.getData(),a=t.coordinateSystem,r=a.dimensions,o=wA(t),s=this._progressiveEls=[],l=e.start;l5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&TA(this,"mousemove")){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function TA(e,t){var n=e._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===t}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&Fr(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get("parallelIndex");return null!=n&&t.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){zr(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];zr(Hr(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this),(function(n){e.push("dim"+n.get("dim")),t.push(n.componentIndex)}))},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null}}(kv);var IA=function(e){function t(t,n,i,a,r){var o=e.call(this,t,n,i)||this;return o.type=a||"value",o.axisIndex=r,o}return We(t,e),t.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},t}(RI);function EA(e,t,n,i,a,r){e=e||0;var o=n[1]-n[0];if(null!=a&&(a=kA(a,[0,o])),null!=r&&(r=Math.max(r,null!=a?a:0)),"all"===i){var s=Math.abs(t[1]-t[0]);s=kA(s,[0,o]),a=r=kA(s,[a,r]),i=0}t[0]=kA(t[0],n),t[1]=kA(t[1],n);var l=MA(t,i);t[i]+=e;var p,c=a||0,d=n.slice();return l.sign<0?d[0]+=c:d[1]-=c,t[i]=kA(t[i],d),p=MA(t,i),null!=a&&(p.sign!==l.sign||p.spanr&&(t[1-i]=t[i]+p.sign*r),t}function MA(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function kA(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var PA=zr,DA=Math.min,OA=Math.max,AA=Math.floor,FA=Math.ceil,RA=$c,BA=Math.PI;!function(){function e(e,t,n){this.type="parallel",this._axesMap=Co(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}e.prototype._init=function(e,t,n){var i=e.dimensions,a=e.parallelAxisIndex;PA(i,(function(e,n){var i=a[n],r=t.getComponent("parallelAxis",i),o=this._axesMap.set(e,new IA(e,tI(r),[0,0],r.get("type"),i)),s="category"===o.type;o.onBand=s&&r.get("boundaryGap"),o.inverse=r.get("inverse"),r.axis=o,o.model=r,o.coordinateSystem=r.coordinateSystem=this}),this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,r=e[1-a],o=e[a];return r>=n&&r<=n+t.axisLength&&o>=i&&o<=i+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries((function(n){if(e.contains(n,t)){var i=n.getData();PA(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(i,i.mapDimension(e)),eI(t.scale,t.model)}),this)}}),this)},e.prototype.resize=function(e,t){this._rect=Sv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e,t=this._model,n=this._rect,i=["x","y"],a=["width","height"],r=t.get("layout"),o="horizontal"===r?0:1,s=n[a[o]],l=[0,s],p=this.dimensions.length,c=NA(t.get("axisExpandWidth"),l),d=NA(t.get("axisExpandCount")||0,[0,p]),u=t.get("axisExpandable")&&p>3&&p>d&&d>1&&c>0&&s>0,m=t.get("axisExpandWindow");m?(e=NA(m[1]-m[0],l),m[1]=m[0]+e):(e=NA(c*(d-1),l),(m=[c*(t.get("axisExpandCenter")||AA(p/2))-e/2])[1]=m[0]+e);var h=(s-e)/(p-d);h<3&&(h=0);var g=[AA(RA(m[0]/c,1))+1,FA(RA(m[1]/c,1))-1],f=h/c*m[0];return{layout:r,pixelDimIndex:o,layoutBase:n[i[o]],layoutLength:s,axisBase:n[i[1-o]],axisLength:n[a[1-o]],axisExpandable:u,axisExpandWidth:c,axisCollapseWidth:h,axisExpandWindow:m,axisCount:p,winInnerIndices:g,axisExpandWindow0Pos:f}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each((function(e){var t=[0,i.axisLength],n=e.inverse?1:0;e.setExtent(t[n],t[1-n])})),PA(n,(function(t,n){var r=(i.axisExpandable?VA:LA)(n,i),o={horizontal:{x:r.position,y:i.axisLength},vertical:{x:0,y:r.position}},s={horizontal:BA/2,vertical:0},l=[o[a].x+e.x,o[a].y+e.y],p=s[a],c=[1,0,0,1,0,0];_s(c,c,p),Cs(c,c,l),this._axesLayout[t]={position:l,rotation:p,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,i){null==n&&(n=0),null==i&&(i=e.count());var a=this._axesMap,r=this.dimensions,o=[],s=[];zr(r,(function(t){o.push(e.mapDimension(t)),s.push(a.get(t).model)}));for(var l=this.hasAxisBrushed(),p=n;pa*(1-c[0])?(l="jump",o=s-a*(1-c[2])):(o=s-a*c[1])>=0&&(o=s-a*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/p)?EA(o,i,r,"all"):l="none";else{var u=i[1]-i[0];(i=[OA(0,r[1]*s/u-u/2)])[1]=DA(r[1],i[0]+u),i[0]=i[1]-u}return{axisExpandWindow:i,behavior:l}}}();function NA(e,t){return DA(OA(e,t[0]),t[1])}function LA(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function VA(e,t){var n,i,a=t.layoutLength,r=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,p=s,c=!1;return e=0;n--)Kc(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(+e))return"inactive";if(1===t.length){var n=t[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var i=0,a=t.length;i6}(e)||r){if(o&&!r){"single"===s.brushMode&&rF(e);var l=Ar(s);l.brushType=SF(l.brushType,o),l.panelId=o===GA?null:o.panelId,r=e._creatingCover=ZA(e,l),e._covers.push(r)}if(r){var p=TF[SF(e._brushType,o)];r.__brushOption.range=p.getCreatingRange(vF(e,r,e._track)),i&&(QA(e,r),p.updateCommon(e,r)),JA(e,r),a={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&iF(e,t,n)&&rF(e)&&(a={isEnd:i,removeOnClick:!0});return a}function SF(e,t){return"auto"===e?t.defaultBrushType:e}var CF={mousedown:function(e){if(this._dragging)_F(this,e);else if(!e.target||!e.target.draggable){xF(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=iF(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,i=this.group.transformCoordToLocal(t,n);if(function(e,t,n){if(e._brushType&&!function(e,t,n){var i=e._zr;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}(e,t.offsetX,t.offsetY)){var i=e._zr,a=e._covers,r=iF(e,t,n);if(!e._dragging)for(var o=0;o=0&&(r[a[o].depth]=new xy(a[o],this,t));if(i&&n){var s=mA(i,n,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getData().getItemLayout(t);if(i){var a=i.depth,r=n.levelModels[a];r&&(e.parentModel=r)}return e})),t.wrapMethod("getItemModel",(function(e,t){var n=e.parentModel,i=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(i){var a=i.depth,r=n.levelModels[a];r&&(e.parentModel=r)}return e}))}));return s.data}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function i(e){return isNaN(e)||null==e}if("edge"===n){var a=this.getDataParams(e,n),r=a.data,o=a.value;return Zb("nameValue",{name:r.source+" -- "+r.target,value:o,noValue:i(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,n).data.name;return Zb("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var i=e.prototype.getDataParams.call(this,t,n);if(null==i.value&&"node"===n){var a=this.getGraph().getNodeByIndex(t).getLayout().value;i.value=a}return i},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3}}(mw);var RF=function(){function e(){}return e.prototype.getInitialData=function(e,t){var n,i,a=t.getComponent("xAxis",this.get("xAxisIndex")),r=t.getComponent("yAxis",this.get("yAxisIndex")),o=a.get("type"),s=r.get("type");"category"===o?(e.layout="horizontal",n=a.getOrdinalMeta(),i=!0):"category"===s?(e.layout="vertical",n=r.getOrdinalMeta(),i=!0):e.layout=e.layout||"horizontal";var l=["x","y"],p="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[p],d=l[1-p],u=[a,r],m=u[p].get("type"),h=u[1-p].get("type"),g=e.data;if(g&&i){var f=[];zr(g,(function(e,t){var n;Xr(e)?(n=e.slice(),e.unshift(t)):Xr(e.value)?((n=Br({},e)).value=n.value.slice(),e.value.unshift(t)):n=e,f.push(n)})),e.data=f}var y=this.defaultValueDimensions,v=[{name:c,type:T_(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:T_(h),dimsDef:y.slice()}];return WM(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:Yr(Wv,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},e}(),BF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return We(t,e),t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(mw);qr(BF,RF,!0);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this.group,r=this._data;this._data||a.removeAll();var o="horizontal"===e.get("layout")?1:0;i.diff(r).add((function(e){if(i.hasValue(e)){var t=VF(i.getItemLayout(e),i,e,o,!0);i.setItemGraphicEl(e,t),a.add(t)}})).update((function(e,t){var n=r.getItemGraphicEl(t);if(i.hasValue(e)){var s=i.getItemLayout(e);n?(gf(n),qF(s,n,i,e)):n=VF(s,i,e,o),a.add(n),i.setItemGraphicEl(e,n)}else a.remove(n)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&a.remove(t)})).execute(),this._data=i},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(e){e&&t.remove(e)}))},t.type="boxplot"}(Tw);var NF=function(){},LF=function(e){function t(t){var n=e.call(this,t)||this;return n.type="boxplotBoxPath",n}return We(t,e),t.prototype.getDefaultShape=function(){return new NF},t.prototype.buildPath=function(e,t){var n=t.points,i=0;for(e.moveTo(n[i][0],n[i][1]),i++;i<4;i++)e.lineTo(n[i][0],n[i][1]);for(e.closePath();i0?"borderColor":"borderColor0"])||n.get(["itemStyle",e>0?"color":"color0"]);0===e&&(a=n.get(["itemStyle","borderColorDoji"]));var r=n.getModel("itemStyle").getItemStyle(zF);t.useStyle(r),t.style.fill=null,t.style.stroke=a}var JF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return We(t,e),t.prototype.getShadowDim=function(){return"open"},t.prototype.brushSelector=function(e,t,n){var i=t.getItemLayout(e);return i&&n.rect(i.brushRect)},t.type="series.candlestick",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},t}(mw);qr(JF,RF,!0);var eR=["itemStyle","borderColor"],tR=["itemStyle","borderColor0"],nR=["itemStyle","borderColorDoji"],iR=["itemStyle","color"],aR=["itemStyle","color0"];Sw(),Sw();function rR(e,t,n,i,a,r){return n>i?-1:n0?e.get(a,t-1)<=i?1:-1:1}function oR(e,t){var n=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?n:null,fill:"fill"===t.brushType?n:null}})}))}var sR=function(e){function t(t,n){var i=e.call(this)||this,a=new TE(t,n),r=new Rc;return i.add(a),i.add(r),i.updateData(t,n),i}return We(t,e),t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,i=e.rippleNumber,a=this.childAt(1),r=0;r0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||o!==this._loop||s!==this._roundTrip){i.stopAnimation();var c=void 0;c=Zr(p)?p(n):p,i.__t>0&&(c=-r*i.__t),this._animateSymbol(i,r,c,o,s)}this._period=r,this._loop=o,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,i,a){if(t>0){e.__t=0;var r=this,o=e.animate("",i).when(a?2*t:t,{__t:a?2:1}).delay(n).during((function(){r._updateSymbolPosition(e)}));i||o.done((function(){r.remove(e)})),o.start()}},t.prototype._getLineLength=function(e){return Go(e.__p1,e.__cp1)+Go(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,i=e.__cp1,a=e.__t<1?e.__t:2-e.__t,r=[e.x,e.y],o=r.slice(),s=_l,l=Tl;r[0]=s(t[0],i[0],n[0],a),r[1]=s(t[1],i[1],n[1],a);var p=e.__t<1?l(t[0],i[0],n[0],a):l(n[0],i[0],t[0],1-a),c=e.__t<1?l(t[1],i[1],n[1],a):l(n[1],i[1],t[1],1-a);e.rotation=-Math.atan2(c,p)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==e.__lastT&&e.__lastT=0&&!(i[r]<=t);r--);r=Math.min(r,a-2)}else{for(r=o;rt);r++);r=Math.min(r-1,a-2)}var s=(t-i[r])/(i[r+1]-i[r]),l=n[r],p=n[r+1];e.x=l[0]*(1-s)+s*p[0],e.y=l[1]*(1-s)+s*p[1];var c=e.__t<1?p[0]-l[0]:l[0]-p[0],d=e.__t<1?p[1]-l[1]:l[1]-p[1];e.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=t,e.ignore=!1}},t}(lR),dR=function(){this.polyline=!1,this.curveness=0,this.segs=[]},uR=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return We(t,e),t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new dR},t.prototype.buildPath=function(e,t){var n,i=t.segs,a=t.curveness;if(t.polyline)for(n=this._off;n0){e.moveTo(i[n++],i[n++]);for(var o=1;o0){var d=(s+p)/2-(l-c)*a,u=(l+c)/2-(p-s)*a;e.quadraticCurveTo(d,u,p,c)}else e.lineTo(p,c)}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,i=n.segs,a=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s0)for(var p=i[s++],c=i[s++],d=1;d0){if(rm(p,c,(p+u)/2-(c-m)*a,(c+m)/2-(u-p)*a,u,m,r,e,t))return o}else if(im(p,c,u,m,r,e,t))return o;o++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return e=n[0],t=n[1],i.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,i=1/0,a=-1/0,r=-1/0,o=0;o0&&(r.dataIndex=n+e.__startIndex)}))},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),hR={seriesType:"lines",plan:Sw(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get("polyline"),i=e.pipelineContext.large;return{progress:function(a,r){var o=[];if(i){var s=void 0,l=a.end-a.start;if(n){for(var p=0,c=a.start;c0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),a.updateData(i);var p=e.get("clip",!0)&&UE(e.coordinateSystem,!1,e);p?this.group.setClipPath(p):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateLineDraw(i,e).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var i=e.getData(),a=e.pipelineContext;if(!this._finished||a.large||a.progressiveRender)return{update:!0};var r=hR.reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,i=this._showEffect(t),a=!!t.get("polyline"),r=t.pipelineContext.large;return n&&i===this._hasEffet&&a===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new mR:new YO(a?i?cR:pR:i?lR:KO),this._hasEffet=i,this._isPolyline=a,this._isLargeDraw=r),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type="lines"}(Tw),"undefined"==typeof Uint32Array?Array:Uint32Array),fR="undefined"==typeof Float64Array?Array:Float64Array;function yR(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=Ur(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),Rr([t,e[0],e[1]])})))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}We(t,e),t.prototype.init=function(t){t.data=t.data||[],yR(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(yR(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=_o(this._flatCoords,t.flatCoords),this._flatCoordsOffset=_o(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],i=this._flatCoordsOffset[2*e+1],a=0;a ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),t=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&t>0?t+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}(mw);var vR=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=vr.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,i,a,r){var o=this._getBrush(),s=this._getGradient(a,"inRange"),l=this._getGradient(a,"outOfRange"),p=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),u=e.length;c.width=t,c.height=n;for(var m=0;m0){var T=r(y)?s:l;y>0&&(y=y*C+S),x[b++]=T[_],x[b++]=T[_+1],x[b++]=T[_+2],x[b++]=T[_+3]*y*256}else b+=4}return d.putImageData(v,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=vr.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,o=0;o<256;o++)e[t](o/255,!0,a),i[r++]=a[0],i[r++]=a[1],i[r++]=a[2],i[r++]=a[3];return i},e}();function xR(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.render=function(e,t,n){var i;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(n){n===e&&(i=t)}))})),this._progressiveEls=null,this.group.removeAll();var a=e.coordinateSystem;"cartesian2d"===a.type||"calendar"===a.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):xR(a)&&this._renderOnGeo(a,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){var a=t.coordinateSystem;a&&(xR(a)?this.render(t,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){jf(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,a){var r,o,s,l,p=e.coordinateSystem,c=jE(p,"cartesian2d");if(c){var d=p.getAxis("x"),u=p.getAxis("y");0,r=d.getBandWidth()+.5,o=u.getBandWidth()+.5,s=d.scale.getExtent(),l=u.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),f=e.getModel(["blur","itemStyle"]).getItemStyle(),y=e.getModel(["select","itemStyle"]).getItemStyle(),v=e.get(["itemStyle","borderRadius"]),x=Xf(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),C=b.get("disabled"),_=c?[h.mapDimension("x"),h.mapDimension("y"),h.mapDimension("value")]:[h.mapDimension("time"),h.mapDimension("value")],T=n;Ts[1]||kl[1])continue;var P=p.dataToPoint([M,k]);I=new Fm({shape:{x:P[0]-r/2,y:P[1]-o/2,width:r,height:o},style:E})}else{if(isNaN(h.get(_[1],T)))continue;I=new Fm({z2:1,shape:p.dataToRect([h.get(_[0],T)]).contentShape,style:E})}if(h.hasItemOption){var D=h.getItemModel(T),O=D.getModel("emphasis");g=O.getModel("itemStyle").getItemStyle(),f=D.getModel(["blur","itemStyle"]).getItemStyle(),y=D.getModel(["select","itemStyle"]).getItemStyle(),v=D.get(["itemStyle","borderRadius"]),w=O.get("focus"),S=O.get("blurScope"),C=O.get("disabled"),x=Xf(D)}I.shape.r=v;var A=e.getRawValue(T),F="-";A&&null!=A[2]&&(F=A[2]+""),Yf(I,x,{labelFetcher:e,labelDataIndex:T,defaultOpacity:E.opacity,defaultText:F}),I.ensureState("emphasis").style=g,I.ensureState("blur").style=f,I.ensureState("select").style=y,Vh(I,w,S,C),I.incremental=a,a&&(I.states.emphasis.hoverLayer=!0),m.add(I),h.setItemGraphicEl(T,I),this._progressiveEls&&this._progressiveEls.push(I)}},t.prototype._renderOnGeo=function(e,t,n,i){var a=n.targetVisuals.inRange,r=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new vR;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),p=e.getRoamTransform();l.applyTransform(p);var c=Math.max(l.x,0),d=Math.max(l.y,0),u=Math.min(l.width+l.x,i.getWidth()),m=Math.min(l.height+l.y,i.getHeight()),h=u-c,g=m-d,f=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],y=o.mapArray(f,(function(t,n,i){var a=e.dataToPoint([t,n]);return a[0]-=c,a[1]-=d,a.push(i),a})),v=n.getExtent(),x="visualMap.continuous"===n.type?function(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}(v,n.option.range):function(e,t,n){var i=e[1]-e[0],a=(t=Ur(t,(function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}}))).length,r=0;return function(e){var i;for(i=r;i=0;i--){var o;if((o=t[i].interval)[0]<=e&&e<=o[1]){r=i;break}}return i>=0&&i0?1:-1}(n,r,a,i,d),function(e,t,n,i,a,r,o,s,l,p){var c,d=l.valueDim,u=l.categoryDim,m=Math.abs(n[u.wh]),h=e.getItemVisual(t,"symbolSize");c=Xr(h)?h.slice():null==h?["100%","100%"]:[h,h];c[u.index]=Wc(c[u.index],m),c[d.index]=Wc(c[d.index],i?m:Math.abs(r)),p.symbolSize=c;var g=p.symbolScale=[c[0]/s,c[1]/s];g[d.index]*=(l.isHorizontal?-1:1)*o}(e,t,a,r,0,d.boundingLength,d.pxSign,p,i,d),function(e,t,n,i,a){var r=e.get(bR)||0;r&&(SR.attr({scaleX:t[0],scaleY:t[1],rotation:n}),SR.updateTransform(),r/=SR.getLineScale(),r*=t[i.valueDim.index]);a.valueLineWidth=r||0}(n,d.symbolScale,l,i,d);var u=d.symbolSize,m=VS(n.get("symbolOffset"),u);return function(e,t,n,i,a,r,o,s,l,p,c,d){var u=c.categoryDim,m=c.valueDim,h=d.pxSign,g=Math.max(t[m.index]+s,0),f=g;if(i){var y=Math.abs(l),v=po(e.get("symbolMargin"),"15%")+"",x=!1;v.lastIndexOf("!")===v.length-1&&(x=!0,v=v.slice(0,v.length-1));var b=Wc(v,t[m.index]),w=Math.max(g+2*b,0),S=x?0:2*b,C=pd(i),_=C?i:VR((y+S)/w);w=g+2*(b=(y-_*g)/2/(x?_:Math.max(_-1,1))),S=x?0:2*b,C||"fixed"===i||(_=p?VR((Math.abs(p)+S)/w):0),f=_*w-S,d.repeatTimes=_,d.symbolMargin=b}var T=h*(f/2),I=d.pathPosition=[];I[u.index]=n[u.wh]/2,I[m.index]="start"===o?T:"end"===o?l-T:l/2,r&&(I[0]+=r[0],I[1]+=r[1]);var E=d.bundlePosition=[];E[u.index]=n[u.xy],E[m.index]=n[m.xy];var M=d.barRectShape=Br({},n);M[m.wh]=h*Math.max(Math.abs(n[m.wh]),Math.abs(I[m.index]+T)),M[u.wh]=n[u.wh];var k=d.clipShape={};k[u.xy]=-n[u.xy],k[u.wh]=c.ecSize[u.wh],k[m.xy]=0,k[m.wh]=n[m.wh]}(n,u,a,r,0,m,s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,i,d),d}function _R(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function TR(e){var t=e.symbolPatternSize,n=NS(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function IR(e,t,n,i){var a=e.__pictorialBundle,r=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,l=t.valueDim,p=n.repeatTimes||0,c=0,d=r[t.valueDim.index]+o+2*n.symbolMargin;for(BR(e,(function(e){e.__pictorialAnimationIndex=c,e.__pictorialRepeatTimes=p,c0:i<0)&&(a=p-1-e),t[l.index]=d*(a-p/2+.5)+s[l.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function ER(e,t,n,i){var a=e.__pictorialBundle,r=e.__pictorialMainPath;r?NR(r,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(r=e.__pictorialMainPath=TR(n),a.add(r),NR(r,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function MR(e,t,n){var i=Br({},t.barRectShape),a=e.__pictorialBarRect;a?NR(a,null,{shape:i},t,n):((a=e.__pictorialBarRect=new Fm({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,e.add(a))}function kR(e,t,n,i){if(n.symbolClip){var a=e.__pictorialClipPath,r=Br({},n.clipShape),o=t.valueDim,s=n.animationModel,l=n.dataIndex;if(a)pf(a,{shape:r},s,l);else{r[o.wh]=0,a=new Fm({shape:r}),e.__pictorialBundle.setClipPath(a),e.__pictorialClipPath=a;var p={};p[o.wh]=n.clipShape[o.wh],Hf[i?"updateProps":"initProps"](a,{shape:p},s,l)}}}function PR(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=DR,n.isAnimationEnabled=OR,n}function DR(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function OR(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function AR(e,t,n,i){var a=new Rc,r=new Rc;return a.add(r),a.__pictorialBundle=r,r.x=n.bundlePosition[0],r.y=n.bundlePosition[1],n.symbolRepeat?IR(a,t,n):ER(a,0,n),MR(a,n,i),kR(a,t,n,i),a.__pictorialShapeStr=RR(e,n),a.__pictorialSymbolMeta=n,a}function FR(e,t,n,i){var a=i.__pictorialBarRect;a&&a.removeTextContent();var r=[];BR(i,(function(e){r.push(e)})),i.__pictorialMainPath&&r.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),zr(r,(function(e){uf(e,{scaleX:0,scaleY:0},n,t,(function(){i.parent&&i.parent.remove(i)}))})),e.setItemGraphicEl(t,null)}function RR(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function BR(e,t,n){zr(e.__pictorialBundle.children(),(function(i){i!==e.__pictorialBarRect&&t.call(n,i)}))}function NR(e,t,n,i,a,r){t&&e.attr(t),i.symbolClip&&!a?n&&e.attr(n):n&&Hf[a?"updateProps":"initProps"](e,n,i.animationModel,i.dataIndex,r)}function LR(e,t,n){var i=n.dataIndex,a=n.itemModel,r=a.getModel("emphasis"),o=r.getModel("itemStyle").getItemStyle(),s=a.getModel(["blur","itemStyle"]).getItemStyle(),l=a.getModel(["select","itemStyle"]).getItemStyle(),p=a.getShallow("cursor"),c=r.get("focus"),d=r.get("blurScope"),u=r.get("scale");BR(e,(function(e){if(e instanceof Em){var t=e.style;e.useStyle(Br({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var i=e.ensureState("emphasis");i.style=o,u&&(i.scaleX=1.1*e.scaleX,i.scaleY=1.1*e.scaleY),e.ensureState("blur").style=s,e.ensureState("select").style=l,p&&(e.cursor=p),e.z2=n.z2}));var m=t.valueDim.posDesc[+(n.boundingLength>0)],h=e.__pictorialBarRect;h.ignoreClip=!0,Yf(h,Xf(a),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:CE(t.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:m}),Vh(e,c,d,r.get("disabled"))}function VR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}We(t,e),t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=Sy(sM.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}})}(sM);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}We(t,e),t.prototype.render=function(e,t,n){var i=e.getData(),a=this,r=this.group,o=e.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,p=s.boundaryGap;function c(e){return e.name}r.x=0,r.y=l.y+p[0];var d=new S_(this._layersSeries||[],o,c,c),u=[];function m(t,n,s){var l=a._layers;if("remove"!==t){for(var p,c,d=[],m=[],h=o[n].indices,g=0;gT&&!td(E-T)&&E0?(a.virtualPiece?a.virtualPiece.updateData(!1,i,e,t,n):(a.virtualPiece=new qR(i,e,t,n),l.add(a.virtualPiece)),r.piece.off("click"),a.virtualPiece.on("click",(function(e){a._rootToNode(r.parentNode)}))):a.virtualPiece&&(l.remove(a.virtualPiece),a.virtualPiece=null)}(o,s),this._initEvents(),this._oldChildren=c},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",(function(t){var n=!1;e.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===t.target){var a=i.getModel().get("nodeClick");if("rootToNode"===a)e._rootToNode(i);else if("link"===a){var r=i.getModel(),o=r.get("link");if(o)fv(o,r.get("target",!0)||"_blank")}n=!0}}))}))},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:GR,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,a=e[1]-n.cy,r=Math.sqrt(i*i+a*a);return r<=n.r&&r>=n.r0}},t.type="sunburst"})(Tw),function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}We(t,e),t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};zR(n);var i=this._levelModels=Ur(e.levels||[],(function(e){return new xy(e,this,t)}),this),a=jD.createTree(n,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var n=a.getNodeByDataIndex(t),r=i[n.depth];return r&&(e.parentModel=r),e}))}));return a.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=KD(i,this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){YD(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"}}(mw);function zR(e){var t=0;zr(e.children,(function(e){zR(e);var n=e.value;Xr(n)&&(n=n[0]),t+=n}));var n=e.value;Xr(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=t),n<0&&(n=0),Xr(e.value)?e.value[0]=n:e.value=n}Math.PI;var UR={color:"fill",borderColor:"stroke"},jR={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},HR=Pd(),WR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return tT(null,this)},t.prototype.getDataParams=function(t,n,i){var a=e.prototype.getDataParams.call(this,t,n);return i&&(a.info=HR(i).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(mw);function $R(e,t){return t=t||[0,0],Ur(["x","y"],(function(n,i){var a=this.getAxis(n),r=t[i],o=e[i]/2;return"category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o))}),this)}function KR(e,t){return t=t||[0,0],Ur([0,1],(function(n){var i=t[n],a=e[n]/2,r=[],o=[];return r[n]=i-a,o[n]=i+a,r[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(r)[n]-this.dataToPoint(o)[n])}),this)}function YR(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,a=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-a)-n.dataToCoord(i+a))}function XR(e,t){return t=t||[0,0],Ur(["Radius","Angle"],(function(n,i){var a=this["get"+n+"Axis"](),r=t[i],o=e[i]/2,s="category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o));return"Angle"===n&&(s=s*Math.PI/180),s}),this)}function ZR(e,t,n,i){return e&&(e.legacy||!1!==e.legacy&&!n&&!i&&"tspan"!==t&&("text"===t||Eo(e,"text")))}function QR(e,t,n){var i,a,r,o=e;if("text"===t)r=o;else{r={},Eo(o,"text")&&(r.text=o.text),Eo(o,"rich")&&(r.rich=o.rich),Eo(o,"textFill")&&(r.fill=o.textFill),Eo(o,"textStroke")&&(r.stroke=o.textStroke),Eo(o,"fontFamily")&&(r.fontFamily=o.fontFamily),Eo(o,"fontSize")&&(r.fontSize=o.fontSize),Eo(o,"fontStyle")&&(r.fontStyle=o.fontStyle),Eo(o,"fontWeight")&&(r.fontWeight=o.fontWeight),a={type:"text",style:r,silent:!0},i={};var s=Eo(o,"textPosition");n?i.position=s?o.textPosition:"inside":s&&(i.position=o.textPosition),Eo(o,"textPosition")&&(i.position=o.textPosition),Eo(o,"textOffset")&&(i.offset=o.textOffset),Eo(o,"textRotation")&&(i.rotation=o.textRotation),Eo(o,"textDistance")&&(i.distance=o.textDistance)}return JR(r,e),zr(r.rich,(function(e){JR(e,e)})),{textConfig:i,textContent:a}}function JR(e,t){t&&(t.font=t.textFont||t.font,Eo(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Eo(t,"textAlign")&&(e.align=t.textAlign),Eo(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Eo(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Eo(t,"textWidth")&&(e.width=t.textWidth),Eo(t,"textHeight")&&(e.height=t.textHeight),Eo(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Eo(t,"textPadding")&&(e.padding=t.textPadding),Eo(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Eo(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Eo(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Eo(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Eo(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Eo(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Eo(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function eB(e,t,n){var i=e;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var a=i.textPosition.indexOf("inside")>=0,r=e.fill||"#000";tB(i,t);var o=null==i.textFill;return a?o&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=r),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(o&&(i.textFill=e.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=t.text,i.rich=t.rich,zr(t.rich,(function(e){tB(e,e)})),i}function tB(e,t){t&&(Eo(t,"fill")&&(e.textFill=t.fill),Eo(t,"stroke")&&(e.textStroke=t.fill),Eo(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Eo(t,"font")&&(e.font=t.font),Eo(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Eo(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Eo(t,"fontSize")&&(e.fontSize=t.fontSize),Eo(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Eo(t,"align")&&(e.textAlign=t.align),Eo(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Eo(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Eo(t,"width")&&(e.textWidth=t.width),Eo(t,"height")&&(e.textHeight=t.height),Eo(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Eo(t,"padding")&&(e.textPadding=t.padding),Eo(t,"borderColor")&&(e.textBorderColor=t.borderColor),Eo(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Eo(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Eo(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Eo(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Eo(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Eo(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Eo(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Eo(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Eo(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Eo(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var nB={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},iB=$r(nB),aB=(jr(hc,(function(e,t){return e[t]=1,e}),{}),hc.join(", "),["","style","shape","extra"]),rB=Pd();function oB(e,t,n,i,a){var r=e+"Animation",o=sf(e,i,a)||{},s=rB(t).userDuring;return o.duration>0&&(o.during=s?Kr(mB,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),Br(o,n[r]),o}function sB(e,t,n,i){var a=(i=i||{}).dataIndex,r=i.isInit,o=i.clearStyle,s=n.isAnimationEnabled(),l=rB(e),p=t.style;l.userDuring=t.during;var c={},d={};if(function(e,t,n){for(var i=0;i=0)){var d=e.getAnimationStyleProps(),u=d?d.style:null;if(u){!a&&(a=i.style={});var m=$r(n);for(p=0;p0&&e.animateFrom(u,m)}else!function(e,t,n,i,a){if(a){var r=oB("update",e,t,i,n);r.duration>0&&e.animateFrom(a,r)}}(e,t,a||0,n,c);lB(e,t),p?e.dirty():e.markRedraw()}function lB(e,t){for(var n=rB(e).leaveToProps,i=0;i=0){!r&&(r=i[e]={});var u=$r(o);for(c=0;ci[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var a=t.dataToRadius(i[0]),r=n.dataToAngle(i[1]),o=e.coordToPoint([a,r]);return o.push(a,r*Math.PI/180),o},size:Kr(XR,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function DB(e){return e instanceof Sm}function OB(e){return e instanceof bu}var AB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var a=this._data,r=e.getData(),o=this.group,s=LB(e,r,t,n);a||o.removeAll(),r.diff(a).add((function(t){qB(n,null,t,s(t,i),e,o,r)})).remove((function(t){var n=a.getItemGraphicEl(t);n&&pB(n,HR(n).option,e)})).update((function(t,l){var p=a.getItemGraphicEl(l);qB(n,p,t,s(t,i),e,o,r)})).execute();var l=e.get("clip",!0)?UE(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=r},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,i,a){var r=t.getData(),o=LB(t,r,n,i),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var p=e.start;p=0?t.getStore().get(a,n):void 0}var r=t.get(i.name,n),o=i&&i.ordinalMeta;return o?o.categories[r]:r},styleEmphasis:function(n,i){0;null==i&&(i=s);var a=v(i,wB).getItemStyle(),r=x(i,wB),o=Zf(r,null,null,!0,!0);o.text=r.getShallow("show")?uo(e.getFormattedLabel(i,wB),e.getFormattedLabel(i,SB),CE(t,i)):null;var l=Qf(r,null,!0);return w(n,a),a=eB(a,o,l),n&&b(a,n),a.legacy=!0,a},visual:function(e,n){if(null==n&&(n=s),Eo(UR,e)){var i=t.getItemVisual(n,"style");return i?i[UR[e]]:null}if(Eo(jR,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===r.type){return function(e){var t=[],n=e.axis,i="axis0";if("category"===n.type){for(var a=n.getBandWidth(),r=0;r=d;h--){var g=t.childAt(h);WB(t,g,a)}}(e,d,n,i,a),o>=0?r.replaceAt(d,o):r.add(d),d}function zB(e,t,n){var i,a=HR(e),r=t.type,o=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=r&&r!==a.customGraphicType||"path"===r&&((i=o)&&(Eo(i,"pathData")||Eo(i,"d")))&&XB(o)!==a.customPathData||"image"===r&&Eo(s,"image")&&s.image!==a.customImagePath}function UB(e,t,n){var i=t?jB(e,t):e,a=t?HB(e,i,wB):e.style,r=e.type,o=i?i.textConfig:null,s=e.textContent,l=s?t?jB(s,t):s:null;if(a&&(n.isLegacy||ZR(a,r,!!o,!!l))){n.isLegacy=!0;var p=QR(a,r,!t);!o&&p.textConfig&&(o=p.textConfig),!l&&p.textContent&&(l=p.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text")}var d=t?n[t]:n.normal;d.cfg=o,d.conOpt=l}function jB(e,t){return t?e?e[t]:null:e}function HB(e,t,n){var i=t&&t.style;return null==i&&n===wB&&e&&(i=e.styleEmphasis),i}function WB(e,t,n){t&&pB(t,HR(e).option,n)}function $B(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function KB(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,a=null!=t?n.oldChildren[t]:null;GB(n.api,a,n.dataIndex,i,n.seriesModel,n.group)}function YB(e){var t=this.context,n=t.oldChildren[e];n&&pB(n,HR(n).option,t.seriesModel)}function XB(e){return e&&(e.pathData||e.d)}function ZB(e){e.registerChartView(AB),e.registerSeriesModel(WR)}var QB=Pd(),JB=Ar,eN=Kr,tN=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var a=t.get("value"),r=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==a||this._lastStatus!==r){this._lastValue=a,this._lastStatus=r;var o=this._group,s=this._handle;if(!r||"hide"===r)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,a,e,t,n);var p=l.graphicKey;p!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=p;var c=this._moveAnimation=this.determineAnimation(e,t);if(o){var d=Yr(nN,t,c);this.updatePointerEl(o,l,d),this.updateLabelEl(o,l,d,t)}else o=this._group=new Rc,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),n.getZr().add(o);oN(o,t,!0),this._renderHandle(a)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,a="category"===i.type,r=t.get("snap");if(!r&&!a)return!1;if("auto"===n||null==n){var o=this.animationThreshold;if(a&&i.getBandWidth()>o)return!0;if(r){var s=Ok(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,a){},e.prototype.createPointerEl=function(e,t,n,i){var a=t.pointer;if(a){var r=QB(e).pointerEl=new Hf[a.type](JB(t.pointer));e.add(r)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var a=QB(e).labelEl=new Nm(JB(t.label));e.add(a),aN(a,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=QB(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var a=QB(e).labelEl;a&&(a.setStyle(t.label.style),n(a,{x:t.label.x,y:t.label.y}),aN(a,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),a=this._handle,r=n.getModel("handle"),o=n.get("status");if(!r.get("show")||!o||"hide"===o)return a&&i.remove(a),void(this._handle=null);this._handle||(t=!0,a=this._handle=Lf(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){gs(e.event)},onmousedown:eN(this._onHandleDragMove,this,0,0),drift:eN(this._onHandleDragMove,this),ondragend:eN(this._onHandleDragEnd,this)}),i.add(a)),oN(a,n,!1),a.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");Xr(s)||(s=[s,s]),a.scaleX=s[0]/2,a.scaleY=s[1]/2,Rw(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){nN(this._axisPointerModel,!t&&this._moveAnimation,this._handle,rN(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(rN(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(rN(i)),QB(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Bw(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}();function nN(e,t,n,i){iN(QB(n).lastProp,i)||(QB(n).lastProp=i,t?pf(n,i,e):(n.stopAnimation(),n.attr(i)))}function iN(e,t){if(to(e)&&to(t)){var n=!0;return zr(t,(function(t,i){n=n&&iN(e[i],t)})),!!n}return e===t}function aN(e,t){e[t.get(["label","show"])?"show":"hide"]()}function rN(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function oN(e,t,n){var i=t.get("z"),a=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=a&&(e.zlevel=a),e.silent=n)}))}function sN(e){var t,n=e.get("type"),i=e.getModel(n+"Style");return"line"===n?(t=i.getLineStyle()).fill=null:"shadow"===n&&((t=i.getAreaStyle()).stroke=null),t}function lN(e,t,n,i,a){var r=pN(n.get("value"),t.axis,t.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),o=n.getModel("label"),s=pv(o.get("padding")||0),l=o.getFont(),p=xc(r,l),c=a.position,d=p.width+s[1]+s[3],u=p.height+s[0]+s[2],m=a.align;"right"===m&&(c[0]-=d),"center"===m&&(c[0]-=d/2);var h=a.verticalAlign;"bottom"===h&&(c[1]-=u),"middle"===h&&(c[1]-=u/2),function(e,t,n,i){var a=i.getWidth(),r=i.getHeight();e[0]=Math.min(e[0]+t,a)-t,e[1]=Math.min(e[1]+n,r)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(c,d,u,i);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get(["axisLine","lineStyle","color"])),e.label={x:c[0],y:c[1],style:Zf(o,{text:r,font:l,fill:o.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function pN(e,t,n,i,a){e=t.scale.parse(e);var r=t.scale.getLabel({value:e},{precision:a.precision}),o=a.formatter;if(o){var s={value:iI(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};zr(i,(function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,a=t&&t.getDataParams(i);a&&s.seriesData.push(a)})),Qr(o)?r=o.replace("{value}",r):Zr(o)&&(r=o(s))}return r}function cN(e,t,n){var i=[1,0,0,1,0,0];return _s(i,i,n.rotation),Cs(i,i,n.position),Of([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function dN(e,t,n,i,a,r){var o=_k.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=a.get(["label","margin"]),lN(t,i,a,r,{position:cN(i.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function uN(e,t,n){return{x1:e[n=n||0],y1:e[1-n],x2:t[n],y2:t[1-n]}}function mN(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}}function hN(e,t,n,i,a,r){return{cx:e,cy:t,r0:n,r:i,startAngle:a,endAngle:r,clockwise:!0}}var gN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis,o=r.grid,s=i.get("type"),l=fN(o,r).getOtherAxis(r).getGlobalExtent(),p=r.toGlobalCoord(r.dataToCoord(t,!0));if(s&&"none"!==s){var c=sN(i),d=yN[s](r,p,l);d.style=c,e.graphicKey=d.type,e.pointer=d}dN(t,e,hk(o.model,n),n,i,a)},t.prototype.getHandleTransform=function(e,t,n){var i=hk(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var a=cN(t.axis,e,i);return{x:a[0],y:a[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var a=n.axis,r=a.grid,o=a.getGlobalExtent(!0),s=fN(r,a).getOtherAxis(a).getGlobalExtent(),l="x"===a.dim?0:1,p=[e.x,e.y];p[l]+=t[l],p[l]=Math.min(o[1],p[l]),p[l]=Math.max(o[0],p[l]);var c=(s[1]+s[0])/2,d=[c,c];d[l]=p[l];return{x:p[0],y:p[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(tN);function fN(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var yN={line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:uN([t,n[0]],[t,n[1]],vN(e))}},shadow:function(e,t,n){var i=Math.max(1,e.getBandWidth()),a=n[1]-n[0];return{type:"Rect",shape:mN([t-i/2,n[0]],[i,a],vN(e))}}};function vN(e){return"x"===e.dim?0:1}var xN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(kv),bN=Pd(),wN=zr;function SN(e,t,n){if(!ur.node){var i=t.getZr();bN(i).records||(bN(i).records={}),function(e,t){if(bN(e).initialized)return;function n(n,i){e.on(n,(function(n){var a=function(e){var t={showTip:[],hideTip:[]},n=function(i){var a=t[i.type];a?a.push(i):(i.dispatchAction=n,e.dispatchAction(i))};return{dispatchAction:n,pendings:t}}(t);wN(bN(e).records,(function(e){e&&i(e,n,a.dispatchAction)})),function(e,t){var n,i=e.showTip.length,a=e.hideTip.length;i?n=e.showTip[i-1]:a&&(n=e.hideTip[a-1]);n&&(n.dispatchAction=null,t.dispatchAction(n))}(a.pendings,t)}))}bN(e).initialized=!0,n("click",Yr(_N,"click")),n("mousemove",Yr(_N,"mousemove")),n("globalout",CN)}(i,t),(bN(i).records[e]||(bN(i).records[e]={})).handler=n}}function CN(e,t,n){e.handler("leave",null,n)}function _N(e,t,n,i){t.handler(e,n,i)}function TN(e,t){if(!ur.node){var n=t.getZr();(bN(n).records||{})[e]&&(bN(n).records[e]=null)}}var IN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),a=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";SN("axisPointer",n,(function(e,t,n){"none"!==a&&("leave"===e||a.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},t.prototype.remove=function(e,t){TN("axisPointer",t)},t.prototype.dispose=function(e,t){TN("axisPointer",t)},t.type="axisPointer",t}(ww);function EN(e,t){var n,i=[],a=e.seriesIndex;if(null==a||!(n=t.getSeriesByIndex(a)))return{point:[]};var r=n.getData(),o=kd(r,e);if(null==o||o<0||Xr(o))return{point:[]};var s=r.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(e.isStacked){var p=l.getBaseAxis(),c=l.getOtherAxis(p).dim,d=p.dim,u="x"===c||"radius"===c?1:0,m=r.mapDimension(d),h=[];h[u]=r.get(m,o),h[1-u]=r.get(r.getCalculationInfo("stackResultDimension"),o),i=l.dataToPoint(h)||[]}else i=l.dataToPoint(r.getValues(Ur(l.dimensions,(function(e){return r.mapDimension(e)})),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var MN=Pd();function kN(e,t,n){var i=e.currTrigger,a=[e.x,e.y],r=e,o=e.dispatchAction||Kr(n.dispatchAction,n),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){FN(a)&&(a=EN({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},t).point);var l=FN(a),p=r.axesInfo,c=s.axesInfo,d="leave"===i||FN(a),u={},m={},h={list:[],map:{}},g={showPointer:Yr(DN,m),showTooltip:Yr(ON,h)};zr(s.coordSysMap,(function(e,t){var n=l||e.containPoint(a);zr(s.coordSysAxesInfo[t],(function(e,t){var i=e.axis,r=function(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}(p,e);if(!d&&n&&(!p||r)){var o=r&&r.value;null!=o||l||(o=i.pointToData(a)),null!=o&&PN(e,o,g,!1,u)}}))}));var f={};return zr(c,(function(e,t){var n=e.linkGroup;n&&!m[t]&&zr(n.axesInfo,(function(t,i){var a=m[i];if(t!==e&&a){var r=a.value;n.mapper&&(r=e.axis.scale.parse(n.mapper(r,AN(t),AN(e)))),f[e.key]=r}}))})),zr(f,(function(e,t){PN(c[t],e,g,!0,u)})),function(e,t,n){var i=n.axesInfo=[];zr(t,(function(t,n){var a=t.axisPointerModel.option,r=e[n];r?(!t.useHandle&&(a.status="show"),a.value=r.value,a.seriesDataIndices=(r.payloadBatch||[]).slice()):!t.useHandle&&(a.status="hide"),"show"===a.status&&i.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:a.value})}))}(m,c,u),function(e,t,n,i){if(FN(t)||!e.list.length)return void i({type:"hideTip"});var a=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:e.list})}(h,a,e,o),function(e,t,n){var i=n.getZr(),a="axisPointerLastHighlights",r=MN(i)[a]||{},o=MN(i)[a]={};zr(e,(function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&zr(n.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];zr(r,(function(e,t){!o[t]&&l.push(e)})),zr(o,(function(e,t){!r[t]&&s.push(e)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(c,0,n),u}}function PN(e,t,n,i,a){var r=e.axis;if(!r.scale.isBlank()&&r.containData(t))if(e.involveSeries){var o=function(e,t){var n=t.axis,i=n.dim,a=e,r=[],o=Number.MAX_VALUE,s=-1;return zr(t.seriesModels,(function(t,l){var p,c,d=t.getData().mapDimensionsAll(i);if(t.getAxisTooltipData){var u=t.getAxisTooltipData(d,e,n);c=u.dataIndices,p=u.nestestValue}else{if(!(c=t.getData().indicesOfNearest(d[0],e,"category"===n.type?.5:null)).length)return;p=t.getData().get(d[0],c[0])}if(null!=p&&isFinite(p)){var m=e-p,h=Math.abs(m);h<=o&&((h=0&&s<0)&&(o=h,s=m,a=p,r.length=0),zr(c,(function(e){r.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:r,snapToValue:a}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==a.seriesIndex&&Br(a,s[0]),!i&&e.snap&&r.containData(l)&&null!=l&&(t=l),n.showPointer(e,t,s),n.showTooltip(e,o,l)}else n.showPointer(e,t)}function DN(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function ON(e,t,n,i){var a=n.payloadBatch,r=t.axis,o=r.model,s=t.axisPointerModel;if(t.triggerTooltip&&a.length){var l=t.coordSys.model,p=Fk(l),c=e.map[p];c||(c=e.map[p]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:r.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function AN(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function FN(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function RN(e){Bk.registerAxisPointerClass("CartesianAxisPointer",gN),e.registerComponentModel(xN),e.registerComponentView(IN),e.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Xr(t)&&(e.axisPointer.link=[t])}})),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=Pk(e,t)})),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},kN)}function BN(e){dI(Kk),dI(RN)}var NN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var o=r.polar,s=o.getOtherAxis(r).getExtent(),l=r.dataToCoord(t),p=i.get("type");if(p&&"none"!==p){var c=sN(i),d=LN[p](r,o,l,s);d.style=c,e.graphicKey=d.type,e.pointer=d}var u=function(e,t,n,i,a){var r=t.axis,o=r.dataToCoord(e),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,p,c,d=i.getRadiusAxis().getExtent();if("radius"===r.dim){var u=[1,0,0,1,0,0];_s(u,u,s),Cs(u,u,[i.cx,i.cy]),l=Of([o,-a],u);var m=t.getModel("axisLabel").get("rotate")||0,h=_k.innerTextLayout(s,m*Math.PI/180,-1);p=h.textAlign,c=h.textVerticalAlign}else{var g=d[1];l=i.coordToPoint([g+a,o]);var f=i.cx,y=i.cy;p=Math.abs(l[0]-f)/g<.3?"center":l[0]>f?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:p,verticalAlign:c}}(t,n,0,o,i.get(["label","margin"]));lN(e,n,i,a,u)},t}(tN);var LN={line:function(e,t,n,i){return"angle"===e.dim?{type:"Line",shape:uN(t.coordToPoint([i[0],n]),t.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,i){var a=Math.max(1,e.getBandWidth()),r=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:hN(t.cx,t.cy,i[0],i[1],(-n-a/2)*r,(a/2-n)*r)}:{type:"Sector",shape:hN(t.cx,t.cy,n-a/2,n+a/2,0,2*Math.PI)}}},VN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(kv),qN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return We(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Fd).models[0]},t.type="polarAxis",t}(kv);qr(qN,lI);var GN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="angleAxis",t}(qN),zN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="radiusAxis",t}(qN),UN=function(e){function t(t,n){return e.call(this,"radius",t,n)||this}return We(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t}(RI);UN.prototype.dataToRadius=RI.prototype.dataToCoord,UN.prototype.radiusToData=RI.prototype.coordToData;var jN=Pd(),HN=function(e){function t(t,n){return e.call(this,"angle",t,n||[0,360])||this}return We(t,e),t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,i=n.getExtent(),a=n.count();if(i[1]-i[0]<1)return 0;var r=i[0],o=e.dataToCoord(r+1)-e.dataToCoord(r),s=Math.abs(o),l=xc(null==r?"":r+"",t.getFont(),"center","top"),p=Math.max(l.height,7)/s;isNaN(p)&&(p=1/0);var c=Math.max(0,Math.floor(p)),d=jN(e.model),u=d.lastAutoInterval,m=d.lastTickCount;return null!=u&&null!=m&&Math.abs(u-c)<=1&&Math.abs(m-a)<=1&&u>c?c=u:(d.lastTickCount=a,d.lastAutoInterval=c),c},t}(RI);HN.prototype.dataToAngle=RI.prototype.dataToCoord,HN.prototype.angleToData=RI.prototype.coordToData;var WN=["radius","angle"],$N=function(){function e(e){this.dimensions=WN,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new UN,this._angleAxis=new HN,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){return this["_"+e+"Axis"]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),r=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?r=o-360:o=r+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var l=Math.atan2(-n,t)/Math.PI*180,p=lo;)l+=360*p;return[s,l]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,i=t-this.cy,a=n*n+i*i-1e-4,r=this.r,o=this.r0;return a<=r*r&&a>=o*o}}},e.prototype.convertToPixel=function(e,t,n){return KN(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return KN(t)===this?this.pointToData(n):null},e}();function KN(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function YN(e,t){var n=this,i=n.getAngleAxis(),a=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===n){var t=e.getData();zr(sI(t,"radius"),(function(e){a.scale.unionExtentFromData(t,e)})),zr(sI(t,"angle"),(function(e){i.scale.unionExtentFromData(t,e)}))}})),eI(i.scale,i.model),eI(a.scale,a.model),"category"===i.type&&!i.onBand){var r=i.getExtent(),o=360/i.scale.count();i.inverse?r[1]+=o:r[1]-=o,i.setExtent(r[0],r[1])}}function XN(e,t){var n;if(e.type=t.get("type"),e.scale=tI(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),function(e){return"angleAxis"===e.mainType}(t)){e.inverse=e.inverse!==t.get("clockwise");var i=t.get("startAngle"),a=null!==(n=t.get("endAngle"))&&void 0!==n?n:i+(e.inverse?-360:360);e.setExtent(i,a)}t.axis=e,e.model=t}var ZN={dimensions:WN,create:function(e,t){var n=[];return e.eachComponent("polar",(function(e,i){var a=new $N(i+"");a.update=YN;var r=a.getRadiusAxis(),o=a.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");XN(r,s),XN(o,l),function(e,t,n){var i=t.get("center"),a=n.getWidth(),r=n.getHeight();e.cx=Wc(i[0],a),e.cy=Wc(i[1],r);var o=e.getRadiusAxis(),s=Math.min(a,r)/2,l=t.get("radius");null==l?l=[0,"100%"]:Xr(l)||(l=[0,l]);var p=[Wc(l[0],s),Wc(l[1],s)];o.inverse?o.setExtent(p[1],p[0]):o.setExtent(p[0],p[1])}(a,e,t),n.push(a),e.coordinateSystem=a,a.model=e})),e.eachSeries((function(e){if("polar"===e.get("coordinateSystem")){var t=e.getReferringComponents("polar",Fd).models[0];0,e.coordinateSystem=t.coordinateSystem}})),n}},QN=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function JN(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var i=e.coordToPoint([t[0],n]),a=e.coordToPoint([t[1],n]);return{x1:i[0],y1:i[1],x2:a[0],y2:a[1]}}function eL(e){return e.getRadiusAxis().inverse?0:1}function tL(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var nL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="PolarAxisPointer",n}return We(t,e),t.prototype.render=function(e,t){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,a=i.getRadiusAxis().getExtent(),r=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=Ur(n.getViewLabels(),(function(e){e=Ar(e);var t=n.scale,i="ordinal"===t.type?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(i),e}));tL(s),tL(r),zr(QN,(function(t){!e.get([t,"show"])||n.scale.isBlank()&&"axisLine"!==t||iL[t](this.group,e,i,r,o,a,s)}),this)}},t.type="angleAxis",t}(Bk),iL={axisLine:function(e,t,n,i,a,r){var o,s=t.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),p=Math.PI/180,c=l.getExtent(),d=eL(n),u=d?0:1,m=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(o=0===r[u]?new Hf[m]({shape:{cx:n.cx,cy:n.cy,r:r[d],startAngle:-c[0]*p,endAngle:-c[1]*p,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new Ag({shape:{cx:n.cx,cy:n.cy,r:r[d],r0:r[u]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,e.add(o)},axisTick:function(e,t,n,i,a,r){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=r[eL(n)],p=Ur(i,(function(e){return new Gg({shape:JN(n,[l,l+s],e.coord)})}));e.add(Ef(p,{style:Nr(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(e,t,n,i,a,r){if(a.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),p=r[eL(n)],c=[],d=0;dh?"left":"right",y=Math.abs(m[1]-g)/u<.3?"middle":m[1]>g?"top":"bottom";if(s&&s[d]){var v=s[d];to(v)&&v.textStyle&&(o=new xy(v.textStyle,l,l.ecModel))}var x=new Nm({silent:_k.isLabelSilent(t),style:Zf(o,{x:m[0],y:m[1],fill:o.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:f,verticalAlign:y})});if(e.add(x),c){var b=_k.makeAxisEventDataBase(t);b.targetType="axisLabel",b.value=i.rawLabel,Xm(x).eventData=b}}),this)},splitLine:function(e,t,n,i,a,r){var o=t.getModel("splitLine").getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var p=[],c=0;c=0?"p":"n",I=b;v&&(i[s][_]||(i[s][_]={p:b,n:b}),I=i[s][_][T]);var E=void 0,M=void 0,k=void 0,P=void 0;if("radius"===d.dim){var D=d.dataToCoord(C)-b,O=r.dataToCoord(_);Math.abs(D)=P})}}}))}var dL={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},uL={splitNumber:5},mL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="polar",t}(ww);function hL(e){dI(RN),Bk.registerAxisPointerClass("PolarAxisPointer",NN),e.registerCoordinateSystem("polar",ZN),e.registerComponentModel(VN),e.registerComponentView(mL),sk(e,"angle",GN,dL),sk(e,"radius",zN,uL),e.registerComponentView(nL),e.registerComponentView(oL),e.registerLayout(Yr(cL,"bar"))}function gL(e,t){t=t||{};var n=e.coordinateSystem,i=e.axis,a={},r=i.position,o=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],p={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};a.position=["vertical"===o?p.vertical[r]:l[0],"horizontal"===o?p.horizontal[r]:l[3]];a.rotation=Math.PI/2*{horizontal:0,vertical:1}[o];a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),po(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var c=t.rotate;return null==c&&(c=e.get(["axisLabel","rotate"])),a.labelRotation="top"===r?-c:c,a.z2=1,a}var fL=["axisLine","axisTickLabel","axisName"],yL=["splitArea","splitLine"],vL=(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="SingleAxisPointer",n}We(t,e),t.prototype.render=function(t,n,i,a){var r=this.group;r.removeAll();var o=this._axisGroup;this._axisGroup=new Rc;var s=gL(t),l=new _k(t,s);zr(fL,l.add,l),r.add(this._axisGroup),r.add(l.getGroup()),zr(yL,(function(e){t.get([e,"show"])&&vL[e](this,this.group,this._axisGroup,t)}),this),Rf(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,a)},t.prototype.remove=function(){Vk(this)},t.type="singleAxis"}(Bk),{splitLine:function(e,t,n,i){var a=i.axis;if(!a.scale.isBlank()){var r=i.getModel("splitLine"),o=r.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=o.get("width"),p=i.coordinateSystem.getRect(),c=a.isHorizontal(),d=[],u=0,m=a.getTicksCoords({tickModel:r}),h=[],g=[],f=0;f=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],a="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=0===a?n.y+n.height/2:n.x+n.width/2,i},e.prototype.convertToPixel=function(e,t,n){return SL(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return SL(t)===this?this.pointToData(n):null}}();function SL(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}var CL=["x","y"],_L=["width","height"],TL=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}We(t,e),t.prototype.makeElOption=function(e,t,n,i,a){var r=n.axis,o=r.coordinateSystem,s=EL(o,1-IL(r)),l=o.dataToPoint(t)[0],p=i.get("type");if(p&&"none"!==p){var c=sN(i),d=TL[p](r,l,s);d.style=c,e.graphicKey=d.type,e.pointer=d}dN(t,e,gL(n),n,i,a)},t.prototype.getHandleTransform=function(e,t,n){var i=gL(t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var a=cN(t.axis,e,i);return{x:a[0],y:a[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var a=n.axis,r=a.coordinateSystem,o=IL(a),s=EL(r,o),l=[e.x,e.y];l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var p=EL(r,1-o),c=(p[1]+p[0])/2,d=[c,c];return d[o]=l[o],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}}}(tN),{line:function(e,t,n){return{type:"Line",subPixelOptimize:!0,shape:uN([t,n[0]],[t,n[1]],IL(e))}},shadow:function(e,t,n){var i=e.getBandWidth(),a=n[1]-n[0];return{type:"Rect",shape:mN([t-i/2,n[0]],[i,a],IL(e))}}});function IL(e){return e.isHorizontal()?0:1}function EL(e,t){var n=e.getRect();return[n[CL[t]],n[CL[t]]+n[_L[t]]]}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.type="single"}(ww);!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.init=function(t,n,i){var a=Iv(t);e.prototype.init.apply(this,arguments),ML(t,a)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),ML(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}}}(kv);function ML(e,t){var n,i=e.cellSize;1===(n=Xr(i)?i:e.cellSize=[i,i]).length&&(n[1]=n[0]);var a=Ur([0,1],(function(e){return function(e,t){return null!=e[xv[t][0]]||null!=e[xv[t][1]]&&null!=e[xv[t][2]]}(t,e)&&(n[e]="auto"),null!=n[e]&&"auto"!==n[e]}));Tv(e,t,{type:"box",ignoreSize:a})}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.render=function(e,t,n){var i=this.group;i.removeAll();var a=e.coordinateSystem,r=a.getRangeInfo(),o=a.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,r,i),this._renderLines(e,r,o,i),this._renderYearText(e,r,o,i),this._renderMonthText(e,s,o,i),this._renderWeekText(e,s,r,o,i)},t.prototype._renderDayRect=function(e,t,n){for(var i=e.coordinateSystem,a=e.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),o=i.getCellHeight(),s=t.start.time;s<=t.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,p=new Fm({shape:{x:l[0],y:l[1],width:r,height:o},cursor:"default",style:a});n.add(p)}},t.prototype._renderLines=function(e,t,n,i){var a=this,r=e.coordinateSystem,o=e.getModel(["splitLine","lineStyle"]).getLineStyle(),s=e.get(["splitLine","show"]),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var p=t.start,c=0;p.time<=t.end.time;c++){u(p.formatedDate),0===c&&(p=r.getDateInfo(t.start.y+"-"+t.start.m));var d=p.date;d.setMonth(d.getMonth()+1),p=r.getDateInfo(d)}function u(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var l=a._getLinePointsOfOneWeek(e,t,n);a._tlpoints.push(l[0]),a._blpoints.push(l[l.length-1]),s&&a._drawSplitline(l,o,i)}u(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,l,n),o,i),s&&this._drawSplitline(a._getEdgesPoints(a._blpoints,l,n),o,i)},t.prototype._getEdgesPoints=function(e,t,n){var i=[e[0].slice(),e[e.length-1].slice()],a="horizontal"===n?0:1;return i[0][a]=i[0][a]-t/2,i[1][a]=i[1][a]+t/2,i},t.prototype._drawSplitline=function(e,t,n){var i=new Lg({z2:20,shape:{points:e},style:t});n.add(i)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var i=e.coordinateSystem,a=i.getDateInfo(t),r=[],o=0;o<7;o++){var s=i.getNextNDay(a.time,o),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},t.prototype._formatterLabel=function(e,t){return Qr(e)&&e?(n=e,zr(t,(function(e,t){n=n.replace("{"+t+"}",i?os(e):e)})),n):Zr(e)?e(t):t.nameMap;var n,i},t.prototype._yearTextPositionControl=function(e,t,n,i,a){var r=t[0],o=t[1],s=["center","bottom"];"bottom"===i?(o+=a,s=["center","top"]):"left"===i?r-=a:"right"===i?(r+=a,s=["center","top"]):o-=a;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:r,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,i){var a=e.getModel("yearLabel");if(a.get("show")){var r=a.get("margin"),o=a.get("position");o||(o="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,p=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,d={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],p],right:[s[c][0],p]},u=t.start.y;+t.end.y>+t.start.y&&(u=u+"-"+t.end.y);var m=a.get("formatter"),h={start:t.start.y,end:t.end.y,nameMap:u},g=this._formatterLabel(m,h),f=new Nm({z2:30,style:Zf(a,{text:g})});f.attr(this._yearTextPositionControl(f,d[o],n,o,r)),i.add(f)}},t.prototype._monthTextPositionControl=function(e,t,n,i,a){var r="left",o="top",s=e[0],l=e[1];return"horizontal"===n?(l+=a,t&&(r="center"),"start"===i&&(o="bottom")):(s+=a,t&&(o="middle"),"start"===i&&(r="right")),{x:s,y:l,align:r,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n,i){var a=e.getModel("monthLabel");if(a.get("show")){var r=a.get("nameMap"),o=a.get("margin"),s=a.get("position"),l=a.get("align"),p=[this._tlpoints,this._blpoints];r&&!Qr(r)||(r&&(t=Py(r)||t),r=t.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,d="horizontal"===n?0:1;o="start"===s?-o:o;for(var u="center"===l,m=0;m=i.start.time&&n.timeo.end.time&&e.reverse(),e},e.prototype._getRangeInfo=function(e){var t,n=[this.getDateInfo(e[0]),this.getDateInfo(e[1])];n[0].time>n[1].time&&(t=!0,n.reverse());var i=Math.floor(n[1].time/kL)-Math.floor(n[0].time/kL)+1,a=new Date(n[0].time),r=a.getDate(),o=n[1].date.getDate();a.setDate(r+i-1);var s=a.getDate();if(s!==o)for(var l=a.getTime()-n[1].time>0?1:-1;(s=a.getDate())!==o&&(a.getTime()-n[1].time)*l>0;)i-=l,a.setDate(s-l);var p=Math.floor((i+n[0].day+6)/7),c=t?1-p:p-1;return t&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:p,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||0===e&&ti.lweek)return null;var a=7*(e-1)-i.fweek+t,r=new Date(i.start.time);return r.setDate(+i.start.d+a),this.getDateInfo(r)},e.create=function(t,n){var i=[];return t.eachComponent("calendar",(function(a){var r=new e(a,t,n);i.push(r),a.coordinateSystem=r})),t.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},e.dimensions=["time","value"]}();function PL(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function DL(e,t){var n;return zr(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)})),n}var OL=["transition","enterFrom","leaveTo"],AL=OL.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function FL(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var i=n?OL:AL,a=0;a=0;l--){var u,m,h;if(h=null!=(m=Id((u=n[l]).id,null))?a.get(m):null){var g=h.parent,f=(d=BL(g),{}),y=Cv(h,u,g===i?{width:r,height:o}:{width:d.width,height:d.height},null,{hv:u.hv,boundingMode:u.bounding},f);if(!BL(h).isNew&&y){for(var v=u.transition,x={},b=0;b=0)?x[w]=S:h[w]=S}pf(h,x,e,0)}else h.attr(f)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each((function(n){VL(n,BL(n).option,t,e._lastGraphicModel)})),this._elMap=Co()},t.prototype.dispose=function(){this._clear()},t.type="graphic"}(ww);function NL(e){var t=Eo(RL,e)?RL[e]:Cf(e);var n=new t({});return BL(n).type=e,n}function LL(e,t,n,i){var a=NL(n);return t.add(a),i.set(e,a),BL(a).id=e,BL(a).isNew=!0,a}function VL(e,t,n,i){e&&e.parent&&("group"===e.type&&e.traverse((function(e){VL(e,t,n,i)})),pB(e,t,i),n.removeKey(BL(e).id))}function qL(e,t,n,i){e.isGroup||zr([["cursor",bu.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];Eo(t,i)?e[i]=co(t[i],n[1]):null==e[i]&&(e[i]=n[1])})),zr($r(t),(function(n){if(0===n.indexOf("on")){var i=t[n];e[n]=Zr(i)?i:null}})),Eo(t,"draggable")&&(e.draggable=t.draggable),null!=t.name&&(e.name=t.name),null!=t.id&&(e.id=t.id)}var GL=["x","y","radius","angle","single"],zL=["cartesian2d","polar","singleAxis"];function UL(e){return e+"Axis"}function jL(e,t){var n,i=Co(),a=[],r=Co();e.eachComponent({mainType:"dataZoom",query:t},(function(e){r.get(e.uid)||s(e)}));do{n=!1,e.eachComponent("dataZoom",o)}while(n);function o(e){!r.get(e.uid)&&function(e){var t=!1;return e.eachTargetAxis((function(e,n){var a=i.get(e);a&&a[n]&&(t=!0)})),t}(e)&&(s(e),n=!0)}function s(e){r.set(e.uid,!0),a.push(e),e.eachTargetAxis((function(e,t){(i.get(e)||i.set(e,[]))[t]=!0}))}return a}function HL(e){var t=e.ecModel,n={infoList:[],infoMap:Co()};return e.eachTargetAxis((function(e,i){var a=t.getComponent(UL(e),i);if(a){var r=a.getCoordSysModel();if(r){var o=r.uid,s=n.infoMap.get(o);s||(s={model:r,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(a)}}})),n}var WL=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),$L=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return We(t,e),t.prototype.init=function(e,t,n){var i=KL(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=KL(e);Fr(this.option,e,!0),Fr(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;zr([["start","startValue"],["end","endValue"]],(function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)}),this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=Co();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each((function(e){e.indexList.length&&(this._noTarget=!1)}),this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return zr(GL,(function(n){var i=this.getReferringComponents(UL(n),Rd);if(i.specified){t=!0;var a=new WL;zr(i.models,(function(e){a.add(e.componentIndex)})),e.set(n,a)}}),this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0;if(i){var a="vertical"===t?"y":"x";r(n.findComponents({mainType:a+"Axis"}),a)}i&&r(n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}}),"single");function r(t,n){var a=t[0];if(a){var r=new WL;if(r.add(a.componentIndex),e.set(n,r),i=!1,"x"===n||"y"===n){var o=a.getReferringComponents("grid",Fd).models[0];o&&zr(t,(function(e){a.componentIndex!==e.componentIndex&&o===e.getReferringComponents("grid",Fd).models[0]&&r.add(e.componentIndex)}))}}}i&&zr(GL,(function(t){if(i){var a=n.findComponents({mainType:UL(t),filter:function(e){return"category"===e.get("type",!0)}});if(a[0]){var r=new WL;r.add(a[0].componentIndex),e.set(t,r),i=!1}}}),this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis((function(t){!e&&(e=t)}),this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");zr([["start","startValue"],["end","endValue"]],(function(i,a){var r=null!=e[i[0]],o=null!=e[i[1]];r&&!o?t[a]="percent":!r&&o?t[a]="value":n?t[a]=n[a]:r&&(t[a]="percent")}))},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis((function(t,n){null==e&&(e=this.ecModel.getComponent(UL(t),n))}),this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each((function(n,i){zr(n.indexList,(function(n){e.call(t,i,n)}))}))},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(UL(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;zr([["start","startValue"],["end","endValue"]],(function(i){null==e[i[0]]&&null==e[i[1]]||(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])}),this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;zr(["start","startValue","end","endValue"],(function(n){t[n]=e[n]}))},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){var n;if(null==e&&null==t){if(n=this.findRepresentativeAxisProxy())return n.getDataValueWindow()}else if(n=this.getAxisProxy(e,t))return n.getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;i=0}(t)){var n=UL(this._dimName),i=t.getReferringComponents(n,Fd).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}}),this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return Ar(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,i=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),r=[0,100],o=[],s=[];XL(["start","end"],(function(l,p){var c=e[l],d=e[l+"Value"];"percent"===a[p]?(null==c&&(c=r[p]),d=i.parse(Hc(c,r,n))):(t=!0,c=Hc(d=null==d?n[p]:i.parse(d),n,r)),s[p]=null==d||isNaN(d)?n[p]:d,o[p]=null==c||isNaN(c)?r[p]:c})),ZL(s),ZL(o);var l=this._minMaxSpan;function p(e,t,n,a,r){var o=r?"Span":"ValueSpan";EA(0,e,n,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=Hc(e[s],n,a,!0),r&&(t[s]=i.parse(t[s]))}return t?p(s,o,n,r,!1):p(o,s,r,n,!0),{valueWindow:s,percentWindow:o}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,n){var i=[1/0,-1/0];XL(n,(function(e){!function(e,t,n){t&&zr(sI(t,n),(function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])}))}(i,e.getData(),t)}));var a=e.getAxisModel(),r=ZT(a.axis.scale,a,i).calculate();return[r.min,r.max]}(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),a=e.get("filterMode"),r=this._valueWindow;"none"!==a&&XL(i,(function(e){var t=e.getData(),i=t.mapDimensionsAll(n);if(i.length){if("weakFilter"===a){var o=t.getStore(),s=Ur(i,(function(e){return t.getDimensionIndex(e)}),t);t.filterSelf((function(e){for(var t,n,a,l=0;lr[1];if(c&&!d&&!u)return!0;c&&(a=!0),d&&(t=!0),u&&(n=!0)}return a&&t&&n}))}else XL(i,(function(n){if("empty"===a)e.setData(t=t.map(n,(function(e){return function(e){return e>=r[0]&&e<=r[1]}(e)?e:NaN})));else{var i={};i[n]=r,t.selectRange(i)}}));XL(i,(function(e){t.setApproximateExtent(r,e)}))}}))}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;XL(["min","max"],(function(i){var a=t.get(i+"Span"),r=t.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),null!=r?a=Hc(n[0]+r,n,[0,100],!0):null!=a&&(r=Hc(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=r}),this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=Zc(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;0!==t[0]&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},e}();var JL={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,a){var r=e.getComponent(UL(i),a);t(i,a,r,n)}))}))}t((function(e,t,n,i){n.__dzAxisProxy=null}));var n=[];t((function(t,i,a,r){a.__dzAxisProxy||(a.__dzAxisProxy=new QL(t,i,r,e),n.push(a.__dzAxisProxy))}));var i=Co();return zr(n,(function(e){zr(e.getTargetSeriesModels(),(function(e){i.set(e.uid,e)}))})),i},overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(t,n){var i=e.getAxisProxy(t,n);i&&i.reset(e)})),e.eachTargetAxis((function(n,i){var a=e.getAxisProxy(n,i);a&&a.filterData(e,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var eV=!1;function tV(e){eV||(eV=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,JL),function(e){e.registerAction("dataZoom",(function(e,t){zr(jL(t,e),(function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}))}(e),e.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}var nV=function(){},iV={};function aV(e){return iV[e]}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;zr(this.option.feature,(function(e,n){var i=aV(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),Fr(e,i.defaultOption))}))},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}}}(kv);function rV(e,t){var n=pv(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Fm({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}We(t,e),t.prototype.render=function(e,t,n,i){var a=this.group;if(a.removeAll(),e.get("show")){var r=+e.get("itemSize"),o="vertical"===e.get("orient"),s=e.get("feature")||{},l=this._features||(this._features={}),p=[];zr(s,(function(e,t){p.push(t)})),new S_(this._featureNames||[],p).add(c).update(c).remove(Yr(c,null)).execute(),this._featureNames=p,function(e,t,n){var i=t.getBoxLayoutParams(),a=t.get("padding"),r={width:n.getWidth(),height:n.getHeight()},o=Sv(i,r,a);wv(t.get("orient"),e,t.get("itemGap"),o.width,o.height),Cv(e,i,r,a)}(a,e,n),a.add(rV(a.getBoundingRect(),e)),o||a.eachChild((function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),s=e.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Zr(l)&&t){var p=l.style||(l.style={}),c=xc(t,Nm.makeFont(p)),d=e.x+a.x,u=!1;e.y+a.y+r+c.height>n.getHeight()&&(o.position="top",u=!0);var m=u?-5-c.height:r+10;d+c.width/2>n.getWidth()?(o.position=["100%",m],p.align="right"):d-c.width/2<0&&(o.position=[0,m],p.align="left")}}))}function c(c,d){var u,m=p[c],h=p[d],g=s[m],f=new xy(g,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===m&&(g.title=i.newTitle),m&&!h){if(function(e){return 0===e.indexOf("my")}(m))u={onclick:f.option.onclick,featureName:m};else{var y=aV(m);if(!y)return;u=new y}l[m]=u}else if(!(u=l[h]))return;u.uid=wy("toolbox-feature"),u.model=f,u.ecModel=t,u.api=n;var v=u instanceof nV;m||!h?!f.get("show")||v&&u.unusable?v&&u.remove&&u.remove(t,n):(!function(i,s,l){var p,c,d=i.getModel("iconStyle"),u=i.getModel(["emphasis","iconStyle"]),m=s instanceof nV&&s.getIcons?s.getIcons():i.get("icon"),h=i.get("title")||{};Qr(m)?(p={})[l]=m:p=m;Qr(h)?(c={})[l]=h:c=h;var g=i.iconPaths={};zr(p,(function(l,p){var m=Lf(l,{},{x:-r/2,y:-r/2,width:r,height:r});m.setStyle(d.getItemStyle()),m.ensureState("emphasis").style=u.getItemStyle();var h=new Nm({style:{text:c[p],align:u.get("textAlign"),borderRadius:u.get("textBorderRadius"),padding:u.get("textPadding"),fill:null,font:iy({fontStyle:u.get("textFontStyle"),fontFamily:u.get("textFontFamily"),fontSize:u.get("textFontSize"),fontWeight:u.get("textFontWeight")},t)},ignore:!0});m.setTextContent(h),zf({el:m,componentModel:e,itemName:p,formatterParamsExtra:{title:c[p]}}),m.__title=c[p],m.on("mouseover",(function(){var t=u.getItemStyle(),i=o?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";h.setStyle({fill:u.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:u.get("textBackgroundColor")}),m.setTextConfig({position:u.get("textPosition")||i}),h.ignore=!e.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",p])&&n.leaveEmphasis(this),h.hide()})),("emphasis"===i.get(["iconStatus",p])?Th:Ih)(m),a.add(m),m.on("click",Kr(s.onclick,s,t,n,p)),g[p]=m}))}(f,u,m),f.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?Th:Ih)(i[e])},u instanceof nV&&u.render&&u.render(f,t,n,i)):v&&u.dispose&&u.dispose(t,n)}},t.prototype.updateView=function(e,t,n,i){zr(this._features,(function(e){e instanceof nV&&e.updateView&&e.updateView(e.model,t,n,i)}))},t.prototype.remove=function(e,t){zr(this._features,(function(n){n instanceof nV&&n.remove&&n.remove(e,t)})),this.group.removeAll()},t.prototype.dispose=function(e,t){zr(this._features,(function(n){n instanceof nV&&n.dispose&&n.dispose(e,t)}))},t.type="toolbox"}(ww);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}We(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",a="svg"===t.getZr().painter.getType(),r=a?"svg":n.get("type",!0)||"png",o=t.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=ur.browser;if(Zr(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+r,l.target="_blank",l.href=o;var p=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(p)}else if(window.navigator.msSaveOrOpenBlob||a){var c=o.split(","),d=c[0].indexOf("base64")>-1,u=a?decodeURIComponent(c[1]):c[1];d&&(u=window.atob(u));var m=i+"."+r;if(window.navigator.msSaveOrOpenBlob){for(var h=u.length,g=new Uint8Array(h);h--;)g[h]=u.charCodeAt(h);var f=new Blob([g]);window.navigator.msSaveOrOpenBlob(f,m)}else{var y=document.createElement("iframe");document.body.appendChild(y);var v=y.contentWindow,x=v.document;x.open("image/svg+xml","replace"),x.write(u),x.close(),v.focus(),x.execCommand("SaveAs",!0,m),document.body.removeChild(y)}}else{var b=n.get("lang"),w='',S=window.open();S.document.write(w),S.document.title=i}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}}}(nV);var oV="__ec_magicType_stack__",sV=[["line","bar"],["stack"]],lV=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}We(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return zr(e.get("type"),(function(e){t[e]&&(n[e]=t[e])})),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i=this.model,a=i.get(["seriesIndex",n]);if(lV[n]){var r,o={series:[]};zr(sV,(function(e){Lr(e,n)>=0&&zr(e,(function(e){i.setIconStatus(e,"normal")}))})),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==a?null:{seriesIndex:a}},(function(e){var t=e.subType,a=e.id,r=lV[n](t,a,e,i);r&&(Nr(r,e.option),o.series.push(r));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var p=l.dim+"Axis",c=e.getReferringComponents(p,Fd).models[0].componentIndex;o[p]=o[p]||[];for(var d=0;d<=c;d++)o[p][c]=o[p][c]||{};o[p][c].boundaryGap="bar"===n}}}));var s=n;"stack"===n&&(r=Fr({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:o,newTitle:r,featureName:"magicType"})}}}(nV),{line:function(e,t,n,i){if("bar"===e)return Fr({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return Fr({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var a=n.get("stack")===oV;if("line"===e||"bar"===e)return i.setIconStatus("stack",a?"normal":"emphasis"),Fr({id:t,stack:a?"":oV},i.get(["option","stack"])||{},!0)}});h_({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)}));var pV=new Array(60).join("-"),cV="\t";function dV(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var uV=new RegExp("[\t]+","g");function mV(e,t){var n=e.split(new RegExp("\n*"+pV+"\n*","g")),i={series:[]};return zr(n,(function(e,n){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(cV)>=0)return!0}(e)){var a=function(e){for(var t=e.split(/\n+/g),n=[],i=Ur(dV(t.shift()).split(uV),(function(e){return{name:e,data:[]}})),a=0;a=0)&&e(a,i._targetInfoList)}))}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,(function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=TV[e.brushType](0,n,t);e.__rangeOffset={offset:EV[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}})),e},e.prototype.matchOutputRanges=function(e,t,n){zr(e,(function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&zr(i.coordSyses,(function(i){var a=TV[e.brushType](1,i,e.range,!0);n(e,a.values,i,t)}))}),this)},e.prototype.setInputRanges=function(e,t){zr(e,(function(e){var n,i,a,r,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=TV[e.brushType](0,s.coordSys,e.coordRange),p=e.__rangeOffset;e.range=p?EV[e.brushType](l.values,p.offset,(n=l.xyMinMax,i=p.xyMinMax,a=kV(n),r=kV(i),o=[a[0]/r[0],a[1]/r[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},e.prototype.makePanelOpts=function(e,t){return Ur(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:EF(i),isTargetByCursor:kF(i,e,n.coordSysModel),getLinearBrushOtherExtent:MF(i)}}))},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&Lr(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=wV(t,e),a=0;ae[1]&&e.reverse(),e}function wV(e,t){return Od(e,t,{includeMainTypes:vV})}var SV={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,a=e.gridModels,r=Co(),o={},s={};(n||i||a)&&(zr(n,(function(e){var t=e.axis.grid.model;r.set(t.id,t),o[t.id]=!0})),zr(i,(function(e){var t=e.axis.grid.model;r.set(t.id,t),s[t.id]=!0})),zr(a,(function(e){r.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),r.each((function(e){var a=e.coordinateSystem,r=[];zr(a.getCartesians(),(function(e,t){(Lr(n,e.getAxis("x").model)>=0||Lr(i,e.getAxis("y").model)>=0)&&r.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:r[0],coordSyses:r,getPanelRect:_V.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){zr(e.geoModels,(function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:_V.geo})}))}},CV=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,a=e.gridModel;return!a&&n&&(a=n.axis.grid.model),!a&&i&&(a=i.axis.grid.model),a&&a===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],_V={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(Df(e)),t}},TV={lineX:Yr(IV,0),lineY:Yr(IV,1),rect:function(e,t,n,i){var a=e?t.pointToData([n[0][0],n[1][0]],i):t.dataToPoint([n[0][0],n[1][0]],i),r=e?t.pointToData([n[0][1],n[1][1]],i):t.dataToPoint([n[0][1],n[1][1]],i),o=[bV([a[0],r[0]]),bV([a[1],r[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,n,i){var a=[[1/0,-1/0],[1/0,-1/0]];return{values:Ur(n,(function(n){var r=e?t.pointToData(n,i):t.dataToPoint(n,i);return a[0][0]=Math.min(a[0][0],r[0]),a[1][0]=Math.min(a[1][0],r[1]),a[0][1]=Math.max(a[0][1],r[0]),a[1][1]=Math.max(a[1][1],r[1]),r})),xyMinMax:a}}};function IV(e,t,n,i){var a=n.getAxis(["x","y"][e]),r=bV(Ur([0,1],(function(e){return t?a.coordToData(a.toLocalCoord(i[e]),!0):a.toGlobalCoord(a.dataToCoord(i[e]))}))),o=[];return o[e]=r,o[1-e]=[NaN,NaN],{values:r,xyMinMax:o}}var EV={lineX:Yr(MV,0),lineY:Yr(MV,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return Ur(e,(function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]}))}};function MV(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function kV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var PV,DV,OV=zr,AV=yd+"toolbox-dataZoom_",FV=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}We(t,e),t.prototype.render=function(e,t,n,i){this._brushController||(this._brushController=new XA(n.getZr()),this._brushController.on("brush",Kr(this._onBrush,this)).mount()),function(e,t,n,i,a){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=r,e.setIconStatus("zoom",r?"emphasis":"normal");var o=new xV(RV(e),t,{include:["grid"]}),s=o.makePanelOpts(a,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!r||!s.length)&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,i,n),function(e,t){e.setIconStatus("back",function(e){return yV(e).length}(t)>1?"emphasis":"normal")}(e,t)},t.prototype.onclick=function(e,t,n){FV[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new xV(RV(this.model),i,{include:["grid"]}).matchOutputRanges(t,i,(function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(a("x",n,t[0]),a("y",n,t[1])):a({lineX:"x",lineY:"y"}[i],n,t)}})),function(e,t){var n=yV(e);gV(t,(function(t,i){for(var a=n.length-1;a>=0&&!n[a][i];a--);if(a<0){var r=e.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var o=r.getPercentRange();n[0][i]={dataZoomId:i,start:o[0],end:o[1]}}}})),n.push(t)}(i,n),this._dispatchZoomAction(n)}function a(e,t,a){var r=t.getAxis(e),o=r.model,s=function(e,t,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(e,t.componentIndex)&&(i=n)})),i}(e,o,i),l=s.findRepresentativeAxisProxy(o);if(l){var p=l.getMinMaxSpan();null==p.minValueSpan&&null==p.maxValueSpan||(a=EA(0,a.slice(),r.scale.getExtent(),0,p.minValueSpan,p.maxValueSpan))}s&&(n[s.id]={dataZoomId:s.id,startValue:a[0],endValue:a[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];OV(e,(function(e,n){t.push(Ar(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}}}(nV),{zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(function(e){var t=yV(e),n=t[t.length-1];t.length>1&&t.pop();var i={};return gV(n,(function(e,n){for(var a=t.length-1;a>=0;a--)if(e=t[a][n]){i[n]=e;break}})),i}(this.ecModel))}});function RV(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}PV="dataZoom",DV=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var i=t.getModel(n),a=[],r=Od(e,RV(i));return OV(r.xAxisModels,(function(e){return o(e,"xAxis","xAxisIndex")})),OV(r.yAxisModels,(function(e){return o(e,"yAxis","yAxisIndex")})),a}function o(e,t,n){var r=e.componentIndex,o={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:AV+t+r};o[n]=r,a.push(o)}},go(null==Zv.get(PV)&&DV),Zv.set(PV,DV);var BV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(kv);function NV(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function LV(e){if(ur.domSupported)for(var t=document.documentElement.style,n=0,i=e.length;n-1?(p+="top:50%",c+="translateY(-50%) rotate("+(o="left"===s?-225:-45)+"deg)"):(p+="left:50%",c+="translateX(-50%) rotate("+(o="top"===s?225:45)+"deg)");var d=o*Math.PI/180,u=l+a,m=u*Math.abs(Math.cos(d))+u*Math.abs(Math.sin(d)),h=t+" solid "+a+"px;";return'
'}(n,i,a)),Qr(e))r.innerHTML=e+o;else if(e){r.innerHTML="",Xr(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,i=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var a=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&a.manuallyShowTip(e,t,n,{x:a._lastX,y:a._lastY,dataByCoordSys:a._lastDataByCoordSys})}))}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!ur.node&&n.getDom()){var a=tq(i,n);this._ticket="";var r=i.dataByCoordSys,o=function(e,t,n){var i=Ad(e).queryOptionMap,a=i.keys()[0];if(!a||"series"===a)return;var r=Bd(t,a,i.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=r.models[0];if(!o)return;var s,l=n.getViewOfComponentModel(o);if(l.group.traverse((function(t){var n=Xm(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0})),s)return{componentMainType:a,componentIndex:o.componentIndex,el:s}}(i,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:i.position,positionDefault:"bottom"},a)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=QV;l.x=i.x,l.y=i.y,l.update(),Xm(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},a)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},a);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var p=EN(i,t),c=p.point[0],d=p.point[1];null!=c&&null!=d&&this._tryShow({offsetX:c,offsetY:d,target:p.el,position:i.position,positionDefault:"bottom"},a)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},a))}},t.prototype.manuallyHideTip=function(e,t,n,i){var a=this._tooltipContent;this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(tq(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var a=i.seriesIndex,r=i.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=r&&null!=o){var s=t.getSeriesByIndex(a);if(s)if("axis"===eq([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:r,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i=e.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,e);else if(n){var a,r;if("legend"===Xm(n).ssrType)return;this._lastDataByCoordSys=null,TS(n,(function(e){return null!=Xm(e).dataIndex?(a=e,!0):null!=Xm(e).tooltipConfig?(r=e,!0):void 0}),!0),a?this._showSeriesItemTooltip(e,a,t):r?this._showComponentItemTooltip(e,r,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=Kr(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,a=[t.offsetX,t.offsetY],r=eq([t.tooltipOption],i),o=this._renderMode,s=[],l=Zb("section",{blocks:[],noHeader:!0}),p=[],c=new lw;zr(e,(function(e){zr(e.dataByAxis,(function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),a=e.value;if(t&&t.axis&&null!=a){var r=pN(a,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),d=Zb("section",{header:r,noHeader:!fo(r),sortBlocks:!0,blocks:[]});l.blocks.push(d),zr(e.seriesDataIndices,(function(l){var u=n.getSeriesByIndex(l.seriesIndex),m=l.dataIndexInside,h=u.getDataParams(m);if(!(h.dataIndex<0)){h.axisDim=e.axisDim,h.axisIndex=e.axisIndex,h.axisType=e.axisType,h.axisId=e.axisId,h.axisValue=iI(t.axis,{value:a}),h.axisValueLabel=r,h.marker=c.makeTooltipMarker("item",gv(h.color),o);var g=mb(u.formatTooltip(m,!0,null)),f=g.frag;if(f){var y=eq([u],i).get("valueFormatter");d.blocks.push(y?Br({valueFormatter:y},f):f)}g.text&&p.push(g.text),s.push(h)}}))}}))})),l.blocks.reverse(),p.reverse();var d=t.position,u=r.get("order"),m=iw(l,c,o,u,n.get("useUTC"),r.get("textStyle"));m&&p.unshift(m);var h="richText"===o?"\n\n":"
",g=p.join(h);this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(r,d,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(r,g,s,Math.random()+"",a[0],a[1],d,null,c)}))},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=this._ecModel,a=Xm(t),r=a.seriesIndex,o=i.getSeriesByIndex(r),s=a.dataModel||o,l=a.dataIndex,p=a.dataType,c=s.getData(p),d=this._renderMode,u=e.positionDefault,m=eq([c.getItemModel(l),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,u?{position:u}:null),h=m.get("trigger");if(null==h||"item"===h){var g=s.getDataParams(l,p),f=new lw;g.marker=f.makeTooltipMarker("item",gv(g.color),d);var y=mb(s.formatTooltip(l,!1,p)),v=m.get("order"),x=m.get("valueFormatter"),b=y.frag,w=b?iw(x?Br({valueFormatter:x},b):b,f,d,v,i.get("useUTC"),m.get("textStyle")):y.text,S="item_"+s.name+"_"+l;this._showOrMove(m,(function(){this._showTooltipContent(m,w,g,S,e.offsetX,e.offsetY,e.position,e.target,f)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:r,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=Xm(t),a=i.tooltipConfig.option||{};if(Qr(a)){a={content:a,formatter:a}}var r=[a],o=this._ecModel.getComponent(i.componentMainType,i.componentIndex);o&&r.push(o),r.push({formatter:a.content});var s=e.positionDefault,l=eq(r,this._tooltipModel,s?{position:s}:null),p=l.get("content"),c=Math.random()+"",d=new lw;this._showOrMove(l,(function(){var n=Ar(l.get("formatterParams")||{});this._showTooltipContent(l,p,n,c,e.offsetX,e.offsetY,e.position,t,d)})),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,a,r,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var p=this._tooltipContent;p.setEnterable(e.get("enterable"));var c=e.get("formatter");o=o||e.get("position");var d=t,u=this._getNearestPoint([a,r],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(Qr(c)){var m=e.ecModel.get("useUTC"),h=Xr(n)?n[0]:n;d=c,h&&h.axisType&&h.axisType.indexOf("time")>=0&&(d=jy(h.axisValue,d,m)),d=mv(d,n,!0)}else if(Zr(c)){var g=Kr((function(t,i){t===this._ticket&&(p.setContent(i,l,e,u,o),this._updatePosition(e,o,a,r,p,n,s))}),this);this._ticket=i,d=c(n,i,g)}else d=c;p.setContent(d,l,e,u,o),p.show(e,u),this._updatePosition(e,o,a,r,p,n,s)}},t.prototype._getNearestPoint=function(e,t,n,i){return"axis"===n||Xr(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:Xr(t)?void 0:{color:i||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,a,r,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var p=a.getSize(),c=e.get("align"),d=e.get("verticalAlign"),u=o&&o.getBoundingRect().clone();if(o&&u.applyTransform(o.transform),Zr(t)&&(t=t([n,i],r,a.el,u,{viewSize:[s,l],contentSize:p.slice()})),Xr(t))n=Wc(t[0],s),i=Wc(t[1],l);else if(to(t)){var m=t;m.width=p[0],m.height=p[1];var h=Sv(m,{width:s,height:l});n=h.x,i=h.y,c=null,d=null}else if(Qr(t)&&o){var g=function(e,t,n,i){var a=n[0],r=n[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,p=t.width,c=t.height;switch(e){case"inside":s=t.x+p/2-a/2,l=t.y+c/2-r/2;break;case"top":s=t.x+p/2-a/2,l=t.y-r-o;break;case"bottom":s=t.x+p/2-a/2,l=t.y+c+o;break;case"left":s=t.x-a-o,l=t.y+c/2-r/2;break;case"right":s=t.x+p+o,l=t.y+c/2-r/2}return[s,l]}(t,u,p,e.get("borderWidth"));n=g[0],i=g[1]}else{g=function(e,t,n,i,a,r,o){var s=n.getSize(),l=s[0],p=s[1];null!=r&&(e+l+r+2>i?e-=l+r:e+=r);null!=o&&(t+p+o>a?t-=p+o:t+=o);return[e,t]}(n,i,a,s,l,c?null:20,d?null:20);n=g[0],i=g[1]}if(c&&(n-=nq(c)?p[0]/2:"right"===c?p[0]:0),d&&(i-=nq(d)?p[1]/2:"bottom"===d?p[1]:0),NV(e)){g=function(e,t,n,i,a){var r=n.getSize(),o=r[0],s=r[1];return e=Math.min(e+o,i)-o,t=Math.min(t+s,a)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(n,i,a,s,l);n=g[0],i=g[1]}a.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,i=this._cbParamsList,a=!!n&&n.length===e.length;return a&&zr(n,(function(n,r){var o=n.dataByAxis||[],s=(e[r]||{}).dataByAxis||[];(a=a&&o.length===s.length)&&zr(o,(function(e,n){var r=s[n]||{},o=e.seriesDataIndices||[],l=r.seriesDataIndices||[];(a=a&&e.value===r.value&&e.axisType===r.axisType&&e.axisId===r.axisId&&o.length===l.length)&&zr(o,(function(e,t){var n=l[t];a=a&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex})),i&&zr(e.seriesDataIndices,(function(e){var n=e.seriesIndex,r=t[n],o=i[n];r&&o&&o.data!==r.data&&(a=!1)}))}))})),this._lastDataByCoordSys=e,this._cbParamsList=t,!!a},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!ur.node&&t.getDom()&&(Bw(this,"_updatePosition"),this._tooltipContent.dispose(),TN("itemTooltip",t))},t.type="tooltip",t}(ww);function eq(e,t,n){var i,a=t.ecModel;n?(i=new xy(n,a,a),i=new xy(t.option,i,a)):i=t;for(var r=e.length-1;r>=0;r--){var o=e[r];o&&(o instanceof xy&&(o=o.get("tooltip",!0)),Qr(o)&&(o={formatter:o}),o&&(i=new xy(o,i,a)))}return i}function tq(e,t){return e.dispatchAction||Kr(t.dispatchAction,t)}function nq(e){return"center"===e||"middle"===e}function iq(e){dI(RN),e.registerComponentModel(BV),e.registerComponentView(JV),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Mo),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Mo)}var aq=zr;function rq(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}function oq(e,t,n){var i={};return aq(t,(function(t){var a,r=i[t]=((a=function(){}).prototype.__hidden=a.prototype,new a);aq(e[t],(function(e,i){if(dO.isValidType(i)){var a={type:i,visual:e};n&&n(a,t),r[i]=new dO(a),"opacity"===i&&((a=Ar(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new dO(a))}}))})),i}function sq(e,t,n){var i;zr(n,(function(e){t.hasOwnProperty(e)&&rq(t[e])&&(i=!0)})),i&&zr(n,(function(n){t.hasOwnProperty(n)&&rq(t[n])?e[n]=Ar(t[n]):delete e[n]}))}lq(0),lq(1);function lq(e){var t=["x","y"],n=["width","height"];return{point:function(t,n,i){if(t){var a=i.range;return pq(t[e],a)}},rect:function(i,a,r){if(i){var o=r.range,s=[i[t[e]],i[t[e]]+i[n[e]]];return s[1]=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e,t=this.option,n=t.data||[],i=t.axisType,a=this._names=[];"category"===i?(e=[],zr(n,(function(t,n){var i,r=Id(wd(t),"");to(t)?(i=Ar(t)).value=n:i=n,e.push(i),a.push(r)}))):e=n;var r={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new W_([{name:"value",type:r}],this)).initData(e,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(kv),hq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="timeline.slider",t.defaultOption=Sy(mq.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(mq);qr(hq,ub.prototype);var gq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="timeline",t}(ww),fq=function(e){function t(t,n,i,a){var r=e.call(this,t,n,i)||this;return r.type=a||"value",r}return We(t,e),t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},t}(RI),yq=Math.PI,vq=Pd();!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var i=this._layout(e,n),a=this._createGroup("_mainGroup"),r=this._createGroup("_labelGroup"),o=this._axis=this._createAxis(i,e);e.formatTooltip=function(e){return Zb("nameValue",{noName:!0,value:o.scale.getLabel({value:e})})},zr(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](i,a,o,e)}),this),this._renderAxisLabel(i,r,o,e),this._position(i,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n,i,a,r,o=e.get(["label","position"]),s=e.get("orient"),l=function(e,t){return Sv(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t),p={horizontal:"center",vertical:(n=null==o||"auto"===o?"horizontal"===s?l.y+l.height/2=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},d={horizontal:0,vertical:yq/2},u="vertical"===s?l.height:l.width,m=e.getModel("controlStyle"),h=m.get("show",!0),g=h?m.get("itemSize"):0,f=h?m.get("itemGap"):0,y=g+f,v=e.get(["label","rotate"])||0;v=v*yq/180;var x=m.get("position",!0),b=h&&m.get("showPlayBtn",!0),w=h&&m.get("showPrevBtn",!0),S=h&&m.get("showNextBtn",!0),C=0,_=u;"left"===x||"bottom"===x?(b&&(i=[0,0],C+=y),w&&(a=[C,0],C+=y),S&&(r=[_-g,0],_-=y)):(b&&(i=[_-g,0],_-=y),w&&(a=[0,0],C+=y),S&&(r=[_-g,0],_-=y));var T=[C,_];return e.get("inverse")&&T.reverse(),{viewRect:l,mainLength:u,orient:s,rotation:d[s],labelRotation:v,labelPosOpt:n,labelAlign:e.get(["label","align"])||p[s],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||c[s],playPosition:i,prevBtnPosition:a,nextBtnPosition:r,axisExtent:T,controlSize:g,controlGap:f}},t.prototype._position=function(e,t){var n=this._mainGroup,i=this._labelGroup,a=e.viewRect;if("vertical"===e.orient){var r=[1,0,0,1,0,0],o=a.x,s=a.y+a.height;Cs(r,r,[-o,-s]),_s(r,r,-yq/2),Cs(r,r,[o,s]),(a=a.clone()).applyTransform(r)}var l=f(a),p=f(n.getBoundingRect()),c=f(i.getBoundingRect()),d=[n.x,n.y],u=[i.x,i.y];u[0]=d[0]=l[0][0];var m,h=e.labelPosOpt;null==h||Qr(h)?(y(d,p,l,1,m="+"===h?0:1),y(u,c,l,1,1-m)):(y(d,p,l,1,m=h>=0?0:1),u[1]=d[1]+h);function g(e){e.originX=l[0][0]-e.x,e.originY=l[1][0]-e.y}function f(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function y(e,t,n,i,a){e[i]+=n[i][a]-t[i][a]}n.setPosition(d),i.setPosition(u),n.rotation=i.rotation=e.rotation,g(n),g(i)},t.prototype._createAxis=function(e,t){var n=t.getData(),i=t.get("axisType"),a=function(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new hT({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case"time":return new PT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new fT}}(t,i);a.getTicks=function(){return n.mapArray(["value"],(function(e){return{value:e}}))};var r=n.getDataExtent("value");a.setExtent(r[0],r[1]),a.calcNiceTicks();var o=new fq("value",a,e.axisExtent,i);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Rc;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,i){var a=n.getExtent();if(i.get(["lineStyle","show"])){var r=new Gg({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:Br({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});t.add(r);var o=this._progressLine=new Gg({shape:{x1:a[0],x2:this._currentPointer?this._currentPointer.x:a[0],y1:0,y2:0},style:Nr({lineCap:"round",lineWidth:r.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,i){var a=this,r=i.getData(),o=n.scale.getTicks();this._tickSymbols=[],zr(o,(function(e){var o=n.dataToCoord(e.value),s=r.getItemModel(e.value),l=s.getModel("itemStyle"),p=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),d={x:o,y:0,onclick:Kr(a._changeTimeline,a,e.value)},u=xq(s,l,t,d);u.ensureState("emphasis").style=p.getItemStyle(),u.ensureState("progress").style=c.getItemStyle(),Lh(u);var m=Xm(u);s.get("tooltip")?(m.dataIndex=e.value,m.dataModel=i):m.dataIndex=m.dataModel=null,a._tickSymbols.push(u)}))},t.prototype._renderAxisLabel=function(e,t,n,i){var a=this;if(n.getLabelModel().get("show")){var r=i.getData(),o=n.getViewLabels();this._tickLabels=[],zr(o,(function(i){var o=i.tickValue,s=r.getItemModel(o),l=s.getModel("label"),p=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),d=n.dataToCoord(i.tickValue),u=new Nm({x:d,y:0,rotation:e.labelRotation-e.rotation,onclick:Kr(a._changeTimeline,a,o),silent:!1,style:Zf(l,{text:i.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});u.ensureState("emphasis").style=Zf(p),u.ensureState("progress").style=Zf(c),t.add(u),Lh(u),vq(u).dataIndex=o,a._tickLabels.push(u)}))}},t.prototype._renderControl=function(e,t,n,i){var a=e.controlSize,r=e.rotation,o=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),p=i.get("inverse",!0);function c(e,n,l,p){if(e){var c=Cc(co(i.get(["controlStyle",n+"BtnSize"]),a),a),d=function(e,t,n,i){var a=i.style,r=Lf(e.get(["controlStyle",t]),i||{},new Ns(n[0],n[1],n[2],n[3]));a&&r.setStyle(a);return r}(i,n+"Icon",[0,-c/2,c,c],{x:e[0],y:e[1],originX:a/2,originY:0,rotation:p?-r:0,rectHover:!0,style:o,onclick:l});d.ensureState("emphasis").style=s,t.add(d),Lh(d)}}c(e.nextBtnPosition,"next",Kr(this._changeTimeline,this,p?"-":"+")),c(e.prevBtnPosition,"prev",Kr(this._changeTimeline,this,p?"+":"-")),c(e.playPosition,l?"stop":"play",Kr(this._handlePlayClick,this,!l),!0)},t.prototype._renderCurrentPointer=function(e,t,n,i){var a=i.getData(),r=i.getCurrentIndex(),o=a.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=Kr(s._handlePointerDrag,s),e.ondragend=Kr(s._handlePointerDragend,s),bq(e,s._progressLine,r,n,i,!0)},onUpdate:function(e){bq(e,s._progressLine,r,n,i)}};this._currentPointer=xq(o,o,this._mainGroup,{},this._currentPointer,l)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],i=Kc(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(o[r]=+o[r].toFixed(d)),[o,c]}var Eq={min:Yr(Iq,"min"),max:Yr(Iq,"max"),average:Yr(Iq,"average"),median:Yr(Iq,"median")};function Mq(e,t){if(t){var n=e.getData(),i=e.coordinateSystem,a=i&&i.dimensions;if(!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Xr(t.coord)&&Xr(a)){var r=kq(t,n,i,e);if((t=Ar(t)).type&&Eq[t.type]&&r.baseAxis&&r.valueAxis){var o=Lr(a,r.baseAxis.dim),s=Lr(a,r.valueAxis.dim),l=Eq[t.type](n,r.baseDataDim,r.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&Xr(a))for(var p=t.coord,c=0;c<2;c++)Eq[p[c]]&&(p[c]=Oq(n,n.mapDimension(a[c]),p[c]));else t.coord=[];return t}}function kq(e,t,n,i){var a={};return null!=e.valueIndex||null!=e.valueDim?(a.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,a.valueAxis=n.getAxis(function(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}(i,a.valueDataDim)),a.baseAxis=n.getOtherAxis(a.valueAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim)):(a.baseAxis=i.getBaseAxis(),a.valueAxis=n.getOtherAxis(a.baseAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim),a.valueDataDim=t.mapDimension(a.valueAxis.dim)),a}function Pq(e,t){return!(e&&e.containData&&t.coord&&!Tq(t))||e.containData(t.coord)}function Dq(e,t){return e?function(e,n,i,a){return yb(a<2?e.coord&&e.coord[a]:e.value,t[a])}:function(e,n,i,a){return yb(e.value,t[a])}}function Oq(e,t,n){if("average"===n){var i=0,a=0;return e.each(t,(function(e,t){isNaN(e)||(i+=e,a++)})),i/a}return"median"===n?e.getMedian(t):e.getDataExtent(t)["max"===n?1:0]}var Aq=Pd(),Fq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.init=function(){this.markerGroupMap=Co()},t.prototype.render=function(e,t,n){var i=this,a=this.markerGroupMap;a.each((function(e){Aq(e).keep=!1})),t.eachSeries((function(e){var a=_q.getMarkerModelFromSeries(e,i.type);a&&i.renderSeries(e,a,t,n)})),a.each((function(e){!Aq(e).keep&&i.group.remove(e.group)}))},t.prototype.markKeep=function(e){Aq(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;zr(e,(function(e){var i=_q.getMarkerModelFromSeries(e,n.type);i&&i.getData().eachItemGraphicEl((function(e){e&&(t?Eh(e):Mh(e))}))}))},t.type="marker",t}(ww);function Rq(e,t,n){var i=t.coordinateSystem;e.each((function(a){var r,o=e.getItemModel(a),s=Wc(o.get("x"),n.getWidth()),l=Wc(o.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)r=t.getMarkerPosition(e.getValues(e.dimensions,a));else if(i){var p=e.get(i.dimensions[0],a),c=e.get(i.dimensions[1],a);r=i.dataToPoint([p,c])}}else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),e.setItemLayout(a,r)}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=_q.getMarkerModelFromSeries(e,"markPoint");t&&(Rq(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new PE),p=function(e,t,n){var i;i=e?Ur(e&&e.dimensions,(function(e){return Br(Br({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var a=new W_(i,n),r=Ur(n.get("data"),Yr(Mq,t));e&&(r=Hr(r,Yr(Pq,e)));var o=Dq(!!e,i);return a.initData(r,null,o),a}(a,e,t);t.setData(p),Rq(t.getData(),e,i),p.each((function(e){var n=p.getItemModel(e),i=n.getShallow("symbol"),a=n.getShallow("symbolSize"),r=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Zr(i)||Zr(a)||Zr(r)||Zr(s)){var c=t.getRawValue(e),d=t.getDataParams(e);Zr(i)&&(i=i(c,d)),Zr(a)&&(a=a(c,d)),Zr(r)&&(r=r(c,d)),Zr(s)&&(s=s(c,d))}var u=n.getModel("itemStyle").getItemStyle(),m=wS(o,"color");u.fill||(u.fill=m),p.setItemVisual(e,{symbol:i,symbolSize:a,symbolRotate:r,symbolOffset:s,symbolKeepAspect:l,style:u})})),l.updateData(p),this.group.add(l.group),p.eachItemGraphicEl((function(e){e.traverse((function(e){Xm(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint"}(Fq);var Bq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(_q),Nq=Pd(),Lq=function(e,t,n,i){var a,r=e.getData();if(Xr(i))a=i;else{var o=i.type;if("min"===o||"max"===o||"average"===o||"median"===o||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=t.getAxis(null!=i.yAxis?"y":"x"),l=po(i.yAxis,i.xAxis);else{var p=kq(i,r,t,e);s=p.valueAxis,l=Oq(r,eT(r,p.valueDataDim),o)}var c="x"===s.dim?0:1,d=1-c,u=Ar(i),m={coord:[]};u.type=null,u.coord=[],u.coord[d]=-1/0,m.coord[d]=1/0;var h=n.get("precision");h>=0&&eo(l)&&(l=+l.toFixed(Math.min(h,20))),u.coord[c]=m.coord[c]=l,a=[u,m,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var g=[Mq(e,a[0]),Mq(e,a[1]),Br({},a[2])];return g[2].type=g[2].type||null,Fr(g[2],g[0]),Fr(g[2],g[1]),g};function Vq(e){return!isNaN(e)&&!isFinite(e)}function qq(e,t,n,i){var a=1-e,r=i.dimensions[e];return Vq(t[a])&&Vq(n[a])&&t[e]===n[e]&&i.getAxis(r).containData(t[e])}function Gq(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(qq(1,n,i,e)||qq(0,n,i,e)))return!0}return Pq(e,t[0])&&Pq(e,t[1])}function zq(e,t,n,i,a){var r,o=i.coordinateSystem,s=e.getItemModel(t),l=Wc(s.get("x"),a.getWidth()),p=Wc(s.get("y"),a.getHeight());if(isNaN(l)||isNaN(p)){if(i.getMarkerPosition)r=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=o.dimensions,d=e.get(c[0],t),u=e.get(c[1],t);r=o.dataToPoint([d,u])}if(jE(o,"cartesian2d")){var m=o.getAxis("x"),h=o.getAxis("y");c=o.dimensions;Vq(e.get(c[0],t))?r[0]=m.toGlobalCoord(m.getExtent()[n?0:1]):Vq(e.get(c[1],t))&&(r[1]=h.toGlobalCoord(h.getExtent()[n?0:1]))}isNaN(l)||(r[0]=l),isNaN(p)||(r[1]=p)}else r=[l,p];e.setItemLayout(t,r)}var Uq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=_q.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),a=Nq(t).from,r=Nq(t).to;a.each((function(t){zq(a,t,!0,e,n),zq(r,t,!1,e,n)})),i.each((function(e){i.setItemLayout(e,[a.getItemLayout(e),r.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new YO);this.group.add(l.group);var p=function(e,t,n){var i;i=e?Ur(e&&e.dimensions,(function(e){return Br(Br({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})})):[{name:"value",type:"float"}];var a=new W_(i,n),r=new W_(i,n),o=new W_([],n),s=Ur(n.get("data"),Yr(Lq,t,e,n));e&&(s=Hr(s,Yr(Gq,e)));var l=Dq(!!e,i);return a.initData(Ur(s,(function(e){return e[0]})),null,l),r.initData(Ur(s,(function(e){return e[1]})),null,l),o.initData(Ur(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:a,to:r,line:o}}(a,e,t),c=p.from,d=p.to,u=p.line;Nq(t).from=c,Nq(t).to=d,t.setData(u);var m=t.get("symbol"),h=t.get("symbolSize"),g=t.get("symbolRotate"),f=t.get("symbolOffset");function y(t,n,a){var r=t.getItemModel(n);zq(t,n,a,e,i);var s=r.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=wS(o,"color")),t.setItemVisual(n,{symbolKeepAspect:r.get("symbolKeepAspect"),symbolOffset:co(r.get("symbolOffset",!0),f[a?0:1]),symbolRotate:co(r.get("symbolRotate",!0),g[a?0:1]),symbolSize:co(r.get("symbolSize"),h[a?0:1]),symbol:co(r.get("symbol",!0),m[a?0:1]),style:s})}Xr(m)||(m=[m,m]),Xr(h)||(h=[h,h]),Xr(g)||(g=[g,g]),Xr(f)||(f=[f,f]),p.from.each((function(e){y(c,e,!0),y(d,e,!1)})),u.each((function(e){var t=u.getItemModel(e).getModel("lineStyle").getLineStyle();u.setItemLayout(e,[c.getItemLayout(e),d.getItemLayout(e)]),null==t.stroke&&(t.stroke=c.getItemVisual(e,"style").fill),u.setItemVisual(e,{fromSymbolKeepAspect:c.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(e,"symbolOffset"),fromSymbolRotate:c.getItemVisual(e,"symbolRotate"),fromSymbolSize:c.getItemVisual(e,"symbolSize"),fromSymbol:c.getItemVisual(e,"symbol"),toSymbolKeepAspect:d.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(e,"symbolOffset"),toSymbolRotate:d.getItemVisual(e,"symbolRotate"),toSymbolSize:d.getItemVisual(e,"symbolSize"),toSymbol:d.getItemVisual(e,"symbol"),style:t})})),l.updateData(u),p.line.eachItemGraphicEl((function(e){Xm(e).dataModel=t,e.traverse((function(e){Xm(e).dataModel=t}))})),this.markKeep(l),l.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(Fq);function jq(e){e.registerComponentModel(Bq),e.registerComponentView(Uq),e.registerPreprocessor((function(e){wq(e.series,"markLine")&&(e.markLine=e.markLine||{})}))}!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}}(_q);var Hq=Pd(),Wq=function(e,t,n,i){var a=i[0],r=i[1];if(a&&r){var o=Mq(e,a),s=Mq(e,r),l=o.coord,p=s.coord;l[0]=po(l[0],-1/0),l[1]=po(l[1],-1/0),p[0]=po(p[0],1/0),p[1]=po(p[1],1/0);var c=Rr([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function $q(e){return!isNaN(e)&&!isFinite(e)}function Kq(e,t,n,i){var a=1-e;return $q(t[a])&&$q(n[a])}function Yq(e,t){var n=t.coord[0],i=t.coord[1],a={coord:n,x:t.x0,y:t.y0},r={coord:i,x:t.x1,y:t.y1};return jE(e,"cartesian2d")?!(!n||!i||!Kq(1,n,i)&&!Kq(0,n,i))||function(e,t,n){return!(e&&e.containZone&&t.coord&&n.coord&&!Tq(t)&&!Tq(n))||e.containZone(t.coord,n.coord)}(e,a,r):Pq(e,a)||Pq(e,r)}function Xq(e,t,n,i,a){var r,o=i.coordinateSystem,s=e.getItemModel(t),l=Wc(s.get(n[0]),a.getWidth()),p=Wc(s.get(n[1]),a.getHeight());if(isNaN(l)||isNaN(p)){if(i.getMarkerPosition){var c=e.getValues(["x0","y0"],t),d=e.getValues(["x1","y1"],t),u=o.clampData(c),m=o.clampData(d),h=[];"x0"===n[0]?h[0]=u[0]>m[0]?d[0]:c[0]:h[0]=u[0]>m[0]?c[0]:d[0],"y0"===n[1]?h[1]=u[1]>m[1]?d[1]:c[1]:h[1]=u[1]>m[1]?c[1]:d[1],r=i.getMarkerPosition(h,n,!0)}else{var g=[v=e.get(n[0],t),x=e.get(n[1],t)];o.clampData&&o.clampData(g,g),r=o.dataToPoint(g,!0)}if(jE(o,"cartesian2d")){var f=o.getAxis("x"),y=o.getAxis("y"),v=e.get(n[0],t),x=e.get(n[1],t);$q(v)?r[0]=f.toGlobalCoord(f.getExtent()["x0"===n[0]?0:1]):$q(x)&&(r[1]=y.toGlobalCoord(y.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(r[0]=l),isNaN(p)||(r[1]=p)}else r=[l,p];return r}var Zq=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];!function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}We(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries((function(e){var t=_q.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each((function(t){var a=Ur(Zq,(function(a){return Xq(i,t,a,e,n)}));i.setItemLayout(t,a),i.getItemGraphicEl(t).setShape("points",a)}))}}),this)},t.prototype.renderSeries=function(e,t,n,i){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,{group:new Rc});this.group.add(l.group),this.markKeep(l);var p=function(e,t,n){var i,a,r=["x0","y0","x1","y1"];if(e){var o=Ur(e&&e.dimensions,(function(e){var n=t.getData();return Br(Br({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}));a=Ur(r,(function(e,t){return{name:e,type:o[t%2].type}})),i=new W_(a,n)}else i=new W_(a=[{name:"value",type:"float"}],n);var s=Ur(n.get("data"),Yr(Wq,t,e,n));e&&(s=Hr(s,Yr(Yq,e)));var l=e?function(e,t,n,i){return yb(e.coord[Math.floor(i/2)][i%2],a[i])}:function(e,t,n,i){return yb(e.value,a[i])};return i.initData(s,null,l),i.hasItemOption=!0,i}(a,e,t);t.setData(p),p.each((function(t){var n=Ur(Zq,(function(n){return Xq(p,t,n,e,i)})),r=a.getAxis("x").scale,s=a.getAxis("y").scale,l=r.getExtent(),c=s.getExtent(),d=[r.parse(p.get("x0",t)),r.parse(p.get("x1",t))],u=[s.parse(p.get("y0",t)),s.parse(p.get("y1",t))];Kc(d),Kc(u);var m=!!(l[0]>d[1]||l[1]u[1]||c[1]=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(kv),Jq=Yr,eG=zr,tG=Rc,nG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return We(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new tG),this.group.add(this._selectorGroup=new tG),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var a=e.get("align"),r=e.get("orient");a&&"auto"!==a||(a="right"===e.get("left")&&"vertical"===r?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(a,e,t,n,o,r,s);var l=e.getBoxLayoutParams(),p={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),d=Sv(l,p,c),u=this.layoutInner(e,a,d,i,o,s),m=Sv(Nr({width:u.width,height:u.height},l),p,c);this.group.x=m.x-u.x,this.group.y=m.y-u.y,this.group.markRedraw(),this.group.add(this._backgroundEl=rV(u,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,a,r,o){var s=this.getContentGroup(),l=Co(),p=t.get("selectedMode"),c=[];n.eachRawSeries((function(e){!e.get("legendHoverLink")&&c.push(e.id)})),eG(t.getData(),(function(a,r){var o=a.get("name");if(!this.newlineDisabled&&(""===o||"\n"===o)){var d=new tG;return d.newline=!0,void s.add(d)}var u=n.getSeriesByName(o)[0];if(!l.get(o)){if(u){var m=u.getData(),h=m.getVisual("legendLineStyle")||{},g=m.getVisual("legendIcon"),f=m.getVisual("style"),y=this._createItem(u,o,r,a,t,e,h,f,g,p,i);y.on("click",Jq(iG,o,null,i,c)).on("mouseover",Jq(rG,u.name,null,i,c)).on("mouseout",Jq(oG,u.name,null,i,c)),n.ssr&&y.eachChild((function(e){var t=Xm(e);t.seriesIndex=u.seriesIndex,t.dataIndex=r,t.ssrType="legend"})),l.set(o,!0)}else n.eachRawSeries((function(s){if(!l.get(o)&&s.legendVisualProvider){var d=s.legendVisualProvider;if(!d.containName(o))return;var u=d.indexOfName(o),m=d.getItemVisual(u,"style"),h=d.getItemVisual(u,"legendIcon"),g=Kl(m.fill);g&&0===g[3]&&(g[3]=.2,m=Br(Br({},m),{fill:tp(g,"rgba")}));var f=this._createItem(s,o,r,a,t,e,{},m,h,p,i);f.on("click",Jq(iG,null,o,i,c)).on("mouseover",Jq(rG,null,o,i,c)).on("mouseout",Jq(oG,null,o,i,c)),n.ssr&&f.eachChild((function(e){var t=Xm(e);t.seriesIndex=s.seriesIndex,t.dataIndex=r,t.ssrType="legend"})),l.set(o,!0)}}),this);0}}),this),a&&this._createSelector(a,t,i,r,o)},t.prototype._createSelector=function(e,t,n,i,a){var r=this.getSelectorGroup();eG(e,(function(e){var i=e.type,a=new Nm({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});r.add(a),Yf(a,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),Lh(a)}))},t.prototype._createItem=function(e,t,n,i,a,r,o,s,l,p,c){var d=e.visualDrawType,u=a.get("itemWidth"),m=a.get("itemHeight"),h=a.isSelected(t),g=i.get("symbolRotate"),f=i.get("symbolKeepAspect"),y=i.get("icon"),v=function(e,t,n,i,a,r,o){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=t.lineWidth>0?2:0),eG(e,(function(n,i){"inherit"===e[i]&&(e[i]=t[i])}))}var l=t.getModel("itemStyle"),p=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",d=l.getShallow("decal");p.decal=d&&"inherit"!==d?cC(d,o):i.decal,"inherit"===p.fill&&(p.fill=i[a]);"inherit"===p.stroke&&(p.stroke=i[c]);"inherit"===p.opacity&&(p.opacity=("fill"===a?i:n).opacity);s(p,i);var u=t.getModel("lineStyle"),m=u.getLineStyle();if(s(m,n),"auto"===p.fill&&(p.fill=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),"auto"===m.stroke&&(m.stroke=i.fill),!r){var h=t.get("inactiveBorderWidth"),g=p[c];p.lineWidth="auto"===h?i.lineWidth>0&&g?2:0:p.lineWidth,p.fill=t.get("inactiveColor"),p.stroke=t.get("inactiveBorderColor"),m.stroke=u.get("inactiveColor"),m.lineWidth=u.get("inactiveWidth")}return{itemStyle:p,lineStyle:m}}(l=y||l||"roundRect",i,o,s,d,h,c),x=new tG,b=i.getModel("textStyle");if(!Zr(e.getLegendIcon)||y&&"inherit"!==y){var w="inherit"===y&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add(function(e){var t=e.icon||"roundRect",n=NS(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:u,itemHeight:m,icon:l,iconRotate:w,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:f}))}else x.add(e.getLegendIcon({itemWidth:u,itemHeight:m,icon:l,iconRotate:g,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:f}));var S="left"===r?u+5:-5,C=r,_=a.get("formatter"),T=t;Qr(_)&&_?T=_.replace("{name}",null!=t?t:""):Zr(_)&&(T=_(t));var I=h?b.getTextColor():i.get("inactiveColor");x.add(new Nm({style:Zf(b,{text:T,x:S,y:m/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var E=new Fm({shape:x.getBoundingRect(),style:{fill:"transparent"}}),M=i.getModel("tooltip");return M.get("show")&&zf({el:E,componentModel:a,itemName:t,itemTooltipOption:M.option}),x.add(E),x.eachChild((function(e){e.silent=!0})),E.silent=!p,this.getContentGroup().add(x),Lh(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,i,a,r){var o=this.getContentGroup(),s=this.getSelectorGroup();wv(e.get("orient"),o,e.get("itemGap"),n.width,n.height);var l=o.getBoundingRect(),p=[-l.x,-l.y];if(s.markRedraw(),o.markRedraw(),a){wv("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],u=e.get("selectorButtonGap",!0),m=e.getOrient().index,h=0===m?"width":"height",g=0===m?"height":"width",f=0===m?"y":"x";"end"===r?d[m]+=l[h]+u:p[m]+=c[h]+u,d[1-m]+=l[g]/2-c[g]/2,s.x=d[0],s.y=d[1],o.x=p[0],o.y=p[1];var y={x:0,y:0};return y[h]=l[h]+u+c[h],y[g]=Math.max(l[g],c[g]),y[f]=Math.min(0,c[f]+d[1-m]),y}return o.x=p[0],o.y=p[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ww);function iG(e,t,n,i){oG(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),rG(e,t,n,i)}function aG(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,a=n.length;in[a],h=[-d.x,-d.y];t||(h[i]=l[s]);var g=[0,0],f=[-u.x,-u.y],y=co(e.get("pageButtonGap",!0),e.get("itemGap",!0));m&&("end"===e.get("pageButtonPosition",!0)?f[i]+=n[a]-u[a]:g[i]+=u[a]+y);f[1-i]+=d[r]/2-u[r]/2,l.setPosition(h),p.setPosition(g),c.setPosition(f);var v={x:0,y:0};if(v[a]=m?n[a]:d[a],v[r]=Math.max(d[r],u[r]),v[o]=Math.min(0,u[o]+f[1-i]),p.__rectSize=n[a],m){var x={x:0,y:0};x[a]=Math.max(n[a]-u[a]-y,0),x[r]=v[r],p.setClipPath(new Fm({shape:x})),p.__rectSize=x[a]}else c.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var b=this._getPageInfo(e);return null!=b.pageIndex&&pf(l,{x:b.contentPosition[0],y:b.contentPosition[1]},m?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;zr(["pagePrev","pageNext"],(function(i){var a=null!=t[i+"DataIndex"],r=n.childOfName(i);r&&(r.setStyle("fill",a?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=a?"pointer":"default")}));var i=n.childOfName("pageText"),a=e.get("pageFormatter"),r=t.pageIndex,o=null!=r?r+1:0,s=t.pageCount;i&&a&&i.setStyle("text",Qr(a)?a.replace("{current}",null==o?"":o+"").replace("{total}",null==s?"":s+""):a({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,a=e.getOrient().index,r=pG[a],o=cG[a],s=this._findTargetItemIndex(t),l=n.children(),p=l[s],c=l.length,d=c?1:0,u={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!p)return u;var m=v(p);u.contentPosition[a]=-m.s;for(var h=s+1,g=m,f=m,y=null;h<=c;++h)(!(y=v(l[h]))&&f.e>g.s+i||y&&!x(y,g.s))&&(g=f.i>g.i?f:y)&&(null==u.pageNextDataIndex&&(u.pageNextDataIndex=g.i),++u.pageCount),f=y;for(h=s-1,g=m,f=m,y=null;h>=-1;--h)(y=v(l[h]))&&x(f,y.s)||!(g.i=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){return this._showController?(this.getContentGroup().eachChild((function(i,a){var r=i.__legendDataIndex;null==n&&null!=r&&(n=a),r===e&&(t=a)})),null!=t?t:n):0;var t,n},t.type="legend.scroll"}(nG);var dG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="dataZoom.inside",t.defaultOption=Sy($L.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}($L),uG=Pd();function mG(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function hG(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function gG(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}function fG(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,(function(e,t){var n=uG(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=Co());i.each((function(e){e.dataZoomInfoMap=null})),e.eachComponent({mainType:"dataZoom",subType:"inside"},(function(e){zr(HL(e).infoList,(function(n){var a=n.model.uid,r=i.get(a)||i.set(a,function(e,t){var n={model:t,containsPoint:Yr(gG,t),dispatchAction:Yr(hG,e),dataZoomInfoMap:null,controller:null},i=n.controller=new mP(e.getZr());return zr(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(t){var i=[];n.dataZoomInfoMap.each((function(a){if(t.isAvailableBehavior(a.model.option)){var r=(a.getRange||{})[e],o=r&&r(a.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!a.model.get("disabled",!0)&&o&&i.push({dataZoomId:a.model.id,start:o[0],end:o[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(t,n.model));(r.dataZoomInfoMap||(r.dataZoomInfoMap=Co())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})}))})),i.each((function(e){var t,n=e.controller,a=e.dataZoomInfoMap;if(a){var r=a.keys()[0];null!=r&&(t=a.get(r))}if(t){var o=function(e){var t,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return e.each((function(e){var r=e.model,o=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+o]>i[n+t]&&(t=o),a=a&&r.get("preventDefaultMouseMove",!0)})),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}(a);n.enable(o.controlType,o.opt),n.setPointerChecker(e.containsPoint),Rw(e,"dispatchAction",t.model.get("throttle",!0),"fixRate")}else mG(i,e)}))}))}var yG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return We(t,e),t.prototype.render=function(t,n,i){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),function(e,t,n){uG(e).coordSysRecordMap.each((function(e){var i=e.dataZoomInfoMap.get(t.uid);i&&(i.getRange=n)}))}(i,t,{pan:Kr(vG.pan,this),zoom:Kr(vG.zoom,this),scrollMove:Kr(vG.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=uG(e).coordSysRecordMap,i=n.keys(),a=0;a0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],p=Math.max(1/i.scale,0);r[0]=(r[0]-l)*p+l,r[1]=(r[1]-l)*p+l;var c=this.dataZoomModel.findRepresentativeAxisProxy();if(c){var d=c.getMinMaxSpan();if(EA(0,r,[0,100],0,d.minSpan,d.maxSpan),this.range=r,a[0]!==r[0]||a[1]!==r[1])return r}}},pan:xG((function(e,t,n,i,a,r){var o=bG[i]([r.oldX,r.oldY],[r.newX,r.newY],t,a,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:xG((function(e,t,n,i,a,r){return bG[i]([0,0],[r.scrollDelta,r.scrollDelta],t,a,n).signal*(e[1]-e[0])*r.scrollDelta}))};function xG(e){return function(t,n,i,a){var r=this.range,o=r.slice(),s=t.axisModels[0];if(s)return EA(e(o,s,t,n,i,a),o,[0,100],"all"),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}}var bG={grid:function(e,t,n,i,a){var r=n.axis,o={},s=a.model.coordinateSystem.getRect();return e=e||[0,0],"x"===r.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=r.inverse?-1:1),o},polar:function(e,t,n,i,a){var r=n.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),p=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=p[1]-p[0],o.pixelStart=p[0],o.signal=r.inverse?-1:1),o},singleAxis:function(e,t,n,i,a){var r=n.axis,o=a.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===r.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=r.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=r.inverse?-1:1),s}};function wG(e){tV(e),e.registerComponentModel(dG),e.registerComponentView(yG),fG(e)}var SG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=Sy($L.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}($L),CG=Fm,_G="horizontal",TG="vertical",IG=["line","bar","candlestick","scatter","custom"],EG={easing:"cubicOut",duration:100,delay:0},MG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return We(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=Kr(this._onBrush,this),this._onBrushEnd=Kr(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,a){if(e.prototype.render.apply(this,arguments),Rw(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();a&&"dataZoom"===a.type&&a.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Bw(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Rc;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect")?7:0,i=this._findCoordRect(),a={width:t.getWidth(),height:t.getHeight()},r=this._orient===_G?{right:a.width-i.x-i.width,top:a.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},o=Iv(e.option);zr(["right","top","width","height"],(function(e){"ph"===o[e]&&(o[e]=r[e])}));var s=Sv(o,a);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===TG&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),a=i&&i.get("inverse"),r=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(n!==_G||a?n===_G&&a?{scaleY:o?1:-1,scaleX:-1}:n!==TG||a?{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?1:-1,scaleX:1});var s=e.getBoundingRect([r]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new CG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var a=new CG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:Kr(this._onClickPanel,this)}),r=this.api.getZr();i?(a.on("mousedown",this._onBrushStart,this),a.cursor="crosshair",r.on("mousemove",this._onBrush),r.on("mouseup",this._onBrushEnd)):(r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)),n.add(a)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],i=e.series,a=i.getRawData(),r=i.getShadowDim&&i.getShadowDim(),o=r&&a.getDimensionInfo(r)?i.getShadowDim():e.otherDim;if(null!=o){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(a!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var p=a.getDataExtent(o),c=.3*(p[1]-p[0]);p=[p[0]-c,p[1]+c];var d,u=[0,t[1]],m=[0,t[0]],h=[[t[0],0],[0,0]],g=[],f=m[1]/(a.count()-1),y=0,v=Math.round(a.count()/t[0]);a.each([o],(function(e,t){if(v>0&&t%v)y+=f;else{var n=null==e||isNaN(e)||""===e,i=n?0:Hc(e,p,u,!0);n&&!d&&t?(h.push([h[h.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&d&&(h.push([y,0]),g.push([y,0])),h.push([y,i]),g.push([y,i]),y+=f,d=n}})),s=this._shadowPolygonPts=h,l=this._shadowPolylinePts=g}this._shadowData=a,this._shadowDim=o,this._shadowSize=[t[0],t[1]];for(var x=this.dataZoomModel,b=0;b<3;b++){var w=S(1===b);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}function S(e){var t=x.getModel(e?"selectedDataBackground":"dataBackground"),n=new Rc,i=new Bg({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),a=new Lg({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(a),n}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var n,i=this.ecModel;return e.eachTargetAxis((function(a,r){var o=e.getAxisProxy(a,r);o&&zr(o.getTargetSeriesModels(),(function(e){if(!(n||!0!==t&&Lr(IG,e.get("type"))<0)){var o,s=i.getComponent(UL(a),r).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(a),p=e.coordinateSystem;null!=l&&p.getOtherAxis&&(o=p.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),n={thisAxis:s,series:e,thisDim:a,otherDim:l,otherAxisInverse:o}}}),this)}),this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],a=this._displayables.sliderGroup,r=this._size,o=this.dataZoomModel,s=this.api,l=o.get("borderRadius")||0,p=o.get("brushSelect"),c=t.filler=new CG({silent:p,style:{fill:o.get("fillerColor")},textConfig:{position:"inside"}});a.add(c),a.add(new CG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1],r:l},style:{stroke:o.get("dataBackgroundColor")||o.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),zr([0,1],(function(t){var r=o.get("handleIcon");!FS[r]&&r.indexOf("path://")<0&&r.indexOf("image://")<0&&(r="path://"+r);var s=NS(r,-1,0,2,2,null,!0);s.attr({cursor:kG(this._orient),draggable:!0,drift:Kr(this._onDragMove,this,t),ondragend:Kr(this._onDragEnd,this),onmouseover:Kr(this._showDataInfo,this,!0),onmouseout:Kr(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),p=o.get("handleSize");this._handleHeight=Wc(p,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(o.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=o.getModel(["emphasis","handleStyle"]).getItemStyle(),Lh(s);var c=o.get("handleColor");null!=c&&(s.style.fill=c),a.add(n[t]=s);var d=o.getModel("textStyle");e.add(i[t]=new Nm({silent:!0,invisible:!0,style:Zf(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))}),this);var d=c;if(p){var u=Wc(o.get("moveHandleSize"),r[1]),m=t.moveHandle=new Fm({style:o.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:r[1]-.5,height:u}}),h=.8*u,g=t.moveHandleIcon=NS(o.get("moveHandleIcon"),-h/2,-h/2,h,h,"#fff",!0);g.silent=!0,g.y=r[1]+u/2-.5,m.ensureState("emphasis").style=o.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var f=Math.min(r[1]/2,Math.max(u,10));(d=t.moveZone=new Fm({invisible:!0,shape:{y:r[1]-f,height:u+f}})).on("mouseover",(function(){s.enterEmphasis(m)})).on("mouseout",(function(){s.leaveEmphasis(m)})),a.add(m),a.add(g),a.add(d)}d.attr({draggable:!0,cursor:kG(this._orient),drift:Kr(this._onDragMove,this,"all"),ondragstart:Kr(this._showDataInfo,this,!0),ondragend:Kr(this._onDragEnd,this),onmouseover:Kr(this._showDataInfo,this,!0),onmouseout:Kr(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Hc(e[0],[0,100],t,!0),Hc(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,a=this._getViewExtent(),r=n.findRepresentativeAxisProxy();if(r){var o=r.getMinMaxSpan(),s=[0,100];EA(t,i,a,n.get("zoomLock")?"all":e,null!=o.minSpan?Hc(o.minSpan,s,a,!0):null,null!=o.maxSpan?Hc(o.maxSpan,s,a,!0):null);var l=this._range,p=this._range=Kc([Hc(i[0],a,s,!0),Hc(i[1],a,s,!0)]);return!l||l[0]!==p[0]||l[1]!==p[1]}return!1},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=Kc(n.slice()),a=this._size;zr([0,1],(function(e){var i=t.handles[e],r=this._handleHeight;i.attr({scaleX:r/2,scaleY:r/2,x:n[e]+(e?-1:1),y:a[1]/2-r/2})}),this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:a[1]});var r={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(r),t.moveZone.setShape(r),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",r.x+r.width/2));for(var o=t.dataShadowSegs,s=[0,i[0],i[1],a[0]],l=0;lt[0]||n[1]<0||n[1]>t[1])){var i=this._handleEnds,a=(i[0]+i[1])/2,r=this._updateInterval("all",n[0]-a);this._updateView(),r&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Ms(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),a=[0,100];this._range=Kc([Hc(n.x,i,a,!0),Hc(n.x+n.width,i,a,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(gs(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,a=n.brushRect;a||(a=n.brushRect=new CG({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(a)),a.attr("ignore",!1);var r=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),l=o.transformCoordToLocal(r.x,r.y),p=this._size;s[0]=Math.max(Math.min(p[0],s[0]),0),a.setShape({x:l[0],y:0,width:s[0]-l[0],height:p[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?EG:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=HL(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),a=this.api.getHeight();e={x:.2*i,y:.2*a,width:.6*i,height:.6*a}}return e},t.type="dataZoom.slider",t}(YL);function kG(e){return"vertical"===e?"ns-resize":"ew-resize"}function PG(e){e.registerComponentModel(SG),e.registerComponentView(MG),tV(e)}function DG(e){dI(wG),dI(PG)}var OG=function(e,t,n){var i=Ar((AG[e]||{})[t]);return n&&Xr(i)?i[i.length-1]:i},AG={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},FG=dO.mapVisual,RG=dO.eachVisual,BG=Xr,NG=zr,LG=Kc,VG=Hc,qG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return We(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&sq(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=Kr(e,this),this.controllerVisuals=oq(this.option.controller,t,e),this.targetVisuals=oq(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,n){t.push(n)})):t=vd(e),t},t.prototype.eachTargetSeries=function(e,t){zr(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&e.call(t,i)}),this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries((function(n){n===e&&(t=!0)})),t},t.prototype.formatValueText=function(e,t,n){var i,a=this.option,r=a.precision,o=this.dataBound,s=a.formatter;n=n||["<",">"],Xr(e)&&(e=e.slice(),i=!0);var l=t?e:i?[p(e[0]),p(e[1])]:p(e);return Qr(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):Zr(s)?i?s(e[0],e[1]):s(e):i?e[0]===o[0]?n[0]+" "+l[1]:e[1]===o[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function p(e){return e===o[0]?"min":e===o[1]?"max":(+e).toFixed(Math.min(r,20))}},t.prototype.resetExtent=function(){var e=this.option,t=LG([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,i=n.length-1;i>=0;i--){var a=n[i],r=e.getDimensionInfo(a);if(!r.isCalculationCoord)return r.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),a=t.controller||(t.controller={});Fr(i,n),Fr(a,n);var r=this.isCategory();function o(n){BG(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,a),function(e,t,n){var i=e[t],a=e[n];i&&!a&&(a=e[n]={},NG(i,(function(e,t){if(dO.isValidType(t)){var n=OG(t,"inactive",r);null!=n&&(a[t]=n,"color"!==t||a.hasOwnProperty("opacity")||a.hasOwnProperty("colorAlpha")||(a.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),a=this.getItemSymbol()||"roundRect";NG(this.stateList,(function(o){var s=this.itemSize,l=e[o];l||(l=e[o]={color:r?i:[i]}),null==l.symbol&&(l.symbol=t&&Ar(t)||(r?a:[a])),null==l.symbolSize&&(l.symbolSize=n&&Ar(n)||(r?s[0]:[s[0],s[0]])),l.symbol=FG(l.symbol,(function(e){return"none"===e?a:e}));var p=l.symbolSize;if(null!=p){var c=-1/0;RG(p,(function(e){e>c&&(c=e)})),l.symbolSize=FG(p,(function(e){return VG(e,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,a)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(kv),GG=[20,140],zG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=GG[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=GG[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):Xr(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),zr(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)}),this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=Kc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries((function(n){var i=[],a=n.getData();a.each(this.getDataDimensionIndex(a),(function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)}),this),t.push({seriesId:n.id,dataIndex:i})}),this),t},t.prototype.getVisualMeta=function(e){var t=UG(this,"outOfRange",this.getExtent()),n=UG(this,"inRange",this.option.range.slice()),i=[];function a(t,n){i.push({value:t,color:e(t,n)})}for(var r=0,o=0,s=n.length,l=t.length;oe[1])break;n.push({color:this.getControllerVisual(r,"color",t),offset:a/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new Rc("horizontal"!==t||n?"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"!==t||n?{scaleX:"left"===e?1:-1}:{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,a=n.handleThumbs,r=n.handleLabels,o=i.itemSize,s=i.getExtent();YG([0,1],(function(l){var p=a[l];p.setStyle("fill",t.handlesColor[l]),p.y=e[l];var c=KG(e[l],[0,o[1]],s,!0),d=this.getControllerVisual(c,"symbolSize");p.scaleX=p.scaleY=d/o[0],p.x=o[0]-d/2;var u=Of(n.handleLabelPoints[l],Df(p,this.group));r[l].setStyle({x:u[0],y:u[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},t.prototype._showIndicator=function(e,t,n,i){var a=this.visualMapModel,r=a.getExtent(),o=a.itemSize,s=[0,o[1]],l=this._shapes,p=l.indicator;if(p){p.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,"symbolSize"),u=KG(e,r,s,!0),m=o[0]-d/2,h={x:p.x,y:p.y};p.y=u,p.x=m;var g=Of(l.indicatorLabelPoint,Df(p,this.group)),f=l.indicatorLabel;f.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;f.setStyle({text:(n||"")+a.formatValueText(t),verticalAlign:v?y:"middle",align:v?"center":y});var x={x:m,y:u,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(a.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};p.x=h.x,p.y=h.y,p.animateTo(x,w),f.animateTo(b,w)}else p.attr(x),f.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ca[1]&&(p[1]=1/0),t&&(p[0]===-1/0?this._showIndicator(l,p[1],"< ",o):p[1]===1/0?this._showIndicator(l,p[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,d=[];(t||ez(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(p));var u=function(e,t){var n={},i={};return a(e||[],n),a(t||[],i,n),[r(n),r(i)];function a(e,t,n){for(var i=0,a=e.length;i=0&&(a.dimension=r,i.push(a))}})),e.getData().setVisual("visualMeta",i)}}];function rz(e,t,n,i){for(var a=t.targetVisuals[i],r=dO.prepareVisualTypes(a),o={color:wS(e.getData(),"color")},s=0,l=r.length;s0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"})),e.registerAction(nz,iz),zr(az,(function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)})),e.registerPreprocessor(sz))}function dz(e){e.registerComponentModel(zG),e.registerComponentView(QG),cz(e)}var uz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return We(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],mz[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var a=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=Ar(a)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=Ur(this._pieceList,(function(e){return e=Ar(e),"inRange"!==t&&(e.visual=null),e})))}))},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=dO.listVisualTypes(),a=this.isCategory();function r(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}zr(t.pieces,(function(e){zr(i,(function(t){e.hasOwnProperty(t)&&(n[t]=1)}))})),zr(n,(function(e,n){var i=!1;zr(this.stateList,(function(e){i=i||r(t,e,n)||r(t.target,e,n)}),this),!i&&zr(this.stateList,(function(e){(t[e]||(t[e]={}))[n]=OG(n,"inRange"===e?"active":"inactive",a)}))}),this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,i=this._pieceList,a=(t?n:e).selected||{};if(n.selected=a,zr(i,(function(e,t){var n=this.getSelectedMapKey(e);a.hasOwnProperty(n)||(a[n]=!0)}),this),"single"===n.selectedMode){var r=!1;zr(i,(function(e,t){var n=this.getSelectedMapKey(e);a[n]&&(r?a[n]=!1:r=!0)}),this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=Ar(e)},t.prototype.getValueState=function(e){var t=dO.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries((function(i){var a=[],r=i.getData();r.each(this.getDataDimensionIndex(r),(function(t,i){dO.findPieceIndex(t,n)===e&&a.push(i)}),this),t.push({seriesId:i.id,dataIndex:a})}),this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var o=-1/0;return zr(a,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:n}}function s(a,r){var o=i.getRepresentValue({interval:a});r||(r=i.getValueState(o));var s=e(o,r);a[0]===-1/0?n[0]=s:a[1]===1/0?n[1]=s:t.push({value:a[0],color:s},{value:a[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=Sy(qG.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(qG),mz={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),a=t.splitNumber;a=Math.max(parseInt(a,10),1),t.splitNumber=a;for(var r=(i[1]-i[0])/a;+r.toFixed(n)!==r&&n<5;)n++;t.precision=n,r=+r.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)}),this)}};function hz(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var gz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return We(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,a=i.getFont(),r=i.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),p=l.endsText,c=po(t.get("showLabel",!0),!p);p&&this._renderEndsText(e,p[0],s,c,o),zr(l.viewPieceList,(function(i){var l=i.piece,p=new Rc;p.onclick=Kr(this._onItemClick,this,l),this._enableHoverLink(p,i.indexInModelPieceList);var d=t.getRepresentValue(l);if(this._createItemSymbol(p,d,[0,0,s[0],s[1]]),c){var u=this.visualMapModel.getValueState(d);p.add(new Nm({style:{x:"right"===o?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:o,font:a,fill:r,opacity:"outOfRange"===u?.5:1}}))}e.add(p)}),this),p&&this._renderEndsText(e,p[1],s,c,o),wv(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:$G(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return WG(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,a){if(t){var r=new Rc,o=this.visualMapModel.textStyleModel;r.add(new Nm({style:Zf(o,{x:i?"right"===a?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?a:"center",text:t})})),e.add(r)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=Ur(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),n=e.get("text"),i=e.get("orient"),a=e.get("inverse");return("horizontal"===i?a:!a)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(NS(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=n.selectedMode;if(i){var a=Ar(n.selected),r=t.getSelectedMapKey(e);"single"===i||!0===i?(a[r]=!0,zr(a,(function(e,t){a[t]=t===r}))):a[r]=!a[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:a})}},t.type="visualMap.piecewise",t}(jG);function fz(e){e.registerComponentModel(uz),e.registerComponentView(gz),cz(e)}function yz(e){dI(dz),dI(fz)}Pd();var vz={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},xz=function(){function e(e){if(null==(this._condVal=Qr(e)?new RegExp(e):so(e)?e:null)){var t="";0,hd(t)}}return e.prototype.evaluate=function(e){var t=typeof e;return Qr(t)?this._condVal.test(e):!!eo(t)&&this._condVal.test(e+"")},e}(),bz=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),wz=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t=Dz:-l>=Dz),u=l>0?l%Dz:l%Dz+Dz,m=!1;m=!!d||!lp(c)&&u>=Pz==!!p;var h=e+n*kz(r),g=t+i*Mz(r);this._start&&this._add("M",h,g);var f=Math.round(a*Oz);if(d){var y=1/this._p,v=(p?1:-1)*(Dz-y);this._add("A",n,i,f,1,+p,e+n*kz(r+v),t+i*Mz(r+v)),y>.01&&this._add("A",n,i,f,0,+p,h,g)}else{var x=e+n*kz(o),b=t+i*Mz(o);this._add("A",n,i,f,+m,+p,x,b)}},e.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},e.prototype.closePath=function(){this._d.length>0&&this._add("Z")},e.prototype._add=function(e,t,n,i,a,r,o,s,l){for(var p=[],c=this._p,d=1;d"}(a,r)+("style"!==a?os(o):o||"")+(i?""+n+Ur(i,(function(t){return e(t)})).join(n)+n:"")+("")}(e)}function Hz(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Wz(e,t,n,i){return Uz("svg","root",{width:e,height:t,xmlns:Vz,"xmlns:xlink":qz,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+e+" "+t},n)}var $z=0;function Kz(){return $z++}var Yz={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Xz="transform-origin";function Zz(e,t,n){var i=Br({},e.shape);Br(i,t),e.buildPath(n,i);var a=new Az;return a.reset(vp(e)),n.rebuildPath(a,1),a.generateStr(),a.getStr()}function Qz(e,t){var n=t.originX,i=t.originY;(n||i)&&(e[Xz]=n+"px "+i+"px")}var Jz={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function eU(e,t){var n=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function tU(e){return Qr(e)?Yz[e]?"cubic-bezier("+Yz[e]+")":Dl(e)?e:"":""}function nU(e,t,n,i){var a=e.animators,r=a.length,o=[];if(e instanceof Kg){var s=function(e,t,n){var i,a,r=e.shape.paths,o={};if(zr(r,(function(e){var t=Hz(n.zrId);t.animation=!0,nU(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,l=$r(r),p=l.length;if(p){var c=r[a=l[p-1]];for(var d in c){var u=c[d];o[d]=o[d]||{d:""},o[d].d+=u.d||""}for(var m in s){var h=s[m].animation;h.indexOf(a)>=0&&(i=h)}}})),i){t.d=!1;var s=eU(o,n);return i.replace(a,s)}}(e,t,n);if(s)o.push(s);else if(!r)return}else if(!r)return;for(var l={},p=0;p0})).length)return eU(c,n)+" "+a[0]+" both"}for(var f in l){(s=g(l[f]))&&o.push(s)}if(o.length){var y=n.zrId+"-cls-"+Kz();n.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function iU(e,t,n,i){var a=JSON.stringify(e),r=n.cssStyleCache[a];r||(r=n.zrId+"-cls-"+Kz(),n.cssStyleCache[a]=r,n.cssNodes["."+r+(i?":hover":"")]=e),t.class=t.class?t.class+" "+r:r}var aU=Math.round;function rU(e){return e&&Qr(e.src)}function oU(e){return e&&Zr(e.toDataURL)}function sU(e,t,n,i){Lz((function(a,r){var o="fill"===a||"stroke"===a;o&&fp(r)?vU(t,e,a,i):o&&mp(r)?xU(n,e,a,i):e[a]=o&&"none"===r?"transparent":r}),t,n,!1),function(e,t,n){var i=e.style;if(function(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}(i)){var a=function(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(e),r=n.shadowCache,o=r[a];if(!o){var s=e.getGlobalScale(),l=s[0],p=s[1];if(!l||!p)return;var c=i.shadowOffsetX||0,d=i.shadowOffsetY||0,u=i.shadowBlur,m=op(i.shadowColor),h=m.opacity,g=m.color,f=u/2/l+" "+u/2/p;o=n.zrId+"-s"+n.shadowIdx++,n.defs[o]=Uz("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Uz("feDropShadow","",{dx:c/l,dy:d/p,stdDeviation:f,"flood-color":g,"flood-opacity":h})]),r[a]=o}t.filter=yp(o)}}(n,e,i)}function lU(e,t){var n=zc(t);n&&(n.each((function(t,n){null!=t&&(e[(Gz+n).toLowerCase()]=t+"")})),t.isSilent()&&(e[Gz+"silent"]="true"))}function pU(e){return lp(e[0]-1)&&lp(e[1])&&lp(e[2])&&lp(e[3]-1)}function cU(e,t,n){if(t&&(!function(e){return lp(e[4])&&lp(e[5])}(t)||!pU(t))){var i=n?10:1e4;e.transform=pU(t)?"translate("+aU(t[4]*i)/i+" "+aU(t[5]*i)/i+")":function(e){return"matrix("+pp(e[0])+","+pp(e[1])+","+pp(e[2])+","+pp(e[3])+","+cp(e[4])+","+cp(e[5])+")"}(t)}}function dU(e,t,n){for(var i=e.points,a=[],r=0;r=0&&o||r;s&&(a=ap(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&e.transform?e.transform[0]:1);var p={cursor:"pointer"};a&&(p.fill=a),i.stroke&&(p.stroke=i.stroke),l&&(p["stroke-width"]=l),iU(p,t,n,!0)}}(e,r,t),Uz(s,e.id+"",r)}function yU(e,t){return e instanceof Sm?fU(e,t):e instanceof Em?function(e,t){var n=e.style,i=n.image;if(i&&!Qr(i)&&(rU(i)?i=i.src:oU(i)&&(i=i.toDataURL())),i){var a=n.x||0,r=n.y||0,o={href:i,width:n.width,height:n.height};return a&&(o.x=a),r&&(o.y=r),cU(o,e.transform),sU(o,n,e,t),lU(o,e),t.animation&&nU(e,o,t),Uz("image",e.id+"",o)}}(e,t):e instanceof _m?function(e,t){var n=e.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var a=n.font||hr,r=n.x||0,o=function(e,t,n){return"top"===n?e+=t/2:"bottom"===n&&(e-=t/2),e}(n.y||0,Sc(a),n.textBaseline),s={"dominant-baseline":"central","text-anchor":dp[n.textAlign]||n.textAlign};if(Um(n)){var l="",p=n.fontStyle,c=Gm(n.fontSize);if(!parseFloat(c))return;var d=n.fontFamily||mr,u=n.fontWeight;l+="font-size:"+c+";font-family:"+d+";",p&&"normal"!==p&&(l+="font-style:"+p+";"),u&&"normal"!==u&&(l+="font-weight:"+u+";"),s.style=l}else s.style="font: "+a;return i.match(/\s/)&&(s["xml:space"]="preserve"),r&&(s.x=r),o&&(s.y=o),cU(s,e.transform),sU(s,n,e,t),lU(s,e),t.animation&&nU(e,s,t),Uz("text",e.id+"",s,void 0,i)}}(e,t):void 0}function vU(e,t,n,i){var a,r=e[n],o={gradientUnits:r.global?"userSpaceOnUse":"objectBoundingBox"};if(hp(r))a="linearGradient",o.x1=r.x,o.y1=r.y,o.x2=r.x2,o.y2=r.y2;else{if(!gp(r))return void 0;a="radialGradient",o.cx=co(r.x,.5),o.cy=co(r.y,.5),o.r=co(r.r,.5)}for(var s=r.colorStops,l=[],p=0,c=s.length;pl?FU(e,null==n[d+1]?null:n[d+1].elm,n,s,d):RU(e,t,o,l))}(n,i,a):PU(a)?(PU(e.text)&&EU(n,""),FU(n,null,a,0,a.length-1)):PU(i)?RU(n,i,0,i.length-1):PU(e.text)&&EU(n,""):e.text!==t.text&&(PU(i)&&RU(n,i,0,i.length-1),EU(n,t.text)))}var LU=0,VU=function(){function e(e,t,n){if(this.type="svg",this.refreshHover=qU("refreshHover"),this.configLayer=qU("configLayer"),this.storage=t,this._opts=n=Br({},n),this.root=e,this._id="zr"+LU++,this._oldVNode=Wz(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=zz("svg");BU(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",function(e,t){if(OU(e,t))NU(e,t);else{var n=e.elm,i=TU(n);AU(t),null!==i&&(SU(i,t.elm,IU(n)),RU(i,[e],0,0))}}(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return yU(e,Hz(this._id))},e.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=Hz(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var r=[],o=this._bgVNode=function(e,t,n,i){var a;if(n&&"none"!==n)if(a=Uz("rect","bg",{width:e,height:t,x:"0",y:"0"}),fp(n))vU({fill:n},a.attrs,"fill",i);else if(mp(n))xU({style:{fill:n},dirty:Mo,getBoundingRect:function(){return{width:e,height:t}}},a.attrs,"fill",i);else{var r=op(n),o=r.color,s=r.opacity;a.attrs.fill=o,s<1&&(a.attrs["fill-opacity"]=s)}return a}(n,i,this._backgroundColor,a);o&&r.push(o);var s=e.compress?null:this._mainVNode=Uz("g","main",{},[]);this._paintList(t,a,s?s.children:r),s&&r.push(s);var l=Ur($r(a.defs),(function(e){return a.defs[e]}));if(l.length&&r.push(Uz("defs","defs",{},l)),e.animation){var p=function(e,t,n){var i=(n=n||{}).newline?"\n":"",a=" {"+i,r=i+"}",o=Ur($r(e),(function(t){return t+a+Ur($r(e[t]),(function(n){return n+":"+e[t][n]+";"})).join(i)+r})).join(i),s=Ur($r(t),(function(e){return"@keyframes "+e+a+Ur($r(t[e]),(function(n){return n+a+Ur($r(t[e][n]),(function(i){var a=t[e][n][i];return"d"===i&&(a='path("'+a+'")'),i+":"+a+";"})).join(i)+r})).join(i)+r})).join(i);return o||s?[""].join(i):""}(a.cssNodes,a.cssAnims,{newline:!0});if(p){var c=Uz("style","stl",{},[],p);r.push(c)}}return Wz(n,i,r,e.useViewBox)},e.prototype.renderToString=function(e){return e=e||{},jz(this.renderToVNode({animation:co(e.cssAnimation,!0),emphasis:co(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:co(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var i,a,r=e.length,o=[],s=0,l=0,p=0;p=0&&(!d||!a||d[h]!==a[h]);h--);for(var g=m-1;g>h;g--)i=o[--s-1];for(var f=h+1;f=o)}}for(var c=this.__startIndex;c15)break}n.prevElClipPaths&&d.restore()};if(m)if(0===m.length)s=l.__endIndex;else for(var b=u.dpr,w=0;w0&&e>i[0]){for(s=0;se);s++);o=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var l=o.dom;l.nextSibling?r.insertBefore(t.dom,l.nextSibling):r.appendChild(t.dom)}else r.firstChild?r.insertBefore(t.dom,r.firstChild):r.appendChild(t.dom);t.painter||(t.painter=this)}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?WU:0),this._needsManuallyCompositing),p.__builtin__||Or("ZLevel "+l+" has been used by unkown layer "+p.id),p!==r&&(p.__used=!0,p.__startIndex!==a&&(p.__dirty=!0),p.__startIndex=a,p.incremental?p.__drawIndex=-1:p.__drawIndex=a,t(a),r=p),1&s.__dirty&&!s.__inHover&&(p.__dirty=!0,p.incremental&&p.__drawIndex<0&&(p.__drawIndex=a))}t(a),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,zr(this._layers,(function(e){e.setUnpainted()}))},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Fr(n[e],t,!0):n[e]=t;for(var i=0;i({legendKey:e,left:!0}),ZU=e=>({background:e});function QU(e,n){1&e&&t.ɵɵelementContainer(0)}function JU(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,QU,1,0,"ng-container",8),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e.widgetTitlePanel)}}function ej(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Min")))}function tj(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Max")))}function nj(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Avg")))}function ij(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Total")))}function aj(e,n){1&e&&(t.ɵɵelementStart(0,"th",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"legend.Latest")))}function rj(e,n){1&e&&t.ɵɵelementContainer(0)}function oj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].min,"html"),t.ɵɵsanitizeHtml)}}function sj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].max,"html"),t.ɵɵsanitizeHtml)}}function lj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].avg,"html"),t.ɵɵsanitizeHtml)}}function pj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].total,"html"),t.ɵɵsanitizeHtml)}}function cj(e,n){if(1&e&&(t.ɵɵelement(0,"td",16),t.ɵɵpipe(1,"safe")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(1,1,n.legendData.data[e.dataIndex].latest,"html"),t.ɵɵsanitizeHtml)}}function dj(e,n){if(1&e&&(t.ɵɵelementStart(0,"tr")(1,"th"),t.ɵɵtemplate(2,rj,1,0,"ng-container",14),t.ɵɵelementEnd(),t.ɵɵtemplate(3,oj,2,4,"td",15)(4,sj,2,4,"td",15)(5,lj,2,4,"td",15)(6,pj,2,4,"td",15)(7,cj,2,4,"td",15),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2),a=t.ɵɵreference(8);t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",a)("ngTemplateOutletContext",t.ɵɵpureFunction1(7,XU,e)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showMin),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showMax),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showAvg),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showTotal),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===i.legendConfig.showLatest)}}function uj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"table",10)(2,"thead")(3,"tr"),t.ɵɵelement(4,"th"),t.ɵɵtemplate(5,ej,3,3,"th",11)(6,tj,3,3,"th",11)(7,nj,3,3,"th",11)(8,ij,3,3,"th",11)(9,aj,3,3,"th",11),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"tbody"),t.ɵɵtemplate(11,dj,8,9,"tr",12),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngIf",!0===e.legendConfig.showMin),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showMax),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showAvg),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showTotal),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!0===e.legendConfig.showLatest),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",e.legendKeys)}}function mj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",18),t.ɵɵelement(2,"div",19)(3,"div",20),t.ɵɵpipe(4,"safe"),t.ɵɵelementEnd()()),2&e){const e=n.legendKey,i=n.left;t.ɵɵclassProp("left",i),t.ɵɵadvance(2),t.ɵɵstyleMap(t.ɵɵpureFunction1(8,ZU,e.dataKey.color)),t.ɵɵadvance(),t.ɵɵproperty("innerHTML",t.ɵɵpipeBind2(4,5,e.dataKey.label,"html"),t.ɵɵsanitizeHtml)}}class hj{constructor(e,t,n){this.renderer=e,this.sanitizer=t,this.widgetComponent=n,this.updateXAxisTimeWindow=(e,t)=>{e.min=t.minTime,e.max=t.maxTime}}ngOnInit(){this.initEchart(),this.initLegend()}ngAfterViewInit(){this.myChart=function(e,t,n){var i=!(n&&n.ssr);if(i){var a=p_(e);if(a)return a}var r=new KC(e,t,n);return r.id="ec_"+s_++,r_[r.id]=r,i&&Nd(e,l_,r.id),UC(r),hC.trigger("afterinit",r),r}(this.echartContainer.nativeElement,null,{renderer:"svg"}),this.initResize(),this.xAxis=this.setupXAxis(),this.yAxis=this.setupYAxis(),this.option={...this.setupAnimationSettings(),formatter:e=>this.setupTooltipElement(e),backgroundColor:"transparent",darkMode:!1,tooltip:{show:!0,trigger:"axis",confine:!0,padding:[8,12],appendTo:"body",textStyle:{fontFamily:"Roboto",fontSize:12,fontWeight:"normal",lineHeight:16}},grid:[{backgroundColor:null,borderColor:"#ccc",borderWidth:1,bottom:45,left:5,right:5,show:!1,top:10}],xAxis:[this.xAxis],yAxis:[this.yAxis],series:this.setupChartLines(),dataZoom:[{type:"inside",disabled:!1,realtime:!0,filterMode:"none"},{type:"slider",show:!0,showDetail:!1,realtime:!0,filterMode:"none",bottom:5}]},this.myChart.setOption(this.option),this.updateAxisOffset(!1)}onDataUpdated(){const e=[];this.onResize(),this.updateXAxisTimeWindow(this.xAxis,this.ctx.defaultSubscription.timeWindow);for(const t in this.ctx.data){e[t]=[];for(const[n,i]of this.ctx.data[t].data)e[t].push({name:n,value:[n,i]})}const t=[];for(const n of e)t.push({data:n});this.option.series=t,this.myChart.setOption(this.option),this.updateAxisOffset()}updateAxisOffset(e=!0){const t=Qe(this.myChart,this.yAxis.mainType,this.yAxis.id),n=Je(this.myChart,this.yAxis.mainType,this.yAxis.id,this.yAxis.name),i=Qe(this.myChart,this.xAxis.mainType,this.xAxis.id),a=t+n,r=i+Je(this.myChart,this.yAxis.mainType,this.yAxis.id,this.yAxis.name)+35;this.option.grid[0].left===a&&this.option.grid[0].bottom===r||(this.option.grid[0].left=a,this.yAxis.nameGap=t,this.option.grid[0].bottom=r,this.xAxis.nameGap=i,this.myChart.setOption(this.option,{replaceMerge:["yAxis","xAxis","grid"],lazyUpdate:e}))}initEchart(){dI([iq,BN,yz,DG,jq,hL,lP,oM,OM,XM,pP,ZB,wE,KU,GU])}initLegend(){this.showLegend=this.ctx.settings.showLegend,this.showLegend&&(this.legendConfig=this.ctx.settings.legendConfig,this.legendData=this.ctx.defaultSubscription.legendData,this.legendKeys=this.legendData.keys,this.legendClass=`legend-${this.legendConfig.position}`,this.legendConfig.sortDataKeys?this.legendKeys=this.legendData.keys.sort(((e,t)=>e.dataKey.label.localeCompare(t.dataKey.label))):this.legendKeys=this.legendData.keys)}initResize(){this.shapeResize$=new ResizeObserver((()=>{this.onResize()})),this.shapeResize$.observe(this.echartContainer.nativeElement)}onResize(){this.myChart.resize()}setupTooltipElement(e){const t=this.renderer.createElement("div");if(this.renderer.setStyle(t,"display","flex"),this.renderer.setStyle(t,"flex-direction","column"),this.renderer.setStyle(t,"align-items","flex-start"),this.renderer.setStyle(t,"gap","16px"),e.length){const n=this.renderer.createElement("div");this.renderer.setStyle(n,"display","flex"),this.renderer.setStyle(n,"flex-direction","column"),this.renderer.setStyle(n,"align-items","flex-start"),this.renderer.setStyle(n,"gap","4px"),this.renderer.appendChild(n,this.setTooltipDate(e));for(const[t,i]of e.entries())this.renderer.appendChild(n,this.constructTooltipSeriesElement(i,t));this.renderer.appendChild(t,n)}return t}constructTooltipSeriesElement(e,t){const n=this.renderer.createElement("div");this.renderer.setStyle(n,"display","flex"),this.renderer.setStyle(n,"flex-direction","row"),this.renderer.setStyle(n,"align-items","center"),this.renderer.setStyle(n,"align-self","stretch"),this.renderer.setStyle(n,"gap","12px");const i=this.renderer.createElement("div");this.renderer.setStyle(i,"display","flex"),this.renderer.setStyle(i,"align-items","center"),this.renderer.setStyle(i,"gap","8px"),this.renderer.appendChild(n,i);const a=this.renderer.createElement("div");this.renderer.setStyle(a,"width","8px"),this.renderer.setStyle(a,"height","8px"),this.renderer.setStyle(a,"border-radius","50%"),this.renderer.setStyle(a,"background",e.color),this.renderer.appendChild(i,a);const r=this.renderer.createElement("div");this.renderer.setProperty(r,"innerHTML",this.sanitizer.sanitize(g.HTML,e.seriesName)),this.renderer.setStyle(r,"font-family","Roboto"),this.renderer.setStyle(r,"font-size","12px"),this.renderer.setStyle(r,"font-style","normal"),this.renderer.setStyle(r,"font-weight",400),this.renderer.setStyle(r,"line-height","16px"),this.renderer.setStyle(r,"color","rgba(0, 0, 0, 0.76)"),this.renderer.appendChild(i,r);const o=J(this.ctx.data[t].dataKey.decimals)?this.ctx.data[t].dataKey.decimals:this.ctx.decimals,s=J(this.ctx.data[t].dataKey.units)?this.ctx.data[t].dataKey.units:this.ctx.units,l=ee(e.value[1],o,s,!1),p=this.renderer.createElement("div");return this.renderer.setProperty(p,"innerHTML",this.sanitizer.sanitize(g.HTML,l)),this.renderer.setStyle(p,"flex","1"),this.renderer.setStyle(p,"text-align","end"),this.renderer.setStyle(p,"font-family","Roboto"),this.renderer.setStyle(p,"font-size","12px"),this.renderer.setStyle(p,"font-style","normal"),this.renderer.setStyle(p,"font-weight",500),this.renderer.setStyle(p,"line-height","16px"),this.renderer.setStyle(p,"color","rgba(0, 0, 0, 0.76)"),this.renderer.appendChild(n,p),n}setTooltipDate(e){const t=this.renderer.createElement("div");return this.renderer.appendChild(t,this.renderer.createText(new Date(e[0].value[0]).toLocaleString("en-GB"))),this.renderer.setStyle(t,"font-family","Roboto"),this.renderer.setStyle(t,"font-size","11px"),this.renderer.setStyle(t,"font-style","normal"),this.renderer.setStyle(t,"font-weight","400"),this.renderer.setStyle(t,"line-height","16px"),this.renderer.setStyle(t,"color","rgba(0, 0, 0, 0.76)"),t}setupAnimationSettings(){return{animation:!0,animationDelay:0,animationDelayUpdate:0,animationDuration:500,animationDurationUpdate:300,animationEasing:"cubicOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3}}setupChartLines(){const e=[];for(const[t,n]of this.ctx.datasources[0].dataKeys.entries())e.push({id:t,name:n.label,type:"line",showSymbol:!1,smooth:!1,step:!1,stackStrategy:"all",data:[],lineStyle:{color:n.color},itemStyle:{color:n.color}});return e}setupYAxis(){return{type:"value",position:"left",mainType:"yAxis",id:"yAxis",offset:0,nameLocation:"middle",nameRotate:90,alignTicks:!0,scale:!0,show:!0,axisLabel:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:12,fontStyle:"normal",fontWeight:400,show:!0,formatter:e=>ee(e,this.ctx.decimals,this.ctx.units,!1)},splitLine:{show:!0},axisLine:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisTick:{lineStyle:{color:"rgba(0, 0, 0, 0.54)"},show:!0},nameTextStyle:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:12,fontStyle:"normal",fontWeight:600}}}setupXAxis(){return{id:"xAxis",mainType:"xAxis",show:!0,type:"time",position:"bottom",offset:0,nameLocation:"middle",max:this.ctx.defaultSubscription.timeWindow.maxTime,min:this.ctx.defaultSubscription.timeWindow.minTime,nameTextStyle:{color:"rgba(0, 0, 0, 0.54)",fontStyle:"normal",fontWeight:600,fontFamily:"Roboto",fontSize:12},axisPointer:{shadowStyle:{color:"rgba(210,219,238,0.2)"}},splitLine:{show:!0},axisTick:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisLine:{onZero:!1,show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.54)"}},axisLabel:{color:"rgba(0, 0, 0, 0.54)",fontFamily:"Roboto",fontSize:10,fontStyle:"normal",fontWeight:400,show:!0,hideOverlap:!0}}}static{this.ɵfac=function(e){return new(e||hj)(t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(et.DomSanitizer),t.ɵɵdirectiveInject(tt.WidgetComponent))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:hj,selectors:[["tb-gateway-statistics-chart"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(YU,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.echartContainer=e.first)}},inputs:{ctx:"ctx",widgetTitlePanel:"widgetTitlePanel"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:9,vars:4,consts:[["echartContainer",""],["legendItem",""],[1,"tb-time-series-chart-panel"],[1,"tb-time-series-chart-overlay"],[4,"ngIf"],[1,"tb-time-series-chart-content"],[1,"tb-time-series-chart-shape"],["class","tb-time-series-chart-legend",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"tb-time-series-chart-legend"],[1,"tb-time-series-chart-legend-table","vertical"],["class","tb-time-series-chart-legend-type-label right legend legend-row-color",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tb-time-series-chart-legend-type-label","right","legend","legend-row-color"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","tb-time-series-chart-legend-value legend",3,"innerHTML",4,"ngIf"],[1,"tb-time-series-chart-legend-value","legend",3,"innerHTML"],[1,"tb-time-series-chart-legend-item"],[1,"tb-time-series-chart-legend-item-label"],[1,"tb-time-series-chart-legend-item-label-circle"],[1,"legend","legend-label-color",3,"innerHTML"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",2),t.ɵɵelement(1,"div",3),t.ɵɵtemplate(2,JU,2,1,"ng-container",4),t.ɵɵelementStart(3,"div",5),t.ɵɵelement(4,"div",6,0),t.ɵɵtemplate(6,uj,12,6,"div",7)(7,mj,5,10,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.widgetComponent.dashboardWidget.showWidgetTitlePanel),t.ɵɵadvance(),t.ɵɵclassMap(n.legendClass),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.showLegend))},dependencies:t.ɵɵgetComponentDepsFactory(hj,[se,_]),styles:['@charset "UTF-8";.tb-time-series-chart-panel[_ngcontent-%COMP%]{width:100%;height:100%;position:relative;display:flex;flex-direction:column;gap:8px;padding:12px}.tb-time-series-chart-panel[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:not(.tb-time-series-chart-overlay){z-index:1}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-overlay[_ngcontent-%COMP%]{position:absolute;inset:12px}.tb-time-series-chart-panel[_ngcontent-%COMP%] div.tb-widget-title[_ngcontent-%COMP%]{padding:0}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%]{flex-direction:column-reverse}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-right[_ngcontent-%COMP%]{flex-direction:row}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-left[_ngcontent-%COMP%]{flex-direction:row-reverse}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-shape[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-right[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-left[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{display:inline-grid;grid-auto-flow:column;grid-template-rows:repeat(auto-fit,minmax(16px,min-content));max-width:calc(25% - 8px);height:fit-content;max-height:100%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{align-self:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend.tb-simple-legend[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend.tb-simple-legend[_ngcontent-%COMP%]{justify-content:center}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-top[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]:not(.tb-simple-legend), .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content.legend-bottom[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]:not(.tb-simple-legend){width:100%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%]{display:flex;align-items:flex-start;align-self:stretch;column-gap:16px;row-gap:8px;flex-wrap:wrap;overflow:auto;width:fit-content;max-width:100%;max-height:calc(35% - 8px)}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%]{border-spacing:0;table-layout:fixed}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table.vertical[_ngcontent-%COMP%]{width:100%;table-layout:auto}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table.vertical[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:95%}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:last-child), .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:last-child){padding-right:16px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:last-child) th[_ngcontent-%COMP%], .tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:last-child) td[_ngcontent-%COMP%]{padding-bottom:8px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%]{align-items:flex-end}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-table[_ngcontent-%COMP%] .tb-time-series-chart-legend-item.left[_ngcontent-%COMP%]{align-items:flex-start}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;-webkit-user-select:none;user-select:none}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;color:#ccc;white-space:nowrap;cursor:pointer}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-item[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label[_ngcontent-%COMP%] .tb-time-series-chart-legend-item-label-circle[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:#ccc}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-type-label[_ngcontent-%COMP%]{white-space:nowrap;text-align:left}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-type-label.right[_ngcontent-%COMP%]{text-align:right}.tb-time-series-chart-panel[_ngcontent-%COMP%] .tb-time-series-chart-content[_ngcontent-%COMP%] .tb-time-series-chart-legend[_ngcontent-%COMP%] .tb-time-series-chart-legend-value[_ngcontent-%COMP%]{white-space:nowrap;text-align:right}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{font-size:12px;font-style:normal;font-weight:500;letter-spacing:normal;line-height:16px}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend.legend-row-color[_ngcontent-%COMP%]{color:#00000061}.tb-time-series-chart-panel[_ngcontent-%COMP%] .legend.legend-label-color[_ngcontent-%COMP%]{color:#000}']})}}const gj=["statisticChart"];function fj(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",12),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.openEditCommandDialog())})),t.ɵɵelementStart(2,"mat-icon",13),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",12),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.onDeleteClick())})),t.ɵɵelementStart(6,"mat-icon",13),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function yj(e,n){if(1&e&&t.ɵɵelement(0,"tb-gateway-statistics-chart",14,0),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("ctx",e.ctx)}}function vj(e,n){if(1&e&&t.ɵɵelement(0,"tb-custom-statistics-table",15),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("data",e.subscriptionData)}}function xj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10),t.ɵɵtemplate(1,yj,2,1,"tb-gateway-statistics-chart",14)(2,vj,1,1,"tb-custom-statistics-table",15),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵconditional(e.isNumericData?1:2)}}function bj(e,n){1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵelement(1,"div",16),t.ɵɵelementStart(2,"div",17),t.ɵɵtext(3,"attribute.no-telemetry-text"),t.ɵɵelementEnd()())}class wj{constructor(e,t,n,i,a,r){this.fb=e,this.attributeService=t,this.destroyRef=n,this.dialog=i,this.dialogService=a,this.utils=r,this.subscriptionData=[],this.statisticForm=this.fb.group({command:[]}),this.isNumericData=!1,this.commands=[],this.subscribed=!1,this.dataTypeDefined=!1,this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.isDataOnlyNumbers(),this.isNumericData&&this.statisticChart?.onDataUpdated()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)}))},useDashboardTimewindow:!1,legendConfig:F(R.timeseries)},this.statisticForm.get("command").valueChanges.pipe(In()).subscribe((e=>{this.subscribed=!1,this.subscriptionInfo&&e?.attributeOnGateway&&this.createSubscription(this.ctx.defaultSubscription.datasources[0].entity,e.attributeOnGateway)}))}ngAfterViewInit(){if(this.ctx.defaultSubscription.datasources.length){const e=this.ctx.defaultSubscription.datasources[0].entity;if(e.id.id===B)return;this.getGatewayGeneralConfig().pipe(In(this.destroyRef)).subscribe((t=>{this.commands=t?.statistics.commands.reverse()??[],this.commands.length&&(this.statisticForm.get("command").setValue(this.commands[0]),this.createSubscription(e,this.commands[0].attributeOnGateway))}))}}openEditCommandDialog(){const e=this.statisticForm.get("command").value,t="string"==typeof e||!e,n="string"==typeof e?{attributeOnGateway:e}:e;let i;this.dialog.open(cr,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{titleText:t?"gateway.statistics.create-command":"gateway.statistics.edit-command",buttonText:t?"action.add":"action.apply",command:n,existingCommands:this.commands.map((e=>e.attributeOnGateway))}}).afterClosed().pipe(Ve((e=>Te(this.getGatewayGeneralConfig(),_e(e)))),Ve((([e,t])=>(this.commands=[...e?.statistics.commands.filter((e=>e.attributeOnGateway!==t?.prev?.attributeOnGateway))??[],...t?.current?[{...t.current}]:[]],i=t?.current,this.updateStatisticsCommands(e,this.commands)))),In(this.destroyRef)).subscribe((()=>{i&&this.statisticForm.get("command").patchValue(i)}))}onDeleteClick(){const e=this.statisticForm.get("command").value.attributeOnGateway;this.dialogService.confirm(this.ctx.translate.instant("gateway.statistics.delete-command",{command:e}),this.ctx.translate.instant("gateway.statistics.delete-command-data"),this.ctx.translate.instant("action.cancel"),this.ctx.translate.instant("action.confirm")).pipe(Le(Boolean),Ve((()=>this.getGatewayGeneralConfig())),Ve((t=>(this.commands=[...t.statistics.commands.filter((t=>t.attributeOnGateway!==e))],this.updateStatisticsCommands(t,this.commands)))),In(this.destroyRef)).subscribe()}getGatewayGeneralConfig(){const e=this.ctx.defaultSubscription.datasources[0].entity;return e.id.id===B?_e(null):this.attributeService.getEntityAttributes(e.id,D.SHARED_SCOPE,["general_configuration"]).pipe(ke((e=>e[0]?.value)))}updateStatisticsCommands(e,t){const n=this.ctx.defaultSubscription.datasources[0].entity;return n.id.id!==B&&e?this.attributeService.saveEntityAttributes(n.id,D.SHARED_SCOPE,[{key:"general_configuration",value:{...e,statistics:{...e.statistics,commands:t}}}]):_e(null)}createSubscription(e,t){const n=[{type:N.entity,entityType:L.DEVICE,entityId:e.id.id,entityName:e.name,timeseries:[]}];n[0].timeseries=[{name:t,label:t,settings:{}}],this.subscriptionInfo=n,this.changeSubscription(n)}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}isDataOnlyNumbers(){this.subscriptionData=this.ctx.defaultSubscription.data[0]?.data??[],this.subscriptionData.length&&!this.dataTypeDefined&&(this.isNumericData=this.subscriptionData.every((e=>!isNaN(+e[1]))),this.dataTypeDefined=!0),this.ctx.detectChanges()}changeSubscription(e){this.ctx.defaultSubscription?.unsubscribe(),this.ctx.datasources[0].entity&&this.ctx.subscriptionApi.createSubscriptionFromInfo(R.timeseries,e,this.subscriptionOptions,!1,!0).pipe(In(this.destroyRef)).subscribe((e=>{this.dataTypeDefined=!1,this.ctx.defaultSubscription=e,this.ctx.settings.showLegend=!1,this.ctx.data=e.data,this.ctx.datasources=e.datasources,this.isDataOnlyNumbers(),this.subscribed=!0}))}static{this.ɵfac=function(e){return new(e||wj)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(K.AttributeService),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(K.UtilsService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:wj,selectors:[["tb-gateway-statistics"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(gj,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.statisticChart=e.first)}},inputs:{ctx:"ctx"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:18,vars:13,consts:[["statisticChart",""],[1,"flex","flex-1","flex-col","max-h-full"],[1,"entry-container","flex","items-center"],[1,"tb-form-panel","stroked","w-full","flex-1",3,"formGroup"],["translate","",1,"tb-form-panel-title"],[1,"entry-container","flex","w-full","gap-2"],["formControlName","command",1,"flex-1",3,"onCreateNewClicked","commands"],["appearance","outline",1,"flex-1"],["matInput","","disabled","",3,"tbTruncateWithTooltip","value"],[1,"actions-container","flex","flex-col","p-2","min-w-16"],[1,"chart-box","flex","flex-1","flex-col","overflow-auto"],[1,"tb-no-data-available","h-full"],["type","button","matSuffix","","mat-icon-button","","aria-label","Edit","matTooltipPosition","above",1,"action-button",3,"click","matTooltip"],[1,"material-icons"],[1,"flex-1",3,"ctx"],[1,"h-full","flex-1",3,"data"],[1,"tb-no-data-bg"],["translate","",1,"tb-no-data-text"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t.ɵɵtext(4,"gateway.statistics.entry"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",5)(6,"tb-statistics-commands-autocomplete",6),t.ɵɵlistener("onCreateNewClicked",(function(){return n.openEditCommandDialog()})),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-form-field",7)(8,"mat-label"),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(11,"input",8),t.ɵɵpipe(12,"translate"),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(14,"div",9),t.ɵɵtemplate(15,fj,8,6),t.ɵɵelementEnd()(),t.ɵɵtemplate(16,xj,3,1,"div",10)(17,bj,4,0,"div",11),t.ɵɵelementEnd()),2&e){let e,i,a,r;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",n.statisticForm),t.ɵɵadvance(4),t.ɵɵproperty("commands",n.commands),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,7,"gateway.statistics.command")),t.ɵɵadvance(2),t.ɵɵproperty("tbTruncateWithTooltip",null!==(e=null==(e=n.statisticForm.get("command").value)?null:e.command)&&void 0!==e?e:t.ɵɵpipeBind1(12,9,"gateway.statistics.no-config-commands-found"))("value",null!==(i=null==(i=n.statisticForm.get("command").value)?null:i.command)&&void 0!==i?i:t.ɵɵpipeBind1(13,11,"gateway.statistics.no-config-commands-found")),t.ɵɵadvance(4),t.ɵɵconditional(null!=(a=n.statisticForm.get("command").value)&&a.attributeOnGateway?15:-1),t.ɵɵadvance(),t.ɵɵconditional(null!=(r=n.statisticForm.get("command").value)&&r.attributeOnGateway&&n.subscriptionData.length&&n.subscribed?16:17)}},dependencies:t.ɵɵgetComponentDepsFactory(wj,[se,_,Nn,Hn,hj]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;padding:4px;display:flex;flex-direction:column}[_nghost-%COMP%] .action-button[_ngcontent-%COMP%]{opacity:.7}@media screen and (max-width: 599px){[_nghost-%COMP%] .entry-container[_ngcontent-%COMP%]{flex-direction:column}[_nghost-%COMP%] .actions-container[_ngcontent-%COMP%]{flex-direction:row}}']})}}var Sj;e("GatewayStatisticsComponent",wj),e("BACnetRequestTypes",Sj),function(e){e.WriteProperty="writeProperty",e.ReadProperty="readProperty"}(Sj||e("BACnetRequestTypes",Sj={}));const Cj=e("BACnetRequestTypesTranslates",new Map([[Sj.WriteProperty,"gateway.rpc.write-property"],[Sj.ReadProperty,"gateway.rpc.read-property"]]));var _j;e("BACnetObjectTypes",_j),function(e){e.BinaryInput="binaryInput",e.BinaryOutput="binaryOutput",e.AnalogInput="analogInput",e.AnalogOutput="analogOutput",e.BinaryValue="binaryValue",e.AnalogValue="analogValue"}(_j||e("BACnetObjectTypes",_j={}));const Tj=e("BACnetObjectTypesTranslates",new Map([[_j.AnalogOutput,"gateway.rpc.analog-output"],[_j.AnalogInput,"gateway.rpc.analog-input"],[_j.BinaryOutput,"gateway.rpc.binary-output"],[_j.BinaryInput,"gateway.rpc.binary-input"],[_j.BinaryValue,"gateway.rpc.binary-value"],[_j.AnalogValue,"gateway.rpc.analog-value"]]));var Ij;e("BLEMethods",Ij),function(e){e.WRITE="write",e.READ="read",e.SCAN="scan"}(Ij||e("BLEMethods",Ij={}));const Ej=e("BLEMethodsTranslates",new Map([[Ij.WRITE,"gateway.rpc.write"],[Ij.READ,"gateway.rpc.read"],[Ij.SCAN,"gateway.rpc.scan"]]));var Mj,kj;e("CANByteOrders",Mj),function(e){e.LITTLE="LITTLE",e.BIG="BIG"}(Mj||e("CANByteOrders",Mj={})),e("SocketMethodProcessings",kj),function(e){e.WRITE="write",e.READ="read"}(kj||e("SocketMethodProcessings",kj={}));const Pj=e("SocketMethodProcessingsTranslates",new Map([[kj.WRITE,"gateway.rpc.write"],[kj.READ,"gateway.rpc.read"]]));var Dj;e("SNMPMethods",Dj),function(e){e.SET="set",e.MULTISET="multiset",e.GET="get",e.BULKWALK="bulkwalk",e.TABLE="table",e.MULTIGET="multiget",e.GETNEXT="getnext",e.BULKGET="bulkget",e.WALKS="walk"}(Dj||e("SNMPMethods",Dj={}));const Oj=e("SNMPMethodsTranslations",new Map([[Dj.SET,"gateway.rpc.set"],[Dj.MULTISET,"gateway.rpc.multiset"],[Dj.GET,"gateway.rpc.get"],[Dj.BULKWALK,"gateway.rpc.bulk-walk"],[Dj.TABLE,"gateway.rpc.table"],[Dj.MULTIGET,"gateway.rpc.multi-get"],[Dj.GETNEXT,"gateway.rpc.get-next"],[Dj.BULKGET,"gateway.rpc.bulk-get"],[Dj.WALKS,"gateway.rpc.walk"]]));var Aj,Fj;e("SocketEncodings",Aj),function(e){e.UTF_8="utf-8"}(Aj||e("SocketEncodings",Aj={})),e("RestSecurityType",Fj),function(e){e.ANONYMOUS="anonymous",e.BASIC="basic"}(Fj||e("RestSecurityType",Fj={}));const Rj=e("RestSecurityTypeTranslationsMap",new Map([[Fj.ANONYMOUS,"gateway.broker.security-types.anonymous"],[Fj.BASIC,"gateway.broker.security-types.basic"]]));class Bj{transform(e){return e.map((e=>(e?.value??e).toString())).join(", ")}static{this.ɵfac=function(e){return new(e||Bj)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getRpcTemplateArrayView",type:Bj,pure:!0,standalone:!0})}}e("RpcTemplateArrayViewPipe",Bj);class Nj{constructor(){this.differs=i(f),this.keyValues=[]}transform(e){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ??=this.differs.find(e).create();const t=this.differ.diff(e);return t&&(this.keyValues=[],t.forEachItem((e=>{J(e.currentValue)&&this.keyValues.push(this.makeKeyValuePair(e.key,e.currentValue))}))),this.keyValues}makeKeyValuePair(e,t){return{key:e,value:t}}static{this.ɵfac=function(e){return new(e||Nj)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"keyValueIsNotEmpty",type:Nj,pure:!1,standalone:!0})}}e("KeyValueIsNotEmptyPipe",Nj);const Lj=e=>({$implicit:e,innerValue:!1}),Vj=e=>({"padding-left":e}),qj=(e,t)=>({"boolean-true":e,"boolean-false":t}),Gj=e=>({$implicit:e,innerValue:!0});function zj(e,n){if(1&e&&t.ɵɵelementContainer(0,13),2&e){const e=n.$implicit;t.ɵɵnextContext();const i=t.ɵɵreference(15);t.ɵɵproperty("ngTemplateOutlet",i)("ngTemplateOutletContext",t.ɵɵpureFunction1(2,Lj,e))}}function Uj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",19),t.ɵɵtext(1),t.ɵɵpipe(2,"getRpcTemplateArrayView"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,e.value)," ")}}function jj(e,n){if(1&e&&t.ɵɵelementContainer(0,20),2&e){t.ɵɵnextContext();const e=t.ɵɵreference(12);t.ɵɵproperty("ngTemplateOutlet",e)}}function Hj(e,n){if(1&e&&t.ɵɵelementContainer(0,20),2&e){t.ɵɵnextContext(2);const e=t.ɵɵreference(10);t.ɵɵproperty("ngTemplateOutlet",e)}}function Wj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵtemplate(1,Hj,1,1,"ng-container",21),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵreference(8),i=t.ɵɵnextContext().$implicit,a=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction2(4,qj,!0===e.value,!1===e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",i.type===a.ConnectorType.SNMP&&"method"===e.key)("ngIfElse",n)}}function $j(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate(e.value)}}function Kj(e,n){if(1&e&&(t.ɵɵtext(0),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵtextInterpolate(t.ɵɵpipeBind1(1,1,n.SNMPMethodsTranslations.get(e.value)))}}function Yj(e,n){if(1&e&&t.ɵɵelementContainer(0,13),2&e){const e=n.$implicit;t.ɵɵnextContext(3);const i=t.ɵɵreference(15);t.ɵɵproperty("ngTemplateOutlet",i)("ngTemplateOutletContext",t.ɵɵpureFunction1(2,Gj,e))}}function Xj(e,n){if(1&e&&(t.ɵɵtemplate(0,Yj,1,4,"ng-container",12),t.ɵɵpipe(1,"keyvalue")),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("ngForOf",t.ɵɵpipeBind2(1,1,e.value,n.originalOrder))}}function Zj(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14)(1,"div",15),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(4,Uj,3,3,"div",16)(5,jj,1,1,"ng-container",17)(6,Wj,2,7,"div",18)(7,$j,1,1,"ng-template",null,1,t.ɵɵtemplateRefExtractor)(9,Kj,2,3,"ng-template",null,2,t.ɵɵtemplateRefExtractor)(11,Xj,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=n.innerValue,a=t.ɵɵnextContext(2);t.ɵɵstyleMap(t.ɵɵpureFunction1(10,Vj,i?"16px":"0")),t.ɵɵclassMap(a.getRpcParamsRowClasses(e.value)),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",i?e.key:t.ɵɵpipeBind1(3,8,"gateway.rpc."+e.key)," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",a.isArray(e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",a.isObject(e.value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!a.isObject(e.value)&&!a.isArray(e.value))}}function Qj(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-expansion-panel",6)(1,"mat-expansion-panel-header")(2,"mat-panel-title",7)(3,"span",8),t.ɵɵtext(4),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"mat-panel-description")(6,"button",9),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteTemplate(n,i))})),t.ɵɵelementStart(7,"mat-icon",10),t.ɵɵtext(8,"delete"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",11),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.applyTemplate(n,i))})),t.ɵɵelementStart(10,"mat-icon",10),t.ɵɵtext(11,"play_arrow"),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(12,zj,1,4,"ng-container",12),t.ɵɵpipe(13,"keyValueIsNotEmpty"),t.ɵɵtemplate(14,Zj,13,12,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit;t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",e.name),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(13,3,e.config))}}class Jj{constructor(e){this.attributeService=e,this.saveTemplate=new u,this.useTemplate=new u,this.ConnectorType=dt,this.originalOrder=()=>0,this.isObject=e=>H(e),this.isArray=e=>Array.isArray(e),this.SNMPMethodsTranslations=Oj}applyTemplate(e,t){e.stopPropagation(),this.useTemplate.emit(t)}deleteTemplate(e,t){e.stopPropagation();const n=this.rpcTemplates.findIndex((e=>e.name==t.name));this.rpcTemplates.splice(n,1);const i=`${this.connectorType}_template`;this.attributeService.saveEntityAttributes({id:this.ctx.defaultSubscription.targetDeviceId,entityType:L.DEVICE},D.SERVER_SCOPE,[{key:i,value:this.rpcTemplates}]).subscribe((()=>{}))}getRpcParamsRowClasses(e){return this.isObject(e)?"flex-col":"flex-row justify-between items-center"}static{this.ɵfac=function(e){return new(e||Jj)(t.ɵɵdirectiveInject(K.AttributeService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Jj,selectors:[["tb-gateway-service-rpc-connector-templates"]],inputs:{connectorType:"connectorType",ctx:"ctx",rpcTemplates:"rpcTemplates"},outputs:{saveTemplate:"saveTemplate",useTemplate:"useTemplate"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:4,vars:4,consts:[["RPCTemplateRef",""],["value",""],["SNMPMethod",""],["RPCObjectRow",""],[1,"mat-subtitle-1","title"],["hideToggle","",4,"ngFor","ngForOf"],["hideToggle",""],[1,"template-name"],["matTooltipPosition","above",3,"matTooltip"],["mat-icon-button","","matTooltip","Delete",3,"click"],[1,"material-icons"],["mat-icon-button","","matTooltip","Use",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"rpc-params-row","flex"],[1,"template-key"],["tbTruncateWithTooltip","","class","array-value",4,"ngIf"],[3,"ngTemplateOutlet",4,"ngIf"],[3,"class",4,"ngIf"],["tbTruncateWithTooltip","",1,"array-value"],[3,"ngTemplateOutlet"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(3,Qj,16,5,"mat-expansion-panel",5)),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,"gateway.rpc.templates-title")),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",n.rpcTemplates))},dependencies:t.ɵɵgetComponentDepsFactory(Jj,[se,_,Bj,Nj]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;padding:0}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .template-key[_ngcontent-%COMP%]{color:#00000061;height:32px;line-height:32px}[_nghost-%COMP%] .boolean-true[_ngcontent-%COMP%], [_nghost-%COMP%] .boolean-false[_ngcontent-%COMP%]{border-radius:3px;height:32px;line-height:32px;padding:0 12px;width:fit-content;font-size:14px;text-transform:capitalize}[_nghost-%COMP%] .boolean-false[_ngcontent-%COMP%]{color:#d12730;background-color:#d1273014}[_nghost-%COMP%] .boolean-true[_ngcontent-%COMP%]{color:#198038;background-color:#19803814}[_nghost-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{margin-top:10px;overflow:visible}[_nghost-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-direction:row-reverse;align-items:center;margin-right:0;flex:0}[_nghost-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{margin-left:15px;color:#00000061}[_nghost-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 0 0 12px}[_nghost-%COMP%] .mat-expansion-panel-header.mat-expansion-panel-header.mat-expanded[_ngcontent-%COMP%]{height:48px}[_nghost-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%] .mat-content.mat-content-hide-toggle[_ngcontent-%COMP%]{margin-right:0}[_nghost-%COMP%] .rpc-params-row[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap}[_nghost-%COMP%] .rpc-params-row[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:first-child){white-space:pre;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .template-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;display:block}[_nghost-%COMP%] .mat-content{align-items:center}[_nghost-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%]{flex:1;margin:0}[_nghost-%COMP%] .array-value[_ngcontent-%COMP%]{margin-left:10px}']})}}function eH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.template-name-required")," "))}function tH(e,n){1&e&&(t.ɵɵelementStart(0,"div",12),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.template-name-duplicate")," "))}e("GatewayServiceRPCConnectorTemplatesComponent",Jj);class nH extends A{constructor(e,t,n,i,a){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.config=this.data.config,this.templates=this.data.templates,this.templateNameCtrl=this.fb.control("",[me.required])}validateDuplicateName(e){const t=e.value.trim();return!!this.templates.find((e=>e.name===t))}close(){this.dialogRef.close()}save(){this.templateNameCtrl.setValue(this.templateNameCtrl.value.trim()),this.templateNameCtrl.valid&&this.dialogRef.close(this.templateNameCtrl.value)}static{this.ɵfac=function(e){return new(e||nH)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:nH,selectors:[["tb-gateway-service-rpc-connector-template-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:20,vars:10,consts:[["color","primary",1,"justify-between"],["translate",""],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"mat-content","flex","flex-col",2,"width","600px"],[1,"mat-block","tb-value-type",2,"flex-grow","0"],["matInput","","required","",3,"formControl"],[4,"ngIf"],["class","mat-mdc-form-field-error","style","margin-top: -15px; padding-left: 10px; font-size: 14px;",4,"ngIf"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"mat-mdc-form-field-error",2,"margin-top","-15px","padding-left","10px","font-size","14px"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-toolbar",0)(1,"h2",1),t.ɵɵtext(2,"gateway.rpc.save-template"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"button",2),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵelementStart(4,"mat-icon",3),t.ɵɵtext(5,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(6,"div",4)(7,"mat-form-field",5)(8,"mat-label",1),t.ɵɵtext(9,"gateway.rpc.template-name"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",6),t.ɵɵtemplate(11,eH,3,3,"mat-error",7),t.ɵɵelementEnd(),t.ɵɵtemplate(12,tH,3,3,"div",8),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",9)(14,"button",10),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵlistener("click",(function(){return n.save()})),t.ɵɵtext(18),t.ɵɵpipe(19,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(10),t.ɵɵproperty("formControl",n.templateNameCtrl),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.templateNameCtrl.hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.validateDuplicateName(n.templateNameCtrl)),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(16,6,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",!n.templateNameCtrl.valid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(19,8,"action.save")," "))},dependencies:t.ɵɵgetComponentDepsFactory(nH,[se,_]),encapsulation:2})}}function iH(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",6),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SecurityTypeTranslationsMap.get(e))," ")}}function aH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function rH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.password-required"))}function oH(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",7)(2,"div",8),t.ɵɵtext(3,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",9)(5,"mat-form-field",10),t.ɵɵelement(6,"input",11),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,aH,3,3,"mat-icon",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",7)(10,"div",8),t.ɵɵtext(11,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"div",9)(13,"mat-form-field",10),t.ɵɵelement(14,"input",13),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,rH,3,3,"mat-icon",12),t.ɵɵelementStart(17,"div",14),t.ɵɵelement(18,"tb-toggle-password",15),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,6,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("password").hasError("required")&&e.securityFormGroup.get("password").touched),t.ɵɵadvance(),t.ɵɵclassProp("hide-toggle",e.securityFormGroup.get("password").hasError("required"))}}e("GatewayServiceRPCConnectorTemplateDialogComponent",nH);class sH{constructor(e){this.fb=e,this.BrokerSecurityType=Fj,this.securityTypes=Object.values(Fj),this.SecurityTypeTranslationsMap=Rj,this.destroy$=new we,this.propagateChange=e=>{},this.securityFormGroup=this.fb.group({type:[Fj.ANONYMOUS,[]],username:["",[me.required,me.pattern(pn)]],password:["",[me.required,me.pattern(pn)]]}),this.observeSecurityForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}writeValue(e){e.type||(e.type=Fj.ANONYMOUS),this.securityFormGroup.reset(e),this.updateView(e)}validate(){return this.securityFormGroup.valid?null:{securityForm:{valid:!1}}}updateView(e){this.propagateChange(e)}updateValidators(e){e===Fj.BASIC?(this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1})):(this.securityFormGroup.get("username").disable({emitEvent:!1}),this.securityFormGroup.get("password").disable({emitEvent:!1}))}observeSecurityForm(){this.securityFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateView(e))),this.securityFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateValidators(e)))}static{this.ɵfac=function(e){return new(e||sH)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:sH,selectors:[["tb-rest-connector-security"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>sH)),multi:!0},{provide:he,useExisting:c((()=>sH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:7,vars:3,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fields-label"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"value"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["translate","",1,"fixed-title-width"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","username",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","password","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.security"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"tb-toggle-select",3),t.ɵɵtemplate(5,iH,3,4,"tb-toggle-option",4),t.ɵɵelementEnd()(),t.ɵɵtemplate(6,oH,19,10,"ng-container",5),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.securityTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value===n.BrokerSecurityType.BASIC))},dependencies:t.ɵɵgetComponentDepsFactory(sH,[_,se]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block;margin-bottom:10px}[_nghost-%COMP%] .fields-label[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .hide-toggle[_ngcontent-%COMP%]{display:none}'],changeDetection:d.OnPush})}}e("RestConnectorSecurityComponent",sH);const lH=e=>({type:e});function pH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bACnetRequestTypesTranslates.get(e))," ")}}function cH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bACnetObjectTypesTranslates.get(e))," ")}}function dH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",9),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",10)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",11),t.ɵɵtemplate(10,pH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field")(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",13),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",14)(17,"mat-form-field",15)(18,"mat-label"),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-select",16),t.ɵɵtemplate(22,cH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",17),t.ɵɵelementEnd()(),t.ɵɵelementStart(28,"mat-form-field",10)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",18),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,8,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,10,"gateway.rpc.requestType")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bACnetRequestTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,12,"gateway.rpc.requestTimeout")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,14,"gateway.rpc.objectType")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bACnetObjectTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,16,"gateway.rpc.identifier")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,18,"gateway.rpc.propertyId"))}}function uH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.bLEMethodsTranslates.get(e))," ")}}function mH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",20),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",21),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-form-field",10)(11,"mat-label"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-select",22),t.ɵɵtemplate(15,uH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"mat-slide-toggle",23),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,5,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,7,"gateway.rpc.characteristicUUID")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,9,"gateway.rpc.methodProcessing")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.bLEMethods),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,11,"gateway.rpc.withResponse")," ")}}function hH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e)," ")}}function gH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",24),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",25),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",26),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-slide-toggle",27),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-slide-toggle",28),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",14)(20,"mat-form-field",15)(21,"mat-label"),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",29),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",15)(26,"mat-label"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-select",30),t.ɵɵtemplate(30,hH,3,4,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(31,"div",14)(32,"mat-form-field",15)(33,"mat-label"),t.ɵɵtext(34),t.ɵɵpipe(35,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(36,"input",31),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",15)(38,"mat-label"),t.ɵɵtext(39),t.ɵɵpipe(40,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(41,"input",32),t.ɵɵelementEnd()(),t.ɵɵelementStart(42,"mat-form-field")(43,"mat-label"),t.ɵɵtext(44),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(46,"input",33),t.ɵɵelementEnd(),t.ɵɵelementStart(47,"mat-form-field")(48,"mat-label"),t.ɵɵtext(49),t.ɵɵpipe(50,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(51,"input",34),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,12,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,14,"gateway.rpc.nodeID")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,16,"gateway.rpc.isExtendedID")," "),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,18,"gateway.rpc.isFD")," "),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,20,"gateway.rpc.bitrateSwitch")," "),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(23,22,"gateway.rpc.dataLength")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,24,"gateway.rpc.dataByteorder")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.cANByteOrders),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(35,26,"gateway.rpc.dataBefore")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(40,28,"gateway.rpc.dataAfter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(45,30,"gateway.rpc.dataInHEX")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(50,32,"gateway.rpc.dataExpression"))}}function fH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",35),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,2,"gateway.rpc.methodFilter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,4,"gateway.rpc.valueExpression")))}function yH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",37),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",38),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,5,"gateway.rpc.valueExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.rpc.withResponse")," "))}function vH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",37),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-slide-toggle",38),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,5,"gateway.rpc.valueExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.rpc.withResponse")," "))}function xH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SNMPMethodsTranslations.get(e))," ")}}function bH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",45)(1,"mat-form-field",46),t.ɵɵelement(2,"input",47),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-icon",48),t.ɵɵpipe(4,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(3);return t.ɵɵresetView(i.removeSNMPoid(n))})),t.ɵɵtext(5,"delete "),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵproperty("formControl",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(4,2,"gateway.rpc.remove"))}}function wH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",39),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",10)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",40),t.ɵɵtemplate(10,xH,3,4,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-slide-toggle",38),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"fieldset",41)(15,"span",42),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(18,bH,6,4,"div",43),t.ɵɵelementStart(19,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addSNMPoid())})),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,7,"gateway.rpc.requestFilter")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,9,"gateway.rpc.method")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sNMPMethods),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,11,"gateway.rpc.withResponse")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(17,13,"gateway.rpc.oids"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",e.getFormArrayControls("oid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(21,15,"gateway.rpc.add-oid")," ")}}function SH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function CH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",59),t.ɵɵelementContainerStart(1,63),t.ɵɵelementStart(2,"mat-form-field",64),t.ɵɵelement(3,"input",65),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",64),t.ɵɵelement(5,"input",66),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-icon",67),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(4);return t.ɵɵresetView(i.removeHTTPHeader(n))})),t.ɵɵtext(8,"delete "),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()}if(2&e){const e=n.index;t.ɵɵadvance(),t.ɵɵproperty("formGroupName",e),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,2,"gateway.rpc.remove"))}}function _H(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",58)(1,"div",59)(2,"span",60),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"span",60),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"span",61),t.ɵɵelementEnd(),t.ɵɵelement(9,"mat-divider"),t.ɵɵtemplate(10,CH,9,4,"div",62),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.header-name")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,5,"gateway.rpc.value")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.getFormArrayControls("httpHeaders"))}}function TH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",49),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",14)(6,"mat-form-field",50)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",51),t.ɵɵtemplate(11,SH,2,2,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",15)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",52),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",14)(18,"mat-form-field",15)(19,"mat-label"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(22,"input",53),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",54),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",15)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",55),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"mat-form-field")(34,"mat-label"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",36),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"fieldset",56)(39,"span",42),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(42,_H,11,7,"div",57),t.ɵɵelementStart(43,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addHTTPHeader())})),t.ɵɵtext(44),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,11,"gateway.rpc.methodFilter")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,13,"gateway.rpc.httpMethod")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.hTTPMethods),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,15,"gateway.rpc.requestUrlExpression")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(21,17,"gateway.rpc.responseTimeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,19,"gateway.rpc.timeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,21,"gateway.rpc.tries")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,23,"gateway.rpc.valueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,25,"gateway.rpc.httpHeaders")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.getFormArrayControls("httpHeaders").length),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(45,27,"gateway.rpc.add-header")," ")}}function IH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",19),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function EH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",59),t.ɵɵelementContainerStart(1,63),t.ɵɵelementStart(2,"mat-form-field",64),t.ɵɵelement(3,"input",73),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",64),t.ɵɵelement(6,"input",74),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-icon",67),t.ɵɵpipe(8,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext(4);return t.ɵɵresetView(i.removeHTTPHeader(n))})),t.ɵɵtext(9,"delete "),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()}if(2&e){const e=n.index;t.ɵɵadvance(),t.ɵɵproperty("formGroupName",e),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(4,3,"gateway.rpc.set")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,5,"gateway.rpc.remove"))}}function MH(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",58)(1,"div",59)(2,"span",60),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"span",60),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"span",61),t.ɵɵelementEnd(),t.ɵɵelement(9,"mat-divider"),t.ɵɵtemplate(10,EH,10,7,"div",62),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.header-name")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,5,"gateway.rpc.value")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.getFormArrayControls("httpHeaders"))}}function kH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",68),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",59)(6,"mat-form-field",50)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",51),t.ɵɵtemplate(11,IH,2,2,"mat-option",12),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",15)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",52),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",59)(18,"mat-form-field",15)(19,"mat-label"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(22,"input",53),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",15)(24,"mat-label"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",69),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",15)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",70),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"mat-form-field")(34,"mat-label"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",71),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"mat-form-field")(39,"mat-label"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(42,"input",72),t.ɵɵelementEnd(),t.ɵɵelementStart(43,"fieldset",56)(44,"span",42),t.ɵɵtext(45),t.ɵɵpipe(46,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(47,MH,11,7,"div",57),t.ɵɵelementStart(48,"button",44),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.addHTTPHeader())})),t.ɵɵtext(49),t.ɵɵpipe(50,"translate"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,12,"gateway.rpc.methodFilter")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,14,"gateway.rpc.httpMethod")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.hTTPMethods),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,16,"gateway.rpc.requestUrlExpression")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(21,18,"gateway.rpc.responseTimeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(26,20,"gateway.rpc.timeout")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,22,"gateway.rpc.tries")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,24,"gateway.rpc.requestValueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,26,"gateway.rpc.responseValueExpression")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(46,28,"gateway.rpc.httpHeaders")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.getFormArrayControls("httpHeaders").length),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(50,30,"gateway.rpc.add-header")," ")}}function PH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rpc.json-value-invalid")," "))}function DH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",75),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field")(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(9,"input",76),t.ɵɵelementStart(10,"mat-icon",77),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext(2);return t.ɵɵresetView(i.openEditJSONDialog(n))})),t.ɵɵtext(12,"edit "),t.ɵɵelementEnd(),t.ɵɵtemplate(13,PH,3,3,"mat-error",78),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,4,"gateway.statistics.command")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,6,"widget-config.datasource-parameters")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,8,"gateway.rpc-command-edit-params")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.commandForm.get("params").hasError("invalidJSON"))}}function OH(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,6),t.ɵɵtemplate(1,dH,33,20,"ng-template",7)(2,mH,19,13,"ng-template",7)(3,gH,52,34,"ng-template",7)(4,fH,10,6,"ng-template",7)(5,yH,13,9,"ng-template",7)(6,vH,13,9,"ng-template",7)(7,wH,22,17,"ng-template",7)(8,TH,46,29,"ng-template",7)(9,kH,51,32,"ng-template",7)(10,DH,14,10,"ng-template",8),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("ngSwitch",e.connectorType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.CAN),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.FTP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OCPP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.XMPP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SNMP),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REQUEST)}}class AH{constructor(e,t){this.fb=e,this.dialog=t,this.sendCommand=new u,this.saveTemplate=new u,this.ConnectorType=dt,this.bACnetRequestTypes=Object.values(Sj),this.bACnetObjectTypes=Object.values(_j),this.bLEMethods=Object.values(Ij),this.cANByteOrders=Object.values(Mj),this.sNMPMethods=Object.values(Dj),this.hTTPMethods=Object.values(gt),this.bACnetRequestTypesTranslates=Cj,this.bACnetObjectTypesTranslates=Tj,this.bLEMethodsTranslates=Ej,this.SNMPMethodsTranslations=Oj,this.gatewayConnectorDefaultTypesTranslates=ut,this.urlPattern=/^[-a-zA-Zd_$:{}?~+=\/.0-9-]*$/,this.numbersOnlyPattern=/^[0-9]*$/,this.hexOnlyPattern=/^[0-9A-Fa-f ]+$/,this.propagateChange=e=>{},this.destroy$=new we}ngOnInit(){this.commandForm=this.connectorParamsFormGroupByType(this.connectorType),this.observeFormChanges()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}connectorParamsFormGroupByType(e){let t;switch(e){case dt.BACNET:t=this.fb.group({method:[null,[me.required,me.pattern(pn)]],requestType:[null,[me.required,me.pattern(pn)]],requestTimeout:[null,[me.required,me.min(10),me.pattern(this.numbersOnlyPattern)]],objectType:[null,[]],identifier:[null,[me.required,me.min(1),me.pattern(this.numbersOnlyPattern)]],propertyId:[null,[me.required,me.pattern(pn)]]});break;case dt.BLE:t=this.fb.group({methodRPC:[null,[me.required,me.pattern(pn)]],characteristicUUID:["00002A00-0000-1000-8000-00805F9B34FB",[me.required,me.pattern(pn)]],methodProcessing:[null,[me.required]],withResponse:[!1,[]]});break;case dt.CAN:t=this.fb.group({method:[null,[me.required,me.pattern(pn)]],nodeID:[null,[me.required,me.min(0),me.pattern(this.numbersOnlyPattern)]],isExtendedID:[!1,[]],isFD:[!1,[]],bitrateSwitch:[!1,[]],dataLength:[null,[me.min(1),me.pattern(this.numbersOnlyPattern)]],dataByteorder:[null,[]],dataBefore:[null,[me.pattern(pn),me.pattern(this.hexOnlyPattern)]],dataAfter:[null,[me.pattern(pn),me.pattern(this.hexOnlyPattern)]],dataInHEX:[null,[me.pattern(pn),me.pattern(this.hexOnlyPattern)]],dataExpression:[null,[me.pattern(pn)]]});break;case dt.FTP:t=this.fb.group({methodFilter:[null,[me.required,me.pattern(pn)]],valueExpression:[null,[me.required,me.pattern(pn)]]});break;case dt.OCPP:case dt.XMPP:t=this.fb.group({methodRPC:[null,[me.required,me.pattern(pn)]],valueExpression:[null,[me.required,me.pattern(pn)]],withResponse:[!1,[]]});break;case dt.SNMP:t=this.fb.group({requestFilter:[null,[me.required,me.pattern(pn)]],method:[null,[me.required]],withResponse:[!1,[]],oid:this.fb.array([],[me.required])});break;case dt.REST:t=this.fb.group({methodFilter:[null,[me.required,me.pattern(pn)]],httpMethod:[null,[me.required]],requestUrlExpression:[null,[me.required,me.pattern(this.urlPattern)]],responseTimeout:[null,[me.required,me.min(10),me.pattern(this.numbersOnlyPattern)]],timeout:[null,[me.required,me.min(10),me.pattern(this.numbersOnlyPattern)]],tries:[null,[me.required,me.min(1),me.pattern(this.numbersOnlyPattern)]],valueExpression:[null,[me.required,me.pattern(pn)]],httpHeaders:this.fb.array([]),security:[{},[me.required]]});break;case dt.REQUEST:t=this.fb.group({methodFilter:[null,[me.required,me.pattern(pn)]],httpMethod:[null,[me.required]],requestUrlExpression:[null,[me.required,me.pattern(this.urlPattern)]],responseTimeout:[null,[me.required,me.min(10),me.pattern(this.numbersOnlyPattern)]],timeout:[null,[me.required,me.min(10),me.pattern(this.numbersOnlyPattern)]],tries:[null,[me.required,me.min(1),me.pattern(this.numbersOnlyPattern)]],requestValueExpression:[null,[me.required,me.pattern(pn)]],responseValueExpression:[null,[me.pattern(pn)]],httpHeaders:this.fb.array([])});break;default:t=this.fb.group({command:[null,[me.required,me.pattern(pn)]],params:[{},[lt]]})}return t}addSNMPoid(e=null){const t=this.commandForm.get("oid");t&&t.push(this.fb.control(e,[me.required,me.pattern(pn)]),{emitEvent:!1})}removeSNMPoid(e){this.commandForm.get("oid").removeAt(e)}addHTTPHeader(e={headerName:null,value:null}){const t=this.commandForm.get("httpHeaders"),n=this.fb.group({headerName:[e.headerName,[me.required,me.pattern(pn)]],value:[e.value,[me.required,me.pattern(pn)]]});t&&t.push(n,{emitEvent:!1})}removeHTTPHeader(e){this.commandForm.get("httpHeaders").removeAt(e)}getFormArrayControls(e){return this.commandForm.get(e).controls}openEditJSONDialog(e){e&&e.stopPropagation(),this.dialog.open(nt,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{jsonValue:this.commandForm.get("params").value,required:!0}}).afterClosed().subscribe((e=>{e&&this.commandForm.get("params").setValue(e)}))}save(){this.saveTemplate.emit()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}clearFromArrayByName(e){const t=this.commandForm.get(e);for(;0!==t.length;)t.removeAt(0)}writeValue(e){if("object"==typeof e){switch(e=te(e),this.connectorType){case dt.SNMP:this.clearFromArrayByName("oid"),e.oid.forEach((e=>{this.addSNMPoid(e)})),delete e.oid;break;case dt.REQUEST:case dt.REST:this.clearFromArrayByName("httpHeaders"),e.httpHeaders&&Object.entries(e.httpHeaders).forEach((e=>{this.addHTTPHeader({headerName:e[0],value:e[1]})})),delete e.httpHeaders}this.commandForm.patchValue(e,{onlySelf:!1})}}observeFormChanges(){this.commandForm.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.connectorType!==dt.REST&&this.connectorType!==dt.REQUEST||(e.httpHeaders=e.httpHeaders.reduce(((e,t)=>(e[t.headerName]=t.value,e)),{})),this.commandForm.valid&&this.propagateChange({...this.commandForm.value,...e})}))}static{this.ɵfac=function(e){return new(e||AH)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(je.MatDialog))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:AH,selectors:[["tb-gateway-service-rpc-connector"]],inputs:{connectorType:"connectorType"},outputs:{sendCommand:"sendCommand",saveTemplate:"saveTemplate"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>AH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:12,vars:16,consts:[[1,"command-form","flex","flex-col",3,"formGroup"],[1,"mat-subtitle-1","title"],[3,"ngIf"],[1,"template-actions","flex","flex-row","justify-end","gap-2.5"],["mat-raised-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"ngSwitch"],[3,"ngSwitchCase"],["ngSwitchDefault",""],["matInput","","formControlName","method","placeholder","set_state"],[1,"mat-block"],["formControlName","requestType"],[3,"value",4,"ngFor","ngForOf"],["matInput","","formControlName","requestTimeout","type","number","min","10","step","1","placeholder","1000"],[1,"flex","flex-1","flex-row","gap-2.5"],[1,"flex-1"],["formControlName","objectType"],["matInput","","formControlName","identifier","type","number","min","1","step","1","placeholder","1"],["matInput","","formControlName","propertyId","placeholder","presentValue"],[3,"value"],["matInput","","formControlName","methodRPC","placeholder","rpcMethod1"],["matInput","","formControlName","characteristicUUID","placeholder","00002A00-0000-1000-8000-00805F9B34FB"],["formControlName","methodProcessing"],["formControlName","withResponse",1,"mat-slide"],["matInput","","formControlName","method","placeholder","sendSameData"],["matInput","","formControlName","nodeID","type","number","placeholder","4","min","0","step","1"],["formControlName","isExtendedID",1,"mat-slide","margin"],["formControlName","isFD",1,"mat-slide","margin"],["formControlName","bitrateSwitch",1,"mat-slide","margin"],["matInput","","formControlName","dataLength","type","number","placeholder","2","min","1","step","1"],["formControlName","dataByteorder"],["matInput","","formControlName","dataBefore","placeholder","00AA"],["matInput","","formControlName","dataAfter","placeholder","0102"],["matInput","","formControlName","dataInHEX","placeholder","aa bb cc dd ee ff aa bb aa bb cc d ee ff"],["matInput","","formControlName","dataExpression","placeholder","userSpeed if maxAllowedSpeed > userSpeed else maxAllowedSpeed"],["matInput","","formControlName","methodFilter","placeholder","read"],["matInput","","formControlName","valueExpression","placeholder","${params}"],["matInput","","formControlName","methodRPC","placeholder","rpc1"],["formControlName","withResponse",1,"mat-slide","margin"],["matInput","","formControlName","requestFilter","placeholder","setData"],["formControlName","method"],["formArrayName","oid",1,"fields","flex","flex-col","gap-2.5","border"],[1,"fields-label"],["class","flex flex-1 flex-row items-center justify-center gap-2.5",4,"ngFor","ngForOf"],["mat-raised-button","",1,"self-start",3,"click"],[1,"flex","flex-1","flex-row","items-center","justify-center","gap-2.5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","flex-1"],["matInput","","required","",3,"formControl"],[1,"flex-[1_1_30px]",2,"cursor","pointer","max-width","30px","min-width","30px",3,"click","matTooltip"],["matInput","","formControlName","methodFilter","placeholder","post_attributes"],[1,"max-w-4/12","flex-[1_1_33%]"],["formControlName","httpMethod"],["matInput","","formControlName","requestUrlExpression","placeholder","http://127.0.0.1:5000/my_devices"],["matInput","","formControlName","responseTimeout","type","number","step","1","min","10","placeholder","10"],["matInput","","formControlName","timeout","type","number","step","1","min","10","placeholder","1000"],["matInput","","formControlName","tries","type","number","step","1","min","1","placeholder","3"],["formArrayName","httpHeaders",1,"fields","flex","flex-col","gap-2.5","border"],["class","flex flex-col gap-2.5 border",4,"ngIf"],[1,"flex","flex-col","gap-2.5","border"],[1,"flex","flex-row","items-center","justify-center","gap-2.5"],[1,"title","flex-1"],[2,"width","30px"],["class","flex flex-row items-center justify-center gap-2.5",4,"ngFor","ngForOf"],[3,"formGroupName"],["appearance","outline",1,"flex-1"],["matInput","","formControlName","headerName"],["matInput","","formControlName","value","placeholder","application/json"],[2,"cursor","pointer","width","30px",3,"click","matTooltip"],["matInput","","formControlName","methodFilter","placeholder","echo"],["matInput","","formControlName","timeout","type","number","step","1","min","10","placeholder","10"],["matInput","","formControlName","tries","type","number","step","1","min","1","placeholder","1"],["matInput","","formControlName","requestValueExpression","placeholder","${params}"],["matInput","","formControlName","responseValueExpression","placeholder","${temp}"],["matInput","","formControlName","headerName",3,"placeholder"],["matInput","","formControlName","value"],["matInput","","formControlName","command"],["matInput","","formControlName","params","type","JSON","tb-json-to-string",""],["aria-hidden","false","aria-label","help-icon","matIconSuffix","",1,"material-icons-outlined",2,"cursor","pointer",3,"click","matTooltip"],[4,"ngIf"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(4,OH,11,10,"ng-template",2),t.ɵɵelementStart(5,"div",3)(6,"button",4),t.ɵɵlistener("click",(function(){return n.save()})),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",5),t.ɵɵlistener("click",(function(){return n.sendCommand.emit()})),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(3,7,"gateway.rpc.title",t.ɵɵpureFunction1(14,lH,n.gatewayConnectorDefaultTypesTranslates.get(n.connectorType)))),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorType),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,10,"gateway.rpc-command-save-template")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,12,"gateway.rpc-command-send")," "))},dependencies:t.ɵɵgetComponentDepsFactory(AH,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;padding:0}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%]{flex-wrap:nowrap}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] .mat-mdc-slide-toggle.margin[_ngcontent-%COMP%]{margin-bottom:10px;margin-left:10px}[_nghost-%COMP%] .fields[_ngcontent-%COMP%] .fields-label[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%] .border[_ngcontent-%COMP%]{padding:16px;margin-bottom:10px;box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{color:#0000008a}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{color:#00000061}[_nghost-%COMP%] .border[_ngcontent-%COMP%] .mat-divider[_ngcontent-%COMP%]{margin-left:-16px;margin-right:-16px;margin-bottom:16px}']})}}function FH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",11),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function RH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",11),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ModbusFunctionCodeTranslationsMap.get(e)))}}function BH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",12),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function NH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",12),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function LH(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",13)(1,"mat-form-field",3)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",14),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,NH,3,3,"mat-icon",8),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rpc.value")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.rpcParametersFormGroup.get("value").hasError("required")&&e.rpcParametersFormGroup.get("value").touched)}}class VH{constructor(e){this.fb=e,this.ModbusEditableDataTypes=Qt,this.ModbusFunctionCodeTranslationsMap=nn,this.modbusDataTypes=Object.values(Zt),this.writeFunctionCodes=[5,6,15,16],this.defaultFunctionCodes=[3,4,6,16],this.readFunctionCodes=[1,2,3,4],this.bitsFunctionCodes=[...this.readFunctionCodes,...this.writeFunctionCodes],this.destroy$=new we,this.rpcParametersFormGroup=this.fb.group({type:[Zt.BYTES,[me.required]],functionCode:[this.defaultFunctionCodes[0],[me.required]],value:[{value:"",disabled:!0},[me.required,me.pattern(pn)]],address:[null,[me.required]],objectsCount:[1,[me.required]]}),this.updateFunctionCodes(this.rpcParametersFormGroup.get("type").value),this.observeValueChanges(),this.observeKeyDataType(),this.observeFunctionCode()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.rpcParametersFormGroup.patchValue(e,{emitEvent:!1})}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}observeKeyDataType(){this.rpcParametersFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.ModbusEditableDataTypes.includes(e)||this.rpcParametersFormGroup.get("objectsCount").patchValue(Jt[e],{emitEvent:!1}),this.updateFunctionCodes(e)}))}observeFunctionCode(){this.rpcParametersFormGroup.get("functionCode").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateValueEnabling(e)))}updateValueEnabling(e){this.writeFunctionCodes.includes(e)?this.rpcParametersFormGroup.get("value").enable({emitEvent:!1}):(this.rpcParametersFormGroup.get("value").setValue(null),this.rpcParametersFormGroup.get("value").disable({emitEvent:!1}))}updateFunctionCodes(e){this.functionCodes=e===Zt.BITS?this.bitsFunctionCodes:this.defaultFunctionCodes,this.functionCodes.includes(this.rpcParametersFormGroup.get("functionCode").value)||this.rpcParametersFormGroup.get("functionCode").patchValue(this.functionCodes[0],{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||VH)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:VH,selectors:[["tb-gateway-modbus-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>VH)),multi:!0},{provide:he,useExisting:c((()=>VH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:35,vars:30,consts:[[3,"formGroup"],[1,"tb-form-hint","tb-primary-fill","no-padding-top","hint-container"],[1,"flex","flex-1","flex-row","gap-2.5"],[1,"flex-1"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["formControlName","functionCode"],["matInput","","type","number","min","0","max","50000","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","min","1","max","50000","name","value","formControlName","objectsCount",3,"placeholder","readonly"],["class","flex",4,"ngIf"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"flex"],["matInput","","name","value","formControlName","value",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelement(4,"br"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",2)(8,"mat-form-field",3)(9,"mat-label"),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-select",4),t.ɵɵtemplate(13,FH,2,2,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-form-field",3)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"mat-select",6),t.ɵɵtemplate(19,RH,3,4,"mat-option",5),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",2)(21,"mat-form-field",3)(22,"mat-label"),t.ɵɵtext(23),t.ɵɵpipe(24,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",7),t.ɵɵpipe(26,"translate"),t.ɵɵtemplate(27,BH,3,3,"mat-icon",8),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-form-field",3)(29,"mat-label"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(32,"input",9),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,LH,8,7,"div",10),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,14,"gateway.rpc.hint.modbus-response-reading"),""),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,16,"gateway.rpc.hint.modbus-writing-functions")," "),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(11,18,"gateway.rpc.type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.modbusDataTypes),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(17,20,"gateway.rpc.functionCode")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.functionCodes),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(24,22,"gateway.rpc.address")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.rpcParametersFormGroup.get("address").hasError("required")&&n.rpcParametersFormGroup.get("address").touched),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(31,26,"gateway.rpc.objectsCount")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(33,28,"gateway.set")),t.ɵɵproperty("readonly",!n.ModbusEditableDataTypes.includes(n.rpcParametersFormGroup.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.writeFunctionCodes.includes(n.rpcParametersFormGroup.get("functionCode").value)))},dependencies:t.ɵɵgetComponentDepsFactory(VH,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{margin-bottom:12px}'],changeDetection:d.OnPush})}}function qH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",6),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rpc.responseTopicExpression")))}function GH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-form-field")(1,"mat-label"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",7),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rpc.responseTimeout")))}class zH{constructor(e){this.fb=e,this.onChange=e=>{},this.onTouched=()=>{},this.destroy$=new we,this.rpcParametersFormGroup=this.fb.group({methodFilter:[null,[me.required,me.pattern(pn)]],requestTopicExpression:[null,[me.required,me.pattern(pn)]],responseTopicExpression:[{value:null,disabled:!0},[me.required,me.pattern(pn)]],responseTimeout:[{value:null,disabled:!0},[me.min(10),me.pattern(cn)]],valueExpression:[null,[me.required,me.pattern(pn)]],withResponse:[!1,[]]}),this.observeValueChanges(),this.observeWithResponse()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.rpcParametersFormGroup.patchValue(e,{emitEvent:!1}),this.toggleResponseFields(e.withResponse)}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}observeWithResponse(){this.rpcParametersFormGroup.get("withResponse").valueChanges.pipe(Ae((e=>this.toggleResponseFields(e))),Me(this.destroy$)).subscribe()}toggleResponseFields(e){const t=this.rpcParametersFormGroup.get("responseTopicExpression"),n=this.rpcParametersFormGroup.get("responseTimeout");e?(t.enable(),n.enable()):(t.disable(),n.disable())}static{this.ɵfac=function(e){return new(e||zH)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:zH,selectors:[["tb-gateway-mqtt-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>zH)),multi:!0},{provide:he,useExisting:c((()=>zH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:21,vars:15,consts:[[3,"formGroup"],["matInput","","formControlName","methodFilter","placeholder","echo"],["matInput","","formControlName","requestTopicExpression","placeholder","sensor/${deviceName}/request/${methodName}/${requestId}"],["formControlName","withResponse",1,"margin",3,"click"],[4,"ngIf"],["matInput","","formControlName","valueExpression","placeholder","${params}"],["matInput","","formControlName","responseTopicExpression","placeholder","sensor/${deviceName}/response/${methodName}/${requestId}"],["matInput","","formControlName","responseTimeout","type","number","placeholder","10000","min","10","step","1"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",1),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field")(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",2),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-slide-toggle",3),t.ɵɵlistener("click",(function(e){return e.stopPropagation()})),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(14,qH,5,3,"mat-form-field",4)(15,GH,5,3,"mat-form-field",4),t.ɵɵelementStart(16,"mat-form-field")(17,"mat-label"),t.ɵɵtext(18),t.ɵɵpipe(19,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(20,"input",5),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){let e,i;t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,7,"gateway.rpc.method-name")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,9,"gateway.rpc.requestTopicExpression")),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,11,"gateway.rpc.withResponse")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==(e=n.rpcParametersFormGroup.get("withResponse"))?null:e.value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",null==(i=n.rpcParametersFormGroup.get("withResponse"))?null:i.value),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(19,13,"gateway.rpc.valueExpression"))}},dependencies:t.ɵɵgetComponentDepsFactory(zH,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .mat-mdc-slide-toggle.margin[_ngcontent-%COMP%]{margin-bottom:10px;margin-left:10px}'],changeDetection:d.OnPush})}}function UH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",26),t.ɵɵelement(1,"mat-icon",27),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",i.valueTypes.get(e).icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,i.valueTypes.get(e).name))}}function jH(e,n){1&e&&(t.ɵɵelement(0,"input",28),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function HH(e,n){1&e&&(t.ɵɵelement(0,"input",29),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function WH(e,n){1&e&&(t.ɵɵelement(0,"input",30),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function $H(e,n){1&e&&(t.ɵɵelementStart(0,"mat-select",31)(1,"mat-option",26),t.ɵɵtext(2,"true"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-option",26),t.ɵɵtext(4,"false"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵproperty("value",!0),t.ɵɵadvance(2),t.ɵɵproperty("value",!1))}function KH(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",32),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function YH(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",8)(1,"div",9)(2,"div",10),t.ɵɵtext(3,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",11)(5,"mat-form-field",12)(6,"mat-select",13)(7,"mat-select-trigger")(8,"div",14),t.ɵɵelement(9,"mat-icon",15),t.ɵɵelementStart(10,"span"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(13,UH,5,5,"mat-option",16),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(14,"div",17)(15,"div",10),t.ɵɵtext(16,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-form-field",18),t.ɵɵelementContainerStart(18,19),t.ɵɵtemplate(19,jH,2,3,"input",20)(20,HH,2,3,"input",21)(21,WH,2,3,"input",22)(22,$H,5,2,"mat-select",23),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(23,KH,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"button",25),t.ɵɵpipe(25,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext();return t.ɵɵresetView(i.removeArgument(n))})),t.ɵɵelementStart(26,"mat-icon"),t.ɵɵtext(27,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext();t.ɵɵproperty("formGroup",a),t.ɵɵadvance(9),t.ɵɵproperty("svgIcon",null==(e=r.valueTypes.get(a.get("type").value))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,11,null==(i=r.valueTypes.get(a.get("type").value))?null:i.name)),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",r.valueTypeKeys),t.ɵɵadvance(5),t.ɵɵproperty("ngSwitch",a.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.STRING),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.INTEGER),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.DOUBLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",r.MappingValueType.BOOLEAN),t.ɵɵadvance(),t.ɵɵproperty("ngIf",a.get(a.get("type").value+"Value").hasError("required")&&a.get(a.get("type").value+"Value").touched),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(25,13,"gateway.rpc.remove"))}}class XH{constructor(e,t){this.fb=e,this.cdr=t,this.valueTypeKeys=Object.values(en),this.MappingValueType=en,this.valueTypes=tn,this.onChange=e=>{},this.onTouched=()=>{},this.destroy$=new we,this.rpcParametersFormGroup=this.fb.group({method:[null,[me.required,me.pattern(pn)]],arguments:this.fb.array([])}),this.observeValueChanges()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.rpcParametersFormGroup.valid?null:{rpcParametersFormGroup:{valid:!1}}}writeValue(e){this.clearArguments(),e.arguments?.map((({type:e,value:t})=>({type:e,[e+"Value"]:t}))).forEach((e=>this.addArgument(e))),this.cdr.markForCheck(),this.rpcParametersFormGroup.get("method").patchValue(e.method)}observeValueChanges(){this.rpcParametersFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{const t=e.arguments.map((({type:e,...t})=>({type:e,value:t[e+"Value"]})));this.onChange({method:e.method,arguments:t}),this.onTouched()}))}removeArgument(e){this.rpcParametersFormGroup.get("arguments").removeAt(e)}addArgument(e={}){const t=this.fb.group({type:[e.type??en.STRING],stringValue:[e.stringValue??{value:"",disabled:!(W(e,{})||e.stringValue)},[me.required,me.pattern(pn)]],integerValue:[{value:e.integerValue??0,disabled:!J(e.integerValue)},[me.required,me.pattern(cn)]],doubleValue:[{value:e.doubleValue??0,disabled:!J(e.doubleValue)},[me.required]],booleanValue:[{value:e.booleanValue??!1,disabled:!J(e.booleanValue)},[me.required]]});this.observeTypeChange(t),this.rpcParametersFormGroup.get("arguments").push(t,{emitEvent:!1})}clearArguments(){const e=this.rpcParametersFormGroup.get("arguments");for(;0!==e.length;)e.removeAt(0)}observeTypeChange(e){e.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((t=>{e.disable({emitEvent:!1}),e.get("type").enable({emitEvent:!1}),e.get(t+"Value").enable({emitEvent:!1})}))}static{this.ɵfac=function(e){return new(e||XH)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:XH,selectors:[["tb-gateway-opc-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>XH)),multi:!0},{provide:he,useExisting:c((()=>XH)),multi:!0}]),t.ɵɵStandaloneFeature],decls:18,vars:14,consts:[[3,"formGroup"],[1,"tb-form-hint","tb-primary-fill","tb-flex","no-padding-top","hint-container"],[1,"tb-flex"],["matInput","","formControlName","method","placeholder","multiply"],["formArrayName","arguments",1,"tb-form-panel","stroked","arguments-container"],[1,"fields-label"],["class","flex flex-1 items-center justify-center gap-2.5",3,"formGroup",4,"ngFor","ngForOf"],["mat-raised-button","",1,"self-start",3,"click"],[1,"flex","flex-1","items-center","justify-center","gap-2.5",3,"formGroup"],[1,"tb-form-row","column-xs","type-container","items-center","justify-between"],["translate","",1,"tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[1,"tb-flex","align-center"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-row","column-xs","value-container","item-center","justify-between"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],[3,"ngSwitch"],["matInput","","required","","formControlName","stringValue",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder",4,"ngSwitchCase"],["formControlName","booleanValue",4,"ngSwitchCase"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["mat-icon-button","","matTooltipPosition","above",1,"tb-box-button",3,"click","matTooltip"],[3,"value"],[1,"tb-mat-20",3,"svgIcon"],["matInput","","required","","formControlName","stringValue",3,"placeholder"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder"],["formControlName","booleanValue"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",2)(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(8,"input",3),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"fieldset",4)(10,"strong")(11,"span",5),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(14,YH,28,15,"div",6),t.ɵɵelementStart(15,"button",7),t.ɵɵlistener("click",(function(){return n.addArgument()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.rpcParametersFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,6,"gateway.rpc.hint.opc-method")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(7,8,"gateway.rpc.method")),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,10,"gateway.rpc.arguments")),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",n.rpcParametersFormGroup.get("arguments").controls),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,12,"gateway.rpc.add-argument")," "))},dependencies:t.ɵɵgetComponentDepsFactory(XH,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .arguments-container[_ngcontent-%COMP%]{margin-bottom:10px}[_nghost-%COMP%] .type-container[_ngcontent-%COMP%]{width:40%}[_nghost-%COMP%] .value-container[_ngcontent-%COMP%]{width:50%}[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{margin-bottom:12px}'],changeDetection:d.OnPush})}}function ZH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SocketMethodProcessingsTranslates.get(e))," ")}}function QH(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}class JH extends za{constructor(){super(...arguments),this.SocketMethodProcessingsTranslates=Pj,this.socketMethodProcessings=Object.values(kj),this.socketEncoding=Object.values(ht)}initFormGroup(){return this.fb.group({methodRPC:[null,[me.required,me.pattern(pn)]],methodProcessing:[kj.WRITE,[me.required]],encoding:[Aj.UTF_8,[me.required,me.pattern(pn)]],withResponse:[!1,[]]})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(JH)))(n||JH)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:JH,selectors:[["tb-gateway-socket-rpc-parameters"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>JH)),multi:!0},{provide:he,useExisting:c((()=>JH)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:21,vars:15,consts:[[3,"formGroup"],[1,"w-full"],["matInput","","formControlName","methodRPC","placeholder","rpcMethod1"],[1,"mat-block"],["formControlName","methodProcessing"],[3,"value",4,"ngFor","ngForOf"],["formControlName","encoding"],["formControlName","withResponse",1,"mat-slide","margin"],[3,"value"]],template:function(e,n){1&e&&(t.ɵɵelementContainerStart(0,0),t.ɵɵelementStart(1,"mat-form-field",1)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",2),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",3)(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-select",4),t.ɵɵtemplate(11,ZH,3,4,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",3)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-select",6),t.ɵɵtemplate(17,QH,2,2,"mat-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"mat-slide-toggle",7),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e&&(t.ɵɵproperty("formGroup",n.formGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,7,"gateway.rpc.methodRPC")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,9,"gateway.rpc.methodProcessing")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketMethodProcessings),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,11,"gateway.encoding")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(20,13,"gateway.rpc.withResponse")," "))},dependencies:t.ɵɵgetComponentDepsFactory(JH,[se,_]),encapsulation:2,changeDetection:d.OnPush})}}const eW=e=>({border:e}),tW=e=>({type:e});function nW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",15),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function iW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")," "))}function aW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-select",9),t.ɵɵtemplate(6,nW,2,2,"mat-option",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"mat-form-field",11)(8,"mat-label"),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(11,"input",12),t.ɵɵtemplate(12,iW,3,3,"mat-error",13),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.sendCommand())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,6,"gateway.statistics.command")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.RPCCommands),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,8,"gateway.statistics.timeout")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.commandForm.get("time").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("disabled",e.commandForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,10,"gateway.rpc-command-send")," ")}}function rW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-service-rpc-connector",17),t.ɵɵlistener("sendCommand",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.sendCommand())}))("saveTemplate",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.saveTemplate())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("connectorType",e.connectorType)}}function oW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-modbus-rpc-parameters",24)}function sW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-mqtt-rpc-parameters",24)}function lW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-opc-rpc-parameters",24)}function pW(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-socket-rpc-parameters",24)}function cW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",18)(1,"div",19),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(4,20),t.ɵɵtemplate(5,oW,1,0,"tb-gateway-modbus-rpc-parameters",21)(6,sW,1,0,"tb-gateway-mqtt-rpc-parameters",21)(7,lW,1,0,"tb-gateway-opc-rpc-parameters",21)(8,pW,1,0,"tb-gateway-socket-rpc-parameters",21),t.ɵɵelementContainerEnd(),t.ɵɵelementStart(9,"div",22)(10,"button",23),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.saveTemplate())})),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.sendCommand())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(3,10,"gateway.rpc.title",t.ɵɵpureFunction1(17,tW,e.gatewayConnectorDefaultTypesTranslates.get(e.connectorType)))),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",e.connectorType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MODBUS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MQTT),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OPCUA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SOCKET),t.ɵɵadvance(2),t.ɵɵproperty("disabled",e.commandForm.get("params").invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,13,"gateway.rpc-command-save-template")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",e.commandForm.get("params").invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,15,"gateway.rpc-command-send")," ")}}function dW(e,n){if(1&e&&t.ɵɵtemplate(0,rW,1,1,"tb-gateway-service-rpc-connector",16)(1,cW,16,19,"ng-template",null,1,t.ɵɵtemplateRefExtractor),2&e){const e=t.ɵɵreference(2),n=t.ɵɵnextContext();t.ɵɵproperty("ngIf",!n.typesWithUpdatedParams.has(n.connectorType))("ngIfElse",e)}}function uW(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",25)(1,"mat-icon",26),t.ɵɵtext(2,"schedule"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"span"),t.ɵɵtext(4),t.ɵɵpipe(5,"date"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind2(5,1,e.resultTime,"yyyy/MM/dd HH:mm:ss"))}}function mW(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-service-rpc-connector-templates",27),t.ɵɵlistener("useTemplate",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.useTemplate(n))})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("rpcTemplates",e.templates)("ctx",e.ctx)("connectorType",e.connectorType)}}class hW{constructor(e,t,n,i,a){this.fb=e,this.dialog=t,this.utils=n,this.cd=i,this.attributeService=a,this.contentTypes=V,this.RPCCommands=["Ping","Stats","Devices","Update","Version","Restart","Reboot"],this.templates=[],this.ConnectorType=dt,this.gatewayConnectorDefaultTypesTranslates=ut,this.typesWithUpdatedParams=new Set([dt.MQTT,dt.OPCUA,dt.MODBUS,dt.SOCKET]),this.modbusReadFunctionCodes=[1,2,3,4],this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.updateTemplates()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)})),dataLoading:()=>{}}},this.commandForm=this.fb.group({command:[null,[me.required]],time:[60,[me.required,me.min(1)]],params:["{}",[lt]],result:[null]})}ngOnInit(){if(this.isConnector=this.ctx.settings.isConnector,this.isConnector){this.connectorType=this.ctx.stateController.getStateParams().connector_rpc.value.type;const e=[{type:N.entity,entityType:L.DEVICE,entityId:this.ctx.defaultSubscription.targetDeviceId,entityName:"Connector",attributes:[{name:`${this.connectorType}_template`}]}];this.ctx.subscriptionApi.createSubscriptionFromInfo(R.latest,e,this.subscriptionOptions,!1,!0).subscribe((e=>{this.subscription=e}))}else this.commandForm.get("command").setValue(this.RPCCommands[0])}sendCommand(e){this.resultTime=null;const t=e||this.commandForm.value,n=this.isConnector?`${this.connectorType}_`:"gateway_",i=this.isConnector?this.getCommandFromParamsByType(t.params):t.command.toLowerCase(),a=this.ctx.stateController.getStateParams().connector_rpc?.value.configurationJson.id,r=a?{...t.params,connectorId:a}:t.params;this.ctx.controlApi.sendTwoWayCommand(n+i,r,t.time).subscribe({next:e=>{this.resultTime=(new Date).getTime(),this.commandForm.get("result").setValue(JSON.stringify(e))},error:e=>{this.resultTime=(new Date).getTime(),console.error(e),this.commandForm.get("result").setValue(JSON.stringify(e.error))}})}getCommandFromParamsByType(e){switch(this.connectorType){case dt.MQTT:case dt.FTP:case dt.SNMP:case dt.REST:case dt.REQUEST:return e.methodFilter;case dt.MODBUS:return this.modbusReadFunctionCodes.includes(e.functionCode)?"get":"set";case dt.BACNET:case dt.CAN:case dt.OPCUA:return e.method;case dt.BLE:case dt.OCPP:case dt.SOCKET:case dt.XMPP:return e.methodRPC;default:return e.command}}saveTemplate(){this.dialog.open(nH,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{config:this.commandForm.value.params,templates:this.templates}}).afterClosed().subscribe((e=>{if(e){const t={name:e,config:this.commandForm.value.params,type:this.connectorType},n=this.templates,i=n.findIndex((e=>e.name==t.name));i>-1&&n.splice(i,1),n.push(t);const a=`${this.connectorType}_template`;this.attributeService.saveEntityAttributes({id:this.ctx.defaultSubscription.targetDeviceId,entityType:L.DEVICE},D.SERVER_SCOPE,[{key:a,value:n}]).subscribe((()=>{this.cd.detectChanges()}))}}))}useTemplate(e){this.commandForm.get("params").patchValue(e.config)}updateTemplates(){this.templates=this.subscription.data[0].data[0][1].length?JSON.parse(this.subscription.data[0].data[0][1]):[],this.cd.detectChanges()}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}static{this.ɵfac=function(e){return new(e||hW)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.UtilsService),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(K.AttributeService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:hW,selectors:[["tb-gateway-service-rpc"]],inputs:{ctx:"ctx",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:12,vars:14,consts:[["connectorForm",""],["updatedParameters",""],[1,"flex","flex-1","flex-col"],[1,"command-form","flex","flex-row","gap-2.5","lt-sm:flex-col",3,"formGroup"],[4,"ngIf","ngIfElse"],[1,"result-block",3,"formGroup"],["class","result-time flex flex-1 flex-row items-center justify-center",4,"ngIf"],["readonly","true","formControlName","result",3,"contentType"],["class","border",3,"rpcTemplates","ctx","connectorType","useTemplate",4,"ngIf"],["formControlName","command"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-1"],["matInput","","formControlName","time","type","number","min","1"],[4,"ngIf"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["formControlName","params",3,"connectorType","sendCommand","saveTemplate",4,"ngIf","ngIfElse"],["formControlName","params",3,"sendCommand","saveTemplate","connectorType"],[1,"rpc-parameters","flex","flex-col"],[1,"mat-subtitle-1","tb-form-panel-title"],[3,"ngSwitch"],["formControlName","params",4,"ngSwitchCase"],[1,"fex-row","template-actions","flex","flex-1","items-center","justify-end","gap-2.5"],["mat-raised-button","",3,"click","disabled"],["formControlName","params"],[1,"result-time","flex","flex-1","flex-row","items-center","justify-center"],[1,"material-icons"],[1,"border",3,"useTemplate","rpcTemplates","ctx","connectorType"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",2)(1,"div",3),t.ɵɵtemplate(2,aW,16,12,"ng-container",4)(3,dW,3,2,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"section",5)(6,"span"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,uW,6,4,"div",6),t.ɵɵelementEnd(),t.ɵɵelement(10,"tb-json-content",7),t.ɵɵelementEnd()(),t.ɵɵtemplate(11,mW,1,3,"tb-gateway-service-rpc-connector-templates",8)),2&e){const e=t.ɵɵreference(4);t.ɵɵclassMap(t.ɵɵpureFunction1(12,eW,n.isConnector)),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.isConnector)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵproperty("formGroup",n.commandForm),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(8,10,"gateway.rpc-command-result")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.resultTime),t.ɵɵadvance(),t.ɵɵproperty("contentType",n.contentTypes.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isConnector)}},dependencies:t.ɵɵgetComponentDepsFactory(hW,[se,_,AH,VH,zH,XH,Jj,JH]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;overflow:auto;display:flex;flex-direction:row;padding:0 5px}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{height:100%;overflow:auto}[_nghost-%COMP%] > tb-gateway-service-rpc-connector-templates[_ngcontent-%COMP%]:last-child{margin-left:10px}[_nghost-%COMP%] tb-gateway-service-rpc-connector-templates[_ngcontent-%COMP%]{flex:1 1 30%;max-width:30%}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%]{flex-wrap:nowrap;padding:0 5px 5px}[_nghost-%COMP%] .command-form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] .rpc-parameters[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%]{padding:0 5px;display:flex;flex-direction:column;flex:1}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-weight:600;position:relative;font-size:14px;margin-bottom:10px}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .result-time[_ngcontent-%COMP%]{font-weight:400;font-size:14px;line-height:32px;position:absolute;left:0;top:25px;z-index:5;color:#0000008a}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .result-time[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding-left:10px}[_nghost-%COMP%] .result-block[_ngcontent-%COMP%] tb-json-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .border[_ngcontent-%COMP%]{padding:16px;box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}']})}}function gW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.configuration-delete-dialog-input-required")," "))}e("GatewayServiceRPCComponent",hW);class fW extends A{constructor(e,t,n,i,a){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.gatewayName=this.data.gatewayName,this.gatewayControl=this.fb.control("")}close(){this.dialogRef.close()}turnOff(){this.dialogRef.close(!0)}static{this.ɵfac=function(e){return new(e||fW)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:fW,selectors:[["tb-gateway-remote-configuration-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:24,vars:14,consts:[["color","warn"],["translate",""],[1,"flex-1"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"mat-content","flex-col",2,"max-width","600px"],[3,"innerHTML"],[1,"mat-block","tb-value-type",2,"flex-grow","0"],["matInput","","required","",3,"formControl"],[4,"ngIf"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","warn","type","button","cdkFocusInitial","",3,"click"],["mat-button","","color","warn","type","button",3,"click","disabled"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-toolbar",0)(1,"mat-icon"),t.ɵɵtext(2,"warning"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"h2",1),t.ɵɵtext(4,"gateway.configuration-delete-dialog-header"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2),t.ɵɵelementStart(6,"button",3),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵelementStart(7,"mat-icon",4),t.ɵɵtext(8,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",5),t.ɵɵelement(10,"span",6),t.ɵɵpipe(11,"translate"),t.ɵɵelementStart(12,"mat-form-field",7)(13,"mat-label",1),t.ɵɵtext(14,"gateway.configuration-delete-dialog-input"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",8),t.ɵɵtemplate(16,gW,3,3,"mat-error",9),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",10)(18,"button",11),t.ɵɵlistener("click",(function(){return n.close()})),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",12),t.ɵɵlistener("click",(function(){return n.turnOff()})),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(10),t.ɵɵpropertyInterpolate2("innerHTML","",t.ɵɵpipeBind1(11,8,"gateway.configuration-delete-dialog-body")," ",n.gatewayName,"",t.ɵɵsanitizeHtml),t.ɵɵadvance(5),t.ɵɵproperty("formControl",n.gatewayControl),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayControl.hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(20,10,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.gatewayControl.value!==n.gatewayName),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,12,"gateway.configuration-delete-dialog-confirm")," "))},dependencies:t.ɵɵgetComponentDepsFactory(fW,[se,_]),encapsulation:2})}}var yW;e("GatewayRemoteConfigurationDialogComponent",fW),function(e){e.tls="tls",e.accessToken="accessToken"}(yW||(yW={}));const vW="configuration_drafts",xW="RemoteLoggingLevel",bW=new Map([[yW.tls,"gateway.security-types.tls"],[yW.accessToken,"gateway.security-types.access-token"]]);var wW,SW;!function(e){e.none="NONE",e.critical="CRITICAL",e.error="ERROR",e.warning="WARNING",e.info="INFO",e.debug="DEBUG"}(wW||(wW={})),function(e){e.memory="memory",e.file="file"}(SW||(SW={}));const CW=new Map([[SW.memory,"gateway.storage-types.memory-storage"],[SW.file,"gateway.storage-types.file-storage"]]);var _W;!function(e){e.mqtt="MQTT",e.modbus="Modbus",e.opcua="OPC-UA",e.ble="BLE",e.request="Request",e.can="CAN",e.bacnet="BACnet",e.custom="Custom"}(_W||(_W={}));const TW={config:{},name:"",configType:null,enabled:!1};function IW(e){return JSON.stringify(e.value)===JSON.stringify({})?{validJSON:!0}:null}function EW(e){return e.replace("_","").replace("-","").replace(/^\s+|\s+/g,"").toLowerCase()+".json"}function MW(e,t){return'[loggers]}}keys=root, service, connector, converter, tb_connection, storage, extension}}[handlers]}}keys=consoleHandler, serviceHandler, connectorHandler, converterHandler, tb_connectionHandler, storageHandler, extensionHandler}}[formatters]}}keys=LogFormatter}}[logger_root]}}level=ERROR}}handlers=consoleHandler}}[logger_connector]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=connector}}[logger_storage]}}level={ERROR}}}handlers=storageHandler}}formatter=LogFormatter}}qualname=storage}}[logger_tb_connection]}}level={ERROR}}}handlers=tb_connectionHandler}}formatter=LogFormatter}}qualname=tb_connection}}[logger_service]}}level={ERROR}}}handlers=serviceHandler}}formatter=LogFormatter}}qualname=service}}[logger_converter]}}level={ERROR}}}handlers=converterHandler}}formatter=LogFormatter}}qualname=converter}}[logger_extension]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=extension}}[handler_consoleHandler]}}class=StreamHandler}}level={ERROR}}}formatter=LogFormatter}}args=(sys.stdout,)}}[handler_connectorHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}connector.log", "d", 1, 7,)}}[handler_storageHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}storage.log", "d", 1, 7,)}}[handler_serviceHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}service.log", "d", 1, 7,)}}[handler_converterHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}converter.log", "d", 1, 3,)}}[handler_extensionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}extension.log", "d", 1, 3,)}}[handler_tb_connectionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}tb_connection.log", "d", 1, 3,)}}[formatter_LogFormatter]}}format="%(asctime)s - %(levelname)s - [%(filename)s] - %(module)s - %(lineno)d - %(message)s" }}datefmt="%Y-%m-%d %H:%M:%S"'.replace(/{ERROR}/g,e).replace(/{.\/logs\/}/g,t)}function kW(e){return{id:e,entityType:L.DEVICE}}function PW(e){const t={};return Object.prototype.hasOwnProperty.call(e,"thingsboard")&&(t.host=e.thingsboard.host,t.port=e.thingsboard.port,t.remoteConfiguration=e.thingsboard.remoteConfiguration,Object.prototype.hasOwnProperty.call(e.thingsboard.security,yW.accessToken)?(t.securityType=yW.accessToken,t.accessToken=e.thingsboard.security.accessToken):(t.securityType=yW.tls,t.caCertPath=e.thingsboard.security.caCert,t.privateKeyPath=e.thingsboard.security.privateKey,t.certPath=e.thingsboard.security.cert)),Object.prototype.hasOwnProperty.call(e,"storage")&&Object.prototype.hasOwnProperty.call(e.storage,"type")&&(e.storage.type===SW.memory?(t.storageType=SW.memory,t.readRecordsCount=e.storage.read_records_count,t.maxRecordsCount=e.storage.max_records_count):e.storage.type===SW.file&&(t.storageType=SW.file,t.dataFolderPath=e.storage.data_folder_path,t.maxFilesCount=e.storage.max_file_count,t.readRecordsCount=e.storage.read_records_count,t.maxRecordsCount=e.storage.max_records_count)),t}function DW(e){const t={};for(const n of e)n.enabled||(t[n.name]={connector:n.configType,config:n.config});return t}function OW(e){const t={thingsboard:AW(e)};return function(e,t){for(const n of t)if(n.enabled){const t=n.configType;Array.isArray(e[t])||(e[t]=[]);const i={name:n.name,config:n.config};e[t].push(i)}}(t,e.connectors),t}function AW(e){let t;t=e.securityType===yW.accessToken?{accessToken:e.accessToken}:{caCert:e.caCertPath,privateKey:e.privateKeyPath,cert:e.certPath};const n={host:e.host,remoteConfiguration:e.remoteConfiguration,port:e.port,security:t};let i;i=e.storageType===SW.memory?{type:SW.memory,read_records_count:e.readRecordsCount,max_records_count:e.maxRecordsCount}:{type:SW.file,data_folder_path:e.dataFolderPath,max_file_count:e.maxFilesCount,max_read_records_count:e.readRecordsCount,max_records_per_file:e.maxRecordsCount};const a=[];for(const t of e.connectors)if(t.enabled){const e={configuration:EW(t.name),name:t.name,type:t.configType};a.push(e)}return{thingsboard:n,connectors:a,storage:i,logs:window.btoa(MW(e.remoteLoggingLevel,e.remoteLoggingPathToLogs))}}const FW=["formContainer"],RW=(e,t,n)=>({"gap-1.25":e,"flex-row":t,"flex-col":n}),BW=(e,t,n)=>({"gap-1.25":e,"flex-row justify-end item-center":t,"flex-col justify-evenly item-center":n});function NW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value.toString())," ")}}function LW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-host-required "),t.ɵɵelementEnd())}function VW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-required "),t.ɵɵelementEnd())}function qW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-min "),t.ɵɵelementEnd())}function GW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-max "),t.ɵɵelementEnd())}function zW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.thingsboard-port-pattern "),t.ɵɵelementEnd())}function UW(e,n){1&e&&(t.ɵɵelementStart(0,"div",16)(1,"mat-form-field")(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",30),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field")(7,"mat-label"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(10,"input",31),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field")(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",32),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.tls-path-ca-certificate")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,5,"gateway.tls-path-private-key")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,7,"gateway.tls-path-client-certificate")))}function jW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function HW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.path-logs-required "),t.ɵɵelementEnd())}function WW(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value.toString())," ")}}function $W(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-required "),t.ɵɵelementEnd())}function KW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-min "),t.ɵɵelementEnd())}function YW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-pack-size-pattern "),t.ɵɵelementEnd())}function XW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-required "),t.ɵɵelementEnd())}function ZW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-min "),t.ɵɵelementEnd())}function QW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-records-pattern "),t.ɵɵelementEnd())}function JW(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-required "),t.ɵɵelementEnd())}function e$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-min "),t.ɵɵelementEnd())}function t$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-max-files-pattern "),t.ɵɵelementEnd())}function n$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.storage-path-required "),t.ɵɵelementEnd())}function i$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",5)(1,"mat-form-field",8)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",33),t.ɵɵtemplate(6,JW,2,0,"mat-error",10)(7,e$,2,0,"mat-error",10)(8,t$,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-form-field",8)(10,"mat-label"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",34),t.ɵɵtemplate(14,n$,2,0,"mat-error",10),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction3(12,RW,e.layoutGap,e.alignment,!e.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,8,"gateway.storage-max-files")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("maxFilesCount").hasError("pattern")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,10,"gateway.storage-path")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.gatewayConfigurationGroup.get("dataFolderPath").hasError("required"))}}function a$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",28),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function r$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.connector-type-required "),t.ɵɵelementEnd())}function o$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error",29),t.ɵɵtext(1," gateway.connector-name-required "),t.ɵɵelementEnd())}function s$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",35)(1,"div",36)(2,"div",37),t.ɵɵelement(3,"mat-slide-toggle",38),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",39)(5,"mat-form-field",8)(6,"mat-label"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-select",40),t.ɵɵlistener("selectionChange",(function(){const n=t.ɵɵrestoreView(e).$implicit,i=t.ɵɵnextContext();return t.ɵɵresetView(i.changeConnectorType(n))})),t.ɵɵtemplate(10,a$,2,2,"mat-option",7),t.ɵɵelementEnd(),t.ɵɵtemplate(11,r$,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",8)(13,"mat-label"),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"input",41),t.ɵɵlistener("blur",(function(){const n=t.ɵɵrestoreView(e),i=n.$implicit,a=n.index,r=t.ɵɵnextContext();return t.ɵɵresetView(r.changeConnectorName(i,a))})),t.ɵɵelementEnd(),t.ɵɵtemplate(17,o$,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",42)(19,"button",43),t.ɵɵpipe(20,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e),a=i.$implicit,r=i.index,o=t.ɵɵnextContext();return t.ɵɵresetView(o.openConfigDialog(n,r,a.get("config").value,a.get("name").value))})),t.ɵɵelementStart(21,"mat-icon"),t.ɵɵtext(22,"more_horiz"),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"button",43),t.ɵɵpipe(24,"translate"),t.ɵɵlistener("click",(function(){const n=t.ɵɵrestoreView(e).index,i=t.ɵɵnextContext();return t.ɵɵresetView(i.removeConnector(n))})),t.ɵɵelementStart(25,"mat-icon"),t.ɵɵtext(26,"close"),t.ɵɵelementEnd()()()()()}if(2&e){const e=n.$implicit,i=n.index,a=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("formGroupName",i),t.ɵɵadvance(3),t.ɵɵclassMap(t.ɵɵpureFunction3(24,RW,a.layoutGap,a.alignment,!a.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(8,16,"gateway.connector-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",a.connectorTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("configType").hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,18,"gateway.connector-name")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.get("name").hasError("required")),t.ɵɵadvance(),t.ɵɵclassMap(t.ɵɵpureFunction3(28,BW,a.layoutGap,a.alignment,!a.alignment)),t.ɵɵadvance(),t.ɵɵclassProp("mat-warn",e.get("config").invalid),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,20,"gateway.update-config")),t.ɵɵproperty("disabled",a.isReadOnlyForm),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(24,22,"gateway.delete")),t.ɵɵproperty("disabled",a.isReadOnlyForm)}}function l$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",44),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.exportConfig())})),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,3,"gateway.download-tip")),t.ɵɵproperty("disabled",!e.gatewayConfigurationGroup.dirty||e.gatewayConfigurationGroup.invalid),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"action.download")," ")}}function p$(e,n){if(1&e&&(t.ɵɵelementStart(0,"button",45),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,3,"gateway.save-tip")),t.ɵɵproperty("disabled",!e.gatewayConfigurationGroup.dirty||e.gatewayConfigurationGroup.invalid),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,5,"action.save")," ")}}class c$ extends q{constructor(e,t,n,i,a,r,o,s,l,p,c){super(e),this.store=e,this.elementRef=t,this.utils=n,this.ngZone=i,this.fb=a,this.window=r,this.dialog=o,this.translate=s,this.deviceService=l,this.attributeService=p,this.importExport=c,this.alignment=!0,this.layoutGap=!0,this.securityTypes=bW,this.gatewayLogLevels=Object.keys(wW).map((e=>wW[e])),this.connectorTypes=Object.keys(_W),this.storageTypes=CW,this.toastTargetId="gateway-configuration-widget"+this.utils.guid(),this.isReadOnlyForm=!1}get connectors(){return this.gatewayConfigurationGroup.get("connectors")}ngOnInit(){this.initWidgetSettings(this.ctx.settings),this.ctx.datasources&&this.ctx.datasources.length&&(this.deviceNameForm=this.ctx.datasources[0].name),this.buildForm(),this.ctx.updateWidgetParams(),this.formResize$=new ResizeObserver((()=>{this.resize()})),this.formResize$.observe(this.formContainerRef.nativeElement)}ngOnDestroy(){this.formResize$&&this.formResize$.disconnect(),this.subscribeGateway$.unsubscribe(),this.subscribeStorageType$.unsubscribe()}initWidgetSettings(e){let t;t=e.gatewayTitle&&e.gatewayTitle.length?this.utils.customTranslation(e.gatewayTitle,e.gatewayTitle):this.translate.instant("gateway.gateway"),this.ctx.widgetTitle=t,this.isReadOnlyForm=!!e.readOnly&&e.readOnly,this.archiveFileName=e.archiveFileName?.length?e.archiveFileName:"gatewayConfiguration",this.gatewayType=e.gatewayType?.length?e.gatewayType:"Gateway",this.gatewayNameExists=this.utils.customTranslation(e.gatewayNameExists,e.gatewayNameExists)||this.translate.instant("gateway.gateway-exists"),this.successfulSaved=this.utils.customTranslation(e.successfulSave,e.successfulSave)||this.translate.instant("gateway.gateway-saved"),this.updateWidgetDisplaying()}resize(){this.ngZone.run((()=>{this.updateWidgetDisplaying(),this.ctx.detectChanges()}))}updateWidgetDisplaying(){this.ctx.$container&&this.ctx.$container[0].offsetWidth<=425?(this.layoutGap=!1,this.alignment=!1):(this.layoutGap=!0,this.alignment=!0)}saveAttribute(e,t,n){const i=this.gatewayConfigurationGroup.get("gateway").value,a={key:e,value:t};return this.attributeService.saveEntityAttributes(kW(i),n,[a])}createConnector(e=TW){this.connectors.push(this.fb.group({enabled:[e.enabled],configType:[e.configType,[me.required]],name:[e.name,[me.required]],config:[e.config,[me.nullValidator,IW]]}))}getFormField(e){return this.gatewayConfigurationGroup.get(e)}buildForm(){this.gatewayConfigurationGroup=this.fb.group({gateway:[null,[]],accessToken:[null,[me.required]],securityType:[yW.accessToken],host:[this.window.location.hostname,[me.required]],port:[1883,[me.required,me.min(1),me.max(65535),me.pattern(/^-?[0-9]+$/)]],remoteConfiguration:[!0],caCertPath:["/etc/thingsboard-gateway/ca.pem"],privateKeyPath:["/etc/thingsboard-gateway/privateKey.pem"],certPath:["/etc/thingsboard-gateway/certificate.pem"],remoteLoggingLevel:[wW.debug],remoteLoggingPathToLogs:["./logs/",[me.required]],storageType:[SW.memory],readRecordsCount:[100,[me.required,me.min(1),me.pattern(/^-?[0-9]+$/)]],maxRecordsCount:[1e4,[me.required,me.min(1),me.pattern(/^-?[0-9]+$/)]],maxFilesCount:[5,[me.required,me.min(1),me.pattern(/^-?[0-9]+$/)]],dataFolderPath:["./data/",[me.required]],connectors:this.fb.array([])}),this.isReadOnlyForm&&this.gatewayConfigurationGroup.disable({emitEvent:!1}),this.subscribeStorageType$=this.getFormField("storageType").valueChanges.subscribe((e=>{e===SW.memory?(this.getFormField("maxFilesCount").disable(),this.getFormField("dataFolderPath").disable()):(this.getFormField("maxFilesCount").enable(),this.getFormField("dataFolderPath").enable())})),this.subscribeGateway$=this.getFormField("gateway").valueChanges.subscribe((e=>{null!==e?Ie([this.deviceService.getDeviceCredentials(e).pipe(Ae((e=>{this.getFormField("accessToken").patchValue(e.credentialsId)}))),...this.getAttributes(e)]).subscribe((()=>{this.gatewayConfigurationGroup.markAsPristine(),this.ctx.detectChanges()})):this.getFormField("accessToken").patchValue("")}))}gatewayExist(){this.ctx.showErrorToast(this.gatewayNameExists,"top","left",this.toastTargetId)}exportConfig(){const e=this.gatewayConfigurationGroup.value,t={};var n,i,a;t["tb_gateway.yaml"]=function(e){let t;t="thingsboard:\n",t+=" host: "+e.host+"\n",t+=" remoteConfiguration: "+e.remoteConfiguration+"\n",t+=" port: "+e.port+"\n",t+=" security:\n",e.securityType===yW.accessToken?t+=" access-token: "+e.accessToken+"\n":(t+=" ca_cert: "+e.caCertPath+"\n",t+=" privateKey: "+e.privateKeyPath+"\n",t+=" cert: "+e.certPath+"\n"),t+="storage:\n",e.storageType===SW.memory?(t+=" type: memory\n",t+=" read_records_count: "+e.readRecordsCount+"\n",t+=" max_records_count: "+e.maxRecordsCount+"\n"):(t+=" type: file\n",t+=" data_folder_path: "+e.dataFolderPath+"\n",t+=" max_file_count: "+e.maxFilesCount+"\n",t+=" max_read_records_count: "+e.readRecordsCount+"\n",t+=" max_records_per_file: "+e.maxRecordsCount+"\n"),t+="connectors:\n";for(const n of e.connectors)n.enabled&&(t+=" -\n",t+=" name: "+n.name+"\n",t+=" type: "+n.configType+"\n",t+=" configuration: "+EW(n.name)+"\n");return t}(e),function(e,t){for(const n of t)n.enabled&&(e[EW(n.name)]=JSON.stringify(n.config))}(t,e.connectors),n=t,i=e.remoteLoggingLevel,a=e.remoteLoggingPathToLogs,n["logs.conf"]=MW(i,a),this.importExport.exportJSZip(t,this.archiveFileName),this.saveAttribute(xW,this.gatewayConfigurationGroup.value.remoteLoggingLevel.toUpperCase(),D.SHARED_SCOPE)}addNewConnector(){this.createConnector()}removeConnector(e){e>-1&&(this.connectors.removeAt(e),this.connectors.markAsDirty())}openConfigDialog(e,t,n,i){e&&(e.stopPropagation(),e.preventDefault()),this.dialog.open(nt,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{jsonValue:n,required:!0,title:this.translate.instant("gateway.title-connectors-json",{typeName:i})}}).afterClosed().subscribe((e=>{e&&(this.connectors.at(t).get("config").patchValue(e),this.ctx.detectChanges())}))}createConnectorName(e,t,n=0){const i=n?t+n:t;return-1===e.findIndex((e=>e.name===i))?i:this.createConnectorName(e,t,++n)}validateConnectorName(e,t,n,i=0){for(let a=0;a{this.ctx.showSuccessToast(this.successfulSaved,2e3,"top","left",this.toastTargetId),this.gatewayConfigurationGroup.markAsPristine()}))}getAttributes(e){const t=[];return t.push(Ie([this.getAttribute("current_configuration",D.CLIENT_SCOPE,e),this.getAttribute(vW,D.SERVER_SCOPE,e)]).pipe(Ae((([e,t])=>{this.setFormGatewaySettings(e),this.setFormConnectorsDraft(t),this.isReadOnlyForm&&this.gatewayConfigurationGroup.disable({emitEvent:!1})})))),t.push(this.getAttribute(xW,D.SHARED_SCOPE,e).pipe(Ae((e=>this.processLoggingLevel(e))))),t}getAttribute(e,t,n){return this.attributeService.getEntityAttributes(kW(n),t,[e])}setFormGatewaySettings(e){if(this.connectors.clear(),e.length>0){const t=JSON.parse(window.atob(e[0].value));for(const e of Object.keys(t)){const n=t[e];if("thingsboard"===e)null!==n&&Object.keys(n).length>0&&this.gatewayConfigurationGroup.patchValue(PW(n));else for(const t of Object.keys(n)){let i="No name";Object.prototype.hasOwnProperty.call(n[t],"name")&&(i=n[t].name);const a={enabled:!0,configType:e,config:n[t].config,name:i};this.createConnector(a)}}}}setFormConnectorsDraft(e){if(e.length>0){const t=JSON.parse(window.atob(e[0].value));for(const e of Object.keys(t)){const n={enabled:!1,configType:t[e].connector,config:t[e].config,name:e};this.createConnector(n)}}}processLoggingLevel(e){let t=wW.debug;e.length>0&&wW[e[0].value.toLowerCase()]&&(t=wW[e[0].value.toLowerCase()]),this.getFormField("remoteLoggingLevel").patchValue(t)}static{this.ɵfac=function(e){return new(e||c$)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(t.ElementRef),t.ɵɵdirectiveInject(K.UtilsService),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(de.UntypedFormBuilder),t.ɵɵdirectiveInject($),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(K.DeviceService),t.ɵɵdirectiveInject(K.AttributeService),t.ɵɵdirectiveInject(it.ImportExportService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:c$,selectors:[["tb-gateway-form"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(FW,7),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.formContainerRef=e.first)}},inputs:{ctx:"ctx",isStateForm:"isStateForm"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:104,vars:104,consts:[["formContainer",""],["tb-toast","",1,"gateway-form",3,"ngSubmit","formGroup","toastTarget"],["multi","true",1,"mat-body-2"],[1,"tb-panel-title"],["formControlName","gateway","required","",3,"gatewayNameExist","deviceName","isStateForm","newGatewayType"],[1,"flex"],["formControlName","securityType"],[3,"value",4,"ngFor","ngForOf"],[1,"flex-1"],["matInput","","type","text","formControlName","host"],["translate","",4,"ngIf"],["matInput","","type","number","formControlName","port"],["class","flex flex-col",4,"ngIf"],["formControlName","remoteConfiguration"],["formControlName","remoteLoggingLevel"],["matInput","","type","text","formControlName","remoteLoggingPathToLogs"],[1,"flex","flex-col"],["formControlName","storageType"],["matInput","","type","number","formControlName","readRecordsCount"],["matInput","","type","number","formControlName","maxRecordsCount"],["class","flex",3,"class",4,"ngIf"],[1,"gateway-config","flex","flex-col"],["formArrayName","connectors",4,"ngFor","ngForOf"],[1,"no-data-found","items-center","justify-center"],["mat-raised-button","","type","button","matTooltipPosition","above",3,"click","matTooltip"],[1,"form-action-buttons","flex","flex-row","items-center","justify-end"],["mat-raised-button","","color","primary","type","button",3,"disabled","matTooltip","click",4,"ngIf"],["mat-raised-button","","color","primary","type","submit",3,"disabled","matTooltip",4,"ngIf"],[3,"value"],["translate",""],["matInput","","type","text","formControlName","caCertPath"],["matInput","","type","text","formControlName","privateKeyPath"],["matInput","","type","text","formControlName","certPath"],["matInput","","type","number","formControlName","maxFilesCount"],["matInput","","type","text","formControlName","dataFolderPath"],["formArrayName","connectors"],[1,"flex","flex-row","items-stretch","justify-between","gap-2",3,"formGroupName"],[1,"flex","flex-col","justify-center"],["formControlName","enabled"],[1,"flex-full","flex"],["formControlName","configType",3,"selectionChange"],["matInput","","type","text","formControlName","name",3,"blur"],[1,"action-buttons","flex"],["mat-icon-button","","matTooltipPosition","above",3,"click","disabled","matTooltip"],["mat-raised-button","","color","primary","type","button",3,"click","disabled","matTooltip"],["mat-raised-button","","color","primary","type","submit",3,"disabled","matTooltip"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"form",1,0),t.ɵɵlistener("ngSubmit",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.save())})),t.ɵɵelementStart(2,"mat-accordion",2)(3,"mat-expansion-panel")(4,"mat-expansion-panel-header")(5,"mat-panel-title")(6,"div",3),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵpipe(9,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"tb-entity-gateway-select",4),t.ɵɵlistener("gatewayNameExist",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.gatewayExist())})),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",5)(12,"mat-label"),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-select",6),t.ɵɵtemplate(16,NW,3,4,"mat-option",7),t.ɵɵpipe(17,"keyvalue"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",5)(19,"mat-form-field",8)(20,"mat-label"),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(23,"input",9),t.ɵɵtemplate(24,LW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",8)(26,"mat-label"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(29,"input",11),t.ɵɵtemplate(30,VW,2,0,"mat-error",10)(31,qW,2,0,"mat-error",10)(32,GW,2,0,"mat-error",10)(33,zW,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,UW,16,9,"div",12),t.ɵɵelementStart(35,"mat-checkbox",13),t.ɵɵtext(36),t.ɵɵpipe(37,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"div",5)(39,"mat-form-field",8)(40,"mat-label"),t.ɵɵtext(41),t.ɵɵpipe(42,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(43,"mat-select",14),t.ɵɵtemplate(44,jW,2,2,"mat-option",7),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"mat-form-field",8)(46,"mat-label"),t.ɵɵtext(47),t.ɵɵpipe(48,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(49,"input",15),t.ɵɵtemplate(50,HW,2,0,"mat-error",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(51,"mat-expansion-panel")(52,"mat-expansion-panel-header")(53,"mat-panel-title")(54,"div",3),t.ɵɵtext(55),t.ɵɵpipe(56,"translate"),t.ɵɵpipe(57,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(58,"div",16)(59,"mat-form-field")(60,"mat-label"),t.ɵɵtext(61),t.ɵɵpipe(62,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"mat-select",17),t.ɵɵtemplate(64,WW,3,4,"mat-option",7),t.ɵɵpipe(65,"keyvalue"),t.ɵɵelementEnd()(),t.ɵɵelementStart(66,"div",5)(67,"mat-form-field",8)(68,"mat-label"),t.ɵɵtext(69),t.ɵɵpipe(70,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(71,"input",18),t.ɵɵtemplate(72,$W,2,0,"mat-error",10)(73,KW,2,0,"mat-error",10)(74,YW,2,0,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(75,"mat-form-field",8)(76,"mat-label"),t.ɵɵtext(77),t.ɵɵpipe(78,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(79,"input",19),t.ɵɵtemplate(80,XW,2,0,"mat-error",10)(81,ZW,2,0,"mat-error",10)(82,QW,2,0,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵtemplate(83,i$,15,16,"div",20),t.ɵɵelementEnd()(),t.ɵɵelementStart(84,"mat-expansion-panel")(85,"mat-expansion-panel-header")(86,"mat-panel-title")(87,"div",3),t.ɵɵtext(88),t.ɵɵpipe(89,"translate"),t.ɵɵpipe(90,"uppercase"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(91,"div",21),t.ɵɵtemplate(92,s$,27,32,"section",22),t.ɵɵelementStart(93,"span",23),t.ɵɵtext(94),t.ɵɵpipe(95,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(96,"div")(97,"button",24),t.ɵɵpipe(98,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addNewConnector())})),t.ɵɵtext(99),t.ɵɵpipe(100,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(101,"section",25),t.ɵɵtemplate(102,l$,4,7,"button",26)(103,p$,4,7,"button",27),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("toastTarget",n.toastTargetId),t.ɵɵproperty("formGroup",n.gatewayConfigurationGroup),t.ɵɵadvance(7),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(9,54,t.ɵɵpipeBind1(8,52,"gateway.thingsboard"))),t.ɵɵadvance(3),t.ɵɵproperty("deviceName",n.deviceNameForm)("isStateForm",n.isStateForm)("newGatewayType",n.gatewayType),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,56,"gateway.security-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(17,58,n.securityTypes)),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(92,RW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,60,"gateway.thingsboard-host")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("host").hasError("required")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,62,"gateway.thingsboard-port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("max")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("port").hasError("pattern")),t.ɵɵadvance(),t.ɵɵproperty("ngIf","tls"===n.gatewayConfigurationGroup.get("securityType").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(37,64,"gateway.remote")),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(96,RW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(42,66,"gateway.remote-logging-level")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.gatewayLogLevels),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(48,68,"gateway.path-logs")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("remoteLoggingPathToLogs").hasError("required")),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(57,72,t.ɵɵpipeBind1(56,70,"gateway.storage"))),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(62,74,"gateway.storage-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(65,76,n.storageTypes)),t.ɵɵadvance(2),t.ɵɵclassMap(t.ɵɵpureFunction3(100,RW,n.layoutGap,n.alignment,!n.alignment)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(70,78,"gateway.storage-pack-size")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("readRecordsCount").hasError("pattern")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(78,80,"file"!==n.gatewayConfigurationGroup.get("storageType").value?"gateway.storage-max-records":"gateway.storage-max-file-records")," "),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("maxRecordsCount").hasError("pattern")),t.ɵɵadvance(),t.ɵɵproperty("ngIf","file"===n.gatewayConfigurationGroup.get("storageType").value),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(90,84,t.ɵɵpipeBind1(89,82,"gateway.connectors-config"))),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",n.connectors.controls),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.connectors.length),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(95,86,"gateway.no-connectors")),t.ɵɵadvance(3),t.ɵɵclassProp("!hidden",n.isReadOnlyForm),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(98,88,"gateway.connector-add")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(100,90,"action.add")," "),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.isReadOnlyForm),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.gatewayConfigurationGroup.get("remoteConfiguration").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.gatewayConfigurationGroup.get("remoteConfiguration").value))},dependencies:t.ɵɵgetComponentDepsFactory(c$,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%]{height:100%;padding:5px;background-color:transparent;overflow-y:auto;overflow-x:hidden}[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%] .form-action-buttons[_ngcontent-%COMP%]{padding-top:8px}[_nghost-%COMP%] .gateway-form[_ngcontent-%COMP%] .gateway-config[_ngcontent-%COMP%] .no-data-found[_ngcontent-%COMP%]{position:relative;display:flex;height:40px}']})}}e("GatewayFormComponent",c$);class d${transform(e,t){return Ya.parseVersion(e)>=Ya.parseVersion(Ai.get(t))}static{this.ɵfac=function(e){return new(e||d$)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"isLatestVersionConfig",type:d$,pure:!0,standalone:!0})}}class u${constructor(e){this.translate=e}transform(e){return e.hasError("required")?this.translate.instant("gateway.port-required"):e.hasError("min")||e.hasError("max")?this.translate.instant("gateway.port-limits-error",{min:Oi.MIN,max:Oi.MAX}):""}static{this.ɵfac=function(e){return new(e||u$)(t.ɵɵdirectiveInject(le.TranslateService,16))}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getGatewayPortTooltip",type:u$,pure:!0,standalone:!0})}}class m${transform(e,t,n,i){switch(e){case dt.OPCUA:return this.getOpcConnectorHelpLink(t,n);case dt.MQTT:return this.getMqttConnectorHelpLink(t,n,i);case dt.BACNET:return this.getBacnetConnectorHelpLink(t,n);case dt.REST:return this.getRestConnectorHelpLink(n)}}getOpcConnectorHelpLink(e,t){if(t!==Fi.CONST)return`widget/lib/gateway/${e}-${t}_fn`}getMqttConnectorHelpLink(e,t,n){if(t!==oi.CONST)return n?e!==Ui.ATTRIBUTES&&e!==Ui.TIMESERIES||n!==ri.JSON?`widget/lib/gateway/mqtt-${n}-expression_fn`:"widget/lib/gateway/mqtt-json-key-expression_fn":"widget/lib/gateway/mqtt-expression_fn"}getBacnetConnectorHelpLink(e,t){if(t!==Fi.CONST)return`widget/lib/gateway/bacnet-device-${e}-${t}_fn`}getRestConnectorHelpLink(e){if(e!==Si.CONST)return"widget/lib/gateway/rest-json_fn"}static{this.ɵfac=function(e){return new(e||m$)}}static{this.ɵpipe=t.ɵɵdefinePipe({name:"getConnectorMappingHelpLink",type:m$,pure:!0,standalone:!0})}}function h$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.gatewayConnectorDefaultTypesTranslatesMap.get(e)," ")}}function g$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.connectorForm.get("name").hasError("duplicateName")?"gateway.connector-duplicate-name":"gateway.name-required"))}}function f$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.connectors-table-class"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",10),t.ɵɵelement(4,"input",23),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,1,"gateway.set")))}function y$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.connectors-table-key"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",10),t.ɵɵelement(4,"input",24),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,1,"gateway.set")))}function v$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function x$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"mat-slide-toggle",25)(2,"mat-label",26),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.fill-connector-defaults-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.fill-connector-defaults")," "))}function b$(e,n){1&e&&(t.ɵɵelementStart(0,"div",8)(1,"mat-slide-toggle",27)(2,"mat-label",26),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.send-change-data-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.send-change-data")," "))}class w$ extends A{constructor(e,t,n,i,a,r){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.isLatestVersionConfig=r,this.connectorType=dt,this.gatewayConnectorDefaultTypesTranslatesMap=ut,this.gatewayLogLevel=Object.values(pt),this.submitted=!1,this.destroy$=new we,this.updateConnectorTypesByVersion(),this.connectorForm=this.fb.group({type:[dt.MQTT,[]],name:["",[me.required,this.uniqNameRequired(),me.pattern(pn)]],logLevel:[pt.INFO,[]],useDefaults:[!0,[]],sendDataOnlyOnChange:[!1,[]],class:["",[]],key:["auto",[]]})}ngOnInit(){this.observeTypeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}helpLinkId(){return O+"/docs/iot-gateway/configuration/"}cancel(){this.dialogRef.close(null)}add(){this.submitted=!0;const e=this.connectorForm.getRawValue();if(e.useDefaults){const t=Xt(e.type),n=this.data.gatewayVersion;n&&(e.configVersion=n),e.configurationJson=(this.isLatestVersionConfig.transform(n,e.type)?t[Ai.get(e.type)]:t[ct.Legacy])??t,this.connectorForm.valid&&this.dialogRef.close(e)}else this.connectorForm.valid&&this.dialogRef.close(e)}uniqNameRequired(){return e=>{const t=e.value.trim().toLowerCase();return this.data.dataSourceData.some((({value:{name:e}})=>e.toLowerCase()===t))?{duplicateName:{valid:!1}}:null}}updateConnectorTypesByVersion(){const e=mt.keys();for(let t of e)if(t===ct.Legacy||Ya.parseVersion(this.data.gatewayVersion)>=Ya.parseVersion(t)){this.connectorTypes=mt.get(t);break}}observeTypeChange(){this.connectorForm.get("type").valueChanges.pipe(Ae((e=>{const t=this.connectorForm.get("useDefaults");e===dt.GRPC||e===dt.CUSTOM?t.setValue(!1):t.value||t.setValue(!0)})),Me(this.destroy$)).subscribe()}static{this.ɵfac=function(e){return new(e||w$)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(d$))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:w$,selectors:[["tb-add-connector-dialog"]],standalone:!0,features:[t.ɵɵProvidersFeature([d$]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:43,vars:25,consts:[[1,"add-connector",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","autocomplete","off","name","value","formControlName","name",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf"],["formControlName","logLevel"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","class",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"],["formControlName","useDefaults",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",2)(6,"div",3),t.ɵɵelementStart(7,"button",4),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",5),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",6)(11,"div",7)(12,"div",8)(13,"div",9),t.ɵɵtext(14,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",10)(16,"mat-select",11),t.ɵɵtemplate(17,h$,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(18,"div",8)(19,"div",13),t.ɵɵtext(20,"gateway.name"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",10),t.ɵɵelement(22,"input",14),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,g$,3,3,"mat-icon",15),t.ɵɵelementEnd()(),t.ɵɵtemplate(25,f$,6,3,"div",16)(26,y$,6,3,"div",16),t.ɵɵelementStart(27,"div",8)(28,"div",9),t.ɵɵtext(29,"gateway.remote-logging-level"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",10)(31,"mat-select",17),t.ɵɵtemplate(32,v$,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵtemplate(33,x$,6,6,"div",16)(34,b$,6,6,"div",16),t.ɵɵpipe(35,"withReportStrategy"),t.ɵɵelementEnd()(),t.ɵɵelementStart(36,"div",18)(37,"button",19),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(38),t.ɵɵpipe(39,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(40,"button",20),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(41),t.ɵɵpipe(42,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.connectorForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,14,"gateway.add-connector")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLinkId()),t.ɵɵadvance(11),t.ɵɵproperty("ngForOf",n.connectorTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorForm.get("name").hasError("required")&&n.connectorForm.get("name").touched||n.connectorForm.get("name").hasError("duplicateName")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.GRPC),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.gatewayLogLevel),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value!==n.connectorType.GRPC&&n.connectorForm.get("type").value!==n.connectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.connectorForm.get("type").value===n.connectorType.MQTT&&!t.ɵɵpipeBind2(35,18,n.data.gatewayVersion,n.connectorType.MQTT)),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(39,21,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.connectorForm.invalid||!n.connectorForm.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(42,23,"action.add")," "))},dependencies:t.ɵɵgetComponentDepsFactory(w$,[se,_,tr]),styles:['@charset "UTF-8";[_nghost-%COMP%] .add-connector[_ngcontent-%COMP%]{min-width:400px;width:500px}']})}}e("AddConnectorDialogComponent",w$);const S$=()=>({maxWidth:"970px"});function C$(e,n){1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtext(1,"gateway.device-info.source"),t.ɵɵelementEnd())}function _$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function T$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-form-field",18)(2,"mat-select",19),t.ɵɵtemplate(3,_$,3,4,"mat-option",20),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sourceTypes)}}function I$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-name-expression-required"))}function E$(e,n){if(1&e&&(t.ɵɵelement(0,"div",23),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,e.connectorType,"name-field",e.mappingFormGroup.get("deviceNameExpressionSource").value,e.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,S$))}}function M$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function k$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-form-field",18)(2,"mat-select",26),t.ɵɵtemplate(3,M$,3,4,"mat-option",20),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",e.sourceTypes)}}function P$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",22),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-profile-expression-required"))}function D$(e,n){if(1&e&&(t.ɵɵelement(0,"div",23),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,e.connectorType,"profile-name",e.mappingFormGroup.get("deviceProfileExpressionSource").value,e.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,S$))}}function O$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",24)(1,"div",9),t.ɵɵtext(2,"gateway.device-info.profile-name"),t.ɵɵelementEnd(),t.ɵɵtemplate(3,k$,4,1,"div",10),t.ɵɵelementStart(4,"div",11)(5,"mat-form-field",12),t.ɵɵelement(6,"input",25),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,P$,3,3,"mat-icon",14)(9,D$,2,8,"div",15),t.ɵɵpipe(10,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵproperty("ngIf",e.useSource),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingFormGroup.get("deviceProfileExpression").hasError("required")&&e.mappingFormGroup.get("deviceProfileExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(10,6,e.connectorType,"profile-name",e.mappingFormGroup.get("deviceProfileExpressionSource").value,e.convertorType))}}class A$ extends q{get deviceInfoType(){return this.deviceInfoTypeValue}set deviceInfoType(e){this.deviceInfoTypeValue!==e&&(this.deviceInfoTypeValue=e)}constructor(e,t,n,i){super(e),this.store=e,this.translate=t,this.dialog=n,this.fb=i,this.SourceTypeTranslationsMap=zi,this.DeviceInfoType=Sa,this.useSource=!0,this.required=!1,this.connectorType=dt.MQTT,this.sourceTypes=Object.values(oi),this.destroy$=new we,this.propagateChange=e=>{}}ngOnInit(){this.mappingFormGroup=this.fb.group({deviceNameExpression:["",this.required?[me.required,me.pattern(pn)]:[me.pattern(pn)]]}),this.useSource&&this.mappingFormGroup.addControl("deviceNameExpressionSource",this.fb.control(this.sourceTypes[0],[])),this.deviceInfoType===Sa.FULL&&(this.useSource&&this.mappingFormGroup.addControl("deviceProfileExpressionSource",this.fb.control(this.sourceTypes[0],[])),this.mappingFormGroup.addControl("deviceProfileExpression",this.fb.control("",this.required?[me.required,me.pattern(pn)]:[me.pattern(pn)]))),this.mappingFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateView(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}writeValue(e){this.mappingFormGroup.patchValue(e,{emitEvent:!1})}validate(){return this.mappingFormGroup.valid?null:{mappingForm:{valid:!1}}}updateView(e){this.propagateChange(e)}static{this.ɵfac=function(e){return new(e||A$)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:A$,selectors:[["tb-device-info-table"]],inputs:{useSource:"useSource",required:"required",connectorType:"connectorType",convertorType:"convertorType",sourceTypes:"sourceTypes",deviceInfoType:"deviceInfoType"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>A$)),multi:!0},{provide:he,useExisting:c((()=>A$)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:23,vars:18,consts:[[1,"tb-form-panel","stroked",3,"formGroup"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-table","no-padding","no-gap"],[1,"tb-form-table-header"],["translate","",1,"tb-form-table-header-cell","w-1/5"],["class","tb-form-table-header-cell w-1/5","translate","",4,"ngIf"],["translate","",1,"tb-form-table-header-cell","w-1/2"],[1,"tb-form-table-body","no-gap"],[1,"tb-form-table-row","tb-form-row","no-border","same-padding","pt-4"],["translate","",1,"tb-required","w-1/5"],["class","no-gap w-1/5",4,"ngIf"],[1,"tb-form-table-row-cell","tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","deviceNameExpression",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],["class","tb-form-table-row tb-form-row no-border same-padding pb-4",4,"ngIf"],[1,"no-gap","w-1/5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","!w-full"],["formControlName","deviceNameExpressionSource"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-form-table-row","tb-form-row","no-border","same-padding","pb-4"],["matInput","","name","value","formControlName","deviceProfileExpression",3,"placeholder"],["formControlName","deviceProfileExpressionSource"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2,"device.device"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",2)(4,"div",3)(5,"div",4),t.ɵɵtext(6,"gateway.device-info.entity-field"),t.ɵɵelementEnd(),t.ɵɵtemplate(7,C$,2,0,"div",5),t.ɵɵelementStart(8,"div",6),t.ɵɵtext(9," gateway.device-info.expression "),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",7)(11,"div",8)(12,"div",9),t.ɵɵtext(13,"gateway.device-info.name"),t.ɵɵelementEnd(),t.ɵɵtemplate(14,T$,4,1,"div",10),t.ɵɵelementStart(15,"div",11)(16,"mat-form-field",12),t.ɵɵelement(17,"input",13),t.ɵɵpipe(18,"translate"),t.ɵɵtemplate(19,I$,3,3,"mat-icon",14)(20,E$,2,8,"div",15),t.ɵɵpipe(21,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(22,O$,11,11,"div",16),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(),t.ɵɵclassProp("tb-required",n.required),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.useSource),t.ɵɵadvance(4),t.ɵɵclassProp("pb-4",n.deviceInfoType!==n.DeviceInfoType.FULL),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.useSource),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(18,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.mappingFormGroup.get("deviceNameExpression").hasError("required")&&n.mappingFormGroup.get("deviceNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(21,13,n.connectorType,"name-field",n.mappingFormGroup.get("deviceNameExpressionSource").value,n.convertorType)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceInfoType===n.DeviceInfoType.FULL))},dependencies:t.ɵɵgetComponentDepsFactory(A$,[se,_,m$]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}He([I()],A$.prototype,"useSource",void 0),He([I()],A$.prototype,"required",void 0);const F$=()=>({maxWidth:"970px"});function R$(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",19),2&e){let e;const n=t.ɵɵnextContext();t.ɵɵproperty("svgIcon",null==(e=n.valueTypes.get(n.valueTypeFormGroup.get("type").value))?null:e.icon)}}function B$(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵelement(1,"mat-icon",22),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext(2);t.ɵɵproperty("value",a),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",null==(e=r.valueTypes.get(a))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,null==(i=r.valueTypes.get(a))?null:i.name))}}function N$(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,B$,5,5,"mat-option",20),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueTypeKeys)}}function L$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-option",23)(1,"span"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.raw")))}function V$(e,n){1&e&&(t.ɵɵelement(0,"input",24),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function q$(e,n){1&e&&(t.ɵɵelement(0,"input",25),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function G$(e,n){1&e&&(t.ɵɵelement(0,"input",26),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function z$(e,n){1&e&&(t.ɵɵelement(0,"input",27),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(1,1,"gateway.set"))}function U$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-select",28)(1,"mat-option",21),t.ɵɵtext(2,"true"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-option",21),t.ɵɵtext(4,"false"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵproperty("value",!0),t.ɵɵadvance(2),t.ɵɵproperty("value",!1))}function j$(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",29),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function H$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",30),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("tb-help-popup",e.helpLink)("tb-help-popup-style",t.ɵɵpureFunction0(2,F$))}}class W${constructor(e){this.fb=e,this.valueTypeKeys=Object.values(en),this.valueTypes=tn,this.MappingValueType=en,this.destroy$=new we,this.onChange=e=>{},this.valueTypeFormGroup=this.fb.group({type:[en.STRING],stringValue:[{value:"",disabled:this.rawData},[me.required,me.pattern(pn)]],integerValue:[{value:0,disabled:!0},[me.required,me.pattern(cn)]],doubleValue:[{value:0,disabled:!0},[me.required]],booleanValue:[{value:!1,disabled:!0},[me.required]],rawValue:[{value:"",disabled:!this.rawData},[me.required,me.pattern(pn)]]}),this.valueTypeFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((({type:e,...t})=>{this.onChange({type:e,value:t[e+"Value"]})})),this.observeTypeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}observeTypeChange(){this.valueTypeFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.toggleTypeInputs(e)))}toggleTypeInputs(e){this.valueTypeFormGroup.disable({emitEvent:!1}),this.valueTypeFormGroup.get("type").enable({emitEvent:!1}),this.valueTypeFormGroup.get(e+"Value").enable({emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){const t=this.getValueType(e?.value),n={stringValue:"",rawValue:"",integerValue:0,doubleValue:0,booleanValue:!1,type:t};n[t+"Value"]=e?.value,this.toggleTypeInputs(t),this.valueTypeFormGroup.patchValue(n,{emitEvent:!1})}validate(){return this.valueTypeFormGroup.valid?null:{valueTypeFormGroup:{valid:!1}}}getValueType(e){if(this.rawData)return"raw";switch(typeof e){case"boolean":return en.BOOLEAN;case"number":return Number.isInteger(e)?en.INTEGER:en.DOUBLE;default:return en.STRING}}static{this.ɵfac=function(e){return new(e||W$)(t.ɵɵdirectiveInject(de.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:W$,selectors:[["tb-type-value-field"]],inputs:{rawData:"rawData",helpLink:"helpLink"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>W$)),multi:!0},{provide:he,useExisting:c((()=>W$)),multi:!0}]),t.ɵɵStandaloneFeature],decls:29,vars:17,consts:[["raw",""],[3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[1,"tb-flex","align-center"],["class","tb-mat-18",3,"svgIcon",4,"ngIf"],[4,"ngIf","ngIfElse"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","flex","tb-suffix-absolute"],[3,"ngSwitch"],["matInput","","required","","formControlName","stringValue",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder",4,"ngSwitchCase"],["matInput","","required","","formControlName","rawValue",3,"placeholder",4,"ngSwitchCase"],["formControlName","booleanValue",4,"ngSwitchCase"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style","click",4,"ngIf"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"tb-mat-20",3,"svgIcon"],["value","raw"],["matInput","","required","","formControlName","stringValue",3,"placeholder"],["matInput","","required","","formControlName","integerValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","doubleValue","type","number",3,"placeholder"],["matInput","","required","","formControlName","rawValue",3,"placeholder"],["formControlName","booleanValue"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"click","tb-help-popup","tb-help-popup-style"]],template:function(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,1),t.ɵɵelementStart(1,"div",2)(2,"div",3),t.ɵɵtext(3,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",4)(5,"mat-form-field",5)(6,"mat-select",6)(7,"mat-select-trigger")(8,"div",7),t.ɵɵtemplate(9,R$,1,1,"mat-icon",8),t.ɵɵelementStart(10,"span"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(14,N$,2,1,"ng-container",9)(15,L$,4,3,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(17,"div",2)(18,"div",3),t.ɵɵtext(19,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"mat-form-field",10),t.ɵɵelementContainerStart(21,11),t.ɵɵtemplate(22,V$,2,3,"input",12)(23,q$,2,3,"input",13)(24,G$,2,3,"input",14)(25,z$,2,3,"input",15)(26,U$,5,2,"mat-select",16),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(27,j$,3,3,"mat-icon",17)(28,H$,1,3,"div",18),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){let e,i;const a=t.ɵɵreference(16);t.ɵɵproperty("formGroup",n.valueTypeFormGroup),t.ɵɵadvance(9),t.ɵɵproperty("ngIf",!n.rawData),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,13,null==(e=n.valueTypes.get(n.valueTypeFormGroup.get("type").value))?null:e.name)||t.ɵɵpipeBind1(13,15,"gateway.raw")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",!n.rawData)("ngIfElse",a),t.ɵɵadvance(7),t.ɵɵproperty("ngSwitch",n.valueTypeFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.STRING),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.INTEGER),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.DOUBLE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase","raw"),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingValueType.BOOLEAN),t.ɵɵadvance(),t.ɵɵproperty("ngIf",(null==(i=n.valueTypeFormGroup.get(n.valueTypeFormGroup.get("type").value))?null:i.hasError("required"))&&n.valueTypeFormGroup.get(n.valueTypeFormGroup.get("type").value).touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.helpLink)}},dependencies:t.ɵɵgetComponentDepsFactory(W$,[_,se]),styles:['@charset "UTF-8";[_nghost-%COMP%]{gap:16px;display:grid;width:100%}']})}}function $$(e,n){if(1&e&&t.ɵɵelement(0,"tb-type-value-field",14),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("helpLink",e.helpLink)}}function K$(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",7),t.ɵɵelementContainerStart(2,8),t.ɵɵelementStart(3,"mat-expansion-panel",9)(4,"mat-expansion-panel-header",10)(5,"mat-panel-title")(6,"div",11),t.ɵɵtext(7),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,$$,1,1,"ng-template",12),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",13),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e;const i=n.$implicit,a=n.last;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i),t.ɵɵadvance(),t.ɵɵproperty("expanded",a),t.ɵɵadvance(4),t.ɵɵtextInterpolate(null!==(e=null==(e=i.get("typeValue").value)?null:e.value)&&void 0!==e?e:""),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(10,4,"gateway.delete-argument"))}}function Y$(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4),t.ɵɵtemplate(1,K$,13,6,"div",5),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function X$(e,n){1&e&&(t.ɵɵelementStart(0,"div",15)(1,"span",16),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate("gateway.no-value"))}He([I()],W$.prototype,"rawData",void 0);class Z${constructor(e){this.fb=e,this.destroy$=new we,this.onChange=e=>{}}ngOnInit(){this.valueListFormArray=this.fb.array([]),this.valueListFormArray.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e.map((({typeValue:e})=>({...e}))))}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}trackByKey(e,t){return t}addKey(){const e=this.fb.group({typeValue:[]});this.valueListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.valueListFormArray.removeAt(t),this.valueListFormArray.markAsDirty()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){for(const t of e){const e={typeValue:[t]},n=this.fb.group(e);this.valueListFormArray.push(n)}}validate(){return this.valueListFormArray.valid?null:{valueListForm:{valid:!1}}}static{this.ɵfac=function(e){return new(e||Z$)(t.ɵɵdirectiveInject(de.UntypedFormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Z$,selectors:[["tb-type-value-panel"]],inputs:{helpLink:"helpLink"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>Z$)),multi:!0},{provide:he,useExisting:c((()=>Z$)),multi:!0}]),t.ɵɵStandaloneFeature],decls:8,vars:5,consts:[["noKeys",""],[1,"tb-form-panel","no-border","no-padding"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["tbTruncateWithTooltip","",1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["formControlName","typeValue",3,"helpLink"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",1),t.ɵɵtemplate(1,Y$,2,2,"div",2),t.ɵɵelementStart(2,"div")(3,"button",3),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(6,X$,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor)}if(2&e){const e=t.ɵɵreference(7);t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.valueListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,3,"gateway.add-value")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(Z$,[se,_,W$]),styles:['@charset "UTF-8";[_nghost-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw}[_nghost-%COMP%] .key-panel[_ngcontent-%COMP%]{height:250px;overflow:auto}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}const Q$=()=>({maxWidth:"970px"});function J$(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",19),t.ɵɵtext(2),t.ɵɵelementEnd(),t.ɵɵtext(3),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",e.get("key").value," "),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",":","  ")}}function eK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function tK(e,n){if(1&e&&(t.ɵɵelement(0,"div",41),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(3).$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,n.connectorType,n.keysType,e.get("type").value,n.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,Q$))}}function nK(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",44),2&e){let e;const n=t.ɵɵnextContext(4).$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("svgIcon",null==(e=i.valueTypes.get(n.get("type").value))?null:e.icon)}}function iK(e,n){if(1&e&&(t.ɵɵelementStart(0,"span"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){let e;const n=t.ɵɵnextContext(4).$implicit,i=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,null!==(e=null==(e=i.valueTypes.get(n.get("type").value))?null:e.name)&&void 0!==e?e:i.valueTypes.get(n.get("type").value))," ")}}function aK(e,n){1&e&&(t.ɵɵelementStart(0,"span"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.raw")))}function rK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-select-trigger")(1,"div",42),t.ɵɵtemplate(2,nK,1,1,"mat-icon",43)(3,iK,3,3,"span",36)(4,aK,3,3,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()),2&e){let e;const n=t.ɵɵreference(5),i=t.ɵɵnextContext(3).$implicit,a=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==(e=a.valueTypes.get(i.get("type").value))?null:e.icon),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!a.rawData)("ngIfElse",n)}}function oK(e,n){if(1&e&&t.ɵɵelement(0,"mat-icon",48),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(6);t.ɵɵpropertyInterpolate("svgIcon",n.valueTypes.get(e).icon)}}function sK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",46),t.ɵɵtemplate(1,oK,1,1,"mat-icon",47),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){let e,i;const a=n.$implicit,r=t.ɵɵnextContext(6);t.ɵɵproperty("value",a),t.ɵɵadvance(),t.ɵɵproperty("ngIf",null==(e=r.valueTypes.get(a))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,3,null!==(i=null==(i=r.valueTypes.get(a))?null:i.name)&&void 0!==i?i:r.valueTypes.get(a))," ")}}function lK(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,sK,5,5,"mat-option",45),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(5);t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.valueTypeKeys)}}function pK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-option",46)(1,"span"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("value","raw"),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,2,"gateway.raw")))}function cK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function dK(e,n){if(1&e&&(t.ɵɵelement(0,"div",41),t.ɵɵpipe(1,"getConnectorMappingHelpLink")),2&e){const e=t.ɵɵnextContext(3).$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind4(1,2,n.connectorType,n.keysType,e.get("type").value,n.convertorType))("tb-help-popup-style",t.ɵɵpureFunction0(7,Q$))}}function uK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",24)(2,"div",25),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",26)(5,"div",27),t.ɵɵpipe(6,"translate"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-form-field",28),t.ɵɵelement(10,"input",29),t.ɵɵpipe(11,"translate"),t.ɵɵtemplate(12,eK,3,3,"mat-icon",30)(13,tK,2,8,"div",31),t.ɵɵpipe(14,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",24)(16,"div",25),t.ɵɵtext(17,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",32)(19,"div",33),t.ɵɵtext(20,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",34)(22,"mat-select",35),t.ɵɵtemplate(23,rK,6,3,"mat-select-trigger",18)(24,lK,2,1,"ng-container",36)(25,pK,4,4,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()()(),t.ɵɵelementStart(27,"div",37)(28,"div",27),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-form-field",38),t.ɵɵelement(33,"input",39),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,cK,3,3,"mat-icon",30)(36,dK,2,8,"div",31),t.ɵɵpipe(37,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵreference(26),n=t.ɵɵnextContext(2).$implicit,i=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,13,"gateway.JSONPath-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,15,"gateway.key")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(11,17,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("key").hasError("required")&&n.get("key").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(14,19,i.connectorType,i.keysType,n.get("type").value,i.convertorType)),t.ɵɵadvance(10),t.ɵɵproperty("ngIf",!i.rawData),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!i.rawData)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(29,24,"gateway.JSONPath-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(31,26,"gateway.value")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(34,28,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("value").hasError("required")&&n.get("value").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind4(37,30,i.connectorType,i.keysType,n.get("type").value,i.convertorType))}}function mK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function hK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function gK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",26)(2,"div",33),t.ɵɵtext(3,"gateway.key"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",28),t.ɵɵelement(5,"input",29),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,mK,3,3,"mat-icon",30),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",26)(9,"div",33),t.ɵɵtext(10,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",49),t.ɵɵelement(12,"input",39),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,hK,3,3,"mat-icon",30),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("key").hasError("required")&&e.get("key").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,6,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("value").hasError("required")&&e.get("value").touched)}}function fK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function yK(e,n){1&e&&t.ɵɵelement(0,"tb-type-value-panel",54)}function vK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"div",26)(2,"div",27),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",28),t.ɵɵelement(7,"input",50),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,fK,3,3,"mat-icon",30),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",14)(11,"mat-expansion-panel",51)(12,"mat-expansion-panel-header",52)(13,"mat-panel-title")(14,"div",53),t.ɵɵpipe(15,"translate"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(18,yK,1,0,"ng-template",20),t.ɵɵelementEnd()()()),2&e){let e;const n=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,7,"gateway.hints.method-name")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,9,"gateway.method-name")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.get("method").hasError("required")&&n.get("method").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(15,13,"gateway.hints.arguments")),t.ɵɵadvance(2),t.ɵɵtextInterpolate2(" ",t.ɵɵpipeBind1(17,15,"gateway.arguments"),""," ("+(null==(e=n.get("arguments").value)?null:e.length)+")"," ")}}function xK(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",55),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}function bK(e,n){if(1&e&&t.ɵɵtemplate(0,uK,38,35,"div",22)(1,gK,15,8,"div",22)(2,vK,19,17,"div",22)(3,xK,1,2,"tb-report-strategy",23),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngIf",e.keysType!==e.MappingKeysType.CUSTOM&&e.keysType!==e.MappingKeysType.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.MappingKeysType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.MappingKeysType.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.withReportStrategy&&(e.keysType===e.MappingKeysType.ATTRIBUTES||e.keysType===e.MappingKeysType.TIMESERIES))}}function wK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",13)(1,"div",14),t.ɵɵelementContainerStart(2,15),t.ɵɵelementStart(3,"mat-expansion-panel",16)(4,"mat-expansion-panel-header",17)(5,"mat-panel-title"),t.ɵɵtemplate(6,J$,4,2,"ng-container",18),t.ɵɵelementStart(7,"div",19),t.ɵɵtext(8),t.ɵɵelementEnd()()(),t.ɵɵtemplate(9,bK,4,4,"ng-template",20),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",21),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",a.keysType!==a.MappingKeysType.RPC_METHODS),t.ɵɵadvance(2),t.ɵɵtextInterpolate(a.valueTitle(e)),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,a.deleteKeyTitle))}}function SK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵtemplate(1,wK,14,7,"div",12),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function CK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",56)(1,"span",57),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class _K extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.valueTypeEnum=en,this.valueTypes=tn,this.valueTypeKeys=Object.values(en),this.rawData=!1,this.withReportStrategy=!0,this.keysDataApplied=new u,this.MappingKeysType=Ui,this.ReportStrategyDefaultValue=on,this.ConnectorType=dt,this.errorText=""}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}trackByKey(e,t){return t}addKey(){let e;e=this.keysType===Ui.RPC_METHODS?this.fb.group({method:["",[me.required]],arguments:[[],[]]}):this.keysType===Ui.CUSTOM?this.fb.group({key:["",[me.required,me.pattern(pn)]],value:["",[me.required,me.pattern(pn)]]}):this.fb.group({key:["",[me.required,me.pattern(pn)]],type:[this.rawData?"raw":this.valueTypeKeys[0]],value:["",[me.required,me.pattern(pn)]],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]}),this.keysListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){let e=this.keysListFormArray.value.map((({reportStrategy:e,...t})=>({...t,...e&&{reportStrategy:e}})));if(this.keysType===Ui.CUSTOM){e={};for(let t of this.keysListFormArray.value)e[t.key]=t.value}this.keysDataApplied.emit(e)}prepareKeysFormArray(e){const t=[];return e&&(this.keysType===Ui.CUSTOM&&(e=Object.keys(e).map((t=>({key:t,value:e[t],type:""})))),e.forEach((e=>{let n;if(this.keysType===Ui.RPC_METHODS)n=this.fb.group({method:[e.method,[me.required]],arguments:[[...e.arguments],[]]});else if(this.keysType===Ui.CUSTOM){const{key:t,value:i}=e;n=this.fb.group({key:[t,[me.required,me.pattern(pn)]],value:[i,[me.required,me.pattern(pn)]]})}else{const{key:t,value:i,type:a,reportStrategy:r}=e;n=this.fb.group({key:[t,[me.required,me.pattern(pn)]],type:[a],value:[i,[me.required,me.pattern(pn)]],reportStrategy:[{value:r,disabled:this.isReportStrategyDisabled()}]})}t.push(n)}))),this.fb.array(t)}valueTitle(e){const t=this.keysType===Ui.RPC_METHODS?e.get("method").value:e.get("value").value;return J(t)?"object"==typeof t?JSON.stringify(t):t:""}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keysType===Ui.ATTRIBUTES||this.keysType===Ui.TIMESERIES))}static{this.ɵfac=function(e){return new(e||_K)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverComponent),t.ɵɵdirectiveInject(Xe.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:_K,selectors:[["tb-mapping-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",connectorType:"connectorType",convertorType:"convertorType",sourceType:"sourceType",valueTypeEnum:"valueTypeEnum",valueTypes:"valueTypes",valueTypeKeys:"valueTypeKeys",rawData:"rawData",withReportStrategy:"withReportStrategy"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["rawOption",""],["rawText",""],[1,"tb-mapping-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex","flex-row","flex-wrap"],[4,"ngIf"],["tbTruncateWithTooltip","",1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["class","tb-form-panel no-border no-padding",4,"ngIf"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],[1,"tb-form-row"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","type"],[4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs","flex","items-center","justify-between"],["appearance","outline","subscriptSizing","dynamic",1,"no-gap","flex","flex-1"],["matInput","","required","","formControlName","value",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-flex","align-center"],["class","tb-mat-18",3,"svgIcon",4,"ngIf"],[1,"tb-mat-18",3,"svgIcon"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["class","tb-mat-20",3,"svgIcon",4,"ngIf"],[1,"tb-mat-20",3,"svgIcon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],["matInput","","name","value","formControlName","method",3,"placeholder"],[1,"tb-settings"],[1,"flex","flex-wrap"],[1,"title-container",3,"tb-hint-tooltip-icon"],["formControlName","arguments"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"div",5),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,SK,2,2,"div",6),t.ɵɵelementStart(6,"div")(7,"button",7),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(10,CK,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",8)(13,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(11);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")",""),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,n.addKeyTitle)," "),t.ɵɵadvance(6),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(_K,[se,_,ni,Z$,m$]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] tb-value-input[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .tb-mapping-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}He([I()],_K.prototype,"rawData",void 0),He([I()],_K.prototype,"withReportStrategy",void 0);const TK=()=>({maxWidth:"970px"}),IK=(e,t)=>[e,t];function EK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.topic-required"))}function MK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.QualityTranslationsMap.get(e))," ")}}function kK(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.ConvertorTypeTranslationsMap.get(e))," ")}}function PK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",41),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("convertorType",e.ConvertorTypeEnum.JSON)("deviceInfoType",e.DeviceInfoType.FULL)}}function DK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",42),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.FULL)("convertorType",e.ConvertorTypeEnum.BYTES)("sourceTypes",t.ɵɵpureFunction2(3,IK,e.sourceTypesEnum.MSG,e.sourceTypesEnum.CONST))}}function OK(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",37),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function AK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function FK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function RK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",14)(1,"div",31)(2,"div",32),t.ɵɵtext(3,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",43)(5,"mat-chip-listbox",44),t.ɵɵtemplate(6,AK,2,1,"mat-chip",45),t.ɵɵelementStart(7,"mat-chip",46),t.ɵɵelement(8,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",48,0),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(10),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(12,"tb-icon",49),t.ɵɵtext(13,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(14,"div",31)(15,"div",32),t.ɵɵtext(16,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"div",43)(18,"mat-chip-listbox",44),t.ɵɵtemplate(19,FK,2,1,"mat-chip",45),t.ɵɵelementStart(20,"mat-chip",46),t.ɵɵelement(21,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"button",48,1),t.ɵɵpipe(24,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(23),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(25,"tb-icon",49),t.ɵɵtext(26,"edit"),t.ɵɵelementEnd()()()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",e.converterAttributes),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.converterAttributes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,6,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.converterTelemetry),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.converterTelemetry),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(24,8,"action.edit"))}}function BK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.extension-required"))}function NK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function LK(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",14)(1,"div",21)(2,"div",50),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",23),t.ɵɵelement(7,"input",51),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,BK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",52)(11,"div",35),t.ɵɵtext(12,"gateway.extension-configuration"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",15),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",31)(17,"div",32),t.ɵɵtext(18,"gateway.keys"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",43)(20,"mat-chip-listbox",44),t.ɵɵtemplate(21,NK,2,1,"mat-chip",45),t.ɵɵelementStart(22,"mat-chip",46),t.ɵɵelement(23,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"button",48,2),t.ɵɵpipe(26,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(25),a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.CUSTOM))})),t.ɵɵelementStart(27,"tb-icon",49),t.ɵɵtext(28,"edit"),t.ɵɵelementEnd()()()()()()}if(2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,8,"gateway.extension-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,10,"gateway.extension")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,12,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("converter.custom.extension").hasError("required")&&e.mappingForm.get("converter.custom.extension").touched),t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(15,14,"gateway.extension-configuration-hint")),t.ɵɵadvance(6),t.ɵɵproperty("tbEllipsisChipList",e.customKeys),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.customKeys),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(26,16,"action.edit"))}}function VK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",22),t.ɵɵtext(2,"gateway.topic-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23),t.ɵɵelement(4,"input",24),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,EK,3,3,"mat-icon",25),t.ɵɵelement(7,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",21)(9,"div",27),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",23)(14,"mat-select",28),t.ɵɵtemplate(15,MK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(16,30),t.ɵɵelementStart(17,"div",31)(18,"div",32),t.ɵɵtext(19,"gateway.payload-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"tb-toggle-select",33),t.ɵɵtemplate(21,kK,3,4,"tb-toggle-option",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",34)(23,"div",35),t.ɵɵtext(24,"gateway.data-conversion"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",15),t.ɵɵtext(26),t.ɵɵpipe(27,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(28,36),t.ɵɵtemplate(29,PK,1,2,"ng-template",17)(30,DK,1,6,"ng-template",17)(31,OK,1,2,"tb-report-strategy",37)(32,RK,27,10,"div",38)(33,LK,29,18,"div",38),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("topicFilter").hasError("required")&&e.mappingForm.get("topicFilter").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/topic-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(24,TK)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,18,"gateway.response-topic-Qos-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,20,"gateway.mqtt-qos")," "),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.qualityTypes),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",e.convertorTypes),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(27,22,e.DataConversionTranslationsMap.get(e.converterType))," "),t.ɵɵadvance(2),t.ɵɵproperty("formGroupName",e.converterType)("ngSwitch",e.converterType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConvertorTypeEnum.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConvertorTypeEnum.BYTES),t.ɵɵadvance(),t.ɵɵconditional(e.data.withReportStrategy?31:-1),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.converterType===e.ConvertorTypeEnum.BYTES||e.converterType===e.ConvertorTypeEnum.JSON),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.converterType===e.ConvertorTypeEnum.CUSTOM)}}function qK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.RequestTypesTranslationsMap.get(e))," ")}}function GK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.topic-required"))}function zK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",22),t.ɵɵtext(2,"gateway.topic-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23),t.ɵɵelement(4,"input",57),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,GK,3,3,"mat-icon",25),t.ɵɵelement(7,"div",26),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,5,"gateway.set")),t.ɵɵproperty("formControl",e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter").hasError("required")&&e.mappingForm.get("requestValue").get(e.requestMappingType).get("topicFilter").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/topic-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(7,TK))}}function UK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",58),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.FULL)}}function jK(e,n){if(1&e&&t.ɵɵelement(0,"tb-device-info-table",58),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("deviceInfoType",e.DeviceInfoType.PARTIAL)}}function HK(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function WK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-info.device-name-expression-required"))}function $K(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(3);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function KK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-name-expression-required"))}function YK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-value-expression-required"))}function XK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function ZK(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",34)(1,"div",59),t.ɵɵtext(2,"gateway.from-device-request-settings"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",60),t.ɵɵtext(4," gateway.from-device-request-settings-hint "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",61)(6,"div",62)(7,"div",63),t.ɵɵtext(8,"gateway.device-info.device-name-expression"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",64)(10,"div",65)(11,"mat-form-field",23)(12,"mat-select",66),t.ɵɵtemplate(13,HK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(14,"mat-form-field",23),t.ɵɵelement(15,"input",67),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,WK,3,3,"mat-icon",25),t.ɵɵelement(18,"div",26),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",21)(20,"div",22),t.ɵɵtext(21,"gateway.attribute-name-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"div",64)(23,"div",65)(24,"mat-form-field",23)(25,"mat-select",68),t.ɵɵtemplate(26,$K,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(27,"mat-form-field",23),t.ɵɵelement(28,"input",69),t.ɵɵpipe(29,"translate"),t.ɵɵtemplate(30,KK,3,3,"mat-icon",25),t.ɵɵelement(31,"div",26),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(32,"div",34)(33,"div",59),t.ɵɵtext(34,"gateway.to-device-response-settings"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"div",60),t.ɵɵtext(36," gateway.to-device-response-settings-hint "),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"div",21)(38,"div",22),t.ɵɵtext(39,"gateway.response-value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(40,"mat-form-field",23),t.ɵɵelement(41,"input",70),t.ɵɵpipe(42,"translate"),t.ɵɵtemplate(43,YK,3,3,"mat-icon",25),t.ɵɵelement(44,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"div",21)(46,"div",22),t.ɵɵtext(47,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(48,"mat-form-field",23),t.ɵɵelement(49,"input",71),t.ɵɵpipe(50,"translate"),t.ɵɵtemplate(51,XK,3,3,"mat-icon",25),t.ɵɵelement(52,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(53,"div",72)(54,"mat-slide-toggle",73)(55,"mat-label",74),t.ɵɵpipe(56,"translate"),t.ɵɵtext(57),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(13),t.ɵɵproperty("ngForOf",e.sourceTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.deviceInfo.deviceNameExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.deviceInfo.deviceNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(32,TK)),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",e.sourceTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(29,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.attributeNameExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.attributeNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(33,TK)),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(42,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(34,TK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(50,26,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeRequests.topicExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeRequests.topicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(35,TK)),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(56,28,"gateway.retain-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(58,30,"gateway.retain")," ")}}function QK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-filter-required"))}function JK(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-filter-required"))}function eY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-value-expression-required"))}function tY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function nY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",50),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",23),t.ɵɵelement(6,"input",75),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,QK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",21)(10,"div",50),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-form-field",23),t.ɵɵelement(15,"input",76),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,JK,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",21)(19,"div",22),t.ɵɵtext(20,"gateway.response-value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",23),t.ɵɵelement(22,"input",70),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,eY,3,3,"mat-icon",25),t.ɵɵelement(25,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"div",21)(27,"div",22),t.ɵɵtext(28,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-form-field",23),t.ɵɵelement(30,"input",71),t.ɵɵpipe(31,"translate"),t.ɵɵtemplate(32,tY,3,3,"mat-icon",25),t.ɵɵelement(33,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",72)(35,"mat-slide-toggle",73)(36,"mat-label",74),t.ɵɵpipe(37,"translate"),t.ɵɵtext(38),t.ɵɵpipe(39,"translate"),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,18,"gateway.device-name-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,20,"gateway.device-name-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.deviceNameFilter").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.deviceNameFilter").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,24,"gateway.attribute-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,26,"gateway.attribute-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,28,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.attributeFilter").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.attributeFilter").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,30,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(38,TK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(31,32,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.attributeUpdates.topicExpression").hasError("required")&&e.mappingForm.get("requestValue.attributeUpdates.topicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(39,TK)),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(37,34,"gateway.retain-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(39,36,"gateway.retain")," ")}}function iY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-filter-required"))}function aY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-filter-required"))}function rY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.request-topic-expression-required"))}function oY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-expression-required"))}function sY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.response-topic-expression-required"))}function lY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(4);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.QualityTranslationsMap.get(e))," ")}}function pY(e,n){if(1&e&&t.ɵɵelement(0,"tb-error-icon",84),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("tooltipText",e.responseTimeoutErrorTooltip)}}function cY(e,n){1&e&&(t.ɵɵelementStart(0,"span",85),t.ɵɵtext(1,"gateway.suffix.ms"),t.ɵɵelementEnd())}function dY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",21)(2,"div",22),t.ɵɵtext(3,"gateway.response-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",23),t.ɵɵelement(5,"input",81),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,sY,3,3,"mat-icon",25),t.ɵɵelement(8,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",21)(10,"div",27),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"mat-form-field",23)(15,"mat-select",82),t.ɵɵtemplate(16,lY,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(17,"div",21)(18,"div",22),t.ɵɵtext(19,"gateway.response-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(20,"mat-form-field",23),t.ɵɵelement(21,"input",83),t.ɵɵpipe(22,"translate"),t.ɵɵtemplate(23,pY,1,1,"tb-error-icon",84)(24,cY,2,0,"span",85),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.responseTopicExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.responseTopicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(17,TK)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,11,"gateway.response-topic-Qos-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(13,13,"gateway.response-topic-Qos")," "),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",e.qualityTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").hasError("required")||e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").hasError("min"))&&e.mappingForm.get("requestValue.serverSideRpc.responseTimeout").touched?23:24)}}function uY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",77)(1,"tb-toggle-select",33)(2,"tb-toggle-option",40),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-option",40),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",21)(9,"div",50),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",23),t.ɵɵelement(14,"input",75),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,iY,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"div",21)(18,"div",50),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",23),t.ɵɵelement(23,"input",78),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,aY,3,3,"mat-icon",25),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"div",21)(27,"div",22),t.ɵɵtext(28,"gateway.request-topic-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-form-field",23),t.ɵɵelement(30,"input",79),t.ɵɵpipe(31,"translate"),t.ɵɵtemplate(32,rY,3,3,"mat-icon",25),t.ɵɵelement(33,"div",26),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",21)(35,"div",22),t.ɵɵtext(36,"gateway.value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",23),t.ɵɵelement(38,"input",70),t.ɵɵpipe(39,"translate"),t.ɵɵtemplate(40,oY,3,3,"mat-icon",25),t.ɵɵelement(41,"div",26),t.ɵɵelementEnd()(),t.ɵɵtemplate(42,dY,25,18,"ng-container",80)),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("value",e.ServerSideRPCType.TWO_WAY),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,21,"gateway.with-response")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",e.ServerSideRPCType.ONE_WAY),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,23,"gateway.without-response")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,25,"gateway.device-name-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,27,"gateway.device-name-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,29,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.deviceNameFilter").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.deviceNameFilter").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(19,31,"gateway.method-filter-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(21,33,"gateway.method-filter")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,35,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.methodFilter").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.methodFilter").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(31,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.requestTopicExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.requestTopicExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(41,TK)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(39,39,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.valueExpression").hasError("required")&&e.mappingForm.get("requestValue.serverSideRpc.valueExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/mqtt-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(42,TK)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.mappingForm.get("requestValue.serverSideRpc.type").value===e.ServerSideRPCType.TWO_WAY)}}function mY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21)(1,"div",32),t.ɵɵtext(2,"gateway.request-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",23)(4,"mat-select",53),t.ɵɵtemplate(5,qK,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(6,54)(7,55),t.ɵɵtemplate(8,zK,8,8,"div",56)(9,UK,1,1,"ng-template",17)(10,jK,1,1,"ng-template",17)(11,ZK,59,36,"ng-template",17)(12,nY,40,40,"ng-template",17)(13,uY,43,43,"ng-template",17),t.ɵɵelementContainerEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.requestTypes),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e.mappingForm.get("requestValue").get(e.requestMappingType))("ngSwitch",e.requestMappingType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.requestMappingType===e.RequestTypeEnum.ATTRIBUTE_REQUEST||e.requestMappingType===e.RequestTypeEnum.CONNECT_REQUEST||e.requestMappingType===e.RequestTypeEnum.DISCONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.CONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.DISCONNECT_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.ATTRIBUTE_REQUEST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.ATTRIBUTE_UPDATE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.RequestTypeEnum.SERVER_SIDE_RPC)}}function hY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",40),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SourceTypeTranslationsMap.get(e))," ")}}function gY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",39),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-node-required"))}function fY(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",37),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function yY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function vY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function xY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function bY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function wY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",86)(1,"div",87)(2,"div",88),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"div",89)(7,"mat-form-field",90)(8,"mat-select",91),t.ɵɵtemplate(9,hY,3,4,"mat-option",29),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"mat-form-field",90),t.ɵɵelement(11,"input",92),t.ɵɵpipe(12,"translate"),t.ɵɵtemplate(13,gY,3,3,"mat-icon",25),t.ɵɵelement(14,"div",26),t.ɵɵpipe(15,"getConnectorMappingHelpLink"),t.ɵɵelementEnd()(),t.ɵɵelement(16,"tb-device-info-table",93),t.ɵɵtemplate(17,fY,1,2,"tb-report-strategy",37),t.ɵɵelementStart(18,"div",31)(19,"div",32),t.ɵɵtext(20,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",43)(22,"mat-chip-listbox",44),t.ɵɵtemplate(23,yY,2,1,"mat-chip",45),t.ɵɵelementStart(24,"mat-chip",46),t.ɵɵelement(25,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"button",48,3),t.ɵɵpipe(28,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(27),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(29,"tb-icon",49),t.ɵɵtext(30,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(31,"div",31)(32,"div",32),t.ɵɵtext(33,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"div",43)(35,"mat-chip-listbox",44),t.ɵɵtemplate(36,vY,2,1,"mat-chip",45),t.ɵɵelementStart(37,"mat-chip",46),t.ɵɵelement(38,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"button",48,4),t.ɵɵpipe(41,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(40),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(42,"tb-icon",49),t.ɵɵtext(43,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(44,"div",31)(45,"div",32),t.ɵɵtext(46,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(47,"div",43)(48,"mat-chip-listbox",44),t.ɵɵtemplate(49,xY,2,1,"mat-chip",45),t.ɵɵelementStart(50,"mat-chip",46),t.ɵɵelement(51,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(52,"button",48,5),t.ɵɵpipe(54,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(53),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(55,"tb-icon",49),t.ɵɵtext(56,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(57,"div",31)(58,"div",32),t.ɵɵtext(59,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(60,"div",43)(61,"mat-chip-listbox",44),t.ɵɵtemplate(62,bY,2,1,"mat-chip",45),t.ɵɵelementStart(63,"mat-chip",46),t.ɵɵelement(64,"label",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(65,"button",48,6),t.ɵɵpipe(67,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(66),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.RPC_METHODS))})),t.ɵɵelementStart(68,"tb-icon",49),t.ɵɵtext(69,"edit"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,23,"gateway.device-node-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,25,"gateway.device-node")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",t.ɵɵpureFunction2(41,IK,e.OPCUaSourceTypesEnum.PATH,e.OPCUaSourceTypesEnum.IDENTIFIER)),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,27,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mappingForm.get("deviceNodePattern").hasError("required")&&e.mappingForm.get("deviceNodePattern").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup",t.ɵɵpipeBind3(15,29,e.ConnectorType.OPCUA,"device-node",e.mappingForm.get("deviceNodeSource").value))("tb-help-popup-style",t.ɵɵpureFunction0(44,TK)),t.ɵɵadvance(2),t.ɵɵproperty("connectorType",e.ConnectorType.OPCUA)("sourceTypes",e.OPCUaSourceTypes)("deviceInfoType",e.DeviceInfoType.FULL),t.ɵɵadvance(),t.ɵɵconditional(e.data.withReportStrategy?17:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",e.opcAttributes),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcAttributes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,33,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcTelemetry),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcTelemetry),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(41,35,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcAttributesUpdates),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcAttributesUpdates),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(54,37,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.opcRpcMethods),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.opcRpcMethods),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(67,39,"action.edit"))}}class SY extends A{constructor(e,t,n,i,a,r,o,s,l){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.translate=l,this.MappingType=Ni,this.qualityTypes=Ki,this.QualityTranslationsMap=li,this.convertorTypes=Object.values(ri),this.ConvertorTypeEnum=ri,this.ConvertorTypeTranslationsMap=pi,this.sourceTypes=Object.values(oi),this.OPCUaSourceTypes=Object.values(Fi),this.OPCUaSourceTypesEnum=Fi,this.sourceTypesEnum=oi,this.SourceTypeTranslationsMap=zi,this.requestTypes=Object.values(ci),this.RequestTypeEnum=ci,this.RequestTypesTranslationsMap=di,this.DeviceInfoType=Sa,this.ServerSideRPCType=Qi,this.MappingKeysType=Ui,this.MappingHintTranslationsMap=Zi,this.MappingTypeTranslationsMap=Li,this.DataConversionTranslationsMap=ui,this.HelpLinkByMappingTypeMap=Xi,this.ConnectorType=dt,this.ReportStrategyDefaultValue=on,this.keysPopupClosed=!0,this.destroy$=new we,this.createMappingForm()}get converterAttributes(){if(this.converterType)return this.mappingForm.get("converter").get(this.converterType).value.attributes.map((e=>e.key))}get converterTelemetry(){if(this.converterType)return this.mappingForm.get("converter").get(this.converterType).value.timeseries.map((e=>e.key))}get opcAttributes(){return this.mappingForm.get("attributes").value?.map((e=>e.key))||[]}get opcTelemetry(){return this.mappingForm.get("timeseries").value?.map((e=>e.key))||[]}get opcRpcMethods(){return this.mappingForm.get("rpc_methods").value?.map((e=>e.method))||[]}get opcAttributesUpdates(){return this.mappingForm.get("attributes_updates")?.value?.map((e=>e.key))||[]}get converterType(){return this.mappingForm.get("converter")?.get("type").value}get customKeys(){return Object.keys(this.mappingForm.get("converter").get("custom").value.extensionConfig)}get requestMappingType(){return this.mappingForm.get("requestType").value}get responseTimeoutErrorTooltip(){const e=this.mappingForm.get("requestValue.serverSideRpc.responseTimeout");return e.hasError("required")?this.translate.instant("gateway.response-timeout-required"):e.hasError("min")?this.translate.instant("gateway.response-timeout-limits-error",{min:1}):""}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}createMappingForm(){switch(this.data.mappingType){case Ni.DATA:this.mappingForm=this.fb.group({}),this.createDataMappingForm();break;case Ni.REQUESTS:this.mappingForm=this.fb.group({}),this.createRequestMappingForm();break;case Ni.OPCUA:this.createOPCUAMappingForm()}}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){this.mappingForm.valid&&this.dialogRef.close(this.prepareMappingData())}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))this.popoverService.hidePopover(i);else{const e=(this.data.mappingType!==Ni.OPCUA?this.mappingForm.get("converter").get(this.converterType):this.mappingForm).get(n),t={keys:e.value,keysType:n,rawData:this.mappingForm.get("converter.type")?.value===ri.BYTES,panelTitle:ji.get(n),addKeyTitle:Hi.get(n),deleteKeyTitle:Wi.get(n),noKeysText:$i.get(n),withReportStrategy:this.data.withReportStrategy,connectorType:this.data.mappingType===Ni.OPCUA?dt.OPCUA:dt.MQTT,convertorType:this.converterType};this.data.mappingType===Ni.OPCUA&&(t.valueTypeKeys=Object.values(Fi),t.valueTypeEnum=Fi,t.valueTypes=zi,t.sourceType=this.mappingForm.get("deviceNodeSource").value),this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,_K,"leftBottom",!1,null,t,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(Me(this.destroy$)).subscribe((t=>{this.popoverComponent.hide(),e.patchValue(t),e.markAsDirty()})),this.popoverComponent.tbHideStart.pipe(Me(this.destroy$)).subscribe((()=>{this.keysPopupClosed=!0}))}}prepareMappingData(){const e=this.mappingForm.value;switch(Y(e),this.data.mappingType){case Ni.DATA:const{converter:t,topicFilter:n,subscriptionQos:i}=e,{reportStrategy:a,...r}=t[t.type];return{topicFilter:n,subscriptionQos:i,...a?{reportStrategy:a}:{},converter:{type:t.type,...r}};case Ni.REQUESTS:return{requestType:e.requestType,requestValue:e.requestValue[e.requestType]};default:return e}}getFormValueData(){if(this.data.value&&Object.keys(this.data.value).length)switch(this.data.mappingType){case Ni.DATA:const{converter:e,topicFilter:t,subscriptionQos:n,reportStrategy:i}=this.data.value;return{topicFilter:t,subscriptionQos:n,converter:{type:e.type,[e.type]:{...e,...i?{reportStrategy:i}:{}}}};case Ni.REQUESTS:return{requestType:this.data.value.requestType,requestValue:{[this.data.value.requestType]:this.data.value.requestValue}};default:return this.data.value}}createDataMappingForm(){this.mappingForm.addControl("topicFilter",this.fb.control("",[me.required,me.pattern(pn)])),this.mappingForm.addControl("subscriptionQos",this.fb.control(0)),this.mappingForm.addControl("converter",this.fb.group({type:[ri.JSON,[]],json:this.fb.group({deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),bytes:this.fb.group({deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),custom:this.fb.group({extension:["",[me.required,me.pattern(pn)]],extensionConfig:[{},[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]})})),this.mappingForm.patchValue(this.getFormValueData()),this.mappingForm.get("converter.type").valueChanges.pipe(qe(this.mappingForm.get("converter.type").value),Me(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("converter");t.get("json").disable({emitEvent:!1}),t.get("bytes").disable({emitEvent:!1}),t.get("custom").disable({emitEvent:!1}),t.get(e).enable({emitEvent:!1})}))}createRequestMappingForm(){this.mappingForm.addControl("requestType",this.fb.control(ci.CONNECT_REQUEST,[])),this.mappingForm.addControl("requestValue",this.fb.group({connectRequests:this.fb.group({topicFilter:["",[me.required,me.pattern(pn)]],deviceInfo:[{},[]]}),disconnectRequests:this.fb.group({topicFilter:["",[me.required,me.pattern(pn)]],deviceInfo:[{},[]]}),attributeRequests:this.fb.group({topicFilter:["",[me.required,me.pattern(pn)]],deviceInfo:this.fb.group({deviceNameExpressionSource:[oi.MSG,[]],deviceNameExpression:["",[me.required]]}),attributeNameExpressionSource:[oi.MSG,[]],attributeNameExpression:["",[me.required,me.pattern(pn)]],topicExpression:["",[me.required,me.pattern(pn)]],valueExpression:["",[me.required,me.pattern(pn)]],retain:[!1,[]]}),attributeUpdates:this.fb.group({deviceNameFilter:["",[me.required,me.pattern(pn)]],attributeFilter:["",[me.required,me.pattern(pn)]],topicExpression:["",[me.required,me.pattern(pn)]],valueExpression:["",[me.required,me.pattern(pn)]],retain:[!0,[]]}),serverSideRpc:this.fb.group({type:[Qi.TWO_WAY,[]],deviceNameFilter:["",[me.required,me.pattern(pn)]],methodFilter:["",[me.required,me.pattern(pn)]],requestTopicExpression:["",[me.required,me.pattern(pn)]],responseTopicExpression:["",[me.required,me.pattern(pn)]],valueExpression:["",[me.required,me.pattern(pn)]],responseTopicQoS:[0,[]],responseTimeout:[1e4,[me.required,me.min(1)]]}),reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]})),this.mappingForm.get("requestType").valueChanges.pipe(qe(this.mappingForm.get("requestType").value),Me(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("requestValue");t.get("connectRequests").disable({emitEvent:!1}),t.get("disconnectRequests").disable({emitEvent:!1}),t.get("attributeRequests").disable({emitEvent:!1}),t.get("attributeUpdates").disable({emitEvent:!1}),t.get("serverSideRpc").disable({emitEvent:!1}),t.get(e).enable()})),this.mappingForm.get("requestValue.serverSideRpc.type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{const t=this.mappingForm.get("requestValue.serverSideRpc");e===Qi.ONE_WAY?(t.get("responseTopicExpression").disable({emitEvent:!1}),t.get("responseTopicQoS").disable({emitEvent:!1}),t.get("responseTimeout").disable({emitEvent:!1})):(t.get("responseTopicExpression").enable({emitEvent:!1}),t.get("responseTopicQoS").enable({emitEvent:!1}),t.get("responseTimeout").enable({emitEvent:!1}))})),this.mappingForm.patchValue(this.getFormValueData())}createOPCUAMappingForm(){this.mappingForm=this.fb.group({deviceNodeSource:[Fi.PATH,[]],deviceNodePattern:["",[me.required]],deviceInfo:[{},[]],attributes:[[],[]],timeseries:[[],[]],rpc_methods:[[],[]],attributes_updates:[[],[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.mappingForm.patchValue(this.getFormValueData())}static{this.ɵfac=function(e){return new(e||SY)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(le.TranslateService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:SY,selectors:[["tb-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:26,vars:19,consts:[["attributesButton",""],["telemetryButton",""],["keysButton",""],["opcAttributesButton",""],["opcTelemetryButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"key-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-hint","tb-primary-fill"],[3,"ngSwitch"],[3,"ngSwitchCase"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["matInput","","name","value","formControlName","topicFilter",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","subscriptionQos"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","converter"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[3,"formGroupName","ngSwitch"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],["class","tb-form-panel no-border no-padding",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["formControlName","deviceInfo","required","true",3,"convertorType","deviceInfoType"],["formControlName","deviceInfo","required","true",3,"deviceInfoType","convertorType","sourceTypes"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","name","value","formControlName","extension",3,"placeholder"],[1,"tb-form-row","space-between","same-padding","tb-flex","column"],["formControlName","requestType"],["formGroupName","requestValue"],[3,"formGroup","ngSwitch"],["class","tb-form-row column-xs",4,"ngIf"],["matInput","","name","value",3,"formControl","placeholder"],["formControlName","deviceInfo","required","true",3,"deviceInfoType"],["translate","",1,"tb-form-panel-title","tb-required"],["translate","",1,"tb-form-hint","tb-primary-fill"],["formGroupName","deviceInfo",1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-flex","no-flex","align-center"],["translate","",1,"tb-required"],[1,"flex","flex-1","gap-2"],[1,"flex","w-1/4"],["formControlName","deviceNameExpressionSource"],["matInput","","name","value","formControlName","deviceNameExpression",3,"placeholder"],["formControlName","attributeNameExpressionSource"],["matInput","","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matInput","","name","value","formControlName","valueExpression",3,"placeholder"],["matInput","","name","value","formControlName","topicExpression",3,"placeholder"],[1,"tb-form-row"],["formControlName","retain",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["matInput","","name","value","formControlName","deviceNameFilter",3,"placeholder"],["matInput","","name","value","formControlName","attributeFilter",3,"placeholder"],[1,"tb-flex","row","center","align-center","no-gap","fill-width"],["matInput","","name","value","formControlName","methodFilter",3,"placeholder"],["matInput","","name","value","formControlName","requestTopicExpression",3,"placeholder"],[4,"ngIf"],["matInput","","name","value","formControlName","responseTopicExpression",3,"placeholder"],["formControlName","responseTopicQoS"],["matInput","","name","value","type","number","min","1","formControlName","responseTimeout",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],[1,"device-node-row","tb-form-row","column-xs","pr-4"],["translate","",1,"tb-flex","no-flex","align-center","w-1/5"],[1,"tb-required",3,"tb-hint-tooltip-icon"],[1,"flex","w-1/5"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","deviceNodeSource"],["matInput","","name","value","formControlName","deviceNodePattern",3,"placeholder"],["formControlName","deviceInfo","required","true",3,"connectorType","sourceTypes","deviceInfoType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",7)(1,"mat-toolbar",8)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",9)(6,"div",10),t.ɵɵelementStart(7,"button",11),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",12),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",13)(11,"div",14)(12,"div",15),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(15,16),t.ɵɵtemplate(16,VK,34,25,"ng-template",17)(17,mY,14,9,"ng-template",17)(18,wY,70,45,"ng-template",17),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",18)(20,"button",19),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"button",20),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,11,n.MappingTypeTranslationsMap.get(null==n.data?null:n.data.mappingType))),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.HelpLinkByMappingTypeMap.get(n.data.mappingType)),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,13,n.MappingHintTranslationsMap.get(null==n.data?null:n.data.mappingType))," "),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.data.mappingType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.MappingType.OPCUA),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(22,15,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingForm.invalid||!n.mappingForm.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,17,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(SY,[se,_,m$,$n,A$,ai,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .key-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .key-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center;flex-wrap:nowrap}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .device-node-row.tb-form-row{gap:12px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}']})}}e("MappingDialogComponent",SY);const CY=["searchInput"],_Y=()=>({minWidth:"96px",textAlign:"center"});function TY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",24)(2,"span",25),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,e.mappingTypeTranslationsMap.get(e.mappingType))),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search"))}}function IY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-header-cell",29),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext();t.ɵɵclassProp("request-column",n.mappingType===n.mappingTypeEnum.REQUESTS),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,3,e.title)," ")}}function EY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext().$implicit,a=t.ɵɵnextContext();t.ɵɵclassProp("request-column",a.mappingType===a.mappingTypeEnum.REQUESTS),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e[i.def]," ")}}function MY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,26),t.ɵɵtemplate(1,IY,3,5,"mat-header-cell",27)(2,EY,2,3,"mat-cell",28),t.ɵɵelementContainerEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("matColumnDef",e.def)}}function kY(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",31)}function PY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function DY(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,PY,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",32),t.ɵɵelementContainer(4,33),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",34)(6,"button",35),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",36),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",37,2),t.ɵɵelementContainer(11,33),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,_Y)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function OY(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",38)}function AY(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class FY{set mappingType(e){this.mappingTypeValue!==e&&(this.mappingTypeValue=e)}get mappingType(){return this.mappingTypeValue}constructor(e,t,n,i){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.required=!1,this.withReportStrategy=!0,this.mappingTypeTranslationsMap=Li,this.mappingTypeEnum=Ni,this.displayedColumns=[],this.mappingColumns=[],this.textSearchMode=!1,this.hidePageSize=!1,this.activeValue=!1,this.dirtyValue=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.onChange=()=>{},this.onTouched=()=>{},this.destroy$=new we,this.mappingFormGroup=this.fb.array([]),this.dirtyValue=!this.activeValue,this.dataSource=new RY}ngOnInit(){this.setMappingColumns(),this.displayedColumns.push(...this.mappingColumns.map((e=>e.def)),"actions"),this.mappingFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateTableData(e),this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(De(150),Pe(((e,t)=>(e??"")===t.trim())),Me(this.destroy$)).subscribe((e=>{const t=e.trim();this.updateTableData(this.mappingFormGroup.value,t.trim())}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.mappingFormGroup.clear(),this.pushDataAsFormArrays(e)}validate(){return!this.required||this.mappingFormGroup.controls.length?null:{mappingFormGroup:{valid:!1}}}enterFilterMode(){this.textSearchMode=!0,setTimeout((()=>{this.searchInputField.nativeElement.focus(),this.searchInputField.nativeElement.setSelectionRange(0,0)}),10)}exitFilterMode(){this.updateTableData(this.mappingFormGroup.value),this.textSearchMode=!1,this.textSearch.reset()}manageMapping(e,t){e&&e.stopPropagation();const n=J(t)?this.mappingFormGroup.at(t).value:{};this.dialog.open(SY,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{mappingType:this.mappingType,value:n,buttonTitle:ne(t)?"action.add":"action.apply",withReportStrategy:this.withReportStrategy}}).afterClosed().pipe(Ne(1),Me(this.destroy$)).subscribe((e=>{e&&(J(t)?this.mappingFormGroup.at(t).patchValue(e):this.pushDataAsFormArrays([e]),this.mappingFormGroup.markAsDirty())}))}updateTableData(e,t){let n=e.map((e=>this.getMappingValue(e)));t&&(n=n.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(n)}deleteMapping(e,t){e&&e.stopPropagation();const n=this.mappingFormGroup.controls[t].value,i=n.deviceInfo?.deviceNameExpression??n.topicFilter??this.getRequestDetails(n);this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:i}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).subscribe((e=>{e&&(this.mappingFormGroup.removeAt(t),this.mappingFormGroup.markAsDirty())}))}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.mappingFormGroup.push(this.fb.control(e))))}getMappingValue(e){switch(this.mappingType){case Ni.DATA:const t=pi.get(e.converter?.type);return{topicFilter:e.topicFilter,QoS:e.subscriptionQos,converter:t?this.translate.instant(t):""};case Ni.REQUESTS:return{requestType:e.requestType,type:this.translate.instant(di.get(e.requestType)),details:this.getRequestDetails(e)};case Ni.OPCUA:const n=e.deviceInfo?.deviceNameExpression,i=e.deviceInfo?.deviceProfileExpression,{deviceNodePattern:a}=e;return{deviceNodePattern:a,deviceNamePattern:n,deviceProfileExpression:i};default:return{}}}getRequestDetails(e){let t;return t=e.requestType===ci.ATTRIBUTE_UPDATE?e.requestValue.attributeFilter:e.requestType===ci.SERVER_SIDE_RPC?e.requestValue.methodFilter:e.requestValue.topicFilter,t}setMappingColumns(){switch(this.mappingType){case Ni.DATA:this.mappingColumns.push({def:"topicFilter",title:"gateway.topic-filter"},{def:"QoS",title:"gateway.mqtt-qos"},{def:"converter",title:"gateway.payload-type"});break;case Ni.REQUESTS:this.mappingColumns.push({def:"type",title:"gateway.type"},{def:"details",title:"gateway.details"});break;case Ni.OPCUA:this.mappingColumns.push({def:"deviceNodePattern",title:"gateway.device-node"},{def:"deviceNamePattern",title:"gateway.device-name"},{def:"deviceProfileExpression",title:"gateway.device-profile"})}}static{this.ɵfac=function(e){return new(e||FY)(t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:FY,selectors:[["tb-mapping-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(CY,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{required:"required",withReportStrategy:"withReportStrategy",mappingType:"mappingType"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>FY)),multi:!0},{provide:he,useExisting:c((()=>FY)),multi:!0}]),t.ɵɵStandaloneFeature],decls:40,vars:33,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-mapping-table","tb-absolute-fill"],[1,"tb-mapping-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-mapping-table-title"],[3,"matColumnDef"],["class","table-value-column",3,"request-column",4,"matHeaderCellDef"],["tbTruncateWithTooltip","","class","table-value-column",3,"request-column",4,"matCellDef"],[1,"table-value-column"],["tbTruncateWithTooltip","",1,"table-value-column"],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,TY,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵtemplate(23,MY,3,1,"ng-container",14),t.ɵɵelementContainerStart(24,15),t.ɵɵtemplate(25,kY,1,0,"mat-header-cell",16)(26,DY,12,6,"mat-cell",17),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(27,OY,1,0,"mat-header-row",18)(28,AY,1,0,"mat-row",19),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"section",20),t.ɵɵpipe(30,"async"),t.ɵɵelementStart(31,"button",21),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(32,"mat-icon",22),t.ɵɵtext(33,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"span"),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(37,"span",23),t.ɵɵpipe(38,"async"),t.ɵɵtext(39," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,19,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,21,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,23,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,25,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.mappingColumns),t.ɵɵadvance(4),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(30,27,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,29,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(38,31,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(FY,[se,_,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content.tb-outlined-border[_ngcontent-%COMP%]{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f;border:solid 1px #e0e0e0;border-radius:4px}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .tb-mapping-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:21%}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column.request-column[_ngcontent-%COMP%]{width:35%}[_nghost-%COMP%] .tb-mapping-table[_ngcontent-%COMP%] .tb-mapping-table-content[_ngcontent-%COMP%] .ellipsis[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-mapping-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("MappingTableComponent",FY),He([I()],FY.prototype,"required",void 0),He([I()],FY.prototype,"withReportStrategy",void 0);let RY=class extends G{constructor(){super()}};function BY(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",7),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SecurityTypeTranslationsMap.get(e))," ")}}function NY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",18),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function LY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",8)(1,"div",9),t.ɵɵtext(2,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",10)(4,"mat-form-field",11),t.ɵɵelement(5,"input",12),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,NY,3,3,"mat-icon",13),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",8)(9,"div",14),t.ɵɵtext(10,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",10)(12,"mat-form-field",11),t.ɵɵelement(13,"input",15),t.ɵɵpipe(14,"translate"),t.ɵɵelementStart(15,"div",16),t.ɵɵelement(16,"tb-toggle-password",17),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,3,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,5,"gateway.set"))}}function VY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",7),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e," ")}}function qY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",18),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.username-required"))}function GY(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",8)(2,"div",14),t.ɵɵtext(3,"gateway.mode"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",10)(5,"mat-form-field",11)(6,"mat-select",25),t.ɵɵtemplate(7,VY,2,2,"mat-option",4),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(8,"div",8)(9,"div",14),t.ɵɵtext(10,"gateway.username"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",10)(12,"mat-form-field",11),t.ɵɵelement(13,"input",12),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,qY,3,3,"mat-icon",13),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",8)(17,"div",14),t.ɵɵtext(18,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",10)(20,"mat-form-field",11),t.ɵɵelement(21,"input",15),t.ɵɵpipe(22,"translate"),t.ɵɵelementStart(23,"div",16),t.ɵɵelement(24,"tb-toggle-password",17),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",e.modeTypes),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,4,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.securityFormGroup.get("username").hasError("required")&&e.securityFormGroup.get("username").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,6,"gateway.set"))}}function zY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",19),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",8)(4,"div",20),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",10)(8,"mat-form-field",11),t.ɵɵelement(9,"input",21),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",8)(12,"div",20),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"div",10)(16,"mat-form-field",11),t.ɵɵelement(17,"input",22),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",8)(20,"div",20),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"div",10)(24,"mat-form-field",11),t.ɵɵelement(25,"input",23),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(27,GY,25,8,"ng-container",24)),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,8,"gateway.path-hint")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,10,"gateway.CA-certificate-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(10,12,"gateway.set")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(14,14,"gateway.private-key-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(18,16,"gateway.set")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,18,"gateway.client-cert-path")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.mode()===e.SecurityMode.extendedCertificates)}}e("MappingDatasource",RY);class UY{constructor(e,t){this.fb=e,this.cdr=t,this.title="gateway.security",this.mode=l(Ji.certificates),this.BrokerSecurityType=Ri,this.SecurityMode=Ji,this.securityTypes=Object.values(Ri),this.modeTypes=Object.values(Bi),this.SecurityTypeTranslationsMap=Gi,this.destroy$=new we,o((()=>{this.mode()===Ji.basic&&(this.securityTypes=this.securityTypes.filter((e=>e!==Ri.CERTIFICATES)))}))}ngOnInit(){this.securityFormGroup=this.fb.group({type:[Ri.ANONYMOUS,[]],username:["",[me.required,me.pattern(pn)]],password:["",[me.pattern(pn)]],pathToCACert:["",[me.pattern(pn)]],pathToPrivateKey:["",[me.pattern(pn)]],pathToClientCert:["",[me.pattern(pn)]]}),this.mode()===Ji.extendedCertificates&&this.securityFormGroup.addControl("mode",this.fb.control(Bi.NONE,[])),this.securityFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{Y(e),this.onChange(e),this.onTouched()})),this.securityFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateValidators(e)))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}writeValue(e){if(e)e.type||(e.type=Ri.ANONYMOUS),this.updateValidators(e.type),this.securityFormGroup.reset(e,{emitEvent:!1});else{const e={type:Ri.ANONYMOUS};this.securityFormGroup.reset(e,{emitEvent:!1})}this.cdr.markForCheck()}validate(){return this.securityFormGroup.get("type").value!==Ri.BASIC||this.securityFormGroup.valid?null:{securityForm:{valid:!1}}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}updateValidators(e){if(e)if(this.securityFormGroup.get("username").disable({emitEvent:!1}),this.securityFormGroup.get("password").disable({emitEvent:!1}),this.securityFormGroup.get("pathToCACert").disable({emitEvent:!1}),this.securityFormGroup.get("pathToPrivateKey").disable({emitEvent:!1}),this.securityFormGroup.get("pathToClientCert").disable({emitEvent:!1}),this.securityFormGroup.get("mode")?.disable({emitEvent:!1}),e===Ri.BASIC)this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1});else if(e===Ri.CERTIFICATES&&(this.securityFormGroup.get("pathToCACert").enable({emitEvent:!1}),this.securityFormGroup.get("pathToPrivateKey").enable({emitEvent:!1}),this.securityFormGroup.get("pathToClientCert").enable({emitEvent:!1}),this.mode()===Ji.extendedCertificates)){const e=this.securityFormGroup.get("mode");e&&!e.value&&e.setValue(Bi.NONE,{emitEvent:!1}),e?.enable({emitEvent:!1}),this.securityFormGroup.get("username").enable({emitEvent:!1}),this.securityFormGroup.get("password").enable({emitEvent:!1})}}static{this.ɵfac=function(e){return new(e||UY)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:UY,selectors:[["tb-security-config"]],inputs:{title:"title",mode:[1,"mode"]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>UY)),multi:!0},{provide:he,useExisting:c((()=>UY)),multi:!0}]),t.ɵɵStandaloneFeature],decls:10,vars:8,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],[1,"fixed-title-width","tb-required"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"ngSwitchCase"],[3,"value"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","username",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width"],["matInput","","type","password","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"tb-form-hint","tb-primary-fill"],["tbTruncateWithTooltip","",1,"fixed-title-width"],["matInput","","name","value","formControlName","pathToCACert",3,"placeholder"],["matInput","","name","value","formControlName","pathToPrivateKey",3,"placeholder"],["matInput","","name","value","formControlName","pathToClientCert",3,"placeholder"],[4,"ngIf"],["formControlName","mode"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",3),t.ɵɵtemplate(6,BY,3,4,"tb-toggle-option",4),t.ɵɵelementEnd()(),t.ɵɵelementContainerStart(7,5),t.ɵɵtemplate(8,LY,17,7,"ng-template",6)(9,zY,28,22,"ng-template",6),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,6,n.title)),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.securityTypes),t.ɵɵadvance(),t.ɵɵproperty("ngSwitch",n.securityFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.BrokerSecurityType.BASIC),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.BrokerSecurityType.CERTIFICATES))},dependencies:t.ɵɵgetComponentDepsFactory(UY,[se,_,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}'],changeDetection:d.OnPush})}}e("SecurityConfigComponent",UY);const jY=()=>({min:1e3}),HY=()=>({min:50}),WY=()=>({min:100});function $Y(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.server-url-required"))}function KY(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",9),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.timeout-error",t.ɵɵpureFunction0(4,jY)))}function YY(e,n){1&e&&(t.ɵɵelementStart(0,"span",10),t.ɵɵtext(1,"gateway.suffix.ms"),t.ɵɵelementEnd())}function XY(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",22),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.value),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name)}}function ZY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.scan-period-error",t.ɵɵpureFunction0(4,jY)))}function QY(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.poll-period-error",t.ɵɵpureFunction0(4,HY)))}function JY(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",6),t.ɵɵpipe(2,"translate"),t.ɵɵelementStart(3,"div",7),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"mat-form-field",3),t.ɵɵelement(7,"input",23),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,QY,3,5,"mat-icon",5),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,4,"gateway.hints.poll-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,6,"gateway.poll-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.serverConfigFormGroup.get("pollPeriodInMillis").hasError("required")||e.serverConfigFormGroup.get("pollPeriodInMillis").hasError("min"))&&e.serverConfigFormGroup.get("pollPeriodInMillis").touched)}}function eX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind2(1,1,"gateway.sub-check-period-error",t.ɵɵpureFunction0(4,WY)))}class tX{constructor(e){this.fb=e,this.hideNewFields=!1,this.securityPolicyTypes=qi,this.SecurityMode=Ji,this.destroy$=new we,this.serverConfigFormGroup=this.fb.group({url:["",[me.required,me.pattern(pn)]],timeoutInMillis:[1e3,[me.required,me.min(1e3)]],scanPeriodInMillis:[z,[me.required,me.min(1e3)]],pollPeriodInMillis:[5e3,[me.required,me.min(50)]],enableSubscriptions:[!0,[]],subCheckPeriodInMillis:[100,[me.required,me.min(100)]],showMap:[!1,[]],security:[Vi.BASIC128,[]],identity:[]}),this.serverConfigFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngAfterViewInit(){this.hideNewFields&&this.serverConfigFormGroup.get("pollPeriodInMillis").disable({emitEvent:!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.serverConfigFormGroup.valid?null:{serverConfigFormGroup:{valid:!1}}}writeValue(e){const{timeoutInMillis:t=1e3,scanPeriodInMillis:n=z,pollPeriodInMillis:i=5e3,enableSubscriptions:a=!0,subCheckPeriodInMillis:r=100,showMap:o=!1,security:s=Vi.BASIC128,identity:l={}}=e;this.serverConfigFormGroup.reset({...e,timeoutInMillis:t,scanPeriodInMillis:n,pollPeriodInMillis:i,enableSubscriptions:a,subCheckPeriodInMillis:r,showMap:o,security:s,identity:l},{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||tX)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:tX,selectors:[["tb-opc-server-config"]],inputs:{hideNewFields:"hideNewFields"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>tX)),multi:!0},{provide:he,useExisting:c((()=>tX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:63,vars:56,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["tbTruncateWithTooltip","","translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","url",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip",""],["matInput","","type","number","min","1000","name","value","formControlName","timeoutInMillis",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],["formControlName","security"],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","number","min","1000","name","value","formControlName","scanPeriodInMillis",3,"placeholder"],["class","tb-form-row column-xs",4,"ngIf"],["matInput","","type","number","min","100","name","value","formControlName","subCheckPeriodInMillis",3,"placeholder"],[1,"tb-form-row"],["formControlName","enableSubscriptions",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","showMap",1,"mat-slide"],["formControlName","identity",3,"mode"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["matInput","","type","number","min","50","name","value","formControlName","pollPeriodInMillis",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.server-url"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",3),t.ɵɵelement(5,"input",4),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,$Y,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",6),t.ɵɵpipe(10,"translate"),t.ɵɵelementStart(11,"div",7),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-form-field",3),t.ɵɵelement(15,"input",8),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,KY,2,5,"tb-error-icon",9)(18,YY,2,0,"span",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",1)(20,"div",6),t.ɵɵpipe(21,"translate"),t.ɵɵelementStart(22,"div",7),t.ɵɵtext(23),t.ɵɵpipe(24,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(25,"mat-form-field",3)(26,"mat-select",11),t.ɵɵtemplate(27,XY,2,2,"mat-option",12),t.ɵɵelementEnd()()(),t.ɵɵelementStart(28,"div",1)(29,"div",6),t.ɵɵpipe(30,"translate"),t.ɵɵelementStart(31,"div",7),t.ɵɵtext(32),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"mat-form-field",3),t.ɵɵelement(35,"input",13),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,ZY,3,5,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵtemplate(38,JY,10,10,"div",14),t.ɵɵelementStart(39,"div",1)(40,"div",6),t.ɵɵpipe(41,"translate"),t.ɵɵelementStart(42,"div",7),t.ɵɵtext(43),t.ɵɵpipe(44,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"mat-form-field",3),t.ɵɵelement(46,"input",15),t.ɵɵpipe(47,"translate"),t.ɵɵtemplate(48,eX,3,5,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(49,"div",16)(50,"mat-slide-toggle",17)(51,"mat-label",18),t.ɵɵpipe(52,"translate"),t.ɵɵelementStart(53,"div",7),t.ɵɵtext(54),t.ɵɵpipe(55,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(56,"div",16)(57,"mat-slide-toggle",19)(58,"mat-label",18),t.ɵɵpipe(59,"translate"),t.ɵɵtext(60),t.ɵɵpipe(61,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelement(62,"tb-security-config",20),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.serverConfigFormGroup),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.serverConfigFormGroup.get("url").hasError("required")&&n.serverConfigFormGroup.get("url").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,26,"gateway.hints.opc-timeout")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,28,"gateway.timeout")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,30,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((n.serverConfigFormGroup.get("timeoutInMillis").hasError("required")||n.serverConfigFormGroup.get("timeoutInMillis").hasError("min"))&&n.serverConfigFormGroup.get("timeoutInMillis").touched?17:18),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,32,"gateway.hints.security-policy")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(24,34,"gateway.security-policy")),t.ɵɵadvance(4),t.ɵɵproperty("ngForOf",n.securityPolicyTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(30,36,"gateway.hints.scan-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(33,38,"gateway.scan-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,40,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.serverConfigFormGroup.get("scanPeriodInMillis").hasError("required")||n.serverConfigFormGroup.get("scanPeriodInMillis").hasError("min"))&&n.serverConfigFormGroup.get("scanPeriodInMillis").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.hideNewFields),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(41,42,"gateway.hints.sub-check-period")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(44,44,"gateway.sub-check-period")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(47,46,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.serverConfigFormGroup.get("subCheckPeriodInMillis").hasError("required")||n.serverConfigFormGroup.get("subCheckPeriodInMillis").hasError("min"))&&n.serverConfigFormGroup.get("subCheckPeriodInMillis").touched),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(52,48,"gateway.hints.enable-subscription")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(55,50,"gateway.enable-subscription")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(59,52,"gateway.hints.show-map")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(61,54,"gateway.show-map")," "),t.ɵɵadvance(2),t.ɵɵproperty("mode",n.SecurityMode.extendedCertificates))},dependencies:t.ɵɵgetComponentDepsFactory(tX,[se,_,UY,Wn,ai]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}'],changeDetection:d.OnPush})}}e("OpcServerConfigComponent",tX),He([I()],tX.prototype,"hideNewFields",void 0);class nX extends Ua{constructor(){super(...arguments),this.withReportStrategy=!0,this.mappingTypes=Ni,this.isLegacy=!0}initBasicFormGroup(){return this.fb.group({mapping:[],server:[]})}mapConfigToFormValue(e){let t;return t=e?.server&&"mapping"in e?.server?Za.mapMappingToUpgradedVersion(e.server.mapping):e&&"mapping"in e?Za.mapMappingToCurrentVersion(e.mapping):[],{server:e.server?Za.mapServerToUpgradedVersion(e.server):{},mapping:t}}getMappedValue(e){return{server:Za.mapServerToDowngradedVersion(e)}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(nX)))(n||nX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:nX,selectors:[["tb-opc-ua-legacy-basic-config"]],inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>nX)),multi:!0},{provide:he,useExisting:c((()=>nX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server",3,"hideNewFields"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"required","withReportStrategy","mappingType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-opc-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,11,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,13,"gateway.server"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("hideNewFields",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,15,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("required",!0)("withReportStrategy",n.withReportStrategy)("mappingType",n.mappingTypes.OPCUA))},dependencies:t.ɵɵgetComponentDepsFactory(nX,[se,_,FY,tX]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("OpcUaLegacyBasicConfigComponent",nX),He([I()],nX.prototype,"withReportStrategy",void 0);class iX extends Ua{constructor(){super(...arguments),this.withReportStrategy=!0,this.mappingTypes=Ni,this.isLegacy=!1}initBasicFormGroup(){return this.fb.group({mapping:[],server:[]})}mapConfigToFormValue(e){return{server:e.server??{},mapping:e.mapping??[]}}getMappedValue(e){return{server:e.server,mapping:e.mapping}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(iX)))(n||iX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:iX,selectors:[["tb-opc-ua-basic-config"]],inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>iX)),multi:!0},{provide:he,useExisting:c((()=>iX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server",3,"hideNewFields"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"required","withReportStrategy","mappingType"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-opc-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,11,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,13,"gateway.server"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("hideNewFields",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,15,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("required",!0)("withReportStrategy",n.withReportStrategy)("mappingType",n.mappingTypes.OPCUA))},dependencies:t.ɵɵgetComponentDepsFactory(iX,[se,_,UY,FY,tX]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("OpcUaBasicConfigComponent",iX),He([I()],iX.prototype,"withReportStrategy",void 0);class aX extends Ua{constructor(){super(...arguments),this.withReportStrategy=!0,this.MappingType=Ni}initBasicFormGroup(){return this.fb.group({mapping:[],requestsMapping:[],broker:[],workers:[]})}getRequestDataArray(e){const t=[];return ie(e)&&Object.keys(e).forEach((n=>{for(const i of e[n])t.push({requestType:n,requestValue:i})})),t}getRequestDataObject(e){return e.reduce(((e,{requestType:t,requestValue:n})=>(e[t].push(n),e)),{connectRequests:[],disconnectRequests:[],attributeRequests:[],attributeUpdates:[],serverSideRpc:[]})}getBrokerMappedValue(e,t){return{...e,maxNumberOfWorkers:t.maxNumberOfWorkers??100,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker??10}}writeValue(e){this.basicFormGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(aX)))(n||aX)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:aX,inputs:{withReportStrategy:"withReportStrategy"},features:[t.ɵɵInheritDefinitionFeature]})}}function rX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",8),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.max-number-of-workers-required"))}function oX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",8),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.max-messages-queue-for-worker-required"))}e("MqttBasicConfigDirective",aX),He([I()],aX.prototype,"withReportStrategy",void 0);class sX{constructor(e){this.fb=e,this.destroy$=new we,this.workersConfigFormGroup=this.fb.group({maxNumberOfWorkers:[100,[me.required,me.min(1)]],maxMessageNumberPerWorker:[10,[me.required,me.min(1)]]}),this.workersConfigFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){const{maxNumberOfWorkers:t,maxMessageNumberPerWorker:n}=e;this.workersConfigFormGroup.reset({maxNumberOfWorkers:t||100,maxMessageNumberPerWorker:n||10},{emitEvent:!1})}validate(){return this.workersConfigFormGroup.valid?null:{workersConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||sX)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:sX,selectors:[["tb-workers-config-control"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>sX)),multi:!0},{provide:he,useExisting:c((()=>sX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:21,vars:21,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",2,"width","50%",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip",""],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","type","number","min","1","formControlName","maxNumberOfWorkers",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","name","value","type","number","min","1","formControlName","maxMessageNumberPerWorker",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"div",3),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"mat-form-field",4),t.ɵɵelement(8,"input",5),t.ɵɵpipe(9,"translate"),t.ɵɵtemplate(10,rX,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"div",1)(12,"div",2),t.ɵɵpipe(13,"translate"),t.ɵɵelementStart(14,"div",3),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"mat-form-field",4),t.ɵɵelement(18,"input",7),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,oX,3,3,"mat-icon",6),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.workersConfigFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,9,"gateway.max-number-of-workers-hint")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,11,"gateway.max-number-of-workers")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(9,13,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.workersConfigFormGroup.get("maxNumberOfWorkers").hasError("min")||n.workersConfigFormGroup.get("maxNumberOfWorkers").hasError("required")&&n.workersConfigFormGroup.get("maxNumberOfWorkers").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(13,15,"gateway.max-messages-queue-for-worker-hint")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,17,"gateway.max-messages-queue-for-worker")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,19,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.workersConfigFormGroup.get("maxMessageNumberPerWorker").hasError("min")||n.workersConfigFormGroup.get("maxMessageNumberPerWorker").hasError("required")&&n.workersConfigFormGroup.get("maxMessageNumberPerWorker").touched))},dependencies:t.ɵɵgetComponentDepsFactory(sX,[se,_,Wn]),encapsulation:2,changeDetection:d.OnPush})}}function lX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",13),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function pX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",13),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.brokerConfigFormGroup.get("port")))}}function cX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",14),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.value),t.ɵɵadvance(),t.ɵɵtextInterpolate(e.name)}}function dX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",15),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("clientId"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.generate-client-id"))}e("WorkersConfigControlComponent",sX);class uX{constructor(e,t){this.fb=e,this.cdr=t,this.mqttVersions=si,this.portLimits=Oi,this.destroy$=new we,this.brokerConfigFormGroup=this.fb.group({host:["",[me.required,me.pattern(pn)]],port:[null,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],version:[5,[]],clientId:["tb_gw_"+ae(5),[me.pattern(pn)]],security:[]}),this.brokerConfigFormGroup.valueChanges.subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}generate(e){this.brokerConfigFormGroup.get(e)?.patchValue("tb_gw_"+ae(5))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){const{version:t=5,clientId:n=`tb_gw_${ae(5)}`,security:i={}}=e;this.brokerConfigFormGroup.reset({...e,version:t,clientId:n,security:i},{emitEvent:!1}),this.cdr.markForCheck()}validate(){return this.brokerConfigFormGroup.valid?null:{brokerConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||uX)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:uX,selectors:[["tb-broker-config-control"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>uX)),multi:!0},{provide:he,useExisting:c((()=>uX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:29,vars:16,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["translate","",1,"fixed-title-width"],["formControlName","version"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","value","formControlName","clientId",3,"placeholder"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip","click",4,"ngIf"],["formControlName","security"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",3),t.ɵɵelement(5,"input",4),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,lX,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",2),t.ɵɵtext(10,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",3),t.ɵɵelement(12,"input",6),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,pX,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"div",1)(16,"div",7),t.ɵɵtext(17,"gateway.mqtt-version"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"mat-form-field",3)(19,"mat-select",8),t.ɵɵtemplate(20,cX,2,2,"mat-option",9),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",1)(22,"div",7),t.ɵɵtext(23,"gateway.client-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(24,"mat-form-field",3),t.ɵɵelement(25,"input",10),t.ɵɵpipe(26,"translate"),t.ɵɵtemplate(27,dX,4,3,"button",11),t.ɵɵelementEnd()(),t.ɵɵelement(28,"tb-security-config",12),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.brokerConfigFormGroup),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.brokerConfigFormGroup.get("host").hasError("required")&&n.brokerConfigFormGroup.get("host").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,12,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.brokerConfigFormGroup.get("port").hasError("required")||n.brokerConfigFormGroup.get("port").hasError("min")||n.brokerConfigFormGroup.get("port").hasError("max"))&&n.brokerConfigFormGroup.get("port").touched),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.mqttVersions),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(26,14,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",!n.brokerConfigFormGroup.get("clientId").value))},dependencies:t.ɵɵgetComponentDepsFactory(uX,[se,_,UY,u$]),encapsulation:2,changeDetection:d.OnPush})}}e("BrokerConfigControlComponent",uX);class mX extends aX{mapConfigToFormValue(e){const{broker:t,mapping:n=[],requestsMapping:i}=e;return{workers:t&&(t.maxNumberOfWorkers||t.maxMessageNumberPerWorker)?{maxNumberOfWorkers:t.maxNumberOfWorkers,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker}:{},mapping:n??[],broker:t??{},requestsMapping:this.getRequestDataArray(i)}}getMappedValue(e){const{broker:t,workers:n,mapping:i,requestsMapping:a}=e||{};return{broker:this.getBrokerMappedValue(t,n),mapping:i,requestsMapping:a?.length?this.getRequestDataObject(a):{}}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(mX)))(n||mX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:mX,selectors:[["tb-mqtt-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>mX)),multi:!0},{provide:he,useExisting:c((()=>mX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:24,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","broker"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"withReportStrategy","required","mappingType"],["formControlName","requestsMapping",3,"withReportStrategy","mappingType"],[1,"tb-form-panel","no-border","no-padding"],["formControlName","workers"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-broker-config-control",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",1),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"div",4),t.ɵɵelement(14,"tb-mapping-table",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-tab",1),t.ɵɵpipe(16,"translate"),t.ɵɵelementStart(17,"div",7),t.ɵɵelement(18,"tb-workers-config-control",8),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,14,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,16,"gateway.broker.connection"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,18,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("required",!0)("mappingType",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,20,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("mappingType",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(16,22,"gateway.workers-settings")))},dependencies:t.ɵɵgetComponentDepsFactory(mX,[se,_,sX,uX,FY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("MqttBasicConfigComponent",mX);class hX extends aX{mapConfigToFormValue(e){const{broker:t,mapping:n=[],connectRequests:i=[],disconnectRequests:a=[],attributeRequests:r=[],attributeUpdates:o=[],serverSideRpc:s=[]}=e,l=Na.mapRequestsToUpgradedVersion({connectRequests:i,disconnectRequests:a,attributeRequests:r,attributeUpdates:o,serverSideRpc:s});return{workers:t&&(t.maxNumberOfWorkers||t.maxMessageNumberPerWorker)?{maxNumberOfWorkers:t.maxNumberOfWorkers,maxMessageNumberPerWorker:t.maxMessageNumberPerWorker}:{},mapping:Na.mapMappingToUpgradedVersion(n)||[],broker:t||{},requestsMapping:this.getRequestDataArray(l)}}getMappedValue(e){const{broker:t,workers:n,mapping:i,requestsMapping:a}=e||{},r=a?.length?this.getRequestDataObject(a):{};return{broker:this.getBrokerMappedValue(t,n),mapping:Na.mapMappingToDowngradedVersion(i),...Na.mapRequestsToDowngradedVersion(r)}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(hX)))(n||hX)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:hX,selectors:[["tb-mqtt-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>hX)),multi:!0},{provide:he,useExisting:c((()=>hX)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:24,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","broker"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","mapping",3,"withReportStrategy","required","mappingType"],["formControlName","requestsMapping",3,"withReportStrategy","mappingType"],[1,"tb-form-panel","no-border","no-padding"],["formControlName","workers"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-broker-config-control",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-mapping-table",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",1),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"div",4),t.ɵɵelement(14,"tb-mapping-table",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-tab",1),t.ɵɵpipe(16,"translate"),t.ɵɵelementStart(17,"div",7),t.ɵɵelement(18,"tb-workers-config-control",8),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,14,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,16,"gateway.broker.connection"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,18,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("required",!0)("mappingType",n.MappingType.DATA),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,20,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("withReportStrategy",n.withReportStrategy)("mappingType",n.MappingType.REQUESTS),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(16,22,"gateway.workers-settings")))},dependencies:t.ɵɵgetComponentDepsFactory(hX,[se,_,sX,uX,FY]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("MqttLegacyBasicConfigComponent",hX);class gX extends A{constructor(e,t,n,i,a){super(t,n,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a,this.portLimits=Oi,this.modbusProtocolTypes=Object.values(ea),this.modbusMethodTypes=Object.values(ta),this.modbusSerialMethodTypes=Object.values(na),this.modbusParities=Object.values(ia),this.modbusByteSizes=la,this.modbusBaudrates=sa,this.modbusOrderType=Object.values(aa),this.ModbusProtocolType=ea,this.ModbusParityLabelsMap=ga,this.ModbusProtocolLabelsMap=ha,this.ModbusMethodLabelsMap=ma,this.ReportStrategyDefaultValue=on,this.modbusHelpLink=O+"/docs/iot-gateway/config/modbus/#section-master-description-and-configuration-parameters",this.serialSpecificControlKeys=["serialPort","baudrate","stopbits","bytesize","parity","strict"],this.tcpUdpSpecificControlKeys=["port","security","host"],this.destroy$=new we,this.showSecurityControl=this.fb.control(!1),this.initializeSlaveFormGroup(),this.updateSlaveFormGroup(),this.updateControlsEnabling(this.data.value.type),this.observeTypeChange(),this.observeShowSecurity(),this.showSecurityControl.patchValue(!!this.data.value.security&&!W(this.data.value.security,{}))}get protocolType(){return this.slaveConfigFormGroup.get("type").value}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}cancel(){this.dialogRef.close(null)}add(){this.slaveConfigFormGroup.valid&&this.dialogRef.close(this.getSlaveResultData())}initializeSlaveFormGroup(){this.slaveConfigFormGroup=this.fb.group({type:[ea.TCP],host:["",[me.required,me.pattern(pn)]],port:[null,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],serialPort:["",[me.required,me.pattern(pn)]],method:[ta.SOCKET,[me.required]],baudrate:[this.modbusBaudrates[0]],stopbits:[1],bytesize:[la[0]],parity:[ia.None],strict:[!0],unitId:[null,[me.required]],deviceName:["",[me.required,me.pattern(pn)]],deviceType:["",[me.required,me.pattern(pn)]],timeout:[35],byteOrder:[aa.BIG],wordOrder:[aa.BIG],retries:[pa],retryOnEmpty:[!0],retryOnInvalid:[!0],pollPeriod:[1e3,[me.required]],connectAttemptTimeMs:[500,[me.required]],connectAttemptCount:[5,[me.required]],waitAfterFailedAttemptsMs:[3e4,[me.required]],values:[{}],security:[{}]}),this.addFieldsToFormGroup()}updateSlaveFormGroup(){this.slaveConfigFormGroup.patchValue({...this.data.value,port:this.data.value.type===ea.Serial?null:this.data.value.port,serialPort:this.data.value.type===ea.Serial?this.data.value.port:"",retries:!1===this.data.value.retries?0:Z(this.data.value.retries)?this.data.value.retries:pa,values:{attributes:this.data.value.attributes??[],timeseries:this.data.value.timeseries??[],attributeUpdates:this.data.value.attributeUpdates??[],rpc:this.data.value.rpc??[]}})}observeTypeChange(){this.slaveConfigFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateControlsEnabling(e),this.updateMethodType(e)}))}updateMethodType(e){this.slaveConfigFormGroup.get("method").value!==ta.RTU&&this.slaveConfigFormGroup.get("method").patchValue(e===ea.Serial?na.ASCII:ta.SOCKET,{emitEvent:!1})}updateControlsEnabling(e){const[t,n]=e===ea.Serial?[this.serialSpecificControlKeys,this.tcpUdpSpecificControlKeys]:[this.tcpUdpSpecificControlKeys,this.serialSpecificControlKeys];t.forEach((e=>this.slaveConfigFormGroup.get(e)?.enable({emitEvent:!1}))),n.forEach((e=>this.slaveConfigFormGroup.get(e)?.disable({emitEvent:!1}))),this.updateSecurityEnabling(this.showSecurityControl.value)}observeShowSecurity(){this.showSecurityControl.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateSecurityEnabling(e)))}updateSecurityEnabling(e){e&&this.protocolType!==ea.Serial?this.slaveConfigFormGroup.get("security").enable({emitEvent:!1}):this.slaveConfigFormGroup.get("security").disable({emitEvent:!1})}static{this.ɵfac=function(e){return new(e||gX)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef))}}static{this.ɵdir=t.ɵɵdefineDirective({type:gX,features:[t.ɵɵInheritDefinitionFeature]})}}e("ModbusSlaveDialogAbstract",gX);const fX=()=>({maxWidth:"970px"});function yX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate3(" ",e.get("tag").value,"",": ","",e.get("value").value," ")}}function vX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",22)(1,"div",23),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"span",24),t.ɵɵtext(5),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"div",25),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"span",26),t.ɵɵtext(10),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"div",25),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementStart(14,"span",26),t.ɵɵtext(15),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(3,6,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.method":"gateway.key"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("tag").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(8,8,"gateway.address"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("address").value),t.ɵɵadvance(2),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(13,10,"gateway.type"),": "),t.ɵɵadvance(3),t.ɵɵtextInterpolate(e.get("type").value)}}function xX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.keysType===e.ModbusValueKey.RPC_REQUESTS?"gateway.method-required":"gateway.key-required"))}}function bX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",47),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function wX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",47),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(5);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.ModbusFunctionCodeTranslationsMap.get(e))," ")}}function SX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",31)(1,"div",36),t.ɵɵtext(2,"gateway.function-code"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",33)(4,"mat-select",48),t.ɵɵtemplate(5,wX,3,4,"mat-option",38),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.functionCodesMap.get(e.get("id").value)||n.defaultFunctionCodes)}}function CX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.objects-count-required"))}function _X(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.modbus.max-bit"))}function TX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",31)(1,"div",49),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.bit"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",50),t.ɵɵelement(5,"input",51),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,_X,3,3,"mat-icon",35),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(3).$implicit;t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.bit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("bit").hasError("max")&&e.get("bit").touched)}}function IX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",47),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(6);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.BitTargetTypeTranslationMap.get(e)))}}function EX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",31)(1,"div",49),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.bit-target-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",52)(5,"mat-form-field",53)(6,"mat-select",54),t.ɵɵtemplate(7,IX,3,4,"mat-option",38),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(5);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.modbus.bit-target-type")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",e.bitTargetTypes)}}function MX(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,TX,8,7,"div",39)(2,EX,8,4,"div",39),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("objectsCount").value>1),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!n.hideNewFields)}}function kX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function PX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",47),t.ɵɵelement(1,"mat-icon",63),t.ɵɵelementStart(2,"span"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(5);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("svgIcon",i.ModifierTypesMap.get(e).icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,i.ModifierTypesMap.get(e).name))}}function DX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.modifier-invalid"))}function OX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",55)(1,"mat-expansion-panel",16)(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-slide-toggle",56),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label",57),t.ɵɵpipe(6,"translate"),t.ɵɵtext(7),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",52)(10,"div",58)(11,"div",36),t.ɵɵtext(12,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",53)(14,"mat-select",59)(15,"mat-select-trigger")(16,"div",60),t.ɵɵelement(17,"mat-icon",61),t.ɵɵelementStart(18,"span"),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(21,PX,5,5,"mat-option",38),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(22,"div",31)(23,"div",36),t.ɵɵtext(24,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",50),t.ɵɵelement(26,"input",62),t.ɵɵpipe(27,"translate"),t.ɵɵtemplate(28,DX,3,3,"mat-icon",35),t.ɵɵelementEnd()()()()}if(2&e){let e,n;const i=t.ɵɵnextContext(2).$implicit,a=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("expanded",a.enableModifiersControlMap.get(i.get("id").value).value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",a.enableModifiersControlMap.get(i.get("id").value)),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,9,"gateway.hints.modbus.modifier")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(8,11,"gateway.modifier")," "),t.ɵɵadvance(10),t.ɵɵproperty("svgIcon",null==(e=a.ModifierTypesMap.get(i.get("modifierType").value))?null:e.icon),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,13,null==(n=a.ModifierTypesMap.get(i.get("modifierType").value))?null:n.name)),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",a.modifierTypes),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(27,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",i.get("modifierValue").hasError("pattern")&&i.get("modifierValue").touched)}}function AX(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",46),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function FX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",31)(1,"div",64),t.ɵɵtext(2,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",33),t.ɵɵelement(4,"input",65),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,AX,3,3,"mat-icon",35),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("value").hasError("required")&&e.get("value").touched)}}function RX(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",66),2&e){const e=t.ɵɵnextContext(4);t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Key)("isExpansionMode",!0)}}function BX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",27),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelement(3,"div",28),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",29)(5,"div",30),t.ɵɵtext(6,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",31)(8,"div",32),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",33),t.ɵɵelement(13,"input",34),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,xX,3,3,"mat-icon",35),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",29)(17,"div",30),t.ɵɵtext(18,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",31)(20,"div",36),t.ɵɵtext(21," gateway.type "),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",33)(23,"mat-select",37),t.ɵɵtemplate(24,bX,2,2,"mat-option",38),t.ɵɵelementEnd()()(),t.ɵɵtemplate(25,SX,6,1,"div",39),t.ɵɵelementStart(26,"div",31)(27,"div",40),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"gateway.objects-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",33),t.ɵɵelement(31,"input",41),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,CX,3,3,"mat-icon",35),t.ɵɵelementEnd()(),t.ɵɵtemplate(34,MX,3,2,"ng-container",42),t.ɵɵelementStart(35,"div",31)(36,"div",40),t.ɵɵpipe(37,"translate"),t.ɵɵtext(38,"gateway.address"),t.ɵɵelementEnd(),t.ɵɵelementStart(39,"mat-form-field",33),t.ɵɵelement(40,"input",43),t.ɵɵpipe(41,"translate"),t.ɵɵtemplate(42,kX,3,3,"mat-icon",35),t.ɵɵelementEnd()(),t.ɵɵtemplate(43,OX,29,17,"div",44)(44,FX,7,4,"div",39)(45,RX,1,2,"tb-report-strategy",45),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,20,"gateway.hints.modbus.data-keys")," "),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/modbus-functions-data-types_fn")("tb-help-popup-style",t.ɵɵpureFunction0(36,fX)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(9,22,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.hints.modbus.method":"gateway.hints.modbus.key")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,24,n.keysType===n.ModbusValueKey.RPC_REQUESTS?"gateway.method-name":"gateway.key")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,26,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("tag").hasError("required")&&e.get("tag").touched),t.ɵɵadvance(9),t.ɵɵproperty("ngForOf",n.modbusDataTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withFunctionCode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(28,28,"gateway.hints.modbus.objects-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,30,"gateway.set")),t.ɵɵproperty("readonly",!n.ModbusEditableDataTypes.includes(e.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("objectsCount").hasError("required")&&e.get("objectsCount").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("type").value===n.ModbusDataType.BITS),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(37,32,"gateway.hints.modbus.address")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(41,34,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("address").hasError("required")&&e.get("address").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.showModifiersMap.get(e.get("id").value)),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isMaster),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withReportStrategy)}}function NX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",13)(1,"div",14),t.ɵɵelementContainerStart(2,15),t.ɵɵelementStart(3,"mat-expansion-panel",16)(4,"mat-expansion-panel-header",17)(5,"mat-panel-title"),t.ɵɵtemplate(6,yX,2,3,"div",18)(7,vX,16,12,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,BX,46,37,"ng-template",19),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",20),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵreference(8),r=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",r.isMaster)("ngIfElse",a),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,r.deleteKeyTitle))}}function LX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵtemplate(1,NX,14,7,"div",12),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByControlId)}}function VX(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",67)(1,"span",68),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class qX{constructor(e,t){this.fb=e,this.popover=t,this.isMaster=!1,this.hideNewFields=!1,this.keysDataApplied=new u,this.withFunctionCode=!0,this.withReportStrategy=!0,this.enableModifiersControlMap=new Map,this.showModifiersMap=new Map,this.functionCodesMap=new Map,this.defaultFunctionCodes=[],this.modbusDataTypes=Object.values(Zt),this.modifierTypes=Object.values(ba),this.bitTargetTypes=Object.values(da),this.BitTargetTypeTranslationMap=ua,this.ModbusEditableDataTypes=Qt,this.ModbusFunctionCodeTranslationsMap=nn,this.ModifierTypesMap=wa,this.ReportStrategyDefaultValue=on,this.ModbusDataType=Zt,this.ModbusValueKey=oa,this.destroy$=new we,this.defaultReadFunctionCodes=[3,4],this.bitsReadFunctionCodes=[1,2],this.defaultWriteFunctionCodes=[6,16],this.bitsWriteFunctionCodes=[5,15]}ngOnInit(){this.withFunctionCode=!this.isMaster||this.keysType!==oa.ATTRIBUTES&&this.keysType!==oa.TIMESERIES,this.withReportStrategy=!(this.isMaster||this.keysType!==oa.ATTRIBUTES&&this.keysType!==oa.TIMESERIES||this.hideNewFields),this.keysListFormArray=this.prepareKeysFormArray(this.values),this.defaultFunctionCodes=this.getDefaultFunctionCodes()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}trackByControlId(e,t){return t.value.id}addKey(){const e=ae(5),t=this.fb.group({tag:["",[me.required,me.pattern(pn)]],value:[{value:"",disabled:!this.isMaster},[me.required,me.pattern(pn)]],type:[Zt.BYTES,[me.required]],address:[null,[me.required]],objectsCount:[1,[me.required]],functionCode:[{value:this.getDefaultFunctionCodes()[0],disabled:!this.withFunctionCode},[me.required]],reportStrategy:[{value:null,disabled:!this.withReportStrategy}],modifierType:[{value:ba.MULTIPLIER,disabled:!0}],modifierValue:[{value:1,disabled:!0},[me.pattern(dn)]],bit:[{value:null,disabled:!0}],bitTargetType:[{value:da.IntegerType,disabled:!0}],id:[{value:e,disabled:!0}]});this.showModifiersMap.set(e,!1),this.enableModifiersControlMap.set(e,this.fb.control(!1)),this.observeKeyDataType(t),this.observeObjectsCount(t),this.observeEnableModifier(t),this.keysListFormArray.push(t)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover.hide()}applyKeysData(){this.keysDataApplied.emit(this.getFormValue())}getFormValue(){return this.mapKeysWithModifier(this.withReportStrategy?this.cleanUpEmptyStrategies(this.keysListFormArray.value):this.keysListFormArray.value)}cleanUpEmptyStrategies(e){return e.map((e=>{const{reportStrategy:t,...n}=e;return t?e:n}))}mapKeysWithModifier(e){return e.map(((e,t)=>{if(this.showModifiersMap.get(this.keysListFormArray.controls[t].get("id").value)){const{modifierType:t,modifierValue:n,...i}=e;return t?{...i,[t]:n}:i}return e}))}prepareKeysFormArray(e){const t=[];return e&&e.forEach((e=>{const n=this.createDataKeyFormGroup(e);this.observeKeyDataType(n),this.observeObjectsCount(n),this.observeEnableModifier(n),this.functionCodesMap.set(n.get("id").value,this.getFunctionCodes(e.type)),t.push(n)})),this.fb.array(t)}createDataKeyFormGroup(e){const{tag:t,value:n,type:i,address:a,objectsCount:r,functionCode:o,multiplier:s,divider:l,reportStrategy:p,bit:c,bitTargetType:d}=e,u=ae(5),m=this.shouldShowModifier(i);return this.showModifiersMap.set(u,m),this.enableModifiersControlMap.set(u,this.fb.control((s||l)&&m)),this.fb.group({tag:[t,[me.required,me.pattern(pn)]],value:[{value:n,disabled:!this.isMaster},[me.required,me.pattern(pn)]],type:[i,[me.required]],address:[a,[me.required]],objectsCount:[r,[me.required]],functionCode:[{value:o,disabled:!this.withFunctionCode},[me.required]],modifierType:[{value:l?ba.DIVIDER:ba.MULTIPLIER,disabled:!this.enableModifiersControlMap.get(u).value}],bit:[{value:c,disabled:i!==Zt.BITS||r<2},[me.max(r-1)]],bitTargetType:[{value:d??da.IntegerType,disabled:i!==Zt.BITS||this.hideNewFields}],modifierValue:[{value:s??l??1,disabled:!this.enableModifiersControlMap.get(u).value},[me.pattern(dn)]],id:[{value:u,disabled:!0}],reportStrategy:[{value:p,disabled:!this.withReportStrategy}]})}shouldShowModifier(e){return!(this.isMaster||this.keysType!==oa.ATTRIBUTES&&this.keysType!==oa.TIMESERIES||this.ModbusEditableDataTypes.includes(e))}observeKeyDataType(e){e.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((t=>{this.ModbusEditableDataTypes.includes(t)||e.get("objectsCount").patchValue(Jt[t],{emitEvent:!1}),this.toggleBitsFields(e);const n=this.shouldShowModifier(t);this.showModifiersMap.set(e.get("id").value,n),this.updateFunctionCodes(e,t)}))}observeObjectsCount(e){e.get("objectsCount").valueChanges.pipe(Oe((()=>e.get("type").value===Zt.BITS)),Me(this.destroy$)).subscribe((()=>this.toggleBitsFields(e)))}toggleBitsFields(e){const{objectsCount:t,type:n,bit:i,bitTargetType:a}=e.controls,r=n.value===Zt.BITS,o=t.value>1;r&&o?(i.enable({emitEvent:!1}),i.setValidators(me.max(t.value-1))):i.disable({emitEvent:!1}),i.updateValueAndValidity({emitEvent:!1}),a[r?"enable":"disable"]({emitEvent:!1})}observeEnableModifier(e){this.enableModifiersControlMap.get(e.get("id").value).valueChanges.pipe(Me(this.destroy$)).subscribe((t=>this.toggleModifierControls(e,t)))}toggleModifierControls(e,t){const n=e.get("modifierType"),i=e.get("modifierValue");n[t?"enable":"disable"]({emitEvent:!1}),i[t?"enable":"disable"]({emitEvent:!1}),n.markAsDirty(),i.markAsDirty()}updateFunctionCodes(e,t){const n=this.getFunctionCodes(t);this.functionCodesMap.set(e.get("id").value,n),n.includes(e.get("functionCode").value)||e.get("functionCode").patchValue(n[0],{emitEvent:!1})}getFunctionCodes(e){const t=[...e===Zt.BITS?this.bitsWriteFunctionCodes:[],...this.defaultWriteFunctionCodes];if(this.keysType===oa.ATTRIBUTES_UPDATES)return t.sort(((e,t)=>e-t));const n=[...this.defaultReadFunctionCodes];return e===Zt.BITS&&n.push(...this.bitsReadFunctionCodes),this.keysType===oa.RPC_REQUESTS&&n.push(...t),n.sort(((e,t)=>e-t))}getDefaultFunctionCodes(){return this.keysType===oa.ATTRIBUTES_UPDATES?this.defaultWriteFunctionCodes:this.keysType===oa.RPC_REQUESTS?[...this.defaultReadFunctionCodes,...this.defaultWriteFunctionCodes]:this.defaultReadFunctionCodes}static{this.ɵfac=function(e){return new(e||qX)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverComponent))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:qX,selectors:[["tb-modbus-data-keys-panel"]],inputs:{isMaster:"isMaster",hideNewFields:"hideNewFields",panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keysType:"keysType",values:"values"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["tagName",""],[1,"tb-modbus-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],[1,"flex","justify-between","pt-4"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["class","title-container","tbTruncateWithTooltip","",4,"ngIf","ngIfElse"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],["tbTruncateWithTooltip","",1,"title-container"],[1,"tb-flex"],[1,"title-container","tb-flex"],["tbTruncateWithTooltip","",1,"key-label"],[1,"title-container"],[1,"key-label"],[1,"tb-form-hint","tb-primary-fill","tb-flex","align-center"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","tag",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width"],["formControlName","type"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","1","max","50000","name","value","formControlName","objectsCount",3,"placeholder","readonly"],[4,"ngIf"],["matInput","","type","number","min","0","max","65535","name","value","formControlName","address",3,"placeholder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],["class","stroked tb-form-panel","formControlName","reportStrategy",3,"defaultValue","isExpansionMode",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"],["formControlName","functionCode"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-inline-field","tb-suffix-absolute","flex"],["matInput","","formControlName","bit","step","1","type","number","min","0",3,"placeholder"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","fill-width"],["formControlName","bitTargetType"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"mat-slide",3,"click","formControl"],[3,"tb-hint-tooltip-icon"],[1,"tb-form-row","column-xs","w-full"],["formControlName","modifierType"],[1,"tb-flex","align-center"],[1,"tb-mat-18",3,"svgIcon"],["matInput","","required","","formControlName","modifierValue","step","0.1","type","number",3,"placeholder"],[1,"tb-mat-20",3,"svgIcon"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","value",3,"placeholder"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"div",3)(2,"div",4),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,LX,2,2,"div",5),t.ɵɵelementEnd(),t.ɵɵtemplate(6,VX,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵelementStart(8,"div",6)(9,"button",7),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"div",8)(13,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(7);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")",""),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,10,n.addKeyTitle)," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(qX,[se,_,ni,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{width:180px}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .key-label[_ngcontent-%COMP%]{font-weight:400}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:calc(100vh - 112px);max-height:500px;overflow:auto}[_nghost-%COMP%] .tb-modbus-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}']})}}e("ModbusDataKeysPanelComponent",qX),He([I()],qX.prototype,"isMaster",void 0),He([I()],qX.prototype,"hideNewFields",void 0);const GX=()=>({$implicit:null}),zX=e=>({$implicit:e});function UX(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",7),t.ɵɵelementContainer(2,8),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(),n=t.ɵɵreference(4);t.ɵɵadvance(),t.ɵɵproperty("formGroup",e.valuesFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",n)("ngTemplateOutletContext",t.ɵɵpureFunction0(3,GX))}}function jX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab",11),t.ɵɵpipe(1,"translate"),t.ɵɵelementStart(2,"div",7),t.ɵɵelementContainer(3,8),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2),a=t.ɵɵreference(4);t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(1,4,i.ModbusValuesTranslationsMap.get(e))),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i.valuesFormGroup.get(e)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",a)("ngTemplateOutletContext",t.ɵɵpureFunction1(6,zX,e))}}function HX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab-group",9),t.ɵɵtemplate(1,jX,4,8,"mat-tab",10),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.valuesFormGroup),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.modbusRegisterTypes)}}function WX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function $X(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function KX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function YX(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.tag," ")}}function XX(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",12)(1,"div",13),t.ɵɵtext(2,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",14)(4,"mat-chip-listbox",15),t.ɵɵtemplate(5,WX,2,1,"mat-chip",16),t.ɵɵelementStart(6,"mat-chip",17),t.ɵɵelement(7,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"button",19,2),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(9),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.ATTRIBUTES,i))})),t.ɵɵelementStart(11,"tb-icon",20),t.ɵɵtext(12,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(13,"div",12)(14,"div",13),t.ɵɵtext(15,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",14)(17,"mat-chip-listbox",15),t.ɵɵtemplate(18,$X,2,1,"mat-chip",16),t.ɵɵelementStart(19,"mat-chip",17),t.ɵɵelement(20,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(21,"button",19,3),t.ɵɵpipe(23,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(22),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.TIMESERIES,i))})),t.ɵɵelementStart(24,"tb-icon",20),t.ɵɵtext(25,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(26,"div",12)(27,"div",13),t.ɵɵtext(28,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",14)(30,"mat-chip-listbox",15),t.ɵɵtemplate(31,KX,2,1,"mat-chip",16),t.ɵɵelementStart(32,"mat-chip",17),t.ɵɵelement(33,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"button",19,4),t.ɵɵpipe(36,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(35),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.ATTRIBUTES_UPDATES,i))})),t.ɵɵelementStart(37,"tb-icon",20),t.ɵɵtext(38,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(39,"div",12)(40,"div",13),t.ɵɵtext(41,"gateway.rpc-requests"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",14)(43,"mat-chip-listbox",15),t.ɵɵtemplate(44,YX,2,1,"mat-chip",16),t.ɵɵelementStart(45,"mat-chip",17),t.ɵɵelement(46,"label",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(47,"button",19,5),t.ɵɵpipe(49,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵreference(48),r=t.ɵɵnextContext();return t.ɵɵresetView(r.manageKeys(n,a,r.ModbusValueKey.RPC_REQUESTS,i))})),t.ɵɵelementStart(50,"tb-icon",20),t.ɵɵtext(51,"edit"),t.ɵɵelementEnd()()()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,16,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.TIMESERIES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.TIMESERIES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(23,18,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES_UPDATES,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.ATTRIBUTES_UPDATES,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(36,20,"action.edit")),t.ɵɵproperty("disabled",i.disabled),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",i.getValueGroup(i.ModbusValueKey.RPC_REQUESTS,e).value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",i.getValueGroup(i.ModbusValueKey.RPC_REQUESTS,e).value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(49,22,"action.edit")),t.ɵɵproperty("disabled",i.disabled)}}class ZX{constructor(e,t,n,i,a,r){this.fb=e,this.popoverService=t,this.renderer=n,this.viewContainerRef=i,this.cdr=a,this.destroyRef=r,this.singleMode=!1,this.hideNewFields=!1,this.disabled=!1,this.modbusRegisterTypes=Object.values(ra),this.modbusValueKeys=Object.values(oa),this.ModbusValuesTranslationsMap=ca,this.ModbusValueKey=oa}ngOnInit(){this.initializeValuesFormGroup(),this.observeValuesChanges()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){if(this.singleMode)this.valuesFormGroup.setValue(this.getSingleRegisterState(e),{emitEvent:!1});else{const{holding_registers:t,coils_initializer:n,input_registers:i,discrete_inputs:a}=e;this.valuesFormGroup.setValue({holding_registers:this.getSingleRegisterState(t),coils_initializer:this.getSingleRegisterState(n),input_registers:this.getSingleRegisterState(i),discrete_inputs:this.getSingleRegisterState(a)},{emitEvent:!1})}this.cdr.markForCheck()}validate(){return this.valuesFormGroup.valid?null:{valuesFormGroup:{valid:!1}}}setDisabledState(e){this.disabled=e,this.cdr.markForCheck()}getValueGroup(e,t){return t?this.valuesFormGroup.get(t).get(e):this.valuesFormGroup.get(e)}manageKeys(e,t,n,i){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const a=t._elementRef.nativeElement;if(this.popoverService.hasPopover(a))return void this.popoverService.hidePopover(a);const r=this.getValueGroup(n,i),o={values:r.value,isMaster:!this.singleMode,keysType:n,panelTitle:fa.get(n),addKeyTitle:ya.get(n),deleteKeyTitle:va.get(n),noKeysText:xa.get(n),hideNewFields:this.hideNewFields};this.popoverComponent=this.popoverService.displayPopover(a,this.renderer,this.viewContainerRef,qX,"leftTop",!1,null,o,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(In(this.destroyRef)).subscribe((e=>{this.popoverComponent.hide(),r.patchValue(e),r.markAsDirty(),this.cdr.markForCheck()}))}initializeValuesFormGroup(){const e=()=>this.fb.group(this.modbusValueKeys.reduce(((e,t)=>(e[t]=this.fb.control([[],[]]),e)),{}));this.singleMode?this.valuesFormGroup=e():this.valuesFormGroup=this.fb.group(this.modbusRegisterTypes.reduce(((t,n)=>(t[n]=e(),t)),{}))}observeValuesChanges(){this.valuesFormGroup.valueChanges.pipe(In(this.destroyRef)).subscribe((e=>{this.onChange(e),this.onTouched()}))}getSingleRegisterState(e){return{attributes:e?.attributes??[],timeseries:e?.timeseries??[],attributeUpdates:e?.attributeUpdates??[],rpc:e?.rpc??[]}}static{this.ɵfac=function(e){return new(e||ZX)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:ZX,selectors:[["tb-modbus-values"]],inputs:{singleMode:"singleMode",hideNewFields:"hideNewFields"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>ZX)),multi:!0},{provide:he,useExisting:c((()=>ZX)),multi:!0}]),t.ɵɵStandaloneFeature],decls:5,vars:2,consts:[["multipleView",""],["singleView",""],["attributesButton",""],["telemetryButton",""],["attributesUpdatesButton",""],["rpcRequestsButton",""],[4,"ngIf","ngIfElse"],[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"formGroup"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","disabled","matTooltip"],["matButtonIcon",""]],template:function(e,n){if(1&e&&t.ɵɵtemplate(0,UX,3,4,"ng-container",6)(1,HX,2,2,"ng-template",null,0,t.ɵɵtemplateRefExtractor)(3,XX,52,24,"ng-template",null,1,t.ɵɵtemplateRefExtractor),2&e){const e=t.ɵɵreference(2);t.ɵɵproperty("ngIf",n.singleMode)("ngIfElse",e)}},dependencies:t.ɵɵgetComponentDepsFactory(ZX,[se,_,$n]),styles:['@charset "UTF-8";[_nghost-%COMP%] .ellipsis-chips-container{max-width:70%}[_nghost-%COMP%] .mat-mdc-tab-body-wrapper{min-height:320px} .mdc-evolution-chip-set__chips{align-items:center}'],changeDetection:d.OnPush})}}function QX(e,n){1&e&&(t.ɵɵelementStart(0,"div",2)(1,"div",10),t.ɵɵtext(2,"gateway.server-hostname"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",5)(4,"mat-form-field",6),t.ɵɵelement(5,"input",16),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function JX(e,n){1&e&&(t.ɵɵelementStart(0,"div",17)(1,"mat-slide-toggle",18)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.request-client-certificate")," "))}e("ModbusValuesComponent",ZX),He([I()],ZX.prototype,"singleMode",void 0),He([I()],ZX.prototype,"hideNewFields",void 0);class eZ{constructor(e,t){this.fb=e,this.cdr=t,this.isMaster=!1,this.disabled=!1,this.destroy$=new we,this.securityConfigFormGroup=this.fb.group({certfile:["",[me.required,me.pattern(pn)]],keyfile:["",[me.required,me.pattern(pn)]],password:["",[me.required,me.pattern(pn)]],server_hostname:["",[me.pattern(pn)]],reqclicert:[{value:!1,disabled:!0}]}),this.observeValueChanges()}ngOnChanges(){this.updateMasterEnabling()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this.disabled?this.securityConfigFormGroup.disable({emitEvent:!1}):this.securityConfigFormGroup.enable({emitEvent:!1}),this.updateMasterEnabling(),this.cdr.markForCheck()}validate(){return this.securityConfigFormGroup.valid?null:{securityConfigFormGroup:{valid:!1}}}writeValue(e){const{certfile:t,password:n,keyfile:i,server_hostname:a}=e,r={certfile:t??"",password:n??"",keyfile:i??"",server_hostname:a??"",reqclicert:!!e.reqclicert};this.securityConfigFormGroup.reset(r,{emitEvent:!1})}updateMasterEnabling(){this.isMaster?(this.disabled||this.securityConfigFormGroup.get("reqclicert").enable({emitEvent:!1}),this.securityConfigFormGroup.get("server_hostname").disable({emitEvent:!1})):(this.disabled||this.securityConfigFormGroup.get("server_hostname").enable({emitEvent:!1}),this.securityConfigFormGroup.get("reqclicert").disable({emitEvent:!1}))}observeValueChanges(){this.securityConfigFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}static{this.ɵfac=function(e){return new(e||eZ)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:eZ,selectors:[["tb-modbus-security-config"]],inputs:{isMaster:"isMaster"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>eZ)),multi:!0},{provide:he,useExisting:c((()=>eZ)),multi:!0}]),t.ɵɵNgOnChangesFeature,t.ɵɵStandaloneFeature],decls:33,vars:21,consts:[[1,"tb-form-panel","no-border","no-padding",3,"formGroup"],[1,"tb-form-hint","tb-primary-fill"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["tbTruncateWithTooltip","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","required","","formControlName","certfile",3,"placeholder"],[1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["matInput","","name","value","required","","formControlName","keyfile",3,"placeholder"],["translate","",1,"fixed-title-width"],["matInput","","type","password","required","","name","value","formControlName","password",3,"placeholder"],["matSuffix","",1,"tb-flex","no-gap","align-center","fill-height"],[1,"tb-flex","align-center","fill-height"],["class","tb-form-row space-between tb-flex fill-width",4,"ngIf"],["class","tb-form-row",4,"ngIf"],["matInput","","name","value","formControlName","server_hostname",3,"placeholder"],[1,"tb-form-row"],["formControlName","reqclicert",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",2)(5,"div",3),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"span",4),t.ɵɵtext(8,"gateway.client-cert-path"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",5)(10,"mat-form-field",6),t.ɵɵelement(11,"input",7),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(13,"div",2)(14,"div",8),t.ɵɵpipe(15,"translate"),t.ɵɵelementStart(16,"span",4),t.ɵɵtext(17,"gateway.private-key-path"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",5)(19,"mat-form-field",6),t.ɵɵelement(20,"input",9),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",2)(23,"div",10),t.ɵɵtext(24,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",5)(26,"mat-form-field",6),t.ɵɵelement(27,"input",11),t.ɵɵpipe(28,"translate"),t.ɵɵelementStart(29,"div",12),t.ɵɵelement(30,"tb-toggle-password",13),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(31,QX,7,3,"div",14)(32,JX,5,3,"div",15),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.securityConfigFormGroup),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,9,"gateway.hints.path-in-os")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,11,"gateway.hints.ca-cert")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,13,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(15,15,"gateway.private-key-path")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,17,"gateway.set")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,19,"gateway.set")),t.ɵɵadvance(4),t.ɵɵproperty("ngIf",!n.isMaster),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.isMaster))},dependencies:t.ɵɵgetComponentDepsFactory(eZ,[se,_,Wn]),encapsulation:2,changeDetection:d.OnPush})}}function tZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function nZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function iZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",53),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,nZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function aZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function rZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",55),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,aZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function oZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function sZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",56),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,oZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("serialPort").hasError("required")&&e.slaveConfigFormGroup.get("serialPort").touched)}}function lZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function pZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function cZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function dZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusParityLabelsMap.get(e))}}function uZ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",17)(2,"div",18),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",19)(6,"mat-select",57),t.ɵɵtemplate(7,pZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",17)(9,"div",18),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"gateway.bytesize"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19)(13,"mat-select",58),t.ɵɵtemplate(14,cZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",17)(16,"div",18),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"gateway.stopbits"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",19),t.ɵɵelement(20,"input",59),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",17)(23,"div",18),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25,"gateway.parity"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",19)(27,"mat-select",60),t.ɵɵtemplate(28,dZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(29,"div",36)(30,"mat-slide-toggle",61)(31,"mat-label",39),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,12,"gateway.hints.modbus.bytesize")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusByteSizes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(17,14,"gateway.hints.modbus.stopbits")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,16,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,18,"gateway.hints.modbus.parity")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusParities),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(32,20,"gateway.hints.modbus.strict")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(34,22,"gateway.strict")," ")}}function mZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function hZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function gZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function fZ(e,n){1&e&&(t.ɵɵelementStart(0,"div",36)(1,"mat-slide-toggle",62)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.send-data-on-change")," "))}function yZ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",63),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Device)("isExpansionMode",!0)}}function vZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function xZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function bZ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",64)(1,"mat-expansion-panel",65)(2,"mat-expansion-panel-header",66)(3,"mat-panel-title")(4,"mat-slide-toggle",67),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",68),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusSecurityConfigComponent",eZ),He([I()],eZ.prototype,"isMaster",void 0);class wZ extends gX{constructor(e,t,n,i,a){super(e,t,n,i,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a}getSlaveResultData(){const{values:e,type:t,serialPort:n,...i}=this.slaveConfigFormGroup.value,a={...i,type:t,...e};return t===ea.Serial&&(a.port=n),a.reportStrategy||delete a.reportStrategy,Y(a),a}addFieldsToFormGroup(){this.slaveConfigFormGroup.addControl("reportStrategy",this.fb.control(null))}static{this.ɵfac=function(e){return new(e||wZ)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:wZ,selectors:[["tb-modbus-slave-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:142,vars:97,consts:[["serialPort",""],["reportStrategy",""],[1,"slaves-config-container"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"tb-form-panel",3,"formGroup"],[1,"stroked","tb-form-panel"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],[4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["class","tb-form-row",4,"ngIf","ngIfElse"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[1,"tb-form-row"],["matInput","","type","number","min","0","name","retries","formControlName","retries",3,"placeholder"],["formControlName","retryOnEmpty",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","retryOnInvalid",1,"mat-slide"],[1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],["translate","",1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","500","name","value","formControlName","connectAttemptTimeMs",3,"placeholder"],["matInput","","type","number","min","1","name","value","formControlName","connectAttemptCount",3,"placeholder"],["matInput","","type","number","min","30000","name","value","formControlName","waitAfterFailedAttemptsMs",3,"placeholder"],["formControlName","values",3,"singleMode","hideNewFields"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],["formControlName","bytesize"],["matInput","","type","number","min","0","name","value","formControlName","stopbits",3,"placeholder"],["formControlName","parity"],["formControlName","strict",1,"mat-slide"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide","justify-start",3,"click","formControl"],["formControlName","security",1,"security-config"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"mat-toolbar",3)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",4)(6,"div",5),t.ɵɵelementStart(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12),t.ɵɵtext(15,"gateway.server-connection"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"tb-toggle-select",13),t.ɵɵtemplate(17,tZ,2,2,"tb-toggle-option",14),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",10),t.ɵɵtemplate(19,iZ,8,7,"div",15)(20,rZ,8,9,"div",16)(21,sZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(23,"div",17)(24,"div",18),t.ɵɵpipe(25,"translate"),t.ɵɵtext(26," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(27,"mat-form-field",19)(28,"mat-select",20),t.ɵɵtemplate(29,lZ,2,2,"mat-option",14),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(30,uZ,35,24,"ng-container",21),t.ɵɵelementStart(31,"div",17)(32,"div",22),t.ɵɵpipe(33,"translate"),t.ɵɵtext(34,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"mat-form-field",19),t.ɵɵelement(36,"input",23),t.ɵɵpipe(37,"translate"),t.ɵɵtemplate(38,mZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"div",17)(40,"div",25),t.ɵɵtext(41,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"mat-form-field",19),t.ɵɵelement(43,"input",26),t.ɵɵpipe(44,"translate"),t.ɵɵtemplate(45,hZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"div",17)(47,"div",25),t.ɵɵtext(48,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"mat-form-field",19),t.ɵɵelement(50,"input",27),t.ɵɵpipe(51,"translate"),t.ɵɵtemplate(52,gZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵtemplate(53,fZ,5,3,"div",28)(54,yZ,1,2,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(56,"div",29)(57,"mat-expansion-panel",30)(58,"mat-expansion-panel-header")(59,"mat-panel-title")(60,"div",31),t.ɵɵtext(61,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(62,"div",10)(63,"div",17)(64,"div",18),t.ɵɵpipe(65,"translate"),t.ɵɵtext(66,"gateway.connection-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(67,"mat-form-field",19),t.ɵɵelement(68,"input",32),t.ɵɵpipe(69,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(70,"div",17)(71,"div",18),t.ɵɵpipe(72,"translate"),t.ɵɵtext(73,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(74,"mat-form-field",19)(75,"mat-select",33),t.ɵɵtemplate(76,vZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(77,"div",17)(78,"div",18),t.ɵɵpipe(79,"translate"),t.ɵɵtext(80,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",19)(82,"mat-select",34),t.ɵɵtemplate(83,xZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(84,bZ,9,5,"div",35),t.ɵɵelementStart(85,"div",36)(86,"div",18),t.ɵɵpipe(87,"translate"),t.ɵɵtext(88,"gateway.retries"),t.ɵɵelementEnd(),t.ɵɵelementStart(89,"mat-form-field",19),t.ɵɵelement(90,"input",37),t.ɵɵpipe(91,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(92,"div",36)(93,"mat-slide-toggle",38)(94,"mat-label",39),t.ɵɵpipe(95,"translate"),t.ɵɵtext(96),t.ɵɵpipe(97,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(98,"div",36)(99,"mat-slide-toggle",40)(100,"mat-label",39),t.ɵɵpipe(101,"translate"),t.ɵɵtext(102),t.ɵɵpipe(103,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(104,"div",17)(105,"div",41),t.ɵɵpipe(106,"translate"),t.ɵɵelementStart(107,"span",42),t.ɵɵtext(108," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(109,"mat-form-field",19),t.ɵɵelement(110,"input",43),t.ɵɵpipe(111,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(112,"div",17)(113,"div",44),t.ɵɵpipe(114,"translate"),t.ɵɵtext(115,"gateway.connect-attempt-time"),t.ɵɵelementEnd(),t.ɵɵelementStart(116,"mat-form-field",19),t.ɵɵelement(117,"input",45),t.ɵɵpipe(118,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(119,"div",17)(120,"div",44),t.ɵɵpipe(121,"translate"),t.ɵɵtext(122,"gateway.connect-attempt-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(123,"mat-form-field",19),t.ɵɵelement(124,"input",46),t.ɵɵpipe(125,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(126,"div",17)(127,"div",44),t.ɵɵpipe(128,"translate"),t.ɵɵtext(129,"gateway.wait-after-failed-attempts"),t.ɵɵelementEnd(),t.ɵɵelementStart(130,"mat-form-field",19),t.ɵɵelement(131,"input",47),t.ɵɵpipe(132,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(133,"div",29),t.ɵɵelement(134,"tb-modbus-values",48),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(135,"div",49)(136,"button",50),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(137),t.ɵɵpipe(138,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(139,"button",51),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(140),t.ɵɵpipe(141,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(22),i=t.ɵɵreference(55);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,45,"gateway.server-slave")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.modbusHelpLink),t.ɵɵadvance(4),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(25,47,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(33,49,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(37,51,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(44,53,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(51,55,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.data.hideNewFields)("ngIfElse",i),t.ɵɵadvance(11),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(65,57,"gateway.hints.modbus.connection-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(69,59,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(72,61,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(79,63,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(87,65,"gateway.hints.modbus.retries")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(91,67,"gateway.set")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(95,69,"gateway.hints.modbus.retries-on-empty")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(97,71,"gateway.retries-on-empty")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(101,73,"gateway.hints.modbus.retries-on-invalid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(103,75,"gateway.retries-on-invalid")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(106,77,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(111,79,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(114,81,"gateway.hints.modbus.connect-attempt-time")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(118,83,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(121,85,"gateway.hints.modbus.connect-attempt-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(125,87,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(128,89,"gateway.hints.modbus.wait-after-failed-attempts")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(132,91,"gateway.set")),t.ɵɵadvance(3),t.ɵɵproperty("singleMode",!0)("hideNewFields",n.data.hideNewFields),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(138,93,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.slaveConfigFormGroup.invalid||!n.slaveConfigFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(141,95,n.data.buttonTitle)," ")}},dependencies:t.ɵɵgetComponentDepsFactory(wZ,[se,_,ZX,eZ,u$,ni,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%] .slaves-config-container[_ngcontent-%COMP%]{width:80vw;max-width:900px}[_nghost-%COMP%] .slave-name-label[_ngcontent-%COMP%]{margin-right:16px;color:#000000de}[_nghost-%COMP%] .fixed-title-width-260[_ngcontent-%COMP%]{min-width:260px}[_nghost-%COMP%] .security-config .fixed-title-width{min-width:230px}'],changeDetection:d.OnPush})}}function SZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function CZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function _Z(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",53),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,CZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function TZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function IZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",55),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,TZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function EZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function MZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",17)(1,"div",22),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",19),t.ɵɵelement(5,"input",56),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,EZ,3,3,"mat-icon",24),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("serialPort").hasError("required")&&e.slaveConfigFormGroup.get("serialPort").touched)}}function kZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function PZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function DZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function OZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusParityLabelsMap.get(e))}}function AZ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵelementStart(1,"div",17)(2,"div",18),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",19)(6,"mat-select",57),t.ɵɵtemplate(7,PZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(8,"div",17)(9,"div",18),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"gateway.bytesize"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19)(13,"mat-select",58),t.ɵɵtemplate(14,DZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",17)(16,"div",18),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"gateway.stopbits"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",19),t.ɵɵelement(20,"input",59),t.ɵɵpipe(21,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"div",17)(23,"div",18),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25,"gateway.parity"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",19)(27,"mat-select",60),t.ɵɵtemplate(28,OZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(29,"div",36)(30,"mat-slide-toggle",61)(31,"mat-label",39),t.ɵɵpipe(32,"translate"),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(10,12,"gateway.hints.modbus.bytesize")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusByteSizes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(17,14,"gateway.hints.modbus.stopbits")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,16,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,18,"gateway.hints.modbus.parity")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusParities),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(32,20,"gateway.hints.modbus.strict")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(34,22,"gateway.strict")," ")}}function FZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function RZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function BZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",54),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function NZ(e,n){1&e&&(t.ɵɵelementStart(0,"div",36)(1,"mat-slide-toggle",62)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.send-data-on-change")," "))}function LZ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",63),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("defaultValue",e.ReportStrategyDefaultValue.Device)("isExpansionMode",!0)}}function VZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function qZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",52),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function GZ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",64)(1,"mat-expansion-panel",65)(2,"mat-expansion-panel-header",66)(3,"mat-panel-title")(4,"mat-slide-toggle",67),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",68),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusSlaveDialogComponent",wZ);class zZ extends gX{constructor(e,t,n,i,a){super(e,t,n,i,a),this.fb=e,this.store=t,this.router=n,this.data=i,this.dialogRef=a}getSlaveResultData(){const{values:e,type:t,serialPort:n,...i}=this.slaveConfigFormGroup.value,a={...i,type:t,...e};return t===ea.Serial&&(a.port=n),Y(a),a}addFieldsToFormGroup(){this.slaveConfigFormGroup.addControl("sendDataOnlyOnChange",this.fb.control(!1))}static{this.ɵfac=function(e){return new(e||zZ)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:zZ,selectors:[["tb-modbus-legacy-slave-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:142,vars:97,consts:[["serialPort",""],["reportStrategy",""],[1,"slaves-config-container"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content","",1,"tb-form-panel",3,"formGroup"],[1,"stroked","tb-form-panel"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],[4,"ngIf"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["class","tb-form-row",4,"ngIf","ngIfElse"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[1,"tb-form-row"],["matInput","","type","number","min","0","name","retries","formControlName","retries",3,"placeholder"],["formControlName","retryOnEmpty",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","retryOnInvalid",1,"mat-slide"],[1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],["translate","",1,"fixed-title-width-260","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","500","name","value","formControlName","connectAttemptTimeMs",3,"placeholder"],["matInput","","type","number","min","1","name","value","formControlName","connectAttemptCount",3,"placeholder"],["matInput","","type","number","min","30000","name","value","formControlName","waitAfterFailedAttemptsMs",3,"placeholder"],["formControlName","values",3,"singleMode","hideNewFields"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],["formControlName","bytesize"],["matInput","","type","number","min","0","name","value","formControlName","stopbits",3,"placeholder"],["formControlName","parity"],["formControlName","strict",1,"mat-slide"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"defaultValue","isExpansionMode"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide","justify-start",3,"click","formControl"],["formControlName","security",1,"security-config"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"mat-toolbar",3)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",4)(6,"div",5),t.ɵɵelementStart(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12),t.ɵɵtext(15,"gateway.server-connection"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"tb-toggle-select",13),t.ɵɵtemplate(17,SZ,2,2,"tb-toggle-option",14),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",10),t.ɵɵtemplate(19,_Z,8,7,"div",15)(20,IZ,8,9,"div",16)(21,MZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(23,"div",17)(24,"div",18),t.ɵɵpipe(25,"translate"),t.ɵɵtext(26," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(27,"mat-form-field",19)(28,"mat-select",20),t.ɵɵtemplate(29,kZ,2,2,"mat-option",14),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(30,AZ,35,24,"ng-container",21),t.ɵɵelementStart(31,"div",17)(32,"div",22),t.ɵɵpipe(33,"translate"),t.ɵɵtext(34,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(35,"mat-form-field",19),t.ɵɵelement(36,"input",23),t.ɵɵpipe(37,"translate"),t.ɵɵtemplate(38,FZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"div",17)(40,"div",25),t.ɵɵtext(41,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"mat-form-field",19),t.ɵɵelement(43,"input",26),t.ɵɵpipe(44,"translate"),t.ɵɵtemplate(45,RZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"div",17)(47,"div",25),t.ɵɵtext(48,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"mat-form-field",19),t.ɵɵelement(50,"input",27),t.ɵɵpipe(51,"translate"),t.ɵɵtemplate(52,BZ,3,3,"mat-icon",24),t.ɵɵelementEnd()(),t.ɵɵtemplate(53,NZ,5,3,"div",28)(54,LZ,1,2,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(56,"div",29)(57,"mat-expansion-panel",30)(58,"mat-expansion-panel-header")(59,"mat-panel-title")(60,"div",31),t.ɵɵtext(61,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(62,"div",10)(63,"div",17)(64,"div",18),t.ɵɵpipe(65,"translate"),t.ɵɵtext(66,"gateway.connection-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(67,"mat-form-field",19),t.ɵɵelement(68,"input",32),t.ɵɵpipe(69,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(70,"div",17)(71,"div",18),t.ɵɵpipe(72,"translate"),t.ɵɵtext(73,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(74,"mat-form-field",19)(75,"mat-select",33),t.ɵɵtemplate(76,VZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵelementStart(77,"div",17)(78,"div",18),t.ɵɵpipe(79,"translate"),t.ɵɵtext(80,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",19)(82,"mat-select",34),t.ɵɵtemplate(83,qZ,2,2,"mat-option",14),t.ɵɵelementEnd()()(),t.ɵɵtemplate(84,GZ,9,5,"div",35),t.ɵɵelementStart(85,"div",36)(86,"div",18),t.ɵɵpipe(87,"translate"),t.ɵɵtext(88,"gateway.retries"),t.ɵɵelementEnd(),t.ɵɵelementStart(89,"mat-form-field",19),t.ɵɵelement(90,"input",37),t.ɵɵpipe(91,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(92,"div",36)(93,"mat-slide-toggle",38)(94,"mat-label",39),t.ɵɵpipe(95,"translate"),t.ɵɵtext(96),t.ɵɵpipe(97,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(98,"div",36)(99,"mat-slide-toggle",40)(100,"mat-label",39),t.ɵɵpipe(101,"translate"),t.ɵɵtext(102),t.ɵɵpipe(103,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(104,"div",17)(105,"div",41),t.ɵɵpipe(106,"translate"),t.ɵɵelementStart(107,"span",42),t.ɵɵtext(108," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(109,"mat-form-field",19),t.ɵɵelement(110,"input",43),t.ɵɵpipe(111,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(112,"div",17)(113,"div",44),t.ɵɵpipe(114,"translate"),t.ɵɵtext(115,"gateway.connect-attempt-time"),t.ɵɵelementEnd(),t.ɵɵelementStart(116,"mat-form-field",19),t.ɵɵelement(117,"input",45),t.ɵɵpipe(118,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(119,"div",17)(120,"div",44),t.ɵɵpipe(121,"translate"),t.ɵɵtext(122,"gateway.connect-attempt-count"),t.ɵɵelementEnd(),t.ɵɵelementStart(123,"mat-form-field",19),t.ɵɵelement(124,"input",46),t.ɵɵpipe(125,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(126,"div",17)(127,"div",44),t.ɵɵpipe(128,"translate"),t.ɵɵtext(129,"gateway.wait-after-failed-attempts"),t.ɵɵelementEnd(),t.ɵɵelementStart(130,"mat-form-field",19),t.ɵɵelement(131,"input",47),t.ɵɵpipe(132,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(133,"div",29),t.ɵɵelement(134,"tb-modbus-values",48),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(135,"div",49)(136,"button",50),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(137),t.ɵɵpipe(138,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(139,"button",51),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(140),t.ɵɵpipe(141,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(22),i=t.ɵɵreference(55);t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,45,"gateway.server-slave")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.modbusHelpLink),t.ɵɵadvance(4),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(25,47,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(33,49,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(37,51,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(44,53,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(51,55,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.data.hideNewFields)("ngIfElse",i),t.ɵɵadvance(11),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(65,57,"gateway.hints.modbus.connection-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(69,59,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(72,61,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(79,63,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(87,65,"gateway.hints.modbus.retries")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(91,67,"gateway.set")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(95,69,"gateway.hints.modbus.retries-on-empty")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(97,71,"gateway.retries-on-empty")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(101,73,"gateway.hints.modbus.retries-on-invalid")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(103,75,"gateway.retries-on-invalid")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(106,77,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(111,79,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(114,81,"gateway.hints.modbus.connect-attempt-time")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(118,83,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(121,85,"gateway.hints.modbus.connect-attempt-count")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(125,87,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(128,89,"gateway.hints.modbus.wait-after-failed-attempts")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(132,91,"gateway.set")),t.ɵɵadvance(3),t.ɵɵproperty("singleMode",!0)("hideNewFields",n.data.hideNewFields),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(138,93,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.slaveConfigFormGroup.invalid||!n.slaveConfigFormGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(141,95,n.data.buttonTitle)," ")}},dependencies:t.ɵɵgetComponentDepsFactory(zZ,[se,_,ZX,eZ,u$,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%] .slaves-config-container[_ngcontent-%COMP%]{width:80vw;max-width:900px}[_nghost-%COMP%] .slave-name-label[_ngcontent-%COMP%]{margin-right:16px;color:#000000de}[_nghost-%COMP%] .fixed-title-width-260[_ngcontent-%COMP%]{min-width:260px}[_nghost-%COMP%] .security-config .fixed-title-width{min-width:230px}'],changeDetection:d.OnPush})}}function UZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusProtocolLabelsMap.get(e))}}function jZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function HZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",39),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,jZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("host").hasError("required")&&e.slaveConfigFormGroup.get("host").touched)}}function WZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.slaveConfigFormGroup.get("port")))}}function $Z(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",41),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,WZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.hints.modbus.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",e.portLimits.MIN),t.ɵɵpropertyInterpolate("max",e.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(e.slaveConfigFormGroup.get("port").hasError("required")||e.slaveConfigFormGroup.get("port").hasError("min")||e.slaveConfigFormGroup.get("port").hasError("max"))&&e.slaveConfigFormGroup.get("port").touched)}}function KZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function YZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",14),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12),t.ɵɵelement(5,"input",42),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,KZ,3,3,"mat-icon",16),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.modbus.serial-port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.slaveConfigFormGroup.get("port").hasError("required")&&e.slaveConfigFormGroup.get("port").touched)}}function XZ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.ModbusMethodLabelsMap.get(e))}}function ZZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.unit-id-required"))}function QZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function JZ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function eQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function tQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10)(1,"div",11),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.baudrate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",12)(5,"mat-select",43),t.ɵɵtemplate(6,eQ,2,2,"mat-option",6),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.modbus.baudrate")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",e.modbusBaudrates)}}function nQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function iQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",38),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function aQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",44)(1,"mat-expansion-panel",45)(2,"mat-expansion-panel-header",46)(3,"mat-panel-title")(4,"mat-slide-toggle",47),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(5,"mat-label"),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(8,"tb-modbus-security-config",48),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("expanded",e.showSecurityControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",e.showSecurityControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,3,"gateway.tls-connection")," ")}}e("ModbusLegacySlaveDialogComponent",zZ);class rQ{constructor(e){this.fb=e,this.ModbusProtocolLabelsMap=ha,this.ModbusMethodLabelsMap=ma,this.portLimits=Oi,this.modbusProtocolTypes=Object.values(ea),this.modbusMethodTypes=Object.values(ta),this.modbusSerialMethodTypes=Object.values(na),this.modbusOrderType=Object.values(aa),this.ModbusProtocolType=ea,this.modbusBaudrates=sa,this.isSlaveEnabled=!1,this.serialSpecificControlKeys=["serialPort","baudrate"],this.tcpUdpSpecificControlKeys=["port","security","host"],this.destroy$=new we,this.showSecurityControl=this.fb.control(!1),this.slaveConfigFormGroup=this.fb.group({type:[ea.TCP],host:["",[me.required,me.pattern(pn)]],port:[null,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],serialPort:["",[me.required,me.pattern(pn)]],method:[ta.SOCKET],unitId:[null,[me.required]],baudrate:[this.modbusBaudrates[0]],deviceName:["",[me.required,me.pattern(pn)]],deviceType:["",[me.required,me.pattern(pn)]],pollPeriod:[1e3,[me.required]],sendDataToThingsBoard:[!1],byteOrder:[aa.BIG],wordOrder:[aa.BIG],security:[],identity:this.fb.group({vendorName:["",[me.pattern(pn)]],productCode:["",[me.pattern(pn)]],vendorUrl:["",[me.pattern(pn)]],productName:["",[me.pattern(pn)]],modelName:["",[me.pattern(pn)]]}),values:[]}),this.observeValueChanges(),this.observeTypeChange(),this.observeShowSecurity()}get protocolType(){return this.slaveConfigFormGroup.get("type").value}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}validate(){return this.slaveConfigFormGroup.valid?null:{slaveConfigFormGroup:{valid:!1}}}writeValue(e){this.showSecurityControl.patchValue(!!e.security&&!W(e.security,{})),this.updateSlaveConfig(e)}setDisabledState(e){this.isSlaveEnabled=!e,this.updateFormEnableState()}observeValueChanges(){this.slaveConfigFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{e.type===ea.Serial&&(e.port=e.serialPort,delete e.serialPort),this.onChange(e),this.onTouched()}))}observeTypeChange(){this.slaveConfigFormGroup.get("type").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateFormEnableState(),this.updateMethodType(e)}))}updateMethodType(e){this.slaveConfigFormGroup.get("method").value!==ta.RTU&&this.slaveConfigFormGroup.get("method").patchValue(e===ea.Serial?na.ASCII:ta.SOCKET,{emitEvent:!1})}updateFormEnableState(){this.isSlaveEnabled?(this.slaveConfigFormGroup.enable({emitEvent:!1}),this.showSecurityControl.enable({emitEvent:!1})):(this.slaveConfigFormGroup.disable({emitEvent:!1}),this.showSecurityControl.disable({emitEvent:!1})),this.updateEnablingByProtocol(),this.updateSecurityEnable(this.showSecurityControl.value)}observeShowSecurity(){this.showSecurityControl.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>this.updateSecurityEnable(e)))}updateSecurityEnable(e){e&&this.isSlaveEnabled&&this.protocolType!==ea.Serial?this.slaveConfigFormGroup.get("security").enable({emitEvent:!1}):this.slaveConfigFormGroup.get("security").disable({emitEvent:!1})}updateEnablingByProtocol(){const e=this.protocolType===ea.Serial,t=e?this.serialSpecificControlKeys:this.tcpUdpSpecificControlKeys,n=e?this.tcpUdpSpecificControlKeys:this.serialSpecificControlKeys;this.isSlaveEnabled&&t.forEach((e=>this.slaveConfigFormGroup.get(e)?.enable({emitEvent:!1}))),n.forEach((e=>this.slaveConfigFormGroup.get(e)?.disable({emitEvent:!1})))}updateSlaveConfig(e){const{vendorName:t="",productCode:n="",vendorUrl:i="",productName:a="",modelName:r=""}=e.identity??{},o={vendorName:t,productCode:n,vendorUrl:i,productName:a,modelName:r},{type:s=ea.TCP,method:l=ta.RTU,unitId:p=0,deviceName:c="",deviceType:d="",pollPeriod:u=1e3,sendDataToThingsBoard:m=!1,byteOrder:h=aa.BIG,wordOrder:g=aa.BIG,security:f={},values:y={},baudrate:v=this.modbusBaudrates[0],host:x="",port:b=null}=e,w={type:s,method:l,unitId:p,deviceName:c,deviceType:d,pollPeriod:u,sendDataToThingsBoard:!!m,byteOrder:h,wordOrder:g,security:f,identity:o,values:y,baudrate:v,host:s===ea.Serial?"":x,port:s===ea.Serial?null:b,serialPort:s===ea.Serial?b:""};this.slaveConfigFormGroup.setValue(w,{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||rQ)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:rQ,selectors:[["tb-modbus-slave-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>rQ)),multi:!0},{provide:he,useExisting:c((()=>rQ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:112,vars:59,consts:[["serialPort",""],[1,"slave-container",3,"formGroup"],[1,"slave-content","tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["translate","",1,"fixed-title-width"],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-panel","no-border","no-padding","padding-top"],["class","tb-form-row column-xs",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf","ngIfElse"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","method"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","unitId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","100","name","value","formControlName","pollPeriod",3,"placeholder"],[1,"tb-form-row"],["formControlName","sendDataToThingsBoard",1,"mat-slide"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],["formControlName","byteOrder"],["formControlName","wordOrder"],["class","tb-form-panel stroked tb-slide-toggle",4,"ngIf"],[3,"formGroup"],["matInput","","name","value","formControlName","vendorName",3,"placeholder"],["matInput","","name","value","formControlName","productCode",3,"placeholder"],["matInput","","name","value","formControlName","vendorUrl",3,"placeholder"],["matInput","","name","value","formControlName","productName",3,"placeholder"],["matInput","","name","value","formControlName","modelName",3,"placeholder"],["formControlName","values"],[3,"value"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matInput","","name","value","formControlName","serialPort",3,"placeholder"],["formControlName","baudrate"],[1,"tb-form-panel","stroked","tb-slide-toggle"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],["formControlName","security"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t.ɵɵtext(4,"gateway.server-slave-config"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",5),t.ɵɵtemplate(6,UZ,2,2,"tb-toggle-option",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",7),t.ɵɵtemplate(8,HZ,8,7,"div",8)(9,$Z,8,9,"div",9)(10,YZ,8,7,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",10)(13,"div",11),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15," gateway.method "),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"mat-form-field",12)(17,"mat-select",13),t.ɵɵtemplate(18,XZ,2,2,"mat-option",6),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(19,"div",10)(20,"div",14),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22,"gateway.unit-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",12),t.ɵɵelement(24,"input",15),t.ɵɵpipe(25,"translate"),t.ɵɵtemplate(26,ZZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(27,"div",10)(28,"div",17),t.ɵɵtext(29,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",12),t.ɵɵelement(31,"input",18),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,QZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(34,"div",10)(35,"div",17),t.ɵɵtext(36,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"mat-form-field",12),t.ɵɵelement(38,"input",19),t.ɵɵpipe(39,"translate"),t.ɵɵtemplate(40,JZ,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(41,"div",10)(42,"div",20),t.ɵɵpipe(43,"translate"),t.ɵɵelementStart(44,"span",21),t.ɵɵtext(45," gateway.poll-period "),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"mat-form-field",12),t.ɵɵelement(47,"input",22),t.ɵɵpipe(48,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(49,tQ,7,4,"div",8),t.ɵɵelementStart(50,"div",23)(51,"mat-slide-toggle",24)(52,"mat-label"),t.ɵɵtext(53),t.ɵɵpipe(54,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(55,"div",25)(56,"mat-expansion-panel",26)(57,"mat-expansion-panel-header")(58,"mat-panel-title")(59,"div",27),t.ɵɵtext(60,"gateway.advanced-connection-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(61,"div",7)(62,"div",10)(63,"div",11),t.ɵɵpipe(64,"translate"),t.ɵɵtext(65,"gateway.byte-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(66,"mat-form-field",12)(67,"mat-select",28),t.ɵɵtemplate(68,nQ,2,2,"mat-option",6),t.ɵɵelementEnd()()(),t.ɵɵelementStart(69,"div",10)(70,"div",11),t.ɵɵpipe(71,"translate"),t.ɵɵtext(72,"gateway.word-order"),t.ɵɵelementEnd(),t.ɵɵelementStart(73,"mat-form-field",12)(74,"mat-select",29),t.ɵɵtemplate(75,iQ,2,2,"mat-option",6),t.ɵɵelementEnd()()(),t.ɵɵtemplate(76,aQ,9,5,"div",30),t.ɵɵelementContainerStart(77,31),t.ɵɵelementStart(78,"div",10)(79,"div",4),t.ɵɵtext(80,"gateway.vendor-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(81,"mat-form-field",12),t.ɵɵelement(82,"input",32),t.ɵɵpipe(83,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(84,"div",10)(85,"div",4),t.ɵɵtext(86,"gateway.product-code"),t.ɵɵelementEnd(),t.ɵɵelementStart(87,"mat-form-field",12),t.ɵɵelement(88,"input",33),t.ɵɵpipe(89,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(90,"div",10)(91,"div",4),t.ɵɵtext(92,"gateway.vendor-url"),t.ɵɵelementEnd(),t.ɵɵelementStart(93,"mat-form-field",12),t.ɵɵelement(94,"input",34),t.ɵɵpipe(95,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(96,"div",10)(97,"div",4),t.ɵɵtext(98,"gateway.product-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(99,"mat-form-field",12),t.ɵɵelement(100,"input",35),t.ɵɵpipe(101,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(102,"div",10)(103,"div",4),t.ɵɵtext(104,"gateway.model-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(105,"mat-form-field",12),t.ɵɵelement(106,"input",36),t.ɵɵpipe(107,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()(),t.ɵɵelementStart(108,"div",25)(109,"div",27),t.ɵɵtext(110,"gateway.values"),t.ɵɵelementEnd(),t.ɵɵelement(111,"tb-modbus-values",37),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵreference(11);t.ɵɵproperty("formGroup",n.slaveConfigFormGroup),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.modbusProtocolTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial)("ngIfElse",e),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,29,"gateway.hints.modbus.framer-type")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.protocolType===n.ModbusProtocolType.Serial?n.modbusSerialMethodTypes:n.modbusMethodTypes),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,31,"gateway.hints.modbus.unit-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(25,33,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("unitId").hasError("required")&&n.slaveConfigFormGroup.get("unitId").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,35,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceName").hasError("required")&&n.slaveConfigFormGroup.get("deviceName").touched),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(39,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.slaveConfigFormGroup.get("deviceType").hasError("required")&&n.slaveConfigFormGroup.get("deviceType").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(43,39,"gateway.hints.modbus.poll-period")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(48,41,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.protocolType===n.ModbusProtocolType.Serial),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(54,43,"gateway.send-data-to-platform")," "),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(64,45,"gateway.hints.modbus.byte-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(71,47,"gateway.hints.modbus.word-order")),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.modbusOrderType),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.protocolType!==n.ModbusProtocolType.Serial),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.slaveConfigFormGroup.get("identity")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(83,49,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(89,51,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(95,53,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(101,55,"gateway.set")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(107,57,"gateway.set"))}},dependencies:t.ɵɵgetComponentDepsFactory(rQ,[se,_,ZX,eZ,u$,Wn]),encapsulation:2,changeDetection:d.OnPush})}}e("ModbusSlaveConfigComponent",rQ);const oQ=["searchInput"],sQ=()=>["deviceName","info","unitId","type","actions"],lQ=()=>({minWidth:"96px",textAlign:"center"});function pQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",28)(2,"span",29),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",11),t.ɵɵelementStart(6,"button",13),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageSlave(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",13),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.servers-slaves")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function cQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function dQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.deviceName)}}function uQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.info")," "))}function mQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){let e;const i=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(null!==(e=i.host)&&void 0!==e?e:i.port)}}function hQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.unit-id")," "))}function gQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.unitId)}}function fQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.type")))}function yQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.ModbusProtocolLabelsMap.get(e.type)," ")}}function vQ(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",32)}function xQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageSlave(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",13),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteSlave(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function bQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,xQ,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",33),t.ɵɵelementContainer(4,34),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",35)(6,"button",36),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",37),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",38,2),t.ɵɵelementContainer(11,34),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,lQ)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function wQ(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",39)}function SQ(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class CQ{constructor(e,t,n,i,a){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.cdr=a,this.isLegacy=!1,this.textSearchMode=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.ModbusProtocolLabelsMap=ha,this.onChange=()=>{},this.onTouched=()=>{},this.destroy$=new we,this.masterFormGroup=this.fb.group({slaves:this.fb.array([])}),this.dataSource=new _Q}get slaves(){return this.masterFormGroup.get("slaves")}ngOnInit(){this.masterFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateTableData(e.slaves),this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(De(150),Pe(((e,t)=>(e??"")===t.trim())),Me(this.destroy$)).subscribe((e=>this.updateTableData(this.slaves.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.slaves.clear(),this.pushDataAsFormArrays(e.slaves)}enterFilterMode(){this.textSearchMode=!0,this.cdr.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.slaves.value),this.textSearchMode=!1,this.textSearch.reset()}manageSlave(e,t){e&&e.stopPropagation();const n=J(t),i=n?this.slaves.at(t).value:{};this.getSlaveDialog(i,n?"action.apply":"action.add").afterClosed().pipe(Ne(1),Me(this.destroy$)).subscribe((e=>{e&&(n?this.slaves.at(t).patchValue(e):this.slaves.push(this.fb.control(e)),this.masterFormGroup.markAsDirty())}))}getSlaveDialog(e,t){return this.isLegacy?this.dialog.open(zZ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,hideNewFields:!0,buttonTitle:t}}):this.dialog.open(wZ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,hideNewFields:!1}})}deleteSlave(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-slave-title",{name:this.slaves.controls[t].value.deviceName}),this.translate.instant("gateway.delete-slave-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(Ne(1),Me(this.destroy$)).subscribe((e=>{e&&(this.slaves.removeAt(t),this.masterFormGroup.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.slaves.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||CQ)(t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:CQ,selectors:[["tb-modbus-master-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(oQ,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{isLegacy:"isLegacy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>CQ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:55,vars:41,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-master-table","tb-absolute-fill"],[1,"tb-form-panel","no-border","no-padding","padding-top","hint-container"],["tbTruncateWithTooltip","",1,"tb-form-hint","tb-primary-fill","tb-flex"],[1,"tb-master-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-master-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"div",5),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"div",6)(6,"mat-toolbar",7),t.ɵɵtemplate(7,pQ,14,9,"div",8),t.ɵɵpipe(8,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"mat-toolbar",7)(10,"div",9)(11,"button",10),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"mat-icon"),t.ɵɵtext(14,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(15,"mat-form-field",11)(16,"mat-label"),t.ɵɵtext(17," "),t.ɵɵelementEnd(),t.ɵɵelement(18,"input",12,0),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",13),t.ɵɵpipe(22,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(23,"mat-icon"),t.ɵɵtext(24,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(25,"div",14)(26,"table",15),t.ɵɵelementContainerStart(27,16),t.ɵɵtemplate(28,cQ,4,3,"mat-header-cell",17)(29,dQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(30,16),t.ɵɵtemplate(31,uQ,3,3,"mat-header-cell",17)(32,mQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(33,16),t.ɵɵtemplate(34,hQ,3,3,"mat-header-cell",17)(35,gQ,3,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(36,16),t.ɵɵtemplate(37,fQ,4,3,"mat-header-cell",17)(38,yQ,2,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(39,19),t.ɵɵtemplate(40,vQ,1,0,"mat-header-cell",20)(41,bQ,12,6,"mat-cell",21),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(42,wQ,1,0,"mat-header-row",22)(43,SQ,1,0,"mat-row",23),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"section",24),t.ɵɵpipe(45,"async"),t.ɵɵelementStart(46,"button",25),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageSlave(i))})),t.ɵɵelementStart(47,"mat-icon",26),t.ɵɵtext(48,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(49,"span"),t.ɵɵtext(50),t.ɵɵpipe(51,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(52,"span",27),t.ɵɵpipe(53,"async"),t.ɵɵtext(54," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,23,"gateway.hints.modbus-master")),t.ɵɵadvance(3),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(8,25,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(12,27,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(20,29,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(22,31,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","info"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","unitId"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","type"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(39,sQ))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(40,sQ)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(45,33,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(51,35,"gateway.add-slave")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(53,37,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(CQ,[se,_,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 60px);background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .tb-master-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-master-table[_ngcontent-%COMP%] .tb-master-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:15%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-master-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] .hint-container[_ngcontent-%COMP%]{z-index:1000}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("ModbusMasterTableComponent",CQ),He([ot()],CQ.prototype,"isLegacy",void 0);class _Q extends G{constructor(){super()}}e("SlavesDatasource",_Q);class TQ extends Ua{constructor(){super(),this.enableSlaveControl=new fe(!1),this.enableSlaveControl.valueChanges.pipe(In()).subscribe((e=>{this.updateSlaveEnabling(e),this.basicFormGroup.get("slave").updateValueAndValidity({emitEvent:!!this.onChange})}))}writeValue(e){super.writeValue(e),this.onEnableSlaveControl(e)}validate(){const{master:e,slave:t}=this.basicFormGroup.value,n=!e?.slaves?.length&&(W(t,{})||!t);return!this.basicFormGroup.valid||n?{basicFormGroup:{valid:!1}}:null}initBasicFormGroup(){return this.fb.group({master:[],slave:[]})}updateSlaveEnabling(e){e?this.basicFormGroup.get("slave").enable({emitEvent:!1}):this.basicFormGroup.get("slave").disable({emitEvent:!1})}onEnableSlaveControl(e){this.enableSlaveControl.setValue(!!e.slave&&!W(e.slave,{}))}static{this.ɵfac=function(e){return new(e||TQ)}}static{this.ɵdir=t.ɵɵdefineDirective({type:TQ,features:[t.ɵɵInheritDefinitionFeature]})}}e("ModbusBasicConfigDirective",TQ);class IQ extends TQ{constructor(){super(...arguments),this.isLegacy=!1}mapConfigToFormValue({master:e,slave:t}){return{master:e?.slaves?e:{slaves:[]},slave:t??{}}}getMappedValue(e){return{master:e.master,slave:e.slave}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(IQ)))(n||IQ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:IQ,selectors:[["tb-modbus-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>IQ)),multi:!0},{provide:he,useExisting:c((()=>IQ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:19,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","master",3,"isLegacy"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-form-hint","tb-primary-fill","tb-flex","center"],[1,"tb-form-row"],[1,"mat-slide",3,"formControl"],["formControlName","slave"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-modbus-master-table",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4)(10,"div",5),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",6)(14,"mat-slide-toggle",7)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(18,"tb-modbus-slave-config",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(5,11,"gateway.master-connections")),t.ɵɵadvance(2),t.ɵɵproperty("isLegacy",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(8,13,"gateway.server-config")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,15,"gateway.hints.modbus-server")),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.enableSlaveControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,17,"gateway.enable")," "))},dependencies:t.ɵɵgetComponentDepsFactory(IQ,[se,_,rQ,CQ,$n]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}'],changeDetection:d.OnPush})}}e("ModbusBasicConfigComponent",IQ);class EQ extends TQ{constructor(){super(...arguments),this.isLegacy=!0}mapConfigToFormValue(e){return{master:e.master?.slaves?e.master:{slaves:[]},slave:e.slave?Xa.mapSlaveToUpgradedVersion(e.slave):{}}}getMappedValue(e){return{master:e.master,slave:e.slave?Xa.mapSlaveToDowngradedVersion(e.slave):{}}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(EQ)))(n||EQ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:EQ,selectors:[["tb-modbus-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>EQ)),multi:!0},{provide:he,useExisting:c((()=>EQ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:19,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","master",3,"isLegacy"],[1,"tb-form-panel","no-border","no-padding","padding-top"],[1,"tb-form-hint","tb-primary-fill","tb-flex","center"],[1,"tb-form-row"],[1,"mat-slide",3,"formControl"],["formControlName","slave"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-modbus-master-table",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4)(10,"div",5),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",6)(14,"mat-slide-toggle",7)(15,"mat-label"),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelement(18,"tb-modbus-slave-config",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(5,11,"gateway.master-connections")),t.ɵɵadvance(2),t.ɵɵproperty("isLegacy",n.isLegacy),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(8,13,"gateway.server-config")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(12,15,"gateway.hints.modbus-server")),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.enableSlaveControl),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,17,"gateway.enable")," "))},dependencies:t.ɵɵgetComponentDepsFactory(EQ,[se,_,rQ,CQ,$n]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}'],changeDetection:d.OnPush})}}e("ModbusLegacyBasicConfigComponent",EQ);const MQ=()=>({maxWidth:"970px"});function kQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",20),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.get("key").value," ")}}function PQ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(e.get("methodRPC").value)}}function DQ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate(e.get("attributeOnThingsBoard").value)}}function OQ(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtext(1),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(2).$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate2(" ",e.get("requestExpression").value+" - ","",e.get("attributeNameExpression").value," ")}}function AQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",21),t.ɵɵtemplate(1,PQ,2,1,"ng-container",22)(2,DQ,2,1,"ng-container",22)(3,OQ,2,2,"ng-container",22),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngSwitch",e.keysType),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.ATTRIBUTES_UPDATES),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.SocketValueKey.ATTRIBUTES_REQUESTS)}}function FQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function RQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function BQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function NQ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",42),2&e){const e=t.ɵɵnextContext(5);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}function LQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",24)(2,"div",25),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",26)(5,"div",27),t.ɵɵpipe(6,"translate"),t.ɵɵpipe(7,"translate"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"div",28)(11,"mat-form-field",29),t.ɵɵelement(12,"input",30),t.ɵɵpipe(13,"translate"),t.ɵɵtemplate(14,FQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(15,"div",24)(16,"div",25),t.ɵɵtext(17,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",26)(19,"div",32)(20,"span",33),t.ɵɵtext(21),t.ɵɵpipe(22,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(23,"div",34),t.ɵɵelementEnd(),t.ɵɵelementStart(24,"label",35),t.ɵɵtext(25,"from"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",36),t.ɵɵelement(27,"input",37),t.ɵɵpipe(28,"translate"),t.ɵɵtemplate(29,RQ,3,3,"mat-icon",31),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"label",38),t.ɵɵtext(31,"to"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-form-field",36),t.ɵɵelement(33,"input",39),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,BQ,3,3,"mat-icon",31),t.ɵɵelementEnd()(),t.ɵɵtemplate(36,NQ,1,2,"tb-report-strategy",40),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",n.keysType===n.SocketValueKey.ATTRIBUTES?t.ɵɵpipeBind1(6,12,"gateway.hints.socket.key-attribute"):t.ɵɵpipeBind1(7,14,"gateway.hints.socket.key-telemetry")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,16,"gateway.key")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(13,18,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("key").hasError("required")&&e.get("key").touched),t.ɵɵadvance(7),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(22,20,"gateway.byte")),t.ɵɵadvance(2),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/byte_fn")("tb-help-popup-style",t.ɵɵpureFunction0(26,MQ)),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,22,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("byteFrom").hasError("required")&&e.get("byteFrom").touched),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(34,24,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("byteTo").hasError("required")&&e.get("byteTo").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.withReportStrategy&&(n.keysType===n.SocketValueKey.ATTRIBUTES||n.keysType===n.SocketValueKey.TIMESERIES))}}function VQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function qQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function GQ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",43),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29),t.ɵɵelement(7,"input",44),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,VQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",26)(11,"div",45),t.ɵɵpipe(12,"translate"),t.ɵɵtext(13," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",28)(15,"mat-form-field",29)(16,"mat-select",46),t.ɵɵtemplate(17,qQ,2,2,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(18,"div",48)(19,"mat-slide-toggle",49),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(20,"mat-label",50),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()()()}if(2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,7,"gateway.method-name")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("methodRPC").hasError("required")&&e.get("methodRPC").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(12,11,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(21,13,"gateway.hints.socket.with-response")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,15,"gateway.rpc.withResponse")," ")}}function zQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function UQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function jQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.request-expression-required"))}function HQ(e,n){1&e&&t.ɵɵelement(0,"div",34),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/request-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,MQ))}function WQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e)," ")}}function $Q(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.attribute-name-expression-required"))}function KQ(e,n){1&e&&t.ɵɵelement(0,"div",34),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/attribute-name-expression_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,MQ))}function YQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",45),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4," gateway.type "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29)(7,"mat-select",52),t.ɵɵtemplate(8,zQ,3,4,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",26)(10,"div",43),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",53)(14,"mat-form-field",29)(15,"mat-select",54),t.ɵɵtemplate(16,UQ,3,4,"mat-option",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"mat-form-field",29),t.ɵɵelement(18,"input",55),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,jQ,3,3,"mat-icon",31)(21,HQ,1,3,"div",56),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",26)(23,"div",43),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"div",53)(27,"mat-form-field",29)(28,"mat-select",57),t.ɵɵtemplate(29,WQ,3,4,"mat-option",47),t.ɵɵelementEnd()(),t.ɵɵelementStart(30,"mat-form-field",29),t.ɵɵelement(31,"input",58),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,$Q,3,3,"mat-icon",31)(34,KQ,1,3,"div",56),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,12,"gateway.hints.socket.attribute-requests-type")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.requestsType),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,14,"gateway.request-expression")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.expressionType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,16,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("requestExpression").hasError("required")&&e.get("requestExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("requestExpressionSource").value===n.ExpressionType.Expression),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,18,"gateway.attribute-name-expression")," "),t.ɵɵadvance(5),t.ɵɵproperty("ngForOf",n.expressionType),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("attributeNameExpression").hasError("required")&&e.get("attributeNameExpression").touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.get("attributeNameExpressionSource").value===n.ExpressionType.Expression)}}function XQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",51),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function ZQ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",41),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.socket.attribute-on-platform-required"))}function QQ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",26)(2,"div",45),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",28)(6,"mat-form-field",29)(7,"mat-select",46),t.ɵɵtemplate(8,XQ,2,2,"mat-option",47),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(9,"div",26)(10,"div",43),t.ɵɵtext(11),t.ɵɵpipe(12,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"div",28)(14,"mat-form-field",29),t.ɵɵelement(15,"input",59),t.ɵɵpipe(16,"translate"),t.ɵɵtemplate(17,ZQ,3,3,"mat-icon",31),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext(2).$implicit,n=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,5,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(12,7,"gateway.attribute-on-platform")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.get("attributeOnThingsBoard").hasError("required")&&e.get("attributeOnThingsBoard").touched)}}function JQ(e,n){if(1&e&&t.ɵɵtemplate(0,LQ,37,27,"div",23)(1,GQ,24,17,"div",23)(2,YQ,35,22,"div",23)(3,QQ,18,11,"div",23),2&e){const e=t.ɵɵnextContext(3);t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.TIMESERIES||e.keysType===e.SocketValueKey.ATTRIBUTES),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.RPC_METHODS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.ATTRIBUTES_REQUESTS),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.keysType===e.SocketValueKey.ATTRIBUTES_UPDATES)}}function eJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",12)(1,"div",13),t.ɵɵelementContainerStart(2,14),t.ɵɵelementStart(3,"mat-expansion-panel",15)(4,"mat-expansion-panel-header",16)(5,"mat-panel-title"),t.ɵɵtemplate(6,kQ,2,1,"div",17)(7,AQ,4,4,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,JQ,4,4,"ng-template",18),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",19),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.last,a=t.ɵɵreference(8),r=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",r.keysType===r.SocketValueKey.TIMESERIES||r.keysType===r.SocketValueKey.ATTRIBUTES)("ngIfElse",a),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,r.deleteKeyTitle))}}function tJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",10),t.ɵɵtemplate(1,eJ,14,7,"div",11),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.keysListFormArray.controls)("ngForTrackBy",e.trackByKey)}}function nJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",60)(1,"span",61),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class iJ extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.withReportStrategy=!0,this.keysDataApplied=new u,this.SocketValueKey=hi,this.socketEncoding=Object.values(ht),this.requestsType=Object.values(fi),this.expressionType=Object.values(yi),this.ExpressionType=yi,this.ReportStrategyDefaultValue=on}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}trackByKey(e,t){return t}addKey(){let e;e=this.keysType===hi.RPC_METHODS?this.fb.group({methodRPC:["",[me.required]],encoding:[ht.UTF16,[me.required]],withResponse:[!0]}):this.keysType===hi.ATTRIBUTES_UPDATES?this.fb.group({encoding:[ht.UTF16,[me.required]],attributeOnThingsBoard:["",[me.required]]}):this.keysType===hi.ATTRIBUTES_REQUESTS?this.fb.group({type:[fi.Shared],requestExpressionSource:[yi.Constant],attributeNameExpressionSource:[yi.Constant],requestExpression:["",[me.required]],attributeNameExpression:["",[me.required]]}):this.fb.group({key:["",[me.required,me.pattern(pn)]],byteFrom:[0,[me.required]],byteTo:[0,[me.required]],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]}),this.keysListFormArray.push(e)}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){let e=this.keysListFormArray.value.map((({reportStrategy:e,...t})=>({...t,...e&&{reportStrategy:e}})));this.keysDataApplied.emit(e)}prepareKeysFormArray(e){const t=[];return e?.forEach((e=>{let n;if(this.keysType===hi.RPC_METHODS){const t=e;n=this.fb.group({methodRPC:[t.methodRPC,[me.required]],encoding:[t.encoding,[me.required]],withResponse:[t.withResponse]})}else if(this.keysType===hi.ATTRIBUTES_REQUESTS){const t=e;n=this.fb.group({type:[t.type??fi.Shared],requestExpressionSource:[t.requestExpressionSource??yi.Constant],attributeNameExpressionSource:[t.attributeNameExpressionSource??yi.Constant],requestExpression:[t.requestExpression,[me.required]],attributeNameExpression:[t.attributeNameExpression,[me.required]]})}else if(this.keysType===hi.ATTRIBUTES_UPDATES)n=this.fb.group({encoding:[e.encoding??ht.UTF16],attributeOnThingsBoard:[e.attributeOnThingsBoard,[me.required]]});else{const{key:t,byteFrom:i,byteTo:a,reportStrategy:r}=e;n=this.fb.group({key:[t,[me.required,me.pattern(pn)]],byteFrom:[i??0,[me.required]],byteTo:[a??0,[me.required]],reportStrategy:[{value:r,disabled:this.isReportStrategyDisabled()}]})}t.push(n)})),this.fb.array(t)}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keysType===hi.ATTRIBUTES||this.keysType===hi.TIMESERIES))}static{this.ɵfac=function(e){return new(e||iJ)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(at.TbPopoverComponent),t.ɵɵdirectiveInject(Xe.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:iJ,selectors:[["tb-device-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",withReportStrategy:"withReportStrategy"},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:19,vars:16,consts:[["noKeys",""],["valueTitle",""],[1,"tb-device-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],["class","tb-form-panel no-border no-padding key-panel",4,"ngIf","ngIfElse"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","key-panel"],["class","tb-form-panel no-border no-padding tb-flex no-flex row center fill-width",4,"ngFor","ngForOf","ngForTrackBy"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],["class","title-container",4,"ngIf","ngIfElse"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"title-container"],[1,"title-container",3,"ngSwitch"],[4,"ngSwitchCase"],["class","tb-form-panel no-border no-padding",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],[1,"fixed-title-width","tb-flex","align-center"],[1,"tb-required"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["for","byteFrom",1,"tb-small-label"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap","flex-1"],["matInput","","required","","formControlName","byteFrom","type","number","id","byteFrom",3,"placeholder"],["for","byteTo",1,"tb-small-label"],["matInput","","required","","formControlName","byteTo","type","number","id","byteTo",3,"placeholder"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","methodRPC",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","encoding"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-row"],["formControlName","withResponse",1,"mat-slide",3,"click"],[3,"tb-hint-tooltip-icon"],[3,"value"],["formControlName","type"],[1,"tb-flex"],["formControlName","requestExpressionSource"],["matInput","","name","value","formControlName","requestExpression",3,"placeholder"],["matSuffix","","class","see-example p-1","tb-help-popup-placement","left",3,"tb-help-popup","tb-help-popup-style",4,"ngIf"],["formControlName","attributeNameExpressionSource"],["matInput","","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matInput","","name","value","formControlName","attributeOnThingsBoard",3,"placeholder"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["translate","",1,"tb-prompt"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",2)(1,"div",3)(2,"div",4),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,tJ,2,2,"div",5),t.ɵɵelementStart(6,"div")(7,"button",6),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.addKey())})),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()(),t.ɵɵtemplate(10,nJ,3,1,"ng-template",null,0,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(12,"div",7)(13,"button",8),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(14),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.applyKeysData())})),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(11);t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,8,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.keysListFormArray.controls.length)("ngIfElse",e),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,n.addKeyTitle)," "),t.ɵɵadvance(6),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(15,12,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,14,"action.apply")," ")}},dependencies:t.ɵɵgetComponentDepsFactory(iJ,[se,_,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-small-label[_ngcontent-%COMP%]{font-size:16px;padding-right:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}e("DeviceDataKeysPanelComponent",iJ),He([I()],iJ.prototype,"withReportStrategy",void 0);const aJ=()=>({maxWidth:"970px"});function rJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-filter-required"))}function oJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-name-required"))}function sJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",40),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.device-profile-required"))}function lJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",41),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",e.toUpperCase()," ")}}function pJ(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",27),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function cJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function dJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function uJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.type," ")}}function mJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.encoding," ")}}function hJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.methodRPC," ")}}class gJ extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.destroyRef=l,this.cdr=p,this.deviceFormGroup=this.fb.group({address:["",[me.required,me.pattern(pn)]],deviceName:["",[me.required,me.pattern(pn)]],deviceType:["",[me.required,me.pattern(pn)]],encoding:[ht.UTF8],telemetry:[[]],attributes:[[]],attributeRequests:[[]],attributeUpdates:[[]],serverSideRpc:[[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.keysPopupClosed=!0,this.SocketValueKey=hi,this.socketDeviceHelpLink=O+"/docs/iot-gateway/config/socket/#device-subsection",this.socketEncoding=Object.values(ht),this.ReportStrategyDefaultValue=on,this.deviceFormGroup.patchValue(this.data.value,{emitEvent:!1})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.deviceFormGroup.valid){const e=this.deviceFormGroup.value;Y(e),this.dialogRef.close(e)}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))return void this.popoverService.hidePopover(i);const a=this.deviceFormGroup.get(n),r={keys:a.value,keysType:n,panelTitle:gi.get(n),addKeyTitle:vi.get(n),deleteKeyTitle:xi.get(n),noKeysText:bi.get(n),withReportStrategy:this.data.withReportStrategy};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,iJ,"leftBottom",!1,null,r,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(In(this.destroyRef)).subscribe((e=>{this.popoverComponent.hide(),a.patchValue(e),a.markAsDirty(),this.cdr.markForCheck()})),this.popoverComponent.tbHideStart.pipe(In(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}static{this.ɵfac=function(e){return new(e||gJ)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:gJ,selectors:[["tb-device-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:119,vars:57,consts:[["socketTelemetryButton",""],["attributesButton",""],["attributeRequestsButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"dialog-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width"],["translate","",1,"tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","name","value","formControlName","deviceName",3,"placeholder"],["matInput","","name","value","formControlName","deviceType",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","encoding"],[3,"value",4,"ngFor","ngForOf"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"tb-form-row","space-between","tb-flex"],["translate","",1,"fixed-title-width"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[4,"ngFor","ngForOf"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[3,"value"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",5)(1,"mat-toolbar",6)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",7)(6,"div",8),t.ɵɵelementStart(7,"button",9),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",10),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15),t.ɵɵtext(15," gateway.address-filter "),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"div",16)(17,"mat-form-field",17),t.ɵɵelement(18,"input",18),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,rJ,3,3,"mat-icon",19),t.ɵɵelement(21,"div",20),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"div",13)(23,"div",21),t.ɵɵtext(24,"gateway.device-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"div",16)(26,"mat-form-field",17),t.ɵɵelement(27,"input",22),t.ɵɵpipe(28,"translate"),t.ɵɵtemplate(29,oJ,3,3,"mat-icon",19),t.ɵɵelementEnd()()(),t.ɵɵelementStart(30,"div",13)(31,"div",21),t.ɵɵtext(32,"gateway.device-profile"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"div",16)(34,"mat-form-field",17),t.ɵɵelement(35,"input",23),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,sJ,3,3,"mat-icon",19),t.ɵɵelementEnd()()(),t.ɵɵelementStart(38,"div",13)(39,"div",24),t.ɵɵpipe(40,"translate"),t.ɵɵtext(41," gateway.encoding "),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",16)(43,"mat-form-field",17)(44,"mat-select",25),t.ɵɵtemplate(45,lJ,2,2,"mat-option",26),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(46,pJ,1,2,"tb-report-strategy",27),t.ɵɵelementStart(47,"div",28)(48,"div",29),t.ɵɵtext(49,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(50,"div",30)(51,"mat-chip-listbox",31),t.ɵɵtemplate(52,cJ,2,1,"mat-chip",32),t.ɵɵelementStart(53,"mat-chip",33),t.ɵɵelement(54,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(55,"button",35,0),t.ɵɵpipe(57,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(56);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.TIMESERIES))})),t.ɵɵelementStart(58,"tb-icon",36),t.ɵɵtext(59,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(60,"div",28)(61,"div",29),t.ɵɵtext(62,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"div",30)(64,"mat-chip-listbox",31),t.ɵɵtemplate(65,dJ,2,1,"mat-chip",32),t.ɵɵelementStart(66,"mat-chip",33),t.ɵɵelement(67,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(68,"button",35,1),t.ɵɵpipe(70,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(69);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES))})),t.ɵɵelementStart(71,"tb-icon",36),t.ɵɵtext(72,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(73,"div",28)(74,"div",29),t.ɵɵtext(75,"gateway.attribute-requests"),t.ɵɵelementEnd(),t.ɵɵelementStart(76,"div",30)(77,"mat-chip-listbox",31),t.ɵɵtemplate(78,uJ,2,1,"mat-chip",32),t.ɵɵelementStart(79,"mat-chip",33),t.ɵɵelement(80,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(81,"button",35,2),t.ɵɵpipe(83,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(82);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES_REQUESTS))})),t.ɵɵelementStart(84,"tb-icon",36),t.ɵɵtext(85,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(86,"div",28)(87,"div",29),t.ɵɵtext(88,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(89,"div",30)(90,"mat-chip-listbox",31),t.ɵɵtemplate(91,mJ,2,1,"mat-chip",32),t.ɵɵelementStart(92,"mat-chip",33),t.ɵɵelement(93,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(94,"button",35,3),t.ɵɵpipe(96,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(95);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(97,"tb-icon",36),t.ɵɵtext(98,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(99,"div",28)(100,"div",29),t.ɵɵtext(101,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(102,"div",30)(103,"mat-chip-listbox",31),t.ɵɵtemplate(104,hJ,2,1,"mat-chip",32),t.ɵɵelementStart(105,"mat-chip",33),t.ɵɵelement(106,"label",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(107,"button",35,4),t.ɵɵpipe(109,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(108);return t.ɵɵresetView(n.manageKeys(i,a,n.SocketValueKey.RPC_METHODS))})),t.ɵɵelementStart(110,"tb-icon",36),t.ɵɵtext(111,"edit"),t.ɵɵelementEnd()()()()()(),t.ɵɵelementStart(112,"div",37)(113,"button",38),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(114),t.ɵɵpipe(115,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(116,"button",39),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(117),t.ɵɵpipe(118,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵproperty("formGroup",n.deviceFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,32,"gateway.device")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.socketDeviceHelpLink),t.ɵɵadvance(12),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,34,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("address").hasError("required")&&n.deviceFormGroup.get("address").touched),t.ɵɵadvance(),t.ɵɵproperty("tb-help-popup","widget/lib/gateway/address-filter_fn")("tb-help-popup-style",t.ɵɵpureFunction0(56,aJ)),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,36,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("deviceName").hasError("required")&&n.deviceFormGroup.get("deviceName").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,38,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.deviceFormGroup.get("deviceType").hasError("required")&&n.deviceFormGroup.get("deviceType").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(40,40,"gateway.hints.encoding")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.socketEncoding),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?46:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("telemetry").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("telemetry").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(57,42,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,44,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeRequests").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributeRequests").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(83,46,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(96,48,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(109,50,"action.edit")),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(115,52,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.deviceFormGroup.invalid||!n.deviceFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(118,54,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(gJ,[se,_,$n,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%]{width:77vw;max-width:800px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .dialog-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}[_nghost-%COMP%] .device-config{gap:12px;padding-left:10px;padding-right:10px}[_nghost-%COMP%] .device-node-pattern-field{flex-basis:3%}'],changeDetection:d.OnPush})}}e("DeviceDialogComponent",gJ);const fJ=["searchInput"],yJ=()=>["address","deviceName","actions"],vJ=()=>({minWidth:"96px",textAlign:"center"});function xJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",26)(2,"span",27),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageDevices(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.devices")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function bJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.address-filter")," "))}function wJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.address)}}function SJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function CJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.deviceName)}}function _J(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",30)}function TJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageDevices(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteDevice(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function IJ(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,TJ,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",31),t.ɵɵelementContainer(4,32),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"button",34),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",35),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",36,2),t.ɵɵelementContainer(11,32),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,vJ)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function EJ(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",37)}function MJ(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class kJ{constructor(e,t,n,i,a){this.translate=e,this.dialog=t,this.dialogService=n,this.fb=i,this.cdr=a,this.withReportStrategy=!0,this.textSearchMode=!1,this.textSearch=this.fb.control("",{nonNullable:!0}),this.onChange=()=>{},this.destroy$=new we,this.devicesFormGroup=this.fb.array([]),this.dataSource=new PJ}ngOnInit(){this.devicesFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.updateTableData(e),this.onChange(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngAfterViewInit(){this.textSearch.valueChanges.pipe(De(150),Pe(((e,t)=>(e??"")===t.trim())),Me(this.destroy$)).subscribe((e=>this.updateTableData(this.devicesFormGroup.value,e.trim())))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.devicesFormGroup.clear(),this.pushDataAsFormArrays(e)}enterFilterMode(){this.textSearchMode=!0,this.cdr.detectChanges();const e=this.searchInputField.nativeElement;e.focus(),e.setSelectionRange(0,0)}exitFilterMode(){this.updateTableData(this.devicesFormGroup.value),this.textSearchMode=!1,this.textSearch.reset()}manageDevices(e,t){e&&e.stopPropagation();const n=J(t),i=n?this.devicesFormGroup.at(t).value:{};this.getDeviceDialog(i,n?"action.apply":"action.add").afterClosed().pipe(Ne(1),Me(this.destroy$)).subscribe((e=>{e&&(n?this.devicesFormGroup.at(t).patchValue(e):this.devicesFormGroup.push(this.fb.control(e)),this.devicesFormGroup.markAsDirty())}))}validate(){return this.devicesFormGroup.controls.length?null:{devicesFormGroup:{valid:!1}}}getDeviceDialog(e,t){return this.dialog.open(gJ,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy}})}deleteDevice(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-device-title",{name:this.devicesFormGroup.controls[t].value.deviceName}),this.translate.instant("gateway.delete-device-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(Ne(1),Me(this.destroy$)).subscribe((e=>{e&&(this.devicesFormGroup.removeAt(t),this.devicesFormGroup.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}pushDataAsFormArrays(e){e?.length&&e.forEach((e=>this.devicesFormGroup.push(this.fb.control(e))))}static{this.ɵfac=function(e){return new(e||kJ)(t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:kJ,selectors:[["tb-devices-config-table"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(fJ,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.searchInputField=e.first)}},inputs:{withReportStrategy:"withReportStrategy"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>kJ)),multi:!0},{provide:he,useExisting:c((()=>kJ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:45,vars:36,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-device-table","tb-absolute-fill"],[1,"tb-device-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-device-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,xJ,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵelementContainerStart(23,14),t.ɵɵtemplate(24,bJ,3,3,"mat-header-cell",15)(25,wJ,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(26,14),t.ɵɵtemplate(27,SJ,4,3,"mat-header-cell",15)(28,CJ,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(29,17),t.ɵɵtemplate(30,_J,1,0,"mat-header-cell",18)(31,IJ,12,6,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(32,EJ,1,0,"mat-header-row",20)(33,MJ,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"section",22),t.ɵɵpipe(35,"async"),t.ɵɵelementStart(36,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageDevices(i))})),t.ɵɵelementStart(37,"mat-icon",24),t.ɵɵtext(38,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(39,"span"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(42,"span",25),t.ɵɵpipe(43,"async"),t.ɵɵtext(44," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,20,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,22,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,24,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,26,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","address"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(34,yJ))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(35,yJ)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(35,28,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,30,"gateway.add-device")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(43,32,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(kJ,[se,_,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:35%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}e("DevicesConfigTableComponent",kJ),He([I()],kJ.prototype,"withReportStrategy",void 0);let PJ=class extends G{constructor(){super()}};function DJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",14),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function OJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.address-required"))}function AJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.socketConfigFormGroup.get("port")))}}function FJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",15),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.socketConfigFormGroup.get("bufferSize").hasError("min")?"gateway.buffer-size-range":"gateway.buffer-size-required"))}}e("DevicesDatasource",PJ);class RJ{constructor(e){this.fb=e,this.portLimits=Oi,this.socketTypes=Object.values(mi),this.onChange=e=>{},this.destroy$=new we,this.socketConfigFormGroup=this.fb.group({address:["",[me.required,me.pattern(pn)]],type:[mi.TCP],port:[5e4,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],bufferSize:[1024,[me.required,me.min(1),me.pattern(pn)]]}),this.socketConfigFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){const{address:t="",type:n=mi.TCP,port:i=5e4,bufferSize:a=1024}=e??{};this.socketConfigFormGroup.reset({address:t,type:n,port:i,bufferSize:a})}validate(){return this.socketConfigFormGroup.valid?null:{socketConfigFormGroup:{valid:!1}}}static{this.ɵfac=function(e){return new(e||RJ)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:RJ,selectors:[["tb-socket-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>RJ)),multi:!0},{provide:he,useExisting:c((()=>RJ)),multi:!0}]),t.ɵɵStandaloneFeature],decls:34,vars:25,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],[1,"fixed-title-width"],["tbTruncateWithTooltip",""],["formControlName","type","appearance","fill"],[3,"value",4,"ngFor","ngForOf"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","address",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","name","value","min","1","formControlName","bufferSize",3,"placeholder"],[3,"value"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"tb-toggle-select",4),t.ɵɵtemplate(7,DJ,2,2,"tb-toggle-option",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"div",1)(9,"div",6),t.ɵɵtext(10,"gateway.address"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"div",7)(12,"mat-form-field",8),t.ɵɵelement(13,"input",9),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,OJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",1)(17,"div",6),t.ɵɵtext(18,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",7)(20,"mat-form-field",8),t.ɵɵelement(21,"input",11),t.ɵɵpipe(22,"translate"),t.ɵɵtemplate(23,AJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()(),t.ɵɵelementStart(24,"div",1)(25,"div",12),t.ɵɵpipe(26,"translate"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",7)(30,"mat-form-field",8),t.ɵɵelement(31,"input",13),t.ɵɵpipe(32,"translate"),t.ɵɵtemplate(33,FJ,3,3,"mat-icon",10),t.ɵɵelementEnd()()()()),2&e&&(t.ɵɵproperty("formGroup",n.socketConfigFormGroup),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,13,"gateway.connection-type")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",n.socketTypes),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.socketConfigFormGroup.get("address").hasError("required")&&n.socketConfigFormGroup.get("address").touched),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(22,17,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",(n.socketConfigFormGroup.get("port").hasError("required")||n.socketConfigFormGroup.get("port").hasError("min")||n.socketConfigFormGroup.get("port").hasError("max"))&&n.socketConfigFormGroup.get("port").touched),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(26,19,"gateway.hints.buffer-size")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(28,21,"gateway.buffer-size")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(32,23,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.socketConfigFormGroup.get("bufferSize").hasError("required")||n.socketConfigFormGroup.get("bufferSize").hasError("min")&&n.socketConfigFormGroup.get("bufferSize").touched))},dependencies:t.ɵɵgetComponentDepsFactory(RJ,[se,_,u$,Wn]),encapsulation:2,changeDetection:d.OnPush})}}e("SocketConfigComponent",RJ);class BJ extends Ua{constructor(){super(...arguments),this.isLegacy=!1}getMappedValue(e){return e}initBasicFormGroup(){return this.fb.group({socket:[],devices:[]})}mapConfigToFormValue(e){return{socket:e.socket??{},devices:e.devices??[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(BJ)))(n||BJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:BJ,selectors:[["tb-socket-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>BJ)),multi:!0},{provide:he,useExisting:c((()=>BJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:10,vars:14,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","socket"],["formControlName","devices",3,"withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-socket-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-devices-config-table",4),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,8,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,10,"gateway.socket"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,12,"gateway.devices"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("withReportStrategy",!n.isLegacy))},dependencies:t.ɵɵgetComponentDepsFactory(BJ,[se,_,RJ,kJ]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}e("SocketBasicConfigComponent",BJ);class NJ extends Ua{constructor(){super(...arguments),this.isLegacy=!0}getMappedValue(e){return Qa.mapSocketToDowngradedVersion(e)}initBasicFormGroup(){return this.fb.group({socket:[],devices:[]})}mapConfigToFormValue(e){return{socket:Qa.mapSocketToUpgradedVersion(e),devices:e?.devices?Qa.mapDevicesToUpgradedVersion(e.devices):[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(NJ)))(n||NJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:NJ,selectors:[["tb-socket-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>NJ)),multi:!0},{provide:he,useExisting:c((()=>NJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:10,vars:14,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","socket"],["formControlName","devices",3,"withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-socket-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-devices-config-table",4),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,8,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,10,"gateway.socket"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,12,"gateway.devices"),"*"),t.ɵɵadvance(2),t.ɵɵproperty("withReportStrategy",!n.isLegacy))},dependencies:t.ɵɵgetComponentDepsFactory(NJ,[se,_,RJ,kJ]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}function LJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.name-required"))}function VJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function qJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.applicationConfigFormGroup.get("port")))}}function GJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.object-id-required"))}function zJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",6),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.vendor-id-required"))}function UJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",21),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.SegmentationTypeTranslationsMap.get(e))," ")}}e("SocketLegacyBasicConfigComponent",NJ);class jJ extends za{constructor(){super(...arguments),this.segmentationTypes=Object.values(Ca),this.SegmentationTypeTranslationsMap=_a,this.portLimits=Oi}get applicationConfigFormGroup(){return this.formGroup}initFormGroup(){return this.fb.group({objectName:["",[me.required,me.pattern(pn)]],host:["",[me.required,me.pattern(pn)]],port:[null,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],mask:[""],objectIdentifier:[null,[me.required]],vendorIdentifier:[null,[me.required]],maxApduLengthAccepted:[],segmentationSupported:[Ca.BOTH],networkNumber:[],deviceDiscoveryTimeoutInSec:[]})}mapOnChangeValue(e){return Y(e),e}onWriteValue(e){const{maxApduLengthAccepted:t=1476,segmentationSupported:n=Ca.BOTH,networkNumber:i=3,deviceDiscoveryTimeoutInSec:a=5,...r}=e;this.formGroup.reset({...r,maxApduLengthAccepted:t,segmentationSupported:n,networkNumber:i,deviceDiscoveryTimeoutInSec:a},{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(jJ)))(n||jJ)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:jJ,selectors:[["tb-bacnet-application-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>jJ)),multi:!0},{provide:he,useExisting:c((()=>jJ)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:83,vars:53,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","autocomplete","off","name","value","formControlName","objectName",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["translate","",1,"fixed-title-width"],["matInput","","name","value","formControlName","mask",3,"placeholder"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["matInput","","type","number","min","0","name","value","formControlName","objectIdentifier",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","vendorIdentifier",3,"placeholder"],[1,"tb-form-panel","stroked"],[1,"tb-settings"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","padding-top"],["matInput","","type","number","min","0","name","value","formControlName","maxApduLengthAccepted",3,"placeholder"],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","segmentationSupported"],[3,"value"],["matInput","","type","number","min","0","name","value","formControlName","networkNumber",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","deviceDiscoveryTimeoutInSec",3,"placeholder"],["translate","","matSuffix","",1,"block","pr-2"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.bacnet.object-name"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3)(5,"mat-form-field",4),t.ɵɵelement(6,"input",5),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,LJ,3,3,"mat-icon",6),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",1)(10,"div",2),t.ɵɵtext(11,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",4),t.ɵɵelement(13,"input",7),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,VJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(16,"div",1)(17,"div",2),t.ɵɵtext(18,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"mat-form-field",4),t.ɵɵelement(20,"input",8),t.ɵɵpipe(21,"translate"),t.ɵɵtemplate(22,qJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(23,"div",1)(24,"div",9),t.ɵɵtext(25,"gateway.network-mask"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",4),t.ɵɵelement(27,"input",10),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(29,"div",1)(30,"div",11),t.ɵɵpipe(31,"translate"),t.ɵɵtext(32,"gateway.object-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"mat-form-field",4),t.ɵɵelement(34,"input",12),t.ɵɵpipe(35,"translate"),t.ɵɵtemplate(36,GJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(37,"div",1)(38,"div",11),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"gateway.vendor-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(41,"mat-form-field",4),t.ɵɵelement(42,"input",13),t.ɵɵpipe(43,"translate"),t.ɵɵtemplate(44,zJ,3,3,"mat-icon",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(45,"div",14)(46,"mat-expansion-panel",15)(47,"mat-expansion-panel-header")(48,"mat-panel-title")(49,"div",16),t.ɵɵtext(50,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(51,"div",17)(52,"div",1)(53,"div",11),t.ɵɵpipe(54,"translate"),t.ɵɵtext(55,"gateway.bacnet.apdu-length"),t.ɵɵelementEnd(),t.ɵɵelementStart(56,"mat-form-field",4),t.ɵɵelement(57,"input",18),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(59,"div",1)(60,"div",19),t.ɵɵpipe(61,"translate"),t.ɵɵtext(62,"gateway.bacnet.segmentation.label"),t.ɵɵelementEnd(),t.ɵɵelementStart(63,"mat-form-field",4)(64,"mat-select",20),t.ɵɵrepeaterCreate(65,UJ,3,4,"mat-option",21,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵelementStart(67,"div",1)(68,"div",19),t.ɵɵpipe(69,"translate"),t.ɵɵtext(70,"gateway.bacnet.network-number"),t.ɵɵelementEnd(),t.ɵɵelementStart(71,"mat-form-field",4),t.ɵɵelement(72,"input",22),t.ɵɵpipe(73,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(74,"div",1)(75,"div",19),t.ɵɵpipe(76,"translate"),t.ɵɵtext(77,"gateway.bacnet.device-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(78,"mat-form-field",4),t.ɵɵelement(79,"input",23),t.ɵɵpipe(80,"translate"),t.ɵɵelementStart(81,"span",24),t.ɵɵtext(82,"gateway.suffix.s"),t.ɵɵelementEnd()()()()()()()),2&e&&(t.ɵɵproperty("formGroup",n.applicationConfigFormGroup),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,23,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("objectName").hasError("required")&&n.applicationConfigFormGroup.get("objectName").touched?8:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,25,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("host").hasError("required")&&n.applicationConfigFormGroup.get("host").touched?15:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(21,27,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional((n.applicationConfigFormGroup.get("port").hasError("required")||n.applicationConfigFormGroup.get("port").hasError("min")||n.applicationConfigFormGroup.get("port").hasError("max"))&&n.applicationConfigFormGroup.get("port").touched?22:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(28,29,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(31,31,"gateway.hints.bacnet.object-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(35,33,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("objectIdentifier").hasError("required")&&n.applicationConfigFormGroup.get("objectIdentifier").touched?36:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(39,35,"gateway.hints.bacnet.vendor-id")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(43,37,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.applicationConfigFormGroup.get("vendorIdentifier").hasError("required")&&n.applicationConfigFormGroup.get("vendorIdentifier").touched?44:-1),t.ɵɵadvance(9),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(54,39,"gateway.hints.bacnet.apdu-length")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(58,41,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(61,43,"gateway.hints.bacnet.segmentation")),t.ɵɵadvance(5),t.ɵɵrepeater(n.segmentationTypes),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(69,45,"gateway.hints.bacnet.network-number")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(73,47,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(76,49,"gateway.hints.bacnet.device-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(80,51,"gateway.set")))},dependencies:t.ɵɵgetComponentDepsFactory(jJ,[se,_,u$]),encapsulation:2,changeDetection:d.OnPush})}}function HJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function WJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",15)(6,"mat-form-field",6),t.ɵɵelement(7,"input",16),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,HJ,3,3,"mat-icon",11),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",e.keyType===e.BacnetDeviceKeysType.TIMESERIES?t.ɵɵpipeBind1(1,4,"gateway.hints.socket.key-telemetry"):t.ɵɵpipeBind1(2,6,"gateway.hints.socket.key-attribute")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,8,"gateway.key")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.formGroup.get("key").hasError("required")&&e.formGroup.get("key").touched?9:-1)}}function $J(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.method-required"))}function KJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",14),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",15)(5,"mat-form-field",6),t.ɵɵelement(6,"input",17),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,$J,3,3,"mat-icon",11),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(1,4,"gateway.hints.method")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,6,"gateway.method")," "),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.formGroup.get("method").hasError("required")&&e.formGroup.get("method").touched?8:-1)}}function YJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext(2);t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetRequestTypeTranslationsMap.get(e))," ")}}function XJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",18)(2,"div",14),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"tb-toggle-select",19),t.ɵɵrepeaterCreate(7,YJ,3,4,"tb-toggle-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.hints.bacnet.request-type")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,4,"gateway.bacnet.request-type.label")),t.ɵɵadvance(3),t.ɵɵrepeater(e.requestTypes)}}function ZJ(e,n){1&e&&(t.ɵɵelementStart(0,"div",3)(1,"div",4),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.request-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",6),t.ɵɵelement(5,"input",20),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,2,"gateway.hints.bacnet.request-timeout")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,4,"gateway.set")))}function QJ(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetKeyObjectTypeTranslationsMap.get(e))," ")}}function JJ(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",11),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.object-id-required"))}function e1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.BacnetPropertyIdTranslationsMap.get(e))," ")}}function t1(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",13),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Key)}}class n1 extends za{constructor(){super(...arguments),this.withReportStrategy=!0,this.propertyIds=Aa.get(Pa.analogOutput),this.objectTypes=Object.values(Pa),this.requestTypes=Object.values(Ra),this.ReportStrategyDefaultValue=on,this.BacnetDeviceKeysType=Ta,this.BacnetKeyObjectTypeTranslationsMap=Da,this.BacnetPropertyIdTranslationsMap=Fa,this.BacnetRequestTypeTranslationsMap=Ba}ngOnInit(){this.formGroup=this.initKeyFormGroup(),this.observeValueChanges(),this.observeObjectType()}isReportStrategyDisabled(){return!(this.withReportStrategy&&(this.keyType===Ta.ATTRIBUTES||this.keyType===Ta.TIMESERIES))}initKeyFormGroup(){return this.fb.group({key:[{value:"",disabled:this.keyType===Ta.RPC_METHODS},[me.required,me.pattern(pn)]],method:[{value:"",disabled:this.keyType!==Ta.RPC_METHODS},[me.required,me.pattern(pn)]],objectType:[Pa.analogOutput],objectId:[0,[me.required]],propertyId:[Oa.presentValue],requestTimeout:[{value:0,disabled:this.keyType!==Ta.RPC_METHODS}],requestType:[{value:Ra.Write,disabled:this.keyType!==Ta.RPC_METHODS}],reportStrategy:[{value:null,disabled:this.isReportStrategyDisabled()}]})}observeObjectType(){this.formGroup.get("objectType").valueChanges.pipe(In(this.destroyRef)).subscribe((e=>{this.propertyIds=Aa.get(e),this.propertyIds.includes(this.formGroup.get("propertyId").value)||this.formGroup.get("propertyId").patchValue(this.propertyIds[0],{emitEvent:!1})}))}initFormGroup(){return this.fb.group({})}mapOnChangeValue({reportStrategy:e,...t}){return e?{...t,reportStrategy:e}:t}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(n1)))(n||n1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:n1,selectors:[["tb-bacnet-device-data-key"]],inputs:{keyType:"keyType",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>n1)),multi:!0},{provide:he,useExisting:c((()=>n1)),multi:!0}]),t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:35,vars:15,consts:[[1,"tb-form-panel","no-border","no-padding",3,"formGroup"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap","raw-value-option"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","objectType"],[3,"value"],[1,"tb-form-table-row-cell","tb-flex","no-gap"],["matInput","","type","number","min","0","name","value","formControlName","objectId",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["formControlName","propertyId"],["formControlName","reportStrategy",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matInput","","name","value","formControlName","method",3,"placeholder"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],["formControlName","requestType","appearance","fill"],["matInput","","type","number","min","0","name","value","formControlName","requestTimeout",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.platform-side"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3),t.ɵɵtemplate(5,WJ,10,12)(6,KJ,9,10),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",1)(8,"div",2),t.ɵɵtext(9,"gateway.connector-side"),t.ɵɵelementEnd(),t.ɵɵtemplate(10,XJ,9,6,"div",3)(11,ZJ,7,6,"div",3),t.ɵɵelementStart(12,"div",3)(13,"div",4),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15,"gateway.object-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"div",5)(17,"mat-form-field",6)(18,"mat-select",7),t.ɵɵrepeaterCreate(19,QJ,3,4,"mat-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",9)(22,"mat-form-field",6),t.ɵɵelement(23,"input",10),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,JJ,3,3,"mat-icon",11),t.ɵɵelementEnd()()(),t.ɵɵelementStart(26,"div",3)(27,"div",4),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"gateway.property-id"),t.ɵɵelementEnd(),t.ɵɵelementStart(30,"mat-form-field",6)(31,"mat-select",12),t.ɵɵrepeaterCreate(32,e1,3,4,"mat-option",8,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()()(),t.ɵɵtemplate(34,t1,1,2,"tb-report-strategy",13),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.formGroup),t.ɵɵadvance(5),t.ɵɵconditional(n.keyType!==n.BacnetDeviceKeysType.RPC_METHODS?5:6),t.ɵɵadvance(5),t.ɵɵconditional(n.keyType===n.BacnetDeviceKeysType.RPC_METHODS?10:-1),t.ɵɵadvance(),t.ɵɵconditional(n.keyType===n.BacnetDeviceKeysType.RPC_METHODS?11:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,9,"gateway.hints.bacnet.key-object-id")),t.ɵɵadvance(6),t.ɵɵrepeater(n.objectTypes),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,11,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.formGroup.get("objectId").hasError("required")&&n.formGroup.get("objectId").touched?25:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(28,13,"gateway.hints.bacnet.property-id")),t.ɵɵadvance(5),t.ɵɵrepeater(n.propertyIds),t.ɵɵadvance(2),t.ɵɵconditional(n.isReportStrategyDisabled()?-1:34))},dependencies:t.ɵɵgetComponentDepsFactory(n1,[se,_,ni]),encapsulation:2,changeDetection:d.OnPush})}}function i1(e,n){if(1&e&&t.ɵɵelement(0,"tb-bacnet-device-data-key",17),2&e){const e=t.ɵɵnextContext().$implicit,n=t.ɵɵnextContext(2);t.ɵɵproperty("formControl",e)("keyType",n.keysType)("withReportStrategy",n.withReportStrategy)}}function a1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵelementContainerStart(2,11),t.ɵɵelementStart(3,"mat-expansion-panel",12)(4,"mat-expansion-panel-header",13)(5,"mat-panel-title")(6,"div",14),t.ɵɵtext(7),t.ɵɵelementEnd()()(),t.ɵɵtemplate(8,i1,1,3,"ng-template",15),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"button",16),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"delete"),t.ɵɵelementEnd()()()}if(2&e){let e;const i=n.$implicit,a=n.$index,r=n.$count,o=t.ɵɵnextContext(2);t.ɵɵadvance(2),t.ɵɵproperty("formGroup",i),t.ɵɵadvance(),t.ɵɵproperty("expanded",a===r-1),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",null!==(e=null==i.value?null:i.value.key)&&void 0!==e?e:null==i.value?null:i.value.method," "),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(10,4,o.deleteKeyTitle))}}function r1(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3),t.ɵɵrepeaterCreate(1,a1,13,6,"div",9,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵrepeater(e.keysListFormArray.controls)}}function o1(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",4)(1,"span",18),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.noKeysText)}}class s1 extends q{constructor(e,t,n){super(n),this.fb=e,this.popover=t,this.store=n,this.withReportStrategy=!0,this.keysDataApplied=p(),this.ReportStrategyDefaultValue=on}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}addKey(){this.keysListFormArray.push(this.fb.control({}))}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){this.keysDataApplied.emit(this.keysListFormArray.value)}prepareKeysFormArray(e){const t=[];return e?.forEach((e=>{t.push(this.fb.control(e))})),this.fb.array(t)}static{this.ɵfac=function(e){return new(e||s1)(t.ɵɵdirectiveInject(de.UntypedFormBuilder),t.ɵɵdirectiveInject(at.TbPopoverComponent),t.ɵɵdirectiveInject(Xe.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:s1,selectors:[["tb-bacnet-device-data-keys-panel"]],inputs:{panelTitle:"panelTitle",addKeyTitle:"addKeyTitle",deleteKeyTitle:"deleteKeyTitle",noKeysText:"noKeysText",keys:"keys",keysType:"keysType",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:18,vars:15,consts:[[1,"tb-device-keys-panel"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","key-panel"],[1,"tb-flex","no-flex","center","align-center","key-panel"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"title-container"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[3,"formControl","keyType","withReportStrategy"],["translate","",1,"tb-prompt"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,r1,3,0,"div",3)(6,o1,3,1,"div",4),t.ɵɵelementStart(7,"div")(8,"button",5),t.ɵɵlistener("click",(function(){return n.addKey()})),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",6)(12,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"button",8),t.ɵɵlistener("click",(function(){return n.applyKeysData()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,7,n.panelTitle),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵconditional(n.keysListFormArray.controls.length?5:6),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(10,9,n.addKeyTitle)," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,11,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,13,"action.apply")," "))},dependencies:t.ɵɵgetComponentDepsFactory(s1,[se,_,n1]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%]{width:77vw;max-width:700px}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{max-width:11vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .key-panel[_ngcontent-%COMP%]{height:500px;overflow:auto}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-form-panel[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{width:56px;height:56px;padding:16px;color:#0000008a}[_nghost-%COMP%] .tb-device-keys-panel[_ngcontent-%COMP%] .tb-small-label[_ngcontent-%COMP%]{font-size:16px;padding-right:0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}'],changeDetection:d.OnPush})}}function l1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function p1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.port-required"))}function c1(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",12)(1,"mat-expansion-panel",35)(2,"mat-expansion-panel-header")(3,"mat-panel-title")(4,"div",36),t.ɵɵtext(5,"gateway.advanced-configuration-settings"),t.ɵɵelementEnd()()(),t.ɵɵelement(6,"tb-string-items-list",37),t.ɵɵpipe(7,"translate"),t.ɵɵpipe(8,"translate"),t.ɵɵelementEnd()()),2&e){let e;const n=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(7,2,"gateway.bacnet.alt-responses-address")),t.ɵɵpropertyInterpolate("placeholder",null!=(e=n.deviceFormGroup.get("altResponsesAddresses").value)&&e.length?"":t.ɵɵpipeBind1(8,4,"gateway.address"))}}function d1(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",21),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function u1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",16),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.hints.poll-period-required"))}function m1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function h1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function g1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function f1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.method," ")}}class y1 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.cdr=l,this.destroyRef=p,this.deviceFormGroup=this.fb.group({host:["",[me.required,me.pattern(pn)]],port:["",[me.required]],networkMask:[""],deviceInfo:[],altResponsesAddresses:[{value:[],disabled:this.data.hideNewFields}],pollPeriod:[1e4,[me.required,me.min(0)]],timeseries:[[]],attributes:[[]],attributeUpdates:[[]],serverSideRpc:[[]],reportStrategy:[{value:null,disabled:!this.data.withReportStrategy}]}),this.keysPopupClosed=!0,this.BacnetDeviceKeysType=Ta,this.DeviceInfoType=Sa,this.deviceHelpLink=O+"/docs/iot-gateway/config/bacnet/#device-object-settings",this.sourceTypes=Object.values(yi),this.ConnectorType=dt,this.ReportStrategyDefaultValue=on,this.deviceFormGroup.patchValue(this.data.value,{emitEvent:!1})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.deviceFormGroup.valid){const{altResponsesAddresses:e,reportStrategy:t,...n}=this.deviceFormGroup.value;this.dialogRef.close({altResponsesAddresses:e??[],...t?{reportStrategy:t}:{},...n})}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))return void this.popoverService.hidePopover(i);const a=this.deviceFormGroup.get(n),r={keys:a.value,keysType:n,panelTitle:Ia.get(n),addKeyTitle:Ea.get(n),deleteKeyTitle:Ma.get(n),noKeysText:ka.get(n),withReportStrategy:this.data.withReportStrategy};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,s1,"leftBottom",!1,null,r,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.subscribe((e=>{this.popoverComponent.hide(),a.patchValue(e),a.markAsDirty(),this.cdr.markForCheck()})),this.popoverComponent.tbHideStart.pipe(In(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}static{this.ɵfac=function(e){return new(e||y1)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:y1,selectors:[["tb-bacnet-device-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:106,vars:48,consts:[["attributesButton",""],["socketTelemetryButton",""],["attributesUpdatesButton",""],["rpcMethodsButton",""],[1,"dialog-mapping",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","port",3,"placeholder"],["translate","",1,"fixed-title-width"],["matInput","","name","value","formControlName","networkMask",3,"placeholder"],["formControlName","deviceInfo","required","true",3,"deviceInfoType","sourceTypes","connectorType"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"fixed-title-width","tb-required"],["tbTruncateWithTooltip","","translate",""],["matInput","","type","number","min","0","name","value","formControlName","pollPeriod",3,"placeholder"],[1,"tb-form-row","space-between","tb-flex"],[1,"tb-flex","ellipsis-chips-container"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-settings","chips-panel","w-full"],["translate","",1,"tb-form-panel-title"],["editable","","floatLabel","always","formControlName","altResponsesAddresses",1,"chips-list",3,"label","placeholder"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",4)(1,"mat-toolbar",5)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",6)(6,"div",7),t.ɵɵelementStart(7,"button",8),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(8,"mat-icon",9),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",10)(11,"div",11)(12,"div",12)(13,"div",13),t.ɵɵtext(14,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",14),t.ɵɵelement(16,"input",15),t.ɵɵpipe(17,"translate"),t.ɵɵtemplate(18,l1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(19,"div",12)(20,"div",13),t.ɵɵtext(21,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",14),t.ɵɵelement(23,"input",17),t.ɵɵpipe(24,"translate"),t.ɵɵtemplate(25,p1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"div",12)(27,"div",18),t.ɵɵtext(28,"gateway.network-mask"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"mat-form-field",14),t.ɵɵelement(30,"input",19),t.ɵɵpipe(31,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(32,c1,9,6,"div",12),t.ɵɵelement(33,"tb-device-info-table",20),t.ɵɵtemplate(34,d1,1,2,"tb-report-strategy",21),t.ɵɵelementStart(35,"div",12)(36,"div",22)(37,"span",23),t.ɵɵtext(38,"gateway.poll-period"),t.ɵɵelementEnd()(),t.ɵɵelementStart(39,"mat-form-field",14),t.ɵɵelement(40,"input",24),t.ɵɵpipe(41,"translate"),t.ɵɵtemplate(42,u1,3,3,"mat-icon",16),t.ɵɵelementEnd()(),t.ɵɵelementStart(43,"div",25)(44,"div",18),t.ɵɵtext(45,"gateway.attributes"),t.ɵɵelementEnd(),t.ɵɵelementStart(46,"div",26)(47,"mat-chip-listbox",27),t.ɵɵrepeaterCreate(48,m1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(50,"mat-chip",28),t.ɵɵelement(51,"label",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(52,"button",30,0),t.ɵɵpipe(54,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(53);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.ATTRIBUTES))})),t.ɵɵelementStart(55,"tb-icon",31),t.ɵɵtext(56,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(57,"div",25)(58,"div",18),t.ɵɵtext(59,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(60,"div",26)(61,"mat-chip-listbox",27),t.ɵɵrepeaterCreate(62,h1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(64,"mat-chip",28),t.ɵɵelement(65,"label",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(66,"button",30,1),t.ɵɵpipe(68,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(67);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.TIMESERIES))})),t.ɵɵelementStart(69,"tb-icon",31),t.ɵɵtext(70,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(71,"div",25)(72,"div",18),t.ɵɵtext(73,"gateway.attribute-updates"),t.ɵɵelementEnd(),t.ɵɵelementStart(74,"div",26)(75,"mat-chip-listbox",27),t.ɵɵrepeaterCreate(76,g1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(78,"mat-chip",28),t.ɵɵelement(79,"label",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(80,"button",30,2),t.ɵɵpipe(82,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(81);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.ATTRIBUTES_UPDATES))})),t.ɵɵelementStart(83,"tb-icon",31),t.ɵɵtext(84,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(85,"div",25)(86,"div",18),t.ɵɵtext(87,"gateway.rpc-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(88,"div",26)(89,"mat-chip-listbox",27),t.ɵɵrepeaterCreate(90,f1,2,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(92,"mat-chip",28),t.ɵɵelement(93,"label",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(94,"button",30,3),t.ɵɵpipe(96,"translate"),t.ɵɵlistener("click",(function(i){t.ɵɵrestoreView(e);const a=t.ɵɵreference(95);return t.ɵɵresetView(n.manageKeys(i,a,n.BacnetDeviceKeysType.RPC_METHODS))})),t.ɵɵelementStart(97,"tb-icon",31),t.ɵɵtext(98,"edit"),t.ɵɵelementEnd()()()()()(),t.ɵɵelementStart(99,"div",32)(100,"button",33),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.cancel())})),t.ɵɵtext(101),t.ɵɵpipe(102,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(103,"button",34),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.add())})),t.ɵɵtext(104),t.ɵɵpipe(105,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵproperty("formGroup",n.deviceFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,26,"gateway.device")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.deviceHelpLink),t.ɵɵadvance(10),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(17,28,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.deviceFormGroup.get("host").hasError("required")&&n.deviceFormGroup.get("host").touched?18:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(24,30,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.deviceFormGroup.get("port").hasError("required")&&n.deviceFormGroup.get("port").touched?25:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(31,32,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.data.hideNewFields?-1:32),t.ɵɵadvance(),t.ɵɵproperty("deviceInfoType",n.DeviceInfoType.FULL)("sourceTypes",n.sourceTypes)("connectorType",n.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?34:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(41,34,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.deviceFormGroup.get("pollPeriod").hasError("required")&&n.deviceFormGroup.get("pollPeriod").touched?42:-1),t.ɵɵadvance(5),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("attributes").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(54,36,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("timeseries").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("timeseries").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(68,38,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("attributeUpdates").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(82,40,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(),t.ɵɵrepeater(n.deviceFormGroup.get("serverSideRpc").value),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(96,42,"action.edit")),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(102,44,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.deviceFormGroup.invalid||!n.deviceFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(105,46,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(y1,[se,_,$n,Wn,A$,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%]{display:grid;height:100%}[_nghost-%COMP%] .tb-form-panel[_ngcontent-%COMP%]{width:77vw;max-width:800px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%]{max-width:900px;display:flex;flex-direction:column}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{min-height:64px}[_nghost-%COMP%] .dialog-mapping[_ngcontent-%COMP%] tb-toggle-select[_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{height:670px}[_nghost-%COMP%] .ellipsis-chips-container[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .chips-panel[_ngcontent-%COMP%]{padding:6px 6px 6px 0}[_nghost-%COMP%] .dialog-mapping .mat-mdc-chip-listbox .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}[_nghost-%COMP%] .tb-form-row .fixed-title-width{min-width:40px;width:35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center}[_nghost-%COMP%] .tb-form-row .mat-mdc-form-field{width:0}[_nghost-%COMP%] .tb-form-row .chips-list .mat-mdc-form-field{width:100%}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex}[_nghost-%COMP%] .device-config{gap:12px;padding-left:10px;padding-right:10px}[_nghost-%COMP%] .device-node-pattern-field{flex-basis:3%}'],changeDetection:d.OnPush})}}const v1=()=>["deviceName","host","port","actions"],x1=()=>({minWidth:"96px",textAlign:"center"});function b1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",26)(2,"span",27),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelement(5,"span",9),t.ɵɵelementStart(6,"button",11),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageDevices(n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",11),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.devices")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,7,"action.search")))}function w1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.device-name")))}function S1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(null==e.deviceInfo?null:e.deviceInfo.deviceNameExpression)}}function C1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.host")," "))}function _1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.host)}}function T1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",28),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.port")," "))}function I1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",28)(1,"div",29),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.port)}}function E1(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",30)}function M1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",11),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageDevices(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",11),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteDevice(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function k1(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,M1,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",31),t.ɵɵelementContainer(4,32),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"button",34),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",35),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",36,2),t.ɵɵelementContainer(11,32),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(3),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,x1)),t.ɵɵadvance(),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function P1(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",37)}function D1(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class O1 extends $a{constructor(){super(...arguments),this.hideNewFields=!1}getDatasource(){return new A1}manageDevices(e,t){e&&e.stopPropagation();const n=J(t),i=n?this.entityFormArray.at(t).value:{};this.getDeviceDialog(i,n?"action.apply":"action.add").afterClosed().pipe(Ne(1),In(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteDevice(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-device-title",{name:this.entityFormArray.controls[t].value.deviceInfo?.deviceNameExpression}),this.translate.instant("gateway.delete-device-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(Ne(1),In(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}getDeviceDialog(e,t){return this.dialog.open(y1,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy,hideNewFields:this.hideNewFields}})}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())||e.deviceNameExpression?.toString().toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(O1)))(n||O1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:O1,selectors:[["tb-bacnet-devices-config-table"]],inputs:{hideNewFields:[2,"hideNewFields","hideNewFields",m]},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>O1)),multi:!0},{provide:he,useExisting:c((()=>O1)),multi:!0}]),t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:48,vars:37,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-device-table","tb-absolute-fill"],[1,"tb-device-table-content","flex","flex-col"],[1,"mat-mdc-table-toolbar"],["class","mat-toolbar-tools",4,"ngIf"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"table-container"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","table-value-column",4,"matHeaderCellDef"],["class","table-value-column",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"tb-device-table-title"],[1,"table-value-column"],["tbTruncateWithTooltip",""],[1,"w-12"],[1,"lt-lg:!hidden","flex","flex-1","flex-row","items-stretch","justify-end"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,b1,14,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"div",7)(7,"button",8),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-icon"),t.ɵɵtext(10,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",9)(12,"mat-label"),t.ɵɵtext(13," "),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",10,0),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"button",11),t.ɵɵpipe(18,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(19,"mat-icon"),t.ɵɵtext(20,"close"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(21,"div",12)(22,"table",13),t.ɵɵelementContainerStart(23,14),t.ɵɵtemplate(24,w1,4,3,"mat-header-cell",15)(25,S1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(26,14),t.ɵɵtemplate(27,C1,3,3,"mat-header-cell",15)(28,_1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(29,14),t.ɵɵtemplate(30,T1,3,3,"mat-header-cell",15)(31,I1,3,1,"mat-cell",16),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(32,17),t.ɵɵtemplate(33,E1,1,0,"mat-header-cell",18)(34,k1,12,6,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(35,P1,1,0,"mat-header-row",20)(36,D1,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"section",22),t.ɵɵpipe(38,"async"),t.ɵɵelementStart(39,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageDevices(i))})),t.ɵɵelementStart(40,"mat-icon",24),t.ɵɵtext(41,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"span"),t.ɵɵtext(43),t.ɵɵpipe(44,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(45,"span",25),t.ɵɵpipe(46,"async"),t.ɵɵtext(47," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵproperty("ngIf",!1===t.ɵɵpipeBind1(4,21,n.dataSource.isEmpty())),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,23,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(16,25,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,27,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","deviceName"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","host"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","port"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(35,v1))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(36,v1)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(38,29,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(44,31,"gateway.add-device")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(46,33,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(O1,[se,_,Wn]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%]{width:100%;height:100%;background:#fff;overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .mat-toolbar-tools[_ngcontent-%COMP%]{min-height:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .title-container[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{table-layout:fixed;min-width:450px}[_nghost-%COMP%] .tb-device-table[_ngcontent-%COMP%] .tb-device-table-content[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .table-value-column[_ngcontent-%COMP%]{padding:0 12px;width:21%}[_nghost-%COMP%] .no-data-found[_ngcontent-%COMP%]{height:calc(100% - 120px)}@media screen and (max-width: 599px){[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{height:auto;min-height:100px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] .tb-device-table-title[_ngcontent-%COMP%]{padding-bottom:5px;width:100%}}[_nghost-%COMP%] mat-cell.tb-value-cell{cursor:pointer}[_nghost-%COMP%] mat-cell.tb-value-cell .mat-icon{height:24px;width:24px;font-size:24px;color:#757575}'],changeDetection:d.OnPush})}}class A1 extends G{constructor(){super()}}class F1 extends Ua{initBasicFormGroup(){return this.fb.group({application:[],devices:[]})}mapConfigToFormValue(e){return{application:e.application??{},devices:e.devices??[]}}getMappedValue(e){return{application:e.application,devices:e.devices??[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(F1)))(n||F1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:F1,selectors:[["tb-bacnet-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>F1)),multi:!0},{provide:he,useExisting:c((()=>F1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:15,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","application"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","devices",3,"hideNewFields","withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-bacnet-application-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-bacnet-devices-config-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.application"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.devices"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("hideNewFields",n.isLegacy)("withReportStrategy",n.withReportStrategy))},dependencies:t.ɵɵgetComponentDepsFactory(F1,[se,_,jJ,O1]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}class R1 extends Ua{constructor(){super(...arguments),this.isLegacy=!0}initBasicFormGroup(){return this.fb.group({application:[],devices:[]})}mapConfigToFormValue(e){return{application:e.general?Ja.mapApplicationToUpgradedVersion(e.general):{},devices:e.devices?.length?Ja.mapDevicesToUpgradedVersion(e.devices):[]}}getMappedValue(e){return{general:e.application?Ja.mapApplicationToDowngradedVersion(e.application):{},devices:e.devices?.length?Ja.mapDevicesToDowngradedVersion(e.devices):[]}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(R1)))(n||R1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:R1,selectors:[["tb-bacnet-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>R1)),multi:!0},{provide:he,useExisting:c((()=>R1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:15,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","application"],[1,"tb-form-panel","no-border","no-padding","padding-top","tb-flex","fill-height"],["formControlName","devices",3,"hideNewFields","withReportStrategy"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-bacnet-application-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"div",4),t.ɵɵelement(10,"tb-bacnet-devices-config-table",5),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.application"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.devices"),"*"),t.ɵɵadvance(3),t.ɵɵproperty("hideNewFields",n.isLegacy)("withReportStrategy",n.withReportStrategy))},dependencies:t.ɵɵgetComponentDepsFactory(R1,[se,_,jJ,O1]),styles:['@charset "UTF-8";[_nghost-%COMP%]{height:100%}[_nghost-%COMP%] .mat-mdc-tab-group, [_nghost-%COMP%] .mat-mdc-tab-body-wrapper{height:100%}'],changeDetection:d.OnPush})}}function B1(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",5),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.host-required"))}function N1(e,n){if(1&e&&(t.ɵɵelement(0,"tb-error-icon",8),t.ɵɵpipe(1,"getGatewayPortTooltip"),t.ɵɵpipe(2,"translate")),2&e){t.ɵɵnextContext();const e=t.ɵɵreadContextLet(16);t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(2,3,t.ɵɵpipeBind1(1,1,e)))}}class L1 extends za{constructor(){super(...arguments),this.portLimits=Oi}get serverConfigFormGroup(){return this.formGroup}initFormGroup(){return this.fb.group({host:["",[me.required,me.pattern(pn)]],port:[null,[me.required,me.min(Oi.MIN),me.max(Oi.MAX)]],SSL:[!1],security:this.fb.group({cert:[""],key:[""]})})}mapOnChangeValue(e){return Y(e),e}onWriteValue(e){this.formGroup.reset(e,{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(L1)))(n||L1)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:L1,selectors:[["tb-rest-server-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>L1)),multi:!0},{provide:he,useExisting:c((()=>L1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:46,vars:43,consts:[[1,"tb-form-panel","no-border","no-padding","padding-top",3,"formGroup"],[1,"tb-form-row"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","host",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],[1,"tb-form-row","column-xs"],["matInput","","type","number","name","value","formControlName","port",3,"min","max","placeholder"],["matSuffix","",3,"tooltipText"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","space-between","tb-flex","fill-width"],["formControlName","SSL",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],[3,"formGroup"],["tbTruncateWithTooltip","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],[1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","cert",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"]],template:function(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4,"gateway.host"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-form-field",3),t.ɵɵelement(6,"input",4),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,B1,3,3,"mat-icon",5),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",6)(10,"div",2),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.port"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",3),t.ɵɵelement(14,"input",7),t.ɵɵpipe(15,"translate"),t.ɵɵdeclareLet(16),t.ɵɵtemplate(17,N1,3,5,"tb-error-icon",8),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",9)(19,"div",10),t.ɵɵtext(20,"gateway.security"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",11)(22,"mat-slide-toggle",12)(23,"mat-label",13),t.ɵɵpipe(24,"translate"),t.ɵɵtext(25),t.ɵɵpipe(26,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerStart(27,14),t.ɵɵelementStart(28,"div",11)(29,"div",15),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31),t.ɵɵpipe(32,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"div",16)(34,"mat-form-field",3),t.ɵɵelement(35,"input",17),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(37,"div",11)(38,"div",15),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40),t.ɵɵpipe(41,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(42,"div",16)(43,"mat-form-field",3),t.ɵɵelement(44,"input",18),t.ɵɵpipe(45,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e){t.ɵɵproperty("formGroup",n.serverConfigFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,18,"gateway.hints.rest.host")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,20,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.serverConfigFormGroup.get("host").hasError("required")&&n.serverConfigFormGroup.get("host").touched?8:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,22,"gateway.hints.rest.port")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("min",n.portLimits.MIN),t.ɵɵpropertyInterpolate("max",n.portLimits.MAX),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,24,"gateway.set")),t.ɵɵadvance(2);const e=t.ɵɵstoreLet(n.serverConfigFormGroup.get("port"));t.ɵɵadvance(),t.ɵɵconditional((e.hasError("required")||e.hasError("min")||e.hasError("max"))&&e.touched?17:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(24,27,"gateway.hints.rest.ssl-verify")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(26,29,"gateway.rest.ssl-verify")," "),t.ɵɵadvance(2),t.ɵɵproperty("formGroup",n.serverConfigFormGroup.get("security")),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(30,31,"gateway.hints.rest.cert")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(32,33,"gateway.certificate")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,35,"gateway.set")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(39,37,"gateway.hints.rest.key")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(41,39,"gateway.key")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(45,41,"gateway.set"))}},dependencies:t.ɵɵgetComponentDepsFactory(L1,[se,_,u$,Wn,ai]),encapsulation:2,changeDetection:d.OnPush})}}const V1=()=>({min:1});function q1(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",4),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.ResponseTypeTranslationsMap.get(e)))}}function G1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",4),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function z1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",4),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function U1(e,n){if(1&e&&(t.ɵɵelementContainerStart(0,7),t.ɵɵelementStart(1,"div",8)(2,"div",9),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",10)(6,"mat-form-field",11)(7,"mat-select",12),t.ɵɵrepeaterCreate(8,G1,2,2,"mat-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(10,"div",8)(11,"div",9),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",10)(15,"mat-form-field",11)(16,"mat-select",13),t.ɵɵrepeaterCreate(17,z1,2,2,"mat-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.responseConfigFormGroup.get(e.ResponseType.CONST)),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.rest.on-success")),t.ɵɵadvance(5),t.ɵɵrepeater(e.responseStatuses),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,5,"gateway.rest.on-error")),t.ɵɵadvance(5),t.ɵɵrepeater(e.responseStatuses)}}function j1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.response-timeout-required"))}function H1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,V1)))}function W1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function $1(e,n){1&e&&(t.ɵɵelementStart(0,"span",18),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function K1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.response-attribute-required"))}function Y1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",17),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.response-attribute-pattern"))}function X1(e,n){if(1&e&&(t.ɵɵdeclareLet(0),t.ɵɵelementContainerStart(1,7),t.ɵɵelementStart(2,"div",8)(3,"mat-slide-toggle",14)(4,"mat-label"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(7,"div",8)(8,"div",15),t.ɵɵtext(9,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-form-field",11),t.ɵɵelement(11,"input",16),t.ɵɵpipe(12,"translate"),t.ɵɵdeclareLet(13),t.ɵɵtemplate(14,j1,2,3,"tb-error-icon",17)(15,H1,2,5,"tb-error-icon",17)(16,W1,2,3,"tb-error-icon",17)(17,$1,2,0,"span",18),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",8)(19,"div",15),t.ɵɵtext(20,"gateway.rest.response-attribute"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",11),t.ɵɵelement(22,"input",19),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,K1,2,3,"tb-error-icon",17)(25,Y1,2,3,"tb-error-icon",17),t.ɵɵelementEnd()(),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵnextContext(),n=e.responseConfigFormGroup.get(e.ResponseType.ADVANCED);t.ɵɵadvance(),t.ɵɵproperty("formGroup",n),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,6,"gateway.rest.response-expected")," "),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(12,8,"gateway.set"));const i=n.get("timeout").touched;t.ɵɵadvance(3),t.ɵɵconditional(n.get("timeout").hasError("required")&&i?14:n.get("timeout").hasError("min")&&i?15:n.get("timeout").hasError("pattern")&&i?16:17),t.ɵɵadvance(8),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,10,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.get("responseAttribute").hasError("required")&&n.get("responseAttribute").touched?24:n.get("responseAttribute").hasError("pattern")&&n.get("responseAttribute").touched?25:-1)}}class Z1 extends za{get responseConfigFormGroup(){return this.formGroup}constructor(){super(),this.ResponseTypeTranslationsMap=Ti,this.ResponseType=Ci,this.responseTypes=Object.values(Ci),this.responseStatuses=Object.values(_i),this.observeIsExpected()}initFormGroup(){return this.fb.group({type:[Ci.DEFAULT],[Ci.CONST]:this.fb.group({successResponse:[_i.OK],unsuccessfulResponse:[_i.ERROR]}),[Ci.ADVANCED]:this.fb.group({responseExpected:[!0],timeout:[null,[me.required,me.min(.001),me.pattern(ln)]],responseAttribute:["",[me.required,me.pattern(pn)]]})})}mapOnChangeValue({type:e,...t}){return{type:e,...t[e]??{}}}onWriteValue(e){const{type:t=Ci.DEFAULT,...n}=e??{};this.toggleIsExpected(n.responseExpected,t),this.responseConfigFormGroup.patchValue({type:t,[t]:n},{emitEvent:!1})}toggleIsExpected(e,t){const n=e&&t===Ci.ADVANCED;this.responseConfigFormGroup.get(Ci.ADVANCED).get("timeout")[n?"enable":"disable"]({emitEvent:!1}),this.responseConfigFormGroup.get(Ci.ADVANCED).get("responseAttribute")[n?"enable":"disable"]({emitEvent:!1})}observeIsExpected(){Ee(this.responseConfigFormGroup.get("type").valueChanges,this.responseConfigFormGroup.get(Ci.ADVANCED).get("responseExpected").valueChanges).pipe(In()).subscribe((()=>this.toggleIsExpected(this.responseConfigFormGroup.get(Ci.ADVANCED).get("responseExpected").value,this.responseConfigFormGroup.get("type").value)))}static{this.ɵfac=function(e){return new(e||Z1)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Z1,selectors:[["tb-rest-response-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>Z1)),multi:!0},{provide:he,useExisting:c((()=>Z1)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:11,vars:7,consts:[[1,"tb-form-row","space-between","same-padding","tb-flex","column","size-full",3,"formGroup"],[1,"tb-flex","row","space-between","align-center","no-gap","fill-width"],[1,"fixed-title-width","tb-required"],["formControlName","type","appearance","fill"],[3,"value"],[3,"ngSwitch"],[3,"ngSwitchCase"],[3,"formGroup"],[1,"tb-form-row"],[1,"fixed-title-width"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["formControlName","successResponse"],["formControlName","unsuccessfulResponse"],["formControlName","responseExpected",1,"mat-slide"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["matSuffix","",3,"tooltipText"],["translate","","matSuffix","",1,"block","pr-2"],["matInput","","type","text","name","value","formControlName","responseAttribute",3,"placeholder"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"tb-toggle-select",3),t.ɵɵrepeaterCreate(6,q1,3,4,"tb-toggle-option",4,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()(),t.ɵɵelementContainerStart(8,5),t.ɵɵtemplate(9,U1,19,7,"ng-template",6)(10,X1,26,12,"ng-template",6),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("formGroup",n.responseConfigFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,5,"gateway.response")),t.ɵɵadvance(3),t.ɵɵrepeater(n.responseTypes),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.responseConfigFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.ResponseType.CONST),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.ResponseType.ADVANCED))},dependencies:t.ɵɵgetComponentDepsFactory(Z1,[se,_,ai]),encapsulation:2,changeDetection:d.OnPush})}}function Q1(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-required"))}function J1(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",17),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function e0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.http-methods-required"))}function t0(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",17),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.RestConvertorTypeTranslationsMap.get(e)))}}function n0(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",27),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Device)}}function i0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function a0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function r0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",28)(1,"div",20)(2,"div",21),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",33)(6,"mat-chip-listbox",34),t.ɵɵrepeaterCreate(7,i0,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(9,"mat-chip",35),t.ɵɵelement(10,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"button",37,0),t.ɵɵpipe(13,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(12),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.ATTRIBUTES))})),t.ɵɵelementStart(14,"tb-icon",38),t.ɵɵtext(15,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(16,"div",20)(17,"div",39),t.ɵɵtext(18,"gateway.timeseries"),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",33)(20,"mat-chip-listbox",34),t.ɵɵrepeaterCreate(21,a0,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(23,"mat-chip",35),t.ɵɵelement(24,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(25,"button",37,1),t.ɵɵpipe(27,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(26),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.TIMESERIES))})),t.ɵɵelementStart(28,"tb-icon",38),t.ɵɵtext(29,"edit"),t.ɵɵelementEnd()()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,5,"gateway.attributes")),t.ɵɵadvance(3),t.ɵɵproperty("tbEllipsisChipList",e.converterAttributes),t.ɵɵadvance(),t.ɵɵrepeater(e.converterAttributes),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(13,7,"action.edit")),t.ɵɵadvance(9),t.ɵɵproperty("tbEllipsisChipList",e.converterTelemetry),t.ɵɵadvance(),t.ɵɵrepeater(e.converterTelemetry),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(27,9,"action.edit"))}}function o0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",15),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.extension-required"))}function s0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",40),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function l0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",28)(1,"div",11)(2,"div",12),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"mat-form-field",41),t.ɵɵelement(7,"input",42),t.ɵɵpipe(8,"translate"),t.ɵɵtemplate(9,o0,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"div",43)(11,"div",24),t.ɵɵtext(12),t.ɵɵpipe(13,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",25),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"div",20)(18,"div",21),t.ɵɵtext(19),t.ɵɵpipe(20,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",44)(22,"mat-chip-listbox",34),t.ɵɵtemplate(23,s0,3,1,"mat-chip",45),t.ɵɵelementStart(24,"mat-chip",35),t.ɵɵelement(25,"label",36),t.ɵɵelementEnd()(),t.ɵɵelementStart(26,"button",37,2),t.ɵɵpipe(28,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(27),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i,a.MappingKeysType.CUSTOM))})),t.ɵɵelementStart(29,"tb-icon",38),t.ɵɵtext(30,"edit"),t.ɵɵelementEnd()()()()()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.rest.extension")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,12,"gateway.extension")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(8,14,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("converter.extension").hasError("required")&&e.mappingFormGroup.get("converter.extension").touched?9:-1),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(13,16,"gateway.extension-configuration")),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,18,"gateway.extension-configuration-hint")),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(20,20,"gateway.keys")),t.ɵɵadvance(3),t.ɵɵproperty("tbEllipsisChipList",e.customKeys),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",e.customKeys),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,22,"action.edit"))}}class p0 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.destroyRef=l,this.cd=p,this.mappingFormGroup=this.fb.group({endpoint:["",[me.required,me.pattern(pn)]],HTTPMethods:[[gt.POST],[me.required]],security:[{type:Ri.ANONYMOUS}],converter:this.fb.group({type:[wi.JSON,[]],deviceInfo:[],reportStrategy:[],attributes:[[]],timeseries:[[]],extension:["",[me.required,me.pattern(pn)]],extensionConfig:[]}),response:[]}),this.keysPopupClosed=!0,this.helpLink=`${O}/docs/iot-gateway/config/rest/#mapping-section`,this.httpMethods=Object.values(gt),this.converterTypes=Object.values(wi),this.restSourceTypes=Object.values(Si),this.SecurityMode=Ji,this.MappingKeysType=Ui,this.DeviceInfoType=Sa,this.RestConvertorTypeTranslationsMap=Pi,this.RestDataConversionTranslationsMap=Di,this.RestConverterType=wi,this.ConnectorType=dt,this.ReportStrategyDefaultValue=on,this.setInitialFormValue(),this.observeConverterTypeChange(),this.toggleConverterFieldsByType(this.converterType)}get converterType(){return this.mappingFormGroup.get("converter")?.get("type").value}get converterAttributes(){if(this.converterType)return this.mappingFormGroup.get("converter").value.attributes.map((e=>e.key))}get converterTelemetry(){if(this.converterType)return this.mappingFormGroup.get("converter").value.timeseries.map((e=>e.key))}get customKeys(){return Object.keys(this.mappingFormGroup.get("converter").value.extensionConfig??{})}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.mappingFormGroup.valid){const{converter:e,...t}=this.mappingFormGroup.value,{reportStrategy:n,...i}=e,a={...t,reportStrategy:n,converter:i};Y(a),this.dialogRef.close(a)}}manageKeys(e,t,n){e?.stopPropagation(),this.popoverComponent&&!this.popoverComponent.tbHidden&&this.popoverComponent.hide();const i=t._elementRef.nativeElement;if(this.popoverService.hasPopover(i))this.popoverService.hidePopover(i);else{const e=this.mappingFormGroup.get("converter").get(n),t={keys:e.value,keysType:n,panelTitle:ji.get(n),addKeyTitle:Hi.get(n),deleteKeyTitle:Wi.get(n),noKeysText:$i.get(n),withReportStrategy:this.data.withReportStrategy,convertorType:this.converterType,connectorType:dt.REST};this.keysPopupClosed=!1,this.popoverComponent=this.popoverService.displayPopover(i,this.renderer,this.viewContainerRef,_K,"leftBottom",!1,null,t,{},{},{},!0),this.popoverComponent.tbComponentRef.instance.keysDataApplied.pipe(In(this.destroyRef)).subscribe((t=>{this.popoverComponent.hide(),e.patchValue(t),e.markAsDirty(),this.cd.markForCheck()})),this.popoverComponent.tbHideStart.pipe(In(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}}setInitialFormValue(){const{converter:e,reportStrategy:t,...n}=this.data.value;this.mappingFormGroup.patchValue({...n,converter:{...e,...t?{reportStrategy:t}:{}}},{emitEvent:!1})}observeConverterTypeChange(){this.mappingFormGroup.get("converter").get("type").valueChanges.pipe(In(this.destroyRef)).subscribe((e=>this.toggleConverterFieldsByType(e)))}toggleConverterFieldsByType(e){const t=e===wi.JSON;this.mappingFormGroup.get("converter").get("attributes")[t?"enable":"disable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("timeseries")[t?"enable":"disable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("extension")[t?"disable":"enable"]({emitEvent:!1}),this.mappingFormGroup.get("converter").get("extensionConfig")[t?"disable":"enable"]({emitEvent:!1})}static{this.ɵfac=function(e){return new(e||p0)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:p0,selectors:[["tb-rest-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:59,vars:45,consts:[["attributesButton",""],["telemetryButton",""],["keysButton",""],[1,"h-full","w-[77vw]","max-w-3xl",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row"],[1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","endpoint",3,"placeholder"],["matSuffix","",3,"tooltipText"],["formControlName","HTTPMethods","multiple",""],[3,"value"],["formControlName","security",3,"mode"],["formGroupName","converter"],[1,"tb-form-row","space-between","tb-flex"],[1,"fixed-title-width"],["formControlName","type","appearance","fill"],[1,"tb-form-panel","stroked"],[1,"tb-form-panel-title"],[1,"tb-form-hint","tb-primary-fill"],["formControlName","deviceInfo","required","true",1,"device-info",3,"sourceTypes","convertorType","deviceInfoType","connectorType"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"],[1,"tb-form-panel","no-border","no-padding","w-full"],["formControlName","response"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"tb-flex","max-w-70%"],[1,"tb-flex","gw-chip-list",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["translate","",1,"fixed-title-width"],["tbTruncateWithTooltip",""],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["matInput","","name","value","formControlName","extension",3,"placeholder"],[1,"tb-form-row","space-between","same-padding","tb-flex","column"],[1,"tb-flex","ellipsis-chips-container"],[4,"ngFor","ngForOf"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",3)(1,"mat-toolbar",4)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",5)(6,"div",6),t.ɵɵelementStart(7,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",8),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",9)(11,"div",10)(12,"div",11)(13,"div",12),t.ɵɵpipe(14,"translate"),t.ɵɵtext(15),t.ɵɵpipe(16,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-form-field",13),t.ɵɵelement(18,"input",14),t.ɵɵpipe(19,"translate"),t.ɵɵtemplate(20,Q1,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(21,"div",11)(22,"div",12),t.ɵɵpipe(23,"translate"),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(26,"mat-form-field",13)(27,"mat-select",16),t.ɵɵrepeaterCreate(28,J1,2,2,"mat-option",17,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd(),t.ɵɵtemplate(30,e0,2,3,"tb-error-icon",15),t.ɵɵelementEnd()(),t.ɵɵelement(31,"tb-security-config",18),t.ɵɵelementContainerStart(32,19),t.ɵɵelementStart(33,"div",20)(34,"div",21),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"tb-toggle-select",22),t.ɵɵrepeaterCreate(38,t0,3,4,"tb-toggle-option",17,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()(),t.ɵɵelementStart(40,"div",23)(41,"div",24),t.ɵɵtext(42),t.ɵɵpipe(43,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"div",25),t.ɵɵtext(45),t.ɵɵpipe(46,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(47,"tb-device-info-table",26),t.ɵɵtemplate(48,n0,1,2,"tb-report-strategy",27)(49,r0,30,11,"div",28)(50,l0,31,24,"div",28),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelement(51,"tb-rest-response-config",29),t.ɵɵelementEnd()(),t.ɵɵelementStart(52,"div",30)(53,"button",31),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(54),t.ɵɵpipe(55,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(56,"button",32),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(57),t.ɵɵpipe(58,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,23,"gateway.data-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLink),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(14,25,"gateway.hints.rest.endpoint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(16,27,"gateway.rest.endpoint")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(19,29,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(n.mappingFormGroup.get("endpoint").hasError("required")&&n.mappingFormGroup.get("endpoint").touched?20:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(23,31,"gateway.hints.rest.http-methods")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(25,33,"gateway.rest.http-methods")),t.ɵɵadvance(4),t.ɵɵrepeater(n.httpMethods),t.ɵɵadvance(2),t.ɵɵconditional(n.mappingFormGroup.get("HTTPMethods").hasError("required")&&n.mappingFormGroup.get("HTTPMethods").touched?30:-1),t.ɵɵadvance(),t.ɵɵproperty("mode",n.SecurityMode.basic),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(36,35,"gateway.payload-type")),t.ɵɵadvance(3),t.ɵɵrepeater(n.converterTypes),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(43,37,"gateway.data-conversion")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(46,39,n.RestDataConversionTranslationsMap.get(n.converterType))," "),t.ɵɵadvance(2),t.ɵɵproperty("sourceTypes",n.restSourceTypes)("convertorType",n.RestConverterType.JSON)("deviceInfoType",n.DeviceInfoType.FULL)("connectorType",n.ConnectorType.REST),t.ɵɵadvance(),t.ɵɵconditional(n.data.withReportStrategy?48:-1),t.ɵɵadvance(),t.ɵɵconditional(n.converterType===n.RestConverterType.JSON?49:50),t.ɵɵadvance(5),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(55,41,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingFormGroup.invalid||!n.mappingFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(58,43,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(p0,[se,_,$n,A$,UY,Z1,ai,ni]),styles:['@charset "UTF-8";[_nghost-%COMP%] .device-info .fixed-title-width{min-width:0}'],changeDetection:d.OnPush})}}const c0=()=>["endpoint","httpMethods","securityType","actions"];function d0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",29),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"span",8),t.ɵɵelementStart(5,"button",10),t.ɵɵpipe(6,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(7,"mat-icon"),t.ɵɵtext(8,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",10),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.data-mapping")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(6,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,7,"action.search")))}function u0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rest.endpoint")))}function m0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",32)(1,"div",31),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.endpoint)}}function h0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",33),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.rest.http-methods")," "))}function g0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",38),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e)}}function f0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",34)(1,"mat-chip-listbox",35),t.ɵɵrepeaterCreate(2,g0,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementStart(4,"mat-chip",36),t.ɵɵelement(5,"label",37),t.ɵɵelementEnd()()()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵproperty("tbEllipsisChipList",e.HTTPMethods),t.ɵɵadvance(),t.ɵɵrepeater(e.HTTPMethods)}}function y0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.security-type")," "))}function v0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",39)(1,"div",31),t.ɵɵtext(2),t.ɵɵpipe(3,"titlecase"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,null==e.security?null:e.security.type))}}function x0(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",40)}function b0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",10),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function w0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,b0,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",41),t.ɵɵelementContainer(4,42),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",43)(6,"button",44),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",45),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",46,2),t.ɵɵelementContainer(11,42),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(4),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function S0(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",47)}function C0(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class _0 extends $a{getDatasource(){return new T0}manageMapping(e,t){e&&e.stopPropagation();const n=J(t),i=n?this.entityFormArray.at(t).value:{};this.getMappingDialog(i,n?"action.apply":"action.add").afterClosed().pipe(In(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteMapping(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:this.entityFormArray.at(t).value.endpoint}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(In(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>Object.values(e).some((e=>e.toString().toLowerCase().includes(t.toLowerCase())||e.type?.toLowerCase().includes(t.toLowerCase())))))),this.dataSource.loadData(e)}getMappingDialog(e,t){return this.dialog.open(p0,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,withReportStrategy:this.withReportStrategy}})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(_0)))(n||_0)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:_0,selectors:[["tb-rest-mapping-table"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>_0)),multi:!0},{provide:he,useExisting:c((()=>_0)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:47,vars:37,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-absolute-fill","size-full"],[1,"flex","size-full","flex-col"],[1,"gw-table-toolbar","mat-mdc-table-toolbar"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"gw-connector-table"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","!w-1/5",4,"matHeaderCellDef"],["class","w-1/5",4,"matCellDef"],["class","w-1/3 !pl-0",4,"matHeaderCellDef"],["class","w-1/3",4,"matCellDef"],["class","w-1/6",4,"matHeaderCellDef"],["class","w-1/6",4,"matCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"!w-1/5"],["tbTruncateWithTooltip",""],[1,"w-1/5"],[1,"w-1/3","!pl-0"],[1,"w-1/3"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text","http-method-label","font-medium"],["tbTruncateWithTooltip","",1,"http-method-label","font-medium"],[1,"w-1/6"],[1,"w-12"],[1,"lt-lg:!hidden","flex","min-w-24","flex-1","flex-row","items-stretch","justify-end","text-center"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,d0,13,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"button",7),t.ɵɵpipe(7,"translate"),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",8)(11,"mat-label"),t.ɵɵtext(12," "),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",9,0),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵpipe(17,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(18,"mat-icon"),t.ɵɵtext(19,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"table",12),t.ɵɵelementContainerStart(22,13),t.ɵɵtemplate(23,u0,4,3,"mat-header-cell",14)(24,m0,3,1,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,13),t.ɵɵtemplate(26,h0,3,3,"mat-header-cell",16)(27,f0,6,1,"mat-cell",17),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(28,13),t.ɵɵtemplate(29,y0,3,3,"mat-header-cell",18)(30,v0,4,3,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(31,20),t.ɵɵtemplate(32,x0,1,0,"mat-header-cell",21)(33,w0,12,3,"mat-cell",22),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(34,S0,1,0,"mat-header-row",23)(35,C0,1,0,"mat-row",24),t.ɵɵelementEnd(),t.ɵɵelementStart(36,"section",25),t.ɵɵpipe(37,"async"),t.ɵɵelementStart(38,"button",26),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(39,"mat-icon",27),t.ɵɵtext(40,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(41,"span"),t.ɵɵtext(42),t.ɵɵpipe(43,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(44,"span",28),t.ɵɵpipe(45,"async"),t.ɵɵtext(46," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵconditional(!1===t.ɵɵpipeBind1(4,21,n.dataSource.isEmpty())?3:-1),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,23,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,25,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,27,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","endpoint"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","httpMethods"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","securityType"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(35,c0))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(36,c0)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(37,29,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(43,31,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(45,33,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(_0,[se,_,Wn,$n]),styles:[".http-method-label[_ngcontent-%COMP%]{font-size:12px}"],changeDetection:d.OnPush})}}let T0=class extends G{constructor(){super()}};function I0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" : ",e.value.value," ")}}function E0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.key-required"))}function M0(e,n){1&e&&(t.ɵɵelementStart(0,"mat-icon",21),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,"gateway.value-required"))}function k0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",16)(1,"div",17),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",18)(5,"mat-form-field",19),t.ɵɵelement(6,"input",20),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,E0,3,3,"mat-icon",21),t.ɵɵelementEnd()()(),t.ɵɵelementStart(9,"div",16)(10,"div",22),t.ɵɵtext(11,"gateway.value"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",19),t.ɵɵelement(13,"input",23),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,M0,3,3,"mat-icon",21),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,5,"gateway.key")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.get("key").hasError("required")&&e.get("key").touched?8:-1),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.get("value").hasError("required")&&e.get("value").touched?15:-1)}}function P0(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵelementContainerStart(2,11),t.ɵɵelementStart(3,"mat-expansion-panel",12)(4,"mat-expansion-panel-header")(5,"mat-panel-title")(6,"div",13),t.ɵɵtext(7),t.ɵɵelementEnd(),t.ɵɵtemplate(8,I0,2,1,"div",13),t.ɵɵelementEnd()(),t.ɵɵtemplate(9,k0,16,11,"ng-template",14),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"button",15),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.deleteKey(n,i))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.$index,a=n.$count;t.ɵɵadvance(2),t.ɵɵproperty("formGroup",e),t.ɵɵadvance(),t.ɵɵproperty("expanded",i===a-1),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",null==e.value?null:e.value.key," "),t.ɵɵadvance(),t.ɵɵconditional(null!=e.value&&e.value.value?8:-1),t.ɵɵadvance(2),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,5,"gateway.rest.delete-http-header"))}}function D0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",3),t.ɵɵrepeaterCreate(1,P0,14,7,"div",9,t.ɵɵrepeaterTrackByIndex),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵrepeater(e.keysListFormArray.controls)}}function O0(e,n){1&e&&(t.ɵɵelementStart(0,"div",4)(1,"span",24),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.rest.no-http-headers")))}class A0 extends q{constructor(e,t){super(t),this.fb=e,this.store=t,this.withReportStrategy=!0,this.keysDataApplied=p(),this.ReportStrategyDefaultValue=on}ngOnInit(){this.keysListFormArray=this.prepareKeysFormArray(this.keys)}addKey(){this.keysListFormArray.push(this.fb.group({key:["",[me.required,me.pattern(pn)]],value:["",[me.required,me.pattern(pn)]]}))}deleteKey(e,t){e&&e.stopPropagation(),this.keysListFormArray.removeAt(t),this.keysListFormArray.markAsDirty()}cancel(){this.popover?.hide()}applyKeysData(){this.keysDataApplied.emit(this.keysListFormArray.value.reduce(((e,{key:t,value:n})=>({...e,[t]:n})),{}))}prepareKeysFormArray(e){const t=[];return Object.keys(e)?.forEach((n=>{t.push(this.fb.group({key:[n,[me.required,me.pattern(pn)]],value:[e[n],[me.required,me.pattern(pn)]]}))})),this.fb.array(t)}static{this.ɵfac=function(e){return new(e||A0)(t.ɵɵdirectiveInject(de.UntypedFormBuilder),t.ɵɵdirectiveInject(Xe.Store))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:A0,selectors:[["tb-rest-http-headers-panel"]],inputs:{keys:"keys",popover:"popover",withReportStrategy:[2,"withReportStrategy","withReportStrategy",m]},outputs:{keysDataApplied:"keysDataApplied"},standalone:!0,features:[t.ɵɵInputTransformsFeature,t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:18,vars:15,consts:[[1,"w-[77vw]","max-w-2xl"],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-panel-title"],[1,"tb-form-panel","no-border","no-padding","h-[500px]"],[1,"tb-flex","no-flex","center","align-center","h-[500px]"],["type","button","mat-stroked-button","","color","primary",3,"click"],[1,"tb-flex","flex-end"],["mat-button","","color","primary","type","button",3,"click"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[1,"tb-form-panel","no-border","no-padding","tb-flex","no-flex","row","center","fill-width"],[1,"tb-form-panel","stroked","tb-flex"],[3,"formGroup"],[1,"tb-settings",3,"expanded"],["tbTruncateWithTooltip","",1,"max-w-[11vw]"],["matExpansionPanelContent",""],["type","button","mat-icon-button","","matTooltipPosition","above",1,"gw-delete-icon-button",3,"click","matTooltip"],[1,"tb-form-row"],[1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","name","value","formControlName","key",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","text","name","value","formControlName","value",3,"placeholder"],[1,"tb-prompt"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(5,D0,3,0,"div",3)(6,O0,4,3,"div",4),t.ɵɵelementStart(7,"div")(8,"button",5),t.ɵɵlistener("click",(function(){return n.addKey()})),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(11,"div",6)(12,"button",7),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"button",8),t.ɵɵlistener("click",(function(){return n.applyKeysData()})),t.ɵɵtext(16),t.ɵɵpipe(17,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate2("",t.ɵɵpipeBind1(4,7,"gateway.rest.http-headers"),""," ("+n.keysListFormArray.controls.length+")"," "),t.ɵɵadvance(2),t.ɵɵconditional(n.keysListFormArray.controls.length?5:6),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(10,9,"gateway.rest.add-http-header")," "),t.ɵɵadvance(4),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,11,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.keysListFormArray.invalid||!n.keysListFormArray.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(17,13,"action.apply")," "))},dependencies:t.ɵɵgetComponentDepsFactory(A0,[se,_]),encapsulation:2,changeDetection:d.OnPush})}}const F0=()=>({min:1}),R0=()=>({maxWidth:"970px"});function B0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,i.RestRequestTypesTranslationsMap.get(e)))}}function N0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-required"))}function L0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.endpoint-pattern"))}function V0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function q0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.http-methods-required"))}function G0(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵpipe(2,"titlecase"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,2,e))}}function z0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.rest.endpoint"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",21),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,N0,2,3,"tb-error-icon",22)(8,L0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",19),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.rest.http-methods"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",20)(14,"mat-select",23),t.ɵɵrepeaterCreate(15,V0,2,2,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd(),t.ɵɵtemplate(17,q0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",9)(19,"div",24),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"gateway.type"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"mat-form-field",20)(23,"mat-select",25),t.ɵɵrepeaterCreate(24,G0,3,4,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,6,"gateway.hints.rest.endpoint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,8,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("endpoint").hasError("required")&&e.mappingFormGroup.get("endpoint").touched?7:e.mappingFormGroup.get("endpoint").hasError("pattern")&&e.mappingFormGroup.get("endpoint").touched?8:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,10,"gateway.hints.rest.http-methods")),t.ɵɵadvance(5),t.ɵɵrepeater(e.httpMethods),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("HTTPMethods").hasError("required")&&e.mappingFormGroup.get("HTTPMethods").touched?17:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(20,12,"gateway.hints.rest.scope-type")),t.ɵɵadvance(5),t.ɵɵrepeater(e.requestsScopeType)}}function U0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-required"))}function j0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-pattern"))}function H0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.device-name-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",26),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,U0,2,3,"tb-error-icon",22)(8,j0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.device-name-filter-hint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("deviceNameFilter").hasError("required")&&e.mappingFormGroup.get("deviceNameFilter").touched?7:e.mappingFormGroup.get("deviceNameFilter").hasError("pattern")&&e.mappingFormGroup.get("deviceNameFilter").touched?8:-1)}}function W0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.method-filter-required"))}function $0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.method-filter-pattern"))}function K0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.method-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",27),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,W0,2,3,"tb-error-icon",22)(8,$0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.rest.method-filter")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("methodFilter").hasError("required")&&e.mappingFormGroup.get("methodFilter").touched?7:e.mappingFormGroup.get("methodFilter").hasError("pattern")&&e.mappingFormGroup.get("methodFilter").touched?8:-1)}}function Y0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-filter-required"))}function X0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-filter-pattern"))}function Z0(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.attribute-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",28),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,Y0,2,3,"tb-error-icon",22)(8,X0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,3,"gateway.hints.rest.attribute-filter")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,5,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("attributeFilter").hasError("required")&&e.mappingFormGroup.get("attributeFilter").touched?7:e.mappingFormGroup.get("attributeFilter").hasError("pattern")&&e.mappingFormGroup.get("attributeFilter").touched?8:-1)}}function Q0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.request-url-expression-required"))}function J0(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.request-url-expression-pattern"))}function e2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",13),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function t2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.value-expression-required"))}function n2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.value-expression-pattern"))}function i2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",29)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.rest.request-url-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",30),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,Q0,2,3,"tb-error-icon",22)(8,J0,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",19),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"gateway.rest.http-method"),t.ɵɵelementEnd(),t.ɵɵelementStart(13,"mat-form-field",20)(14,"mat-select",31),t.ɵɵrepeaterCreate(15,e2,2,2,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵelementStart(17,"div",9)(18,"div",19),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"gateway.value-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",20),t.ɵɵelement(22,"input",32),t.ɵɵpipe(23,"translate"),t.ɵɵtemplate(24,t2,2,3,"tb-error-icon",22)(25,n2,2,3,"tb-error-icon",22),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,7,"gateway.hints.rest.attribute-url-expression")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("requestUrlExpression").hasError("required")&&e.mappingFormGroup.get("requestUrlExpression").touched?7:e.mappingFormGroup.get("requestUrlExpression").hasError("pattern")&&e.mappingFormGroup.get("requestUrlExpression").touched?8:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(11,11,"gateway.hints.rest.http-method")),t.ɵɵadvance(5),t.ɵɵrepeater(e.httpMethods),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(19,13,"gateway.hints.rest.value-expression")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(23,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("valueExpression").hasError("required")&&e.mappingFormGroup.get("valueExpression").touched?24:e.mappingFormGroup.get("valueExpression").hasError("pattern")&&e.mappingFormGroup.get("valueExpression").touched?25:-1)}}function a2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,F0)))}function r2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function o2(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function s2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2,"gateway.response-timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",20),t.ɵɵelement(4,"input",33),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,a2,2,5,"tb-error-icon",22)(7,r2,2,3,"tb-error-icon",22)(8,o2,2,0,"span",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("responseTimeout").hasError("min")&&e.mappingFormGroup.get("responseTimeout").touched?6:e.mappingFormGroup.get("responseTimeout").hasError("pattern")&&e.mappingFormGroup.get("responseTimeout").touched?7:8)}}function l2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-required"))}function p2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.device-name-filter-pattern"))}function c2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-name-expression-required"))}function d2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.attribute-name-expression-pattern"))}function u2(e,n){1&e&&t.ɵɵelement(0,"div",38),2&e&&t.ɵɵproperty("tb-help-popup","widget/lib/gateway/rest-json_fn")("tb-help-popup-style",t.ɵɵpureFunction0(2,R0))}function m2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",19),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3,"gateway.device-name-filter"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-form-field",20),t.ɵɵelement(5,"input",35),t.ɵɵpipe(6,"translate"),t.ɵɵtemplate(7,l2,2,3,"tb-error-icon",22)(8,p2,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"div",9)(10,"div",36),t.ɵɵtext(11,"gateway.attribute-name-expression"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"mat-form-field",20),t.ɵɵelement(13,"input",37),t.ɵɵpipe(14,"translate"),t.ɵɵtemplate(15,c2,2,3,"tb-error-icon",22)(16,d2,2,3,"tb-error-icon",22)(17,u2,1,3,"div",38),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,5,"gateway.device-name-filter-hint")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,7,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("deviceNameExpression").hasError("required")&&e.mappingFormGroup.get("deviceNameExpression").touched?7:e.mappingFormGroup.get("deviceNameExpression").hasError("pattern")&&e.mappingFormGroup.get("deviceNameExpression").touched?8:-1),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(14,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("attributeNameExpression").hasError("required")&&e.mappingFormGroup.get("attributeNameExpression").touched?15:e.mappingFormGroup.get("attributeNameExpression").hasError("pattern")&&e.mappingFormGroup.get("attributeNameExpression").touched?16:17)}}function h2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,F0)))}function g2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function f2(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function y2(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",9)(1,"div",10),t.ɵɵtext(2,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"mat-form-field",20),t.ɵɵelement(4,"input",39),t.ɵɵpipe(5,"translate"),t.ɵɵtemplate(6,h2,2,5,"tb-error-icon",22)(7,g2,2,3,"tb-error-icon",22)(8,f2,2,0,"span",34),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(5,2,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("timeout").hasError("min")&&e.mappingFormGroup.get("timeout").touched?6:e.mappingFormGroup.get("timeout").hasError("pattern")&&e.mappingFormGroup.get("timeout").touched?7:8)}}function v2(e,n){1&e&&(t.ɵɵelementStart(0,"div",14)(1,"mat-slide-toggle",40)(2,"mat-label",41),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.hints.rest.update-ssl")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.rest.ssl-verify")," "))}function x2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-chip")(1,"div",53),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit;t.ɵɵadvance(2),t.ɵɵtextInterpolate(e.value)}}function b2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind2(1,1,"gateway.response-timeout-limits-error",t.ɵɵpureFunction0(4,F0)))}function w2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.timeout-pattern"))}function S2(e,n){1&e&&(t.ɵɵelementStart(0,"span",34),t.ɵɵtext(1,"gateway.suffix.s"),t.ɵɵelementEnd())}function C2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.tries-min"))}function _2(e,n){1&e&&(t.ɵɵelement(0,"tb-error-icon",22),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("tooltipText",t.ɵɵpipeBind1(1,1,"gateway.hints.rest.tries-pattern"))}function T2(e,n){1&e&&(t.ɵɵelementStart(0,"div",14)(1,"mat-slide-toggle",54)(2,"mat-label"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,1,"gateway.rest.allow-redirects")," "))}function I2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",8)(1,"mat-expansion-panel",42)(2,"mat-expansion-panel-header")(3,"mat-panel-title",43)(4,"div",44),t.ɵɵtext(5,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(6,"div",45)(7,"div",10),t.ɵɵtext(8,"gateway.rest.http-headers"),t.ɵɵelementEnd(),t.ɵɵelementStart(9,"div",46)(10,"mat-chip-listbox",47),t.ɵɵpipe(11,"keyvalue"),t.ɵɵrepeaterCreate(12,x2,3,1,"mat-chip",null,t.ɵɵrepeaterTrackByIdentity),t.ɵɵpipe(14,"keyvalue"),t.ɵɵelementStart(15,"mat-chip",48),t.ɵɵelement(16,"label",49),t.ɵɵelementEnd()(),t.ɵɵelementStart(17,"button",50,0),t.ɵɵpipe(19,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵreference(18),a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageKeys(n,i))})),t.ɵɵelementStart(20,"tb-icon",51),t.ɵɵtext(21,"edit"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(22,"div",9)(23,"div",10),t.ɵɵtext(24,"gateway.timeout"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-form-field",20),t.ɵɵelement(26,"input",39),t.ɵɵpipe(27,"translate"),t.ɵɵtemplate(28,b2,2,5,"tb-error-icon",22)(29,w2,2,3,"tb-error-icon",22)(30,S2,2,0,"span",34),t.ɵɵelementEnd()(),t.ɵɵelementStart(31,"div",9)(32,"div",10),t.ɵɵtext(33,"gateway.rest.tries"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"mat-form-field",20),t.ɵɵelement(35,"input",52),t.ɵɵpipe(36,"translate"),t.ɵɵtemplate(37,C2,2,3,"tb-error-icon",22)(38,_2,2,3,"tb-error-icon",22),t.ɵɵelementEnd()(),t.ɵɵtemplate(39,T2,5,3,"div",14),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(10),t.ɵɵproperty("tbEllipsisChipList",t.ɵɵpipeBind1(11,7,e.mappingFormGroup.get("httpHeaders").value)),t.ɵɵadvance(2),t.ɵɵrepeater(t.ɵɵpipeBind1(14,9,e.mappingFormGroup.get("httpHeaders").value)),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,11,"action.edit")),t.ɵɵadvance(9),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(27,13,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("timeout").hasError("min")&&e.mappingFormGroup.get("timeout").touched?28:e.mappingFormGroup.get("timeout").hasError("pattern")&&e.mappingFormGroup.get("timeout").touched?29:30),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(36,15,"gateway.set")),t.ɵɵadvance(2),t.ɵɵconditional(e.mappingFormGroup.get("tries").hasError("min")&&e.mappingFormGroup.get("tries").touched?37:e.mappingFormGroup.get("tries").hasError("pattern")&&e.mappingFormGroup.get("tries").touched?38:-1),t.ɵɵadvance(2),t.ɵɵconditional(e.requestType===e.RestRequestType.ATTRIBUTE_UPDATE?39:-1)}}class E2 extends A{constructor(e,t,n,i,a,r,o,s,l,p){super(e,t,i),this.store=e,this.router=t,this.data=n,this.dialogRef=i,this.fb=a,this.popoverService=r,this.renderer=o,this.viewContainerRef=s,this.cdr=l,this.destroyRef=p,this.requestTypes=Object.values(Ii),this.requestsScopeType=Object.values(Mi),this.httpMethods=Object.values(gt),this.helpLink=`${O}/docs/iot-gateway/config/rest/#attribute-request-section`,this.RestRequestTypesTranslationsMap=Ei,this.SecurityMode=Ji,this.RestRequestType=Ii,this.mappingFormGroup=this.fb.group({requestType:[Ii.ATTRIBUTE_REQUEST],endpoint:["",[me.required,me.pattern(pn)]],HTTPMethods:[[gt.POST],[me.required]],HTTPMethod:[gt.POST,[me.required]],type:[Mi.Shared],security:[{type:Ri.ANONYMOUS}],timeout:[null,[me.min(.001),me.pattern(ln)]],deviceNameExpression:["",[me.required,me.pattern(pn)]],attributeNameExpression:["",[me.required,me.pattern(pn)]],SSLVerify:[!1],deviceNameFilter:["",[me.required,me.pattern(pn)]],methodFilter:["",[me.required,me.pattern(pn)]],attributeFilter:["",[me.required,me.pattern(pn)]],requestUrlExpression:[this.data.defaultRequestUrl,[me.required,me.pattern(pn)]],valueExpression:["",[me.required,me.pattern(pn)]],responseTimeout:[null,[me.min(.001),me.pattern(ln)]],tries:[null,[me.min(1),me.pattern(ln)]],allowRedirects:[!1],httpHeaders:[{}]}),this.keysPopupClosed=!0,this.mappingFormGroup.patchValue(this.data.value,{emitEvent:!1}),this.observeRequestTypeChange(),this.toggleFieldsByRequestType(this.mappingFormGroup.get("requestType").value)}get requestType(){return this.mappingFormGroup.get("requestType").value}cancel(){this.keysPopupClosed&&this.dialogRef.close(null)}add(){if(this.mappingFormGroup.valid){const{requestType:e,...t}=this.mappingFormGroup.value;Y(t),this.dialogRef.close({requestType:e,requestValue:t})}}manageKeys(e,t){e.stopPropagation();const n=t._elementRef.nativeElement;if(this.popoverService.hasPopover(n))return void this.popoverService.hidePopover(n);this.popoverService.hasPopover(n)&&this.popoverService.hidePopover(n),this.keysPopupClosed=!1;const i=this.popoverService.displayPopover(n,this.renderer,this.viewContainerRef,A0,"leftBottom",!1,null,{keys:this.mappingFormGroup.get("httpHeaders").value,withReportStrategy:this.data.withReportStrategy},{},{},{},!0);i.tbComponentRef.instance.popover=i,i.tbComponentRef.instance.keysDataApplied.subscribe((e=>{i.hide(),this.mappingFormGroup.get("httpHeaders").patchValue(e),this.mappingFormGroup.get("httpHeaders").markAsDirty(),this.cdr.markForCheck()})),i.tbHideStart.pipe(In(this.destroyRef)).subscribe((()=>{this.keysPopupClosed=!0}))}observeRequestTypeChange(){this.mappingFormGroup.get("requestType").valueChanges.pipe(Pe(),In(this.destroyRef)).subscribe((e=>this.toggleFieldsByRequestType(e)))}toggleFieldsByRequestType(e){this.mappingFormGroup.disable({emitEvent:!1}),ki.get("all").forEach((e=>this.mappingFormGroup.get(e).enable({emitEvent:!1}))),ki.get(e).forEach((e=>this.mappingFormGroup.get(e).enable({emitEvent:!1})))}static{this.ɵfac=function(e){return new(e||E2)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(Ze.Router),t.ɵɵdirectiveInject(Ue),t.ɵɵdirectiveInject(je.MatDialogRef),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(rt.TbPopoverService),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:E2,selectors:[["tb-rest-requests-mapping-dialog"]],standalone:!0,features:[t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:37,vars:23,consts:[["button",""],[1,"h-full","w-[77vw]","max-w-3xl",3,"formGroup"],["color","primary"],[1,"flex-1"],[3,"tb-help"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["mat-dialog-content",""],[1,"tb-form-panel","no-border","no-padding"],[1,"tb-form-row"],["translate","",1,"fixed-title-width"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex"],["formControlName","requestType"],[3,"value"],[1,"tb-form-row","tb-flex","fill-width"],["formControlName","security",3,"mode"],["mat-dialog-actions","",1,"justify-end"],["mat-button","","color","primary","type","button","cdkFocusInitial","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],["translate","",1,"fixed-title-width","tb-required",3,"tb-hint-tooltip-icon"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","type","text","name","value","formControlName","endpoint",3,"placeholder"],["matSuffix","",3,"tooltipText"],["formControlName","HTTPMethods","multiple",""],["translate","",1,"fixed-title-width",3,"tb-hint-tooltip-icon"],["formControlName","type"],["matInput","","type","text","name","value","formControlName","deviceNameFilter",3,"placeholder"],["matInput","","type","text","name","value","formControlName","methodFilter",3,"placeholder"],["matInput","","type","text","name","value","formControlName","attributeFilter",3,"placeholder"],[1,"tb-form-row","request-url-row"],["matInput","","type","text","name","value","formControlName","requestUrlExpression",3,"placeholder"],["formControlName","HTTPMethod"],["matInput","","type","text","name","value","formControlName","valueExpression",3,"placeholder"],["matInput","","type","number","min","0","name","value","formControlName","responseTimeout",3,"placeholder"],["translate","","matSuffix","",1,"block","pr-2"],["matInput","","type","text","name","value","formControlName","deviceNameExpression",3,"placeholder"],["translate","",1,"fixed-title-width","tb-required"],["matInput","","type","text","name","value","formControlName","attributeNameExpression",3,"placeholder"],["matSuffix","","tb-help-popup-placement","left",1,"see-example","p-1",3,"tb-help-popup","tb-help-popup-style"],["matInput","","type","number","min","0","name","value","formControlName","timeout",3,"placeholder"],["formControlName","SSLVerify",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],[1,"tb-settings"],[1,"justify-end"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","space-between","tb-flex"],[1,"tb-flex","gw-chip-list"],[1,"tb-flex",3,"tbEllipsisChipList"],[1,"mat-mdc-chip","ellipsis-chip"],[1,"ellipsis-text"],["type","button","mat-icon-button","","color","primary","matTooltipPosition","above",3,"click","matTooltip"],["matButtonIcon",""],["matInput","","type","number","min","0","name","value","formControlName","tries",3,"placeholder"],["tbTruncateWithTooltip",""],["formControlName","allowRedirects",1,"mat-slide"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",1)(1,"mat-toolbar",2)(2,"h2"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(5,"span",3)(6,"div",4),t.ɵɵelementStart(7,"button",5),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵelementStart(8,"mat-icon",6),t.ɵɵtext(9,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10),t.ɵɵtext(14,"gateway.request-type"),t.ɵɵelementEnd(),t.ɵɵelementStart(15,"mat-form-field",11)(16,"mat-select",12),t.ɵɵrepeaterCreate(17,B0,3,4,"mat-option",13,t.ɵɵrepeaterTrackByIdentity),t.ɵɵelementEnd()()(),t.ɵɵtemplate(19,z0,26,14)(20,H0,9,7,"div",9)(21,K0,9,7,"div",9)(22,Z0,9,7,"div",9)(23,i2,26,17)(24,s2,9,4,"div",9)(25,m2,18,11)(26,y2,9,4,"div",9)(27,v2,6,6,"div",14),t.ɵɵelement(28,"tb-security-config",15),t.ɵɵtemplate(29,I2,40,17,"div",8),t.ɵɵelementEnd()(),t.ɵɵelementStart(30,"div",16)(31,"button",17),t.ɵɵlistener("click",(function(){return n.cancel()})),t.ɵɵtext(32),t.ɵɵpipe(33,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(34,"button",18),t.ɵɵlistener("click",(function(){return n.add()})),t.ɵɵtext(35),t.ɵɵpipe(36,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.mappingFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,17,"gateway.requests-mapping")),t.ɵɵadvance(3),t.ɵɵproperty("tb-help",n.helpLink),t.ɵɵadvance(11),t.ɵɵrepeater(n.requestTypes),t.ɵɵadvance(2),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?19:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?20:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.SERVER_SIDE_RPC?21:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_UPDATE?22:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?23:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.SERVER_SIDE_RPC?24:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?25:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_REQUEST?26:-1),t.ɵɵadvance(),t.ɵɵconditional(n.requestType===n.RestRequestType.ATTRIBUTE_UPDATE?27:-1),t.ɵɵadvance(),t.ɵɵproperty("mode",n.SecurityMode.basic),t.ɵɵadvance(),t.ɵɵconditional(n.requestType!==n.RestRequestType.ATTRIBUTE_REQUEST?29:-1),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(33,19,"action.cancel")," "),t.ɵɵadvance(2),t.ɵɵproperty("disabled",n.mappingFormGroup.invalid||!n.mappingFormGroup.dirty||!n.keysPopupClosed),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(36,21,n.data.buttonTitle)," "))},dependencies:t.ɵɵgetComponentDepsFactory(E2,[se,_,$n,UY,ai]),styles:["[_nghost-%COMP%] .tb-form-row.request-url-row[_ngcontent-%COMP%]{gap:6px}"],changeDetection:d.OnPush})}}const M2=()=>["type","details","actions"],k2=()=>({});function P2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",6)(1,"div",26),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelement(4,"span",8),t.ɵɵelementStart(5,"button",10),t.ɵɵpipe(6,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.manageMapping(n))})),t.ɵɵelementStart(7,"mat-icon"),t.ɵɵtext(8,"add"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"button",10),t.ɵɵpipe(10,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.enterFilterMode())})),t.ɵɵelementStart(11,"mat-icon"),t.ɵɵtext(12,"search"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,3,"gateway.requests-mapping")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(6,5,"action.add")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,7,"action.search")))}function D2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",27)(1,"div",28),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,"gateway.type")))}function O2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",29)(1,"div",28),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,1,i.RestRequestTypesTranslationsMap.get(e.requestType)))}}function A2(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",30),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.details")," "))}function F2(e,n){if(1&e&&t.ɵɵtext(0),2&e){let e;const n=t.ɵɵnextContext().$implicit,i=t.ɵɵnextContext();t.ɵɵtextInterpolate1(" ",i.Object.values(null!==(e=n.requestValue.httpHeaders)&&void 0!==e?e:t.ɵɵpureFunction0(1,k2)).join(", ")," ")}}function R2(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate1(" ",e.requestValue.methodFilter," ")}}function B2(e,n){if(1&e&&t.ɵɵtext(0),2&e){const e=t.ɵɵnextContext().$implicit;t.ɵɵtextInterpolate1(" ",e.requestValue.endpoint," ")}}function N2(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",29)(1,"div",28),t.ɵɵtemplate(2,F2,1,2)(3,R2,1,1)(4,B2,1,1),t.ɵɵelementEnd()()),2&e){let e;const i=n.$implicit;t.ɵɵadvance(2),t.ɵɵconditional("attributeUpdates"===(e=i.requestType)?2:"serverSideRpc"===e?3:4)}}function L2(e,n){1&e&&t.ɵɵelement(0,"mat-header-cell",31)}function V2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",10),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.manageMapping(n,i))})),t.ɵɵelementStart(2,"tb-icon"),t.ɵɵtext(3,"edit"),t.ɵɵelementEnd()(),t.ɵɵelementStart(4,"button",10),t.ɵɵpipe(5,"translate"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext().index,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteMapping(n,i))})),t.ɵɵelementStart(6,"tb-icon"),t.ɵɵtext(7,"delete"),t.ɵɵelementEnd()()}2&e&&(t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.edit")),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(5,4,"action.delete")))}function q2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtemplate(1,V2,8,6,"ng-template",null,1,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(3,"div",32),t.ɵɵelementContainer(4,33),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",34)(6,"button",35),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(7,"mat-icon",36),t.ɵɵtext(8,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(9,"mat-menu",37,2),t.ɵɵelementContainer(11,33),t.ɵɵelementEnd()()()}if(2&e){const e=t.ɵɵreference(2),n=t.ɵɵreference(10);t.ɵɵadvance(4),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(2),t.ɵɵproperty("matMenuTriggerFor",n),t.ɵɵadvance(5),t.ɵɵproperty("ngTemplateOutlet",e)}}function G2(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",38)}function z2(e,n){1&e&&t.ɵɵelement(0,"mat-row")}class U2 extends $a{constructor(){super(...arguments),this.Object=Object,this.RestRequestTypesTranslationsMap=Ei}getDatasource(){return new j2}manageMapping(e,t){e&&e.stopPropagation();const n=J(t),{requestType:i=Ii.ATTRIBUTE_REQUEST,requestValue:a={}}=n?this.entityFormArray.at(t).value:{};this.getMappingDialog({requestType:i,...a},n?"action.apply":"action.add").afterClosed().pipe(In(this.destroyRef)).subscribe((e=>{e&&(n?this.entityFormArray.at(t).patchValue(e):this.entityFormArray.push(this.fb.control(e)),this.entityFormArray.markAsDirty())}))}deleteMapping(e,t){e&&e.stopPropagation(),this.dialogService.confirm(this.translate.instant("gateway.delete-mapping-title",{name:this.getRequestDetails(this.entityFormArray.at(t).value)}),this.translate.instant("gateway.delete-mapping-description"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0).pipe(In(this.destroyRef)).subscribe((e=>{e&&(this.entityFormArray.removeAt(t),this.entityFormArray.markAsDirty())}))}updateTableData(e,t){t&&(e=e.filter((e=>{const n=this.getRequestDetails(e);return Object.values(e).some((e=>Q(e)&&this.translate.instant(Ei.get(e)).toLowerCase().includes(t.toLowerCase())||n?.toLowerCase().includes(t.toLowerCase())))}))),this.dataSource.loadData(e)}getRequestDetails(e){let t;switch(e.requestType){case"attributeUpdates":t=Object.values(e.requestValue.httpHeaders).join(", ");break;case"serverSideRpc":t=e.requestValue.methodFilter;break;default:t=e.requestValue.endpoint}return t}validate(){return null}getMappingDialog(e,t){return this.dialog.open(E2,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{value:e,buttonTitle:t,defaultRequestUrl:this.defaultRequestUrl,withReportStrategy:this.withReportStrategy}})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(U2)))(n||U2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:U2,selectors:[["tb-rest-request-mapping-table"]],inputs:{defaultRequestUrl:"defaultRequestUrl"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>U2)),multi:!0},{provide:he,useExisting:c((()=>U2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:44,vars:36,consts:[["searchInput",""],["rowActions",""],["cellActionsMenu","matMenu"],[1,"tb-absolute-fill","size-full"],[1,"flex","size-full","flex-col"],[1,"gw-table-toolbar","mat-mdc-table-toolbar"],[1,"mat-toolbar-tools"],["mat-icon-button","","matTooltipPosition","above",3,"matTooltip"],[1,"flex-1"],["matInput","",3,"formControl","placeholder"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"gw-connector-table"],["mat-table","",3,"dataSource"],[3,"matColumnDef"],["class","!w-1/3",4,"matHeaderCellDef"],["class","w-1/3",4,"matCellDef"],["class","w-1/3 !pl-0",4,"matHeaderCellDef"],["matColumnDef","actions","stickyEnd",""],["class","w-12",4,"matHeaderCellDef"],[4,"matCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],["translate","",1,"no-data-found","items-center","justify-center"],[1,"title-container"],[1,"!w-1/3"],["tbTruncateWithTooltip",""],[1,"w-1/3"],[1,"w-1/3","!pl-0"],[1,"w-12"],[1,"lt-lg:!hidden","flex","min-w-24","flex-1","flex-row","items-stretch","justify-end","text-center"],[3,"ngTemplateOutlet"],[1,"gt-md:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",3)(1,"div",4)(2,"mat-toolbar",5),t.ɵɵtemplate(3,P2,13,9,"div",6),t.ɵɵpipe(4,"async"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-toolbar",5)(6,"button",7),t.ɵɵpipe(7,"translate"),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"search"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"mat-form-field",8)(11,"mat-label"),t.ɵɵtext(12," "),t.ɵɵelementEnd(),t.ɵɵelement(13,"input",9,0),t.ɵɵpipe(15,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(16,"button",10),t.ɵɵpipe(17,"translate"),t.ɵɵlistener("click",(function(){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.exitFilterMode())})),t.ɵɵelementStart(18,"mat-icon"),t.ɵɵtext(19,"close"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(20,"div",11)(21,"table",12),t.ɵɵelementContainerStart(22,13),t.ɵɵtemplate(23,D2,4,3,"mat-header-cell",14)(24,O2,4,3,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,13),t.ɵɵtemplate(26,A2,3,3,"mat-header-cell",16)(27,N2,5,1,"mat-cell",15),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(28,17),t.ɵɵtemplate(29,L2,1,0,"mat-header-cell",18)(30,q2,12,3,"mat-cell",19),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(31,G2,1,0,"mat-header-row",20)(32,z2,1,0,"mat-row",21),t.ɵɵelementEnd(),t.ɵɵelementStart(33,"section",22),t.ɵɵpipe(34,"async"),t.ɵɵelementStart(35,"button",23),t.ɵɵlistener("click",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.manageMapping(i))})),t.ɵɵelementStart(36,"mat-icon",24),t.ɵɵtext(37,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(38,"span"),t.ɵɵtext(39),t.ɵɵpipe(40,"translate"),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(41,"span",25),t.ɵɵpipe(42,"async"),t.ɵɵtext(43," widget.no-data-found "),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",n.textSearchMode),t.ɵɵadvance(),t.ɵɵconditional(!1===t.ɵɵpipeBind1(4,20,n.dataSource.isEmpty())?3:-1),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(7,22,"action.search")),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(15,24,"common.enter-search")),t.ɵɵproperty("formControl",n.textSearch),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,26,"action.close")),t.ɵɵadvance(5),t.ɵɵproperty("dataSource",n.dataSource),t.ɵɵadvance(),t.ɵɵproperty("matColumnDef","type"),t.ɵɵadvance(3),t.ɵɵproperty("matColumnDef","details"),t.ɵɵadvance(6),t.ɵɵproperty("matHeaderRowDef",t.ɵɵpureFunction0(34,M2))("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",t.ɵɵpureFunction0(35,M2)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.textSearchMode||!1===t.ɵɵpipeBind1(34,28,n.dataSource.isEmpty())),t.ɵɵadvance(6),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(40,30,"gateway.add-mapping")),t.ɵɵadvance(2),t.ɵɵclassProp("!hidden",!n.textSearchMode||!1===t.ɵɵpipeBind1(42,32,n.dataSource.isEmpty())))},dependencies:t.ɵɵgetComponentDepsFactory(U2,[se,_,Wn]),encapsulation:2,changeDetection:d.OnPush})}}class j2 extends G{constructor(){super()}}class H2 extends Ua{initBasicFormGroup(){return this.fb.group({server:[],mapping:[],requestsMapping:[]})}getRequestDataArray(e){const t=[];return ie(e)&&Object.keys(e).forEach((n=>{for(const i of e[n])t.push({requestType:n,requestValue:i})})),t}getRequestDataObject(e){return e.reduce(((e,{requestType:t,requestValue:n})=>(e[t]?.push(n),e)),{attributeRequests:[],attributeUpdates:[],serverSideRpc:[]})}updateDefaultUrl({host:e,port:t,SSL:n}){this.defaultRequestUrl=e&&t?`${n?"https":"http"}//${e}:${t}/`:document.location.origin}writeValue(e){this.basicFormGroup.setValue(this.mapConfigToFormValue(e),{emitEvent:!1})}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(H2)))(n||H2)}})()}static{this.ɵdir=t.ɵɵdefineDirective({type:H2,features:[t.ɵɵInheritDefinitionFeature]})}}class W2 extends H2{mapConfigToFormValue(e){return{server:e.server??{},mapping:e.mapping??[],requestsMapping:this.getRequestDataArray(e.requestsMapping)}}getMappedValue(e){return this.updateDefaultUrl(e?.server??{}),{server:e.server??{},mapping:e.mapping??[],requestsMapping:this.getRequestDataObject(e.requestsMapping??[])}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory(W2)))(n||W2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:W2,selectors:[["tb-rest-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>W2)),multi:!0},{provide:he,useExisting:c((()=>W2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:13,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server"],["formControlName","mapping"],["formControlName","requestsMapping",3,"defaultRequestUrl"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-rest-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-rest-mapping-table",4),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-tab",1),t.ɵɵpipe(11,"translate"),t.ɵɵelement(12,"tb-rest-request-mapping-table",5),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.server"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(11,15,"gateway.requests-mapping")),t.ɵɵadvance(2),t.ɵɵproperty("defaultRequestUrl",n.defaultRequestUrl))},dependencies:t.ɵɵgetComponentDepsFactory(W2,[se,_,L1,_0,U2]),encapsulation:2,changeDetection:d.OnPush})}}class $2 extends H2{mapConfigToFormValue({attributeRequests:e=[],attributeUpdates:t=[],serverSideRpc:n=[],mapping:i=[],...a}){return{server:{...a??{}},mapping:er.mapMappingToUpgradedVersion(i),requestsMapping:this.getRequestDataArray({attributeRequests:e,attributeUpdates:t,serverSideRpc:n})}}getMappedValue({requestsMapping:e,mapping:t=[],server:n={}}){this.updateDefaultUrl(n);const{attributeRequests:i=[],attributeUpdates:a=[],serverSideRpc:r=[]}=this.getRequestDataObject(e);return{...n,mapping:er.mapMappingToDowngradedVersion(t),attributeRequests:i,attributeUpdates:a,serverSideRpc:r}}static{this.ɵfac=(()=>{let e;return function(n){return(e||(e=t.ɵɵgetInheritedFactory($2)))(n||$2)}})()}static{this.ɵcmp=t.ɵɵdefineComponent({type:$2,selectors:[["tb-rest-legacy-basic-config"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>$2)),multi:!0},{provide:he,useExisting:c((()=>$2)),multi:!0}]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:13,vars:17,consts:[[3,"formGroup"],[3,"label"],[3,"ngTemplateOutlet"],["formControlName","server"],["formControlName","mapping"],["formControlName","requestsMapping",3,"defaultRequestUrl"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"mat-tab-group",0)(1,"mat-tab",1),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,2),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",1),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-rest-server-config",3),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"mat-tab",1),t.ɵɵpipe(8,"translate"),t.ɵɵelement(9,"tb-rest-mapping-table",4),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"mat-tab",1),t.ɵɵpipe(11,"translate"),t.ɵɵelement(12,"tb-rest-request-mapping-table",5),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,9,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",n.generalTabContent),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,11,"gateway.server"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(8,13,"gateway.data-mapping"),"*"),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(11,15,"gateway.requests-mapping")),t.ɵɵadvance(2),t.ɵɵproperty("defaultRequestUrl",n.defaultRequestUrl))},dependencies:t.ɵɵgetComponentDepsFactory($2,[se,_,L1,_0,U2]),encapsulation:2,changeDetection:d.OnPush})}}const K2=(e,t)=>({hasErrors:e,noErrors:t}),Y2=()=>({minWidth:"144px",maxWidth:"144px",textAlign:"center"}),X2=()=>({minWidth:"144px",maxWidth:"144px",width:"144px",textAlign:"center"}),Z2=e=>({"tb-current-entity":e});function Q2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",32),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"async"),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onAddConnector(n))})),t.ɵɵelementStart(3,"mat-icon"),t.ɵɵtext(4,"add"),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,2,"action.add")),t.ɵɵproperty("disabled",t.ɵɵpipeBind1(2,4,e.isLoading$))}}function J2(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",33)(1,"button",34),t.ɵɵlistener("click",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onAddConnector(n))})),t.ɵɵelementStart(2,"mat-icon",35),t.ɵɵtext(3,"add"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"span"),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()}2&e&&(t.ɵɵadvance(5),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,1,"gateway.add-connector")))}function e3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",36),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-enabled")," "))}function t3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell")(1,"mat-slide-toggle",37),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return n.stopPropagation(),t.ɵɵresetView(a.onEnableConnector(i))})),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("checked",i.activeConnectors.includes(e.key))}}function n3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",38),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-name"),""))}function i3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",e.key," ")}}function a3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-type")," "))}function r3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",40),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.returnType(e)," ")}}function o3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.configuration")," "))}function s3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-cell",40)(1,"div",41),t.ɵɵtext(2),t.ɵɵelementEnd()()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(i.isConnectorSynced(e)?"status-sync":"status-unsync"),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",i.isConnectorSynced(e)?"sync":"out of sync"," ")}}function l3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell",39),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.connectors-table-status")," "))}function p3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell",40)(1,"span",42),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementEnd()()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassMap(t.ɵɵpureFunction2(3,K2,+i.getErrorsCount(e)>0,0==+i.getErrorsCount(e)||""===i.getErrorsCount(e))),t.ɵɵpropertyInterpolate("matTooltip","Errors: "+i.getErrorsCount(e))}}function c3(e,n){1&e&&(t.ɵɵelementStart(0,"mat-header-cell"),t.ɵɵelement(1,"div",43),t.ɵɵelementStart(2,"div",44),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵstyleMap(t.ɵɵpureFunction0(5,Y2)),t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(4,3,"gateway.connectors-table-actions")))}function d3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-cell")(1,"div",45)(2,"button",46),t.ɵɵpipe(3,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorRpc(i,n))})),t.ɵɵelementStart(4,"mat-icon"),t.ɵɵtext(5,"private_connectivity"),t.ɵɵelementEnd()(),t.ɵɵelementStart(6,"button",47),t.ɵɵpipe(7,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementStart(8,"mat-icon"),t.ɵɵtext(9,"list"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"button",47),t.ɵɵpipe(11,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteConnector(i,n))})),t.ɵɵelementStart(12,"mat-icon"),t.ɵɵtext(13,"delete"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(14,"div",48)(15,"button",49),t.ɵɵlistener("click",(function(n){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.stopPropagation())})),t.ɵɵelementStart(16,"mat-icon",50),t.ɵɵtext(17,"more_vert"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"mat-menu",51,1)(20,"button",46),t.ɵɵpipe(21,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorRpc(i,n))})),t.ɵɵelementStart(22,"mat-icon"),t.ɵɵtext(23,"private_connectivity"),t.ɵɵelementEnd()(),t.ɵɵelementStart(24,"button",47),t.ɵɵpipe(25,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.connectorLogs(i,n))})),t.ɵɵelementStart(26,"mat-icon"),t.ɵɵtext(27,"list"),t.ɵɵelementEnd()(),t.ɵɵelementStart(28,"button",47),t.ɵɵpipe(29,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.deleteConnector(i,n))})),t.ɵɵelementStart(30,"mat-icon"),t.ɵɵtext(31,"delete"),t.ɵɵelementEnd()()()()()}if(2&e){const e=n.$implicit,i=t.ɵɵreference(19);t.ɵɵadvance(),t.ɵɵstyleMap(t.ɵɵpureFunction0(23,X2)),t.ɵɵadvance(),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(3,11,"gateway.rpc.rpc"))("disabled",!e.value.configurationJson.id),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(7,13,"gateway.logs.logs")),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(11,15,"gateway.delete-connector")),t.ɵɵadvance(5),t.ɵɵproperty("matMenuTriggerFor",i),t.ɵɵadvance(5),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(21,17,"gateway.rpc.rpc"))("disabled",!e.value.configurationJson.id),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(25,19,"gateway.logs.logs")),t.ɵɵadvance(4),t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(29,21,"gateway.delete-connector"))}}function u3(e,n){1&e&&t.ɵɵelement(0,"mat-header-row",52)}function m3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-row",53),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).$implicit,a=t.ɵɵnextContext();return t.ɵɵresetView(a.selectConnector(n,i))})),t.ɵɵelementEnd()}if(2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵclassMap(t.ɵɵpureFunction1(2,Z2,i.isSameConnector(e)))}}function h3(e,n){if(1&e&&(t.ɵɵelementStart(0,"span",54),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵtextInterpolate1("v",e.connectorForm.get("configVersion").value,"")}}function g3(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-select",55)(1,"tb-toggle-option",56),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"tb-toggle-option",56),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("value",e.ConnectorConfigurationModes.BASIC),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(3,4,"gateway.basic")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",e.ConnectorConfigurationModes.ADVANCED),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,6,"gateway.advanced")," ")}}function f3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-mqtt-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function y3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-mqtt-legacy-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function v3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,f3,2,4,"tb-mqtt-basic-config",63),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,y3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.MQTT))("ngIfElse",e)}}function x3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-opc-ua-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function b3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-opc-ua-legacy-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function w3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,x3,2,4,"tb-opc-ua-basic-config",63),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,b3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.OPCUA))("ngIfElse",e)}}function S3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-modbus-basic-config",66),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function C3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-modbus-legacy-basic-config",66),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function _3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,S3,1,1,"tb-modbus-basic-config",65),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,C3,1,1,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.MODBUS))("ngIfElse",e)}}function T3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-socket-basic-config",66),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function I3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-socket-legacy-basic-config",66),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){t.ɵɵnextContext(4);const e=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",e)}}function E3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,T3,1,1,"tb-socket-basic-config",65),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,I3,1,1,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.SOCKET))("ngIfElse",e)}}function M3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-bacnet-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function k3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-bacnet-legacy-basic-config",64),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function P3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,M3,2,4,"tb-bacnet-basic-config",63),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,k3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.BACNET))("ngIfElse",e)}}function D3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-rest-basic-config",68),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function O3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-rest-legacy-basic-config",68),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(4);return t.ɵɵresetView(n.basicConfigInitSubject.next())})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext(4),n=t.ɵɵreference(41);t.ɵɵproperty("generalTabContent",n)("withReportStrategy",t.ɵɵpipeBind1(1,2,e.connectorForm.get("configVersion").value))}}function A3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0),t.ɵɵtemplate(1,D3,2,4,"tb-rest-basic-config",67),t.ɵɵpipe(2,"isLatestVersionConfig"),t.ɵɵtemplate(3,O3,2,4,"ng-template",null,3,t.ɵɵtemplateRefExtractor),t.ɵɵelementContainerEnd()),2&e){const e=t.ɵɵreference(4),n=t.ɵɵnextContext(3);t.ɵɵadvance(),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(2,2,n.connectorForm.get("configVersion").value,n.ConnectorType.REST))("ngIfElse",e)}}function F3(e,n){if(1&e&&(t.ɵɵelementContainerStart(0)(1,61),t.ɵɵtemplate(2,v3,5,5,"ng-container",62)(3,w3,5,5,"ng-container",62)(4,_3,5,5,"ng-container",62)(5,E3,5,5,"ng-container",62)(6,P3,5,5,"ng-container",62)(7,A3,5,5,"ng-container",62),t.ɵɵelementContainerEnd()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("ngSwitch",e.initialConnector.type),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MQTT),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.OPCUA),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.MODBUS),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.SOCKET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.BACNET),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",e.ConnectorType.REST)}}function R3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-tab-group")(1,"mat-tab",69),t.ɵɵpipe(2,"translate"),t.ɵɵelementContainer(3,70),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"mat-tab",69),t.ɵɵpipe(5,"translate"),t.ɵɵelement(6,"tb-json-object-edit",71),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()),2&e){t.ɵɵnextContext(2);const e=t.ɵɵreference(41);t.ɵɵadvance(),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,6,"gateway.general")),t.ɵɵadvance(2),t.ɵɵproperty("ngTemplateOutlet",e),t.ɵɵadvance(),t.ɵɵpropertyInterpolate1("label","",t.ɵɵpipeBind1(5,8,"gateway.configuration"),"*"),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(7,10,"gateway.configuration")),t.ɵɵproperty("fillHeight",!0)}}function B3(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"section",57),t.ɵɵtemplate(1,F3,8,7,"ng-container",58)(2,R3,8,12,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementStart(4,"div",59)(5,"button",60),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.onSaveConnector())})),t.ɵɵtext(6),t.ɵɵpipe(7,"translate"),t.ɵɵelementEnd()()()}if(2&e){let e;const n=t.ɵɵreference(3),i=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵproperty("ngIf",(null==(e=i.connectorForm.get("mode"))?null:e.value)===i.ConnectorConfigurationModes.BASIC)("ngIfElse",n),t.ɵɵadvance(4),t.ɵɵproperty("disabled",!i.connectorForm.dirty||i.connectorForm.invalid),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(7,4,"action.save")," ")}}function N3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-icon",88),t.ɵɵpipe(1,"translate"),t.ɵɵtext(2," warning "),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("matTooltip",t.ɵɵpipeBind1(1,1,e.connectorForm.get("name").hasError("duplicateName")?"gateway.connector-duplicate-name":"gateway.name-required"))}}function L3(e,n){1&e&&(t.ɵɵelementStart(0,"div",73)(1,"div",84),t.ɵɵtext(2,"gateway.connectors-table-class"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",75)(4,"mat-form-field",76),t.ɵɵelement(5,"input",89),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function V3(e,n){1&e&&(t.ɵɵelementStart(0,"div",73)(1,"div",84),t.ɵɵtext(2,"gateway.connectors-table-key"),t.ɵɵelementEnd(),t.ɵɵelementStart(3,"div",75)(4,"mat-form-field",76),t.ɵɵelement(5,"input",90),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(6,1,"gateway.set")))}function q3(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",56),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function G3(e,n){1&e&&(t.ɵɵelementStart(0,"div",73)(1,"mat-slide-toggle",91)(2,"mat-label",92),t.ɵɵpipe(3,"translate"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,2,"gateway.send-change-data-hint")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(5,4,"gateway.send-change-data")," "))}function z3(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",93),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("defaultValue",e.ReportStrategyDefaultValue.Connector)}}function U3(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",72)(1,"div",73)(2,"div",74),t.ɵɵtext(3,"gateway.name"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",75)(5,"mat-form-field",76),t.ɵɵelement(6,"input",77),t.ɵɵpipe(7,"translate"),t.ɵɵtemplate(8,N3,3,3,"mat-icon",78),t.ɵɵelementEnd()()(),t.ɵɵtemplate(9,L3,7,3,"div",79)(10,V3,7,3,"div",79),t.ɵɵelementStart(11,"div",80)(12,"div",81),t.ɵɵtext(13,"gateway.logs-configuration"),t.ɵɵelementEnd(),t.ɵɵelementStart(14,"div",82)(15,"mat-slide-toggle",83)(16,"mat-label"),t.ɵɵtext(17),t.ɵɵpipe(18,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(19,"div",73)(20,"div",84),t.ɵɵtext(21,"gateway.remote-logging-level"),t.ɵɵelementEnd(),t.ɵɵelementStart(22,"div",75)(23,"mat-form-field",76)(24,"mat-select",85),t.ɵɵtemplate(25,q3,2,2,"mat-option",86),t.ɵɵelementEnd()()()()(),t.ɵɵtemplate(26,G3,6,6,"div",79),t.ɵɵpipe(27,"withReportStrategy"),t.ɵɵtemplate(28,z3,1,2,"tb-report-strategy",87),t.ɵɵpipe(29,"withReportStrategy"),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("formGroup",e.connectorForm),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("placeholder",t.ɵɵpipeBind1(7,9,"gateway.set")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.connectorForm.get("name").hasError("required")&&e.connectorForm.get("name").touched||e.connectorForm.get("name").hasError("duplicateName")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.CUSTOM),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.GRPC),t.ɵɵadvance(7),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(18,11,"gateway.enable-remote-logging")," "),t.ɵɵadvance(8),t.ɵɵproperty("ngForOf",e.gatewayLogLevel),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.connectorForm.get("type").value===e.ConnectorType.MQTT&&!t.ɵɵpipeBind2(27,13,e.connectorForm.get("configVersion").value,e.ConnectorType.MQTT)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",t.ɵɵpipeBind2(29,16,e.connectorForm.get("configVersion").value,e.connectorForm.get("type").value))}}class j3{isErrorState(e){return e&&e.invalid}}e("ForceErrorStateMatcher",j3);class H3 extends q{constructor(e,t,n,i,a,r,o,s,l,p,c){super(e),this.store=e,this.fb=t,this.translate=n,this.attributeService=i,this.dialogService=a,this.dialog=r,this.telemetryWsService=o,this.zone=s,this.utils=l,this.withReportStrategy=p,this.cd=c,this.ConnectorType=dt,this.allowBasicConfig=new Set([dt.MQTT,dt.OPCUA,dt.MODBUS,dt.SOCKET,dt.BACNET,dt.REST]),this.gatewayLogLevel=Object.values(pt),this.displayedColumns=["enabled","key","type","syncStatus","errors","actions"],this.GatewayConnectorTypesTranslatesMap=ut,this.ConnectorConfigurationModes=an,this.ReportStrategyDefaultValue=on,this.basicConfigInitSubject=new we,this.activeData=[],this.inactiveData=[],this.sharedAttributeData=[],this.subscriptionOptions={callbacks:{onDataUpdated:()=>this.ctx.ngZone.run((()=>{this.onErrorsUpdated()})),onDataUpdateError:(e,t)=>this.ctx.ngZone.run((()=>{this.onDataUpdateError(t)}))}},this.destroy$=new we,this.attributeUpdateSubject=new we,this.initDataSources(),this.initConnectorForm(),this.observeAttributeChange()}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.sortingDataAccessor=this.getSortingDataAccessor(),this.ctx.$scope.gatewayConnectors=this,this.loadConnectors(),this.loadGatewayState(),this.observeModeChange()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),super.ngOnDestroy()}onSaveConnector(){this.saveConnector(this.getUpdatedConnectorData(this.connectorForm.value),!1)}saveConnector(e,t=!0){const n=t||this.activeConnectors.includes(this.initialConnector.name)?D.SHARED_SCOPE:D.SERVER_SCOPE;Ie(this.getEntityAttributeTasks(e,n)).pipe(Ne(1)).subscribe((n=>{this.showToast(t?this.translate.instant("gateway.connector-created"):this.translate.instant("gateway.connector-updated")),this.initialConnector=e,this.updateData(!0),this.connectorForm.markAsPristine()}))}getEntityAttributeTasks(e,t){const n=[],i=[{key:e.name,value:e}],a=[],r=!this.activeConnectors.includes(e.name)&&t===D.SHARED_SCOPE||!this.inactiveConnectors.includes(e.name)&&t===D.SERVER_SCOPE,o=this.initialConnector&&this.initialConnector.name!==e.name;return o&&(a.push({key:this.initialConnector.name}),this.removeConnectorFromList(this.initialConnector.name,!0),this.removeConnectorFromList(this.initialConnector.name,!1)),r&&(t===D.SHARED_SCOPE?this.activeConnectors.push(e.name):this.inactiveConnectors.push(e.name)),(o||r)&&n.push(this.getSaveEntityAttributesTask(t)),n.push(this.attributeService.saveEntityAttributes(this.device,t,i)),a.length&&n.push(this.attributeService.deleteEntityAttributes(this.device,t,a)),n}getSaveEntityAttributesTask(e){const t=e===D.SHARED_SCOPE?"active_connectors":"inactive_connectors",n=e===D.SHARED_SCOPE?this.activeConnectors:this.inactiveConnectors;return this.attributeService.saveEntityAttributes(this.device,e,[{key:t,value:n}])}removeConnectorFromList(e,t){const n=t?this.activeConnectors:this.inactiveConnectors,i=n.indexOf(e);-1!==i&&n.splice(i,1)}getUpdatedConnectorData(e){const t={...e};return t.configuration=`${re(t.name)}.json`,delete t.basicConfig,t.type!==dt.GRPC&&delete t.key,t.type!==dt.CUSTOM&&delete t.class,this.allowBasicConfig.has(t.type)||delete t.mode,this.withReportStrategy.transform(t.configVersion,t.type)&&(t.configurationJson.reportStrategy=t.reportStrategy,ne(t.reportStrategy)&&delete t.reportStrategy,ne(t.configurationJson.reportStrategy)&&delete t.configurationJson.reportStrategy),this.gatewayVersion&&!t.configVersion&&(t.configVersion=this.gatewayVersion),t.ts=Date.now(),t}updateData(e=!1){this.pageLink.sortOrder.property=this.sort.active,this.pageLink.sortOrder.direction=w[this.sort.direction.toUpperCase()],this.attributeDataSource.loadAttributes(this.device,D.CLIENT_SCOPE,this.pageLink,e).subscribe((e=>{this.activeData=e.data.filter((e=>this.activeConnectors.includes(e.key))),this.combineData(),this.generateSubscription(),this.setClientData(e)})),this.inactiveConnectorsDataSource.loadAttributes(this.device,D.SHARED_SCOPE,this.pageLink,e).subscribe((e=>{this.sharedAttributeData=e.data.filter((e=>this.activeConnectors.includes(e.key))),this.combineData()})),this.serverDataSource.loadAttributes(this.device,D.SERVER_SCOPE,this.pageLink,e).subscribe((e=>{this.inactiveData=e.data.filter((e=>this.inactiveConnectors.includes(e.key))),this.combineData()}))}isConnectorSynced(e){const t=e.value;if(!t.ts||e.skipSync||!this.isGatewayActive)return!1;if(-1===this.activeData.findIndex((e=>("string"==typeof e.value?JSON.parse(e.value):e.value).name===t.name)))return!1;return-1!==this.sharedAttributeData.findIndex((e=>{const n=e.value,i=n.name===t.name,a=W(n.configurationJson,{})&&i,r=this.hasSameConfig(n.configurationJson,t.configurationJson),o=n.ts&&n.ts<=t.ts;return i&&o&&(r||a)}))}hasSameConfig(e,t){const{name:n,id:i,enableRemoteLogging:a,logLevel:r,reportStrategy:o,configVersion:s,...l}=e,{name:p,id:c,enableRemoteLogging:d,logLevel:u,reportStrategy:m,configVersion:h,...g}=t;return W(l,g)}combineData(){const e=[...this.activeData,...this.inactiveData,...this.sharedAttributeData].reduce(((e,t)=>{const n=e.findIndex((e=>e.key===t.key));return-1===n?e.push(t):t.lastUpdateTs>e[n].lastUpdateTs&&!this.isConnectorSynced(e[n])&&(e[n]={...t,skipSync:!0}),e}),[]);this.dataSource.data=e.map((e=>({...e,value:"string"==typeof e.value?JSON.parse(e.value):e.value})))}clearOutConnectorForm(){this.initialConnector=null,this.connectorForm.setValue({mode:an.BASIC,name:"",type:dt.MQTT,sendDataOnlyOnChange:!1,enableRemoteLogging:!1,logLevel:pt.INFO,key:"auto",class:"",configuration:"",configurationJson:{},basicConfig:{},configVersion:"",reportStrategy:[{value:{},disabled:!0}]},{emitEvent:!1}),this.connectorForm.markAsPristine()}selectConnector(e,t){e&&e.stopPropagation();const n=t.value;n?.name!==this.initialConnector?.name&&this.confirmConnectorChange().subscribe((e=>{e&&this.setFormValue(n)}))}isSameConnector(e){if(!this.initialConnector)return!1;const t=e.value;return this.initialConnector.name===t.name}showToast(e){this.store.dispatch({type:"[Notification] Show",notification:{message:e,type:"success",duration:1e3,verticalPosition:"top",horizontalPosition:"left",target:"dashboardRoot",forceDismiss:!0}})}returnType(e){const t=e.value;return this.GatewayConnectorTypesTranslatesMap.get(t.type)}deleteConnector(e,t){t?.stopPropagation();const n=`Delete connector "${e.key}"?`;this.dialogService.confirm(n,"All connector data will be deleted.","Cancel","Delete").pipe(Ne(1),Ve((t=>{if(!t)return;const n=[],i=this.activeConnectors.includes(e.value?.name)?D.SHARED_SCOPE:D.SERVER_SCOPE;return n.push(this.attributeService.deleteEntityAttributes(this.device,i,[e])),this.removeConnectorFromList(e.key,!0),this.removeConnectorFromList(e.key,!1),n.push(this.getSaveEntityAttributesTask(i)),Ie(n)}))).subscribe((()=>{this.initialConnector&&this.initialConnector.name!==e.key||(this.clearOutConnectorForm(),this.cd.detectChanges()),this.updateData(!0)}))}connectorLogs(e,t){t&&t.stopPropagation();const n=te(this.ctx.stateController.getStateParams());n.connector_logs=e,n.targetEntityParamName="connector_logs",this.ctx.stateController.openState("connector_logs",n)}connectorRpc(e,t){t&&t.stopPropagation();const n=te(this.ctx.stateController.getStateParams());n.connector_rpc=e,n.targetEntityParamName="connector_rpc",this.ctx.stateController.openState("connector_rpc",n)}onEnableConnector(e){e.value.ts=(new Date).getTime(),this.updateActiveConnectorKeys(e.key),this.attributeUpdateSubject.next(e)}getErrorsCount(e){const t=e.key,n=this.subscription&&this.subscription.data.find((e=>e&&e.dataKey.name===`${t}_ERRORS_COUNT`));return n&&this.activeConnectors.includes(t)?n.data[0][1]||0:"Inactive"}onAddConnector(e){e?.stopPropagation(),this.confirmConnectorChange().pipe(Ne(1),Oe(Boolean),Ve((()=>this.openAddConnectorDialog())),Oe(Boolean)).subscribe((e=>this.addConnector(e)))}addConnector(e){e.configurationJson||(e.configurationJson={}),this.gatewayVersion&&!e.configVersion&&(e.configVersion=this.gatewayVersion),e.basicConfig=e.configurationJson,this.initialConnector=e;const t=this.connectorForm.get("type").value;this.setInitialConnectorValues(e),this.saveConnector(this.getUpdatedConnectorData(e)),t!==e.type&&this.allowBasicConfig.has(e.type)?this.basicConfigInitSubject.pipe(Ne(1)).subscribe((()=>{this.patchConnectorBasicConfig(e.basicConfig)})):this.patchConnectorBasicConfig(e.basicConfig)}setInitialConnectorValues(e){const{basicConfig:t,mode:n,enableRemoteLogging:i,...a}=e;this.toggleReportStrategy(e),this.connectorForm.get("mode").setValue(this.allowBasicConfig.has(e.type)?e.mode??an.BASIC:null,{emitEvent:!1}),this.connectorForm.get("enableRemoteLogging").setValue(i,{emitEvent:!1}),this.connectorForm.patchValue(a,{emitEvent:!1})}openAddConnectorDialog(){return this.ctx.ngZone.run((()=>this.dialog.open(w$,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{dataSourceData:this.dataSource.data,gatewayVersion:this.gatewayVersion}}).afterClosed()))}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase(),n=this.dataSource.data.some((e=>e.value.name.toLowerCase()===t)),i=this.initialConnector?.name.toLowerCase()===t;return n&&!i?{duplicateName:{valid:!1}}:null}}initDataSources(){const e={property:"key",direction:w.ASC};this.pageLink=new S(1e3,0,null,e),this.attributeDataSource=new Kn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.inactiveConnectorsDataSource=new Kn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.serverDataSource=new Kn(this.attributeService,this.telemetryWsService,this.zone,this.translate),this.dataSource=new x([])}initConnectorForm(){this.connectorForm=this.fb.group({mode:[an.BASIC],name:["",[me.required,this.uniqNameRequired(),me.pattern(pn)]],type:["",[me.required]],enableRemoteLogging:[!1],logLevel:["",[me.required]],sendDataOnlyOnChange:[!1],key:["auto"],class:[""],configuration:[""],configurationJson:[{},[me.required]],basicConfig:[{}],configVersion:[""],reportStrategy:[{value:{},disabled:!0}]})}getSortingDataAccessor(){return(e,t)=>{switch(t){case"syncStatus":return this.isConnectorSynced(e)?1:0;case"enabled":return this.activeConnectors.includes(e.key)?1:0;case"errors":const n=this.getErrorsCount(e);return"string"==typeof n?this.sort.direction.toUpperCase()===w.DESC?-1:1/0:n;default:return e[t]||e.value[t]}}}loadConnectors(){this.device&&this.device.id!==B&&Ie([this.attributeService.getEntityAttributes(this.device,D.SHARED_SCOPE,["active_connectors"]),this.attributeService.getEntityAttributes(this.device,D.SERVER_SCOPE,["inactive_connectors"]),this.attributeService.getEntityAttributes(this.device,D.CLIENT_SCOPE,["Version"])]).pipe(Me(this.destroy$)).subscribe((e=>{this.activeConnectors=this.parseConnectors(e[0]),this.inactiveConnectors=this.parseConnectors(e[1]),this.gatewayVersion=e[2][0]?.value,this.updateData(!0)}))}loadGatewayState(){this.attributeService.getEntityAttributes(this.device,D.SERVER_SCOPE).pipe(Me(this.destroy$)).subscribe((e=>{const t=e.find((e=>"active"===e.key)).value,n=e.find((e=>"lastDisconnectTime"===e.key))?.value,i=e.find((e=>"lastConnectTime"===e.key))?.value;this.isGatewayActive=this.getGatewayStatus(t,i,n)}))}parseConnectors(e){const t=e?.[0]?.value||[];return Q(t)?JSON.parse(t):t}observeModeChange(){this.connectorForm.get("mode").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{e===an.BASIC&&this.patchConnectorBasicConfig(this.connectorForm.get("configurationJson").value)}))}observeAttributeChange(){this.attributeUpdateSubject.pipe(De(300),Ae((e=>this.executeAttributeUpdates(e))),Me(this.destroy$)).subscribe()}updateActiveConnectorKeys(e){if(this.activeConnectors.includes(e)){const t=this.activeConnectors.indexOf(e);-1!==t&&this.activeConnectors.splice(t,1),this.inactiveConnectors.push(e)}else{const t=this.inactiveConnectors.indexOf(e);-1!==t&&this.inactiveConnectors.splice(t,1),this.activeConnectors.push(e)}}executeAttributeUpdates(e){Ie(this.getAttributeExecutionTasks(e)).pipe(Ne(1),Ae((()=>this.updateData(!0))),Me(this.destroy$)).subscribe()}getAttributeExecutionTasks(e){const t=this.activeConnectors.includes(e.key),n=t?D.SERVER_SCOPE:D.SHARED_SCOPE,i=t?D.SHARED_SCOPE:D.SERVER_SCOPE;return[this.attributeService.saveEntityAttributes(this.device,D.SHARED_SCOPE,[{key:"active_connectors",value:this.activeConnectors}]),this.attributeService.saveEntityAttributes(this.device,D.SERVER_SCOPE,[{key:"inactive_connectors",value:this.inactiveConnectors}]),this.attributeService.deleteEntityAttributes(this.device,n,[e]),this.attributeService.saveEntityAttributes(this.device,i,[e])]}onDataUpdateError(e){const t=this.utils.parseException(e);let n=t.name;t.message&&(n+=": "+t.message),console.error(n)}onErrorsUpdated(){this.cd.detectChanges()}onDataUpdated(){const e=this.ctx.defaultSubscription.data,t=e.find((e=>"active"===e.dataKey.name)).data[0][1],n=e.find((e=>"lastDisconnectTime"===e.dataKey.name)).data[0][1],i=e.find((e=>"lastConnectTime"===e.dataKey.name)).data[0][1];this.isGatewayActive=this.getGatewayStatus(t,i,n),this.cd.detectChanges()}getGatewayStatus(e,t,n){return!!e&&(!n||t>n)}generateSubscription(){if(this.subscription&&this.subscription.unsubscribe(),this.device){const e=[{type:N.entity,entityType:L.DEVICE,entityId:this.device.id,entityName:"Gateway",timeseries:[]}];this.dataSource.data.forEach((t=>{e[0].timeseries.push({name:`${t.key}_ERRORS_COUNT`,label:`${t.key}_ERRORS_COUNT`})})),this.ctx.subscriptionApi.createSubscriptionFromInfo(R.latest,e,this.subscriptionOptions,!1,!0).subscribe((e=>{this.subscription=e}))}}createBasicConfigWatcher(){this.basicConfigSub&&this.basicConfigSub.unsubscribe(),this.basicConfigSub=this.connectorForm.get("basicConfig").valueChanges.pipe(Oe((()=>!!this.initialConnector)),Me(this.destroy$)).subscribe((e=>{const t=this.connectorForm.get("configurationJson"),n=this.connectorForm.get("type").value,i=this.connectorForm.get("mode").value;if(!W(e,t?.value)&&this.allowBasicConfig.has(n)&&i===an.BASIC){const n={...t.value,...e};this.connectorForm.get("configurationJson").patchValue(n,{emitEvent:!1})}}))}createJsonConfigWatcher(){this.jsonConfigSub&&this.jsonConfigSub.unsubscribe(),this.jsonConfigSub=this.connectorForm.get("configurationJson").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{const t=this.connectorForm.get("basicConfig"),n=this.connectorForm.get("type").value,i=this.connectorForm.get("mode").value;!W(e,t?.value)&&this.allowBasicConfig.has(n)&&i===an.ADVANCED&&this.connectorForm.get("basicConfig").patchValue(e,{emitEvent:!1})}))}confirmConnectorChange(){return this.initialConnector&&this.connectorForm.dirty?this.dialogService.confirm(this.translate.instant("gateway.change-connector-title"),this.translate.instant("gateway.change-connector-text"),this.translate.instant("action.no"),this.translate.instant("action.yes"),!0):_e(!0)}setFormValue(e){this.connectorForm.disabled&&this.connectorForm.enable();const t=Ya.getConfig({configuration:"",key:"auto",configurationJson:{},...e},this.gatewayVersion);this.gatewayVersion&&!t.configVersion&&(t.configVersion=this.gatewayVersion),t.basicConfig=t.configurationJson,this.initialConnector=t,this.updateConnector(t)}updateConnector(e){this.jsonConfigSub?.unsubscribe(),this.allowBasicConfig.has(e.type)?this.updateBasicConfigConnector(e):(this.setInitialConnectorValues(e),this.connectorForm.markAsPristine(),this.createJsonConfigWatcher())}updateBasicConfigConnector(e){this.basicConfigSub?.unsubscribe();const t=this.connectorForm.get("type").value;this.setInitialConnectorValues(e),t!==e.type&&this.allowBasicConfig.has(e.type)&&e.mode!==an.ADVANCED?this.basicConfigInitSubject.asObservable().pipe(Ne(1)).subscribe((()=>{this.patchConnectorBasicConfig(e.basicConfig)})):this.patchConnectorBasicConfig(e.basicConfig)}patchConnectorBasicConfig(e){this.connectorForm.get("basicConfig").patchValue(e,{emitEvent:!1}),this.connectorForm.markAsPristine(),this.createBasicConfigWatcher(),this.createJsonConfigWatcher()}toggleReportStrategy(e){const t=this.connectorForm.get("reportStrategy"),n=this.connectorForm.get("sendDataOnlyOnChange");this.connectorForm.get("reportStrategy").reset(e.reportStrategy,{emitEvent:!1}),this.withReportStrategy.transform(e.configVersion,e.type)?(t.enable({emitEvent:!1}),n.disable({emitEvent:!1})):(t.disable({emitEvent:!1}),e.type===dt.MQTT&&n.enable({emitEvent:!1}))}setClientData(e){if(this.initialConnector){const t=e.data.find((e=>e.key===this.initialConnector.name));t&&(t.value="string"==typeof t.value?JSON.parse(t.value):t.value,this.isConnectorSynced(t)&&t.value.configurationJson&&this.setFormValue({...t.value,mode:this.connectorForm.get("mode").value??t.value.mode}))}}static{this.ɵfac=function(e){return new(e||H3)(t.ɵɵdirectiveInject(Xe.Store),t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(le.TranslateService),t.ɵɵdirectiveInject(K.AttributeService),t.ɵɵdirectiveInject(K.DialogService),t.ɵɵdirectiveInject(je.MatDialog),t.ɵɵdirectiveInject(K.TelemetryWebsocketService),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(K.UtilsService),t.ɵɵdirectiveInject(tr),t.ɵɵdirectiveInject(t.ChangeDetectorRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:H3,selectors:[["tb-gateway-connector"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(v,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.sort=e.first)}},inputs:{ctx:"ctx",device:"device"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:st,useClass:j3},tr]),t.ɵɵInheritDefinitionFeature,t.ɵɵStandaloneFeature],decls:42,vars:21,consts:[["generalTabContent",""],["cellActionsMenu","matMenu"],["defaultConfig",""],["legacy",""],[1,"connector-container","tb-form-panel","no-border"],[1,"table-section","tb-form-panel","no-padding","section-container","flex"],[1,"mat-mdc-table-toolbar","justify-between"],["mat-icon-button","","matTooltipPosition","above",3,"disabled","matTooltip","click",4,"ngIf"],[1,"table-container"],["class","mat-headline-5 tb-absolute-fill tb-add-new items-center justify-center",4,"ngIf"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","matSortActive","matSortDirection"],["matColumnDef","enabled","sticky",""],["style","width: 60px;min-width: 60px;",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","key"],["mat-sort-header","","style","width: 40%",4,"matHeaderCellDef"],["matColumnDef","type"],["mat-sort-header","","style","width: 30%",4,"matHeaderCellDef"],["style","text-transform: uppercase",4,"matCellDef"],["matColumnDef","syncStatus"],["matColumnDef","errors"],["matColumnDef","actions","stickyEnd",""],[4,"matHeaderCellDef"],["class","mat-row-select",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","mat-row-select",3,"class","click",4,"matRowDef","matRowDefColumns"],[1,"tb-form-panel","section-container","flex",3,"formGroup"],[1,"tb-form-panel-title","tb-flex","no-flex","space-between","align-center"],[1,"tb-form-panel-title"],["class","version-placeholder",4,"ngIf"],["formControlName","mode","appearance","fill",4,"ngIf"],["translate","",1,"no-data-found","items-center","justify-center"],["class","tb-form-panel section-container no-border no-padding tb-flex space-between",4,"ngIf"],["mat-icon-button","","matTooltipPosition","above",3,"click","disabled","matTooltip"],[1,"mat-headline-5","tb-absolute-fill","tb-add-new","items-center","justify-center"],["mat-button","",1,"connector",3,"click"],[1,"tb-mat-96"],[2,"width","60px","min-width","60px"],[3,"click","checked"],["mat-sort-header","",2,"width","40%"],["mat-sort-header","",2,"width","30%"],[2,"text-transform","uppercase"],[1,"status"],["matTooltipPosition","above",1,"dot",3,"click","matTooltip"],[1,"gt-md:!hidden",2,"width","48px","min-width","48px","max-width","48px"],[1,"lt-lg:!hidden"],[1,"lt-md:!hidden","flex-row","justify-end"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip","disabled"],["mat-icon-button","","matTooltipPosition","above",3,"click","matTooltip"],[1,"gt-sm:!hidden"],["mat-icon-button","",3,"click","matMenuTriggerFor"],[1,"material-icons"],["xPosition","before"],[1,"mat-row-select"],[1,"mat-row-select",3,"click"],[1,"version-placeholder"],["formControlName","mode","appearance","fill"],[3,"value"],[1,"tb-form-panel","section-container","no-border","no-padding","tb-flex","space-between"],[4,"ngIf","ngIfElse"],[1,"flex","justify-end"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],[3,"ngSwitch"],[4,"ngSwitchCase"],["formControlName","basicConfig",3,"generalTabContent","withReportStrategy","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",3,"initialized","generalTabContent","withReportStrategy"],["formControlName","basicConfig",3,"generalTabContent","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",3,"initialized","generalTabContent"],["class","h-full","formControlName","basicConfig",3,"generalTabContent","withReportStrategy","initialized",4,"ngIf","ngIfElse"],["formControlName","basicConfig",1,"h-full",3,"initialized","generalTabContent","withReportStrategy"],[3,"label"],[3,"ngTemplateOutlet"],["jsonRequired","","formControlName","configurationJson",1,"configuration-json",3,"fillHeight","label"],[1,"tb-form-panel","no-border","no-padding","padding-top","section-container","flex",3,"formGroup"],[1,"tb-form-row","column-xs"],["translate","",1,"fixed-title-width","tb-required"],[1,"tb-flex","no-gap"],["appearance","outline","subscriptSizing","dynamic",1,"tb-flex","no-gap"],["matInput","","autocomplete","off","name","value","formControlName","name",3,"placeholder"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip","class","tb-error",3,"matTooltip",4,"ngIf"],["class","tb-form-row column-xs",4,"ngIf"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row"],["formControlName","enableRemoteLogging",1,"mat-slide"],["translate","",1,"fixed-title-width"],["formControlName","logLevel"],[3,"value",4,"ngFor","ngForOf"],["class","stroked tb-form-panel","formControlName","reportStrategy",3,"isExpansionMode","defaultValue",4,"ngIf"],["matSuffix","","matTooltipPosition","above","matTooltipClass","tb-error-tooltip",1,"tb-error",3,"matTooltip"],["matInput","","name","value","formControlName","class",3,"placeholder"],["matInput","","name","value","formControlName","key",3,"placeholder"],["formControlName","sendDataOnlyOnChange",1,"mat-slide"],[3,"tb-hint-tooltip-icon"],["formControlName","reportStrategy",1,"stroked","tb-form-panel",3,"isExpansionMode","defaultValue"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",4)(1,"section",5)(2,"mat-toolbar",6)(3,"h2"),t.ɵɵtext(4),t.ɵɵpipe(5,"translate"),t.ɵɵelementEnd(),t.ɵɵtemplate(6,Q2,5,6,"button",7),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",8),t.ɵɵtemplate(8,J2,7,3,"section",9),t.ɵɵelementStart(9,"table",10),t.ɵɵelementContainerStart(10,11),t.ɵɵtemplate(11,e3,3,3,"mat-header-cell",12)(12,t3,2,1,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(13,14),t.ɵɵtemplate(14,n3,3,3,"mat-header-cell",15)(15,i3,2,1,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(16,16),t.ɵɵtemplate(17,a3,3,3,"mat-header-cell",17)(18,r3,2,1,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(19,19),t.ɵɵtemplate(20,o3,3,3,"mat-header-cell",17)(21,s3,3,3,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(22,20),t.ɵɵtemplate(23,l3,3,3,"mat-header-cell",17)(24,p3,2,6,"mat-cell",18),t.ɵɵelementContainerEnd(),t.ɵɵelementContainerStart(25,21),t.ɵɵtemplate(26,c3,5,6,"mat-header-cell",22)(27,d3,32,24,"mat-cell",13),t.ɵɵelementContainerEnd(),t.ɵɵtemplate(28,u3,1,0,"mat-header-row",23)(29,m3,1,4,"mat-row",24),t.ɵɵelementEnd()()(),t.ɵɵelementStart(30,"section",25)(31,"div",26)(32,"div",27),t.ɵɵtext(33),t.ɵɵpipe(34,"translate"),t.ɵɵtemplate(35,h3,2,1,"span",28),t.ɵɵelementEnd(),t.ɵɵtemplate(36,g3,7,8,"tb-toggle-select",29),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"span",30),t.ɵɵtext(38," gateway.select-connector "),t.ɵɵelementEnd(),t.ɵɵtemplate(39,B3,8,6,"section",31),t.ɵɵelementEnd()(),t.ɵɵtemplate(40,U3,30,19,"ng-template",null,0,t.ɵɵtemplateRefExtractor)),2&e&&(t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(5,17,"gateway.connectors")),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",null==n.dataSource||null==n.dataSource.data?null:n.dataSource.data.length),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",!(null!=n.dataSource&&(null!=n.dataSource.data&&n.dataSource.data.length))),t.ɵɵadvance(),t.ɵɵproperty("dataSource",n.dataSource)("matSortActive",n.pageLink.sortOrder.property)("matSortDirection",n.pageLink.sortDirection()),t.ɵɵadvance(19),t.ɵɵproperty("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),t.ɵɵadvance(),t.ɵɵproperty("matRowDefColumns",n.displayedColumns),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.connectorForm),t.ɵɵadvance(3),t.ɵɵtextInterpolate2(" ",null!=n.initialConnector&&n.initialConnector.type?n.GatewayConnectorTypesTranslatesMap.get(n.initialConnector.type):""," ",t.ɵɵpipeBind1(34,19,"gateway.configuration")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.connectorForm.get("configVersion").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.initialConnector&&n.allowBasicConfig.has(n.initialConnector.type)),t.ɵɵadvance(),t.ɵɵclassProp("!hidden",n.initialConnector),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.initialConnector))},dependencies:t.ɵɵgetComponentDepsFactory(H3,[se,_,tr,d$,mX,hX,iX,nX,IQ,EQ,BJ,NJ,ni,F1,R1,$2,W2]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow-x:auto;padding:0}[_nghost-%COMP%] .version-placeholder[_ngcontent-%COMP%]{color:gray;font-size:12px}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%]{height:100%;width:100%;flex-direction:row}@media screen and (max-width: 1279px){[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%]{flex-direction:column}}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] > section[_ngcontent-%COMP%]:not(.table-section){max-width:unset}@media screen and (min-width: 1280px){[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] > section[_ngcontent-%COMP%]:not(.table-section){max-width:50%}}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .table-section[_ngcontent-%COMP%]{min-height:35vh;overflow:hidden}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .table-section[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .flex[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .input-container[_ngcontent-%COMP%]{height:auto}[_nghost-%COMP%] .connector-container[_ngcontent-%COMP%] .section-container[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{background:transparent;color:#000000de!important}[_nghost-%COMP%] .mat-mdc-slide-toggle[_ngcontent-%COMP%]{margin:0 8px}[_nghost-%COMP%] .status[_ngcontent-%COMP%]{text-align:center;border-radius:16px;font-weight:500;width:fit-content;padding:5px 15px}[_nghost-%COMP%] .status-sync[_ngcontent-%COMP%]{background:#1980380f;color:#198038}[_nghost-%COMP%] .status-unsync[_ngcontent-%COMP%]{background:#cb25300f;color:#cb2530}[_nghost-%COMP%] mat-row[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .dot[_ngcontent-%COMP%]{height:12px;width:12px;background-color:#bbb;border-radius:50%;display:inline-block}[_nghost-%COMP%] .hasErrors[_ngcontent-%COMP%]{background-color:#cb2530}[_nghost-%COMP%] .noErrors[_ngcontent-%COMP%]{background-color:#198038}[_nghost-%COMP%] .connector-container .mat-mdc-tab-group, [_nghost-%COMP%] .connector-container .mat-mdc-tab-body-wrapper{height:100%}[_nghost-%COMP%] .connector-container .mat-mdc-tab-body.mat-mdc-tab-body-active{position:absolute}[_nghost-%COMP%] .connector-container .tb-form-row .fixed-title-width{min-width:120px;width:30%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .connector-container .tb-add-new{display:flex;z-index:999;pointer-events:none;background-color:#fff}[_nghost-%COMP%] .connector-container .tb-add-new button.connector{height:auto;padding-right:12px;font-size:20px;border-style:dashed;border-width:2px;border-radius:8px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;color:#00000061}@media screen and (min-width: 960px){[_nghost-%COMP%] .configuration-json .ace_tooltip{transform:translate(-250px,-120px)}}']})}}e("GatewayConnectorComponent",H3);class W3{constructor(e){this.deviceService=e}download(e){e&&e.stopPropagation(),this.deviceId&&this.deviceService.downloadGatewayDockerComposeFile(this.deviceId).subscribe((()=>{}))}static{this.ɵfac=function(e){return new(e||W3)(t.ɵɵdirectiveInject(K.DeviceService))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:W3,selectors:[["tb-gateway-command"]],inputs:{deviceId:"deviceId"},standalone:!0,features:[t.ɵɵStandaloneFeature],decls:32,vars:9,consts:[["mat-dialog-content","",1,"tb-form-panel","no-border",2,"padding","16px 16px 8px"],[1,"tb-no-data-text"],[1,"tb-form-panel","stroked"],["translate","",1,"tb-form-panel-title"],[1,"tb-form-row","no-border","no-padding","space-between"],["translate","",1,"tb-no-data-text","tb-commands-hint"],["mat-stroked-button","","color","primary","href","https://docs.docker.com/compose/install/","target","_blank"],["mat-stroked-button","","color","primary",3,"click"],["usePlainMarkdown","","containerClass","start-code","data","\n ```bash\n docker compose up\n {:copy-code}\n ```\n "]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2),t.ɵɵpipe(3,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",2)(5,"div",3),t.ɵɵtext(6,"device.connectivity.install-necessary-client-tools"),t.ɵɵelementEnd(),t.ɵɵelementStart(7,"div",4)(8,"div",5),t.ɵɵtext(9,"gateway.install-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelementStart(10,"a",6)(11,"mat-icon"),t.ɵɵtext(12,"description"),t.ɵɵelementEnd(),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(15,"div",2)(16,"div",3),t.ɵɵtext(17,"gateway.download-configuration-file"),t.ɵɵelementEnd(),t.ɵɵelementStart(18,"div",4)(19,"div",5),t.ɵɵtext(20,"gateway.download-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"button",7),t.ɵɵlistener("click",(function(e){return n.download(e)})),t.ɵɵelementStart(22,"mat-icon"),t.ɵɵtext(23,"download"),t.ɵɵelementEnd(),t.ɵɵtext(24),t.ɵɵpipe(25,"translate"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(26,"div",2)(27,"div",3),t.ɵɵtext(28,"gateway.launch-gateway"),t.ɵɵelementEnd(),t.ɵɵelementStart(29,"div",5),t.ɵɵtext(30,"gateway.launch-docker-compose"),t.ɵɵelementEnd(),t.ɵɵelement(31,"tb-markdown",8),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(3,3,"gateway.docker-label")),t.ɵɵadvance(11),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,5,"common.documentation")," "),t.ɵɵadvance(11),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(25,7,"action.download")," "))},dependencies:t.ɵɵgetComponentDepsFactory(W3,[se,_]),styles:['@charset "UTF-8";[_nghost-%COMP%] .tb-commands-hint[_ngcontent-%COMP%]{color:inherit;font-weight:400;flex:1}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper{padding:0}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper pre[class*=language-]{margin:0;background:#f3f6fa;border-color:#305680;padding-right:38px;overflow:scroll;padding-bottom:4px;min-height:42px;scrollbar-width:thin}[_nghost-%COMP%] .tb-markdown-view .start-code .code-wrapper pre[class*=language-]::-webkit-scrollbar{width:4px;height:4px}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn{right:-2px}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn p{color:#305680}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn p, [_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div{background-color:#f3f6fa}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div img{display:none}[_nghost-%COMP%] .tb-markdown-view .start-code button.clipboard-btn div:after{content:"";position:initial;display:block;width:18px;height:18px;background:#305680;mask-image:url(/assets/copy-code-icon.svg);-webkit-mask-image:url(/assets/copy-code-icon.svg);mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat}']})}}var $3,K3,Y3;e("DeviceGatewayCommandComponent",W3),e("GatewayBasicConfigTab",$3),function(e){e[e.general=0]="general",e[e.logs=1]="logs",e[e.storage=2]="storage",e[e.grpc=3]="grpc",e[e.statistics=4]="statistics",e[e.other=5]="other"}($3||e("GatewayBasicConfigTab",$3={})),e("StorageTypes",K3),function(e){e.MEMORY="memory",e.FILE="file",e.SQLITE="sqlite"}(K3||e("StorageTypes",K3={})),e("LocalLogsConfigs",Y3),function(e){e.service="service",e.connector="connector",e.converter="converter",e.tb_connection="tb_connection",e.storage="storage",e.extension="extension"}(Y3||e("LocalLogsConfigs",Y3={}));const X3=e("LocalLogsConfigTranslateMap",new Map([[Y3.service,"Service"],[Y3.connector,"Connector"],[Y3.converter,"Converter"],[Y3.tb_connection,"TB Connection"],[Y3.storage,"Storage"],[Y3.extension,"Extension"]])),Z3=e("StorageTypesTranslationMap",new Map([[K3.MEMORY,"gateway.storage-types.memory-storage"],[K3.FILE,"gateway.storage-types.file-storage"],[K3.SQLITE,"gateway.storage-types.sqlite"]]));var Q3;e("LogSavingPeriod",Q3),function(e){e.days="D",e.hours="H",e.minutes="M",e.seconds="S"}(Q3||e("LogSavingPeriod",Q3={}));const J3=e("LogSavingPeriodTranslations",new Map([[Q3.days,"gateway.logs.days"],[Q3.hours,"gateway.logs.hours"],[Q3.minutes,"gateway.logs.minutes"],[Q3.seconds,"gateway.logs.seconds"]]));var e4;e("SecurityTypes",e4),function(e){e.ACCESS_TOKEN="accessToken",e.USERNAME_PASSWORD="usernamePassword",e.TLS_ACCESS_TOKEN="tlsAccessToken",e.TLS_PRIVATE_KEY="tlsPrivateKey"}(e4||e("SecurityTypes",e4={}));const t4=e("SecurityTypesTranslationsMap",new Map([[e4.ACCESS_TOKEN,"gateway.security-types.access-token"],[e4.USERNAME_PASSWORD,"gateway.security-types.username-password"],[e4.TLS_ACCESS_TOKEN,"gateway.security-types.tls-access-token"]])),n4=e("logsHandlerClass","thingsboard_gateway.tb_utility.tb_rotating_file_handler.TimedRotatingFileHandler"),i4=e("logsLegacyHandlerClass","thingsboard_gateway.tb_utility.tb_handler.TimedRotatingFileHandler");function a4(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",10),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,i.storageTypesTranslationMap.get(e))," ")}}function r4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-required")," "))}function o4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-min")," "))}function s4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-read-record-count-pattern")," "))}function l4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-required")," "))}function p4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-min")," "))}function c4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-pattern")," "))}function d4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",11)(1,"mat-form-field",12)(2,"mat-label",13),t.ɵɵtext(3,"gateway.storage-read-record-count"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",14),t.ɵɵtemplate(5,r4,3,3,"mat-error",15)(6,o4,3,3,"mat-error",15)(7,s4,3,3,"mat-error",15),t.ɵɵelementStart(8,"mat-icon",16),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",12)(12,"mat-label",13),t.ɵɵtext(13,"gateway.storage-max-records"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",17),t.ɵɵtemplate(15,l4,3,3,"mat-error",15)(16,p4,3,3,"mat-error",15)(17,c4,3,3,"mat-error",15),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(5),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("read_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,8,"gateway.hints.read-record-count")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,10,"gateway.hints.max-records-count"))}}function u4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-data-folder-path-required")," "))}function m4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-data-folder-path-pattern")," "))}function h4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-required")," "))}function g4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-min")," "))}function f4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-files-pattern")," "))}function y4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-required")," "))}function v4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-min")," "))}function x4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-pattern")," "))}function b4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-required")," "))}function w4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-min")," "))}function S4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-records-pattern")," "))}function C4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section")(1,"div",18)(2,"mat-form-field",12)(3,"mat-label",13),t.ɵɵtext(4,"gateway.storage-data-folder-path"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",19),t.ɵɵtemplate(6,u4,3,3,"mat-error",15)(7,m4,3,3,"mat-error",15),t.ɵɵelementStart(8,"mat-icon",20),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",12)(12,"mat-label",13),t.ɵɵtext(13,"gateway.storage-max-files"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",21),t.ɵɵtemplate(15,h4,3,3,"mat-error",15)(16,g4,3,3,"mat-error",15)(17,f4,3,3,"mat-error",15),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",11)(22,"mat-form-field",12)(23,"mat-label",13),t.ɵɵtext(24,"gateway.storage-max-read-record-count-storage"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",22),t.ɵɵtemplate(26,y4,3,3,"mat-error",15)(27,v4,3,3,"mat-error",15)(28,x4,3,3,"mat-error",15),t.ɵɵelementStart(29,"mat-icon",16),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(32,"mat-form-field",12)(33,"mat-label",13),t.ɵɵtext(34,"gateway.storage-max-records"),t.ɵɵelementEnd(),t.ɵɵelement(35,"input",23),t.ɵɵtemplate(36,b4,3,3,"mat-error",15)(37,w4,3,3,"mat-error",15)(38,S4,3,3,"mat-error",15),t.ɵɵelementStart(39,"mat-icon",16),t.ɵɵpipe(40,"translate"),t.ɵɵtext(41,"info_outlined "),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_folder_path").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_folder_path").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,15,"gateway.hints.data-folder")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_file_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,17,"gateway.hints.max-file-count")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(30,19,"gateway.hints.max-read-count")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_records_per_file").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(40,21,"gateway.hints.max-records"))}}function _4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-path-required")," "))}function T4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-path-pattern")," "))}function I4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-required")," "))}function E4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-min")," "))}function M4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-check-in-hours-pattern")," "))}function k4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-required")," "))}function P4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-min")," "))}function D4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.messages-ttl-in-days-pattern")," "))}function O4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-required")," "))}function A4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-min")," "))}function F4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.storage-max-read-record-count-pattern")," "))}function R4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.size-limit-required")," "))}function B4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.size-limit-min")," "))}function N4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.size-limit-pattern")," "))}function L4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.max-db-amount-required")," "))}function V4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.max-db-amount-min")," "))}function q4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.max-db-amount-pattern")," "))}function G4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.oversize-check-period-required")," "))}function z4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.oversize-check-period-min")," "))}function U4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.oversize-check-period-pattern")," "))}function j4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.writing-batch-size-required")," "))}function H4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.writing-batch-size-min")," "))}function W4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.writing-batch-size-pattern")," "))}function $4(e,n){if(1&e&&(t.ɵɵelementStart(0,"section")(1,"div",24)(2,"mat-form-field",25)(3,"mat-label",13),t.ɵɵtext(4,"gateway.storage-path"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",26),t.ɵɵtemplate(6,_4,3,3,"mat-error",15)(7,T4,3,3,"mat-error",15),t.ɵɵelementStart(8,"mat-icon",16),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",12)(12,"mat-label",13),t.ɵɵtext(13,"gateway.messages-ttl-check-in-hours"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",27),t.ɵɵtemplate(15,I4,3,3,"mat-error",15)(16,E4,3,3,"mat-error",15)(17,M4,3,3,"mat-error",15),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(21,"div",11)(22,"mat-form-field",12)(23,"mat-label",13),t.ɵɵtext(24,"gateway.messages-ttl-in-days"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",28),t.ɵɵtemplate(26,k4,3,3,"mat-error",15)(27,P4,3,3,"mat-error",15)(28,D4,3,3,"mat-error",15),t.ɵɵelementStart(29,"mat-icon",29),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(32,"mat-form-field",12)(33,"mat-label",13),t.ɵɵtext(34,"gateway.storage-max-read-record-count"),t.ɵɵelementEnd(),t.ɵɵelement(35,"input",22),t.ɵɵtemplate(36,O4,3,3,"mat-error",15)(37,A4,3,3,"mat-error",15)(38,F4,3,3,"mat-error",15),t.ɵɵelementStart(39,"mat-icon",29),t.ɵɵpipe(40,"translate"),t.ɵɵtext(41,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(42,"div",11)(43,"mat-form-field",12)(44,"mat-label",13),t.ɵɵtext(45,"gateway.size-limit"),t.ɵɵelementEnd(),t.ɵɵelement(46,"input",30),t.ɵɵtemplate(47,R4,3,3,"mat-error",15)(48,B4,3,3,"mat-error",15)(49,N4,3,3,"mat-error",15),t.ɵɵelementStart(50,"mat-icon",29),t.ɵɵpipe(51,"translate"),t.ɵɵtext(52,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(53,"mat-form-field",12)(54,"mat-label",13),t.ɵɵtext(55,"gateway.max-db-amount"),t.ɵɵelementEnd(),t.ɵɵelement(56,"input",31),t.ɵɵtemplate(57,L4,3,3,"mat-error",15)(58,V4,3,3,"mat-error",15)(59,q4,3,3,"mat-error",15),t.ɵɵelementStart(60,"mat-icon",29),t.ɵɵpipe(61,"translate"),t.ɵɵtext(62,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(63,"div",11)(64,"mat-form-field",12)(65,"mat-label",13),t.ɵɵtext(66,"gateway.oversize-check-period"),t.ɵɵelementEnd(),t.ɵɵelement(67,"input",32),t.ɵɵtemplate(68,G4,3,3,"mat-error",15)(69,z4,3,3,"mat-error",15)(70,U4,3,3,"mat-error",15),t.ɵɵelementStart(71,"mat-icon",29),t.ɵɵpipe(72,"translate"),t.ɵɵtext(73,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(74,"mat-form-field",12)(75,"mat-label",13),t.ɵɵtext(76,"gateway.writing-batch-size"),t.ɵɵelementEnd(),t.ɵɵelement(77,"input",33),t.ɵɵtemplate(78,j4,3,3,"mat-error",15)(79,H4,3,3,"mat-error",15)(80,W4,3,3,"mat-error",15),t.ɵɵelementStart(81,"mat-icon",29),t.ɵɵpipe(82,"translate"),t.ɵɵtext(83,"info_outlined "),t.ɵɵelementEnd()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(6),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_file_path").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("data_file_path").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,31,"gateway.hints.data-folder")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_check_in_hours").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,33,"gateway.hints.ttl-check-hour")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("messages_ttl_in_days").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(30,35,"gateway.hints.ttl-messages-day")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_read_records_count").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(40,37,"gateway.hints.max-read-count")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("size_limit").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("size_limit").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("size_limit").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(51,39,"gateway.size-limit-hint")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_db_amount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_db_amount").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("max_db_amount").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(61,41,"gateway.max-db-amount-hint")),t.ɵɵadvance(8),t.ɵɵproperty("ngIf",e.storageFormGroup.get("oversize_check_period").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("oversize_check_period").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("oversize_check_period").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(72,43,"gateway.oversize-check-period-hint")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",e.storageFormGroup.get("writing_batch_size").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("writing_batch_size").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",e.storageFormGroup.get("writing_batch_size").hasError("pattern")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(82,45,"gateway.writing-batch-size-hint"))}}class K4{constructor(e){this.fb=e,this.initialized=new u,this.StorageTypes=K3,this.storageTypes=Object.values(K3),this.storageTypesTranslationMap=Z3,this.onChange=()=>{},this.numberValidators=[me.min(1),me.pattern(ln)],this.requiredNumberValidators=[me.required,...this.numberValidators],this.requiredDirValidators=[me.required,me.pattern(un)],this.storageConfig={[K3.MEMORY]:{read_records_count:this.requiredNumberValidators,max_records_count:this.requiredNumberValidators},[K3.FILE]:{data_folder_path:this.requiredDirValidators,max_file_count:this.requiredNumberValidators,max_read_records_count:this.requiredNumberValidators,max_records_per_file:this.requiredNumberValidators},[K3.SQLITE]:{data_file_path:this.requiredDirValidators,messages_ttl_check_in_hours:this.requiredNumberValidators,messages_ttl_in_days:this.requiredNumberValidators,max_read_records_count:this.requiredNumberValidators,size_limit:this.numberValidators,max_db_amount:this.numberValidators,oversize_check_period:this.numberValidators,writing_batch_size:this.numberValidators}},this.storageFormGroup=this.initStorageFormGroup(),this.observeStorageTypeChanges(),this.storageFormGroup.valueChanges.pipe(In()).subscribe((e=>{this.onChange(e)}))}ngAfterViewInit(){this.updateValidators(this.storageFormGroup.get("type").value),this.initialized.emit({storage:this.storageFormGroup.value})}writeValue(e){J(e)&&(this.storageFormGroup.patchValue(e,{emitEvent:!1}),this.updateValidators(e.type))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.storageFormGroup.valid?null:{storageFormGroup:{valid:!1}}}initStorageFormGroup(){return this.fb.group({type:[K3.MEMORY,[me.required]],read_records_count:[100],max_records_count:[1e5],data_folder_path:["./data/"],max_file_count:[10],max_read_records_count:[10],max_records_per_file:[1e4],data_file_path:["./data/"],messages_ttl_check_in_hours:[1],messages_ttl_in_days:[7],size_limit:[1024],max_db_amount:[10],oversize_check_period:[1],writing_batch_size:[1e3]})}observeStorageTypeChanges(){this.storageFormGroup.get("type").valueChanges.pipe(In()).subscribe((e=>{this.updateValidators(e)}))}updateValidators(e){const t=this.storageConfig[e];Object.keys(this.storageFormGroup.controls).forEach((e=>{if("type"===e)return;const n=this.storageFormGroup.get(e),i=t[e];i?(n.enable({emitEvent:!1}),n.setValidators(i),n.updateValueAndValidity({emitEvent:!1}),n.markAsTouched({emitEvent:!1})):(n.disable({emitEvent:!1}),n.clearValidators(),n.updateValueAndValidity({emitEvent:!1}),n.markAsUntouched({emitEvent:!1}))}))}static{this.ɵfac=function(e){return new(e||K4)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:K4,selectors:[["tb-gateway-storage-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>K4)),multi:!0},{provide:he,useExisting:c((()=>K4)),multi:!0}]),t.ɵɵStandaloneFeature],decls:15,vars:9,consts:[[1,"mat-content","mat-padding","flex","w-full","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom","w-full"],["translate","",1,"tb-form-panel-title"],["translate","",1,"tb-form-panel-hint"],["formControlName","type",1,"flex"],[3,"value",4,"ngFor","ngForOf"],[1,"tb-form-panel-hint"],[3,"ngSwitch"],["class","tb-form-row no-border no-padding tb-standard-fields column-xs",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"value"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["type","number","matInput","","formControlName","read_records_count"],[4,"ngIf"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["type","number","matInput","","formControlName","max_records_count"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs","mb-2"],["matInput","","formControlName","data_folder_path"],["aria-hidden","false","aria-label","help-icon","matSuffix","",1,"mat-form-field-infix","pointer-event","suffix-icon",2,"cursor","pointer",3,"matTooltip"],["matInput","","type","number","formControlName","max_file_count"],["matInput","","type","number","formControlName","max_read_records_count"],["matInput","","type","number","formControlName","max_records_per_file"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs","align-start","mb-2"],["appearance","outline","subscriptSizing","dynamic",1,"flex"],["matInput","","formControlName","data_file_path"],["matInput","","type","number","formControlName","messages_ttl_check_in_hours"],["matInput","","type","number","formControlName","messages_ttl_in_days"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"],["matInput","","type","number","formControlName","size_limit"],["matInput","","type","number","formControlName","max_db_amount"],["matInput","","type","number","formControlName","oversize_check_period"],["matInput","","type","number","formControlName","writing_batch_size"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2),t.ɵɵtext(3,"gateway.storage"),t.ɵɵelementEnd(),t.ɵɵelementStart(4,"div",3),t.ɵɵtext(5,"gateway.hints.storage"),t.ɵɵelementEnd(),t.ɵɵelementStart(6,"tb-toggle-select",4),t.ɵɵtemplate(7,a4,3,4,"tb-toggle-option",5),t.ɵɵelementEnd(),t.ɵɵelementStart(8,"div",6),t.ɵɵtext(9),t.ɵɵpipe(10,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(11,7),t.ɵɵtemplate(12,d4,21,12,"section",8)(13,C4,42,23,"section",9)(14,$4,84,47,"section",9),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.storageFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngForOf",n.storageTypes),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(10,7,"gateway.hints."+n.storageFormGroup.get("type").value)),t.ɵɵadvance(2),t.ɵɵproperty("ngSwitch",n.storageFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.MEMORY),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.FILE),t.ɵɵadvance(),t.ɵɵproperty("ngSwitchCase",n.StorageTypes.SQLITE))},dependencies:t.ɵɵgetComponentDepsFactory(K4,[se,_]),encapsulation:2})}}function Y4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-required")," "))}function X4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-min")," "))}function Z4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-max")," "))}function Q4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-pattern")," "))}function J4(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-required")," "))}function e5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-min")," "))}function t5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-timeout-pattern")," "))}function n5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-required")," "))}function i5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-min")," "))}function a5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-keep-alive-pattern")," "))}function r5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-required")," "))}function o5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-min")," "))}function s5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-time-between-pings-pattern")," "))}function l5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-required")," "))}function p5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-min")," "))}function c5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-max-pings-without-data-pattern")," "))}function d5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-required")," "))}function u5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-min")," "))}function m5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.grpc-min-ping-interval-without-data-pattern")," "))}class h5{constructor(e){this.fb=e,this.initialized=new u,this.onChange=()=>{},this.grpcFormGroup=this.initGrpcFormGroup(),this.grpcFormGroup.valueChanges.pipe(In()).subscribe((e=>{this.onChange(e)})),this.grpcFormGroup.get("enabled").valueChanges.pipe(In()).subscribe((e=>{this.toggleRpcFields(e)}))}ngAfterViewInit(){this.initialized.emit({grpc:this.grpcFormGroup.value})}writeValue(e){e&&this.toggleRpcFields(e.enabled),this.grpcFormGroup.patchValue(e,{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.grpcFormGroup.valid?null:{grpcFormGroup:{valid:!1}}}toggleRpcFields(e){const t=this.grpcFormGroup;e?(t.get("serverPort").enable({emitEvent:!1}),t.get("keepAliveTimeMs").enable({emitEvent:!1}),t.get("keepAliveTimeoutMs").enable({emitEvent:!1}),t.get("keepalivePermitWithoutCalls").enable({emitEvent:!1}),t.get("maxPingsWithoutData").enable({emitEvent:!1}),t.get("minTimeBetweenPingsMs").enable({emitEvent:!1}),t.get("minPingIntervalWithoutDataMs").enable({emitEvent:!1})):(t.get("serverPort").disable({emitEvent:!1}),t.get("keepAliveTimeMs").disable({emitEvent:!1}),t.get("keepAliveTimeoutMs").disable({emitEvent:!1}),t.get("keepalivePermitWithoutCalls").disable({emitEvent:!1}),t.get("maxPingsWithoutData").disable({emitEvent:!1}),t.get("minTimeBetweenPingsMs").disable({emitEvent:!1}),t.get("minPingIntervalWithoutDataMs").disable({emitEvent:!1}))}initGrpcFormGroup(){return this.fb.group({enabled:[!1],serverPort:[9595,[me.required,me.min(1),me.max(65535),me.pattern(ln)]],keepAliveTimeMs:[1e4,[me.required,me.min(1),me.pattern(ln)]],keepAliveTimeoutMs:[5e3,[me.required,me.min(1),me.pattern(ln)]],keepalivePermitWithoutCalls:[!0],maxPingsWithoutData:[0,[me.required,me.min(0),me.pattern(ln)]],minTimeBetweenPingsMs:[1e4,[me.required,me.min(1),me.pattern(ln)]],minPingIntervalWithoutDataMs:[5e3,[me.required,me.min(1),me.pattern(ln)]]})}static{this.ɵfac=function(e){return new(e||h5)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:h5,selectors:[["tb-gateway-grpc-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>h5)),multi:!0},{provide:he,useExisting:c((()=>h5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:75,vars:47,consts:[[1,"mat-content","mat-padding","flex","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom","w-full"],["color","primary","formControlName","enabled",1,"mat-slide"],[1,"tb-form-row","no-border","no-padding",3,"tb-hint-tooltip-icon"],["color","primary","formControlName","keepalivePermitWithoutCalls",1,"mat-slide"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["translate",""],["matInput","","formControlName","serverPort","type","number","min","0"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],[4,"ngIf"],["matInput","","formControlName","keepAliveTimeoutMs","type","number","min","0"],["matInput","","formControlName","keepAliveTimeMs","type","number","min","0"],["matInput","","formControlName","minTimeBetweenPingsMs","type","number","min","0"],["matInput","","formControlName","maxPingsWithoutData","type","number","min","0"],["matInput","","formControlName","minPingIntervalWithoutDataMs","type","number","min","0"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"mat-slide-toggle",2),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"div",3),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"mat-slide-toggle",4),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(10,"section")(11,"section",5)(12,"mat-form-field",6)(13,"mat-label",7),t.ɵɵtext(14,"gateway.server-port"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",8),t.ɵɵelementStart(16,"mat-icon",9),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(19,Y4,3,3,"mat-error",10)(20,X4,3,3,"mat-error",10)(21,Z4,3,3,"mat-error",10)(22,Q4,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(23,"mat-form-field",6)(24,"mat-label",7),t.ɵɵtext(25,"gateway.grpc-keep-alive-timeout"),t.ɵɵelementEnd(),t.ɵɵelement(26,"input",11),t.ɵɵelementStart(27,"mat-icon",9),t.ɵɵpipe(28,"translate"),t.ɵɵtext(29,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(30,J4,3,3,"mat-error",10)(31,e5,3,3,"mat-error",10)(32,t5,3,3,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(33,"section",5)(34,"mat-form-field",6)(35,"mat-label",7),t.ɵɵtext(36,"gateway.grpc-keep-alive"),t.ɵɵelementEnd(),t.ɵɵelement(37,"input",12),t.ɵɵelementStart(38,"mat-icon",9),t.ɵɵpipe(39,"translate"),t.ɵɵtext(40,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(41,n5,3,3,"mat-error",10)(42,i5,3,3,"mat-error",10)(43,a5,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-form-field",6)(45,"mat-label",7),t.ɵɵtext(46,"gateway.grpc-min-time-between-pings"),t.ɵɵelementEnd(),t.ɵɵelement(47,"input",13),t.ɵɵelementStart(48,"mat-icon",9),t.ɵɵpipe(49,"translate"),t.ɵɵtext(50,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(51,r5,3,3,"mat-error",10)(52,o5,3,3,"mat-error",10)(53,s5,3,3,"mat-error",10),t.ɵɵelementEnd()(),t.ɵɵelementStart(54,"section",5)(55,"mat-form-field",6)(56,"mat-label",7),t.ɵɵtext(57,"gateway.grpc-max-pings-without-data"),t.ɵɵelementEnd(),t.ɵɵelement(58,"input",14),t.ɵɵelementStart(59,"mat-icon",9),t.ɵɵpipe(60,"translate"),t.ɵɵtext(61,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(62,l5,3,3,"mat-error",10)(63,p5,3,3,"mat-error",10)(64,c5,3,3,"mat-error",10),t.ɵɵelementEnd(),t.ɵɵelementStart(65,"mat-form-field",6)(66,"mat-label",7),t.ɵɵtext(67,"gateway.grpc-min-ping-interval-without-data"),t.ɵɵelementEnd(),t.ɵɵelement(68,"input",15),t.ɵɵelementStart(69,"mat-icon",9),t.ɵɵpipe(70,"translate"),t.ɵɵtext(71,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(72,d5,3,3,"mat-error",10)(73,u5,3,3,"mat-error",10)(74,m5,3,3,"mat-error",10),t.ɵɵelementEnd()()()()()),2&e&&(t.ɵɵproperty("formGroup",n.grpcFormGroup),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,29,"gateway.grpc")," "),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(6,31,"gateway.hints.permit-without-calls")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,33,"gateway.permit-without-calls")," "),t.ɵɵadvance(8),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,35,"gateway.hints.server-port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("max")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("serverPort").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(28,37,"gateway.hints.grpc-keep-alive-timeout")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeoutMs").hasError("pattern")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(39,39,"gateway.hints.grpc-keep-alive")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("keepAliveTimeMs").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(49,41,"gateway.hints.grpc-min-time-between-pings")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minTimeBetweenPingsMs").hasError("pattern")),t.ɵɵadvance(6),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(60,43,"gateway.hints.grpc-max-pings-without-data")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("maxPingsWithoutData").hasError("pattern")),t.ɵɵadvance(5),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,45,"gateway.hints.grpc-min-ping-interval-without-data")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("min")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.grpcFormGroup.get("minPingIntervalWithoutDataMs").hasError("pattern")))},dependencies:t.ɵɵgetComponentDepsFactory(h5,[se,_]),encapsulation:2})}}function g5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.date-format-required")," "))}function f5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.log-format-required")," "))}function y5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function v5(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",30),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit,i=t.ɵɵnextContext();t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(i.localLogsConfigTranslateMap.get(e))}}function x5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e),t.ɵɵadvance(),t.ɵɵtextInterpolate(e)}}function b5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.file-path-required")," "))}function w5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.saving-period-required")," "))}function S5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.saving-period-min")," "))}function C5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-option",29),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,2,e.value)," ")}}function _5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.backup-count-required")," "))}function T5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.logs.backup-count-min")," "))}class I5{constructor(e){this.fb=e,this.initialized=new u,this.logSavingPeriods=J3,this.localLogsConfigs=Object.keys(Y3),this.localLogsConfigTranslateMap=X3,this.gatewayLogLevel=Object.values(pt),this.remoteLogLevel=Object.values(pt).filter((e=>e!==pt.NONE)),this.onChange=()=>{},this.logsFormGroup=this.initLogsFormGroup(),this.showRemoteLogsControl=this.fb.control(!1),this.logsFormGroup.valueChanges.pipe(In()).subscribe((e=>{this.onChange(e)})),this.logSelector=this.fb.control(Y3.service);for(const e of Object.keys(Y3))this.addLocalLogConfig(e,{});this.showRemoteLogsControl.valueChanges.pipe(In()).subscribe((e=>this.logsFormGroup.get("logLevel")[e?"enable":"disable"]()))}ngAfterViewInit(){this.initialized.emit({logs:this.logsFormGroup.value})}writeValue(e){this.logsFormGroup.patchValue(e,{emitEvent:!1}),this.updateRemoteLogs(e?.logLevel??pt.NONE)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}getLogFormGroup(e){return this.logsFormGroup.get(`local.${e}`)}validate(){return this.logsFormGroup.valid?null:{logsFormGroup:{valid:!1}}}initLogsFormGroup(){return this.fb.group({dateFormat:["%Y-%m-%d %H:%M:%S",[me.required,me.pattern(/^[^\s].*[^\s]$/)]],logFormat:["%(asctime)s.%(msecs)03d - |%(levelname)s| - [%(filename)s] - %(module)s - %(funcName)s - %(lineno)d - %(message)s",[me.required,me.pattern(/^[^\s].*[^\s]$/)]],type:["remote",[me.required]],logLevel:[{value:pt.INFO,disabled:!0}],local:this.fb.group({})})}addLocalLogConfig(e,t){const n=this.logsFormGroup.get("local"),i=this.fb.group({logLevel:[t.logLevel||pt.INFO,[me.required]],filePath:[t.filePath||"./logs",[me.required]],backupCount:[t.backupCount||7,[me.required,me.min(0)]],savingTime:[t.savingTime||3,[me.required,me.min(0)]],savingPeriod:[t.savingPeriod||Q3.days,[me.required]]});n.addControl(e,i,{emitEvent:!1})}updateRemoteLogs(e){const t=e&&e!==pt.NONE;this.showRemoteLogsControl.patchValue(t,{emitEvent:!1}),this.logsFormGroup.get("logLevel")[t?"enable":"disable"]({emitEvent:!1}),this.logsFormGroup.get("logLevel").patchValue(e===pt.NONE?pt.INFO:e,{emitEvent:!1})}static{this.ɵfac=function(e){return new(e||I5)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:I5,selectors:[["tb-gateway-logs-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>I5)),multi:!0},{provide:he,useExisting:c((()=>I5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:72,vars:33,consts:[[1,"mat-content","mat-padding","flex","flex-col","gap-2",3,"formGroup"],[1,"tb-form-panel","no-padding-bottom"],[1,"flex","flex-col"],["appearance","outline"],["translate",""],["matInput","","formControlName","dateFormat"],[4,"ngIf"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","logFormat","rows","2"],[1,"tb-form-panel"],[1,"tb-settings",3,"expanded"],[1,"flex-wrap"],[1,"mat-slide",3,"click","formControl"],[3,"tb-hint-tooltip-icon"],["formControlName","logLevel"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","local",1,"tb-form-panel","no-padding-bottom"],["translate","",1,"tb-form-panel-title"],[1,"toggle-group",3,"formControl"],["class","first-capital",3,"value",4,"ngFor","ngForOf"],[3,"formGroup"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["matInput","","formControlName","filePath"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","saving-period"],["matInput","","formControlName","savingTime","type","number","min","0"],["appearance","outline","hideRequiredMarker","",2,"min-width","110px","width","30%"],["formControlName","savingPeriod"],["matInput","","formControlName","backupCount","type","number","min","0"],[3,"value"],[1,"first-capital",3,"value"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label",4),t.ɵɵtext(5,"gateway.logs.date-format"),t.ɵɵelementEnd(),t.ɵɵelement(6,"input",5),t.ɵɵtemplate(7,g5,3,3,"mat-error",6),t.ɵɵelementStart(8,"mat-icon",7),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",3)(12,"mat-label",4),t.ɵɵtext(13,"gateway.logs.log-format"),t.ɵɵelementEnd(),t.ɵɵelement(14,"textarea",8),t.ɵɵtemplate(15,f5,3,3,"mat-error",6),t.ɵɵelementStart(16,"mat-icon",7),t.ɵɵpipe(17,"translate"),t.ɵɵtext(18,"info_outlined "),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(19,"div",9)(20,"mat-expansion-panel",10)(21,"mat-expansion-panel-header",11)(22,"mat-panel-title")(23,"mat-slide-toggle",12),t.ɵɵlistener("click",(function(e){return e.stopPropagation()})),t.ɵɵelementStart(24,"mat-label")(25,"div",13),t.ɵɵpipe(26,"translate"),t.ɵɵtext(27),t.ɵɵpipe(28,"translate"),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(29,"mat-form-field",3)(30,"mat-label",4),t.ɵɵtext(31,"gateway.logs.level"),t.ɵɵelementEnd(),t.ɵɵelementStart(32,"mat-select",14),t.ɵɵtemplate(33,y5,2,2,"mat-option",15),t.ɵɵelementEnd()()()(),t.ɵɵelementStart(34,"div",16)(35,"div",17),t.ɵɵtext(36,"gateway.logs.local"),t.ɵɵelementEnd(),t.ɵɵelementStart(37,"tb-toggle-select",18),t.ɵɵtemplate(38,v5,2,2,"tb-toggle-option",19),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(39,20),t.ɵɵelementStart(40,"div",21)(41,"mat-form-field",22)(42,"mat-label",4),t.ɵɵtext(43,"gateway.logs.level"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-select",14),t.ɵɵtemplate(45,x5,2,2,"mat-option",15),t.ɵɵelementEnd()(),t.ɵɵelementStart(46,"mat-form-field",22)(47,"mat-label",4),t.ɵɵtext(48,"gateway.logs.file-path"),t.ɵɵelementEnd(),t.ɵɵelement(49,"input",23),t.ɵɵtemplate(50,b5,3,3,"mat-error",6),t.ɵɵelementEnd()(),t.ɵɵelementStart(51,"div",21)(52,"div",24)(53,"mat-form-field",22)(54,"mat-label",4),t.ɵɵtext(55,"gateway.logs.saving-period"),t.ɵɵelementEnd(),t.ɵɵelement(56,"input",25),t.ɵɵtemplate(57,w5,3,3,"mat-error",6)(58,S5,3,3,"mat-error",6),t.ɵɵelementEnd(),t.ɵɵelementStart(59,"mat-form-field",26)(60,"mat-select",27),t.ɵɵtemplate(61,C5,3,4,"mat-option",15),t.ɵɵpipe(62,"keyvalue"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(63,"mat-form-field",22)(64,"mat-label",4),t.ɵɵtext(65,"gateway.logs.backup-count"),t.ɵɵelementEnd(),t.ɵɵelement(66,"input",28),t.ɵɵtemplate(67,_5,3,3,"mat-error",6)(68,T5,3,3,"mat-error",6),t.ɵɵelementStart(69,"mat-icon",7),t.ɵɵpipe(70,"translate"),t.ɵɵtext(71,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()),2&e&&(t.ɵɵproperty("formGroup",n.logsFormGroup),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("dateFormat").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,21,"gateway.hints.date-form")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("logFormat").hasError("required")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(17,23,"gateway.hints.log-format")),t.ɵɵadvance(4),t.ɵɵproperty("expanded",n.showRemoteLogsControl.value),t.ɵɵadvance(3),t.ɵɵproperty("formControl",n.showRemoteLogsControl),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(26,25,"gateway.hints.remote-log")),t.ɵɵadvance(2),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(28,27,"gateway.logs.remote")),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.remoteLogLevel),t.ɵɵadvance(4),t.ɵɵproperty("formControl",n.logSelector),t.ɵɵadvance(),t.ɵɵproperty("ngForOf",n.localLogsConfigs),t.ɵɵadvance(),t.ɵɵproperty("formGroup",n.getLogFormGroup(n.logSelector.value)),t.ɵɵadvance(6),t.ɵɵproperty("ngForOf",n.gatewayLogLevel),t.ɵɵadvance(5),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".filePath").hasError("required")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".savingTime").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".savingTime").hasError("min")),t.ɵɵadvance(3),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(62,29,n.logSavingPeriods)),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".backupCount").hasError("required")),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.logsFormGroup.get("local."+n.logSelector.value+".backupCount").hasError("min")),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(70,31,"gateway.hints.backup-count")))},dependencies:t.ɵɵgetComponentDepsFactory(I5,[se,_]),encapsulation:2})}}function E5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.clientId-required")," "))}function M5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-client-id")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("clientId").value)}}function k5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("clientId"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-client-id"))}function P5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.username-required")," "))}function D5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-username")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("username").value)}}function O5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("username"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-user-name"))}function A5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",6),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext();t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"gateway.copy-password")),t.ɵɵproperty("copyText",e.usernameFormGroup.get("password").value)}}function F5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",13),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.generate("password"))})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-password"))}function R5(e,n){1&e&&(t.ɵɵelement(0,"tb-error",14),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("error",t.ɵɵpipeBind1(1,1,"device.client-id-or-user-name-necessary"))}function B5(e,n){1&e&&(t.ɵɵelement(0,"tb-error",14),t.ɵɵpipe(1,"translate")),2&e&&t.ɵɵproperty("error",t.ɵɵpipeBind1(1,1,"gateway.hints.username-required-with-password"))}class N5{constructor(e){this.fb=e,this.onChange=()=>{},this.initForm(),this.usernameFormGroup.valueChanges.pipe(In()).subscribe((e=>this.onChange(e)))}writeValue(e){this.usernameFormGroup.patchValue(e,{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){e?this.usernameFormGroup.disable({emitEvent:!1}):this.usernameFormGroup.enable({emitEvent:!1})}validate(){return this.usernameFormGroup.valid?null:{usernameFormGroup:{valid:!1}}}initForm(){this.usernameFormGroup=this.createSecurityFormGroup()}createSecurityFormGroup(){return this.fb.group({clientId:[null,[me.pattern(/^[^.\s]+$/)]],username:[null,[me.pattern(/^[^.\s]+$/)]],password:[null,[me.pattern(/^[^.\s]+$/)]]},{validators:[this.atLeastOneRequired,this.usernameRequired]})}atLeastOneRequired(e){const t=e.get("clientId").value,n=e.get("username").value;return t||n?null:{atLeastOneRequired:!0}}usernameRequired(e){const t=e.get("username").value,n=e.get("password").value;return!t&&n?{usernameRequired:!0}:null}generate(e){this.usernameFormGroup.get(e).patchValue(ae(20))}static{this.ɵfac=function(e){return new(e||N5)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:N5,selectors:[["tb-gateway-username-configuration"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>N5)),multi:!0},{provide:he,useExisting:c((()=>N5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:33,vars:17,consts:[[3,"formGroup"],[1,"xs:flex-col","no-border","no-padding","tb-standard-fields","flex","gap-2"],["appearance","outline",1,"flex","flex-1"],["translate",""],["matInput","","formControlName","clientId"],[4,"ngIf"],["matSuffix","","miniButton","false","tooltipPosition","above","icon","content_copy",3,"copyText","tooltipText"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","username"],["appearance","outline","subscriptSizing","dynamic",2,"width","100%"],["matInput","","formControlName","password"],["class","block",3,"error",4,"ngIf"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"],[1,"block",3,"error"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"section",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label",3),t.ɵɵtext(4,"security.clientId"),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",4),t.ɵɵtemplate(6,E5,3,3,"mat-error",5)(7,M5,2,4,"tb-copy-button",6)(8,k5,4,3,"button",7),t.ɵɵelementStart(9,"mat-icon",8),t.ɵɵpipe(10,"translate"),t.ɵɵtext(11,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"mat-form-field",2)(13,"mat-label",3),t.ɵɵtext(14,"security.username"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",9),t.ɵɵtemplate(16,P5,3,3,"mat-error",5)(17,D5,2,4,"tb-copy-button",6)(18,O5,4,3,"button",7),t.ɵɵelementStart(19,"mat-icon",8),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(22,"mat-form-field",10)(23,"mat-label",3),t.ɵɵtext(24,"gateway.password"),t.ɵɵelementEnd(),t.ɵɵelement(25,"input",11),t.ɵɵtemplate(26,A5,2,4,"tb-copy-button",6)(27,F5,4,3,"button",7),t.ɵɵelementStart(28,"mat-icon",8),t.ɵɵpipe(29,"translate"),t.ɵɵtext(30,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵtemplate(31,R5,2,3,"tb-error",12)(32,B5,2,3,"tb-error",12)),2&e&&(t.ɵɵproperty("formGroup",n.usernameFormGroup),t.ɵɵadvance(6),t.ɵɵproperty("ngIf",n.usernameFormGroup.get("clientId").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(n.usernameFormGroup.get("clientId").value?7:8),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(10,11,"gateway.hints.client-id")),t.ɵɵadvance(7),t.ɵɵproperty("ngIf",n.usernameFormGroup.get("username").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(n.usernameFormGroup.get("username").value?17:18),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,13,"gateway.hints.username")),t.ɵɵadvance(7),t.ɵɵconditional(n.usernameFormGroup.get("password").value?26:27),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(29,15,"gateway.hints.password")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",n.usernameFormGroup.hasError("atLeastOneRequired")&&n.usernameFormGroup.touched),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.usernameFormGroup.hasError("usernameRequired")&&n.usernameFormGroup.touched))},dependencies:t.ɵɵgetComponentDepsFactory(N5,[se,_]),encapsulation:2})}}class L5{constructor(e,t){this.deviceService=e,this.destroyRef=t,this.initialCredentialsSubject=new Ce(null)}get initialCredentials(){return this.initialCredentialsSubject.value}get initialCredentials$(){return this.initialCredentialsSubject.asObservable()}updateCredentials(e){let t={};switch(e.type){case e4.USERNAME_PASSWORD:this.shouldUpdateCredentials(e)&&(t=this.generateMqttCredentials(e));break;case e4.ACCESS_TOKEN:case e4.TLS_ACCESS_TOKEN:this.shouldUpdateAccessToken(e)&&(t={credentialsType:U.ACCESS_TOKEN,credentialsId:e.accessToken,credentialsValue:null})}return this.initialCredentialsSubject.next({...this.initialCredentials,...t}),Object.keys(t).length?this.deviceService.saveDeviceCredentials(this.initialCredentials):_e(null)}setInitialCredentials(e){this.deviceService.getDeviceCredentials(e.id).pipe(In(this.destroyRef)).subscribe((e=>{this.initialCredentialsSubject.next({...e,version:null})}))}shouldUpdateSecurityConfig(e){switch(e.type){case e4.USERNAME_PASSWORD:return this.shouldUpdateCredentials(e);case e4.ACCESS_TOKEN:case e4.TLS_ACCESS_TOKEN:return this.shouldUpdateAccessToken(e)}}credentialsToSecurityConfig(e){const t=e.credentialsType===U.MQTT_BASIC?e4.USERNAME_PASSWORD:e4.ACCESS_TOKEN;if(e.credentialsType!==U.MQTT_BASIC)return{type:t,accessToken:e.credentialsId};if(e.credentialsValue){const{clientId:n,userName:i,password:a}=JSON.parse(e.credentialsValue);return{type:t,clientId:n,username:i,password:a}}}shouldUpdateCredentials(e){if(this.initialCredentials.credentialsType!==U.MQTT_BASIC)return!0;const t=JSON.parse(this.initialCredentials.credentialsValue);return!(t.clientId===e.clientId&&t.userName===e.username&&t.password===e.password)}shouldUpdateAccessToken(e){return this.initialCredentials.credentialsType!==U.ACCESS_TOKEN||this.initialCredentials.credentialsId!==e.accessToken}generateMqttCredentials(e){const{clientId:t,username:n,password:i}=e,a={...t&&{clientId:t},...n&&{userName:n},...i&&{password:i}};return{credentialsType:U.MQTT_BASIC,credentialsValue:JSON.stringify(a)}}static{this.ɵfac=function(e){return new(e||L5)(t.ɵɵinject(K.DeviceService),t.ɵɵinject(t.DestroyRef))}}static{this.ɵprov=t.ɵɵdefineInjectable({token:L5,factory:L5.ɵfac})}}function V5(e,n){if(1&e&&(t.ɵɵelementStart(0,"tb-toggle-option",8),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e){const e=n.$implicit;t.ɵɵproperty("value",e.key),t.ɵɵadvance(),t.ɵɵtextInterpolate1("",t.ɵɵpipeBind1(2,2,e.value)," ")}}function q5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"security.access-token-required")," "))}function G5(e,n){if(1&e&&(t.ɵɵelement(0,"tb-copy-button",13),t.ɵɵpipe(1,"translate")),2&e){const e=t.ɵɵnextContext(2);t.ɵɵpropertyInterpolate("tooltipText",t.ɵɵpipeBind1(1,2,"device.copy-access-token")),t.ɵɵproperty("copyText",e.securityFormGroup.get("accessToken").value)}}function z5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",16),t.ɵɵpipe(1,"translate"),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext(2);return t.ɵɵresetView(n.generateAccessToken())})),t.ɵɵelementStart(2,"mat-icon"),t.ɵɵtext(3,"autorenew"),t.ɵɵelementEnd()()}2&e&&t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(1,1,"device.generate-access-token"))}function U5(e,n){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field",9)(1,"mat-label",10),t.ɵɵtext(2,"security.access-token"),t.ɵɵelementEnd(),t.ɵɵelement(3,"input",11),t.ɵɵtemplate(4,q5,3,3,"mat-error",12)(5,G5,2,4,"tb-copy-button",13)(6,z5,4,3,"button",14),t.ɵɵelementStart(7,"mat-icon",15),t.ɵɵpipe(8,"translate"),t.ɵɵtext(9,"info_outlined "),t.ɵɵelementEnd()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(4),t.ɵɵproperty("ngIf",e.securityFormGroup.get("accessToken").hasError("required")),t.ɵɵadvance(),t.ɵɵconditional(e.securityFormGroup.get("accessToken").value?5:6),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(8,3,"gateway.hints.token"))}}function j5(e,n){1&e&&(t.ɵɵelement(0,"tb-file-input",17),t.ɵɵpipe(1,"translate"),t.ɵɵpipe(2,"translate"),t.ɵɵpipe(3,"translate")),2&e&&(t.ɵɵpropertyInterpolate("hint",t.ɵɵpipeBind1(1,5,"gateway.hints.ca-cert")),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(2,7,"security.ca-cert")),t.ɵɵpropertyInterpolate("dropLabel",t.ɵɵpipeBind1(3,9,"gateway.drop-file")),t.ɵɵproperty("allowedExtensions","pem,cert,key")("accept",".pem, application/pem,.cert, application/cert, .key,application/key"))}class H5{constructor(e,t,n){this.fb=e,this.cd=t,this.gatewayCredentialsService=n,this.initialized=new u,this.securityTypes=t4,this.onChange=()=>{},this.securityFormGroup=this.createSecurityFormGroup(),this.setupFormListeners()}ngAfterViewInit(){const{usernamePassword:e,...t}=this.securityFormGroup.value;this.initialized.emit({thingsboard:{security:e?{...t,...e}:t}})}writeValue(e){e?this.updateFormBySecurityConfig(e):this.updateFormBySecurityConfig(this.gatewayCredentialsService.credentialsToSecurityConfig(this.gatewayCredentialsService.initialCredentials))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}validate(){return this.securityFormGroup.valid?null:{securityFormGroup:{valid:!1}}}updateFormBySecurityConfig(e){const{clientId:t,username:n,password:i,...a}=e??{};a?.type===e4.USERNAME_PASSWORD?this.securityFormGroup.patchValue({...a,usernamePassword:{clientId:t,username:n,password:i}},{emitEvent:!1}):this.securityFormGroup.patchValue(a,{emitEvent:!1}),this.toggleBySecurityType(this.securityFormGroup.get("type").value)}createSecurityFormGroup(){return this.fb.group({type:[e4.ACCESS_TOKEN,[me.required]],accessToken:[null,[me.required,me.pattern(/^[^.\s]+$/)]],caCert:[null,[me.required]],usernamePassword:[]})}setupFormListeners(){this.securityFormGroup.valueChanges.pipe(In()).subscribe((({usernamePassword:e,...t})=>{this.onChange(e?{...t,...e}:t)})),this.securityFormGroup.get("type").valueChanges.pipe(In()).subscribe((e=>{this.toggleBySecurityType(e)})),this.securityFormGroup.get("caCert").valueChanges.pipe(In()).subscribe((()=>this.cd.detectChanges()))}toggleBySecurityType(e){switch(this.securityFormGroup.disable({emitEvent:!1}),this.securityFormGroup.get("type").enable({emitEvent:!1}),e){case e4.ACCESS_TOKEN:this.securityFormGroup.get("accessToken").enable({emitEvent:!1});break;case e4.TLS_PRIVATE_KEY:this.securityFormGroup.get("caCert").enable({emitEvent:!1});break;case e4.TLS_ACCESS_TOKEN:this.securityFormGroup.get("accessToken").enable({emitEvent:!1}),this.securityFormGroup.get("caCert").enable({emitEvent:!1});break;case e4.USERNAME_PASSWORD:this.securityFormGroup.get("usernamePassword").enable({emitEvent:!1})}}generateAccessToken(){this.securityFormGroup.get("accessToken").patchValue(ae(20))}static{this.ɵfac=function(e){return new(e||H5)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(L5))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:H5,selectors:[["tb-gateway-security-configuration"]],outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>H5)),multi:!0},{provide:he,useExisting:c((()=>H5)),multi:!0}]),t.ɵɵStandaloneFeature],decls:10,vars:8,consts:[[1,"tb-form-panel"],["translate","",1,"tb-form-panel-title"],[3,"formGroup"],["formControlName","type",1,"toggle-group","flex"],[3,"value",4,"ngFor","ngForOf"],["appearance","outline",4,"ngIf"],["formControlName","usernamePassword"],["formControlName","caCert",3,"hint","label","allowedExtensions","accept","dropLabel",4,"ngIf"],[3,"value"],["appearance","outline"],["translate",""],["matInput","","formControlName","accessToken"],[4,"ngIf"],["matSuffix","","miniButton","false","tooltipPosition","above","icon","content_copy",3,"copyText","tooltipText"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"matTooltip"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["type","button","matSuffix","","mat-icon-button","","aria-label","Generate","matTooltipPosition","above",3,"click","matTooltip"],["formControlName","caCert",3,"hint","label","allowedExtensions","accept","dropLabel"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"div",1),t.ɵɵtext(2,"security.security"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(3,2),t.ɵɵelementStart(4,"tb-toggle-select",3),t.ɵɵtemplate(5,V5,3,4,"tb-toggle-option",4),t.ɵɵpipe(6,"keyvalue"),t.ɵɵelementEnd(),t.ɵɵtemplate(7,U5,10,5,"mat-form-field",5),t.ɵɵelement(8,"tb-gateway-username-configuration",6),t.ɵɵtemplate(9,j5,4,11,"tb-file-input",7),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(3),t.ɵɵproperty("formGroup",n.securityFormGroup),t.ɵɵadvance(2),t.ɵɵproperty("ngForOf",t.ɵɵpipeBind1(6,6,n.securityTypes)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value.toLowerCase().includes("accesstoken")),t.ɵɵadvance(),t.ɵɵclassProp("hidden","usernamePassword"!==n.securityFormGroup.get("type").value),t.ɵɵadvance(),t.ɵɵproperty("ngIf",n.securityFormGroup.get("type").value.toLowerCase().includes("tls")))},dependencies:t.ɵɵgetComponentDepsFactory(H5,[se,_,N5]),encapsulation:2})}}const W5=["configGroup"];function $5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-host-required")))}function K5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-required")))}function Y5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-min")))}function X5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-max")))}function Z5(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.thingsboard-port-pattern")))}function Q5(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-security-configuration",20),t.ɵɵlistener("initialized",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext(2);return t.ɵɵresetView(i.onInitialized(n))})),t.ɵɵelementEnd()}}function J5(e,n){if(1&e&&t.ɵɵelement(0,"tb-report-strategy",21),2&e){const e=t.ɵɵnextContext(2);t.ɵɵproperty("isExpansionMode",!0)("isConfig",!0)("defaultValue",e.ReportStrategyDefaultValue.Gateway)}}function e6(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",7)(1,"div",8)(2,"div",9),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"mat-slide-toggle",10),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",9),t.ɵɵpipe(8,"translate"),t.ɵɵelementStart(9,"mat-slide-toggle",11),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(12,"div",12)(13,"mat-form-field",13)(14,"mat-label",14),t.ɵɵtext(15,"gateway.thingsboard-host"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",15),t.ɵɵelementStart(17,"mat-icon",16),t.ɵɵpipe(18,"translate"),t.ɵɵtext(19,"info_outlined "),t.ɵɵelementEnd(),t.ɵɵtemplate(20,$5,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"mat-form-field",13)(22,"mat-label",14),t.ɵɵtext(23,"gateway.thingsboard-port"),t.ɵɵelementEnd(),t.ɵɵelement(24,"input",17),t.ɵɵtemplate(25,K5,3,3,"mat-error")(26,Y5,3,3,"mat-error")(27,X5,3,3,"mat-error")(28,Z5,3,3,"mat-error"),t.ɵɵelementStart(29,"mat-icon",16),t.ɵɵpipe(30,"translate"),t.ɵɵtext(31,"info_outlined "),t.ɵɵelementEnd()()()(),t.ɵɵtemplate(32,Q5,1,0,"tb-gateway-security-configuration",18),t.ɵɵpipe(33,"async"),t.ɵɵtemplate(34,J5,1,3,"tb-report-strategy",19),t.ɵɵelementEnd()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,10,"gateway.hints.remote-configuration")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,12,"gateway.remote-configuration")," "),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(8,14,"gateway.hints.remote-shell")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,16,"gateway.remote-shell")," "),t.ɵɵadvance(7),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(18,18,"gateway.hints.host")),t.ɵɵadvance(3),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.host").hasError("required")?20:-1),t.ɵɵadvance(5),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.port").hasError("required")?25:e.basicFormGroup.get("thingsboard.port").hasError("min")?26:e.basicFormGroup.get("thingsboard.port").hasError("max")?27:e.basicFormGroup.get("thingsboard.port").hasError("pattern")?28:-1),t.ɵɵadvance(4),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(30,20,"gateway.hints.port")),t.ɵɵadvance(3),t.ɵɵproperty("ngIf",t.ɵɵpipeBind1(33,22,e.initialCredentials$)),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.withReportStrategy)}}function t6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-slide-toggle",23)(1,"mat-label",33),t.ɵɵpipe(2,"translate"),t.ɵɵtext(3),t.ɵɵpipe(4,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(5,"mat-slide-toggle",34)(6,"mat-label",33),t.ɵɵpipe(7,"translate"),t.ɵɵtext(8),t.ɵɵpipe(9,"translate"),t.ɵɵelementEnd()()),2&e&&(t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(2,4,"gateway.hints.enable-general-statistics")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(4,6,"gateway.statistics.general-statistics")," "),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(7,8,"gateway.hints.enable-custom-statistics")),t.ɵɵadvance(2),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(9,10,"gateway.statistics.custom-statistics")," "))}function n6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-slide-toggle",23),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.statistics")," "))}function i6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-required")))}function a6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-min")))}function r6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.send-period-pattern")))}function o6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-required")))}function s6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-min")))}function l6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.custom-send-period-pattern")))}function p6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-required")))}function c6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-pattern")," "))}function d6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.time-series-name-already-exists")))}function u6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-required")))}function m6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-min")))}function h6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.timeout-pattern")))}function g6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.command-required")))}function f6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.command-pattern")))}function y6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",35)(1,"section",36)(2,"section",37)(3,"mat-form-field",38)(4,"mat-label",14),t.ɵɵtext(5,"gateway.statistics.name"),t.ɵɵelementEnd(),t.ɵɵelement(6,"input",39),t.ɵɵtemplate(7,p6,3,3,"mat-error")(8,c6,3,3,"mat-error")(9,d6,3,3,"mat-error"),t.ɵɵelementStart(10,"mat-icon",16),t.ɵɵpipe(11,"translate"),t.ɵɵtext(12,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(13,"mat-form-field",38)(14,"mat-label",14),t.ɵɵtext(15,"gateway.statistics.timeout"),t.ɵɵelementEnd(),t.ɵɵelement(16,"input",40),t.ɵɵtemplate(17,u6,3,3,"mat-error")(18,m6,3,3,"mat-error")(19,h6,3,3,"mat-error"),t.ɵɵelementStart(20,"mat-icon",16),t.ɵɵpipe(21,"translate"),t.ɵɵtext(22,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(23,"section")(24,"mat-form-field",41)(25,"mat-label",14),t.ɵɵtext(26,"gateway.statistics.command"),t.ɵɵelementEnd(),t.ɵɵelement(27,"input",42),t.ɵɵtemplate(28,g6,3,3,"mat-error")(29,f6,3,3,"mat-error"),t.ɵɵelementStart(30,"mat-icon",16),t.ɵɵpipe(31,"translate"),t.ɵɵtext(32,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(33,"section")(34,"mat-expansion-panel",43)(35,"mat-expansion-panel-header")(36,"mat-panel-title")(37,"div",28),t.ɵɵtext(38,"gateway.advanced-settings"),t.ɵɵelementEnd()()(),t.ɵɵelementStart(39,"mat-form-field",38)(40,"mat-label",14),t.ɵɵtext(41,"gateway.statistics.install-cmd"),t.ɵɵelementEnd(),t.ɵɵelement(42,"input",44),t.ɵɵelementStart(43,"mat-icon",45),t.ɵɵpipe(44,"translate"),t.ɵɵtext(45,"info_outlined "),t.ɵɵelementEnd()()()()(),t.ɵɵelementStart(46,"button",46),t.ɵɵpipe(47,"translate"),t.ɵɵlistener("click",(function(n){const i=t.ɵɵrestoreView(e).index,a=t.ɵɵnextContext(2);return t.ɵɵresetView(a.removeCommandControl(i,n))})),t.ɵɵelementStart(48,"mat-icon"),t.ɵɵtext(49,"delete"),t.ɵɵelementEnd()()()}if(2&e){const e=n.$implicit,i=n.index,a=t.ɵɵnextContext(2);t.ɵɵadvance(),t.ɵɵproperty("formGroupName",i),t.ɵɵadvance(6),t.ɵɵconditional(e.get("attributeOnGateway").hasError("required")?7:e.get("attributeOnGateway").hasError("pattern")?8:e.get("attributeOnGateway").hasError("duplicateName")?9:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(11,10,"gateway.hints.attribute")),t.ɵɵadvance(7),t.ɵɵconditional(e.get("timeout").hasError("required")?17:e.get("timeout").hasError("min")?18:e.get("timeout").hasError("pattern")?19:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(21,12,"gateway.hints.timeout")),t.ɵɵadvance(8),t.ɵɵconditional(e.get("command").hasError("required")?28:e.get("command").hasError("pattern")?29:-1),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(31,14,"gateway.hints.command")),t.ɵɵadvance(13),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(44,16,"gateway.hints.install-cmd")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(47,18,"gateway.statistics.remove")),t.ɵɵproperty("disabled",!a.basicFormGroup.get("thingsboard.remoteConfiguration").value)}}function v6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",7)(1,"div",22),t.ɵɵtemplate(2,t6,10,12)(3,n6,3,3,"mat-slide-toggle",23),t.ɵɵelementStart(4,"mat-form-field",24)(5,"mat-label",14),t.ɵɵtext(6,"gateway.statistics.send-period"),t.ɵɵelementEnd(),t.ɵɵelement(7,"input",25),t.ɵɵtemplate(8,i6,3,3,"mat-error")(9,a6,3,3,"mat-error")(10,r6,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"mat-form-field",24)(12,"mat-label",14),t.ɵɵtext(13,"gateway.statistics.custom-send-period"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",26),t.ɵɵtemplate(15,o6,3,3,"mat-error")(16,s6,3,3,"mat-error")(17,l6,3,3,"mat-error"),t.ɵɵelementEnd()(),t.ɵɵelementStart(18,"div",27)(19,"div",28),t.ɵɵtext(20,"gateway.statistics.commands"),t.ɵɵelementEnd(),t.ɵɵelementStart(21,"div",29),t.ɵɵtext(22,"gateway.hints.commands"),t.ɵɵelementEnd(),t.ɵɵelementContainerStart(23,30),t.ɵɵtemplate(24,y6,50,20,"div",31),t.ɵɵelementStart(25,"button",32),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.addCommand())})),t.ɵɵtext(26),t.ɵɵpipe(27,"translate"),t.ɵɵelementEnd(),t.ɵɵelementContainerEnd(),t.ɵɵelementEnd()()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(2),t.ɵɵconditional(e.hasUpdatedStatistics?2:3),t.ɵɵadvance(6),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("required")?8:e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("min")?9:e.basicFormGroup.get("thingsboard.statistics.statsSendPeriodInSeconds").hasError("pattern")?10:-1),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("required")?15:e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("min")?16:e.basicFormGroup.get("thingsboard.statistics.customStatsSendPeriodInSeconds").hasError("pattern")?17:-1),t.ɵɵadvance(9),t.ɵɵproperty("ngForOf",e.commandFormArray().controls),t.ɵɵadvance(),t.ɵɵproperty("disabled",!e.basicFormGroup.get("thingsboard.remoteConfiguration").value),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(27,6,"gateway.statistics.add")," ")}}function x6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-required")))}function b6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-min")))}function w6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-timeout-seconds-pattern")))}function S6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-required")))}function C6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-min")))}function _6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.inactivity-check-period-seconds-pattern")))}function T6(e,n){if(1&e&&(t.ɵɵelementStart(0,"section",37)(1,"mat-form-field",38)(2,"mat-label",14),t.ɵɵtext(3,"gateway.inactivity-timeout-seconds"),t.ɵɵelementEnd(),t.ɵɵelement(4,"input",56),t.ɵɵtemplate(5,x6,3,3,"mat-error")(6,b6,3,3,"mat-error")(7,w6,3,3,"mat-error"),t.ɵɵelementStart(8,"mat-icon",16),t.ɵɵpipe(9,"translate"),t.ɵɵtext(10,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-form-field",38)(12,"mat-label",14),t.ɵɵtext(13,"gateway.inactivity-check-period-seconds"),t.ɵɵelementEnd(),t.ɵɵelement(14,"input",57),t.ɵɵtemplate(15,S6,3,3,"mat-error")(16,C6,3,3,"mat-error")(17,_6,3,3,"mat-error"),t.ɵɵelementStart(18,"mat-icon",16),t.ɵɵpipe(19,"translate"),t.ɵɵtext(20,"info_outlined "),t.ɵɵelementEnd()()()),2&e){const e=t.ɵɵnextContext(2);t.ɵɵadvance(5),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("required")?5:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("min")?6:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds").hasError("pattern")?7:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(9,4,"gateway.hints.inactivity-timeout")),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("required")?15:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("min")?16:e.basicFormGroup.get("thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds").hasError("pattern")?17:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(19,6,"gateway.hints.inactivity-period"))}}function I6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-required")))}function E6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-min")))}function M6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.min-pack-send-delay-pattern")))}function k6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-required")))}function P6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-range")))}function D6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.mqtt-qos-range")))}function O6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-required")))}function A6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-min")))}function F6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.check-connectors-configuration-pattern")))}function R6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-required")))}function B6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-min")))}function N6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.max-payload-size-bytes-pattern")))}function L6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-required")))}function V6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-min")))}function q6(e,n){1&e&&(t.ɵɵelementStart(0,"mat-error"),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(2,1,"gateway.statistics.min-pack-size-to-send-pattern")))}function G6(e,n){if(1&e&&(t.ɵɵelementStart(0,"div",7)(1,"div",47)(2,"div",9),t.ɵɵpipe(3,"translate"),t.ɵɵelementStart(4,"mat-slide-toggle",48),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(7,T6,21,8,"section",49),t.ɵɵelementEnd(),t.ɵɵelementStart(8,"div",8)(9,"div",28),t.ɵɵtext(10,"gateway.advanced"),t.ɵɵelementEnd(),t.ɵɵelementStart(11,"section",37)(12,"mat-form-field",38)(13,"mat-label",14),t.ɵɵtext(14,"gateway.min-pack-send-delay"),t.ɵɵelementEnd(),t.ɵɵelement(15,"input",50),t.ɵɵtemplate(16,I6,3,3,"mat-error")(17,E6,3,3,"mat-error")(18,M6,3,3,"mat-error"),t.ɵɵelementStart(19,"mat-icon",16),t.ɵɵpipe(20,"translate"),t.ɵɵtext(21,"info_outlined "),t.ɵɵelementEnd()(),t.ɵɵelementStart(22,"mat-form-field",38)(23,"mat-label",14),t.ɵɵtext(24,"gateway.mqtt-qos"),t.ɵɵelementEnd(),t.ɵɵelementStart(25,"mat-select",51)(26,"mat-option",52),t.ɵɵtext(27,"0"),t.ɵɵelementEnd(),t.ɵɵelementStart(28,"mat-option",52),t.ɵɵtext(29,"1"),t.ɵɵelementEnd()(),t.ɵɵtemplate(30,k6,3,3,"mat-error")(31,P6,3,3,"mat-error")(32,D6,3,3,"mat-error"),t.ɵɵelementStart(33,"mat-icon",16),t.ɵɵpipe(34,"translate"),t.ɵɵtext(35,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(36,"section",37)(37,"mat-form-field",38)(38,"mat-label",14),t.ɵɵtext(39,"gateway.statistics.check-connectors-configuration"),t.ɵɵelementEnd(),t.ɵɵelement(40,"input",53),t.ɵɵtemplate(41,O6,3,3,"mat-error")(42,A6,3,3,"mat-error")(43,F6,3,3,"mat-error"),t.ɵɵelementEnd(),t.ɵɵelementStart(44,"mat-form-field",38)(45,"mat-label",14),t.ɵɵtext(46,"gateway.statistics.max-payload-size-bytes"),t.ɵɵelementEnd(),t.ɵɵelement(47,"input",54),t.ɵɵtemplate(48,R6,3,3,"mat-error")(49,B6,3,3,"mat-error")(50,N6,3,3,"mat-error"),t.ɵɵelementStart(51,"mat-icon",16),t.ɵɵpipe(52,"translate"),t.ɵɵtext(53,"info_outlined "),t.ɵɵelementEnd()()(),t.ɵɵelementStart(54,"section",37)(55,"mat-form-field",38)(56,"mat-label",14),t.ɵɵtext(57,"gateway.statistics.min-pack-size-to-send"),t.ɵɵelementEnd(),t.ɵɵelement(58,"input",55),t.ɵɵtemplate(59,L6,3,3,"mat-error")(60,V6,3,3,"mat-error")(61,q6,3,3,"mat-error"),t.ɵɵelementStart(62,"mat-icon",16),t.ɵɵpipe(63,"translate"),t.ɵɵtext(64,"info_outlined "),t.ɵɵelementEnd()()()()()),2&e){const e=t.ɵɵnextContext();t.ɵɵadvance(),t.ɵɵclassProp("no-padding-bottom",e.basicFormGroup.get("thingsboard.checkingDeviceActivity.checkDeviceInactivity").value),t.ɵɵadvance(),t.ɵɵpropertyInterpolate("tb-hint-tooltip-icon",t.ɵɵpipeBind1(3,16,"gateway.hints.check-device-activity")),t.ɵɵadvance(3),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(6,18,"gateway.checking-device-activity")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",e.basicFormGroup.get("thingsboard.checkingDeviceActivity.checkDeviceInactivity").value),t.ɵɵadvance(9),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("required")?16:e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("min")?17:e.basicFormGroup.get("thingsboard.minPackSendDelayMS").hasError("pattern")?18:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(20,20,"gateway.hints.minimal-pack-delay")),t.ɵɵadvance(7),t.ɵɵproperty("value",0),t.ɵɵadvance(2),t.ɵɵproperty("value",1),t.ɵɵadvance(2),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.qos").hasError("required")?30:e.basicFormGroup.get("thingsboard.qos").hasError("min")?31:e.basicFormGroup.get("thingsboard.qos").hasError("max")?32:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(34,22,"gateway.hints.qos")),t.ɵɵadvance(8),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("required")?41:e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("min")?42:e.basicFormGroup.get("thingsboard.checkConnectorsConfigurationInSeconds").hasError("pattern")?43:-1),t.ɵɵadvance(7),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("required")?48:e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("min")?49:e.basicFormGroup.get("thingsboard.maxPayloadSizeBytes").hasError("pattern")?50:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(52,24,"gateway.hints.max-payload-size-bytes")),t.ɵɵadvance(8),t.ɵɵconditional(e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("required")?59:e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("min")?60:e.basicFormGroup.get("thingsboard.minPackSizeToSend").hasError("pattern")?61:-1),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("matTooltip",t.ɵɵpipeBind1(63,26,"gateway.hints.min-pack-size-to-send"))}}class z6{constructor(e,t,n,i,a){this.fb=e,this.deviceService=t,this.gatewayCredentialsService=n,this.destroyRef=i,this.dialog=a,this.gatewayVersion=ct.Legacy,this.dialogMode=!1,this.withReportStrategy=!1,this.initialized=new u,this.ReportStrategyDefaultValue=on,this.initialCredentials$=this.gatewayCredentialsService.initialCredentials$,this.onChange=()=>{},this.destroy$=new we,this.initBasicFormGroup(),this.observeFormChanges(),this.basicFormGroup.valueChanges.pipe(Me(this.destroy$)).subscribe((()=>{this.onChange(this.basicFormGroup.getRawValue())}))}ngOnChanges(e){e.withReportStrategy&&!e.withReportStrategy.firstChange&&this.withReportStrategy&&this.basicFormGroup.get("thingsboard.reportStrategy").enable({emitEvent:!1}),e.gatewayVersion?.previousValue!==e.gatewayVersion.currentValue&&this.onVersionChange()}ngAfterViewInit(){this.defaultTab&&(this.configGroup.selectedIndex=$3[this.defaultTab])}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){}writeValue(e){this.basicFormGroup.patchValue(e,{emitEvent:!1});const t=this.basicFormGroup.get("thingsboard.reportStrategy"),n=e?.thingsboard?.reportStrategy;"DISABLED"===n?.type?t.disable({emitEvent:!1}):this.withReportStrategy&&t.enable({emitEvent:!1});const i=e?.thingsboard?.statistics?.commands??[];this.commandFormArray().clear({emitEvent:!1}),i.forEach((e=>this.addCommand(e,!1)))}validate(){return this.basicFormGroup.valid?null:{basicFormGroup:{valid:!1}}}commandFormArray(){return this.basicFormGroup.get("thingsboard.statistics.commands")}removeCommandControl(e,t){""!==t.pointerType&&(this.commandFormArray().removeAt(e),this.basicFormGroup.markAsDirty())}openConfigurationConfirmDialog(){this.deviceService.getDevice(this.device.id).pipe(Me(this.destroy$)).subscribe((e=>{this.dialog.open(fW,{disableClose:!0,panelClass:["tb-dialog","tb-fullscreen-dialog"],data:{gatewayName:e.name}}).afterClosed().pipe(Ne(1)).subscribe((e=>{e||this.basicFormGroup.get("thingsboard.remoteConfiguration").setValue(!0,{emitEvent:!1})}))}))}addCommand(e,t=!0){const{attributeOnGateway:n=null,command:i=null,timeout:a=10,installCmd:r=""}=e||{},o=this.fb.group({attributeOnGateway:[n,[me.required,me.pattern(pn),this.uniqNameRequired()]],command:[i,[me.required,me.pattern(/^(?=\S).*\S$/)]],timeout:[a,[me.required,me.min(1),me.pattern(ln),me.pattern(/^[^.\s]+$/)]],installCmd:[r,me.pattern(pn)]});this.commandFormArray().push(o,{emitEvent:t})}uniqNameRequired(){return e=>{const t=e.value?.trim().toLowerCase();return e.dirty&&t&&this.commandFormArray().value.some((e=>e.attributeOnGateway?.toLowerCase()===t))?{duplicateName:{valid:!1}}:null}}onInitialized(e){this.basicFormGroup.patchValue(e,{emitEvent:!1}),this.initialized.emit(this.basicFormGroup.value)}initBasicFormGroup(){this.basicFormGroup=this.fb.group({thingsboard:this.initThingsboardFormGroup(),storage:[],grpc:[],connectors:this.fb.array([]),logs:[]})}initThingsboardFormGroup(){return this.fb.group({host:[window.location.hostname,[me.required,me.pattern(/^[^\s]+$/)]],port:[1883,[me.required,me.min(1),me.max(65535),me.pattern(ln)]],remoteShell:[!1],remoteConfiguration:[!0],checkConnectorsConfigurationInSeconds:[60,[me.required,me.min(1),me.pattern(ln)]],statistics:this.fb.group({enable:[!0],enableCustom:[{value:!1,disabled:!0}],statsSendPeriodInSeconds:[3600,[me.required,me.min(60),me.pattern(ln)]],customStatsSendPeriodInSeconds:[3600,[me.required,me.min(60),me.pattern(ln)]],commands:this.fb.array([])}),maxPayloadSizeBytes:[8196,[me.required,me.min(100),me.pattern(ln)]],minPackSendDelayMS:[50,[me.required,me.min(10),me.pattern(ln)]],minPackSizeToSend:[500,[me.required,me.min(100),me.pattern(ln)]],handleDeviceRenaming:[!0],checkingDeviceActivity:this.initCheckingDeviceActivityFormGroup(),security:[],qos:[1],reportStrategy:[null]})}initCheckingDeviceActivityFormGroup(){return this.fb.group({checkDeviceInactivity:[!1],inactivityTimeoutSeconds:[300,[me.min(1),me.pattern(ln)]],inactivityCheckPeriodSeconds:[10,[me.min(1),me.pattern(ln)]]})}onVersionChange(){if(this.hasUpdatedStatistics=Ya.parseVersion(this.gatewayVersion)>=Ya.parseVersion(ct.v3_7_3),this.hasUpdatedStatistics){const e=this.basicFormGroup.get("thingsboard.statistics.enableCustom");e.enable({emitEvent:!1}),this.basicFormGroup.get("thingsboard.statistics.enable").valueChanges.pipe(In(this.destroyRef)).subscribe((t=>{t||e.patchValue(!1,{emitEvent:!1}),e[t?"enable":"disable"]({emitEvent:!1})}))}}observeFormChanges(){this.observeRemoteConfigurationChanges(),this.observeDeviceActivityChanges()}observeRemoteConfigurationChanges(){this.basicFormGroup.get("thingsboard.remoteConfiguration").valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{e||this.openConfigurationConfirmDialog()}))}observeDeviceActivityChanges(){const e=this.basicFormGroup.get("thingsboard.checkingDeviceActivity");e.get("checkDeviceInactivity").valueChanges.pipe(Me(this.destroy$)).subscribe((t=>{e.updateValueAndValidity();const n=[me.min(1),me.required,me.pattern(ln)];t?(e.get("inactivityTimeoutSeconds").setValidators(n),e.get("inactivityCheckPeriodSeconds").setValidators(n)):(e.get("inactivityTimeoutSeconds").clearValidators(),e.get("inactivityCheckPeriodSeconds").clearValidators()),e.get("inactivityTimeoutSeconds").updateValueAndValidity({emitEvent:!1}),e.get("inactivityCheckPeriodSeconds").updateValueAndValidity({emitEvent:!1})}))}static{this.ɵfac=function(e){return new(e||z6)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(K.DeviceService),t.ɵɵdirectiveInject(L5),t.ɵɵdirectiveInject(t.DestroyRef),t.ɵɵdirectiveInject(je.MatDialog))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:z6,selectors:[["tb-gateway-basic-configuration"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(W5,5),2&e){let e;t.ɵɵqueryRefresh(e=t.ɵɵloadQuery())&&(n.configGroup=e.first)}},inputs:{device:"device",defaultTab:"defaultTab",gatewayVersion:"gatewayVersion",dialogMode:"dialogMode",withReportStrategy:"withReportStrategy"},outputs:{initialized:"initialized"},standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>z6)),multi:!0},{provide:he,useExisting:c((()=>z6)),multi:!0}]),t.ɵɵNgOnChangesFeature,t.ɵɵStandaloneFeature],decls:20,vars:21,consts:[["configGroup",""],[1,"tab-group-block",3,"formGroup"],[3,"label"],["matTabContent",""],["formControlName","logs",1,"configuration-block",3,"initialized"],["formControlName","storage",3,"initialized"],["formControlName","grpc",3,"initialized"],["formGroupName","thingsboard",1,"mat-content","mat-padding","configuration-block"],[1,"tb-form-panel","no-padding-bottom"],[1,"tb-form-row","no-border","no-padding",3,"tb-hint-tooltip-icon"],["color","primary","formControlName","remoteConfiguration",1,"mat-slide"],["color","primary","formControlName","remoteShell",1,"mat-slide"],[1,"no-border","no-padding","tb-standard-fields","xs:flex-col","flex","gap-2"],["appearance","outline",1,"flex","flex-1"],["translate",""],["matInput","","formControlName","host"],["matIconSuffix","",2,"cursor","pointer",3,"matTooltip"],["matInput","","formControlName","port","type","number","min","0"],["formControlName","security",3,"initialized",4,"ngIf"],["class","tb-form-panel","formControlName","reportStrategy",3,"isExpansionMode","isConfig","defaultValue",4,"ngIf"],["formControlName","security",3,"initialized"],["formControlName","reportStrategy",1,"tb-form-panel",3,"isExpansionMode","isConfig","defaultValue"],["formGroupName","statistics",1,"tb-form-panel","no-padding-bottom"],["color","primary","formControlName","enable",1,"mat-slide"],["appearance","outline"],["matInput","","formControlName","statsSendPeriodInSeconds","type","number","min","60"],["matInput","","formControlName","customStatsSendPeriodInSeconds","type","number","min","60"],[1,"tb-form-panel"],["translate","",1,"tb-form-panel-title"],["translate","",1,"tb-form-panel-hint"],["formGroupName","statistics"],["formArrayName","commands","class","statistics-container flex flex-row",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button",2,"width","fit-content",3,"click","disabled"],[3,"tb-hint-tooltip-icon"],["color","primary","formControlName","enableCustom",1,"mat-slide"],["formArrayName","commands",1,"statistics-container","flex","flex-row"],[1,"tb-form-panel","stroked","no-padding-bottom","no-gap","command-container",3,"formGroupName"],[1,"tb-form-row","no-border","no-padding","tb-standard-fields","column-xs"],["appearance","outline",1,"flex"],["matInput","","formControlName","attributeOnGateway"],["matInput","","formControlName","timeout","type","number","min","0"],["appearance","outline",1,"mat-block"],["matInput","","formControlName","command"],[1,"tb-settings","pb-4"],["matInput","","formControlName","installCmd"],["matIconSuffix","",1,"cursor-pointer",3,"matTooltip"],["mat-icon-button","","matTooltipPosition","above",1,"tb-box-button",3,"click","disabled","matTooltip"],["formGroupName","checkingDeviceActivity",1,"tb-form-panel"],["color","primary","formControlName","checkDeviceInactivity",1,"mat-slide"],["class","tb-form-row no-border no-padding tb-standard-fields column-xs",4,"ngIf"],["matInput","","formControlName","minPackSendDelayMS","type","number","min","0"],["formControlName","qos"],[3,"value"],["matInput","","formControlName","checkConnectorsConfigurationInSeconds","type","number","min","0"],["matInput","","formControlName","maxPayloadSizeBytes","type","number","min","0"],["matInput","","formControlName","minPackSizeToSend","type","number","min","0"],["matInput","","formControlName","inactivityTimeoutSeconds","type","number","min","0"],["matInput","","type","number","min","0","formControlName","inactivityCheckPeriodSeconds"]],template:function(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"mat-tab-group",1,0)(2,"mat-tab",2),t.ɵɵpipe(3,"translate"),t.ɵɵtemplate(4,e6,35,24,"ng-template",3),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-tab",2),t.ɵɵpipe(6,"translate"),t.ɵɵelementStart(7,"tb-gateway-logs-configuration",4),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(8,"mat-tab",2),t.ɵɵpipe(9,"translate"),t.ɵɵelementStart(10,"tb-gateway-storage-configuration",5),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(11,"mat-tab",2),t.ɵɵpipe(12,"translate"),t.ɵɵelementStart(13,"tb-gateway-grpc-configuration",6),t.ɵɵlistener("initialized",(function(i){return t.ɵɵrestoreView(e),t.ɵɵresetView(n.onInitialized(i))})),t.ɵɵelementEnd()(),t.ɵɵelementStart(14,"mat-tab",2),t.ɵɵpipe(15,"translate"),t.ɵɵtemplate(16,v6,28,8,"ng-template",3),t.ɵɵelementEnd(),t.ɵɵelementStart(17,"mat-tab",2),t.ɵɵpipe(18,"translate"),t.ɵɵtemplate(19,G6,65,28,"ng-template",3),t.ɵɵelementEnd()()}2&e&&(t.ɵɵclassProp("dialog-mode",n.dialogMode),t.ɵɵproperty("formGroup",n.basicFormGroup),t.ɵɵadvance(2),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(3,9,"gateway.general")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(6,11,"gateway.logs.logs")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(9,13,"gateway.storage")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(12,15,"gateway.grpc")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(15,17,"gateway.statistics.statistics")),t.ɵɵadvance(3),t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(18,19,"gateway.other")))},dependencies:t.ɵɵgetComponentDepsFactory(z6,[se,_,ni,K4,h5,I5,H5]),styles:['@charset "UTF-8";[_nghost-%COMP%]{width:100%;height:100%;display:grid;grid-template-rows:min-content minmax(auto,1fr) min-content}[_nghost-%COMP%] .configuration-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{grid-row:1;background:transparent;color:#000000de!important}[_nghost-%COMP%] .tab-group-block[_ngcontent-%COMP%]{min-width:0;height:100%;min-height:0;grid-row:2}[_nghost-%COMP%] .toggle-group[_ngcontent-%COMP%]{margin-right:auto}[_nghost-%COMP%] .first-capital[_ngcontent-%COMP%]{text-transform:capitalize}[_nghost-%COMP%] textarea[_ngcontent-%COMP%]{resize:none}[_nghost-%COMP%] .saving-period[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] .statistics-container[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .statistics-container[_ngcontent-%COMP%] .command-container[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] mat-form-field[_ngcontent-%COMP%] mat-error[_ngcontent-%COMP%]{display:none!important}[_nghost-%COMP%] mat-form-field[_ngcontent-%COMP%] mat-error[_ngcontent-%COMP%]:first-child{display:block!important}[_nghost-%COMP%] .pointer-event{pointer-events:all}[_nghost-%COMP%] .toggle-group span{padding:0 25px}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{color:#e0e0e0}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix:hover{color:#9e9e9e}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{display:flex;align-items:center}']})}}e("GatewayBasicConfigurationComponent",z6),He([I()],z6.prototype,"dialogMode",void 0),He([I()],z6.prototype,"withReportStrategy",void 0);class U6{constructor(e){this.fb=e,this.destroy$=new we,this.advancedFormControl=this.fb.control(""),this.advancedFormControl.valueChanges.pipe(Me(this.destroy$)).subscribe((e=>{this.onChange(e),this.onTouched()}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){this.advancedFormControl.reset(e,{emitEvent:!1})}validate(){return this.advancedFormControl.valid?null:{advancedFormControl:{valid:!1}}}static{this.ɵfac=function(e){return new(e||U6)(t.ɵɵdirectiveInject(de.FormBuilder))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:U6,selectors:[["tb-gateway-advanced-configuration"]],standalone:!0,features:[t.ɵɵProvidersFeature([{provide:ue,useExisting:c((()=>U6)),multi:!0},{provide:he,useExisting:c((()=>U6)),multi:!0}]),t.ɵɵStandaloneFeature],decls:2,vars:4,consts:[["fillHeight","true","jsonRequired","",1,"flex","h-full","flex-col","p-2",3,"label","formControl"]],template:function(e,n){1&e&&(t.ɵɵelement(0,"tb-json-object-edit",0),t.ɵɵpipe(1,"translate")),2&e&&(t.ɵɵpropertyInterpolate("label",t.ɵɵpipeBind1(1,2,"gateway.configuration")),t.ɵɵproperty("formControl",n.advancedFormControl))},dependencies:t.ɵɵgetComponentDepsFactory(U6,[se,_]),encapsulation:2})}}function j6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",14),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.cancel())})),t.ɵɵelementStart(1,"mat-icon",15),t.ɵɵtext(2,"close"),t.ɵɵelementEnd()()}}function H6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"tb-gateway-basic-configuration",16),t.ɵɵpipe(1,"withReportStrategy"),t.ɵɵlistener("initialized",(function(n){t.ɵɵrestoreView(e);const i=t.ɵɵnextContext();return t.ɵɵresetView(i.onInitialized(n))})),t.ɵɵelementEnd()}if(2&e){const e=t.ɵɵnextContext();t.ɵɵproperty("device",e.device)("defaultTab",e.defaultTab)("gatewayVersion",e.gatewayVersion)("dialogMode",!!e.dialogRef)("withReportStrategy",t.ɵɵpipeBind1(1,5,e.gatewayVersion))}}function W6(e,n){1&e&&t.ɵɵelement(0,"tb-gateway-advanced-configuration",10)}function $6(e,n){if(1&e){const e=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"button",17),t.ɵɵlistener("click",(function(){t.ɵɵrestoreView(e);const n=t.ɵɵnextContext();return t.ɵɵresetView(n.cancel())})),t.ɵɵtext(1),t.ɵɵpipe(2,"translate"),t.ɵɵelementEnd()}2&e&&(t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(2,1,"action.cancel")," "))}e("GatewayAdvancedConfigurationComponent",U6);class K6{constructor(e,t,n,i,a){this.fb=e,this.attributeService=t,this.cd=n,this.gatewayCredentialsService=i,this.destroyRef=a,this.ConfigurationModes=an,this.gatewayConfigAttributeKeys=["general_configuration","grpc_configuration","logs_configuration","storage_configuration","RemoteLoggingLevel","mode"],this.useUpdatedLogs=!1,this.gatewayConfigGroup=this.fb.group({basicConfig:[],advancedConfig:[],mode:[an.BASIC]}),this.observeAlignConfigs()}ngAfterViewInit(){this.fetchConfigAttribute(this.device)}saveConfig(){const{mode:e,advancedConfig:t}=oe(this.removeEmpty(this.gatewayConfigGroup.value)),n={mode:e,...t};n.thingsboard.statistics.commands=Object.values(n.thingsboard.statistics.commands??[]),n.thingsboard.reportStrategy||(n.thingsboard.reportStrategy={type:"DISABLED"});const i=this.generateAttributes(n);this.attributeService.saveEntityAttributes(this.device,D.SHARED_SCOPE,i).pipe(Ve((e=>this.gatewayCredentialsService.updateCredentials(n.thingsboard.security))),In(this.destroyRef)).subscribe((()=>{this.dialogRef?this.dialogRef.close():(this.gatewayConfigGroup.markAsPristine(),this.cd.detectChanges())}))}onInitialized(e){this.gatewayConfigGroup.get("basicConfig").patchValue(e,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(e,{emitEvent:!1})}observeAlignConfigs(){this.gatewayConfigGroup.get("basicConfig").valueChanges.pipe(In(this.destroyRef)).subscribe((e=>{const t=this.gatewayConfigGroup.get("advancedConfig");W(t.value,e)||this.gatewayConfigGroup.get("mode").value!==an.BASIC||t.patchValue(e,{emitEvent:!1})})),this.gatewayConfigGroup.get("advancedConfig").valueChanges.pipe(In(this.destroyRef)).subscribe((e=>{const t=this.gatewayConfigGroup.get("basicConfig");W(t.value,e)||this.gatewayConfigGroup.get("mode").value!==an.ADVANCED||t.patchValue(e,{emitEvent:!1})}))}generateAttributes(e){const t=[],n=(e,n)=>{t.push({key:e,value:n})},i=(e,t)=>{t={...t,ts:(new Date).getTime()},n(e,t)};return n("RemoteLoggingLevel",e.logs?.logLevel??pt.NONE),delete e.connectors,n("logs_configuration",this.generateLogsFile(e.logs)),i("grpc_configuration",e.grpc),i("storage_configuration",e.storage),i("general_configuration",e.thingsboard),n("mode",e.mode),t}cancel(){this.dialogRef&&this.dialogRef.close()}removeEmpty(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>null!=t)).map((([e,t])=>[e,t===Object(t)?this.removeEmpty(t):t])))}generateLogsFile(e){const t={version:1,disable_existing_loggers:!1,formatters:{LogFormatter:{class:"logging.Formatter",format:e.logFormat,datefmt:e.dateFormat}},handlers:{consoleHandler:{class:"logging.StreamHandler",formatter:"LogFormatter",level:0,stream:"ext://sys.stdout"}},loggers:{...this.useUpdatedLogs?{}:{database:{handlers:["consoleHandler"],level:"DEBUG",propagate:!1}}},root:{level:"ERROR",handlers:["consoleHandler"]},ts:(new Date).getTime()};return this.addLocalLoggers(t,e?.local),t}addLocalLoggers(e,t){if(t)for(const n of Object.keys(t))e.handlers[n+"Handler"]=this.createHandlerObj(t[n],n),e.loggers[n]=this.createLoggerObj(t[n],n)}createHandlerObj(e,t){return{class:this.useUpdatedLogs?n4:i4,formatter:"LogFormatter",filename:`${e.filePath}/${t}.log`,backupCount:e.backupCount,interval:e.savingTime,when:e.savingPeriod,encoding:"utf-8"}}createLoggerObj(e,t){return{handlers:[`${t}Handler`,"consoleHandler"],level:e.logLevel,propagate:!1}}fetchConfigAttribute(e){e.id!==B&&this.attributeService.getEntityAttributes(e,D.CLIENT_SCOPE).pipe(Ge((t=>t.length?_e(t):this.attributeService.getEntityAttributes(e,D.SHARED_SCOPE,this.gatewayConfigAttributeKeys))),In(this.destroyRef)).subscribe((e=>{this.gatewayVersion=e.find((e=>"Version"===e.key))?.value,this.useUpdatedLogs=Ya.parseVersion(this.gatewayVersion??ct.Legacy)>=Ya.parseVersion(ct.v3_6_3),this.updateConfigs(e),this.cd.detectChanges()}))}updateConfigs(e){let t={},n=pt.NONE;this.gatewayCredentialsService.setInitialCredentials(this.device),e.forEach((e=>{switch(e.key){case"general_configuration":e.value&&(t={...t,thingsboard:e.value});break;case"grpc_configuration":e.value&&(t={...t,grpc:e.value});break;case"logs_configuration":e.value&&(t={...t,logs:this.logsToObj(e.value)});break;case"storage_configuration":e.value&&(t={...t,storage:e.value});break;case"mode":t={...t,mode:e.value??an.BASIC};break;case"RemoteLoggingLevel":e.value&&(n=e.value)}})),t.logs&&(t={...t,logs:{...t.logs,logLevel:n}}),t.thingsboard?.security?this.gatewayCredentialsService.initialCredentials$.pipe(Oe(Boolean),Ne(1),In(this.destroyRef)).subscribe((e=>{this.gatewayCredentialsService.shouldUpdateSecurityConfig(t.thingsboard.security)&&(t.thingsboard.security=this.gatewayCredentialsService.credentialsToSecurityConfig(e)),this.gatewayConfigGroup.get("basicConfig").patchValue(t,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(t,{emitEvent:!1})})):(this.gatewayConfigGroup.get("basicConfig").patchValue(t,{emitEvent:!1}),this.gatewayConfigGroup.get("advancedConfig").patchValue(t,{emitEvent:!1}))}logsToObj(e){const{format:t,datefmt:n}=e.formatters.LogFormatter;return{local:Object.keys(Y3).reduce(((t,n)=>{const i=e.handlers[`${n}Handler`]||{},a=e.loggers[n]||{};return t[n]={logLevel:a.level||pt.INFO,filePath:i.filename?.split(`/${n}`)[0]||"./logs",backupCount:i.backupCount||7,savingTime:i.interval||3,savingPeriod:i.when||Q3.days},t}),{}),logFormat:t,dateFormat:n}}static{this.ɵfac=function(e){return new(e||K6)(t.ɵɵdirectiveInject(de.FormBuilder),t.ɵɵdirectiveInject(K.AttributeService),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(L5),t.ɵɵdirectiveInject(t.DestroyRef))}}static{this.ɵcmp=t.ɵɵdefineComponent({type:K6,selectors:[["tb-gateway-configuration"]],inputs:{device:"device",defaultTab:"defaultTab",dialogRef:"dialogRef"},standalone:!0,features:[t.ɵɵProvidersFeature([L5]),t.ɵɵStandaloneFeature],decls:24,vars:24,consts:[[1,"flex","size-full","max-w-full","flex-col",3,"formGroup"],["color","primary"],[1,"tb-flex","space-between","align-center","h-16"],["tbTruncateWithTooltip",""],[1,"flex","items-center"],["formControlName","mode",3,"appearance"],[3,"value"],["mat-icon-button","","type","button",3,"click",4,"ngIf"],[1,"content-wrapper","flex-1"],["formControlName","basicConfig",3,"device","defaultTab","gatewayVersion","dialogMode","withReportStrategy"],["formControlName","advancedConfig"],[1,"flex","h-full","items-center","justify-end","gap-2","pr-4"],["mat-button","","color","primary","type","button"],["mat-raised-button","","color","primary","type","button",3,"click","disabled"],["mat-icon-button","","type","button",3,"click"],[1,"material-icons"],["formControlName","basicConfig",3,"initialized","device","defaultTab","gatewayVersion","dialogMode","withReportStrategy"],["mat-button","","color","primary","type","button",3,"click"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0)(1,"mat-toolbar",1)(2,"div",2)(3,"h2")(4,"div",3),t.ɵɵtext(5),t.ɵɵpipe(6,"translate"),t.ɵɵelementEnd()(),t.ɵɵelementStart(7,"div",4)(8,"tb-toggle-select",5)(9,"tb-toggle-option",6),t.ɵɵtext(10),t.ɵɵpipe(11,"translate"),t.ɵɵelementEnd(),t.ɵɵelementStart(12,"tb-toggle-option",6),t.ɵɵtext(13),t.ɵɵpipe(14,"translate"),t.ɵɵelementEnd()(),t.ɵɵtemplate(15,j6,3,0,"button",7),t.ɵɵelementEnd()()(),t.ɵɵelementStart(16,"div",8),t.ɵɵtemplate(17,H6,2,7,"tb-gateway-basic-configuration",9)(18,W6,1,0,"tb-gateway-advanced-configuration",10),t.ɵɵelementEnd(),t.ɵɵelementStart(19,"div",11),t.ɵɵtemplate(20,$6,3,3,"button",12),t.ɵɵelementStart(21,"button",13),t.ɵɵlistener("click",(function(){return n.saveConfig()})),t.ɵɵtext(22),t.ɵɵpipe(23,"translate"),t.ɵɵelementEnd()()()),2&e&&(t.ɵɵproperty("formGroup",n.gatewayConfigGroup),t.ɵɵadvance(),t.ɵɵclassProp("page-header",!n.dialogRef),t.ɵɵadvance(4),t.ɵɵtextInterpolate(t.ɵɵpipeBind1(6,16,"gateway.gateway-configuration")),t.ɵɵadvance(3),t.ɵɵclassProp("dialog-toggle",!!n.dialogRef),t.ɵɵpropertyInterpolate("appearance",n.dialogRef?"stroked":"fill"),t.ɵɵadvance(),t.ɵɵproperty("value",n.ConfigurationModes.BASIC),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(11,18,"gateway.basic")," "),t.ɵɵadvance(2),t.ɵɵproperty("value",n.ConfigurationModes.ADVANCED),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(14,20,"gateway.advanced")," "),t.ɵɵadvance(2),t.ɵɵproperty("ngIf",n.dialogRef),t.ɵɵadvance(2),t.ɵɵconditional(n.gatewayConfigGroup.get("mode").value===n.ConfigurationModes.BASIC?17:18),t.ɵɵadvance(3),t.ɵɵconditional(n.dialogRef?20:-1),t.ɵɵadvance(),t.ɵɵproperty("disabled",n.gatewayConfigGroup.invalid||!n.gatewayConfigGroup.dirty),t.ɵɵadvance(),t.ɵɵtextInterpolate1(" ",t.ɵɵpipeBind1(23,22,"action.save")," "))},dependencies:t.ɵɵgetComponentDepsFactory(K6,[se,_,tr,z6,U6]),styles:['@charset "UTF-8";[_nghost-%COMP%]{overflow:hidden;padding:0!important;max-height:75vh;height:75vh;width:800px;max-width:80vw}@media screen and (max-width: 599px){[_nghost-%COMP%]{max-height:100%;height:100%;width:100%;max-width:100%}}[_nghost-%COMP%] .page-header.mat-toolbar[_ngcontent-%COMP%]{background:transparent;color:#000000de!important}[_nghost-%COMP%] .content-wrapper[_ngcontent-%COMP%]{min-height:calc(100% - 116px)}.dialog-toggle[_ngcontent-%COMP%] .mat-button-toggle-button{color:#ffffffbf}']})}}e("GatewayConfigurationComponent",K6);class Y6{constructor(){}static{this.ɵfac=function(e){return new(e||Y6)}}static{this.ɵcmp=t.ɵɵdefineComponent({type:Y6,selectors:[["tb-lib-styles-entry"]],standalone:!0,features:[t.ɵɵStandaloneFeature],decls:0,vars:0,template:function(e,t){},styles:['@charset "UTF-8";.gw-delete-icon-button{color:#0000008a}.gw-connector-table .mat-mdc-table{table-layout:fixed}.gw-chip-list .mdc-evolution-chip-set__chips{justify-content:flex-end;align-items:center}.gw-table-toolbar.mat-mdc-table-toolbar.mat-mdc-table-toolbar{padding:0 8px}.see-example{display:flex}.tb-default .h-16{height:4rem}.tb-default .h-\\[500px\\]{height:500px}.tb-default .max-h-full{max-height:100%}.tb-default .min-h-10{min-height:2.5rem}.tb-default .\\!w-1\\/5{width:20%!important}.tb-default .w-1\\/2{width:50%}.tb-default .w-12{width:3rem}.tb-default .w-\\[77vw\\]{width:77vw}.tb-default .min-w-16{min-width:4rem}.tb-default .min-w-24{min-width:6rem}.tb-default .max-w-2xl{max-width:42rem}.tb-default .max-w-3xl{max-width:48rem}.tb-default .max-w-4\\/12{max-width:33.333333%}.tb-default .max-w-\\[11vw\\]{max-width:11vw}.tb-default .max-w-full{max-width:100%}.tb-default .flex-\\[1_1_30px\\]{flex:1 1 30px}.tb-default .flex-\\[1_1_33\\%\\]{flex:1 1 33%}.tb-default .flex-grow{flex-grow:1}.tb-default .gap-1\\.25{gap:.3125rem}.tb-default .p-1{padding:.25rem}.tb-default .\\!pl-0{padding-left:0!important}.tb-default .pr-4{padding-right:1rem}.tb-default .pt-4{padding-top:1rem}.tb-default .text-center{text-align:center}@media (max-width: 599px){.tb-default .lt-sm\\:flex-col{flex-direction:column}}\n'],encapsulation:2})}}const X6=(e,t)=>{const n=e[y];if(n.styles?.length){const e=n.styles[0];let i=document.getElementById(t);if(!i){i=document.createElement("style"),i.id=t;(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}i.innerHTML=e}};class Z6{constructor(e){this.translate=e,At(e),this.translate.onLangChange.pipe(In(),Oe((e=>e.lang!==ft.English))).subscribe((()=>{At(e)})),(e=>{X6(Y6,e)})("tb-gateway-css")}static{this.ɵfac=function(e){return new(e||Z6)(t.ɵɵinject(le.TranslateService))}}static{this.ɵmod=t.ɵɵdefineNgModule({type:Z6})}static{this.ɵinj=t.ɵɵdefineInjector({imports:[se,_,ce,wj,hW,c$,K6,Tn,W3,H3]})}}e("GatewayExtensionModule",Z6),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(Z6,{imports:[se,_,ce,wj,hW,c$,K6,Tn,W3,H3]})}}}));//# sourceMappingURL=gateway-management-extension.js.map diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index db8792131b..63aae7382d 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -1330,7 +1330,7 @@ transport: # URL of gateways dashboard repository repository_url: "${TB_GATEWAY_DASHBOARD_SYNC_REPOSITORY_URL:https://github.com/thingsboard/gateway-management-extensions-dist.git}" # Branch of gateways dashboard repository to work with - branch: "${TB_GATEWAY_DASHBOARD_SYNC_BRANCH:release/4.0.0}" + branch: "${TB_GATEWAY_DASHBOARD_SYNC_BRANCH:release/4.2.0}" # Fetch frequency in hours for gateways dashboard repository fetch_frequency: "${TB_GATEWAY_DASHBOARD_SYNC_FETCH_FREQUENCY:24}"