@c8y/ng1-modules 1017.45.0 → 1017.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/NOTICES +1025 -984
  2. package/administration-tfaSettings/tfa-settings.component.js +1 -1
  3. package/alarmsEventsExplorer/alarmsEventsTimelinesChart/alarmsEventsTimelinesChart.service.js +1 -1
  4. package/app-logs/app-logs/app-logs.component.js +1 -1
  5. package/app-logs/app-logs.service.js +1 -1
  6. package/assetPropertyWidget/main.controller.js +1 -1
  7. package/assetTable/assetTable2/assets.controller.js +1 -1
  8. package/cell-id-information-activator/cell-id-information-activator.config.js +1 -1
  9. package/cell-id-information-activator/cell-id-information-activator.service.js +1 -1
  10. package/cell-id-usage-statistics/cell-id-usage-statistics.component.js +1 -1
  11. package/cell-id-usage-statistics/cell-id-usage-statistics.service.js +1 -1
  12. package/commandTemplates/controllers/commandTemplates.js +1 -1
  13. package/core/core/services/alarms.js +1 -1
  14. package/core/core/services/application.js +1 -1
  15. package/core/core/services/auth.js +1 -1
  16. package/core/core/services/base.js +1 -1
  17. package/core/core/services/binary.js +1 -1
  18. package/core/core/services/dynamicGroups.js +1 -1
  19. package/core/core/services/events.js +1 -1
  20. package/core/core/services/groups.js +1 -1
  21. package/core/core/services/inventory.js +1 -1
  22. package/core/core/services/kpi.js +1 -1
  23. package/core/core/services/license.js +1 -1
  24. package/core/core/services/permissions.js +1 -1
  25. package/core/core/services/realtime.js +1 -1
  26. package/core/core/services/settings.js +1 -1
  27. package/core/core/services/tenant.js +1 -1
  28. package/core/core/services/user.js +1 -1
  29. package/core/core/services/userGroup.js +1 -1
  30. package/core/core/services/util.js +1 -1
  31. package/core/sdk/directives/repeat.js +1 -1
  32. package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
  33. package/core/ui/configurable-device-list-columns/modal-columns-configure.component.js +1 -1
  34. package/core/ui/controllers/deviceList.js +1 -1
  35. package/core/ui/csvExporter/csvExporter.controller.js +1 -1
  36. package/core/ui/directives/alarmList.js +1 -1
  37. package/core/ui/directives/auditList.js +1 -1
  38. package/core/ui/directives/binaryInput.js +1 -1
  39. package/core/ui/directives/binaryOut.js +1 -1
  40. package/core/ui/directives/interval.js +1 -1
  41. package/core/ui/directives/map.js +1 -1
  42. package/core/ui/directives/map2.js +1 -1
  43. package/core/ui/directives/sunburstChart.js +1 -1
  44. package/core/ui/directives/textOut.js +1 -1
  45. package/core/ui/forms/uib-dropdown.decorator.js +1 -1
  46. package/core/ui/header/action-bar.service.js +1 -1
  47. package/core/ui/properties/lastDeviceMessage.computedProperty.js +1 -1
  48. package/core/ui/properties/propertiesLibrary.service.js +1 -1
  49. package/core/ui/providers/httpCache.js +1 -1
  50. package/core/ui/providers/views.js +1 -1
  51. package/core/ui/providers/zip.js +1 -1
  52. package/core/ui/sanitize-html/sanitize-html.service.js +1 -1
  53. package/core/ui/schemaForm/fileUpload.config.js +1 -1
  54. package/core/ui/schemaForm/overrides/decorators/decorators.decorator.js +1 -1
  55. package/core/ui/schemaForm/schemaForm.component.js +1 -1
  56. package/core/ui/services/deviceListColumns.js +1 -1
  57. package/core/ui/user/editUser.directive.html +1 -0
  58. package/core/ui/user/userPicker.html +6 -1
  59. package/dashboard2/dashboard.service.js +1 -1
  60. package/dataBroker/connectorsAlarms/connectorAlarms.component.js +1 -1
  61. package/dataPointExplorer/services/dataPoints.js +1 -1
  62. package/device-protocol-actility/actility-device.provider.js +1 -1
  63. package/device-protocol-canbus/canbus-device.provider.js +1 -1
  64. package/device-protocol-canopen/canopen-device.provider.js +1 -1
  65. package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
  66. package/device-protocol-lora/lora-device.provider.js +1 -1
  67. package/device-protocol-lpwan/lpwan-device.provider.js +1 -1
  68. package/device-protocol-modbus/modbus-device.provider.js +1 -1
  69. package/device-protocol-opcua/opcua-device.provider.js +1 -1
  70. package/device-protocol-profibus/profibus-device.provider.js +1 -1
  71. package/device-protocol-sigfox/sigfox-device.provider.js +1 -1
  72. package/device-protocol-snmp/snmp-device.provider.js +1 -1
  73. package/device-protocols/device-protocol-import-button.component.js +1 -1
  74. package/deviceControlRelay/relayControl/relayControl.directive.js +1 -1
  75. package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
  76. package/deviceDatabase4/detail/message-id-configuration-description.component.js +1 -1
  77. package/deviceDatabase4/device-database.service.js +1 -1
  78. package/deviceDatabase4/device-type-list.component.js +1 -1
  79. package/deviceDatabase4/modals/configure-discrete-io.component.js +1 -1
  80. package/deviceDatabase4/modals/configure-register.component.js +1 -1
  81. package/deviceDatabase4/modals/import-device-type.component.js +1 -1
  82. package/deviceDatabase4/parsers/device-type-parser-eds.service.js +1 -1
  83. package/deviceDatabase4/unique.directive.js +1 -1
  84. package/deviceSelector/controllers/deviceSelectorComboCtrl.js +1 -1
  85. package/devicemanagement-alarmList/controllers/alarmList.js +1 -1
  86. package/devicemanagement-availability/controllers/availability.js +1 -1
  87. package/devicemanagement-eventList/controllers/eventList.js +1 -1
  88. package/enterpriseEdition/createFile.js +1 -1
  89. package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +1 -1
  90. package/enterpriseEdition/customBranding/brandingDeploy.service.js +1 -1
  91. package/export/services/api.js +1 -1
  92. package/generic-ui/generic-ui-inventory-property.component.js +1 -1
  93. package/groupsHierarchy/controllers/groupsListCtrl.js +1 -1
  94. package/groupsHierarchy/groupsHierarchyUi.provider.js +1 -1
  95. package/kpi/controllers/pieChart.js +1 -1
  96. package/measurements/directives/lineChart.js +1 -1
  97. package/measurements/fragmentChart/fragmentChart.component.js +1 -1
  98. package/measurements/measurements2/axisY.service.js +1 -1
  99. package/measurements/measurements2/chart.service.js +1 -1
  100. package/measurements/measurements2/series.service.js +1 -1
  101. package/modbusConfiguration4/fieldbus-config.component.js +1 -1
  102. package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
  103. package/modbusWidget4/modbus-widget.service.js +1 -1
  104. package/modbusWidget4/widget-config.component.js +1 -1
  105. package/modbusWidget4/widget.component.js +1 -1
  106. package/package.json +2 -2
  107. package/remoteAccess/remoteAccess.service.js +1 -1
  108. package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +1 -1
  109. package/rotation3dWidget/components/webscene.component.js +1 -1
  110. package/scada/mapping.directive.js +1 -1
  111. package/smartRules/directives/smartRuleParamInputKpi.js +1 -1
  112. package/smartRules/services/smartRuleTemplates.js +1 -1
  113. package/tenantApplications/views/index.html +1 -0
  114. package/tenantStatistics/tenant-statistics.component.js +1 -1
  115. package/tenants/controllers/detail.js +1 -1
  116. package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,d=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",n=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,a,c,u,o=t&&t.prototype instanceof v?t:v,s=Object.create(o.prototype),d=new x(n||[]);return s._invoke=(i=e,a=r,c=d,u="suspendedStart",function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return N()}for(c.method=e,c.arg=t;;){var r=c.delegate;if(r){var n=b(r,c);if(n){if(n===f)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=l(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===f)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}),s}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var f={};function v(){}function u(){}function s(){}var p={};i(p,o,function(){return this});var h=Object.getPrototypeOf,y=h&&h(h(D([])));y&&y!==e&&d.call(y,o)&&(p=y);var m=s.prototype=v.prototype=Object.create(p);function g(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function _(u,s){var t;this._invoke=function(r,n){function e(){return new s(function(e,t){!function t(e,r,n,o){var i=l(u[e],u,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&d.call(c,"__await")?s.resolve(c.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):s.resolve(c).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,o)})}o(i.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=l(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function D(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(d.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:N}}function N(){return{value:void 0,done:!0}}return i(m,"constructor",u.prototype=s),i(s,"constructor",u),u.displayName=i(s,n,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,i(e,n,"GeneratorFunction")),e.prototype=Object.create(m),e},a.awrap=function(e){return{__await:e}},g(_.prototype),i(_.prototype,r,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new _(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},g(m),i(m,n,"Generator"),i(m,o,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=D,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=d.call(o,"catchLoc"),c=d.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&d.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:D(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},a}!function(){function e(o,n,t,i,a,c,u,s,d,l,r){var e,h=this,f=d.snmpVersions,v=d.snmpAuthPrivProtocols,p=d.snmpAuthProtocols,y=d.snmpSecurityLevels;function m(){h.expandedId="",h.reloadDevices(),t.success(r("Child device changes saved."))}function g(e){e.adding=!1,t.danger(r("Failed to change child device."))}function b(){E(),h.reloadDevices(),t.success(r("New child device added."))}function w(){h.newDevice.adding=!1,t.danger(r("Failed to add new child device."))}function E(){h.expandedId="",_.unset(h,"newDevice"),h[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function x(){return"modbus"===h.tab}function D(){return"canbus"===h.tab}function N(){return"opcua"===h.tab}function S(){return"profibus"===h.tab}function I(){return"canopen"===h.tab}function L(){return"snmp"===h.tab}_.assign(h,{$onInit:function(){e="new".concat(h.mode,"DeviceForm"),h.expandedId=""},shouldShowSection:function(){var e=h.device,t=h.mode,r=!1;x()?"TCP"===t?r=l.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===t&&(r=l.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):D()&&"CAN"===t?r=l.supportsOperation(e,"c8y_CanDevice"):S()&&"Profibus"===t?r=l.supportsOperation(e,"c8y_ProfibusDevice"):I()&&"CANopen"===t&&(r=l.supportsOperation(e,"c8y_CANopenAddDevice"));return r},isModbusTab:x,isCanBusTab:D,isOPCUATab:N,isProfibusTab:S,isCanOpenTab:I,isSNMPTab:L,invalid:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(h.mode,"DeviceForm");return function(e){var t=h.mode,r=h.fieldErrors;if("TCP"===t||"RTU"===t){var n=h[e],o=n.address;if(o){var i=o.$modelValue;if("TCP"===t){var a=n.ipAddress,c=a.$modelValue;_.isUndefined(i)||o.$setValidity(r.ADDRESS_INVALID,function(e){return e<=247||255===e}(i));var u=i&&c&&_.some(h.devices,{address:i,ipAddress:c,protocol:"TCP"});o.$setValidity(r.ADDRESSES_IN_USE,!u),a.$setValidity(r.ADDRESSES_IN_USE,!u)}else if("RTU"===t){var s=i&&_.some(h.devices,{address:i,protocol:"RTU"});o.$setValidity(r.ADDRESS_IN_USE,!s)}}}else if("CANopen"===t){var d=h[e],l=d.nodeId;if(l){var f=l.$modelValue;if(f){var v=function(e){return 1<=e&&e<=127}(f),p=function(t){return h.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===t})}(f);v?p?(l.$setValidity(r.NODE_OUT_OF_RANGE,!0),l.$setValidity(r.NODE_IN_USE,!1)):(l.$setValidity(r.NODE_OUT_OF_RANGE,!0),l.$setValidity(r.NODE_IN_USE,!0)):(l.$setValidity(r.NODE_OUT_OF_RANGE,!1),l.$setValidity(r.NODE_IN_USE,!0))}}}else"SNMP"===t&&function(e){var t,r=h[e];e&&(t=function(e){return _.toNumber(e.replace("form",""))}(e)),function(e,t){var r=h.fieldErrors;if(e.snmpVersionEngineId){var n=e.snmpVersionEngineId,o=n.$modelValue;o&&n.$setValidity(r.ENGINEID_IN_USE,!function(t,r){return r?_.some(h.devices,function(e){return(_.toNumber(e.id)!==r||t!==e.auth.engineId)&&e.engineId===t}):_.some(h.devices,function(e){return e.auth.engineId===t})}(o,t))}}(r,t),function(e,t){var r=h.fieldErrors,n=e.ipAddress,o=n.$modelValue;n.$setValidity(r.ADDRESS_IN_USE,!function(t,r){return r?_.some(h.devices,function(e){return(_.toNumber(e.id)!==r||t!==e.ipAddress)&&e.ipAddress===t}):_.some(h.devices,{ipAddress:t})}(o,t))}(r,t),function(e){var t=h.fieldErrors,r=e.port,n=r.$modelValue;r.$setValidity(t.PORT_INVALID,!_.isNaN(_.toNumber(n)))}(r)}(e)}(t),n.invalid(h,t,e)},getFieldValidationHints:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(h.mode,"DeviceForm"),r=_.get(h,"".concat(t,".").concat(e));if(r)return n.validationHints(r,h.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(h,"".concat(e,".$invalid"))||_.get(h,"newDevice.adding")},startAddingNewDevice:function(){h.newDevice={name:null,deviceType:null,address:null},L()&&(h.newDevice=_.extend(h.newDevice,{version:null,port:null,auth:{}}),h.toggle("newDevice"))},addNewDevice:function(){var t,r,n;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.mode,r=h.device,(n=h.newDevice).adding=!0,n.protocol=t,e.prev=3,x())return e.next=7,_regeneratorRuntime().awrap(i.create(r,n));e.next=9;break;case 7:e.next=32;break;case 9:if(D())return e.next=12,_regeneratorRuntime().awrap(a.create(r,n));e.next=14;break;case 12:e.next=32;break;case 14:if(N())return e.next=17,_regeneratorRuntime().awrap(c.create(r,n));e.next=19;break;case 17:e.next=32;break;case 19:if(S())return e.next=22,_regeneratorRuntime().awrap(u.create(r,n));e.next=24;break;case 22:e.next=32;break;case 24:if(I())return e.next=27,_regeneratorRuntime().awrap(s.create(r,n));e.next=29;break;case 27:e.next=32;break;case 29:if(L())return e.next=32,_regeneratorRuntime().awrap(d.create(r,n));e.next=32;break;case 32:b(),e.next=38;break;case 35:e.prev=35,e.t0=e.catch(3),w();case 38:o.$apply();case 39:case"end":return e.stop()}},null,null,[[3,35]],Promise)},clearNewDevice:E,filterByMode:function(){if(x())return function(e){var t=_.get(e,"protocol");return t===h.mode};if(I())return function(e){return e.nodeId};return function(){return!0}},snmpVersions:f,snmpAuthPrivProtocols:v,snmpAuthProtocols:p,snmpSecurityLevels:y,updateDevice:function(t){var r,n;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=h.mode,n=h.device,t.adding=!0,t.protocol=r,e.prev=3,L())return e.next=7,_regeneratorRuntime().awrap(d.update(n,t));e.next=7;break;case 7:m(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),g(t);case 13:o.$apply();case 14:case"end":return e.stop()}},null,null,[[3,10]],Promise)},startEditDevice:function(e){var t=_.cloneDeep(e);if(t.adding=!1,!_.isUndefined(t.deviceType)){var r=h.deviceConfigurationOptions;t.deviceType=_.find(r.types,function(e){return e.name===t.deviceType})}return t},isEditFormInvalid:function(e,t){return _.get(h,"".concat(e,".$invalid"))||_.get(t,"adding")},toggle:function(e){h.expandedId===e?h.expandedId="":h.expandedId=e},clearEditDevice:function(){h.expandedId=""},getSnmpVersionLabel:function(e){var t=_.find(f,{value:e});return _.get(t,"label")},getFormName:function(e){if(e){var t=e.id;return"vm.form".concat(_.toString(t))}return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8ySNMPDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,d=e.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new D(r||[]);return c(i,"_invoke",{value:function(i,a,c){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){var r=w(n,c);if(r){if(r===s)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=l(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===s)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}}(e,n,a)}),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=u;var s={};function f(){}function v(){}function p(){}var h={};i(h,o,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(N([])));m&&m!==e&&d.call(m,o)&&(h=m);var g=p.prototype=f.prototype=Object.create(h);function _(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function b(u,s){var t;c(this,"_invoke",{value:function(n,r){function e(){return new s(function(e,t){!function t(e,n,r,o){var i=l(u[e],u,n);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&d.call(c,"__await")?s.resolve(c.__await).then(function(e){t("next",e,r,o)},function(e){t("throw",e,r,o)}):s.resolve(c).then(function(e){a.value=e,r(a)},function(e){return t("throw",e,r,o)})}o(i.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function w(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),s;var o=l(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,s;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function N(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(d.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:void 0,done:!0}}return c(g,"constructor",{value:v.prototype=p,configurable:!0}),c(p,"constructor",{value:v,configurable:!0}),v.displayName=i(p,r,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,i(e,r,"GeneratorFunction")),e.prototype=Object.create(g),e},a.awrap=function(e){return{__await:e}},_(b.prototype),i(b.prototype,n,function(){return this}),a.AsyncIterator=b,a.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var i=new b(u(e,t,n,r),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},_(g),i(g,r,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(e){var n=Object(e),r=[];for(var t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=N,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=d.call(o,"catchLoc"),c=d.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&d.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,s):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},a}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function o(e){asyncGeneratorStep(r,t,n,o,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,o,i,"throw",e)}o(void 0)})}}!function(){function e(o,r,t,i,a,c,u,s,d,l,n){var e,h=this,f=d.snmpVersions,v=d.snmpAuthPrivProtocols,p=d.snmpAuthProtocols,y=d.snmpSecurityLevels;function m(){return(m=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var n,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.mode,r=h.device,t.adding=!0,t.protocol=n,e.prev=3,T())return e.next=7,d.update(r,t);e.next=7;break;case 7:g(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),b(t);case 13:o.$apply();case 14:case"end":return e.stop()}},e,null,[[3,10]])}))).apply(this,arguments)}function g(){h.expandedId="",h.reloadDevices(),t.success(n("Child device changes saved."))}function b(e){e.adding=!1,t.danger(n("Failed to change child device."))}function w(){return(w=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,n,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.mode,n=h.device,(r=h.newDevice).adding=!0,r.protocol=t,e.prev=3,N())return e.next=7,i.create(n,r);e.next=9;break;case 7:e.next=32;break;case 9:if(S())return e.next=12,a.create(n,r);e.next=14;break;case 12:e.next=32;break;case 14:if(I())return e.next=17,c.create(n,r);e.next=19;break;case 17:e.next=32;break;case 19:if(O())return e.next=22,u.create(n,r);e.next=24;break;case 22:e.next=32;break;case 24:if(L())return e.next=27,s.create(n,r);e.next=29;break;case 27:e.next=32;break;case 29:if(T())return e.next=32,d.create(n,r);e.next=32;break;case 32:E(),e.next=38;break;case 35:e.prev=35,e.t0=e.catch(3),x();case 38:o.$apply();case 39:case"end":return e.stop()}},e,null,[[3,35]])}))).apply(this,arguments)}function E(){D(),h.reloadDevices(),t.success(n("New child device added."))}function x(){h.newDevice.adding=!1,t.danger(n("Failed to add new child device."))}function D(){h.expandedId="",_.unset(h,"newDevice"),h[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function N(){return"modbus"===h.tab}function S(){return"canbus"===h.tab}function I(){return"opcua"===h.tab}function O(){return"profibus"===h.tab}function L(){return"canopen"===h.tab}function T(){return"snmp"===h.tab}_.assign(h,{$onInit:function(){e="new".concat(h.mode,"DeviceForm"),h.expandedId=""},shouldShowSection:function(){var e=h.device,t=h.mode,n=!1;N()?"TCP"===t?n=l.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===t&&(n=l.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):S()&&"CAN"===t?n=l.supportsOperation(e,"c8y_CanDevice"):O()&&"Profibus"===t?n=l.supportsOperation(e,"c8y_ProfibusDevice"):L()&&"CANopen"===t&&(n=l.supportsOperation(e,"c8y_CANopenAddDevice"));return n},isModbusTab:N,isCanBusTab:S,isOPCUATab:I,isProfibusTab:O,isCanOpenTab:L,isSNMPTab:T,invalid:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(h.mode,"DeviceForm");return function(e){var t=h.mode,n=h.fieldErrors;if("TCP"===t||"RTU"===t){var r=h[e],o=r.address;if(o){var i=o.$modelValue;if("TCP"===t){var a=r.ipAddress,c=a.$modelValue;_.isUndefined(i)||o.$setValidity(n.ADDRESS_INVALID,function(e){return e<=247||255===e}(i));var u=i&&c&&_.some(h.devices,{address:i,ipAddress:c,protocol:"TCP"});o.$setValidity(n.ADDRESSES_IN_USE,!u),a.$setValidity(n.ADDRESSES_IN_USE,!u)}else if("RTU"===t){var s=i&&_.some(h.devices,{address:i,protocol:"RTU"});o.$setValidity(n.ADDRESS_IN_USE,!s)}}}else if("CANopen"===t){var d=h[e],l=d.nodeId;if(l){var f=l.$modelValue;if(f){var v=function(e){return 1<=e&&e<=127}(f),p=function(t){return h.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===t})}(f);v?p?(l.$setValidity(n.NODE_OUT_OF_RANGE,!0),l.$setValidity(n.NODE_IN_USE,!1)):(l.$setValidity(n.NODE_OUT_OF_RANGE,!0),l.$setValidity(n.NODE_IN_USE,!0)):(l.$setValidity(n.NODE_OUT_OF_RANGE,!1),l.$setValidity(n.NODE_IN_USE,!0))}}}else"SNMP"===t&&function(e){var t,n=h[e];e&&(t=function(e){return _.toNumber(e.replace("form",""))}(e)),function(e,t){var n=h.fieldErrors;if(e.snmpVersionEngineId){var r=e.snmpVersionEngineId,o=r.$modelValue;o&&r.$setValidity(n.ENGINEID_IN_USE,!function(t,n){return n?_.some(h.devices,function(e){return(_.toNumber(e.id)!==n||t!==e.auth.engineId)&&e.engineId===t}):_.some(h.devices,function(e){return e.auth.engineId===t})}(o,t))}}(n,t),function(e,t){var n=h.fieldErrors,r=e.ipAddress,o=r.$modelValue;r.$setValidity(n.ADDRESS_IN_USE,!function(t,n){return n?_.some(h.devices,function(e){return(_.toNumber(e.id)!==n||t!==e.ipAddress)&&e.ipAddress===t}):_.some(h.devices,{ipAddress:t})}(o,t))}(n,t),function(e){var t=h.fieldErrors,n=e.port,r=n.$modelValue;n.$setValidity(t.PORT_INVALID,!_.isNaN(_.toNumber(r)))}(n)}(e)}(t),r.invalid(h,t,e)},getFieldValidationHints:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(h.mode,"DeviceForm"),n=_.get(h,"".concat(t,".").concat(e));if(n)return r.validationHints(n,h.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(h,"".concat(e,".$invalid"))||_.get(h,"newDevice.adding")},startAddingNewDevice:function(){h.newDevice={name:null,deviceType:null,address:null},T()&&(h.newDevice=_.extend(h.newDevice,{version:null,port:null,auth:{}}),h.toggle("newDevice"))},addNewDevice:function(){return w.apply(this,arguments)},clearNewDevice:D,filterByMode:function(){if(N())return function(e){var t=_.get(e,"protocol");return t===h.mode};if(L())return function(e){return e.nodeId};return function(){return!0}},snmpVersions:f,snmpAuthPrivProtocols:v,snmpAuthProtocols:p,snmpSecurityLevels:y,updateDevice:function(e){return m.apply(this,arguments)},startEditDevice:function(e){var t=_.cloneDeep(e);if(t.adding=!1,!_.isUndefined(t.deviceType)){var n=h.deviceConfigurationOptions;t.deviceType=_.find(n.types,function(e){return e.name===t.deviceType})}return t},isEditFormInvalid:function(e,t){return _.get(h,"".concat(e,".$invalid"))||_.get(t,"adding")},toggle:function(e){h.expandedId===e?h.expandedId="":h.expandedId=e},clearEditDevice:function(){h.expandedId=""},getSnmpVersionLabel:function(e){var t=_.find(f,{value:e});return _.get(t,"label")},getFormName:function(e){if(e){var t=e.id;return"vm.form".concat(_.toString(t))}return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8ySNMPDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})}();
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(e){_defineProperty(t,e,r[e])})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",n=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i,a,u,c,o=t&&t.prototype instanceof p?t:p,l=Object.create(o.prototype),s=new L(n||[]);return l._invoke=(i=e,a=r,u=s,c="suspendedStart",function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return T()}for(u.method=e,u.arg=t;;){var r=u.delegate;if(r){var n=_(r,u);if(n){if(n===y)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=f(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===y)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}),l}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=u;var y={};function p(){}function c(){}function l(){}var d={};i(d,o,function(){return this});var g=Object.getPrototypeOf,m=g&&g(g(x([])));m&&m!==e&&s.call(m,o)&&(d=m);var h=l.prototype=p.prototype=Object.create(d);function v(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function b(c,l){var t;this._invoke=function(r,n){function e(){return new l(function(e,t){!function t(e,r,n,o){var i=f(c[e],c,r);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==_typeof(u)&&s.call(u,"__await")?l.resolve(u.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):l.resolve(u).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,o)})}o(i.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return y;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,y;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,y):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return i(h,"constructor",c.prototype=l),i(l,"constructor",c),c.displayName=i(l,n,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===c||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,n,"GeneratorFunction")),e.prototype=Object.create(h),e},a.awrap=function(e){return{__await:e}},v(b.prototype),i(b.prototype,r,function(){return this}),a.AsyncIterator=b,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new b(u(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},v(h),i(h,n,"Generator"),i(h,o,function(){return this}),i(h,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=x,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),y}},a}!function(){function e(y,e,t,p,d,u){var o=e.MODBUS_DEVICE_FRAGMENT,i=e.PROFIBUS_DEVICE_FRAGMENT;return{getConfigModel:function(t){var r,n;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_.get(t,"device"))return e.next=4,_regeneratorRuntime().awrap(h(r));e.next=6;break;case 4:return n=e.sent,e.abrupt("return",a({fieldbusDevice:n,widgetConfig:t}));case 6:return e.abrupt("return",y.resolve([]));case 7:case"end":return e.stop()}},null,null,null,Promise)},updateConfigModel:function(e,t){_.set(e,"categoriesConfig",_.map(t,function(e){return{name:e.name,label:e.label,elements:_.compact(_.map(e.elements,function(e){return e.show?_.pick(e,["refId","label","type"]):void 0}))}})),_.unset(e,"coils"),_.unset(e,"registers")},getWidgetModel:function(t){var r,n,o,i,a,u,c,l,s,f;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.get(t,"device.id"),n=p.detailRealtime(r),o=n.then(v),i=g(r,t).then(function(e){return _.get(t,"categoriesConfig",e)}),e.next=6,_regeneratorRuntime().awrap(y.all({fieldbusDevice:n,deviceType:o,categoriesConfig:i}));case 6:return a=e.sent,u=a.fieldbusDevice,c=a.deviceType,l=a.categoriesConfig,s=m({fieldbusDevice:u,deviceType:c}),f=_.map(l,function(e){return _.defaults(_objectSpread({},e,{elements:_(e.elements).map(function(e){var t=d.findElementBestMatchingRefId(s,e.refId,e.type);return t?_.defaults(_objectSpread({},e,t),{label:t.name,show:!0}):e}).filter("show").value()}),{label:e.name})}),e.abrupt("return",{device:u,categories:f});case 13:case"end":return e.stop()}},null,null,null,Promise)},isAtLeastOneElementSelected:function(e){return _.some(e,function(e){return _.some(e.elements,"show")})},isDiscreteIOSelectedInConfig:window.c8y_testing&&n,isRegisterSelectedInConfig:window.c8y_testing&&r};function a(t){var r,n,o,i,a;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fieldbusDevice,n=t.widgetConfig,e.next=3,_regeneratorRuntime().awrap(v(r));case 3:if(o=e.sent,i=m({fieldbusDevice:r,deviceType:o}),_.isEmpty(i))return e.abrupt("return",[]);e.next=7;break;case 7:return a=_.groupBy(i,b),e.abrupt("return",_(n).chain().get("categoriesConfig",[]).map(function(e){var t=_.get(a,e.name);_.defaults(e,{label:e.name||u("Uncategorized")});var r=_.flow([c,l])({categoryConfigElements:e.elements,deviceType:o,elements:i,categoryElements:t,widgetConfig:n}).categoryConfigElements;return e.elements=r,e}).thru(function(e){return w({categoriesConfig:e,categories:a,deviceType:o,widgetConfig:n})}).value());case 9:case"end":return e.stop()}},null,null,null,Promise)}function c(e){var t=e.categoryConfigElements,o=e.deviceType,i=e.elements,r=e.categoryElements,n=e.widgetConfig;return{categoryConfigElements:_.map(t,function(e){var t=e.refId,r=e.type,n=d.findElementBestMatchingRefId(i,t,r);if(n)return _.defaults(e,{name:n.name,type:n.meta.type.value,typeLabel:d.getElementTypeLabel(n,o),show:!0,label:n.name})}),deviceType:o,elements:i,categoryElements:r,widgetConfig:n}}function l(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,i=e.widgetConfig;return{categoryConfigElements:[].concat(_toConsumableArray(t),_toConsumableArray(_(o).filter(function(e){return!_.find(t,{refId:d.getElementRefId(e)})}).map(function(e){return{refId:d.getElementRefId(e),label:e.name,show:s(e,i),name:e.name,type:e.meta.type.value,typeLabel:d.getElementTypeLabel(e,r)}}).value())),deviceType:r,elements:n,categoryElements:o,widgetConfig:i}}function s(e,t){return function(e){return e.meta.type===d.ElementType.REGISTER}(e)?r(e,t):n(e,t)}function r(e,t){var r=e.id,n=e.input,o=e.number,i=e.startBit,a=t.registers;return _.includes(a,r)||_.includes(a,[n,o,i].join(","))||_.includes(a,o)||!!_.find(a,{number:o,startBit:i})}function n(e,t){var r=e.id,n=e.input,o=e.number,i=t.coils;return _.includes(i,r)||_.includes(i,[n,o].join(","))||_.includes(i,o)}function g(t,r){var n,o,i,a;return _regeneratorRuntime().async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_regeneratorRuntime().awrap(h(t));case 2:return n=e.sent,e.next=5,_regeneratorRuntime().awrap(v(n));case 5:return o=e.sent,i=m({fieldbusDevice:n,deviceType:o}),a=_.groupBy(i,b),e.abrupt("return",w({categoriesConfig:[],categories:a,deviceType:o,widgetConfig:r}));case 9:case"end":return e.stop()}},null,null,null,Promise)}function m(e){var t=e.fieldbusDevice,r=e.deviceType,n=d.getElementsWithMeta(r);return _.has(t,o)||_.has(t,i)?n:_.filter(n,f)}function f(e){return e.meta.type===d.ElementType.REGISTER&&!e.input}function h(e){return d.isFieldbusDevice(e)?y.resolve(e):p.detail(t.getId(e)).then(t.getResData)}function v(e){return d.getDeviceTypeFromDevice(e)}function b(e){return _.get(e,"category","")}function w(e){var r=e.categoriesConfig,t=e.categories,n=e.deviceType,o=e.widgetConfig;return[].concat(_toConsumableArray(r),_toConsumableArray(_(t).pickBy(function(e,t){return!_.find(r,{name:t})}).map(function(e,t){return{name:t,label:t||u("Uncategorized"),elements:_.map(e,function(e){return{refId:d.getElementRefId(e),label:e.name,show:s(e,o),name:e.name,type:e.meta.type.value,typeLabel:d.getElementTypeLabel(e,n)}})}}).value()))}}e.$inject=["$q","fieldbusConstants","c8yBase","c8yDevices","c8yDeviceDatabase","gettext"],angular.module("c8y.modbusWidget4").factory("modbusWidgetSvc",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.forEach(function(e){_defineProperty(t,e,r[e])})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",n=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),a=new x(n||[]);return u(i,"_invoke",{value:function(i,a,u){var c="suspendedStart";return function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return S()}for(u.method=e,u.arg=t;;){var r=u.delegate;if(r){var n=w(r,u);if(n){if(n===l)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=f(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===l)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(e,r,a)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var l={};function p(){}function y(){}function d(){}var g={};i(g,o,function(){return this});var m=Object.getPrototypeOf,h=m&&m(m(L([])));h&&h!==e&&s.call(h,o)&&(g=h);var v=d.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function _(c,l){var t;u(this,"_invoke",{value:function(r,n){function e(){return new l(function(e,t){!function t(e,r,n,o){var i=f(c[e],c,r);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==_typeof(u)&&s.call(u,"__await")?l.resolve(u.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):l.resolve(u).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,o)})}o(i.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var o=f(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,l;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return u(v,"constructor",{value:y.prototype=d,configurable:!0}),u(d,"constructor",{value:y,configurable:!0}),y.displayName=i(d,n,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,n,"GeneratorFunction")),e.prototype=Object.create(v),e},a.awrap=function(e){return{__await:e}},b(_.prototype),i(_.prototype,r,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new _(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},b(v),i(v,n,"Generator"),i(v,o,function(){return this}),i(v,"toString",function(){return"[object Generator]"}),a.keys=function(e){var r=Object(e),n=[];for(var t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},a}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(u){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=u.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}!function(){function e(p,e,t,y,d,u){var o=e.MODBUS_DEVICE_FRAGMENT,i=e.PROFIBUS_DEVICE_FRAGMENT;return{getConfigModel:function(e){return r.apply(this,arguments)},updateConfigModel:function(e,t){_.set(e,"categoriesConfig",_.map(t,function(e){return{name:e.name,label:e.label,elements:_.compact(_.map(e.elements,function(e){return e.show?_.pick(e,["refId","label","type"]):void 0}))}})),_.unset(e,"coils"),_.unset(e,"registers")},getWidgetModel:function(e){return m.apply(this,arguments)},isAtLeastOneElementSelected:function(e){return _.some(e,function(e){return _.some(e.elements,"show")})},isDiscreteIOSelectedInConfig:window.c8y_testing&&g,isRegisterSelectedInConfig:window.c8y_testing&&f};function r(){return(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_.get(t,"device"))return e.next=4,E(r);e.next=6;break;case 4:return n=e.sent,e.abrupt("return",a({fieldbusDevice:n,widgetConfig:t}));case 6:return e.abrupt("return",p.resolve([]));case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function a(e){return n.apply(this,arguments)}function n(){return(n=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o,i,a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fieldbusDevice,n=t.widgetConfig,e.next=3,T(r);case 3:if(o=e.sent,i=b({fieldbusDevice:r,deviceType:o}),_.isEmpty(i))return e.abrupt("return",[]);e.next=7;break;case 7:return a=_.groupBy(i,x),e.abrupt("return",_(n).chain().get("categoriesConfig",[]).map(function(e){var t=_.get(a,e.name);_.defaults(e,{label:e.name||u("Uncategorized")});var r=_.flow([c,l])({categoryConfigElements:e.elements,deviceType:o,elements:i,categoryElements:t,widgetConfig:n}).categoryConfigElements;return e.elements=r,e}).thru(function(e){return L({categoriesConfig:e,categories:a,deviceType:o,widgetConfig:n})}).value());case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function c(e){var t=e.categoryConfigElements,o=e.deviceType,i=e.elements,r=e.categoryElements,n=e.widgetConfig;return{categoryConfigElements:_.map(t,function(e){var t=e.refId,r=e.type,n=d.findElementBestMatchingRefId(i,t,r);if(n)return _.defaults(e,{name:n.name,type:n.meta.type.value,typeLabel:d.getElementTypeLabel(n,o),show:!0,label:n.name})}),deviceType:o,elements:i,categoryElements:r,widgetConfig:n}}function l(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,i=e.widgetConfig;return{categoryConfigElements:[].concat(_toConsumableArray(t),_toConsumableArray(_(o).filter(function(e){return!_.find(t,{refId:d.getElementRefId(e)})}).map(function(e){return{refId:d.getElementRefId(e),label:e.name,show:s(e,i),name:e.name,type:e.meta.type.value,typeLabel:d.getElementTypeLabel(e,r)}}).value())),deviceType:r,elements:n,categoryElements:o,widgetConfig:i}}function s(e,t){return function(e){return e.meta.type===d.ElementType.REGISTER}(e)?f(e,t):g(e,t)}function f(e,t){var r=e.id,n=e.input,o=e.number,i=e.startBit,a=t.registers;return _.includes(a,r)||_.includes(a,[n,o,i].join(","))||_.includes(a,o)||!!_.find(a,{number:o,startBit:i})}function g(e,t){var r=e.id,n=e.input,o=e.number,i=t.coils;return _.includes(i,r)||_.includes(i,[n,o].join(","))||_.includes(i,o)}function m(){return(m=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o,i,a,u,c,l,s,f;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.get(t,"device.id"),n=y.detailRealtime(r),o=n.then(T),i=h(r,t).then(function(e){return _.get(t,"categoriesConfig",e)}),e.next=6,p.all({fieldbusDevice:n,deviceType:o,categoriesConfig:i});case 6:return a=e.sent,u=a.fieldbusDevice,c=a.deviceType,l=a.categoriesConfig,s=b({fieldbusDevice:u,deviceType:c}),f=_.map(l,function(e){return _.defaults(_objectSpread({},e,{elements:_(e.elements).map(function(e){var t=d.findElementBestMatchingRefId(s,e.refId,e.type);return t?_.defaults(_objectSpread({},e,t),{label:t.name,show:!0}):e}).filter("show").value()}),{label:e.name})}),e.abrupt("return",{device:u,categories:f});case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(e,t){return v.apply(this,arguments)}function v(){return(v=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var n,o,i,a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E(t);case 2:return n=e.sent,e.next=5,T(n);case 5:return o=e.sent,i=b({fieldbusDevice:n,deviceType:o}),a=_.groupBy(i,x),e.abrupt("return",L({categoriesConfig:[],categories:a,deviceType:o,widgetConfig:r}));case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function b(e){var t=e.fieldbusDevice,r=e.deviceType,n=d.getElementsWithMeta(r);return _.has(t,o)||_.has(t,i)?n:_.filter(n,w)}function w(e){return e.meta.type===d.ElementType.REGISTER&&!e.input}function E(e){return d.isFieldbusDevice(e)?p.resolve(e):y.detail(t.getId(e)).then(t.getResData)}function T(e){return d.getDeviceTypeFromDevice(e)}function x(e){return _.get(e,"category","")}function L(e){var r=e.categoriesConfig,t=e.categories,n=e.deviceType,o=e.widgetConfig;return[].concat(_toConsumableArray(r),_toConsumableArray(_(t).pickBy(function(e,t){return!_.find(r,{name:t})}).map(function(e,t){return{name:t,label:t||u("Uncategorized"),elements:_.map(e,function(e){return{refId:d.getElementRefId(e),label:e.name,show:s(e,o),name:e.name,type:e.meta.type.value,typeLabel:d.getElementTypeLabel(e,n)}})}}).value()))}}e.$inject=["$q","fieldbusConstants","c8yBase","c8yDevices","c8yDeviceDatabase","gettext"],angular.module("c8y.modbusWidget4").factory("modbusWidgetSvc",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i,a,c,u,o=e&&e.prototype instanceof p?e:p,f=Object.create(o.prototype),l=new _(n||[]);return f._invoke=(i=t,a=r,c=l,u="suspendedStart",function(t,e){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===t)throw e;return S()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r){var n=b(r,c);if(n){if(n===h)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=s(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===h)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}),f}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h={};function p(){}function u(){}function f(){}var d={};i(d,o,function(){return this});var y=Object.getPrototypeOf,g=y&&y(y(E([])));g&&g!==t&&l.call(g,o)&&(d=g);var v=f.prototype=p.prototype=Object.create(d);function m(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(u,f){var e;this._invoke=function(r,n){function t(){return new f(function(t,e){!function e(t,r,n,o){var i=s(u[t],u,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&l.call(c,"__await")?f.resolve(c.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):f.resolve(c).then(function(t){a.value=t,n(a)},function(t){return e("throw",t,n,o)})}o(i.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(l.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return i(v,"constructor",u.prototype=f),i(f,"constructor",u),u.displayName=i(f,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,i(t,n,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},m(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},m(v),i(v,n,"Generator"),i(v,o,function(){return this}),i(v,"toString",function(){return"[object Generator]"}),a.keys=function(r){var n=[];for(var t in r)n.push(t);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=E,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),c=l.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},a}!function(){function t(e,r){var t,n,o=this;_.assign(o,{$doCheck:function(){_.isEqual(t,o.config.device)||(t=o.config.device,_regeneratorRuntime().async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_regeneratorRuntime().awrap(r.getConfigModel(o.config));case 2:o.categoriesConfig=t.sent,e.$apply();case 4:case"end":return t.stop()}},null,null,null,Promise));_.isEqual(n,o.categoriesConfig)||(n=_.cloneDeep(o.categoriesConfig),function(){if(n){var t=r.isAtLeastOneElementSelected(n);return o.modbusWidgetConfigForm.modbusWidgetValidation.$setValidity("at-least-one-field-selected",t),o.atLeastOneElementSelected=t}return!1}()&&r.updateConfigModel(o.config,n))}})}t.$inject=["$rootScope","modbusWidgetSvc"],angular.module("c8y.modbusWidget4").component("c8yModbusWidgetConfig",{templateUrl:":::PLUGIN_PATH:::/widget-config.html",bindings:{config:"<"},controllerAs:"vm",controller:t})}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new E(n||[]);return c(i,"_invoke",{value:function(i,a,c){var u="suspendedStart";return function(t,e){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===t)throw e;return O()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r){var n=L(r,c);if(n){if(n===f)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===u)throw u="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u="executing";var o=s(i,a,c);if("normal"===o.type){if(u=c.done?"completed":"suspendedYield",o.arg===f)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u="completed",c.method="throw",c.arg=o.arg)}}}(t,r,a)}),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var f={};function h(){}function p(){}function y(){}var d={};i(d,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(S([])));g&&g!==t&&l.call(g,o)&&(d=g);var m=y.prototype=h.prototype=Object.create(d);function w(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function b(u,f){var e;c(this,"_invoke",{value:function(r,n){function t(){return new f(function(t,e){!function e(t,r,n,o){var i=s(u[t],u,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==_typeof(c)&&l.call(c,"__await")?f.resolve(c.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):f.resolve(c).then(function(t){a.value=t,n(a)},function(t){return e("throw",t,n,o)})}o(i.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function L(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(l.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return c(m,"constructor",{value:p.prototype=y,configurable:!0}),c(y,"constructor",{value:p,configurable:!0}),p.displayName=i(y,n,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,i(t,n,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},w(b.prototype),i(b.prototype,r,function(){return this}),a.AsyncIterator=b,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new b(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},w(m),i(m,n,"Generator"),i(m,o,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),a.keys=function(t){var r=Object(t),n=[];for(var e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),c=l.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(e,r){var t,n,o=this;function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.getConfigModel(o.config);case 2:o.categoriesConfig=t.sent,e.$apply();case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}_.assign(o,{$doCheck:function(){_.isEqual(t,o.config.device)||(t=o.config.device,function(){i.apply(this,arguments)}());_.isEqual(n,o.categoriesConfig)||(n=_.cloneDeep(o.categoriesConfig),function(){if(n){var t=r.isAtLeastOneElementSelected(n);return o.modbusWidgetConfigForm.modbusWidgetValidation.$setValidity("at-least-one-field-selected",t),o.atLeastOneElementSelected=t}return!1}()&&r.updateConfigModel(o.config,n))}})}t.$inject=["$rootScope","modbusWidgetSvc"],angular.module("c8y.modbusWidget4").component("c8yModbusWidgetConfig",{templateUrl:":::PLUGIN_PATH:::/widget-config.html",bindings:{config:"<"},controllerAs:"vm",controller:t})}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,s=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof p?e:p,l=Object.create(o.prototype),s=new x(r||[]);return l._invoke=(i=t,a=n,u=s,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return S()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=E(n,u);if(r){if(r===h)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=f(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===h)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}),l}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var h={};function p(){}function c(){}function l(){}var d={};i(d,o,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(L([])));y&&y!==t&&s.call(y,o)&&(d=y);var v=l.prototype=p.prototype=Object.create(d);function g(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(c,l){var e;this._invoke=function(n,r){function t(){return new l(function(t,e){!function e(t,n,r,o){var i=f(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==_typeof(u)&&s.call(u,"__await")?l.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):l.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:S}}function S(){return{value:void 0,done:!0}}return i(v,"constructor",c.prototype=l),i(l,"constructor",c),c.displayName=i(l,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,i(t,r,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(w.prototype),i(w.prototype,n,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new w(u(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),i(v,r,"Generator"),i(v,o,function(){return this}),i(v,"toString",function(){return"[object Generator]"}),a.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=L,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},a}!function(){function t(r,e,t,o,n,i,a,u,c,l,s){var f,h,p=this,d=t.PROFIBUS_DEVICE_FRAGMENT,m=t.CANOPEN_DEVICE_FRAGMENT,y=i.isElementChangePending,v=i.canUpdateElement,g=i.getCurrentElementValue,w=l("Value out of range. Allowed values from {{min | number}} to {{max | number}}."),E=[];function b(t){e(x,t)}function x(){_.forEach(p.categories,function(t){_.forEach(t.elements,function(t){(function(t){return p.isElementChangePending(t)||_.includes(E,t)})(t)||(t.meta.type===n.ElementType.DISCRETE_IO&&(t.valueObj=_.find(t.meta.enumValues,{value:g(p.device,t)})),t.meta.type===n.ElementType.REGISTER&&(t.meta.enumType?t.valueObj=_.find(t.meta.enumValues,{value:g(p.device,t)}):_.set(t,"valueObj.value",g(p.device,t))))})})}_.assign(p,{$onChanges:function(t){t.config&&function(e){var n;_regeneratorRuntime().async(function(t){for(;;)switch(t.prev=t.next){case 0:if(e)return t.next=3,_regeneratorRuntime().awrap(c.getWidgetModel(e));t.next=6;break;case 3:n=t.sent,_.assign(p,n),r.$apply();case 6:case"end":return t.stop()}},null,null,null,Promise)}(p.config)},$doCheck:function(){var t=!1;_.isEqual(f,p.categories)||(f=_.cloneDeep(p.categories),t=!0);_.isEqual(h,p.device)||(h=_.cloneDeep(p.device),t=!0);t&&b()},isElementChangePending:y,canUpdateElement:v,updateElement:function(t,e,n){var r=i.updateElement;_.has(t,d)?r=a.updateElement:_.has(t,m)&&(r=u.updateElement);return r(t,e,n).then(function(){E=_.without(E,e),b(500)})},shouldShowSwitch:function(t){return t.meta.enumType&&t.meta.enumValues&&2===t.meta.enumValues.length},shouldShowEnumSelect:function(t){return t.meta.enumType&&t.meta.enumValues&&(1===t.meta.enumValues.length||2<t.meta.enumValues.length)},shouldShowNumberInput:function(t){return!t.meta.enumType},validationHints:function(t,e){var n=[];e.meta.valuesRange.possiblePrecisionLoss&&n.push(s.getString("Precision loss may occur, check Cloud Fieldbus specification for details."));if(p.canUpdateElement(p.device,e)){var r=_.get(e,"meta.valuesRange.custom");n.push(o.validationHints(t,{required:l("This field is required."),"value-in-register-range":s.getString(w,r)}))}return n.join(" ")},focus:function(t){E.push(t)},blur:_.debounce(function(t){E=_.without(E,t),b(500)},500)})}t.$inject=["$rootScope","$timeout","fieldbusConstants","c8yBase","c8yDeviceDatabase","c8yModbusDevice","c8yProfibusDevice","c8yCanopenDevice","modbusWidgetSvc","gettext","gettextCatalog"],angular.module("c8y.modbusWidget4").component("c8yModbusWidget",{templateUrl:":::PLUGIN_PATH:::/widget.html",bindings:{config:"<"},controllerAs:"vm",controller:t})}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},t=Object.prototype,s=t.hasOwnProperty,u=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new L(r||[]);return u(i,"_invoke",{value:function(i,a,u){var c="suspendedStart";return function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return O()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=E(n,u);if(r){if(r===l)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if("suspendedStart"===c)throw c="completed",u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c="executing";var o=f(i,a,u);if("normal"===o.type){if(c=u.done?"completed":"suspendedYield",o.arg===l)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c="completed",u.method="throw",u.arg=o.arg)}}}(t,n,a)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var l={};function h(){}function p(){}function d(){}var v={};i(v,o,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==t&&s.call(m,o)&&(v=m);var g=d.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function b(c,l){var e;u(this,"_invoke",{value:function(n,r){function t(){return new l(function(t,e){!function e(t,n,r,o){var i=f(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==_typeof(u)&&s.call(u,"__await")?l.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):l.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,l;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return u(g,"constructor",{value:p.prototype=d,configurable:!0}),u(d,"constructor",{value:p,configurable:!0}),p.displayName=i(d,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,i(t,r,"GeneratorFunction")),t.prototype=Object.create(g),t},a.awrap=function(t){return{__await:t}},w(b.prototype),i(b.prototype,n,function(){return this}),a.AsyncIterator=b,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new b(c(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},w(g),i(g,r,"Generator"),i(g,o,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},a}function asyncGeneratorStep(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function _asyncToGenerator(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){asyncGeneratorStep(r,e,n,o,i,"next",t)}function i(t){asyncGeneratorStep(r,e,n,o,i,"throw",t)}o(void 0)})}}!function(){function t(r,e,t,o,n,i,a,u,c,l,s){var f,h,p=this,d=t.PROFIBUS_DEVICE_FRAGMENT,v=t.CANOPEN_DEVICE_FRAGMENT,y=i.isElementChangePending,m=i.canUpdateElement,g=i.getCurrentElementValue,w=l("Value out of range. Allowed values from {{min | number}} to {{max | number}}."),b=[];function E(){return(E=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e)return t.next=3,c.getWidgetModel(e);t.next=6;break;case 3:n=t.sent,_.assign(p,n),r.$apply();case 6:case"end":return t.stop()}},t)}))).apply(this,arguments)}function x(t){e(L,t)}function L(){_.forEach(p.categories,function(t){_.forEach(t.elements,function(t){(function(t){return p.isElementChangePending(t)||_.includes(b,t)})(t)||(t.meta.type===n.ElementType.DISCRETE_IO&&(t.valueObj=_.find(t.meta.enumValues,{value:g(p.device,t)})),t.meta.type===n.ElementType.REGISTER&&(t.meta.enumType?t.valueObj=_.find(t.meta.enumValues,{value:g(p.device,t)}):_.set(t,"valueObj.value",g(p.device,t))))})})}_.assign(p,{$onChanges:function(t){t.config&&function(t){E.apply(this,arguments)}(p.config)},$doCheck:function(){var t=!1;_.isEqual(f,p.categories)||(f=_.cloneDeep(p.categories),t=!0);_.isEqual(h,p.device)||(h=_.cloneDeep(p.device),t=!0);t&&x()},isElementChangePending:y,canUpdateElement:m,updateElement:function(t,e,n){var r=i.updateElement;_.has(t,d)?r=a.updateElement:_.has(t,v)&&(r=u.updateElement);return r(t,e,n).then(function(){b=_.without(b,e),x(500)})},shouldShowSwitch:function(t){return t.meta.enumType&&t.meta.enumValues&&2===t.meta.enumValues.length},shouldShowEnumSelect:function(t){return t.meta.enumType&&t.meta.enumValues&&(1===t.meta.enumValues.length||2<t.meta.enumValues.length)},shouldShowNumberInput:function(t){return!t.meta.enumType},validationHints:function(t,e){var n=[];e.meta.valuesRange.possiblePrecisionLoss&&n.push(s.getString("Precision loss may occur, check Cloud Fieldbus specification for details."));if(p.canUpdateElement(p.device,e)){var r=_.get(e,"meta.valuesRange.custom");n.push(o.validationHints(t,{required:l("This field is required."),"value-in-register-range":s.getString(w,r)}))}return n.join(" ")},focus:function(t){b.push(t)},blur:_.debounce(function(t){b=_.without(b,t),x(500)},500)})}t.$inject=["$rootScope","$timeout","fieldbusConstants","c8yBase","c8yDeviceDatabase","c8yModbusDevice","c8yProfibusDevice","c8yCanopenDevice","modbusWidgetSvc","gettext","gettextCatalog"],angular.module("c8y.modbusWidget4").component("c8yModbusWidget",{templateUrl:":::PLUGIN_PATH:::/widget.html",bindings:{config:"<"},controllerAs:"vm",controller:t})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1017.45.0",
3
+ "version": "1017.47.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "jest-junit": "14.0.0",
56
- "fs-extra": "^7.0.0",
56
+ "fs-extra": "^11.1.0",
57
57
  "npm-packlist": "1.1.11",
58
58
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
59
59
  "uglify-js": "3.5.3"
@@ -1 +1 @@
1
- "use strict";function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(){function e(n,a,e,i,r,o,c,s,l,u,d,t){var p="service/remoteaccess",f="127.0.0.1",v=":::PLUGIN_PATH:::/clients/terminal/index.html",y="top=30,left=30,height=933,width=1350,location=no,menubar=no,toolbar=no,status=no,resizable=no",S=i.url("".concat(p,"/keypair/generate")),m={http:"ws:",https:"wss:"}[e.protocol()]||"ws:",h="wss:"===m,g="XSRF-TOKEN",P={category:"remoteaccess",key:"pass-through.enabled"},b=i.createEnum([{name:"NONE",value:"NONE",label:u("No password")},{name:"USER_PASS",value:"USER_PASS",label:u("Username and password")},{name:"PASS_ONLY",value:"PASS_ONLY",label:u("Password only")},{name:"KEY_PAIR",value:"KEY_PAIR",label:u("Public/private keys")},{name:"CERTIFICATE",value:"CERTIFICATE",label:u("Certificate")}]),w=[{name:"VNC",value:"VNC",label:u("VNC"),supportedCredentialsTypes:[b.NONE,b.PASS_ONLY],defaults:{host:f,port:5900},clientWindowPath:":::PLUGIN_PATH:::/clients/vnc/vncClient.html",clientWindowParams:"top=0,left=0,location=no,menubar=no,toolbar=no,status=no,resizable=yes",extraConnectionParams:{encrypt:h,true_color:!0,local_cursor:!1,viewport:!0,shared:!0,view_only:!1,disconnectTimeout:10,repeaterID:"",port:443,password:""}},{name:"TELNET",value:"TELNET",label:u("Telnet"),supportedCredentialsTypes:[b.NONE],defaults:{host:f,port:23},clientWindowPath:v,clientWindowParams:y},{name:"SSH",value:"SSH",label:u("SSH"),supportedCredentialsTypes:[b.USER_PASS,b.KEY_PAIR,b.CERTIFICATE],defaults:{host:f,port:22},clientWindowPath:v,clientWindowParams:y},{name:"PASSTHROUGH",value:"PASSTHROUGH",label:u("PASSTHROUGH"),supportedCredentialsTypes:[],defaults:{host:f,port:22},isConnectDissalowed:!0,tooltipConnectDissalowed:u("PASSTHROUGH protocol configuration should be used with native client only."),showIf:function(){return t.getSystemOptionValue(P)}}];return{DEFAULT_HOST:f,getProtocols:function(){return n.all(_.map(w,function(e){return s.configureVisibility(e,"visible")})).then(function(e){return _.filter(e,"visible")})},CREDENTIALS_TYPES:b,save:function(t,n){try{return function(e,t){var n=_.includes([b.USER_PASS.value,b.PASS_ONLY.value],t.credentialsType),r=_.includes([b.KEY_PAIR.value],t.credentialsType);_.defaults(t,{password:n?_.get(t,"credentials.password"):void 0,privateKey:r?_.get(t,"credentials.privateKey"):void 0}),_.unset(t,"credentials"),_.unset(t,"attrs");var o=T(e,t);return a.put(o,t).then(i.getResData)}(t,n)}catch(e){return function(e,t){var n=E(e);return a.post(n,t).then(i.getResData)}(t,n)}},list:function(e){var t=E(e);return a.get(t).then(i.getResData)},detail:function(e,t){var n=T(e,t);return a.get(n).then(i.getResData)},remove:function(e,t){var n=T(e,t);return a.delete(n)},getConnectionParams:function(e,t){return n.all({title:d.getString("Connected to: {{name}}",t),protocol:_.find(w,{value:t.protocol}),host:c.current().then(function(e){return e.domainName}),path:function(t,n){return o.current().then(function(e){return function(e){var t="service/remoteaccess/client/".concat(e.deviceId,"/configurations/").concat(e.configurationId,"?token=").concat(e.token),n=s.getCookieValue(g);if(n){var r=encodeURIComponent(n);t="".concat(t,"&").concat(g,"=").concat(r)}return t}({deviceId:i.getId(t),configurationId:n.id,token:r.encodeToken(e.userName,r.getPassword(),e.tenant)})})}(e,t),wsProtocol:m}).then(function(e){return _objectSpread({},e,e.protocol.extraConnectionParams)})},isMicroServiceAvailable:function(t){return l.isAvailable({name:"cloud-remote-access",type:"MICROSERVICE"}).then(function(e){return e?a.head(E(t),{silentError:!0}).then(_.constant(!0),_.constant(!1)):n.resolve(e)})},parseSshKeyFile:function(r){return n(function(n,e){var t=new FileReader;t.onload=function(e){var t=e.target;return n(t.result)},t.onerror=function(){return e({feedback:{type:"error",summary:u("Could not read file.")}})},t.readAsText(r)})},generateKeys:function(e){return a.post(S,{hostname:e}).then(i.getResData)},exportSshKey:function(e){var t=new Blob([e],{type:"text/plain"});window.saveAs(t,"key.pub")}};function E(e){var t=[p,"devices",i.getId(e),"configurations"].join("/");return i.url(t)}function T(e,t){return[E(e),i.getId(t)].join("/")}}e.$inject=["$q","$http","$location","c8yBase","c8yAuth","c8yUser","c8yTenant","c8yUiUtil","c8yApplication","gettext","gettextCatalog","c8ySettings"],angular.module("c8y.remoteAccess").factory("c8yRemoteAccess",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),o.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var o=n.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(n,a,e,i,o,r,c,l,u,s,p,t){var f="service/remoteaccess",d="127.0.0.1",y=":::PLUGIN_PATH:::/clients/terminal/index.html",v="top=30,left=30,height=933,width=1350,location=no,menubar=no,toolbar=no,status=no,resizable=no",m=i.url("".concat(f,"/keypair/generate")),S={http:"ws:",https:"wss:"}[e.protocol()]||"ws:",b="wss:"===S,P="XSRF-TOKEN",g={category:"remoteaccess",key:"pass-through.enabled"},h=i.createEnum([{name:"NONE",value:"NONE",label:s("No password")},{name:"USER_PASS",value:"USER_PASS",label:s("Username and password")},{name:"PASS_ONLY",value:"PASS_ONLY",label:s("Password only")},{name:"KEY_PAIR",value:"KEY_PAIR",label:s("Public/private keys")},{name:"CERTIFICATE",value:"CERTIFICATE",label:s("Certificate")}]),w=[{name:"VNC",value:"VNC",label:s("VNC"),supportedCredentialsTypes:[h.NONE,h.PASS_ONLY],defaults:{host:d,port:5900},clientWindowPath:":::PLUGIN_PATH:::/clients/vnc/vncClient.html",clientWindowParams:"top=0,left=0,location=no,menubar=no,toolbar=no,status=no,resizable=yes",extraConnectionParams:{encrypt:b,true_color:!0,local_cursor:!1,viewport:!0,shared:!0,view_only:!1,disconnectTimeout:10,repeaterID:"",port:443,password:""}},{name:"TELNET",value:"TELNET",label:s("Telnet"),supportedCredentialsTypes:[h.NONE],defaults:{host:d,port:23},clientWindowPath:y,clientWindowParams:v},{name:"SSH",value:"SSH",label:s("SSH"),supportedCredentialsTypes:[h.USER_PASS,h.KEY_PAIR,h.CERTIFICATE],defaults:{host:d,port:22},clientWindowPath:y,clientWindowParams:v},{name:"PASSTHROUGH",value:"PASSTHROUGH",label:s("PASSTHROUGH"),supportedCredentialsTypes:[],defaults:{host:d,port:22},isConnectDissalowed:!0,tooltipConnectDissalowed:s("PASSTHROUGH protocol configuration should be used with native client only."),showIf:function(){return t.getSystemOptionValue(g)}}];return{DEFAULT_HOST:d,getProtocols:function(){return n.all(_.map(w,function(e){return l.configureVisibility(e,"visible")})).then(function(e){return _.filter(e,"visible")})},CREDENTIALS_TYPES:h,save:function(t,n){try{return function(e,t){var n=_.includes([h.USER_PASS.value,h.PASS_ONLY.value],t.credentialsType),o=_.includes([h.KEY_PAIR.value],t.credentialsType);_.defaults(t,{password:n?_.get(t,"credentials.password"):void 0,privateKey:o?_.get(t,"credentials.privateKey"):void 0}),_.unset(t,"credentials"),_.unset(t,"attrs");var r=T(e,t);return a.put(r,t).then(i.getResData)}(t,n)}catch(e){return function(e,t){var n=E(e);return a.post(n,t).then(i.getResData)}(t,n)}},list:function(e){var t=E(e);return a.get(t).then(i.getResData)},detail:function(e,t){var n=T(e,t);return a.get(n).then(i.getResData)},remove:function(e,t){var n=T(e,t);return a.delete(n)},getConnectionParams:function(e,t){return n.all({title:p.getString("Connected to: {{name}}",t),protocol:_.find(w,{value:t.protocol}),host:c.current().then(function(e){return e.domainName}),path:function(t,n){return r.current().then(function(e){return function(e){var t="service/remoteaccess/client/".concat(e.deviceId,"/configurations/").concat(e.configurationId,"?token=").concat(e.token),n=l.getCookieValue(P);if(n){var o=encodeURIComponent(n);t="".concat(t,"&").concat(P,"=").concat(o)}return t}({deviceId:i.getId(t),configurationId:n.id,token:o.encodeToken(e.userName,o.getPassword(),e.tenant)})})}(e,t),wsProtocol:S}).then(function(e){return _objectSpread({},e,e.protocol.extraConnectionParams)})},isMicroServiceAvailable:function(t){return u.isAvailable({name:"cloud-remote-access",type:"MICROSERVICE"}).then(function(e){return e?a.head(E(t),{silentError:!0}).then(_.constant(!0),_.constant(!1)):n.resolve(e)})},parseSshKeyFile:function(o){return n(function(n,e){var t=new FileReader;t.onload=function(e){var t=e.target;return n(t.result)},t.onerror=function(){return e({feedback:{type:"error",summary:s("Could not read file.")}})},t.readAsText(o)})},generateKeys:function(e){return a.post(m,{hostname:e}).then(i.getResData)},exportSshKey:function(e){var t=new Blob([e],{type:"text/plain"});window.saveAs(t,"key.pub")}};function E(e){var t=[f,"devices",i.getId(e),"configurations"].join("/");return i.url(t)}function T(e,t){return[E(e),i.getId(t)].join("/")}}e.$inject=["$q","$http","$location","c8yBase","c8yAuth","c8yUser","c8yTenant","c8yUiUtil","c8yApplication","gettext","gettextCatalog","c8ySettings"],angular.module("c8y.remoteAccess").factory("c8yRemoteAccess",e)}();
@@ -1 +1 @@
1
- "use strict";function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(){function e(e,n,t,r){var o=this,c=[{name:"hostkeyAutosave",option:{category:"remoteaccess",key:"hostkey-autosave"},defaultValue:!1}];function u(e){return n.updateOption(_objectSpread({},e.option,{value:_.get(o,e.name,e.defaultValue)}))}_.assign(o,{$onInit:function(){e.all(_.map(c,function(e){return function(t){return n.detailValue(t.option,t.defaultValue).then(function(e){return _.set(o,t.name,e)})}(e)}))},updateSetting:u,updateSettings:function(){return e.all(_.map(c,function(e){return u(e)})).then(function(){return t.success(r("Settings saved."))}).catch(function(){return t.danger(r("Settings could not be saved."))})}})}e.$inject=["$q","c8ySettings","c8yAlert","gettext"],angular.module("c8y.remoteAccess").component("c8yRemoteAccessSettings",{templateUrl:":::PLUGIN_PATH:::/remoteAccessSettings/remoteAccessSettings.html",controller:e,controllerAs:"vm"})}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),r.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var r=n.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t,n,e,r){var o=this,i=[{name:"hostkeyAutosave",option:{category:"remoteaccess",key:"hostkey-autosave"},defaultValue:!1}];function u(t){return n.updateOption(_objectSpread({},t.option,{value:_.get(o,t.name,t.defaultValue)}))}_.assign(o,{$onInit:function(){t.all(_.map(i,function(t){return function(e){return n.detailValue(e.option,e.defaultValue).then(function(t){return _.set(o,e.name,t)})}(t)}))},updateSetting:u,updateSettings:function(){return t.all(_.map(i,function(t){return u(t)})).then(function(){return e.success(r("Settings saved."))}).catch(function(){return e.danger(r("Settings could not be saved."))})}})}t.$inject=["$q","c8ySettings","c8yAlert","gettext"],angular.module("c8y.remoteAccess").component("c8yRemoteAccessSettings",{templateUrl:":::PLUGIN_PATH:::/remoteAccessSettings/remoteAccessSettings.html",controller:t,controllerAs:"vm"})}();
@@ -1 +1 @@
1
- "use strict";function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,i=[],o=!0,c=!1;try{for(t=t.call(e);!(o=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(c)throw a}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,a,t){var i,o,c=this,l=r.THREE;_.assign(c,{$onChanges:function(e){var r=e.rotate&&e.rotate.currentValue;r&&function(e){var t=s;_.isUndefined(t&&e)||_.forIn(e,function(e,r){!function(e,r,t){e.rotation[r]=t}(t,r,e)})}(r);(e.objectModel||e.isWireframe||e.cameraType)&&(i&&_.forEach(i.children,function(e){i.remove(e)}),function(){i=new l.Scene,o=window.WebGLRenderingContext?new l.WebGLRenderer({canvas:d,alpha:!0}):new l.CanvasRenderer;var e=new l.AmbientLight(16777215,.5),r=new l.DirectionalLight(16777215),t=new l.DirectionalLight(16777215);switch(c.cameraType){case"OC":u=new l.OrthographicCamera(-15,15,15,-15,1,1e3);break;case"PC":default:u=new l.PerspectiveCamera(30,d.clientWidth/d.clientHeight,.1,1e3)}r.position.set(20,25,30),t.position.set(-20,-25,-30),i.add(r),i.add(t),i.add(e),u.rotateX(Math.PI/2),u.rotateY(Math.PI/2),u.position.z=23,u.position.x=14,u.position.y=7,i.add(u),a.load(c.objectModel).then(function(e){_.forEach(e.children,function(e){e.material&&!_.isUndefined(e.material.wireframe)&&(e.material.wireframe=c.isWireframe)}),s=e,i.add(s)});var n=new l.OrbitControls(u,o.domElement);n.enableDamping=!0,n.dampingFactor=.25,n.rotateSpeed=.35,o.setClearColor(16777215,0)}(),n.runOutsideAngular(function(){f()}))}});var u,s,n,d=_slicedToArray(e.find("canvas"),1)[0];function f(){!function(){var e=d.clientWidth,r=d.clientHeight;d.width===e&&d.height===r||o.setSize(e,r,!1)}(),o.render(i,u),requestAnimationFrame(f)}n=t.has("ngZone")?t.get("ngZone"):{runOutsideAngular:function(e){return e()}}}e.$inject=["$element","$window","c8yWebSceneLoader","$injector"],angular.module("c8y.rotation3d").component("c8yWebScene",{template:'<canvas style="width:100%;"></canvas>',bindings:{rotate:"<",objectModel:"<",isWireframe:"<",cameraType:"<"},controller:e,controllerAs:"vm"})}();
1
+ "use strict";function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,i,o,c=[],l=!0,u=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(c.push(n.value),c.length!==r);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,a,t){var i,o,c=this,l=r.THREE;_.assign(c,{$onChanges:function(e){var r=e.rotate&&e.rotate.currentValue;r&&function(e){var t=s;_.isUndefined(t&&e)||_.forIn(e,function(e,r){!function(e,r,t){e.rotation[r]=t}(t,r,e)})}(r);(e.objectModel||e.isWireframe||e.cameraType)&&(i&&_.forEach(i.children,function(e){i.remove(e)}),function(){i=new l.Scene,o=window.WebGLRenderingContext?new l.WebGLRenderer({canvas:d,alpha:!0}):new l.CanvasRenderer;var e=new l.AmbientLight(16777215,.5),r=new l.DirectionalLight(16777215),t=new l.DirectionalLight(16777215);switch(c.cameraType){case"OC":u=new l.OrthographicCamera(-15,15,15,-15,1,1e3);break;case"PC":default:u=new l.PerspectiveCamera(30,d.clientWidth/d.clientHeight,.1,1e3)}r.position.set(20,25,30),t.position.set(-20,-25,-30),i.add(r),i.add(t),i.add(e),u.rotateX(Math.PI/2),u.rotateY(Math.PI/2),u.position.z=23,u.position.x=14,u.position.y=7,i.add(u),a.load(c.objectModel).then(function(e){_.forEach(e.children,function(e){e.material&&!_.isUndefined(e.material.wireframe)&&(e.material.wireframe=c.isWireframe)}),s=e,i.add(s)});var n=new l.OrbitControls(u,o.domElement);n.enableDamping=!0,n.dampingFactor=.25,n.rotateSpeed=.35,o.setClearColor(16777215,0)}(),n.runOutsideAngular(function(){f()}))}});var u,s,n,d=_slicedToArray(e.find("canvas"),1)[0];function f(){!function(){var e=d.clientWidth,r=d.clientHeight;d.width===e&&d.height===r||o.setSize(e,r,!1)}(),o.render(i,u),requestAnimationFrame(f)}n=t.has("ngZone")?t.get("ngZone"):{runOutsideAngular:function(e){return e()}}}e.$inject=["$element","$window","c8yWebSceneLoader","$injector"],angular.module("c8y.rotation3d").component("c8yWebScene",{template:'<canvas style="width:100%;"></canvas>',bindings:{rotate:"<",objectModel:"<",isWireframe:"<",cameraType:"<"},controller:e,controllerAs:"vm"})}();
@@ -1 +1 @@
1
- "use strict";function _objectSpread(n){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?Object(arguments[e]):{},t=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&t.push.apply(t,Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})),t.forEach(function(e){_defineProperty(n,e,i[e])})}return n}function _defineProperty(e,n,i){return n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}!function(){function e(u,d,p,f,s,g){return{require:"ngModel",restrict:"EA",link:function(c,e,n,i){var r={},t=s.SHARED_CONTEXTS.COMPUTED_PROPERTY_LAST_MEASUREMENT.value;function o(e){return _.find(c.devices,{id:e})}function a(){i.$setViewValue(_.cloneDeep(c.mappings))}function l(e){var n=c.deviceIds,i=c.devices,t=n[e.placeholder];t&&_.find(i,{id:t})||(n[e.placeholder]=(_.head(i)||{}).id)}i.$parsers.push(function(e){var n={};return _.each(e,function(e){n[e.placeholder]=e.config}),n}),i.$validators["c8y-scada-mapping"]=function(e){var t=!1;return _.forEach(e,function(e,n){var i=!_.isNull(e);r[n]=!i,t=t||!i}),!t},i.$overrideModelOptions({allowInvalid:!0}),i.$formatters.push(function(e){return _.map(e,function(e,n){return{placeholder:n,config:e}})}),i.$render=function(){c.mappings=i.$viewValue},_.assign(c,{hasError:r,clearMapping:function(e){e.config=null,a()},setMapping:function(n){s.set(t,o(c.deviceIds[n.placeholder])),(e=n,u.openSelector({selectSingle:!0,managedObject:o(c.deviceIds[e.placeholder])})).then(function(e){n.config=e}).then(a).finally(function(){s.clear(t)});var e},editComputedProperty:function(n){s.set(t,o(c.deviceIds[n.placeholder])),d.edit(n.config).then(function(e){n.config.config=e}).then(a).finally(function(){s.clear(t)})},setFieldbusMapping:function(n){f.openFieldbusSelector({device:o(c.deviceIds[n.placeholder])}).then(function(e){n.config=e}).then(a)},propertyValueFor:function(e){var n=o(c.deviceIds[e.placeholder]);return p.getValueForMapping(n,e.config)},humanizeValue:function(e){var n=e.config?_objectSpread({},e.config,{label:g.getString(e.config.label)}):e.config;return p.humanizeMapping(n)}}),c.$watch("devices",function(e){e&&_.forEach(c.mappings,l)},!0)},templateUrl:":::PLUGIN_PATH:::/views/mapping.html",scope:{device:"=",devices:"=",deviceIds:"=",onDeviceIdsChange:"&"}}}e.$inject=["SchemaPropertiesSvc","c8yComputedProperties","ScadaWidgetUtilSvc","c8yDeviceDatabase","contextDetailsSharedService","gettextCatalog"],angular.module("c8y.parts.scadaWidget").directive("c8yScadaMapping",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(u,f,p,d,s,g){return{require:"ngModel",restrict:"EA",link:function(i,e,t,n){var o={},r=s.SHARED_CONTEXTS.COMPUTED_PROPERTY_LAST_MEASUREMENT.value;function c(e){return _.find(i.devices,{id:e})}function a(){n.$setViewValue(_.cloneDeep(i.mappings))}function l(e){var t=i.deviceIds,n=i.devices,r=t[e.placeholder];r&&_.find(n,{id:r})||(t[e.placeholder]=(_.head(n)||{}).id)}n.$parsers.push(function(e){var t={};return _.each(e,function(e){t[e.placeholder]=e.config}),t}),n.$validators["c8y-scada-mapping"]=function(e){var r=!1;return _.forEach(e,function(e,t){var n=!_.isNull(e);o[t]=!n,r=r||!n}),!r},n.$overrideModelOptions({allowInvalid:!0}),n.$formatters.push(function(e){return _.map(e,function(e,t){return{placeholder:t,config:e}})}),n.$render=function(){i.mappings=n.$viewValue},_.assign(i,{hasError:o,clearMapping:function(e){e.config=null,a()},setMapping:function(t){s.set(r,c(i.deviceIds[t.placeholder])),(e=t,u.openSelector({selectSingle:!0,managedObject:c(i.deviceIds[e.placeholder])})).then(function(e){t.config=e}).then(a).finally(function(){s.clear(r)});var e},editComputedProperty:function(t){s.set(r,c(i.deviceIds[t.placeholder])),f.edit(t.config).then(function(e){t.config.config=e}).then(a).finally(function(){s.clear(r)})},setFieldbusMapping:function(t){d.openFieldbusSelector({device:c(i.deviceIds[t.placeholder])}).then(function(e){t.config=e}).then(a)},propertyValueFor:function(e){var t=c(i.deviceIds[e.placeholder]);return p.getValueForMapping(t,e.config)},humanizeValue:function(e){var t=e.config?_objectSpread({},e.config,{label:g.getString(e.config.label)}):e.config;return p.humanizeMapping(t)}}),i.$watch("devices",function(e){e&&_.forEach(i.mappings,l)},!0)},templateUrl:":::PLUGIN_PATH:::/views/mapping.html",scope:{device:"=",devices:"=",deviceIds:"=",onDeviceIdsChange:"&"}}}e.$inject=["SchemaPropertiesSvc","c8yComputedProperties","ScadaWidgetUtilSvc","c8yDeviceDatabase","contextDetailsSharedService","gettextCatalog"],angular.module("c8y.parts.scadaWidget").directive("c8yScadaMapping",e)}();
@@ -1 +1 @@
1
- "use strict";function _defineProperty(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){if(r){if("string"==typeof r)return _arrayLikeToArray(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _iterableToArrayLimit(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,a,i=[],o=!0,l=!1;try{for(t=t.call(r);!(o=(n=t.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(r){l=!0,a=r}finally{try{o||null==t.return||t.return()}finally{if(l)throw a}}return i}}function _arrayWithHoles(r){if(Array.isArray(r))return r}angular.module("c8y.smartRules").directive("smartRuleParamInputKpi",function(){return{require:"^smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputKpi.html",link:function(r,e,t,n){r.placeholder=n.placeholder},controller:["$scope","c8yKpi","c8yDataPointSvc",function(c,r,e){function t(){var r=c.param.property;r&&(c.kpiId=c.rule.config[r])}function n(r){var e=c.rule,t=c.param,n=e.config,a=function(r){return _.find(c.kpis,{id:r})}(r),i=t.mapSelectedKpiToProperties;if(a&&i){var o,l=a.c8y_Kpi;_.assign(n,(_defineProperty(o={},i.fragment,l.fragment),_defineProperty(o,i.series,l.series),_defineProperty(o,i.redRangeMin,_.get(l,"redRangeMin",90)),_defineProperty(o,i.redRangeMax,_.get(l,"redRangeMax",100)),o))}var u=t.property;u&&(n[u]=r)}_.assign(c,{getKpiLabel:function(r){var e=r.c8y_Kpi;return"".concat(e.label," - ").concat(e.series)},openKpiSelector:function(){e.chooseKpiWithUI().then(function(r){var e=_slicedToArray(r,1),t=e[0];c.kpiId=t._kpiId,n(c.kpiId)})},onKpiSelectionChange:n}),r.list().then(function(r){c.kpis=r}).then(t)}]}});
1
+ "use strict";function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function _defineProperty(r,e,t){return(e=_toPropertyKey(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _toPropertyKey(r){var e=_toPrimitive(r,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(r,e){if("object"!==_typeof(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0===t)return("string"===e?String:Number)(r);var n=t.call(r,e||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){if(r){if("string"==typeof r)return _arrayLikeToArray(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _iterableToArrayLimit(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(r){c=!0,o=r}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function _arrayWithHoles(r){if(Array.isArray(r))return r}angular.module("c8y.smartRules").directive("smartRuleParamInputKpi",function(){return{require:"^smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputKpi.html",link:function(r,e,t,n){r.placeholder=n.placeholder},controller:["$scope","c8yKpi","c8yDataPointSvc",function(c,r,e){function t(){var r=c.param.property;r&&(c.kpiId=c.rule.config[r])}function n(r){var e=c.rule,t=c.param,n=e.config,o=function(r){return _.find(c.kpis,{id:r})}(r),i=t.mapSelectedKpiToProperties;if(o&&i){var a,l=o.c8y_Kpi;_.assign(n,(_defineProperty(a={},i.fragment,l.fragment),_defineProperty(a,i.series,l.series),_defineProperty(a,i.redRangeMin,_.get(l,"redRangeMin",90)),_defineProperty(a,i.redRangeMax,_.get(l,"redRangeMax",100)),a))}var u=t.property;u&&(n[u]=r)}_.assign(c,{getKpiLabel:function(r){var e=r.c8y_Kpi;return"".concat(e.label," - ").concat(e.series)},openKpiSelector:function(){e.chooseKpiWithUI().then(function(r){var e=_slicedToArray(r,1),t=e[0];c.kpiId=t._kpiId,n(c.kpiId)})},onKpiSelectionChange:n}),r.list().then(function(r){c.kpis=r}).then(t)}]}});
@@ -1 +1 @@
1
- "use strict";function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,o=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw a}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,t,n,a,o,i,l){var u=a.url("service/smartrule/smartrules/configurations"),c=e("smartRuleTemplates"),s="list";return 0<_.get(window,"c8y.collections.smartrules",[]).length&&t.warn("In-memory definitions of smart rules are not supported right now."),{list:f,getTemplateForRule:function(r){return f().then(function(e){return _.find(e,{name:r.ruleTemplateName})})},getTemplateByName:function(r){return f().then(function(e){return _.find(e,{name:r})}).then(y)},mustBeAvailable:function(e){return h(e).then(function(e){return e?n.when():n.reject()})},isAvailable:h};function f(){var e=c.get(s);return e?n.when(e):r.get(u).then(a.getResData).then(function(e){return _.filter(e,function(e){return!_.includes(i.smartRules.exclude,e.name)})}).then(m).then(function(e){return c.put(s,e),e})}function m(e){var r=[];return e.forEach(function(e){r.push(y(e))}),n.all(r)}function y(r){return h(r.name).then(function(e){return r._active=e,n.when(r)})}function h(e){switch(e){case"sendDashboardsViaEmail":return n.all({systemOption:o.getSystemOptionValue({category:"reportMailer",key:"available"},!1),featureActive:l.isAvailable({name:"feature-dashboard-mailer"})}).then(_.every);case"onAlarmSendSms":return n.all([l.isAvailable({contextPath:"messaging"}),o.detailValue({category:"messaging",key:"provider"})]).then(function(e){var r=_slicedToArray(e,2),t=r[0],n=r[1];return Boolean(t&&n)});case"onAlarmEscalateAlarm":return h("onAlarmSendSms");default:return n.when(!0)}}}e.$inject=["$cacheFactory","$http","$log","$q","c8yBase","c8ySettings","c8yConfig","c8yApplication"],angular.module("c8y.smartRules").factory("smartRuleTemplatesSvc",e)}();
1
+ "use strict";function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,a,i,o,l=[],u=!0,c=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(e,r,t,n,a,i,o,l){var u=a.url("service/smartrule/smartrules/configurations"),c=e("smartRuleTemplates"),s="list";return 0<_.get(window,"c8y.collections.smartrules",[]).length&&t.warn("In-memory definitions of smart rules are not supported right now."),{list:f,getTemplateForRule:function(r){return f().then(function(e){return _.find(e,{name:r.ruleTemplateName})})},getTemplateByName:function(r){return f().then(function(e){return _.find(e,{name:r})}).then(y)},mustBeAvailable:function(e){return h(e).then(function(e){return e?n.when():n.reject()})},isAvailable:h};function f(){var e=c.get(s);return e?n.when(e):r.get(u).then(a.getResData).then(function(e){return _.filter(e,function(e){return!_.includes(o.smartRules.exclude,e.name)})}).then(m).then(function(e){return c.put(s,e),e})}function m(e){var r=[];return e.forEach(function(e){r.push(y(e))}),n.all(r)}function y(r){return h(r.name).then(function(e){return r._active=e,n.when(r)})}function h(e){switch(e){case"sendDashboardsViaEmail":return n.all({systemOption:i.getSystemOptionValue({category:"reportMailer",key:"available"},!1),featureActive:l.isAvailable({name:"feature-dashboard-mailer"})}).then(_.every);case"onAlarmSendSms":return n.all([l.isAvailable({contextPath:"messaging"}),i.detailValue({category:"messaging",key:"provider"})]).then(function(e){var r=_slicedToArray(e,2),t=r[0],n=r[1];return Boolean(t&&n)});case"onAlarmEscalateAlarm":return h("onAlarmSendSms");default:return n.when(!0)}}}e.$inject=["$cacheFactory","$http","$log","$q","c8yBase","c8ySettings","c8yConfig","c8yApplication"],angular.module("c8y.smartRules").factory("smartRuleTemplatesSvc",e)}();
@@ -94,6 +94,7 @@
94
94
  <button
95
95
  class="btn-dot m-l-auto m-r-8"
96
96
  type="button"
97
+ ng-click="associate(a)"
97
98
  uib-tooltip="{{ 'Subscribe' | translate }}"
98
99
  aria-label="{{ 'Subscribe' | translate }}"
99
100
  tooltip-popup-delay="500"
@@ -1 +1 @@
1
- "use strict";function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),o.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(){function t(t,e,n,o,r,i,a,u,s,c,l,m,g,f,d){var C=this,p=l.another(l.paths.Tenants),h=c.stringToDate(i.fromThisMonthStartFilter().dateFrom),T=f("No tenants to display.");function S(){C.refreshLoading=!0,u.isCurrentUserTopTenant().then(function(t){C.isTopTenant=t}).then(y).then(v).then(b).then(O).then(U).then(j).then(function(){C.refreshLoading=!1})}function y(){C.storageLimitFeatureEnabled=i.appOption("storageLimitationFeatureEnabled")}function v(){C.dateFrom=c.stringToDate(n.dateFrom)||h,C.dateTo=c.stringToDate(n.dateTo)}function b(){return a.list(P()).then(D)}function P(){return{dateFrom:c.dateToStringWithTimeZone(C.dateFrom),dateTo:void 0!==C.dateTo?c.dateToStringWithTimeZone(moment(C.dateTo).endOf("day")):void 0}}function D(t){C.statistics=function(t){return _.map(t,function(t){return _objectSpread({},t,{storageQuota:F(function(t){var e=t.storageLimitPerDevice,n=t.deviceWithChildrenCount,o=e;o&&(o*=n||1);return o}(t)),storageSize:F(t.storageSize),peakStorageSize:F(t.peakStorageSize)})})}(t)}function F(t){return!_.isUndefined(t)&&Number((t/Math.pow(2,20)).toFixed(2))}function O(){return p.list().then(function(t){return _.filter(t,{id:"c8ySchema!!customProperties"})}).then(function(t){return p.getSchema(t)}).then(function(t){return _.get(t,"properties.customProperties.properties",{})}).then(function(t){return _.map(t,function(t,e){return{title:t.title,key:e,schema:t}})}).then(function(t){C.customProperties=_.sortBy(t,"title")})}function U(){C.columns=_([m.getTenantNameColumn(),m.getTenantIdColumn(),m.getTenantDomainColumn(),m.getApiRequestsColumn(),m.getDeviceApiRequestsColumn(),C.storageLimitFeatureEnabled?m.getStorageQuotaColumn():null,m.getStorageSizeColumn(),m.getPeakStorageSizeColumn(),m.getRootDevicesColumn(),m.getPeakRootDevicesColumn(),m.getDevicesColumn(),m.getPeakDevicesColumn(),m.getDeviceEndpointCountColumn(),m.getSubscribedApplicationsColumn(),m.getCreationTimeColumn(),m.getAlarmsCreatedCountColumn(),m.getAlarmsUpdatedCountColumn(),m.getInventoriesCreatedCountColumn(),m.getInventoriesUpdatedCountColumn(),m.getEventsCreatedCountColumn(),m.getEventsUpdatedCountColumn(),m.getMeasurementsCreatedCountColumn(),m.getTotalInboundTransferColumn(),m.getCpuUsageColumn(),m.getMemoryUsageColumn(),C.isTopTenant?m.getParentTenantIdColumn():null,_.map(C.customProperties,function(t){return m.getCustomPropertyColumn(t)})]).flattenDeep().compact().orderBy([function(t){return t.priority||0}],["desc"]).value(),C.columnsConfig={}}function j(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:C.columnsConfig;C.columnsConfig=t,C.filteredSortedStatistics=g.filterSort(C.statistics,C.columns,C.columnsConfig)}_.assign(C,{noItemsMessage:T,getSubtitle:function(){var t=_.get(C.statistics,"length"),e=d.getPlural(t,"1 tenant","{{$count}} tenants",{});return _.isNumber(t)?e:""},$onInit:S,onColumnsConfigChanged:function(t){j(t)},getCsvHeaders:function(){return _(C.columns).map(function(t){return _.result(t,"getCsvHeaders")||_.get(t,"header.text")||_.get(t,"header")}).flatten().value()},getCsvData:function(){return _.map(C.filteredSortedStatistics,function(e){return _(C.columns).map(function(t){return t.getCsvValues(e)}).flatten().value()})},detail:function(t){o.path("/tenants/".concat(t.tenantId))},filter:function(){_.isEqual(P().dateFrom,h)&&_.isUndefined(P().dateTo)||o.search(P())},clearFilter:function(){o.search({})},refresh:function(){S()}})}t.$inject=["$scope","$q","$routeParams","$location","$filter","c8yBase","c8yStatistics","c8yTenant","c8yTitle","c8yUtil","c8yPropertiesLibrary","c8yTenantStatisticsColumns","c8yFilteringSortingCollections","gettext","gettextCatalog"],angular.module("c8y.tenantStatistics").component("c8yTenantStatistics",{templateUrl:":::PLUGIN_PATH:::/tenant-statistics.html",controller:t,controllerAs:"vm"})}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),o.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var o=n.call(t,e||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t,e,n,o,r,i,u,a,s,c,l,m,f,g,p){var d=this,C=l.another(l.paths.Tenants),y=c.stringToDate(i.fromThisMonthStartFilter().dateFrom),h=g("No tenants to display.");function v(){d.refreshLoading=!0,a.isCurrentUserTopTenant().then(function(t){d.isTopTenant=t}).then(S).then(b).then(T).then(j).then(O).then(U).then(function(){d.refreshLoading=!1})}function S(){d.storageLimitFeatureEnabled=i.appOption("storageLimitationFeatureEnabled")}function b(){d.dateFrom=c.stringToDate(n.dateFrom)||y,d.dateTo=c.stringToDate(n.dateTo)}function T(){return u.list(P()).then(D)}function P(){return{dateFrom:c.dateToStringWithTimeZone(d.dateFrom),dateTo:void 0!==d.dateTo?c.dateToStringWithTimeZone(moment(d.dateTo).endOf("day")):void 0}}function D(t){d.statistics=function(t){return _.map(t,function(t){return _objectSpread({},t,{storageQuota:F(function(t){var e=t.storageLimitPerDevice,n=t.deviceWithChildrenCount,o=e;o&&(o*=n||1);return o}(t)),storageSize:F(t.storageSize),peakStorageSize:F(t.peakStorageSize)})})}(t)}function F(t){return!_.isUndefined(t)&&Number((t/Math.pow(2,20)).toFixed(2))}function j(){return C.list().then(function(t){return _.filter(t,{id:"c8ySchema!!customProperties"})}).then(function(t){return C.getSchema(t)}).then(function(t){return _.get(t,"properties.customProperties.properties",{})}).then(function(t){return _.map(t,function(t,e){return{title:t.title,key:e,schema:t}})}).then(function(t){d.customProperties=_.sortBy(t,"title")})}function O(){d.columns=_([m.getTenantNameColumn(),m.getTenantIdColumn(),m.getTenantDomainColumn(),m.getApiRequestsColumn(),m.getDeviceApiRequestsColumn(),d.storageLimitFeatureEnabled?m.getStorageQuotaColumn():null,m.getStorageSizeColumn(),m.getPeakStorageSizeColumn(),m.getRootDevicesColumn(),m.getPeakRootDevicesColumn(),m.getDevicesColumn(),m.getPeakDevicesColumn(),m.getDeviceEndpointCountColumn(),m.getSubscribedApplicationsColumn(),m.getCreationTimeColumn(),m.getAlarmsCreatedCountColumn(),m.getAlarmsUpdatedCountColumn(),m.getInventoriesCreatedCountColumn(),m.getInventoriesUpdatedCountColumn(),m.getEventsCreatedCountColumn(),m.getEventsUpdatedCountColumn(),m.getMeasurementsCreatedCountColumn(),m.getTotalInboundTransferColumn(),m.getCpuUsageColumn(),m.getMemoryUsageColumn(),d.isTopTenant?m.getParentTenantIdColumn():null,_.map(d.customProperties,function(t){return m.getCustomPropertyColumn(t)})]).flattenDeep().compact().orderBy([function(t){return t.priority||0}],["desc"]).value(),d.columnsConfig={}}function U(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:d.columnsConfig;d.columnsConfig=t,d.filteredSortedStatistics=f.filterSort(d.statistics,d.columns,d.columnsConfig)}_.assign(d,{noItemsMessage:h,getSubtitle:function(){var t=_.get(d.statistics,"length"),e=p.getPlural(t,"1 tenant","{{$count}} tenants",{});return _.isNumber(t)?e:""},$onInit:v,onColumnsConfigChanged:function(t){U(t)},getCsvHeaders:function(){return _(d.columns).map(function(t){return _.result(t,"getCsvHeaders")||_.get(t,"header.text")||_.get(t,"header")}).flatten().value()},getCsvData:function(){return _.map(d.filteredSortedStatistics,function(e){return _(d.columns).map(function(t){return t.getCsvValues(e)}).flatten().value()})},detail:function(t){o.path("/tenants/".concat(t.tenantId))},filter:function(){_.isEqual(P().dateFrom,y)&&_.isUndefined(P().dateTo)||o.search(P())},clearFilter:function(){o.search({})},refresh:function(){v()}})}t.$inject=["$scope","$q","$routeParams","$location","$filter","c8yBase","c8yStatistics","c8yTenant","c8yTitle","c8yUtil","c8yPropertiesLibrary","c8yTenantStatisticsColumns","c8yFilteringSortingCollections","gettext","gettextCatalog"],angular.module("c8y.tenantStatistics").component("c8yTenantStatistics",{templateUrl:":::PLUGIN_PATH:::/tenant-statistics.html",controller:t,controllerAs:"vm"})}();
@@ -1 +1 @@
1
- "use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(a,i,r,e,t,o,n,s,c,l,u,d,m,f){var h,g,y,p,v=e.tenantId,P=u("May contain lowercase letters, digits, and hyphens. Must start with a letter; hyphens only allowed in the middle; minimum 2 characters. ");function w(e){var t=e||{};i.storageLimitation.storageLimitPerDeviceEnabled=function(e){return i.storageLimitation.storageLimitFeatureEnabled&&!!e.storageLimitPerDevice}(t),t.storageLimitPerDevice=(t.storageLimitPerDevice||0)/1024/1024,i.tenant=t}function T(e){i.saveInProgress=e}function L(e){i.tenantPolicies=_.union([{name:d.getString("None")}],e)}function E(){var e="c8yTenantPolicies";return!h&&t.has(e)&&(h=t.get(e)),h}_.assign(i,{validation:m.validation,tenantIdDomainHelpText:P,maxStorageLimitPerDevice:(g=Number.MAX_SAFE_INTEGER||9007199254740991,Math.round(g/1024/1024)),passwordStrengthUser:{},cancel:function(){r.path("tenants")},save:function(e,n){i.isNew&&i.host&&(e.domain=e.id+i.host);var t=_.cloneDeep(e);i.storageLimitation.storageLimitPerDeviceEnabled?t.storageLimitPerDevice=1024*t.storageLimitPerDevice*1024:t.storageLimitPerDevice=0;T(!0),o.save(t).then(function(e){var t=e.data;return function(e,t){i.isNew&&r.path("/tenants/".concat(e.id));_.assign(i.tenant,e),c.success(u("Tenant saved.")),t.$setPristine()}(t,n)}).finally(function(){T(!1)})},shouldShowSubtenantCheckbox:function(){var e=i.tenant&&o.isParentTopTenant(i.tenant);return i.isTopTenant&&(e||i.isNew)},storageLimitation:{storageLimitPerDeviceEnabled:!1,storageLimitFeatureEnabled:n.appOption("storageLimitationFeatureEnabled")},humanize:n.humanizeFragment,saveInProgress:!1,changePasswordConfirm:function(){var e=i.tenantForm,t=e.confirmPassword,n=e.adminPass;if(t){var r=t.$modelValue,a=n.$modelValue;t.$setValidity("password-mismatch",r===a)}},changePassword:!1,resetPassword:function(){i.changePassword=!i.changePassword,i.changePassword||(i.tenant.adminPass=null)},shouldDisplayConfirmPassword:function(){return!_.isEmpty(i.tenant.adminPass)}}),i.$watchGroup(["passwordStrengthEnforced","passwordStrengthUser.passwordStrength"],function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1];i.tenantForm&&i.tenantForm.adminPass&&i.tenantForm.adminPass.$setValidity("password-strength",!n||"GREEN"===r)}),i.$watch("tenant.tenantPolicyId",function(e){var t=l.getStrongPasswordSettings(),n=E(),r=_.find(i.tenantPolicies,{id:e});a.all({enforcedOnSystemLevel:t.then(function(e){return e.enforceStrength}),enforcedOnTenantLevel:t.then(function(e){return e.strengthValidity}),enforcedOnTenantPolicyLevel:n&&n.doesEnforceStrongPassword(r)}).then(function(e){var t=e.enforcedOnSystemLevel,n=e.enforcedOnTenantLevel,r=e.enforcedOnTenantPolicyLevel;i.isNew?i.passwordStrengthEnforced=t||r:i.passwordStrengthEnforced=t||n})}),o.current().then(function(e){var t=e.domainName;return".".concat(t.split(".").slice(1).join("."))}).then(function(e){i.host=e}),o.isCurrentUserTopTenant().then(function(e){i.isTopTenant=e}),f.current(!1).then(function(e){(f.hasRole(e,"ROLE_SUPPORT_ADMIN")||f.hasRole(e,"ROLE_SUPPORT_READ"))&&(i.supportUser=encodeURIComponent("".concat(e.id,"$")))}),v&&"new"!==v?o.detail(v).then(function(e){return e.data}).then(w):(w({sendPasswordResetEmail:i.isNew=!0}),s.changeTitle({title:u("New tenant")}),y=E(),p=!1,y&&(p=!0,y.list().then(L)),i.selectTenantPolicy=p),o.isEnterpriseEditionTenant().then(function(e){i.isEnterpriseEditionTenant=e})}e.$inject=["$q","$scope","$location","$routeParams","$injector","c8yTenant","c8yBase","c8yTitle","c8yAlert","c8yLoginOptions","gettext","gettextCatalog","c8yConfig","c8yUser"],angular.module("c8y.tenants").controller("tenantDetailCtrl",e)}();
1
+ "use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(a,i,r,e,t,o,n,s,c,l,u,d,f,m){var h,g,y,p,v=e.tenantId,P=u("May contain lowercase letters, digits, and hyphens. Must start with a letter; hyphens only allowed in the middle; minimum 2 characters. ");function w(e){var t=e||{};i.storageLimitation.storageLimitPerDeviceEnabled=function(e){return i.storageLimitation.storageLimitFeatureEnabled&&!!e.storageLimitPerDevice}(t),t.storageLimitPerDevice=(t.storageLimitPerDevice||0)/1024/1024,i.tenant=t}function T(e){i.saveInProgress=e}function L(e){i.tenantPolicies=_.union([{name:d.getString("None")}],e)}function b(){var e="c8yTenantPolicies";return!h&&t.has(e)&&(h=t.get(e)),h}_.assign(i,{validation:f.validation,tenantIdDomainHelpText:P,maxStorageLimitPerDevice:(g=Number.MAX_SAFE_INTEGER||9007199254740991,Math.round(g/1024/1024)),passwordStrengthUser:{},cancel:function(){r.path("tenants")},save:function(e,n){i.isNew&&i.host&&(e.domain=e.id+i.host);var t=_.cloneDeep(e);i.storageLimitation.storageLimitPerDeviceEnabled?t.storageLimitPerDevice=1024*t.storageLimitPerDevice*1024:t.storageLimitPerDevice=0;T(!0),o.save(t).then(function(e){var t=e.data;return function(e,t){i.isNew&&r.path("/tenants/".concat(e.id));_.assign(i.tenant,e),c.success(u("Tenant saved.")),t.$setPristine()}(t,n)}).finally(function(){T(!1)})},shouldShowSubtenantCheckbox:function(){var e=i.tenant&&o.isParentTopTenant(i.tenant);return i.isTopTenant&&(e||i.isNew)},storageLimitation:{storageLimitPerDeviceEnabled:!1,storageLimitFeatureEnabled:n.appOption("storageLimitationFeatureEnabled")},humanize:n.humanizeFragment,saveInProgress:!1,changePasswordConfirm:function(){var e=i.tenantForm,t=e.confirmPassword,n=e.adminPass;if(t){var r=t.$modelValue,a=n.$modelValue;t.$setValidity("password-mismatch",r===a)}},changePassword:!1,resetPassword:function(){i.changePassword=!i.changePassword,i.changePassword||(i.tenant.adminPass=null)},shouldDisplayConfirmPassword:function(){return!_.isEmpty(i.tenant.adminPass)}}),i.$watchGroup(["passwordStrengthEnforced","passwordStrengthUser.passwordStrength"],function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1];i.tenantForm&&i.tenantForm.adminPass&&i.tenantForm.adminPass.$setValidity("password-strength",!n||"GREEN"===r)}),i.$watch("tenant.tenantPolicyId",function(e){var t=l.getStrongPasswordSettings(),n=b(),r=_.find(i.tenantPolicies,{id:e});a.all({enforcedOnSystemLevel:t.then(function(e){return e.enforceStrength}),enforcedOnTenantLevel:t.then(function(e){return e.strengthValidity}),enforcedOnTenantPolicyLevel:n&&n.doesEnforceStrongPassword(r)}).then(function(e){var t=e.enforcedOnSystemLevel,n=e.enforcedOnTenantLevel,r=e.enforcedOnTenantPolicyLevel;i.isNew?i.passwordStrengthEnforced=t||r:i.passwordStrengthEnforced=t||n})}),o.current().then(function(e){var t=e.domainName;return".".concat(t.split(".").slice(1).join("."))}).then(function(e){i.host=e}),o.isCurrentUserTopTenant().then(function(e){i.isTopTenant=e}),m.current(!1).then(function(e){(m.hasRole(e,"ROLE_SUPPORT_ADMIN")||m.hasRole(e,"ROLE_SUPPORT_READ"))&&(i.supportUser=encodeURIComponent("".concat(e.id,"$")))}),v&&"new"!==v?o.detail(v).then(function(e){return e.data}).then(w):(w({sendPasswordResetEmail:i.isNew=!0}),s.changeTitle({title:u("New tenant")}),y=b(),p=!1,y&&(p=!0,y.list().then(L)),i.selectTenantPolicy=p),o.isEnterpriseEditionTenant().then(function(e){i.isEnterpriseEditionTenant=e})}e.$inject=["$q","$scope","$location","$routeParams","$injector","c8yTenant","c8yBase","c8yTitle","c8yAlert","c8yLoginOptions","gettext","gettextCatalog","c8yConfig","c8yUser"],angular.module("c8y.tenants").controller("tenantDetailCtrl",e)}();
@@ -1 +1 @@
1
- "use strict";function _objectSpread(n){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?Object(arguments[e]):{},s=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&s.push.apply(s,Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})),s.forEach(function(e){_defineProperty(n,e,o[e])})}return n}function _defineProperty(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}!function(){function e(e,n,o,t,r,s,l,i){var a=this;function c(){n.listInventoryRoles(a.userId).then(o.getResData).then(function(e){a.assignedRoles=_.keyBy(e.inventoryAssignments,"managedObject")}),n.detail(a.userId).then(o.getResData).then(function(e){a.user=e,a.user.owner?n.listInventoryRoles(a.user.owner).then(o.getResData).then(function(e){a.ownerAssignedRoles=_.keyBy(e.inventoryAssignments,"managedObject"),_.isEmpty(a.ownerAssignedRoles)&&(a.displayNoOwnerRolesAlert=!0),a.failedToFetchOwnerInventoryRoles=!1}).catch(function(){a.failedToFetchOwnerInventoryRoles=!0}):a.failedToFetchOwnerInventoryRoles=!1})}function u(){c(),l.success(i.getPlural(d(),"Inventory role updated","Inventory roles updated",{}))}function d(){return _.filter(a.assignedRoles,"isModified").length}function y(e){var n="replace"===e.process,o=e.roles,s=_.map(a.assignedRoles);return t.copyUserRoles(o,s,a.userId,n).then(c).then(r.successUserRolesCopy)}_.assign(a,{$onChange:function(e){e.user&&c()},onChangeRoles:function(e,n){a.assignedRoles[n]=a.assignedRoles[n]||{},_.assign(a.assignedRoles[n],{managedObject:n,roles:e,isModified:!0}),a.assignedRoles=_objectSpread({},a.assignedRoles)},onSaveInventoryRoles:function(){t.onSaveInventoryRoles(a.userId,a.assignedRoles).then(u)},copyRoles:function(){r.copyFromUserDialog(a.userId).then(y)},loadAssignedRoles:c,isUnchanged:function(){return 0===d()},helpLink:s.getUserGuideLink(_.get(r.STRINGS,"LINKS.ROLES_INVENTORY")),displayNoOwnerRolesAlert:!1,failedToFetchOwnerInventoryRoles:null}),c()}e.$inject=["$q","c8yUser","c8yBase","c8yUserInventoryRoles","c8yUserRolesUi","c8yDocs","c8yAlert","gettextCatalog"],angular.module("c8y.userRoles").component("c8yUserInventoryRolesTab",{templateUrl:":::PLUGIN_PATH:::/inventoryRolesTab/inventoryRolesTab.html",controllerAs:"vm",controller:e,bindings:{userId:"<"}})}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.forEach(function(e){_defineProperty(n,e,t[e])})}return n}function _defineProperty(e,n,t){return(n=_toPropertyKey(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _toPropertyKey(e){var n=_toPrimitive(e,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(e,n){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);var o=t.call(e,n||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,n,t,r,s,o,i,l){var c=this;function u(){n.listInventoryRoles(c.userId).then(t.getResData).then(function(e){c.assignedRoles=_.keyBy(e.inventoryAssignments,"managedObject")}),n.detail(c.userId).then(t.getResData).then(function(e){c.user=e,c.user.owner?n.listInventoryRoles(c.user.owner).then(t.getResData).then(function(e){c.ownerAssignedRoles=_.keyBy(e.inventoryAssignments,"managedObject"),_.isEmpty(c.ownerAssignedRoles)&&(c.displayNoOwnerRolesAlert=!0),c.failedToFetchOwnerInventoryRoles=!1}).catch(function(){c.failedToFetchOwnerInventoryRoles=!0}):c.failedToFetchOwnerInventoryRoles=!1})}function a(){u(),i.success(l.getPlural(y(),"Inventory role updated","Inventory roles updated",{}))}function y(){return _.filter(c.assignedRoles,"isModified").length}function f(e){var n="replace"===e.process,t=e.roles,o=_.map(c.assignedRoles);return r.copyUserRoles(t,o,c.userId,n).then(u).then(s.successUserRolesCopy)}_.assign(c,{$onChange:function(e){e.user&&u()},onChangeRoles:function(e,n){c.assignedRoles[n]=c.assignedRoles[n]||{},_.assign(c.assignedRoles[n],{managedObject:n,roles:e,isModified:!0}),c.assignedRoles=_objectSpread({},c.assignedRoles)},onSaveInventoryRoles:function(){r.onSaveInventoryRoles(c.userId,c.assignedRoles).then(a)},copyRoles:function(){s.copyFromUserDialog(c.userId).then(f)},loadAssignedRoles:u,isUnchanged:function(){return 0===y()},helpLink:o.getUserGuideLink(_.get(s.STRINGS,"LINKS.ROLES_INVENTORY")),displayNoOwnerRolesAlert:!1,failedToFetchOwnerInventoryRoles:null}),u()}e.$inject=["$q","c8yUser","c8yBase","c8yUserInventoryRoles","c8yUserRolesUi","c8yDocs","c8yAlert","gettextCatalog"],angular.module("c8y.userRoles").component("c8yUserInventoryRolesTab",{templateUrl:":::PLUGIN_PATH:::/inventoryRolesTab/inventoryRolesTab.html",controllerAs:"vm",controller:e,bindings:{userId:"<"}})}();