(()=>{function n(e,u){var n={create:function(n){var r=new Worker(e.url(n)),t=!0,o={push:function(n){return r.postMessage(n),o},terminateOnMessage:function(){return t=!1,o},message:function(e){return r.onmessage=function(n){u(function(){e(n.data),t||r.terminate()})},o},error:function(e){return r.onerror=function(n){u(function(){e(n),t||r.terminate()})},o},terminate:function(){r.terminate()}};return o}};return n}n.$inject=["c8yBase","$timeout"],angular.module("c8y.core").factory("c8yWorkers",n)})();