(()=>{function n(t,n){var r=e,o={LongPollingTransport:function(){var n=new org.cometd.LongPollingTransport,n=org.cometd.Transport.derive(n);return n.xhrSend=function(n){return r(n)},n},enable:function(n){r=n?e:a}};return o.enable(!n.getFlag("test")),o;function e(r){var e={},n=r.headers||{};return n["Content-Type"]="application/json;charset=UTF-8",o.disabled||t.post(r.url,r.body,{headers:n,withCredentials:!0}).then(function(n){var t=n.data;e.status=n.status,r.onSuccess(t)},function(n){var t=n.data;e.status=n.status,r.onError(t)}),e}function a(n){var t=JSON.parse(n.body);return setTimeout(function(){n.onSuccess({successful:!0,id:t.id,channel:t.channel},100)}),{status:200}}}n.$inject=["$http","c8yBase"],angular.module("c8y.core").factory("c8yLongPollingTransport",n),_.assign(org.cometd.JSON,{toJSON:JSON.stringify,fromJSON:JSON.parse})})();