1import{a as fi}from"./Bz2dEcw7.js";class Tt{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(s,c){return this.listen(".client-"+s,c)}notification(s){return this.listen(this.notificationCreatedEvent,s)}stopListeningForNotification(s){return this.stopListening(this.notificationCreatedEvent,s)}stopListeningForWhisper(s,c){return this.stopListening(".client-"+s,c)}}class oe{constructor(s){this.namespace=s}format(s){return[".","\\"].includes(s.charAt(0))?s.substring(1):(this.namespace&&(s=this.namespace+"."+s),s.replace(/\./g,"\\"))}setNamespace(s){this.namespace=s}}function pi(E){try{return Reflect.construct(String,[],E),!0}catch{return!1}}class kt extends Tt{constructor(s,c,p){super(),this.name=c,this.pusher=s,this.options=p,this.eventFormatter=new oe(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(s,c){return this.on(this.eventFormatter.format(s),c
1),this}listenToAll(s){return this.subscription.bind_global((c,p)=>{if(c.startsWith("pusher:"))return;let b=String(this.options.namespace??"").replace(/\./g,"\\"),y=c.startsWith(b)?c.substring(b.length+1):"."+c;s(y,p)}),this}stopListening(s,c){return c?this.subscription.unbind(this.eventFormatter.format(s),c):this.subscription.unbind(this.eventFormatter.format(s)),this}stopListeningToAll(s){return s?this.subscription.unbind_global(s):this.subscription.unbind_global(),this}subscribed(s){return this.on("pusher:subscription_succeeded",()=>{s()}),this}error(s){return this.on("pusher:subscription_error",c=>{s(c)}),this}on(s,c){return this.subscription.bind(s,c),this}}class se extends kt{whisper(s,c){return this.pusher.channels.channels[this.name].trigger(`client-${s}`,c),this}}class di extends kt{whisper(s,c){return this.pusher.channels.channels[this.name].trigger(`client-${s}`,c),this}}class vi extends se{here(s){return this.on("pusher:subscription_succeeded",c=>{s(Object.keys(c.members).map(p=>c.members[p]))}),this}joining(s){return this.on("pusher:member_added",c=>{s(c.info)}),this}whisper(s,c){return this.pusher.channels.channels[this.name].trigger(`client-${s}`,c),this}leaving(s){return this.on("pusher:member_removed",c=>{s(c.info)}),this}}class ae extends Tt{constructor(s,c,p){super(),this.events={},this.listeners={},this.name=c,this.socket=s,this.options=p,this.eventFormatter=new oe(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}
1listen(s,c){return this.on(this.eventFormatter.format(s),c),this}stopListening(s,c){return this.unbindEvent(this.eventFormatter.format(s),c),this}subscribed(s){return this.on("connect",c=>{s(c)}),this}error(s){return this}on(s,c){return this.listeners[s]=this.listeners[s]||[],this.events[s]||(this.events[s]=(p,b)=>{this.name===p&&this.listeners[s]&&this.listeners[s].forEach(y=>y(b))},this.socket.on(s,this.events[s])),this.listeners[s].push(c),this}unbind(){Object.keys(this.events).forEach(s=>{this.unbindEvent(s)})}unbindEvent(s,c){this.listeners[s]=this.listeners[s]||[],c&&(this.listeners[s]=this.listeners[s].filter(p=>p!==c)),(!c||this.listeners[s].length===0)&&(this.events[s]&&(this.socket.removeListener(s,this.events[s]),delete this.events[s]),delete this.listeners[s])}}class ce extends ae{whisper(s,c){return this.socket.emit("client event",{channel:this.name,event:`client-${s}`,data:c}),this}}class gi extends ce{here(s){return this.on("presence:subscribed",c=>{s(c.map(p=>p.user_info))}),this}joining(s){return this.on("presence:joining",c=>s(c.user_info)),this}whisper(s,c){return this.socket.emit("client event",{channel:this.name,event:`client-${s}`,data:c}),this}leaving(s){return this.on("presence:leaving",c=>s(c.user_info)),this}}class ut extends Tt{subscribe(){}unsubscribe(){}listen(s,c){return this}listenToAll(s){return this}stopListening(s,c){return this}subscribed(s){return this}error(s){return this}on(s,c){return this}}class ue extends ut{whisper(s,c){return this}}class yi extends ut{whisper(s,c){return this}}class _i extends ue{here(s){return this}joining(s){return this}whisper(s,c){return this}leaving(s){return this}}const he=class le{constructor(s){this.setOptions(s),this.connect()}setOptions(s){this.options={...le._defaultOptions,...s,broadcaster:s.broadcaster};let c=this.csrfToken();c&&(this.options.auth.headers["X-CSRF-TOKEN"]=c,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=c),c=this.options.bearerToken,c&&(this.options.auth.headers.Authorization="Bearer "+c,this.options.userAuthentication.headers.Authorization="Bearer "+c)}csrfToken(){var s,c;return typeof window<"u"&&(s=window.Laravel)!=null&&s.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((c=document.querySelector('meta[name="csrf-token"]'))==null?void 0:c.getAttribute("content"))??null:null}};he._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let xt=he;class ct extends xt{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(s,c,p){return this.channel(s).listen(c,p)}channel(s){return this.channels[s]||(this.channels[s]=new kt(this.pusher,s,this.options)),this.channels[s]}privateChannel(s){return this.channels["private-"+s]||(this.channels["private-"+s]=new se(this.pusher,"private-"+s,this.options)),this.channels["private-"+s]}encryptedPrivateChannel(s){return this.channels["private-encrypted-"+s]||(this.channels["private-encrypted-"+s]=new di(this.pusher,"private-encrypted-"+s,this.options)),this.channels["private-encrypted-"+s]}presenceChannel(s){return this.channels["presence-"+s]||(this.channels["presence-"+s]=new vi(this.pusher,"presence-"+s,this.options)),this.channels["presence-"+s]}leave(s){[s,"private-"+s,"private-encrypted-"+s,"presence-"+s].forEach(c=>{this.leaveChannel(c)})}leaveChannel(s){this.channels[s]&&(this.channels[s].unsubscribe(),delete this.channels[s])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const s=this.pusher.connection.state;switch(s){case"connected":case"connecting":return s;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(s){const c=()=>{s(this.connectionStatus())},p=["state_change","connected","disconnected"];return p.forEach(b=>{this.pusher.connection.bind(b,c)}),()=>{p.forEach(b=>{this.pusher.connection.unbind(b,c)})}}disconnect(){this.pusher.disconnect()}}class mi extends xt{constructor(){super(...arguments),this.channels={}}connect(){let s=this.getSocketIO();this.socket=s(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>
1{Object.values(this.channels).forEach(c=>{c.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(s,c,p){return this.channel(s).listen(c,p)}channel(s){return this.channels[s]||(this.channels[s]=new ae(this.socket,s,this.options)),this.channels[s]}privateChannel(s){return this.channels["private-"+s]||(this.channels["private-"+s]=new ce(this.socket,"private-"+s,this.options)),this.channels["private-"+s]}presenceChannel(s){return this.channels["presence-"+s]||(this.channels["presence-"+s]=new gi(this.socket,"presence-"+s,this.options)),this.channels["presence-"+s]}leave(s){[s,"private-"+s,"presence-"+s].forEach(c=>{this.leaveChannel(c)})}leaveChannel(s){this.channels[s]&&(this.channels[s].unsubscribe(),delete this.channels[s])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(s){const c=()=>{s(this.connectionStatus())},p=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return p.forEach(b=>{this.socket.on(b,c)}),()=>{p.forEach(b=>{this.socket.off(b,c)})}}disconnect(){this.socket.disconnect()}}class re extends xt{constructor(){super(...arguments),this.channels={}}connect(){}listen(s,c,p){return new ut}channel(s){return new ut}privateChannel(s){return new ue}encryptedPrivateChannel(s){return new yi}presenceChannel(s){return new _i}leave(s){}leaveChannel(s){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(s){return()=>{}}disconnect(){}}class Ci{constructor(s){this.options=s,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(s){return this.connector.channel(s)}connect(){if(this.options.broadcaster==="reverb")this.connector=new ct({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new ct(this.options);else if(this.options.broadcaster==="ably")this.connector=new ct({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new mi(this.options);else if(this.options.broadcaster==="null")this.connector=new re(this.options);else if(typeof this.options.broadcaster=="function"&&pi(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(s){return this.connector.presenceChannel(s)}leave(s){this.connector.leave(s)}leaveChannel(s){this.connector.leaveChannel(s)}leaveAllChannels(){for(const s in this.connector.channels)this.leaveChannel(s)}listen(s,c,p){return this.connector.listen(s,c,p)}private(s){return this.connector.privateChannel(s)}encryptedPrivate(s){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(s);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(s){return s instanceof ct||s instanceof re}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&Vue!=null&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((s,c)=>{this.socketId()&&s.headers.set("X-Socket-ID",this.socketId()),c()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(s=>(this.socketId()&&(s.headers["X-Socket-Id"]=this.socketId()),s))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((s,c,p)=>{this.socketId()&&p.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",s=>{s.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var Ct={exports:{}};var ie;function bi(){return ie||(ie=1,(function(E,s){(function(p,b){E.exports=b()})(window,function(){return(function(c){var p={};function b(y){if(p[y])return p[y].exports;var d=p[y]={i:y,l:!1,exports:{}};return c[y].call(d.exports,d,d.exports,b),d.l=!0,d.exports}return b.m=c,b.c=p,b.d=function(y,d,R){b.o(y,d)||Object.defineProperty(y,d,{enumerable:!0,get:R})},b.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},b.t=function(y,d){if(d&1&&(y=b(y)),d&8||d&4&&typeof y=="object"&&y&&y.__esModule)return y;var R=Object.create(null);if(b.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:y}
1),d&2&&typeof y!="string")for(var S in y)b.d(R,S,(function(W){return y[W]}).bind(null,S));return R},b.n=function(y){var d=y&&y.__esModule?function(){return y.default}:function(){return y};return b.d(d,"a",d),d},b.o=function(y,d){return Object.prototype.hasOwnProperty.call(y,d)},b.p="",b(b.s=2)})([(function(c,p,b){var y=this&&this.__extends||(function(){var g=function(h,l){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,O){m.__proto__=O}||function(m,O){for(var I in O)O.hasOwnProperty(I)&&(m[I]=O[I])},g(h,l)};return function(h,l){g(h,l);function m(){this.constructor=h}h.prototype=l===null?Object.create(l):(m.prototype=l.prototype,new m)}})();Object.defineProperty(p,"__esModule",{value:!0});var d=256,R=(function(){function g(h){h===void 0&&(h="="),this._paddingCharacter=h}return g.prototype.encodedLength=function(h){return this._paddingCharacter?(h+2)/3*4|0:(h*8+5)/6|0},g.prototype.encode=function(h){for(var l="",m=0;m<h.length-2;m+=3){var O=h[m]<<16|h[m+1]<<8|h[m+2];l+=this._encodeByte(O>>>18&63),l+=this._encodeByte(O>>>12&63),l+=this._encodeByte(O>>>6&63),l+=this._encodeByte(O>>>0&63)}var I=h.length-m;if(I>0){var O=h[m]<<16|(I===2?h[m+1]<<8:0);l+=this._encodeByte(O>>>18&63),l+=this._encodeByte(O>>>12&63),I===2?l+=this._encodeByte(O>>>6&63):l+=this._paddingCharacter||"",l+=this._paddingCharacter||""}return l},g.prototype.maxDecodedLength=function(h){return this._paddingCharacter?h/4*3|0:(h*6+7)/8|0},g.prototype.decodedLength=function(h){return this.maxDecodedLength(h.length-this._getPaddingLength(h))},g.prototype.decode=function(h){if(h.length===0)return new Uint8Array(0);for(var l=this._getPaddingLength(h),m=h.length-l,O=new Uint8Array(this.maxDecodedLength(m)),I=0,N=0,U=0,F=0,H=0,D=0,M=0;N<m-4;N+=4)F=this._decodeChar(h.charCodeAt(N+0)),H=this._decodeChar(h.charCodeAt(N+1)),D=this._decodeChar(h.charCodeAt(N+2)),M=this._decodeChar(h.charCodeAt(N+3)),O[I++]=F<<2|H>>>4,O[I++]=H<<4|D>>>2,O[I++]=D<<6|M,U|=F&d,U|=H&d,U|=D&d,U|=M&d;if(N<m-1&&(F=this._decodeChar(h.charCodeAt(N)),H=this._decodeChar(h.charCodeAt(N+1)),O[I++]=F<<2|H>>>4,U|=F&d,U|=H&d),N<m-2&&(D=this._decodeChar(h.charCodeAt(N+2)),O[I++]=H<<4|D>>>2,U|=D&d),N<m-3&&(M=this._decodeChar(h.charCodeAt(N+3)),O[I++]=D<<6|M,U|=M&d),U!==0)throw new Error("Base64Coder: incorrect characters for decoding");return O},g.prototype._encodeByte=function(h){var l=h;return l+=65,l+=25-h>>>8&6,l+=51-h>>>8&-75,l+=61-h>>>8&-15,l+=62-h>>>8&3,String.fromCharCode(l)},g.prototype._decodeChar=function(h){var l=d;return l+=(42-h&h-44)>>>8&-d+h-43+62,l+=(46-h&h-48)>>>8&-d+h-47+63,l+=(47-h&h-58)>>>8&-d+h-48+52,l+=(64-h&h-91)>>>8&-d+h-65+0,l+=(96-h&h-123)>>>8&-d+h-97+26,l},g.prototype._getPaddingLength=function(h){var l=0;if(this._paddingCharacter){for(var m=h.length-1;m>=0&&h[m]===this._paddingCharacter;m--)l++;if(h.length<4||l>2)throw new Error("Base64Coder: incorrect padding")}return l},g})();p.Coder=R;var S=new R;function W(g){return S.encode(g)}p.encode=W;function P(g){return S.decode(g)}p.decode=P;var k=(function(g){y(h,g);function h(){return g!==null&&g.apply(this,arguments)||this}return h.prototype._encodeByte=function(l){var m=l;return m+=65,m+=25-l>>>8&6,m+=51-l>>>8&-75,m+=61-l>>>8&-13,m+=62-l>>>8&49,String.fromCharCode(m)},h.prototype._decodeChar=function(l){var m=d;return m+=(44-l&l-46)>>>8&-d+l-45+62,m+=(94-l&l-96)>>>8&-d+l-95+63,m+=(47-l&l-58)>>>8&-d+l-48+52,m+=(64-l&l-91)>>>8&-d+l-65+0,m+=(96-l&l-123)>>>8&-d+l-97+26,m},h})(R);p.URLSafeCoder=k;var C=new k;function T(g){return C.encode(g)}p.encodeURLSafe=T;function x(g){return C.decode(g)}p.decodeURLSafe=x,p.encodedLength=function(g){return S.encodedLength(g)},p.maxDecodedLength=function(g){return S.maxDecodedLength(g)},p.decodedLength=function(g){return S.decodedLength(g)}}),(function(c,p,b){Object.defineProperty(p,"__esModule",{value:!0});var y="utf8: invalid string",d="utf8: invalid source encoding";function R(P){for(var k=new Uint8Array(S(P)),C=0,T=0;T<P.length;T++){var x=P.charCodeAt(T);x<128?k[C++]=x:x<2048?(k[C++]=192|x>>6,k[C++]=128|x&63):x<55296?(k[C++]=224|x>>12,k[C++]=128|x>>6&63,k[C++]=128|x&63):(T++,x=(x&1023)<<10,x|=P.charCodeAt(T)&1023,x+=65536,k[C++]=240|x>>18,k[C++]=128|x>>12&63,k[C++]=128|x>>6&63,k[C++]=128|x&63)}return k}p.encode=R;function S(P){for(var k=0,C=0;C<P.length;C++){var T=P.charCodeAt(C);if(T<128)k+=1;else if(T<2048)k+=2;else if(T<55296)k+=3;else if(T<=57343){if(C>=P.length-1)throw new Error(y);C++,k+=4}else throw new Error(y)}return k}p.encodedLength=S;function W(P){for(var k=[],C=0;C<P.length;C++){var T=P[C];if(T&128){var x=void 0;if(T<224){if(C>=P.length)throw new Error(d);var g=P[++C];if((g&192)!==128)throw new Error(d);T=(T&31)<<6|g&63,x=128}else if(T<240){if(C>=P.length-1)throw new Error(d);var g=P[++C],h=P[++C];if((g&192)!==128||(h&192)!==128)throw new Error(d);T=(T&15)<<12|(g&63)<<6|h&63,x=2048}else if(T<248){if(C>=P.length-2)throw new Error(d);var g=P[++C],h=P[++C],l=P[++C];if((g&192)!==128||(h&192)!==128||(l&192)!==128)throw new Error(d);T=(T&15)<<18|(g&63)<<12|(h&63)<<6|l&63,x=65536}else throw new Error(d);if(T<x||T>=55296&&T<=57343)throw new Error(d);if(T>
1=65536){if(T>1114111)throw new Error(d);T-=65536,k.push(String.fromCharCode(55296|T>>10)),T=56320|T&1023}}k.push(String.fromCharCode(T))}return k.join("")}p.decode=W}),(function(c,p,b){c.exports=b(3).default}),(function(c,p,b){b.r(p);var y=(function(){function e(t,n){this.lastId=0,this.prefix=t,this.name=n}return e.prototype.create=function(t){this.lastId++;var n=this.lastId,r=this.prefix+n,i=this.name+"["+n+"]",o=!1,a=function(){o||(t.apply(null,arguments),o=!0)};return this[n]=a,{number:n,id:r,name:i,callback:a}},e.prototype.remove=function(t){delete this[t.number]},e})(),d=new y("_pusher_script_","Pusher.ScriptReceivers"),R={VERSION:"7.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},S=R,W=(function(){function e(t){this.options=t,this.receivers=t.receivers||d,this.loading={}}return e.prototype.load=function(t,n,r){var i=this;if(i.loading[t]&&i.loading[t].length>0)i.loading[t].push(r);else{i.loading[t]=[r];var o=_.createScriptRequest(i.getPath(t,n)),a=i.receivers.create(function(u){if(i.receivers.remove(a),i.loading[t]){var v=i.loading[t];delete i.loading[t];for(var f=function(L){L||o.cleanup()},w=0;w<v.length;w++)v[w](u,f)}});o.send(a)}},e.prototype.getRoot=function(t){var n,r=_.getDocument().location.protocol;return t&&t.useTLS||r==="https:"?n=this.options.cdn_https:n=this.options.cdn_http,n.replace(/\/*$/,"")+"/"+this.options.version},e.prototype.getPath=function(t,n){return this.getRoot(n)+"/"+t+this.options.suffix+".js"},e})(),P=W,k=new y("_pusher_dependencies","Pusher.DependenciesReceivers"),C=new P({cdn_http:S.cdn_http,cdn_https:S.cdn_https,version:S.VERSION,suffix:S.dependency_suffix,receivers:k}),T={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},x=function(e){var t="See:",n=T.urls[e];if(!n)return"";var r;return n.fullUrl?r=n.fullUrl:n.path&&(r=T.baseUrl+n.path),r?t+" "+r:""},g={buildLogSuffix:x},h;(function(e){e.UserAuthentication="user-authentication",e.ChannelAuthorization="channel-authorization"})(h||(h={}));var l=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),m=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),O=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),I=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),N=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),U=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),F=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),H=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),D=(function(e){l(t,e);function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return t})(Error),M=(function(e){l(t,e);function t(n,r){var i=this.constructor,o=e.call(this,r)||this;return o.status=n,Object.setPrototypeOf(o,i.prototype),o}return t})(Error),fe=function(e,t,n,r,i){var o=_.createXHR();o.open("POST",n.endpoint,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var a in n.headers)o.setRequestHeader(a,n.headers[a]);if(n.headersProvider!=null){var u=n.headersProvider();for(var a in u)o.setRequestHeader(a,u[a])}return o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200){var v=void 0,f=!1;try{v=JSON.parse(o.responseText),f=!0}catch{i(new M(200,"JSON returned from "+r.toString()+" endpoint was invali
1d, yet status code was 200. Data was: "+o.responseText),null)}f&&i(null,v)}else{var w="";switch(r){case h.UserAuthentication:w=g.buildLogSuffix("authenticationEndpoint");break;case h.ChannelAuthorization:w="Clients must be authorized to join private or presence channels. "+g.buildLogSuffix("authorizationEndpoint");break}i(new M(o.status,"Unable to retrieve auth string from "+r.toString()+" endpoint - "+("received status: "+o.status+" from "+n.endpoint+". "+w)),null)}},o.send(t),o},pe=fe;function de(e){return _e(ge(e))}var Z=String.fromCharCode,rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ve=function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?Z(192|t>>>6)+Z(128|t&63):Z(224|t>>>12&15)+Z(128|t>>>6&63)+Z(128|t&63)},ge=function(e){return e.replace(/[^\x00-\x7F]/g,ve)},ye=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[rt.charAt(n>>>18),rt.charAt(n>>>12&63),t>=2?"=":rt.charAt(n>>>6&63),t>=1?"=":rt.charAt(n&63)];return r.join("")},_e=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,ye)},me=(function(){function e(t,n,r,i){var o=this;this.clear=n,this.timer=t(function(){o.timer&&(o.timer=i(o.timer))},r)}return e.prototype.isRunning=function(){return this.timer!==null},e.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},e})(),Pt=me,Ot=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();function be(e){window.clearTimeout(e)}function we(e){window.clearInterval(e)}var V=(function(e){Ot(t,e);function t(n,r){return e.call(this,setTimeout,be,n,function(i){return r(),null})||this}return t})(Pt),Se=(function(e){Ot(t,e);function t(n,r){return e.call(this,setInterval,we,n,function(i){return r(),i})||this}return t})(Pt),Ce={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(e){return new V(0,e)},method:function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){return n[e].apply(n,t.concat(arguments))}}},j=Ce;function q(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var i=t[r];for(var o in i)i[o]&&i[o].constructor&&i[o].constructor===Object?e[o]=q(e[o]||{},i[o]):e[o]=i[o]}return e}function Te(){for(var e=["Pusher"],t=0;t<arguments.length;t++)typeof arguments[t]=="string"?e.push(arguments[t]):e.push(it(arguments[t]));return e.join(" : ")}function At(e,t){var n=Array.prototype.indexOf;if(e===null)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}function B(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)}function Et(e){var t=[];return B(e,function(n,r){t.push(r)}),t}function ke(e){var t=[];return B(e,function(n){t.push(n)}),t}function tt(e,t,n){for(var r=0;r<e.length;r++)t.call(n||window,e[r],r,e)}function Lt(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r,e,n));return n}function xe(e,t){var n={};return B(e,function(r,i){n[i]=t(r)}),n}function Rt(e,t){t=t||function(i){return!!i};for(var n=[],r=0;r<e.length;r++)t(e[r],r,e,n)&&n.push(e[r]);return n}function It(e,t){var n={};return B(e,function(r,i){(t&&t(r,i,e,n)||r)&&(n[i]=r)}),n}function Pe(e){var t=[];return B(e,function(n,r){t.push([r,n])}),t}function jt(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1}function Oe(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0}function Ae(e){return xe(e,function(t){return typeof t=="object"&&(t=it(t)),encodeURIComponent(de(t.toString()))})}function Ee(e){var t=It(e,function(r){return r!==void 0}),n=Lt(Pe(Ae(t)),j.method("join","=")).join("&");return n}function Le(e){var t=[],n=[];return(function r(i,o){var a,u,v;switch(typeof i){case"object":if(!i)return null;for(a=0;a<t.length;a+=1)if(t[a]===i)return{$ref:n[a]};if(t.push(i),n.push(o),Object.prototype.toString.apply(i)==="[object Array]")for(v=[],a=0;a<i.length;a+=1)v[a]=r(i[a],o+"["+a+"]");else{v={};for(u in i)Object.prototype.hasOwnProperty.call(i,u)&&(v[u]=r(i[u],o+"["+JSON.stringify(u)+"]"))}return v;case"number":case"string":case"boolean":return i}})(e,"$")}function it(e){try{return JSON.stringify(e)}catch{return JSON.stringify(Le(e))}}var Re=(function(){function e(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLog,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogWarn,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogError,t)},e.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},e.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},e.prototype.log=function(t){var n=Te.apply(this,arguments);if(bt.log)bt.log(n);else if(bt.logToConsole){var r=t.bind(this);r(n)}},e})(),A=new Re,Ie=function(e,t,n,r,i){(n.headers!==void 0||n.headersProvider!=null)&&A.warn("To send headers with the "+r.toString()+" request, you must use AJAX, rather than JSONP.");var o=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var a=e.getDocument(),u=a.createElement("script");e.auth_callbacks[o]=function(w){i(null,w)};var v="Pusher.auth_callbacks['"+o+"']";u.src=n.endpoint+"?callback="+encodeURIComponent(v)+"&"+t;var f=a.getElementsByTagName("head")[0]||a.documentElement;f.insertBefore(u,f.firstChild)},je=Ie,Ne=(function(){function e(t){this.src=t}return e.prototype.send=function(t){var n=this,r="Error loading "+n.src;n.script=document.createElement("script"),n.script.id=t.id,n.script.src=n.src,n.script.type="text/javascript",n.script.charset="UTF-8",n.script.addEventListener?(n.script.onerror=function(){t.callback(r)},n.script.onload=function(){t.callback(null)}):n.script.onreadystatechange=function(){(n.script.readyState==="loaded"||n.script.readyState==="complete")&&t.callback(null)},n.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(n.errorScript=document.createElement("script"),n.errorScript.id=t.id+"_error",n.errorScript.text=t.name+"('"+r+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var i=document.getElementsByTagName("head")[0];i.insertBefore(n.script,i.firstChild),n.errorScript&&i.insertBefore(n.errorScript,n.script.nextSibling)},e.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},e})(),qe=Ne,Ue=(function(){function e(t,n){this.url=t,this.data=n}return e.prototype.send=function(t){if(!this.request){var n=Ee(this.data),r=this.url+"/"+t.number+"?"+n;this.request=_.createScriptRequest(r),this.request.send(t)}},e.prototype.cleanup=function(){this.request&&this.request.cleanup()},e})(),De=Ue,He=function(e,t){return function(n,r){var i="http"+(t?"s":"")+"://",o=i+(e.host||e.options.host)+e.options.path,a=_.createJSONPRequest(o,n),u=_.ScriptReceivers.create(function(v,f){d.remove(u),a.cleanup(),f&&f.host&&(e.host=f.host),r&&r(v,f)});a.send(u)}},Me={name:"jsonp",getAgent:He},ze=Me;function ht(e,t,n){var r=e+(t.useTLS?"s":""),i=t.useTLS?t.hostTLS:t.hostNonTLS;return r+"://"+i+n}function lt(e,t){var n="/app/"+e,r="?protocol="+S.PROTOCOL+"&client=js&ver
1sion="+S.VERSION+(t?"&"+t:"");return n+r}var Fe={getInitial:function(e,t){var n=(t.httpPath||"")+lt(e,"flash=false");return ht("ws",t,n)}},Be={getInitial:function(e,t){var n=(t.httpPath||"/pusher")+lt(e);return ht("http",t,n)}},Xe={getInitial:function(e,t){return ht("http",t,t.httpPath||"/pusher")},getPath:function(e,t){return lt(e)}},Je=(function(){function e(){this._callbacks={}}return e.prototype.get=function(t){return this._callbacks[ft(t)]},e.prototype.add=function(t,n,r){var i=ft(t);this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:n,context:r})},e.prototype.remove=function(t,n,r){if(!t&&!n&&!r){this._callbacks={};return}var i=t?[ft(t)]:Et(this._callbacks);n||r?this.removeCallback(i,n,r):this.removeAllCallbacks(i)},e.prototype.removeCallback=function(t,n,r){tt(t,function(i){this._callbacks[i]=Rt(this._callbacks[i]||[],function(o){return n&&n!==o.fn||r&&r!==o.context}),this._callbacks[i].length===0&&delete this._callbacks[i]},this)},e.prototype.removeAllCallbacks=function(t){tt(t,function(n){delete this._callbacks[n]},this)},e})(),We=Je;function ft(e){return"_"+e}var Ve=(function(){function e(t){this.callbacks=new We,this.global_callbacks=[],this.failThrough=t}return e.prototype.bind=function(t,n,r){return this.callbacks.add(t,n,r),this},e.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},e.prototype.unbind=function(t,n,r){return this.callbacks.remove(t,n,r),this},e.prototype.unbind_global=function(t){return t?(this.global_callbacks=Rt(this.global_callbacks||[],function(n){return n!==t}),this):(this.global_callbacks=[],this)},e.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},e.prototype.emit=function(t,n,r){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](t,n);var o=this.callbacks.get(t),a=[];if(r?a.push(n,r):n&&a.push(n),o&&o.length>0)for(var i=0;i<o.length;i++)o[i].fn.apply(o[i].context||window,a);else this.failThrough&&this.failThrough(t,n);return this},e})(),X=Ve,Ge=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$e=(function(e){Ge(t,e);function t(n,r,i,o,a){var u=e.call(this)||this;return u.initialize=_.transportConnectionInitializer,u.hooks=n,u.name=r,u.priority=i,u.key=o,u.options=a,u.state="new",u.timeline=a.timeline,u.activityTimeout=a.activityTimeout,u.id=u.timeline.generateUniqueID(),u}return t.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},t.prototype.supportsPing=function(){return!!this.hooks.supportsPing},t.prototype.connect=function(){var n=this;if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(i){return j.defer(function(){n.onError(i),n.changeState("closed")}),!1}return this.bindListeners(),A.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0},t.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},t.prototype.send=function(n){var r=this;return this.state==="open"?(j.defer(function(){r.socket&&r.socket.send(n)}),!0):!1},t.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},t.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},t.prototype.onError=function(n){this.emit("error",{type:"WebSocketError",error:n}),this.timeline.error(this.buildTimelineMessage({error:n.toString()}))},t.prototype.onClose=function(n){n?this.changeState("closed",{code:n.code,reason:n.reason,wasClean:n.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},t.prototype.onMessage=function(n){this.emit("message",n)}
1,t.prototype.onActivity=function(){this.emit("activity")},t.prototype.bindListeners=function(){var n=this;this.socket.onopen=function(){n.onOpen()},this.socket.onerror=function(r){n.onError(r)},this.socket.onclose=function(r){n.onClose(r)},this.socket.onmessage=function(r){n.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=function(){n.onActivity()})},t.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},t.prototype.changeState=function(n,r){this.state=n,this.timeline.info(this.buildTimelineMessage({state:n,params:r})),this.emit(n,r)},t.prototype.buildTimelineMessage=function(n){return q({cid:this.id},n)},t})(X),Qe=$e,Ke=(function(){function e(t){this.hooks=t}return e.prototype.isSupported=function(t){return this.hooks.isSupported(t)},e.prototype.createConnection=function(t,n,r,i){return new Qe(this.hooks,t,n,r,i)},e})(),K=Ke,Ye=new K({urls:Fe,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!_.getWebSocketAPI()},isSupported:function(){return!!_.getWebSocketAPI()},getSocket:function(e){return _.createWebSocket(e)}}),Nt={urls:Be,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},qt=q({getSocket:function(e){return _.HTTPFactory.createStreamingSocket(e)}},Nt),Ut=q({getSocket:function(e){return _.HTTPFactory.createPollingSocket(e)}},Nt),Dt={isSupported:function(){return _.isXHRSupported()}},Ze=new K(q({},qt,Dt)),tn=new K(q({},Ut,Dt)),en={ws:Ye,xhr_streaming:Ze,xhr_polling:tn},ot=en,nn=new K({file:"sockjs",urls:Xe,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(e,t){return new window.SockJS(e,null,{js_path:C.getPath("sockjs",{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),Ht={isSupported:function(e){var t=_.isXDRSupported(e.useTLS);return t}},rn=new K(q({},qt,Ht)),on=new K(q({},Ut,Ht));ot.xdr_streaming=rn,ot.xdr_polling=on,ot.sockjs=nn;var sn=ot,an=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),cn=(function(e){an(t,e);function t(){var n=e.call(this)||this,r=n;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1)),n}return t.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},t})(X),un=new cn,hn=(function(){function e(t,n,r){this.manager=t,this.transport=n,this.minPingDelay=r.minPingDelay,this.maxPingDelay=r.maxPingDelay,this.pingDelay=void 0}return e.prototype.createConnection=function(t,n,r,i){var o=this;i=q({},i,{activityTimeout:this.pingDelay});var a=this.transport.createConnection(t,n,r,i),u=null,v=function(){a.unbind("open",v),a.bind("closed",f),u=j.now()},f=function(w){if(a.unbind("closed",f),w.code===1002||w.code===1003)o.manager.reportDeath();else if(!w.wasClean&&u){var L=j.now()-u;L<2*o.maxPingDelay&&(o.manager.reportDeath(),o.pingDelay=Math.max(L/2,o.minPingDelay))}};return a.bind("open",v),a},e.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},e})(),ln=hn,Mt={decodeMessage:function(e){try{var t=JSON.parse(e.data),n=t.data;if(typeof n=="string")try{n=JSON.parse(t.data)}catch{}var r={event:t.event,channel:t.channel,data:n};return t.user_id&&(r.user_id=t.user_id),r}catch(i){throw{type:"MessageParseError",error:i,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=Mt.decodeMessage(e);if(t.event==="pusher:connection_established"){if(!t.data.activity_timeout)throw"No activity timeout specified in handshake";
1return{action:"connected",id:t.data.socket_id,activityTimeout:t.data.activity_timeout*1e3}}else{if(t.event==="pusher:error")return{action:this.getCloseAction(t.data),error:this.getCloseError(t.data)};throw"Invalid handshake"}},getCloseAction:function(e){return e.code<4e3?e.code>=1002&&e.code<=1004?"backoff":null:e.code===4e3?"tls_only":e.code<4100?"refused":e.code<4200?"backoff":e.code<4300?"retry":"refused"},getCloseError:function(e){return e.code!==1e3&&e.code!==1001?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}},G=Mt,fn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pn=(function(e){fn(t,e);function t(n,r){var i=e.call(this)||this;return i.id=n,i.transport=r,i.activityTimeout=r.activityTimeout,i.bindListeners(),i}return t.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.prototype.send=function(n){return this.transport.send(n)},t.prototype.send_event=function(n,r,i){var o={event:n,data:r};return i&&(o.channel=i),A.debug("Event sent",o),this.send(G.encodeMessage(o))},t.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},t.prototype.close=function(){this.transport.close()},t.prototype.bindListeners=function(){var n=this,r={message:function(o){var a;try{a=G.decodeMessage(o)}catch(u){n.emit("error",{type:"MessageParseError",error:u,data:o.data})}if(a!==void 0){switch(A.debug("Event recd",a),a.event){case"pusher:error":n.emit("error",{type:"PusherError",data:a.data});break;case"pusher:ping":n.emit("ping");break;case"pusher:pong":n.emit("pong");break}n.emit("message",a)}},activity:function(){n.emit("activity")},error:function(o){n.emit("error",o)},closed:function(o){i(),o&&o.code&&n.handleCloseEvent(o),n.transport=null,n.emit("closed")}},i=function(){B(r,function(o,a){n.transport.unbind(a,o)})};B(r,function(o,a){n.transport.bind(a,o)})},t.prototype.handleCloseEvent=function(n){var r=G.getCloseAction(n),i=G.getCloseError(n);i&&this.emit("error",i),r&&this.emit(r,{action:r,error:i})},t})(X),dn=pn,vn=(function(){function e(t,n){this.transport=t,this.callback=n,this.bindListeners()}return e.prototype.close=function(){this.unbindListeners(),this.transport.close()},e.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){t.unbindListeners();var r;try{r=G.processHandshake(n)}catch(i){t.finish("error",{error:i}),t.transport.close();return}r.action==="connected"?t.finish("connected",{connection:new dn(r.id,t.transport),activityTimeout:r.activityTimeout}):(t.finish(r.action,{error:r.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var r=G.getCloseAction(n)||"backoff",i=G.getCloseError(n);t.finish(r,{error:i})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},e.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},e.prototype.finish=function(t,n){this.callback(q({transport:this.transport,action:t},n))},e})(),gn=vn,yn=(function(){function e(t,n){this.timeline=t,this.options=n||{}}return e.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(_.TimelineTransport.getAgent(this,t),n)},e})(),_n=yn,mn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),bn=(function(e){mn(t,e);function t(n,r){var i=e.call(this,function(o,a){A.debug("No callbacks on "+n+" for "+o)})||this;return i.name=n,i.pusher=r,i.subscribed=!1,i.subscriptionPending=!1,i.subscriptionCancelled=!1,i}return t.prototype.authorize=function(n,r){return r(null,{auth:""})},t.prototype.trigger=function(n,r){if(n.indexOf("client-")!==0)throw new m
1("Event '"+n+"' does not start with 'client-'");if(!this.subscribed){var i=g.buildLogSuffix("triggeringClientEvents");A.warn("Client event triggered before channel 'subscription_succeeded' event . "+i)}return this.pusher.send_event(n,r,this.name)},t.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},t.prototype.handleEvent=function(n){var r=n.event,i=n.data;if(r==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(n);else if(r==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(n);else if(r.indexOf("pusher_internal:")!==0){var o={};this.emit(r,i,o)}},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",n.data)},t.prototype.handleSubscriptionCountEvent=function(n){n.data.subscription_count&&(this.subscriptionCount=n.data.subscription_count),this.emit("pusher:subscription_count",n.data)},t.prototype.subscribe=function(){var n=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(r,i){r?(n.subscriptionPending=!1,A.error(r.toString()),n.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof M?{status:r.status}:{}))):n.pusher.send_event("pusher:subscribe",{auth:i.auth,channel_data:i.channel_data,channel:n.name})}))},t.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},t.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},t.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},t})(X),pt=bn,wn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Sn=(function(e){wn(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.authorize=function(n,r){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:n},r)},t})(pt),dt=Sn,Cn=(function(){function e(){this.reset()}return e.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},e.prototype.each=function(t){var n=this;B(this.members,function(r,i){t(n.get(i))})},e.prototype.setMyID=function(t){this.myID=t},e.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},e.prototype.addMember=function(t){return this.get(t.user_id)===null&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},e.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},e.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},e})(),Tn=Cn,kn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xn=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(w){try{f(r.next(w))}catch(L){a(L)}}function v(w){try{f(r.throw(w))}catch(L){a(L)}}function f(w){w.done?o(w.value):i(w.value).then(u,v)}f((r=r.apply(e,t||[])).next())})},Pn=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(w){return v([f,w])}}function v(f){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(w){f=[6,w],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},On=(function(e){kn(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.members=new Tn,i}return t.prototype.authorize=function(n,r){var i=this;e.prototype.authorize.call(this,n,function(o,a){return xn(i,void 0,void 0,function(){var u,v;return Pn(this,function(f){switch(f.label){case 0:return o?[3,3]:(a=a,a.channel_data==null?[3,1]:(u=JSON.parse(a.channel_data),this.members.setMyID(u.user_id),[3,3]));case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(f.sent(),this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else return v=g.buildLogSuffix("authorizationEndpoint"),A.error("Invalid auth response for channel '"+this.name+"', "+("expected 'channel_data' field. "+v+", ")+"or the user should be signed in."),r("Invalid auth response"),[2];f.label=3;case 3:return r(o,a),[2]}})})})},t.prototype.handleEvent=function(n){var r=n.event;if(r.indexOf("pusher_internal:")===0)this.handleInternalEvent(n);else{var i=n.data,o={};
1n.user_id&&(o.user_id=n.user_id),this.emit(r,i,o)}},t.prototype.handleInternalEvent=function(n){var r=n.event,i=n.data;switch(r){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(n);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(n);break;case"pusher_internal:member_added":var o=this.members.addMember(i);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var a=this.members.removeMember(i);a&&this.emit("pusher:member_removed",a);break}},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(n.data),this.emit("pusher:subscription_succeeded",this.members))},t.prototype.disconnect=function(){this.members.reset(),e.prototype.disconnect.call(this)},t})(dt),An=On,En=b(1),vt=b(0),Ln=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rn=(function(e){Ln(t,e);function t(n,r,i){var o=e.call(this,n,r)||this;return o.key=null,o.nacl=i,o}return t.prototype.authorize=function(n,r){var i=this;e.prototype.authorize.call(this,n,function(o,a){if(o){r(o,a);return}var u=a.shared_secret;if(!u){r(new Error("No shared_secret key in auth payload for encrypted channel: "+i.name),null);return}i.key=Object(vt.decode)(u),delete a.shared_secret,r(null,a)})},t.prototype.trigger=function(n,r){throw new F("Client events are not currently supported for encrypted channels")},t.prototype.handleEvent=function(n){var r=n.event,i=n.data;if(r.indexOf("pusher_internal:")===0||r.indexOf("pusher:")===0){e.prototype.handleEvent.call(this,n);return}this.handleEncryptedEvent(r,i)},t.prototype.handleEncryptedEvent=function(n,r){var i=this;if(!this.key){A.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!r.ciphertext||!r.nonce){A.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+r);return}var o=Object(vt.decode)(r.ciphertext);if(o.length<this.nacl.secretbox.overheadLength){A.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+o.length);return}var a=Object(vt.decode)(r.nonce);if(a.length<this.nacl.secretbox.nonceLength){A.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+a.length);return}var u=this.nacl.secretbox.open(o,a,this.key);if(u===null){A.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,function(v,f){if(v){A.error("Failed to make a request to the authEndpoint: "+f+". Unable to fetch new key, so dropping encrypted event");return}if(u=i.nacl.secretbox.open(o,a,i.key),u===null){A.error("Failed to decrypt event with new key. Dropping encrypted event");return}i.emit(n,i.getDataToEmit(u))});return}this.emit(n,this.getDataToEmit(u))},t.prototype.getDataToEmit=function(n){var r=Object(En.decode)(n);try{return JSON.parse(r)}catch{return r}},t})(dt),In=Rn,jn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nn=(function(e){jn(t,e);function t(n,r){var i=e.call(this)||this;i.state="initialized",i.connection=null,i.key=n,i.options=r,i.timeline=i.options.timeline,i.usingTLS=i.options.useTLS,i.errorCallbacks=i.buildErrorCallbacks(),i.connectionCallbacks=i.buildConnectionCallbacks(i.errorCallbacks),i.handshakeCallbacks=i.buildHandshakeCallbacks(i.errorCallbacks);var o=_.getNetwork();return o.bind("online",function(){i.timeline.info({netinfo:"online"}),(i.state==="connecting"||i.state==="unavailable")&&i.retryIn(0)}),o.bind("offline",function(){i.timeline.info({netinfo:"offline"}),i.connection&&i.sendActivityCheck()}),i.updateStrategy(),i}return t.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},t.prototype.send=function(n){return this.connection?this.connection.send(n):!1},t.prototype.send_event=function(n,r,i){return this.connection?this.connection.send_event(n,r,i):!1},t.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},t.prototype.isUsingTLS=function(){return this.usingTLS},t.prototype.startConnecting=function(){var n=this,r=function(i,o){i?n.runner=n.strategy.connect(0,r):o.action==="error"?(n.emit("error",{type:"HandshakeError",error:o.error}),n.timeline.error({handshakeError:o.error})):(n.abortConnecting(),n.handshakeCallbacks[o.action](o))};this.runner=this.strategy.connect(0,r)},t.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},t.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var n=this.abandonConnection();n.close()}},t.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},t.prototype.retryIn=function(n){var r=this;this.timeline.info({action:"retry",delay:n}),n>
10&&this.emit("connecting_in",Math.round(n/1e3)),this.retryTimer=new V(n||0,function(){r.disconnectInternally(),r.connect()})},t.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},t.prototype.setUnavailableTimer=function(){var n=this;this.unavailableTimer=new V(this.options.unavailableTimeout,function(){n.updateState("unavailable")})},t.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.prototype.sendActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new V(this.options.pongTimeout,function(){n.timeline.error({pong_timed_out:n.options.pongTimeout}),n.retryIn(0)})},t.prototype.resetActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new V(this.activityTimeout,function(){n.sendActivityCheck()}))},t.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.prototype.buildConnectionCallbacks=function(n){var r=this;return q({},n,{message:function(i){r.resetActivityCheck(),r.emit("message",i)},ping:function(){r.send_event("pusher:pong",{})},activity:function(){r.resetActivityCheck()},error:function(i){r.emit("error",i)},closed:function(){r.abandonConnection(),r.shouldRetry()&&r.retryIn(1e3)}})},t.prototype.buildHandshakeCallbacks=function(n){var r=this;return q({},n,{connected:function(i){r.activityTimeout=Math.min(r.options.activityTimeout,i.activityTimeout,i.connection.activityTimeout||1/0),r.clearUnavailableTimer(),r.setConnection(i.connection),r.socket_id=r.connection.id,r.updateState("connected",{socket_id:r.socket_id})}})},t.prototype.buildErrorCallbacks=function(){var n=this,r=function(i){return function(o){o.error&&n.emit("error",{type:"WebSocketError",error:o.error}),i(o)}};return{tls_only:r(function(){n.usingTLS=!0,n.updateStrategy(),n.retryIn(0)}),refused:r(function(){n.disconnect()}),backoff:r(function(){n.retryIn(1e3)}),retry:r(function(){n.retryIn(0)})}},t.prototype.setConnection=function(n){this.connection=n;for(var r in this.connectionCallbacks)this.connection.bind(r,this.connectionCallbacks[r]);this.resetActivityCheck()},t.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var n in this.connectionCallbacks)this.connection.unbind(n,this.connectionCallbacks[n]);var r=this.connection;return this.connection=null,r}},t.prototype.updateState=function(n,r){var i=this.state;if(this.state=n,i!==n){var o=n;o==="connected"&&(o+=" with new socket ID "+r.socket_id),A.debug("State changed",i+" -> "+o),this.timeline.info({state:n,params:r}),this.emit("state_change",{previous:i,current:n}),this.emit(n,r)}},t.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},t})(X),qn=Nn,Un=(function(){function e(){this.channels={}}return e.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=Hn(t,n)),this.channels[t]},e.prototype.all=function(){return ke(this.channels)},e.prototype.find=function(t){return this.channels[t]},e.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},e.prototype.disconnect=function(){B(this.channels,function(t){t.disconnect()})},e})(),Dn=Un;function Hn(e,t){if(e.indexOf("private-encrypted-")===0){if(t.config.nacl)return J.createEncryptedChannel(e,t,t.config.nacl);var n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",r=g.buildLogSuffix("encryptedChannelSupport");throw new F(n+". "+r)}else{if(e.indexOf("private-")===0)return J.createPrivateChannel(e,t);if(e.indexOf("presence-")===0)return J.createPresenceChannel(e,t);if(e.indexOf("#")===0)throw new O('Cannot create a channel with name "'+e+'".');return J.createChannel(e,t)}}var Mn={createChannels:function(){return new Dn},createConnectionManager:function(e,t){return new qn(e,t)},createChannel:function(e,t){return new pt(e,t)},createPrivateChannel:function(e,t){return new dt(e,t)},createPresenceChannel:function(e,t){return new An(e,t)},createEncryptedChannel:function(e,t,n){return new In(e,t,n)},createTimelineSender:function(e,t){return new _n(e,t)},createHandshake:function(e,t){return new gn(e,t)},createAssistantToTheTransportManager:function(e,t,n){return new ln(e,t,n
1)}},J=Mn,zn=(function(){function e(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return e.prototype.getAssistant=function(t){return J.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},e.prototype.isAlive=function(){return this.livesLeft>0},e.prototype.reportDeath=function(){this.livesLeft-=1},e})(),zt=zn,Fn=(function(){function e(t,n){this.strategies=t,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return e.prototype.isSupported=function(){return jt(this.strategies,j.method("isSupported"))},e.prototype.connect=function(t,n){var r=this,i=this.strategies,o=0,a=this.timeout,u=null,v=function(f,w){w?n(null,w):(o=o+1,r.loop&&(o=o%i.length),o<i.length?(a&&(a=a*2,r.timeoutLimit&&(a=Math.min(a,r.timeoutLimit))),u=r.tryStrategy(i[o],t,{timeout:a,failFast:r.failFast},v)):n(!0))};return u=this.tryStrategy(i[o],t,{timeout:a,failFast:this.failFast},v),{abort:function(){u.abort()},forceMinPriority:function(f){t=f,u&&u.forceMinPriority(f)}}},e.prototype.tryStrategy=function(t,n,r,i){var o=null,a=null;return r.timeout>0&&(o=new V(r.timeout,function(){a.abort(),i(!0)})),a=t.connect(n,function(u,v){u&&o&&o.isRunning()&&!r.failFast||(o&&o.ensureAborted(),i(u,v))}),{abort:function(){o&&o.ensureAborted(),a.abort()},forceMinPriority:function(u){a.forceMinPriority(u)}}},e})(),$=Fn,Bn=(function(){function e(t){this.strategies=t}return e.prototype.isSupported=function(){return jt(this.strategies,j.method("isSupported"))},e.prototype.connect=function(t,n){return Xn(this.strategies,t,function(r,i){return function(o,a){if(i[r].error=o,o){Jn(i)&&n(!0);return}tt(i,function(u){u.forceMinPriority(a.transport.priority)}),n(null,a)}})},e})(),gt=Bn;function Xn(e,t,n){var r=Lt(e,function(i,o,a,u){return i.connect(t,n(o,u))});return{abort:function(){tt(r,Wn)},forceMinPriority:function(i){tt(r,function(o){o.forceMinPriority(i)})}}}function Jn(e){return Oe(e,function(t){return!!t.error})}function Wn(e){!e.error&&!e.aborted&&(e.abort(),e.aborted=!0)}var Vn=(function(){function e(t,n,r){this.strategy=t,this.transports=n,this.ttl=r.ttl||1800*1e3,this.usingTLS=r.useTLS,this.timeline=r.timeline}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var r=this.usingTLS,i=$n(r),o=[this.strategy];if(i&&i.timestamp+this.ttl>=j.now()){var a=this.transports[i.transport];a&&(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),o.push(new $([a],{timeout:i.latency*2+1e3,failFast:!0})))}var u=j.now(),v=o.pop().connect(t,function f(w,L){w?(Ft(r),o.length>0?(u=j.now(),v=o.pop().connect(t,f)):n(w)):(Qn(r,L.transport.name,j.now()-u),n(null,L))});return{abort:function(){v.abort()},forceMinPriority:function(f){t=f,v&&v.forceMinPriority(f)}}},e})(),Gn=Vn;function yt(e){return"pusherTransport"+(e?"TLS":"NonTLS")}function $n(e){var t=_.getLocalStorage();if(t)try{var n=t[yt(e)];if(n)return JSON.parse(n)}catch{Ft(e)}return null}function Qn(e,t,n){var r=_.getLocalStorage();if(r)try{r[yt(e)]=it({timestamp:j.now(),transport:t,latency:n})}catch{}}function Ft(e){var t=_.getLocalStorage();if(t)try{delete t[yt(e)]}catch{}}var Kn=(function(){function e(t,n){var r=n.delay;this.strategy=t,this.options={delay:r}}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var r=this.strategy,i,o=new V(this.options.delay,function(){i=r.connect(t,n)});return{abort:function(){o.ensureAborted(),i&&i.abort()},forceMinPriority:function(a){t=a,i&&i.forceMinPriority(a)}}},e})(),st=Kn,Yn=(function(){function e(t,n,r){this.test=t,this.trueBranch=n,this.falseBranch=r}return e.prototype.isSupported=function(){var t=this.test()?this.trueBranch:this.falseBranch;return t.isSupported()},e.prototype.connect=function(t,n){var r=this.test()?this.trueBranch:this.falseBranch;return r.connect(t,n)},e})(),et=Yn,Zn=(function(){function e(t){this.strategy=t}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var r=this.strategy.connect(t,function(i,o){o&&r.abort(),n(i,o)});return r},e})(),tr=Zn;function nt(e){return function(){return e.isSupported()}}var er=function(e,t,n){var r={};function i(ee,ci,ui,hi,li){var ne=n(e,ee,ci,ui,hi,li);return r[ee]=ne,ne}var o=Object.assign({},t,{hostNonTLS:e.wsHost+":"+e.wsPort,hostTLS:e.wsHost+":"+e.wssPort,httpPath:e.wsPath}),a=Object.assign({},o,{useTLS:!0}),u=Object.assign({},t,{hostNonTLS:e.httpHost+":"+e.httpPort,hostTLS:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}),v={loop:!0,timeout:15e3,timeoutLimit:6e4},f=new zt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),w=new zt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),L=i("ws","ws",3,o,f),z=i("wss","ws",3,a,f),ri=i("sockjs","sockjs",1,u),$t=i("xhr_streaming","xhr_streaming",1,u,w),ii=i("xdr_streaming","xdr_streaming",1,u,w),Qt=i("xhr_polling","xhr_polling",1,u),oi=i("xdr_polling","xdr_polling",1,u),Kt=new $([L],v),si=new $([z],v),ai=new $([ri],v),Yt=new $([new et(nt($t),$t,ii)],v),Zt=new $([new et(nt(Qt),Qt,oi)],v),te=new $([new et(nt(Yt),new gt([Yt,new st(Zt,{delay:4e3})]),Zt)],v),wt=new et(nt(te),te,ai),St;return t.useTLS?St=new gt([Kt,new st(wt,{delay:2e3})]):St=new gt([Kt,new st(si,{delay:2e3}),new st(wt,{delay:5e3})]),new Gn(new tr(new et(nt(L),St,wt)),r,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},nr=er,rr=(function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.useTLS?"s":"")})),e.hooks.isInitialized()?e.changeState("initialized"):e.hooks.file?(e.changeState("initializing"),C.load(e.hooks.file,{useTLS:e.options.useTLS},function(t,n){e.hooks.isInitialized()?(e.changeState("initialized"),n(!0)):(t&&e.onError(t),e.onClose(),n(!1))})):e.onClose()}),ir={getRequest:function(e){var t=new window.XDomainRequest;return t.ontimeout=function(){e.emit("error",new I),e.close()},t.onerror=function(n){e.emit("error",n),e.close()},t.onprogress=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText)},t.onload=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText),e.emit("finished",200),e.close()},t},abortRequest:function(e){e.ontimeout=e.onerror=e.onprogress=e.onload=null,e.abort()}},or=ir,sr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
1t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ar=256*1024,cr=(function(e){sr(t,e);function t(n,r,i){var o=e.call(this)||this;return o.hooks=n,o.method=r,o.url=i,o}return t.prototype.start=function(n){var r=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){r.close()},_.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(n)},t.prototype.close=function(){this.unloader&&(_.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},t.prototype.onChunk=function(n,r){for(;;){var i=this.advanceBuffer(r);if(i)this.emit("chunk",{status:n,data:i});else break}this.isBufferTooLong(r)&&this.emit("buffer_too_long")},t.prototype.advanceBuffer=function(n){var r=n.slice(this.position),i=r.indexOf(` 2`);return i!==-1?(this.position+=i+1,r.slice(0,i)):null},t.prototype.isBufferTooLong=function(n){return this.position===n.length&&n.length>ar},t})(X),ur=cr,_t;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=3]="CLOSED"})(_t||(_t={}));var Q=_t,hr=1,lr=(function(){function e(t,n){this.hooks=t,this.session=Xt(1e3)+"/"+vr(8),this.location=fr(n),this.readyState=Q.CONNECTING,this.openStream()}return e.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},e.prototype.ping=function(){this.hooks.sendHeartbeat(this)},e.prototype.close=function(t,n){this.onClose(t,n,!0)},e.prototype.sendRaw=function(t){if(this.readyState===Q.OPEN)try{return _.createSocketRequest("POST",Bt(pr(this.location,this.session))).start(t),!0}catch{return!1}else return!1},e.prototype.reconnect=function(){this.closeStream(),this.openStream()},e.prototype.onClose=function(t,n,r){this.closeStream(),this.readyState=Q.CLOSED,this.onclose&&this.onclose({code:t,reason:n,wasClean:r})},e.prototype.onChunk=function(t){if(t.status===200){this.readyState===Q.OPEN&&this.onActivity();var n,r=t.data.slice(0,1);switch(r){case"o":n=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(t.data.slice(1)||"[]");for(var i=0;i<n.length;i++)this.onEvent(n[i]);break;case"m":n=JSON.parse(t.data.slice(1)||"null"),this.onEvent(n);break;case"h":this.hooks.onHeartbeat(this);break;case"c":n=JSON.parse(t.data.slice(1)||"[]"),this.onClose(n[0],n[1],!0);break}}},e.prototype.onOpen=function(t){this.readyState===Q.CONNECTING?(t&&t.hostname&&(this.location.base=dr(this.location.base,t.hostname)),this.readyState=Q.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},e.prototype.onEvent=function(t){this.readyState===Q.OPEN&&this.onmessage&&this.onmessage({data:t})},e.prototype.onActivity=function(){this.onactivity&&this.onactivity()},e.prototype.onError=function(t){this.onerror&&this.onerror(t)},e.prototype.openStream=function(){var t=this;this.stream=_.createSocketRequest("POST",Bt(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(n){t.onChunk(n)}),this.stream.bind("finished",function(n){t.hooks.onFinished(t,n)}),this.stream.bind("buffer_too_long",function(){t.reconnect()});try{this.stream.start()}catch(n){j.defer(function(){t.onError(n),t.onClose(1006,"Could not start streaming",!1)})}},e.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},e})();function fr(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}function pr(e,t){return e.base+"/"+t+"/xhr_send"}function Bt(e){var t=e.indexOf("?")===-1?"?":"&";return e+t+"t="+ +new Date+"&n="+hr++}function dr(e,t){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);return n[1]+t+n[3]}function Xt(e){return _.randomInt(e)}function vr(e){for(var t=[],n=0;n<e;n++)t.push(Xt(32).toString(32));return t.join("")}var gr=lr,yr={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr_streaming"+e.queryString},onHeartbeat:function(e){e.sendRaw("[]")},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){e.onClose(1006,"Connection interrupted ("+t+")",!1)}},_r=yr,mr={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr"+e.queryString}
2,onHeartbeat:function(){},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){t===200?e.reconnect():e.onClose(1006,"Connection interrupted ("+t+")",!1)}},br=mr,wr={getRequest:function(e){var t=_.getXHRAPI(),n=new t;return n.onreadystatechange=n.onprogress=function(){switch(n.readyState){case 3:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText),e.emit("finished",n.status),e.close();break}},n},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},Sr=wr,Cr={createStreamingSocket:function(e){return this.createSocket(_r,e)},createPollingSocket:function(e){return this.createSocket(br,e)},createSocket:function(e,t){return new gr(e,t)},createXHR:function(e,t){return this.createRequest(Sr,e,t)},createRequest:function(e,t,n){return new ur(e,t,n)}},Jt=Cr;Jt.createXDR=function(e,t){return this.createRequest(or,e,t)};var Tr=Jt,kr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:d,DependenciesReceivers:k,getDefaultStrategy:nr,Transports:sn,transportConnectionInitializer:rr,HTTPFactory:Tr,TimelineTransport:ze,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(e){var t=this;window.Pusher=e;var n=function(){t.onDocumentBody(e.ready)};window.JSON?n():C.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:pe,jsonp:je}},onDocumentBody:function(e){var t=this;document.body?e():setTimeout(function(){t.onDocumentBody(e)},0)},createJSONPRequest:function(e,t){return new De(e,t)},createScriptRequest:function(e){return new qe(e)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var e=this.getXHRAPI();return new e},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return un},createWebSocket:function(e){var t=this.getWebSocketAPI();return new t(e)},createSocketRequest:function(e,t){if(this.isXHRSupported())return this.HTTPFactory.createXHR(e,t);if(this.isXDRSupported(t.indexOf("https:")===0))return this.HTTPFactory.createXDR(e,t);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var e=this.getXHRAPI();return!!e&&new e().withCredentials!==void 0},isXDRSupported:function(e){var t=e?"https:":"http:",n=this.getProtocol();return!!window.XDomainRequest&&n===t},addUnloadListener:function(e){window.addEventListener!==void 0?window.addEventListener("unload",e,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",e)},removeUnloadListener:function(e){window.addEventListener!==void 0?window.removeEventListener("unload",e,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",e)},randomInt:function(e){var t=function(){var n=window.crypto||window.msCrypto,r=n.getRandomValues(new Uint32Array(1))[0];return r/Math.pow(2,32)};return Math.floor(t()*e)}},_=kr,mt;(function(e){e[e.ERROR=3]="ERROR",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG"})(mt||(mt={}));var at=mt,xr=(function(){function e(t,n,r){this.key=t,this.session=n,this.events=[],this.options=r||{},this.sent=0,this.uniqueID=0}return e.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(q({},n,{timestamp:j.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},e.prototype.error=function(t){this.log(at.ERROR,t)},e.prototype.info=function(t){this.log(at.INFO,t)},e.prototype.debug=function(t){this.log(at.DEBUG,t)},e.prototype.isEmpty=function(){return this.events.length===0},e.prototype.send=function(t,n){var r=this,i=q({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(i,function(o,a){o||r.sent++,n&&n(o,a)}),!0},e.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},e})(),Pr=xr,Or=(function(){function e(t,n,r,i){this.name=t,this.priority=n,this.transport=r,this.options=i||{}}return e.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},e.prototype.connect=function(t,n){var r=this;
2if(this.isSupported()){if(this.priority<t)return Wt(new N,n)}else return Wt(new D,n);var i=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),a=null,u=function(){o.unbind("initialized",u),o.connect()},v=function(){a=J.createHandshake(o,function(z){i=!0,L(),n(null,z)})},f=function(z){L(),n(z)},w=function(){L();var z;z=it(o),n(new U(z))},L=function(){o.unbind("initialized",u),o.unbind("open",v),o.unbind("error",f),o.unbind("closed",w)};return o.bind("initialized",u),o.bind("open",v),o.bind("error",f),o.bind("closed",w),o.initialize(),{abort:function(){i||(L(),a?a.close():o.close())},forceMinPriority:function(z){i||r.priority<z&&(a?a.close():o.close())}}},e})(),Ar=Or;function Wt(e,t){return j.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var Er=_.Transports,Lr=function(e,t,n,r,i,o){var a=Er[n];if(!a)throw new H(n);var u=(!e.enabledTransports||At(e.enabledTransports,t)!==-1)&&(!e.disabledTransports||At(e.disabledTransports,t)===-1),v;return u?(i=Object.assign({ignoreNullOrigin:e.ignoreNullOrigin},i),v=new Ar(t,r,o?o.getAssistant(a):a,i)):v=Rr,v},Rr={isSupported:function(){return!1},connect:function(e,t){var n=j.defer(function(){t(new D)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},Ir=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);for(var r in t.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t.params[r]);if(t.paramsProvider!=null){var i=t.paramsProvider();for(var r in i)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(i[r])}return n},jr=function(e){if(typeof _.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var r=Ir(t,e);_.getAuthorizers()[e.transport](_,r,e,h.UserAuthentication,n)}},Nr=jr,qr=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);n+="&channel_name="+encodeURIComponent(e.channelName);for(var r in t.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t.params[r]);if(t.paramsProvider!=null){var i=t.paramsProvider();for(var r in i)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(i[r])}return n},Ur=function(e){if(typeof _.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var r=qr(t,e);_.getAuthorizers()[e.transport](_,r,e,h.ChannelAuthorization,n)}},Dr=Ur,Hr=function(e,t,n){var r={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return function(i,o){var a=e.channel(i.channelName),u=n(a,r);u.authorize(i.socketId,o)}},Y=function(){return Y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Y.apply(this,arguments)};function Mr(e,t){var n={activityTimeout:e.activityTimeout||S.activityTimeout,cluster:e.cluster||S.cluster,httpPath:e.httpPath||S.httpPath,httpPort:e.httpPort||S.httpPort,httpsPort:e.httpsPort||S.httpsPort,pongTimeout:e.pongTimeout||S.pongTimeout,statsHost:e.statsHost||S.stats_host,unavailableTimeout:e.unavailableTimeout||S.unavailableTimeout,wsPath:e.wsPath||S.wsPath,wsPort:e.wsPort||S.wsPort,wssPort:e.wssPort||S.wssPort,enableStats:Xr(e),httpHost:zr(e),useTLS:Br(e),wsHost:Fr(e),userAuthenticator:Jr(e),channelAuthorizer:Vr(e,t)};return"disabledTransports"in e&&(n.disabledTransports=e.disabledTransports),"enabledTransports"in e&&(n.enabledTransports=e.enabledTransports),"ignoreNullOrigin"in e&&(n.ignoreNullOrigin=e.ignoreNullOrigin),"timelineParams"in e&&(n.timelineParams=e.timelineParams),"nacl"in e&&(n.nacl=e.nacl),n}function zr(e){return e.httpHost?e.httpHost:e.cluster?"sockjs-"+e.cluster+".pusher.com":S.httpHost}function Fr(e){return e.wsHost?e.wsHost:e.cluster?Vt(e.cluster):Vt(S.cluster)}function Vt(e){return"ws-"+e+".pusher.com"}function Br(e){return _.getProtocol()==="https:"?!0:e.forceTLS!==!1}function Xr(e){return"enableStats"in e?e.enableStats:"disableStats"in e?!e.disableStats:!1}function Jr(e){var t=Y(Y({},S.userAuthentication),e.userAuthentication);return"customHandler"in t&&t.customHandler!=null?t.customHandler:Nr(t)}function Wr(e,t){var n;return"channelAuthorization"in e?n=Y(Y({},S.channelAuthorization),e.channelAuthorization):(n={transport:e.authTransport||S.authTransport,endpoint:e.authEndpoint||S.authEndpoint},"auth"in e&&("params"in e.auth&&(n.params=e.auth.params),"headers"in e.auth&&(n.headers=e.auth.headers)),"authorizer"in e&&(n.customHandler=Hr(t,n,e.authorizer))),n}function Vr(e,t){var n=Wr(e,t);return"customHandler"in n&&n.customHandler!=null?n.customHandler:Dr(n)}var Gr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
2t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$r=(function(e){Gr(t,e);function t(n){var r=e.call(this,function(i,o){A.debug("No callbacks on watchlist events for "+i)})||this;return r.pusher=n,r.bindWatchlistInternalEvent(),r}return t.prototype.handleEvent=function(n){var r=this;n.data.events.forEach(function(i){r.emit(i.name,i)})},t.prototype.bindWatchlistInternalEvent=function(){var n=this;this.pusher.connection.bind("message",function(r){var i=r.event;i==="pusher_internal:watchlist_events"&&n.handleEvent(r)})},t})(X),Qr=$r;function Kr(){var e,t,n=new Promise(function(r,i){e=r,t=i});return{promise:n,resolve:e,reject:t}}var Yr=Kr,Zr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ti=(function(e){Zr(t,e);function t(n){var r=e.call(this,function(i,o){A.debug("No callbacks on user for "+i)})||this;return r.signin_requested=!1,r.user_data=null,r.serverToUserChannel=null,r.signinDonePromise=null,r._signinDoneResolve=null,r._onAuthorize=function(i,o){if(i){A.warn("Error during signin: "+i),r._cleanup();return}r.pusher.send_event("pusher:signin",{auth:o.auth,user_data:o.user_data})},r.pusher=n,r.pusher.connection.bind("state_change",function(i){var o=i.previous,a=i.current;o!=="connected"&&a==="connected"&&r._signin(),o==="connected"&&a!=="connected"&&(r._cleanup(),r._newSigninPromiseIfNeeded())}),r.watchlist=new Qr(n),r.pusher.connection.bind("message",function(i){var o=i.event;o==="pusher:signin_success"&&r._onSigninSuccess(i.data),r.serverToUserChannel&&r.serverToUserChannel.name===i.channel&&r.serverToUserChannel.handleEvent(i)}),r}return t.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},t.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},t.prototype._onSigninSuccess=function(n){try{this.user_data=JSON.parse(n.user_data)}catch{A.error("Failed parsing user data after signin: "+n.user_data),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){A.error("user_data doesn't contain an id. user_data: "+this.user_data),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()},t.prototype._subscribeChannels=function(){var n=this,r=function(i){i.subscriptionPending&&i.subscriptionCancelled?i.reinstateSubscription():!i.subscriptionPending&&n.pusher.connection.state==="connected"&&i.subscribe()};this.serverToUserChannel=new pt("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(i,o){i.indexOf("pusher_internal:")===0||i.indexOf("pusher:")===0||n.emit(i,o)}),r(this.serverToUserChannel)},t.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},t.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&!(this.signinDonePromise&&!this.signinDonePromise.done)){var n=Yr(),r=n.promise,i=n.resolve;r.done=!1;var o=function(){r.done=!0};r.then(o).catch(o),this.signinDonePromise=r,this._signinDoneResolve=i}},t})(X),ei=ti,Gt=(function(){function e(t,n){var r=this;if(ni(t),n=n||{},!n.cluster&&!(n.wsHost||n.httpHost)){var i=g.buildLogSuffix("javascriptQuickStart");A.warn("You should always specify a cluster when connecting. "+i)}"disableStats"in n&&A.warn("The disableStats option is deprecated in favor of enableStats"),this.key=t,this.config=Mr(n,this),this.channels=J.createChannels(),this.global_emitter=new X,this.sessionID=_.randomInt(1e9),this.timeline=new Pr(this.key,this.sessionID,{cluster:this.config.cluster,features:e.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:at.INFO,version:S.VERSION}),this.config.enableStats&&(this.timelineSender=J.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+_.TimelineTransport.name}));var o=function(a){return _.getDefaultStrategy(r.config,a,Lr)};this.connection=J.createConnectionManager(this.key,{getStrategy:o,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){r.subscribeAll(),r.timelineSender&&r.timelineSender.send(r.connection.isUsingTLS())}),this.connection.bind("message",function(a){var u=a.event,v=u.indexOf("pusher_internal:")===0;if(a.channel){var f=r.channel(a.channel);f&&f.handleEvent(a)}v||r.global_emitter.emit(a.event,a.data)}),this.connection.bind("connecting",function(){r.channels.disconnect()}),this.connection.bind("disconnected",function(){r.channels.disconnect()}),this.connection.bind("error",function(a){A.warn(a)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),this.user=new ei(this),e.isReady&&this.connect()}return e.ready=function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()},e.getClientFeatures=function(){return Et(It({ws:_.Transports.ws},function(t){return t.isSupported({})}))},e.prototype.channel=function(t){return this.channels.find(t)},e.prototype.allChannels=function(){return this.channels.all()},e.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),n=this.timelineSender;this.timelineSenderTimer=new Se(6e4,function(){n.send(t)})}},e.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},e.prototype.bind=function(t,n,r){return this.global_emitter.bind(t,n,r),this},e.prototype.unbind=function(t,n,r){return this.global_emitter.unbind(t,n,r),this},e.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},e.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},e.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},e.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},e.prototype.subscribe=function(t){var n=this.channels.add(t,this);return n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.connection.state==="connected"&&n.subscribe(),n},e.prototype.unsubscribe=function(t){var n=this.channels.find(t);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(t),n&&n.subscribed&&n.unsubscribe())},e.prototype.send_event=function(t,n,r){return this.connection.send_event(t,n,r)},e.prototype.shouldUseTLS=function(){return this.config.useTLS},e.prototype.signin=function(){this.user.signin()},e.instances=[],e.isReady=!1,e.logToConsole=!1,e.Runtime=_,e.ScriptReceivers=_.ScriptReceivers,e.Depen
2denciesReceivers=_.DependenciesReceivers,e.auth_callbacks=_.auth_callbacks,e})(),bt=p.default=Gt;function ni(e){if(e==null)throw"You must pass your app key when you instantiate Pusher."}_.setup(Gt)})])})})(Ct)),Ct.exports}var wi=bi();const Ti=fi(wi);export{Ci as E,Ti as P};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.