UNPKG

wilddog

Version:

wilddog,realtime,websocket

10 lines 188 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.eio=e():t.eio=e()}(global,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";t.exports=r(1),global.eio=t.exports},function(t,e,r){"use strict";t.exports=r(2),t.exports.parser=r(6)},function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);e=e||{},t&&"object"===("undefined"==typeof t?"undefined":s(t))&&(e=t,t=null),t?(t=p(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=p(e.host).host),this.secure=null!=e.secure?e.secure:global.location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||(global.location?location.hostname:"localhost"),this.port=e.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=f.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["websocket"],this.readyState="",this.writeBuffer=[],this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized;var r="object"===("undefined"==typeof global?"undefined":s(global))&&global;r.global===r&&e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),this.open()}function o(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(3),a=r(17),c=r(21)("engine.io-client:socket"),u=r(32),h=r(6),p=r(33),f=r(18);t.exports=n,n.priorWebsocketSuccess=!1,a(n.prototype),n.protocol=h.protocol,n.Socket=n,n.Transport=r(5),n.transports=r(3),n.parser=r(6),n.prototype.createTransport=function(t){c('creating transport "%s"',t);var e=o(this.query);e.EIO=h.protocol,e.transport=t,this.id&&(e.sid=this.id);var r=new i[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return r},n.prototype.open=function(){var t;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(r){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},n.prototype.setTransport=function(t){c("setting transport %s",t.name);var e=this;this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},n.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;p=p||e}p||(c('probe transport "%s" opened',t),h.send([{type:"ping",data:"probe"}]),h.once("packet",function(e){if(!p)if("pong"===e.type&&"probe"===e.data){if(c('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",h),!h)return;n.priorWebsocketSuccess="websocket"===h.name,c('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){p||"closed"!==f.readyState&&(c("changing transport and sending upgrade packet"),u(),f.setTransport(h),h.send([{type:"upgrade"}]),f.emit("upgrade",h),h=null,f.upgrading=!1,f.flush())})}else{c('probe transport "%s" failed',t);var r=new Error("probe error");r.transport=h.name,f.emit("upgradeError",r)}}))}function r(){p||(p=!0,u(),h.close(),h=null)}function o(e){var n=new Error("probe error: "+e);n.transport=h.name,r(),c('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",n)}function s(){o("transport closed")}function i(){o("socket closed")}function a(t){h&&t.name!==h.name&&(c('"%s" works - aborting "%s"',t.name,h.name),r())}function u(){h.removeListener("open",e),h.removeListener("error",o),h.removeListener("close",s),f.removeListener("close",i),f.removeListener("upgrading",a)}c('probing transport "%s"',t);var h=this.createTransport(t,{probe:1}),p=!1,f=this;n.priorWebsocketSuccess=!1,h.once("open",e),h.once("error",o),h.once("close",s),this.once("close",i),this.once("upgrading",a),h.open()},n.prototype.onOpen=function(){if(c("socket open"),this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){c("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},n.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState)switch(c('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else c('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},n.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){c("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},n.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},n.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},n.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(c("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},n.prototype.sendPacket=function(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){r=r||{},r.compress=!1!==r.compress;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},n.prototype.close=function(){function t(){n.onClose("forced close"),c("socket closing - telling transport to close"),n.transport.close()}function e(){n.removeListener("upgrade",e),n.removeListener("upgradeError",e),t()}function r(){n.once("upgrade",e),n.once("upgradeError",e)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var n=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?r():t()}):this.upgrading?r():t()}return this},n.prototype.onError=function(t){c("socket error %j",t),n.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},n.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){c('socket close with reason: "%s"',t);var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}},n.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~u(this.transports,t[r])&&e.push(t[r]);return e}},function(t,e,r){"use strict";function n(t){var e,r=!1,n=!1,o=!1!==t.jsonp;if(global.location){var s="https:"===location.protocol,i=location.port;i||(i=s?443:80),r=t.hostname!==location.hostname||i!==t.port,n=t.secure!==s}if(t.xdomain=r,t.xscheme=n,e=new XMLHttpRequest(t),"open"in e&&!t.forceJSONP)return new XHR(t);if(!o)throw new Error("JSONP disabled");return new JSONP(t)}var o=r(4);e.polling=n,e.websocket=o},function(t,e,r){"use strict";function n(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,o.call(this,t)}var o=r(5),s=r(6),i=r(18),a=r(19),c=r(20),u=r(21)("engine.io-client:websocket"),h=r(24).WebSocket;t.exports=n,a(n,o),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e={agent:this.agent,perMessageDeflate:this.perMessageDeflate};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(e.headers=this.extraHeaders),this.ws=new h(t),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(t){var e=this;setTimeout(function(){o.prototype.onData.call(e,t)},0)}),n.prototype.write=function(t){function e(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var n=t.length,o=0,i=n;o<i;o++)!function(t){s.encodePacket(t,r.supportsBinary,function(t){try{r.ws.send(t)}catch(o){u("websocket closed before onclose event")}--n||e()})}(t[o])},n.prototype.onClose=function(){o.prototype.onClose.call(this)},n.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||(t.b64=1),t=i.encode(t),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t},n.prototype.check=function(){return!(!h||"__initialize"in h&&this.name===n.prototype.name)}},function(t,e,r){"use strict";function n(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders}var o=r(6),s=r(17);t.exports=n,s(n.prototype),n.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},n.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},n.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(t){var e=o.decodePacket(t,this.socket.binaryType);this.onPacket(e)},n.prototype.onPacket=function(t){this.emit("packet",t)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,r){"use strict";function n(t,r){var n="b"+e.packets[t.type]+t.data.data;return r(n)}function o(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=t.data,s=new Uint8Array(o),i=new Uint8Array(1+o.byteLength);i[0]=v[t.type];for(var a=0;a<s.length;a++)i[a+1]=s[a];return n(i.buffer)}function s(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,r,!0,n)},o.readAsArrayBuffer(t.data)}function i(t,r,n){if(!r)return e.encodeBase64Packet(t,n);if(m)return s(t,r,n);var o=new Uint8Array(1);o[0]=v[t.type];var i=new k([o.buffer,t.data]);return n(i)}function a(t){try{t=d.decode(t)}catch(e){return!1}return t}function c(t,e,r){for(var n=new Array(t.length),o=l(t.length,r),s=function(t,r,o){e(r,function(e,r){n[t]=r,o(e,n)})},i=0;i<t.length;i++)s(i,t[i],o)}var u,h=r(7),p=r(8),f=r(10),l=r(11),d=r(12);global&&global.ArrayBuffer&&(u=r(15));var y="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),g="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),m=y||g;e.protocol=3;var v=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},b=h(v),w={type:"error",data:"parser error"},k=r(16);e.encodePacket=function(t,e,r,s){"function"==typeof e&&(s=e,e=!1),"function"==typeof r&&(s=r,r=null);var a=void 0===t.data?void 0:t.data.buffer||t.data;if(global.ArrayBuffer&&a instanceof ArrayBuffer)return o(t,e,s);if(k&&a instanceof global.Blob)return i(t,e,s);if(a&&a.base64)return n(t,s);var c=v[t.type];return void 0!==t.data&&(c+=r?d.encode(String(t.data)):String(t.data)),s(""+c)},e.encodeBase64Packet=function(t,r){var n="b"+e.packets[t.type];if(k&&t.data instanceof global.Blob){var o=new FileReader;return o.onload=function(){var t=o.result.split(",")[1];r(n+t)},o.readAsDataURL(t.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(i){for(var a=new Uint8Array(t.data),c=new Array(a.length),u=0;u<a.length;u++)c[u]=a[u];s=String.fromCharCode.apply(null,c)}return n+=global.btoa(s),r(n)},e.decodePacket=function(t,r,n){if("string"==typeof t||void 0===t){if("b"==t.charAt(0))return e.decodeBase64Packet(t.substr(1),r);if(n&&(t=a(t),t===!1))return w;var o=t.charAt(0);return Number(o)==o&&b[o]?t.length>1?{type:b[o],data:t.substring(1)}:{type:b[o]}:w}var s=new Uint8Array(t),o=s[0],i=f(t,1);return k&&"blob"===r&&(i=new k([i])),{type:b[o],data:i}},e.decodeBase64Packet=function(t,e){var r=b[t.charAt(0)];if(!u)return{type:r,data:{base64:!0,data:t.substr(1)}};var n=u.decode(t.substr(1));return"blob"===e&&k&&(n=new k([n])),{type:r,data:n}},e.encodePayload=function(t,r,n){function o(t){return t.length+":"+t}function s(t,n){e.encodePacket(t,!!i&&r,!0,function(t){n(null,o(t))})}"function"==typeof r&&(n=r,r=null);var i=p(t);return r&&i?k&&!m?e.encodePayloadAsBlob(t,n):e.encodePayloadAsArrayBuffer(t,n):t.length?void c(t,s,function(t,e){return n(e.join(""))}):n("0:")},e.decodePayload=function(t,r,n){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,n);"function"==typeof r&&(n=r,r=null);var o;if(""==t)return n(w,0,1);for(var s,i,a="",c=0,u=t.length;c<u;c++){var h=t.charAt(c);if(":"!=h)a+=h;else{if(""==a||a!=(s=Number(a)))return n(w,0,1);if(i=t.substr(c+1,s),a!=i.length)return n(w,0,1);if(i.length){if(o=e.decodePacket(i,r,!0),w.type==o.type&&w.data==o.data)return n(w,0,1);var p=n(o,c+s,u);if(!1===p)return}c+=s,a=""}}return""!=a?n(w,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,r){function n(t,r){e.encodePacket(t,!0,!0,function(t){return r(null,t)})}return t.length?void c(t,n,function(t,e){var n=e.reduce(function(t,e){var r;return r="string"==typeof e?e.length:e.byteLength,t+r.toString().length+r+2},0),o=new Uint8Array(n),s=0;return e.forEach(function(t){var e="string"==typeof t,r=t;if(e){for(var n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);r=n.buffer}e?o[s++]=0:o[s++]=1;for(var a=r.byteLength.toString(),i=0;i<a.length;i++)o[s++]=parseInt(a[i]);o[s++]=255;for(var n=new Uint8Array(r),i=0;i<n.length;i++)o[s++]=n[i]}),r(o.buffer)}):r(new ArrayBuffer(0))},e.encodePayloadAsBlob=function(t,r){function n(t,r){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);t=n.buffer,e[0]=0}for(var s=t instanceof ArrayBuffer?t.byteLength:t.size,i=s.toString(),a=new Uint8Array(i.length+1),o=0;o<i.length;o++)a[o]=parseInt(i[o]);if(a[i.length]=255,k){var c=new k([e.buffer,a.buffer,t]);r(null,c)}})}c(t,n,function(t,e){return r(new k(e))})},e.decodePayloadAsBinary=function(t,r,n){"function"==typeof r&&(n=r,r=null);for(var o=t,s=[],i=!1;o.byteLength>0;){for(var a=new Uint8Array(o),c=0===a[0],u="",h=1;255!=a[h];h++){if(u.length>310){i=!0;break}u+=a[h]}if(i)return n(w,0,1);o=f(o,2+u.length),u=parseInt(u);var p=f(o,0,u);if(c)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(l){var d=new Uint8Array(p);p="";for(var h=0;h<d.length;h++)p+=String.fromCharCode(d[h])}s.push(p),o=f(o,u)}var y=s.length;s.forEach(function(t,o){n(e.decodePacket(t,r,!0),o,y)})}},function(t,e){"use strict";t.exports=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e}},function(t,e,r){"use strict";function n(t){function e(t){if(!t)return!1;if(global.Buffer&&global.Buffer.isBuffer(t)||global.ArrayBuffer&&t instanceof ArrayBuffer||global.Blob&&t instanceof Blob||global.File&&t instanceof File)return!0;if(s(t)){for(var r=0;r<t.length;r++)if(e(t[r]))return!0}else if(t&&"object"==("undefined"==typeof t?"undefined":o(t))){t.toJSON&&(t=t.toJSON());for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0}return!1}return e(t)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=r(9);t.exports=n},function(t,e){"use strict";t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(t),s=new Uint8Array(r-e),i=e,a=0;i<r;i++,a++)s[a]=o[i];return s.buffer}},function(t,e){"use strict";function r(t,e,r){function o(t,n){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(s=!0,e(t),e=r):0!==o.count||s||e(null,n)}var s=!1;return r=r||n,o.count=t,0===t?e():o}function n(){}t.exports=r},function(t,e,r){var n;(function(t){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(s){function i(t){for(var e,r,n=[],o=0,s=t.length;o<s;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<s?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function a(t){for(var e,r=t.length,n=-1,o="";++n<r;)e=t[n],e>65535&&(e-=65536,o+=w(e>>>10&1023|55296),e=56320|1023&e),o+=w(e);return o}function c(t,e){return w(t>>e&63|128)}function u(t){if(0==(4294967168&t))return w(t);var e="";return 0==(4294965248&t)?e=w(t>>6&31|192):0==(4294901760&t)?(e=w(t>>12&15|224),e+=c(t,6)):0==(4292870144&t)&&(e=w(t>>18&7|240),e+=c(t,12),e+=c(t,6)),e+=w(63&t|128)}function h(t){for(var e,r=i(t),n=r.length,o=-1,s="";++o<n;)e=r[o],s+=u(e);return s}function p(){if(b>=v)throw Error("Invalid byte index");var t=255&m[b];if(b++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,e,r,n,o;if(b>v)throw Error("Invalid byte index");if(b==v)return!1;if(t=255&m[b],b++,0==(128&t))return t;if(192==(224&t)){var e=p();if(o=(31&t)<<6|e,o>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=p(),r=p(),o=(15&t)<<12|e<<6|r,o>=2048)return o;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=p(),r=p(),n=p(),o=(15&t)<<18|e<<12|r<<6|n,o>=65536&&o<=1114111))return o;throw Error("Invalid WTF-8 detected")}function l(t){m=i(t),v=m.length,b=0;for(var e,r=[];(e=f())!==!1;)r.push(e);return a(r)}var d="object"==o(e)&&e,y="object"==o(t)&&t&&t.exports==d&&t,g="object"==("undefined"==typeof global?"undefined":o(global))&&global;g.global!==g&&g.window!==g||(s=g);var m,v,b,w=String.fromCharCode,k={version:"1.0.0",encode:h,decode:l};if("object"==o(r(14))&&r(14))n=function(){return k}.call(e,r,e,t),!(void 0!==n&&(t.exports=n));else if(d&&!d.nodeType)if(y)y.exports=k;else{var S={},x=S.hasOwnProperty;for(var A in k)x.call(k,A)&&(d[A]=k[A])}else s.wtf8=k}(void 0)}).call(e,r(13)(t))},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e){"use strict";!function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;e.encode=function(e){var r,n=new Uint8Array(e),o=n.length,s="";for(r=0;r<o;r+=3)s+=t[n[r]>>2],s+=t[(3&n[r])<<4|n[r+1]>>4],s+=t[(15&n[r+1])<<2|n[r+2]>>6],s+=t[63&n[r+2]];return o%3===2?s=s.substring(0,s.length-1)+"=":o%3===1&&(s=s.substring(0,s.length-2)+"=="),s},e.decode=function(t){var e,n,o,s,i,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),p=new Uint8Array(h);for(e=0;e<c;e+=4)n=r[t.charCodeAt(e)],o=r[t.charCodeAt(e+1)],s=r[t.charCodeAt(e+2)],i=r[t.charCodeAt(e+3)],p[u++]=n<<2|o>>4,p[u++]=(15&o)<<4|s>>2,p[u++]=(3&s)<<6|63&i;return h}}()},function(t,e){"use strict";function r(t){for(var e=0;e<t.length;e++){var r=t[e];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}t[e]=n}}}function n(t,e){e=e||{};var n=new s;r(t);for(var o=0;o<t.length;o++)n.append(t[o]);return e.type?n.getBlob(e.type):n.getBlob()}function o(t,e){return r(t),new Blob(t,e||{})}var s=global.BlobBuilder||global.WebKitBlobBuilder||global.MSBlobBuilder||global.MozBlobBuilder,i=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(e){return!1}}(),a=i&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(e){return!1}}(),c=s&&s.prototype.append&&s.prototype.getBlob;t.exports=function(){return i?a?global.Blob:o:c?n:void 0}()},function(t,e){"use strict";function r(t){if(t)return n(t)}function n(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function r(){n.off(t,r),e.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},r.fn=e,this.on(t,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks[t];if(!r)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var n,o=0;o<r.length;o++)if(n=r[o],n===e||n.fn===e){r.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks[t];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){"use strict";e.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},e.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}},function(t,e){"use strict";t.exports=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){"use strict";function r(t){var e="";do e=i[t%a]+e,t=Math.floor(t/a);while(t>0);return e}function n(t){var e=0;for(h=0;h<t.length;h++)e=e*a+c[t.charAt(h)];return e}function o(){var t=r(+new Date);return t!==s?(u=0,s=t):t+"."+r(u++)}for(var s,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},u=0,h=0;h<a;h++)c[i[h]]=h;o.encode=r,o.decode=n,t.exports=o},function(t,e,r){"use strict";function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var t=arguments,r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return t;var n="color: "+this.color;t=[t[0],n,"color: inherit"].concat(Array.prototype.slice.call(t,1));var o=0,s=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(s=o))}),t.splice(s,0,n),t}function s(){return"object"===("undefined"==typeof console?"undefined":u(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(r){}}function a(){var t;try{t=e.storage.debug}catch(r){}return t}function c(){try{return window.localStorage}catch(t){}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e=t.exports=r(22),e.log=s,e.formatArgs=o,e.save=i,e.load=a,e.useColors=n,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(a())},function(t,e,r){"use strict";function n(){return e.colors[h++%e.colors.length]}function o(t){function r(){}function o(){var t=o,r=+new Date,s=r-(u||r);t.diff=s,t.prev=u,t.curr=r,u=r,null==t.useColors&&(t.useColors=e.useColors()),null==t.color&&t.useColors&&(t.color=n());var i=Array.prototype.slice.call(arguments);i[0]=e.coerce(i[0]),"string"!=typeof i[0]&&(i=["%o"].concat(i));var a=0;i[0]=i[0].replace(/%([a-z%])/g,function(r,n){if("%%"===r)return r;a++;var o=e.formatters[n];if("function"==typeof o){var s=i[a];r=o.call(t,s),i.splice(a,1),a--}return r}),"function"==typeof e.formatArgs&&(i=e.formatArgs.apply(t,i));var c=o.log||e.log||console.log.bind(console);c.apply(t,i)}r.enabled=!1,o.enabled=!0;var s=e.enabled(t)?o:r;return s.namespace=t,s}function s(t){e.save(t);for(var r=(t||"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&(t=r[o].replace(/\*/g,".*?"),"-"===t[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))}function i(){e.enable("")}function a(t){var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1}function c(t){return t instanceof Error?t.stack||t.message:t}e=t.exports=o,e.coerce=c,e.disable=i,e.enable=s,e.enabled=a,e.humanize=r(23),e.names=[],e.skips=[],e.formatters={};var u,h=0},function(t,e){"use strict";function r(t){if(t=""+t,!(t.length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*h;case"days":case"day":case"d":return r*u;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function o(t){return s(t,u,"day")||s(t,c,"hour")||s(t,a,"minute")||s(t,i,"second")||t+" ms"}function s(t,e,r){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}var i=1e3,a=60*i,c=60*a,u=24*c,h=365.25*u;t.exports=function(t,e){return e=e||{},"string"==typeof t?r(t):e["long"]?o(t):n(t)}},function(t,e,r){"use strict";var n=r(25);t.exports={WebSocket:n},null==navigator&&(navigator={},navigator.userAgent="WeApp")},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),s=r(26),i=r(27),a=function(){function t(e){var r=this;if(n(this,t),null==e)throw new TypeError("1 argument needed");try{var o=i.parse(e);if("wss:"!=o.protocol)throw new Error("protocol must be wss")}catch(s){throw new SyntaxError("url in wrong format,protocol must be wss")}t.instance=this,this.url=e,this.readyState=0,this.onopen=null,this.onclose=null,this.onerror=null,this.onmessage=null,wx.connectSocket({url:e,header:{"content-type":"application/json"},method:"GET"}),wx.onSocketOpen(function(){r.readyState=t.OPEN,r.onopen&&r.onopen.call(r),r.dispatchEvent({type:"open"})}),wx.onSocketError(function(t){if(""!==t.message){var e={type:"error",data:t};r.onerror&&r.onerror.call(r,e),r.dispatchEvent(e)}}),wx.onSocketMessage(function(e){if(r.readyState===t.OPEN||r.readyState===t.CLOSING){var n={type:"message",data:e.data};r.onmessage&&r.onmessage.call(r,n),r.dispatchEvent(n)}}),wx.onSocketClose(function(){if(r.readyState=t.CLOSED,r.onclose){var e={type:"close",wasClean:!0,code:0,reason:""};r.onclose.call(r,e)}})}return o(t,[{key:"close",value:function(){wx.closeSocket()}},{key:"send",value:function(t){wx.sendSocketMessage({data:t})}}]),t}();a.prototype.addEventListener=s.addEventListener, a.prototype.removeEventListener=s.removeEventListener,a.prototype.dispatchEvent=s.dispatchEvent,a.CONNECTING=0,a.OPEN=1,a.CLOSING=2,a.CLOSED=3,a.instance=null,t.exports=a},function(t,e){"use strict";t.exports=function(){function t(t,e,r){i.value=r,a(t,e,i),i.value=null}function e(e,r,n){var o;u.call(e,r)?o=e[r]:t(e,r,o=[]),c.call(o,n)<0&&o.push(n)}function r(t,e,r){var n,o,s;if(u.call(t,e))for(r.target=t,n=t[e].slice(0),s=0;s<n.length;s++)o=n[s],"function"==typeof o?o.call(t,r):"function"==typeof o.handleEvent&&o.handleEvent(r)}function n(t,e,r){var n,o;u.call(t,e)&&(n=t[e],o=c.call(n,r),-1<o&&(n.splice(o,1),n.length||delete t[e]))}var o="@@",s={},i={configurable:!0,value:null},a=Object.defineProperty||function(t,e,r){t[e]=r.value},c=[].indexOf||function(t){for(var e=this.length;e--&&this[e]!==t;);return e},u=s.hasOwnProperty;return t(s,"addEventListener",function(t,r){e(this,o+t,r)}),t(s,"dispatchEvent",function(t){r(this,o+t.type,t)}),t(s,"removeEventListener",function(t,e){n(this,o+t,e)}),s}()},function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(t,e,r){if(t&&u(t)&&t instanceof n)return t;var o=new n;return o.parse(t,e,r),o}function s(t){return c(t)&&(t=o(t)),t instanceof n?t.format():n.prototype.format.call(t)}function i(t,e){return o(t,!1,!0).resolve(e)}function a(t,e){return t?o(t,!1,!0).resolveObject(e):e}function c(t){return"string"==typeof t}function u(t){return"object"===("undefined"==typeof t?"undefined":f(t))&&null!==t}function h(t){return null===t}function p(t){return null==t}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=r(28);e.parse=o,e.resolve=i,e.resolveObject=a,e.format=s,e.Url=n;var d=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,g=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(m),b=["%","/","?",";","#"].concat(v),w=["/","?","#"],k=255,S=/^[a-z0-9A-Z_-]{0,63}$/,x=/^([a-z0-9A-Z_-]{0,63})(.*)$/,A={javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},B={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=r(29);n.prototype.parse=function(t,e,r){if(!c(t))throw new TypeError("Parameter 'url' must be a string, not "+("undefined"==typeof t?"undefined":f(t)));var n=t;n=n.trim();var o=d.exec(n);if(o){o=o[0];var s=o.toLowerCase();this.protocol=s,n=n.substr(o.length)}if(r||o||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var i="//"===n.substr(0,2);!i||o&&C[o]||(n=n.substr(2),this.slashes=!0)}if(!C[o]&&(i||o&&!B[o])){for(var a=-1,u=0;u<w.length;u++){var h=n.indexOf(w[u]);h!==-1&&(a===-1||h<a)&&(a=h)}var p,y;y=a===-1?n.lastIndexOf("@"):n.lastIndexOf("@",a),y!==-1&&(p=n.slice(0,y),n=n.slice(y+1),this.auth=decodeURIComponent(p)),a=-1;for(var u=0;u<b.length;u++){var h=n.indexOf(b[u]);h!==-1&&(a===-1||h<a)&&(a=h)}a===-1&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var m=this.hostname.split(/\./),u=0,P=m.length;u<P;u++){var j=m[u];if(j&&!j.match(S)){for(var E="",U=0,L=j.length;U<L;U++)E+=j.charCodeAt(U)>127?"x":j[U];if(!E.match(S)){var T=m.slice(0,u),I=m.slice(u+1),q=j.match(x);q&&(T.push(q[1]),I.unshift(q[2])),I.length&&(n="/"+I.join(".")+n),this.hostname=T.join(".");break}}}if(this.hostname.length>k?this.hostname="":this.hostname=this.hostname.toLowerCase(),!g){for(var R=this.hostname.split("."),D=[],u=0;u<R.length;++u){var M=R[u];D.push(M.match(/[^A-Za-z0-9_-]/)?"xn--"+l.encode(M):M)}this.hostname=D.join(".")}var z=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+z,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==n[0]&&(n="/"+n))}if(!A[s])for(var u=0,P=v.length;u<P;u++){var _=v[u],H=encodeURIComponent(_);H===_&&(H=escape(_)),n=n.split(_).join(H)}var F=n.indexOf("#");F!==-1&&(this.hash=n.substr(F),n=n.slice(0,F));var J=n.indexOf("?");if(J!==-1?(this.search=n.substr(J),this.query=n.substr(J+1),e&&(this.query=O.parse(this.query)),n=n.slice(0,J)):e&&(this.search="",this.query={}),n&&(this.pathname=n),B[s]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var z=this.pathname||"",M=this.search||"";this.path=z+M}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(s=O.stringify(this.query));var i=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||B[e])&&o!==!1?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),i&&"?"!==i.charAt(0)&&(i="?"+i),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),i=i.replace("#","%23"),e+o+r+i+n},n.prototype.resolve=function(t){return this.resolveObject(o(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(c(t)){var e=new n;e.parse(t,!1,!0),t=e}var r=new n;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),B[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!B[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||C[t.protocol])r.pathname=t.pathname;else{for(var o=(t.pathname||"").split("/");o.length&&!(t.host=o.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),r.pathname=o.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var s=r.pathname||"",i=r.search||"";r.path=s+i}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),f=u||a||r.host&&t.pathname,l=f,d=r.pathname&&r.pathname.split("/")||[],o=t.pathname&&t.pathname.split("/")||[],y=r.protocol&&!B[r.protocol];if(y&&(r.hostname="",r.port=null,r.host&&(""===d[0]?d[0]=r.host:d.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===o[0]?o[0]=t.host:o.unshift(t.host)),t.host=null),f=f&&(""===o[0]||""===d[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,d=o;else if(o.length)d||(d=[]),d.pop(),d=d.concat(o),r.search=t.search,r.query=t.query;else if(!p(t.search)){if(y){r.hostname=r.host=d.shift();var g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!d.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var m=d.slice(-1)[0],v=(r.host||t.host)&&("."===m||".."===m)||""===m,b=0,w=d.length;w>=0;w--)m=d[w],"."==m?d.splice(w,1):".."===m?(d.splice(w,1),b++):b&&(d.splice(w,1),b--);if(!f&&!l)for(;b--;b)d.unshift("..");!f||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),v&&"/"!==d.join("/").substr(-1)&&d.push("");var k=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(y){r.hostname=r.host=k?"":d.length?d.shift():"";var g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return f=f||r.host&&d.length,f&&!k&&d.unshift(""),d.length?r.pathname=d.join("/"):(r.pathname=null,r.path=null),h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=y.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){var n;(function(t){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(s){function i(t){throw RangeError(q[t])}function a(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function c(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(I,".");var o=t.split("."),s=a(o,e).join(".");return n+s}function u(t){for(var e,r,n=[],o=0,s=t.length;o<s;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<s?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function h(t){return a(t,function(t){var e="";return t>65535&&(t-=65536,e+=M(t>>>10&1023|55296),t=56320|1023&t),e+=M(t)}).join("")}function p(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:A}function f(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function l(t,e,r){var n=0;for(t=r?D(t/P):t>>1,t+=D(t/e);t>R*B>>1;n+=A)t=D(t/R);return D(n+(R+1)*t/(t+O))}function d(t){var e,r,n,o,s,a,c,u,f,d,y=[],g=t.length,m=0,v=E,b=j;for(r=t.lastIndexOf(U),r<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&i("not-basic"),y.push(t.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(s=m,a=1,c=A;o>=g&&i("invalid-input"),u=p(t.charCodeAt(o++)),(u>=A||u>D((x-m)/a))&&i("overflow"),m+=u*a,f=c<=b?C:c>=b+B?B:c-b,!(u<f);c+=A)d=A-f,a>D(x/d)&&i("overflow"),a*=d;e=y.length+1,b=l(m-s,e,0==s),D(m/e)>x-v&&i("overflow"),v+=D(m/e),m%=e,y.splice(m++,0,v)}return h(y)}function y(t){var e,r,n,o,s,a,c,h,p,d,y,g,m,v,b,w=[];for(t=u(t),g=t.length,e=E,r=0,s=j,a=0;a<g;++a)y=t[a],y<128&&w.push(M(y));for(n=o=w.length,o&&w.push(U);n<g;){for(c=x,a=0;a<g;++a)y=t[a],y>=e&&y<c&&(c=y);for(m=n+1,c-e>D((x-r)/m)&&i("overflow"),r+=(c-e)*m,e=c,a=0;a<g;++a)if(y=t[a],y<e&&++r>x&&i("overflow"),y==e){for(h=r,p=A;d=p<=s?C:p>=s+B?B:p-s,!(h<d);p+=A)b=h-d,v=A-d,w.push(M(f(d+b%v,0))),h=D(b/v);w.push(M(f(h,0))),s=l(r,m,n==o),r=0,++n}++r,++e}return w.join("")}function g(t){return c(t,function(t){return L.test(t)?d(t.slice(4).toLowerCase()):t})}function m(t){return c(t,function(t){return T.test(t)?"xn--"+y(t):t})}var v="object"==o(e)&&e&&!e.nodeType&&e,b="object"==o(t)&&t&&!t.nodeType&&t,w="object"==("undefined"==typeof global?"undefined":o(global))&&global;w.global!==w&&w.window!==w&&w.self!==w||(s=w);var k,S,x=2147483647,A=36,C=1,B=26,O=38,P=700,j=72,E=128,U="-",L=/^xn--/,T=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=A-C,D=Math.floor,M=String.fromCharCode;if(k={version:"1.3.2",ucs2:{decode:u,encode:h},decode:d,encode:y,toASCII:m,toUnicode:g},"object"==o(r(14))&&r(14))n=function(){return k}.call(e,r,e,t),!(void 0!==n&&(t.exports=n));else if(v&&b)if(t.exports==v)b.exports=k;else for(S in k)k.hasOwnProperty(S)&&(v[S]=k[S]);else s.punycode=k}(void 0)}).call(e,r(13)(t))},function(t,e,r){"use strict";e.decode=e.parse=r(30),e.encode=e.stringify=r(31)},function(t,e){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var i=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var c=t.length;a>0&&c>a&&(c=a);for(var u=0;u<c;++u){var h,p,f,l,d=t[u].replace(i,"%20"),y=d.indexOf(n);y>=0?(h=d.substr(0,y),p=d.substr(y+1)):(h=d,p=""),f=decodeURIComponent(h),l=decodeURIComponent(p),r(s,f)?Array.isArray(s[f])?s[f].push(l):s[f]=[s[f],l]:s[f]=l}return s}},function(t,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(t){switch("undefined"==typeof t?"undefined":r(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,o,s){return e=e||"&",o=o||"=",null===t&&(t=void 0),"object"===("undefined"==typeof t?"undefined":r(t))?Object.keys(t).map(function(r){var s=encodeURIComponent(n(r))+o;return Array.isArray(t[r])?t[r].map(function(t){return s+encodeURIComponent(n(t))}).join(e):s+encodeURIComponent(n(t[r]))}).join(e):s?encodeURIComponent(n(s))+o+encodeURIComponent(n(t)):""}},function(t,e){"use strict";var r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){"use strict";var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),s=t.indexOf("]");o!=-1&&s!=-1&&(t=t.substring(0,o)+t.substring(o,s).replace(/:/g,";")+t.substring(s,t.length));for(var i=r.exec(t||""),a={},c=14;c--;)a[n[c]]=i[c]||"";return o!=-1&&s!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}}])}); (function(ns){var CLIENT_VERSION = "2.5.17";var CLIENT_TYPE ="WX";ns.wrapper=function(goog,wd){ var h,n=this;function p(a){return void 0!==a}function aa(){}function ba(a){a.ac=function(){return a.jf?a.jf:a.jf=new a}} function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){return"array"==da(a)}function q(a){return"string"==typeof a}function fa(a){return"number"==typeof a}function ga(a){return"function"==da(a)}function ha(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ia(a,b,c){return a.call.apply(a.bind,arguments)} function ja(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function r(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ia:ja;return r.apply(null,arguments)} function ka(a,b){var c=a.split("."),d=n;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&p(b)?d[e]=b:d=d[e]?d[e]:d[e]={}}function la(a,b){function c(){}c.prototype=b.prototype;a.Ah=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.sh=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var ma={},na={NETWORK_ERROR:"Unable to contact the Wilddog server.",SERVER_ERROR:"An unknown server error occurred.",TRANSPORT_UNAVAILABLE:"There are no login transports available for the requested method.",REQUEST_INTERRUPTED:"The browser redirected the page before the login request could complete.",USER_CANCELLED:"The user cancelled authentication."};function oa(a){var b=t(na,a),b=Error(b,a);b.code=a;return b};function pa(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function t(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b]}function qa(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(c,a[c])}function ra(a){var b={};qa(a,function(a,d){b[a]=d});return b};function sa(a){var b=[];qa(a,function(a,d){ea(d)?ta(d,function(c){b.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}):b.push(encodeURIComponent(a)+"="+encodeURIComponent(d))});return b.length?"&"+b.join("&"):""}function ua(a){var b={};a=a.replace(/^\?/,"").split("&");ta(a,function(a){a&&(a=a.split("="),b[a[0]]=a[1])});return b};function va(a){return/^\s*$/.test(a)?!1:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))}function wa(a){a=String(a);if(va(a))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function xa(){this.Od=void 0} function ya(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(ea(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),e=d[f],ya(a,a.Od?a.Od.call(d,String(f),e):e,c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");f="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(e=b[d],"function"!=typeof e&&(c.push(f),za(d,c),c.push(":"),ya(a,a.Od?a.Od.call(b,d,e):e,c),f=","));c.push("}");return}}switch(typeof b){case "string":za(b, c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unk