(()=>{function e(e,t,n,i,o){var c=this;function s(e){e&&(n.getSampleAlarmsAndEventsConfigsForDevice(e).then(function(e){c.suggestedAlarmsEventsConfigs=e}),c.customCfg=n.getEmptyAlarmEventConfigForDevice(e))}function l(){return _.filter(c.suggestedAlarmsEventsConfigs,{__active:!0}).concat(c.customCfg.__active?[c.customCfg]:[])}_.assign(c,{$onInit:function(){(()=>{var e=i.getContext();(e=>(e=e.context)&&("device"===e||"group"===e))(e)?c.rootId=e.id:c.noContext=!0})(),e.$watch("vm.selectedDevice",s)},getSelected:l,add:function(){t.close(_.map(l(),function(e){return e.label||(e.label=e.filters.type),e}))},cancel:t.dismiss,timelineTypes:n.TIMELINE_TYPES.values(),config:o})}e.$inject=["$scope","$uibModalInstance","c8yAlarmsEventsTimelinesChartService","c8yUiUtil","config"],angular.module("c8y.alarmsEventsExplorer").controller("c8yAlarmsEventsTimelineConfigModalController",e)})();