faye 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6360fb99c07ebc88410222fab2f63fe2e01ce4ccc20b044ce1af8b9abce23a88
4
- data.tar.gz: df9d35e5534ae844d428fa32a81d4c496072eb4d638231d884988a5bb6d1ea5e
3
+ metadata.gz: 75788ddfabe886ea54ef361093becae8966721c002d50f15cc73fdcc5e8d9989
4
+ data.tar.gz: ffed4468e7ee32ab131191edae3cca52f96cfacd7ae6680db73e6922471a464d
5
5
  SHA512:
6
- metadata.gz: 6ab5b18b7dc99264d45a80b17890982e0b6373634b9b44c0b39d57ce5474f6e278aea0b56104f932d61b05482a17483af1ec58cb6b6a29a430c3e42b6d3d86e3
7
- data.tar.gz: 131c7e89ce4f7af23e76c9c57b0ac0f63c5da58ac417991e1a381009dc5e2007eab6bf9c9bccb1a62ca1eefe1601d0b8f744f6b41fcf29f9c868bbd30f6d07b4
6
+ metadata.gz: 6d2955083bd87e4c290f3331551d5ec477e57c401b9aadc75aa94f78b1a208962248238fdda186b99c317b4a5aacfc7707d262ea0465e3c8c31f6152f00d22bc
7
+ data.tar.gz: 92c68a4b89f3e730aa1e0ace1ec2ba2bf1640a7625ae2ab98f5625fbc4c2af9ec016e16410d03600ea41caad793f14429d1da5eb8ee18ca55617dffe5c3df73b
@@ -1,3 +1,12 @@
1
+ ### 1.4.0 / 2020-07-31
2
+
3
+ - Implement TLS certificate verification and enable it by default in the Ruby
4
+ client class `Faye::Client`
5
+ - Add a `:tls` option to the Ruby client with sub-field `:verify_peer` for
6
+ configuring TLS verification
7
+ - Officially support the `tls` option in the Node.js client, whose contents are
8
+ forward to the `https` and `tls` modules as appropriate
9
+
1
10
  ### 1.3.0 / 2020-06-08
2
11
 
3
12
  - Support `user:pass@` authorization in URIs and send `Authorization` headers
@@ -1,2 +1,2 @@
1
- var Faye=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";var i=Array.prototype.forEach,s=Object.prototype.hasOwnProperty;t.exports=function(t){return i.call(arguments,(function(e,n){if(0!==n)for(var i in e)s.call(e,i)&&(t[i]=e[i])})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports={isURI:function(t){return t&&t.protocol&&t.host&&t.path},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t){if("string"!=typeof t)return t;var e,n,i,s,r,o,c={},a=function(e,n){t=t.replace(n,(function(t){return c[e]=t,""})),c[e]=c[e]||""};for(a("protocol",/^[a-z]+\:/i),a("host",/^\/\/[^\/\?#]+/),/^\//.test(t)||c.host||(t=location.pathname.replace(/[^\/]*$/,"")+t),a("pathname",/^[^\?#]*/),a("search",/^\?[^#]*/),a("hash",/^#.*/),c.protocol=c.protocol||location.protocol,c.host?(c.host=c.host.substr(2),/@/.test(c.host)&&(c.auth=c.host.split("@")[0],c.host=c.host.split("@")[1]),e=c.host.match(/^\[([^\]]+)\]|^[^:]+/),c.hostname=e[1]||e[0],c.port=(c.host.match(/:(\d+)$/)||[])[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,o={},s=0,r=(i=(n=c.search.replace(/^\?/,""))?n.split("&"):[]).length;s<r;s++)e=i[s].split("="),o[decodeURIComponent(e[0]||"")]=decodeURIComponent(e[1]||"");return c.query=o,c.href=this.stringify(c),c},stringify:function(t){var e=t.auth?t.auth+"@":"",n=t.protocol+"//"+e+t.host;return n+=t.pathname+this.queryString(t.query)+(t.hash||"")},queryString:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return 0===e.length?"":"?"+e.join("&")}}},function(t,e,n){"use strict";var i=n(1),s=n(18).Cookie,r=n(6),o=n(11),c=n(0),a=n(8),h=n(29),u=n(15),l=c(i({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},MAX_DELAY:0,batching:!0,initialize:function(t,e){this._dispatcher=t,this.endpoint=e,this._outbox=[],this._proxy=c({},this._dispatcher.proxy),this._proxy.origin||(this._proxy.origin=this._findProxy())},close:function(){},encode:function(t){return""},sendMessage:function(t){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,this.endpoint.href,t),this.batching?(this._outbox.push(t),this._flushLargeBatch(),t.channel===u.HANDSHAKE?this._publish(.01):(t.channel===u.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):r.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new r((function(e){t._resolvePromise=e}))},_publish:function(t){return this._makePromise(),this.addTimeout("publish",t,(function(){this._flush(),delete this._requestPromise}),this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length<this._dispatcher.maxRequestSize)){var t=this._outbox.pop();this._makePromise(),this._flush(),t&&this._outbox.push(t)}},_receive:function(t){if(t){t=[].concat(t),this.debug("Client ? received from ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var e=0,n=t.length;e<n;e++)this._dispatcher.handleResponse(t[e])}},_handleError:function(t,e){t=[].concat(t),this.debug("Client ? failed to send to ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var n=0,i=t.length;n<i;n++)this._dispatcher.handleError(t[n])},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?o.map(t.getCookiesSync(e),(function(t){return t.cookieString()})).join("; "):""},_storeCookies:function(t){var e,n=this._dispatcher.cookies,i=this.endpoint.href;if(t&&n)for(var r=0,o=(t=[].concat(t)).length;r<o;r++)e=s.parse(t[r]),n.setCookieSync(e,i)},_findProxy:function(){if("undefined"!=typeof process){var t=this.endpoint.protocol;if(t){var e,n,i=t.replace(/:$/,"").toLowerCase()+"_proxy",s=i.toUpperCase(),r=process.env;return"http_proxy"===i&&r.REQUEST_METHOD?(1===(e=Object.keys(r).filter((function(t){return/^http_proxy$/i.test(t)}))).length?e[0]===i&&void 0===r[s]&&(n=r[i]):e.length>1&&(n=r[i]),n=n||r["CGI_"+s]):(n=r[i]||r[s])&&!r[i]&&console.warn("The environment variable "+s+" is discouraged. Use "+i+"."),n}}}}),{get:function(t,e,n,i,s){var r=t.endpoint;o.asyncEach(this._transports,(function(r,c){var a=r[0],h=r[1],u=t.endpointFor(a);return o.indexOf(n,a)>=0?c():o.indexOf(e,a)<0?(h.isUsable(t,u,(function(){})),c()):void h.isUsable(t,u,(function(e){if(!e)return c();var n=h.hasOwnProperty("create")?h.create(t,u):new h(t,u);i.call(s,n)}))}),(function(){throw new Error("Could not find a usable connection type for "+r.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return o.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(var e=0;e<this._transports.length;e++)this._transports[e][1]._unloaded=!1},_transports:[]});c(l.prototype,a),c(l.prototype,h),t.exports=l},function(t,e,n){"use strict";t.exports=function(t){return JSON.stringify(t,(function(t,e){return this[t]instanceof Array?this[t]:e}))}},function(t,e,n){"use strict";var i=n(13),s=function(t){this._state=-1,this._value=null,this._defer=[],r(this,t)};s.prototype.then=function(t,e){var n=new s,i={promise:n,onFulfilled:t,onRejected:e};return-1===this._state?this._defer.push(i):o(this,i),n},s.prototype.catch=function(t){return this.then(null,t)};var r=function(t,e){if("function"==typeof e){var n=0,i=function(e){0==n++&&u(t,e)};try{e((function(e){0==n++&&c(t,e)}),i)}catch(t){i(t)}}},o=function(t,e){var n=t._state,s=t._value,r=e.promise,o=[e.onFulfilled,e.onRejected][n];if("function"!=typeof o)return(0,[c,u][n])(r,s);i((function(){try{c(r,o(s))}catch(t){u(r,t)}}))},c=function(t,e){if(t===e)return u(t,new TypeError("Recursive promise chain detected"));var n;try{n=a(e)}catch(e){return u(t,e)}if(!n)return h(t,e);r(t,(function(t,i){n.call(e,t,i)}))},a=function(t){var e=typeof t,n=("object"===e||"function"===e)&&t&&t.then;return"function"==typeof n?n:null},h=function(t,e){l(t,0,e)},u=function(t,e){l(t,1,e)},l=function(t,e,n){var i=t._defer,s=0;if(t._state=e,t._value=n,t._defer=null,0!==i.length)for(;s<i.length;)o(t,i[s++])};s.resolve=function(t){try{if(a(t))return t}catch(t){return s.reject(t)}return new s((function(e,n){e(t)}))},s.reject=function(t){return new s((function(e,n){n(t)}))},s.all=function(t){return new s((function(e,n){var i,r=[],o=t.length;if(0===o)return e(r);var c=function(t,i){s.resolve(t).then((function(t){r[i]=t,0==--o&&e(r)}),n)};for(i=0;i<o;i++)c(t[i],i)}))},s.race=function(t){return new s((function(e,n){for(var i=0,r=t.length;i<r;i++)s.resolve(t[i]).then(e,n)}))},s.deferred=function(){var t={};return t.promise=new s((function(e,n){t.resolve=e,t.reject=n})),t},t.exports=s},function(t,e,n){"use strict";(function(e){var i=n(6);t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new i((function(t,e){n._resolve=t,n._reject=e}))),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){return this.then((function(n){t.call(e,n)}))},errback:function(t,e){return this.then(null,(function(n){t.call(e,n)}))},timeout:function(t,n){this.then();var i=this;this._timer=e.setTimeout((function(){i._reject(n)}),1e3*t)},setDeferredStatus:function(t,n){this._timer&&e.clearTimeout(this._timer),this.then(),"succeeded"===t?this._resolve(n):"failed"===t?this._reject(n):delete this._promise}}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(5),s={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(t,e){var n=s.logger||(s.wrapper||s).logger;if(n){var r=Array.prototype.slice.apply(t),o="[Faye",c=this.className,a=r.shift().replace(/\?/g,(function(){try{return i(r.shift())}catch(t){return"[Object]"}}));c&&(o+="."+c),o+="] ","function"==typeof n[e]?n[e](o+a):"function"==typeof n&&n(o+a)}}};for(var r in s.LOG_LEVELS)!function(t){s[t]=function(){this.writeLog(arguments,t)}}(r);t.exports=s},function(t,e,n){"use strict";var i={countListeners:function(t){return this.listeners(t).length},bind:function(t,e,n){var i=Array.prototype.slice,s=function(){e.apply(n,i.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([t,e,n,s]),this.on(t,s)},unbind:function(t,e,n){this._listeners=this._listeners||[];for(var i,s=this._listeners.length;s--;)(i=this._listeners[s])[0]===t&&(!e||i[1]===e&&i[2]===n)&&(this._listeners.splice(s,1),this.removeListener(t,i[3]))}};n(0)(i,n(28).prototype),i.trigger=i.emit,t.exports=i},,function(t,e,n){"use strict";t.exports={commonElement:function(t,e){for(var n=0,i=t.length;n<i;n++)if(-1!==this.indexOf(e,t[n]))return t[n];return null},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},map:function(t,e,n){if(t.map)return t.map(e,n);var i=[];if(t instanceof Array)for(var s=0,r=t.length;s<r;s++)i.push(e.call(n||null,t[s],s));else for(var o in t)t.hasOwnProperty(o)&&i.push(e.call(n||null,o,t[o]));return i},filter:function(t,e,n){if(t.filter)return t.filter(e,n);for(var i=[],s=0,r=t.length;s<r;s++)e.call(n||null,t[s],s)&&i.push(t[s]);return i},asyncEach:function(t,e,n,i){var s=t.length,r=-1,o=0,c=!1,a=function(){if(o-=1,(r+=1)===s)return n&&n.call(i);e(t[r],h)},h=function(){o+=1,function(){if(!c){for(c=!0;o>0;)a();c=!1}}()};h()}}},function(t,e,n){"use strict";var i=function(t){var e,n,s;if(t instanceof Array){for(e=[],n=t.length;n--;)e[n]=i(t[n]);return e}if("object"==typeof t){for(s in e=null===t?null:{},t)e[s]=i(t[s]);return e}return t};t.exports=i},function(t,e,n){"use strict";var i=n(26),s=[],r=[],o=i.makeRequestCallFromTimer((function(){if(r.length)throw r.shift()}));function c(t){var e;(e=s.length?s.pop():new a).task=t,i(e)}function a(){this.task=null}t.exports=c,a.prototype.call=function(){try{this.task.call()}catch(t){c.onerror?c.onerror(t):(r.push(t),o())}finally{this.task=null,s[s.length]=this}}},function(t,e,n){"use strict";(function(e){var n={_registry:[],on:function(t,e,n,i){var s=function(){n.call(i)};t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s),this._registry.push({_element:t,_type:e,_callback:n,_context:i,_handler:s})},detach:function(t,e,n,i){for(var s,r=this._registry.length;r--;)s=this._registry[r],t&&t!==s._element||e&&e!==s._type||n&&n!==s._callback||i&&i!==s._context||(s._element.removeEventListener?s._element.removeEventListener(s._type,s._handler,!1):s._element.detachEvent("on"+s._type,s._handler),this._registry.splice(r,1),s=null)}};void 0!==e.onunload&&n.on(e,"unload",n.detach,n),t.exports={Event:n}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(9),o=n(16),c=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});s(c.prototype,r),s(c,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(t){var e=this.parse(t),n=["/**",t],i=e.slice();i[i.length-1]="*",n.push(this.unparse(i));for(var s=1,r=e.length;s<r;s++)(i=e.slice(0,s)).push("**"),n.push(this.unparse(i));return n},isValid:function(t){return o.CHANNEL_NAME.test(t)||o.CHANNEL_PATTERN.test(t)},parse:function(t){return this.isValid(t)?t.split("/").slice(1):null},unparse:function(t){return"/"+t.join("/")},isMeta:function(t){var e=this.parse(t);return e?e[0]===this.META:null},isService:function(t){var e=this.parse(t);return e?e[0]===this.SERVICE:null},isSubscribable:function(t){return this.isValid(t)?!this.isMeta(t)&&!this.isService(t):null},Set:i({initialize:function(){this._channels={}},getKeys:function(){var t=[];for(var e in this._channels)t.push(e);return t},remove:function(t){delete this._channels[t]},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(var n,i=0,s=t.length;i<s;i++){n=t[i],(this._channels[n]=this._channels[n]||new c(n)).bind("message",e)}},unsubscribe:function(t,e){var n=this._channels[t];return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){for(var e=c.expand(t.channel),n=0,i=e.length;n<i;n++){var s=this._channels[e[n]];s&&s.trigger("message",t)}}})}),t.exports=c},function(t,e,n){"use strict";t.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(18),o=n(0),c=n(8),a=n(9),h=n(19),u=n(22),l=i({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(t,e,n){this._client=t,this.endpoint=s.parse(e),this._alternates=n.endpoints||{},this.cookies=r.CookieJar&&new r.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||u,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var i=n.websocketExtensions;if(i)for(var o=0,c=(i=[].concat(i)).length;o<c;o++)this.addWebsocketExtension(i[o]);for(var a in this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca,this._alternates)this._alternates[a]=s.parse(this._alternates[a]);this.maxRequestSize=this.MAX_REQUEST_SIZE},endpointFor:function(t){return this._alternates[t]||this.endpoint},addWebsocketExtension:function(t){this.wsExtensions.push(t)},disable:function(t){this._disabled.push(t),h.disable(t)},setHeader:function(t,e){this.headers[t]=e},close:function(){var t=this._transport;delete this._transport,t&&t.close()},getConnectionTypes:function(){return h.getConnectionTypes()},selectTransport:function(t){h.get(this,t,this._disabled,(function(t){this.debug("Selected ? transport for ?",t.connectionType,t.endpoint.href),t!==this._transport&&(this._transport&&this._transport.close(),this._transport=t,this.connectionType=t.connectionType)}),this)},sendMessage:function(t,e,n){n=n||{};var i,s=t.id,r=n.attempts,o=n.deadline&&(new Date).getTime()+1e3*n.deadline,c=this._envelopes[s];c||(i=new this._scheduler(t,{timeout:e,interval:this.retry,attempts:r,deadline:o}),c=this._envelopes[s]={message:t,scheduler:i}),this._sendEnvelope(c)},_sendEnvelope:function(t){if(this._transport&&!t.request&&!t.timer){var n=t.message,i=t.scheduler,s=this;if(!i.isDeliverable())return i.abort(),void delete this._envelopes[n.id];t.timer=e.setTimeout((function(){s.handleError(n)}),1e3*i.getTimeout()),i.send(),t.request=this._transport.sendMessage(n)}},handleResponse:function(t){var n=this._envelopes[t.id];void 0!==t.successful&&n&&(n.scheduler.succeed(),delete this._envelopes[t.id],e.clearTimeout(n.timer)),this.trigger("message",t),this._state!==this.UP&&(this._state=this.UP,this._client.trigger("transport:up"))},handleError:function(t,n){var i=this._envelopes[t.id],s=i&&i.request,r=this;if(s){s.then((function(t){t&&t.abort&&t.abort()}));var o=i.scheduler;o.fail(),e.clearTimeout(i.timer),i.request=i.timer=null,n?this._sendEnvelope(i):i.timer=e.setTimeout((function(){i.timer=null,r._sendEnvelope(i)}),1e3*o.getInterval()),this._state!==this.DOWN&&(this._state=this.DOWN,this._client.trigger("transport:down"))}}});l.create=function(t,e,n){return new l(t,e,n)},o(l.prototype,a),o(l.prototype,c),t.exports=l}).call(this,n(2))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(4);i.register("websocket",n(30)),i.register("eventsource",n(32)),i.register("long-polling",n(21)),i.register("cross-origin-long-polling",n(33)),i.register("callback-polling",n(34)),t.exports=i},function(t,e,n){"use strict";var i=n(1);t.exports=i({initialize:function(){this._index={}},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.hasOwnProperty(e)&&(this._index[e]=t,!0)},forEach:function(t,e){for(var n in this._index)this._index.hasOwnProperty(n)&&t.call(e,this._index[n])},isEmpty:function(){for(var t in this._index)if(this._index.hasOwnProperty(t))return!1;return!0},member:function(t){for(var e in this._index)if(this._index[e]===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index[e];return delete this._index[e],n},toArray:function(){var t=[];return this.forEach((function(e){t.push(e)})),t}})},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(14),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return c(t)},request:function(t){var n,i=this.endpoint.href,s=this;if(e.XMLHttpRequest)n=new XMLHttpRequest;else{if(!e.ActiveXObject)return this._handleError(t);n=new ActiveXObject("Microsoft.XMLHTTP")}n.open("POST",i,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Pragma","no-cache"),n.setRequestHeader("X-Requested-With","XMLHttpRequest");var o=this._dispatcher.headers;for(var c in o)o.hasOwnProperty(c)&&n.setRequestHeader(c,o[c]);var a=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",a),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,c=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",a),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(c)}catch(t){}i?s._receive(i):s._handleError(t)}},n.send(this.encode(t)),n}}),{isUsable:function(t,e,n,i){var r="ReactNative"===navigator.product||s.isSameOrigin(e);n.call(i,r)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};n(0)(i.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var t=this.options.attempts,e=this.attempts,n=this.options.deadline,i=(new Date).getTime();return!(void 0!==t&&e>=t)&&!(void 0!==n&&i>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=i},function(t,e){t.exports={VERSION:"1.3.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(7),o=i({initialize:function(t,e,n,i){this._client=t,this._channels=e,this._callback=n,this._context=i,this._cancelled=!1},withChannel:function(t,e){return this._withChannel=[t,e],this},apply:function(t,e){var n=e[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});s(o.prototype,r),t.exports=o},function(t,e,n){"use strict";(function(e){var i=n(13),s=n(1),r=(n(6),n(11)),o=n(14),c=n(23),a=n(0),h=n(27),u=n(7),l=n(8),f=n(9),d=n(15),p=n(17),_=n(35),v=n(36),g=n(37),m=n(24),y=s({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(t,n){this.info("New client created for ?",t),h(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(n.interval||this.INTERVAL),timeout:1e3*(n.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){r.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()}),this)},addWebsocketExtension:function(t){return this._dispatcher.addWebsocketExtension(t)},disable:function(t){return this._dispatcher.disable(t)},setHeader:function(t,e){return this._dispatcher.setHeader(t,e)},handshake:function(t,n){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var s=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(c.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:c.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(r){r.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=r.clientId,this._dispatcher.selectTransport(r.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&i((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){s.handshake(t,n)}),1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)}),this)}},connect:function(t,e){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake((function(){this.connect(t,e)}),this);this.callback(t,e),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var t=new g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",_.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return r.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new m(this,t,e,n),s=!0===e;return this._channels.hasSubscription(t)&&!s?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),s||this._channels.subscribe([t],i),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",_.parse(e.error)),this._channels.unsubscribe(t,i);var n=[].concat(e.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),i.setDeferredStatus("succeeded")}),this)}),this),i)},unsubscribe:function(t,e){if(t instanceof Array)return r.map(t,(function(t){return this.unsubscribe(t,e)}),this);this._channels.unsubscribe(t,e)&&this.connect((function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,t),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(t){if(t.successful){var e=[].concat(t.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,e)}}),this)}),this)},publish:function(t,e,n){h(n||{},["attempts","deadline"]);var i=new g;return this.connect((function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,t,e),this._sendMessage({channel:t,data:e,clientId:this._dispatcher.clientId},n,(function(t){t.successful?i.setDeferredStatus("succeeded"):i.setDeferredStatus("failed",_.parse(t.error))}),this)}),this),i},_sendMessage:function(t,e,n,i){t.id=this._generateMessageId();var s=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",t,null,(function(t){t&&(n&&(this._responseCallbacks[t.id]=[n,i]),this._dispatcher.sendMessage(t,s,e||{}))}),this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(t){var e,n=t.id;void 0!==t.successful&&(e=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",t,null,(function(t){t&&(t.advice&&this._handleAdvice(t.advice),this._deliverMessage(t),e&&e[0].call(e[1],t))}),this)},_handleAdvice:function(t){a(this._advice,t),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(t){t.channel&&void 0!==t.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,t.channel,t.data),this._channels.distributeMessage(t))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var t=this;e.setTimeout((function(){t.connect()}),this._advice.interval)}});a(y.prototype,u),a(y.prototype,f),a(y.prototype,l),a(y.prototype,v),t.exports=y}).call(this,n(2))},function(t,e,n){"use strict";(function(e){function n(t){s.length||(i(),!0),s[s.length]=t}t.exports=n;var i,s=[],r=0;function o(){for(;r<s.length;){var t=r;if(r+=1,s[t].call(),r>1024){for(var e=0,n=s.length-r;e<n;e++)s[e]=s[e+r];s.length-=r,r=0}}s.length=0,r=0,!1}var c,a,h,u=void 0!==e?e:self,l=u.MutationObserver||u.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof l?(c=1,a=new l(o),h=document.createTextNode(""),a.observe(h,{characterData:!0}),i=function(){c=-c,h.data=c}):i=f(o),n.requestFlush=i,n.makeRequestCallFromTimer=f}).call(this,n(2))},function(t,e,n){"use strict";var i=n(11);t.exports=function(t,e){for(var n in t)if(i.indexOf(e,n)<0)throw new Error("Unrecognized option: "+n)}},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(){}t.exports=i,i.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||n(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var i=Array.prototype.slice.call(arguments,1);e.apply(this,i)}return!0}if(n(e)){i=Array.prototype.slice.call(arguments,1);for(var s=e.slice(),r=0,o=s.length;r<o;r++)s[r].apply(this,i);return!0}return!1},i.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");return this._events||(this._events={}),this.emit("newListener",t,e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){var n=this;return n.on(t,(function i(){n.removeListener(t,i),e.apply(this,arguments)})),this},i.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var i=this._events[t];if(n(i)){var s=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}(i,e);if(s<0)return this;i.splice(s,1),0==i.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},i.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},i.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),n(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}},function(t,e,n){"use strict";(function(e){t.exports={addTimeout:function(t,n,i,s){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(t)){var r=this;this._timeouts[t]=e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n)}},removeTimeout:function(t){this._timeouts=this._timeouts||{};var n=this._timeouts[t];n&&(e.clearTimeout(n),delete this._timeouts[t])},removeAllTimeouts:function(){for(var t in this._timeouts=this._timeouts||{},this._timeouts)this.removeTimeout(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(6),r=n(20),o=n(3),c=n(14),a=n(12),h=n(0),u=n(5),l=n(31),f=n(7),d=h(i(n(4),{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)})),this.connect()},request:function(t){this._pending=this._pending||new r;for(var e=0,n=t.length;e<n;e++)this._pending.add(t[e]);var i=this,o=new s((function(e,n){i.callback((function(n){n&&1===n.readyState&&(n.send(u(t)),e(n))})),i.connect()}));return{abort:function(){o.then((function(t){t.close()}))}}},connect:function(){if(!d._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var t=this._createSocket();if(!t)return this.setDeferredStatus("failed");var e=this;t.onopen=function(){t.headers&&e._storeCookies(t.headers["set-cookie"]),e._socket=t,e._state=e.CONNECTED,e._everConnected=!0,e.setDeferredStatus("succeeded",t)};var n=!1;t.onclose=t.onerror=function(){if(!n){n=!0;var i=e._state===e.CONNECTED;t.onopen=t.onclose=t.onerror=t.onmessage=null,delete e._socket,e._state=e.UNCONNECTED;var s=e._pending?e._pending.toArray():[];delete e._pending,i||e._everConnected?(e.setDeferredStatus("unknown"),e._handleError(s,i)):e.setDeferredStatus("failed")}},t.onmessage=function(t){var n;try{n=JSON.parse(t.data)}catch(t){}if(n){for(var i=0,s=(n=[].concat(n)).length;i<s;i++)void 0!==n[i].successful&&e._pending.remove(n[i]);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=d.getSocketUrl(this.endpoint),e=this._dispatcher.headers,n=this._dispatcher.wsExtensions,i=this._getCookies(),s=this._dispatcher.tls,r={extensions:n,headers:e,proxy:this._proxy,tls:s};""!==i&&(r.headers.Cookie=i);try{return l.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports.websocket=t.transports.websocket||{};return n[e.href]=n[e.href]||new this(t,e),n[e.href]},getSocketUrl:function(t){return(t=a(t)).protocol=this.PROTOCOLS[t.protocol],o.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});h(d.prototype,f),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",(function(){void 0===d._unloaded&&(d._unloaded=!0)})),t.exports=d}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var n=e.MozWebSocket||e.WebSocket;t.exports={create:function(t,e,i){return"function"!=typeof n?null:new n(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(7),a=n(4),h=n(21),u=o(i(a,{initialize:function(t,n){if(a.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new h(t,n),(n=r(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),o=this;i.onopen=function(){o._everConnected=!0,o.setDeferredStatus("succeeded")},i.onerror=function(){o._everConnected?o._handleError([]):(o.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?o._receive(e):o._handleError([])},this._socket=i},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)}))},encode:function(t){return this._xhr.encode(t)},request:function(t){return this._xhr.request(t)}}),{isUsable:function(t,e,n,i){if(!t.clientId)return n.call(i,!1);h.isUsable(t,e,(function(s){if(!s)return n.call(i,!1);this.create(t,e).isUsable(n,i)}),this)},create:function(t,e){var n=t.transports.eventsource=t.transports.eventsource||{},i=t.clientId,o=r(e);return o.pathname+="/"+(i||""),n[o=s.stringify(o)]=n[o]||new this(t,e),n[o]}});o(u.prototype,c),t.exports=u}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(20),r=n(3),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return"message="+encodeURIComponent(c(t))},request:function(t){var n,i=e.XDomainRequest?XDomainRequest:XMLHttpRequest,s=new i,r=++a._id,o=this._dispatcher.headers,c=this;if(s.open("POST",this.endpoint.href,!0),s.withCredentials=!0,s.setRequestHeader)for(n in s.setRequestHeader("Pragma","no-cache"),o)o.hasOwnProperty(n)&&s.setRequestHeader(n,o[n]);var h=function(){if(!s)return!1;a._pending.remove(r),s.onload=s.onerror=s.ontimeout=s.onprogress=null,s=null};return s.onload=function(){var e;try{e=JSON.parse(s.responseText)}catch(t){}h(),e?c._receive(e):c._handleError(t)},s.onerror=s.ontimeout=function(){h(),c._handleError(t)},s.onprogress=function(){},i===e.XDomainRequest&&a._pending.add({id:r,xhr:s}),s.send(this.encode(t)),s}}),{_id:0,_pending:new s,isUsable:function(t,n,i,s){if(r.isSameOrigin(n))return i.call(s,!1);if(e.XDomainRequest)return i.call(s,n.protocol===location.protocol);if(e.XMLHttpRequest){var o=new XMLHttpRequest;return i.call(s,void 0!==o.withCredentials)}return i.call(s,!1)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){var e=r(this.endpoint);return e.query.message=c(t),e.query.jsonp="__jsonp"+a._cbCount+"__",s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=a.getCallbackName(),h=r(this.endpoint),u=this;h.query.message=c(t),h.query.jsonp=o;var l=function(){if(!e[o])return!1;e[o]=void 0;try{delete e[o]}catch(t){}i.parentNode.removeChild(i)};return e[o]=function(t){l(),u._receive(t)},i.type="text/javascript",i.src=s.stringify(h),n.appendChild(i),i.onerror=function(){l(),u._handleError(t)},{abort:l}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(16),r=i({initialize:function(t,e,n){this.code=t,this.params=Array.prototype.slice.call(e),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});r.parse=function(t){if(t=t||"",!s.ERROR.test(t))return new r(null,[],t);var e=t.split(":"),n=parseInt(e[0]),i=e[1].split(",");t=e[2];return new r(n,i,t)};var o={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var c in o)!function(t){r[t]=function(){return new r(o[t][0],arguments,o[t][1]).toString()}}(c);t.exports=r},function(t,e,n){"use strict";var i={addExtension:function(t){this._extensions=this._extensions||[],this._extensions.push(t),t.added&&t.added(this)},removeExtension:function(t){if(this._extensions)for(var e=this._extensions.length;e--;)this._extensions[e]===t&&(this._extensions.splice(e,1),t.removed&&t.removed(this))},pipeThroughExtensions:function(t,e,n,i,s){if(this.debug("Passing through ? extensions: ?",t,e),!this._extensions)return i.call(s,e);var r=this._extensions.slice(),o=function(e){if(!e)return i.call(s,e);var c=r.shift();if(!c)return i.call(s,e);var a=c[t];if(!a)return o(e);a.length>=3?c[t](e,n,o):c[t](e,o)};o(e)}};n(0)(i,n(8)),t.exports=i},function(t,e,n){"use strict";var i=n(1),s=n(7);t.exports=i(s)},function(t,e,n){"use strict";var i=n(23),s=n(8),r={VERSION:i.VERSION,Client:n(25),Scheduler:n(22)};s.wrapper=r,t.exports=r}]);
1
+ var Faye=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";var i=Array.prototype.forEach,s=Object.prototype.hasOwnProperty;t.exports=function(t){return i.call(arguments,(function(e,n){if(0!==n)for(var i in e)s.call(e,i)&&(t[i]=e[i])})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports={isURI:function(t){return t&&t.protocol&&t.host&&t.path},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t){if("string"!=typeof t)return t;var e,n,i,s,r,o,c={},a=function(e,n){t=t.replace(n,(function(t){return c[e]=t,""})),c[e]=c[e]||""};for(a("protocol",/^[a-z]+\:/i),a("host",/^\/\/[^\/\?#]+/),/^\//.test(t)||c.host||(t=location.pathname.replace(/[^\/]*$/,"")+t),a("pathname",/^[^\?#]*/),a("search",/^\?[^#]*/),a("hash",/^#.*/),c.protocol=c.protocol||location.protocol,c.host?(c.host=c.host.substr(2),/@/.test(c.host)&&(c.auth=c.host.split("@")[0],c.host=c.host.split("@")[1]),e=c.host.match(/^\[([^\]]+)\]|^[^:]+/),c.hostname=e[1]||e[0],c.port=(c.host.match(/:(\d+)$/)||[])[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,o={},s=0,r=(i=(n=c.search.replace(/^\?/,""))?n.split("&"):[]).length;s<r;s++)e=i[s].split("="),o[decodeURIComponent(e[0]||"")]=decodeURIComponent(e[1]||"");return c.query=o,c.href=this.stringify(c),c},stringify:function(t){var e=t.auth?t.auth+"@":"",n=t.protocol+"//"+e+t.host;return n+=t.pathname+this.queryString(t.query)+(t.hash||"")},queryString:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return 0===e.length?"":"?"+e.join("&")}}},function(t,e,n){"use strict";var i=n(1),s=n(18).Cookie,r=n(6),o=n(11),c=n(0),a=n(8),h=n(29),u=n(15),l=c(i({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},MAX_DELAY:0,batching:!0,initialize:function(t,e){this._dispatcher=t,this.endpoint=e,this._outbox=[],this._proxy=c({},this._dispatcher.proxy),this._proxy.origin||(this._proxy.origin=this._findProxy())},close:function(){},encode:function(t){return""},sendMessage:function(t){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,this.endpoint.href,t),this.batching?(this._outbox.push(t),this._flushLargeBatch(),t.channel===u.HANDSHAKE?this._publish(.01):(t.channel===u.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):r.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new r((function(e){t._resolvePromise=e}))},_publish:function(t){return this._makePromise(),this.addTimeout("publish",t,(function(){this._flush(),delete this._requestPromise}),this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length<this._dispatcher.maxRequestSize)){var t=this._outbox.pop();this._makePromise(),this._flush(),t&&this._outbox.push(t)}},_receive:function(t){if(t){t=[].concat(t),this.debug("Client ? received from ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var e=0,n=t.length;e<n;e++)this._dispatcher.handleResponse(t[e])}},_handleError:function(t,e){t=[].concat(t),this.debug("Client ? failed to send to ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var n=0,i=t.length;n<i;n++)this._dispatcher.handleError(t[n])},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?o.map(t.getCookiesSync(e),(function(t){return t.cookieString()})).join("; "):""},_storeCookies:function(t){var e,n=this._dispatcher.cookies,i=this.endpoint.href;if(t&&n)for(var r=0,o=(t=[].concat(t)).length;r<o;r++)e=s.parse(t[r]),n.setCookieSync(e,i)},_findProxy:function(){if("undefined"!=typeof process){var t=this.endpoint.protocol;if(t){var e,n,i=t.replace(/:$/,"").toLowerCase()+"_proxy",s=i.toUpperCase(),r=process.env;return"http_proxy"===i&&r.REQUEST_METHOD?(1===(e=Object.keys(r).filter((function(t){return/^http_proxy$/i.test(t)}))).length?e[0]===i&&void 0===r[s]&&(n=r[i]):e.length>1&&(n=r[i]),n=n||r["CGI_"+s]):(n=r[i]||r[s])&&!r[i]&&console.warn("The environment variable "+s+" is discouraged. Use "+i+"."),n}}}}),{get:function(t,e,n,i,s){var r=t.endpoint;o.asyncEach(this._transports,(function(r,c){var a=r[0],h=r[1],u=t.endpointFor(a);return o.indexOf(n,a)>=0?c():o.indexOf(e,a)<0?(h.isUsable(t,u,(function(){})),c()):void h.isUsable(t,u,(function(e){if(!e)return c();var n=h.hasOwnProperty("create")?h.create(t,u):new h(t,u);i.call(s,n)}))}),(function(){throw new Error("Could not find a usable connection type for "+r.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return o.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(var e=0;e<this._transports.length;e++)this._transports[e][1]._unloaded=!1},_transports:[]});c(l.prototype,a),c(l.prototype,h),t.exports=l},function(t,e,n){"use strict";t.exports=function(t){return JSON.stringify(t,(function(t,e){return this[t]instanceof Array?this[t]:e}))}},function(t,e,n){"use strict";var i=n(13),s=function(t){this._state=-1,this._value=null,this._defer=[],r(this,t)};s.prototype.then=function(t,e){var n=new s,i={promise:n,onFulfilled:t,onRejected:e};return-1===this._state?this._defer.push(i):o(this,i),n},s.prototype.catch=function(t){return this.then(null,t)};var r=function(t,e){if("function"==typeof e){var n=0,i=function(e){0==n++&&u(t,e)};try{e((function(e){0==n++&&c(t,e)}),i)}catch(t){i(t)}}},o=function(t,e){var n=t._state,s=t._value,r=e.promise,o=[e.onFulfilled,e.onRejected][n];if("function"!=typeof o)return(0,[c,u][n])(r,s);i((function(){try{c(r,o(s))}catch(t){u(r,t)}}))},c=function(t,e){if(t===e)return u(t,new TypeError("Recursive promise chain detected"));var n;try{n=a(e)}catch(e){return u(t,e)}if(!n)return h(t,e);r(t,(function(t,i){n.call(e,t,i)}))},a=function(t){var e=typeof t,n=("object"===e||"function"===e)&&t&&t.then;return"function"==typeof n?n:null},h=function(t,e){l(t,0,e)},u=function(t,e){l(t,1,e)},l=function(t,e,n){var i=t._defer,s=0;if(t._state=e,t._value=n,t._defer=null,0!==i.length)for(;s<i.length;)o(t,i[s++])};s.resolve=function(t){try{if(a(t))return t}catch(t){return s.reject(t)}return new s((function(e,n){e(t)}))},s.reject=function(t){return new s((function(e,n){n(t)}))},s.all=function(t){return new s((function(e,n){var i,r=[],o=t.length;if(0===o)return e(r);var c=function(t,i){s.resolve(t).then((function(t){r[i]=t,0==--o&&e(r)}),n)};for(i=0;i<o;i++)c(t[i],i)}))},s.race=function(t){return new s((function(e,n){for(var i=0,r=t.length;i<r;i++)s.resolve(t[i]).then(e,n)}))},s.deferred=function(){var t={};return t.promise=new s((function(e,n){t.resolve=e,t.reject=n})),t},t.exports=s},function(t,e,n){"use strict";(function(e){var i=n(6);t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new i((function(t,e){n._resolve=t,n._reject=e}))),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){return this.then((function(n){t.call(e,n)}))},errback:function(t,e){return this.then(null,(function(n){t.call(e,n)}))},timeout:function(t,n){this.then();var i=this;this._timer=e.setTimeout((function(){i._reject(n)}),1e3*t)},setDeferredStatus:function(t,n){this._timer&&e.clearTimeout(this._timer),this.then(),"succeeded"===t?this._resolve(n):"failed"===t?this._reject(n):delete this._promise}}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(5),s={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(t,e){var n=s.logger||(s.wrapper||s).logger;if(n){var r=Array.prototype.slice.apply(t),o="[Faye",c=this.className,a=r.shift().replace(/\?/g,(function(){try{return i(r.shift())}catch(t){return"[Object]"}}));c&&(o+="."+c),o+="] ","function"==typeof n[e]?n[e](o+a):"function"==typeof n&&n(o+a)}}};for(var r in s.LOG_LEVELS)!function(t){s[t]=function(){this.writeLog(arguments,t)}}(r);t.exports=s},function(t,e,n){"use strict";var i={countListeners:function(t){return this.listeners(t).length},bind:function(t,e,n){var i=Array.prototype.slice,s=function(){e.apply(n,i.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([t,e,n,s]),this.on(t,s)},unbind:function(t,e,n){this._listeners=this._listeners||[];for(var i,s=this._listeners.length;s--;)(i=this._listeners[s])[0]===t&&(!e||i[1]===e&&i[2]===n)&&(this._listeners.splice(s,1),this.removeListener(t,i[3]))}};n(0)(i,n(28).prototype),i.trigger=i.emit,t.exports=i},,function(t,e,n){"use strict";t.exports={commonElement:function(t,e){for(var n=0,i=t.length;n<i;n++)if(-1!==this.indexOf(e,t[n]))return t[n];return null},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},map:function(t,e,n){if(t.map)return t.map(e,n);var i=[];if(t instanceof Array)for(var s=0,r=t.length;s<r;s++)i.push(e.call(n||null,t[s],s));else for(var o in t)t.hasOwnProperty(o)&&i.push(e.call(n||null,o,t[o]));return i},filter:function(t,e,n){if(t.filter)return t.filter(e,n);for(var i=[],s=0,r=t.length;s<r;s++)e.call(n||null,t[s],s)&&i.push(t[s]);return i},asyncEach:function(t,e,n,i){var s=t.length,r=-1,o=0,c=!1,a=function(){if(o-=1,(r+=1)===s)return n&&n.call(i);e(t[r],h)},h=function(){o+=1,function(){if(!c){for(c=!0;o>0;)a();c=!1}}()};h()}}},function(t,e,n){"use strict";var i=function(t){var e,n,s;if(t instanceof Array){for(e=[],n=t.length;n--;)e[n]=i(t[n]);return e}if("object"==typeof t){for(s in e=null===t?null:{},t)e[s]=i(t[s]);return e}return t};t.exports=i},function(t,e,n){"use strict";var i=n(26),s=[],r=[],o=i.makeRequestCallFromTimer((function(){if(r.length)throw r.shift()}));function c(t){var e;(e=s.length?s.pop():new a).task=t,i(e)}function a(){this.task=null}t.exports=c,a.prototype.call=function(){try{this.task.call()}catch(t){c.onerror?c.onerror(t):(r.push(t),o())}finally{this.task=null,s[s.length]=this}}},function(t,e,n){"use strict";(function(e){var n={_registry:[],on:function(t,e,n,i){var s=function(){n.call(i)};t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s),this._registry.push({_element:t,_type:e,_callback:n,_context:i,_handler:s})},detach:function(t,e,n,i){for(var s,r=this._registry.length;r--;)s=this._registry[r],t&&t!==s._element||e&&e!==s._type||n&&n!==s._callback||i&&i!==s._context||(s._element.removeEventListener?s._element.removeEventListener(s._type,s._handler,!1):s._element.detachEvent("on"+s._type,s._handler),this._registry.splice(r,1),s=null)}};void 0!==e.onunload&&n.on(e,"unload",n.detach,n),t.exports={Event:n}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(9),o=n(16),c=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});s(c.prototype,r),s(c,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(t){var e=this.parse(t),n=["/**",t],i=e.slice();i[i.length-1]="*",n.push(this.unparse(i));for(var s=1,r=e.length;s<r;s++)(i=e.slice(0,s)).push("**"),n.push(this.unparse(i));return n},isValid:function(t){return o.CHANNEL_NAME.test(t)||o.CHANNEL_PATTERN.test(t)},parse:function(t){return this.isValid(t)?t.split("/").slice(1):null},unparse:function(t){return"/"+t.join("/")},isMeta:function(t){var e=this.parse(t);return e?e[0]===this.META:null},isService:function(t){var e=this.parse(t);return e?e[0]===this.SERVICE:null},isSubscribable:function(t){return this.isValid(t)?!this.isMeta(t)&&!this.isService(t):null},Set:i({initialize:function(){this._channels={}},getKeys:function(){var t=[];for(var e in this._channels)t.push(e);return t},remove:function(t){delete this._channels[t]},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(var n,i=0,s=t.length;i<s;i++){n=t[i],(this._channels[n]=this._channels[n]||new c(n)).bind("message",e)}},unsubscribe:function(t,e){var n=this._channels[t];return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){for(var e=c.expand(t.channel),n=0,i=e.length;n<i;n++){var s=this._channels[e[n]];s&&s.trigger("message",t)}}})}),t.exports=c},function(t,e,n){"use strict";t.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(18),o=n(0),c=n(8),a=n(9),h=n(19),u=n(22),l=i({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(t,e,n){this._client=t,this.endpoint=s.parse(e),this._alternates=n.endpoints||{},this.cookies=r.CookieJar&&new r.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||u,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var i=n.websocketExtensions;if(i)for(var o=0,c=(i=[].concat(i)).length;o<c;o++)this.addWebsocketExtension(i[o]);for(var a in this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca,this._alternates)this._alternates[a]=s.parse(this._alternates[a]);this.maxRequestSize=this.MAX_REQUEST_SIZE},endpointFor:function(t){return this._alternates[t]||this.endpoint},addWebsocketExtension:function(t){this.wsExtensions.push(t)},disable:function(t){this._disabled.push(t),h.disable(t)},setHeader:function(t,e){this.headers[t]=e},close:function(){var t=this._transport;delete this._transport,t&&t.close()},getConnectionTypes:function(){return h.getConnectionTypes()},selectTransport:function(t){h.get(this,t,this._disabled,(function(t){this.debug("Selected ? transport for ?",t.connectionType,t.endpoint.href),t!==this._transport&&(this._transport&&this._transport.close(),this._transport=t,this.connectionType=t.connectionType)}),this)},sendMessage:function(t,e,n){n=n||{};var i,s=t.id,r=n.attempts,o=n.deadline&&(new Date).getTime()+1e3*n.deadline,c=this._envelopes[s];c||(i=new this._scheduler(t,{timeout:e,interval:this.retry,attempts:r,deadline:o}),c=this._envelopes[s]={message:t,scheduler:i}),this._sendEnvelope(c)},_sendEnvelope:function(t){if(this._transport&&!t.request&&!t.timer){var n=t.message,i=t.scheduler,s=this;if(!i.isDeliverable())return i.abort(),void delete this._envelopes[n.id];t.timer=e.setTimeout((function(){s.handleError(n)}),1e3*i.getTimeout()),i.send(),t.request=this._transport.sendMessage(n)}},handleResponse:function(t){var n=this._envelopes[t.id];void 0!==t.successful&&n&&(n.scheduler.succeed(),delete this._envelopes[t.id],e.clearTimeout(n.timer)),this.trigger("message",t),this._state!==this.UP&&(this._state=this.UP,this._client.trigger("transport:up"))},handleError:function(t,n){var i=this._envelopes[t.id],s=i&&i.request,r=this;if(s){s.then((function(t){t&&t.abort&&t.abort()}));var o=i.scheduler;o.fail(),e.clearTimeout(i.timer),i.request=i.timer=null,n?this._sendEnvelope(i):i.timer=e.setTimeout((function(){i.timer=null,r._sendEnvelope(i)}),1e3*o.getInterval()),this._state!==this.DOWN&&(this._state=this.DOWN,this._client.trigger("transport:down"))}}});l.create=function(t,e,n){return new l(t,e,n)},o(l.prototype,a),o(l.prototype,c),t.exports=l}).call(this,n(2))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(4);i.register("websocket",n(30)),i.register("eventsource",n(32)),i.register("long-polling",n(21)),i.register("cross-origin-long-polling",n(33)),i.register("callback-polling",n(34)),t.exports=i},function(t,e,n){"use strict";var i=n(1);t.exports=i({initialize:function(){this._index={}},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.hasOwnProperty(e)&&(this._index[e]=t,!0)},forEach:function(t,e){for(var n in this._index)this._index.hasOwnProperty(n)&&t.call(e,this._index[n])},isEmpty:function(){for(var t in this._index)if(this._index.hasOwnProperty(t))return!1;return!0},member:function(t){for(var e in this._index)if(this._index[e]===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index[e];return delete this._index[e],n},toArray:function(){var t=[];return this.forEach((function(e){t.push(e)})),t}})},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(14),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return c(t)},request:function(t){var n,i=this.endpoint.href,s=this;if(e.XMLHttpRequest)n=new XMLHttpRequest;else{if(!e.ActiveXObject)return this._handleError(t);n=new ActiveXObject("Microsoft.XMLHTTP")}n.open("POST",i,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Pragma","no-cache"),n.setRequestHeader("X-Requested-With","XMLHttpRequest");var o=this._dispatcher.headers;for(var c in o)o.hasOwnProperty(c)&&n.setRequestHeader(c,o[c]);var a=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",a),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,c=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",a),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(c)}catch(t){}i?s._receive(i):s._handleError(t)}},n.send(this.encode(t)),n}}),{isUsable:function(t,e,n,i){var r="ReactNative"===navigator.product||s.isSameOrigin(e);n.call(i,r)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};n(0)(i.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var t=this.options.attempts,e=this.attempts,n=this.options.deadline,i=(new Date).getTime();return!(void 0!==t&&e>=t)&&!(void 0!==n&&i>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=i},function(t,e){t.exports={VERSION:"1.4.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(7),o=i({initialize:function(t,e,n,i){this._client=t,this._channels=e,this._callback=n,this._context=i,this._cancelled=!1},withChannel:function(t,e){return this._withChannel=[t,e],this},apply:function(t,e){var n=e[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});s(o.prototype,r),t.exports=o},function(t,e,n){"use strict";(function(e){var i=n(13),s=n(1),r=(n(6),n(11)),o=n(14),c=n(23),a=n(0),h=n(27),u=n(7),l=n(8),f=n(9),d=n(15),p=n(17),_=n(35),v=n(36),g=n(37),m=n(24),y=s({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(t,n){this.info("New client created for ?",t),h(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(n.interval||this.INTERVAL),timeout:1e3*(n.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){r.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()}),this)},addWebsocketExtension:function(t){return this._dispatcher.addWebsocketExtension(t)},disable:function(t){return this._dispatcher.disable(t)},setHeader:function(t,e){return this._dispatcher.setHeader(t,e)},handshake:function(t,n){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var s=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(c.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:c.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(r){r.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=r.clientId,this._dispatcher.selectTransport(r.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&i((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){s.handshake(t,n)}),1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)}),this)}},connect:function(t,e){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake((function(){this.connect(t,e)}),this);this.callback(t,e),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var t=new g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",_.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return r.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new m(this,t,e,n),s=!0===e;return this._channels.hasSubscription(t)&&!s?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),s||this._channels.subscribe([t],i),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",_.parse(e.error)),this._channels.unsubscribe(t,i);var n=[].concat(e.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),i.setDeferredStatus("succeeded")}),this)}),this),i)},unsubscribe:function(t,e){if(t instanceof Array)return r.map(t,(function(t){return this.unsubscribe(t,e)}),this);this._channels.unsubscribe(t,e)&&this.connect((function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,t),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(t){if(t.successful){var e=[].concat(t.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,e)}}),this)}),this)},publish:function(t,e,n){h(n||{},["attempts","deadline"]);var i=new g;return this.connect((function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,t,e),this._sendMessage({channel:t,data:e,clientId:this._dispatcher.clientId},n,(function(t){t.successful?i.setDeferredStatus("succeeded"):i.setDeferredStatus("failed",_.parse(t.error))}),this)}),this),i},_sendMessage:function(t,e,n,i){t.id=this._generateMessageId();var s=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",t,null,(function(t){t&&(n&&(this._responseCallbacks[t.id]=[n,i]),this._dispatcher.sendMessage(t,s,e||{}))}),this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(t){var e,n=t.id;void 0!==t.successful&&(e=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",t,null,(function(t){t&&(t.advice&&this._handleAdvice(t.advice),this._deliverMessage(t),e&&e[0].call(e[1],t))}),this)},_handleAdvice:function(t){a(this._advice,t),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(t){t.channel&&void 0!==t.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,t.channel,t.data),this._channels.distributeMessage(t))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var t=this;e.setTimeout((function(){t.connect()}),this._advice.interval)}});a(y.prototype,u),a(y.prototype,f),a(y.prototype,l),a(y.prototype,v),t.exports=y}).call(this,n(2))},function(t,e,n){"use strict";(function(e){function n(t){s.length||(i(),!0),s[s.length]=t}t.exports=n;var i,s=[],r=0;function o(){for(;r<s.length;){var t=r;if(r+=1,s[t].call(),r>1024){for(var e=0,n=s.length-r;e<n;e++)s[e]=s[e+r];s.length-=r,r=0}}s.length=0,r=0,!1}var c,a,h,u=void 0!==e?e:self,l=u.MutationObserver||u.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof l?(c=1,a=new l(o),h=document.createTextNode(""),a.observe(h,{characterData:!0}),i=function(){c=-c,h.data=c}):i=f(o),n.requestFlush=i,n.makeRequestCallFromTimer=f}).call(this,n(2))},function(t,e,n){"use strict";var i=n(11);t.exports=function(t,e){for(var n in t)if(i.indexOf(e,n)<0)throw new Error("Unrecognized option: "+n)}},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(){}t.exports=i,i.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||n(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var i=Array.prototype.slice.call(arguments,1);e.apply(this,i)}return!0}if(n(e)){i=Array.prototype.slice.call(arguments,1);for(var s=e.slice(),r=0,o=s.length;r<o;r++)s[r].apply(this,i);return!0}return!1},i.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");return this._events||(this._events={}),this.emit("newListener",t,e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){var n=this;return n.on(t,(function i(){n.removeListener(t,i),e.apply(this,arguments)})),this},i.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var i=this._events[t];if(n(i)){var s=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}(i,e);if(s<0)return this;i.splice(s,1),0==i.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},i.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},i.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),n(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}},function(t,e,n){"use strict";(function(e){t.exports={addTimeout:function(t,n,i,s){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(t)){var r=this;this._timeouts[t]=e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n)}},removeTimeout:function(t){this._timeouts=this._timeouts||{};var n=this._timeouts[t];n&&(e.clearTimeout(n),delete this._timeouts[t])},removeAllTimeouts:function(){for(var t in this._timeouts=this._timeouts||{},this._timeouts)this.removeTimeout(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(6),r=n(20),o=n(3),c=n(14),a=n(12),h=n(0),u=n(5),l=n(31),f=n(7),d=h(i(n(4),{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)})),this.connect()},request:function(t){this._pending=this._pending||new r;for(var e=0,n=t.length;e<n;e++)this._pending.add(t[e]);var i=this,o=new s((function(e,n){i.callback((function(n){n&&1===n.readyState&&(n.send(u(t)),e(n))})),i.connect()}));return{abort:function(){o.then((function(t){t.close()}))}}},connect:function(){if(!d._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var t=this._createSocket();if(!t)return this.setDeferredStatus("failed");var e=this;t.onopen=function(){t.headers&&e._storeCookies(t.headers["set-cookie"]),e._socket=t,e._state=e.CONNECTED,e._everConnected=!0,e.setDeferredStatus("succeeded",t)};var n=!1;t.onclose=t.onerror=function(){if(!n){n=!0;var i=e._state===e.CONNECTED;t.onopen=t.onclose=t.onerror=t.onmessage=null,delete e._socket,e._state=e.UNCONNECTED;var s=e._pending?e._pending.toArray():[];delete e._pending,i||e._everConnected?(e.setDeferredStatus("unknown"),e._handleError(s,i)):e.setDeferredStatus("failed")}},t.onmessage=function(t){var n;try{n=JSON.parse(t.data)}catch(t){}if(n){for(var i=0,s=(n=[].concat(n)).length;i<s;i++)void 0!==n[i].successful&&e._pending.remove(n[i]);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=d.getSocketUrl(this.endpoint),e=this._dispatcher.headers,n=this._dispatcher.wsExtensions,i=this._getCookies(),s=this._dispatcher.tls,r={extensions:n,headers:e,proxy:this._proxy,tls:s};""!==i&&(r.headers.Cookie=i);try{return l.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports.websocket=t.transports.websocket||{};return n[e.href]=n[e.href]||new this(t,e),n[e.href]},getSocketUrl:function(t){return(t=a(t)).protocol=this.PROTOCOLS[t.protocol],o.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});h(d.prototype,f),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",(function(){void 0===d._unloaded&&(d._unloaded=!0)})),t.exports=d}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var n=e.MozWebSocket||e.WebSocket;t.exports={create:function(t,e,i){return"function"!=typeof n?null:new n(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(7),a=n(4),h=n(21),u=o(i(a,{initialize:function(t,n){if(a.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new h(t,n),(n=r(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),o=this;i.onopen=function(){o._everConnected=!0,o.setDeferredStatus("succeeded")},i.onerror=function(){o._everConnected?o._handleError([]):(o.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?o._receive(e):o._handleError([])},this._socket=i},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)}))},encode:function(t){return this._xhr.encode(t)},request:function(t){return this._xhr.request(t)}}),{isUsable:function(t,e,n,i){if(!t.clientId)return n.call(i,!1);h.isUsable(t,e,(function(s){if(!s)return n.call(i,!1);this.create(t,e).isUsable(n,i)}),this)},create:function(t,e){var n=t.transports.eventsource=t.transports.eventsource||{},i=t.clientId,o=r(e);return o.pathname+="/"+(i||""),n[o=s.stringify(o)]=n[o]||new this(t,e),n[o]}});o(u.prototype,c),t.exports=u}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(20),r=n(3),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return"message="+encodeURIComponent(c(t))},request:function(t){var n,i=e.XDomainRequest?XDomainRequest:XMLHttpRequest,s=new i,r=++a._id,o=this._dispatcher.headers,c=this;if(s.open("POST",this.endpoint.href,!0),s.withCredentials=!0,s.setRequestHeader)for(n in s.setRequestHeader("Pragma","no-cache"),o)o.hasOwnProperty(n)&&s.setRequestHeader(n,o[n]);var h=function(){if(!s)return!1;a._pending.remove(r),s.onload=s.onerror=s.ontimeout=s.onprogress=null,s=null};return s.onload=function(){var e;try{e=JSON.parse(s.responseText)}catch(t){}h(),e?c._receive(e):c._handleError(t)},s.onerror=s.ontimeout=function(){h(),c._handleError(t)},s.onprogress=function(){},i===e.XDomainRequest&&a._pending.add({id:r,xhr:s}),s.send(this.encode(t)),s}}),{_id:0,_pending:new s,isUsable:function(t,n,i,s){if(r.isSameOrigin(n))return i.call(s,!1);if(e.XDomainRequest)return i.call(s,n.protocol===location.protocol);if(e.XMLHttpRequest){var o=new XMLHttpRequest;return i.call(s,void 0!==o.withCredentials)}return i.call(s,!1)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){var e=r(this.endpoint);return e.query.message=c(t),e.query.jsonp="__jsonp"+a._cbCount+"__",s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=a.getCallbackName(),h=r(this.endpoint),u=this;h.query.message=c(t),h.query.jsonp=o;var l=function(){if(!e[o])return!1;e[o]=void 0;try{delete e[o]}catch(t){}i.parentNode.removeChild(i)};return e[o]=function(t){l(),u._receive(t)},i.type="text/javascript",i.src=s.stringify(h),n.appendChild(i),i.onerror=function(){l(),u._handleError(t)},{abort:l}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(16),r=i({initialize:function(t,e,n){this.code=t,this.params=Array.prototype.slice.call(e),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});r.parse=function(t){if(t=t||"",!s.ERROR.test(t))return new r(null,[],t);var e=t.split(":"),n=parseInt(e[0]),i=e[1].split(",");t=e[2];return new r(n,i,t)};var o={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var c in o)!function(t){r[t]=function(){return new r(o[t][0],arguments,o[t][1]).toString()}}(c);t.exports=r},function(t,e,n){"use strict";var i={addExtension:function(t){this._extensions=this._extensions||[],this._extensions.push(t),t.added&&t.added(this)},removeExtension:function(t){if(this._extensions)for(var e=this._extensions.length;e--;)this._extensions[e]===t&&(this._extensions.splice(e,1),t.removed&&t.removed(this))},pipeThroughExtensions:function(t,e,n,i,s){if(this.debug("Passing through ? extensions: ?",t,e),!this._extensions)return i.call(s,e);var r=this._extensions.slice(),o=function(e){if(!e)return i.call(s,e);var c=r.shift();if(!c)return i.call(s,e);var a=c[t];if(!a)return o(e);a.length>=3?c[t](e,n,o):c[t](e,o)};o(e)}};n(0)(i,n(8)),t.exports=i},function(t,e,n){"use strict";var i=n(1),s=n(7);t.exports=i(s)},function(t,e,n){"use strict";var i=n(23),s=n(8),r={VERSION:i.VERSION,Client:n(25),Scheduler:n(22)};s.wrapper=r,t.exports=r}]);
2
2
  //# sourceMappingURL=faye-browser-min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://Faye/webpack/bootstrap","webpack://Faye/./src/util/assign.js","webpack://Faye/./src/util/class.js","webpack://Faye/(webpack)/buildin/global.js","webpack://Faye/./src/util/uri.js","webpack://Faye/./src/transport/transport.js","webpack://Faye/./src/util/to_json.js","webpack://Faye/./src/util/promise.js","webpack://Faye/./src/mixins/deferrable.js","webpack://Faye/./src/mixins/logging.js","webpack://Faye/./src/mixins/publisher.js","webpack://Faye/./src/util/array.js","webpack://Faye/./src/util/copy_object.js","webpack://Faye/./node_modules/asap/browser-asap.js","webpack://Faye/./src/util/browser/event.js","webpack://Faye/./src/protocol/channel.js","webpack://Faye/./src/protocol/grammar.js","webpack://Faye/./src/protocol/dispatcher.js","webpack://Faye/./src/util/cookies/browser_cookies.js","webpack://Faye/./src/transport/browser_transports.js","webpack://Faye/./src/util/set.js","webpack://Faye/./src/transport/xhr.js","webpack://Faye/./src/protocol/scheduler.js","webpack://Faye/./src/util/constants.js","webpack://Faye/./src/protocol/subscription.js","webpack://Faye/./src/protocol/client.js","webpack://Faye/./node_modules/asap/browser-raw.js","webpack://Faye/./src/util/validate_options.js","webpack://Faye/./src/util/event_emitter.js","webpack://Faye/./src/mixins/timeouts.js","webpack://Faye/./src/transport/web_socket.js","webpack://Faye/./src/util/websocket/browser_websocket.js","webpack://Faye/./src/transport/event_source.js","webpack://Faye/./src/transport/cors.js","webpack://Faye/./src/transport/jsonp.js","webpack://Faye/./src/protocol/error.js","webpack://Faye/./src/protocol/extensible.js","webpack://Faye/./src/protocol/publication.js","webpack://Faye/./src/faye_browser.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","forEach","Array","hasOwn","target","arguments","source","assign","parent","methods","klass","this","initialize","apply","bridge","g","Function","e","window","isURI","uri","protocol","host","path","isSameOrigin","location","hostname","port","parse","url","parts","query","pairs","data","consume","pattern","replace","match","test","pathname","substr","auth","split","search","length","decodeURIComponent","href","stringify","string","queryString","hash","push","encodeURIComponent","join","Class","Cookie","Promise","array","Logging","Timeouts","Channel","Transport","className","DEFAULT_PORTS","MAX_DELAY","batching","dispatcher","endpoint","_dispatcher","_outbox","_proxy","proxy","origin","_findProxy","close","encode","messages","sendMessage","message","debug","clientId","_flushLargeBatch","channel","HANDSHAKE","_publish","CONNECT","_connectMessage","resolve","request","_makePromise","self","_requestPromise","_resolvePromise","delay","addTimeout","_flush","removeTimeout","advice","timeout","maxRequestSize","last","pop","_receive","replies","concat","connectionType","handleResponse","_handleError","immediate","handleError","_getCookies","cookies","map","getCookiesSync","cookie","cookieString","_storeCookies","setCookie","setCookieSync","process","keys","toLowerCase","upcase","toUpperCase","env","REQUEST_METHOD","filter","k","undefined","console","warn","allowed","disabled","callback","context","asyncEach","_transports","pair","resume","connType","connEndpoint","endpointFor","indexOf","isUsable","transport","Error","register","type","getConnectionTypes","disable","feature","_unloaded","JSON","asap","task","_state","_value","_defer","execute","then","onFulfilled","onRejected","promise","deferred","propagate","calls","rejectPromise","reason","reject","error","state","next","handler","pass","TypeError","getThen","fulfill","resolvePromise","settle","defer","all","promises","list","race","tuple","errback","_promise","_resolve","_reject","seconds","_timer","global","setTimeout","setDeferredStatus","status","clearTimeout","toJSON","LOG_LEVELS","fatal","info","writeLog","messageArgs","level","logger","wrapper","args","slice","banner","shift","Publisher","countListeners","eventType","listeners","listener","_listeners","on","unbind","splice","removeListener","trigger","emit","commonElement","lista","listb","needle","result","iterator","looping","iterate","loop","copyObject","clone","rawAsap","freeTasks","pendingErrors","requestErrorThrow","makeRequestCallFromTimer","rawTask","RawTask","onerror","Event","_registry","element","eventName","wrapped","addEventListener","attachEvent","_element","_type","_callback","_context","_handler","detach","removeEventListener","detachEvent","onunload","Grammar","id","isUnused","SUBSCRIBE","UNSUBSCRIBE","DISCONNECT","META","SERVICE","expand","segments","channels","copy","unparse","isValid","CHANNEL_NAME","CHANNEL_PATTERN","isMeta","isService","isSubscribable","Set","_channels","getKeys","remove","hasSubscription","subscribe","names","subscription","unsubscribe","distributeMessage","ERROR","VERSION","URI","Scheduler","Dispatcher","MAX_REQUEST_SIZE","DEFAULT_RETRY","UP","DOWN","client","options","_client","_alternates","endpoints","CookieJar","_disabled","_envelopes","headers","retry","_scheduler","scheduler","transports","wsExtensions","exts","websocketExtensions","addWebsocketExtension","tls","ca","extension","setHeader","_transport","selectTransport","transportTypes","attempts","deadline","Date","getTime","envelope","interval","_sendEnvelope","timer","isDeliverable","abort","getTimeout","send","reply","successful","succeed","req","fail","getInterval","_index","add","item","block","isEmpty","member","removed","toArray","browser","XHR","xhr","XMLHttpRequest","ActiveXObject","open","setRequestHeader","onbeforeunload","onreadystatechange","readyState","text","responseText","usable","navigator","product","made","now","BAYEUX_VERSION","ID_LENGTH","JSONP_CALLBACK","CONNECTION_TYPES","MANDATORY_CONNECTION_TYPES","Deferrable","Subscription","_cancelled","withChannel","_withChannel","cancel","constants","validateOptions","Extensible","Publication","Client","UNCONNECTED","CONNECTING","CONNECTED","DISCONNECTED","RETRY","NONE","CONNECTION_TIMEOUT","DEFAULT_ENDPOINT","INTERVAL","_messageId","_responseCallbacks","_advice","reconnect","_receiveMessage","disconnect","handshake","_sendMessage","version","supportedConnectionTypes","response","connect","_connectRequest","_cycleConnection","force","publish","publication","_generateMessageId","pipeThroughExtensions","Math","pow","toString","_handleAdvice","_deliverMessage","queue","requestFlush","index","flush","currentIndex","scan","newLength","toggle","observer","node","scope","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","timeoutHandle","handleTimer","intervalHandle","setInterval","clearInterval","document","createTextNode","observe","characterData","validKeys","isArray","xs","EventEmitter","_events","addListener","once","x","removeAllListeners","_timeouts","removeAllTimeouts","ws","WebSocket","_pending","socket","_createSocket","onopen","_socket","_everConnected","closed","onclose","wasConnected","onmessage","pending","event","getSocketUrl","extensions","PROTOCOLS","sockets","websocket","WS","MozWebSocket","protocols","EventSource","_xhr","eventsource","CORS","xhrClass","XDomainRequest","_id","withCredentials","cleanUp","onload","ontimeout","onprogress","JSONP","jsonp","_cbCount","head","getElementsByTagName","script","createElement","callbackName","getCallbackName","cleanup","parentNode","removeChild","src","appendChild","code","params","parseInt","errors","versionMismatch","conntypeMismatch","extMismatch","badRequest","clientUnknown","parameterMissing","channelForbidden","channelUnknown","channelInvalid","extUnknown","publishFailed","serverError","addExtension","_extensions","added","removeExtension","stage","pipe","fn","Faye"],"mappings":"qBACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAA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EpByc,EAAO,CACTrO,QAAYsF,EAAUtF,QAEtB0F,OAAY,EAAQ,IACpBxF,UAAY,EAAQ,KAGtBtO,EAAQkJ,QAAUuT,EAElBniB,EAAOD,QAAUoiB","file":"build/client/faye-browser-min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 38);\n","'use strict';\n\nvar forEach = Array.prototype.forEach,\n hasOwn = Object.prototype.hasOwnProperty;\n\nmodule.exports = function(target) {\n forEach.call(arguments, function(source, i) {\n if (i === 0) return;\n\n for (var key in source) {\n if (hasOwn.call(source, key)) target[key] = source[key];\n }\n });\n\n return target;\n};\n","'use strict';\n\nvar assign = require('./assign');\n\nmodule.exports = function(parent, methods) {\n if (typeof parent !== 'function') {\n methods = parent;\n parent = Object;\n }\n\n var klass = function() {\n if (!this.initialize) return this;\n return this.initialize.apply(this, arguments) || this;\n };\n\n var bridge = function() {};\n bridge.prototype = parent.prototype;\n\n klass.prototype = new bridge();\n assign(klass.prototype, methods);\n\n return klass;\n};\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nmodule.exports = {\n isURI: function(uri) {\n return uri && uri.protocol && uri.host && uri.path;\n },\n\n isSameOrigin: function(uri) {\n return uri.protocol === location.protocol &&\n uri.hostname === location.hostname &&\n uri.port === location.port;\n },\n\n parse: function(url) {\n if (typeof url !== 'string') return url;\n var uri = {}, parts, query, pairs, i, n, data;\n\n var consume = function(name, pattern) {\n url = url.replace(pattern, function(match) {\n uri[name] = match;\n return '';\n });\n uri[name] = uri[name] || '';\n };\n\n consume('protocol', /^[a-z]+\\:/i);\n consume('host', /^\\/\\/[^\\/\\?#]+/);\n\n if (!/^\\//.test(url) && !uri.host)\n url = location.pathname.replace(/[^\\/]*$/, '') + url;\n\n consume('pathname', /^[^\\?#]*/);\n consume('search', /^\\?[^#]*/);\n consume('hash', /^#.*/);\n\n uri.protocol = uri.protocol || location.protocol;\n\n if (uri.host) {\n uri.host = uri.host.substr(2);\n\n if (/@/.test(uri.host)) {\n uri.auth = uri.host.split('@')[0];\n uri.host = uri.host.split('@')[1];\n }\n parts = uri.host.match(/^\\[([^\\]]+)\\]|^[^:]+/);\n uri.hostname = parts[1] || parts[0];\n uri.port = (uri.host.match(/:(\\d+)$/) || [])[1] || '';\n } else {\n uri.host = location.host;\n uri.hostname = location.hostname;\n uri.port = location.port;\n }\n\n uri.pathname = uri.pathname || '/';\n uri.path = uri.pathname + uri.search;\n\n query = uri.search.replace(/^\\?/, '');\n pairs = query ? query.split('&') : [];\n data = {};\n\n for (i = 0, n = pairs.length; i < n; i++) {\n parts = pairs[i].split('=');\n data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');\n }\n\n uri.query = data;\n\n uri.href = this.stringify(uri);\n return uri;\n },\n\n stringify: function(uri) {\n var auth = uri.auth ? uri.auth + '@' : '',\n string = uri.protocol + '//' + auth + uri.host;\n\n string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');\n\n return string;\n },\n\n queryString: function(query) {\n var pairs = [];\n for (var key in query) {\n if (!query.hasOwnProperty(key)) continue;\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));\n }\n if (pairs.length === 0) return '';\n return '?' + pairs.join('&');\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Cookie = require('../util/cookies').Cookie,\n Promise = require('../util/promise'),\n array = require('../util/array'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Timeouts = require('../mixins/timeouts'),\n Channel = require('../protocol/channel');\n\nvar Transport = assign(Class({ className: 'Transport',\n DEFAULT_PORTS: { 'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443 },\n MAX_DELAY: 0,\n\n batching: true,\n\n initialize: function(dispatcher, endpoint) {\n this._dispatcher = dispatcher;\n this.endpoint = endpoint;\n this._outbox = [];\n this._proxy = assign({}, this._dispatcher.proxy);\n\n if (!this._proxy.origin)\n this._proxy.origin = this._findProxy();\n },\n\n close: function() {},\n\n encode: function(messages) {\n return '';\n },\n\n sendMessage: function(message) {\n this.debug('Client ? sending message to ?: ?',\n this._dispatcher.clientId, this.endpoint.href, message);\n\n if (!this.batching) return Promise.resolve(this.request([message]));\n\n this._outbox.push(message);\n this._flushLargeBatch();\n\n if (message.channel === Channel.HANDSHAKE)\n return this._publish(0.01);\n\n if (message.channel === Channel.CONNECT)\n this._connectMessage = message;\n\n return this._publish(this.MAX_DELAY);\n },\n\n _makePromise: function() {\n var self = this;\n\n this._requestPromise = this._requestPromise || new Promise(function(resolve) {\n self._resolvePromise = resolve;\n });\n },\n\n _publish: function(delay) {\n this._makePromise();\n\n this.addTimeout('publish', delay, function() {\n this._flush();\n delete this._requestPromise;\n }, this);\n\n return this._requestPromise;\n },\n\n _flush: function() {\n this.removeTimeout('publish');\n\n if (this._outbox.length > 1 && this._connectMessage)\n this._connectMessage.advice = { timeout: 0 };\n\n this._resolvePromise(this.request(this._outbox));\n\n this._connectMessage = null;\n this._outbox = [];\n },\n\n _flushLargeBatch: function() {\n var string = this.encode(this._outbox);\n if (string.length < this._dispatcher.maxRequestSize) return;\n var last = this._outbox.pop();\n\n this._makePromise();\n this._flush();\n\n if (last) this._outbox.push(last);\n },\n\n _receive: function(replies) {\n if (!replies) return;\n replies = [].concat(replies);\n\n this.debug('Client ? received from ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, replies);\n\n for (var i = 0, n = replies.length; i < n; i++)\n this._dispatcher.handleResponse(replies[i]);\n },\n\n _handleError: function(messages, immediate) {\n messages = [].concat(messages);\n\n this.debug('Client ? failed to send to ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, messages);\n\n for (var i = 0, n = messages.length; i < n; i++)\n this._dispatcher.handleError(messages[i]);\n },\n\n _getCookies: function() {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href;\n\n if (!cookies) return '';\n\n return array.map(cookies.getCookiesSync(url), function(cookie) {\n return cookie.cookieString();\n }).join('; ');\n },\n\n _storeCookies: function(setCookie) {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href,\n cookie;\n\n if (!setCookie || !cookies) return;\n setCookie = [].concat(setCookie);\n\n for (var i = 0, n = setCookie.length; i < n; i++) {\n cookie = Cookie.parse(setCookie[i]);\n cookies.setCookieSync(cookie, url);\n }\n },\n\n _findProxy: function() {\n if (typeof process === 'undefined') return undefined;\n\n var protocol = this.endpoint.protocol;\n if (!protocol) return undefined;\n\n var name = protocol.replace(/:$/, '').toLowerCase() + '_proxy',\n upcase = name.toUpperCase(),\n env = process.env,\n keys, proxy;\n\n if (name === 'http_proxy' && env.REQUEST_METHOD) {\n keys = Object.keys(env).filter(function(k) { return /^http_proxy$/i.test(k) });\n if (keys.length === 1) {\n if (keys[0] === name && env[upcase] === undefined)\n proxy = env[name];\n } else if (keys.length > 1) {\n proxy = env[name];\n }\n proxy = proxy || env['CGI_' + upcase];\n } else {\n proxy = env[name] || env[upcase];\n if (proxy && !env[name])\n console.warn('The environment variable ' + upcase +\n ' is discouraged. Use ' + name + '.');\n }\n return proxy;\n }\n\n}), {\n get: function(dispatcher, allowed, disabled, callback, context) {\n var endpoint = dispatcher.endpoint;\n\n array.asyncEach(this._transports, function(pair, resume) {\n var connType = pair[0], klass = pair[1],\n connEndpoint = dispatcher.endpointFor(connType);\n\n if (array.indexOf(disabled, connType) >= 0)\n return resume();\n\n if (array.indexOf(allowed, connType) < 0) {\n klass.isUsable(dispatcher, connEndpoint, function() {});\n return resume();\n }\n\n klass.isUsable(dispatcher, connEndpoint, function(isUsable) {\n if (!isUsable) return resume();\n var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);\n callback.call(context, transport);\n });\n }, function() {\n throw new Error('Could not find a usable connection type for ' + endpoint.href);\n });\n },\n\n register: function(type, klass) {\n this._transports.push([type, klass]);\n klass.prototype.connectionType = type;\n },\n\n getConnectionTypes: function() {\n return array.map(this._transports, function(t) { return t[0] });\n },\n\n disable: function(feature) {\n if (feature !== 'autodisconnect') return;\n\n for (var i = 0; i < this._transports.length; i++)\n this._transports[i][1]._unloaded = false;\n },\n\n _transports: []\n});\n\nassign(Transport.prototype, Logging);\nassign(Transport.prototype, Timeouts);\n\nmodule.exports = Transport;\n","'use strict';\n\n// http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/\n\nmodule.exports = function(object) {\n return JSON.stringify(object, function(key, value) {\n return (this[key] instanceof Array) ? this[key] : value;\n });\n};\n","'use strict';\n\nvar asap = require('asap');\n\nvar PENDING = -1,\n FULFILLED = 0,\n REJECTED = 1;\n\nvar Promise = function(task) {\n this._state = PENDING;\n this._value = null;\n this._defer = [];\n\n execute(this, task);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var promise = new Promise();\n\n var deferred = {\n promise: promise,\n onFulfilled: onFulfilled,\n onRejected: onRejected\n };\n\n if (this._state === PENDING)\n this._defer.push(deferred);\n else\n propagate(this, deferred);\n\n return promise;\n};\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nvar execute = function(promise, task) {\n if (typeof task !== 'function') return;\n\n var calls = 0;\n\n var resolvePromise = function(value) {\n if (calls++ === 0) resolve(promise, value);\n };\n\n var rejectPromise = function(reason) {\n if (calls++ === 0) reject(promise, reason);\n };\n\n try {\n task(resolvePromise, rejectPromise);\n } catch (error) {\n rejectPromise(error);\n }\n};\n\nvar propagate = function(promise, deferred) {\n var state = promise._state,\n value = promise._value,\n next = deferred.promise,\n handler = [deferred.onFulfilled, deferred.onRejected][state],\n pass = [resolve, reject][state];\n\n if (typeof handler !== 'function')\n return pass(next, value);\n\n asap(function() {\n try {\n resolve(next, handler(value));\n } catch (error) {\n reject(next, error);\n }\n });\n};\n\nvar resolve = function(promise, value) {\n if (promise === value)\n return reject(promise, new TypeError('Recursive promise chain detected'));\n\n var then;\n\n try {\n then = getThen(value);\n } catch (error) {\n return reject(promise, error);\n }\n\n if (!then) return fulfill(promise, value);\n\n execute(promise, function(resolvePromise, rejectPromise) {\n then.call(value, resolvePromise, rejectPromise);\n });\n};\n\nvar getThen = function(value) {\n var type = typeof value,\n then = (type === 'object' || type === 'function') && value && value.then;\n\n return (typeof then === 'function')\n ? then\n : null;\n};\n\nvar fulfill = function(promise, value) {\n settle(promise, FULFILLED, value);\n};\n\nvar reject = function(promise, reason) {\n settle(promise, REJECTED, reason);\n};\n\nvar settle = function(promise, state, value) {\n var defer = promise._defer, i = 0;\n\n promise._state = state;\n promise._value = value;\n promise._defer = null;\n\n if (defer.length === 0) return;\n while (i < defer.length) propagate(promise, defer[i++]);\n};\n\nPromise.resolve = function(value) {\n try {\n if (getThen(value)) return value;\n } catch (error) {\n return Promise.reject(error);\n }\n\n return new Promise(function(resolve, reject) { resolve(value) });\n};\n\nPromise.reject = function(reason) {\n return new Promise(function(resolve, reject) { reject(reason) });\n};\n\nPromise.all = function(promises) {\n return new Promise(function(resolve, reject) {\n var list = [], n = promises.length, i;\n\n if (n === 0) return resolve(list);\n\n var push = function(promise, i) {\n Promise.resolve(promise).then(function(value) {\n list[i] = value;\n if (--n === 0) resolve(list);\n }, reject);\n };\n\n for (i = 0; i < n; i++) push(promises[i], i);\n });\n};\n\nPromise.race = function(promises) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, n = promises.length; i < n; i++)\n Promise.resolve(promises[i]).then(resolve, reject);\n });\n};\n\nPromise.deferred = function() {\n var tuple = {};\n\n tuple.promise = new Promise(function(resolve, reject) {\n tuple.resolve = resolve;\n tuple.reject = reject;\n });\n return tuple;\n};\n\nmodule.exports = Promise;\n","'use strict';\n\nvar Promise = require('../util/promise');\n\nmodule.exports = {\n then: function(callback, errback) {\n var self = this;\n if (!this._promise)\n this._promise = new Promise(function(resolve, reject) {\n self._resolve = resolve;\n self._reject = reject;\n });\n\n if (arguments.length === 0)\n return this._promise;\n else\n return this._promise.then(callback, errback);\n },\n\n callback: function(callback, context) {\n return this.then(function(value) { callback.call(context, value) });\n },\n\n errback: function(callback, context) {\n return this.then(null, function(reason) { callback.call(context, reason) });\n },\n\n timeout: function(seconds, message) {\n this.then();\n var self = this;\n this._timer = global.setTimeout(function() {\n self._reject(message);\n }, seconds * 1000);\n },\n\n setDeferredStatus: function(status, value) {\n if (this._timer) global.clearTimeout(this._timer);\n\n this.then();\n\n if (status === 'succeeded')\n this._resolve(value);\n else if (status === 'failed')\n this._reject(value);\n else\n delete this._promise;\n }\n};\n","'use strict';\n\nvar toJSON = require('../util/to_json');\n\nvar Logging = {\n LOG_LEVELS: {\n fatal: 4,\n error: 3,\n warn: 2,\n info: 1,\n debug: 0\n },\n\n writeLog: function(messageArgs, level) {\n var logger = Logging.logger || (Logging.wrapper || Logging).logger;\n if (!logger) return;\n\n var args = Array.prototype.slice.apply(messageArgs),\n banner = '[Faye',\n klass = this.className,\n\n message = args.shift().replace(/\\?/g, function() {\n try {\n return toJSON(args.shift());\n } catch (error) {\n return '[Object]';\n }\n });\n\n if (klass) banner += '.' + klass;\n banner += '] ';\n\n if (typeof logger[level] === 'function')\n logger[level](banner + message);\n else if (typeof logger === 'function')\n logger(banner + message);\n }\n};\n\nfor (var key in Logging.LOG_LEVELS)\n (function(level) {\n Logging[level] = function() {\n this.writeLog(arguments, level);\n };\n })(key);\n\nmodule.exports = Logging;\n","'use strict';\n\nvar assign = require('../util/assign'),\n EventEmitter = require('../util/event_emitter');\n\nvar Publisher = {\n countListeners: function(eventType) {\n return this.listeners(eventType).length;\n },\n\n bind: function(eventType, listener, context) {\n var slice = Array.prototype.slice,\n handler = function() { listener.apply(context, slice.call(arguments)) };\n\n this._listeners = this._listeners || [];\n this._listeners.push([eventType, listener, context, handler]);\n return this.on(eventType, handler);\n },\n\n unbind: function(eventType, listener, context) {\n this._listeners = this._listeners || [];\n var n = this._listeners.length, tuple;\n\n while (n--) {\n tuple = this._listeners[n];\n if (tuple[0] !== eventType) continue;\n if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;\n this._listeners.splice(n, 1);\n this.removeListener(eventType, tuple[3]);\n }\n }\n};\n\nassign(Publisher, EventEmitter.prototype);\nPublisher.trigger = Publisher.emit;\n\nmodule.exports = Publisher;\n","'use strict';\n\nmodule.exports = {\n commonElement: function(lista, listb) {\n for (var i = 0, n = lista.length; i < n; i++) {\n if (this.indexOf(listb, lista[i]) !== -1)\n return lista[i];\n }\n return null;\n },\n\n indexOf: function(list, needle) {\n if (list.indexOf) return list.indexOf(needle);\n\n for (var i = 0, n = list.length; i < n; i++) {\n if (list[i] === needle) return i;\n }\n return -1;\n },\n\n map: function(object, callback, context) {\n if (object.map) return object.map(callback, context);\n var result = [];\n\n if (object instanceof Array) {\n for (var i = 0, n = object.length; i < n; i++) {\n result.push(callback.call(context || null, object[i], i));\n }\n } else {\n for (var key in object) {\n if (!object.hasOwnProperty(key)) continue;\n result.push(callback.call(context || null, key, object[key]));\n }\n }\n return result;\n },\n\n filter: function(array, callback, context) {\n if (array.filter) return array.filter(callback, context);\n var result = [];\n for (var i = 0, n = array.length; i < n; i++) {\n if (callback.call(context || null, array[i], i))\n result.push(array[i]);\n }\n return result;\n },\n\n asyncEach: function(list, iterator, callback, context) {\n var n = list.length,\n i = -1,\n calls = 0,\n looping = false;\n\n var iterate = function() {\n calls -= 1;\n i += 1;\n if (i === n) return callback && callback.call(context);\n iterator(list[i], resume);\n };\n\n var loop = function() {\n if (looping) return;\n looping = true;\n while (calls > 0) iterate();\n looping = false;\n };\n\n var resume = function() {\n calls += 1;\n loop();\n };\n resume();\n }\n};\n","'use strict';\n\nvar copyObject = function(object) {\n var clone, i, key;\n if (object instanceof Array) {\n clone = [];\n i = object.length;\n while (i--) clone[i] = copyObject(object[i]);\n return clone;\n } else if (typeof object === 'object') {\n clone = (object === null) ? null : {};\n for (key in object) clone[key] = copyObject(object[key]);\n return clone;\n } else {\n return object;\n }\n};\n\nmodule.exports = copyObject;\n","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n","'use strict';\n\nvar Event = {\n _registry: [],\n\n on: function(element, eventName, callback, context) {\n var wrapped = function() { callback.call(context) };\n\n if (element.addEventListener)\n element.addEventListener(eventName, wrapped, false);\n else\n element.attachEvent('on' + eventName, wrapped);\n\n this._registry.push({\n _element: element,\n _type: eventName,\n _callback: callback,\n _context: context,\n _handler: wrapped\n });\n },\n\n detach: function(element, eventName, callback, context) {\n var i = this._registry.length, register;\n while (i--) {\n register = this._registry[i];\n\n if ((element && element !== register._element) ||\n (eventName && eventName !== register._type) ||\n (callback && callback !== register._callback) ||\n (context && context !== register._context))\n continue;\n\n if (register._element.removeEventListener)\n register._element.removeEventListener(register._type, register._handler, false);\n else\n register._element.detachEvent('on' + register._type, register._handler);\n\n this._registry.splice(i,1);\n register = null;\n }\n }\n};\n\nif (global.onunload !== undefined)\n Event.on(global, 'unload', Event.detach, Event);\n\nmodule.exports = {\n Event: Event\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Publisher = require('../mixins/publisher'),\n Grammar = require('./grammar');\n\nvar Channel = Class({\n initialize: function(name) {\n this.id = this.name = name;\n },\n\n push: function(message) {\n this.trigger('message', message);\n },\n\n isUnused: function() {\n return this.countListeners('message') === 0;\n }\n});\n\nassign(Channel.prototype, Publisher);\n\nassign(Channel, {\n HANDSHAKE: '/meta/handshake',\n CONNECT: '/meta/connect',\n SUBSCRIBE: '/meta/subscribe',\n UNSUBSCRIBE: '/meta/unsubscribe',\n DISCONNECT: '/meta/disconnect',\n\n META: 'meta',\n SERVICE: 'service',\n\n expand: function(name) {\n var segments = this.parse(name),\n channels = ['/**', name];\n\n var copy = segments.slice();\n copy[copy.length - 1] = '*';\n channels.push(this.unparse(copy));\n\n for (var i = 1, n = segments.length; i < n; i++) {\n copy = segments.slice(0, i);\n copy.push('**');\n channels.push(this.unparse(copy));\n }\n\n return channels;\n },\n\n isValid: function(name) {\n return Grammar.CHANNEL_NAME.test(name) ||\n Grammar.CHANNEL_PATTERN.test(name);\n },\n\n parse: function(name) {\n if (!this.isValid(name)) return null;\n return name.split('/').slice(1);\n },\n\n unparse: function(segments) {\n return '/' + segments.join('/');\n },\n\n isMeta: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.META) : null;\n },\n\n isService: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.SERVICE) : null;\n },\n\n isSubscribable: function(name) {\n if (!this.isValid(name)) return null;\n return !this.isMeta(name) && !this.isService(name);\n },\n\n Set: Class({\n initialize: function() {\n this._channels = {};\n },\n\n getKeys: function() {\n var keys = [];\n for (var key in this._channels) keys.push(key);\n return keys;\n },\n\n remove: function(name) {\n delete this._channels[name];\n },\n\n hasSubscription: function(name) {\n return this._channels.hasOwnProperty(name);\n },\n\n subscribe: function(names, subscription) {\n var name;\n for (var i = 0, n = names.length; i < n; i++) {\n name = names[i];\n var channel = this._channels[name] = this._channels[name] || new Channel(name);\n channel.bind('message', subscription);\n }\n },\n\n unsubscribe: function(name, subscription) {\n var channel = this._channels[name];\n if (!channel) return false;\n channel.unbind('message', subscription);\n\n if (channel.isUnused()) {\n this.remove(name);\n return true;\n } else {\n return false;\n }\n },\n\n distributeMessage: function(message) {\n var channels = Channel.expand(message.channel);\n\n for (var i = 0, n = channels.length; i < n; i++) {\n var channel = this._channels[channels[i]];\n if (channel) channel.trigger('message', message);\n }\n }\n })\n});\n\nmodule.exports = Channel;\n","'use strict';\n\nmodule.exports = {\n CHANNEL_NAME: /^\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*$/,\n CHANNEL_PATTERN: /^(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*\\/\\*{1,2}$/,\n ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*(,(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)$/,\n VERSION: /^([0-9])+(\\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\\-|\\_))*)*$/\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n cookies = require('../util/cookies'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Transport = require('../transport'),\n Scheduler = require('./scheduler');\n\nvar Dispatcher = Class({ className: 'Dispatcher',\n MAX_REQUEST_SIZE: 2048,\n DEFAULT_RETRY: 5,\n\n UP: 1,\n DOWN: 2,\n\n initialize: function(client, endpoint, options) {\n this._client = client;\n this.endpoint = URI.parse(endpoint);\n this._alternates = options.endpoints || {};\n\n this.cookies = cookies.CookieJar && new cookies.CookieJar();\n this._disabled = [];\n this._envelopes = {};\n this.headers = {};\n this.retry = options.retry || this.DEFAULT_RETRY;\n this._scheduler = options.scheduler || Scheduler;\n this._state = 0;\n this.transports = {};\n this.wsExtensions = [];\n\n this.proxy = options.proxy || {};\n if (typeof this._proxy === 'string') this._proxy = { origin: this._proxy };\n\n var exts = options.websocketExtensions;\n if (exts) {\n exts = [].concat(exts);\n for (var i = 0, n = exts.length; i < n; i++)\n this.addWebsocketExtension(exts[i]);\n }\n\n this.tls = options.tls || {};\n this.tls.ca = this.tls.ca || options.ca;\n\n for (var type in this._alternates)\n this._alternates[type] = URI.parse(this._alternates[type]);\n\n this.maxRequestSize = this.MAX_REQUEST_SIZE;\n },\n\n endpointFor: function(connectionType) {\n return this._alternates[connectionType] || this.endpoint;\n },\n\n addWebsocketExtension: function(extension) {\n this.wsExtensions.push(extension);\n },\n\n disable: function(feature) {\n this._disabled.push(feature);\n Transport.disable(feature);\n },\n\n setHeader: function(name, value) {\n this.headers[name] = value;\n },\n\n close: function() {\n var transport = this._transport;\n delete this._transport;\n if (transport) transport.close();\n },\n\n getConnectionTypes: function() {\n return Transport.getConnectionTypes();\n },\n\n selectTransport: function(transportTypes) {\n Transport.get(this, transportTypes, this._disabled, function(transport) {\n this.debug('Selected ? transport for ?', transport.connectionType, transport.endpoint.href);\n\n if (transport === this._transport) return;\n if (this._transport) this._transport.close();\n\n this._transport = transport;\n this.connectionType = transport.connectionType;\n }, this);\n },\n\n sendMessage: function(message, timeout, options) {\n options = options || {};\n\n var id = message.id,\n attempts = options.attempts,\n deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),\n envelope = this._envelopes[id],\n scheduler;\n\n if (!envelope) {\n scheduler = new this._scheduler(message, { timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline });\n envelope = this._envelopes[id] = { message: message, scheduler: scheduler };\n }\n\n this._sendEnvelope(envelope);\n },\n\n _sendEnvelope: function(envelope) {\n if (!this._transport) return;\n if (envelope.request || envelope.timer) return;\n\n var message = envelope.message,\n scheduler = envelope.scheduler,\n self = this;\n\n if (!scheduler.isDeliverable()) {\n scheduler.abort();\n delete this._envelopes[message.id];\n return;\n }\n\n envelope.timer = global.setTimeout(function() {\n self.handleError(message);\n }, scheduler.getTimeout() * 1000);\n\n scheduler.send();\n envelope.request = this._transport.sendMessage(message);\n },\n\n handleResponse: function(reply) {\n var envelope = this._envelopes[reply.id];\n\n if (reply.successful !== undefined && envelope) {\n envelope.scheduler.succeed();\n delete this._envelopes[reply.id];\n global.clearTimeout(envelope.timer);\n }\n\n this.trigger('message', reply);\n\n if (this._state === this.UP) return;\n this._state = this.UP;\n this._client.trigger('transport:up');\n },\n\n handleError: function(message, immediate) {\n var envelope = this._envelopes[message.id],\n request = envelope && envelope.request,\n self = this;\n\n if (!request) return;\n\n request.then(function(req) {\n if (req && req.abort) req.abort();\n });\n\n var scheduler = envelope.scheduler;\n scheduler.fail();\n\n global.clearTimeout(envelope.timer);\n envelope.request = envelope.timer = null;\n\n if (immediate) {\n this._sendEnvelope(envelope);\n } else {\n envelope.timer = global.setTimeout(function() {\n envelope.timer = null;\n self._sendEnvelope(envelope);\n }, scheduler.getInterval() * 1000);\n }\n\n if (this._state === this.DOWN) return;\n this._state = this.DOWN;\n this._client.trigger('transport:down');\n }\n});\n\nDispatcher.create = function(client, endpoint, options) {\n return new Dispatcher(client, endpoint, options);\n};\n\nassign(Dispatcher.prototype, Publisher);\nassign(Dispatcher.prototype, Logging);\n\nmodule.exports = Dispatcher;\n","'use strict';\n\nmodule.exports = {};\n","'use strict';\n\nvar Transport = require('./transport');\n\nTransport.register('websocket', require('./web_socket'));\nTransport.register('eventsource', require('./event_source'));\nTransport.register('long-polling', require('./xhr'));\nTransport.register('cross-origin-long-polling', require('./cors'));\nTransport.register('callback-polling', require('./jsonp'));\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('./class');\n\nmodule.exports = Class({\n initialize: function() {\n this._index = {};\n },\n\n add: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n if (this._index.hasOwnProperty(key)) return false;\n this._index[key] = item;\n return true;\n },\n\n forEach: function(block, context) {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key))\n block.call(context, this._index[key]);\n }\n },\n\n isEmpty: function() {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key)) return false;\n }\n return true;\n },\n\n member: function(item) {\n for (var key in this._index) {\n if (this._index[key] === item) return true;\n }\n return false;\n },\n\n remove: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n var removed = this._index[key];\n delete this._index[key];\n return removed;\n },\n\n toArray: function() {\n var array = [];\n this.forEach(function(item) { array.push(item) });\n return array;\n }\n});\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar XHR = assign(Class(Transport, {\n encode: function(messages) {\n return toJSON(messages);\n },\n\n request: function(messages) {\n var href = this.endpoint.href,\n self = this,\n xhr;\n\n // Prefer XMLHttpRequest over ActiveXObject if they both exist\n if (global.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (global.ActiveXObject) {\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\n } else {\n return this._handleError(messages);\n }\n\n xhr.open('POST', href, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n var headers = this._dispatcher.headers;\n for (var key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n\n var abort = function() { xhr.abort() };\n if (global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {\n if (!xhr || xhr.readyState !== 4) return;\n\n var replies = null,\n status = xhr.status,\n text = xhr.responseText,\n successful = (status >= 200 && status < 300) || status === 304 || status === 1223;\n\n if (global.onbeforeunload !== undefined)\n browser.Event.detach(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {};\n xhr = null;\n\n if (!successful) return self._handleError(messages);\n\n try {\n replies = JSON.parse(text);\n } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var usable = (navigator.product === 'ReactNative')\n || URI.isSameOrigin(endpoint);\n\n callback.call(context, usable);\n }\n});\n\nmodule.exports = XHR;\n","'use strict';\n\nvar assign = require('../util/assign');\n\nvar Scheduler = function(message, options) {\n this.message = message;\n this.options = options;\n this.attempts = 0;\n};\n\nassign(Scheduler.prototype, {\n getTimeout: function() {\n return this.options.timeout;\n },\n\n getInterval: function() {\n return this.options.interval;\n },\n\n isDeliverable: function() {\n var attempts = this.options.attempts,\n made = this.attempts,\n deadline = this.options.deadline,\n now = new Date().getTime();\n\n if (attempts !== undefined && made >= attempts)\n return false;\n\n if (deadline !== undefined && now > deadline)\n return false;\n\n return true;\n },\n\n send: function() {\n this.attempts += 1;\n },\n\n succeed: function() {},\n\n fail: function() {},\n\n abort: function() {}\n});\n\nmodule.exports = Scheduler;\n","module.exports = {\n VERSION: '1.3.0',\n\n BAYEUX_VERSION: '1.0',\n ID_LENGTH: 160,\n JSONP_CALLBACK: 'jsonpcallback',\n CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],\n\n MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable');\n\nvar Subscription = Class({\n initialize: function(client, channels, callback, context) {\n this._client = client;\n this._channels = channels;\n this._callback = callback;\n this._context = context;\n this._cancelled = false;\n },\n\n withChannel: function(callback, context) {\n this._withChannel = [callback, context];\n return this;\n },\n\n apply: function(context, args) {\n var message = args[0];\n\n if (this._callback)\n this._callback.call(this._context, message.data);\n\n if (this._withChannel)\n this._withChannel[0].call(this._withChannel[1], message.channel, message.data);\n },\n\n cancel: function() {\n if (this._cancelled) return;\n this._client.unsubscribe(this._channels, this);\n this._cancelled = true;\n },\n\n unsubscribe: function() {\n this.cancel();\n }\n});\n\nassign(Subscription.prototype, Deferrable);\n\nmodule.exports = Subscription;\n","'use strict';\n\nvar asap = require('asap'),\n Class = require('../util/class'),\n Promise = require('../util/promise'),\n array = require('../util/array'),\n browser = require('../util/browser'),\n constants = require('../util/constants'),\n assign = require('../util/assign'),\n validateOptions = require('../util/validate_options'),\n Deferrable = require('../mixins/deferrable'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Channel = require('./channel'),\n Dispatcher = require('./dispatcher'),\n Error = require('./error'),\n Extensible = require('./extensible'),\n Publication = require('./publication'),\n Subscription = require('./subscription');\n\nvar Client = Class({ className: 'Client',\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n DISCONNECTED: 4,\n\n HANDSHAKE: 'handshake',\n RETRY: 'retry',\n NONE: 'none',\n\n CONNECTION_TIMEOUT: 60,\n\n DEFAULT_ENDPOINT: '/bayeux',\n INTERVAL: 0,\n\n initialize: function(endpoint, options) {\n this.info('New client created for ?', endpoint);\n options = options || {};\n\n validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);\n\n this._channels = new Channel.Set();\n this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);\n\n this._messageId = 0;\n this._state = this.UNCONNECTED;\n\n this._responseCallbacks = {};\n\n this._advice = {\n reconnect: this.RETRY,\n interval: 1000 * (options.interval || this.INTERVAL),\n timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)\n };\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n this._dispatcher.bind('message', this._receiveMessage, this);\n\n if (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() {\n if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)\n this.disconnect();\n }, this);\n },\n\n addWebsocketExtension: function(extension) {\n return this._dispatcher.addWebsocketExtension(extension);\n },\n\n disable: function(feature) {\n return this._dispatcher.disable(feature);\n },\n\n setHeader: function(name, value) {\n return this._dispatcher.setHeader(name, value);\n },\n\n // Request\n // MUST include: * channel\n // * version\n // * supportedConnectionTypes\n // MAY include: * minimumVersion\n // * ext\n // * id\n //\n // Success Response Failed Response\n // MUST include: * channel MUST include: * channel\n // * version * successful\n // * supportedConnectionTypes * error\n // * clientId MAY include: * supportedConnectionTypes\n // * successful * advice\n // MAY include: * minimumVersion * version\n // * advice * minimumVersion\n // * ext * ext\n // * id * id\n // * authSuccessful\n handshake: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state !== this.UNCONNECTED) return;\n\n this._state = this.CONNECTING;\n var self = this;\n\n this.info('Initiating handshake with ?', this._dispatcher.endpoint.href);\n this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);\n\n this._sendMessage({\n channel: Channel.HANDSHAKE,\n version: constants.BAYEUX_VERSION,\n supportedConnectionTypes: this._dispatcher.getConnectionTypes()\n\n }, {}, function(response) {\n\n if (response.successful) {\n this._state = this.CONNECTED;\n this._dispatcher.clientId = response.clientId;\n\n this._dispatcher.selectTransport(response.supportedConnectionTypes);\n\n this.info('Handshake successful: ?', this._dispatcher.clientId);\n\n this.subscribe(this._channels.getKeys(), true);\n if (callback) asap(function() { callback.call(context) });\n\n } else {\n this.info('Handshake unsuccessful');\n global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);\n this._state = this.UNCONNECTED;\n }\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * connectionType * clientId\n // MAY include: * ext MAY include: * error\n // * id * advice\n // * ext\n // * id\n // * timestamp\n connect: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state === this.DISCONNECTED) return;\n\n if (this._state === this.UNCONNECTED)\n return this.handshake(function() { this.connect(callback, context) }, this);\n\n this.callback(callback, context);\n if (this._state !== this.CONNECTED) return;\n\n this.info('Calling deferred actions for ?', this._dispatcher.clientId);\n this.setDeferredStatus('succeeded');\n this.setDeferredStatus('unknown');\n\n if (this._connectRequest) return;\n this._connectRequest = true;\n\n this.info('Initiating connection for ?', this._dispatcher.clientId);\n\n this._sendMessage({\n channel: Channel.CONNECT,\n clientId: this._dispatcher.clientId,\n connectionType: this._dispatcher.connectionType\n\n }, {}, this._cycleConnection, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // MAY include: * ext * clientId\n // * id MAY include: * error\n // * ext\n // * id\n disconnect: function() {\n if (this._state !== this.CONNECTED) return;\n this._state = this.DISCONNECTED;\n\n this.info('Disconnecting ?', this._dispatcher.clientId);\n var promise = new Publication();\n\n this._sendMessage({\n channel: Channel.DISCONNECT,\n clientId: this._dispatcher.clientId\n\n }, {}, function(response) {\n if (response.successful) {\n this._dispatcher.close();\n promise.setDeferredStatus('succeeded');\n } else {\n promise.setDeferredStatus('failed', Error.parse(response.error));\n }\n }, this);\n\n this.info('Clearing channel listeners for ?', this._dispatcher.clientId);\n this._channels = new Channel.Set();\n\n return promise;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n subscribe: function(channel, callback, context) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.subscribe(c, callback, context);\n }, this);\n\n var subscription = new Subscription(this, channel, callback, context),\n force = (callback === true),\n hasSubscribe = this._channels.hasSubscription(channel);\n\n if (hasSubscribe && !force) {\n this._channels.subscribe([channel], subscription);\n subscription.setDeferredStatus('succeeded');\n return subscription;\n }\n\n this.connect(function() {\n this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);\n if (!force) this._channels.subscribe([channel], subscription);\n\n this._sendMessage({\n channel: Channel.SUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) {\n subscription.setDeferredStatus('failed', Error.parse(response.error));\n return this._channels.unsubscribe(channel, subscription);\n }\n\n var channels = [].concat(response.subscription);\n this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);\n subscription.setDeferredStatus('succeeded');\n }, this);\n }, this);\n\n return subscription;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n unsubscribe: function(channel, subscription) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.unsubscribe(c, subscription);\n }, this);\n\n var dead = this._channels.unsubscribe(channel, subscription);\n if (!dead) return;\n\n this.connect(function() {\n this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);\n\n this._sendMessage({\n channel: Channel.UNSUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) return;\n\n var channels = [].concat(response.subscription);\n this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);\n }, this);\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * data * successful\n // MAY include: * clientId MAY include: * id\n // * id * error\n // * ext * ext\n publish: function(channel, data, options) {\n validateOptions(options || {}, ['attempts', 'deadline']);\n var publication = new Publication();\n\n this.connect(function() {\n this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);\n\n this._sendMessage({\n channel: channel,\n data: data,\n clientId: this._dispatcher.clientId\n\n }, options, function(response) {\n if (response.successful)\n publication.setDeferredStatus('succeeded');\n else\n publication.setDeferredStatus('failed', Error.parse(response.error));\n }, this);\n }, this);\n\n return publication;\n },\n\n _sendMessage: function(message, options, callback, context) {\n message.id = this._generateMessageId();\n\n var timeout = this._advice.timeout\n ? 1.2 * this._advice.timeout / 1000\n : 1.2 * this._dispatcher.retry;\n\n this.pipeThroughExtensions('outgoing', message, null, function(message) {\n if (!message) return;\n if (callback) this._responseCallbacks[message.id] = [callback, context];\n this._dispatcher.sendMessage(message, timeout, options || {});\n }, this);\n },\n\n _generateMessageId: function() {\n this._messageId += 1;\n if (this._messageId >= Math.pow(2,32)) this._messageId = 0;\n return this._messageId.toString(36);\n },\n\n _receiveMessage: function(message) {\n var id = message.id, callback;\n\n if (message.successful !== undefined) {\n callback = this._responseCallbacks[id];\n delete this._responseCallbacks[id];\n }\n\n this.pipeThroughExtensions('incoming', message, null, function(message) {\n if (!message) return;\n if (message.advice) this._handleAdvice(message.advice);\n this._deliverMessage(message);\n if (callback) callback[0].call(callback[1], message);\n }, this);\n },\n\n _handleAdvice: function(advice) {\n assign(this._advice, advice);\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {\n this._state = this.UNCONNECTED;\n this._dispatcher.clientId = null;\n this._cycleConnection();\n }\n },\n\n _deliverMessage: function(message) {\n if (!message.channel || message.data === undefined) return;\n this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);\n this._channels.distributeMessage(message);\n },\n\n _cycleConnection: function() {\n if (this._connectRequest) {\n this._connectRequest = null;\n this.info('Closed connection for ?', this._dispatcher.clientId);\n }\n var self = this;\n global.setTimeout(function() { self.connect() }, this._advice.interval);\n }\n});\n\nassign(Client.prototype, Deferrable);\nassign(Client.prototype, Publisher);\nassign(Client.prototype, Logging);\nassign(Client.prototype, Extensible);\n\nmodule.exports = Client;\n","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== \"undefined\" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","'use strict';\n\nvar array = require('./array');\n\nmodule.exports = function(options, validKeys) {\n for (var key in options) {\n if (array.indexOf(validKeys, key) < 0)\n throw new Error('Unrecognized option: ' + key);\n }\n};\n","/*\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\nfunction indexOf (xs, x) {\n if (xs.indexOf) return xs.indexOf(x);\n for (var i = 0; i < xs.length; i++) {\n if (x === xs[i]) return i;\n }\n return -1;\n}\n\nfunction EventEmitter() {}\nmodule.exports = EventEmitter;\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = indexOf(list, listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n if (arguments.length === 0) {\n this._events = {};\n return this;\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n","'use strict';\n\nmodule.exports = {\n addTimeout: function(name, delay, callback, context) {\n this._timeouts = this._timeouts || {};\n if (this._timeouts.hasOwnProperty(name)) return;\n var self = this;\n this._timeouts[name] = global.setTimeout(function() {\n delete self._timeouts[name];\n callback.call(context);\n }, 1000 * delay);\n },\n\n removeTimeout: function(name) {\n this._timeouts = this._timeouts || {};\n var timeout = this._timeouts[name];\n if (!timeout) return;\n global.clearTimeout(timeout);\n delete this._timeouts[name];\n },\n\n removeAllTimeouts: function() {\n this._timeouts = this._timeouts || {};\n for (var name in this._timeouts) this.removeTimeout(name);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Promise = require('../util/promise'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n ws = require('../util/websocket'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport');\n\nvar WebSocket = assign(Class(Transport, {\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n\n batching: false,\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n this.connect();\n },\n\n request: function(messages) {\n this._pending = this._pending || new Set();\n for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);\n\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.callback(function(socket) {\n if (!socket || socket.readyState !== 1) return;\n socket.send(toJSON(messages));\n resolve(socket);\n });\n\n self.connect();\n });\n\n return {\n abort: function() { promise.then(function(ws) { ws.close() }) }\n };\n },\n\n connect: function() {\n if (WebSocket._unloaded) return;\n\n this._state = this._state || this.UNCONNECTED;\n if (this._state !== this.UNCONNECTED) return;\n this._state = this.CONNECTING;\n\n var socket = this._createSocket();\n if (!socket) return this.setDeferredStatus('failed');\n\n var self = this;\n\n socket.onopen = function() {\n if (socket.headers) self._storeCookies(socket.headers['set-cookie']);\n self._socket = socket;\n self._state = self.CONNECTED;\n self._everConnected = true;\n self.setDeferredStatus('succeeded', socket);\n };\n\n var closed = false;\n socket.onclose = socket.onerror = function() {\n if (closed) return;\n closed = true;\n\n var wasConnected = (self._state === self.CONNECTED);\n socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;\n\n delete self._socket;\n self._state = self.UNCONNECTED;\n\n var pending = self._pending ? self._pending.toArray() : [];\n delete self._pending;\n\n if (wasConnected || self._everConnected) {\n self.setDeferredStatus('unknown');\n self._handleError(pending, wasConnected);\n } else {\n self.setDeferredStatus('failed');\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (!replies) return;\n\n replies = [].concat(replies);\n\n for (var i = 0, n = replies.length; i < n; i++) {\n if (replies[i].successful === undefined) continue;\n self._pending.remove(replies[i]);\n }\n self._receive(replies);\n };\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.close();\n },\n\n _createSocket: function() {\n var url = WebSocket.getSocketUrl(this.endpoint),\n headers = this._dispatcher.headers,\n extensions = this._dispatcher.wsExtensions,\n cookie = this._getCookies(),\n tls = this._dispatcher.tls,\n options = { extensions: extensions, headers: headers, proxy: this._proxy, tls: tls };\n\n if (cookie !== '') options.headers['Cookie'] = cookie;\n\n try {\n return ws.create(url, [], options);\n } catch (e) {\n // catch CSP error to allow transport to fallback to next connType\n }\n }\n\n}), {\n PROTOCOLS: {\n 'http:': 'ws:',\n 'https:': 'wss:'\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};\n sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);\n return sockets[endpoint.href];\n },\n\n getSocketUrl: function(endpoint) {\n endpoint = copyObject(endpoint);\n endpoint.protocol = this.PROTOCOLS[endpoint.protocol];\n return URI.stringify(endpoint);\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }\n});\n\nassign(WebSocket.prototype, Deferrable);\n\nif (browser.Event && global.onbeforeunload !== undefined) {\n browser.Event.on(global, 'beforeunload', function() {\n if (WebSocket._unloaded === undefined)\n WebSocket._unloaded = true;\n });\n}\n\nmodule.exports = WebSocket;\n","'use strict';\n\nvar WS = global.MozWebSocket || global.WebSocket;\n\nmodule.exports = {\n create: function(url, protocols, options) {\n if (typeof WS !== 'function') return null;\n return new WS(url);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport'),\n XHR = require('./xhr');\n\nvar EventSource = assign(Class(Transport, {\n initialize: function(dispatcher, endpoint) {\n Transport.prototype.initialize.call(this, dispatcher, endpoint);\n if (!global.EventSource) return this.setDeferredStatus('failed');\n\n this._xhr = new XHR(dispatcher, endpoint);\n\n endpoint = copyObject(endpoint);\n endpoint.pathname += '/' + dispatcher.clientId;\n\n var socket = new global.EventSource(URI.stringify(endpoint)),\n self = this;\n\n socket.onopen = function() {\n self._everConnected = true;\n self.setDeferredStatus('succeeded');\n };\n\n socket.onerror = function() {\n if (self._everConnected) {\n self._handleError([]);\n } else {\n self.setDeferredStatus('failed');\n socket.close();\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError([]);\n };\n\n this._socket = socket;\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;\n this._socket.close();\n delete this._socket;\n },\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n },\n\n encode: function(messages) {\n return this._xhr.encode(messages);\n },\n\n request: function(messages) {\n return this._xhr.request(messages);\n }\n\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var id = dispatcher.clientId;\n if (!id) return callback.call(context, false);\n\n XHR.isUsable(dispatcher, endpoint, function(usable) {\n if (!usable) return callback.call(context, false);\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }, this);\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},\n id = dispatcher.clientId;\n\n var url = copyObject(endpoint);\n url.pathname += '/' + (id || '');\n url = URI.stringify(url);\n\n sockets[url] = sockets[url] || new this(dispatcher, endpoint);\n return sockets[url];\n }\n});\n\nassign(EventSource.prototype, Deferrable);\n\nmodule.exports = EventSource;\n","'use strict';\n\nvar Class = require('../util/class'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar CORS = assign(Class(Transport, {\n encode: function(messages) {\n return 'message=' + encodeURIComponent(toJSON(messages));\n },\n\n request: function(messages) {\n var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,\n xhr = new xhrClass(),\n id = ++CORS._id,\n headers = this._dispatcher.headers,\n self = this,\n key;\n\n xhr.open('POST', this.endpoint.href, true);\n xhr.withCredentials = true;\n\n if (xhr.setRequestHeader) {\n xhr.setRequestHeader('Pragma', 'no-cache');\n for (key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n\n var cleanUp = function() {\n if (!xhr) return false;\n CORS._pending.remove(id);\n xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;\n xhr = null;\n };\n\n xhr.onload = function() {\n var replies;\n try { replies = JSON.parse(xhr.responseText) } catch (error) {}\n\n cleanUp();\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.onerror = xhr.ontimeout = function() {\n cleanUp();\n self._handleError(messages);\n };\n\n xhr.onprogress = function() {};\n\n if (xhrClass === global.XDomainRequest)\n CORS._pending.add({ id: id, xhr: xhr });\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n _id: 0,\n _pending: new Set(),\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n if (URI.isSameOrigin(endpoint))\n return callback.call(context, false);\n\n if (global.XDomainRequest)\n return callback.call(context, endpoint.protocol === location.protocol);\n\n if (global.XMLHttpRequest) {\n var xhr = new XMLHttpRequest();\n return callback.call(context, xhr.withCredentials !== undefined);\n }\n return callback.call(context, false);\n }\n});\n\nmodule.exports = CORS;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar JSONP = assign(Class(Transport, {\n encode: function(messages) {\n var url = copyObject(this.endpoint);\n url.query.message = toJSON(messages);\n url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';\n return URI.stringify(url);\n },\n\n request: function(messages) {\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callbackName = JSONP.getCallbackName(),\n endpoint = copyObject(this.endpoint),\n self = this;\n\n endpoint.query.message = toJSON(messages);\n endpoint.query.jsonp = callbackName;\n\n var cleanup = function() {\n if (!global[callbackName]) return false;\n global[callbackName] = undefined;\n try { delete global[callbackName] } catch (error) {}\n script.parentNode.removeChild(script);\n };\n\n global[callbackName] = function(replies) {\n cleanup();\n self._receive(replies);\n };\n\n script.type = 'text/javascript';\n script.src = URI.stringify(endpoint);\n head.appendChild(script);\n\n script.onerror = function() {\n cleanup();\n self._handleError(messages);\n };\n\n return { abort: cleanup };\n }\n}), {\n _cbCount: 0,\n\n getCallbackName: function() {\n this._cbCount += 1;\n return '__jsonp' + this._cbCount + '__';\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n callback.call(context, true);\n }\n});\n\nmodule.exports = JSONP;\n","'use strict';\n\nvar Class = require('../util/class'),\n Grammar = require('./grammar');\n\nvar Error = Class({\n initialize: function(code, params, message) {\n this.code = code;\n this.params = Array.prototype.slice.call(params);\n this.message = message;\n },\n\n toString: function() {\n return this.code + ':' +\n this.params.join(',') + ':' +\n this.message;\n }\n});\n\nError.parse = function(message) {\n message = message || '';\n if (!Grammar.ERROR.test(message)) return new Error(null, [], message);\n\n var parts = message.split(':'),\n code = parseInt(parts[0]),\n params = parts[1].split(','),\n message = parts[2];\n\n return new Error(code, params, message);\n};\n\n// http://code.google.com/p/cometd/wiki/BayeuxCodes\nvar errors = {\n versionMismatch: [300, 'Version mismatch'],\n conntypeMismatch: [301, 'Connection types not supported'],\n extMismatch: [302, 'Extension mismatch'],\n badRequest: [400, 'Bad request'],\n clientUnknown: [401, 'Unknown client'],\n parameterMissing: [402, 'Missing required parameter'],\n channelForbidden: [403, 'Forbidden channel'],\n channelUnknown: [404, 'Unknown channel'],\n channelInvalid: [405, 'Invalid channel'],\n extUnknown: [406, 'Unknown extension'],\n publishFailed: [407, 'Failed to publish'],\n serverError: [500, 'Internal server error']\n};\n\nfor (var name in errors)\n (function(name) {\n Error[name] = function() {\n return new Error(errors[name][0], arguments, errors[name][1]).toString();\n };\n })(name);\n\nmodule.exports = Error;\n","'use strict';\n\nvar assign = require('../util/assign'),\n Logging = require('../mixins/logging');\n\nvar Extensible = {\n addExtension: function(extension) {\n this._extensions = this._extensions || [];\n this._extensions.push(extension);\n if (extension.added) extension.added(this);\n },\n\n removeExtension: function(extension) {\n if (!this._extensions) return;\n var i = this._extensions.length;\n while (i--) {\n if (this._extensions[i] !== extension) continue;\n this._extensions.splice(i,1);\n if (extension.removed) extension.removed(this);\n }\n },\n\n pipeThroughExtensions: function(stage, message, request, callback, context) {\n this.debug('Passing through ? extensions: ?', stage, message);\n\n if (!this._extensions) return callback.call(context, message);\n var extensions = this._extensions.slice();\n\n var pipe = function(message) {\n if (!message) return callback.call(context, message);\n\n var extension = extensions.shift();\n if (!extension) return callback.call(context, message);\n\n var fn = extension[stage];\n if (!fn) return pipe(message);\n\n if (fn.length >= 3) extension[stage](message, request, pipe);\n else extension[stage](message, pipe);\n };\n pipe(message);\n }\n};\n\nassign(Extensible, Logging);\n\nmodule.exports = Extensible;\n","'use strict';\n\nvar Class = require('../util/class'),\n Deferrable = require('../mixins/deferrable');\n\nmodule.exports = Class(Deferrable);\n","'use strict';\n\nvar constants = require('./util/constants'),\n Logging = require('./mixins/logging');\n\nvar Faye = {\n VERSION: constants.VERSION,\n\n Client: require('./protocol/client'),\n Scheduler: require('./protocol/scheduler')\n};\n\nLogging.wrapper = Faye;\n\nmodule.exports = Faye;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://Faye/webpack/bootstrap","webpack://Faye/./src/util/assign.js","webpack://Faye/./src/util/class.js","webpack://Faye/(webpack)/buildin/global.js","webpack://Faye/./src/util/uri.js","webpack://Faye/./src/transport/transport.js","webpack://Faye/./src/util/to_json.js","webpack://Faye/./src/util/promise.js","webpack://Faye/./src/mixins/deferrable.js","webpack://Faye/./src/mixins/logging.js","webpack://Faye/./src/mixins/publisher.js","webpack://Faye/./src/util/array.js","webpack://Faye/./src/util/copy_object.js","webpack://Faye/./node_modules/asap/browser-asap.js","webpack://Faye/./src/util/browser/event.js","webpack://Faye/./src/protocol/channel.js","webpack://Faye/./src/protocol/grammar.js","webpack://Faye/./src/protocol/dispatcher.js","webpack://Faye/./src/util/cookies/browser_cookies.js","webpack://Faye/./src/transport/browser_transports.js","webpack://Faye/./src/util/set.js","webpack://Faye/./src/transport/xhr.js","webpack://Faye/./src/protocol/scheduler.js","webpack://Faye/./src/util/constants.js","webpack://Faye/./src/protocol/subscription.js","webpack://Faye/./src/protocol/client.js","webpack://Faye/./node_modules/asap/browser-raw.js","webpack://Faye/./src/util/validate_options.js","webpack://Faye/./src/util/event_emitter.js","webpack://Faye/./src/mixins/timeouts.js","webpack://Faye/./src/transport/web_socket.js","webpack://Faye/./src/util/websocket/browser_websocket.js","webpack://Faye/./src/transport/event_source.js","webpack://Faye/./src/transport/cors.js","webpack://Faye/./src/transport/jsonp.js","webpack://Faye/./src/protocol/error.js","webpack://Faye/./src/protocol/extensible.js","webpack://Faye/./src/protocol/publication.js","webpack://Faye/./src/faye_browser.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","forEach","Array","hasOwn","target","arguments","source","assign","parent","methods","klass","this","initialize","apply","bridge","g","Function","e","window","isURI","uri","protocol","host","path","isSameOrigin","location","hostname","port","parse","url","parts","query","pairs","data","consume","pattern","replace","match","test","pathname","substr","auth","split","search","length","decodeURIComponent","href","stringify","string","queryString","hash","push","encodeURIComponent","join","Class","Cookie","Promise","array","Logging","Timeouts","Channel","Transport","className","DEFAULT_PORTS","MAX_DELAY","batching","dispatcher","endpoint","_dispatcher","_outbox","_proxy","proxy","origin","_findProxy","close","encode","messages","sendMessage","message","debug","clientId","_flushLargeBatch","channel","HANDSHAKE","_publish","CONNECT","_connectMessage","resolve","request","_makePromise","self","_requestPromise","_resolvePromise","delay","addTimeout","_flush","removeTimeout","advice","timeout","maxRequestSize","last","pop","_receive","replies","concat","connectionType","handleResponse","_handleError","immediate","handleError","_getCookies","cookies","map","getCookiesSync","cookie","cookieString","_storeCookies","setCookie","setCookieSync","process","keys","toLowerCase","upcase","toUpperCase","env","REQUEST_METHOD","filter","k","undefined","console","warn","allowed","disabled","callback","context","asyncEach","_transports","pair","resume","connType","connEndpoint","endpointFor","indexOf","isUsable","transport","Error","register","type","getConnectionTypes","disable","feature","_unloaded","JSON","asap","task","_state","_value","_defer","execute","then","onFulfilled","onRejected","promise","deferred","propagate","calls","rejectPromise","reason","reject","error","state","next","handler","pass","TypeError","getThen","fulfill","resolvePromise","settle","defer","all","promises","list","race","tuple","errback","_promise","_resolve","_reject","seconds","_timer","global","setTimeout","setDeferredStatus","status","clearTimeout","toJSON","LOG_LEVELS","fatal","info","writeLog","messageArgs","level","logger","wrapper","args","slice","banner","shift","Publisher","countListeners","eventType","listeners","listener","_listeners","on","unbind","splice","removeListener","trigger","emit","commonElement","lista","listb","needle","result","iterator","looping","iterate","loop","copyObject","clone","rawAsap","freeTasks","pendingErrors","requestErrorThrow","makeRequestCallFromTimer","rawTask","RawTask","onerror","Event","_registry","element","eventName","wrapped","addEventListener","attachEvent","_element","_type","_callback","_context","_handler","detach","removeEventListener","detachEvent","onunload","Grammar","id","isUnused","SUBSCRIBE","UNSUBSCRIBE","DISCONNECT","META","SERVICE","expand","segments","channels","copy","unparse","isValid","CHANNEL_NAME","CHANNEL_PATTERN","isMeta","isService","isSubscribable","Set","_channels","getKeys","remove","hasSubscription","subscribe","names","subscription","unsubscribe","distributeMessage","ERROR","VERSION","URI","Scheduler","Dispatcher","MAX_REQUEST_SIZE","DEFAULT_RETRY","UP","DOWN","client","options","_client","_alternates","endpoints","CookieJar","_disabled","_envelopes","headers","retry","_scheduler","scheduler","transports","wsExtensions","exts","websocketExtensions","addWebsocketExtension","tls","ca","extension","setHeader","_transport","selectTransport","transportTypes","attempts","deadline","Date","getTime","envelope","interval","_sendEnvelope","timer","isDeliverable","abort","getTimeout","send","reply","successful","succeed","req","fail","getInterval","_index","add","item","block","isEmpty","member","removed","toArray","browser","XHR","xhr","XMLHttpRequest","ActiveXObject","open","setRequestHeader","onbeforeunload","onreadystatechange","readyState","text","responseText","usable","navigator","product","made","now","BAYEUX_VERSION","ID_LENGTH","JSONP_CALLBACK","CONNECTION_TYPES","MANDATORY_CONNECTION_TYPES","Deferrable","Subscription","_cancelled","withChannel","_withChannel","cancel","constants","validateOptions","Extensible","Publication","Client","UNCONNECTED","CONNECTING","CONNECTED","DISCONNECTED","RETRY","NONE","CONNECTION_TIMEOUT","DEFAULT_ENDPOINT","INTERVAL","_messageId","_responseCallbacks","_advice","reconnect","_receiveMessage","disconnect","handshake","_sendMessage","version","supportedConnectionTypes","response","connect","_connectRequest","_cycleConnection","force","publish","publication","_generateMessageId","pipeThroughExtensions","Math","pow","toString","_handleAdvice","_deliverMessage","queue","requestFlush","index","flush","currentIndex","scan","newLength","toggle","observer","node","scope","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","timeoutHandle","handleTimer","intervalHandle","setInterval","clearInterval","document","createTextNode","observe","characterData","validKeys","isArray","xs","EventEmitter","_events","addListener","once","x","removeAllListeners","_timeouts","removeAllTimeouts","ws","WebSocket","_pending","socket","_createSocket","onopen","_socket","_everConnected","closed","onclose","wasConnected","onmessage","pending","event","getSocketUrl","extensions","PROTOCOLS","sockets","websocket","WS","MozWebSocket","protocols","EventSource","_xhr","eventsource","CORS","xhrClass","XDomainRequest","_id","withCredentials","cleanUp","onload","ontimeout","onprogress","JSONP","jsonp","_cbCount","head","getElementsByTagName","script","createElement","callbackName","getCallbackName","cleanup","parentNode","removeChild","src","appendChild","code","params","parseInt","errors","versionMismatch","conntypeMismatch","extMismatch","badRequest","clientUnknown","parameterMissing","channelForbidden","channelUnknown","channelInvalid","extUnknown","publishFailed","serverError","addExtension","_extensions","added","removeExtension","stage","pipe","fn","Faye"],"mappings":"qBACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,I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EAAU6B,SAAS7B,EAAU6B,QAAQ3U,QAI7CyY,sBAAuB,SAAS4G,EAAOlb,EAASU,EAAS6C,EAAUC,GAGjE,GAFA3H,KAAKoE,MAAM,kCAAmCib,EAAOlb,IAEhDnE,KAAKkf,YAAa,OAAOxX,EAASjK,KAAKkK,EAASxD,GACrD,IAAI6X,EAAahc,KAAKkf,YAAY/S,QAE9BmT,EAAO,SAASnb,GAClB,IAAKA,EAAS,OAAOuD,EAASjK,KAAKkK,EAASxD,GAE5C,IAAI2O,EAAYkJ,EAAW3P,QAC3B,IAAKyG,EAAW,OAAOpL,EAASjK,KAAKkK,EAASxD,GAE9C,IAAIob,EAAKzM,EAAUuM,GACnB,IAAKE,EAAI,OAAOD,EAAKnb,GAEjBob,EAAGtd,QAAU,EAAG6Q,EAAUuM,GAAOlb,EAASU,EAASya,GACnCxM,EAAUuM,GAAOlb,EAASmb,IAEhDA,EAAKnb,KAtCK,EAAQ,EA0CtBvE,CAAO+W,EAzCO,EAAQ,IA2CtBtZ,EAAOD,QAAUuZ,G,6BC5CjB,IAAIhU,EAAa,EAAQ,GACrBwT,EAAa,EAAQ,GAEzB9Y,EAAOD,QAAUuF,EAAMwT,I,6BCHvB,IAAIM,EAAY,EAAQ,IACpB1T,EAAY,EAAQ,GAEpByc,EAAO,CACTrO,QAAYsF,EAAUtF,QAEtB0F,OAAY,EAAQ,IACpBxF,UAAY,EAAQ,KAGtBtO,EAAQkJ,QAAUuT,EAElBniB,EAAOD,QAAUoiB","file":"build/client/faye-browser-min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 38);\n","'use strict';\n\nvar forEach = Array.prototype.forEach,\n hasOwn = Object.prototype.hasOwnProperty;\n\nmodule.exports = function(target) {\n forEach.call(arguments, function(source, i) {\n if (i === 0) return;\n\n for (var key in source) {\n if (hasOwn.call(source, key)) target[key] = source[key];\n }\n });\n\n return target;\n};\n","'use strict';\n\nvar assign = require('./assign');\n\nmodule.exports = function(parent, methods) {\n if (typeof parent !== 'function') {\n methods = parent;\n parent = Object;\n }\n\n var klass = function() {\n if (!this.initialize) return this;\n return this.initialize.apply(this, arguments) || this;\n };\n\n var bridge = function() {};\n bridge.prototype = parent.prototype;\n\n klass.prototype = new bridge();\n assign(klass.prototype, methods);\n\n return klass;\n};\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nmodule.exports = {\n isURI: function(uri) {\n return uri && uri.protocol && uri.host && uri.path;\n },\n\n isSameOrigin: function(uri) {\n return uri.protocol === location.protocol &&\n uri.hostname === location.hostname &&\n uri.port === location.port;\n },\n\n parse: function(url) {\n if (typeof url !== 'string') return url;\n var uri = {}, parts, query, pairs, i, n, data;\n\n var consume = function(name, pattern) {\n url = url.replace(pattern, function(match) {\n uri[name] = match;\n return '';\n });\n uri[name] = uri[name] || '';\n };\n\n consume('protocol', /^[a-z]+\\:/i);\n consume('host', /^\\/\\/[^\\/\\?#]+/);\n\n if (!/^\\//.test(url) && !uri.host)\n url = location.pathname.replace(/[^\\/]*$/, '') + url;\n\n consume('pathname', /^[^\\?#]*/);\n consume('search', /^\\?[^#]*/);\n consume('hash', /^#.*/);\n\n uri.protocol = uri.protocol || location.protocol;\n\n if (uri.host) {\n uri.host = uri.host.substr(2);\n\n if (/@/.test(uri.host)) {\n uri.auth = uri.host.split('@')[0];\n uri.host = uri.host.split('@')[1];\n }\n parts = uri.host.match(/^\\[([^\\]]+)\\]|^[^:]+/);\n uri.hostname = parts[1] || parts[0];\n uri.port = (uri.host.match(/:(\\d+)$/) || [])[1] || '';\n } else {\n uri.host = location.host;\n uri.hostname = location.hostname;\n uri.port = location.port;\n }\n\n uri.pathname = uri.pathname || '/';\n uri.path = uri.pathname + uri.search;\n\n query = uri.search.replace(/^\\?/, '');\n pairs = query ? query.split('&') : [];\n data = {};\n\n for (i = 0, n = pairs.length; i < n; i++) {\n parts = pairs[i].split('=');\n data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');\n }\n\n uri.query = data;\n\n uri.href = this.stringify(uri);\n return uri;\n },\n\n stringify: function(uri) {\n var auth = uri.auth ? uri.auth + '@' : '',\n string = uri.protocol + '//' + auth + uri.host;\n\n string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');\n\n return string;\n },\n\n queryString: function(query) {\n var pairs = [];\n for (var key in query) {\n if (!query.hasOwnProperty(key)) continue;\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));\n }\n if (pairs.length === 0) return '';\n return '?' + pairs.join('&');\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Cookie = require('../util/cookies').Cookie,\n Promise = require('../util/promise'),\n array = require('../util/array'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Timeouts = require('../mixins/timeouts'),\n Channel = require('../protocol/channel');\n\nvar Transport = assign(Class({ className: 'Transport',\n DEFAULT_PORTS: { 'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443 },\n MAX_DELAY: 0,\n\n batching: true,\n\n initialize: function(dispatcher, endpoint) {\n this._dispatcher = dispatcher;\n this.endpoint = endpoint;\n this._outbox = [];\n this._proxy = assign({}, this._dispatcher.proxy);\n\n if (!this._proxy.origin)\n this._proxy.origin = this._findProxy();\n },\n\n close: function() {},\n\n encode: function(messages) {\n return '';\n },\n\n sendMessage: function(message) {\n this.debug('Client ? sending message to ?: ?',\n this._dispatcher.clientId, this.endpoint.href, message);\n\n if (!this.batching) return Promise.resolve(this.request([message]));\n\n this._outbox.push(message);\n this._flushLargeBatch();\n\n if (message.channel === Channel.HANDSHAKE)\n return this._publish(0.01);\n\n if (message.channel === Channel.CONNECT)\n this._connectMessage = message;\n\n return this._publish(this.MAX_DELAY);\n },\n\n _makePromise: function() {\n var self = this;\n\n this._requestPromise = this._requestPromise || new Promise(function(resolve) {\n self._resolvePromise = resolve;\n });\n },\n\n _publish: function(delay) {\n this._makePromise();\n\n this.addTimeout('publish', delay, function() {\n this._flush();\n delete this._requestPromise;\n }, this);\n\n return this._requestPromise;\n },\n\n _flush: function() {\n this.removeTimeout('publish');\n\n if (this._outbox.length > 1 && this._connectMessage)\n this._connectMessage.advice = { timeout: 0 };\n\n this._resolvePromise(this.request(this._outbox));\n\n this._connectMessage = null;\n this._outbox = [];\n },\n\n _flushLargeBatch: function() {\n var string = this.encode(this._outbox);\n if (string.length < this._dispatcher.maxRequestSize) return;\n var last = this._outbox.pop();\n\n this._makePromise();\n this._flush();\n\n if (last) this._outbox.push(last);\n },\n\n _receive: function(replies) {\n if (!replies) return;\n replies = [].concat(replies);\n\n this.debug('Client ? received from ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, replies);\n\n for (var i = 0, n = replies.length; i < n; i++)\n this._dispatcher.handleResponse(replies[i]);\n },\n\n _handleError: function(messages, immediate) {\n messages = [].concat(messages);\n\n this.debug('Client ? failed to send to ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, messages);\n\n for (var i = 0, n = messages.length; i < n; i++)\n this._dispatcher.handleError(messages[i]);\n },\n\n _getCookies: function() {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href;\n\n if (!cookies) return '';\n\n return array.map(cookies.getCookiesSync(url), function(cookie) {\n return cookie.cookieString();\n }).join('; ');\n },\n\n _storeCookies: function(setCookie) {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href,\n cookie;\n\n if (!setCookie || !cookies) return;\n setCookie = [].concat(setCookie);\n\n for (var i = 0, n = setCookie.length; i < n; i++) {\n cookie = Cookie.parse(setCookie[i]);\n cookies.setCookieSync(cookie, url);\n }\n },\n\n _findProxy: function() {\n if (typeof process === 'undefined') return undefined;\n\n var protocol = this.endpoint.protocol;\n if (!protocol) return undefined;\n\n var name = protocol.replace(/:$/, '').toLowerCase() + '_proxy',\n upcase = name.toUpperCase(),\n env = process.env,\n keys, proxy;\n\n if (name === 'http_proxy' && env.REQUEST_METHOD) {\n keys = Object.keys(env).filter(function(k) { return /^http_proxy$/i.test(k) });\n if (keys.length === 1) {\n if (keys[0] === name && env[upcase] === undefined)\n proxy = env[name];\n } else if (keys.length > 1) {\n proxy = env[name];\n }\n proxy = proxy || env['CGI_' + upcase];\n } else {\n proxy = env[name] || env[upcase];\n if (proxy && !env[name])\n console.warn('The environment variable ' + upcase +\n ' is discouraged. Use ' + name + '.');\n }\n return proxy;\n }\n\n}), {\n get: function(dispatcher, allowed, disabled, callback, context) {\n var endpoint = dispatcher.endpoint;\n\n array.asyncEach(this._transports, function(pair, resume) {\n var connType = pair[0], klass = pair[1],\n connEndpoint = dispatcher.endpointFor(connType);\n\n if (array.indexOf(disabled, connType) >= 0)\n return resume();\n\n if (array.indexOf(allowed, connType) < 0) {\n klass.isUsable(dispatcher, connEndpoint, function() {});\n return resume();\n }\n\n klass.isUsable(dispatcher, connEndpoint, function(isUsable) {\n if (!isUsable) return resume();\n var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);\n callback.call(context, transport);\n });\n }, function() {\n throw new Error('Could not find a usable connection type for ' + endpoint.href);\n });\n },\n\n register: function(type, klass) {\n this._transports.push([type, klass]);\n klass.prototype.connectionType = type;\n },\n\n getConnectionTypes: function() {\n return array.map(this._transports, function(t) { return t[0] });\n },\n\n disable: function(feature) {\n if (feature !== 'autodisconnect') return;\n\n for (var i = 0; i < this._transports.length; i++)\n this._transports[i][1]._unloaded = false;\n },\n\n _transports: []\n});\n\nassign(Transport.prototype, Logging);\nassign(Transport.prototype, Timeouts);\n\nmodule.exports = Transport;\n","'use strict';\n\n// http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/\n\nmodule.exports = function(object) {\n return JSON.stringify(object, function(key, value) {\n return (this[key] instanceof Array) ? this[key] : value;\n });\n};\n","'use strict';\n\nvar asap = require('asap');\n\nvar PENDING = -1,\n FULFILLED = 0,\n REJECTED = 1;\n\nvar Promise = function(task) {\n this._state = PENDING;\n this._value = null;\n this._defer = [];\n\n execute(this, task);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var promise = new Promise();\n\n var deferred = {\n promise: promise,\n onFulfilled: onFulfilled,\n onRejected: onRejected\n };\n\n if (this._state === PENDING)\n this._defer.push(deferred);\n else\n propagate(this, deferred);\n\n return promise;\n};\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nvar execute = function(promise, task) {\n if (typeof task !== 'function') return;\n\n var calls = 0;\n\n var resolvePromise = function(value) {\n if (calls++ === 0) resolve(promise, value);\n };\n\n var rejectPromise = function(reason) {\n if (calls++ === 0) reject(promise, reason);\n };\n\n try {\n task(resolvePromise, rejectPromise);\n } catch (error) {\n rejectPromise(error);\n }\n};\n\nvar propagate = function(promise, deferred) {\n var state = promise._state,\n value = promise._value,\n next = deferred.promise,\n handler = [deferred.onFulfilled, deferred.onRejected][state],\n pass = [resolve, reject][state];\n\n if (typeof handler !== 'function')\n return pass(next, value);\n\n asap(function() {\n try {\n resolve(next, handler(value));\n } catch (error) {\n reject(next, error);\n }\n });\n};\n\nvar resolve = function(promise, value) {\n if (promise === value)\n return reject(promise, new TypeError('Recursive promise chain detected'));\n\n var then;\n\n try {\n then = getThen(value);\n } catch (error) {\n return reject(promise, error);\n }\n\n if (!then) return fulfill(promise, value);\n\n execute(promise, function(resolvePromise, rejectPromise) {\n then.call(value, resolvePromise, rejectPromise);\n });\n};\n\nvar getThen = function(value) {\n var type = typeof value,\n then = (type === 'object' || type === 'function') && value && value.then;\n\n return (typeof then === 'function')\n ? then\n : null;\n};\n\nvar fulfill = function(promise, value) {\n settle(promise, FULFILLED, value);\n};\n\nvar reject = function(promise, reason) {\n settle(promise, REJECTED, reason);\n};\n\nvar settle = function(promise, state, value) {\n var defer = promise._defer, i = 0;\n\n promise._state = state;\n promise._value = value;\n promise._defer = null;\n\n if (defer.length === 0) return;\n while (i < defer.length) propagate(promise, defer[i++]);\n};\n\nPromise.resolve = function(value) {\n try {\n if (getThen(value)) return value;\n } catch (error) {\n return Promise.reject(error);\n }\n\n return new Promise(function(resolve, reject) { resolve(value) });\n};\n\nPromise.reject = function(reason) {\n return new Promise(function(resolve, reject) { reject(reason) });\n};\n\nPromise.all = function(promises) {\n return new Promise(function(resolve, reject) {\n var list = [], n = promises.length, i;\n\n if (n === 0) return resolve(list);\n\n var push = function(promise, i) {\n Promise.resolve(promise).then(function(value) {\n list[i] = value;\n if (--n === 0) resolve(list);\n }, reject);\n };\n\n for (i = 0; i < n; i++) push(promises[i], i);\n });\n};\n\nPromise.race = function(promises) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, n = promises.length; i < n; i++)\n Promise.resolve(promises[i]).then(resolve, reject);\n });\n};\n\nPromise.deferred = function() {\n var tuple = {};\n\n tuple.promise = new Promise(function(resolve, reject) {\n tuple.resolve = resolve;\n tuple.reject = reject;\n });\n return tuple;\n};\n\nmodule.exports = Promise;\n","'use strict';\n\nvar Promise = require('../util/promise');\n\nmodule.exports = {\n then: function(callback, errback) {\n var self = this;\n if (!this._promise)\n this._promise = new Promise(function(resolve, reject) {\n self._resolve = resolve;\n self._reject = reject;\n });\n\n if (arguments.length === 0)\n return this._promise;\n else\n return this._promise.then(callback, errback);\n },\n\n callback: function(callback, context) {\n return this.then(function(value) { callback.call(context, value) });\n },\n\n errback: function(callback, context) {\n return this.then(null, function(reason) { callback.call(context, reason) });\n },\n\n timeout: function(seconds, message) {\n this.then();\n var self = this;\n this._timer = global.setTimeout(function() {\n self._reject(message);\n }, seconds * 1000);\n },\n\n setDeferredStatus: function(status, value) {\n if (this._timer) global.clearTimeout(this._timer);\n\n this.then();\n\n if (status === 'succeeded')\n this._resolve(value);\n else if (status === 'failed')\n this._reject(value);\n else\n delete this._promise;\n }\n};\n","'use strict';\n\nvar toJSON = require('../util/to_json');\n\nvar Logging = {\n LOG_LEVELS: {\n fatal: 4,\n error: 3,\n warn: 2,\n info: 1,\n debug: 0\n },\n\n writeLog: function(messageArgs, level) {\n var logger = Logging.logger || (Logging.wrapper || Logging).logger;\n if (!logger) return;\n\n var args = Array.prototype.slice.apply(messageArgs),\n banner = '[Faye',\n klass = this.className,\n\n message = args.shift().replace(/\\?/g, function() {\n try {\n return toJSON(args.shift());\n } catch (error) {\n return '[Object]';\n }\n });\n\n if (klass) banner += '.' + klass;\n banner += '] ';\n\n if (typeof logger[level] === 'function')\n logger[level](banner + message);\n else if (typeof logger === 'function')\n logger(banner + message);\n }\n};\n\nfor (var key in Logging.LOG_LEVELS)\n (function(level) {\n Logging[level] = function() {\n this.writeLog(arguments, level);\n };\n })(key);\n\nmodule.exports = Logging;\n","'use strict';\n\nvar assign = require('../util/assign'),\n EventEmitter = require('../util/event_emitter');\n\nvar Publisher = {\n countListeners: function(eventType) {\n return this.listeners(eventType).length;\n },\n\n bind: function(eventType, listener, context) {\n var slice = Array.prototype.slice,\n handler = function() { listener.apply(context, slice.call(arguments)) };\n\n this._listeners = this._listeners || [];\n this._listeners.push([eventType, listener, context, handler]);\n return this.on(eventType, handler);\n },\n\n unbind: function(eventType, listener, context) {\n this._listeners = this._listeners || [];\n var n = this._listeners.length, tuple;\n\n while (n--) {\n tuple = this._listeners[n];\n if (tuple[0] !== eventType) continue;\n if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;\n this._listeners.splice(n, 1);\n this.removeListener(eventType, tuple[3]);\n }\n }\n};\n\nassign(Publisher, EventEmitter.prototype);\nPublisher.trigger = Publisher.emit;\n\nmodule.exports = Publisher;\n","'use strict';\n\nmodule.exports = {\n commonElement: function(lista, listb) {\n for (var i = 0, n = lista.length; i < n; i++) {\n if (this.indexOf(listb, lista[i]) !== -1)\n return lista[i];\n }\n return null;\n },\n\n indexOf: function(list, needle) {\n if (list.indexOf) return list.indexOf(needle);\n\n for (var i = 0, n = list.length; i < n; i++) {\n if (list[i] === needle) return i;\n }\n return -1;\n },\n\n map: function(object, callback, context) {\n if (object.map) return object.map(callback, context);\n var result = [];\n\n if (object instanceof Array) {\n for (var i = 0, n = object.length; i < n; i++) {\n result.push(callback.call(context || null, object[i], i));\n }\n } else {\n for (var key in object) {\n if (!object.hasOwnProperty(key)) continue;\n result.push(callback.call(context || null, key, object[key]));\n }\n }\n return result;\n },\n\n filter: function(array, callback, context) {\n if (array.filter) return array.filter(callback, context);\n var result = [];\n for (var i = 0, n = array.length; i < n; i++) {\n if (callback.call(context || null, array[i], i))\n result.push(array[i]);\n }\n return result;\n },\n\n asyncEach: function(list, iterator, callback, context) {\n var n = list.length,\n i = -1,\n calls = 0,\n looping = false;\n\n var iterate = function() {\n calls -= 1;\n i += 1;\n if (i === n) return callback && callback.call(context);\n iterator(list[i], resume);\n };\n\n var loop = function() {\n if (looping) return;\n looping = true;\n while (calls > 0) iterate();\n looping = false;\n };\n\n var resume = function() {\n calls += 1;\n loop();\n };\n resume();\n }\n};\n","'use strict';\n\nvar copyObject = function(object) {\n var clone, i, key;\n if (object instanceof Array) {\n clone = [];\n i = object.length;\n while (i--) clone[i] = copyObject(object[i]);\n return clone;\n } else if (typeof object === 'object') {\n clone = (object === null) ? null : {};\n for (key in object) clone[key] = copyObject(object[key]);\n return clone;\n } else {\n return object;\n }\n};\n\nmodule.exports = copyObject;\n","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n","'use strict';\n\nvar Event = {\n _registry: [],\n\n on: function(element, eventName, callback, context) {\n var wrapped = function() { callback.call(context) };\n\n if (element.addEventListener)\n element.addEventListener(eventName, wrapped, false);\n else\n element.attachEvent('on' + eventName, wrapped);\n\n this._registry.push({\n _element: element,\n _type: eventName,\n _callback: callback,\n _context: context,\n _handler: wrapped\n });\n },\n\n detach: function(element, eventName, callback, context) {\n var i = this._registry.length, register;\n while (i--) {\n register = this._registry[i];\n\n if ((element && element !== register._element) ||\n (eventName && eventName !== register._type) ||\n (callback && callback !== register._callback) ||\n (context && context !== register._context))\n continue;\n\n if (register._element.removeEventListener)\n register._element.removeEventListener(register._type, register._handler, false);\n else\n register._element.detachEvent('on' + register._type, register._handler);\n\n this._registry.splice(i,1);\n register = null;\n }\n }\n};\n\nif (global.onunload !== undefined)\n Event.on(global, 'unload', Event.detach, Event);\n\nmodule.exports = {\n Event: Event\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Publisher = require('../mixins/publisher'),\n Grammar = require('./grammar');\n\nvar Channel = Class({\n initialize: function(name) {\n this.id = this.name = name;\n },\n\n push: function(message) {\n this.trigger('message', message);\n },\n\n isUnused: function() {\n return this.countListeners('message') === 0;\n }\n});\n\nassign(Channel.prototype, Publisher);\n\nassign(Channel, {\n HANDSHAKE: '/meta/handshake',\n CONNECT: '/meta/connect',\n SUBSCRIBE: '/meta/subscribe',\n UNSUBSCRIBE: '/meta/unsubscribe',\n DISCONNECT: '/meta/disconnect',\n\n META: 'meta',\n SERVICE: 'service',\n\n expand: function(name) {\n var segments = this.parse(name),\n channels = ['/**', name];\n\n var copy = segments.slice();\n copy[copy.length - 1] = '*';\n channels.push(this.unparse(copy));\n\n for (var i = 1, n = segments.length; i < n; i++) {\n copy = segments.slice(0, i);\n copy.push('**');\n channels.push(this.unparse(copy));\n }\n\n return channels;\n },\n\n isValid: function(name) {\n return Grammar.CHANNEL_NAME.test(name) ||\n Grammar.CHANNEL_PATTERN.test(name);\n },\n\n parse: function(name) {\n if (!this.isValid(name)) return null;\n return name.split('/').slice(1);\n },\n\n unparse: function(segments) {\n return '/' + segments.join('/');\n },\n\n isMeta: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.META) : null;\n },\n\n isService: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.SERVICE) : null;\n },\n\n isSubscribable: function(name) {\n if (!this.isValid(name)) return null;\n return !this.isMeta(name) && !this.isService(name);\n },\n\n Set: Class({\n initialize: function() {\n this._channels = {};\n },\n\n getKeys: function() {\n var keys = [];\n for (var key in this._channels) keys.push(key);\n return keys;\n },\n\n remove: function(name) {\n delete this._channels[name];\n },\n\n hasSubscription: function(name) {\n return this._channels.hasOwnProperty(name);\n },\n\n subscribe: function(names, subscription) {\n var name;\n for (var i = 0, n = names.length; i < n; i++) {\n name = names[i];\n var channel = this._channels[name] = this._channels[name] || new Channel(name);\n channel.bind('message', subscription);\n }\n },\n\n unsubscribe: function(name, subscription) {\n var channel = this._channels[name];\n if (!channel) return false;\n channel.unbind('message', subscription);\n\n if (channel.isUnused()) {\n this.remove(name);\n return true;\n } else {\n return false;\n }\n },\n\n distributeMessage: function(message) {\n var channels = Channel.expand(message.channel);\n\n for (var i = 0, n = channels.length; i < n; i++) {\n var channel = this._channels[channels[i]];\n if (channel) channel.trigger('message', message);\n }\n }\n })\n});\n\nmodule.exports = Channel;\n","'use strict';\n\nmodule.exports = {\n CHANNEL_NAME: /^\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*$/,\n CHANNEL_PATTERN: /^(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*\\/\\*{1,2}$/,\n ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*(,(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)$/,\n VERSION: /^([0-9])+(\\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\\-|\\_))*)*$/\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n cookies = require('../util/cookies'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Transport = require('../transport'),\n Scheduler = require('./scheduler');\n\nvar Dispatcher = Class({ className: 'Dispatcher',\n MAX_REQUEST_SIZE: 2048,\n DEFAULT_RETRY: 5,\n\n UP: 1,\n DOWN: 2,\n\n initialize: function(client, endpoint, options) {\n this._client = client;\n this.endpoint = URI.parse(endpoint);\n this._alternates = options.endpoints || {};\n\n this.cookies = cookies.CookieJar && new cookies.CookieJar();\n this._disabled = [];\n this._envelopes = {};\n this.headers = {};\n this.retry = options.retry || this.DEFAULT_RETRY;\n this._scheduler = options.scheduler || Scheduler;\n this._state = 0;\n this.transports = {};\n this.wsExtensions = [];\n\n this.proxy = options.proxy || {};\n if (typeof this._proxy === 'string') this._proxy = { origin: this._proxy };\n\n var exts = options.websocketExtensions;\n if (exts) {\n exts = [].concat(exts);\n for (var i = 0, n = exts.length; i < n; i++)\n this.addWebsocketExtension(exts[i]);\n }\n\n this.tls = options.tls || {};\n this.tls.ca = this.tls.ca || options.ca;\n\n for (var type in this._alternates)\n this._alternates[type] = URI.parse(this._alternates[type]);\n\n this.maxRequestSize = this.MAX_REQUEST_SIZE;\n },\n\n endpointFor: function(connectionType) {\n return this._alternates[connectionType] || this.endpoint;\n },\n\n addWebsocketExtension: function(extension) {\n this.wsExtensions.push(extension);\n },\n\n disable: function(feature) {\n this._disabled.push(feature);\n Transport.disable(feature);\n },\n\n setHeader: function(name, value) {\n this.headers[name] = value;\n },\n\n close: function() {\n var transport = this._transport;\n delete this._transport;\n if (transport) transport.close();\n },\n\n getConnectionTypes: function() {\n return Transport.getConnectionTypes();\n },\n\n selectTransport: function(transportTypes) {\n Transport.get(this, transportTypes, this._disabled, function(transport) {\n this.debug('Selected ? transport for ?', transport.connectionType, transport.endpoint.href);\n\n if (transport === this._transport) return;\n if (this._transport) this._transport.close();\n\n this._transport = transport;\n this.connectionType = transport.connectionType;\n }, this);\n },\n\n sendMessage: function(message, timeout, options) {\n options = options || {};\n\n var id = message.id,\n attempts = options.attempts,\n deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),\n envelope = this._envelopes[id],\n scheduler;\n\n if (!envelope) {\n scheduler = new this._scheduler(message, { timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline });\n envelope = this._envelopes[id] = { message: message, scheduler: scheduler };\n }\n\n this._sendEnvelope(envelope);\n },\n\n _sendEnvelope: function(envelope) {\n if (!this._transport) return;\n if (envelope.request || envelope.timer) return;\n\n var message = envelope.message,\n scheduler = envelope.scheduler,\n self = this;\n\n if (!scheduler.isDeliverable()) {\n scheduler.abort();\n delete this._envelopes[message.id];\n return;\n }\n\n envelope.timer = global.setTimeout(function() {\n self.handleError(message);\n }, scheduler.getTimeout() * 1000);\n\n scheduler.send();\n envelope.request = this._transport.sendMessage(message);\n },\n\n handleResponse: function(reply) {\n var envelope = this._envelopes[reply.id];\n\n if (reply.successful !== undefined && envelope) {\n envelope.scheduler.succeed();\n delete this._envelopes[reply.id];\n global.clearTimeout(envelope.timer);\n }\n\n this.trigger('message', reply);\n\n if (this._state === this.UP) return;\n this._state = this.UP;\n this._client.trigger('transport:up');\n },\n\n handleError: function(message, immediate) {\n var envelope = this._envelopes[message.id],\n request = envelope && envelope.request,\n self = this;\n\n if (!request) return;\n\n request.then(function(req) {\n if (req && req.abort) req.abort();\n });\n\n var scheduler = envelope.scheduler;\n scheduler.fail();\n\n global.clearTimeout(envelope.timer);\n envelope.request = envelope.timer = null;\n\n if (immediate) {\n this._sendEnvelope(envelope);\n } else {\n envelope.timer = global.setTimeout(function() {\n envelope.timer = null;\n self._sendEnvelope(envelope);\n }, scheduler.getInterval() * 1000);\n }\n\n if (this._state === this.DOWN) return;\n this._state = this.DOWN;\n this._client.trigger('transport:down');\n }\n});\n\nDispatcher.create = function(client, endpoint, options) {\n return new Dispatcher(client, endpoint, options);\n};\n\nassign(Dispatcher.prototype, Publisher);\nassign(Dispatcher.prototype, Logging);\n\nmodule.exports = Dispatcher;\n","'use strict';\n\nmodule.exports = {};\n","'use strict';\n\nvar Transport = require('./transport');\n\nTransport.register('websocket', require('./web_socket'));\nTransport.register('eventsource', require('./event_source'));\nTransport.register('long-polling', require('./xhr'));\nTransport.register('cross-origin-long-polling', require('./cors'));\nTransport.register('callback-polling', require('./jsonp'));\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('./class');\n\nmodule.exports = Class({\n initialize: function() {\n this._index = {};\n },\n\n add: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n if (this._index.hasOwnProperty(key)) return false;\n this._index[key] = item;\n return true;\n },\n\n forEach: function(block, context) {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key))\n block.call(context, this._index[key]);\n }\n },\n\n isEmpty: function() {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key)) return false;\n }\n return true;\n },\n\n member: function(item) {\n for (var key in this._index) {\n if (this._index[key] === item) return true;\n }\n return false;\n },\n\n remove: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n var removed = this._index[key];\n delete this._index[key];\n return removed;\n },\n\n toArray: function() {\n var array = [];\n this.forEach(function(item) { array.push(item) });\n return array;\n }\n});\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar XHR = assign(Class(Transport, {\n encode: function(messages) {\n return toJSON(messages);\n },\n\n request: function(messages) {\n var href = this.endpoint.href,\n self = this,\n xhr;\n\n // Prefer XMLHttpRequest over ActiveXObject if they both exist\n if (global.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (global.ActiveXObject) {\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\n } else {\n return this._handleError(messages);\n }\n\n xhr.open('POST', href, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n var headers = this._dispatcher.headers;\n for (var key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n\n var abort = function() { xhr.abort() };\n if (global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {\n if (!xhr || xhr.readyState !== 4) return;\n\n var replies = null,\n status = xhr.status,\n text = xhr.responseText,\n successful = (status >= 200 && status < 300) || status === 304 || status === 1223;\n\n if (global.onbeforeunload !== undefined)\n browser.Event.detach(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {};\n xhr = null;\n\n if (!successful) return self._handleError(messages);\n\n try {\n replies = JSON.parse(text);\n } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var usable = (navigator.product === 'ReactNative')\n || URI.isSameOrigin(endpoint);\n\n callback.call(context, usable);\n }\n});\n\nmodule.exports = XHR;\n","'use strict';\n\nvar assign = require('../util/assign');\n\nvar Scheduler = function(message, options) {\n this.message = message;\n this.options = options;\n this.attempts = 0;\n};\n\nassign(Scheduler.prototype, {\n getTimeout: function() {\n return this.options.timeout;\n },\n\n getInterval: function() {\n return this.options.interval;\n },\n\n isDeliverable: function() {\n var attempts = this.options.attempts,\n made = this.attempts,\n deadline = this.options.deadline,\n now = new Date().getTime();\n\n if (attempts !== undefined && made >= attempts)\n return false;\n\n if (deadline !== undefined && now > deadline)\n return false;\n\n return true;\n },\n\n send: function() {\n this.attempts += 1;\n },\n\n succeed: function() {},\n\n fail: function() {},\n\n abort: function() {}\n});\n\nmodule.exports = Scheduler;\n","module.exports = {\n VERSION: '1.4.0',\n\n BAYEUX_VERSION: '1.0',\n ID_LENGTH: 160,\n JSONP_CALLBACK: 'jsonpcallback',\n CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],\n\n MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable');\n\nvar Subscription = Class({\n initialize: function(client, channels, callback, context) {\n this._client = client;\n this._channels = channels;\n this._callback = callback;\n this._context = context;\n this._cancelled = false;\n },\n\n withChannel: function(callback, context) {\n this._withChannel = [callback, context];\n return this;\n },\n\n apply: function(context, args) {\n var message = args[0];\n\n if (this._callback)\n this._callback.call(this._context, message.data);\n\n if (this._withChannel)\n this._withChannel[0].call(this._withChannel[1], message.channel, message.data);\n },\n\n cancel: function() {\n if (this._cancelled) return;\n this._client.unsubscribe(this._channels, this);\n this._cancelled = true;\n },\n\n unsubscribe: function() {\n this.cancel();\n }\n});\n\nassign(Subscription.prototype, Deferrable);\n\nmodule.exports = Subscription;\n","'use strict';\n\nvar asap = require('asap'),\n Class = require('../util/class'),\n Promise = require('../util/promise'),\n array = require('../util/array'),\n browser = require('../util/browser'),\n constants = require('../util/constants'),\n assign = require('../util/assign'),\n validateOptions = require('../util/validate_options'),\n Deferrable = require('../mixins/deferrable'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Channel = require('./channel'),\n Dispatcher = require('./dispatcher'),\n Error = require('./error'),\n Extensible = require('./extensible'),\n Publication = require('./publication'),\n Subscription = require('./subscription');\n\nvar Client = Class({ className: 'Client',\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n DISCONNECTED: 4,\n\n HANDSHAKE: 'handshake',\n RETRY: 'retry',\n NONE: 'none',\n\n CONNECTION_TIMEOUT: 60,\n\n DEFAULT_ENDPOINT: '/bayeux',\n INTERVAL: 0,\n\n initialize: function(endpoint, options) {\n this.info('New client created for ?', endpoint);\n options = options || {};\n\n validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);\n\n this._channels = new Channel.Set();\n this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);\n\n this._messageId = 0;\n this._state = this.UNCONNECTED;\n\n this._responseCallbacks = {};\n\n this._advice = {\n reconnect: this.RETRY,\n interval: 1000 * (options.interval || this.INTERVAL),\n timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)\n };\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n this._dispatcher.bind('message', this._receiveMessage, this);\n\n if (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() {\n if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)\n this.disconnect();\n }, this);\n },\n\n addWebsocketExtension: function(extension) {\n return this._dispatcher.addWebsocketExtension(extension);\n },\n\n disable: function(feature) {\n return this._dispatcher.disable(feature);\n },\n\n setHeader: function(name, value) {\n return this._dispatcher.setHeader(name, value);\n },\n\n // Request\n // MUST include: * channel\n // * version\n // * supportedConnectionTypes\n // MAY include: * minimumVersion\n // * ext\n // * id\n //\n // Success Response Failed Response\n // MUST include: * channel MUST include: * channel\n // * version * successful\n // * supportedConnectionTypes * error\n // * clientId MAY include: * supportedConnectionTypes\n // * successful * advice\n // MAY include: * minimumVersion * version\n // * advice * minimumVersion\n // * ext * ext\n // * id * id\n // * authSuccessful\n handshake: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state !== this.UNCONNECTED) return;\n\n this._state = this.CONNECTING;\n var self = this;\n\n this.info('Initiating handshake with ?', this._dispatcher.endpoint.href);\n this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);\n\n this._sendMessage({\n channel: Channel.HANDSHAKE,\n version: constants.BAYEUX_VERSION,\n supportedConnectionTypes: this._dispatcher.getConnectionTypes()\n\n }, {}, function(response) {\n\n if (response.successful) {\n this._state = this.CONNECTED;\n this._dispatcher.clientId = response.clientId;\n\n this._dispatcher.selectTransport(response.supportedConnectionTypes);\n\n this.info('Handshake successful: ?', this._dispatcher.clientId);\n\n this.subscribe(this._channels.getKeys(), true);\n if (callback) asap(function() { callback.call(context) });\n\n } else {\n this.info('Handshake unsuccessful');\n global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);\n this._state = this.UNCONNECTED;\n }\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * connectionType * clientId\n // MAY include: * ext MAY include: * error\n // * id * advice\n // * ext\n // * id\n // * timestamp\n connect: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state === this.DISCONNECTED) return;\n\n if (this._state === this.UNCONNECTED)\n return this.handshake(function() { this.connect(callback, context) }, this);\n\n this.callback(callback, context);\n if (this._state !== this.CONNECTED) return;\n\n this.info('Calling deferred actions for ?', this._dispatcher.clientId);\n this.setDeferredStatus('succeeded');\n this.setDeferredStatus('unknown');\n\n if (this._connectRequest) return;\n this._connectRequest = true;\n\n this.info('Initiating connection for ?', this._dispatcher.clientId);\n\n this._sendMessage({\n channel: Channel.CONNECT,\n clientId: this._dispatcher.clientId,\n connectionType: this._dispatcher.connectionType\n\n }, {}, this._cycleConnection, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // MAY include: * ext * clientId\n // * id MAY include: * error\n // * ext\n // * id\n disconnect: function() {\n if (this._state !== this.CONNECTED) return;\n this._state = this.DISCONNECTED;\n\n this.info('Disconnecting ?', this._dispatcher.clientId);\n var promise = new Publication();\n\n this._sendMessage({\n channel: Channel.DISCONNECT,\n clientId: this._dispatcher.clientId\n\n }, {}, function(response) {\n if (response.successful) {\n this._dispatcher.close();\n promise.setDeferredStatus('succeeded');\n } else {\n promise.setDeferredStatus('failed', Error.parse(response.error));\n }\n }, this);\n\n this.info('Clearing channel listeners for ?', this._dispatcher.clientId);\n this._channels = new Channel.Set();\n\n return promise;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n subscribe: function(channel, callback, context) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.subscribe(c, callback, context);\n }, this);\n\n var subscription = new Subscription(this, channel, callback, context),\n force = (callback === true),\n hasSubscribe = this._channels.hasSubscription(channel);\n\n if (hasSubscribe && !force) {\n this._channels.subscribe([channel], subscription);\n subscription.setDeferredStatus('succeeded');\n return subscription;\n }\n\n this.connect(function() {\n this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);\n if (!force) this._channels.subscribe([channel], subscription);\n\n this._sendMessage({\n channel: Channel.SUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) {\n subscription.setDeferredStatus('failed', Error.parse(response.error));\n return this._channels.unsubscribe(channel, subscription);\n }\n\n var channels = [].concat(response.subscription);\n this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);\n subscription.setDeferredStatus('succeeded');\n }, this);\n }, this);\n\n return subscription;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n unsubscribe: function(channel, subscription) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.unsubscribe(c, subscription);\n }, this);\n\n var dead = this._channels.unsubscribe(channel, subscription);\n if (!dead) return;\n\n this.connect(function() {\n this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);\n\n this._sendMessage({\n channel: Channel.UNSUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) return;\n\n var channels = [].concat(response.subscription);\n this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);\n }, this);\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * data * successful\n // MAY include: * clientId MAY include: * id\n // * id * error\n // * ext * ext\n publish: function(channel, data, options) {\n validateOptions(options || {}, ['attempts', 'deadline']);\n var publication = new Publication();\n\n this.connect(function() {\n this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);\n\n this._sendMessage({\n channel: channel,\n data: data,\n clientId: this._dispatcher.clientId\n\n }, options, function(response) {\n if (response.successful)\n publication.setDeferredStatus('succeeded');\n else\n publication.setDeferredStatus('failed', Error.parse(response.error));\n }, this);\n }, this);\n\n return publication;\n },\n\n _sendMessage: function(message, options, callback, context) {\n message.id = this._generateMessageId();\n\n var timeout = this._advice.timeout\n ? 1.2 * this._advice.timeout / 1000\n : 1.2 * this._dispatcher.retry;\n\n this.pipeThroughExtensions('outgoing', message, null, function(message) {\n if (!message) return;\n if (callback) this._responseCallbacks[message.id] = [callback, context];\n this._dispatcher.sendMessage(message, timeout, options || {});\n }, this);\n },\n\n _generateMessageId: function() {\n this._messageId += 1;\n if (this._messageId >= Math.pow(2,32)) this._messageId = 0;\n return this._messageId.toString(36);\n },\n\n _receiveMessage: function(message) {\n var id = message.id, callback;\n\n if (message.successful !== undefined) {\n callback = this._responseCallbacks[id];\n delete this._responseCallbacks[id];\n }\n\n this.pipeThroughExtensions('incoming', message, null, function(message) {\n if (!message) return;\n if (message.advice) this._handleAdvice(message.advice);\n this._deliverMessage(message);\n if (callback) callback[0].call(callback[1], message);\n }, this);\n },\n\n _handleAdvice: function(advice) {\n assign(this._advice, advice);\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {\n this._state = this.UNCONNECTED;\n this._dispatcher.clientId = null;\n this._cycleConnection();\n }\n },\n\n _deliverMessage: function(message) {\n if (!message.channel || message.data === undefined) return;\n this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);\n this._channels.distributeMessage(message);\n },\n\n _cycleConnection: function() {\n if (this._connectRequest) {\n this._connectRequest = null;\n this.info('Closed connection for ?', this._dispatcher.clientId);\n }\n var self = this;\n global.setTimeout(function() { self.connect() }, this._advice.interval);\n }\n});\n\nassign(Client.prototype, Deferrable);\nassign(Client.prototype, Publisher);\nassign(Client.prototype, Logging);\nassign(Client.prototype, Extensible);\n\nmodule.exports = Client;\n","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== \"undefined\" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","'use strict';\n\nvar array = require('./array');\n\nmodule.exports = function(options, validKeys) {\n for (var key in options) {\n if (array.indexOf(validKeys, key) < 0)\n throw new Error('Unrecognized option: ' + key);\n }\n};\n","/*\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\nfunction indexOf (xs, x) {\n if (xs.indexOf) return xs.indexOf(x);\n for (var i = 0; i < xs.length; i++) {\n if (x === xs[i]) return i;\n }\n return -1;\n}\n\nfunction EventEmitter() {}\nmodule.exports = EventEmitter;\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = indexOf(list, listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n if (arguments.length === 0) {\n this._events = {};\n return this;\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n","'use strict';\n\nmodule.exports = {\n addTimeout: function(name, delay, callback, context) {\n this._timeouts = this._timeouts || {};\n if (this._timeouts.hasOwnProperty(name)) return;\n var self = this;\n this._timeouts[name] = global.setTimeout(function() {\n delete self._timeouts[name];\n callback.call(context);\n }, 1000 * delay);\n },\n\n removeTimeout: function(name) {\n this._timeouts = this._timeouts || {};\n var timeout = this._timeouts[name];\n if (!timeout) return;\n global.clearTimeout(timeout);\n delete this._timeouts[name];\n },\n\n removeAllTimeouts: function() {\n this._timeouts = this._timeouts || {};\n for (var name in this._timeouts) this.removeTimeout(name);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Promise = require('../util/promise'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n ws = require('../util/websocket'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport');\n\nvar WebSocket = assign(Class(Transport, {\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n\n batching: false,\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n this.connect();\n },\n\n request: function(messages) {\n this._pending = this._pending || new Set();\n for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);\n\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.callback(function(socket) {\n if (!socket || socket.readyState !== 1) return;\n socket.send(toJSON(messages));\n resolve(socket);\n });\n\n self.connect();\n });\n\n return {\n abort: function() { promise.then(function(ws) { ws.close() }) }\n };\n },\n\n connect: function() {\n if (WebSocket._unloaded) return;\n\n this._state = this._state || this.UNCONNECTED;\n if (this._state !== this.UNCONNECTED) return;\n this._state = this.CONNECTING;\n\n var socket = this._createSocket();\n if (!socket) return this.setDeferredStatus('failed');\n\n var self = this;\n\n socket.onopen = function() {\n if (socket.headers) self._storeCookies(socket.headers['set-cookie']);\n self._socket = socket;\n self._state = self.CONNECTED;\n self._everConnected = true;\n self.setDeferredStatus('succeeded', socket);\n };\n\n var closed = false;\n socket.onclose = socket.onerror = function() {\n if (closed) return;\n closed = true;\n\n var wasConnected = (self._state === self.CONNECTED);\n socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;\n\n delete self._socket;\n self._state = self.UNCONNECTED;\n\n var pending = self._pending ? self._pending.toArray() : [];\n delete self._pending;\n\n if (wasConnected || self._everConnected) {\n self.setDeferredStatus('unknown');\n self._handleError(pending, wasConnected);\n } else {\n self.setDeferredStatus('failed');\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (!replies) return;\n\n replies = [].concat(replies);\n\n for (var i = 0, n = replies.length; i < n; i++) {\n if (replies[i].successful === undefined) continue;\n self._pending.remove(replies[i]);\n }\n self._receive(replies);\n };\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.close();\n },\n\n _createSocket: function() {\n var url = WebSocket.getSocketUrl(this.endpoint),\n headers = this._dispatcher.headers,\n extensions = this._dispatcher.wsExtensions,\n cookie = this._getCookies(),\n tls = this._dispatcher.tls,\n options = { extensions: extensions, headers: headers, proxy: this._proxy, tls: tls };\n\n if (cookie !== '') options.headers['Cookie'] = cookie;\n\n try {\n return ws.create(url, [], options);\n } catch (e) {\n // catch CSP error to allow transport to fallback to next connType\n }\n }\n\n}), {\n PROTOCOLS: {\n 'http:': 'ws:',\n 'https:': 'wss:'\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};\n sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);\n return sockets[endpoint.href];\n },\n\n getSocketUrl: function(endpoint) {\n endpoint = copyObject(endpoint);\n endpoint.protocol = this.PROTOCOLS[endpoint.protocol];\n return URI.stringify(endpoint);\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }\n});\n\nassign(WebSocket.prototype, Deferrable);\n\nif (browser.Event && global.onbeforeunload !== undefined) {\n browser.Event.on(global, 'beforeunload', function() {\n if (WebSocket._unloaded === undefined)\n WebSocket._unloaded = true;\n });\n}\n\nmodule.exports = WebSocket;\n","'use strict';\n\nvar WS = global.MozWebSocket || global.WebSocket;\n\nmodule.exports = {\n create: function(url, protocols, options) {\n if (typeof WS !== 'function') return null;\n return new WS(url);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport'),\n XHR = require('./xhr');\n\nvar EventSource = assign(Class(Transport, {\n initialize: function(dispatcher, endpoint) {\n Transport.prototype.initialize.call(this, dispatcher, endpoint);\n if (!global.EventSource) return this.setDeferredStatus('failed');\n\n this._xhr = new XHR(dispatcher, endpoint);\n\n endpoint = copyObject(endpoint);\n endpoint.pathname += '/' + dispatcher.clientId;\n\n var socket = new global.EventSource(URI.stringify(endpoint)),\n self = this;\n\n socket.onopen = function() {\n self._everConnected = true;\n self.setDeferredStatus('succeeded');\n };\n\n socket.onerror = function() {\n if (self._everConnected) {\n self._handleError([]);\n } else {\n self.setDeferredStatus('failed');\n socket.close();\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError([]);\n };\n\n this._socket = socket;\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;\n this._socket.close();\n delete this._socket;\n },\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n },\n\n encode: function(messages) {\n return this._xhr.encode(messages);\n },\n\n request: function(messages) {\n return this._xhr.request(messages);\n }\n\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var id = dispatcher.clientId;\n if (!id) return callback.call(context, false);\n\n XHR.isUsable(dispatcher, endpoint, function(usable) {\n if (!usable) return callback.call(context, false);\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }, this);\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},\n id = dispatcher.clientId;\n\n var url = copyObject(endpoint);\n url.pathname += '/' + (id || '');\n url = URI.stringify(url);\n\n sockets[url] = sockets[url] || new this(dispatcher, endpoint);\n return sockets[url];\n }\n});\n\nassign(EventSource.prototype, Deferrable);\n\nmodule.exports = EventSource;\n","'use strict';\n\nvar Class = require('../util/class'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar CORS = assign(Class(Transport, {\n encode: function(messages) {\n return 'message=' + encodeURIComponent(toJSON(messages));\n },\n\n request: function(messages) {\n var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,\n xhr = new xhrClass(),\n id = ++CORS._id,\n headers = this._dispatcher.headers,\n self = this,\n key;\n\n xhr.open('POST', this.endpoint.href, true);\n xhr.withCredentials = true;\n\n if (xhr.setRequestHeader) {\n xhr.setRequestHeader('Pragma', 'no-cache');\n for (key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n\n var cleanUp = function() {\n if (!xhr) return false;\n CORS._pending.remove(id);\n xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;\n xhr = null;\n };\n\n xhr.onload = function() {\n var replies;\n try { replies = JSON.parse(xhr.responseText) } catch (error) {}\n\n cleanUp();\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.onerror = xhr.ontimeout = function() {\n cleanUp();\n self._handleError(messages);\n };\n\n xhr.onprogress = function() {};\n\n if (xhrClass === global.XDomainRequest)\n CORS._pending.add({ id: id, xhr: xhr });\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n _id: 0,\n _pending: new Set(),\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n if (URI.isSameOrigin(endpoint))\n return callback.call(context, false);\n\n if (global.XDomainRequest)\n return callback.call(context, endpoint.protocol === location.protocol);\n\n if (global.XMLHttpRequest) {\n var xhr = new XMLHttpRequest();\n return callback.call(context, xhr.withCredentials !== undefined);\n }\n return callback.call(context, false);\n }\n});\n\nmodule.exports = CORS;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar JSONP = assign(Class(Transport, {\n encode: function(messages) {\n var url = copyObject(this.endpoint);\n url.query.message = toJSON(messages);\n url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';\n return URI.stringify(url);\n },\n\n request: function(messages) {\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callbackName = JSONP.getCallbackName(),\n endpoint = copyObject(this.endpoint),\n self = this;\n\n endpoint.query.message = toJSON(messages);\n endpoint.query.jsonp = callbackName;\n\n var cleanup = function() {\n if (!global[callbackName]) return false;\n global[callbackName] = undefined;\n try { delete global[callbackName] } catch (error) {}\n script.parentNode.removeChild(script);\n };\n\n global[callbackName] = function(replies) {\n cleanup();\n self._receive(replies);\n };\n\n script.type = 'text/javascript';\n script.src = URI.stringify(endpoint);\n head.appendChild(script);\n\n script.onerror = function() {\n cleanup();\n self._handleError(messages);\n };\n\n return { abort: cleanup };\n }\n}), {\n _cbCount: 0,\n\n getCallbackName: function() {\n this._cbCount += 1;\n return '__jsonp' + this._cbCount + '__';\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n callback.call(context, true);\n }\n});\n\nmodule.exports = JSONP;\n","'use strict';\n\nvar Class = require('../util/class'),\n Grammar = require('./grammar');\n\nvar Error = Class({\n initialize: function(code, params, message) {\n this.code = code;\n this.params = Array.prototype.slice.call(params);\n this.message = message;\n },\n\n toString: function() {\n return this.code + ':' +\n this.params.join(',') + ':' +\n this.message;\n }\n});\n\nError.parse = function(message) {\n message = message || '';\n if (!Grammar.ERROR.test(message)) return new Error(null, [], message);\n\n var parts = message.split(':'),\n code = parseInt(parts[0]),\n params = parts[1].split(','),\n message = parts[2];\n\n return new Error(code, params, message);\n};\n\n// http://code.google.com/p/cometd/wiki/BayeuxCodes\nvar errors = {\n versionMismatch: [300, 'Version mismatch'],\n conntypeMismatch: [301, 'Connection types not supported'],\n extMismatch: [302, 'Extension mismatch'],\n badRequest: [400, 'Bad request'],\n clientUnknown: [401, 'Unknown client'],\n parameterMissing: [402, 'Missing required parameter'],\n channelForbidden: [403, 'Forbidden channel'],\n channelUnknown: [404, 'Unknown channel'],\n channelInvalid: [405, 'Invalid channel'],\n extUnknown: [406, 'Unknown extension'],\n publishFailed: [407, 'Failed to publish'],\n serverError: [500, 'Internal server error']\n};\n\nfor (var name in errors)\n (function(name) {\n Error[name] = function() {\n return new Error(errors[name][0], arguments, errors[name][1]).toString();\n };\n })(name);\n\nmodule.exports = Error;\n","'use strict';\n\nvar assign = require('../util/assign'),\n Logging = require('../mixins/logging');\n\nvar Extensible = {\n addExtension: function(extension) {\n this._extensions = this._extensions || [];\n this._extensions.push(extension);\n if (extension.added) extension.added(this);\n },\n\n removeExtension: function(extension) {\n if (!this._extensions) return;\n var i = this._extensions.length;\n while (i--) {\n if (this._extensions[i] !== extension) continue;\n this._extensions.splice(i,1);\n if (extension.removed) extension.removed(this);\n }\n },\n\n pipeThroughExtensions: function(stage, message, request, callback, context) {\n this.debug('Passing through ? extensions: ?', stage, message);\n\n if (!this._extensions) return callback.call(context, message);\n var extensions = this._extensions.slice();\n\n var pipe = function(message) {\n if (!message) return callback.call(context, message);\n\n var extension = extensions.shift();\n if (!extension) return callback.call(context, message);\n\n var fn = extension[stage];\n if (!fn) return pipe(message);\n\n if (fn.length >= 3) extension[stage](message, request, pipe);\n else extension[stage](message, pipe);\n };\n pipe(message);\n }\n};\n\nassign(Extensible, Logging);\n\nmodule.exports = Extensible;\n","'use strict';\n\nvar Class = require('../util/class'),\n Deferrable = require('../mixins/deferrable');\n\nmodule.exports = Class(Deferrable);\n","'use strict';\n\nvar constants = require('./util/constants'),\n Logging = require('./mixins/logging');\n\nvar Faye = {\n VERSION: constants.VERSION,\n\n Client: require('./protocol/client'),\n Scheduler: require('./protocol/scheduler')\n};\n\nLogging.wrapper = Faye;\n\nmodule.exports = Faye;\n"],"sourceRoot":""}
@@ -2712,7 +2712,7 @@ module.exports = function(parent, methods) {
2712
2712
  /***/ (function(module, exports) {
2713
2713
 
2714
2714
  module.exports = {
2715
- VERSION: '1.3.0',
2715
+ VERSION: '1.4.0',
2716
2716
 
2717
2717
  BAYEUX_VERSION: '1.0',
2718
2718
  ID_LENGTH: 160,
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://Faye/webpack/bootstrap","webpack://Faye/./node_modules/asap/browser-asap.js","webpack://Faye/./node_modules/asap/browser-raw.js","webpack://Faye/(webpack)/buildin/global.js","webpack://Faye/./src/faye_browser.js","webpack://Faye/./src/mixins/deferrable.js","webpack://Faye/./src/mixins/logging.js","webpack://Faye/./src/mixins/publisher.js","webpack://Faye/./src/mixins/timeouts.js","webpack://Faye/./src/protocol/channel.js","webpack://Faye/./src/protocol/client.js","webpack://Faye/./src/protocol/dispatcher.js","webpack://Faye/./src/protocol/error.js","webpack://Faye/./src/protocol/extensible.js","webpack://Faye/./src/protocol/grammar.js","webpack://Faye/./src/protocol/publication.js","webpack://Faye/./src/protocol/scheduler.js","webpack://Faye/./src/protocol/subscription.js","webpack://Faye/./src/transport/browser_transports.js","webpack://Faye/./src/transport/cors.js","webpack://Faye/./src/transport/event_source.js","webpack://Faye/./src/transport/jsonp.js","webpack://Faye/./src/transport/transport.js","webpack://Faye/./src/transport/web_socket.js","webpack://Faye/./src/transport/xhr.js","webpack://Faye/./src/util/array.js","webpack://Faye/./src/util/assign.js","webpack://Faye/./src/util/browser/event.js","webpack://Faye/./src/util/class.js","webpack://Faye/./src/util/constants.js","webpack://Faye/./src/util/cookies/browser_cookies.js","webpack://Faye/./src/util/copy_object.js","webpack://Faye/./src/util/event_emitter.js","webpack://Faye/./src/util/promise.js","webpack://Faye/./src/util/set.js","webpack://Faye/./src/util/to_json.js","webpack://Faye/./src/util/uri.js","webpack://Faye/./src/util/validate_options.js","webpack://Faye/./src/util/websocket/browser_websocket.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA,cAAc,mBAAO,CAAC,iDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;;;;;;;;;;;ACjEA,8CAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9NA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;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B,mBAAO,CAAC,kDAAmB;AACjD,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD,sBAAsB,mBAAO,CAAC,4CAAW;AACzC,sBAAsB,mBAAO,CAAC,kDAAc;AAC5C,sBAAsB,mBAAO,CAAC,wCAAS;AACvC,sBAAsB,mBAAO,CAAC,kDAAc;AAC5C,sBAAsB,mBAAO,CAAC,oDAAe;AAC7C,sBAAsB,mBAAO,CAAC,sDAAgB;;AAE9C,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK,IAAI;;AAET;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAuC,yBAAyB;;AAEhE,OAAO;AACP;AACA,sCAAsC,oCAAoC;AAC1E;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC,kCAAkC;;AAE1E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK,IAAI;AACT,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,KAAK,IAAI;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,IAAI;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,IAAI;AACX;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kEAAkE;AAClE,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;AChYA,8CAAa;;AAEb,gBAAgB,mBAAO,CAAC,0CAAe;AACvC,gBAAgB,mBAAO,CAAC,sCAAa;AACrC,gBAAgB,mBAAO,CAAC,8DAAiB;AACzC,gBAAgB,mBAAO,CAAC,4CAAgB;AACxC,gBAAgB,mBAAO,CAAC,kDAAmB;AAC3C,gBAAgB,mBAAO,CAAC,sDAAqB;AAC7C,gBAAgB,mBAAO,CAAC,2DAAc;AACtC,gBAAgB,mBAAO,CAAC,gDAAa;;AAErC,wBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,iFAAiF;AACjI,yCAAyC;AACzC;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;;ACzLa;;AAEb,cAAc,mBAAO,CAAC,0CAAe;AACrC,cAAc,mBAAO,CAAC,4CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA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B,mBAAO,CAAC,sCAAa;AACrC,gBAAgB,mBAAO,CAAC,oDAAiB;AACzC,gBAAgB,mBAAO,CAAC,4CAAgB;AACxC,gBAAgB,mBAAO,CAAC,8CAAiB;AACzC,gBAAgB,mBAAO,CAAC,iDAAa;;AAErC;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzEa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACfA,8CAAa;;AAEb;AACA;;AAEA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;ACjDa;;AAEb,aAAa,mBAAO,CAAC,sCAAU;;AAE/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;ACtBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACTa;;AAEb;;;;;;;;;;;;;ACFa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;;AAEA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ka;;AAEb,WAAW,mBAAO,CAAC,iDAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,gDAAgD,iBAAiB;AACjE;;AAEA;AACA,gDAAgD,iBAAiB;AACjE;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,eAAe,OAAO;AACtB,GAAG;AACH;;AAEA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;;;;AC3Ka;;AAEb,YAAY,mBAAO,CAAC,oCAAS;;AAE7B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,iCAAiC,mBAAmB;AACpD;AACA;AACA,CAAC;;;;;;;;;;;;;ACjDY;;AAEb;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACRa;;AAEb;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC,OAAO;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzFa;;AAEb,YAAY,mBAAO,CAAC,oCAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACTA,8CAAa;;AAEb;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"build/client/faye-browser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/faye_browser.js\");\n","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== \"undefined\" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nvar constants = require('./util/constants'),\n Logging = require('./mixins/logging');\n\nvar Faye = {\n VERSION: constants.VERSION,\n\n Client: require('./protocol/client'),\n Scheduler: require('./protocol/scheduler')\n};\n\nLogging.wrapper = Faye;\n\nmodule.exports = Faye;\n","'use strict';\n\nvar Promise = require('../util/promise');\n\nmodule.exports = {\n then: function(callback, errback) {\n var self = this;\n if (!this._promise)\n this._promise = new Promise(function(resolve, reject) {\n self._resolve = resolve;\n self._reject = reject;\n });\n\n if (arguments.length === 0)\n return this._promise;\n else\n return this._promise.then(callback, errback);\n },\n\n callback: function(callback, context) {\n return this.then(function(value) { callback.call(context, value) });\n },\n\n errback: function(callback, context) {\n return this.then(null, function(reason) { callback.call(context, reason) });\n },\n\n timeout: function(seconds, message) {\n this.then();\n var self = this;\n this._timer = global.setTimeout(function() {\n self._reject(message);\n }, seconds * 1000);\n },\n\n setDeferredStatus: function(status, value) {\n if (this._timer) global.clearTimeout(this._timer);\n\n this.then();\n\n if (status === 'succeeded')\n this._resolve(value);\n else if (status === 'failed')\n this._reject(value);\n else\n delete this._promise;\n }\n};\n","'use strict';\n\nvar toJSON = require('../util/to_json');\n\nvar Logging = {\n LOG_LEVELS: {\n fatal: 4,\n error: 3,\n warn: 2,\n info: 1,\n debug: 0\n },\n\n writeLog: function(messageArgs, level) {\n var logger = Logging.logger || (Logging.wrapper || Logging).logger;\n if (!logger) return;\n\n var args = Array.prototype.slice.apply(messageArgs),\n banner = '[Faye',\n klass = this.className,\n\n message = args.shift().replace(/\\?/g, function() {\n try {\n return toJSON(args.shift());\n } catch (error) {\n return '[Object]';\n }\n });\n\n if (klass) banner += '.' + klass;\n banner += '] ';\n\n if (typeof logger[level] === 'function')\n logger[level](banner + message);\n else if (typeof logger === 'function')\n logger(banner + message);\n }\n};\n\nfor (var key in Logging.LOG_LEVELS)\n (function(level) {\n Logging[level] = function() {\n this.writeLog(arguments, level);\n };\n })(key);\n\nmodule.exports = Logging;\n","'use strict';\n\nvar assign = require('../util/assign'),\n EventEmitter = require('../util/event_emitter');\n\nvar Publisher = {\n countListeners: function(eventType) {\n return this.listeners(eventType).length;\n },\n\n bind: function(eventType, listener, context) {\n var slice = Array.prototype.slice,\n handler = function() { listener.apply(context, slice.call(arguments)) };\n\n this._listeners = this._listeners || [];\n this._listeners.push([eventType, listener, context, handler]);\n return this.on(eventType, handler);\n },\n\n unbind: function(eventType, listener, context) {\n this._listeners = this._listeners || [];\n var n = this._listeners.length, tuple;\n\n while (n--) {\n tuple = this._listeners[n];\n if (tuple[0] !== eventType) continue;\n if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;\n this._listeners.splice(n, 1);\n this.removeListener(eventType, tuple[3]);\n }\n }\n};\n\nassign(Publisher, EventEmitter.prototype);\nPublisher.trigger = Publisher.emit;\n\nmodule.exports = Publisher;\n","'use strict';\n\nmodule.exports = {\n addTimeout: function(name, delay, callback, context) {\n this._timeouts = this._timeouts || {};\n if (this._timeouts.hasOwnProperty(name)) return;\n var self = this;\n this._timeouts[name] = global.setTimeout(function() {\n delete self._timeouts[name];\n callback.call(context);\n }, 1000 * delay);\n },\n\n removeTimeout: function(name) {\n this._timeouts = this._timeouts || {};\n var timeout = this._timeouts[name];\n if (!timeout) return;\n global.clearTimeout(timeout);\n delete this._timeouts[name];\n },\n\n removeAllTimeouts: function() {\n this._timeouts = this._timeouts || {};\n for (var name in this._timeouts) this.removeTimeout(name);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Publisher = require('../mixins/publisher'),\n Grammar = require('./grammar');\n\nvar Channel = Class({\n initialize: function(name) {\n this.id = this.name = name;\n },\n\n push: function(message) {\n this.trigger('message', message);\n },\n\n isUnused: function() {\n return this.countListeners('message') === 0;\n }\n});\n\nassign(Channel.prototype, Publisher);\n\nassign(Channel, {\n HANDSHAKE: '/meta/handshake',\n CONNECT: '/meta/connect',\n SUBSCRIBE: '/meta/subscribe',\n UNSUBSCRIBE: '/meta/unsubscribe',\n DISCONNECT: '/meta/disconnect',\n\n META: 'meta',\n SERVICE: 'service',\n\n expand: function(name) {\n var segments = this.parse(name),\n channels = ['/**', name];\n\n var copy = segments.slice();\n copy[copy.length - 1] = '*';\n channels.push(this.unparse(copy));\n\n for (var i = 1, n = segments.length; i < n; i++) {\n copy = segments.slice(0, i);\n copy.push('**');\n channels.push(this.unparse(copy));\n }\n\n return channels;\n },\n\n isValid: function(name) {\n return Grammar.CHANNEL_NAME.test(name) ||\n Grammar.CHANNEL_PATTERN.test(name);\n },\n\n parse: function(name) {\n if (!this.isValid(name)) return null;\n return name.split('/').slice(1);\n },\n\n unparse: function(segments) {\n return '/' + segments.join('/');\n },\n\n isMeta: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.META) : null;\n },\n\n isService: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.SERVICE) : null;\n },\n\n isSubscribable: function(name) {\n if (!this.isValid(name)) return null;\n return !this.isMeta(name) && !this.isService(name);\n },\n\n Set: Class({\n initialize: function() {\n this._channels = {};\n },\n\n getKeys: function() {\n var keys = [];\n for (var key in this._channels) keys.push(key);\n return keys;\n },\n\n remove: function(name) {\n delete this._channels[name];\n },\n\n hasSubscription: function(name) {\n return this._channels.hasOwnProperty(name);\n },\n\n subscribe: function(names, subscription) {\n var name;\n for (var i = 0, n = names.length; i < n; i++) {\n name = names[i];\n var channel = this._channels[name] = this._channels[name] || new Channel(name);\n channel.bind('message', subscription);\n }\n },\n\n unsubscribe: function(name, subscription) {\n var channel = this._channels[name];\n if (!channel) return false;\n channel.unbind('message', subscription);\n\n if (channel.isUnused()) {\n this.remove(name);\n return true;\n } else {\n return false;\n }\n },\n\n distributeMessage: function(message) {\n var channels = Channel.expand(message.channel);\n\n for (var i = 0, n = channels.length; i < n; i++) {\n var channel = this._channels[channels[i]];\n if (channel) channel.trigger('message', message);\n }\n }\n })\n});\n\nmodule.exports = Channel;\n","'use strict';\n\nvar asap = require('asap'),\n Class = require('../util/class'),\n Promise = require('../util/promise'),\n array = require('../util/array'),\n browser = require('../util/browser'),\n constants = require('../util/constants'),\n assign = require('../util/assign'),\n validateOptions = require('../util/validate_options'),\n Deferrable = require('../mixins/deferrable'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Channel = require('./channel'),\n Dispatcher = require('./dispatcher'),\n Error = require('./error'),\n Extensible = require('./extensible'),\n Publication = require('./publication'),\n Subscription = require('./subscription');\n\nvar Client = Class({ className: 'Client',\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n DISCONNECTED: 4,\n\n HANDSHAKE: 'handshake',\n RETRY: 'retry',\n NONE: 'none',\n\n CONNECTION_TIMEOUT: 60,\n\n DEFAULT_ENDPOINT: '/bayeux',\n INTERVAL: 0,\n\n initialize: function(endpoint, options) {\n this.info('New client created for ?', endpoint);\n options = options || {};\n\n validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);\n\n this._channels = new Channel.Set();\n this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);\n\n this._messageId = 0;\n this._state = this.UNCONNECTED;\n\n this._responseCallbacks = {};\n\n this._advice = {\n reconnect: this.RETRY,\n interval: 1000 * (options.interval || this.INTERVAL),\n timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)\n };\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n this._dispatcher.bind('message', this._receiveMessage, this);\n\n if (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() {\n if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)\n this.disconnect();\n }, this);\n },\n\n addWebsocketExtension: function(extension) {\n return this._dispatcher.addWebsocketExtension(extension);\n },\n\n disable: function(feature) {\n return this._dispatcher.disable(feature);\n },\n\n setHeader: function(name, value) {\n return this._dispatcher.setHeader(name, value);\n },\n\n // Request\n // MUST include: * channel\n // * version\n // * supportedConnectionTypes\n // MAY include: * minimumVersion\n // * ext\n // * id\n //\n // Success Response Failed Response\n // MUST include: * channel MUST include: * channel\n // * version * successful\n // * supportedConnectionTypes * error\n // * clientId MAY include: * supportedConnectionTypes\n // * successful * advice\n // MAY include: * minimumVersion * version\n // * advice * minimumVersion\n // * ext * ext\n // * id * id\n // * authSuccessful\n handshake: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state !== this.UNCONNECTED) return;\n\n this._state = this.CONNECTING;\n var self = this;\n\n this.info('Initiating handshake with ?', this._dispatcher.endpoint.href);\n this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);\n\n this._sendMessage({\n channel: Channel.HANDSHAKE,\n version: constants.BAYEUX_VERSION,\n supportedConnectionTypes: this._dispatcher.getConnectionTypes()\n\n }, {}, function(response) {\n\n if (response.successful) {\n this._state = this.CONNECTED;\n this._dispatcher.clientId = response.clientId;\n\n this._dispatcher.selectTransport(response.supportedConnectionTypes);\n\n this.info('Handshake successful: ?', this._dispatcher.clientId);\n\n this.subscribe(this._channels.getKeys(), true);\n if (callback) asap(function() { callback.call(context) });\n\n } else {\n this.info('Handshake unsuccessful');\n global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);\n this._state = this.UNCONNECTED;\n }\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * connectionType * clientId\n // MAY include: * ext MAY include: * error\n // * id * advice\n // * ext\n // * id\n // * timestamp\n connect: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state === this.DISCONNECTED) return;\n\n if (this._state === this.UNCONNECTED)\n return this.handshake(function() { this.connect(callback, context) }, this);\n\n this.callback(callback, context);\n if (this._state !== this.CONNECTED) return;\n\n this.info('Calling deferred actions for ?', this._dispatcher.clientId);\n this.setDeferredStatus('succeeded');\n this.setDeferredStatus('unknown');\n\n if (this._connectRequest) return;\n this._connectRequest = true;\n\n this.info('Initiating connection for ?', this._dispatcher.clientId);\n\n this._sendMessage({\n channel: Channel.CONNECT,\n clientId: this._dispatcher.clientId,\n connectionType: this._dispatcher.connectionType\n\n }, {}, this._cycleConnection, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // MAY include: * ext * clientId\n // * id MAY include: * error\n // * ext\n // * id\n disconnect: function() {\n if (this._state !== this.CONNECTED) return;\n this._state = this.DISCONNECTED;\n\n this.info('Disconnecting ?', this._dispatcher.clientId);\n var promise = new Publication();\n\n this._sendMessage({\n channel: Channel.DISCONNECT,\n clientId: this._dispatcher.clientId\n\n }, {}, function(response) {\n if (response.successful) {\n this._dispatcher.close();\n promise.setDeferredStatus('succeeded');\n } else {\n promise.setDeferredStatus('failed', Error.parse(response.error));\n }\n }, this);\n\n this.info('Clearing channel listeners for ?', this._dispatcher.clientId);\n this._channels = new Channel.Set();\n\n return promise;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n subscribe: function(channel, callback, context) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.subscribe(c, callback, context);\n }, this);\n\n var subscription = new Subscription(this, channel, callback, context),\n force = (callback === true),\n hasSubscribe = this._channels.hasSubscription(channel);\n\n if (hasSubscribe && !force) {\n this._channels.subscribe([channel], subscription);\n subscription.setDeferredStatus('succeeded');\n return subscription;\n }\n\n this.connect(function() {\n this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);\n if (!force) this._channels.subscribe([channel], subscription);\n\n this._sendMessage({\n channel: Channel.SUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) {\n subscription.setDeferredStatus('failed', Error.parse(response.error));\n return this._channels.unsubscribe(channel, subscription);\n }\n\n var channels = [].concat(response.subscription);\n this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);\n subscription.setDeferredStatus('succeeded');\n }, this);\n }, this);\n\n return subscription;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n unsubscribe: function(channel, subscription) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.unsubscribe(c, subscription);\n }, this);\n\n var dead = this._channels.unsubscribe(channel, subscription);\n if (!dead) return;\n\n this.connect(function() {\n this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);\n\n this._sendMessage({\n channel: Channel.UNSUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) return;\n\n var channels = [].concat(response.subscription);\n this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);\n }, this);\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * data * successful\n // MAY include: * clientId MAY include: * id\n // * id * error\n // * ext * ext\n publish: function(channel, data, options) {\n validateOptions(options || {}, ['attempts', 'deadline']);\n var publication = new Publication();\n\n this.connect(function() {\n this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);\n\n this._sendMessage({\n channel: channel,\n data: data,\n clientId: this._dispatcher.clientId\n\n }, options, function(response) {\n if (response.successful)\n publication.setDeferredStatus('succeeded');\n else\n publication.setDeferredStatus('failed', Error.parse(response.error));\n }, this);\n }, this);\n\n return publication;\n },\n\n _sendMessage: function(message, options, callback, context) {\n message.id = this._generateMessageId();\n\n var timeout = this._advice.timeout\n ? 1.2 * this._advice.timeout / 1000\n : 1.2 * this._dispatcher.retry;\n\n this.pipeThroughExtensions('outgoing', message, null, function(message) {\n if (!message) return;\n if (callback) this._responseCallbacks[message.id] = [callback, context];\n this._dispatcher.sendMessage(message, timeout, options || {});\n }, this);\n },\n\n _generateMessageId: function() {\n this._messageId += 1;\n if (this._messageId >= Math.pow(2,32)) this._messageId = 0;\n return this._messageId.toString(36);\n },\n\n _receiveMessage: function(message) {\n var id = message.id, callback;\n\n if (message.successful !== undefined) {\n callback = this._responseCallbacks[id];\n delete this._responseCallbacks[id];\n }\n\n this.pipeThroughExtensions('incoming', message, null, function(message) {\n if (!message) return;\n if (message.advice) this._handleAdvice(message.advice);\n this._deliverMessage(message);\n if (callback) callback[0].call(callback[1], message);\n }, this);\n },\n\n _handleAdvice: function(advice) {\n assign(this._advice, advice);\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {\n this._state = this.UNCONNECTED;\n this._dispatcher.clientId = null;\n this._cycleConnection();\n }\n },\n\n _deliverMessage: function(message) {\n if (!message.channel || message.data === undefined) return;\n this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);\n this._channels.distributeMessage(message);\n },\n\n _cycleConnection: function() {\n if (this._connectRequest) {\n this._connectRequest = null;\n this.info('Closed connection for ?', this._dispatcher.clientId);\n }\n var self = this;\n global.setTimeout(function() { self.connect() }, this._advice.interval);\n }\n});\n\nassign(Client.prototype, Deferrable);\nassign(Client.prototype, Publisher);\nassign(Client.prototype, Logging);\nassign(Client.prototype, Extensible);\n\nmodule.exports = Client;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n cookies = require('../util/cookies'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Transport = require('../transport'),\n Scheduler = require('./scheduler');\n\nvar Dispatcher = Class({ className: 'Dispatcher',\n MAX_REQUEST_SIZE: 2048,\n DEFAULT_RETRY: 5,\n\n UP: 1,\n DOWN: 2,\n\n initialize: function(client, endpoint, options) {\n this._client = client;\n this.endpoint = URI.parse(endpoint);\n this._alternates = options.endpoints || {};\n\n this.cookies = cookies.CookieJar && new cookies.CookieJar();\n this._disabled = [];\n this._envelopes = {};\n this.headers = {};\n this.retry = options.retry || this.DEFAULT_RETRY;\n this._scheduler = options.scheduler || Scheduler;\n this._state = 0;\n this.transports = {};\n this.wsExtensions = [];\n\n this.proxy = options.proxy || {};\n if (typeof this._proxy === 'string') this._proxy = { origin: this._proxy };\n\n var exts = options.websocketExtensions;\n if (exts) {\n exts = [].concat(exts);\n for (var i = 0, n = exts.length; i < n; i++)\n this.addWebsocketExtension(exts[i]);\n }\n\n this.tls = options.tls || {};\n this.tls.ca = this.tls.ca || options.ca;\n\n for (var type in this._alternates)\n this._alternates[type] = URI.parse(this._alternates[type]);\n\n this.maxRequestSize = this.MAX_REQUEST_SIZE;\n },\n\n endpointFor: function(connectionType) {\n return this._alternates[connectionType] || this.endpoint;\n },\n\n addWebsocketExtension: function(extension) {\n this.wsExtensions.push(extension);\n },\n\n disable: function(feature) {\n this._disabled.push(feature);\n Transport.disable(feature);\n },\n\n setHeader: function(name, value) {\n this.headers[name] = value;\n },\n\n close: function() {\n var transport = this._transport;\n delete this._transport;\n if (transport) transport.close();\n },\n\n getConnectionTypes: function() {\n return Transport.getConnectionTypes();\n },\n\n selectTransport: function(transportTypes) {\n Transport.get(this, transportTypes, this._disabled, function(transport) {\n this.debug('Selected ? transport for ?', transport.connectionType, transport.endpoint.href);\n\n if (transport === this._transport) return;\n if (this._transport) this._transport.close();\n\n this._transport = transport;\n this.connectionType = transport.connectionType;\n }, this);\n },\n\n sendMessage: function(message, timeout, options) {\n options = options || {};\n\n var id = message.id,\n attempts = options.attempts,\n deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),\n envelope = this._envelopes[id],\n scheduler;\n\n if (!envelope) {\n scheduler = new this._scheduler(message, { timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline });\n envelope = this._envelopes[id] = { message: message, scheduler: scheduler };\n }\n\n this._sendEnvelope(envelope);\n },\n\n _sendEnvelope: function(envelope) {\n if (!this._transport) return;\n if (envelope.request || envelope.timer) return;\n\n var message = envelope.message,\n scheduler = envelope.scheduler,\n self = this;\n\n if (!scheduler.isDeliverable()) {\n scheduler.abort();\n delete this._envelopes[message.id];\n return;\n }\n\n envelope.timer = global.setTimeout(function() {\n self.handleError(message);\n }, scheduler.getTimeout() * 1000);\n\n scheduler.send();\n envelope.request = this._transport.sendMessage(message);\n },\n\n handleResponse: function(reply) {\n var envelope = this._envelopes[reply.id];\n\n if (reply.successful !== undefined && envelope) {\n envelope.scheduler.succeed();\n delete this._envelopes[reply.id];\n global.clearTimeout(envelope.timer);\n }\n\n this.trigger('message', reply);\n\n if (this._state === this.UP) return;\n this._state = this.UP;\n this._client.trigger('transport:up');\n },\n\n handleError: function(message, immediate) {\n var envelope = this._envelopes[message.id],\n request = envelope && envelope.request,\n self = this;\n\n if (!request) return;\n\n request.then(function(req) {\n if (req && req.abort) req.abort();\n });\n\n var scheduler = envelope.scheduler;\n scheduler.fail();\n\n global.clearTimeout(envelope.timer);\n envelope.request = envelope.timer = null;\n\n if (immediate) {\n this._sendEnvelope(envelope);\n } else {\n envelope.timer = global.setTimeout(function() {\n envelope.timer = null;\n self._sendEnvelope(envelope);\n }, scheduler.getInterval() * 1000);\n }\n\n if (this._state === this.DOWN) return;\n this._state = this.DOWN;\n this._client.trigger('transport:down');\n }\n});\n\nDispatcher.create = function(client, endpoint, options) {\n return new Dispatcher(client, endpoint, options);\n};\n\nassign(Dispatcher.prototype, Publisher);\nassign(Dispatcher.prototype, Logging);\n\nmodule.exports = Dispatcher;\n","'use strict';\n\nvar Class = require('../util/class'),\n Grammar = require('./grammar');\n\nvar Error = Class({\n initialize: function(code, params, message) {\n this.code = code;\n this.params = Array.prototype.slice.call(params);\n this.message = message;\n },\n\n toString: function() {\n return this.code + ':' +\n this.params.join(',') + ':' +\n this.message;\n }\n});\n\nError.parse = function(message) {\n message = message || '';\n if (!Grammar.ERROR.test(message)) return new Error(null, [], message);\n\n var parts = message.split(':'),\n code = parseInt(parts[0]),\n params = parts[1].split(','),\n message = parts[2];\n\n return new Error(code, params, message);\n};\n\n// http://code.google.com/p/cometd/wiki/BayeuxCodes\nvar errors = {\n versionMismatch: [300, 'Version mismatch'],\n conntypeMismatch: [301, 'Connection types not supported'],\n extMismatch: [302, 'Extension mismatch'],\n badRequest: [400, 'Bad request'],\n clientUnknown: [401, 'Unknown client'],\n parameterMissing: [402, 'Missing required parameter'],\n channelForbidden: [403, 'Forbidden channel'],\n channelUnknown: [404, 'Unknown channel'],\n channelInvalid: [405, 'Invalid channel'],\n extUnknown: [406, 'Unknown extension'],\n publishFailed: [407, 'Failed to publish'],\n serverError: [500, 'Internal server error']\n};\n\nfor (var name in errors)\n (function(name) {\n Error[name] = function() {\n return new Error(errors[name][0], arguments, errors[name][1]).toString();\n };\n })(name);\n\nmodule.exports = Error;\n","'use strict';\n\nvar assign = require('../util/assign'),\n Logging = require('../mixins/logging');\n\nvar Extensible = {\n addExtension: function(extension) {\n this._extensions = this._extensions || [];\n this._extensions.push(extension);\n if (extension.added) extension.added(this);\n },\n\n removeExtension: function(extension) {\n if (!this._extensions) return;\n var i = this._extensions.length;\n while (i--) {\n if (this._extensions[i] !== extension) continue;\n this._extensions.splice(i,1);\n if (extension.removed) extension.removed(this);\n }\n },\n\n pipeThroughExtensions: function(stage, message, request, callback, context) {\n this.debug('Passing through ? extensions: ?', stage, message);\n\n if (!this._extensions) return callback.call(context, message);\n var extensions = this._extensions.slice();\n\n var pipe = function(message) {\n if (!message) return callback.call(context, message);\n\n var extension = extensions.shift();\n if (!extension) return callback.call(context, message);\n\n var fn = extension[stage];\n if (!fn) return pipe(message);\n\n if (fn.length >= 3) extension[stage](message, request, pipe);\n else extension[stage](message, pipe);\n };\n pipe(message);\n }\n};\n\nassign(Extensible, Logging);\n\nmodule.exports = Extensible;\n","'use strict';\n\nmodule.exports = {\n CHANNEL_NAME: /^\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*$/,\n CHANNEL_PATTERN: /^(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*\\/\\*{1,2}$/,\n ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*(,(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)$/,\n VERSION: /^([0-9])+(\\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\\-|\\_))*)*$/\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Deferrable = require('../mixins/deferrable');\n\nmodule.exports = Class(Deferrable);\n","'use strict';\n\nvar assign = require('../util/assign');\n\nvar Scheduler = function(message, options) {\n this.message = message;\n this.options = options;\n this.attempts = 0;\n};\n\nassign(Scheduler.prototype, {\n getTimeout: function() {\n return this.options.timeout;\n },\n\n getInterval: function() {\n return this.options.interval;\n },\n\n isDeliverable: function() {\n var attempts = this.options.attempts,\n made = this.attempts,\n deadline = this.options.deadline,\n now = new Date().getTime();\n\n if (attempts !== undefined && made >= attempts)\n return false;\n\n if (deadline !== undefined && now > deadline)\n return false;\n\n return true;\n },\n\n send: function() {\n this.attempts += 1;\n },\n\n succeed: function() {},\n\n fail: function() {},\n\n abort: function() {}\n});\n\nmodule.exports = Scheduler;\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable');\n\nvar Subscription = Class({\n initialize: function(client, channels, callback, context) {\n this._client = client;\n this._channels = channels;\n this._callback = callback;\n this._context = context;\n this._cancelled = false;\n },\n\n withChannel: function(callback, context) {\n this._withChannel = [callback, context];\n return this;\n },\n\n apply: function(context, args) {\n var message = args[0];\n\n if (this._callback)\n this._callback.call(this._context, message.data);\n\n if (this._withChannel)\n this._withChannel[0].call(this._withChannel[1], message.channel, message.data);\n },\n\n cancel: function() {\n if (this._cancelled) return;\n this._client.unsubscribe(this._channels, this);\n this._cancelled = true;\n },\n\n unsubscribe: function() {\n this.cancel();\n }\n});\n\nassign(Subscription.prototype, Deferrable);\n\nmodule.exports = Subscription;\n","'use strict';\n\nvar Transport = require('./transport');\n\nTransport.register('websocket', require('./web_socket'));\nTransport.register('eventsource', require('./event_source'));\nTransport.register('long-polling', require('./xhr'));\nTransport.register('cross-origin-long-polling', require('./cors'));\nTransport.register('callback-polling', require('./jsonp'));\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('../util/class'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar CORS = assign(Class(Transport, {\n encode: function(messages) {\n return 'message=' + encodeURIComponent(toJSON(messages));\n },\n\n request: function(messages) {\n var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,\n xhr = new xhrClass(),\n id = ++CORS._id,\n headers = this._dispatcher.headers,\n self = this,\n key;\n\n xhr.open('POST', this.endpoint.href, true);\n xhr.withCredentials = true;\n\n if (xhr.setRequestHeader) {\n xhr.setRequestHeader('Pragma', 'no-cache');\n for (key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n\n var cleanUp = function() {\n if (!xhr) return false;\n CORS._pending.remove(id);\n xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;\n xhr = null;\n };\n\n xhr.onload = function() {\n var replies;\n try { replies = JSON.parse(xhr.responseText) } catch (error) {}\n\n cleanUp();\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.onerror = xhr.ontimeout = function() {\n cleanUp();\n self._handleError(messages);\n };\n\n xhr.onprogress = function() {};\n\n if (xhrClass === global.XDomainRequest)\n CORS._pending.add({ id: id, xhr: xhr });\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n _id: 0,\n _pending: new Set(),\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n if (URI.isSameOrigin(endpoint))\n return callback.call(context, false);\n\n if (global.XDomainRequest)\n return callback.call(context, endpoint.protocol === location.protocol);\n\n if (global.XMLHttpRequest) {\n var xhr = new XMLHttpRequest();\n return callback.call(context, xhr.withCredentials !== undefined);\n }\n return callback.call(context, false);\n }\n});\n\nmodule.exports = CORS;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport'),\n XHR = require('./xhr');\n\nvar EventSource = assign(Class(Transport, {\n initialize: function(dispatcher, endpoint) {\n Transport.prototype.initialize.call(this, dispatcher, endpoint);\n if (!global.EventSource) return this.setDeferredStatus('failed');\n\n this._xhr = new XHR(dispatcher, endpoint);\n\n endpoint = copyObject(endpoint);\n endpoint.pathname += '/' + dispatcher.clientId;\n\n var socket = new global.EventSource(URI.stringify(endpoint)),\n self = this;\n\n socket.onopen = function() {\n self._everConnected = true;\n self.setDeferredStatus('succeeded');\n };\n\n socket.onerror = function() {\n if (self._everConnected) {\n self._handleError([]);\n } else {\n self.setDeferredStatus('failed');\n socket.close();\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError([]);\n };\n\n this._socket = socket;\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;\n this._socket.close();\n delete this._socket;\n },\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n },\n\n encode: function(messages) {\n return this._xhr.encode(messages);\n },\n\n request: function(messages) {\n return this._xhr.request(messages);\n }\n\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var id = dispatcher.clientId;\n if (!id) return callback.call(context, false);\n\n XHR.isUsable(dispatcher, endpoint, function(usable) {\n if (!usable) return callback.call(context, false);\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }, this);\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},\n id = dispatcher.clientId;\n\n var url = copyObject(endpoint);\n url.pathname += '/' + (id || '');\n url = URI.stringify(url);\n\n sockets[url] = sockets[url] || new this(dispatcher, endpoint);\n return sockets[url];\n }\n});\n\nassign(EventSource.prototype, Deferrable);\n\nmodule.exports = EventSource;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar JSONP = assign(Class(Transport, {\n encode: function(messages) {\n var url = copyObject(this.endpoint);\n url.query.message = toJSON(messages);\n url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';\n return URI.stringify(url);\n },\n\n request: function(messages) {\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callbackName = JSONP.getCallbackName(),\n endpoint = copyObject(this.endpoint),\n self = this;\n\n endpoint.query.message = toJSON(messages);\n endpoint.query.jsonp = callbackName;\n\n var cleanup = function() {\n if (!global[callbackName]) return false;\n global[callbackName] = undefined;\n try { delete global[callbackName] } catch (error) {}\n script.parentNode.removeChild(script);\n };\n\n global[callbackName] = function(replies) {\n cleanup();\n self._receive(replies);\n };\n\n script.type = 'text/javascript';\n script.src = URI.stringify(endpoint);\n head.appendChild(script);\n\n script.onerror = function() {\n cleanup();\n self._handleError(messages);\n };\n\n return { abort: cleanup };\n }\n}), {\n _cbCount: 0,\n\n getCallbackName: function() {\n this._cbCount += 1;\n return '__jsonp' + this._cbCount + '__';\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n callback.call(context, true);\n }\n});\n\nmodule.exports = JSONP;\n","'use strict';\n\nvar Class = require('../util/class'),\n Cookie = require('../util/cookies').Cookie,\n Promise = require('../util/promise'),\n array = require('../util/array'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Timeouts = require('../mixins/timeouts'),\n Channel = require('../protocol/channel');\n\nvar Transport = assign(Class({ className: 'Transport',\n DEFAULT_PORTS: { 'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443 },\n MAX_DELAY: 0,\n\n batching: true,\n\n initialize: function(dispatcher, endpoint) {\n this._dispatcher = dispatcher;\n this.endpoint = endpoint;\n this._outbox = [];\n this._proxy = assign({}, this._dispatcher.proxy);\n\n if (!this._proxy.origin)\n this._proxy.origin = this._findProxy();\n },\n\n close: function() {},\n\n encode: function(messages) {\n return '';\n },\n\n sendMessage: function(message) {\n this.debug('Client ? sending message to ?: ?',\n this._dispatcher.clientId, this.endpoint.href, message);\n\n if (!this.batching) return Promise.resolve(this.request([message]));\n\n this._outbox.push(message);\n this._flushLargeBatch();\n\n if (message.channel === Channel.HANDSHAKE)\n return this._publish(0.01);\n\n if (message.channel === Channel.CONNECT)\n this._connectMessage = message;\n\n return this._publish(this.MAX_DELAY);\n },\n\n _makePromise: function() {\n var self = this;\n\n this._requestPromise = this._requestPromise || new Promise(function(resolve) {\n self._resolvePromise = resolve;\n });\n },\n\n _publish: function(delay) {\n this._makePromise();\n\n this.addTimeout('publish', delay, function() {\n this._flush();\n delete this._requestPromise;\n }, this);\n\n return this._requestPromise;\n },\n\n _flush: function() {\n this.removeTimeout('publish');\n\n if (this._outbox.length > 1 && this._connectMessage)\n this._connectMessage.advice = { timeout: 0 };\n\n this._resolvePromise(this.request(this._outbox));\n\n this._connectMessage = null;\n this._outbox = [];\n },\n\n _flushLargeBatch: function() {\n var string = this.encode(this._outbox);\n if (string.length < this._dispatcher.maxRequestSize) return;\n var last = this._outbox.pop();\n\n this._makePromise();\n this._flush();\n\n if (last) this._outbox.push(last);\n },\n\n _receive: function(replies) {\n if (!replies) return;\n replies = [].concat(replies);\n\n this.debug('Client ? received from ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, replies);\n\n for (var i = 0, n = replies.length; i < n; i++)\n this._dispatcher.handleResponse(replies[i]);\n },\n\n _handleError: function(messages, immediate) {\n messages = [].concat(messages);\n\n this.debug('Client ? failed to send to ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, messages);\n\n for (var i = 0, n = messages.length; i < n; i++)\n this._dispatcher.handleError(messages[i]);\n },\n\n _getCookies: function() {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href;\n\n if (!cookies) return '';\n\n return array.map(cookies.getCookiesSync(url), function(cookie) {\n return cookie.cookieString();\n }).join('; ');\n },\n\n _storeCookies: function(setCookie) {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href,\n cookie;\n\n if (!setCookie || !cookies) return;\n setCookie = [].concat(setCookie);\n\n for (var i = 0, n = setCookie.length; i < n; i++) {\n cookie = Cookie.parse(setCookie[i]);\n cookies.setCookieSync(cookie, url);\n }\n },\n\n _findProxy: function() {\n if (typeof process === 'undefined') return undefined;\n\n var protocol = this.endpoint.protocol;\n if (!protocol) return undefined;\n\n var name = protocol.replace(/:$/, '').toLowerCase() + '_proxy',\n upcase = name.toUpperCase(),\n env = process.env,\n keys, proxy;\n\n if (name === 'http_proxy' && env.REQUEST_METHOD) {\n keys = Object.keys(env).filter(function(k) { return /^http_proxy$/i.test(k) });\n if (keys.length === 1) {\n if (keys[0] === name && env[upcase] === undefined)\n proxy = env[name];\n } else if (keys.length > 1) {\n proxy = env[name];\n }\n proxy = proxy || env['CGI_' + upcase];\n } else {\n proxy = env[name] || env[upcase];\n if (proxy && !env[name])\n console.warn('The environment variable ' + upcase +\n ' is discouraged. Use ' + name + '.');\n }\n return proxy;\n }\n\n}), {\n get: function(dispatcher, allowed, disabled, callback, context) {\n var endpoint = dispatcher.endpoint;\n\n array.asyncEach(this._transports, function(pair, resume) {\n var connType = pair[0], klass = pair[1],\n connEndpoint = dispatcher.endpointFor(connType);\n\n if (array.indexOf(disabled, connType) >= 0)\n return resume();\n\n if (array.indexOf(allowed, connType) < 0) {\n klass.isUsable(dispatcher, connEndpoint, function() {});\n return resume();\n }\n\n klass.isUsable(dispatcher, connEndpoint, function(isUsable) {\n if (!isUsable) return resume();\n var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);\n callback.call(context, transport);\n });\n }, function() {\n throw new Error('Could not find a usable connection type for ' + endpoint.href);\n });\n },\n\n register: function(type, klass) {\n this._transports.push([type, klass]);\n klass.prototype.connectionType = type;\n },\n\n getConnectionTypes: function() {\n return array.map(this._transports, function(t) { return t[0] });\n },\n\n disable: function(feature) {\n if (feature !== 'autodisconnect') return;\n\n for (var i = 0; i < this._transports.length; i++)\n this._transports[i][1]._unloaded = false;\n },\n\n _transports: []\n});\n\nassign(Transport.prototype, Logging);\nassign(Transport.prototype, Timeouts);\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('../util/class'),\n Promise = require('../util/promise'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n ws = require('../util/websocket'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport');\n\nvar WebSocket = assign(Class(Transport, {\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n\n batching: false,\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n this.connect();\n },\n\n request: function(messages) {\n this._pending = this._pending || new Set();\n for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);\n\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.callback(function(socket) {\n if (!socket || socket.readyState !== 1) return;\n socket.send(toJSON(messages));\n resolve(socket);\n });\n\n self.connect();\n });\n\n return {\n abort: function() { promise.then(function(ws) { ws.close() }) }\n };\n },\n\n connect: function() {\n if (WebSocket._unloaded) return;\n\n this._state = this._state || this.UNCONNECTED;\n if (this._state !== this.UNCONNECTED) return;\n this._state = this.CONNECTING;\n\n var socket = this._createSocket();\n if (!socket) return this.setDeferredStatus('failed');\n\n var self = this;\n\n socket.onopen = function() {\n if (socket.headers) self._storeCookies(socket.headers['set-cookie']);\n self._socket = socket;\n self._state = self.CONNECTED;\n self._everConnected = true;\n self.setDeferredStatus('succeeded', socket);\n };\n\n var closed = false;\n socket.onclose = socket.onerror = function() {\n if (closed) return;\n closed = true;\n\n var wasConnected = (self._state === self.CONNECTED);\n socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;\n\n delete self._socket;\n self._state = self.UNCONNECTED;\n\n var pending = self._pending ? self._pending.toArray() : [];\n delete self._pending;\n\n if (wasConnected || self._everConnected) {\n self.setDeferredStatus('unknown');\n self._handleError(pending, wasConnected);\n } else {\n self.setDeferredStatus('failed');\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (!replies) return;\n\n replies = [].concat(replies);\n\n for (var i = 0, n = replies.length; i < n; i++) {\n if (replies[i].successful === undefined) continue;\n self._pending.remove(replies[i]);\n }\n self._receive(replies);\n };\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.close();\n },\n\n _createSocket: function() {\n var url = WebSocket.getSocketUrl(this.endpoint),\n headers = this._dispatcher.headers,\n extensions = this._dispatcher.wsExtensions,\n cookie = this._getCookies(),\n tls = this._dispatcher.tls,\n options = { extensions: extensions, headers: headers, proxy: this._proxy, tls: tls };\n\n if (cookie !== '') options.headers['Cookie'] = cookie;\n\n try {\n return ws.create(url, [], options);\n } catch (e) {\n // catch CSP error to allow transport to fallback to next connType\n }\n }\n\n}), {\n PROTOCOLS: {\n 'http:': 'ws:',\n 'https:': 'wss:'\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};\n sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);\n return sockets[endpoint.href];\n },\n\n getSocketUrl: function(endpoint) {\n endpoint = copyObject(endpoint);\n endpoint.protocol = this.PROTOCOLS[endpoint.protocol];\n return URI.stringify(endpoint);\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }\n});\n\nassign(WebSocket.prototype, Deferrable);\n\nif (browser.Event && global.onbeforeunload !== undefined) {\n browser.Event.on(global, 'beforeunload', function() {\n if (WebSocket._unloaded === undefined)\n WebSocket._unloaded = true;\n });\n}\n\nmodule.exports = WebSocket;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar XHR = assign(Class(Transport, {\n encode: function(messages) {\n return toJSON(messages);\n },\n\n request: function(messages) {\n var href = this.endpoint.href,\n self = this,\n xhr;\n\n // Prefer XMLHttpRequest over ActiveXObject if they both exist\n if (global.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (global.ActiveXObject) {\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\n } else {\n return this._handleError(messages);\n }\n\n xhr.open('POST', href, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n var headers = this._dispatcher.headers;\n for (var key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n\n var abort = function() { xhr.abort() };\n if (global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {\n if (!xhr || xhr.readyState !== 4) return;\n\n var replies = null,\n status = xhr.status,\n text = xhr.responseText,\n successful = (status >= 200 && status < 300) || status === 304 || status === 1223;\n\n if (global.onbeforeunload !== undefined)\n browser.Event.detach(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {};\n xhr = null;\n\n if (!successful) return self._handleError(messages);\n\n try {\n replies = JSON.parse(text);\n } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var usable = (navigator.product === 'ReactNative')\n || URI.isSameOrigin(endpoint);\n\n callback.call(context, usable);\n }\n});\n\nmodule.exports = XHR;\n","'use strict';\n\nmodule.exports = {\n commonElement: function(lista, listb) {\n for (var i = 0, n = lista.length; i < n; i++) {\n if (this.indexOf(listb, lista[i]) !== -1)\n return lista[i];\n }\n return null;\n },\n\n indexOf: function(list, needle) {\n if (list.indexOf) return list.indexOf(needle);\n\n for (var i = 0, n = list.length; i < n; i++) {\n if (list[i] === needle) return i;\n }\n return -1;\n },\n\n map: function(object, callback, context) {\n if (object.map) return object.map(callback, context);\n var result = [];\n\n if (object instanceof Array) {\n for (var i = 0, n = object.length; i < n; i++) {\n result.push(callback.call(context || null, object[i], i));\n }\n } else {\n for (var key in object) {\n if (!object.hasOwnProperty(key)) continue;\n result.push(callback.call(context || null, key, object[key]));\n }\n }\n return result;\n },\n\n filter: function(array, callback, context) {\n if (array.filter) return array.filter(callback, context);\n var result = [];\n for (var i = 0, n = array.length; i < n; i++) {\n if (callback.call(context || null, array[i], i))\n result.push(array[i]);\n }\n return result;\n },\n\n asyncEach: function(list, iterator, callback, context) {\n var n = list.length,\n i = -1,\n calls = 0,\n looping = false;\n\n var iterate = function() {\n calls -= 1;\n i += 1;\n if (i === n) return callback && callback.call(context);\n iterator(list[i], resume);\n };\n\n var loop = function() {\n if (looping) return;\n looping = true;\n while (calls > 0) iterate();\n looping = false;\n };\n\n var resume = function() {\n calls += 1;\n loop();\n };\n resume();\n }\n};\n","'use strict';\n\nvar forEach = Array.prototype.forEach,\n hasOwn = Object.prototype.hasOwnProperty;\n\nmodule.exports = function(target) {\n forEach.call(arguments, function(source, i) {\n if (i === 0) return;\n\n for (var key in source) {\n if (hasOwn.call(source, key)) target[key] = source[key];\n }\n });\n\n return target;\n};\n","'use strict';\n\nvar Event = {\n _registry: [],\n\n on: function(element, eventName, callback, context) {\n var wrapped = function() { callback.call(context) };\n\n if (element.addEventListener)\n element.addEventListener(eventName, wrapped, false);\n else\n element.attachEvent('on' + eventName, wrapped);\n\n this._registry.push({\n _element: element,\n _type: eventName,\n _callback: callback,\n _context: context,\n _handler: wrapped\n });\n },\n\n detach: function(element, eventName, callback, context) {\n var i = this._registry.length, register;\n while (i--) {\n register = this._registry[i];\n\n if ((element && element !== register._element) ||\n (eventName && eventName !== register._type) ||\n (callback && callback !== register._callback) ||\n (context && context !== register._context))\n continue;\n\n if (register._element.removeEventListener)\n register._element.removeEventListener(register._type, register._handler, false);\n else\n register._element.detachEvent('on' + register._type, register._handler);\n\n this._registry.splice(i,1);\n register = null;\n }\n }\n};\n\nif (global.onunload !== undefined)\n Event.on(global, 'unload', Event.detach, Event);\n\nmodule.exports = {\n Event: Event\n};\n","'use strict';\n\nvar assign = require('./assign');\n\nmodule.exports = function(parent, methods) {\n if (typeof parent !== 'function') {\n methods = parent;\n parent = Object;\n }\n\n var klass = function() {\n if (!this.initialize) return this;\n return this.initialize.apply(this, arguments) || this;\n };\n\n var bridge = function() {};\n bridge.prototype = parent.prototype;\n\n klass.prototype = new bridge();\n assign(klass.prototype, methods);\n\n return klass;\n};\n","module.exports = {\n VERSION: '1.3.0',\n\n BAYEUX_VERSION: '1.0',\n ID_LENGTH: 160,\n JSONP_CALLBACK: 'jsonpcallback',\n CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],\n\n MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']\n};\n","'use strict';\n\nmodule.exports = {};\n","'use strict';\n\nvar copyObject = function(object) {\n var clone, i, key;\n if (object instanceof Array) {\n clone = [];\n i = object.length;\n while (i--) clone[i] = copyObject(object[i]);\n return clone;\n } else if (typeof object === 'object') {\n clone = (object === null) ? null : {};\n for (key in object) clone[key] = copyObject(object[key]);\n return clone;\n } else {\n return object;\n }\n};\n\nmodule.exports = copyObject;\n","/*\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\nfunction indexOf (xs, x) {\n if (xs.indexOf) return xs.indexOf(x);\n for (var i = 0; i < xs.length; i++) {\n if (x === xs[i]) return i;\n }\n return -1;\n}\n\nfunction EventEmitter() {}\nmodule.exports = EventEmitter;\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = indexOf(list, listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n if (arguments.length === 0) {\n this._events = {};\n return this;\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n","'use strict';\n\nvar asap = require('asap');\n\nvar PENDING = -1,\n FULFILLED = 0,\n REJECTED = 1;\n\nvar Promise = function(task) {\n this._state = PENDING;\n this._value = null;\n this._defer = [];\n\n execute(this, task);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var promise = new Promise();\n\n var deferred = {\n promise: promise,\n onFulfilled: onFulfilled,\n onRejected: onRejected\n };\n\n if (this._state === PENDING)\n this._defer.push(deferred);\n else\n propagate(this, deferred);\n\n return promise;\n};\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nvar execute = function(promise, task) {\n if (typeof task !== 'function') return;\n\n var calls = 0;\n\n var resolvePromise = function(value) {\n if (calls++ === 0) resolve(promise, value);\n };\n\n var rejectPromise = function(reason) {\n if (calls++ === 0) reject(promise, reason);\n };\n\n try {\n task(resolvePromise, rejectPromise);\n } catch (error) {\n rejectPromise(error);\n }\n};\n\nvar propagate = function(promise, deferred) {\n var state = promise._state,\n value = promise._value,\n next = deferred.promise,\n handler = [deferred.onFulfilled, deferred.onRejected][state],\n pass = [resolve, reject][state];\n\n if (typeof handler !== 'function')\n return pass(next, value);\n\n asap(function() {\n try {\n resolve(next, handler(value));\n } catch (error) {\n reject(next, error);\n }\n });\n};\n\nvar resolve = function(promise, value) {\n if (promise === value)\n return reject(promise, new TypeError('Recursive promise chain detected'));\n\n var then;\n\n try {\n then = getThen(value);\n } catch (error) {\n return reject(promise, error);\n }\n\n if (!then) return fulfill(promise, value);\n\n execute(promise, function(resolvePromise, rejectPromise) {\n then.call(value, resolvePromise, rejectPromise);\n });\n};\n\nvar getThen = function(value) {\n var type = typeof value,\n then = (type === 'object' || type === 'function') && value && value.then;\n\n return (typeof then === 'function')\n ? then\n : null;\n};\n\nvar fulfill = function(promise, value) {\n settle(promise, FULFILLED, value);\n};\n\nvar reject = function(promise, reason) {\n settle(promise, REJECTED, reason);\n};\n\nvar settle = function(promise, state, value) {\n var defer = promise._defer, i = 0;\n\n promise._state = state;\n promise._value = value;\n promise._defer = null;\n\n if (defer.length === 0) return;\n while (i < defer.length) propagate(promise, defer[i++]);\n};\n\nPromise.resolve = function(value) {\n try {\n if (getThen(value)) return value;\n } catch (error) {\n return Promise.reject(error);\n }\n\n return new Promise(function(resolve, reject) { resolve(value) });\n};\n\nPromise.reject = function(reason) {\n return new Promise(function(resolve, reject) { reject(reason) });\n};\n\nPromise.all = function(promises) {\n return new Promise(function(resolve, reject) {\n var list = [], n = promises.length, i;\n\n if (n === 0) return resolve(list);\n\n var push = function(promise, i) {\n Promise.resolve(promise).then(function(value) {\n list[i] = value;\n if (--n === 0) resolve(list);\n }, reject);\n };\n\n for (i = 0; i < n; i++) push(promises[i], i);\n });\n};\n\nPromise.race = function(promises) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, n = promises.length; i < n; i++)\n Promise.resolve(promises[i]).then(resolve, reject);\n });\n};\n\nPromise.deferred = function() {\n var tuple = {};\n\n tuple.promise = new Promise(function(resolve, reject) {\n tuple.resolve = resolve;\n tuple.reject = reject;\n });\n return tuple;\n};\n\nmodule.exports = Promise;\n","'use strict';\n\nvar Class = require('./class');\n\nmodule.exports = Class({\n initialize: function() {\n this._index = {};\n },\n\n add: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n if (this._index.hasOwnProperty(key)) return false;\n this._index[key] = item;\n return true;\n },\n\n forEach: function(block, context) {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key))\n block.call(context, this._index[key]);\n }\n },\n\n isEmpty: function() {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key)) return false;\n }\n return true;\n },\n\n member: function(item) {\n for (var key in this._index) {\n if (this._index[key] === item) return true;\n }\n return false;\n },\n\n remove: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n var removed = this._index[key];\n delete this._index[key];\n return removed;\n },\n\n toArray: function() {\n var array = [];\n this.forEach(function(item) { array.push(item) });\n return array;\n }\n});\n","'use strict';\n\n// http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/\n\nmodule.exports = function(object) {\n return JSON.stringify(object, function(key, value) {\n return (this[key] instanceof Array) ? this[key] : value;\n });\n};\n","'use strict';\n\nmodule.exports = {\n isURI: function(uri) {\n return uri && uri.protocol && uri.host && uri.path;\n },\n\n isSameOrigin: function(uri) {\n return uri.protocol === location.protocol &&\n uri.hostname === location.hostname &&\n uri.port === location.port;\n },\n\n parse: function(url) {\n if (typeof url !== 'string') return url;\n var uri = {}, parts, query, pairs, i, n, data;\n\n var consume = function(name, pattern) {\n url = url.replace(pattern, function(match) {\n uri[name] = match;\n return '';\n });\n uri[name] = uri[name] || '';\n };\n\n consume('protocol', /^[a-z]+\\:/i);\n consume('host', /^\\/\\/[^\\/\\?#]+/);\n\n if (!/^\\//.test(url) && !uri.host)\n url = location.pathname.replace(/[^\\/]*$/, '') + url;\n\n consume('pathname', /^[^\\?#]*/);\n consume('search', /^\\?[^#]*/);\n consume('hash', /^#.*/);\n\n uri.protocol = uri.protocol || location.protocol;\n\n if (uri.host) {\n uri.host = uri.host.substr(2);\n\n if (/@/.test(uri.host)) {\n uri.auth = uri.host.split('@')[0];\n uri.host = uri.host.split('@')[1];\n }\n parts = uri.host.match(/^\\[([^\\]]+)\\]|^[^:]+/);\n uri.hostname = parts[1] || parts[0];\n uri.port = (uri.host.match(/:(\\d+)$/) || [])[1] || '';\n } else {\n uri.host = location.host;\n uri.hostname = location.hostname;\n uri.port = location.port;\n }\n\n uri.pathname = uri.pathname || '/';\n uri.path = uri.pathname + uri.search;\n\n query = uri.search.replace(/^\\?/, '');\n pairs = query ? query.split('&') : [];\n data = {};\n\n for (i = 0, n = pairs.length; i < n; i++) {\n parts = pairs[i].split('=');\n data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');\n }\n\n uri.query = data;\n\n uri.href = this.stringify(uri);\n return uri;\n },\n\n stringify: function(uri) {\n var auth = uri.auth ? uri.auth + '@' : '',\n string = uri.protocol + '//' + auth + uri.host;\n\n string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');\n\n return string;\n },\n\n queryString: function(query) {\n var pairs = [];\n for (var key in query) {\n if (!query.hasOwnProperty(key)) continue;\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));\n }\n if (pairs.length === 0) return '';\n return '?' + pairs.join('&');\n }\n};\n","'use strict';\n\nvar array = require('./array');\n\nmodule.exports = function(options, validKeys) {\n for (var key in options) {\n if (array.indexOf(validKeys, key) < 0)\n throw new Error('Unrecognized option: ' + key);\n }\n};\n","'use strict';\n\nvar WS = global.MozWebSocket || global.WebSocket;\n\nmodule.exports = {\n create: function(url, protocols, options) {\n if (typeof WS !== 'function') return null;\n return new WS(url);\n }\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://Faye/webpack/bootstrap","webpack://Faye/./node_modules/asap/browser-asap.js","webpack://Faye/./node_modules/asap/browser-raw.js","webpack://Faye/(webpack)/buildin/global.js","webpack://Faye/./src/faye_browser.js","webpack://Faye/./src/mixins/deferrable.js","webpack://Faye/./src/mixins/logging.js","webpack://Faye/./src/mixins/publisher.js","webpack://Faye/./src/mixins/timeouts.js","webpack://Faye/./src/protocol/channel.js","webpack://Faye/./src/protocol/client.js","webpack://Faye/./src/protocol/dispatcher.js","webpack://Faye/./src/protocol/error.js","webpack://Faye/./src/protocol/extensible.js","webpack://Faye/./src/protocol/grammar.js","webpack://Faye/./src/protocol/publication.js","webpack://Faye/./src/protocol/scheduler.js","webpack://Faye/./src/protocol/subscription.js","webpack://Faye/./src/transport/browser_transports.js","webpack://Faye/./src/transport/cors.js","webpack://Faye/./src/transport/event_source.js","webpack://Faye/./src/transport/jsonp.js","webpack://Faye/./src/transport/transport.js","webpack://Faye/./src/transport/web_socket.js","webpack://Faye/./src/transport/xhr.js","webpack://Faye/./src/util/array.js","webpack://Faye/./src/util/assign.js","webpack://Faye/./src/util/browser/event.js","webpack://Faye/./src/util/class.js","webpack://Faye/./src/util/constants.js","webpack://Faye/./src/util/cookies/browser_cookies.js","webpack://Faye/./src/util/copy_object.js","webpack://Faye/./src/util/event_emitter.js","webpack://Faye/./src/util/promise.js","webpack://Faye/./src/util/set.js","webpack://Faye/./src/util/to_json.js","webpack://Faye/./src/util/uri.js","webpack://Faye/./src/util/validate_options.js","webpack://Faye/./src/util/websocket/browser_websocket.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA,cAAc,mBAAO,CAAC,iDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;;;;;;;;;;;ACjEA,8CAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9NA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;;ACnBa;;AAEb,gBAAgB,mBAAO,CAAC,iDAAkB;AAC1C,gBAAgB,mBAAO,CAAC,iDAAkB;;AAE1C;AACA;;AAEA,cAAc,mBAAO,CAAC,mDAAmB;AACzC,cAAc,mBAAO,CAAC,yDAAsB;AAC5C;;AAEA;;AAEA;;;;;;;;;;;;;ACdA,8CAAa;;AAEb,gBAAgB,mBAAO,CAAC,8CAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,sCAAsC,gCAAgC;AACtE,GAAG;;AAEH;AACA,6CAA6C,iCAAiC;AAC9E,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC/Ca;;AAEb,aAAa,mBAAO,CAAC,8CAAiB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;;;;;;;;;;;;AC9Ca;;AAEb,mBAAmB,mBAAO,CAAC,4CAAgB;AAC3C,mBAAmB,mBAAO,CAAC,0DAAuB;;AAElD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;ACpCA,8CAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACzBa;;AAEb,gBAAgB,mBAAO,CAAC,0CAAe;AACvC,gBAAgB,mBAAO,CAAC,4CAAgB;AACxC,gBAAgB,mBAAO,CAAC,sDAAqB;AAC7C,gBAAgB,mBAAO,CAAC,4CAAW;;AAEnC;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;;AAEA;AACA,GAAG;;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A;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK,IAAI;;AAET;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,uCAAuC,yBAAyB;;AAEhE,OAAO;AACP;AACA,sCAAsC,oCAAoC;AAC1E;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC,kCAAkC;;AAE1E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK,IAAI;AACT,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,KAAK,IAAI;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,IAAI;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,IAAI;AACX;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kEAAkE;AAClE,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;AChYA,8CAAa;;AAEb,gBAAgB,mBAAO,CAAC,0CAAe;AACvC,gBAAgB,mBAAO,CAAC,sCAAa;AACrC,gBAAgB,mBAAO,CAAC,8DAAiB;AACzC,gBAAgB,mBAAO,CAAC,4CAAgB;AACxC,gBAAgB,mBAAO,CAAC,kDAAmB;AAC3C,gBAAgB,mBAAO,CAAC,sDAAqB;AAC7C,gBAAgB,mBAAO,CAAC,2DAAc;AACtC,gBAAgB,mBAAO,CAAC,gDAAa;;AAErC,wBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,iFAAiF;AACjI,yCAAyC;AACzC;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;;ACzLa;;AAEb,cAAc,mBAAO,CAAC,0CAAe;AACrC,cAAc,mBAAO,CAAC,4CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;;;;;;;;;;;;ACtDa;;AAEb,cAAc,mBAAO,CAAC,4CAAgB;AACtC,cAAc,mBAAO,CAAC,kDAAmB;;AAEzC;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;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7D,6BAA6B,gCAAgC;AAC7D;AACA,GAAG;;AAEH;AACA;AACA,wCAAwC,OAAO;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;;AAEL;AACA,yBAAyB,4BAA4B,aAAa;AAClE;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,WAAW,mCAAmC;;AAE9C;;AAEA;;AAEA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;;AChKA,8CAAa;;AAEb,gBAAgB,mBAAO,CAAC,0CAAe;AACvC,gBAAgB,mBAAO,CAAC,sCAAa;AACrC,gBAAgB,mBAAO,CAAC,oDAAiB;AACzC,gBAAgB,mBAAO,CAAC,4CAAgB;AACxC,gBAAgB,mBAAO,CAAC,8CAAiB;AACzC,gBAAgB,mBAAO,CAAC,iDAAa;;AAErC;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,qCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzEa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACfA,8CAAa;;AAEb;AACA;;AAEA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;ACjDa;;AAEb,aAAa,mBAAO,CAAC,sCAAU;;AAE/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;ACtBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACTa;;AAEb;;;;;;;;;;;;;ACFa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH;;AAEA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;;AAEA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ka;;AAEb,WAAW,mBAAO,CAAC,iDAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,gDAAgD,iBAAiB;AACjE;;AAEA;AACA,gDAAgD,iBAAiB;AACjE;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,eAAe,OAAO;AACtB,GAAG;AACH;;AAEA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;;;;AC3Ka;;AAEb,YAAY,mBAAO,CAAC,oCAAS;;AAE7B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,iCAAiC,mBAAmB;AACpD;AACA;AACA,CAAC;;;;;;;;;;;;;ACjDY;;AAEb;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACRa;;AAEb;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iCAAiC,OAAO;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzFa;;AAEb,YAAY,mBAAO,CAAC,oCAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACTA,8CAAa;;AAEb;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"build/client/faye-browser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/faye_browser.js\");\n","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== \"undefined\" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nvar constants = require('./util/constants'),\n Logging = require('./mixins/logging');\n\nvar Faye = {\n VERSION: constants.VERSION,\n\n Client: require('./protocol/client'),\n Scheduler: require('./protocol/scheduler')\n};\n\nLogging.wrapper = Faye;\n\nmodule.exports = Faye;\n","'use strict';\n\nvar Promise = require('../util/promise');\n\nmodule.exports = {\n then: function(callback, errback) {\n var self = this;\n if (!this._promise)\n this._promise = new Promise(function(resolve, reject) {\n self._resolve = resolve;\n self._reject = reject;\n });\n\n if (arguments.length === 0)\n return this._promise;\n else\n return this._promise.then(callback, errback);\n },\n\n callback: function(callback, context) {\n return this.then(function(value) { callback.call(context, value) });\n },\n\n errback: function(callback, context) {\n return this.then(null, function(reason) { callback.call(context, reason) });\n },\n\n timeout: function(seconds, message) {\n this.then();\n var self = this;\n this._timer = global.setTimeout(function() {\n self._reject(message);\n }, seconds * 1000);\n },\n\n setDeferredStatus: function(status, value) {\n if (this._timer) global.clearTimeout(this._timer);\n\n this.then();\n\n if (status === 'succeeded')\n this._resolve(value);\n else if (status === 'failed')\n this._reject(value);\n else\n delete this._promise;\n }\n};\n","'use strict';\n\nvar toJSON = require('../util/to_json');\n\nvar Logging = {\n LOG_LEVELS: {\n fatal: 4,\n error: 3,\n warn: 2,\n info: 1,\n debug: 0\n },\n\n writeLog: function(messageArgs, level) {\n var logger = Logging.logger || (Logging.wrapper || Logging).logger;\n if (!logger) return;\n\n var args = Array.prototype.slice.apply(messageArgs),\n banner = '[Faye',\n klass = this.className,\n\n message = args.shift().replace(/\\?/g, function() {\n try {\n return toJSON(args.shift());\n } catch (error) {\n return '[Object]';\n }\n });\n\n if (klass) banner += '.' + klass;\n banner += '] ';\n\n if (typeof logger[level] === 'function')\n logger[level](banner + message);\n else if (typeof logger === 'function')\n logger(banner + message);\n }\n};\n\nfor (var key in Logging.LOG_LEVELS)\n (function(level) {\n Logging[level] = function() {\n this.writeLog(arguments, level);\n };\n })(key);\n\nmodule.exports = Logging;\n","'use strict';\n\nvar assign = require('../util/assign'),\n EventEmitter = require('../util/event_emitter');\n\nvar Publisher = {\n countListeners: function(eventType) {\n return this.listeners(eventType).length;\n },\n\n bind: function(eventType, listener, context) {\n var slice = Array.prototype.slice,\n handler = function() { listener.apply(context, slice.call(arguments)) };\n\n this._listeners = this._listeners || [];\n this._listeners.push([eventType, listener, context, handler]);\n return this.on(eventType, handler);\n },\n\n unbind: function(eventType, listener, context) {\n this._listeners = this._listeners || [];\n var n = this._listeners.length, tuple;\n\n while (n--) {\n tuple = this._listeners[n];\n if (tuple[0] !== eventType) continue;\n if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;\n this._listeners.splice(n, 1);\n this.removeListener(eventType, tuple[3]);\n }\n }\n};\n\nassign(Publisher, EventEmitter.prototype);\nPublisher.trigger = Publisher.emit;\n\nmodule.exports = Publisher;\n","'use strict';\n\nmodule.exports = {\n addTimeout: function(name, delay, callback, context) {\n this._timeouts = this._timeouts || {};\n if (this._timeouts.hasOwnProperty(name)) return;\n var self = this;\n this._timeouts[name] = global.setTimeout(function() {\n delete self._timeouts[name];\n callback.call(context);\n }, 1000 * delay);\n },\n\n removeTimeout: function(name) {\n this._timeouts = this._timeouts || {};\n var timeout = this._timeouts[name];\n if (!timeout) return;\n global.clearTimeout(timeout);\n delete this._timeouts[name];\n },\n\n removeAllTimeouts: function() {\n this._timeouts = this._timeouts || {};\n for (var name in this._timeouts) this.removeTimeout(name);\n }\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Publisher = require('../mixins/publisher'),\n Grammar = require('./grammar');\n\nvar Channel = Class({\n initialize: function(name) {\n this.id = this.name = name;\n },\n\n push: function(message) {\n this.trigger('message', message);\n },\n\n isUnused: function() {\n return this.countListeners('message') === 0;\n }\n});\n\nassign(Channel.prototype, Publisher);\n\nassign(Channel, {\n HANDSHAKE: '/meta/handshake',\n CONNECT: '/meta/connect',\n SUBSCRIBE: '/meta/subscribe',\n UNSUBSCRIBE: '/meta/unsubscribe',\n DISCONNECT: '/meta/disconnect',\n\n META: 'meta',\n SERVICE: 'service',\n\n expand: function(name) {\n var segments = this.parse(name),\n channels = ['/**', name];\n\n var copy = segments.slice();\n copy[copy.length - 1] = '*';\n channels.push(this.unparse(copy));\n\n for (var i = 1, n = segments.length; i < n; i++) {\n copy = segments.slice(0, i);\n copy.push('**');\n channels.push(this.unparse(copy));\n }\n\n return channels;\n },\n\n isValid: function(name) {\n return Grammar.CHANNEL_NAME.test(name) ||\n Grammar.CHANNEL_PATTERN.test(name);\n },\n\n parse: function(name) {\n if (!this.isValid(name)) return null;\n return name.split('/').slice(1);\n },\n\n unparse: function(segments) {\n return '/' + segments.join('/');\n },\n\n isMeta: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.META) : null;\n },\n\n isService: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.SERVICE) : null;\n },\n\n isSubscribable: function(name) {\n if (!this.isValid(name)) return null;\n return !this.isMeta(name) && !this.isService(name);\n },\n\n Set: Class({\n initialize: function() {\n this._channels = {};\n },\n\n getKeys: function() {\n var keys = [];\n for (var key in this._channels) keys.push(key);\n return keys;\n },\n\n remove: function(name) {\n delete this._channels[name];\n },\n\n hasSubscription: function(name) {\n return this._channels.hasOwnProperty(name);\n },\n\n subscribe: function(names, subscription) {\n var name;\n for (var i = 0, n = names.length; i < n; i++) {\n name = names[i];\n var channel = this._channels[name] = this._channels[name] || new Channel(name);\n channel.bind('message', subscription);\n }\n },\n\n unsubscribe: function(name, subscription) {\n var channel = this._channels[name];\n if (!channel) return false;\n channel.unbind('message', subscription);\n\n if (channel.isUnused()) {\n this.remove(name);\n return true;\n } else {\n return false;\n }\n },\n\n distributeMessage: function(message) {\n var channels = Channel.expand(message.channel);\n\n for (var i = 0, n = channels.length; i < n; i++) {\n var channel = this._channels[channels[i]];\n if (channel) channel.trigger('message', message);\n }\n }\n })\n});\n\nmodule.exports = Channel;\n","'use strict';\n\nvar asap = require('asap'),\n Class = require('../util/class'),\n Promise = require('../util/promise'),\n array = require('../util/array'),\n browser = require('../util/browser'),\n constants = require('../util/constants'),\n assign = require('../util/assign'),\n validateOptions = require('../util/validate_options'),\n Deferrable = require('../mixins/deferrable'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Channel = require('./channel'),\n Dispatcher = require('./dispatcher'),\n Error = require('./error'),\n Extensible = require('./extensible'),\n Publication = require('./publication'),\n Subscription = require('./subscription');\n\nvar Client = Class({ className: 'Client',\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n DISCONNECTED: 4,\n\n HANDSHAKE: 'handshake',\n RETRY: 'retry',\n NONE: 'none',\n\n CONNECTION_TIMEOUT: 60,\n\n DEFAULT_ENDPOINT: '/bayeux',\n INTERVAL: 0,\n\n initialize: function(endpoint, options) {\n this.info('New client created for ?', endpoint);\n options = options || {};\n\n validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);\n\n this._channels = new Channel.Set();\n this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);\n\n this._messageId = 0;\n this._state = this.UNCONNECTED;\n\n this._responseCallbacks = {};\n\n this._advice = {\n reconnect: this.RETRY,\n interval: 1000 * (options.interval || this.INTERVAL),\n timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)\n };\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n this._dispatcher.bind('message', this._receiveMessage, this);\n\n if (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() {\n if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)\n this.disconnect();\n }, this);\n },\n\n addWebsocketExtension: function(extension) {\n return this._dispatcher.addWebsocketExtension(extension);\n },\n\n disable: function(feature) {\n return this._dispatcher.disable(feature);\n },\n\n setHeader: function(name, value) {\n return this._dispatcher.setHeader(name, value);\n },\n\n // Request\n // MUST include: * channel\n // * version\n // * supportedConnectionTypes\n // MAY include: * minimumVersion\n // * ext\n // * id\n //\n // Success Response Failed Response\n // MUST include: * channel MUST include: * channel\n // * version * successful\n // * supportedConnectionTypes * error\n // * clientId MAY include: * supportedConnectionTypes\n // * successful * advice\n // MAY include: * minimumVersion * version\n // * advice * minimumVersion\n // * ext * ext\n // * id * id\n // * authSuccessful\n handshake: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state !== this.UNCONNECTED) return;\n\n this._state = this.CONNECTING;\n var self = this;\n\n this.info('Initiating handshake with ?', this._dispatcher.endpoint.href);\n this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);\n\n this._sendMessage({\n channel: Channel.HANDSHAKE,\n version: constants.BAYEUX_VERSION,\n supportedConnectionTypes: this._dispatcher.getConnectionTypes()\n\n }, {}, function(response) {\n\n if (response.successful) {\n this._state = this.CONNECTED;\n this._dispatcher.clientId = response.clientId;\n\n this._dispatcher.selectTransport(response.supportedConnectionTypes);\n\n this.info('Handshake successful: ?', this._dispatcher.clientId);\n\n this.subscribe(this._channels.getKeys(), true);\n if (callback) asap(function() { callback.call(context) });\n\n } else {\n this.info('Handshake unsuccessful');\n global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);\n this._state = this.UNCONNECTED;\n }\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * connectionType * clientId\n // MAY include: * ext MAY include: * error\n // * id * advice\n // * ext\n // * id\n // * timestamp\n connect: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state === this.DISCONNECTED) return;\n\n if (this._state === this.UNCONNECTED)\n return this.handshake(function() { this.connect(callback, context) }, this);\n\n this.callback(callback, context);\n if (this._state !== this.CONNECTED) return;\n\n this.info('Calling deferred actions for ?', this._dispatcher.clientId);\n this.setDeferredStatus('succeeded');\n this.setDeferredStatus('unknown');\n\n if (this._connectRequest) return;\n this._connectRequest = true;\n\n this.info('Initiating connection for ?', this._dispatcher.clientId);\n\n this._sendMessage({\n channel: Channel.CONNECT,\n clientId: this._dispatcher.clientId,\n connectionType: this._dispatcher.connectionType\n\n }, {}, this._cycleConnection, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // MAY include: * ext * clientId\n // * id MAY include: * error\n // * ext\n // * id\n disconnect: function() {\n if (this._state !== this.CONNECTED) return;\n this._state = this.DISCONNECTED;\n\n this.info('Disconnecting ?', this._dispatcher.clientId);\n var promise = new Publication();\n\n this._sendMessage({\n channel: Channel.DISCONNECT,\n clientId: this._dispatcher.clientId\n\n }, {}, function(response) {\n if (response.successful) {\n this._dispatcher.close();\n promise.setDeferredStatus('succeeded');\n } else {\n promise.setDeferredStatus('failed', Error.parse(response.error));\n }\n }, this);\n\n this.info('Clearing channel listeners for ?', this._dispatcher.clientId);\n this._channels = new Channel.Set();\n\n return promise;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n subscribe: function(channel, callback, context) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.subscribe(c, callback, context);\n }, this);\n\n var subscription = new Subscription(this, channel, callback, context),\n force = (callback === true),\n hasSubscribe = this._channels.hasSubscription(channel);\n\n if (hasSubscribe && !force) {\n this._channels.subscribe([channel], subscription);\n subscription.setDeferredStatus('succeeded');\n return subscription;\n }\n\n this.connect(function() {\n this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);\n if (!force) this._channels.subscribe([channel], subscription);\n\n this._sendMessage({\n channel: Channel.SUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) {\n subscription.setDeferredStatus('failed', Error.parse(response.error));\n return this._channels.unsubscribe(channel, subscription);\n }\n\n var channels = [].concat(response.subscription);\n this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);\n subscription.setDeferredStatus('succeeded');\n }, this);\n }, this);\n\n return subscription;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n unsubscribe: function(channel, subscription) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.unsubscribe(c, subscription);\n }, this);\n\n var dead = this._channels.unsubscribe(channel, subscription);\n if (!dead) return;\n\n this.connect(function() {\n this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);\n\n this._sendMessage({\n channel: Channel.UNSUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) return;\n\n var channels = [].concat(response.subscription);\n this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);\n }, this);\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * data * successful\n // MAY include: * clientId MAY include: * id\n // * id * error\n // * ext * ext\n publish: function(channel, data, options) {\n validateOptions(options || {}, ['attempts', 'deadline']);\n var publication = new Publication();\n\n this.connect(function() {\n this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);\n\n this._sendMessage({\n channel: channel,\n data: data,\n clientId: this._dispatcher.clientId\n\n }, options, function(response) {\n if (response.successful)\n publication.setDeferredStatus('succeeded');\n else\n publication.setDeferredStatus('failed', Error.parse(response.error));\n }, this);\n }, this);\n\n return publication;\n },\n\n _sendMessage: function(message, options, callback, context) {\n message.id = this._generateMessageId();\n\n var timeout = this._advice.timeout\n ? 1.2 * this._advice.timeout / 1000\n : 1.2 * this._dispatcher.retry;\n\n this.pipeThroughExtensions('outgoing', message, null, function(message) {\n if (!message) return;\n if (callback) this._responseCallbacks[message.id] = [callback, context];\n this._dispatcher.sendMessage(message, timeout, options || {});\n }, this);\n },\n\n _generateMessageId: function() {\n this._messageId += 1;\n if (this._messageId >= Math.pow(2,32)) this._messageId = 0;\n return this._messageId.toString(36);\n },\n\n _receiveMessage: function(message) {\n var id = message.id, callback;\n\n if (message.successful !== undefined) {\n callback = this._responseCallbacks[id];\n delete this._responseCallbacks[id];\n }\n\n this.pipeThroughExtensions('incoming', message, null, function(message) {\n if (!message) return;\n if (message.advice) this._handleAdvice(message.advice);\n this._deliverMessage(message);\n if (callback) callback[0].call(callback[1], message);\n }, this);\n },\n\n _handleAdvice: function(advice) {\n assign(this._advice, advice);\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {\n this._state = this.UNCONNECTED;\n this._dispatcher.clientId = null;\n this._cycleConnection();\n }\n },\n\n _deliverMessage: function(message) {\n if (!message.channel || message.data === undefined) return;\n this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);\n this._channels.distributeMessage(message);\n },\n\n _cycleConnection: function() {\n if (this._connectRequest) {\n this._connectRequest = null;\n this.info('Closed connection for ?', this._dispatcher.clientId);\n }\n var self = this;\n global.setTimeout(function() { self.connect() }, this._advice.interval);\n }\n});\n\nassign(Client.prototype, Deferrable);\nassign(Client.prototype, Publisher);\nassign(Client.prototype, Logging);\nassign(Client.prototype, Extensible);\n\nmodule.exports = Client;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n cookies = require('../util/cookies'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Transport = require('../transport'),\n Scheduler = require('./scheduler');\n\nvar Dispatcher = Class({ className: 'Dispatcher',\n MAX_REQUEST_SIZE: 2048,\n DEFAULT_RETRY: 5,\n\n UP: 1,\n DOWN: 2,\n\n initialize: function(client, endpoint, options) {\n this._client = client;\n this.endpoint = URI.parse(endpoint);\n this._alternates = options.endpoints || {};\n\n this.cookies = cookies.CookieJar && new cookies.CookieJar();\n this._disabled = [];\n this._envelopes = {};\n this.headers = {};\n this.retry = options.retry || this.DEFAULT_RETRY;\n this._scheduler = options.scheduler || Scheduler;\n this._state = 0;\n this.transports = {};\n this.wsExtensions = [];\n\n this.proxy = options.proxy || {};\n if (typeof this._proxy === 'string') this._proxy = { origin: this._proxy };\n\n var exts = options.websocketExtensions;\n if (exts) {\n exts = [].concat(exts);\n for (var i = 0, n = exts.length; i < n; i++)\n this.addWebsocketExtension(exts[i]);\n }\n\n this.tls = options.tls || {};\n this.tls.ca = this.tls.ca || options.ca;\n\n for (var type in this._alternates)\n this._alternates[type] = URI.parse(this._alternates[type]);\n\n this.maxRequestSize = this.MAX_REQUEST_SIZE;\n },\n\n endpointFor: function(connectionType) {\n return this._alternates[connectionType] || this.endpoint;\n },\n\n addWebsocketExtension: function(extension) {\n this.wsExtensions.push(extension);\n },\n\n disable: function(feature) {\n this._disabled.push(feature);\n Transport.disable(feature);\n },\n\n setHeader: function(name, value) {\n this.headers[name] = value;\n },\n\n close: function() {\n var transport = this._transport;\n delete this._transport;\n if (transport) transport.close();\n },\n\n getConnectionTypes: function() {\n return Transport.getConnectionTypes();\n },\n\n selectTransport: function(transportTypes) {\n Transport.get(this, transportTypes, this._disabled, function(transport) {\n this.debug('Selected ? transport for ?', transport.connectionType, transport.endpoint.href);\n\n if (transport === this._transport) return;\n if (this._transport) this._transport.close();\n\n this._transport = transport;\n this.connectionType = transport.connectionType;\n }, this);\n },\n\n sendMessage: function(message, timeout, options) {\n options = options || {};\n\n var id = message.id,\n attempts = options.attempts,\n deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),\n envelope = this._envelopes[id],\n scheduler;\n\n if (!envelope) {\n scheduler = new this._scheduler(message, { timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline });\n envelope = this._envelopes[id] = { message: message, scheduler: scheduler };\n }\n\n this._sendEnvelope(envelope);\n },\n\n _sendEnvelope: function(envelope) {\n if (!this._transport) return;\n if (envelope.request || envelope.timer) return;\n\n var message = envelope.message,\n scheduler = envelope.scheduler,\n self = this;\n\n if (!scheduler.isDeliverable()) {\n scheduler.abort();\n delete this._envelopes[message.id];\n return;\n }\n\n envelope.timer = global.setTimeout(function() {\n self.handleError(message);\n }, scheduler.getTimeout() * 1000);\n\n scheduler.send();\n envelope.request = this._transport.sendMessage(message);\n },\n\n handleResponse: function(reply) {\n var envelope = this._envelopes[reply.id];\n\n if (reply.successful !== undefined && envelope) {\n envelope.scheduler.succeed();\n delete this._envelopes[reply.id];\n global.clearTimeout(envelope.timer);\n }\n\n this.trigger('message', reply);\n\n if (this._state === this.UP) return;\n this._state = this.UP;\n this._client.trigger('transport:up');\n },\n\n handleError: function(message, immediate) {\n var envelope = this._envelopes[message.id],\n request = envelope && envelope.request,\n self = this;\n\n if (!request) return;\n\n request.then(function(req) {\n if (req && req.abort) req.abort();\n });\n\n var scheduler = envelope.scheduler;\n scheduler.fail();\n\n global.clearTimeout(envelope.timer);\n envelope.request = envelope.timer = null;\n\n if (immediate) {\n this._sendEnvelope(envelope);\n } else {\n envelope.timer = global.setTimeout(function() {\n envelope.timer = null;\n self._sendEnvelope(envelope);\n }, scheduler.getInterval() * 1000);\n }\n\n if (this._state === this.DOWN) return;\n this._state = this.DOWN;\n this._client.trigger('transport:down');\n }\n});\n\nDispatcher.create = function(client, endpoint, options) {\n return new Dispatcher(client, endpoint, options);\n};\n\nassign(Dispatcher.prototype, Publisher);\nassign(Dispatcher.prototype, Logging);\n\nmodule.exports = Dispatcher;\n","'use strict';\n\nvar Class = require('../util/class'),\n Grammar = require('./grammar');\n\nvar Error = Class({\n initialize: function(code, params, message) {\n this.code = code;\n this.params = Array.prototype.slice.call(params);\n this.message = message;\n },\n\n toString: function() {\n return this.code + ':' +\n this.params.join(',') + ':' +\n this.message;\n }\n});\n\nError.parse = function(message) {\n message = message || '';\n if (!Grammar.ERROR.test(message)) return new Error(null, [], message);\n\n var parts = message.split(':'),\n code = parseInt(parts[0]),\n params = parts[1].split(','),\n message = parts[2];\n\n return new Error(code, params, message);\n};\n\n// http://code.google.com/p/cometd/wiki/BayeuxCodes\nvar errors = {\n versionMismatch: [300, 'Version mismatch'],\n conntypeMismatch: [301, 'Connection types not supported'],\n extMismatch: [302, 'Extension mismatch'],\n badRequest: [400, 'Bad request'],\n clientUnknown: [401, 'Unknown client'],\n parameterMissing: [402, 'Missing required parameter'],\n channelForbidden: [403, 'Forbidden channel'],\n channelUnknown: [404, 'Unknown channel'],\n channelInvalid: [405, 'Invalid channel'],\n extUnknown: [406, 'Unknown extension'],\n publishFailed: [407, 'Failed to publish'],\n serverError: [500, 'Internal server error']\n};\n\nfor (var name in errors)\n (function(name) {\n Error[name] = function() {\n return new Error(errors[name][0], arguments, errors[name][1]).toString();\n };\n })(name);\n\nmodule.exports = Error;\n","'use strict';\n\nvar assign = require('../util/assign'),\n Logging = require('../mixins/logging');\n\nvar Extensible = {\n addExtension: function(extension) {\n this._extensions = this._extensions || [];\n this._extensions.push(extension);\n if (extension.added) extension.added(this);\n },\n\n removeExtension: function(extension) {\n if (!this._extensions) return;\n var i = this._extensions.length;\n while (i--) {\n if (this._extensions[i] !== extension) continue;\n this._extensions.splice(i,1);\n if (extension.removed) extension.removed(this);\n }\n },\n\n pipeThroughExtensions: function(stage, message, request, callback, context) {\n this.debug('Passing through ? extensions: ?', stage, message);\n\n if (!this._extensions) return callback.call(context, message);\n var extensions = this._extensions.slice();\n\n var pipe = function(message) {\n if (!message) return callback.call(context, message);\n\n var extension = extensions.shift();\n if (!extension) return callback.call(context, message);\n\n var fn = extension[stage];\n if (!fn) return pipe(message);\n\n if (fn.length >= 3) extension[stage](message, request, pipe);\n else extension[stage](message, pipe);\n };\n pipe(message);\n }\n};\n\nassign(Extensible, Logging);\n\nmodule.exports = Extensible;\n","'use strict';\n\nmodule.exports = {\n CHANNEL_NAME: /^\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*$/,\n CHANNEL_PATTERN: /^(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*\\/\\*{1,2}$/,\n ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*(,(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)$/,\n VERSION: /^([0-9])+(\\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\\-|\\_))*)*$/\n};\n","'use strict';\n\nvar Class = require('../util/class'),\n Deferrable = require('../mixins/deferrable');\n\nmodule.exports = Class(Deferrable);\n","'use strict';\n\nvar assign = require('../util/assign');\n\nvar Scheduler = function(message, options) {\n this.message = message;\n this.options = options;\n this.attempts = 0;\n};\n\nassign(Scheduler.prototype, {\n getTimeout: function() {\n return this.options.timeout;\n },\n\n getInterval: function() {\n return this.options.interval;\n },\n\n isDeliverable: function() {\n var attempts = this.options.attempts,\n made = this.attempts,\n deadline = this.options.deadline,\n now = new Date().getTime();\n\n if (attempts !== undefined && made >= attempts)\n return false;\n\n if (deadline !== undefined && now > deadline)\n return false;\n\n return true;\n },\n\n send: function() {\n this.attempts += 1;\n },\n\n succeed: function() {},\n\n fail: function() {},\n\n abort: function() {}\n});\n\nmodule.exports = Scheduler;\n","'use strict';\n\nvar Class = require('../util/class'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable');\n\nvar Subscription = Class({\n initialize: function(client, channels, callback, context) {\n this._client = client;\n this._channels = channels;\n this._callback = callback;\n this._context = context;\n this._cancelled = false;\n },\n\n withChannel: function(callback, context) {\n this._withChannel = [callback, context];\n return this;\n },\n\n apply: function(context, args) {\n var message = args[0];\n\n if (this._callback)\n this._callback.call(this._context, message.data);\n\n if (this._withChannel)\n this._withChannel[0].call(this._withChannel[1], message.channel, message.data);\n },\n\n cancel: function() {\n if (this._cancelled) return;\n this._client.unsubscribe(this._channels, this);\n this._cancelled = true;\n },\n\n unsubscribe: function() {\n this.cancel();\n }\n});\n\nassign(Subscription.prototype, Deferrable);\n\nmodule.exports = Subscription;\n","'use strict';\n\nvar Transport = require('./transport');\n\nTransport.register('websocket', require('./web_socket'));\nTransport.register('eventsource', require('./event_source'));\nTransport.register('long-polling', require('./xhr'));\nTransport.register('cross-origin-long-polling', require('./cors'));\nTransport.register('callback-polling', require('./jsonp'));\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('../util/class'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar CORS = assign(Class(Transport, {\n encode: function(messages) {\n return 'message=' + encodeURIComponent(toJSON(messages));\n },\n\n request: function(messages) {\n var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,\n xhr = new xhrClass(),\n id = ++CORS._id,\n headers = this._dispatcher.headers,\n self = this,\n key;\n\n xhr.open('POST', this.endpoint.href, true);\n xhr.withCredentials = true;\n\n if (xhr.setRequestHeader) {\n xhr.setRequestHeader('Pragma', 'no-cache');\n for (key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n\n var cleanUp = function() {\n if (!xhr) return false;\n CORS._pending.remove(id);\n xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;\n xhr = null;\n };\n\n xhr.onload = function() {\n var replies;\n try { replies = JSON.parse(xhr.responseText) } catch (error) {}\n\n cleanUp();\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.onerror = xhr.ontimeout = function() {\n cleanUp();\n self._handleError(messages);\n };\n\n xhr.onprogress = function() {};\n\n if (xhrClass === global.XDomainRequest)\n CORS._pending.add({ id: id, xhr: xhr });\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n _id: 0,\n _pending: new Set(),\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n if (URI.isSameOrigin(endpoint))\n return callback.call(context, false);\n\n if (global.XDomainRequest)\n return callback.call(context, endpoint.protocol === location.protocol);\n\n if (global.XMLHttpRequest) {\n var xhr = new XMLHttpRequest();\n return callback.call(context, xhr.withCredentials !== undefined);\n }\n return callback.call(context, false);\n }\n});\n\nmodule.exports = CORS;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport'),\n XHR = require('./xhr');\n\nvar EventSource = assign(Class(Transport, {\n initialize: function(dispatcher, endpoint) {\n Transport.prototype.initialize.call(this, dispatcher, endpoint);\n if (!global.EventSource) return this.setDeferredStatus('failed');\n\n this._xhr = new XHR(dispatcher, endpoint);\n\n endpoint = copyObject(endpoint);\n endpoint.pathname += '/' + dispatcher.clientId;\n\n var socket = new global.EventSource(URI.stringify(endpoint)),\n self = this;\n\n socket.onopen = function() {\n self._everConnected = true;\n self.setDeferredStatus('succeeded');\n };\n\n socket.onerror = function() {\n if (self._everConnected) {\n self._handleError([]);\n } else {\n self.setDeferredStatus('failed');\n socket.close();\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError([]);\n };\n\n this._socket = socket;\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;\n this._socket.close();\n delete this._socket;\n },\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n },\n\n encode: function(messages) {\n return this._xhr.encode(messages);\n },\n\n request: function(messages) {\n return this._xhr.request(messages);\n }\n\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var id = dispatcher.clientId;\n if (!id) return callback.call(context, false);\n\n XHR.isUsable(dispatcher, endpoint, function(usable) {\n if (!usable) return callback.call(context, false);\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }, this);\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},\n id = dispatcher.clientId;\n\n var url = copyObject(endpoint);\n url.pathname += '/' + (id || '');\n url = URI.stringify(url);\n\n sockets[url] = sockets[url] || new this(dispatcher, endpoint);\n return sockets[url];\n }\n});\n\nassign(EventSource.prototype, Deferrable);\n\nmodule.exports = EventSource;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar JSONP = assign(Class(Transport, {\n encode: function(messages) {\n var url = copyObject(this.endpoint);\n url.query.message = toJSON(messages);\n url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';\n return URI.stringify(url);\n },\n\n request: function(messages) {\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callbackName = JSONP.getCallbackName(),\n endpoint = copyObject(this.endpoint),\n self = this;\n\n endpoint.query.message = toJSON(messages);\n endpoint.query.jsonp = callbackName;\n\n var cleanup = function() {\n if (!global[callbackName]) return false;\n global[callbackName] = undefined;\n try { delete global[callbackName] } catch (error) {}\n script.parentNode.removeChild(script);\n };\n\n global[callbackName] = function(replies) {\n cleanup();\n self._receive(replies);\n };\n\n script.type = 'text/javascript';\n script.src = URI.stringify(endpoint);\n head.appendChild(script);\n\n script.onerror = function() {\n cleanup();\n self._handleError(messages);\n };\n\n return { abort: cleanup };\n }\n}), {\n _cbCount: 0,\n\n getCallbackName: function() {\n this._cbCount += 1;\n return '__jsonp' + this._cbCount + '__';\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n callback.call(context, true);\n }\n});\n\nmodule.exports = JSONP;\n","'use strict';\n\nvar Class = require('../util/class'),\n Cookie = require('../util/cookies').Cookie,\n Promise = require('../util/promise'),\n array = require('../util/array'),\n assign = require('../util/assign'),\n Logging = require('../mixins/logging'),\n Timeouts = require('../mixins/timeouts'),\n Channel = require('../protocol/channel');\n\nvar Transport = assign(Class({ className: 'Transport',\n DEFAULT_PORTS: { 'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443 },\n MAX_DELAY: 0,\n\n batching: true,\n\n initialize: function(dispatcher, endpoint) {\n this._dispatcher = dispatcher;\n this.endpoint = endpoint;\n this._outbox = [];\n this._proxy = assign({}, this._dispatcher.proxy);\n\n if (!this._proxy.origin)\n this._proxy.origin = this._findProxy();\n },\n\n close: function() {},\n\n encode: function(messages) {\n return '';\n },\n\n sendMessage: function(message) {\n this.debug('Client ? sending message to ?: ?',\n this._dispatcher.clientId, this.endpoint.href, message);\n\n if (!this.batching) return Promise.resolve(this.request([message]));\n\n this._outbox.push(message);\n this._flushLargeBatch();\n\n if (message.channel === Channel.HANDSHAKE)\n return this._publish(0.01);\n\n if (message.channel === Channel.CONNECT)\n this._connectMessage = message;\n\n return this._publish(this.MAX_DELAY);\n },\n\n _makePromise: function() {\n var self = this;\n\n this._requestPromise = this._requestPromise || new Promise(function(resolve) {\n self._resolvePromise = resolve;\n });\n },\n\n _publish: function(delay) {\n this._makePromise();\n\n this.addTimeout('publish', delay, function() {\n this._flush();\n delete this._requestPromise;\n }, this);\n\n return this._requestPromise;\n },\n\n _flush: function() {\n this.removeTimeout('publish');\n\n if (this._outbox.length > 1 && this._connectMessage)\n this._connectMessage.advice = { timeout: 0 };\n\n this._resolvePromise(this.request(this._outbox));\n\n this._connectMessage = null;\n this._outbox = [];\n },\n\n _flushLargeBatch: function() {\n var string = this.encode(this._outbox);\n if (string.length < this._dispatcher.maxRequestSize) return;\n var last = this._outbox.pop();\n\n this._makePromise();\n this._flush();\n\n if (last) this._outbox.push(last);\n },\n\n _receive: function(replies) {\n if (!replies) return;\n replies = [].concat(replies);\n\n this.debug('Client ? received from ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, replies);\n\n for (var i = 0, n = replies.length; i < n; i++)\n this._dispatcher.handleResponse(replies[i]);\n },\n\n _handleError: function(messages, immediate) {\n messages = [].concat(messages);\n\n this.debug('Client ? failed to send to ? via ?: ?',\n this._dispatcher.clientId, this.endpoint.href, this.connectionType, messages);\n\n for (var i = 0, n = messages.length; i < n; i++)\n this._dispatcher.handleError(messages[i]);\n },\n\n _getCookies: function() {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href;\n\n if (!cookies) return '';\n\n return array.map(cookies.getCookiesSync(url), function(cookie) {\n return cookie.cookieString();\n }).join('; ');\n },\n\n _storeCookies: function(setCookie) {\n var cookies = this._dispatcher.cookies,\n url = this.endpoint.href,\n cookie;\n\n if (!setCookie || !cookies) return;\n setCookie = [].concat(setCookie);\n\n for (var i = 0, n = setCookie.length; i < n; i++) {\n cookie = Cookie.parse(setCookie[i]);\n cookies.setCookieSync(cookie, url);\n }\n },\n\n _findProxy: function() {\n if (typeof process === 'undefined') return undefined;\n\n var protocol = this.endpoint.protocol;\n if (!protocol) return undefined;\n\n var name = protocol.replace(/:$/, '').toLowerCase() + '_proxy',\n upcase = name.toUpperCase(),\n env = process.env,\n keys, proxy;\n\n if (name === 'http_proxy' && env.REQUEST_METHOD) {\n keys = Object.keys(env).filter(function(k) { return /^http_proxy$/i.test(k) });\n if (keys.length === 1) {\n if (keys[0] === name && env[upcase] === undefined)\n proxy = env[name];\n } else if (keys.length > 1) {\n proxy = env[name];\n }\n proxy = proxy || env['CGI_' + upcase];\n } else {\n proxy = env[name] || env[upcase];\n if (proxy && !env[name])\n console.warn('The environment variable ' + upcase +\n ' is discouraged. Use ' + name + '.');\n }\n return proxy;\n }\n\n}), {\n get: function(dispatcher, allowed, disabled, callback, context) {\n var endpoint = dispatcher.endpoint;\n\n array.asyncEach(this._transports, function(pair, resume) {\n var connType = pair[0], klass = pair[1],\n connEndpoint = dispatcher.endpointFor(connType);\n\n if (array.indexOf(disabled, connType) >= 0)\n return resume();\n\n if (array.indexOf(allowed, connType) < 0) {\n klass.isUsable(dispatcher, connEndpoint, function() {});\n return resume();\n }\n\n klass.isUsable(dispatcher, connEndpoint, function(isUsable) {\n if (!isUsable) return resume();\n var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);\n callback.call(context, transport);\n });\n }, function() {\n throw new Error('Could not find a usable connection type for ' + endpoint.href);\n });\n },\n\n register: function(type, klass) {\n this._transports.push([type, klass]);\n klass.prototype.connectionType = type;\n },\n\n getConnectionTypes: function() {\n return array.map(this._transports, function(t) { return t[0] });\n },\n\n disable: function(feature) {\n if (feature !== 'autodisconnect') return;\n\n for (var i = 0; i < this._transports.length; i++)\n this._transports[i][1]._unloaded = false;\n },\n\n _transports: []\n});\n\nassign(Transport.prototype, Logging);\nassign(Transport.prototype, Timeouts);\n\nmodule.exports = Transport;\n","'use strict';\n\nvar Class = require('../util/class'),\n Promise = require('../util/promise'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n copyObject = require('../util/copy_object'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n ws = require('../util/websocket'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport');\n\nvar WebSocket = assign(Class(Transport, {\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n\n batching: false,\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n this.connect();\n },\n\n request: function(messages) {\n this._pending = this._pending || new Set();\n for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);\n\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.callback(function(socket) {\n if (!socket || socket.readyState !== 1) return;\n socket.send(toJSON(messages));\n resolve(socket);\n });\n\n self.connect();\n });\n\n return {\n abort: function() { promise.then(function(ws) { ws.close() }) }\n };\n },\n\n connect: function() {\n if (WebSocket._unloaded) return;\n\n this._state = this._state || this.UNCONNECTED;\n if (this._state !== this.UNCONNECTED) return;\n this._state = this.CONNECTING;\n\n var socket = this._createSocket();\n if (!socket) return this.setDeferredStatus('failed');\n\n var self = this;\n\n socket.onopen = function() {\n if (socket.headers) self._storeCookies(socket.headers['set-cookie']);\n self._socket = socket;\n self._state = self.CONNECTED;\n self._everConnected = true;\n self.setDeferredStatus('succeeded', socket);\n };\n\n var closed = false;\n socket.onclose = socket.onerror = function() {\n if (closed) return;\n closed = true;\n\n var wasConnected = (self._state === self.CONNECTED);\n socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;\n\n delete self._socket;\n self._state = self.UNCONNECTED;\n\n var pending = self._pending ? self._pending.toArray() : [];\n delete self._pending;\n\n if (wasConnected || self._everConnected) {\n self.setDeferredStatus('unknown');\n self._handleError(pending, wasConnected);\n } else {\n self.setDeferredStatus('failed');\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (!replies) return;\n\n replies = [].concat(replies);\n\n for (var i = 0, n = replies.length; i < n; i++) {\n if (replies[i].successful === undefined) continue;\n self._pending.remove(replies[i]);\n }\n self._receive(replies);\n };\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.close();\n },\n\n _createSocket: function() {\n var url = WebSocket.getSocketUrl(this.endpoint),\n headers = this._dispatcher.headers,\n extensions = this._dispatcher.wsExtensions,\n cookie = this._getCookies(),\n tls = this._dispatcher.tls,\n options = { extensions: extensions, headers: headers, proxy: this._proxy, tls: tls };\n\n if (cookie !== '') options.headers['Cookie'] = cookie;\n\n try {\n return ws.create(url, [], options);\n } catch (e) {\n // catch CSP error to allow transport to fallback to next connType\n }\n }\n\n}), {\n PROTOCOLS: {\n 'http:': 'ws:',\n 'https:': 'wss:'\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};\n sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);\n return sockets[endpoint.href];\n },\n\n getSocketUrl: function(endpoint) {\n endpoint = copyObject(endpoint);\n endpoint.protocol = this.PROTOCOLS[endpoint.protocol];\n return URI.stringify(endpoint);\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }\n});\n\nassign(WebSocket.prototype, Deferrable);\n\nif (browser.Event && global.onbeforeunload !== undefined) {\n browser.Event.on(global, 'beforeunload', function() {\n if (WebSocket._unloaded === undefined)\n WebSocket._unloaded = true;\n });\n}\n\nmodule.exports = WebSocket;\n","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n assign = require('../util/assign'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar XHR = assign(Class(Transport, {\n encode: function(messages) {\n return toJSON(messages);\n },\n\n request: function(messages) {\n var href = this.endpoint.href,\n self = this,\n xhr;\n\n // Prefer XMLHttpRequest over ActiveXObject if they both exist\n if (global.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (global.ActiveXObject) {\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\n } else {\n return this._handleError(messages);\n }\n\n xhr.open('POST', href, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n var headers = this._dispatcher.headers;\n for (var key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n\n var abort = function() { xhr.abort() };\n if (global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {\n if (!xhr || xhr.readyState !== 4) return;\n\n var replies = null,\n status = xhr.status,\n text = xhr.responseText,\n successful = (status >= 200 && status < 300) || status === 304 || status === 1223;\n\n if (global.onbeforeunload !== undefined)\n browser.Event.detach(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {};\n xhr = null;\n\n if (!successful) return self._handleError(messages);\n\n try {\n replies = JSON.parse(text);\n } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var usable = (navigator.product === 'ReactNative')\n || URI.isSameOrigin(endpoint);\n\n callback.call(context, usable);\n }\n});\n\nmodule.exports = XHR;\n","'use strict';\n\nmodule.exports = {\n commonElement: function(lista, listb) {\n for (var i = 0, n = lista.length; i < n; i++) {\n if (this.indexOf(listb, lista[i]) !== -1)\n return lista[i];\n }\n return null;\n },\n\n indexOf: function(list, needle) {\n if (list.indexOf) return list.indexOf(needle);\n\n for (var i = 0, n = list.length; i < n; i++) {\n if (list[i] === needle) return i;\n }\n return -1;\n },\n\n map: function(object, callback, context) {\n if (object.map) return object.map(callback, context);\n var result = [];\n\n if (object instanceof Array) {\n for (var i = 0, n = object.length; i < n; i++) {\n result.push(callback.call(context || null, object[i], i));\n }\n } else {\n for (var key in object) {\n if (!object.hasOwnProperty(key)) continue;\n result.push(callback.call(context || null, key, object[key]));\n }\n }\n return result;\n },\n\n filter: function(array, callback, context) {\n if (array.filter) return array.filter(callback, context);\n var result = [];\n for (var i = 0, n = array.length; i < n; i++) {\n if (callback.call(context || null, array[i], i))\n result.push(array[i]);\n }\n return result;\n },\n\n asyncEach: function(list, iterator, callback, context) {\n var n = list.length,\n i = -1,\n calls = 0,\n looping = false;\n\n var iterate = function() {\n calls -= 1;\n i += 1;\n if (i === n) return callback && callback.call(context);\n iterator(list[i], resume);\n };\n\n var loop = function() {\n if (looping) return;\n looping = true;\n while (calls > 0) iterate();\n looping = false;\n };\n\n var resume = function() {\n calls += 1;\n loop();\n };\n resume();\n }\n};\n","'use strict';\n\nvar forEach = Array.prototype.forEach,\n hasOwn = Object.prototype.hasOwnProperty;\n\nmodule.exports = function(target) {\n forEach.call(arguments, function(source, i) {\n if (i === 0) return;\n\n for (var key in source) {\n if (hasOwn.call(source, key)) target[key] = source[key];\n }\n });\n\n return target;\n};\n","'use strict';\n\nvar Event = {\n _registry: [],\n\n on: function(element, eventName, callback, context) {\n var wrapped = function() { callback.call(context) };\n\n if (element.addEventListener)\n element.addEventListener(eventName, wrapped, false);\n else\n element.attachEvent('on' + eventName, wrapped);\n\n this._registry.push({\n _element: element,\n _type: eventName,\n _callback: callback,\n _context: context,\n _handler: wrapped\n });\n },\n\n detach: function(element, eventName, callback, context) {\n var i = this._registry.length, register;\n while (i--) {\n register = this._registry[i];\n\n if ((element && element !== register._element) ||\n (eventName && eventName !== register._type) ||\n (callback && callback !== register._callback) ||\n (context && context !== register._context))\n continue;\n\n if (register._element.removeEventListener)\n register._element.removeEventListener(register._type, register._handler, false);\n else\n register._element.detachEvent('on' + register._type, register._handler);\n\n this._registry.splice(i,1);\n register = null;\n }\n }\n};\n\nif (global.onunload !== undefined)\n Event.on(global, 'unload', Event.detach, Event);\n\nmodule.exports = {\n Event: Event\n};\n","'use strict';\n\nvar assign = require('./assign');\n\nmodule.exports = function(parent, methods) {\n if (typeof parent !== 'function') {\n methods = parent;\n parent = Object;\n }\n\n var klass = function() {\n if (!this.initialize) return this;\n return this.initialize.apply(this, arguments) || this;\n };\n\n var bridge = function() {};\n bridge.prototype = parent.prototype;\n\n klass.prototype = new bridge();\n assign(klass.prototype, methods);\n\n return klass;\n};\n","module.exports = {\n VERSION: '1.4.0',\n\n BAYEUX_VERSION: '1.0',\n ID_LENGTH: 160,\n JSONP_CALLBACK: 'jsonpcallback',\n CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],\n\n MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']\n};\n","'use strict';\n\nmodule.exports = {};\n","'use strict';\n\nvar copyObject = function(object) {\n var clone, i, key;\n if (object instanceof Array) {\n clone = [];\n i = object.length;\n while (i--) clone[i] = copyObject(object[i]);\n return clone;\n } else if (typeof object === 'object') {\n clone = (object === null) ? null : {};\n for (key in object) clone[key] = copyObject(object[key]);\n return clone;\n } else {\n return object;\n }\n};\n\nmodule.exports = copyObject;\n","/*\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\nfunction indexOf (xs, x) {\n if (xs.indexOf) return xs.indexOf(x);\n for (var i = 0; i < xs.length; i++) {\n if (x === xs[i]) return i;\n }\n return -1;\n}\n\nfunction EventEmitter() {}\nmodule.exports = EventEmitter;\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = indexOf(list, listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n if (arguments.length === 0) {\n this._events = {};\n return this;\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n","'use strict';\n\nvar asap = require('asap');\n\nvar PENDING = -1,\n FULFILLED = 0,\n REJECTED = 1;\n\nvar Promise = function(task) {\n this._state = PENDING;\n this._value = null;\n this._defer = [];\n\n execute(this, task);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var promise = new Promise();\n\n var deferred = {\n promise: promise,\n onFulfilled: onFulfilled,\n onRejected: onRejected\n };\n\n if (this._state === PENDING)\n this._defer.push(deferred);\n else\n propagate(this, deferred);\n\n return promise;\n};\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nvar execute = function(promise, task) {\n if (typeof task !== 'function') return;\n\n var calls = 0;\n\n var resolvePromise = function(value) {\n if (calls++ === 0) resolve(promise, value);\n };\n\n var rejectPromise = function(reason) {\n if (calls++ === 0) reject(promise, reason);\n };\n\n try {\n task(resolvePromise, rejectPromise);\n } catch (error) {\n rejectPromise(error);\n }\n};\n\nvar propagate = function(promise, deferred) {\n var state = promise._state,\n value = promise._value,\n next = deferred.promise,\n handler = [deferred.onFulfilled, deferred.onRejected][state],\n pass = [resolve, reject][state];\n\n if (typeof handler !== 'function')\n return pass(next, value);\n\n asap(function() {\n try {\n resolve(next, handler(value));\n } catch (error) {\n reject(next, error);\n }\n });\n};\n\nvar resolve = function(promise, value) {\n if (promise === value)\n return reject(promise, new TypeError('Recursive promise chain detected'));\n\n var then;\n\n try {\n then = getThen(value);\n } catch (error) {\n return reject(promise, error);\n }\n\n if (!then) return fulfill(promise, value);\n\n execute(promise, function(resolvePromise, rejectPromise) {\n then.call(value, resolvePromise, rejectPromise);\n });\n};\n\nvar getThen = function(value) {\n var type = typeof value,\n then = (type === 'object' || type === 'function') && value && value.then;\n\n return (typeof then === 'function')\n ? then\n : null;\n};\n\nvar fulfill = function(promise, value) {\n settle(promise, FULFILLED, value);\n};\n\nvar reject = function(promise, reason) {\n settle(promise, REJECTED, reason);\n};\n\nvar settle = function(promise, state, value) {\n var defer = promise._defer, i = 0;\n\n promise._state = state;\n promise._value = value;\n promise._defer = null;\n\n if (defer.length === 0) return;\n while (i < defer.length) propagate(promise, defer[i++]);\n};\n\nPromise.resolve = function(value) {\n try {\n if (getThen(value)) return value;\n } catch (error) {\n return Promise.reject(error);\n }\n\n return new Promise(function(resolve, reject) { resolve(value) });\n};\n\nPromise.reject = function(reason) {\n return new Promise(function(resolve, reject) { reject(reason) });\n};\n\nPromise.all = function(promises) {\n return new Promise(function(resolve, reject) {\n var list = [], n = promises.length, i;\n\n if (n === 0) return resolve(list);\n\n var push = function(promise, i) {\n Promise.resolve(promise).then(function(value) {\n list[i] = value;\n if (--n === 0) resolve(list);\n }, reject);\n };\n\n for (i = 0; i < n; i++) push(promises[i], i);\n });\n};\n\nPromise.race = function(promises) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, n = promises.length; i < n; i++)\n Promise.resolve(promises[i]).then(resolve, reject);\n });\n};\n\nPromise.deferred = function() {\n var tuple = {};\n\n tuple.promise = new Promise(function(resolve, reject) {\n tuple.resolve = resolve;\n tuple.reject = reject;\n });\n return tuple;\n};\n\nmodule.exports = Promise;\n","'use strict';\n\nvar Class = require('./class');\n\nmodule.exports = Class({\n initialize: function() {\n this._index = {};\n },\n\n add: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n if (this._index.hasOwnProperty(key)) return false;\n this._index[key] = item;\n return true;\n },\n\n forEach: function(block, context) {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key))\n block.call(context, this._index[key]);\n }\n },\n\n isEmpty: function() {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key)) return false;\n }\n return true;\n },\n\n member: function(item) {\n for (var key in this._index) {\n if (this._index[key] === item) return true;\n }\n return false;\n },\n\n remove: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n var removed = this._index[key];\n delete this._index[key];\n return removed;\n },\n\n toArray: function() {\n var array = [];\n this.forEach(function(item) { array.push(item) });\n return array;\n }\n});\n","'use strict';\n\n// http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/\n\nmodule.exports = function(object) {\n return JSON.stringify(object, function(key, value) {\n return (this[key] instanceof Array) ? this[key] : value;\n });\n};\n","'use strict';\n\nmodule.exports = {\n isURI: function(uri) {\n return uri && uri.protocol && uri.host && uri.path;\n },\n\n isSameOrigin: function(uri) {\n return uri.protocol === location.protocol &&\n uri.hostname === location.hostname &&\n uri.port === location.port;\n },\n\n parse: function(url) {\n if (typeof url !== 'string') return url;\n var uri = {}, parts, query, pairs, i, n, data;\n\n var consume = function(name, pattern) {\n url = url.replace(pattern, function(match) {\n uri[name] = match;\n return '';\n });\n uri[name] = uri[name] || '';\n };\n\n consume('protocol', /^[a-z]+\\:/i);\n consume('host', /^\\/\\/[^\\/\\?#]+/);\n\n if (!/^\\//.test(url) && !uri.host)\n url = location.pathname.replace(/[^\\/]*$/, '') + url;\n\n consume('pathname', /^[^\\?#]*/);\n consume('search', /^\\?[^#]*/);\n consume('hash', /^#.*/);\n\n uri.protocol = uri.protocol || location.protocol;\n\n if (uri.host) {\n uri.host = uri.host.substr(2);\n\n if (/@/.test(uri.host)) {\n uri.auth = uri.host.split('@')[0];\n uri.host = uri.host.split('@')[1];\n }\n parts = uri.host.match(/^\\[([^\\]]+)\\]|^[^:]+/);\n uri.hostname = parts[1] || parts[0];\n uri.port = (uri.host.match(/:(\\d+)$/) || [])[1] || '';\n } else {\n uri.host = location.host;\n uri.hostname = location.hostname;\n uri.port = location.port;\n }\n\n uri.pathname = uri.pathname || '/';\n uri.path = uri.pathname + uri.search;\n\n query = uri.search.replace(/^\\?/, '');\n pairs = query ? query.split('&') : [];\n data = {};\n\n for (i = 0, n = pairs.length; i < n; i++) {\n parts = pairs[i].split('=');\n data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');\n }\n\n uri.query = data;\n\n uri.href = this.stringify(uri);\n return uri;\n },\n\n stringify: function(uri) {\n var auth = uri.auth ? uri.auth + '@' : '',\n string = uri.protocol + '//' + auth + uri.host;\n\n string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');\n\n return string;\n },\n\n queryString: function(query) {\n var pairs = [];\n for (var key in query) {\n if (!query.hasOwnProperty(key)) continue;\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));\n }\n if (pairs.length === 0) return '';\n return '?' + pairs.join('&');\n }\n};\n","'use strict';\n\nvar array = require('./array');\n\nmodule.exports = function(options, validKeys) {\n for (var key in options) {\n if (array.indexOf(validKeys, key) < 0)\n throw new Error('Unrecognized option: ' + key);\n }\n};\n","'use strict';\n\nvar WS = global.MozWebSocket || global.WebSocket;\n\nmodule.exports = {\n create: function(url, protocols, options) {\n if (typeof WS !== 'function') return null;\n return new WS(url);\n }\n};\n"],"sourceRoot":""}
@@ -14,7 +14,7 @@ require 'time'
14
14
  require 'uri'
15
15
 
16
16
  module Faye
17
- VERSION = '1.3.0'
17
+ VERSION = '1.4.0'
18
18
 
19
19
  ROOT = File.expand_path(File.dirname(__FILE__))
20
20
 
@@ -21,7 +21,7 @@ module Faye
21
21
  def_delegators :@dispatcher, :add_websocket_extension, :disable, :set_header
22
22
 
23
23
  def initialize(endpoint = nil, options = {})
24
- ::WebSocket::Driver.validate_options(options, [:interval, :timeout, :endpoints, :proxy, :retry, :scheduler, :websocket_extensions])
24
+ ::WebSocket::Driver.validate_options(options, [:interval, :timeout, :endpoints, :proxy, :retry, :scheduler, :websocket_extensions, :tls])
25
25
  super()
26
26
  info('New client created for ?', endpoint)
27
27
 
@@ -16,7 +16,8 @@ module Faye
16
16
  def_delegators :@transport, :connection_type
17
17
 
18
18
  attr_accessor :client_id, :timeout
19
- attr_reader :cookies, :endpoint, :headers, :max_request_size, :proxy, :retry, :transports, :ws_extensions
19
+ attr_reader :endpoint, :tls, :headers, :cookies, :proxy, :retry
20
+ attr_reader :max_request_size, :transports, :ws_extensions
20
21
 
21
22
  def initialize(client, endpoint, options)
22
23
  super()
@@ -42,6 +43,8 @@ module Faye
42
43
  add_websocket_extension(extension)
43
44
  end
44
45
 
46
+ @tls = { :verify_peer => true }.merge(options[:tls] || {})
47
+
45
48
  @alternates.each do |type, url|
46
49
  @alternates[type] = URI(url)
47
50
  end
@@ -29,15 +29,15 @@ module Faye
29
29
  private
30
30
 
31
31
  def build_params(content)
32
+ headers = {
33
+ 'Content-Length' => content.bytesize,
34
+ 'Content-Type' => 'application/json',
35
+ 'Host' => @endpoint.host + (@endpoint.port ? ":#{ @endpoint.port }" : '')
36
+ }
37
+
32
38
  params = {
33
- :head => {
34
- 'Content-Length' => content.bytesize,
35
- 'Content-Type' => 'application/json',
36
- 'Host' => @endpoint.host + (@endpoint.port ? ":#{ @endpoint.port }" : '')
37
- }.merge(@dispatcher.headers),
38
-
39
- :body => content,
40
- :timeout => -1 # for em-http-request < 1.0
39
+ :head => headers.merge(@dispatcher.headers),
40
+ :body => content
41
41
  }
42
42
 
43
43
  cookie = get_cookies
@@ -47,10 +47,9 @@ module Faye
47
47
  end
48
48
 
49
49
  def create_request(params)
50
- version = EventMachine::HttpRequest::VERSION.split('.')[0].to_i
51
50
  options = {
52
51
  :inactivity_timeout => 0,
53
- :tls => { :sni_hostname => @endpoint.hostname }
52
+ :tls => @dispatcher.tls
54
53
  }
55
54
 
56
55
  if @proxy[:origin]
@@ -61,12 +60,7 @@ module Faye
61
60
  end
62
61
  end
63
62
 
64
- if version >= 1
65
- client = EventMachine::HttpRequest.new(@endpoint.to_s, options)
66
- else
67
- client = EventMachine::HttpRequest.new(@endpoint.to_s)
68
- end
69
-
63
+ client = EventMachine::HttpRequest.new(@endpoint.to_s, options)
70
64
  client.post(params)
71
65
  end
72
66
 
@@ -72,7 +72,7 @@ module Faye
72
72
  :extensions => extensions,
73
73
  :headers => headers,
74
74
  :proxy => @proxy,
75
- :tls => { :sni_hostname => url.hostname }
75
+ :tls => @dispatcher.tls
76
76
  }
77
77
 
78
78
  socket = Faye::WebSocket::Client.new(url.to_s, [], options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faye
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cookiejar
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.0
33
+ version: 1.1.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.0
40
+ version: 1.1.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: eventmachine
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.1
61
+ version: 0.11.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.1
68
+ version: 0.11.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: multi_json
71
71
  requirement: !ruby/object:Gem::Requirement