(()=>{function t(t,o,e,n,a,c,r,i){var s=this,l="/brokerconnectors/*",d=t.$id;function u(){o.getConnectors().then(function(t){s.connectors=t})}function g(){u()}function T(t,e){var n=_.find(s.connectors,{id:e.id});_.assign(n,_.pick(e,"destinationStatus")),_.isUndefined(n)||_.set(n,"visibleStatus",o.getMappedStatus(n))}function C(){g()}_.assign(s,{$onInit:function(){u(),c.addListener(d,l,c.realtimeActions().UPDATE,T),c.addListener(d,l,c.realtimeActions().CREATE,C),c.addListener(d,l,c.realtimeActions().DELETE,C),c.start(d,l),t.$on("$destroy",function(){c.stop(d,l)})},reload:g,editConnector:function(t){o.navigateToDetails(t)},duplicateConnector:function(t){o.navigateToNew(t)},deleteConnector:function(t){return n({title:r("Delete connector"),body:i.getString('You are about to delete connector "{{name}}". Do you want to proceed?',{name:t.name}),status:"danger",labels:{ok:r("Delete")}}).then(_.partial(o.deleteConnector,t.id)).then(function(){a.success(r("Connector deleted.")),u()})},toggleConnectorStatus:function(t,e){t.stopPropagation(),t.preventDefault(),o.toggleConnectorStatus(e)},ROUTE_NEW_CONNECTOR:e.ROUTE_NEW_CONNECTOR,STATUS:o.STATUS,MAPPED_STATUS:o.MAPPED_STATUS,getStatusTooltip:o.getStatusTooltip})}t.$inject=["$scope","dataBrokerConnectorsSvc","dataBrokerConstants","c8yModal","c8yAlert","c8yRealtime","gettext","gettextCatalog"],angular.module("c8y.dataBroker").component("c8yDataBrokerConnectorsList",{templateUrl:":::PLUGIN_PATH:::/connectors/connectors.html",controller:t,controllerAs:"vm"})})();