xa-sultangames-9202.xyz Open in urlscan Pro
195.245.221.11  Public Scan

URL: https://xa-sultangames-9202.xyz/262.85e5420a1cd386eb246c.bundle.js
Submission: On November 21 via api from US — Scanned from CA

Form analysis 0 forms found in the DOM

Text Content

(self.webpackChunk=self.webpackChunk||[]).push([[262],{61328:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Centrifuge=void 0;const i=s(63196),r=s(74061),o=s(78144),c=s(74723),a=s(74266),h=s(55804),u=s(72390),l=s(11505),d=s(51422),_=s(35027),p=n(s(50343)),b={protocol:"json",token:null,getToken:null,data:null,debug:!1,name:"js",version:"",fetch:null,readableStream:null,websocket:null,eventsource:null,sockjs:null,sockjsOptions:{},emulationEndpoint:"/emulation",minReconnectDelay:500,maxReconnectDelay:2e4,timeout:5e3,maxServerPingDelay:1e4};class f extends p.default{constructor(e,t){super(),this._reconnectTimeout=null,this._refreshTimeout=null,this._serverPingTimeout=null,this.state=_.State.Disconnected,this._endpoint=e,this._emulation=!1,this._transports=[],this._currentTransportIndex=0,this._triedAllTransports=!1,this._transportWasOpen=!1,this._transport=null,this._transportClosed=!0,this._encoder=null,this._decoder=null,this._reconnectTimeout=null,this._reconnectAttempts=0,this._client=null,this._session="",this._node="",this._subs={},this._serverSubs={},this._commandId=0,this._commands=[],this._batching=!1,this._refreshRequired=!1,this._refreshTimeout=null,this._callbacks={},this._token=void 0,this._dispatchPromise=Promise.resolve(),this._serverPing=0,this._serverPingTimeout=null,this._sendPong=!1,this._promises={},this._promiseId=0,this._debugEnabled=!1,this._config=Object.assign(Object.assign({},b),t),this._configure(),this._debugEnabled?(this.on("state",(e=>{this._debug("client state",e.oldState,"->",e.newState)})),this.on("error",(e=>{this._debug("client error",e)}))):this.on("error",(function(){Function.prototype()}))}newSubscription(e,t){if(null!==this.getSubscription(e))throw new Error("Subscription to the channel "+e+" already exists");const s=new i.Subscription(this,e,t);return this._subs[e]=s,s}getSubscription(e){return this._getSub(e)}removeSubscription(e){e&&(e.state!==_.SubscriptionState.Unsubscribed&&e.unsubscribe(),this._removeSubscription(e))}subscriptions(){return this._subs}ready(e){return this.state===_.State.Disconnected?Promise.reject({code:r.errorCodes.clientDisconnected,message:"client disconnected"}):this.state===_.State.Connected?Promise.resolve():new Promise(((t,s)=>{const n={resolve:t,reject:s};e&&(n.timeout=setTimeout((function(){s({code:r.errorCodes.timeout,message:"timeout"})}),e)),this._promises[this._nextPromiseId()]=n}))}connect(){this._isConnected()?this._debug("connect called when already connected"):this._isConnecting()?this._debug("connect called when already connecting"):(this._reconnectAttempts=0,this._startConnecting())}disconnect(){this._disconnect(r.disconnectedCodes.disconnectCalled,"disconnect called",!1)}send(e){const t={send:{data:e}},s=this;return this._methodCall().then((function(){return s._transportSendCommands([t])?Promise.resolve():Promise.reject(s._createErrorObject(r.errorCodes.transportWriteError,"transport write error"))}))}rpc(e,t){const s={rpc:{method:e,data:t}},n=this;return this._methodCall().then((function(){return n._callPromise(s,(function(e){return{data:e.rpc.data}}))}))}publish(e,t){const s={publish:{channel:e,data:t}},n=this;return this._methodCall().then((function(){return n._callPromise(s,(function(){return{}}))}))}history(e,t){const s={history:this._getHistoryRequest(e,t)},n=this;return this._methodCall().then((function(){return n._callPromise(s,(function(t){const s=t.history,i=[];if(s.publications)for(let t=0;t<s.publications.length;t++)i.push(n._getPublicationContext(e,s.publications[t]));return{publications:i,epoch:s.epoch||"",offset:s.offset||0}}))}))}presence(e){const t={presence:{channel:e}},s=this;return this._methodCall().then((function(){return s._callPromise(t,(function(e){return{clients:e.presence.presence}}))}))}presenceStats(e){const t={presence_stats:{channel:e}},s=this;return this._methodCall().then((function(){return s._callPromise(t,(function(e){const t=e.presence_stats;return{numUsers:t.num_users,numClients:t.num_clients}}))}))}startBatching(){this._batching=!0}stopBatching(){const e=this;Promise.resolve().then((function(){Promise.resolve().then((function(){e._batching=!1,e._flush()}))}))}_debug(...e){this._debugEnabled&&(0,d.log)("debug",e)}_setFormat(e){if(!this._formatOverride(e)){if("protobuf"===e)throw new Error("not implemented by JSON-only Centrifuge client, use client with Protobuf support");this._encoder=new l.JsonEncoder,this._decoder=new l.JsonDecoder}}_formatOverride(e){return!1}_configure(){if(!("Promise"in globalThis))throw new Error("Promise polyfill required");if(!this._endpoint)throw new Error("endpoint configuration required");if("json"!==this._config.protocol&&"protobuf"!==this._config.protocol)throw new Error("unsupported protocol "+this._config.protocol);if(null!==this._config.token&&(this._token=this._config.token),this._setFormat("json"),"protobuf"===this._config.protocol&&this._setFormat("protobuf"),(!0===this._config.debug||"undefined"!=typeof localStorage&&localStorage.getItem("centrifuge.debug"))&&(this._debugEnabled=!0),this._debug("config",this._config),"string"==typeof this._endpoint);else{if(!("object"==typeof this._endpoint&&this._endpoint instanceof Array))throw new Error("unsupported url configuration type: only string or array of objects are supported");this._transports=this._endpoint,this._emulation=!0;for(const e in this._transports){const t=this._transports[e];if(!t.endpoint||!t.transport)throw new Error("malformed transport configuration");const s=t.transport;if(["websocket","http_stream","sse","sockjs","webtransport"].indexOf(s)<0)throw new Error("unsupported transport name: "+s)}}}_setState(e){if(this.state!==e){const t=this.state;return this.state=e,this.emit("state",{newState:e,oldState:t}),!0}return!1}_isDisconnected(){return this.state===_.State.Disconnected}_isConnecting(){return this.state===_.State.Connecting}_isConnected(){return this.state===_.State.Connected}_nextCommandId(){return++this._commandId}_getReconnectDelay(){const e=(0,d.backoff)(this._reconnectAttempts,this._config.minReconnectDelay,this._config.maxReconnectDelay);return this._reconnectAttempts+=1,e}_clearOutgoingRequests(){for(const e in this._callbacks)if(this._callbacks.hasOwnProperty(e)){const t=this._callbacks[e];clearTimeout(t.timeout);const s=t.errback;if(!s)continue;s({error:this._createErrorObject(r.errorCodes.connectionClosed,"connection closed")})}this._callbacks={}}_clearConnectedState(){this._client=null,this._clearServerPingTimeout(),this._clearRefreshTimeout();for(const e in this._subs){if(!this._subs.hasOwnProperty(e))continue;const t=this._subs[e];t.state===_.SubscriptionState.Subscribed&&t._setSubscribing(r.subscribingCodes.transportClosed,"transport closed")}for(const e in this._serverSubs)this._serverSubs.hasOwnProperty(e)&&this.emit("subscribing",{channel:e})}_handleWriteError(e){for(const t of e){const e=t.id;if(!(e in this._callbacks))continue;const s=this._callbacks[e];clearTimeout(this._callbacks[e].timeout),delete this._callbacks[e];(0,s.errback)({error:this._createErrorObject(r.errorCodes.transportWriteError,"transport write error")})}}_transportSendCommands(e){if(!e.length)return!0;if(!this._transport)return!1;try{this._transport.send(this._encoder.encodeCommands(e),this._session,this._node)}catch(t){return this._debug("error writing commands",t),this._handleWriteError(e),!1}return!0}_initializeTransport(){let e;null!==this._config.websocket?e=this._config.websocket:"function"!=typeof globalThis.WebSocket&&"object"!=typeof globalThis.WebSocket||(e=globalThis.WebSocket);let t=null;null!==this._config.sockjs?t=this._config.sockjs:void 0!==globalThis.SockJS&&(t=globalThis.SockJS);let s=null;null!==this._config.eventsource?s=this._config.eventsource:void 0!==globalThis.EventSource&&(s=globalThis.EventSource);let n=null;null!==this._config.fetch?n=this._config.fetch:void 0!==globalThis.fetch&&(n=globalThis.fetch);let i=null;if(null!==this._config.readableStream?i=this._config.readableStream:void 0!==globalThis.ReadableStream&&(i=globalThis.ReadableStream),this._emulation){this._currentTransportIndex>=this._transports.length&&(this._triedAllTransports=!0,this._currentTransportIndex=0);let r=0;for(;;){if(r>=this._transports.length)throw new Error("no supported transport found");const l=this._transports[this._currentTransportIndex],d=l.transport,_=l.endpoint;if("websocket"===d){if(this._debug("trying websocket transport"),this._transport=new c.WebsocketTransport(_,{websocket:e}),!this._transport.supported()){this._debug("websocket transport not available"),this._currentTransportIndex++,r++;continue}}else if("webtransport"===d){if(this._debug("trying webtransport transport"),this._transport=new u.WebtransportTransport(_,{webtransport:globalThis.WebTransport,decoder:this._decoder,encoder:this._encoder}),!this._transport.supported()){this._debug("webtransport transport not available"),this._currentTransportIndex++,r++;continue}}else if("http_stream"===d){if(this._debug("trying http_stream transport"),this._transport=new a.HttpStreamTransport(_,{fetch:n,readableStream:i,emulationEndpoint:this._config.emulationEndpoint,decoder:this._decoder,encoder:this._encoder}),!this._transport.supported()){this._debug("http_stream transport not available"),this._currentTransportIndex++,r++;continue}}else if("sse"===d){if(this._debug("trying sse transport"),this._transport=new h.SseTransport(_,{eventsource:s,fetch:n,emulationEndpoint:this._config.emulationEndpoint}),!this._transport.supported()){this._debug("sse transport not available"),this._currentTransportIndex++,r++;continue}}else{if("sockjs"!==d)throw new Error("unknown transport "+d);if(this._debug("trying sockjs"),this._transport=new o.SockjsTransport(_,{sockjs:t,sockjsOptions:this._config.sockjsOptions}),!this._transport.supported()){this._debug("sockjs transport not available"),this._currentTransportIndex++,r++;continue}}break}}else{if((0,d.startsWith)(this._endpoint,"http"))throw new Error("Provide explicit transport endpoints configuration in case of using HTTP (i.e. using array of TransportEndpoint instead of a single string), or use ws(s):// scheme in an endpoint if you aimed using WebSocket transport");if(this._debug("client will use websocket"),this._transport=new c.WebsocketTransport(this._endpoint,{websocket:e}),!this._transport.supported())throw new Error("WebSocket not available")}const l=this;let _,p=!1,b=!0;"sse"===this._transport.name()&&(b=!1);const f=[];if(this._transport.emulation()){const e=l._sendConnect(!0);if(f.push(e),b){const e=l._sendSubscribeCommands(!0,!0);for(const t in e)f.push(e[t])}}const m=this._encoder.encodeCommands(f);this._transport.initialize(this._config.protocol,{onOpen:function(){p=!0,_=l._transport.subName(),l._debug(_,"transport open"),l._transportWasOpen=!0,l._transportClosed=!1,l._transport.emulation()||(l.startBatching(),l._sendConnect(!1),b&&l._sendSubscribeCommands(!0,!1),l.stopBatching())},onError:function(e){l._debug("transport level error",e)},onClose:function(e){l._debug(l._transport.name(),"transport closed"),l._transportClosed=!0;let t="connection closed",s=!0,n=0;if(e&&"code"in e&&e.code&&(n=e.code),e&&e.reason)try{const n=JSON.parse(e.reason);t=n.reason,s=n.reconnect}catch(i){t=e.reason,(n>=3500&&n<4e3||n>=4500&&n<5e3)&&(s=!1)}n<3e3?(1009===n?(n=r.disconnectedCodes.messageSizeLimit,t="message size limit exceeded",s=!1):(n=r.connectingCodes.transportClosed,t="transport closed"),l._emulation&&!l._transportWasOpen&&(l._currentTransportIndex++,l._currentTransportIndex>=l._transports.length&&(l._triedAllTransports=!0,l._currentTransportIndex=0))):l._transportWasOpen=!0;let i=!1;if(!l._emulation||l._transportWasOpen||l._triedAllTransports||(i=!0),l._isConnecting()&&!p&&l.emit("error",{type:"transport",error:{code:r.errorCodes.transportClosed,message:"transport closed"},transport:l._transport.name()}),l._disconnect(n,t,s),l._isConnecting()){let e=l._getReconnectDelay();i&&(e=0),l._debug("reconnect after "+e+" milliseconds"),l._reconnectTimeout=setTimeout((()=>{l._startReconnecting()}),e)}},onMessage:function(e){l._dataReceived(e)}},m)}_sendConnect(e){const t=this._constructConnectCommand(),s=this;return this._call(t,e).then((e=>{const t=e.reply.connect;s._connectResponse(t),e.next&&e.next()}),(e=>{s._connectError(e.error),e.next&&e.next()})),t}_startReconnecting(){if(!this._isConnecting())return;if(!(this._refreshRequired||!this._token&&null!==this._config.getToken))return void this._initializeTransport();const e=this;this._getToken().then((function(t){e._isConnecting()&&(t?(e._token=t,e._debug("connection token refreshed"),e._initializeTransport()):e._failUnauthorized())})).catch((function(t){if(!e._isConnecting())return;e.emit("error",{type:"connectToken",error:{code:r.errorCodes.clientConnectToken,message:void 0!==t?t.toString():""}});const s=e._getReconnectDelay();e._debug("error on connection token refresh, reconnect after "+s+" milliseconds",t),e._reconnectTimeout=setTimeout((()=>{e._startReconnecting()}),s)}))}_connectError(e){this.state===_.State.Connecting&&(109===e.code&&(this._refreshRequired=!0),e.code<100||!0===e.temporary||109===e.code?(this.emit("error",{type:"connect",error:e}),this._transport&&!this._transportClosed&&(this._transportClosed=!0,this._transport.close())):this._disconnect(e.code,e.message,!1))}_constructConnectCommand(){const e={};this._token&&(e.token=this._token),this._config.data&&(e.data=this._config.data),this._config.name&&(e.name=this._config.name),this._config.version&&(e.version=this._config.version);const t={};let s=!1;for(const e in this._serverSubs)if(this._serverSubs.hasOwnProperty(e)&&this._serverSubs[e].recoverable){s=!0;const n={recover:!0};this._serverSubs[e].offset&&(n.offset=this._serverSubs[e].offset),this._serverSubs[e].epoch&&(n.epoch=this._serverSubs[e].epoch),t[e]=n}return s&&(e.subs=t),{connect:e}}_getHistoryRequest(e,t){const s={channel:e};return void 0!==t&&(t.since&&(s.since={offset:t.since.offset},t.since.epoch&&(s.since.epoch=t.since.epoch)),void 0!==t.limit&&(s.limit=t.limit),!0===t.reverse&&(s.reverse=!0)),s}_methodCall(){return this._isConnected()?Promise.resolve():new Promise(((e,t)=>{const s=setTimeout((function(){t({code:r.errorCodes.timeout,message:"timeout"})}),this._config.timeout);this._promises[this._nextPromiseId()]={timeout:s,resolve:e,reject:t}}))}_callPromise(e,t){return new Promise(((s,n)=>{this._call(e,!1).then((e=>{s(t(e.reply)),e.next&&e.next()}),(e=>{n(e.error),e.next&&e.next()}))}))}_dataReceived(e){this._serverPing>0&&this._waitServerPing();const t=this._decoder.decodeReplies(e);this._dispatchPromise=this._dispatchPromise.then((()=>{let e;this._dispatchPromise=new Promise((t=>{e=t})),this._dispatchSynchronized(t,e)}))}_dispatchSynchronized(e,t){let s=Promise.resolve();for(const t in e)e.hasOwnProperty(t)&&(s=s.then((()=>this._dispatchReply(e[t]))));s=s.then((()=>{t()}))}_dispatchReply(e){let t;const s=new Promise((e=>{t=e}));if(null==e)return this._debug("dispatch: got undefined or null reply"),t(),s;const n=e.id;return n&&n>0?this._handleReply(e,t):e.push?this._handlePush(e.push,t):this._handleServerPing(t),s}_call(e,t){return new Promise(((s,n)=>{e.id=this._nextCommandId(),this._registerCall(e.id,s,n),t||this._addCommand(e)}))}_startConnecting(){this._debug("start connecting"),this._setState(_.State.Connecting)&&this.emit("connecting",{code:r.connectingCodes.connectCalled,reason:"connect called"}),this._client=null,this._startReconnecting()}_disconnect(e,t,s){if(this._isDisconnected())return;const n=this.state,i={code:e,reason:t};let o=!1;s?o=this._setState(_.State.Connecting):(o=this._setState(_.State.Disconnected),this._rejectPromises({code:r.errorCodes.clientDisconnected,message:"disconnected"})),this._clearOutgoingRequests(),n===_.State.Connecting&&this._clearReconnectTimeout(),n===_.State.Connected&&this._clearConnectedState(),o&&(this._isConnecting()?this.emit("connecting",i):this.emit("disconnected",i)),this._transport&&!this._transportClosed&&(this._transportClosed=!0,this._transport.close())}_failUnauthorized(){this._disconnect(r.disconnectedCodes.unauthorized,"unauthorized",!1)}_getToken(){if(this._debug("get connection token"),!this._config.getToken)throw new Error("provide a function to get connection token");return this._config.getToken({})}_refresh(){const e=this._client,t=this;this._getToken().then((function(s){if(e!==t._client)return;if(!s)return void t._failUnauthorized();if(t._token=s,t._debug("connection token refreshed"),!t._isConnected())return;const n={refresh:{token:t._token}};t._call(n,!1).then((e=>{const s=e.reply.refresh;t._refreshResponse(s),e.next&&e.next()}),(e=>{t._refreshError(e.error),e.next&&e.next()}))})).catch((function(e){t.emit("error",{type:"refreshToken",error:{code:r.errorCodes.clientRefreshToken,message:void 0!==e?e.toString():""}}),t._refreshTimeout=setTimeout((()=>t._refresh()),t._getRefreshRetryDelay())}))}_refreshError(e){e.code<100||!0===e.temporary?(this.emit("error",{type:"refresh",error:e}),this._refreshTimeout=setTimeout((()=>this._refresh()),this._getRefreshRetryDelay())):this._disconnect(e.code,e.message,!1)}_getRefreshRetryDelay(){return(0,d.backoff)(0,5e3,1e4)}_refreshResponse(e){this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),e.expires&&(this._client=e.client,this._refreshTimeout=setTimeout((()=>this._refresh()),(0,d.ttlMilliseconds)(e.ttl)))}_removeSubscription(e){null!==e&&delete this._subs[e.channel]}_unsubscribe(e){if(!this._isConnected())return;const t={unsubscribe:{channel:e.channel}},s=this;this._call(t,!1).then((e=>{e.next&&e.next()}),(e=>{e.next&&e.next(),s._disconnect(r.connectingCodes.unsubscribeError,"unsubscribe error",!0)}))}_getSub(e){const t=this._subs[e];return t||null}_isServerSub(e){return void 0!==this._serverSubs[e]}_sendSubscribeCommands(e,t){const s=[];for(const n in this._subs){if(!this._subs.hasOwnProperty(n))continue;const i=this._subs[n];if(!0!==i._inflight&&i.state===_.SubscriptionState.Subscribing){const n=i._subscribe(e,t);n&&s.push(n)}}return s}_connectResponse(e){if(this._transportWasOpen=!0,this._reconnectAttempts=0,this._refreshRequired=!1,this._isConnected())return;this._client=e.client,this._setState(_.State.Connected),this._refreshTimeout&&clearTimeout(this._refreshTimeout),e.expires&&(this._refreshTimeout=setTimeout((()=>this._refresh()),(0,d.ttlMilliseconds)(e.ttl))),this._session=e.session,this._node=e.node,this.startBatching(),this._sendSubscribeCommands(!1,!1),this.stopBatching();const t={client:e.client,transport:this._transport.subName()};e.data&&(t.data=e.data),this.emit("connected",t),this._resolvePromises(),this._processServerSubs(e.subs||{}),e.ping&&e.ping>0?(this._serverPing=1e3*e.ping,this._sendPong=!0===e.pong,this._waitServerPing()):this._serverPing=0}_processServerSubs(e){for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];this._serverSubs[t]={offset:s.offset,epoch:s.epoch,recoverable:s.recoverable||!1};const n=this._getSubscribeContext(t,s);this.emit("subscribed",n)}for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];if(s.recovered){const e=s.publications;if(e&&e.length>0)for(const s in e)e.hasOwnProperty(s)&&this._handlePublication(t,e[s])}}for(const t in this._serverSubs)this._serverSubs.hasOwnProperty(t)&&(e[t]||(this.emit("unsubscribed",{channel:t}),delete this._serverSubs[t]))}_clearRefreshTimeout(){null!==this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null)}_clearReconnectTimeout(){null!==this._reconnectTimeout&&(clearTimeout(this._reconnectTimeout),this._reconnectTimeout=null)}_clearServerPingTimeout(){null!==this._serverPingTimeout&&(clearTimeout(this._serverPingTimeout),this._serverPingTimeout=null)}_waitServerPing(){0!==this._config.maxServerPingDelay&&this._isConnected()&&(this._clearServerPingTimeout(),this._serverPingTimeout=setTimeout((()=>{this._isConnected()&&this._disconnect(r.connectingCodes.noPing,"no ping",!0)}),this._serverPing+this._config.maxServerPingDelay))}_getSubscribeContext(e,t){const s={channel:e,positioned:!1,recoverable:!1,wasRecovering:!1,recovered:!1};t.recovered&&(s.recovered=!0),t.positioned&&(s.positioned=!0),t.recoverable&&(s.recoverable=!0),t.was_recovering&&(s.wasRecovering=!0);let n="";"epoch"in t&&(n=t.epoch);let i=0;return"offset"in t&&(i=t.offset),(s.positioned||s.recoverable)&&(s.streamPosition={offset:i,epoch:n}),t.data&&(s.data=t.data),s}_handleReply(e,t){const s=e.id;if(!(s in this._callbacks))return void t();const n=this._callbacks[s];if(clearTimeout(this._callbacks[s].timeout),delete this._callbacks[s],(0,d.errorExists)(e)){const s=n.errback;if(!s)return void t();s({error:e.error,next:t})}else{const s=n.callback;if(!s)return;s({reply:e,next:t})}}_handleJoin(e,t){const s=this._getSub(e);if(s)s._handleJoin(t);else if(this._isServerSub(e)){const s={channel:e,info:this._getJoinLeaveContext(t.info)};this.emit("join",s)}}_handleLeave(e,t){const s=this._getSub(e);if(s)s._handleLeave(t);else if(this._isServerSub(e)){const s={channel:e,info:this._getJoinLeaveContext(t.info)};this.emit("leave",s)}}_handleUnsubscribe(e,t){const s=this._getSub(e);s?t.code<2500?s._setUnsubscribed(t.code,t.reason,!1):s._setSubscribing(t.code,t.reason):this._isServerSub(e)&&(delete this._serverSubs[e],this.emit("unsubscribed",{channel:e}))}_handleSubscribe(e,t){this._serverSubs[e]={offset:t.offset,epoch:t.epoch,recoverable:t.recoverable||!1},this.emit("subscribed",this._getSubscribeContext(e,t))}_handleDisconnect(e){const t=e.code;let s=!0;(t>=3500&&t<4e3||t>=4500&&t<5e3)&&(s=!1),this._disconnect(t,e.reason,s)}_getPublicationContext(e,t){const s={channel:e,data:t.data};return t.offset&&(s.offset=t.offset),t.info&&(s.info=this._getJoinLeaveContext(t.info)),t.tags&&(s.tags=t.tags),s}_getJoinLeaveContext(e){const t={client:e.client,user:e.user};return e.conn_info&&(t.connInfo=e.conn_info),e.chan_info&&(t.chanInfo=e.chan_info),t}_handlePublication(e,t){const s=this._getSub(e);if(s)s._handlePublication(t);else if(this._isServerSub(e)){const s=this._getPublicationContext(e,t);this.emit("publication",s),void 0!==t.offset&&(this._serverSubs[e].offset=t.offset)}}_handleMessage(e){this.emit("message",{data:e.data})}_handleServerPing(e){if(this._sendPong){const e={};this._transportSendCommands([e])}e()}_handlePush(e,t){const s=e.channel;e.pub?this._handlePublication(s,e.pub):e.message?this._handleMessage(e.message):e.join?this._handleJoin(s,e.join):e.leave?this._handleLeave(s,e.leave):e.unsubscribe?this._handleUnsubscribe(s,e.unsubscribe):e.subscribe?this._handleSubscribe(s,e.subscribe):e.disconnect&&this._handleDisconnect(e.disconnect),t()}_flush(){const e=this._commands.slice(0);this._commands=[],this._transportSendCommands(e)}_createErrorObject(e,t,s){const n={code:e,message:t};return s&&(n.temporary=!0),n}_registerCall(e,t,s){this._callbacks[e]={callback:t,errback:s,timeout:null},this._callbacks[e].timeout=setTimeout((()=>{delete this._callbacks[e],(0,d.isFunction)(s)&&s({error:this._createErrorObject(r.errorCodes.timeout,"timeout")})}),this._config.timeout)}_addCommand(e){this._batching?this._commands.push(e):this._transportSendCommands([e])}_nextPromiseId(){return++this._promiseId}_resolvePromises(){for(const e in this._promises)this._promises[e].timeout&&clearTimeout(this._promises[e].timeout),this._promises[e].resolve(),delete this._promises[e]}_rejectPromises(e){for(const t in this._promises)this._promises[t].timeout&&clearTimeout(this._promises[t].timeout),this._promises[t].reject(e),delete this._promises[t]}}t.Centrifuge=f,f.SubscriptionState=_.SubscriptionState,f.State=_.State},74061:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsubscribedCodes=t.subscribingCodes=t.disconnectedCodes=t.connectingCodes=t.errorCodes=void 0,t.errorCodes={timeout:1,transportClosed:2,clientDisconnected:3,clientClosed:4,clientConnectToken:5,clientRefreshToken:6,subscriptionUnsubscribed:7,subscriptionSubscribeToken:8,subscriptionRefreshToken:9,transportWriteError:10,connectionClosed:11},t.connectingCodes={connectCalled:0,transportClosed:1,noPing:2,subscribeTimeout:3,unsubscribeError:4},t.disconnectedCodes={disconnectCalled:0,unauthorized:1,badProtocol:2,messageSizeLimit:3},t.subscribingCodes={subscribeCalled:0,transportClosed:1},t.unsubscribedCodes={unsubscribeCalled:0,unauthorized:1,clientClosed:2}},50262:function(e,t,s){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,i)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||n(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=t.Centrifuge=void 0;const r=s(61328);Object.defineProperty(t,"Centrifuge",{enumerable:!0,get:function(){return r.Centrifuge}});const o=s(63196);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return o.Subscription}}),i(s(35027),t)},11505:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonDecoder=t.JsonEncoder=void 0;t.JsonEncoder=class{encodeCommands(e){return e.map((e=>JSON.stringify(e))).join("\n")}};t.JsonDecoder=class{decodeReplies(e){return e.trim().split("\n").map((e=>JSON.parse(e)))}}},63196:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=void 0;const i=n(s(50343)),r=s(74061),o=s(35027),c=s(51422);class a extends i.default{constructor(e,t,s){super(),this._resubscribeTimeout=null,this._refreshTimeout=null,this.channel=t,this.state=o.SubscriptionState.Unsubscribed,this._centrifuge=e,this._token=null,this._getToken=null,this._data=null,this._recover=!1,this._offset=null,this._epoch=null,this._recoverable=!1,this._positioned=!1,this._joinLeave=!1,this._minResubscribeDelay=500,this._maxResubscribeDelay=2e4,this._resubscribeTimeout=null,this._resubscribeAttempts=0,this._promises={},this._promiseId=0,this._inflight=!1,this._refreshTimeout=null,this._setOptions(s),this._centrifuge._debugEnabled?(this.on("state",(e=>{this._centrifuge._debug("subscription state",t,e.oldState,"->",e.newState)})),this.on("error",(e=>{this._centrifuge._debug("subscription error",t,e)}))):this.on("error",(function(){Function.prototype()}))}ready(e){return this.state===o.SubscriptionState.Unsubscribed?Promise.reject({code:r.errorCodes.subscriptionUnsubscribed,message:this.state}):this.state===o.SubscriptionState.Subscribed?Promise.resolve():new Promise(((t,s)=>{const n={resolve:t,reject:s};e&&(n.timeout=setTimeout((function(){s({code:r.errorCodes.timeout,message:"timeout"})}),e)),this._promises[this._nextPromiseId()]=n}))}subscribe(){this._isSubscribed()||(this._resubscribeAttempts=0,this._setSubscribing(r.subscribingCodes.subscribeCalled,"subscribe called"))}unsubscribe(){this._setUnsubscribed(r.unsubscribedCodes.unsubscribeCalled,"unsubscribe called",!0)}publish(e){const t=this;return this._methodCall().then((function(){return t._centrifuge.publish(t.channel,e)}))}presence(){const e=this;return this._methodCall().then((function(){return e._centrifuge.presence(e.channel)}))}presenceStats(){const e=this;return this._methodCall().then((function(){return e._centrifuge.presenceStats(e.channel)}))}history(e){const t=this;return this._methodCall().then((function(){return t._centrifuge.history(t.channel,e)}))}_methodCall(){return this._isSubscribed()?Promise.resolve():this._isUnsubscribed()?Promise.reject({code:r.errorCodes.subscriptionUnsubscribed,message:this.state}):new Promise(((e,t)=>{const s=setTimeout((function(){t({code:r.errorCodes.timeout,message:"timeout"})}),this._centrifuge._config.timeout);this._promises[this._nextPromiseId()]={timeout:s,resolve:e,reject:t}}))}_nextPromiseId(){return++this._promiseId}_needRecover(){return!0===this._recover}_isUnsubscribed(){return this.state===o.SubscriptionState.Unsubscribed}_isSubscribing(){return this.state===o.SubscriptionState.Subscribing}_isSubscribed(){return this.state===o.SubscriptionState.Subscribed}_setState(e){if(this.state!==e){const t=this.state;return this.state=e,this.emit("state",{newState:e,oldState:t,channel:this.channel}),!0}return!1}_usesToken(){return null!==this._token||null!==this._getToken}_clearSubscribingState(){this._resubscribeAttempts=0,this._clearResubscribeTimeout()}_clearSubscribedState(){this._clearRefreshTimeout()}_setSubscribed(e){if(!this._isSubscribing())return;this._clearSubscribingState(),e.recoverable&&(this._recover=!0,this._offset=e.offset||0,this._epoch=e.epoch||""),this._setState(o.SubscriptionState.Subscribed);const t=this._centrifuge._getSubscribeContext(this.channel,e);this.emit("subscribed",t),this._resolvePromises();const s=e.publications;if(s&&s.length>0)for(const e in s)s.hasOwnProperty(e)&&this._handlePublication(s[e]);!0===e.expires&&(this._refreshTimeout=setTimeout((()=>this._refresh()),(0,c.ttlMilliseconds)(e.ttl)))}_setSubscribing(e,t){this._isSubscribing()||(this._isSubscribed()&&this._clearSubscribedState(),this._setState(o.SubscriptionState.Subscribing)&&this.emit("subscribing",{channel:this.channel,code:e,reason:t}),this._subscribe(!1,!1))}_subscribe(e,t){if(this._centrifuge._debug("subscribing on",this.channel),this._centrifuge.state!==o.State.Connected&&!e)return this._centrifuge._debug("delay subscribe on",this.channel,"till connected"),null;if(this._usesToken()){if(this._token)return this._sendSubscribe(this._token,t);{if(e)return null;const t=this;return this._getSubscriptionToken().then((function(e){t._isSubscribing()&&(e?(t._token=e,t._sendSubscribe(e,!1)):t._failUnauthorized())})).catch((function(e){t._isSubscribing()&&(t.emit("error",{type:"subscribeToken",channel:t.channel,error:{code:r.errorCodes.subscriptionSubscribeToken,message:void 0!==e?e.toString():""}}),t._scheduleResubscribe())})),null}}return this._sendSubscribe("",t)}_sendSubscribe(e,t){const s={channel:this.channel};if(e&&(s.token=e),this._data&&(s.data=this._data),this._positioned&&(s.positioned=!0),this._recoverable&&(s.recoverable=!0),this._joinLeave&&(s.join_leave=!0),this._needRecover()){s.recover=!0;const e=this._getOffset();e&&(s.offset=e);const t=this._getEpoch();t&&(s.epoch=t)}const n={subscribe:s};return this._inflight=!0,this._centrifuge._call(n,t).then((e=>{this._inflight=!1;const t=e.reply.subscribe;this._handleSubscribeResponse(t),e.next&&e.next()}),(e=>{this._inflight=!1,this._handleSubscribeError(e.error),e.next&&e.next()})),n}_handleSubscribeError(e){this._isSubscribing()&&(e.code!==r.errorCodes.timeout?this._subscribeError(e):this._centrifuge._disconnect(r.connectingCodes.subscribeTimeout,"subscribe timeout",!0))}_handleSubscribeResponse(e){this._isSubscribing()&&this._setSubscribed(e)}_setUnsubscribed(e,t,s){this._isUnsubscribed()||(this._isSubscribed()&&(s&&this._centrifuge._unsubscribe(this),this._clearSubscribedState()),this._isSubscribing()&&this._clearSubscribingState(),this._setState(o.SubscriptionState.Unsubscribed)&&this.emit("unsubscribed",{channel:this.channel,code:e,reason:t}),this._rejectPromises({code:r.errorCodes.subscriptionUnsubscribed,message:this.state}))}_handlePublication(e){const t=this._centrifuge._getPublicationContext(this.channel,e);this.emit("publication",t),e.offset&&(this._offset=e.offset)}_handleJoin(e){const t=this._centrifuge._getJoinLeaveContext(e.info);this.emit("join",{channel:this.channel,info:t})}_handleLeave(e){const t=this._centrifuge._getJoinLeaveContext(e.info);this.emit("leave",{channel:this.channel,info:t})}_resolvePromises(){for(const e in this._promises)this._promises[e].timeout&&clearTimeout(this._promises[e].timeout),this._promises[e].resolve(),delete this._promises[e]}_rejectPromises(e){for(const t in this._promises)this._promises[t].timeout&&clearTimeout(this._promises[t].timeout),this._promises[t].reject(e),delete this._promises[t]}_scheduleResubscribe(){const e=this,t=this._getResubscribeDelay();this._resubscribeTimeout=setTimeout((function(){e._isSubscribing()&&e._subscribe(!1,!1)}),t)}_subscribeError(e){if(this._isSubscribing())if(e.code<100||109===e.code||!0===e.temporary){109===e.code&&(this._token=null);const t={channel:this.channel,type:"subscribe",error:e};this._centrifuge.state===o.State.Connected&&this.emit("error",t),this._scheduleResubscribe()}else this._setUnsubscribed(e.code,e.message,!1)}_getResubscribeDelay(){const e=(0,c.backoff)(this._resubscribeAttempts,this._minResubscribeDelay,this._maxResubscribeDelay);return this._resubscribeAttempts++,e}_setOptions(e){e&&(e.since&&(this._offset=e.since.offset,this._epoch=e.since.epoch,this._recover=!0),e.data&&(this._data=e.data),void 0!==e.minResubscribeDelay&&(this._minResubscribeDelay=e.minResubscribeDelay),void 0!==e.maxResubscribeDelay&&(this._maxResubscribeDelay=e.maxResubscribeDelay),e.token&&(this._token=e.token),e.getToken&&(this._getToken=e.getToken),!0===e.positioned&&(this._positioned=!0),!0===e.recoverable&&(this._recoverable=!0),!0===e.joinLeave&&(this._joinLeave=!0))}_getOffset(){const e=this._offset;return null!==e?e:0}_getEpoch(){const e=this._epoch;return null!==e?e:""}_clearRefreshTimeout(){null!==this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null)}_clearResubscribeTimeout(){null!==this._resubscribeTimeout&&(clearTimeout(this._resubscribeTimeout),this._resubscribeTimeout=null)}_getSubscriptionToken(){this._centrifuge._debug("get subscription token for channel",this.channel);const e={channel:this.channel},t=this._getToken;if(null===t)throw new Error("provide a function to get channel subscription token");return t(e)}_refresh(){this._clearRefreshTimeout();const e=this;this._getSubscriptionToken().then((function(t){if(!e._isSubscribed())return;if(!t)return void e._failUnauthorized();e._token=t;const s={sub_refresh:{channel:e.channel,token:t}};e._centrifuge._call(s).then((t=>{const s=t.reply.sub_refresh;e._refreshResponse(s),t.next&&t.next()}),(t=>{e._refreshError(t.error),t.next&&t.next()}))})).catch((function(t){e.emit("error",{type:"refreshToken",channel:e.channel,error:{code:r.errorCodes.subscriptionRefreshToken,message:void 0!==t?t.toString():""}}),e._refreshTimeout=setTimeout((()=>e._refresh()),e._getRefreshRetryDelay())}))}_refreshResponse(e){this._isSubscribed()&&(this._centrifuge._debug("subscription token refreshed, channel",this.channel),this._clearRefreshTimeout(),!0===e.expires&&(this._refreshTimeout=setTimeout((()=>this._refresh()),(0,c.ttlMilliseconds)(e.ttl))))}_refreshError(e){this._isSubscribed()&&(e.code<100||!0===e.temporary?(this.emit("error",{type:"refresh",channel:this.channel,error:e}),this._refreshTimeout=setTimeout((()=>this._refresh()),this._getRefreshRetryDelay())):this._setUnsubscribed(e.code,e.message,!0))}_getRefreshRetryDelay(){return(0,c.backoff)(0,1e4,2e4)}_failUnauthorized(){this._setUnsubscribed(r.unsubscribedCodes.unauthorized,"unauthorized",!0)}}t.Subscription=a},74266:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpStreamTransport=void 0;t.HttpStreamTransport=class{constructor(e,t){this.endpoint=e,this.options=t,this._abortController=null,this._utf8decoder=new TextDecoder,this._protocol="json"}name(){return"http_stream"}subName(){return"http_stream"}emulation(){return!0}_handleErrors(e){if(!e.ok)throw new Error(e.status);return e}_fetchEventTarget(e,t,s){const n=new EventTarget;return(0,e.options.fetch)(t,s).then(e._handleErrors).then((t=>{n.dispatchEvent(new Event("open"));let s="",i=0,r=new Uint8Array;const o=t.body.getReader();return new e.options.readableStream({start(t){return function c(){return o.read().then((({done:o,value:a})=>{if(o)return n.dispatchEvent(new Event("close")),void t.close();try{if("json"===e._protocol)for(s+=e._utf8decoder.decode(a);i<s.length;)if("\n"===s[i]){const e=s.substring(0,i);n.dispatchEvent(new MessageEvent("message",{data:e})),s=s.substring(i+1),i=0}else++i;else{const t=new Uint8Array(r.length+a.length);for(t.set(r),t.set(a,r.length),r=t;;){const t=e.options.decoder.decodeReply(r);if(!t.ok)break;{const e=r.slice(0,t.pos);n.dispatchEvent(new MessageEvent("message",{data:e})),r=r.slice(t.pos)}}}}catch(e){return n.dispatchEvent(new Event("error",{detail:e})),n.dispatchEvent(new Event("close")),void t.close()}c()})).catch((function(e){n.dispatchEvent(new Event("error",{detail:e})),n.dispatchEvent(new Event("close")),t.close()}))}()}})})).catch((e=>{n.dispatchEvent(new Event("error",{detail:e})),n.dispatchEvent(new Event("close"))})),n}supported(){return null!==this.options.fetch&&null!==this.options.readableStream&&"undefined"!=typeof TextDecoder&&"undefined"!=typeof AbortController&&"undefined"!=typeof EventTarget&&"undefined"!=typeof Event&&"undefined"!=typeof MessageEvent&&"undefined"!=typeof Error}initialize(e,t,s){let n,i;this._protocol=e,this._abortController=new AbortController,"json"===e?(n={Accept:"application/json","Content-Type":"application/json"},i=s):(n={Accept:"application/octet-stream","Content-Type":"application/octet-stream"},i=s);const r={method:"POST",headers:n,body:i,mode:"cors",credentials:"same-origin",cache:"no-cache",signal:this._abortController.signal},o=this._fetchEventTarget(this,this.endpoint,r);o.addEventListener("open",(()=>{t.onOpen()})),o.addEventListener("error",(e=>{this._abortController.abort(),t.onError(e)})),o.addEventListener("close",(()=>{this._abortController.abort(),t.onClose({code:4,reason:"connection closed"})})),o.addEventListener("message",(e=>{t.onMessage(e.data)}))}close(){this._abortController.abort()}send(e,t,s){let n,i;const r={session:t,node:s,data:e};"json"===this._protocol?(n={"Content-Type":"application/json"},i=JSON.stringify(r)):(n={"Content-Type":"application/octet-stream"},i=this.options.encoder.encodeEmulationRequest(r));const o={method:"POST",headers:n,body:i,mode:"cors",credentials:"same-origin",cache:"no-cache"};(0,this.options.fetch)(this.options.emulationEndpoint,o)}}},78144:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SockjsTransport=void 0;t.SockjsTransport=class{constructor(e,t){this.endpoint=e,this.options=t,this._transport=null}name(){return"sockjs"}subName(){return"sockjs-"+this._transport.transport}emulation(){return!1}supported(){return null!==this.options.sockjs}initialize(e,t){this._transport=new this.options.sockjs(this.endpoint,null,this.options.sockjsOptions),this._transport.onopen=()=>{t.onOpen()},this._transport.onerror=e=>{t.onError(e)},this._transport.onclose=e=>{t.onClose(e)},this._transport.onmessage=e=>{t.onMessage(e.data)}}close(){this._transport.close()}send(e){this._transport.send(e)}}},55804:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SseTransport=void 0;t.SseTransport=class{constructor(e,t){this.endpoint=e,this.options=t,this._protocol="json",this._transport=null,this._onClose=null}name(){return"sse"}subName(){return"sse"}emulation(){return!0}supported(){return null!==this.options.eventsource&&null!==this.options.fetch}initialize(e,t,s){let n;n=globalThis&&globalThis.document&&globalThis.document.baseURI?new URL(this.endpoint,globalThis.document.baseURI):new URL(this.endpoint),n.searchParams.append("cf_connect",s);const i=new this.options.eventsource(n.toString(),{});this._transport=i;i.onopen=function(){t.onOpen()},i.onerror=function(e){i.close(),t.onError(e),t.onClose({code:4,reason:"connection closed"})},i.onmessage=function(e){t.onMessage(e.data)},this._onClose=function(){t.onClose({code:4,reason:"connection closed"})}}close(){this._transport.close(),null!==this._onClose&&this._onClose()}send(e,t,s){const n={session:t,node:s,data:e},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),mode:"cors",credentials:"same-origin",cache:"no-cache"};(0,this.options.fetch)(this.options.emulationEndpoint,i)}}},74723:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketTransport=void 0;t.WebsocketTransport=class{constructor(e,t){this.endpoint=e,this.options=t,this._transport=null}name(){return"websocket"}subName(){return"websocket"}emulation(){return!1}supported(){return void 0!==this.options.websocket&&null!==this.options.websocket}initialize(e,t){let s="";"protobuf"===e&&(s="centrifuge-protobuf"),this._transport=""!==s?new this.options.websocket(this.endpoint,s):new this.options.websocket(this.endpoint),"protobuf"===e&&(this._transport.binaryType="arraybuffer"),this._transport.onopen=()=>{t.onOpen()},this._transport.onerror=e=>{t.onError(e)},this._transport.onclose=e=>{t.onClose(e)},this._transport.onmessage=e=>{t.onMessage(e.data)}}close(){this._transport.close()}send(e){this._transport.send(e)}}},72390:function(e,t){"use strict";var s=this&&this.__awaiter||function(e,t,s,n){return new(s||(s=Promise))((function(i,r){function o(e){try{a(n.next(e))}catch(e){r(e)}}function c(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WebtransportTransport=void 0;t.WebtransportTransport=class{constructor(e,t){this.endpoint=e,this.options=t,this._transport=null,this._stream=null,this._writer=null,this._utf8decoder=new TextDecoder,this._protocol="json"}name(){return"webtransport"}subName(){return"webtransport"}emulation(){return!1}supported(){return void 0!==this.options.webtransport&&null!==this.options.webtransport}initialize(e,t){return s(this,void 0,void 0,(function*(){let s;s=globalThis&&globalThis.document&&globalThis.document.baseURI?new URL(this.endpoint,globalThis.document.baseURI):new URL(this.endpoint),"protobuf"===e&&s.searchParams.append("cf_protocol","protobuf"),this._protocol=e;const n=new EventTarget;this._transport=new this.options.webtransport(s.toString()),this._transport.closed.then((()=>{t.onClose({code:4,reason:"connection closed"})})).catch((()=>{t.onClose({code:4,reason:"connection closed"})}));try{yield this._transport.ready}catch(e){return void this.close()}let i;try{i=yield this._transport.createBidirectionalStream()}catch(e){return void this.close()}this._stream=i,this._writer=this._stream.writable.getWriter(),n.addEventListener("close",(()=>{t.onClose({code:4,reason:"connection closed"})})),n.addEventListener("message",(e=>{t.onMessage(e.data)})),this._startReading(n),t.onOpen()}))}_startReading(e){return s(this,void 0,void 0,(function*(){const t=this._stream.readable.getReader();let s="",n=0,i=new Uint8Array;try{for(;;){const{done:r,value:o}=yield t.read();if(o.length>0)if("json"===this._protocol)for(s+=this._utf8decoder.decode(o);n<s.length;)if("\n"===s[n]){const t=s.substring(0,n);e.dispatchEvent(new MessageEvent("message",{data:t})),s=s.substring(n+1),n=0}else++n;else{const t=new Uint8Array(i.length+o.length);for(t.set(i),t.set(o,i.length),i=t;;){const t=this.options.decoder.decodeReply(i);if(!t.ok)break;{const s=i.slice(0,t.pos);e.dispatchEvent(new MessageEvent("message",{data:s})),i=i.slice(t.pos)}}}if(r)break}}catch(t){e.dispatchEvent(new Event("close"))}}))}close(){return s(this,void 0,void 0,(function*(){try{this._writer&&(yield this._writer.close()),this._transport.close()}catch(e){}}))}send(e){return s(this,void 0,void 0,(function*(){let t;t="json"===this._protocol?(new TextEncoder).encode(e+"\n"):e;try{yield this._writer.write(t)}catch(e){this.close()}}))}}},35027:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionState=t.State=void 0,function(e){e.Disconnected="disconnected",e.Connecting="connecting",e.Connected="connected"}(t.State||(t.State={})),function(e){e.Unsubscribed="unsubscribed",e.Subscribing="subscribing",e.Subscribed="subscribed"}(t.SubscriptionState||(t.SubscriptionState={}))},51422:function(e,t){"use strict";function s(e){return null!=e&&"function"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.ttlMilliseconds=t.errorExists=t.backoff=t.log=t.isFunction=t.startsWith=void 0,t.startsWith=function(e,t){return 0===e.lastIndexOf(t,0)},t.isFunction=s,t.log=function(e,t){if(globalThis.console){const n=globalThis.console[e];s(n)&&n.apply(globalThis.console,t)}},t.backoff=function(e,t,s){e>31&&(e=31);const n=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}(0,Math.min(s,t*Math.pow(2,e)));return Math.min(s,t+n)},t.errorExists=function(e){return"error"in e&&null!==e.error},t.ttlMilliseconds=function(e){return Math.min(1e3*e,2147483647)}},50343:function(e){"use strict";var t,s="object"==typeof Reflect?Reflect:null,n=s&&"function"==typeof s.apply?s.apply:function(e,t,s){return Function.prototype.apply.call(e,t,s)};t=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise((function(s,n){function i(s){e.removeListener(t,r),n(s)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",i),s([].slice.call(arguments))}b(e,t,r,{once:!0}),"error"!==t&&function(e,t,s){"function"==typeof e.on&&b(e,"error",t,s)}(e,i,{once:!0})}))},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function h(e,t,s,n){var i,r,o,h;if(c(s),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,s.listener?s.listener:s),r=e._events),o=r[t]),void 0===o)o=r[t]=s,++e._eventsCount;else if("function"==typeof o?o=r[t]=n?[s,o]:[o,s]:n?o.unshift(s):o.push(s),(i=a(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,h=u,console&&console.warn&&console.warn(h)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,s){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:s},i=u.bind(n);return i.listener=s,n.wrapFn=i,i}function d(e,t,s){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?s?[i.listener||i]:[i]:s?function(e){for(var t=new Array(e.length),s=0;s<t.length;++s)t[s]=e[s].listener||e[s];return t}(i):p(i,i.length)}function _(e){var t=this._events;if(void 0!==t){var s=t[e];if("function"==typeof s)return 1;if(void 0!==s)return s.length}return 0}function p(e,t){for(var s=new Array(t),n=0;n<t;++n)s[n]=e[n];return s}function b(e,t,s,n){if("function"==typeof e.on)n.once?e.once(t,s):e.on(t,s);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(r){n.once&&e.removeEventListener(t,i),s(r)}))}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(e){for(var t=[],s=1;s<arguments.length;s++)t.push(arguments[s]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var a=r[e];if(void 0===a)return!1;if("function"==typeof a)n(a,this,t);else{var h=a.length,u=p(a,h);for(s=0;s<h;++s)n(u[s],this,t)}return!0},r.prototype.addListener=function(e,t){return h(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return h(this,e,t,!0)},r.prototype.once=function(e,t){return c(t),this.on(e,l(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,l(this,e,t)),this},r.prototype.removeListener=function(e,t){var s,n,i,r,o;if(c(t),void 0===(n=this._events))return this;if(void 0===(s=n[e]))return this;if(s===t||s.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,s.listener||t));else if("function"!=typeof s){for(i=-1,r=s.length-1;r>=0;r--)if(s[r]===t||s[r].listener===t){o=s[r].listener,i=r;break}if(i<0)return this;0===i?s.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(s,i),1===s.length&&(n[e]=s[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,s,n;if(void 0===(s=this._events))return this;if(void 0===s.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==s[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete s[e]),this;if(0===arguments.length){var i,r=Object.keys(s);for(n=0;n<r.length;++n)"removeListener"!==(i=r[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=s[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return d(this,e,!0)},r.prototype.rawListeners=function(e){return d(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},r.prototype.listenerCount=_,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}}]);