function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_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(t,a){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,a):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,a):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var r=0,e=Array(a);r<a;r++)e[r]=t[r];return e}(()=>{function t(e,t,a,r,n,o){_.assign(this,{validationChanged:function(t){e.forms.dpForm.$setValidity("dpSelected",t)},modelChanged:function(t){(t=>{var a;e.datapoints||(e.datapoints=[]),e.datapoints.length=0,(a=e.datapoints).push.apply(a,_toConsumableArray(t))})(t)}}),_.assign(e,{tmpDatapoints:[]}),_.assign(e,{actions:[]}),e.$watch("datapoints",function(){e.tmpDatapoints.length=0;var t,a=e.datapoints||[];(t=e.tmpDatapoints).push.apply(t,_toConsumableArray(a))},!0),e.$watch("smartrules",function(t){t&&_.assign(e,{actions:[{label:o("Create smart rule"),callback:function(t){n.addNewForInputDataPointWithUI(t)},icon:"cogs"}]})});var i=_.get(e,"$parent.config.settings.context");function s(t){var a,r;t&&t.id&&(a=t.name,r=t.id,t=t.c8y_IsDevice,e.selectorConfig||(e.selectorConfig={}),e.selectorConfig.contextAsset={name:a,id:r,c8y_IsDevice:t},e.allowAddingDataPointsFromContextMoOnly)&&(e.selectorConfig.allowChangingContext=!1)}i&&i.id?s(i):(i=t.getContext())&&i.id&&("device"===i.context||"group"===i.context)&&a.detailCached(i.id,{withChildren:!1}).then(r.getResData).then(s)}t.$inject=["$scope","c8yUiUtil","c8yInventory","c8yBase","smartRulesSvc","gettext"],angular.module("c8y.cockpit.dataPointExplorer").controller("c8yDataPointListCtrl",t)})();