!function e(t,n,o){function i(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[a]={exports:{}};t[a][0].call(d.exports,function(e){var n=t[a][1][e];return i(n?n:e)},d,d.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;at+i.target.result.byteLength?window.setTimeout(o,n.config.pacing,t+n.config.chunksize):(n.emit("progress",e.size,e.size,null),n.emit("sentFile"))}}(e);var r=e.slice(t,t+n.config.chunksize);i.readAsArrayBuffer(r)};window.setTimeout(o,0,0)},a.inherits(i,r),i.prototype.receive=function(e,t){var n=this;e&&(this.metadata=e),this.channel=t,t.binaryType="arraybuffer",this.channel.onmessage=function(e){var t=e.data.byteLength;n.received+=t,n.receiveBuffer.push(e.data),n.emit("progress",n.received,n.metadata.size,e.data),n.received===n.metadata.size?(n.emit("receivedFile",new window.Blob(n.receiveBuffer),n.metadata),n.receiveBuffer=[]):n.received>n.metadata.size&&(console.error("received more than expected, discarding..."),n.receiveBuffer=[])}},t.exports={},t.exports.support="undefined"!=typeof window&&window&&window.File&&window.FileReader&&window.Blob,t.exports.Sender=o,t.exports.Receiver=i},{util:45,wildemitter:40}],3:[function(e,t,n){var o=e("getusermedia"),i={};t.exports=function(e,t){var n,r=2===arguments.length,a=r?t:e;if("undefined"==typeof window||"http:"===window.location.protocol)return n=new Error("NavigatorUserMediaError"),n.name="HTTPS_REQUIRED",a(n);if(window.navigator.userAgent.match("Chrome")){var s=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),c=33,u=!window.chrome.webstore;if(window.navigator.userAgent.match("Linux")&&(c=35),sessionStorage.getScreenMediaJSExtensionId)chrome.runtime.sendMessage(sessionStorage.getScreenMediaJSExtensionId,{type:"getScreen",id:1},null,function(t){if(t&&""!==t.sourceId)e=r&&e||{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}},e.video.mandatory.chromeMediaSourceId=t.sourceId,o(e,a);else{var n=new Error("NavigatorUserMediaError");n.name="PERMISSION_DENIED",a(n)}});else if(window.cefGetScreenMedia)window.cefGetScreenMedia(function(t){if(t)e=r&&e||{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}},e.video.mandatory.chromeMediaSourceId=t,o(e,a);else{var n=new Error("cefGetScreenMediaError");n.name="CEF_GETSCREENMEDIA_CANCELED",a(n)}});else if(u||s>=26&&c>=s)e=r&&e||{video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3,chromeMediaSource:"screen"}}},o(e,a);else{var d=window.setTimeout(function(){return n=new Error("NavigatorUserMediaError"),n.name="EXTENSION_UNAVAILABLE",a(n)},1e3);i[d]=[a,r?e:null],window.postMessage({type:"getScreen",id:d},"*")}}else if(window.navigator.userAgent.match("Firefox")){var p=parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1],10);p>=33?(e=r&&e||{video:{mozMediaSource:"window",mediaSource:"window"}},o(e,function(e,t){if(a(e,t),!e)var n=t.currentTime,o=window.setInterval(function(){t||window.clearInterval(o),t.currentTime==n&&(window.clearInterval(o),t.onended&&t.onended()),n=t.currentTime},500)})):(n=new Error("NavigatorUserMediaError"),n.name="EXTENSION_UNAVAILABLE")}},window.addEventListener("message",function(e){if(e.origin==window.location.origin)if("gotScreen"==e.data.type&&i[e.data.id]){var t=i[e.data.id],n=t[1],r=t[0];if(delete i[e.data.id],""===e.data.sourceId){var a=new Error("NavigatorUserMediaError");a.name="PERMISSION_DENIED",r(a)}else n=n||{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}},n.video.mandatory.chromeMediaSourceId=e.data.sourceId,o(n,r)}else"getScreenPending"==e.data.type&&window.clearTimeout(e.data.id)})},{getusermedia:4}],4:[function(e,t,n){e("webrtc-adapter-test");t.exports=function(e,t){var n,o=2===arguments.length,i={video:!0,audio:!0},r="PermissionDeniedError",a="PERMISSION_DENIED",s="ConstraintNotSatisfiedError";return o||(t=e,e=i),navigator.getUserMedia?e.audio||e.video?(localStorage&&"true"===localStorage.useFirefoxFakeDevice&&(e.fake=!0),void navigator.getUserMedia(e,function(e){t(null,e)},function(e){var n;"string"==typeof e?(n=new Error("MediaStreamError"),e===r||e===a?n.name=r:n.name=s):(n=e,n.name||(n[r]?e.name=r:e.name=s)),t(n)})):(n=new Error("MediaStreamError"),n.name="NoMediaRequestedError",window.setTimeout(function(){t(n)},0)):(n=new Error("MediaStreamError"),n.name="NotSupportedError",window.setTimeout(function(){t(n)},0))}},{"webrtc-adapter-test":38}],5:[function(e,t,n){function o(e,t){var n=-(1/0);e.getFloatFrequencyData(t);for(var o=4,i=t.length;i>o;o++)t[o]>n&&t[o]<0&&(n=t[o]);return n}var i=e("wildemitter"),r=window.AudioContext||window.webkitAudioContext,a=null;t.exports=function(e,t){var n=new i;if(!r)return n;var t=t||{},s=t.smoothing||.1,c=t.interval||50,u=t.threshold,d=t.play,p=t.history||10,l=!0;a||(a=new r);var f,h,m;m=a.createAnalyser(),m.fftSize=512,m.smoothingTimeConstant=s,h=new Float32Array(m.fftSize),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(f=a.createMediaElementSource(e),"undefined"==typeof d&&(d=!0),u=u||-50):(f=a.createMediaStreamSource(e),u=u||-50),f.connect(m),d&&m.connect(a.destination),n.speaking=!1,n.setThreshold=function(e){u=e},n.setInterval=function(e){c=e},n.stop=function(){l=!1,n.emit("volume_change",-100,u),n.speaking&&(n.speaking=!1,n.emit("stopped_speaking"))},n.speakingHistory=[];for(var g=0;p>g;g++)n.speakingHistory.push(0);var v=function(){setTimeout(function(){if(l){var e=o(m,h);n.emit("volume_change",e,u);var t=0;if(e>u&&!n.speaking){for(var i=n.speakingHistory.length-3;i=2&&(n.speaking=!0,n.emit("speaking"))}else if(u>e&&n.speaking){for(var i=0;iu)),v()}},c)};return v(),n}},{wildemitter:40}],6:[function(e,t,n){function o(e){u.call(this);var t,n=this.config={autoAdjustMic:!1,detectSpeakingEvents:!0,audioFallback:!1,media:{audio:!0,video:!0},logger:p};for(t in e)this.config[t]=e[t];this.logger=n.logger,this._log=this.logger.log.bind(this.logger,"LocalMedia:"),this._logerror=this.logger.error.bind(this.logger,"LocalMedia:"),this.screenSharingSupport=a.screenSharing,this.localStreams=[],this.localScreens=[],a.support||this._logerror("Your browser does not support local media capture.")}var i=e("util"),r=e("hark"),a=e("webrtcsupport"),s=e("getusermedia"),c=e("getscreenmedia"),u=e("wildemitter"),d=e("mediastream-gain"),p=e("mockconsole");i.inherits(o,u),o.prototype.start=function(e,t){var n=this,o=e||this.config.media;s(o,function(e,i){if(e){if(n.config.audioFallback&&"DevicesNotFoundError"===e.name&&o.video!==!1)return o.video=!1,void n.start(o,t)}else o.audio&&n.config.detectSpeakingEvents&&n.setupAudioMonitor(i,n.config.harkOptions),n.localStreams.push(i),n.config.autoAdjustMic&&(n.gainController=new d(i),n.setMicIfEnabled(.5)),i.onended=function(){},n.emit("localStream",i);return t?t(e,i):void 0})},o.prototype.stop=function(e){var t=this;if(e){e.getTracks().forEach(function(e){e.stop()});var n=t.localStreams.indexOf(e);n>-1?(t.emit("localStreamStopped",e),t.localStreams=t.localStreams.splice(n,1)):(n=t.localScreens.indexOf(e),n>-1&&(t.emit("localScreenStopped",e),t.localScreens=t.localScreens.splice(n,1)))}else this.stopStreams(),this.stopScreenShare()},o.prototype.stopStreams=function(){var e=this;this.audioMonitor&&(this.audioMonitor.stop(),delete this.audioMonitor),this.localStreams.forEach(function(t){t.getTracks().forEach(function(e){e.stop()}),e.emit("localStreamStopped",t)}),this.localStreams=[]},o.prototype.startScreenShare=function(e){var t=this;c(function(n,o){return n||(t.localScreens.push(o),o.onended=function(){var e=t.localScreens.indexOf(o);e>-1&&t.localScreens.splice(e,1),t.emit("localScreenStopped",o)},t.emit("localScreen",o)),e?e(n,o):void 0})},o.prototype.stopScreenShare=function(e){var t=this;e?(e.getTracks().forEach(function(e){e.stop()}),this.emit("localScreenStopped",e)):(this.localScreens.forEach(function(e){e.getTracks().forEach(function(e){e.stop()}),t.emit("localScreenStopped",e)}),this.localScreens=[])},o.prototype.mute=function(){this._audioEnabled(!1),this.hardMuted=!0,this.emit("audioOff")},o.prototype.unmute=function(){this._audioEnabled(!0),this.hardMuted=!1,this.emit("audioOn")},o.prototype.setupAudioMonitor=function(e,t){this._log("Setup audio");var n,o=this.audioMonitor=r(e,t),i=this;o.on("speaking",function(){i.emit("speaking"),i.hardMuted||i.setMicIfEnabled(1)}),o.on("stopped_speaking",function(){n&&clearTimeout(n),n=setTimeout(function(){i.emit("stoppedSpeaking"),i.hardMuted||i.setMicIfEnabled(.5)},1e3)}),o.on("volume_change",function(e,t){i.emit("volumeChange",e,t)})},o.prototype.setMicIfEnabled=function(e){this.config.autoAdjustMic&&this.gainController.setGain(e)},o.prototype.pauseVideo=function(){this._videoEnabled(!1),this.emit("videoOff")},o.prototype.resumeVideo=function(){this._videoEnabled(!0),this.emit("videoOn")},o.prototype.pause=function(){this.mute(),this.pauseVideo()},o.prototype.resume=function(){this.unmute(),this.resumeVideo()},o.prototype._audioEnabled=function(e){this.setMicIfEnabled(e?1:0),this.localStreams.forEach(function(t){t.getAudioTracks().forEach(function(t){t.enabled=!!e})})},o.prototype._videoEnabled=function(e){this.localStreams.forEach(function(t){t.getVideoTracks().forEach(function(t){t.enabled=!!e})})},o.prototype.isAudioEnabled=function(){var e=!0;return this.localStreams.forEach(function(t){t.getAudioTracks().forEach(function(t){e=e&&t.enabled})}),e},o.prototype.isVideoEnabled=function(){var e=!0;return this.localStreams.forEach(function(t){t.getVideoTracks().forEach(function(t){e=e&&t.enabled})}),e},o.prototype.startLocalMedia=o.prototype.start,o.prototype.stopLocalMedia=o.prototype.stop,Object.defineProperty(o.prototype,"localStream",{get:function(){return this.localStreams.length>0?this.localStreams[0]:null}}),Object.defineProperty(o.prototype,"localScreen",{get:function(){return this.localScreens.length>0?this.localScreens[0]:null}}),t.exports=o},{getscreenmedia:3,getusermedia:4,hark:5,"mediastream-gain":24,mockconsole:25,util:45,webrtcsupport:39,wildemitter:40}],7:[function(e,t,n){function o(e,t){for(var n=-1,o=e.length;++no;)e=e[t[o++]];return o&&o==i?e:void 0}}function a(e,t,n){var o=t.length,i=o,r=!n;if(null==e)return!i;for(e=m(e);o--;){var a=t[o];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++ot&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(i);++o-1&&e%1==0&&p>=e}function c(e){return u(e)?e:Object(e)}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var d=e("lodash.keys"),p=9007199254740991,l=r(o),f=a(),h=i("length");t.exports=l},{"lodash.keys":20}],11:[function(e,t,n){function o(e,t,n){if(null!=e){void 0!==n&&n in i(e)&&(t=[n]);for(var o=0,r=t.length;null!=e&&r>o;)e=e[t[o++]];return o&&o==r?e:void 0}}function i(e){return r(e)?e:Object(e)}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=o},{}],12:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e,t){for(var n=-1,o=e.length;++nu))return!1;for(;++c-1&&e%1==0&&p>=e}function s(e){return o(e)&&r(e)&&u.call(e,"callee")&&!d.call(e,"callee")}var c=Object.prototype,u=c.hasOwnProperty,d=c.propertyIsEnumerable,p=9007199254740991,l=i("length");t.exports=s},{}],18:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e,t){var n=null==e?void 0:e[t];return c(n)?n:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&y>=e}function a(e){return s(e)&&m.call(e)==d}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function c(e){return null==e?!1:a(e)?g.test(f.call(e)):o(e)&&p.test(e)}var u="[object Array]",d="[object Function]",p=/^\[object .+?Constructor\]$/,l=Object.prototype,f=Function.prototype.toString,h=l.hasOwnProperty,m=l.toString,g=RegExp("^"+f.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),y=9007199254740991,b=v||function(e){return o(e)&&r(e.length)&&m.call(e)==u};t.exports=b},{}],19:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&M>=e}function r(e){return o(e)&&i(e.length)&&!!_[A.call(e)]}var a="[object Arguments]",s="[object Array]",c="[object Boolean]",u="[object Date]",d="[object Error]",p="[object Function]",l="[object Map]",f="[object Number]",h="[object Object]",m="[object RegExp]",g="[object Set]",v="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",w="[object Float32Array]",S="[object Float64Array]",k="[object Int8Array]",C="[object Int16Array]",E="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",x="[object Uint16Array]",j="[object Uint32Array]",_={};_[w]=_[S]=_[k]=_[C]=_[E]=_[O]=_[T]=_[x]=_[j]=!0,_[a]=_[s]=_[b]=_[c]=_[u]=_[d]=_[p]=_[l]=_[f]=_[h]=_[m]=_[g]=_[v]=_[y]=!1;var D=Object.prototype,A=D.toString,M=9007199254740991;t.exports=r},{}],20:[function(e,t,n){function o(e){return function(t){return null==t?void 0:t[e]}}function i(e){return null!=e&&a(y(e))}function r(e,t){return e="number"==typeof e||f.test(e)?+e:-1,t=null==t?v:t,e>-1&&e%1==0&&t>e}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&v>=e}function s(e){for(var t=u(e),n=t.length,o=n&&e.length,i=!!o&&a(o)&&(l(e)||p(e)),s=-1,c=[];++s0;++o-1&&e%1==0&&l>=e}function s(e,t,n){var i=p(e)?c:o;return t=u(t,n,3),i(e,t)}var c=e("lodash._arraymap"),u=e("lodash._basecallback"),d=e("lodash._baseeach"),p=e("lodash.isarray"),l=9007199254740991,f=i("length");t.exports=s},{"lodash._arraymap":8,"lodash._basecallback":9,"lodash._baseeach":10,"lodash.isarray":18}],22:[function(e,t,n){function o(e){return i(e)?e:Object(e)}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function r(e){e=o(e);for(var t=-1,n=a(e),i=n.length,r=Array(i);++t0&&(o.firefoxcandidatebuffer=[]))})),this.pc=new u(e,t),this.getLocalStreams=this.pc.getLocalStreams.bind(this.pc),this.getRemoteStreams=this.pc.getRemoteStreams.bind(this.pc),this.addStream=this.pc.addStream.bind(this.pc),this.removeStream=this.pc.removeStream.bind(this.pc),this.pc.on("*",function(){o.emit.apply(o,arguments)}),this.pc.onremovestream=this.emit.bind(this,"removeStream"),this.pc.onaddstream=this.emit.bind(this,"addStream"),this.pc.onnegotiationneeded=this.emit.bind(this,"negotiationNeeded"),this.pc.oniceconnectionstatechange=this.emit.bind(this,"iceConnectionStateChange"),this.pc.onsignalingstatechange=this.emit.bind(this,"signalingStateChange"),this.pc.onicecandidate=this._onIce.bind(this),this.pc.ondatachannel=this._onDataChannel.bind(this),this.localDescription={contents:[]},this.remoteDescription={contents:[]},this.config={debug:!1,ice:{},sid:"",isInitiator:!0,sdpSessionID:Date.now(),useJingle:!1};for(n in e)this.config[n]=e[n];this.config.debug&&this.on("*",function(){var t=e.logger||console;t.log("PeerConnection event:",arguments)}),this.hadLocalStunCandidate=!1,this.hadRemoteStunCandidate=!1,this.hadLocalRelayCandidate=!1,this.hadRemoteRelayCandidate=!1,this.hadLocalIPv6Candidate=!1,this.hadRemoteIPv6Candidate=!1,this._remoteDataChannels=[],this._localDataChannels=[],this._candidateBuffer=[]}var i=e("util"),r=e("lodash.foreach"),a=e("lodash.pluck"),s=e("sdp-jingle-json"),c=e("wildemitter"),u=e("traceablepeerconnection"),d=e("webrtc-adapter-test");i.inherits(o,c),Object.defineProperty(o.prototype,"signalingState",{get:function(){return this.pc.signalingState}}),Object.defineProperty(o.prototype,"iceConnectionState",{get:function(){return this.pc.iceConnectionState}}),o.prototype._role=function(){return this.isInitiator?"initiator":"responder"},o.prototype.addStream=function(e){this.localStream=e,this.pc.addStream(e)},o.prototype._checkLocalCandidate=function(e){var t=s.toCandidateJSON(e);"srflx"==t.type?this.hadLocalStunCandidate=!0:"relay"==t.type&&(this.hadLocalRelayCandidate=!0),-1!=t.ip.indexOf(":")&&(this.hadLocalIPv6Candidate=!0)},o.prototype._checkRemoteCandidate=function(e){var t=s.toCandidateJSON(e);"srflx"==t.type?this.hadRemoteStunCandidate=!0:"relay"==t.type&&(this.hadRemoteRelayCandidate=!0),-1!=t.ip.indexOf(":")&&(this.hadRemoteIPv6Candidate=!0)},o.prototype.processIce=function(e,t){t=t||function(){};var n=this;if("closed"===this.pc.signalingState)return t();if(e.contents||e.jingle&&e.jingle.contents){var o=a(this.remoteDescription.contents,"name"),i=e.contents||e.jingle.contents;i.forEach(function(e){var t=e.transport||{},i=t.candidates||[],r=o.indexOf(e.name),a=e.name;i.forEach(function(e){var t=s.toCandidateSDP(e)+"\r\n";n.pc.addIceCandidate(new RTCIceCandidate({candidate:t,sdpMLineIndex:r,sdpMid:a}),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(t)})})}else{if(e.candidate&&0!==e.candidate.candidate.indexOf("a=")&&(e.candidate.candidate="a="+e.candidate.candidate),this.wtFirefox&&null!==this.firefoxcandidatebuffer&&this.pc.localDescription&&"offer"===this.pc.localDescription.type)return this.firefoxcandidatebuffer.push(e.candidate),t();n.pc.addIceCandidate(new RTCIceCandidate(e.candidate),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(e.candidate.candidate)}t()},o.prototype.offer=function(e,t){var n=this,o=2===arguments.length,i=o&&e?e:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};return t=o?t:e,t=t||function(){},"closed"===this.pc.signalingState?t("Already closed"):void this.pc.createOffer(function(e){var o={type:"offer",sdp:e.sdp};n.assumeSetLocalSuccess&&(n.emit("offer",o),t(null,o)),n._candidateBuffer=[],n.pc.setLocalDescription(e,function(){var i;n.config.useJingle&&(i=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"}),i.sid=n.config.sid,n.localDescription=i,r(i.contents,function(e){var t=e.transport||{};t.ufrag&&(n.config.ice[e.name]={ufrag:t.ufrag,pwd:t.pwd})}),o.jingle=i),o.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkLocalCandidate(e)}),n.assumeSetLocalSuccess||(n.emit("offer",o),t(null,o))},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},i)},o.prototype.handleOffer=function(e,t){t=t||function(){};var n=this;if(e.type="offer",e.jingle){if(this.enableChromeNativeSimulcast&&e.jingle.contents.forEach(function(e){"video"===e.name&&(e.description.googConferenceFlag=!0)}),this.enableMultiStreamHacks&&e.jingle.contents.forEach(function(e){if("video"===e.name){var t=e.description.sources||[];(0===t.length||"3735928559"!==t[0].ssrc)&&(t.unshift({ssrc:"3735928559",parameters:[{key:"cname",value:"deadbeef"},{key:"msid",value:"mixyourfecintothis please"}]}),e.description.sources=t)}}),n.restrictBandwidth>0&&e.jingle.contents.length>=2&&"video"===e.jingle.contents[1].name){var o=e.jingle.contents[1],i=o.description&&o.description.bandwidth;i||(e.jingle.contents[1].description.bandwidth={type:"AS",bandwidth:n.restrictBandwidth.toString()},e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"outgoing"}))}e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"incoming"}),n.remoteDescription=e.jingle}e.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkRemoteCandidate(e)}),n.pc.setRemoteDescription(new RTCSessionDescription(e),function(){t()},t)},o.prototype.answerAudioOnly=function(e){var t={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!1}};this._answer(t,e)},o.prototype.answerBroadcastOnly=function(e){var t={mandatory:{ OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}};this._answer(t,e)},o.prototype.answer=function(e,t){var n=2===arguments.length,o=n?t:e,i=n&&e?e:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};this._answer(i,o)},o.prototype.handleAnswer=function(e,t){t=t||function(){};var n=this;e.jingle&&(e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"incoming"}),n.remoteDescription=e.jingle),e.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkRemoteCandidate(e)}),n.pc.setRemoteDescription(new RTCSessionDescription(e),function(){n.wtFirefox&&window.setTimeout(function(){n.firefoxcandidatebuffer.forEach(function(e){n.pc.addIceCandidate(new RTCIceCandidate(e),function(){},function(e){n.emit("error",e)}),n._checkRemoteCandidate(e.candidate)}),n.firefoxcandidatebuffer=null},n.wtFirefox),t(null)},t)},o.prototype.close=function(){this.pc.close(),this._localDataChannels=[],this._remoteDataChannels=[],this.emit("close")},o.prototype._answer=function(e,t){t=t||function(){};var n=this;if(!this.pc.remoteDescription)throw new Error("remoteDescription not set");return"closed"===this.pc.signalingState?t("Already closed"):void n.pc.createAnswer(function(e){var o=[];if(n.enableChromeNativeSimulcast&&(e.jingle=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"}),e.jingle.contents.length>=2&&"video"===e.jingle.contents[1].name)){var i=e.jingle.contents[1].description.sourceGroups||[],r=!1;if(i.forEach(function(e){"SIM"==e.semantics&&(r=!0)}),!r&&e.jingle.contents[1].description.sources.length){var a=JSON.parse(JSON.stringify(e.jingle.contents[1].description.sources[0]));a.ssrc=""+Math.floor(4294967295*Math.random()),e.jingle.contents[1].description.sources.push(a),o.push(e.jingle.contents[1].description.sources[0].ssrc),o.push(a.ssrc),i.push({semantics:"SIM",sources:o});var c=JSON.parse(JSON.stringify(a));c.ssrc=""+Math.floor(4294967295*Math.random()),e.jingle.contents[1].description.sources.push(c),i.push({semantics:"FID",sources:[a.ssrc,c.ssrc]}),e.jingle.contents[1].description.sourceGroups=i,e.sdp=s.toSessionSDP(e.jingle,{sid:n.config.sdpSessionID,role:n._role(),direction:"outgoing"})}}var u={type:"answer",sdp:e.sdp};n.assumeSetLocalSuccess&&(n.emit("answer",u),t(null,u)),n._candidateBuffer=[],n.pc.setLocalDescription(e,function(){if(n.config.useJingle){var o=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"});o.sid=n.config.sid,n.localDescription=o,u.jingle=o}n.enableChromeNativeSimulcast&&(u.jingle||(u.jingle=s.toSessionJSON(e.sdp,{role:n._role(),direction:"outgoing"})),u.jingle.contents[1].description.sources.forEach(function(e,t){e.parameters=e.parameters.map(function(e){return"msid"===e.key&&(e.value+="-"+Math.floor(t/2)),e})}),u.sdp=s.toSessionSDP(u.jingle,{sid:n.sdpSessionID,role:n._role(),direction:"outgoing"})),u.sdp.split("\r\n").forEach(function(e){0===e.indexOf("a=candidate:")&&n._checkLocalCandidate(e)}),n.assumeSetLocalSuccess||(n.emit("answer",u),t(null,u))},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},e)},o.prototype._onIce=function(e){var t=this;if(e.candidate){if(this.dontSignalCandidates)return;var n=e.candidate,o={candidate:{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex}};this._checkLocalCandidate(n.candidate);var i,a,c=s.toCandidateJSON(n.candidate);if(this.eliminateDuplicateCandidates&&"relay"===c.type&&(i=this._candidateBuffer.filter(function(e){return"relay"===e.type}).map(function(e){return e.foundation+":"+e.component}),a=i.indexOf(c.foundation+":"+c.component),a>-1&&c.priority>>24>=i[a].priority>>24))return;if("max-bundle"===this.config.bundlePolicy&&(i=this._candidateBuffer.filter(function(e){return c.type===e.type}).map(function(e){return e.address+":"+e.port}),a=i.indexOf(c.address+":"+c.port),a>-1))return;if("require"===this.config.rtcpMuxPolicy&&"2"===c.component)return;if(this._candidateBuffer.push(c),t.config.useJingle){if(n.sdpMid||(t.pc.remoteDescription&&"offer"===t.pc.remoteDescription.type?n.sdpMid=t.remoteDescription.contents[n.sdpMLineIndex].name:n.sdpMid=t.localDescription.contents[n.sdpMLineIndex].name),!t.config.ice[n.sdpMid]){var u=s.toSessionJSON(t.pc.localDescription.sdp,{role:t._role(),direction:"outgoing"});r(u.contents,function(e){var n=e.transport||{};n.ufrag&&(t.config.ice[e.name]={ufrag:n.ufrag,pwd:n.pwd})})}if(o.jingle={contents:[{name:n.sdpMid,creator:t._role(),transport:{transType:"iceUdp",ufrag:t.config.ice[n.sdpMid].ufrag,pwd:t.config.ice[n.sdpMid].pwd,candidates:[c]}}]},t.batchIceCandidates>0)return 0===t.batchedIceCandidates.length&&window.setTimeout(function(){var e={};t.batchedIceCandidates.forEach(function(t){t=t.contents[0],e[t.name]||(e[t.name]=t),e[t.name].transport.candidates.push(t.transport.candidates[0])});var n={jingle:{contents:[]}};Object.keys(e).forEach(function(t){n.jingle.contents.push(e[t])}),t.batchedIceCandidates=[],t.emit("ice",n)},t.batchIceCandidates),void t.batchedIceCandidates.push(o.jingle)}this.emit("ice",o)}else this.emit("endOfCandidates")},o.prototype._onDataChannel=function(e){var t=e.channel;this._remoteDataChannels.push(t),this.emit("addChannel",t)},o.prototype.createDataChannel=function(e,t){var n=this.pc.createDataChannel(e,t);return this._localDataChannels.push(n),n},o.prototype.getStats=function(e){"firefox"===d.webrtcDetectedBrowser?this.pc.getStats(function(t){var n=[];for(var o in t)"object"==typeof t[o]&&n.push(t[o]);e(null,n)},e):this.pc.getStats(function(t){var n=[];t.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,n.push(t)}),e(null,n)})},t.exports=o},{"lodash.foreach":16,"lodash.pluck":23,"sdp-jingle-json":27,traceablepeerconnection:37,util:45,"webrtc-adapter-test":38,wildemitter:40}],27:[function(e,t,n){var o=e("./lib/tosdp"),i=e("./lib/tojson");n.toIncomingSDPOffer=function(e){return o.toSessionSDP(e,{role:"responder",direction:"incoming"})},n.toOutgoingSDPOffer=function(e){return o.toSessionSDP(e,{role:"initiator",direction:"outgoing"})},n.toIncomingSDPAnswer=function(e){return o.toSessionSDP(e,{role:"initiator",direction:"incoming"})},n.toOutgoingSDPAnswer=function(e){return o.toSessionSDP(e,{role:"responder",direction:"outgoing"})},n.toIncomingMediaSDPOffer=function(e){return o.toMediaSDP(e,{role:"responder",direction:"incoming"})},n.toOutgoingMediaSDPOffer=function(e){return o.toMediaSDP(e,{role:"initiator",direction:"outgoing"})},n.toIncomingMediaSDPAnswer=function(e){return o.toMediaSDP(e,{role:"initiator",direction:"incoming"})},n.toOutgoingMediaSDPAnswer=function(e){return o.toMediaSDP(e,{role:"responder",direction:"outgoing"})},n.toCandidateSDP=o.toCandidateSDP,n.toMediaSDP=o.toMediaSDP,n.toSessionSDP=o.toSessionSDP,n.toIncomingJSONOffer=function(e,t){return i.toSessionJSON(e,{role:"responder",direction:"incoming",creators:t})},n.toOutgoingJSONOffer=function(e,t){return i.toSessionJSON(e,{role:"initiator",direction:"outgoing",creators:t})},n.toIncomingJSONAnswer=function(e,t){return i.toSessionJSON(e,{role:"initiator",direction:"incoming",creators:t})},n.toOutgoingJSONAnswer=function(e,t){return i.toSessionJSON(e,{role:"responder",direction:"outgoing",creators:t})},n.toIncomingMediaJSONOffer=function(e,t){return i.toMediaJSON(e,{role:"responder",direction:"incoming",creator:t})},n.toOutgoingMediaJSONOffer=function(e,t){return i.toMediaJSON(e,{role:"initiator",direction:"outgoing",creator:t})},n.toIncomingMediaJSONAnswer=function(e,t){return i.toMediaJSON(e,{role:"initiator",direction:"incoming",creator:t})},n.toOutgoingMediaJSONAnswer=function(e,t){return i.toMediaJSON(e,{role:"responder",direction:"outgoing",creator:t})},n.toCandidateJSON=i.toCandidateJSON,n.toMediaJSON=i.toMediaJSON,n.toSessionJSON=i.toSessionJSON},{"./lib/tojson":30,"./lib/tosdp":31}],28:[function(e,t,n){n.lines=function(e){return e.split("\r\n").filter(function(e){return e.length>0})},n.findLine=function(e,t,n){for(var o=e.length,i=0;i=0?(n.id=o.substr(0,i),n.senders=o.substr(i+1)):(n.id=o,n.senders="sendrecv"),n.uri=t.shift()||"",n},n.rtcpfb=function(e){var t=e.substr(10).split(" "),n={};return n.id=t.shift(),n.type=t.shift(),"trr-int"===n.type?n.value=t.shift():n.subtype=t.shift()||"",n.parameters=t,n},n.candidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:t[3],ip:t[4],port:t[5],type:t[7],generation:"0"},o=8;o0||d.length>0?p.push("RTP/SAVPF"):p.push("RTP/AVPF"),u.forEach(function(e){p.push(e.id)})),i.push("m="+p.join(" ")),i.push("c=IN IP4 0.0.0.0"),s.bandwidth&&s.bandwidth.type&&s.bandwidth.bandwidth&&i.push("b="+s.bandwidth.type+":"+s.bandwidth.bandwidth),"rtp"==s.descType&&i.push("a=rtcp:1 IN IP4 0.0.0.0"),c){c.ufrag&&i.push("a=ice-ufrag:"+c.ufrag),c.pwd&&i.push("a=ice-pwd:"+c.pwd);var l=!1;d.forEach(function(e){i.push("a=fingerprint:"+e.hash+" "+e.value),e.setup&&!l&&i.push("a=setup:"+e.setup)}),c.sctp&&c.sctp.forEach(function(e){i.push("a=sctpmap:"+e.number+" "+e.protocol+" "+e.streams)})}"rtp"==s.descType&&i.push("a="+(o[r][a][e.senders]||"sendrecv")),i.push("a=mid:"+e.name),s.sources&&s.sources.length&&(s.sources[0].parameters||[]).forEach(function(e){"msid"===e.key&&i.push("a=msid:"+e.value)}),s.mux&&i.push("a=rtcp-mux");var f=s.encryption||[];f.forEach(function(e){i.push("a=crypto:"+e.tag+" "+e.cipherSuite+" "+e.keyParams+(e.sessionParams?" "+e.sessionParams:""))}),s.googConferenceFlag&&i.push("a=x-google-flag:conference"),u.forEach(function(e){var t="a=rtpmap:"+e.id+" "+e.name+"/"+e.clockrate;if(e.channels&&"1"!=e.channels&&(t+="/"+e.channels),i.push(t),e.parameters&&e.parameters.length){var n=["a=fmtp:"+e.id],o=[];e.parameters.forEach(function(e){o.push((e.key?e.key+"=":"")+e.value)}),n.push(o.join(";")),i.push(n.join(" "))}e.feedback&&e.feedback.forEach(function(t){"trr-int"===t.type?i.push("a=rtcp-fb:"+e.id+" trr-int "+(t.value?t.value:"0")):i.push("a=rtcp-fb:"+e.id+" "+t.type+(t.subtype?" "+t.subtype:""))})}),s.feedback&&s.feedback.forEach(function(e){"trr-int"===e.type?i.push("a=rtcp-fb:* trr-int "+(e.value?e.value:"0")):i.push("a=rtcp-fb:* "+e.type+(e.subtype?" "+e.subtype:""))});var h=s.headerExtensions||[];h.forEach(function(e){i.push("a=extmap:"+e.id+(e.senders?"/"+o[r][a][e.senders]:"")+" "+e.uri)});var m=s.sourceGroups||[];m.forEach(function(e){i.push("a=ssrc-group:"+e.semantics+" "+e.sources.join(" "))});var g=s.sources||[];g.forEach(function(e){for(var t=0;t1?a.path:"")}}("object"==typeof module?module.exports:this.io={},this),function(e,t){var n=e.util={},o=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.parseUri=function(e){for(var t=o.exec(e||""),n={},r=14;r--;)n[i[r]]=t[r]||"";return n},n.uniqueUri=function(e){var n=e.protocol,o=e.host,i=e.port;return"document"in t?(o=o||document.domain,i=i||("https"==n&&"https:"!==document.location.protocol?443:document.location.port)):(o=o||"localhost",i||"https"!=n||(i=443)),(n||"http")+"://"+o+":"+(i||80)},n.query=function(e,t){var o=n.chunkQuery(e||""),i=[];n.merge(o,n.chunkQuery(t||""));for(var r in o)o.hasOwnProperty(r)&&i.push(r+"="+o[r]);return i.length?"?"+i.join("&"):""},n.chunkQuery=function(e){for(var t,n={},o=e.split("&"),i=0,r=o.length;r>i;++i)t=o[i].split("="),t[0]&&(n[t[0]]=t[1]);return n};var r=!1;n.load=function(e){return"document"in t&&"complete"===document.readyState||r?e():void n.on(t,"load",e,!1)},n.on=function(e,t,n,o){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,o)},n.request=function(e){if(e&&"undefined"!=typeof XDomainRequest&&!n.ua.hasCORS)return new XDomainRequest;if("undefined"!=typeof XMLHttpRequest&&(!e||n.ua.hasCORS))return new XMLHttpRequest;if(!e)try{return new(window[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}return null},"undefined"!=typeof window&&n.load(function(){r=!0}),n.defer=function(e){return n.ua.webkit&&"undefined"==typeof importScripts?void n.load(function(){setTimeout(e,100)}):e()},n.merge=function(e,t,o,i){var r,a=i||[],s="undefined"==typeof o?2:o;for(r in t)t.hasOwnProperty(r)&&n.indexOf(a,r)<0&&("object"==typeof e[r]&&s?n.merge(e[r],t[r],s-1,a):(e[r]=t[r],a.push(t[r])));return e},n.mixin=function(e,t){n.merge(e.prototype,t.prototype)},n.inherit=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.intersect=function(e,t){for(var o=[],i=e.length>t.length?e:t,r=e.length>t.length?t:e,a=0,s=r.length;s>a;a++)~n.indexOf(i,r[a])&&o.push(r[a]);return o},n.indexOf=function(e,t,n){for(var o=e.length,n=0>n?0>n+o?0:n+o:n||0;o>n&&e[n]!==t;n++);return n>=o?-1:n},n.toArray=function(e){for(var t=[],n=0,o=e.length;o>n;n++)t.push(e[n]);return t},n.ua={},n.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(t){return!1}return void 0!=e.withCredentials}(),n.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),n.ua.iDevice="undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)}("undefined"!=typeof io?io:module.exports,this),function(e,t){function n(){}e.EventEmitter=n,n.prototype.on=function(e,n){return this.$events||(this.$events={}),this.$events[e]?t.util.isArray(this.$events[e])?this.$events[e].push(n):this.$events[e]=[this.$events[e],n]:this.$events[e]=n,this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){function n(){o.removeListener(e,n),t.apply(this,arguments)}var o=this;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,n){if(this.$events&&this.$events[e]){var o=this.$events[e];if(t.util.isArray(o)){for(var i=-1,r=0,a=o.length;a>r;r++)if(o[r]===n||o[r].listener&&o[r].listener===n){i=r;break}if(0>i)return this;o.splice(i,1),o.length||delete this.$events[e]}else(o===n||o.listener&&o.listener===n)&&delete this.$events[e]}return this},n.prototype.removeAllListeners=function(e){return void 0===e?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},n.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),t.util.isArray(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},n.prototype.emit=function(e){if(!this.$events)return!1;var n=this.$events[e];if(!n)return!1;var o=Array.prototype.slice.call(arguments,1);if("function"==typeof n)n.apply(this,o);else{if(!t.util.isArray(n))return!1;for(var i=n.slice(),r=0,a=i.length;a>r;r++)i[r].apply(this,o)}return!0}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(exports,nativeJSON){"use strict";function f(e){return 10>e?"0"+e:e}function date(e,t){return isFinite(e.valueOf())?e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"Z":null}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,o,i,r,a,s=gap,c=t[e];switch(c instanceof Date&&(c=date(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(r=c.length,n=0;r>n;n+=1)a[n]=str(n,c)||"null";return i=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(r=rep.length,n=0;r>n;n+=1)"string"==typeof rep[n]&&(o=rep[n],i=str(o,c),i&&a.push(quote(o)+(gap?": ":":")+i));else for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(i=str(o,c),i&&a.push(quote(o)+(gap?": ":":")+i));return i=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,i}}if(nativeJSON&&nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;JSON.stringify=function(e,t,n){var o;if(gap="",indent="","number"==typeof n)for(o=0;n>o;o+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})},JSON.parse=function(text,reviver){function walk(e,t){var n,o,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=walk(i,n),void 0!==o?i[n]=o:delete i[n]);return reviver.call(e,t,i)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof JSON?JSON:void 0),function(e,t){var n=e.parser={},o=n.packets=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],i=n.reasons=["transport not supported","client not handshaken","unauthorized"],r=n.advice=["reconnect"],a=t.JSON,s=t.util.indexOf;n.encodePacket=function(e){var t=s(o,e.type),n=e.id||"",c=e.endpoint||"",u=e.ack,d=null;switch(e.type){case"error":var p=e.reason?s(i,e.reason):"",l=e.advice?s(r,e.advice):"";(""!==p||""!==l)&&(d=p+(""!==l?"+"+l:""));break;case"message":""!==e.data&&(d=e.data);break;case"event":var f={name:e.name};e.args&&e.args.length&&(f.args=e.args),d=a.stringify(f);break;case"json":d=a.stringify(e.data);break;case"connect":e.qs&&(d=e.qs);break;case"ack":d=e.ackId+(e.args&&e.args.length?"+"+a.stringify(e.args):"")}var h=[t,n+("data"==u?"+":""),c];return null!==d&&void 0!==d&&h.push(d),h.join(":")},n.encodePayload=function(e){var t="";if(1==e.length)return e[0];for(var n=0,o=e.length;o>n;n++){var i=e[n];t+="�"+i.length+"�"+e[n]}return t};var c=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;n.decodePacket=function(e){var t=e.match(c);if(!t)return{};var n=t[2]||"",e=t[5]||"",s={type:o[t[1]],endpoint:t[4]||""};switch(n&&(s.id=n,t[3]?s.ack="data":s.ack=!0),s.type){case"error":var t=e.split("+");s.reason=i[t[0]]||"",s.advice=r[t[1]]||"";break;case"message":s.data=e||"";break;case"event":try{var u=a.parse(e);s.name=u.name,s.args=u.args}catch(d){}s.args=s.args||[];break;case"json":try{s.data=a.parse(e)}catch(d){}break;case"connect":s.qs=e||"";break;case"ack":var t=e.match(/^([0-9]+)(\+)?(.*)/);if(t&&(s.ackId=t[1],s.args=[],t[3]))try{s.args=t[3]?a.parse(t[3]):[]}catch(d){}break;case"disconnect":case"heartbeat":}return s},n.decodePayload=function(e){if("�"==e.charAt(0)){for(var t=[],o=1,i="";oo;o++)this.onPacket(n[o])}return this},n.prototype.onPacket=function(e){return this.socket.setHeartbeatTimeout(),"heartbeat"==e.type?this.onHeartbeat():("connect"==e.type&&""==e.endpoint&&this.onConnect(),"error"==e.type&&"reconnect"==e.advice&&(this.isOpen=!1),this.socket.onPacket(e),this)},n.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var e=this;this.closeTimeout=setTimeout(function(){e.onDisconnect()},this.socket.closeTimeout)}},n.prototype.onDisconnect=function(){return this.isOpen&&this.close(),this.clearTimeouts(),this.socket.onDisconnect(),this},n.prototype.onConnect=function(){return this.socket.onConnect(),this},n.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},n.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&&clearTimeout(this.reopenTimeout)},n.prototype.packet=function(e){this.send(t.parser.encodePacket(e))},n.prototype.onHeartbeat=function(e){this.packet({type:"heartbeat"})},n.prototype.onOpen=function(){this.isOpen=!0,this.clearCloseTimeout(),this.socket.onOpen()},n.prototype.onClose=function(){this.isOpen=!1,this.socket.onClose(),this.onDisconnect()},n.prototype.prepareUrl=function(){var e=this.socket.options;return this.scheme()+"://"+e.host+":"+e.port+"/"+e.resource+"/"+t.protocol+"/"+this.name+"/"+this.sessid},n.prototype.ready=function(e,t){t.call(this)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(e){if(this.options={port:80,secure:!1,document:"document"in n?document:!1,resource:"socket.io",transports:t.transports,"connect timeout":1e4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reconnection limit":1/0,"reopen delay":3e3,"max reconnection attempts":10,"sync disconnect on unload":!1,"auto connect":!0,"flash policy port":10843,manualFlush:!1},t.util.merge(this.options,e),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1,this.namespaces={},this.buffer=[],this.doBuffer=!1,this.options["sync disconnect on unload"]&&(!this.isXDomain()||t.util.ua.hasCORS)){var o=this;t.util.on(n,"beforeunload",function(){o.disconnectSync()},!1)}this.options["auto connect"]&&this.connect()}function i(){}e.Socket=o,t.util.mixin(o,t.EventEmitter),o.prototype.of=function(e){return this.namespaces[e]||(this.namespaces[e]=new t.SocketNamespace(this,e),""!==e&&this.namespaces[e].packet({type:"connect"})),this.namespaces[e]},o.prototype.publish=function(){this.emit.apply(this,arguments);var e;for(var t in this.namespaces)this.namespaces.hasOwnProperty(t)&&(e=this.of(t),e.$emit.apply(e,arguments))},o.prototype.handshake=function(e){function n(t){t instanceof Error?(o.connecting=!1,o.onError(t.message)):e.apply(null,t.split(":"))}var o=this,r=this.options,a=["http"+(r.secure?"s":"")+":/",r.host+":"+r.port,r.resource,t.protocol,t.util.query(this.options.query,"t="+ +new Date)].join("/");if(this.isXDomain()&&!t.util.ua.hasCORS){var s=document.getElementsByTagName("script")[0],c=document.createElement("script");c.src=a+"&jsonp="+t.j.length,s.parentNode.insertBefore(c,s),t.j.push(function(e){n(e),c.parentNode.removeChild(c)})}else{var u=t.util.request();u.open("GET",a,!0),this.isXDomain()&&(u.withCredentials=!0),u.onreadystatechange=function(){4==u.readyState&&(u.onreadystatechange=i,200==u.status?n(u.responseText):403==u.status?o.onError(u.responseText):(o.connecting=!1,!o.reconnecting&&o.onError(u.responseText)))},u.send(null)}},o.prototype.getTransport=function(e){for(var n,o=e||this.transports,i=0;n=o[i];i++)if(t.Transport[n]&&t.Transport[n].check(this)&&(!this.isXDomain()||t.Transport[n].xdomainCheck(this)))return new t.Transport[n](this,this.sessionid);return null},o.prototype.connect=function(e){if(this.connecting)return this;var n=this;return n.connecting=!0,this.handshake(function(o,i,r,a){function s(e){return n.transport&&n.transport.clearTimeouts(),n.transport=n.getTransport(e),n.transport?void n.transport.ready(n,function(){n.connecting=!0,n.publish("connecting",n.transport.name),n.transport.open(),n.options["connect timeout"]&&(n.connectTimeoutTimer=setTimeout(function(){if(!n.connected&&(n.connecting=!1,n.options["try multiple transports"])){for(var e=n.transports;e.length>0&&e.splice(0,1)[0]!=n.transport.name;);e.length?s(e):n.publish("connect_failed")}},n.options["connect timeout"]))}):n.publish("connect_failed")}n.sessionid=o,n.closeTimeout=1e3*r,n.heartbeatTimeout=1e3*i,n.transports||(n.transports=n.origTransports=a?t.util.intersect(a.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),s(n.transports),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),e&&"function"==typeof e&&e()})}),this},o.prototype.setHeartbeatTimeout=function(){if(clearTimeout(this.heartbeatTimeoutTimer),!this.transport||this.transport.heartbeats()){var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport.onClose()},this.heartbeatTimeout)}},o.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},o.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},o.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},o.prototype.disconnect=function(){return(this.connected||this.connecting)&&(this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted")),this},o.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},o.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},o.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},o.prototype.onOpen=function(){this.open=!0},o.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},o.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},o.prototype.onError=function(e){e&&e.advice&&"reconnect"===e.advice&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},o.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1,(t||n)&&(this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect()))},o.prototype.reconnect=function(){function e(){if(n.connected){for(var e in n.namespaces)n.namespaces.hasOwnProperty(e)&&""!==e&&n.namespaces[e].packet({type:"connect"});n.publish("reconnect",n.transport.name,n.reconnectionAttempts)}clearTimeout(n.reconnectionTimer),n.removeListener("connect_failed",t),n.removeListener("connect",t),n.reconnecting=!1,delete n.reconnectionAttempts,delete n.reconnectionDelay,delete n.reconnectionTimer,delete n.redoTransports,n.options["try multiple transports"]=i}function t(){return n.reconnecting?n.connected?e():n.connecting&&n.reconnecting?n.reconnectionTimer=setTimeout(t,1e3):void(n.reconnectionAttempts++>=o?n.redoTransports?(n.publish("reconnect_failed"),e()):(n.on("connect_failed",t),n.options["try multiple transports"]=!0,n.transports=n.origTransports,n.transport=n.getTransport(),n.redoTransports=!0,n.connect()):(n.reconnectionDelayt;t++)this.packet(e[t]);return this},o.prototype.close=function(){return this.websocket.close(),this},o.prototype.onError=function(e){this.socket.onError(e)},o.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"},o.check=function(){return"WebSocket"in n&&!("__addTask"in WebSocket)||"MozWebSocket"in n},o.xdomainCheck=function(){return!0},t.transports.push("websocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(){t.Transport.websocket.apply(this,arguments)}e.flashsocket=n,t.util.inherit(n,t.Transport.websocket),n.prototype.name="flashsocket",n.prototype.open=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.open.apply(e,n)}),this},n.prototype.send=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.send.apply(e,n)}),this},n.prototype.close=function(){return WebSocket.__tasks.length=0,t.Transport.websocket.prototype.close.call(this),this},n.prototype.ready=function(e,o){function i(){var t=e.options,i=t["flash policy port"],a=["http"+(t.secure?"s":"")+":/",t.host+":"+t.port,t.resource,"static/flashsocket","WebSocketMain"+(e.isXDomain()?"Insecure":"")+".swf"];n.loaded||("undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=a.join("/")),843!==i&&WebSocket.loadFlashPolicyFile("xmlsocket://"+t.host+":"+i),WebSocket.__initialize(),n.loaded=!0),o.call(r)}var r=this;return document.body?i():void t.util.load(i)},n.check=function(){return"undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject?swfobject.getFlashPlayerVersion().major>=10:!1},n.xdomainCheck=function(){return!0},"undefined"!=typeof window&&(WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),t.transports.push("flashsocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),"undefined"!=typeof window)var swfobject=function(){function e(){if(!V){try{var e=N.getElementsByTagName("body")[0].appendChild(g("span"));e.parentNode.removeChild(e)}catch(t){return}V=!0;for(var n=W.length,o=0;n>o;o++)W[o]()}}function t(e){V?e():W[W.length]=e}function n(e){if(typeof P.addEventListener!=j)P.addEventListener("load",e,!1);else if(typeof N.addEventListener!=j)N.addEventListener("load",e,!1);else if(typeof P.attachEvent!=j)v(P,"onload",e);else if("function"==typeof P.onload){var t=P.onload;P.onload=function(){t(),e()}}else P.onload=e}function o(){F?i():r()}function i(){var e=N.getElementsByTagName("body")[0],t=g(_);t.setAttribute("type",M);var n=e.appendChild(t);if(n){var o=0;!function(){if(typeof n.GetVariable!=j){var i=n.GetVariable("$version");i&&(i=i.split(" ")[1].split(","),q.pv=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)])}else if(10>o)return o++,void setTimeout(arguments.callee,10);e.removeChild(t),n=null,r()}()}else r()}function r(){var e=B.length;if(e>0)for(var t=0;e>t;t++){var n=B[t].id,o=B[t].callbackFn,i={success:!1,id:n};if(q.pv[0]>0){var r=m(n);if(r)if(!y(B[t].swfVersion)||q.wk&&q.wk<312)if(B[t].expressInstall&&s()){var d={};d.data=B[t].expressInstall,d.width=r.getAttribute("width")||"0",d.height=r.getAttribute("height")||"0",r.getAttribute("class")&&(d.styleclass=r.getAttribute("class")),r.getAttribute("align")&&(d.align=r.getAttribute("align"));for(var p={},l=r.getElementsByTagName("param"),f=l.length,h=0;f>h;h++)"movie"!=l[h].getAttribute("name").toLowerCase()&&(p[l[h].getAttribute("name")]=l[h].getAttribute("value"));c(d,p,n,o)}else u(r),o&&o(i);else w(n,!0),o&&(i.success=!0,i.ref=a(n),o(i))}else if(w(n,!0),o){var g=a(n);g&&typeof g.SetVariable!=j&&(i.success=!0,i.ref=g),o(i)}}}function a(e){var t=null,n=m(e);if(n&&"OBJECT"==n.nodeName)if(typeof n.SetVariable!=j)t=n;else{var o=n.getElementsByTagName(_)[0];o&&(t=o)}return t}function s(){return!$&&y("6.0.65")&&(q.win||q.mac)&&!(q.wk&&q.wk<312)}function c(e,t,n,o){$=!0,E=o||null,O={success:!1,id:n};var i=m(n);if(i){"OBJECT"==i.nodeName?(k=d(i),C=null):(k=i,C=n),e.id=I,(typeof e.width==j||!/%$/.test(e.width)&&parseInt(e.width,10)<310)&&(e.width="310"),(typeof e.height==j||!/%$/.test(e.height)&&parseInt(e.height,10)<137)&&(e.height="137"),N.title=N.title.slice(0,47)+" - Flash Player Installation";var r=q.ie&&q.win?["Active"].concat("").join("X"):"PlugIn",a="MMredirectURL="+P.location.toString().replace(/&/g,"%26")+"&MMplayerType="+r+"&MMdoctitle="+N.title;if(typeof t.flashvars!=j?t.flashvars+="&"+a:t.flashvars=a,q.ie&&q.win&&4!=i.readyState){var s=g("div");n+="SWFObjectNew",s.setAttribute("id",n),i.parentNode.insertBefore(s,i),i.style.display="none",function(){4==i.readyState?i.parentNode.removeChild(i):setTimeout(arguments.callee,10)}()}p(e,t,n)}}function u(e){if(q.ie&&q.win&&4!=e.readyState){var t=g("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(d(e),t),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(d(e),e)}function d(e){var t=g("div");if(q.win&&q.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(_)[0];if(n){var o=n.childNodes;if(o)for(var i=o.length,r=0;i>r;r++)1==o[r].nodeType&&"PARAM"==o[r].nodeName||8==o[r].nodeType||t.appendChild(o[r].cloneNode(!0))}}return t}function p(e,t,n){var o,i=m(n);if(q.wk&&q.wk<312)return o;if(i)if(typeof e.id==j&&(e.id=n),q.ie&&q.win){var r="";for(var a in e)e[a]!=Object.prototype[a]&&("data"==a.toLowerCase()?t.movie=e[a]:"styleclass"==a.toLowerCase()?r+=' class="'+e[a]+'"':"classid"!=a.toLowerCase()&&(r+=" "+a+'="'+e[a]+'"'));var s="";for(var c in t)t[c]!=Object.prototype[c]&&(s+='');i.outerHTML='"+s+"",U[U.length]=e.id,o=m(e.id)}else{var u=g(_);u.setAttribute("type",M);for(var d in e)e[d]!=Object.prototype[d]&&("styleclass"==d.toLowerCase()?u.setAttribute("class",e[d]):"classid"!=d.toLowerCase()&&u.setAttribute(d,e[d]));for(var p in t)t[p]!=Object.prototype[p]&&"movie"!=p.toLowerCase()&&l(u,p,t[p]);i.parentNode.replaceChild(u,i),o=u}return o}function l(e,t,n){var o=g("param");o.setAttribute("name",t),o.setAttribute("value",n),e.appendChild(o)}function f(e){var t=m(e);t&&"OBJECT"==t.nodeName&&(q.ie&&q.win?(t.style.display="none",function(){4==t.readyState?h(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function h(e){var t=m(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function m(e){var t=null;try{t=N.getElementById(e)}catch(n){}return t}function g(e){return N.createElement(e)}function v(e,t,n){e.attachEvent(t,n),J[J.length]=[e,t,n]}function y(e){var t=q.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]?!0:!1}function b(e,t,n,o){if(!q.ie||!q.mac){var i=N.getElementsByTagName("head")[0];if(i){var r=n&&"string"==typeof n?n:"screen";if(o&&(T=null,x=null),!T||x!=r){var a=g("style");a.setAttribute("type","text/css"),a.setAttribute("media",r),T=i.appendChild(a),q.ie&&q.win&&typeof N.styleSheets!=j&&N.styleSheets.length>0&&(T=N.styleSheets[N.styleSheets.length-1]),x=r}q.ie&&q.win?T&&typeof T.addRule==_&&T.addRule(e,t):T&&typeof N.createTextNode!=j&&T.appendChild(N.createTextNode(e+" {"+t+"}"))}}}function w(e,t){if(z){var n=t?"visible":"hidden";V&&m(e)?m(e).style.visibility=n:b("#"+e,"visibility:"+n)}}function S(e){var t=/[\\\"<>\.;]/,n=null!=t.exec(e);return n&&typeof encodeURIComponent!=j?encodeURIComponent(e):e}var k,C,E,O,T,x,j="undefined",_="object",D="Shockwave Flash",A="ShockwaveFlash.ShockwaveFlash",M="application/x-shockwave-flash",I="SWFObjectExprInst",R="onreadystatechange",P=window,N=document,L=navigator,F=!1,W=[o],B=[],U=[],J=[],V=!1,$=!1,z=!0,q=function(){var e=typeof N.getElementById!=j&&typeof N.getElementsByTagName!=j&&typeof N.createElement!=j,t=L.userAgent.toLowerCase(),n=L.platform.toLowerCase(),o=n?/win/.test(n):/win/.test(t),i=n?/mac/.test(n):/mac/.test(t),r=/webkit/.test(t)?parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,a=!1,s=[0,0,0],c=null;if(typeof L.plugins!=j&&typeof L.plugins[D]==_)c=L.plugins[D].description,!c||typeof L.mimeTypes!=j&&L.mimeTypes[M]&&!L.mimeTypes[M].enabledPlugin||(F=!0,a=!1,c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),s[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),10),s[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),s[2]=/[a-zA-Z]/.test(c)?parseInt(c.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof P[["Active"].concat("Object").join("X")]!=j)try{var u=new(window[["Active"].concat("Object").join("X")])(A);u&&(c=u.GetVariable("$version"),c&&(a=!0,c=c.split(" ")[1].split(","),s=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]))}catch(d){}return{w3:e,pv:s,wk:r,ie:a,win:o,mac:i}}();(function(){q.w3&&((typeof N.readyState!=j&&"complete"==N.readyState||typeof N.readyState==j&&(N.getElementsByTagName("body")[0]||N.body))&&e(), V||(typeof N.addEventListener!=j&&N.addEventListener("DOMContentLoaded",e,!1),q.ie&&q.win&&(N.attachEvent(R,function(){"complete"==N.readyState&&(N.detachEvent(R,arguments.callee),e())}),P==top&&!function(){if(!V){try{N.documentElement.doScroll("left")}catch(t){return void setTimeout(arguments.callee,0)}e()}}()),q.wk&&!function(){return V?void 0:/loaded|complete/.test(N.readyState)?void e():void setTimeout(arguments.callee,0)}(),n(e)))})(),function(){q.ie&&q.win&&window.attachEvent("onunload",function(){for(var e=J.length,t=0;e>t;t++)J[t][0].detachEvent(J[t][1],J[t][2]);for(var n=U.length,o=0;n>o;o++)f(U[o]);for(var i in q)q[i]=null;q=null;for(var r in swfobject)swfobject[r]=null;swfobject=null})}();return{registerObject:function(e,t,n,o){if(q.w3&&e&&t){var i={};i.id=e,i.swfVersion=t,i.expressInstall=n,i.callbackFn=o,B[B.length]=i,w(e,!1)}else o&&o({success:!1,id:e})},getObjectById:function(e){return q.w3?a(e):void 0},embedSWF:function(e,n,o,i,r,a,u,d,l,f){var h={success:!1,id:n};q.w3&&!(q.wk&&q.wk<312)&&e&&n&&o&&i&&r?(w(n,!1),t(function(){o+="",i+="";var t={};if(l&&typeof l===_)for(var m in l)t[m]=l[m];t.data=e,t.width=o,t.height=i;var g={};if(d&&typeof d===_)for(var v in d)g[v]=d[v];if(u&&typeof u===_)for(var b in u)typeof g.flashvars!=j?g.flashvars+="&"+b+"="+u[b]:g.flashvars=b+"="+u[b];if(y(r)){var S=p(t,g,n);t.id==n&&w(n,!0),h.success=!0,h.ref=S}else{if(a&&s())return t.data=a,void c(t,g,n,f);w(n,!0)}f&&f(h)})):f&&f(h)},switchOffAutoHideShow:function(){z=!1},ua:q,getFlashPlayerVersion:function(){return{major:q.pv[0],minor:q.pv[1],release:q.pv[2]}},hasFlashPlayerVersion:y,createSWF:function(e,t,n){return q.w3?p(e,t,n):void 0},showExpressInstall:function(e,t,n,o){q.w3&&s()&&c(e,t,n,o)},removeSWF:function(e){q.w3&&f(e)},createCSS:function(e,t,n,o){q.w3&&b(e,t,n,o)},addDomLoadEvent:t,addLoadEvent:n,getQueryParamValue:function(e){var t=N.location.search||N.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),null==e)return S(t);for(var n=t.split("&"),o=0;o= 10.0.0 is required.");"file:"==location.protocol&&e.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),WebSocket=function(e,t,n,o,i){var r=this;r.__id=WebSocket.__nextId++,WebSocket.__instances[r.__id]=r,r.readyState=WebSocket.CONNECTING,r.bufferedAmount=0,r.__events={},t?"string"==typeof t&&(t=[t]):t=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(r.__id,e,t,n||null,o||0,i||null)})},0)},WebSocket.prototype.send=function(e){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var t=WebSocket.__flash.send(this.__id,encodeURIComponent(e));return 0>t?!0:(this.bufferedAmount+=t,!1)},WebSocket.prototype.close=function(){this.readyState!=WebSocket.CLOSED&&this.readyState!=WebSocket.CLOSING&&(this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id))},WebSocket.prototype.addEventListener=function(e,t,n){e in this.__events||(this.__events[e]=[]),this.__events[e].push(t)},WebSocket.prototype.removeEventListener=function(e,t,n){if(e in this.__events)for(var o=this.__events[e],i=o.length-1;i>=0;--i)if(o[i]===t){o.splice(i,1);break}},WebSocket.prototype.dispatchEvent=function(e){for(var t=this.__events[e.type]||[],n=0;no;o++)n.push(t.parser.encodePacket(e[o]));this.send(t.parser.encodePayload(n))},o.prototype.send=function(e){return this.post(e),this},o.prototype.post=function(e){function t(){4==this.readyState&&(this.onreadystatechange=i,r.posting=!1,200==this.status?r.socket.setBuffer(!1):r.onClose())}function o(){this.onload=i,r.socket.setBuffer(!1)}var r=this;this.socket.setBuffer(!0),this.sendXHR=this.request("POST"),n.XDomainRequest&&this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=o:this.sendXHR.onreadystatechange=t,this.sendXHR.send(e)},o.prototype.close=function(){return this.onClose(),this},o.prototype.request=function(e){var n=t.util.request(this.socket.isXDomain()),o=t.util.query(this.socket.options.query,"t="+ +new Date);if(n.open(e||"GET",this.prepareUrl()+o,!0),"POST"==e)try{n.setRequestHeader?n.setRequestHeader("Content-type","text/plain;charset=UTF-8"):n.contentType="text/plain"}catch(i){}return n},o.prototype.scheme=function(){return this.socket.options.secure?"https":"http"},o.check=function(e,o){try{var i=t.util.request(o),r=n.XDomainRequest&&i instanceof XDomainRequest,a=e&&e.options&&e.options.secure?"https:":"http:",s=n.location&&a!=n.location.protocol;if(i&&(!r||!s))return!0}catch(c){}return!1},o.xdomainCheck=function(e){return o.check(e,!0)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(e){t.Transport.XHR.apply(this,arguments)}e.htmlfile=n,t.util.inherit(n,t.Transport.XHR),n.prototype.name="htmlfile",n.prototype.get=function(){this.doc=new(window[["Active"].concat("Object").join("X")])("htmlfile"),this.doc.open(),this.doc.write(""),this.doc.close(),this.doc.parentWindow.s=this;var e=this.doc.createElement("div");e.className="socketio",this.doc.body.appendChild(e),this.iframe=this.doc.createElement("iframe"),e.appendChild(this.iframe);var n=this,o=t.util.query(this.socket.options.query,"t="+ +new Date);this.iframe.src=this.prepareUrl()+o,t.util.on(window,"unload",function(){n.destroy()})},n.prototype._=function(e,t){e=e.replace(/\\\//g,"/"),this.onData(e);try{var n=t.getElementsByTagName("script")[0];n.parentNode.removeChild(n)}catch(o){}},n.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},n.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},n.check=function(e){if("undefined"!=typeof window&&["Active"].concat("Object").join("X")in window)try{var n=new(window[["Active"].concat("Object").join("X")])("htmlfile");return n&&t.Transport.XHR.check(e)}catch(o){}return!1},n.xdomainCheck=function(){return!1},t.transports.push("htmlfile")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(){t.Transport.XHR.apply(this,arguments)}function i(){}e["xhr-polling"]=o,t.util.inherit(o,t.Transport.XHR),t.util.merge(o,t.Transport.XHR),o.prototype.name="xhr-polling",o.prototype.heartbeats=function(){return!1},o.prototype.open=function(){var e=this;return t.Transport.XHR.prototype.open.call(e),!1},o.prototype.get=function(){function e(){4==this.readyState&&(this.onreadystatechange=i,200==this.status?(r.onData(this.responseText),r.get()):r.onClose())}function t(){this.onload=i,this.onerror=i,r.retryCounter=1,r.onData(this.responseText),r.get()}function o(){r.retryCounter++,!r.retryCounter||r.retryCounter>3?r.onClose():r.get()}if(this.isOpen){var r=this;this.xhr=this.request(),n.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=t,this.xhr.onerror=o):this.xhr.onreadystatechange=e,this.xhr.send(null)}},o.prototype.onClose=function(){if(t.Transport.XHR.prototype.onClose.call(this),this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=i;try{this.xhr.abort()}catch(e){}this.xhr=null}},o.prototype.ready=function(e,n){var o=this;t.util.defer(function(){n.call(o)})},t.transports.push("xhr-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t,n){function o(e){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var n=this;t.j.push(function(e){n._(e)})}var i=n.document&&"MozAppearance"in n.document.documentElement.style;e["jsonp-polling"]=o,t.util.inherit(o,t.Transport["xhr-polling"]),o.prototype.name="jsonp-polling",o.prototype.post=function(e){function n(){o(),i.socket.setBuffer(!1)}function o(){i.iframe&&i.form.removeChild(i.iframe);try{a=document.createElement('