From 9cc9b5b3be884a3ece678edd74dc5bfedc31d23d Mon Sep 17 00:00:00 2001 From: Maik Hummel Date: Wed, 25 Jan 2017 11:36:19 +0100 Subject: [PATCH] Release 0.4.0 --- bower.json | 2 +- dist/ng-stomp.min.js | 6 ++---- dist/ng-stomp.standalone.min.js | 17 ++++------------- package.json | 2 +- src/ng-stomp.js | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/bower.json b/bower.json index f2fa795..d6cb7fb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ng-stomp", - "version": "0.3.0", + "version": "0.4.0", "homepage": "https://github.com/beevelop/ng-stomp", "authors": [ "Maik Hummel " diff --git a/dist/ng-stomp.min.js b/dist/ng-stomp.min.js index a961855..340c8e2 100644 --- a/dist/ng-stomp.min.js +++ b/dist/ng-stomp.min.js @@ -1,10 +1,8 @@ /** * ngStomp * - * @version 0.3.0 + * @version 0.4.0 * @author Maik Hummel * @license MIT */ -/*global - angular, SockJS, Stomp */ -angular.module("ngStomp",[]).service("$stomp",["$rootScope","$q",function(a,b){this.sock=null,this.stomp=null,this.debug=null,this.setDebug=function(a){this.debug=a},this.connect=function(a,c,d){c=c||{};var e=b.defer();return this.sock=new SockJS(a),this.stomp=Stomp.over(this.sock),this.stomp.debug=this.debug,this.stomp.connect(c,function(a){e.resolve(a)},function(a){e.reject(a),d(a)}),e.promise},this.disconnect=function(){var a=b.defer();return this.stomp.disconnect(a.resolve),a.promise},this.subscribe=this.on=function(a,b,c){return c=c||{},this.stomp.subscribe(a,function(a){var c=null;try{c=JSON.parse(a.body)}finally{b&&b(c,a.headers,a)}},c)},this.unsubscribe=this.off=function(a){a.unsubscribe()},this.send=function(a,c,d){var e=b.defer();try{var f=JSON.stringify(c);d=d||{},this.stomp.send(a,d,f),e.resolve()}catch(a){e.reject(a)}return e.promise}}]); \ No newline at end of file +!function(){angular.module("ngStomp",[]).service("$stomp",["$rootScope","$q",function(a,b){this.sock=null,this.stomp=null,this.debug=null,this.setDebug=function(a){this.debug=a},this.connect=function(a,c,d,e){c=c||{},e=e||{};var f=b.defer();return this.sock=new SockJS(a,null,e),this.sock.onclose=function(){angular.isFunction(d)&&d(new Error("Connection broken"))},this.stomp=Stomp.over(this.sock),this.stomp.debug=this.debug,this.stomp.connect(c,function(a){f.resolve(a)},function(a){f.reject(a),angular.isFunction(d)&&d(a)}),f.promise},this.disconnect=function(){var a=b.defer();return this.stomp.disconnect(a.resolve),a.promise},this.subscribe=this.on=function(a,b,c){return c=c||{},this.stomp.subscribe(a,function(a){var c=null;try{c=JSON.parse(a.body)}finally{b&&b(c,a.headers,a)}},c)},this.unsubscribe=this.off=function(a){a.unsubscribe()},this.send=function(a,c,d){var e=b.defer();try{var f=JSON.stringify(c);d=d||{},this.stomp.send(a,d,f),e.resolve()}catch(a){e.reject(a)}return e.promise}}])}(); \ No newline at end of file diff --git a/dist/ng-stomp.standalone.min.js b/dist/ng-stomp.standalone.min.js index f1c5b20..cb98a95 100644 --- a/dist/ng-stomp.standalone.min.js +++ b/dist/ng-stomp.standalone.min.js @@ -1,19 +1,10 @@ -/* sockjs-client v1.1.1 | http://sockjs.org | MIT license */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.SockJS=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)d[e-1]=arguments[e];for(var f=0;f1?this._listeners[a]=c.slice(0,d).concat(c.slice(d+1)):delete this._listeners[a]):void 0}},c.prototype.dispatchEvent=function(){var a=arguments[0],b=a.type,c=1===arguments.length?[a]:Array.apply(null,arguments);if(this["on"+b]&&this["on"+b].apply(this,c),b in this._listeners)for(var d=this._listeners[b],e=0;e=3e3&&4999>=a}a("./shims");var f,g=a("url-parse"),h=a("inherits"),i=a("json3"),j=a("./utils/random"),k=a("./utils/escape"),l=a("./utils/url"),m=a("./utils/event"),n=a("./utils/transport"),o=a("./utils/object"),p=a("./utils/browser"),q=a("./utils/log"),r=a("./event/event"),s=a("./event/eventtarget"),t=a("./location"),u=a("./event/close"),v=a("./event/trans-message"),w=a("./info-receiver");h(d,s),d.prototype.close=function(a,b){if(a&&!e(a))throw new Error("InvalidAccessError: Invalid code");if(b&&b.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==d.CLOSING&&this.readyState!==d.CLOSED){var c=!0;this._close(a||1e3,b||"Normal closure",c)}},d.prototype.send=function(a){if("string"!=typeof a&&(a=""+a),this.readyState===d.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===d.OPEN&&this._transport.send(k.quote(a))},d.version=a("./version"),d.CONNECTING=0,d.OPEN=1,d.CLOSING=2,d.CLOSED=3,d.prototype._receiveInfo=function(a,b){if(this._ir=null,!a)return void this._close(1002,"Cannot connect to server");this._rto=this.countRTO(b),this._transUrl=a.base_url?a.base_url:this.url,a=o.extend(a,this._urlInfo);var c=f.filterToEnabled(this._transportsWhitelist,a);this._transports=c.main,this._connect()},d.prototype._connect=function(){for(var a=this._transports.shift();a;a=this._transports.shift()){if(a.needBody&&(!c.document.body||"undefined"!=typeof c.document.readyState&&"complete"!==c.document.readyState&&"interactive"!==c.document.readyState))return this._transports.unshift(a),void m.attachEvent("load",this._connect.bind(this));var b=this._rto*a.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),b);var d=l.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),e=this._transportOptions[a.transportName],f=new a(d,this._transUrl,e);return f.on("message",this._transportMessage.bind(this)),f.once("close",this._transportClose.bind(this)),f.transportName=a.transportName,void(this._transport=f)}this._close(2e3,"All transports failed",!1)},d.prototype._transportTimeout=function(){this.readyState===d.CONNECTING&&this._transportClose(2007,"Transport timed out")},d.prototype._transportMessage=function(a){var b,c=this,d=a.slice(0,1),e=a.slice(1);switch(d){case"o":return void this._open();case"h":return void this.dispatchEvent(new r("heartbeat"))}if(e)try{b=i.parse(e)}catch(a){}if("undefined"!=typeof b)switch(d){case"a":Array.isArray(b)&&b.forEach(function(a){c.dispatchEvent(new v(a))});break;case"m":this.dispatchEvent(new v(b));break;case"c":Array.isArray(b)&&2===b.length&&this._close(b[0],b[1],!0)}},d.prototype._transportClose=function(a,b){return this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),e(a)||2e3===a||this.readyState!==d.CONNECTING?void this._close(a,b):void this._connect()},d.prototype._open=function(){this.readyState===d.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=d.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new r("open"))):this._close(1006,"Server lost session")},d.prototype._close=function(a,b,c){var e=!1;if(this._ir&&(e=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===d.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=d.CLOSING,setTimeout(function(){this.readyState=d.CLOSED,e&&this.dispatchEvent(new r("error"));var f=new u("close");f.wasClean=c||!1,f.code=a||1e3,f.reason=b,this.dispatchEvent(f),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},d.prototype.countRTO=function(a){return a>100?4*a:300+a},b.exports=function(b){return f=n(b),a("./iframe-bootstrap")(d,b),d}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,debug:void 0,inherits:54,json3:55,"url-parse":56}],15:[function(){"use strict";function a(a){var b=+a;return b!==b?b=0:0!==b&&b!==1/0&&b!==-(1/0)&&(b=(b>0||-1)*Math.floor(Math.abs(b))),b}function b(a){return a>>>0}function c(){}var d,e=Array.prototype,f=Object.prototype,g=Function.prototype,h=String.prototype,i=e.slice,j=f.toString,k=function(a){return"[object Function]"===f.toString.call(a)},l=function(a){return"[object Array]"===j.call(a)},m=function(a){return"[object String]"===j.call(a)},n=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(a){return!1}}();d=n?function(a,b,c,d){!d&&b in a||Object.defineProperty(a,b,{configurable:!0,enumerable:!1,writable:!0,value:c})}:function(a,b,c,d){!d&&b in a||(a[b]=c)};var o=function(a,b,c){for(var e in b)f.hasOwnProperty.call(b,e)&&d(a,e,b[e],c)},p=function(a){if(null==a)throw new TypeError("can't convert "+a+" to object");return Object(a)};o(g,{bind:function(a){var b=this;if(!k(b))throw new TypeError("Function.prototype.bind called on incompatible "+b);for(var d=i.call(arguments,1),e=function(){if(this instanceof j){var c=b.apply(this,d.concat(i.call(arguments)));return Object(c)===c?c:this}return b.apply(a,d.concat(i.call(arguments)))},f=Math.max(0,b.length-d.length),g=[],h=0;f>h;h++)g.push("$"+h);var j=Function("binder","return function ("+g.join(",")+"){ return binder.apply(this, arguments); }")(e);return b.prototype&&(c.prototype=b.prototype,j.prototype=new c,c.prototype=null),j}}),o(Array,{isArray:l});var q=Object("a"),r="a"!==q[0]||!(0 in q),s=function(a){var b=!0,c=!0;return a&&(a.call("foo",function(a,c,d){"object"!=typeof d&&(b=!1)}),a.call([1],function(){c="string"==typeof this},"x")),!!a&&b&&c};o(e,{forEach:function(a){var b=p(this),c=r&&m(this)?this.split(""):b,d=arguments[1],e=-1,f=c.length>>>0;if(!k(a))throw new TypeError;for(;++e>>0;if(!d)return-1;var e=0;for(arguments.length>1&&(e=a(arguments[1])),e=e>=0?e:Math.max(0,d+e);d>e;e++)if(e in c&&c[e]===b)return e;return-1}},t);var u=h.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var a=void 0===/()??/.exec("")[1];h.split=function(c,d){var f=this;if(void 0===c&&0===d)return[];if("[object RegExp]"!==j.call(c))return u.call(this,c,d);var g,h,i,k,l=[],m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.extended?"x":"")+(c.sticky?"y":""),n=0;for(c=new RegExp(c.source,m+"g"),f+="",a||(g=new RegExp("^"+c.source+"$(?!\\s)",m)),d=void 0===d?-1>>>0:b(d);(h=c.exec(f))&&(i=h.index+h[0].length,!(i>n&&(l.push(f.slice(n,h.index)),!a&&h.length>1&&h[0].replace(g,function(){for(var a=1;a1&&h.index=d)));)c.lastIndex===h.index&&c.lastIndex++;return n===f.length?(k||!c.test(""))&&l.push(""):l.push(f.slice(n)),l.length>d?l.slice(0,d):l}}():"0".split(void 0,0).length&&(h.split=function(a,b){return void 0===a&&0===b?[]:u.call(this,a,b)});var v="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",w="​",x="["+v+"]",y=new RegExp("^"+x+x+"*"),z=new RegExp(x+x+"*$"),A=h.trim&&(v.trim()||!w.trim());o(h,{trim:function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(y,"").replace(z,"")}},A);var B=h.substr,C="".substr&&"b"!=="0b".substr(-1);o(h,{substr:function(a,b){return B.call(this,0>a&&(a=this.length+a)<0?0:a,b)}},C)},{}],16:[function(a,b){"use strict";b.exports=[a("./transport/websocket"),a("./transport/xhr-streaming"),a("./transport/xdr-streaming"),a("./transport/eventsource"),a("./transport/lib/iframe-wrap")(a("./transport/eventsource")),a("./transport/htmlfile"),a("./transport/lib/iframe-wrap")(a("./transport/htmlfile")),a("./transport/xhr-polling"),a("./transport/xdr-polling"),a("./transport/lib/iframe-wrap")(a("./transport/xhr-polling")),a("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(a,b){(function(c){"use strict";function d(a,b,c,d){var f=this;e.call(this),setTimeout(function(){f._start(a,b,c,d)},0)}var e=a("events").EventEmitter,f=a("inherits"),g=a("../../utils/event"),h=a("../../utils/url"),i=c.XMLHttpRequest;f(d,e),d.prototype._start=function(a,b,c,e){var f=this;try{this.xhr=new i}catch(a){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();b=h.addQuery(b,"t="+ +new Date),this.unloadRef=g.unloadAdd(function(){f._cleanup(!0)});try{this.xhr.open(a,b,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){f.emit("finish",0,""),f._cleanup(!1)})}catch(a){return this.emit("finish",0,""),void this._cleanup(!1)}if(e&&e.noCredentials||!d.supportsCORS||(this.xhr.withCredentials="true"),e&&e.headers)for(var j in e.headers)this.xhr.setRequestHeader(j,e.headers[j]);this.xhr.onreadystatechange=function(){if(f.xhr){var a,b,c=f.xhr;switch(c.readyState){case 3:try{b=c.status,a=c.responseText}catch(a){}1223===b&&(b=204),200===b&&a&&a.length>0&&f.emit("chunk",b,a);break;case 4:b=c.status,1223===b&&(b=204),(12005===b||12029===b)&&(b=0),f.emit("finish",b,c.responseText),f._cleanup(!1)}}};try{f.xhr.send(c)}catch(a){f.emit("finish",0,""),f._cleanup(!1)}},d.prototype._cleanup=function(a){if(this.xhr){if(this.removeAllListeners(),g.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),a)try{this.xhr.abort()}catch(a){}this.unloadRef=this.xhr=null}},d.prototype.close=function(){this._cleanup(!0)},d.enabled=!!i;var j=["Active"].concat("Object").join("X");!d.enabled&&j in c&&(i=function(){try{return new c[j]("Microsoft.XMLHTTP")}catch(a){return null}},d.enabled=!!new i);var k=!1;try{k="withCredentials"in new i}catch(a){}d.supportsCORS=k,b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,debug:void 0,events:3,inherits:54}],18:[function(a,b){(function(a){b.exports=a.EventSource}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(a,b){(function(a){"use strict";var c=a.WebSocket||a.MozWebSocket;c&&(b.exports=function(a){return new c(a)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(a,b){"use strict";function c(a){if(!c.enabled())throw new Error("Transport created when disabled");e.call(this,a,"/eventsource",f,g)}var d=a("inherits"),e=a("./lib/ajax-based"),f=a("./receiver/eventsource"),g=a("./sender/xhr-cors"),h=a("eventsource");d(c,e),c.enabled=function(){return!!h},c.transportName="eventsource",c.roundTrips=2,b.exports=c},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,eventsource:18,inherits:54}],21:[function(a,b){"use strict";function c(a){if(!e.enabled)throw new Error("Transport created when disabled");g.call(this,a,"/htmlfile",e,f)}var d=a("inherits"),e=a("./receiver/htmlfile"),f=a("./sender/xhr-local"),g=a("./lib/ajax-based");d(c,g),c.enabled=function(a){return e.enabled&&a.sameOrigin},c.transportName="htmlfile",c.roundTrips=2,b.exports=c},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,inherits:54}],22:[function(a,b){"use strict";function c(a,b,d){if(!c.enabled())throw new Error("Transport created when disabled");f.call(this);var e=this;this.origin=h.getOrigin(d),this.baseUrl=d,this.transUrl=b,this.transport=a,this.windowId=k.string(8);var g=h.addPath(d,"/iframe.html")+"#"+this.windowId;this.iframeObj=i.createIframe(g,function(a){e.emit("close",1006,"Unable to load an iframe ("+a+")"),e.close()}),this.onmessageCallback=this._message.bind(this),j.attachEvent("message",this.onmessageCallback)}var d=a("inherits"),e=a("json3"),f=a("events").EventEmitter,g=a("../version"),h=a("../utils/url"),i=a("../utils/iframe"),j=a("../utils/event"),k=a("../utils/random");d(c,f),c.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){j.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(a){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},c.prototype._message=function(a){if(h.isOriginEqual(a.origin,this.origin)){var b;try{b=e.parse(a.data)}catch(a){return}if(b.windowId===this.windowId)switch(b.type){case"s":this.iframeObj.loaded(),this.postMessage("s",e.stringify([g,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",b.data);break;case"c":var c;try{c=e.parse(b.data)}catch(a){return}this.emit("close",c[0],c[1]),this.close()}}},c.prototype.postMessage=function(a,b){this.iframeObj.post(e.stringify({windowId:this.windowId,type:a,data:b||""}),this.origin)},c.prototype.send=function(a){this.postMessage("m",a)},c.enabled=function(){return i.iframeEnabled},c.transportName="iframe",c.roundTrips=2,b.exports=c},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,debug:void 0,events:3,inherits:54,json3:55}],23:[function(a,b){(function(c){"use strict";function d(a){if(!d.enabled())throw new Error("Transport created when disabled");f.call(this,a,"/jsonp",h,g)}var e=a("inherits"),f=a("./lib/sender-receiver"),g=a("./receiver/jsonp"),h=a("./sender/jsonp");e(d,f),d.enabled=function(){return!!c.document},d.transportName="jsonp-polling",d.roundTrips=1,d.needBody=!0,b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,inherits:54}],24:[function(a,b){"use strict";function c(a){return function(b,c,d){var e={};"string"==typeof c&&(e.headers={"Content-type":"text/plain"});var g=f.addPath(b,"/xhr_send"),h=new a("POST",g,c,e);return h.once("finish",function(a){return h=null,200!==a&&204!==a?d(new Error("http status "+a)):void d()}),function(){h.close(),h=null;var a=new Error("Aborted");a.code=1e3,d(a)}}}function d(a,b,d,e){g.call(this,a,b,c(e),d,e)}var e=a("inherits"),f=a("../../utils/url"),g=a("./sender-receiver");e(d,g),b.exports=d},{"../../utils/url":52,"./sender-receiver":28,debug:void 0,inherits:54}],25:[function(a,b){"use strict";function c(a,b){e.call(this),this.sendBuffer=[],this.sender=b,this.url=a}var d=a("inherits"),e=a("events").EventEmitter;d(c,e),c.prototype.send=function(a){this.sendBuffer.push(a),this.sendStop||this.sendSchedule()},c.prototype.sendScheduleWait=function(){var a,b=this;this.sendStop=function(){b.sendStop=null,clearTimeout(a)},a=setTimeout(function(){b.sendStop=null,b.sendSchedule()},25)},c.prototype.sendSchedule=function(){var a=this;if(this.sendBuffer.length>0){var b="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,b,function(b){a.sendStop=null,b?(a.emit("close",b.code||1006,"Sending error: "+b),a._cleanup()):a.sendScheduleWait()}),this.sendBuffer=[]}},c.prototype._cleanup=function(){this.removeAllListeners()},c.prototype.stop=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},b.exports=c},{debug:void 0,events:3,inherits:54}],26:[function(a,b){(function(c){"use strict";var d=a("inherits"),e=a("../iframe"),f=a("../../utils/object");b.exports=function(a){function b(b,c){e.call(this,a.transportName,b,c)}return d(b,e),b.enabled=function(b,d){if(!c.document)return!1;var g=f.extend({},d);return g.sameOrigin=!0,a.enabled(g)&&e.enabled()},b.transportName="iframe-"+a.transportName,b.needBody=!0,b.roundTrips=e.roundTrips+a.roundTrips-1,b.facadeTransport=a,b}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,inherits:54}],27:[function(a,b){"use strict";function c(a,b,c){e.call(this),this.Receiver=a,this.receiveUrl=b,this.AjaxObject=c,this._scheduleReceiver()}var d=a("inherits"),e=a("events").EventEmitter;d(c,e),c.prototype._scheduleReceiver=function(){var a=this,b=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);b.on("message",function(b){a.emit("message",b)}),b.once("close",function(c,d){a.poll=b=null,a.pollIsClosing||("network"===d?a._scheduleReceiver():(a.emit("close",c||1006,d),a.removeAllListeners()))})},c.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},b.exports=c},{debug:void 0,events:3,inherits:54}],28:[function(a,b){"use strict";function c(a,b,c,d,h){var i=e.addPath(a,b),j=this;f.call(this,a,c),this.poll=new g(d,i,h),this.poll.on("message",function(a){j.emit("message",a)}),this.poll.once("close",function(a,b){j.poll=null,j.emit("close",a,b),j.close()})}var d=a("inherits"),e=a("../../utils/url"),f=a("./buffered-sender"),g=a("./polling");d(c,f),c.prototype.close=function(){this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null),this.stop()},b.exports=c},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,debug:void 0,inherits:54}],29:[function(a,b){"use strict";function c(a){e.call(this);var b=this,c=this.es=new f(a);c.onmessage=function(a){b.emit("message",decodeURI(a.data))},c.onerror=function(a){var d=2!==c.readyState?"network":"permanent";b._cleanup(),b._close(d)}}var d=a("inherits"),e=a("events").EventEmitter,f=a("eventsource");d(c,e),c.prototype.abort=function(){this._cleanup(),this._close("user")},c.prototype._cleanup=function(){var a=this.es;a&&(a.onmessage=a.onerror=null,a.close(),this.es=null)},c.prototype._close=function(a){var b=this;setTimeout(function(){b.emit("close",null,a),b.removeAllListeners()},200)},b.exports=c},{debug:void 0,events:3,eventsource:18,inherits:54}],30:[function(a,b){(function(c){"use strict";function d(a){h.call(this);var b=this;f.polluteGlobalNamespace(),this.id="a"+i.string(6),a=g.addQuery(a,"c="+decodeURIComponent(f.WPrefix+"."+this.id));var e=d.htmlfileEnabled?f.createHtmlfile:f.createIframe;c[f.WPrefix][this.id]={start:function(){b.iframeObj.loaded()},message:function(a){b.emit("message",a)},stop:function(){b._cleanup(),b._close("network")}},this.iframeObj=e(a,function(){b._cleanup(),b._close("permanent")})}var e=a("inherits"),f=a("../../utils/iframe"),g=a("../../utils/url"),h=a("events").EventEmitter,i=a("../../utils/random");e(d,h),d.prototype.abort=function(){this._cleanup(),this._close("user")},d.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete c[f.WPrefix][this.id]},d.prototype._close=function(a){this.emit("close",null,a),this.removeAllListeners()},d.htmlfileEnabled=!1;var j=["Active"].concat("Object").join("X");if(j in c)try{d.htmlfileEnabled=!!new c[j]("htmlfile")}catch(a){}d.enabled=d.htmlfileEnabled||f.iframeEnabled,b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],31:[function(a,b){(function(c){"use strict";function d(a){var b=this;j.call(this),e.polluteGlobalNamespace(),this.id="a"+f.string(6);var g=h.addQuery(a,"c="+encodeURIComponent(e.WPrefix+"."+this.id));c[e.WPrefix][this.id]=this._callback.bind(this),this._createScript(g),this.timeoutId=setTimeout(function(){b._abort(new Error("JSONP script loaded abnormally (timeout)"))},d.timeout)}var e=a("../../utils/iframe"),f=a("../../utils/random"),g=a("../../utils/browser"),h=a("../../utils/url"),i=a("inherits"),j=a("events").EventEmitter;i(d,j),d.prototype.abort=function(){if(c[e.WPrefix][this.id]){var a=new Error("JSONP user aborted read");a.code=1e3,this._abort(a)}},d.timeout=35e3,d.scriptErrorTimeout=1e3,d.prototype._callback=function(a){this._cleanup(),this.aborting||(a&&this.emit("message",a),this.emit("close",null,"network"),this.removeAllListeners())},d.prototype._abort=function(a){this._cleanup(),this.aborting=!0,this.emit("close",a.code,a.message),this.removeAllListeners()},d.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var a=this.script;a.parentNode.removeChild(a),a.onreadystatechange=a.onerror=a.onload=a.onclick=null,this.script=null}delete c[e.WPrefix][this.id]},d.prototype._scriptError=function(){var a=this;this.errorTimer||(this.errorTimer=setTimeout(function(){a.loadedOkay||a._abort(new Error("JSONP script loaded abnormally (onerror)"))},d.scriptErrorTimeout))},d.prototype._createScript=function(a){var b,d=this,e=this.script=c.document.createElement("script");if(e.id="a"+f.string(8),e.src=a,e.type="text/javascript",e.charset="UTF-8",e.onerror=this._scriptError.bind(this),e.onload=function(){d._abort(new Error("JSONP script loaded abnormally (onload)"))},e.onreadystatechange=function(){if(/loaded|closed/.test(e.readyState)){if(e&&e.htmlFor&&e.onclick){d.loadedOkay=!0;try{e.onclick()}catch(a){}}e&&d._abort(new Error("JSONP script loaded abnormally (onreadystatechange)")); -}},"undefined"==typeof e.async&&c.document.attachEvent)if(g.isOpera())b=this.script2=c.document.createElement("script"),b.text="try{var a = document.getElementById('"+e.id+"'); if(a)a.onerror();}catch(x){};",e.async=b.async=!1;else{try{e.htmlFor=e.id,e.event="onclick"}catch(a){}e.async=!0}"undefined"!=typeof e.async&&(e.async=!0);var h=c.document.getElementsByTagName("head")[0];h.insertBefore(e,h.firstChild),b&&h.insertBefore(b,h.firstChild)},b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],32:[function(a,b){"use strict";function c(a,b){e.call(this);var c=this;this.bufferPosition=0,this.xo=new b("POST",a,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(a,b){c._chunkHandler(a,b),c.xo=null;var d=200===a?"network":"permanent";c.emit("close",null,d),c._cleanup()})}var d=a("inherits"),e=a("events").EventEmitter;d(c,e),c.prototype._chunkHandler=function(a,b){if(200===a&&b)for(var c=-1;;this.bufferPosition+=c+1){var d=b.slice(this.bufferPosition);if(c=d.indexOf("\n"),-1===c)break;var e=d.slice(0,c);e&&this.emit("message",e)}},c.prototype._cleanup=function(){this.removeAllListeners()},c.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},b.exports=c},{debug:void 0,events:3,inherits:54}],33:[function(a,b){(function(c){"use strict";function d(a){try{return c.document.createElement('